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

aws-cloudfront: support KeyValueStore #28377

Closed
2 tasks
epiphone opened this issue Dec 15, 2023 · 9 comments · Fixed by #28473 or #28571
Closed
2 tasks

aws-cloudfront: support KeyValueStore #28377

epiphone opened this issue Dec 15, 2023 · 9 comments · Fixed by #28473 or #28571
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@epiphone
Copy link

Describe the feature

Hi! Are there any plans of supporting the new Cloudfront KeyValueStore feature in cdk?

Use Case

I'd like to

  1. create a key value store, and
  2. associate the store with a function.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.115.0

Environment details (OS name and version, etc.)

Ubuntu 22

@epiphone epiphone added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Dec 15, 2023
@github-actions github-actions bot added the @aws-cdk/aws-cloudfront Related to Amazon CloudFront label Dec 15, 2023
@pahud
Copy link
Contributor

pahud commented Dec 15, 2023

This is awesome!

https://aws.amazon.com/blogs/aws/introducing-amazon-cloudfront-keyvaluestore-a-low-latency-datastore-for-cloudfront-functions/

CloudFormation support is coming soon. We definitely should support that when it arrives to cloudformation.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Dec 15, 2023
@robc79
Copy link

robc79 commented Dec 20, 2023

Hello. Do we know when support for this will be added to CloudFormation and CDK? Curious as I have a project at work that wants to use this feature. Thank you.

@laurelmay
Copy link
Contributor

I see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-keyvaluestore.html is now documented; I can go ahead and take an initial stab at this if community contributions are something the team is interested in for this construct.

@laurelmay
Copy link
Contributor

Okay so I went ahead and got started in #28473; however, I am concerned about the usability of the construct. Reviewing the CloudFormation documentation and resource specification, it seems that at the moment CloudFormation doesn't actually support associating the Key Value Store with a function (in either direction). This means users would either need to do this manually or the user/library would need a custom resource.

@pahud is there any way to get an indication of whether there will be CloudFormation support for the associations? It seems silly for the library to go through the effort to create a custom resource to do so if it'll be supported natively in a couple revisions of the spec.

@pahud
Copy link
Contributor

pahud commented Dec 26, 2023

Yes looks like this resource is missing a functionArn property or maybe a new association resource. I will cut an internal ticket to relevant team to clarify but I can't guarantee the response. I would recommend to create an issue to https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues as well and link it back to this issue for more community visibility.

@pahud
Copy link
Contributor

pahud commented Dec 26, 2023

ticket ID V1175345449

@mergify mergify bot closed this as completed in #28473 Dec 29, 2023
mergify bot pushed a commit that referenced this issue Dec 29, 2023
This adds an initial resource to support creating a Key Value Store and
specifying an import source. Unfortunately, CloudFormation doesn't seem
to support specifying the `KeyValueStoreAssociations` property of a
function so there isn't a way to actually associate the store with a
function.


Closes #28377.

----

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

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

paulhcsun pushed a commit to paulhcsun/aws-cdk that referenced this issue Jan 5, 2024
This adds an initial resource to support creating a Key Value Store and
specifying an import source. Unfortunately, CloudFormation doesn't seem
to support specifying the `KeyValueStoreAssociations` property of a
function so there isn't a way to actually associate the store with a
function.


Closes aws#28377.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@pahud
Copy link
Contributor

pahud commented Jan 16, 2024

@laurelmay
Copy link
Contributor

Thanks! #28571 should implement that. Association support was in a separate service spec update after the initial launch but it should be ready now.

mergify bot pushed a commit that referenced this issue Jan 24, 2024
CloudFormation now supports specifying [`KeyValueStoreAssocations`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-keyvaluestoreassociation.html) on a `AWS::CloudFront::Function`. This adds that support to the CDK. Even though the field is plural (in CloudFormation and the API), [a function can have one value store](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/kvs-with-functions-associate.html) so the implementation here tries to provide a nicer API around that.

If a Key Value Store is specified, the function will default to `js-2.0` instead of `js-1.0`. Behavior for existing functions is retained. Additionally, an error is thrown if 1.0 is used.

Closes #28377.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Vandita2020 pushed a commit to Vandita2020/aws-cdk that referenced this issue Jan 30, 2024
CloudFormation now supports specifying [`KeyValueStoreAssocations`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-keyvaluestoreassociation.html) on a `AWS::CloudFront::Function`. This adds that support to the CDK. Even though the field is plural (in CloudFormation and the API), [a function can have one value store](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/kvs-with-functions-associate.html) so the implementation here tries to provide a nicer API around that.

If a Key Value Store is specified, the function will default to `js-2.0` instead of `js-1.0`. Behavior for existing functions is retained. Additionally, an error is thrown if 1.0 is used.

Closes aws#28377.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
SankyRed pushed a commit that referenced this issue Feb 8, 2024
CloudFormation now supports specifying [`KeyValueStoreAssocations`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-keyvaluestoreassociation.html) on a `AWS::CloudFront::Function`. This adds that support to the CDK. Even though the field is plural (in CloudFormation and the API), [a function can have one value store](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/kvs-with-functions-associate.html) so the implementation here tries to provide a nicer API around that.

If a Key Value Store is specified, the function will default to `js-2.0` instead of `js-1.0`. Behavior for existing functions is retained. Additionally, an error is thrown if 1.0 is used.

Closes #28377.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
4 participants