A simple HashiCorp Packer provisioner, utilizing github.com/hashicorp/go-getter to download files from Amazon S3 or S3 compatible endpoints.
Please refer to the official docs on plugin installation.
Using AWS_ACCESS_KEY
and AWS_SECRET_KEY
environment variables:
{
"builders": [],
"provisioners": [
{
"type": "s3file",
"url": "https://s3-region.amazonaws.com/bucket/path/key",
"destination": "/tmp/example"
}
]
}
Using inline S3 credentials and user-defined input variables:
{
"variables": {
"aws_access_key": "{{ env `AWS_ACCESS_KEY` }}",
"aws_secret_key": "{{ env `AWS_SECRET_KEY` }}"
},
"builders": [],
"provisioners": [
{
"type": "s3file",
"url": "https://s3-region.amazonaws.com/bucket/path/key",
"s3_access_key": "{{user `aws_access_key`}}",
"s3_secret_key": "{{user `aws_secret_key`}}",
"destination": "/tmp/example"
}
]
}
This provisioner is in response to @SwampDragons from this GitHub issue.