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

data-source/aws_partition: reverse_dns_prefix attribute incorrect outside AWS Commercial and GovCloud (US) #17140

Closed
bflad opened this issue Jan 15, 2021 · 2 comments · Fixed by #17142
Assignees
Labels
bug Addresses a defect in current functionality. partition/aws-cn Pertains to the aws-cn partition. partition/aws-iso Pertains to the aws-iso partition. partition/aws-iso-b Pertains to the aws-iso-b partition. provider Pertains to the provider itself, rather than any interaction with AWS.
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Jan 15, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Any version of Terraform CLI and Terraform AWS Provider version 3.24.0/3.24.1

Affected Resource(s)

  • aws_partition

Terraform Configuration Files

data "aws_partition" "current" {}

output "reverse_dns" {
  value = data.aws_partition.current.reverse_dns_prefix
}

Expected Behavior

  • In AWS China, it should return cn.com.amazonaws
  • In AWS SC2S, it should return gov.sgov.sc2s
  • In AWS C2S, it should return gov.ic.c2s

Actual Behavior

It is reverse sorted alphabetically:

  • In AWS China, it would return com.cn.amazonaws
  • In AWS SC2S, it would return sc2s.sgov.gov
  • In AWS C2S, it would return ic.gov.c2s

Steps to Reproduce

  1. terraform apply

Important Factoids

The sorting is using sort.Reverse() not slice index swapping.

References

@bflad bflad added bug Addresses a defect in current functionality. provider Pertains to the provider itself, rather than any interaction with AWS. partition/aws-cn Pertains to the aws-cn partition. partition/aws-iso Pertains to the aws-iso partition. partition/aws-iso-b Pertains to the aws-iso-b partition. labels Jan 15, 2021
@bflad bflad self-assigned this Jan 15, 2021
bflad added a commit that referenced this issue Jan 15, 2021
Reference: #17140

Output from acceptance testing:

```
--- PASS: TestAccAWSPartition_basic (8.02s)

--- PASS: TestAccAWSProvider_AssumeRole_Empty (18.41s)
--- PASS: TestAccAWSProvider_Endpoints (16.22s)
--- PASS: TestAccAWSProvider_IgnoreTags_EmptyConfigurationBlock (15.68s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_Multiple (15.57s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_None (15.56s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_One (15.84s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_Multiple (15.92s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_None (15.99s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_One (16.10s)
--- PASS: TestAccAWSProvider_Region_AwsC2S (13.71s)
--- PASS: TestAccAWSProvider_Region_AwsChina (13.27s)
--- PASS: TestAccAWSProvider_Region_AwsCommercial (12.85s)
--- PASS: TestAccAWSProvider_Region_AwsGovCloudUs (12.59s)
--- PASS: TestAccAWSProvider_Region_AwsSC2S (14.52s)
```
bflad added a commit that referenced this issue Feb 1, 2021
* provider: Fix reverse DNS prefix handling and save to AWSClient

Reference: #17140

Output from acceptance testing:

```
--- PASS: TestAccAWSPartition_basic (8.02s)

--- PASS: TestAccAWSProvider_AssumeRole_Empty (18.41s)
--- PASS: TestAccAWSProvider_Endpoints (16.22s)
--- PASS: TestAccAWSProvider_IgnoreTags_EmptyConfigurationBlock (15.68s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_Multiple (15.57s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_None (15.56s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_One (15.84s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_Multiple (15.92s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_None (15.99s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_One (16.10s)
--- PASS: TestAccAWSProvider_Region_AwsC2S (13.71s)
--- PASS: TestAccAWSProvider_Region_AwsChina (13.27s)
--- PASS: TestAccAWSProvider_Region_AwsCommercial (12.85s)
--- PASS: TestAccAWSProvider_Region_AwsGovCloudUs (12.59s)
--- PASS: TestAccAWSProvider_Region_AwsSC2S (14.52s)
```

* Update CHANGELOG for #17142
@github-actions github-actions bot added this to the v3.27.0 milestone Feb 1, 2021
@ghost
Copy link

ghost commented Feb 5, 2021

This has been released in version 3.27.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 Mar 4, 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 Mar 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. partition/aws-cn Pertains to the aws-cn partition. partition/aws-iso Pertains to the aws-iso partition. partition/aws-iso-b Pertains to the aws-iso-b partition. provider Pertains to the provider itself, rather than any interaction with AWS.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant