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

Changing azurecr_name of azuredevops_serviceendpoint_azurecr in-place fails #391

Closed
schnerring opened this issue May 27, 2021 · 2 comments
Closed

Comments

@schnerring
Copy link

schnerring commented May 27, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and Azure DevOps Provider) Version

Terraform 0.15.3
azuredevops 0.1.4

Affected Resource(s)

  • azuredevops_serviceendpoint_azurecr

Debug Output

terraform plan:

# azuredevops_serviceendpoint_azurecr.devops_image_acr_sc will be updated in-place
  ~ resource "azuredevops_serviceendpoint_azurecr" "devops_image_acr_sc" {
      ~ azurecr_name              = "myacr38" -> "myacr200"
        # (13 unchanged attributes hidden)
    }

Panic Output

Error: Error updating service endpoint in Azure DevOps: Updating the endpoint data is not allowed for Azure Container Registry type Docker endpoint. Updated field: 'registryId', Old Value: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/build-rg/providers/Microsoft.ContainerRegistry/registries/myacr38', New Value: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/build-rg/providers/Microsoft.ContainerRegistry/registries/myacr200

Expected Behavior

I guess if changing the azurecr_name value in-place is not allowed, the resource should be replaced.

Actual Behavior

terraform apply crashes.

Steps to Reproduce

  1. Add azuredevops_serviceendpoint_azurecr and terraform apply
  2. Change azurecr_name of service endpoint
  3. terraform apply again
@tmeckel
Copy link
Contributor

tmeckel commented May 28, 2021

@xuzhang3 If the observation is correct, we need a ForceNew: true on the Name schema attribute.

https://www.terraform.io/docs/extend/schemas/schema-behaviors.html#forcenew

@xuzhang3
Copy link
Collaborator

@schnerring Fixed in v0.1.5. Close this issue ,feel free to open another if you have questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants