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

tech-debt/resources:autofix extraneous value conversion for d.Set() of primitives #16671

Merged

Conversation

anGie44
Copy link
Contributor

@anGie44 anGie44 commented Dec 9, 2020

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

Release note for CHANGELOG:

N/A

Output from acceptance testing:

N/A semgrep rule (defined in https://github.com/hashicorp/terraform-provider-aws/pull/16650) should not show warning msgs for these files

@anGie44 anGie44 added the technical-debt Addresses areas of the codebase that need refactoring or redesign. label Dec 9, 2020
@anGie44 anGie44 requested a review from a team as a code owner December 9, 2020 15:46
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. service/appsync Issues and PRs that pertain to the appsync service. service/autoscalingplans Issues and PRs that pertain to the autoscalingplans service. service/cloudwatchlogs service/codepipeline Issues and PRs that pertain to the codepipeline service. service/dax Issues and PRs that pertain to the dax service. service/directconnect Issues and PRs that pertain to the directconnect service. service/ec2 Issues and PRs that pertain to the ec2 service. service/elasticache Issues and PRs that pertain to the elasticache service. service/elasticsearch Issues and PRs that pertain to the elasticsearch service. service/emr Issues and PRs that pertain to the emr service. service/glue Issues and PRs that pertain to the glue service. service/iam Issues and PRs that pertain to the iam service. service/kafka Issues and PRs that pertain to the kafka service. service/kinesisanalytics Issues and PRs that pertain to the kinesisanalytics service. service/kinesisanalyticsv2 Issues and PRs that pertain to the kinesisanalyticsv2 service. service/lambda Issues and PRs that pertain to the lambda service. labels Dec 9, 2020
Copy link
Member

@YakDriver YakDriver left a comment

Choose a reason for hiding this comment

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

LGTM (once the conflict is resolved)

Base automatically changed from master to main January 23, 2021 00:59
@anGie44 anGie44 force-pushed the td-files-changed-for-semgrep-extraneous-wrapping-rule-resources branch from 37a4674 to 5cfb1c5 Compare March 31, 2021 20:37
@ghost ghost added size/L 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 Mar 31, 2021
@ghost ghost added the service/pinpoint Issues and PRs that pertain to the pinpoint service. label Mar 31, 2021
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. service/acmpca Issues and PRs that pertain to the acmpca service. service/cloudfront Issues and PRs that pertain to the cloudfront service. service/fms Issues and PRs that pertain to the fms service. and removed size/L Managed by automation to categorize the size of a PR. labels Apr 1, 2021
@anGie44
Copy link
Contributor Author

anGie44 commented Apr 1, 2021

@bflad confirmed removing the AWS SDK value conversions does not change the output value of an API object String field e.g.

With terraform config:

resource "aws_msk_configuration" "test" {
  kafka_versions = ["2.1.0"]
  name           = "tf-test-1234"

  server_properties = <<PROPERTIES
auto.create.topics.enable = true
delete.topic.enable = true
PROPERTIES
}

output "test" {
  value = aws_msk_configuration.test.description
}

Terraform apply output (using tf v0.14 and aws provider v3.34.0):

aws_msk_configuration.test: Creating...
aws_msk_configuration.test: Still creating... [10s elapsed]
aws_msk_configuration.test: Creation complete after 12s [id=arn:aws:kafka:us-west-2:xxxxxxxxx:configuration/tf-test-1234/5edd0390-9c3b-4ad6-90d0-d1e04d91e2e5-6]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Value in terraform state file:

"description": "",

Running terraform refresh:

Outputs:

test = ""

Then upgrading to a provider built from this branch and running terraform apply:

aws_msk_configuration.test: Refreshing state... [id=arn:aws:kafka:us-west-2:xxxxxxxxxxx:configuration/tf-test-1234/5edd0390-9c3b-4ad6-90d0-d1e04d91e2e5-6]

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

test = ""

Similarly if we run the above configuration, creating a new resource, just on the provider built from this branch:

aws_msk_configuration.test: Creating...
aws_msk_configuration.test: Creation complete after 1s [id=arn:aws:kafka:us-west-2:xxxxxxxx:configuration/tf-test-1234/3d0a1187-13ee-4390-b205-eb671f9b05a2-6]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Running terraform refresh:

aws_msk_configuration.test: Refreshing state... [id=arn:aws:kafka:us-west-2:xxxxxxxxxxx:configuration/tf-test-1234/3d0a1187-13ee-4390-b205-eb671f9b05a2-6]

Outputs:

test = ""

@bflad bflad self-assigned this Apr 1, 2021
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 is wonderful! Thank you for the extra careful validation. 🚀

@anGie44 anGie44 added this to the v3.35.0 milestone Apr 1, 2021
@anGie44 anGie44 merged commit d89359b into main Apr 1, 2021
@anGie44 anGie44 deleted the td-files-changed-for-semgrep-extraneous-wrapping-rule-resources branch April 1, 2021 19:24
@ghost
Copy link

ghost commented Apr 1, 2021

This has been released in version 3.35.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 for triage. Thanks!

@ghost
Copy link

ghost commented May 2, 2021

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 as resolved and limited conversation to collaborators May 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/acmpca Issues and PRs that pertain to the acmpca service. service/appsync Issues and PRs that pertain to the appsync service. service/autoscalingplans Issues and PRs that pertain to the autoscalingplans service. service/cloudfront Issues and PRs that pertain to the cloudfront service. service/codepipeline Issues and PRs that pertain to the codepipeline service. service/dax Issues and PRs that pertain to the dax service. service/directconnect Issues and PRs that pertain to the directconnect service. service/ec2 Issues and PRs that pertain to the ec2 service. service/elasticache Issues and PRs that pertain to the elasticache service. service/elasticsearch Issues and PRs that pertain to the elasticsearch service. service/emr Issues and PRs that pertain to the emr service. service/fms Issues and PRs that pertain to the fms service. service/glue Issues and PRs that pertain to the glue service. service/iam Issues and PRs that pertain to the iam service. service/kafka Issues and PRs that pertain to the kafka service. service/kinesisanalytics Issues and PRs that pertain to the kinesisanalytics service. service/kinesisanalyticsv2 Issues and PRs that pertain to the kinesisanalyticsv2 service. service/lambda Issues and PRs that pertain to the lambda service. service/pinpoint Issues and PRs that pertain to the pinpoint service. size/XL Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants