bitter-zebra-93800
06/14/2020, 10:29 PM// Get latest Debian Buster AMI
const busterId = aws.getAmi({
owners: ["136693071363"],
mostRecent: true,
filters: [{
name: "name",
values: ["debian-10-amd64-*"],
}],
}, { async: true }).then(ami => ami.id);
billowy-army-68599
06/14/2020, 10:57 PMbitter-zebra-93800
06/14/2020, 10:58 PMbillowy-army-68599
06/14/2020, 11:01 PMmostRecent
in that case, launchTemplates would help here because it would mean the new ec2 instance would have the latest but it wouldn't replace the existing instancesbitter-zebra-93800
06/14/2020, 11:10 PMgentle-diamond-70147
06/15/2020, 3:57 PMdebian-10-amd64-*
filter to debian-10-amd64-YYYMMDD
or whatever the exact name is that will pin it.{ ignoreChanges: ["ami"] }
to your instance to ignore any changes that might come through the AMI lookup - https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges.{ protect: true }
to ensure that no changes (AMI or otherwise) would result in the instance being destroyed or replaced - https://www.pulumi.com/docs/intro/concepts/programming-model/#protect.bitter-zebra-93800
06/15/2020, 5:50 PM