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

Add tags and tags_all argument to aws_ecrpublic_repository #26057

Merged

Conversation

yktakaha4
Copy link
Contributor

@yktakaha4 yktakaha4 commented Jul 30, 2022

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 #0000

Thanks for the great library!

I added the tags attribute to aws_ecrpublic_repository.
As this is my first time sending a PR to this repository, please let me know if I am not following the rules.

Implemented with reference to the contents of the ECR.

func TestAccECRRepository_tags(t *testing.T) {
var v1, v2 ecr.Repository
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_ecr_repository.test"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
CheckDestroy: testAccCheckRepositoryDestroy,
Steps: []resource.TestStep{
{
Config: testAccRepositoryConfig_tags(rName),
Check: resource.ComposeTestCheckFunc(
testAccCheckRepositoryExists(resourceName, &v1),
resource.TestCheckResourceAttr(resourceName, "name", rName),
resource.TestCheckResourceAttr(resourceName, "tags.%", "2"),
resource.TestCheckResourceAttr(resourceName, "tags.Usage", "original"),
),
},
{
Config: testAccRepositoryConfig_tagsChanged(rName),
Check: resource.ComposeTestCheckFunc(
testAccCheckRepositoryExists(resourceName, &v2),
resource.TestCheckResourceAttr(resourceName, "name", rName),
resource.TestCheckResourceAttr(resourceName, "tags.%", "1"),
resource.TestCheckResourceAttr(resourceName, "tags.Usage", "changed"),
),
},
},
})
}

Output from acceptance testing:

$ make testacc TESTS=TestAccECRPublicRepository PKG=ecrpublic 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ecrpublic/... -v -count 1 -parallel 20 -run='TestAccECRPublicRepository'  -timeout 180m
=== RUN   TestAccECRPublicRepositoryPolicy_basic
=== PAUSE TestAccECRPublicRepositoryPolicy_basic
=== RUN   TestAccECRPublicRepositoryPolicy_disappears
=== PAUSE TestAccECRPublicRepositoryPolicy_disappears
=== RUN   TestAccECRPublicRepositoryPolicy_Disappears_repository
=== PAUSE TestAccECRPublicRepositoryPolicy_Disappears_repository
=== RUN   TestAccECRPublicRepositoryPolicy_iam
=== PAUSE TestAccECRPublicRepositoryPolicy_iam
=== RUN   TestAccECRPublicRepository_basic
=== PAUSE TestAccECRPublicRepository_basic
=== RUN   TestAccECRPublicRepository_tags
=== PAUSE TestAccECRPublicRepository_tags
=== RUN   TestAccECRPublicRepository_CatalogData_aboutText
=== PAUSE TestAccECRPublicRepository_CatalogData_aboutText
=== RUN   TestAccECRPublicRepository_CatalogData_architectures
=== PAUSE TestAccECRPublicRepository_CatalogData_architectures
=== RUN   TestAccECRPublicRepository_CatalogData_description
=== PAUSE TestAccECRPublicRepository_CatalogData_description
=== RUN   TestAccECRPublicRepository_CatalogData_operatingSystems
=== PAUSE TestAccECRPublicRepository_CatalogData_operatingSystems
=== RUN   TestAccECRPublicRepository_CatalogData_usageText
=== PAUSE TestAccECRPublicRepository_CatalogData_usageText
=== RUN   TestAccECRPublicRepository_CatalogData_logoImageBlob
=== PAUSE TestAccECRPublicRepository_CatalogData_logoImageBlob
=== RUN   TestAccECRPublicRepository_Basic_forceDestroy
=== PAUSE TestAccECRPublicRepository_Basic_forceDestroy
=== RUN   TestAccECRPublicRepository_disappears
=== PAUSE TestAccECRPublicRepository_disappears
=== CONT  TestAccECRPublicRepositoryPolicy_basic
=== CONT  TestAccECRPublicRepository_CatalogData_architectures
=== CONT  TestAccECRPublicRepository_basic
=== CONT  TestAccECRPublicRepositoryPolicy_Disappears_repository
=== CONT  TestAccECRPublicRepository_disappears
=== CONT  TestAccECRPublicRepository_CatalogData_operatingSystems
=== CONT  TestAccECRPublicRepository_CatalogData_aboutText
=== CONT  TestAccECRPublicRepository_Basic_forceDestroy
=== CONT  TestAccECRPublicRepository_CatalogData_logoImageBlob
=== CONT  TestAccECRPublicRepository_CatalogData_description
=== CONT  TestAccECRPublicRepositoryPolicy_disappears
=== CONT  TestAccECRPublicRepository_tags
=== CONT  TestAccECRPublicRepositoryPolicy_iam
=== CONT  TestAccECRPublicRepository_CatalogData_usageText
--- PASS: TestAccECRPublicRepository_disappears (49.05s)
--- PASS: TestAccECRPublicRepositoryPolicy_Disappears_repository (60.93s)
--- PASS: TestAccECRPublicRepositoryPolicy_disappears (68.74s)
--- PASS: TestAccECRPublicRepository_basic (96.88s)
--- PASS: TestAccECRPublicRepository_Basic_forceDestroy (108.88s)
--- PASS: TestAccECRPublicRepository_CatalogData_logoImageBlob (117.31s)
--- PASS: TestAccECRPublicRepository_tags (136.49s)
--- PASS: TestAccECRPublicRepository_CatalogData_architectures (156.76s)
--- PASS: TestAccECRPublicRepository_CatalogData_description (158.29s)
--- PASS: TestAccECRPublicRepository_CatalogData_usageText (158.95s)
--- PASS: TestAccECRPublicRepositoryPolicy_basic (159.27s)
--- PASS: TestAccECRPublicRepository_CatalogData_operatingSystems (159.48s)
--- PASS: TestAccECRPublicRepository_CatalogData_aboutText (163.74s)
--- PASS: TestAccECRPublicRepositoryPolicy_iam (168.92s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ecrpublic  168.971s

@github-actions github-actions bot added size/L Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. generators Relates to code generators. service/ecrpublic Issues and PRs that pertain to the ecrpublic service. tags Pertains to resource tagging. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. needs-triage Waiting for first response or review from a maintainer. labels Jul 30, 2022
@yktakaha4 yktakaha4 marked this pull request as draft July 30, 2022 17:32
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @yktakaha4 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@yktakaha4 yktakaha4 marked this pull request as ready for review July 30, 2022 17:38
@ewbankkit ewbankkit added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 1, 2022
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% AWS_DEFAULT_REGION=us-east-1 make testacc TESTARGS='-run=TestAccECRPublicRepository_' PKG=ecrpublic ACCTEST_PARALLELISM=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ecrpublic/... -v -count 1 -parallel 1  -run=TestAccECRPublicRepository_ -timeout 180m
=== RUN   TestAccECRPublicRepository_basic
=== PAUSE TestAccECRPublicRepository_basic
=== RUN   TestAccECRPublicRepository_tags
=== PAUSE TestAccECRPublicRepository_tags
=== RUN   TestAccECRPublicRepository_CatalogData_aboutText
=== PAUSE TestAccECRPublicRepository_CatalogData_aboutText
=== RUN   TestAccECRPublicRepository_CatalogData_architectures
=== PAUSE TestAccECRPublicRepository_CatalogData_architectures
=== RUN   TestAccECRPublicRepository_CatalogData_description
=== PAUSE TestAccECRPublicRepository_CatalogData_description
=== RUN   TestAccECRPublicRepository_CatalogData_operatingSystems
=== PAUSE TestAccECRPublicRepository_CatalogData_operatingSystems
=== RUN   TestAccECRPublicRepository_CatalogData_usageText
=== PAUSE TestAccECRPublicRepository_CatalogData_usageText
=== RUN   TestAccECRPublicRepository_CatalogData_logoImageBlob
=== PAUSE TestAccECRPublicRepository_CatalogData_logoImageBlob
=== RUN   TestAccECRPublicRepository_Basic_forceDestroy
=== PAUSE TestAccECRPublicRepository_Basic_forceDestroy
=== RUN   TestAccECRPublicRepository_disappears
=== PAUSE TestAccECRPublicRepository_disappears
=== CONT  TestAccECRPublicRepository_basic
--- PASS: TestAccECRPublicRepository_basic (12.66s)
=== CONT  TestAccECRPublicRepository_CatalogData_operatingSystems
--- PASS: TestAccECRPublicRepository_CatalogData_operatingSystems (16.14s)
=== CONT  TestAccECRPublicRepository_disappears
--- PASS: TestAccECRPublicRepository_disappears (6.80s)
=== CONT  TestAccECRPublicRepository_Basic_forceDestroy
--- PASS: TestAccECRPublicRepository_Basic_forceDestroy (9.93s)
=== CONT  TestAccECRPublicRepository_CatalogData_logoImageBlob
--- PASS: TestAccECRPublicRepository_CatalogData_logoImageBlob (9.82s)
=== CONT  TestAccECRPublicRepository_CatalogData_usageText
--- PASS: TestAccECRPublicRepository_CatalogData_usageText (16.16s)
=== CONT  TestAccECRPublicRepository_CatalogData_architectures
--- PASS: TestAccECRPublicRepository_CatalogData_architectures (18.00s)
=== CONT  TestAccECRPublicRepository_CatalogData_description
--- PASS: TestAccECRPublicRepository_CatalogData_description (16.20s)
=== CONT  TestAccECRPublicRepository_CatalogData_aboutText
--- PASS: TestAccECRPublicRepository_CatalogData_aboutText (16.95s)
=== CONT  TestAccECRPublicRepository_tags
--- PASS: TestAccECRPublicRepository_tags (22.74s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ecrpublic	149.263s

@ewbankkit
Copy link
Contributor

@yktakaha4 Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 3b94d69 into hashicorp:main Aug 1, 2022
@github-actions github-actions bot added this to the v4.25.0 milestone Aug 1, 2022
@github-actions
Copy link

github-actions bot commented Aug 4, 2022

This functionality has been released in v4.25.0 of the Terraform AWS 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

github-actions bot commented Sep 4, 2022

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 issues.
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 Sep 4, 2022
@yktakaha4 yktakaha4 deleted the f-aws_ecrpublic_repository-add-tags branch February 25, 2023 04:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. generators Relates to code generators. service/ecrpublic Issues and PRs that pertain to the ecrpublic service. size/L Managed by automation to categorize the size of a PR. tags Pertains to resource tagging. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants