English 中文(简体)
CDK CrossAccount Deployment AccessDenied. User doesn t have permission to call ssm:GetParameters
原标题:

I am facing issues. Trying to deploy CFN Stack in crossaccount.

I have created roles and import in my code pipeline stack.

But when I am trying to launch and comes to deploystage execution its getting error.

I am using CDK typescript.

const CrossAccountRole = iam.Role.fromRoleArn(this,  ProdCrossAccountRole , `arn:aws:iam::${props.accounts.prodaccount}:role/MyCrossAccountRole`)
 
const prodAccountRootPrincipal = new iam.AccountPrincipal(props.accounts.prodaccount);

const pipeline = new codepipeline.Pipeline(this,  MyCodePipeline , {
      pipelineName:  MyCodePipeline , // Replace with your desired pipeline name
      artifactBucket: mybucket,
      //encryptionKey: key
    });



const CRAccdeployStage = pipeline.addStage({
      stageName: props.codepipeline.crossaccountstage,
      actions: [
        new codepipeline_actions.CloudFormationCreateUpdateStackAction({
          actionName: props.codepipeline.crossaccountaction,
          stackName: props.codepipeline.crossaccountstack,
          templatePath: new codepipeline.ArtifactPath(
            buildOutput,
             CdkServerlessDemoStack.template.json , // Replace with the path to your synthesized CloudFormation template
          ),
          adminPermissions: true,
          runOrder: 1,
          role: CrossAccountRole,
          cfnCapabilities: [cdk.CfnCapabilities.ANONYMOUS_IAM],
          deploymentRole: CrossDeploymentRole,
          
        }),
      ],
    });

ERROR I FACED,

ERROR

I trust my CICD account and add administrator access policy.

Any One have Idea What I have missed?

Thank You

问题回答

I have resolved this issue at my end.

Added below policy in my cross deployment role.

new iam.PolicyStatement({
            effect: iam.Effect.ALLOW,
            actions: [
               ssm:GetParameter ,
               ssm:GetParameters ,
               ssm:GetParametersByPath ,
            ],
            resources: [
                          "arn:aws:ssm:xxxx:xxxxxxx:parameter/*",
            ],
          }),




相关问题
Mount windows shared drive to MWAA in bootscript

In MWAA startup script sudo yum install samba-client cifs-utils -y sudo mount.cifs //dev/test/drop /mnt/dev/test-o username=testuser,password= pwd ,domain=XX Executing above commonds giving error - ...

How to get Amazon Seller Central orders programmatically?

We have been manually been keying Amazon orders into our system and would like to automate it. However, I can t seem to figure out how to go about it. Their documentation is barely there. There is: ...

Using a CDN like Amazon S3 to control access to media

I want to use Amazon S3/CloudFront to store flash files. These files must be private as they will be accessed by members. This will be done by storing each file with a link to Amazon using a mysql ...

unable to connect to database on AWS

actually I have my website build with Joomla hosted on hostmonster but all Joomla website need a database support to run this database is on AWS configuration files need to be updated for that I ...

Using EC2 Load Balancing with Existing Wordpress Blog

I currently have a virtual dedicated server through Media Temple that I use to run several high traffic Wordpress blogs. Both tend to receive sudden StumbleUpon traffic surges that (I m assuming) ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

热门标签