This is an example bit of code written in Terraform at version 0.12.3
. This shows you the fundamentals of Terraform and some cool little utilities you can use to maximise your development process and ensure maximum code quality in an automated fashion.
- Creation of an ECS Cluster with a simple/example service
- Automated Semantic Versioning/Tagging and updating of CHANGELOG.md
- Creation of an S3 bucket for data storage
- Attachment of an IAM policy to acccess that bucket
Terraform module which creates EC2 instance(s) on AWS.
These types of resources are supported:
terraform init
terraform plan
terraform apply
Name | Description | Type | Default | Required |
---|---|---|---|---|
additional_user_data_script | extra stuff you want to put into your user-data.sh scripts | string | "echo example ecs cluster being provisioned" |
no |
ecs_cluster_name | Default name of the ECS cluster | string | "jamesg-test-cluster" |
no |
egress_cidr | list | [ "0.0.0.0/0" ] |
no | |
ingress_cidr | list | [ "0.0.0.0/0" ] |
no | |
region | region | string | "eu-west-1" |
no |
s3_bucket_name | string | "jamesg-data-test-bucket" |
no | |
vpc_cidr | string | "10.1.0.0/16" |
no |
Name | Description |
---|---|
cluster_id | |
ecr_registry_url | |
instance_role | |
instance_sg_id | |
s3_data_bucket | |
this_iam_instance_profile_id |
Code written by James Gonzalez