packer-plugin-amazon icon indicating copy to clipboard operation
packer-plugin-amazon copied to clipboard

S3 data source

Open ilyaluk opened this issue 3 years ago • 0 comments

Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request. If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

It would be great to have AWS S3 data source in addition to SSM Parameter store and Secrets manager. I can't find any implementations in Packer plugins.

Use Case(s)

Our use case is following:

  • Create some resources for packer (subnet, security group, etc) using terraform
  • Export them to S3 as json object
  • Read the data from S3 using packer data source

While this is possible to implement using SSM, we would like not to depend on service we are not using in other production systems. At the moment we are manually copying file from S3 using aws cli, and passing it as vars, while using data source would be easier to use.

Potential configuration

data "amazon-s3" "basic-example" {
  bucket = "acme-bucket"
  key    = "packer-export/config.json"
}

locals {
  body       = data.amazon-s3.basic-example.body
  version_id = data.amazon-s3.basic-example.version_id
}

Potential References

https://developer.hashicorp.com/packer/plugins/datasources/amazon/parameterstore https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/s3_object

ilyaluk avatar Dec 09 '22 11:12 ilyaluk