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

Problem setting up cloudfront_distribution_config - error when applying config change #83

Closed
sebasrp opened this issue Apr 23, 2014 · 4 comments
Labels

Comments

@sebasrp
Copy link

sebasrp commented Apr 23, 2014

s3_id: <my id>
s3_secret: <my secret key>
s3_bucket: <bucket name>
max_age:
   "assets/*": 6000
   "*": 300
gzip:
   - .html
   - .css
   - .js
   - .xml
   - .md
gzip_zopfli: true
s3_endpoint: eu-west-1

cloudfront_distribution_id: <cloudfront distribution id>
cloudfront_distribution_config:
   default_cache_behavior:
     min_TTL: <%= 60 * 60 * 24 %>
   aliases:
     quantity: 1
     items:
       CNAME: <site url>

output of the command "s3_website cfg apply":

> s3_website cfg apply
Applying the configurations in s3_website.yml on the AWS services ...
Bucket <bucket name> now functions as a website
Bucket <bucket name> is now readable to the whole world
No redirects to configure for <bucket name> bucket
Detected an existing CloudFront distribution (id <cloudfront distribution id>) ...
AWS API call failed:
<?xml version="1.0"?>
<ErrorResponse xmlns="http://cloudfront.amazonaws.com/doc/2012-07-01/"><Error><Type>Sender</Type><Code>InvalidArgument</Code><Message>The parameter origin name must be a domain name.</Message></Error><RequestId>e01f8fdf-cb25-11e3-bf8d-bbfbb9b22e5a</RequestId></ErrorResponse> (GenericError)

I can´t figure out what is going on. If I comment all the "cloudfront_distribution_config" section, the command "s3_website cfg apply" succeeds.

@laurilehmijoki
Copy link
Owner

Your existing CloudFront distribution seems to have a setting that the s3_website cfg apply command cannot handle.

It's difficult to say more about this without detailed information about the settings of your existing CloudFront distribution.

Try removing the cloudfront_distribution_id setting from the s3_config.yml file and then run the cfg apply command again. This will create you a new distribution. You can then point your DNS entry into that distribution.

Please reopen this issue if the problem persists.

@sebasrp
Copy link
Author

sebasrp commented Apr 24, 2014

When removing the cloudfrount_distribution_id, I receive the following error:

> s3_website cfg apply
Applying the configurations in s3_website.yml on the AWS services ...
Bucket <site url> now functions as a website
Bucket <site url> is now readable to the whole world
No redirects to configure for <bucket name> bucket
Do you want to deliver your website via CloudFront, the CDN of Amazon? [y/N]
y
AWS API call failed:
<?xml version="1.0"?>
<ErrorResponse xmlns="http://cloudfront.amazonaws.com/doc/2012-07-01/"><Error><Type>Sender</Type><Code>InvalidArgument</Code><Message>The parameter origin name must be a domain name.</Message></Error><RequestId>df15cd38-cbf9-11e3-9afa-df9d431cf736</RequestId></ErrorResponse> (GenericError)

@laurilehmijoki
Copy link
Owner

I'm able to reproduce this issue.

laurilehmijoki added a commit that referenced this issue Apr 29, 2014
@laurilehmijoki
Copy link
Owner

Thanks for pointing out this problem! This bug is fixed in the version 1.7.4.

The cause of this bug was here: laurilehmijoki/configure-s3-website@1e65450#diff-5566f331b3ef32ac86a3d209894b50a8L148.

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

No branches or pull requests

2 participants