Skip to content

[aws-cdk-pipelines] Cannot assume role by code pipeline on code pipeline action AWS CDK  #22489

Closed

Description

@chamakov

Describe the bug

Hello there,

Im receiving an error when I try to deploy a CDK template using python. The message says "XXX is not authorized to perform AssumeRole on role XXXXX (Service: AWSCodePipeline Error Code: InvalidStructureException) (module name): (short issue description)"

Im not using a constructor for the core CodePipeline but im using the examples from the documentation:

`
from aws_cdk.pipelines import CodePipeline, ShellStep, CodePipelineSource, ManualApprovalStep

Creating a pipeline with a manual approval step.

    pipeline =  CodePipeline(self, "Pipeline-IVR-" + stage, 
                    pipeline_name="Pipeline-IVR-" + stage,
                    synth=ShellStep("Synth", 
                        input=CodePipelineSource.s3(s3Bucket, "infraIVR.zip"),
                        commands=["npm install -g aws-cdk", 
                            "python -m pip install -r requirements.txt", 
                            "cdk synth"]
                    )
                )`

If I try to deploy the same package on another account all is OK

Expected Behavior

I expect to be able to deploy the base pipeline

Current Behavior

Im receiving an error when I try to deploy a CDK template using python. The message says "XXX is not authorized to perform AssumeRole on role XXXXX (Service: AWSCodePipeline Error Code: InvalidStructureException) (module name): (short issue description)"

Reproduction Steps

`
from aws_cdk.pipelines import CodePipeline, ShellStep, CodePipelineSource, ManualApprovalStep

Creating a pipeline with a manual approval step.

    pipeline =  CodePipeline(self, "Pipeline-IVR-" + stage, 
                    pipeline_name="Pipeline-IVR-" + stage,
                    synth=ShellStep("Synth", 
                        input=CodePipelineSource.s3(s3Bucket, "infraIVR.zip"),
                        commands=["npm install -g aws-cdk", 
                            "python -m pip install -r requirements.txt", 
                            "cdk synth"]
                    )
                )`

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.18.0

Framework Version

No response

Node.js Version

12.22.8

OS

Windows

Language

Python

Language Version

No response

Other information

No response

Activity

  1. added
    bugThis issue is a bug.
    needs-triageThis issue or PR still needs to be triaged.
    on Oct 13, 2022
  2. rix0rrr commented on Nov 8, 2022

    @rix0rrr
    Contributor

    If I try to deploy the same package on another account all is OK

    This isn't really a bug report but a request for assistance in debugging an account's permissions setup. That's not what GitHub issues are for, I'm converting this to a discussion and hope someone else will be able to assist you there.

  3. locked and limited conversation to collaborators on Nov 8, 2022
  4. converted this issue into a discussion #22831 on Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

@aws-cdk/pipelinesCDK Pipelines librarybugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions