Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
terraform
Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
Let's get on to the code! If you want just the code, you can find it here: https://gitlab.com/tangram-vision/oss/tangram-visions-blog/-/tree/main/2021.10.06_TerraformS3Upload
The for_each meta-argument loops over all files in the website directory tree, binding the file path (index.html, assets/normalize.css, etc.) to each.key, which can be used elsewhere in the block. The source_hash argument hashes the file, which helps Terraform determine when the file has changed and needs to be re-uploaded to the S3 bucket. (There's a similar etag argument, but it doesn't work when some kinds of S3 encryption are enabled.)
Sidenote: An open Terraform issue requesting native MIME type detection directs users to use this Terraform module.
Related posts
- Authorization and Amazon Verified Permissions - A New Way to Manage Permissions Part XII: Terraform
- Anyone like the new 2 part plan in 0.15.4?
- Retrieve token data from Kubernetes Service Account in Terraform
-
terraform VS selefra - a user suggested alternative
2 projects | 20 Mar 2023
- Terraform을 이용해서 Amazon IVS Live Streams 및 Chat 배포하기 (Deploy Amazon IVS Live Streams and Chat with Terraform)