https://github.com/ccnmtl/tfmodules
reusable terraform modules
https://github.com/ccnmtl/tfmodules
Last synced: about 2 months ago
JSON representation
reusable terraform modules
- Host: GitHub
- URL: https://github.com/ccnmtl/tfmodules
- Owner: ccnmtl
- Created: 2016-09-20T10:37:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-09T19:39:15.000Z (over 4 years ago)
- Last Synced: 2025-02-16T00:43:55.758Z (4 months ago)
- Language: HCL
- Size: 9.77 KB
- Stars: 2
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
## CTL Terraform Modules
Reusable [terraform](https://terraform.io/) modules for our
infrastructure.### django_static
Static file configs for django apps.
* IAM User
* S3 bucket
* Cloudfront DistributionS3 bucket is public-readable with CORS setup.
IAM user only has access to the S3 bucket and no other AWS resources.
Cloudfront distribution configured to use the S3 bucket as origin.#### Example Usage
module "django-example" {
source = "github.com/ccnmtl/tfmodules//django_static"
app = "example"
env = "prod"
}output "django-example-access_key" {
value = module.django-example.access_key
}output "django-example-secret_key" {
value = module.django-example.secret_key
}output "django-example-bucket" {
value = module.django-example.s3_bucket
}output "django-example-cloudfront" {
value = module.django-example.cloudfront
}Running `terraform apply` results in output like:
django-example-access_key = AKIAI37SSEC5TED26RSQ
django-example-secret_key = *******************
django-example-bucket = ctl-tfexample-static-prod
django-example-cloudfront = d3t6vzw86uqlhs.cloudfront.netWhich you can then use to configure your Django app and run `manage.py
collectstatic && manage.py compress`#### Variables
* `app`
* `env`
* `prefix` - defaults to `ctl`#### Outputs
* `access_key` + `secret_key` - credentials for the IAM user
* `s3_bucket` - name of the S3 bucket created
* `cloudfront` - cloudfront domain### vault_storage
S3 storage for Vault
* IAM User
* S3 bucketS3 bucket is restricted to just the IAM Vault user
IAM user only has access to the S3 bucket and no other AWS resources.#### Example Usage
module "vault-example" {
source = "github.com/ccnmtl/tfmodules//vault_storage"
env = "prod"
}output "vault-example-access_key" {
value = module.vault-example.access_key
}output "vault-example-secret_key" {
value = module.vault-example.secret_key
}output "vault-example-bucket" {
value = module.vault-example.s3_bucket
}Running `terraform apply` results in output like:
vault-example-access_key = AKIA3I7SSEC5TED26RSQ
vault-example-secret_key = *******************
vault-example-bucket = ctl-vault-prodWhich you can then use to configure Vault.
#### Variables
* `env`
* `prefix` - defaults to `ctl`#### Outputs
* `access_key` + `secret_key` - credentials for the IAM user
* `s3_bucket` - name of the S3 bucket created