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

Deprecated ibm_resource_access_tag and replaced it with ibm_iam_access_tag. Fixed 5566 too. #5567

Merged
merged 9 commits into from
Sep 11, 2024

Conversation

luiof
Copy link
Contributor

@luiof luiof commented Aug 21, 2024

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #5566
Relates OR Closes #5522

This PR addresses #5522 and #5566

The ibm_resource_access_tag terraform resource has been deprecated and replaced with the ibm_iam_access_tag terraform resource. We just renamed it with the new name following the decision here: #5522 (comment)

With this PR we fixed the #5566 too.
Reworked the tests in order to use a resource that requires less time to be provisioned.

Output from acceptance testing:

Test about the fix in the ibm_resource_tag terraform resource about #5566

make testacc TEST=./ibm/service/globaltagging TESTARGS='-run=TestAccResourceTag_Basic -count=1'
=== RUN   TestAccResourceTag_Basic
--- PASS: TestAccResourceTag_Basic (76.64s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging   78.420s

make testacc TEST=./ibm/service/globaltagging TESTARGS='-run=TestAccResourceTag_Wait -count=1'
=== RUN   TestAccResourceTag_Wait
--- PASS: TestAccResourceTag_Wait (70.54s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging   72.340s

make testacc TEST=./ibm/service/globaltagging TESTARGS='-run=TestAccResourceTag_replace_Basic -count=1'
=== RUN   TestAccResourceTag_replace_Basic
--- PASS: TestAccResourceTag_replace_Basic (76.12s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging   77.636s
...

Test about the ibm_iam_access_tag terraform resource:

make testacc TEST=./ibm/service/globaltagging TESTARGS='-run=TestAccIamAccessTag_Basic -count=1''
=== RUN   TestAccIamAccessTag_Basic
--- PASS: TestAccIamAccessTag_Basic (30.05s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging   31.540s

make testacc TEST=./ibm/service/globaltagging  TESTARGS='-run=TestAccIamAccessTag_Usage -count=1'
=== RUN   TestAccIamAccessTag_Usage
--- PASS: TestAccIamAccessTag_Usage (101.26s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging   102.753s

We used the -count=1 flag to avoid the usage of the case.

website/docs/r/iam_access_tag.html.markdown Outdated Show resolved Hide resolved
website/docs/r/iam_access_tag.html.markdown Outdated Show resolved Hide resolved
website/docs/r/iam_access_tag.html.markdown Show resolved Hide resolved

func ResourceIBMIamAccessTag() *schema.Resource {
return &schema.Resource{
Create: resourceIBMIamAccessTagCreate,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The changes have been pushed. Can you re-check? Thank you

ibm/service/globaltagging/resource_ibm_iam_access_tag.go Outdated Show resolved Hide resolved
if len(errMap) > 0 {
output, err := json.MarshalIndent(errMap, "", " ")
log.Printf("err is %s", err)
return fmt.Errorf("[ERROR] Error while creating access tag(%s) : %s", tagName, string(output))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you upgrade the error logging mechanism as per new error framework
communicated recently Terraform slack channels
https://ibm-cloudplatform.slack.com/archives/C53NF5MB4/p1722606201652699

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The changes have been pushed. Can you re-check? Thank you

@@ -45,7 +45,7 @@ Review the argument references that you can specify for your resource.

- `resource_id` - (Required, String) The CRN of the resource on which the tags is be attached.
- `resource_type` - (Optional, String) The resource type on which the tags should be attached.
- `tag_type` - (Optional, String) Type of the tag. Supported values are: `user`, `service`, or `access`. The default value is user.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why was servicetag type removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We decided to remove the service tag due to the fact that the service tag is used in IBM internally only and only a little set of users can use it. So it should not be exposed in the documentation.

@luiof
Copy link
Contributor Author

luiof commented Sep 9, 2024

All the above changes have been addresses.
Tests:

make testacc TEST=./ibm/service/globaltagging TESTARGS='-run=TestAccIamAccessTag_Basic -count=1'

=== RUN   TestAccIamAccessTag_Basic
--- PASS: TestAccIamAccessTag_Basic (31.34s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging   32.992s
make testacc TEST=./ibm/service/globaltagging  TESTARGS='-run=TestAccIamAccessTag_Usage -count=1'
=== RUN   TestAccIamAccessTag_Usage
--- PASS: TestAccIamAccessTag_Usage (111.97s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/globaltagging   113.586s

@luiof luiof requested review from hkantare and mkrudele September 9, 2024 16:02
@hkantare hkantare merged commit 52fab34 into IBM-Cloud:master Sep 11, 2024
1 check passed
srikant-sahu pushed a commit to srikant-sahu/terraform-provider-ibm that referenced this pull request Sep 24, 2024
…s_tag. Fixed 5566 too. (IBM-Cloud#5567)

* Deprecated ibm_resource_access_tag in favor of ibm_iam_access_tag

* changes

* Fix

* Changed resource to speed up tests

* fix

* PR changes

* PR changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants