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

Ignore Terraform tags managed by CDC #1202

Merged
merged 1 commit into from
Jul 29, 2024
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
36 changes: 36 additions & 0 deletions operations/template/alert.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ resource "azurerm_monitor_action_group" "notify_slack_email" {
name = "cdcti-flexion-slack-email-receiver"
email_address = var.alert_slack_email
}

# below tags are managed by CDC
lifecycle {
ignore_changes = [
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}

resource "azurerm_monitor_scheduled_query_rules_alert" "database_token_expired_alert" {
Expand Down Expand Up @@ -40,4 +58,22 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "database_token_expired_a
operator = "GreaterThan"
threshold = 1
}

# below tags are managed by CDC
lifecycle {
ignore_changes = [
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}
72 changes: 71 additions & 1 deletion operations/template/app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ resource "azurerm_container_registry" "registry" {
location = data.azurerm_resource_group.group.location
sku = "Standard"
admin_enabled = true
# below tags are managed by CDC
lifecycle {
ignore_changes = [
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}

# Create the staging service plan
Expand All @@ -15,6 +32,24 @@ resource "azurerm_service_plan" "plan" {
os_type = "Linux"
sku_name = local.higher_environment_level ? "P1v3" : "P0v3"
zone_balancing_enabled = local.higher_environment_level

# below tags are managed by CDC
lifecycle {
ignore_changes = [
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}

# Create the staging App Service
Expand Down Expand Up @@ -74,6 +109,24 @@ resource "azurerm_linux_web_app" "api" {
identity {
type = "SystemAssigned"
}

# below tags are managed by CDC
lifecycle {
ignore_changes = [
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}

resource "azurerm_monitor_autoscale_setting" "api_autoscale" {
Expand All @@ -82,7 +135,6 @@ resource "azurerm_monitor_autoscale_setting" "api_autoscale" {
location = data.azurerm_resource_group.group.location
target_resource_id = azurerm_service_plan.plan.id


profile {
name = "defaultProfile"

Expand Down Expand Up @@ -134,4 +186,22 @@ resource "azurerm_monitor_autoscale_setting" "api_autoscale" {
}
}
}

# below tags are managed by CDC
lifecycle {
ignore_changes = [
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}
15 changes: 14 additions & 1 deletion operations/template/db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,20 @@ resource "azurerm_postgresql_flexible_server" "database" {
lifecycle {
ignore_changes = [
zone,
high_availability.0.standby_availability_zone
high_availability.0.standby_availability_zone,
# below tags are managed by CDC
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}
Expand Down
18 changes: 18 additions & 0 deletions operations/template/docs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,22 @@ resource "azurerm_storage_account" "docs" {
static_website {
index_document = "index.html"
}

# below tags are managed by CDC
lifecycle {
ignore_changes = [
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}
18 changes: 18 additions & 0 deletions operations/template/key.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ resource "azurerm_key_vault" "key_storage" {
tenant_id = data.azurerm_client_config.current.tenant_id

purge_protection_enabled = false

# below tags are managed by CDC
lifecycle {
ignore_changes = [
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}

resource "azurerm_key_vault_access_policy" "allow_github_deployer" {
Expand Down
36 changes: 36 additions & 0 deletions operations/template/logs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,48 @@ resource "azurerm_log_analytics_workspace" "logs_workspace" {

resource_group_name = data.azurerm_resource_group.group.name
location = data.azurerm_resource_group.group.location

# below tags are managed by CDC
lifecycle {
ignore_changes = [
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}

resource "azurerm_log_analytics_query_pack" "application_logs_pack" {
name = "TI Application Logs"
resource_group_name = data.azurerm_resource_group.group.name
location = data.azurerm_resource_group.group.location

# below tags are managed by CDC
lifecycle {
ignore_changes = [
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}

resource "azurerm_log_analytics_query_pack_query" "application_logs" {
Expand Down
88 changes: 88 additions & 0 deletions operations/template/net.tf
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,24 @@ resource "azurerm_subnet" "resolver_outbound" {
resource "azurerm_private_dns_zone" "dns_zone" {
name = "privateintermediary.postgres.database.azure.com"
resource_group_name = data.azurerm_resource_group.group.name

# below tags are managed by CDC
lifecycle {
ignore_changes = [
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}

resource "azurerm_private_dns_zone_virtual_network_link" "db_network_link" {
Expand All @@ -113,18 +131,71 @@ resource "azurerm_private_dns_zone_virtual_network_link" "db_network_link" {
virtual_network_id = data.azurerm_virtual_network.app.id
resource_group_name = data.azurerm_resource_group.group.name
depends_on = [azurerm_subnet.database]

# below tags are managed by CDC
lifecycle {
ignore_changes = [
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}

resource "azurerm_network_security_group" "db_security_group" {
name = "database-security-group"
location = data.azurerm_resource_group.group.location
resource_group_name = data.azurerm_resource_group.group.name
# below tags are managed by CDC
lifecycle {
ignore_changes = [
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}

resource "azurerm_route_table" "database" {
name = "database-route-table"
location = data.azurerm_resource_group.group.location
resource_group_name = data.azurerm_resource_group.group.name

# below tags are managed by CDC
lifecycle {
ignore_changes = [
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}

resource "azurerm_route" "entra_internet" {
Expand Down Expand Up @@ -234,6 +305,23 @@ resource "azurerm_network_security_group" "app_security_group" {
name = "app-security-group"
location = data.azurerm_resource_group.group.location
resource_group_name = data.azurerm_resource_group.group.name
# below tags are managed by CDC
lifecycle {
ignore_changes = [
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}

resource "azurerm_network_security_rule" "App_Splunk_UF_omhsinf" {
Expand Down
Loading
Loading