Fix terraform build of nginx images (#4547)

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-09-10 10:26:10 -03:00 committed by GitHub
parent bf82482aeb
commit 63dfa2b77c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 97 additions and 64 deletions

View file

@ -133,9 +133,12 @@ resource "aws_spot_instance_request" "build_worker" {
subnet_id = aws_subnet.subnet_public.id
vpc_security_group_ids = [aws_security_group.allow_ssh.id]
valid_until = var.valid_until
key_name = aws_key_pair.ssh_key.key_name
spot_price = "2"
spot_type = "one-time"
ebs_optimized = true
@ -146,6 +149,7 @@ resource "aws_spot_instance_request" "build_worker" {
}
wait_for_fulfillment = true
instance_initiated_shutdown_behavior = "terminate"
associate_public_ip_address = true
@ -165,10 +169,14 @@ resource "aws_spot_instance_request" "build_worker" {
destination = "/tmp/build-nginx.sh"
}
provisioner "file" {
source = "/root/env.tfvars"
destination = "/tmp/env"
}
provisioner "remote-exec" {
inline = [
"echo Building nginx images...",
"ls /tmp",
"chmod +x /tmp/build-nginx.sh",
"sudo /tmp/build-nginx.sh",
]