-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add Backup Support to azurerm_redis_cache
#130
Conversation
Tests pass:
|
Removed the State Migration and added a test enabling, then disabling the backup:
|
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'm not overly happy about the types. I don't know what's considered conventional in MSFT/Azure world nor I have checked if this is what we do in other Azure resources, nonetheless I think it's defeating the purpose of having typed schema (and taking advantage of basic HCL/HIL validation).
azurerm/resource_arm_redis_cache.go
Outdated
Type: schema.TypeString, | ||
Optional: true, | ||
DiffSuppressFunc: ignoreCaseDiffSuppressFunc, | ||
ValidateFunc: validation.StringInSlice([]string{ |
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.
Is there any particular reason we want to have string here? Stringifyed boolean values don't look nice and break the whole point of having a (semi)typed schema IMO.
Even if the reason here is API/SDK then I think we should solve that problem and do our bit internally in the CRUD and/or DiffSuppressFunc
/StateFunc
so that the user doesn't have to deal with it.
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 was originally due to the API design - but by chatting in Slack we've managed to work around this 👍
azurerm/resource_arm_redis_cache.go
Outdated
}, true), | ||
}, | ||
"rdb_backup_frequency": { | ||
Type: schema.TypeString, |
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.
Similar question here - any reason we cannot make it TypeInt
?
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.
updated
azurerm/resource_arm_redis_cache.go
Outdated
ValidateFunc: validateRedisBackupFrequency, | ||
}, | ||
"rdb_backup_max_snapshot_count": { | ||
Type: schema.TypeString, |
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.
☝️ TypeInt
?
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.
updated
d2f6626
to
61aed53
Compare
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.
As mentioned via Slack this LGTM, as long as you can verify we don't need a state migration due to changes in the existing schema.
I've confirmed there's no state migration needed by creating a Redis instance using a build from |
Add Backup Support to `azurerm_redis_cache`
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Adds support for the backup fields:
rdb-backup-enabled
rdb-backup-frequency
rdb-backup-max-snapshot-count
rdb-storage-connection-string
Fixes #75