M #-: OneProvision: move ami search to cluster (#1865)

Otherwise there will be duplicites for multiple hosts
This commit is contained in:
Jan Orel authored and GitHub committed 2022-03-22 09:19:56 +01:00
1 parent 88c48e2a52
commit 1bcc970ba3
2 files changed
+17 -17

No files matched your search

@@ -1,3 +1,20 @@
data "aws_ami" "ubuntu2004" {
most_recent = true
filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
owners = ["099720109477"]
}
resource "aws_vpc" "device_<%= obj['ID'] %>" {
cidr_block = "<%= provision['CIDR'] ? provision['CIDR'] : '10.0.0.0/16'%>"
@@ -1,20 +1,3 @@
data "aws_ami" "ubuntu2004" {
most_recent = true
filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
owners = ["099720109477"]
}
resource "aws_instance" "device_<%= obj['ID'] %>" {
<% if provision['AMI'] == 'default' %>