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 resource aws_iot_ca_certificate and data aws_iot_registration_code #15098

Merged
merged 31 commits into from
Nov 13, 2023

Conversation

funnybirdman
Copy link
Contributor

@funnybirdman funnybirdman commented Sep 10, 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

Closes #14949.
Closes #15840.
Closes #33057.

Release note for CHANGELOG:


Output from acceptance testing:

$ make test TESTARGS='-run=TestAccAWSIotRegistrationCodeDataSource_basic'
==> Checking that code complies with gofmt requirements...
go test ./... -run=TestAccAWSIotRegistrationCodeDataSource_basic -timeout=120s -parallel=4
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1.714s
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/encryption	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/experimental/sync	[no test files]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/hashcode	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/mutexkv	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/naming	(cached) [no tests to run]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/acmpca/finder	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/acmpca/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/apigatewayv2/waiter	[no test files]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/batch/equivalency	(cached) [no tests to run]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cognitoidentityprovider/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/finder	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ecs/waiter	[no test files]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/eks/token	(cached) [no tests to run]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/guardduty/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/kafka/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/kinesisanalytics/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/kms/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/lex/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/neptune/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/rds/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/secretsmanager/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/servicediscovery/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/sfn/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/workspaces/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/xray/waiter	[no test files]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/tfawsresource	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/vault/helper/pgpkeys	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/vault/sdk/helper/jsonutil	(cached) [no tests to run]
?   	github.com/terraform-providers/terraform-provider-aws/awsproviderlint	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/helper/awsprovidertype/keyvaluetags	[no test files]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSAT001	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSAT002	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSAT003	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSAT004	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSAT005	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSAT006	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSR001	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSR002	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSV001	(cached) [no tests to run]


$ make test TESTARGS='-run=TestAccAWSIoTCACertificate_certificate'
==> Checking that code complies with gofmt requirements...
go test ./... -run=TestAccAWSIoTCACertificate_certificate -timeout=120s -parallel=4
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1.719s
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/encryption	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/experimental/sync	[no test files]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/hashcode	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/mutexkv	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/naming	(cached) [no tests to run]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/acmpca/finder	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/acmpca/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/apigatewayv2/waiter	[no test files]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/batch/equivalency	(cached) [no tests to run]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cognitoidentityprovider/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/finder	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ecs/waiter	[no test files]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/eks/token	(cached) [no tests to run]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/guardduty/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/kafka/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/kinesisanalytics/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/kms/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/lex/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/neptune/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/rds/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/secretsmanager/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/servicediscovery/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/sfn/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/workspaces/waiter	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/aws/internal/service/xray/waiter	[no test files]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/tfawsresource	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/vault/helper/pgpkeys	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/vault/sdk/helper/jsonutil	(cached) [no tests to run]
?   	github.com/terraform-providers/terraform-provider-aws/awsproviderlint	[no test files]
?   	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/helper/awsprovidertype/keyvaluetags	[no test files]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSAT001	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSAT002	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSAT003	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSAT004	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSAT005	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSAT006	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSR001	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSR002	(cached) [no tests to run]
ok  	github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSV001	(cached) [no tests to run]
...

@funnybirdman funnybirdman requested a review from a team September 10, 2020 16:48
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/iot Issues and PRs that pertain to the iot service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Sep 10, 2020
@anGie44 anGie44 added new-data-source Introduces a new data source. new-resource Introduces a new resource. enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 17, 2020
Base automatically changed from master to main January 23, 2021 00:59
@breathingdust breathingdust requested a review from a team as a code owner January 23, 2021 00:59
@EdgarGrimbergNOV
Copy link

There seems to be a small conflict in this PR. @funnybirdman @brandon-bird-yolabs do you have time to fix this?

@AlmogCohen
Copy link

Any chance to see this included?

@AlmogCohen
Copy link

@funnybirdman I see you merged master into the repo but there still seems to be some missing parts:

  • You did not paste the output of the acceptance tests (only tests)
  • The acceptance test you have for the data object is broken - you can see my PR for the fix (simply adding data. to the object name)
  • The acceptance test you have for the resource isn't working either - it uses invalid attributes (and does not create the dependency objects)

@zhelding
Copy link
Contributor

Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding.

Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single aws directory to a large number of separate directories in internal/service, each corresponding to a particular AWS service. This separation of code has also allowed for us to simplify the names of underlying functions -- while still avoiding namespace collisions.

We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author.

For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000.

For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide.

@github-actions github-actions bot added pre-service-packages Includes pre-Service Packages aspects. and removed provider Pertains to the provider itself, rather than any interaction with AWS. labels Nov 10, 2023
% make testacc TESTARGS='-run=TestAccIoTRegistrationCodeDataSource_' PKG=iot
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 20  -run=TestAccIoTRegistrationCodeDataSource_ -timeout 360m
=== RUN   TestAccIoTRegistrationCodeDataSource_basic
=== PAUSE TestAccIoTRegistrationCodeDataSource_basic
=== CONT  TestAccIoTRegistrationCodeDataSource_basic
--- PASS: TestAccIoTRegistrationCodeDataSource_basic (16.37s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iot	21.673s
% make testacc TESTARGS='-run=TestAccIoTCACertificate_basic' PKG=iot
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 20  -run=TestAccIoTCACertificate_basic -timeout 360m
=== RUN   TestAccIoTCACertificate_basic
--- PASS: TestAccIoTCACertificate_basic (19.53s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iot	24.760s
% make testacc TESTARGS='-run=TestAccIoTCACertificate_' PKG=iot ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 2  -run=TestAccIoTCACertificate_ -timeout 360m
=== RUN   TestAccIoTCACertificate_basic
=== PAUSE TestAccIoTCACertificate_basic
=== RUN   TestAccIoTCACertificate_disappears
=== PAUSE TestAccIoTCACertificate_disappears
=== RUN   TestAccIoTCACertificate_tags
=== PAUSE TestAccIoTCACertificate_tags
=== RUN   TestAccIoTCACertificate_defaultMode
=== PAUSE TestAccIoTCACertificate_defaultMode
=== CONT  TestAccIoTCACertificate_basic
=== CONT  TestAccIoTCACertificate_tags
--- PASS: TestAccIoTCACertificate_basic (21.54s)
=== CONT  TestAccIoTCACertificate_defaultMode
--- PASS: TestAccIoTCACertificate_tags (54.91s)
=== CONT  TestAccIoTCACertificate_disappears
--- PASS: TestAccIoTCACertificate_defaultMode (45.12s)
--- PASS: TestAccIoTCACertificate_disappears (17.64s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iot	78.487s
% make testacc TESTARGS='-run=TestAccIoTCertificate_' PKG=iot ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 2  -run=TestAccIoTCertificate_ -timeout 360m
=== RUN   TestAccIoTCertificate_csr
=== PAUSE TestAccIoTCertificate_csr
=== RUN   TestAccIoTCertificate_Keys_certificate
=== PAUSE TestAccIoTCertificate_Keys_certificate
=== RUN   TestAccIoTCertificate_Keys_existingCertificate
=== PAUSE TestAccIoTCertificate_Keys_existingCertificate
=== CONT  TestAccIoTCertificate_csr
=== CONT  TestAccIoTCertificate_Keys_existingCertificate
--- PASS: TestAccIoTCertificate_csr (24.53s)
=== CONT  TestAccIoTCertificate_Keys_certificate
--- PASS: TestAccIoTCertificate_Keys_existingCertificate (40.24s)
--- PASS: TestAccIoTCertificate_Keys_certificate (19.25s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iot	49.638s
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccIoTRegistrationCodeDataSource_' PKG=iot
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 20  -run=TestAccIoTRegistrationCodeDataSource_ -timeout 360m
=== RUN   TestAccIoTRegistrationCodeDataSource_basic
=== PAUSE TestAccIoTRegistrationCodeDataSource_basic
=== CONT  TestAccIoTRegistrationCodeDataSource_basic
--- PASS: TestAccIoTRegistrationCodeDataSource_basic (16.37s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iot	21.673s
% make testacc TESTARGS='-run=TestAccIoTCACertificate_' PKG=iot ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 2  -run=TestAccIoTCACertificate_ -timeout 360m
=== RUN   TestAccIoTCACertificate_basic
=== PAUSE TestAccIoTCACertificate_basic
=== RUN   TestAccIoTCACertificate_disappears
=== PAUSE TestAccIoTCACertificate_disappears
=== RUN   TestAccIoTCACertificate_tags
=== PAUSE TestAccIoTCACertificate_tags
=== RUN   TestAccIoTCACertificate_defaultMode
=== PAUSE TestAccIoTCACertificate_defaultMode
=== CONT  TestAccIoTCACertificate_basic
=== CONT  TestAccIoTCACertificate_tags
--- PASS: TestAccIoTCACertificate_basic (21.54s)
=== CONT  TestAccIoTCACertificate_defaultMode
--- PASS: TestAccIoTCACertificate_tags (54.91s)
=== CONT  TestAccIoTCACertificate_disappears
--- PASS: TestAccIoTCACertificate_defaultMode (45.12s)
--- PASS: TestAccIoTCACertificate_disappears (17.64s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iot	78.487s
% make testacc TESTARGS='-run=TestAccIoTCertificate_' PKG=iot ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 2  -run=TestAccIoTCertificate_ -timeout 360m
=== RUN   TestAccIoTCertificate_csr
=== PAUSE TestAccIoTCertificate_csr
=== RUN   TestAccIoTCertificate_Keys_certificate
=== PAUSE TestAccIoTCertificate_Keys_certificate
=== RUN   TestAccIoTCertificate_Keys_existingCertificate
=== PAUSE TestAccIoTCertificate_Keys_existingCertificate
=== CONT  TestAccIoTCertificate_csr
=== CONT  TestAccIoTCertificate_Keys_existingCertificate
--- PASS: TestAccIoTCertificate_csr (24.53s)
=== CONT  TestAccIoTCertificate_Keys_certificate
--- PASS: TestAccIoTCertificate_Keys_existingCertificate (40.24s)
--- PASS: TestAccIoTCertificate_Keys_certificate (19.25s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iot	49.638s

@ewbankkit
Copy link
Contributor

@funnybirdman Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 0ad8b3c into hashicorp:main Nov 13, 2023
43 checks passed
@github-actions github-actions bot added this to the v5.26.0 milestone Nov 13, 2023
Copy link

This functionality has been released in v5.26.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. Thank you!

Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 17, 2023
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. new-data-source Introduces a new data source. new-resource Introduces a new resource. pre-service-packages Includes pre-Service Packages aspects. service/iot Issues and PRs that pertain to the iot 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
7 participants