question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(codepipeline_actions): CodeDeployEcsDeployAction doesn't return the role created by default

See original GitHub issue

What is the problem?

If you create a CodeDeployEcsDeployAction and don’t pass a role as a parameter, the codepipeline will generate a default one for you (as seen in pipeline.ts). However this role cannot be retrieved from the CodeDeployEcsDeployAction object.

Reproduction Steps

    const deploymentGroup = codedeploy.EcsDeploymentGroup.fromEcsDeploymentGroupAttributes(stack, "DeploymentGroup", {
      application: EcsApplication.fromEcsApplicationName(stack, "ECSApplication", "test"),
      deploymentGroupName: "test",
    });

    const action = new codepipeline_actions.CodeDeployEcsDeployAction({
      actionName: "Deploy",
      deploymentGroup: deploymentGroup,
      taskDefinitionTemplateInput: new codepipeline.Artifact("dummy"),
      appSpecTemplateInput: new codepipeline.Artifact("dummy2"),
    });

    const pipeline = new codepipeline.Pipeline(stack, "Pipeline", {
      stages: [
        {
          stageName: "DeployECS",
          actions: [action],
        },
      ],
    });

    const actionRole = action.actionProperties.role;
    // actionRole is always undefined
    console.log(actionRole);

What did you expect to happen?

action.actionProperties.role returns the default role created by codepipeline.

What actually happened?

action.actionProperties.role is undefined.

CDK CLI Version

1.129.0

Framework Version

No response

Node.js Version

14.18.1

OS

Amazon Linux 2

Language

Typescript

Language Version

No response

Other information

No response

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
angarg12commented, Feb 8, 2022

Sure, I’m busy at the moment but I would be able to take this by the end of the month.

1reaction
angarg12commented, Feb 1, 2022

That works.

I (incorrectly) assumed that fromEcsDeploymentGroupAttributes would point to the existing Deployment Group in the account, which has the correct DeploymentConfig. Now it works as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting CodePipeline - AWS Documentation
Pipeline error: A pipeline configured with AWS Elastic Beanstalk returns an error message: "Deployment failed. The provided role does not have sufficient ...
Read more >
awslabs/aws-cdk - Gitter
"AWS CodeDeploy is a deployment service that automates application deployments to Amazon EC2 instances, on-premises instances, serverless Lambda ...
Read more >
@aws-cdk/aws-codepipeline-actions - npm
After that, you can safely abort creating or editing the pipeline - the connection has already been created. const sourceOutput = new codepipeline.Artifact() ......
Read more >
Cannot assume role by code pipeline on code pipeline action ...
My problem is, AWS CDK generates a role for the code pipeline action whose Principle is ARN of the root account. So it...
Read more >
awscodepipelineactions - Go Packages
Low-level class for generic CodePipeline Actions. ... The default role that will be created for you will have full (i.e., ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found