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

feat: add subscription_tags_ignored variable #410

Closed
Closed
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
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,24 @@ Type: `map(string)`

Default: `{}`

### <a name="input_subscription_tags_ignored"></a> [subscription\_tags_ignored](#input\_subscription\_tags_ignored)

Drescription: A list of tags to ignore changes on when updating the subscription.

Example value:

```terraform
subscription_tags_ignored = [
tags["mytag"],
tags["mytag2"],
tags["mytag3"]
]
```

Type: `list(string)`

Default: `[]`

### <a name="input_subscription_update_existing"></a> [subscription\_update\_existing](#input\_subscription\_update\_existing)

Description: Whether to update an existing subscription with the supplied tags and display name.
Expand Down
1 change: 1 addition & 0 deletions main.subscription.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module "subscription" {
subscription_management_group_association_enabled = var.subscription_management_group_association_enabled
subscription_management_group_id = var.subscription_management_group_id
subscription_tags = var.subscription_tags
subscription_tags_ignored = var.subscription_tags_ignored
subscription_use_azapi = var.subscription_use_azapi
subscription_update_existing = var.subscription_update_existing
subscription_workload = var.subscription_workload
Expand Down
18 changes: 18 additions & 0 deletions modules/subscription/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,24 @@ Type: `map(string)`

Default: `{}`

### <a name="input_subscription_tags_ignored"></a> [subscription\_tags_ignored](#input\_subscription\_tags_ignored)

Drescription: A list of tags to ignore changes on when updating the subscription.

Example value:

```terraform
subscription_tags_ignored = [
tags["mytag"],
tags["mytag2"],
tags["mytag3"]
]
```

Type: `list(string)`

Default: `[]`

### <a name="input_subscription_update_existing"></a> [subscription\_update\_existing](#input\_subscription\_update\_existing)

Description: Whether to update an existing subscription with the supplied tags and display name.
Expand Down
4 changes: 4 additions & 0 deletions modules/subscription/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ resource "azurerm_subscription" "this" {
billing_scope_id = var.subscription_billing_scope
workload = var.subscription_workload
tags = var.subscription_tags

lifecycle {
ignore_changes = var.subscription_tags_ignored
}
}

# This resource ensures that we can manage the management group for the subscription
Expand Down
18 changes: 18 additions & 0 deletions modules/subscription/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,24 @@ DESCRIPTION
}
}

variable "subscription_tags_ignored" {
type = list(string)
default = []
description = <<DESCRIPTION
A list of tags to ignore changes on when updating the subscription.

Example value:

```terraform
subscription_tags_ignored = [
tags["mytag"],
tags["mytag2"],
tags["mytag3"]
]
```
DESCRIPTION
}

variable "subscription_use_azapi" {
type = bool
default = false
Expand Down
18 changes: 18 additions & 0 deletions variables.subscription.tf
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,24 @@ DESCRIPTION
default = {}
}

variable "subscription_tags_ignored" {
type = list(string)
default = []
description = <<DESCRIPTION
A list of tags to ignore changes on when updating the subscription.

Example value:

```terraform
subscription_tags_ignored = [
tags["mytag",
tags["mytag2"],
tags["mytag3"]
]
```
DESCRIPTION
}

variable "subscription_use_azapi" {
type = bool
default = false
Expand Down
Loading