aws / aws/aws-cdk

router53-targets: UserPoolDomainTarget uses deprecated cloudFrontDomainName

Open
#34,391 2 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-route53-targets documentation effort/small p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

The [`UserPoolDomainTarget`](https://github.com/aws/aws-cdk/blob/feadd6cb643b415ae002191ba2cb4622221a5af6/packages/%40aws-cdk/aws-route53-targets/lib/userpool-domain.ts#L14) target uses `cloudFrontDomainName` attribute, but it should use `.cloudFrontEndpoint`

This causes a deprecation warning during synthesis.

### Regression Issue

- [ ] Select this option if this issue appears to be a regression.

### Last Known Working CDK Library Version

_No response_

### Expected Behavior

Usage of `.cloudFrontEndpoint` and no deprecation warning.

### Current Behavior

```
[WARNING] aws-cdk-lib.aws_cognito.UserPoolDomain#cloudFrontDomainName is deprecated.
use `cloudFrontEndpoint` method instead.
This API will be removed in the next major release.
```

### Reproduction Steps

A construction that uses the ` route53_targets.UserPoolDomainTarget(...)`

```
user_pool_domain = user_pool.add_domain(
f'{construct_id}UserPoolDomain',
custom_domain=cognito.CustomDomainOptions(
domain_name=user_pool_domain_name,
certificate=domain_config.domain_certificate,
)
)

route53.ARecord(
self, f'{construct_id}UserPoolDomainARecord',
zone=domain_config.hosted_zone,
record_name=user_pool_domain_name,
target=route53.RecordTarget.from_alias(
route53_targets.UserPoolDomainTarget(user_pool_domain)
)
)
```

And then `cdk synth`

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### AWS CDK Library version (aws-cdk-lib)

v2.195.0

### AWS CDK CLI version

2.1003.0 (build b242c23)

### Node.js Version

v20.16.0

### OS

Windows

### Language

Python

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start in packages/@aws-cdk/aws-route53-targets/lib/userpool-domain.ts, the file linked in the issue, and inspect UserPoolDomainTarget. Reproduce the warning with the provided Python construction and cdk synth; done means the target uses cloudFrontEndpoint and synthesis no longer emits the deprecation warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.