Insufficient permissions. CloudFront UpdateDistribution permission is required to create a custom domain.

0

While I am deploying the cloud formation template that contains the resources to create the custom domain for my Cognito user pool client present in the prod AWS account. This template is run using the aws code pipeline in the execute change step it fails due to this error Insufficient permissions. CloudFront UpdateDistribution permission is required to create a custom domain. why? But for the last deployment, it was a success, now it is showing these insufficient permissions issues.

1 Answer
0

Hello.

When you set up a custom domain for your Cognito user pool, your CloudFront distribution will be associated with it.
Therefore, I think that setting the following IAM policy will eliminate the error.
https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-add-custom-domain.html

{
    "Version": "2012-10-17",
    "Statement": [
         {
            "Sid": "AllowCloudFrontUpdateDistribution",
            "Effect": "Allow",
            "Action": [
                "cloudfront:updateDistribution"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
}
profile picture
EXPERT
answered 3 months ago
  • Means what you are saying is we need check whether the user running the ci/cd will have this policy if not need to add it to him right? If policy there means what should be the issue?

  • Means what you are saying is we need check whether the user running the ci/cd will have this policy if not need to add it to him right?

    No, it is the CloudFormation service role that requires setting this policy. Since you are deploying CloudFormation with CodePipeline, you need to set an IAM policy for the CloudFormation service role. I think you set the CloudFormation service role when setting the CodePipeline deployment action, but you need to configure it for that service role.

  • Just now I checked the issue, is it possible to create the custom domain for the cognito user pool client manaully or not by giving the domain name and acm certificate it is not creating and showing an error like this, could you please help me?

    one or more alias specified for the distribution includes an incorrectly configure DNS record that points to another cloud front distribution, You must update the DNS record to correct the problem.

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