Skip to content

Conversation

@GuidoBR
Copy link
Contributor

@GuidoBR GuidoBR commented Apr 9, 2025

Change

  • Create endpoint for saving reports file url
  • Create S3 bucket with the necessary permissions

Does this PR introduce a breaking change?

{...}

What needs to be documented once your changes are merged?

{...}

Additional Comments

{...}

Copy link
Collaborator

@adamrefaey adamrefaey left a comment

Choose a reason for hiding this comment

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

@GuidoBR Nice work! We just need to make a few changes

@GuidoBR GuidoBR requested a review from adamrefaey April 10, 2025 20:12
conditions: {
// Restrict uploads to PDF and JPG files
StringLike: {
's3:x-amz-content-type': ['application/pdf', 'image/jpeg', 'image/jpg'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

we don't need to have validation here since that means we have the validation in many places and when we want to make any kind of change like add more file types, we'll have to change multiple places.

const uploadBucket = new s3.Bucket(this, `${appName}UploadBucket-${props.environment}`, {
bucketName: `${appName.toLowerCase()}-uploads-${props.environment}-${this.account}`,
removalPolicy: RemovalPolicy.RETAIN,
versioned: true, // Enable versioning in production
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe we don't need to use versioning.

Copy link
Collaborator

@adamrefaey adamrefaey left a comment

Choose a reason for hiding this comment

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

Nice work @GuidoBR !

@GuidoBR GuidoBR merged commit 2af29d9 into main Apr 11, 2025
1 check passed
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.

3 participants