Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added encrypted AMI info #34

Merged
merged 1 commit into from
Jun 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,49 @@ module "ec2_cluster" {

* [Basic EC2 instance](https://github.com/terraform-aws-modules/terraform-aws-ec2-instance/tree/master/examples/basic)

## Make an encrypted ami for use

This module does not sopport encrypted AMI's out of the box however it is easy enough for you to generate one for use

This example creates an encrypted image from the latest ubuntu 16.04 base image.


```hcl
resource "aws_ami_copy" "ubuntu-xenial-encrypted-ami" {
name = "ubuntu-xenial-encrypted-ami"
description = "An encrypted root ami based off ${data.aws_ami.ubuntu-xenial.id}"
source_ami_id = "${data.aws_ami.ubuntu-xenial.id}"
source_ami_region = "eu-west-2"
encrypted = "true"

tags {
Name = "ubuntu-xenial-encrypted-ami"
}
}

data "aws_ami" "encrypted-ami" {
most_recent = true

filter {
name = "name"
values = ["ubuntu-xenial-encrypted"]
}

owners = ["self"]
}

data "aws_ami" "ubuntu-xenial" {
most_recent = true
owners = ["099720109477"]

filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-*"]
}
}
```


## Limitations

* `network_interface` can't be specified together with `associate_public_ip_address`, which makes `network_interface`
Expand Down