Skip to content

Commit

Permalink
Merge pull request #9 from getndazn/fix-launch-template
Browse files Browse the repository at this point in the history
Fix launch template
  • Loading branch information
Michał Wieczorek authored May 28, 2020
2 parents 743c05e + d0dfbd4 commit 97c95c4
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ resource "aws_launch_template" "bastion-service-host" {
image_id = local.bastion_ami_id
instance_type = var.bastion_instance_type
key_name = var.bastion_service_host_key_name
user_data = data.template_cloudinit_config.config.rendered
user_data = base64encode(data.template_cloudinit_config.config.rendered)

iam_instance_profile {
name = element(
concat(
aws_iam_instance_profile.bastion_service_assume_role_profile.*.arn,
aws_iam_instance_profile.bastion_service_profile.*.arn,
aws_iam_instance_profile.bastion_service_assume_role_profile.*.name,
aws_iam_instance_profile.bastion_service_profile.*.name,
),
0,
)
Expand All @@ -54,6 +54,17 @@ resource "aws_launch_template" "bastion-service-host" {
lifecycle {
create_before_destroy = true
}

tags = var.tags

tag_specifications {
resource_type = "instance"
tags = var.tags
}
tag_specifications {
resource_type = "volume"
tags = var.tags
}
}

#######################################################
Expand Down Expand Up @@ -86,7 +97,7 @@ resource "aws_autoscaling_group" "bastion-service" {
launch_template {
launch_template_specification {
launch_template_id = aws_launch_template.bastion-service-host.id
version = "$$Latest"
version = "$Latest"
}

override {
Expand Down

0 comments on commit 97c95c4

Please sign in to comment.