Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parameter origin domain name error #1296

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

flo-kn
Copy link
Contributor

@flo-kn flo-kn commented Oct 27, 2022

The value websiteEndpoint seems to produce an error on $ pulumi up command 🙋‍♂️❌

  aws:cloudfront:Distribution (cdn):
    error: 1 error occurred:
        * error creating CloudFront Distribution: InvalidArgument: The parameter Origin DomainName does not refer to a valid S3 bucket.
        status code: 400, request id: 123456-2345-7890-1234-123456789

Use bucketRegionalDomainName instead!

Think , a longterm solution could be to exchange the legacy origin access identity (OAI) with origin access control (OAC). See AWS Docs. Lemme know what you think! I could over support on the migration.

Fix parameter origin domain name error
`websiteEndpoint` seems to produce this error. Use bucketname instead
```
The parameter Origin DomainName does not refer to a valid S3 bucket
```
@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-example-tests on the PR

@cnunciato
Copy link
Contributor

cnunciato commented Oct 27, 2022

Thanks for the submission @flo-kn! We'll take a look.

Did you make any additional customizations to the generated program to produce this error? If so, would you mind sharing what they were? And out of curiosity, which AWS region were you deploying to?

@flo-kn
Copy link
Contributor Author

flo-kn commented Oct 27, 2022

Hi @cnunciato,

I modified parts of the code for my own purpose, e.g. I migrated to OAC. That's when I bumped into the error.

However, before submitting this PR, I started again fresh on a whole new environment (pulumi stack) with code from pulumi/examples master to make sure that the error did not come from some of my modifications and again saw the error.

Here my git diff on the repo in the ./pulumi-ts-static-website dir:

diff --git a/aws-ts-static-website/index.ts b/aws-ts-static-website/index.ts
--- a/aws-ts-static-website/index.ts
+++ b/aws-ts-static-website/index.ts
@@ -174,7 +174,7 @@ const distributionArgs: aws.cloudfront.DistributionArgs = {
     origins: [
         {
             originId: contentBucket.arn,
-            domainName: contentBucket.websiteEndpoint,
+            domainName: contentBucket.bucketRegionalDomainName,
             s3OriginConfig: {
                 originAccessIdentity: originAccessIdentity.cloudfrontAccessIdentityPath,
             },

So no other customizations, at least not in the source code.

Region in the profile was: eu-central-1:

$ aws configure get region 
eu-central-1

Let me know in case you need more infos. Happy to help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants