hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.76k stars 9.12k forks source link

[Enhancement]: Add support for `import_source` for `aws_cloudfront_key_value_store` #36524

Open maciej-nedza opened 6 months ago

maciej-nedza commented 6 months ago

Description

When creating Cloudfront key value store, user should be able to specify ImportSource, so he can populate kvs with the data from an S3 file - https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_CreateKeyValueStore.html#API_CreateKeyValueStore_RequestSyntax Currently, there is no direct support for populating the store using Terraform. There is a similar issue opened, but it's a bit different as it's for adding individual key-value pairs https://github.com/hashicorp/terraform-provider-aws/issues/35793.

Keep in mind that this functionality can be used only on creation, and not on update: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/kvs-with-functions-create.html says

An import-source parameter that lets you import key-value pairs from a file that is stored in an Amazon S3 bucket. Note that you can import from a file only on initial creation of the key value stores. For information about the format of the file, see Creating a file of key-value pairs.

Affected Resource(s) and/or Data Source(s)

Potential Terraform Configuration

resource "aws_cloudfront_key_value_store" "example" {
  name    = "example_name"
  import_source {
    source_type = "S3",
    source_arn = arn
  }
}

References

https://github.com/hashicorp/terraform-provider-aws/issues/34512 https://github.com/hashicorp/terraform-provider-aws/issues/35793 https://github.com/hashicorp/terraform-provider-aws/pull/35663

Would you like to implement a fix?

None

github-actions[bot] commented 6 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue