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

Data Source: azurerm_storage_management_policy add supports for the tier_to_archive_after_days_since_last_tier_change_greater_than #18898

Merged
merged 1 commit into from
Oct 21, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ func dataSourceStorageManagementPolicy() *pluginsdk.Resource {
Type: pluginsdk.TypeInt,
Computed: true,
},
"tier_to_archive_after_days_since_last_tier_change_greater_than": {
Type: pluginsdk.TypeInt,
Computed: true,
},
"delete_after_days_since_last_access_time_greater_than": {
Type: pluginsdk.TypeInt,
Computed: true,
Expand All @@ -126,6 +130,10 @@ func dataSourceStorageManagementPolicy() *pluginsdk.Resource {
Type: pluginsdk.TypeInt,
Computed: true,
},
"tier_to_archive_after_days_since_last_tier_change_greater_than": {
Type: pluginsdk.TypeInt,
Computed: true,
},
"change_tier_to_cool_after_days_since_creation": {
Type: pluginsdk.TypeInt,
Optional: true,
Expand All @@ -147,6 +155,10 @@ func dataSourceStorageManagementPolicy() *pluginsdk.Resource {
Type: pluginsdk.TypeInt,
Computed: true,
},
"tier_to_archive_after_days_since_last_tier_change_greater_than": {
Type: pluginsdk.TypeInt,
Computed: true,
},
"change_tier_to_cool_after_days_since_creation": {
Type: pluginsdk.TypeInt,
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ func TestAccDataSourceStorageManagementPolicy_basic(t *testing.T) {
check.That(data.ResourceName).Key("rule.0.actions.0.base_blob.#").HasValue("1"),
check.That(data.ResourceName).Key("rule.0.actions.0.base_blob.0.tier_to_cool_after_days_since_modification_greater_than").HasValue("10"),
check.That(data.ResourceName).Key("rule.0.actions.0.base_blob.0.tier_to_archive_after_days_since_modification_greater_than").HasValue("50"),
check.That(data.ResourceName).Key("rule.0.actions.0.base_blob.0.tier_to_archive_after_days_since_last_tier_change_greater_than").HasValue("10"),
check.That(data.ResourceName).Key("rule.0.actions.0.base_blob.0.delete_after_days_since_modification_greater_than").HasValue("100"),
check.That(data.ResourceName).Key("rule.0.actions.0.snapshot.#").HasValue("1"),
check.That(data.ResourceName).Key("rule.0.actions.0.snapshot.0.delete_after_days_since_creation_greater_than").HasValue("30"),
check.That(data.ResourceName).Key("rule.0.actions.0.snapshot.0.tier_to_archive_after_days_since_last_tier_change_greater_than").HasValue("10"),
check.That(data.ResourceName).Key("rule.0.actions.0.snapshot.0.change_tier_to_archive_after_days_since_creation").HasValue("10"),
),
},
})
Expand Down Expand Up @@ -91,12 +94,15 @@ resource "azurerm_storage_management_policy" "test" {
}
actions {
base_blob {
tier_to_cool_after_days_since_modification_greater_than = 10
tier_to_archive_after_days_since_modification_greater_than = 50
delete_after_days_since_modification_greater_than = 100
tier_to_cool_after_days_since_modification_greater_than = 10
tier_to_archive_after_days_since_modification_greater_than = 50
tier_to_archive_after_days_since_last_tier_change_greater_than = 10
delete_after_days_since_modification_greater_than = 100
}
snapshot {
delete_after_days_since_creation_greater_than = 30
delete_after_days_since_creation_greater_than = 30
change_tier_to_archive_after_days_since_creation = 10
tier_to_archive_after_days_since_last_tier_change_greater_than = 10
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions website/docs/d/storage_management_policy.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ The following arguments are supported:
* `tier_to_cool_after_days_since_last_access_time_greater_than` - The age in days after last access time to tier blobs to cool storage. Supports blob currently at Hot tier.
* `tier_to_archive_after_days_since_modification_greater_than` - The age in days after last modification to tier blobs to archive storage. Supports blob currently at Hot or Cool tier.
* `tier_to_archive_after_days_since_last_access_time_greater_than` - The age in days after last access time to tier blobs to archive storage. Supports blob currently at Hot or Cool tier.
* `tier_to_archive_after_days_since_last_tier_change_greater_than` - The age in days after last tier change to the blobs to skip to be archved.
* `delete_after_days_since_modification_greater_than` - The age in days after last modification to delete the blob.
* `delete_after_days_since_last_access_time_greater_than` - The age in days after last access time to delete the blob.

Expand All @@ -75,6 +76,7 @@ The following arguments are supported:
`snapshot` supports the following:

* `change_tier_to_archive_after_days_since_creation` - The age in days after creation to tier blob snapshot to archive storage.
* `tier_to_archive_after_days_since_last_tier_change_greater_than` - The age in days after last tier change to the blobs to skip to be archved.
* `change_tier_to_cool_after_days_since_creation` - The age in days after creation to tier blob snapshot to cool storage.
* `delete_after_days_since_creation_greater_than` - The age in days after creation to delete the blob snapshot.

Expand All @@ -83,6 +85,7 @@ The following arguments are supported:
`version` supports the following:

* `change_tier_to_archive_after_days_since_creation` - The age in days after creation to tier blob version to archive storage.
* `tier_to_archive_after_days_since_last_tier_change_greater_than` - The age in days after last tier change to the blobs to skip to be archved.
* `change_tier_to_cool_after_days_since_creation` - The age in days after creation to tier blob version to cool storage.
* `delete_after_days_since_creation` - The age in days after creation to delete the blob version.

Expand Down