-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
azurerm_storage_account
- add supports for change_feed_retention_in_days
#17130
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your implementation should be consistent with the rest of the code.
Check how delete_retention_policy, container_delete_retention_policy are implemented.
@@ -403,6 +403,12 @@ func resourceStorageAccount() *pluginsdk.Resource { | |||
Default: false, | |||
}, | |||
|
|||
"change_feed_retention_in_days": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be more like other retention_policies
example
"delete_retention_policy": {
Type: pluginsdk.TypeList,
Optional: true,
MaxItems: 1,
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"days": {
Type: pluginsdk.TypeInt,
Optional: true,
Default: 7,
ValidateFunc: validation.IntBetween(1, 365),
},
},
},
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. But the problem is that there already exists a property change_feed_enabled
. If it doesn't, we can use the same style as other retention policies, and use the presence of this block to indicate whether this policy is enabled or not.
Besides, the allowed maximum day is 14600 days (i.e. 400 years) as is stated in the swagger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug in Portal, the API can use a larger value. Also the default value used in TF is not necessarily needed to be the same as Portal.
@@ -2815,7 +2830,8 @@ func flattenBlobProperties(input storage.BlobServiceProperties) []interface{} { | |||
"cors_rule": flattenedCorsRules, | |||
"delete_retention_policy": flattenedDeletePolicy, | |||
"versioning_enabled": versioning, | |||
"change_feed_enabled": changeFeed, | |||
"change_feed_enabled": changeFeedEnabled, | |||
"change_feed_retention_in_days": changeFeedRetentionInDays, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change_feed_retention_policy
@@ -172,6 +172,8 @@ A `blob_properties` block supports the following: | |||
|
|||
* `change_feed_enabled` - (Optional) Is the blob service properties for change feed events enabled? Default to `false`. | |||
|
|||
* `change_feed_retention_in_days` - (Optional) The duration of change feed events retention in days. The possible values are between 1 and 146000 days (400 years). Setting this to null (or omit this in the configuration file) indicates an infinite retention of the change feed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A change_feed_retention_policy
block supports the following:
days
- (Optional) Specifies the number of days that the change feed should be retained, between1
and365
days. Defaults to7
.
@katbyte This test failure is also observed from the main: https://ci-oss.hashicorp.engineering/buildConfiguration/TerraformOpenSource_TerraformProviders_AzureRMPublic_AZURERM_SERVICE_PUBLIC_STORAGE/310986, which seems intermittently happen, and might be a service side issue. |
@magodo - can you open an issue with the service team and drop a link to it here for tracking? |
@katbyte The issue is opened: Azure/azure-rest-api-specs#19785 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @magodo - LGTM 🌮
This functionality has been released in v3.15.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Fix #17117
Test