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

Resource xray sampling rules #8535

Merged
merged 19 commits into from
May 9, 2019

Conversation

dedoussis
Copy link
Contributor

@dedoussis dedoussis commented May 6, 2019

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" comments, they generate extra noise for pull request followers and do not help prioritize the request

Fixes #7028

Release note for CHANGELOG:

New Resource: aws_xray_sampling_rule (#7028)

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSXraySamplingRule'

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSXraySamplingRule -timeout 120m
=== RUN   TestAccAWSXraySamplingRule_basic
=== PAUSE TestAccAWSXraySamplingRule_basic
=== RUN   TestAccAWSXraySamplingRule_update
=== PAUSE TestAccAWSXraySamplingRule_update
=== RUN   TestAccAWSXraySamplingRule_import
=== PAUSE TestAccAWSXraySamplingRule_import
=== CONT  TestAccAWSXraySamplingRule_basic
=== CONT  TestAccAWSXraySamplingRule_update
=== CONT  TestAccAWSXraySamplingRule_import
--- PASS: TestAccAWSXraySamplingRule_basic (18.06s)
--- PASS: TestAccAWSXraySamplingRule_import (19.33s)
--- PASS: TestAccAWSXraySamplingRule_update (37.13s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	37.193s

References

https://docs.aws.amazon.com/xray/latest/devguide/xray-api-sampling.html

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/xray Issues and PRs that pertain to the xray service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels May 6, 2019
@ghost ghost added the dependencies Used to indicate dependency changes. label May 6, 2019
@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. and removed size/XL Managed by automation to categorize the size of a PR. labels May 6, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Hi @dedoussis 👋 Thanks for submitting this, despite the comment count its in pretty good shape! Initial feedback below -- please let us know if you have any questions or do not have time to implement these items.

One important note about adding new services, the vendoring should be included in a separate PR as noted in the contributing guide. Rebasing this pull request on master and running go mod vendor shows the xray SDK client is out of date already.

aws/config.go Show resolved Hide resolved
aws/resource_aws_xray_sampling_rule.go Show resolved Hide resolved
aws/resource_aws_xray_sampling_rule.go Show resolved Hide resolved
aws/resource_aws_xray_sampling_rule.go Show resolved Hide resolved
aws/resource_aws_xray_sampling_rule.go Show resolved Hide resolved
aws/resource_aws_xray_sampling_rule_test.go Outdated Show resolved Hide resolved
aws/resource_aws_xray_sampling_rule_test.go Outdated Show resolved Hide resolved
aws/resource_aws_xray_sampling_rule_test.go Outdated Show resolved Hide resolved
aws/resource_aws_xray_sampling_rule_test.go Outdated Show resolved Hide resolved
website/docs/r/xray_sampling_rule.html.markdown Outdated Show resolved Hide resolved
@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label May 6, 2019
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. and removed size/XXL Managed by automation to categorize the size of a PR. labels May 6, 2019
@dedoussis
Copy link
Contributor Author

Thanks for reviewing this @bflad ! 😃
I do have time to implement any needed fixes. Have already picked up some of your comments.

Regarding the vendoring, I do get that SDKs can get outdated but do not understand how a separate PR solves this.

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label May 6, 2019
Required: true,
ValidateFunc: validation.IntBetween(1, 9999),
},
"fixed_rate": {
Copy link
Contributor Author

@dedoussis dedoussis May 6, 2019

Choose a reason for hiding this comment

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

@bflad Do you think this would require a custom validator as the validation helper does not support anything along the lines of FloatBetween?

Copy link
Contributor

Choose a reason for hiding this comment

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

It appears there are two upstream PRs for adding FloatBetween to the helper/validation package upstream:

I cannot imagine there is a specific reason why one of these is not merged, so I will followup with those maintainers to make sure the new validation function gets in. We are likely pulling in a newer version of the upstream dependency later this week anyways as part of some Terraform 0.12 work, so this problem might resolve itself shortly. I would suggest omitting any changes in this regard for now.

@bflad
Copy link
Contributor

bflad commented May 7, 2019

Regarding the vendoring, I do get that SDKs can get outdated but do not understand how a separate PR solves this.

The maintainers generally prioritize merging vendoring changes before other code reviews as they are a fast moving target with how often the AWS Go SDK is released. If the AWS Go SDK for one service is out of sync version-wise with the rest of the services, it will show as unexpected changes the next time vendoring occurs. Since the AWS Go SDK is generally additive usually this is not a problem, but there have been rare cases in the past where that did not hold. Separating the SDK client addition, e.g. as #8512 did for managedblockchain, allows us to immediately get the service SDK into the codebase.

Once Go Module caching becomes more publicly stable and we feel comfortable removing the vendoring, this will no longer be a problem. 👍

@bflad bflad added the new-resource Introduces a new resource. label May 7, 2019
@dedoussis
Copy link
Contributor Author

dedoussis commented May 7, 2019

@bflad Have addressed all of your comments. 😺
Once you're happy with the state of this PR, I will open a separate one for the vendoring.

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

This looks great, @dedoussis, thanks so much for your contribution! 🚀 I will add the go mod vendor commit when merging this pull request so you don't need to worry about that little detail. 😄

Output from acceptance testing:

--- PASS: TestAccAWSXraySamplingRule_basic (10.06s)
--- PASS: TestAccAWSXraySamplingRule_update (15.27s)

@bflad bflad merged commit 7810470 into hashicorp:master May 9, 2019
@bflad bflad added this to the v2.10.0 milestone May 9, 2019
bflad added a commit that referenced this pull request May 9, 2019
@bflad
Copy link
Contributor

bflad commented May 10, 2019

This has been released in version 2.10.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Mar 30, 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 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Used to indicate dependency changes. documentation Introduces or discusses updates to documentation. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/xray Issues and PRs that pertain to the xray service. size/XL 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.

Support for X-Ray Sampling Rules
2 participants