Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions packages/@aws-cdk/aws-autoscaling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ An `AutoScalingGroup` represents a number of instances on which you run your cod
pick the size of the fleet, the instance type and the OS image:

```ts
import autoscaling = require('@aws-cdk/aws-autoscaling');
import ec2 = require('@aws-cdk/aws-ec2');

new ec2.AutoScalingGroup(stack, 'ASG', {
const vpc = new ec2.VpcNetwork(stack, 'VPC', {
maxAZs: 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to limit AZs in this example, just leave new ec2.VpcNetwork(stack, 'VPC')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will remove it.

});

new autoscaling.AutoScalingGroup(stack, 'ASG', {
vpc,
instanceType: new ec2.InstanceTypePair(InstanceClass.Burstable2, InstanceSize.Micro),
machineImage: new ec2.LinuxImage({
'us-east-1': 'ami-97785bed'
})
machineImage: new ec2.AmazonLinuxImage()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a small comment explaining what this does

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will add it. The AMI does not work for us-west-2. Specifically, I got the following message.

[AWS::AutoScaling::LaunchConfiguration] asgLaunchConfig37FDE42B AMI ami-97785bed is invalid: The image id '[ami-97785bed]' does not exist (Service: AmazonAutoScaling; Status Code: 400; Error Code: ValidationError; Request ID: d9ec164e-d35c-11e8-b28a-e7ee5dc94f2f)

Hence, I think that it is more robust to ec2.AmazonLinuxImage() as an example.

});
```

Expand Down