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 Answers
3
Accepted Answer

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
EXPERT
answered 3 months ago
profile picture
EXPERT
reviewed a month ago
0

Thank you very much , I missed it

answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions

Relevant content