Last active
September 22, 2018 00:05
-
-
Save AlainODea/c950a02ad5a3253e8728f9207af5fc0b to your computer and use it in GitHub Desktop.
Terraform: Latest Ubuntu 16.04 LTS encrypted AMI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_ami_copy" "ubuntu-16_04-encrypted" { | |
name = "${data.aws_ami.ubuntu-16_04.name}-encrypted" | |
description = "${data.aws_ami.ubuntu-16_04.description} (encrypted)" | |
source_ami_id = "${data.aws_ami.ubuntu-16_04.id}" | |
source_ami_region = "${var.region}" | |
encrypted = true | |
tags { | |
ImageType = "encrypted-ubuntu-16_04" | |
} | |
} | |
data "aws_ami" "ubuntu-16_04" { | |
most_recent = true | |
owners = ["${var.ubuntu_account_number}"] | |
filter { | |
name = "name" | |
values = ["ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-*"] | |
} | |
} | |
variable "ubuntu_account_number" { | |
default = "099720109477" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment