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

new resource: azurerm_api_management_api_tag #14453 #14711

Merged
merged 21 commits into from
Jan 12, 2022

Conversation

meilz381
Copy link
Contributor

Fix for #14453


* `api_id` - (Required) The ID of the API Management API. Changing this forces a new API Management API Tag to be created.

* `tag_name` - (Required) The name of the tag. It must be known in the API Management instance. Changing this forces a new API Management API Tag to be created.
Copy link
Collaborator

Choose a reason for hiding this comment

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

does it make sense to call this tag name? given the resource is apit_tag

Suggested change
* `tag_name` - (Required) The name of the tag. It must be known in the API Management instance. Changing this forces a new API Management API Tag to be created.
* `name` - (Required) The name of the tag. It must be known in the API Management instance. Changing this forces a new API Management API Tag to be created.

@meilz381 meilz381 marked this pull request as ready for review December 28, 2021 19:32
@katbyte
Copy link
Collaborator

katbyte commented Jan 2, 2022

Looks like we have some test failures:

------- Stdout: -------
=== RUN   TestAccApiManagementApiTag_basic
=== PAUSE TestAccApiManagementApiTag_basic
=== CONT  TestAccApiManagementApiTag_basic
    testcase.go:110: Step 1/2 error: Error running apply: exit status 1
        
        Error: assigning to Api "Api Tag: (Tag Name \"acctest-Api-Tag-211228181815017528\" / Api Name \"acctestapi-211228181815017528\" / Service Name \"acctestAM-211228181815017528\" / Resource Group \"acctestRG-211228181815017528\")": apimanagement.TagClient#AssignToAPI: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="Tag not found."
        
          with azurerm_api_management_api_tag.test,
          on terraform_plugin_test.tf line 34, in resource "azurerm_api_management_api_tag" "test":
          34: resource "azurerm_api_management_api_tag" "test" {
        
--- FAIL: TestAccApiManagementApiTag_basic (316.84s)
FAIL

@meilz381
Copy link
Contributor Author

meilz381 commented Jan 2, 2022

Thank you @katbyte for your hints and reviews. I hopefully fixed the test failures. Running the tests locally was not so straightforward since we have a management agent that adds tags to all resources.

@katbyte
Copy link
Collaborator

katbyte commented Jan 3, 2022

no worries! thats why we run them before merge 🙂 doing that again now

@katbyte
Copy link
Collaborator

katbyte commented Jan 7, 2022

Another test failure:

------- Stdout: -------
=== RUN   TestAccApiManagementApiTag_requiresImport
=== PAUSE TestAccApiManagementApiTag_requiresImport
=== CONT  TestAccApiManagementApiTag_requiresImport
    testcase.go:110: Step 2/2, expected an error with pattern, no match on: Error running pre-apply refresh: exit status 1
        
        Error: ID contained more segments than required: "/subscriptions/*******/resourceGroups/acctestRG-220105142222439592/providers/Microsoft.ApiManagement/service/acctestAM-220105142222439592/apis/acctestapi-220105142222439592/tags/acctest-Tag-220105142222439592", map[tags:acctest-Tag-220105142222439592]
        
          with azurerm_api_management_api_tag.import,
          on terraform_plugin_test.tf line 46, in resource "azurerm_api_management_api_tag" "import":
          46:   api_id = azurerm_api_management_api_tag.test.id
        
--- FAIL: TestAccApiManagementApiTag_requiresImport (353.74s)
FAIL

@meilz381
Copy link
Contributor Author

meilz381 commented Jan 7, 2022

@katbyte hopefully I managed to run and fix not only the basic test this time. 😅

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 @meilz381 - LGTM 💯

@katbyte katbyte changed the title F/api management api tag new resource: azurerm_api_management_api_tag #14453 Jan 12, 2022
@katbyte katbyte merged commit e17390b into hashicorp:main Jan 12, 2022
@github-actions github-actions bot added this to the v2.92.0 milestone Jan 12, 2022
katbyte added a commit that referenced this pull request Jan 12, 2022
@github-actions
Copy link

This functionality has been released in v2.92.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!

@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 Feb 13, 2022
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.

2 participants