aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.61k stars 3.91k forks source link

aws-cloudfront: support KeyValueStore #28377

Closed epiphone closed 9 months ago

epiphone commented 10 months ago

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

CDK version used

2.115.0

Environment details (OS name and version, etc.)

Ubuntu 22

pahud commented 10 months ago

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.

robc79 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

Okay so I went ahead and got started in https://github.com/aws/aws-cdk/pull/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 commented 10 months ago

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 commented 10 months ago

ticket ID V1175345449

github-actions[bot] commented 9 months ago

⚠️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.

pahud commented 9 months ago

Hi @kylelaker

The kv store association is defined in the function resource instead, see: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-functionconfig.html#cfn-cloudfront-function-functionconfig-keyvaluestoreassociations

I've seen your PR https://github.com/aws/aws-cdk/pull/28571 WIP. Thank you!

laurelmay commented 9 months ago

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