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 tagging to aws_resourcegroup_group. #7774

Closed

Conversation

joestump
Copy link
Contributor

Refs #6217.

Changes proposed in this pull request:

  • Adds tags attribute to aws_resourcegroup_group.

Output from acceptance testing:

Import test is currently failing. No idea why.

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run="TestAccAWSResourceGroup_basic" -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSResourceGroup_basic
=== PAUSE TestAccAWSResourceGroup_basic
=== CONT  TestAccAWSResourceGroup_basic
--- FAIL: TestAccAWSResourceGroup_basic (22.26s)
    testing.go:538: Step 1 error: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
        
        (map[string]string) {
        }
        
        
        (map[string]string) (len=2) {
         (string) (len=6) "tags.%": (string) (len=1) "1",
         (string) (len=8) "tags.Foo": (string) (len=3) "bar"
        }
        
FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	22.525s
make: *** [testacc] Error 1

@ghost ghost added size/M Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/resourcegroups Issues and PRs that pertain to the resourcegroups service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Feb 28, 2019
@joestump
Copy link
Contributor Author

@bflad I tried creating an importer based on resourceAwsResourceGroupsGroupRead and it still wasn't pulling in the tags. Any pointers on how to fix this import test would be great.

@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Mar 6, 2019
@bflad
Copy link
Contributor

bflad commented Mar 6, 2019

Related: #7811

@DrFaust92
Copy link
Collaborator

Hey @joestump, i have a working PR (#10640) for this with changes including the keyvaluetags package, would you like me to merge these to this PR or close this one?

@bflad
Copy link
Contributor

bflad commented Nov 19, 2019

Hi @joestump 👋 Thank you for working on this and sorry it was previously lingering.

Relating to the ImportStateVerify issue, it is generally is a signal that the Read function is not properly saving an attribute (via d.Set()) into the Terraform state correctly. One way of ensuring any d.Set() call is properly working is to perform error checking on it, e.g.

if err := d.Set("tags", /* ... */); err != nil {
  return fmt.Errorf("error setting tags: %s", err)
}

As @DrFaust92 is mentioning above, there have been some consistency changes and simplifications to how to implement resource tagging into the Terraform AWS Provider codebase, which can be found in the Contributing Guide using a new internal keyvaluetags package.

Since we didn't see a response to the above and it appears this pull request wasn't in a mergeable state, we are going to opt to close this in preference of the one implementing the new methodology. Thanks again for your contribution here and let us know if you have any questions.

@bflad bflad closed this Nov 19, 2019
@ghost
Copy link

ghost commented Mar 29, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
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. service/resourcegroups Issues and PRs that pertain to the resourcegroups service. size/M Managed by automation to categorize the size of a PR. 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.

3 participants