Skip to content

Commit

Permalink
Merge pull request #27790 from larstobi/add-cloudfront-distribution-z…
Browse files Browse the repository at this point in the history
…one-id-to-cognito-domain

Add cloudfront_distribution_zone_id to aws_cognito_user_pool_domain
  • Loading branch information
ewbankkit authored Mar 13, 2023
2 parents 4f7b0c3 + 6311399 commit 76a2cb9
Show file tree
Hide file tree
Showing 18 changed files with 507 additions and 924 deletions.
3 changes: 3 additions & 0 deletions .changelog/27790.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution` and `cloudfront_distribution_zone_id` attributes
```
10 changes: 10 additions & 0 deletions internal/conns/awsclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"net/http"

"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/service/s3"
)

Expand Down Expand Up @@ -43,3 +44,12 @@ func (client *AWSClient) SetHTTPClient(httpClient *http.Client) {
func (client *AWSClient) HTTPClient() *http.Client {
return client.httpClient
}

// CloudFrontDistributionHostedZoneIDForPartition returns for the Route 53 hosted zone ID
// for Amazon CloudFront distributions in the configured AWS partition.
func (client *AWSClient) CloudFrontDistributionHostedZoneID() string {
if client.Partition == endpoints.AwsCnPartitionID {
return "Z3RFFRIM2A3IF5" // See https://docs.amazonaws.cn/en_us/aws/latest/userguide/route53.html
}
return "Z2FDTNDATAQYW2" // See https://docs.aws.amazon.com/Route53/latest/APIReference/API_AliasTarget.html#Route53-Type-AliasTarget-HostedZoneId
}
125 changes: 0 additions & 125 deletions internal/service/apigateway/acc_test.go

This file was deleted.

Loading

0 comments on commit 76a2cb9

Please sign in to comment.