This is a template for Terraform modules.
It is part of our XOAP Automation Forces Open Source community library to give you a quick start into Infrastructure as Code deployments with Terraform.
We have a lot of Terraform modules that are Open Source and maintained by the XOAP staff.
Please check the links for more info, including usage information and full documentation:
We are using the following guidelines to write code and make it easier for everyone to follow a destinctive guideline. Please check these links before starting to work on changes.
Git Naming Conventions are an important part of the development process. They descrtibe how Branched, Commit Messages, Pull Requests and Tags should look like to make the easily understandebla for everybody in the development chain.
he Conventional Commits specification is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history; which makes it easier to write automated tools on top of.
The better a Pull Request description is, the better a review can understand and decide on how to review the changes. This improves implementation speed and reduces communication between the requester and the reviewer resulting in much less overhead.
Wiriting A Great Pull Request Description
Versioning is a crucial part for Terraform Stacks and Modules. Without version tags you cannot clearly create a stable environment and be sure that your latest changes won't crash your production environment (sure it still can happen, but we are trying our best to implement everything that we can to reduce the risk)
Naming Conventions for Terraform resources must be used.
For the first ime using this template necessary tools need to be installed. A script for PowerShell Core is provided under ./build/init.ps1
This script will install following dependencies:
This script configures:
- global git template under ~/.git-template
- global pre-commit hooks for prepare-commit-msg and commit-msg under ~/.git-template/hooks
- github actions:
- linting and checks for pull requests from dev to master/main
- automatic tagging and release creation on pushes to master/main
- dependabot updates
It currently supports the automated installation for macOS. Support for Windows and Linux will be available soon.
We provided a script under ./build/sync_template.ps1 to fetch the latest changes from this template repository. Please be aware that this is mainly a copy operation which means all your current changes have to be committed first and after running the script you have to merge this changes into your codebase.
Name | Version |
---|---|
terraform | >=1.1.6 |
aws | >= 4.8.0 |
Name | Version |
---|---|
aws | >= 4.8.0 |
Name | Source | Version |
---|---|---|
this_label | git::github.com/xoap-io/terraform-aws-misc-label | v0.1.1 |
Name | Type |
---|---|
aws_s3_bucket.this | resource |
aws_s3_bucket_acl.this | resource |
aws_s3_bucket_cors_configuration.this | resource |
aws_s3_bucket_logging.this | resource |
aws_s3_bucket_ownership_controls.this | resource |
aws_s3_bucket_policy.this | resource |
aws_s3_bucket_public_access_block.this | resource |
aws_s3_bucket_server_side_encryption_configuration.this | resource |
aws_s3_bucket_versioning.this | resource |
aws_s3_bucket_website_configuration.this | resource |
aws_caller_identity.this | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
acl | Default ACL to use when uploading files | string |
"private" |
no |
bucket_policy | Bucket policy statement to use | string |
"" |
no |
context | Default environmental context | object({ |
n/a | yes |
cors_allowed_header | Allowed headers for cors | list(string) |
[] |
no |
cors_allowed_methods | Allowed method for CORS access | list(string) |
[] |
no |
cors_allowed_origins | Allowed origins for CORS | list(string) |
[] |
no |
cors_exposed_header | Headers which are exposed through CORS requests | list(string) |
[] |
no |
disable_public_access | Disables or enabled the public access block | bool |
true |
no |
error_document | Error page document in S3 bucket | string |
"404.html" |
no |
index_document | Index page document in S3 bucket | string |
"index.html" |
no |
is_logging | Determines if the bucket is intended for logging purposes | bool |
false |
no |
kms_arn | KMS Key to use | string |
n/a | yes |
logging_bucket | Target bucket for logging | string |
n/a | yes |
name | Name of the bucket to create | string |
n/a | yes |
origin_path | Path in S3 bucket for hosted files, with leading slash | string |
"/" |
no |
routing_rules | A json array containing routing rules describing redirect behavior and when redirects are applied | map(string) |
{ |
no |
versioning | Enables or disables bucket versioning | bool |
true |
no |
website_enabled | Enables or disabled static website functionality | bool |
false |
no |
Name | Description |
---|---|
arn | ARN of the created S3 bucket |
domain_name | Regional domain name of the created S3 bucket |
id | ID of the created S3 bucket |
website_domain | Website domain of the created S3 bucket if hosting is enabled |
website_endpoint | Website endpoint of the created S3 bucket if hosting is enabled |