pulumi / pulumi-aws

An Amazon Web Services (AWS) Pulumi resource package, providing multi-language access to AWS
Apache License 2.0
430 stars 151 forks source link

UserPoolDomain.cloudfront_distribution_arn is not actually an ARN #2058

Open ecmonsen opened 1 year ago

ecmonsen commented 1 year ago

What happened?

According to documentation, UserPoolDomain has an output called cloudfront_distribution_arn that is actually a CloudFront Distribution URL, not an ARN.

Steps to reproduce

user_pool_domain = aws.cognito.UserPoolDomain(
    "user_pool_domain",
    certificate_arn=user_pool_custom_domain_cert_arn,
    domain=user_pool_custom_domain,
    user_pool_id=pool.id)

cf_hosted_zone = "Z2FDTNDATAQYW2"
user_pool_domain_dns_record = aws.route53.Record(
    "user_pool_domain_dns_record",
    aliases=[aws.route53.RecordAliasArgs(
        evaluate_target_health=False,
        name=user_pool_domain.cloudfront_distribution_arn,
        zone_id=cf_hosted_zone,
    )],
    name=user_pool_custom_domain,
    type="A",
    zone_id=dns_zone_id)

pulumi.export("user_pool_domain.cloudfront_distribution_arn", user_pool_domain.cloudfront_distribution_arn)

The exported value is

user_pool_domain.cloudfront_distribution_arn: "xxxxxxxxxxxxx.cloudfront.net"

Expected Behavior

I expect a variable containing a URL not to be named with 'arn'. Even though it is described as an URL in the documentation I was confused about whether this value should be used in the subsequent route53 alias.

Actual Behavior

It would be least confusing if this output was renamed cloudfront_distribution_url or similar.

Versions used

Python 3.8, with the output of pulumi about as follows.

CLI          
Version      3.35.3
Go Version   go1.18.3
Go Compiler  gc

Plugins
NAME    VERSION
aws     5.9.2
python  unknown

Host     
OS       darwin
Version  12.4
Arch     x86_64

Additional context

I appreciate the contributors' hard work. Pulumi is awesome.

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

viveklak commented 1 year ago

This seems to be due to https://github.com/hashicorp/terraform-provider-aws/issues/11666