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

docs/contributing: Add data handling and conversion documentation #16748

Merged
merged 4 commits into from
Dec 17, 2020

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Dec 14, 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

Release note for CHANGELOG:

NONE

Initial Contributing Guide documentation on how to handle data and its conversion. Provides a walkthrough of the current Terraform Plugin SDK type system, AWS (API and SDK) type systems, and how to convert between the two. Also includes an initial section on how the maintainers treat sensitive values in terms of the Terraform Plugin SDK implementation that exists today.

In the future, this documentation can be augmented with further information on how to handle "nullable" types and other data concerns such as "passthrough" and "virtual" attributes.

Output from acceptance testing: N/A (documentation)

Verified

This commit was signed with the committer’s verified signature.
Initial Contributing Guide documentation on how to handle data and its conversion. Provides a walkthrough of the current Terraform Plugin SDK type system, AWS (API and SDK) type systems, and how to convert between the two. Also includes an initial section on how the maintainers treat sensitive values in terms of the Terraform Plugin SDK implementation that exists today.

In the future, this documentation can be augmented with further information on how to handle "nullable" types and other data concerns such as "passthrough" and "virtual" attributes.
@bflad bflad requested a review from a team as a code owner December 14, 2020 13:23
@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. labels Dec 14, 2020
ewbankkit added a commit to ewbankkit/terraform-provider-aws that referenced this pull request Dec 15, 2020
bflad pushed a commit that referenced this pull request Dec 15, 2020
…tomer_owned_ip attributes (#16723)

* d/aws_network_interface: Add 'association.carrier_ip' attribute.

* d/aws_network_interface: Move all configurations below acceptance tests.

* d/aws_network_interface: Refactor existing acceptance tests before testing new functionality.

Acceptance test output:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccDataSourceAwsNetworkInterface_' ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccDataSourceAwsNetworkInterface_ -timeout 120m
=== RUN   TestAccDataSourceAwsNetworkInterface_basic
=== PAUSE TestAccDataSourceAwsNetworkInterface_basic
=== RUN   TestAccDataSourceAwsNetworkInterface_filters
=== PAUSE TestAccDataSourceAwsNetworkInterface_filters
=== CONT  TestAccDataSourceAwsNetworkInterface_basic
=== CONT  TestAccDataSourceAwsNetworkInterface_filters
--- PASS: TestAccDataSourceAwsNetworkInterface_filters (57.63s)
--- PASS: TestAccDataSourceAwsNetworkInterface_basic (57.84s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	57.929s

* d/aws_network_interface: Add 'TestAccDataSourceAwsNetworkInterface_EIPAssociation'.

Acceptance test output:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccDataSourceAwsNetworkInterface_EIPAssociation' ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccDataSourceAwsNetworkInterface_EIPAssociation -timeout 120m
=== RUN   TestAccDataSourceAwsNetworkInterface_EIPAssociation
=== PAUSE TestAccDataSourceAwsNetworkInterface_EIPAssociation
=== CONT  TestAccDataSourceAwsNetworkInterface_EIPAssociation
--- PASS: TestAccDataSourceAwsNetworkInterface_EIPAssociation (67.86s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	67.946s

* d/aws_network_interface: Add 'TestAccDataSourceAwsNetworkInterface_CarrierIPAssociation'.

* Fix linter errors.

* 'EIPAssociation' -> 'PublicIPAssociation'.

* d/aws_network_interface: Add 'association.customer_owned_ip' attribute.

Acceptance test output:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccDataSourceAwsNetworkInterface_PublicIPAssociation'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccDataSourceAwsNetworkInterface_PublicIPAssociation -timeout 120m
=== RUN   TestAccDataSourceAwsNetworkInterface_PublicIPAssociation
=== PAUSE TestAccDataSourceAwsNetworkInterface_PublicIPAssociation
=== CONT  TestAccDataSourceAwsNetworkInterface_PublicIPAssociation
--- PASS: TestAccDataSourceAwsNetworkInterface_PublicIPAssociation (67.42s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	67.484s

* Modify 'flattenEc2NetworkInterfaceAssociation' to conform to suggested code pattern (#16748).
Copy link
Member

@breathingdust breathingdust 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 great, I think this will be a really valuable for new contributors and equally as a quick reference for more established ones. 🚀 👍

@bflad bflad added this to the v3.22.0 milestone Dec 17, 2020
@bflad bflad merged commit 3ae747b into master Dec 17, 2020
@bflad bflad deleted the d-provider-data-handling-and-conversion branch December 17, 2020 00:12
Comment on lines +549 to +551
if v, ok := tfMap["nested_attribute_name"].([]interface{}); ok && len(v) > 0 {
apiObject.NestedAttributeName = expandServiceStructure(v[0].map[string]interface{})
}

This comment was marked as resolved.

This comment was marked as resolved.

@ghost
Copy link

ghost commented Dec 18, 2020

This has been released in version 3.22.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 Jan 16, 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 Jan 16, 2021
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. provider Pertains to the provider itself, rather than any interaction with AWS. size/XL Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants