diff --git a/core/src/epicli/cli/static/terraform_templates_aws/epiphany_cluster.tf.j2 b/core/src/epicli/cli/static/terraform_templates_aws/epiphany_cluster.tf.j2 index 5fd8108b7f..9ead9d53a8 100644 --- a/core/src/epicli/cli/static/terraform_templates_aws/epiphany_cluster.tf.j2 +++ b/core/src/epicli/cli/static/terraform_templates_aws/epiphany_cluster.tf.j2 @@ -11,7 +11,7 @@ ##################################################### provider "aws" { - access_key = "{{ specification.cloud.service_principal.key }}" - secret_key = "{{ specification.cloud.service_principal.secret }}" + access_key = "{{ specification.cloud.credentials.key }}" + secret_key = "{{ specification.cloud.credentials.secret }}" region = "{{ specification.cloud.region }}" } \ No newline at end of file diff --git a/core/src/epicli/cli/static/terraform_templates_aws/vm_template.tf.j2 b/core/src/epicli/cli/static/terraform_templates_aws/vm_template.tf.j2 index 645eb70aeb..ebab3d8ac3 100644 --- a/core/src/epicli/cli/static/terraform_templates_aws/vm_template.tf.j2 +++ b/core/src/epicli/cli/static/terraform_templates_aws/vm_template.tf.j2 @@ -12,7 +12,8 @@ resource "aws_autoscaling_group" "{{ specification.name }}" { - availability_zones = [{% for availability_zone in specification.availability_zones %} "{{ availability_zone }}" {% if not loop.last %}, {% endif %} {% endfor %}] + # todo: check availability zones in VPC + #availability_zones = [{% for availability_zone in specification.availability_zones %} "{{ availability_zone }}" {% if not loop.last %}, {% endif %} {% endfor %}] name = "{{ specification.name }}" max_size = "{{ specification.count }}" min_size = "{{ specification.count }}" @@ -25,8 +26,19 @@ resource "aws_autoscaling_group" "{{ specification.name }}" { ] tag { - key = "Name" - value = "{{ specification.name }}" + key = "Name" + value = "{{ specification.name }}" propagate_at_launch = "true" } + + {%- for tag in specification.tags %} + tag { + {%- for tag_key, tag_value in tag.items() %} + key = "{{ tag_key }}" + value = "{% if tag_value is defined and tag_value|length %}{{ tag_value }}{% else %}-{% endif %}" + {%- endfor %} + propagate_at_launch = "true" + } + {%- endfor %} + } \ No newline at end of file diff --git a/core/src/epicli/cli/static/terraform_templates_aws/vpc.tf.j2 b/core/src/epicli/cli/static/terraform_templates_aws/vpc.tf.j2 index 4056910605..ff46b64097 100644 --- a/core/src/epicli/cli/static/terraform_templates_aws/vpc.tf.j2 +++ b/core/src/epicli/cli/static/terraform_templates_aws/vpc.tf.j2 @@ -15,4 +15,8 @@ resource "aws_vpc" "{{ specification.name }}" { instance_tenancy = "default" enable_dns_support = "true" enable_dns_hostnames = "true" + + tags { + Name = "{{ specification.name }}" + } } \ No newline at end of file