Skip to content

Commit e4899f3

Browse files
committed
Allow specifing Ubuntu version. Change distro name to "ubuntu"
1 parent c3d6fd7 commit e4899f3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# TODO: add variables for AmazonLinux version and try for Ubuntu
44

55
locals {
6-
names = "amazonlinux,ecs,ubuntu1604"
6+
names = "amazonlinux,ecs,ubuntu"
77

88
owners = "${join(",", list(
99
var.ami_owners["amazon"],
@@ -14,7 +14,7 @@ locals {
1414
patterns = "${join(",", list(
1515
"amzn-ami-hvm-${var.ami_version_amazonlinux}-x86_64-gp2",
1616
"amzn-ami-${var.ami_version_ecs}-amazon-ecs-optimized",
17-
"ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-*"
17+
"ubuntu/images/hvm-ssd/ubuntu-${var.ami_version_ubuntu}-amd64-server-*"
1818
))}"
1919
}
2020

variables.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ variable "ami_version_ecs" {
2020
default = "*"
2121
}
2222

23+
variable "ami_version_ubuntu" {
24+
description = "Ubuntu version to get"
25+
default = "xenial-16.04"
26+
}
27+
2328
variable "distribution" {
24-
description = "Linux distribution for AWS AMI, supported: amazonlinux, ecs, ubuntu1604"
29+
description = "Linux distribution for AWS AMI, supported: amazonlinux, ecs, ubuntu"
2530
}

0 commit comments

Comments
 (0)