sparse-intern-71089
06/24/2021, 12:34 PMbrave-planet-10645
06/24/2021, 12:49 PMmillions-furniture-75402
06/24/2021, 1:02 PM<appName>-<availabilityZone>
as the name.brave-planet-10645
06/24/2021, 1:13 PMmillions-furniture-75402
06/24/2021, 1:14 PMName: <appName>-<availabilityZone>
millions-furniture-75402
06/24/2021, 1:34 PMmillions-furniture-75402
06/24/2021, 1:46 PMbrave-planet-10645
06/24/2021, 5:06 PMbrave-planet-10645
06/25/2021, 11:01 AMappName
(although you can tag them whatever you want)
Then I'm getting the instances using aws.ec2.getInstances()
(worth noting that the instance data that's returned is not the same as on the aws.ec2.Instance
resource)
const myAppName = "pk-app";
let instances = pulumi.output(aws.ec2.getInstances({
instanceTags: {
appName: myAppName
}
}));
instances.ids.apply(ids => {
ids.map(id => {
new aws.cloudwatch.LogGroup(`${appName}-ec2-lg`, {
name: pulumi.interpolate`/custom/ec2/${myAppName}/${id}`,
retentionInDays: 14
})
})
});
millions-furniture-75402
06/25/2021, 9:13 PM