Skip to content

Conversation

@ruiscosta
Copy link
Contributor

Summary of Changes

This PR introduces a set of significant improvements and fixes to the CDK stack, including renaming S3 buckets, enabling proper SPA routing in CloudFront, addressing deprecated constructs, and upgrading dependencies for compatibility and performance.


Details of Changes

1. S3 Bucket Naming Updates

  • Renamed S3 buckets for improved clarity and uniqueness.
  • Integrated UUID-based segment for dynamic and unique bucket names.

2. SPA Routing Fix for CloudFront

  • Updated CloudFront Distribution configuration to support client-side routing for SPA paths.
  • Configured errorResponses in CloudFront to redirect 403 and 404 errors to index.html, ensuring seamless navigation across routes.

3. Replaced Deprecated Constructs

  • Replaced S3Origin with S3BucketOrigin for compliance with updated AWS CDK standards.

4. Dependency Upgrades

  • Upgraded eslint to version 8.57.0 and aligned @typescript-eslint/eslint-plugin and @typescript-eslint/parser to version 5.46.1.
  • Upgraded aws-cdk, aws-cdk-lib, and related libraries to the latest compatible versions.

5. Code Refactoring

  • Refactored cloudfront-s3-website-construct.ts to align with new standards and improve readability and maintainability.
  • Streamlined policies to enforce TLS and ensure secure communication.

Breaking Changes

  • S3 Bucket Renaming: May require updates to downstream configurations or integrations.
  • Deprecated Constructs: Replaced deprecated S3Origin with S3BucketOrigin in CloudFront.

Issue(s) Addressed

  • Fixed SPA routing issues in CloudFront (e.g., /add-archive)
  • Improved compatibility by addressing deprecated constructs.

Checklist

  • Code changes are tested locally.
  • Bucket naming is backward compatible where possible.
  • Dependencies are updated without introducing new conflicts.
  • Documentation is updated with the changes (if applicable).

… conflicts

- Upgraded `eslint` to version 8.57.0
- Aligned `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` to version 5.46.1
- Resolved peer dependency conflicts preventing installation
@ruiscosta ruiscosta requested a review from ztanruan December 18, 2024 02:22
@ruiscosta ruiscosta self-assigned this Dec 18, 2024
@ztanruan ztanruan merged commit 01252ee into main Dec 18, 2024
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.

2 participants