8000 Add cf bucket policy for generated images by davisengeler · Pull Request #45 · Vibe-House-LLC/memeSRC · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add cf bucket policy for generated images #45

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

Merged
merged 1 commit into from
Jan 23, 2023

Conversation

davisengeler
Copy link
Contributor
@davisengeler davisengeler commented Jan 23, 2023

Description

This PR uses Amplify's override.ts methodology to add a bucket policy allowing Cloud Formation to publicly serve images from the private memesrc-generated-images bucket. It currently serves generated images publicly on i-dev.memesrc.com.

Policy deployed to dev

This should automatically work correctly for other Amplify envs (like when we deploy to beta and prod envs).

{
    "Version": "2008-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "cloudfront.amazonaws.com"
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::memesrc-generated-images191629-dev/public/*"
        }
    ]
}

Notes

  • This adds the policy to allow CF to read from the bucket, but doesn't actually set up the CF distribution itself.
  • In order to get a clean domain, I clickops'd my way into setting up to CF distribution for the dev env.
  • I also added a Route53 record for the CF distribution: i-dev.memesrc.com

@davisengeler davisengeler added the enhancement New feature or request label Jan 23, 2023
@davisengeler davisengeler self-assigned this Jan 23, 2023
Copy link
Collaborator
@AustinWoodard AustinWoodard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@davisengeler davisengeler merged commit 6045ef6 into public-generated-images Jan 23, 2023
@davisengeler davisengeler deleted the add-cf-bucket-policy branch January 23, 2023 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0