-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(aws-codedeploy): Add the auto-scaling groups property to ServerD…
…eploymentGroup.
- Loading branch information
Showing
3 changed files
with
135 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
packages/@aws-cdk/aws-codedeploy/test/test.deployment-group.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { expect, haveResource } from '@aws-cdk/assert'; | ||
import autoscaling = require('@aws-cdk/aws-autoscaling'); | ||
import ec2 = require('@aws-cdk/aws-ec2'); | ||
import cdk = require('@aws-cdk/cdk'); | ||
import { Test } from 'nodeunit'; | ||
import codedeploy = require('../lib'); | ||
|
||
// tslint:disable:object-literal-key-quotes | ||
|
||
export = { | ||
'CodeDeploy Deployment Group': { | ||
"created with ASGs contains the ASG names"(test: Test) { | ||
const stack = new cdk.Stack(); | ||
|
||
const asg = new autoscaling.AutoScalingGroup(stack, 'ASG', { | ||
instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Standard3, ec2.InstanceSize.Small), | ||
machineImage: new ec2.AmazonLinuxImage(), | ||
vpc: new ec2.VpcNetwork(stack, 'VPC'), | ||
}); | ||
|
||
new codedeploy.ServerDeploymentGroup(stack, 'DeploymentGroup', { | ||
autoScalingGroups: [asg], | ||
}); | ||
|
||
expect(stack).to(haveResource('AWS::CodeDeploy::DeploymentGroup', { | ||
"AutoScalingGroups": [ | ||
{ | ||
"Ref": "ASG46ED3070", | ||
}, | ||
] | ||
})); | ||
|
||
test.done(); | ||
}, | ||
}, | ||
}; |