@@ -16,10 +16,8 @@ new autoscaling.AutoScalingGroup(this, 'ASG', {
16
16
vpc ,
17
17
instanceType: ec2 .InstanceType .of (ec2 .InstanceClass .BURSTABLE2 , ec2 .InstanceSize .MICRO ),
18
18
19
- // The latest Amazon Linux image of a particular generation
20
- machineImage: ec2 .MachineImage .latestAmazonLinux ({
21
- generation: ec2 .AmazonLinuxGeneration .AMAZON_LINUX_2 ,
22
- }),
19
+ // The latest Amazon Linux 2 image
20
+ machineImage: ec2 .MachineImage .latestAmazonLinux2 (),
23
21
});
24
22
```
25
23
@@ -53,9 +51,7 @@ const mySecurityGroup = new ec2.SecurityGroup(this, 'SecurityGroup', { vpc });
53
51
new autoscaling .AutoScalingGroup (this , ' ASG' , {
54
52
vpc ,
55
53
instanceType: ec2 .InstanceType .of (ec2 .InstanceClass .BURSTABLE2 , ec2 .InstanceSize .MICRO ),
56
- machineImage: ec2 .MachineImage .latestAmazonLinux ({
57
- generation: ec2 .AmazonLinuxGeneration .AMAZON_LINUX_2 ,
58
- }),
54
+ machineImage: ec2 .MachineImage .latestAmazonLinux2 (),
59
55
securityGroup: mySecurityGroup ,
60
56
});
61
57
```
@@ -577,9 +573,7 @@ new autoscaling.AutoScalingGroup(this, 'ASG', {
577
573
instanceType: ec2 .InstanceType .of (ec2 .InstanceClass .T3 , ec2 .InstanceSize .MICRO ),
578
574
579
575
// Amazon Linux 2 comes with SSM Agent by default
580
- machineImage: ec2 .MachineImage .latestAmazonLinux ({
581
- generation: ec2 .AmazonLinuxGeneration .AMAZON_LINUX_2 ,
582
- }),
576
+ machineImage: ec2 .MachineImage .latestAmazonLinux2 (),
583
577
584
578
// Turn on SSM
585
579
ssmSessionPermissions: true ,
0 commit comments