Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonbrouse/terraform-style-guide
This repository gives coding conventions for Terraform's HashiCorp Configuration Language (HCL).
https://github.com/jonbrouse/terraform-style-guide
Last synced: 3 months ago
JSON representation
This repository gives coding conventions for Terraform's HashiCorp Configuration Language (HCL).
- Host: GitHub
- URL: https://github.com/jonbrouse/terraform-style-guide
- Owner: jonbrouse
- License: apache-2.0
- Created: 2016-12-02T19:43:16.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-04-26T15:16:19.000Z (over 2 years ago)
- Last Synced: 2024-05-29T06:13:40.786Z (6 months ago)
- Size: 24.4 KB
- Stars: 119
- Watchers: 6
- Forks: 49
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform Style Guide
**Table of Contents**
- [Introduction](#introduction)
- [Syntax](#syntax)
- [Spacing](#spacing)
- [Resource Block Alignment](#resource-block-alignment)
- [Comments](#comments)
- [Organizing Variables](#organizing-variables)
- [Naming Conventions](#naming-conventions)
- [File Names](#file-names)
- [Parameter, Meta-parameter and Variable Naming](#parameter-meta-parameter-and-variable-naming)
- [Resource Naming](#resource-naming)
- [Policies as Data Sources](#policies-as-data-sources)## Introduction
This repository gives coding conventions for Terraform's HashiCorp Configuration Language (HCL). Terraform allows infrastructure to be described as code. As such, we should adhere to a style guide to ensure readable and high quality code.
## Syntax
- Strings are in double-quotes.
### Spacing
Use 2 spaces when defining resources except when defining inline policies or other inline resources.
```
resource "aws_iam_role" "iam_role" {
name = "${var.resource_name}-role"
assume_role_policy = <