Search code examples
amazon-web-servicesgithub-actionsaws-code-deploycicd

AWS CodeDeploy is not authorized to perform: codedeploy:CreateDeployment


I'm trying to do CI/CD with aws CodeDeployand and GitHub Actions from , following this tutorial.

but the following error appears when trying to create the deploy:

An error occurred (AccessDeniedException) when calling the CreateDeployment operation: User: arn:aws:iam::***:user/church-managment-bff-s3 is not authorized to perform: codedeploy:CreateDeployment on resource: arn:aws:codedeploy:sa-east-1:***:deploymentgroup:church-managment-bff/church-managment-bff-deploy-group because no identity-based policy allows the codedeploy:CreateDeployment action
Error: Process completed with exit code 254.

I believe it's a permission problem, but I'm not able to solve it, can someone please help


Solution

  • You have to add codedeploy:CreateDeployment permissions for church-managment-bff-s3 user. You can do this as an inline policy for the user in aws console:

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "VisualEditor0",
                "Effect": "Allow",
                "Action": "codedeploy:CreateDeployment",
                "Resource": "*"
            }
        ]
    }