Skip to content

Commit ff7c321

Browse files
authored
chore : Add error classification regarding AMI authorization issue (#8529)
1 parent db9076a commit ff7c321

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/errors/errors.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ func ToReasonMessage(err error) (string, string) {
221221
if strings.Contains(err.Error(), "with an explicit deny in a service control policy") {
222222
return "Unauthorized", "User is not authorized to perform this operation due to a service control policy"
223223
}
224+
if strings.Contains(err.Error(), "not authorized for images") {
225+
return "AMIAuthorizationFailure", "User is not authorized for AMI used in instance launch"
226+
}
224227
return "Unauthorized", "User is not authorized to perform this operation because no identity-based policy allows it"
225228
}
226229
if strings.Contains(err.Error(), "iamInstanceProfile.name is invalid") {

0 commit comments

Comments
 (0)