Skip to content

Commit

Permalink
fix(aws-codedeploy): implicitly create application in ServerDeploymen…
Browse files Browse the repository at this point in the history
…tGroup

fixes #13337
  • Loading branch information
BLasan committed Mar 14, 2021
1 parent 165a3d8 commit 198c2e5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export class ServerDeploymentGroup extends ServerDeploymentGroupBase {
physicalName: props.deploymentGroupName,
});

this.application = props.application || new ServerApplication(this, 'Application');
this.application = props.application || new ServerApplication(this, this.physicalName);

this.role = props.role || new iam.Role(this, 'Role', {
assumedBy: new iam.ServicePrincipal('codedeploy.amazonaws.com'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ export = {
test.done();
},

'with creating an application implicitly'(test: Test) {
const stack = new cdk.Stack();

const deploymentGroup = new codedeploy.ServerDeploymentGroup(stack, 'MyDG', {
deploymentGroupName: 'MyDG',
});

test.notEqual(deploymentGroup, undefined);

test.done();
},

'can be imported'(test: Test) {
const stack = new cdk.Stack();

Expand All @@ -38,7 +50,7 @@ export = {
});

test.notEqual(deploymentGroup, undefined);

test.done();
},

Expand Down

0 comments on commit 198c2e5

Please sign in to comment.