artifactory-user is not authorized to perform: amplify:CreateBackendEnvironment on resource

0

Hi guys, Trying to use amplify cli but I am getting error, but I have amplify:CreateBackendEnvironment in the permission

I did : amplify init

? Initialize the project with the above configuration? Yes
Using default provider  awscloudformation
? Select the authentication method you want to use: AWS access keys
? accessKeyId:  ********************
? secretAccessKey:  ****************************************
? region:  us-east-2
Adding backend environment dev to AWS Amplify app: abc
🛑 User: arn:aws:iam::1234:user/artifactory-user is not authorized to perform: amplify:CreateBackendEnvironment on resource: arn:aws:amplify:us-east-2:1234:apps/abc/backendenvironments/

Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report'
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

My permissions:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "amplify:CreateApp",
                "amplify:CreateBranch",
                "amplify:CreateDeployment",
                "amplify:CreateDomainAssociation",
                "amplify:DeleteApp",
                "amplify:DeleteBranch",
                "amplify:DeleteDomainAssociation",
                "amplify:DeleteJob",
                "amplify:GetApp",
                "amplify:GetBranch",
                "amplify:GetDomainAssociation",
                "amplify:GetJob",
                "amplify:GetWebhook",
                "amplify:ListApps",
                "amplify:ListArtifacts",
                "amplify:ListBranches",
                "amplify:ListDomainAssociations",
                "amplify:ListJobs",
                "amplify:ListTagsForResource",
                "amplify:ListWebhooks",
                "amplify:StartDeployment",
                "amplify:StartJob",
                "amplify:StopJob",
                "amplify:TagResource",
                "amplify:UntagResource",
                "amplify:UpdateApp",
                "amplify:UpdateBranch",
                "amplify:UpdateDomainAssociation",
                "amplify:UpdateWebhook"
            ],
            "Resource": "*"
        }
    ]
}

I also used IAM Policy Simulator https://policysim.aws.amazon.com/home/index.jsp with my User/Role. CreateBackendEnvironment worked in simulator , but issue still exists.

Can someone please advice? Thank you

2 Antworten
3
Akzeptierte Antwort

Hello.

Reading the error contents, it seems that the action "amplify:CreateBackendEnvironment" is not set in the IAM policy.
Your shared IAM policy does not have "amplify:CreateBackendEnvironment" set, so try adding it.
https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsamplify.html

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "amplify:CreateApp",
                "amplify:CreateBranch",
                "amplify:CreateDeployment",
                "amplify:CreateDomainAssociation",
                "amplify:CreateBackendEnvironment",  <--- add
                "amplify:DeleteApp",
                "amplify:DeleteBranch",
                "amplify:DeleteDomainAssociation",
                "amplify:DeleteJob",
                "amplify:GetApp",
                "amplify:GetBranch",
                "amplify:GetDomainAssociation",
                "amplify:GetJob",
                "amplify:GetWebhook",
                "amplify:ListApps",
                "amplify:ListArtifacts",
                "amplify:ListBranches",
                "amplify:ListDomainAssociations",
                "amplify:ListJobs",
                "amplify:ListTagsForResource",
                "amplify:ListWebhooks",
                "amplify:StartDeployment",
                "amplify:StartJob",
                "amplify:StopJob",
                "amplify:TagResource",
                "amplify:UntagResource",
                "amplify:UpdateApp",
                "amplify:UpdateBranch",
                "amplify:UpdateDomainAssociation",
                "amplify:UpdateWebhook"
            ],
            "Resource": "*"
        }
    ]
}
profile picture
EXPERTE
beantwortet vor 3 Monaten
profile picture
EXPERTE
überprüft vor 2 Monaten
0

Thank you very much , I missed it

beantwortet vor 3 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen