This module creates an S3 bucket for storage purposes. It is created with server-side AES256 encryption.
- name: bucky type: aws-s3 bucket_name: dev-runx-bucky cors_rule: allowed_methods: - "PUT" max_age_seconds: 3600 allowed_origins: - "runx.dev"
To upload files to s3, just set the
files field to the path (relative to the yaml or absolute) of a local directory.
On the next apply, all the files and subdirectories will be automatically uploaded to the bucket!
So for example if you called the module like so:
- type: s3 name: blah bucket_name: "opta-is-testing-cloudfront" files: "../blah"
../blah directory had the following structure:
../blah ├── hello2.html ├── hello2.txt ├── hello3.txt └── subdir └── hello3.html
Then Opta would upload 4 files to your S3 bucket, with the S3 keys being
Opta will also catch any changes to the files on the next
opta apply and will push updates as needed. Opta supports
extensive MIME parsing, so it also makes sure to set the content type correctly.
This module can be linked to Opta’s cloudfront module in order to serve static files.
To securely work with cloudfront, the module additionally creates a Cloudfront Origin Access Identity with read privileges to be used by cloudfront to access its contents.
When linked to a k8s-service or IAM role/user, this adds the necessary IAM permissions to read (e.g. list objects and get objects) and/or write (e.g. list, get, create, destroy, and update objects) to the given s3 bucket. The current permissions are, “read” and “write”, defaulting to “write” if none specified
||The name of the bucket to create.||
||Create a same-region bucket for replica storage (needed for compliance). Can be added later without destroying the resource.||
||Block all public access.||
||A custom s3 policy json/yaml to add.||
||A custom cors policy.||
||The path (can be relative to the opta yaml) to a directory holding files which you wish to upload to the s3 bucket. The files will have the same names and any subdirectories will similarly be included and uploaded as subdir/path/filename.||
||The id of the S3 bucket|
||The arn of the S3 bucket|
||The path of the cloud front origin access identity created for reading objects in this bucket|