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

feat(cloudfront): adding support for inline KeyValueStore sources #29419

Merged
merged 17 commits into from
Apr 8, 2024

Conversation

ssennettau
Copy link
Contributor

@ssennettau ssennettau commented Mar 9, 2024

Issue # (if applicable)

Closes #29204.

Reason for this change

CloudFront's KeyValueStore has the option to initialize the store using a file, imported with an ImportSource. The CloudFormation resource does not support inline declarations, so the current L2 construct does not support inline either. To provide easier

Description of changes

Added the InlineImportSource, along with the companion static method to cloudfront.KeyValueStore.

📄 Temporary Files

Since inline declarations are not supported by the underlying L1 construct, I have resorted to creating a temporary file which will be handled as a CDK asset. This is done utilizing elements of the cdk core, and follows the pattern used by the s3-deployment. This does also couple the KeyValueStore to the assets in S3, though the only other option would seem to be creating its own S3 bucket.

This is the only case I'm aware of in CDK of handling a temporary file like this. As far as I'm aware, all design principles are met, but this seems something of an edge case.

Open to suggestions and reviews.

Description of how you validated changes

New Unit Tests and Integration Test implemented

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Mar 9, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team March 9, 2024 09:58
@github-actions github-actions bot added effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Mar 9, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@ssennettau ssennettau changed the title feat(cloudfront): Adding support for inline KeyValueStore sources feat(cloudfront): adding support for inline KeyValueStore sources Mar 9, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review March 9, 2024 11:44

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@ssennettau ssennettau marked this pull request as ready for review March 10, 2024 01:01
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Mar 12, 2024
Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

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

Thanks 👍 Just a minor documentation adjustment

packages/aws-cdk-lib/aws-cloudfront/README.md Outdated Show resolved Hide resolved
@aws-cdk-automation aws-cdk-automation added pr/needs-maintainer-review This PR needs a review from a Core Team Member and removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Mar 30, 2024
Copy link
Contributor

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

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

Amazing, thank you for the contribution.

Copy link
Contributor

mergify bot commented Apr 8, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Apr 8, 2024
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 261bb26
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 5675010 into aws:main Apr 8, 2024
12 checks passed
Copy link
Contributor

mergify bot commented Apr 8, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(cloudfront): Support inline data as KeyValueStore import source
4 participants