in example/index-with-asg.ts [13:30]
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const vpc = new ec2.Vpc(this, 'Vpc')
const asg = new autoscaling.AutoScalingGroup(this, 'Asg', {
vpc,
instanceType: new ec2.InstanceType('t2.micro'),
machineImage: ec2.MachineImage.latestAmazonLinux({generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2}),
});
const deploymentGroup = new codedeploy.ServerDeploymentGroup(this, 'DeploymentGroup', {
autoScalingGroups: [asg]
});
const deployer = new Ec2Deployer(this, 'Deployer', {
code: Code.fromAsset('app'),
deploymentGroup,
});
}