Skip to content

Commit

Permalink
Merge pull request #1434 from LBHackney-IT/enable-pre-prod-qlik-restore
Browse files Browse the repository at this point in the history
Enable pre-prod instance restore
  • Loading branch information
daroclark authored Sep 8, 2023
2 parents 8ff835a + eab6ca2 commit 7665ce3
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions terraform/modules/qlik-sense-server/13-aws-ec2-pre-prod.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,38 +90,38 @@ resource "aws_instance" "qlik_sense_pre_prod_instance" {
}
}

# resource "aws_instance" "qlik_sense_pre_prod_instance_restore_2" {
# count = !var.is_production_environment && var.is_live_environment ? 1 : 0
# ami = local.backup_ami_id_to_restore
# instance_type = "c5.4xlarge"
# subnet_id = data.aws_secretsmanager_secret_version.subnet_value_for_qlik_sense_pre_prod_instance[0].secret_string
# vpc_security_group_ids = [aws_security_group.qlik_sense.id]

# private_dns_name_options {
# enable_resource_name_dns_a_record = true
# }

# iam_instance_profile = aws_iam_instance_profile.qlik_sense.id
# disable_api_termination = true
# key_name = aws_key_pair.qlik_sense_server_key.key_name
# tags = merge(var.tags, local.ec2_tags_for_restore)
# associate_public_ip_address = false

# root_block_device {
# encrypted = true
# delete_on_termination = false
# kms_key_id = aws_kms_key.key.arn
# tags = merge(var.tags, local.ec2_tags_for_restore)
# volume_size = 1000
# volume_type = "gp3"
# }

# lifecycle {
# ignore_changes = [ami, subnet_id]
# }

# metadata_options {
# http_tokens = "required"
# http_endpoint = "enabled"
# }
# }
resource "aws_instance" "qlik_sense_pre_prod_instance_restore_2" {
count = !var.is_production_environment && var.is_live_environment ? 1 : 0
ami = local.backup_ami_id_to_restore
instance_type = "c5.4xlarge"
subnet_id = data.aws_secretsmanager_secret_version.subnet_value_for_qlik_sense_pre_prod_instance[0].secret_string
vpc_security_group_ids = [aws_security_group.qlik_sense.id]

private_dns_name_options {
enable_resource_name_dns_a_record = true
}

iam_instance_profile = aws_iam_instance_profile.qlik_sense.id
disable_api_termination = true
key_name = aws_key_pair.qlik_sense_server_key.key_name
tags = merge(var.tags, local.ec2_tags_for_restore)
associate_public_ip_address = false

root_block_device {
encrypted = true
delete_on_termination = false
kms_key_id = aws_kms_key.key.arn
tags = merge(var.tags, local.ec2_tags_for_restore)
volume_size = 1000
volume_type = "gp3"
}

lifecycle {
ignore_changes = [ami, subnet_id]
}

metadata_options {
http_tokens = "required"
http_endpoint = "enabled"
}
}

0 comments on commit 7665ce3

Please sign in to comment.