website
website copied to clipboard
Serverless Website Component: Added CloudFront Feture
This PR is the continuation of other PR at serverless/domain
https://github.com/serverless-components/domain/pull/6
This changeset passes s3 bucket name and CloudFront information to serverless/domain
component.
For the consumer, there will be few CloudFront properties
myWebsite:
component: "@serverless/website"
inputs:
cloudFront: # (Optional)
waitForCreateDistribution: true # (Optional) wait for create CloudFront distribution to complete
waitForUpdateDistribution: false # (Optional) wait for update CloudFront distribution to complete
customOrigin: true # (Optional) wait for custom origin to avoid s3 bucket redirect during cloudfront creation
CustomOrigin
is required to avoid CloudFront url redirection to s3 website redirection for initial 30-40 minutes.
Thanks again @Durgaprasad-Budhwani ... as mentioned in #6 ... we can't accept this change as it'd slow down the deployment of the entire stack. So we'll close this PR as well.
Also, the website
component is a great simple abstraction on top of everything AWS. It could even be used with different providers in the future. So I'd try to avoid introducing CloudFront specific inputs unless we absolutely have to.