Skip to main content

Template Examples

This section provides practical examples of templates you can use and adapt for your organization.

Creating an AWS S3 Bucket Template

Follow this example to create a simple AWS S3 bucket. Venue.sh will take variables defined in your template steps and replace your template files with the actual values when used.

File Structure
.
├── providers.tf
├── main.tf
├── variables.tf
├── docs
│ └── index.md
providers.tf
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 6.0"
}
}
}

provider "aws" {
region = var.region

default_tags {
tags = {
"BusinessUnit" = "purplehotels-devops"
"Department" = "product-${{ values.environment }}"
"Team" = "purplehotels-devops"
"Stage" = "${{ values.environment }}"
"Support:Email" = "support@purplehotels.com"
"Support:Slack" = "purplehotels:support"
"Support:Url" = "https://purplehotels.atlassian.net/jira/servicedesk/projects/PH/queues/custom/4"
}
}
}
main.tf
resource "aws_s3_bucket" "${{ values.bucket_name }}_s3_bucket" {
bucket = "s3-${{ values.bucket_name }}"
}
variables.tf
variable "region" {
type = string
default = "${{ values.region }}"
}
docs/index.md
# ${{ values.bucket_name }} (Terraform AWS S3)

## Values

- name: ${{ values.bucket_name }}
- region: ${{ values.region }}
- environment: ${{ values.environment }}

When creating a template, each ${{ values.variable }} that you define in your files must also be defined in the variables step.

In the following example, we split the variables into two steps. While you can define your variables however you desire, we recommend splitting them into multiple steps.