Add subnet_id parameter
This commit is contained in:
parent
f5e273d05c
commit
b1114d9b87
|
@ -59,12 +59,17 @@ function prepare_geny_aws() {
|
|||
instance=$(get_value '.instance')
|
||||
ami=$(get_value '.AMI')
|
||||
sg=$(get_value '.SG')
|
||||
subnet_id=$(get_value '.subnet_id')
|
||||
if [[ $subnet_id == null ]]; then
|
||||
subnet_id=""
|
||||
fi
|
||||
|
||||
echo $region
|
||||
echo $android_version
|
||||
echo $instance
|
||||
echo $ami
|
||||
echo $sg
|
||||
echo $subnet_id
|
||||
|
||||
#TODO: remove this dirty hack
|
||||
if [[ $android_version == null ]]; then
|
||||
|
@ -183,6 +188,11 @@ variable "instance_type_$index" {
|
|||
default = "$instance"
|
||||
}
|
||||
|
||||
variable "subnet_id_$index" {
|
||||
type = "string"
|
||||
default = "$subnet_id"
|
||||
}
|
||||
|
||||
provider "aws" {
|
||||
alias = "provider_$index"
|
||||
region = "\${var.aws_region_$index}"
|
||||
|
@ -214,6 +224,7 @@ resource "aws_instance" "geny_aws_$index" {
|
|||
provider = "aws.provider_$index"
|
||||
ami="\${data.aws_ami.geny_aws_$index.id}"
|
||||
instance_type = "\${var.instance_type_$index}"
|
||||
subnet_id = "\${var.subnet_id_$index}"
|
||||
vpc_security_group_ids=["\${aws_security_group.geny_sg_$index.name}"]
|
||||
key_name = "\${aws_key_pair.geny_key_$index.key_name}"
|
||||
tags {
|
||||
|
|
Loading…
Reference in a new issue