(codepipeline_actions): CodeDeployEcsDeployAction doesn't return the role created by default
See original GitHub issueWhat 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:
- Created 2 years ago
- Comments:11 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure, I’m busy at the moment but I would be able to take this by the end of the month.
That works.
I (incorrectly) assumed that
fromEcsDeploymentGroupAttributes
would point to the existing Deployment Group in the account, which has the correctDeploymentConfig
. Now it works as expected.