-
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
azurerm_app_configuration
- support for the encrption
, local_auth_enabled
, public_network_access_enabled
, purge_protection_enabled
,and soft_delete_retention_days
properties
#17714
Conversation
a7ce29c
to
1a7b5f6
Compare
I believe this also resolves #16915 |
azurerm_app_configuration
support for more propertiesazurerm_app_configuration
support for encrption
, local_auth_enabled
, public_network_access_enabled
, purge_protection_enabled
,and soft_delete_retention_days
azurerm_app_configuration
support for encrption
, local_auth_enabled
, public_network_access_enabled
, purge_protection_enabled
,and soft_delete_retention_days
azurerm_app_configuration
- support for the encrption
, local_auth_enabled
, public_network_access_enabled
, purge_protection_enabled
,and soft_delete_retention_days
properties
…m into app_configuration_update
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.
failing test:
------- Stdout: -------
=== RUN TestAccAppConfiguration_softDeletePurgeThenRecreate
=== PAUSE TestAccAppConfiguration_softDeletePurgeThenRecreate
=== CONT TestAccAppConfiguration_softDeletePurgeThenRecreate
testcase.go:110: Step 4/5 error: Error running apply: exit status 1
Error: creating Configuration Store (Subscription: "*******"
Resource Group Name: "acctestRG-appconfig-220818172108466617"
Config Store Name: "testaccappconf220818172108466617"): polling after Create: Code="NameUnavailable" Message="The specified name is already in use." AdditionalInfo=[{"info":{"activityId":"97d8f3d1-da74-427f-a5a2-be22e2ffdcd9"},"type":"ActivityId"}]
with azurerm_app_configuration.test,
on terraform_plugin_test.tf line 15, in resource "azurerm_app_configuration" "test":
15: resource "azurerm_app_configuration" "test" {
testing_new.go:84: Error running post-test destroy, there may be dangling resources: exit status 1
Error: deleting Resource Group "acctestRG-appconfig-220818172108466617": the Resource Group still contains Resources.
Terraform is configured to check for Resources within the Resource Group when deleting the Resource Group - and
raise an error if nested Resources still exist to avoid unintentionally deleting these Resources.
Terraform has detected that the following Resources still exist within the Resource Group:
* `/subscriptions/*******/resourceGroups/acctestRG-appconfig-220818172108466617/providers/Microsoft.AppConfiguration/configurationStores/testaccappconf220818172108466617`
This feature is intended to avoid the unintentional destruction of nested Resources provisioned through some
other means (for example, an ARM Template Deployment) - as such you must either remove these Resources, or
disable this behaviour using the feature flag `prevent_deletion_if_contains_resources` within the `features`
block when configuring the Provider, for example:
provider "azurerm" {
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}
When that feature flag is set, Terraform will skip checking for any Resources within the Resource Group and
delete this using the Azure API directly (which will clear up any nested resources).
More information on the `features` block can be found in the documentation:
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs#features
--- FAIL: TestAccAppConfiguration_softDeletePurgeThenRecreate (814.75s)
FAIL
likely this is due to the delete returning too early?
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.
still have a test failure
------- Stdout: -------
=== RUN TestAccAppConfiguration_softDeletePurgeThenRecreate
=== PAUSE TestAccAppConfiguration_softDeletePurgeThenRecreate
=== CONT TestAccAppConfiguration_softDeletePurgeThenRecreate
testcase.go:110: Step 4/5 error: Error running apply: exit status 1
Error: creating Configuration Store (Subscription: "*******"
Resource Group Name: "acctestRG-appconfig-220823153556433279"
Config Store Name: "testaccappconf220823153556433279"): polling after Create: Code="NameUnavailable" Message="The specified name is already in use." AdditionalInfo=[{"info":{"activityId":"adca45ed-5098-4946-9a48-0276995f957f"},"type":"ActivityId"}]
with azurerm_app_configuration.test,
on terraform_plugin_test.tf line 15, in resource "azurerm_app_configuration" "test":
15: resource "azurerm_app_configuration" "test" {
testing_new.go:84: Error running post-test destroy, there may be dangling resources: exit status 1
Error: deleting Resource Group "acctestRG-appconfig-220823153556433279": the Resource Group still contains Resources.
Terraform is configured to check for Resources within the Resource Group when deleting the Resource Group - and
raise an error if nested Resources still exist to avoid unintentionally deleting these Resources.
Terraform has detected that the following Resources still exist within the Resource Group:
* `/subscriptions/*******/resourceGroups/acctestRG-appconfig-220823153556433279/providers/Microsoft.AppConfiguration/configurationStores/testaccappconf220823153556433279`
This feature is intended to avoid the unintentional destruction of nested Resources provisioned through some
other means (for example, an ARM Template Deployment) - as such you must either remove these Resources, or
disable this behaviour using the feature flag `prevent_deletion_if_contains_resources` within the `features`
block when configuring the Provider, for example:
provider "azurerm" {
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}
When that feature flag is set, Terraform will skip checking for any Resources within the Resource Group and
delete this using the Azure API directly (which will clear up any nested resources).
More information on the `features` block can be found in the documentation:
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs#features
--- FAIL: TestAccAppConfiguration_softDeletePurgeThenRecreate (797.64s)
FAIL
I find this is caused by service behaviour, If I PUT the same named resource right after the previous one is successfully purged, PUT will return a Now I am going to add a method in Create method to retry |
Would this not mean that this case only occurs when one rapidly deletes and then creates the resource? Would that not mean it's mostly a problem with testing and unlikely to be an issue in actual practice? |
@jason-johnson thanks for the comment.
So I think it is neccessary to support such a capability. |
…m into app_configuration_update
Blocked for this POST method checkNameAvailability is not in the generated SDK appconfiguration 2022-05-01. I have submitted an issue. |
Hi @katbyte , is it possible to merge this PR first and later add the retry checkNameAvailability after SDK is ready. As long as users don't recreate the resource shortly after the previous one is deleted, other functions works well. Actually the current provider also has the same issue (cannot recreate quickly). |
ForceNew: true, | ||
ValidateFunc: validation.IntBetween(1, 7), | ||
DiffSuppressFunc: func(_, old, new string, _ *pluginsdk.ResourceData) bool { | ||
return old == "0" |
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.
Here this is because service default value is 0 for free sku, but 7 for standard sku.
@teowa - if it returns unavailable then on delete can we not just do a state-wait on checkname until it returns free? thus ensuring the delete is complete by the time it returns? |
Yes, checkname on delete can ensure the delete is complete. Instead, checkname before create can ensure the name used in create is available and no Apart from above, currently the checkname function is blocked by SDK, can we add the checkname later and merge this PR first? I believe features added in this PR can function well (except recreation and ForceNew properties, I should add this in doc). |
That makes sense to me @teowa - could you add a comment where that fix would go, and then remove the workarounds in the tests so they fail so we know they need to be fixed? |
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 @teowa ! LGTM 🍰
This functionality has been released in v3.27.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. |
Resolves #17408 , resolves #16915
azurerm_app_configuration
support forencrption
,local_auth_enabled
,public_network_access_enabled
,purge_protection_enabled
,andsoft_delete_retention_days
properties.For
public_network_access_enabled
, find a existing PR #17549, which can be merged before this one.Reference:
purge_protection_enabled
andsoft_delete_retention_days
properties implementation in KeyVaultTest Result