Skip to content

Instantly share code, notes, and snippets.

@psantus
Created December 2, 2022 23:36
First, deploy with standard Windows AMI, then with AMI containing a snapshot of the pre-configured machine
module "autoscaling" {
#image_id = data.aws_ami.windows.id // Phase 2 : we let the Auto Scaling Group use the AMI we've juste created.
image_id = data.aws_ami.final.id // Phase 1 : use AWS' standard Windows AMI
}
# AMI to use in Phase 1
data "aws_ami" "windows" {
most_recent = true
filter {
name = "name"
values = ["Windows_Server-2022-English-Full-Base-*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
owners = ["801119661308"] # Canonical
}
# AMI to use in Phase 2
data "aws_ami" "final" {
most_recent = true
filter {
name = "name"
values = ["PowerBI-On-Premise-Gateway"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
owners = ["self"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment