aws / aws-cdk-rfcs

RFCs for the AWS CDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Common API for Resources with Web Addresses

nathanpeck opened this issue · comments

One thing that I'd like to see improved is a consistent way of exposing the domain name of something. Currently there are a lot of different schemes for different constructs

LoadBalancer.dnsName
LambdaRestApi.url
CloudFrontWebDistribution.domainName
LoadBalancedFargateService.loadbalancer.dnsName
Bucket.domainName

I think ideally we should have a consistent interface similar to how the Connections interface works. Any construct that has an address on the internet should have an interface like MyConstruct.address, and that interface would have properties for fetching either a full URL, or just a domain name, or the port, etc. Right now I have to learn for each construct what the property is which that construct uses to expose its address on the internet.

This would be in addition to the raw native attributes from CloudFormation, just a higher level interface that makes it easier to get the address of whatever construct you just created.

Hi @nathanpeck,

Sorry that this has been left so long with no response. This has not been forgotten, and is still on the long-term to-do. If you would like to see this more urgently, feel free to put in a PR. Otherwise someone will update this issue when the status changes!

😸