jamesridgway / aws-lambda-short-url

Use terraform to quickly setup your own Short URL generator using a custom domain with AWS API Gateway, CloudFront, Lambda, Route 53 and S3.
22 stars 12 forks source link

Hardcoded S3 IAM policy issue #2

Closed yardensachs closed 5 years ago

yardensachs commented 5 years ago

Hi,

Thanks for writing this!

One quick thing I noticed when looking at this:

This line has the subdomain hardcoded

https://github.com/jamesridgway/aws-lambda-short-url/blob/7540230fd0fede3f6f724915589a7ba64f9e5214/short_urls.tf#L105

Should change:

-        "arn:aws:s3:::jmsr.io/*"
+        "arn:aws:s3:::${var.short_url_domain}/*"
jamesridgway commented 5 years ago

Hi,

Thanks for checking out the project.

Good spot! I've pushed a fix to move that line of the policy over to using the variable.

Let me know if you have any other feedback.

Thanks, James