-
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
New Resource: azurerm_app_configuration
#4859
New Resource: azurerm_app_configuration
#4859
Conversation
Tests and documentation are missing as I would like to agree on the implementation first. |
Has been validated with this Terraform config:
|
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.
Hey @brennerm. This is a good start and I'm glad you asked for a design check before fleshing the rest of it out. I think moving the keys from TypeMap to TypeList is a must and then we need to add quite a few nil checks
702b264
to
b76d319
Compare
@mbfrahry I have another branch adding a new data source to get a value from an App Configuration. Are you OK with me adding these changes to this PR as both use the same App Configuration client code? Otherwise I'd create a separate PR. |
Hey @brennerm, adding it here should be fine |
Done |
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.
Hey @brennerm, this is a good start but we're missing a test and doc for this. Also, do you updating with master to fix config.go
- Terraform provider linters only allow string literals for ResourceData.Set() - switched to nested if-statements instead of string interpolation
Co-Authored-By: Matthew Frahry <mbfrahry@gmail.com>
9b7db45
to
015480a
Compare
@mbfrahry Apparently Azure allows upgrading from the How do you normally handle this? Make changing the SKU create a new resource by default or do we allow an upgrade in-place and tell the user that downgrading is not supported? |
Ohhh, that's a tricky one. We have a way to customize the diff of a resource depending on certain conditions but I don't think we should use that here. The API leaves a clear enough message on what is going on when trying to downgrade a sku that a user could act on and deal with themselves. Force newing on our end might add more confusion since we wouldn't be able to leave as helpful of a message as the api about why we need to force new when downgrading. I think leaving what to do in the hand of the user is fine here. |
the tests are failing with:
looks like you need to set the SKU on read |
be712d5
to
60eb5c4
Compare
Should be fixed. 👍 |
The schema version could be set to 0 as this is the initial version of this resource, right? |
…rennerm/terraform-provider-azurerm into brennerm-add-app-configuration-resource
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.
Hey @brennerm. I took another pass through and the tests are passing but the nil check aren't quite right. I left a comment but let me know if that doesn't make sense
|
||
"primary_read_key": { | ||
Type: schema.TypeList, | ||
MaxItems: 1, |
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 can be removed as MaxItems
is a validation check for what a user submits rather than a check that the api only returns 1 of this. This goes for MaxItems
on the blocks down below as well
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.
Just out of curiosity, I got this from resource_arm_kubernetes_cluster.go. Is there some reason why it's necessary there?
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.
Not that I'm aware! It might just be a mistake. That validation is only checked against what a user submits not what the api returns.
|
||
values := resultPage.Values() | ||
for _, value := range values { | ||
if &value == nil { |
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.
Unfortunately, this isn't the right check for nil. value
is actually fine in this case as it's just an APIKey but the individual attributes in an APIKey are pointers *
. Those need to be nil checked before pointing to them
…rennerm/terraform-provider-azurerm into brennerm-add-app-configuration-resource
Hey @brennerm. That nil check still isn't quite right. We want to still set whatever variables we have access too. I went ahead and wrote what it should look like up and merged with master since there were some tricky conflicts but for some reason I can't commit my changes to your branch. I opened a PR on your end with master changes and my three commits on top. Apologies for all the changes coming in! brennerm#1 |
@mbfrahry Understand, thought we are going with the all or nothing approach and ignore incomplete access keys which probably shouldn't happen at all. |
…guration-resource2
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.
LGTM!
azurerm_app_configuration
Thanks for your patience here @brennerm. This should go out the door in the next release |
This has been released in version 1.39.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 1.39.0"
}
# ... other configuration ... |
|
||
--- | ||
|
||
# azurerm_container_registry |
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.
Copy/paste error here? This should be # azurerm_app_configuration
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.
Correct, fixed with #5186.
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! |
This PR adds the resource
azurerm_app_configuration
that allows creating, deleting and updating Azure App Configuration instances.Related issue: #3514