You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, (as far as I can see), the Bucket construct doesn't export the WebsiteURL property. It would be useful if this was exported to prevent situations like the following where you have to hardcode bits of a URL
import*ascloudfrontfrom'@aws-cdk/aws-cloudfront'import*ass3from'@aws-cdk/aws-s3'import*ascdkfrom'@aws-cdk/cdk'exportdefaultclassStackextendscdk.Stack{constructor(parent: cdk.App,name: string,props?: cdk.StackProps){super(parent,name,props)constbucket=news3.Bucket(this,'Bucket',{publicReadAccess: true,websiteIndexDocument: 'index.html'})constdistribution=newcloudfront.CloudFrontWebDistribution(this,'Distribution',{aliasConfiguration: {acmCertRef: '<MY_CERT_ARN>',names: ['my.domain']},originConfigs: [{behaviors: [{defaultTtlSeconds: 10,isDefaultBehavior: true,maxTtlSeconds: 30,minTtlSeconds: 0}],customOriginSource: {// ideally here we could do something like:// domainName: bucket.websiteURL,domainName: `${bucket.bucketName}.s3-website-eu-west-1.amazonaws.com`,originProtocolPolicy: cloudfront.OriginProtocolPolicy.HttpOnly}}]})}
Planning to open a PR for this unless someone is already working on it :)
The text was updated successfully, but these errors were encountered:
Currently, (as far as I can see), the
Bucket
construct doesn't export theWebsiteURL
property. It would be useful if this was exported to prevent situations like the following where you have to hardcode bits of a URLPlanning to open a PR for this unless someone is already working on it :)
The text was updated successfully, but these errors were encountered: