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

[Resource][Data Source] ACR Scope Map and Tokens #11350

Merged
merged 5 commits into from
Apr 28, 2021

Conversation

MattiasAng
Copy link
Contributor

Supersede #9402 after email exchange with @Lucretius which didn't have time to complete it currently.
I fixed the comments from last review.

Data Source for azurerm_container_registry_token
Data Source for azurerm_container_registry_scope_map
Resource for azurerm_container_registry_token
Resource for azurerm_container_registry_scope_map
Documentation for each
Tests for each, they all pass running against my own Azure environment.
There are passwords for the token which I would like to expose but there is no way to delete them once generated so they didn't really fit into the lifecycle management of the token itself. Perhaps they might be better suited as a separate data source, similar to how we handle the SAS tokens?

Also note that these are still both preview features. As such I've vendor-included the SDK preview code and only used it in these specific preview features (see client.go)

This PR resolves #6505

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking on this pr @MattiasAng - overall this looks great and most of my comments are minor. this should be good to merge once they have been addressed

@katbyte
Copy link
Collaborator

katbyte commented Apr 27, 2021

see my comment reply left inline @MattiasAng

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this should be good to merge once the build is fix:

Run GOARCH=386 GOOS=linux go build -o 32bitbuild .
# github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/containers
azurerm/internal/services/containers/container_registry_scope_map_data_source.go:30:19: undefined: ValidateContainerRegistryName
azurerm/internal/services/containers/container_registry_scope_map_resource.go:42:19: undefined: ValidateContainerRegistryName
azurerm/internal/services/containers/container_registry_scope_map_resource.go:57:19: undefined: ValidateContainerRegistryName
azurerm/internal/services/containers/container_registry_token_data_source.go:27:19: undefined: ValidateContainerRegistryName
azurerm/internal/services/containers/container_registry_token_data_source.go:33:19: undefined: ValidateContainerRegistryName
azurerm/internal/services/containers/container_registry_token_resource.go:42:19: undefined: ValidateContainerRegistryName
azurerm/internal/services/containers/container_registry_token_resource.go:51:19: undefined: ValidateContainerRegistryName
Error: Process completed with exit code 2.

@ghost ghost removed the waiting-response label Apr 28, 2021
@MattiasAng MattiasAng requested a review from katbyte April 28, 2021 10:16
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MattiasAng - aside from 2 comments this looks good 👍

@katbyte katbyte merged commit 0f8f856 into hashicorp:master Apr 28, 2021
katbyte added a commit that referenced this pull request Apr 28, 2021
alvintang pushed a commit to alvintang/terraform-provider-azurerm that referenced this pull request Apr 29, 2021
Supersede hashicorp#9402 after email exchange with @Lucretius which didn't have time to complete it currently.
I fixed the comments from last review.

Data Source for azurerm_container_registry_token
Data Source for azurerm_container_registry_scope_map
Resource for azurerm_container_registry_token
Resource for azurerm_container_registry_scope_map
Documentation for each
Tests for each, they all pass running against my own Azure environment.
There are passwords for the token which I would like to expose but there is no way to delete them once generated so they didn't really fit into the lifecycle management of the token itself. Perhaps they might be better suited as a separate data source, similar to how we handle the SAS tokens?

Also note that these are still both preview features. As such I've vendor-included the SDK preview code and only used it in these specific preview features (see client.go)

This PR resolves hashicorp#6505
alvintang pushed a commit to alvintang/terraform-provider-azurerm that referenced this pull request Apr 29, 2021
@ghost
Copy link

ghost commented Apr 30, 2021

This has been released in version 2.57.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 = "~> 2.57.0"
}
# ... other configuration ...

@github-actions
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Azure Container Registry tokens and scope
2 participants