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

provider/aws: Add support for tags to aws_cloudfront_distribution #9011

Merged
merged 1 commit into from
Sep 28, 2016

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Sep 23, 2016

Fixes #8959

% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSCloudFrontDistribution_S3OriginWithTags'                                           2 ↵ ✹
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/23 16:30:31 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSCloudFrontDistribution_S3OriginWithTags -timeout 120m
=== RUN   TestAccAWSCloudFrontDistribution_S3OriginWithTags
--- PASS: TestAccAWSCloudFrontDistribution_S3OriginWithTags (1234.66s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    1234.680s

@stack72 stack72 force-pushed the f-aws-cloudfront-tags branch from 5aeea6a to a830319 Compare September 23, 2016 15:54
@stack72 stack72 changed the title [WIP] provider/aws: Add support for tags to aws_cloudfront_distribution provider/aws: Add support for tags to aws_cloudfront_distribution Sep 23, 2016
log.Printf("[DEBUG] Error retrieving tags for ARN: %s", cloudFrontArn)
}

d.Set("tags", tagsToMapCloudFront(tagResp.Tags))
Copy link
Contributor

Choose a reason for hiding this comment

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

if tagErr is non-nil, seems like there would be a decent chance that tagResp is nil, does that sound right? We may want to guard here for a nil response and nil pointer dereference

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 can guard against it no worries at all - I was just going with the API description:

// The returned result of the corresponding request.
type ListTagsForResourceOutput struct {
    _ struct{} `type:"structure" payload:"Tags"`

    // A complex type that contains zero or more Tag elements.
    Tags *Tags `type:"structure" required:"true"`
}

Have pushed the guard :)

Fixes #8959

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSCloudFrontDistribution_S3OriginWithTags'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/23 16:30:31 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSCloudFrontDistribution_S3OriginWithTags -timeout 120m
=== RUN   TestAccAWSCloudFrontDistribution_S3OriginWithTags
--- PASS: TestAccAWSCloudFrontDistribution_S3OriginWithTags (1234.66s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws
1234.680s
```
@stack72 stack72 force-pushed the f-aws-cloudfront-tags branch from a830319 to 13cf370 Compare September 28, 2016 12:18
@stack72 stack72 merged commit 9202bb4 into master Sep 28, 2016
@stack72 stack72 deleted the f-aws-cloudfront-tags branch January 31, 2017 22:12
@ghost
Copy link

ghost commented Apr 17, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 17, 2020
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.

AWS_CLOUDFRONT_DISTRIBUTION add tags support
2 participants