ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Terraform​Snippets-AWS

by Haydar Ciftci ALL

Terraform snippets for Sublime Text 3

Details

Installs

  • Total 6K
  • Win 2K
  • Mac 3K
  • Linux 1K
Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8
Windows 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
Mac 0 0 2 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1
Linux 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Terraform Snippets AWS

Terraform snippets for Sublime Text 2/3 for the AWS provider.

Requirements

Install package control by following instructions at https://packagecontrol.io/installation.

Installation

Install TerraformSnippets-AWS with Package Control and restart Sublime Text.

Manual

Clone the repository in your Sublime Text “Packages” directory:

git clone https://github.com/memoryleak/TerraformSnippets-AWS.git TerraformSnippets-AWS

The “Packages” directory is located at:

  • OS X: ~/Library/Application Support/Sublime Text 3/Packages/
  • Linux: ~/.Sublime Text 3/Packages/
  • Windows: %APPDATA%/Sublime Text 3/Packages/

Dependencies

  • None

Usage

In a .tf file type a resource or data source type and press Tab:

  • aws_instance expands to resource "aws_instance" "name" { ... }
  • data_aws_ami expands to data "aws_ami" "name" { ... }

Required arguments are tab stops. Optional arguments and blocks are listed as comments with a short description, uncomment the ones you need.

Generator

Snippets are generated from the AWS provider schema (terraform providers schema -json) and the provider's documentation, so names, types and required/optional flags match the provider exactly.

Requirements: Docker, or Terraform, Python 3 and Git.

bin/docker-build.sh            # in Docker: regenerate for the provider version in bin/provider/.terraform.lock.hcl
bin/docker-build.sh --upgrade  # in Docker: move to the latest provider version first

bin/build.sh [--upgrade]       # the same, with the tools installed on the host

The Docker image (see Dockerfile) only holds the toolchain; the repository is mounted into it, so the snippets are written straight into Snippets/. GitHub Actions runs the same image.

bin/build.sh dumps the schema, fetches the matching docs, runs bin/generate.py and validates the output with bin/check.py. Do not edit files in Snippets/ by hand, they are overwritten on every build.

The Snippets workflow checks on every pull request that the committed snippets match the generator, and every Monday opens a pull request when a new AWS provider version is available.

License

MIT

Author Information

Haydar Ciftci haydar.ciftci@gmail.com