Skip to content

Commit 744e66d

Browse files
remove BackupPolicy tag from root_block_device (#2227)
1 parent 54725f2 commit 744e66d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

terraform/modules/qlik-sense-server/15-aws-ec2-prod.tf

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
locals {
22
backup_ami_id_prod = "ami-0a9bac68a32217ec9"
33
ec2_tags_prod = {
4-
Application = "Qlik"
4+
Application = "Qlik"
55
BackupPolicy = title(var.environment)
66
Name = "${var.identifier_prefix}-qlik-sense-restore"
77
}
88
ec2_tags_prod_restore = {
9-
Application = "Qlik"
9+
Application = "Qlik"
1010
BackupPolicy = title(var.environment)
1111
Name = "${var.identifier_prefix}-qlik-sense-restore-2"
1212
}
@@ -44,9 +44,14 @@ resource "aws_instance" "qlik_sense_prod_instance" {
4444
encrypted = true
4545
delete_on_termination = false
4646
kms_key_id = aws_kms_key.key.arn
47-
tags = merge(var.tags, local.ec2_tags_prod)
48-
volume_size = 1000
49-
volume_type = "gp3"
47+
# BackupPolicy tags will be automatically removed from volumes by cloud custodian
48+
# https://github.com/LBHackney-IT/ce-cloud-custodian/blob/be250a45b282b9bd3771cc0990a8a8e00c669888/custodian/policies/prod-ou/remove-tag-from-ebs-volumes.yaml
49+
tags = {
50+
for key, value in merge(var.tags, local.ec2_tags_prod) :
51+
key => value if key != "BackupPolicy"
52+
}
53+
volume_size = 1000
54+
volume_type = "gp3"
5055
}
5156

5257
lifecycle {

0 commit comments

Comments
 (0)