Skip to content

Commit

Permalink
Add launch template detailed monitoring unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
SHession committed Jul 22, 2024
1 parent ff41eec commit 296dc12
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/patterns/ec2-app/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1123,4 +1123,32 @@ UserData from accessed construct`);
},
});
});

it("set detailed monitoring on the ASG launch template when set", function () {
const stack = simpleGuStackForTesting();
new GuEc2App(stack, {
applicationPort: 3000,
app: "test-gu-ec2-app",
access: { scope: AccessScope.PUBLIC },
instanceType: InstanceType.of(InstanceClass.T4G, InstanceSize.MEDIUM),
monitoringConfiguration: { noMonitoring: true },
userData: UserData.forLinux(),
certificateProps: {
domainName: "domain-name-for-your-application.example",
},
scaling: {
minimumInstances: 1,
},
enabledDetailedInstanceMonitoring: true,
});
Template.fromStack(stack).hasResource("AWS::EC2::LaunchTemplate", {
Properties: {
LaunchTemplateData: {
Monitoring: {
Enabled: true,
},
},
},
});
});
});

0 comments on commit 296dc12

Please sign in to comment.