Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CC-1993: Added user_data, user_data_replace_on_change to the ignore_changes block. #3044

Merged
merged 1 commit into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion terraform/environments/ccms-ebs/ccms-ec2-clamav.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ resource "aws_instance" "ec2_clamav" {

# Due to a bug in terraform wanting to rebuild the ec2 if more than 1 ebs block is attached, we need the lifecycle clause below
lifecycle {
ignore_changes = [ebs_block_device, root_block_device]
ignore_changes = [
ebs_block_device,
root_block_device,
user_data,
user_data_replace_on_change
]
}
user_data_replace_on_change = false
user_data = <<EOF
Expand Down
7 changes: 6 additions & 1 deletion terraform/environments/ccms-ebs/ccms-ec2-ftp.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ resource "aws_instance" "ec2_ftp" {

# Due to a bug in terraform wanting to rebuild the ec2 if more than 1 ebs block is attached, we need the lifecycle clause below
lifecycle {
ignore_changes = [ebs_block_device, root_block_device]
ignore_changes = [
ebs_block_device,
root_block_device,
user_data,
user_data_replace_on_change
]
}
user_data_replace_on_change = false
user_data = <<EOF
Expand Down
9 changes: 7 additions & 2 deletions terraform/environments/ccms-ebs/ccms-ec2-mailrelay.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ resource "aws_instance" "ec2_mailrelay" {

# Due to a bug in terraform wanting to rebuild the ec2 if more than 1 ebs block is attached, we need the lifecycle clause below
lifecycle {
ignore_changes = [ebs_block_device, root_block_device]
ignore_changes = [
ebs_block_device,
root_block_device,
user_data,
user_data_replace_on_change
]
}

user_data_replace_on_change = true
user_data_replace_on_change = false
user_data = base64encode(templatefile("./templates/ec2_user_data_mailrelay.sh", {
hostname = "mailrelay"
mp_fqdn = "${var.networking[0].business-unit}-${local.environment}.modernisation-platform.service.justice.gov.uk"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ resource "aws_instance" "ec2_accessgate" {
cpu_core_count = local.application_data.accounts[local.environment].ec2_oracle_instance_cores_accessgate
cpu_threads_per_core = local.application_data.accounts[local.environment].ec2_oracle_instance_threads_accessgate

# Due to a bug in terraform wanting to rebuild the ec2 if more than 1 ebs block is attached, we need the lifecycle clause below
# Due to a bug in terraform wanting to rebuild the ec2 if more than 1 ebs block is attached, we need the lifecycle clause below.
# Also includes ebs_optimized and cpu_core_count due to changing instance family from c5d.2xlarge to m5d.large
lifecycle {
ignore_changes = [
cpu_core_count,
ebs_block_device,
ebs_optimized,
cpu_core_count
user_data,
user_data_replace_on_change
]
}
user_data_replace_on_change = false
Expand Down
8 changes: 7 additions & 1 deletion terraform/environments/ccms-ebs/ccms-ec2-oracle_ebs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ resource "aws_instance" "ec2_oracle_ebs" {
# ignore_changes = [ebs_block_device]
#}
lifecycle {
ignore_changes = [ebs_block_device, user_data_replace_on_change, user_data, ebs_optimized, cpu_core_count]
ignore_changes = [
cpu_core_count,
ebs_block_device,
ebs_optimized,
user_data,
user_data_replace_on_change
]
}
user_data_replace_on_change = false
user_data = <<EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ resource "aws_instance" "ec2_ebsapps" {

# Due to a bug in terraform wanting to rebuild the ec2 if more than 1 ebs block is attached, we need the lifecycle clause below
lifecycle {
ignore_changes = [ebs_block_device]
ignore_changes = [
ebs_block_device,
user_data,
user_data_replace_on_change
]
}
user_data_replace_on_change = false
user_data = <<EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ resource "aws_instance" "ec2_oracle_ebs_dr" {
# ignore_changes = [ebs_block_device]
#}
lifecycle {
ignore_changes = [ebs_block_device, user_data_replace_on_change, user_data, ebs_optimized, cpu_core_count]
ignore_changes = [
cpu_core_count,
ebs_block_device,
ebs_optimized,
user_data,
user_data_replace_on_change
]
}
user_data_replace_on_change = false
user_data = <<EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ resource "aws_instance" "ec2_webgate" {
ignore_changes = [
ebs_block_device,
ebs_optimized,
cpu_core_count
cpu_core_count,
user_data,
user_data_replace_on_change
]
}
user_data_replace_on_change = false
Expand Down
Loading