Lightsail container as CloudFront Origin returns 404 No Such Service
I have created and deployed a Lightsail container and it is available publicly via HTTPS with a domain like containerservicename.123456abcdef.us-west-2.cs.amazonlightsail.com.
I have created a CloudFront Distribution and set this domain as the HTTPS origin. However, when I access the CloudFront distribution endpoint I get 404 No Such Service. Why?
I am using a normal CloudFront Distribution instead of a Lightsail Distribution as I need to add Lambda@Edge functions to it.
I have resolved it by adding the default domain name of the distribution to my container service by using the AWS CLI as per https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-adding-distribution-default-domain-to-container-service.
This can only by done via the CLI.
aws lightsail update-container-service --service-name ContainerServiceName --public-domain-names '{"_": ["example123.cloudfront.net"]}'
Relevant questions
Accessing files and CLI inside of container deployment in lightsail
Accepted Answerasked 11 days agoLightsail with WAF
Accepted Answerasked a year agoUsing subdomain with Lightsail Containers
asked a year agoLightsail container as CloudFront Origin returns 404 No Such Service
Accepted Answerasked 3 months agoLightsail container - connect to ElastiCache
asked 3 months agoCan I attach Lightsail disk to a Lightsailt container?
Accepted Answerasked 3 months agoLightsail container - specific public port
asked 4 months agoLightsail Distrbution, custom SSL certificate and custom domain
asked 4 months agolightsail cdn default document
asked 4 months agoLightsail Container Timeout
asked 2 months ago