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

Iot domain name configuration #24765

Merged
merged 34 commits into from
Oct 25, 2023

Conversation

jalavoy
Copy link
Contributor

@jalavoy jalavoy commented May 12, 2022

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

Output from acceptance testing:
Using an example domain name I can't get the acceptance test to pass, but it's because of AWS returning the following error, which seems specific to them:

Cannot provide a custom domain name for an AWS Managed Domain

However, after building the provider and using it from my production terraform repo, it appears to work fine. Not sure the best way to handle this, as I'm not sure exactly what AWS is testing the domain against.

TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 20 -run='TestAccIotDomainNameConfiguration'  -timeout 180m
=== RUN   TestAccIotDomainNameConfiguration
    domain_name_configuration_test.go:14: Step 1/1 error: Error running apply: exit status 1
        
        Error: error creating IoT Domain Configuration (test): InvalidRequestException: Cannot provide a custom domain name for an AWS Managed Domain
        
          with aws_iot_domain_name_configuration.iot,
          on terraform_plugin_test.tf line 2, in resource "aws_iot_domain_name_configuration" "iot":
           2:   resource "aws_iot_domain_name_configuration" "iot" {
        
--- FAIL: TestAccIotDomainNameConfiguration (7.53s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/iot        11.062s
FAIL
make: *** [testacc] Error 1

Output from my terraform:

Terraform will perform the following actions:

  # aws_iot_domain_name_configuration.iot will be created
  + resource "aws_iot_domain_name_configuration" "iot" {
      + domain_name             = "REDACTED"
      + id                      = (known after apply)
      + name                    = "REDACTED"
      + server_certificate_arns = [
          + "REDACTED",
        ]
      + service_type            = "DATA"
    }

Plan: 1 to add, 0 to change, 0 to destroy.
aws_iot_domain_name_configuration.iot: Creating...
aws_iot_domain_name_configuration.iot: Creation complete after 0s [id=REDACTED]

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

If y'all have any input on how I can improve my test I'm open to it. I'm still new at working on this code. If it's acceptable to remove the test since it works outside of testing I'm fine with that too.

I'm also not positive I did the tagging stuff right. Super open to input on that.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. provider Pertains to the provider itself, rather than any interaction with AWS. repository Repository modifications; GitHub Actions, developer docs, issue templates, codeowners, changelog. service/iot Issues and PRs that pertain to the iot service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/L Managed by automation to categorize the size of a PR. size/XL Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels May 12, 2022
@jalavoy jalavoy force-pushed the iot_domain_name_configuration branch from 347aef7 to 249c802 Compare May 12, 2022 23:07
@github-actions github-actions bot 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 May 12, 2022
@jalavoy jalavoy force-pushed the iot_domain_name_configuration branch from 35782a8 to 7c925be Compare May 13, 2022 02:20
@jalavoy jalavoy changed the title Iot domain name configuration [WIP] Iot domain name configuration May 13, 2022
@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. and removed size/L Managed by automation to categorize the size of a PR. labels May 13, 2022
@jalavoy jalavoy force-pushed the iot_domain_name_configuration branch from 3120aae to 13690c7 Compare May 13, 2022 14:42
@jalavoy jalavoy changed the title [WIP] Iot domain name configuration Iot domain name configuration May 13, 2022
@justinretzolk justinretzolk added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels May 13, 2022
@github-actions github-actions bot removed the repository Repository modifications; GitHub Actions, developer docs, issue templates, codeowners, changelog. label May 27, 2022
…on must be disabled for at least 7 days before it can be deleted' errors in sweeper.
% ACM_CERTIFICATE_ROOT_DOMAIN=terraform-provider-aws-acctest-acm.com make testacc TESTARGS='-run=TestAccIoTDomainConfiguration_basic' PKG=iot
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 20  -run=TestAccIoTDomainConfiguration_basic -timeout 360m
=== RUN   TestAccIoTDomainConfiguration_basic
--- PASS: TestAccIoTDomainConfiguration_basic (108.42s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/iot        113.441s
@ewbankkit ewbankkit force-pushed the iot_domain_name_configuration branch from e8fc6d3 to c8eb41f Compare October 25, 2023 18:37
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 🚀.

% ACM_CERTIFICATE_ROOT_DOMAIN=terraform-provider-aws-acctest-acm.com make testacc TESTARGS='-run=TestAccIoTDomainConfiguration_' PKG=iot ACCTEST_PARALLELISM=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 1  -run=TestAccIoTDomainConfiguration_ -timeout 360m
=== RUN   TestAccIoTDomainConfiguration_basic
--- PASS: TestAccIoTDomainConfiguration_basic (108.34s)
=== RUN   TestAccIoTDomainConfiguration_disappears
--- PASS: TestAccIoTDomainConfiguration_disappears (133.20s)
=== RUN   TestAccIoTDomainConfiguration_tags
--- PASS: TestAccIoTDomainConfiguration_tags (175.62s)
=== RUN   TestAccIoTDomainConfiguration_update
--- PASS: TestAccIoTDomainConfiguration_update (152.94s)
=== RUN   TestAccIoTDomainConfiguration_awsManaged
    acctest.go:2450: Environment variable IOT_DOMAIN_CONFIGURATION_TEST_AWS_MANAGED is not set, skipping test
--- SKIP: TestAccIoTDomainConfiguration_awsManaged (0.00s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/iot        466.800s

@ewbankkit
Copy link
Contributor

@jalavoy Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 1b6e1fa into hashicorp:main Oct 25, 2023
42 of 43 checks passed
@github-actions github-actions bot added this to the v5.23.0 milestone Oct 25, 2023
@github-actions
Copy link

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

@jalavoy jalavoy deleted the iot_domain_name_configuration branch November 1, 2023 15:49
Copy link

github-actions bot commented Dec 2, 2023

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 2, 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. new-resource Introduces a new resource. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. 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
Development

Successfully merging this pull request may close these issues.

IOT: Add resource for domain configurations
8 participants