├── .gitignore ├── .vscodeignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── images ├── logo-header-black@2x-c6b59644.png └── screenshot.png ├── package-lock.json ├── package.json ├── scripts └── build.js ├── snippets └── terraform.json ├── src ├── backends │ ├── artifactory.json │ ├── atlas.json │ ├── azure.json │ ├── consul.json │ ├── etcd.json │ ├── gcs.json │ ├── http.json │ ├── local.json │ ├── s3.json │ └── swift.json ├── configuration │ ├── module.json │ ├── output.json │ ├── resources.json │ └── variable.json ├── modules │ ├── bitbucket.json │ ├── git.json │ ├── github.json │ ├── mercurial.json │ └── s3.json ├── providers │ ├── archive.json │ ├── arukas.json │ ├── atlas.json │ ├── aws.json │ ├── azurerm.json │ ├── bitbucket.json │ ├── centurylinkcloud.json │ ├── chef.json │ ├── cloudflare.json │ ├── cloudstack.json │ ├── cobbler.json │ ├── consul.json │ ├── datadog.json │ ├── digitalocean.json │ ├── dnsimple.json │ ├── dnsmadeeasy.json │ ├── docker.json │ ├── dyn.json │ ├── fastly.json │ ├── github.json │ ├── gitlab.json │ ├── google.json │ ├── grafana.json │ ├── heroku.json │ ├── ibmcloud.json │ ├── influxdb.json │ ├── kubernetes.json │ ├── librato.json │ ├── logentries.json │ ├── mailgun.json │ ├── mysql.json │ ├── newrelic.json │ ├── openstack.json │ ├── opsgenie.json │ ├── packet.json │ ├── pagerduty.json │ ├── postgresql.json │ ├── powerdns.json │ ├── rabbitmq.json │ ├── random.json │ ├── rundeck.json │ ├── scaleway.json │ ├── softlayer.json │ ├── statuscake.json │ ├── template.json │ ├── tls.json │ ├── triton.json │ ├── ultradns.json │ ├── vault.json │ ├── vmware-vcloud-director.json │ └── vmware-vsphere.json ├── provisioners │ ├── chef.json │ ├── connection.json │ ├── file.json │ ├── local-exec.json │ ├── null-resource.json │ └── remote-exec.json └── state │ └── terraform.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | 39 | # custom 40 | .vscode 41 | .idea -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | typings/** 3 | out/test/** 4 | test/** 5 | src/** 6 | **/*.map 7 | .gitignore 8 | tsconfig.json 9 | vsc-extension-quickstart.md 10 | yarn.lock -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | # [2.1.0](https://github.com/rixrix/vscode-terraform-snippets/compare/v2.0.1...v2.1.0) (2018-06-24) 3 | 4 | 5 | ### Features 6 | 7 | * **azurerm_kubernetes_cluster:** support for azurerm_kubernetes_cluster (AKS) ([#45](https://github.com/rixrix/vscode-terraform-snippets/issues/45)) ([1f8a7e7](https://github.com/rixrix/vscode-terraform-snippets/commit/1f8a7e7)) 8 | 9 | 10 | 11 | 12 | ## [2.0.1](https://github.com/rixrix/vscode-terraform-snippets/compare/v2.0.0...v2.0.1) (2018-01-30) 13 | 14 | 15 | 16 | 17 | # [2.0.0](https://github.com/rixrix/vscode-terraform-snippets/compare/v1.10.7...v2.0.0) (2018-01-29) 18 | 19 | 20 | ### Bug Fixes 21 | 22 | * Fix cloudflare_record snippet ([7ff046c](https://github.com/rixrix/vscode-terraform-snippets/commit/7ff046c)) 23 | * **azure:** remove azurerm account deprecated field, fixes [#38](https://github.com/rixrix/vscode-terraform-snippets/issues/38) ([17f1ed4](https://github.com/rixrix/vscode-terraform-snippets/commit/17f1ed4)) 24 | 25 | 26 | ### Features 27 | 28 | * Add support for OpsGenie, closes [#17](https://github.com/rixrix/vscode-terraform-snippets/issues/17) ([984ca29](https://github.com/rixrix/vscode-terraform-snippets/commit/984ca29)) 29 | * **ibm:** add IBM Cloud snippets ([#39](https://github.com/rixrix/vscode-terraform-snippets/issues/39)) ([5ed3446](https://github.com/rixrix/vscode-terraform-snippets/commit/5ed3446)) 30 | 31 | 32 | 33 | 34 | ## [1.9.1](https://github.com/rixrix/vscode-terraform-snippets/compare/v1.9.0...v1.9.1) (2017-07-24) 35 | 36 | 37 | ### Bug Fixes 38 | 39 | * **aws:** fix missing required params for aws_instance ([b8d59b2](https://github.com/rixrix/vscode-terraform-snippets/commit/b8d59b2)) 40 | * Arukas ([84067d2](https://github.com/rixrix/vscode-terraform-snippets/commit/84067d2)) 41 | * minor script fixes ([d14dcc6](https://github.com/rixrix/vscode-terraform-snippets/commit/d14dcc6)) 42 | 43 | 44 | ### Features 45 | 46 | * **Archive:** add Archive support ([868e544](https://github.com/rixrix/vscode-terraform-snippets/commit/868e544)) 47 | * **Atlas:** add Atlas support ([0b58366](https://github.com/rixrix/vscode-terraform-snippets/commit/0b58366)) 48 | * **aws:** add API Gateway Resources ([a1eb78e](https://github.com/rixrix/vscode-terraform-snippets/commit/a1eb78e)) 49 | * **AWS:** Add AWS regions ([b95946e](https://github.com/rixrix/vscode-terraform-snippets/commit/b95946e)) 50 | * **Azure:** Add Azure Resource Manager support ([5b0bdcc](https://github.com/rixrix/vscode-terraform-snippets/commit/5b0bdcc)) 51 | * **backend:** add backend support ([e07c60f](https://github.com/rixrix/vscode-terraform-snippets/commit/e07c60f)) 52 | * **basic:** input, output, module, resource, provider ([a481308](https://github.com/rixrix/vscode-terraform-snippets/commit/a481308)) 53 | * **basics:** add depends_on, module-xxx, template, provisioner ([ffebd98](https://github.com/rixrix/vscode-terraform-snippets/commit/ffebd98)) 54 | * **bitbucket:** add support for bitbucket ([80801b1](https://github.com/rixrix/vscode-terraform-snippets/commit/80801b1)) 55 | * **CenturyLinkCloud:** add CenturyLinkCloud support ([40b3f89](https://github.com/rixrix/vscode-terraform-snippets/commit/40b3f89)) 56 | * **Chef:** add Chef support ([f21a41b](https://github.com/rixrix/vscode-terraform-snippets/commit/f21a41b)) 57 | * **Chef provisioner:** add Chef provisioner support ([ba7ba5b](https://github.com/rixrix/vscode-terraform-snippets/commit/ba7ba5b)) 58 | * **Cloudflare:** add Cloudflare support ([c50950e](https://github.com/rixrix/vscode-terraform-snippets/commit/c50950e)) 59 | * **Cloudstack:** add Cloudstack support ([ff0cf09](https://github.com/rixrix/vscode-terraform-snippets/commit/ff0cf09)) 60 | * **Cobbler:** add Cobbler support ([5cb3b45](https://github.com/rixrix/vscode-terraform-snippets/commit/5cb3b45)) 61 | * **consul:** add support for Consule ([6439352](https://github.com/rixrix/vscode-terraform-snippets/commit/6439352)) 62 | * **Datadog:** add Datadog support ([7e643c0](https://github.com/rixrix/vscode-terraform-snippets/commit/7e643c0)) 63 | * **digital ocean:** add digital ocean ([813d50f](https://github.com/rixrix/vscode-terraform-snippets/commit/813d50f)) 64 | * **DNSimple:** add DNSimple support ([3c95044](https://github.com/rixrix/vscode-terraform-snippets/commit/3c95044)) 65 | * **DNSMadeEasy:** add DNSMadeEasy support ([8d0cc7a](https://github.com/rixrix/vscode-terraform-snippets/commit/8d0cc7a)) 66 | * **Dyn:** add Dyn support ([aedc7a2](https://github.com/rixrix/vscode-terraform-snippets/commit/aedc7a2)) 67 | * **Fastly:** add Fastly support ([51004cf](https://github.com/rixrix/vscode-terraform-snippets/commit/51004cf)) 68 | * **github:** add github support ([6d45754](https://github.com/rixrix/vscode-terraform-snippets/commit/6d45754)) 69 | * **Google Cloud:** Add Google Cloud support ([9d74477](https://github.com/rixrix/vscode-terraform-snippets/commit/9d74477)) 70 | * **Grafana:** add Grafana support ([cad904d](https://github.com/rixrix/vscode-terraform-snippets/commit/cad904d)) 71 | * **heroku:** add support for Heroku ([5922742](https://github.com/rixrix/vscode-terraform-snippets/commit/5922742)) 72 | * **InfluxDB:** add InfluxDB support ([dd3914d](https://github.com/rixrix/vscode-terraform-snippets/commit/dd3914d)) 73 | * **Librato:** add Librato support ([dad4541](https://github.com/rixrix/vscode-terraform-snippets/commit/dad4541)) 74 | * **Logentries:** add Logentries support ([6effd4f](https://github.com/rixrix/vscode-terraform-snippets/commit/6effd4f)) 75 | * **Mailgun:** add Mailgun support ([5eefc9e](https://github.com/rixrix/vscode-terraform-snippets/commit/5eefc9e)) 76 | * **MySQL:** Add MySQL support ([75c7076](https://github.com/rixrix/vscode-terraform-snippets/commit/75c7076)) 77 | * **Packet:** add Packet support ([97425a6](https://github.com/rixrix/vscode-terraform-snippets/commit/97425a6)) 78 | * **PagerDuty:** add PagerDuty support ([043c314](https://github.com/rixrix/vscode-terraform-snippets/commit/043c314)) 79 | * **PostgreSQL:** add PostgreSQL support ([6b72076](https://github.com/rixrix/vscode-terraform-snippets/commit/6b72076)) 80 | * **PowerDNS:** add PowerDNS support ([995fe41](https://github.com/rixrix/vscode-terraform-snippets/commit/995fe41)) 81 | * **RabbitMQ:** add RabbitMQ support ([846dd93](https://github.com/rixrix/vscode-terraform-snippets/commit/846dd93)) 82 | * **Random:** add Random support ([6121232](https://github.com/rixrix/vscode-terraform-snippets/commit/6121232)) 83 | * **Rundeck:** add Rundeck support ([10ab974](https://github.com/rixrix/vscode-terraform-snippets/commit/10ab974)) 84 | * **scaleway:** add scaleway support ([406e31b](https://github.com/rixrix/vscode-terraform-snippets/commit/406e31b)) 85 | * **snippets:** initial terraform snippets ([db9f56a](https://github.com/rixrix/vscode-terraform-snippets/commit/db9f56a)) 86 | * add Arukas ([1f5b2b5](https://github.com/rixrix/vscode-terraform-snippets/commit/1f5b2b5)) 87 | * add GitLab snippets ([fadb545](https://github.com/rixrix/vscode-terraform-snippets/commit/fadb545)) 88 | * add Kubernetes. closes [#12](https://github.com/rixrix/vscode-terraform-snippets/issues/12) ([33690da](https://github.com/rixrix/vscode-terraform-snippets/commit/33690da)) 89 | * add New Relic, closes [#13](https://github.com/rixrix/vscode-terraform-snippets/issues/13) ([8194b7d](https://github.com/rixrix/vscode-terraform-snippets/commit/8194b7d)) 90 | * **UltraDNS:** add UltraDNS support ([5084768](https://github.com/rixrix/vscode-terraform-snippets/commit/5084768)) 91 | * add Vault support. closes [#22](https://github.com/rixrix/vscode-terraform-snippets/issues/22) ([c12c454](https://github.com/rixrix/vscode-terraform-snippets/commit/c12c454)) 92 | * **softlayer:** add softlayer support ([74d5138](https://github.com/rixrix/vscode-terraform-snippets/commit/74d5138)) 93 | * **StatusCake:** add StatusCake support ([b0d77b1](https://github.com/rixrix/vscode-terraform-snippets/commit/b0d77b1)) 94 | * **Terraform:** add Terraform support ([f5123af](https://github.com/rixrix/vscode-terraform-snippets/commit/f5123af)) 95 | * **TLS:** add TLS support ([aa69464](https://github.com/rixrix/vscode-terraform-snippets/commit/aa69464)) 96 | * **Triton:** add Triton support ([c4444ff](https://github.com/rixrix/vscode-terraform-snippets/commit/c4444ff)) 97 | * **VMware vSphere:** add VMware vSphere support ([6004722](https://github.com/rixrix/vscode-terraform-snippets/commit/6004722)) 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Richard Sentino 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # News 2 | > ## I'm looking for volunteers to help me maintain this project. I don't have enough time to do some of the work. 3 | 4 | # Advanced Terraform Snippets for Visual Studio Code 5 | 6 | Provides **550+** code snippets of Hashicorp's [Terraform](https://www.terraform.io/) cloud orchestration tool for [Visual Studio Code](https://code.visualstudio.com/). 7 | 8 | ## Usage 9 | Type part of the snippets `tf`, press `enter`: 10 | 11 | ### Sample Snippets 12 | 13 | #### Input / Output / Module 14 | ```bash 15 | tf-variable // generates `variable "myVariable" { }` 16 | tf-variable-default // generates `variable "myVariable" { default = ""}` 17 | tf-output // generates `output "myOutputName" { value = ""}` 18 | tf-module // generates `module "myModuleName" { source = ""}` 19 | tf-module-github // generates `module "myModuleName" { source = "github.com/username"}` 20 | tf-module-github-private // generates `module "myModuleName" { source = "git::https://MACHINE-USER:MACHINE-PASS@github.com/username"}` 21 | tf-module-bitbucket // generates `module "myModuleName" { source = "bitbucket.org/username"}` 22 | tf-module-git // generates `module "myModuleName" { source = "git://"}` 23 | tf-module-mercurial // generates `module "myModuleName" { source = "hg::http://"}` 24 | tf-module-s3 // generates `module "myModuleName" { source = "s3::https://"}` 25 | ``` 26 | 27 | #### Providers 28 | 29 | ```bash 30 | tf-aws // generates `provider "aws" { ... }` 31 | tf-aws-profile // generates `provider "aws" { profile = "", shared_credentials_file="",... }` 32 | tf-azurerm // generates `provider "azurerm" { ... }` 33 | tf-google // generates `provider "google" { ... }` 34 | tf-openstack // generates `provider "openstack" { ... }` 35 | tf-ibm_provider // generates `provider "ibm" { ... }` 36 | ``` 37 | 38 | #### Backends / Remote State 39 | 40 | ```bash 41 | tf-backend-azure // generates `data "terraform_remote_state" "xxx" { backend = "azure" ... }` 42 | tf-backend-s3 // generates `data "terraform_remote_state" "xxx" { backend = "s3" ... }` 43 | tf-backend-gcs // generates `data "terraform_remote_state" "xxx" { backend = "gcs" ... }` 44 | tf-backend-consul // generates `data "terraform_remote_state" "xxx" { backend = "consul" ... }` 45 | ``` 46 | #### Handy shortcuts for AWS Regions 47 | 48 | ```bash 49 | tf-aws-region-us-east-1 // generates US East (N.Virginia) `us-east-1` 50 | tf-aws-region-ap-south-1 // generates Asia Pacific (Mumbai) `ap-south-1` 51 | 52 | plus all other AWS regions 53 | 54 | ``` 55 | 56 | #### Others + more, see supported list 57 | ```bash 58 | tf-depends_on // generates `depends_on []` 59 | tf-provisioner-connection // generates `provisioner "file" { ... }` 60 | tf-provisioner-file // generates `provisioner "file" { ... }` 61 | tf-provisioner-local-exec // generates `provisioner "local-exec" { ... }` 62 | tf-provisioner-remote-exec // generates `provisioner "remote-exec" { ... }` 63 | tf-provisioner-null_resource // generates `resource "null_resource" { ... }` 64 | tf-template_file // generates `data "template_file" "init" { ... }` 65 | tf-template_file-inline // generates `data "template_file" "init" { ... }` inline 66 | tf-template_cloudinit_config // generates `data "template_cloudinit_config" "config" { ... }` inline 67 | ``` 68 | 69 | ![Use Extension](https://raw.githubusercontent.com/rixrix/vscode-terraform-snippets/master/images/screenshot.png) 70 | 71 | Alternatively, press `Ctrl`+`Space` (Windows, Linux) or `Cmd`+`Space` (OSX) to activate snippets from within the editor. 72 | 73 | ## Supported Snippets 74 | 75 | ### Input, Output, Module 76 | 77 | * [Input variables](https://www.terraform.io/intro/getting-started/variables.html) 78 | * [Output Variables](https://www.terraform.io/intro/getting-started/outputs.html) 79 | * [Modules](https://www.terraform.io/intro/getting-started/modules.html) 80 | 81 | ### Provisioners 82 | 83 | * [Resource](https://www.terraform.io/intro/getting-started/provision.html), [connection](https://www.terraform.io/docs/provisioners/connection.html), [file](https://www.terraform.io/docs/provisioners/file.html), [local-exec](https://www.terraform.io/docs/provisioners/local-exec.html), [remote-exec](https://www.terraform.io/docs/provisioners/remote-exec.html) 84 | * [null_resource](https://www.terraform.io/docs/provisioners/null_resource.html), [file](https://www.terraform.io/docs/providers/template/d/file.html), [cloudinit](https://www.terraform.io/docs/providers/template/d/cloudinit_config.html), [Chef provisioner](https://www.terraform.io/docs/provisioners/chef.html) 85 | 86 | ### Providers 87 | 88 | * Amazon Web Services, Google Cloud, Microsoft Azure, CloudStack 89 | * Consul, Docker, Heroku, DigitalOcean, Bitbucket 90 | * GitHub, Archive, Atlas, Chef, Cloudflare 91 | * MySQL, PostgreSQL, SoftLayer, Scaleway, CenturyLinkCloud 92 | * Cobbler, Datadog, DNSMadeEasy, DNSimple, Dyn 93 | * Fastly, Grafana, InfluxDB, Librato, Logentries 94 | * Mailgun, Packet, PagerDuty, PowerDNS, RabbitMQ 95 | * Random, Rundeck, StatusCake, Terraform, TLS, 96 | * Triton, UltraDNS, OpenStack, VMware vCloud Director, VMware vSphere 97 | * GitLab, Arukas, New Relic, Kubernetes, Vault, OpsGenie, IBM Cloud 98 | 99 | ### Backends / Remote State 100 | 101 | * Artifactory, Atlas, Microsoft Azure Storage, Consul, Etcd, 102 | * Google Cloud Storage, Http, Local, Manta, Amazon S3, Openstack Swift 103 | 104 | ## Requirements / Dependencies 105 | 106 | Install the [Terraform Language](https://marketplace.visualstudio.com/items?itemName=mauve.terraform) support extension from the marketplace published by "Mikael Olenfalk" 107 | 108 | ## Installation 109 | 110 | 1. Install Visual Studio Code 1.x or higher 111 | 2. Launch Code 112 | 3. From the command palette `Ctrl`-`Shift`-`P` (Windows, Linux) or `Cmd`-`Shift`-`P` (OSX) 113 | 4. Select `Install Extension` 114 | 5. Choose the extension 115 | 6. Reload Visual Studio Code 116 | 117 | ## Development 118 | 119 | ### How to build 120 | 121 | - `npm run build:snippets` 122 | - Generates a single file in "snippets/terraform.json" from "src/" snippets file. 123 | 124 | ### Convention 125 | - All commit logs must follow the "Conventional Changelog" convention, particularly "angular" preset. see https://github.com/conventional-changelog/conventional-changelog 126 | 127 | ## How can you help ? 128 | 129 | It is super easy, the snippets for each Terraform features are self-contained into its own single JSON file. 130 | 131 | ``` 132 | src/ 133 | backends/ 134 | configuration/ 135 | modules/ 136 | state/ 137 | provisioners/ 138 | providers/ 139 | aws.json 140 | chef.json 141 | your-new-feature-here.json 142 | ``` 143 | 144 | ## Issues / Comments / Suggestions 145 | 146 | Feel free to file an issue or submit a pull request at https://github.com/rixrix/vscode-terraform-snippets/issues 147 | 148 | ## Notes 149 | 150 | * Microsoft Azure (Legacy ASM) is not included in this release due to [inactivity of development](https://www.terraform.io/docs/providers/azure/index.html). 151 | 152 | ## Contributors 153 | 154 | * [Lionel T.](https://github.com/lktslionel) 155 | * [madole](https://github.com/madole) 156 | 157 | ## License 158 | 159 | MIT 160 | -------------------------------------------------------------------------------- /images/logo-header-black@2x-c6b59644.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rixrix/vscode-terraform-snippets/937f47ca2c1a0dd5763da6d8c3ad0650c3bd1c89/images/logo-header-black@2x-c6b59644.png -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rixrix/vscode-terraform-snippets/937f47ca2c1a0dd5763da6d8c3ad0650c3bd1c89/images/screenshot.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "terraform-snippets", 3 | "displayName": "Advanced Terraform Snippets Generator", 4 | "description": "Provides 550+ code snippets of Hashicorp's Terraform cloud orchestration tool.", 5 | "version": "2.1.0", 6 | "publisher": "mindginative", 7 | "author": { 8 | "name": "Richard Sentino", 9 | "email": "richard@mindginative.com" 10 | }, 11 | "bugs": { 12 | "url": "https://github.com/rixrix/vscode-terraform-snippets/issues" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/rixrix/vscode-terraform-snippets.git" 17 | }, 18 | "engines": { 19 | "vscode": "^1.0.0" 20 | }, 21 | "categories": [ 22 | "Snippets" 23 | ], 24 | "contributes": { 25 | "snippets": [ 26 | { 27 | "language": "terraform", 28 | "path": "./snippets/terraform.json" 29 | } 30 | ] 31 | }, 32 | "icon": "images/logo-header-black@2x-c6b59644.png", 33 | "galleryBanner": { 34 | "color": "#822ff7", 35 | "theme": "dark" 36 | }, 37 | "license": "MIT", 38 | "devDependencies": { 39 | "conventional-changelog": "^1.1.24", 40 | "conventional-github-releaser": "^1.1.12", 41 | "glob": "^7.1.2", 42 | "task-nibbler": "^1.0.5", 43 | "vsce": "^1.18.0" 44 | }, 45 | "scripts": { 46 | "postversion": "npm run publish:release", 47 | "publish:vsce": "vsce publish", 48 | "publish:release": "conventional-github-releaser -p angular -r 0", 49 | "build:snippets": "node ./scripts/build.js", 50 | "build:changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0" 51 | }, 52 | "__metadata": { 53 | "id": "2624ae48-4d99-446a-acd6-63c633093655", 54 | "publisherDisplayName": "Richard Sentino", 55 | "publisherId": "45d724a7-d479-4d38-a910-876dde48897d" 56 | }, 57 | "dependencies": { 58 | "conventional-changelog-cli": "^2.0.1" 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /scripts/build.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var fs = require('fs'); 3 | var taskRunner = require('task-nibbler').nibbler; 4 | var glob = require('glob'); 5 | 6 | var ROOT_DIR = path.resolve(__dirname, '../'); 7 | var TERRAFORM_FILE = ROOT_DIR + '/snippets/terraform.json'; 8 | 9 | function snippetsProcessor(pathToNewJsonSnippetsFile) { 10 | return new Promise(function(resolve, reject) { 11 | try { 12 | var newSnippetsContent = fs.readFileSync(pathToNewJsonSnippetsFile, {encoding: 'utf8'}); 13 | 14 | newSnippetsContent = newSnippetsContent.substring(newSnippetsContent.indexOf('\n') + 1); 15 | newSnippetsContent = newSnippetsContent.substring(0, newSnippetsContent.lastIndexOf('\n')) + ','; 16 | 17 | fs.appendFile(TERRAFORM_FILE, newSnippetsContent, function(error) { 18 | resolve(); 19 | }); 20 | 21 | } catch (e) { 22 | console.log(pathToNewJsonSnippetsFile, e); 23 | reject(e); 24 | } 25 | }); 26 | } 27 | 28 | function doBuild() { 29 | // @FIXME: temp. solution 30 | var messageFiller = '\n"copyright": { "year": "2017" } \n}'; 31 | 32 | glob(ROOT_DIR + '/src/**/*.json', function(error, files) { 33 | fs.truncateSync(TERRAFORM_FILE, 0); 34 | fs.appendFileSync(TERRAFORM_FILE, '{\n'); 35 | 36 | taskRunner(files, snippetsProcessor) 37 | .then(function() { 38 | 39 | fs.appendFile(TERRAFORM_FILE, messageFiller); 40 | }) 41 | .catch(function(error) { 42 | console.log('[ERROR]', error); 43 | }); 44 | }); 45 | } 46 | 47 | // run json builder 48 | doBuild(); -------------------------------------------------------------------------------- /src/backends/artifactory.json: -------------------------------------------------------------------------------- 1 | { 2 | "artifactory_backend": { 3 | "prefix": "tf-artifactory_backend", 4 | "description": "Define a backend-artifactory backend", 5 | "body": [ 6 | "data \"terraform_remote_state\" \"${myBackend}\" {", 7 | " backend = \"artifactory\"", 8 | " config {", 9 | " username = \"SheldonCooper\"", 10 | " password = \"AmyFarrahFowler\"", 11 | " url = \"https://custom.artifactoryonline.com/artifactory\"", 12 | " repo = \"foo\"", 13 | " subpath = \"terraform-bar\"", 14 | " }", 15 | "}" 16 | ] 17 | } 18 | } -------------------------------------------------------------------------------- /src/backends/atlas.json: -------------------------------------------------------------------------------- 1 | { 2 | "atlas_backend": { 3 | "prefix": "tf-atlas_backend", 4 | "description": "Define a backend-atlas backend", 5 | "body": [ 6 | "data \"terraform_remote_state\" \"${myBackend}\" {", 7 | " backend = \"atlas\"", 8 | " config {", 9 | " name = \"bigbang/example\"", 10 | " access_token = \"X2iTFefU5aWOjg.atlasv1.YaDa\"", 11 | " }", 12 | "}" 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /src/backends/azure.json: -------------------------------------------------------------------------------- 1 | { 2 | "azure_backend": { 3 | "prefix": "tf-azure_backend", 4 | "description": "Define a backend-azure backend", 5 | "body": [ 6 | "data \"terraform_remote_state\" \"${myBackend}\" {", 7 | " backend = \"azure\"", 8 | " config {", 9 | " storage_account_name = \"terraform123abc\"", 10 | " container_name = \"terraform-state\"", 11 | " key = \"prod.terraform.tfstate\"", 12 | " }", 13 | "}" 14 | ] 15 | } 16 | } -------------------------------------------------------------------------------- /src/backends/consul.json: -------------------------------------------------------------------------------- 1 | { 2 | "consul_backend": { 3 | "prefix": "tf-consul_backend", 4 | "description": "Define a backend-consul backend", 5 | "body": [ 6 | "data \"terraform_remote_state\" \"${myBackend}\" {", 7 | " backend = \"consul\"", 8 | " config {", 9 | " path = \"full/path\"", 10 | " }", 11 | "}" 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /src/backends/etcd.json: -------------------------------------------------------------------------------- 1 | { 2 | "etcd_backend": { 3 | "prefix": "tf-etcd_backend", 4 | "description": "Define a backend-etcd backend", 5 | "body": [ 6 | "data \"terraform_remote_state\" \"${myBackend}\" {", 7 | " backend = \"etcd\"", 8 | " config {", 9 | " path = \"path/to/terraform.tfstate\"", 10 | " endpoints = \"http://one:4001 http://two:4001\"", 11 | " }", 12 | "}" 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /src/backends/gcs.json: -------------------------------------------------------------------------------- 1 | { 2 | "gcs_backend": { 3 | "prefix": "tf-gcs_backend", 4 | "description": "Define a backend-gcs backend", 5 | "body": [ 6 | "data \"terraform_remote_state\" \"${myBackend}\" {", 7 | " backend = \"gcs\"", 8 | " config {", 9 | " bucket = \"terraform-state-prod\"", 10 | " path = \"network/terraform.tfstate\"", 11 | " project = \"goopro\"", 12 | " }", 13 | "}" 14 | ] 15 | } 16 | } -------------------------------------------------------------------------------- /src/backends/http.json: -------------------------------------------------------------------------------- 1 | { 2 | "http_backend": { 3 | "prefix": "tf-http_backend", 4 | "description": "Define a backend-http backend", 5 | "body": [ 6 | "data \"terraform_remote_state\" \"${myBackend}\" {", 7 | " backend = \"http\"", 8 | " config {", 9 | " address = \"http://my.rest.api.com\"", 10 | " }", 11 | "}" 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /src/backends/local.json: -------------------------------------------------------------------------------- 1 | { 2 | "local_backend": { 3 | "prefix": "tf-local_backend", 4 | "description": "Define a backend-local backend", 5 | "body": [ 6 | "data \"terraform_remote_state\" \"${myBackend}\" {", 7 | " backend = \"local\"", 8 | " config {", 9 | " path = \"\\${path.module}/../../terraform.tfstate\"", 10 | " }", 11 | "}" 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /src/backends/s3.json: -------------------------------------------------------------------------------- 1 | { 2 | "s3_backend": { 3 | "prefix": "tf-s3_backend", 4 | "description": "Define a backend-s3 backend", 5 | "body": [ 6 | "data \"terraform_remote_state\" \"${myBackend}\" {", 7 | " backend = \"s3\"", 8 | " config {", 9 | " bucket = \"terraform-state-prod\"", 10 | " key = \"network/terraform.tfstate\"", 11 | " region = \"us-east-1\"", 12 | " }", 13 | "}" 14 | ] 15 | } 16 | } -------------------------------------------------------------------------------- /src/backends/swift.json: -------------------------------------------------------------------------------- 1 | { 2 | "swift_backend": { 3 | "prefix": "tf-swift_backend", 4 | "description": "Define a backend-swift backend", 5 | "body": [ 6 | "data \"terraform_remote_state\" \"${myBackend}\" {", 7 | " backend = \"swift\"", 8 | " config {", 9 | " path = \"terraform_state\"", 10 | " }", 11 | "}" 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /src/configuration/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "module": { 3 | "prefix": "tf-module", 4 | "description": "Modules in Terraform are self-contained packages of Terraform configurations that are managed as a group.", 5 | "body": [ 6 | "module \"${myModuleName}\" {", 7 | " source = \"\"", 8 | "}" 9 | ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/configuration/output.json: -------------------------------------------------------------------------------- 1 | { 2 | "output": { 3 | "prefix": "tf-output", 4 | "description": "Outputs are a way to tell Terraform what data is important.", 5 | "body": [ 6 | "output \"${myOutput}\" {", 7 | " value = \"\"", 8 | "}" 9 | ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/configuration/resources.json: -------------------------------------------------------------------------------- 1 | { 2 | "resource": { 3 | "prefix": "tf-resource", 4 | "description": "define a provisioner.", 5 | "body": [ 6 | "resource \"${1}\" \"${2}\" {", 7 | "\t${3}", 8 | "}" 9 | ] 10 | }, 11 | "depends_on": { 12 | "prefix": "tf-depends_on", 13 | "description": "Define explicit dependencies.", 14 | "body": [ 15 | "depends_on = [\"${dependsOn}\"]" 16 | ] 17 | } 18 | } -------------------------------------------------------------------------------- /src/configuration/variable.json: -------------------------------------------------------------------------------- 1 | { 2 | "variable": { 3 | "prefix": "tf-variable", 4 | "description": "Define variables.", 5 | "body": [ 6 | "variable \"${myVariable}\" { }" 7 | ] 8 | }, 9 | "variable-default": { 10 | "prefix": "tf-variable-default", 11 | "description": "Define variables with default", 12 | "body": [ 13 | "variable \"${myVariable}\" {", 14 | " default = \"\"", 15 | "}" 16 | ] 17 | } 18 | } -------------------------------------------------------------------------------- /src/modules/bitbucket.json: -------------------------------------------------------------------------------- 1 | { 2 | "bitbucket_module": { 3 | "prefix": "tf-bitbucket_module", 4 | "description": "Define a module with BitBucket source.", 5 | "body": [ 6 | "module \"${myModuleName}\" {", 7 | " source = \"bitbucket.org/username\"", 8 | "}" 9 | ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/modules/git.json: -------------------------------------------------------------------------------- 1 | { 2 | "git_module": { 3 | "prefix": "tf-git_module", 4 | "description": "Define a module with genertic Git source.", 5 | "body": [ 6 | "module \"${myModuleName}\" {", 7 | " source = \"git://\"", 8 | "}" 9 | ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/modules/github.json: -------------------------------------------------------------------------------- 1 | { 2 | "github_private_module": { 3 | "prefix": "tf-github_private_module", 4 | "description": "Define a module with github with private source.", 5 | "body": [ 6 | "module \"${myModuleName}\" {", 7 | " source = \"git::https://MACHINE-USER:MACHINE-PASS@github.com/username\"", 8 | "}" 9 | ] 10 | }, 11 | "github_module": { 12 | "prefix": "tf-github_module", 13 | "description": "Define a module with github source.", 14 | "body": [ 15 | "module \"${myModuleName}\" {", 16 | " source = \"github.com/username\"", 17 | "}" 18 | ] 19 | } 20 | } -------------------------------------------------------------------------------- /src/modules/mercurial.json: -------------------------------------------------------------------------------- 1 | { 2 | "mercurial_module": { 3 | "prefix": "tf-mercurial_module", 4 | "description": "Define a module with Mercurial source.", 5 | "body": [ 6 | "module \"${myModuleName}\" {", 7 | " source = \"hg::http://\"", 8 | "}" 9 | ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/modules/s3.json: -------------------------------------------------------------------------------- 1 | { 2 | "s3_module": { 3 | "prefix": "tf-s3_module", 4 | "description": "Define a module with S3 source.", 5 | "body": [ 6 | "module \"${myModuleName}\" {", 7 | " source = \"s3::https://\"", 8 | "}" 9 | ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/providers/archive.json: -------------------------------------------------------------------------------- 1 | { 2 | "archive": { 3 | "prefix":"tf-archive", 4 | "description": "Defines archive", 5 | "body": [ 6 | "provider \"archive\" {", 7 | "}" 8 | ] 9 | }, 10 | "archive_file": { 11 | "prefix":"tf-archive_file", 12 | "description": "Defines archive_file", 13 | "body": [ 14 | "data \"archive_file\" \"${init}\" {", 15 | " type = \"zip\"", 16 | " source_file = \"\\${path.module}/init.tpl\"", 17 | " output_path = \"\\${path.module}/files/init.zip\"", 18 | "}" 19 | ] 20 | } 21 | } -------------------------------------------------------------------------------- /src/providers/arukas.json: -------------------------------------------------------------------------------- 1 | { 2 | "arukas": { 3 | "prefix":"tf-arukas", 4 | "description": "Defines Arukas provider", 5 | "body": [ 6 | "provider \"arukas\" {", 7 | " token = \"${1:token}\"", 8 | " secret = \"${2:secret}\"", 9 | "}" 10 | ] 11 | }, 12 | "arukas_container": { 13 | "prefix":"tf-arukas_container", 14 | "description": "Defines Arukas container", 15 | "body": [ 16 | "resource \"arukas_container\" \"${1:arukas_container_id}\" {", 17 | " name = \"${2:myArukasName}\"", 18 | "}" 19 | ] 20 | } 21 | } -------------------------------------------------------------------------------- /src/providers/atlas.json: -------------------------------------------------------------------------------- 1 | { 2 | "atlas": { 3 | "prefix":"tf-atlas", 4 | "description": "Defines atlas", 5 | "body": [ 6 | "provider \"atlas\" {", 7 | " token = \"${atlasToken}\"", 8 | "}" 9 | ] 10 | }, 11 | "atlas_artifact_data": { 12 | "prefix":"tf-atlas_artifact", 13 | "description": "Defines atlas_artifact data", 14 | "body": [ 15 | "data \"atlas_artifact\" \"${web}\" {", 16 | " name = \"hashicorp/web\"", 17 | " type = \"amazon.image\"", 18 | " build = \"latest\"", 19 | " metadata {", 20 | " arch = \"386\"", 21 | " }", 22 | "}" 23 | ] 24 | } 25 | } -------------------------------------------------------------------------------- /src/providers/bitbucket.json: -------------------------------------------------------------------------------- 1 | { 2 | "bitbucket": { 3 | "prefix":"tf-bitbucket", 4 | "description": "Defines bitbucket", 5 | "body": [ 6 | "provider \"bitbucket\" {", 7 | " username = \"${bitbucketUsername}\"", 8 | " password = \"****\"", 9 | "}" 10 | ] 11 | }, 12 | "bitbucket_default_reviewers": { 13 | "prefix":"tf-bitbucket_default_reviewers", 14 | "description": "Defines bitbucket_default_reviewers", 15 | "body": [ 16 | "resource \"bitbucket_default_reviewers\" \"${MyResource}\" {", 17 | "}" 18 | ] 19 | }, 20 | "bitbucket_hook": { 21 | "prefix":"tf-bitbucket_hook", 22 | "description": "Defines bitbucket_hook", 23 | "body": [ 24 | "resource \"bitbucket_hook\" \"${MyResource}\" {", 25 | "}" 26 | ] 27 | }, 28 | "bitbucket_repository": { 29 | "prefix":"tf-bitbucket_repository", 30 | "description": "Defines bitbucket_repository", 31 | "body": [ 32 | "resource \"bitbucket_repository\" \"${MyResource}\" {", 33 | "}" 34 | ] 35 | } 36 | } -------------------------------------------------------------------------------- /src/providers/centurylinkcloud.json: -------------------------------------------------------------------------------- 1 | { 2 | "clc": { 3 | "prefix": "tf-clc", 4 | "description": "define a clc provider.", 5 | "body": [ 6 | "provider \"clc\" {", 7 | " username = \"\\${var.clc_username}\"", 8 | " password = \"\\${var.clc_password}\"", 9 | " account = \"\\${var.clc_account}\" # optional", 10 | "}" 11 | ] 12 | }, 13 | "clc_server": { 14 | "prefix": "tf-clc_server", 15 | "description": "define clc_server resource.", 16 | "body": [ 17 | "resource \"clc_server\" \"${myResourceName}\" {", 18 | " name = \"my-${myResourceName}\"", 19 | " description = \"my-description-${myResourceName}\"", 20 | " source_server_id = \"UBUNTU-14-64-TEMPLATE\"", 21 | " group_id = \"\\${clc_group.frontends.id}\"", 22 | " cpu = 2", 23 | " memory_mb = 2048", 24 | " password = \"Green123$\"", 25 | " additional_disks {", 26 | " path = \"/var\"", 27 | " size_gb = 100", 28 | " type = \"partitioned\"", 29 | " }\n", 30 | " additional_disks {", 31 | " size_gb = 10", 32 | " type = \"raw\"", 33 | " }", 34 | "}" 35 | ] 36 | }, 37 | "clc_group": { 38 | "prefix": "tf-clc_group", 39 | "description": "define clc_group resource.", 40 | "body": [ 41 | "resource \"clc_group\" \"${myResourceName}\" {", 42 | " name = \"my-${myResourceName}\"", 43 | " description = \"my-description-${myResourceName}\"", 44 | " location_id = \"WA1\"", 45 | " name = \"frontends\"", 46 | " parent = \"Default Group\"", 47 | "}" 48 | ] 49 | }, 50 | "clc_public_ip": { 51 | "prefix": "tf-clc_public_ip", 52 | "description": "define clc_public_ip resource.", 53 | "body": [ 54 | "resource \"clc_public_ip\" \"${myResourceName}\" {", 55 | " name = \"my-${myResourceName}\"", 56 | " description = \"my-description-${myResourceName}\"", 57 | " server_id = \"\\${clc_server.node.0.id}\"", 58 | " internal_ip_address = \"${clc_server.node.0.private_ip_address}\"", 59 | " ports {", 60 | " protocol = \"ICMP\"", 61 | " port = -1", 62 | " }\n", 63 | " ports {", 64 | " protocol = \"TCP\"", 65 | " port = 22", 66 | " }\n", 67 | " ports {", 68 | " protocol = \"TCP\"", 69 | " port = 2000", 70 | " port_to = 9000", 71 | " }\n", 72 | " source_restrictions {", 73 | " cidr = \"85.39.22.15/30\"", 74 | " }", 75 | "}" 76 | ] 77 | }, 78 | "clc_load_balancer": { 79 | "prefix": "tf-clc_load_balancer", 80 | "description": "define clc_load_balancer resource.", 81 | "body": [ 82 | "resource \"clc_load_balancer\" \"${myResourceName}\" {", 83 | " name = \"my-${myResourceName}\"", 84 | " description = \"my-description-${myResourceName}\"", 85 | " data_center = \"\\${clc_group.frontends.location_id}\"", 86 | " name = \"api\"", 87 | " description = \"api load balancer\"", 88 | " status = \"enabled\"", 89 | "}" 90 | ] 91 | }, 92 | "clc_load_balancer_pool": { 93 | "prefix": "tf-clc_load_balancer_pool", 94 | "description": "define clc_load_balancer_pool resource.", 95 | "body": [ 96 | "resource \"clc_load_balancer_pool\" \"${myResourceName}\" {", 97 | " name = \"my-${myResourceName}\"", 98 | " description = \"my-description-${myResourceName}\"", 99 | " data_center = \"\\${clc_group.frontends.location_id}\"", 100 | " load_balancer = \"\\${clc_load_balancer.api.id}\"", 101 | " method = \"roundRobin\"", 102 | " persistence = \"standard\"", 103 | " port = 80\n", 104 | " nodes {", 105 | " status = \"enabled\"", 106 | " ipAddress = \"\\${clc_server.node.0.private_ip_address}\"", 107 | " privatePort = 3000", 108 | " }\n", 109 | " nodes {", 110 | " status = \"enabled\"", 111 | " ipAddress = \"\\${clc_server.node.1.private_ip_address}\"", 112 | " privatePort = 3000", 113 | " }", 114 | "}" 115 | ] 116 | } 117 | } -------------------------------------------------------------------------------- /src/providers/chef.json: -------------------------------------------------------------------------------- 1 | { 2 | "chef": { 3 | "prefix":"tf-chef", 4 | "description": "Defines chef", 5 | "body": [ 6 | "provider \"chef\" {", 7 | " server_url = \"${url}\"", 8 | " client_name = \"samplechef\"", 9 | "}" 10 | ] 11 | }, 12 | "chef_data_bag": { 13 | "prefix":"tf-chef_data_bag", 14 | "description": "Defines chef_data_bag resource", 15 | "body": [ 16 | "resource \"chef_data_bag\" \"${MyResource}\" {", 17 | " name = \"sampleName\"", 18 | "}" 19 | ] 20 | }, 21 | "chef_data_bag_item": { 22 | "prefix":"tf-chef_data_bag_item", 23 | "description": "Defines chef_data_bag_item resource", 24 | "body": [ 25 | "resource \"chef_data_bag_item\" \"${MyResource}\" {", 26 | " data_bag_name = \"example-data-bag\"", 27 | "content_json = <\"", 58 | "}" 59 | ] 60 | }, 61 | "cobbler_system": { 62 | "prefix": "tf-cobbler_system", 63 | "description": "define cobbler_system resource.", 64 | "body": [ 65 | "resource \"cobbler_system\" \"${myResourceName}\" {", 66 | " name = \"my-${myResourceName}\"", 67 | " description = \"my-description-${myResourceName}\"", 68 | " profile = \"\\${cobbler_profile.my_profile.name}\"", 69 | " name_servers = [\"8.8.8.8\", \"8.8.4.4\"]", 70 | " comment = \"I'm a system\"\n", 71 | " interface {", 72 | " name = \"eth0\"", 73 | " mac_address = \"aa:bb:cc:dd:ee:ff\"", 74 | " static = true", 75 | " ip_address = \"1.2.3.4\"", 76 | " netmask = \"255.255.255.0\"", 77 | " }\n", 78 | " interface {", 79 | " name = \"eth1\"", 80 | " mac_address = \"aa:bb:cc:dd:ee:fa\"", 81 | " static = true", 82 | " ip_address = \"1.2.3.5\"", 83 | " netmask = \"255.255.255.0\"", 84 | " }", 85 | "}" 86 | ] 87 | } 88 | } -------------------------------------------------------------------------------- /src/providers/consul.json: -------------------------------------------------------------------------------- 1 | { 2 | "consul_keys": { 3 | "prefix":"tf-consul_keys", 4 | "description": "Defines consul_keys", 5 | "body": [ 6 | "data \"consul_keys\" \"${MyConsulResource}\" {", 7 | " key {", 8 | " name = \"\"", 9 | " }", 10 | "}" 11 | ] 12 | }, 13 | "consul_agent_service": { 14 | "prefix":"tf-consul_agent_service", 15 | "description": "Defines consul_agent_service", 16 | "body": [ 17 | "resource \"consul_agent_service\" \"${MyResource}\" {", 18 | "}" 19 | ] 20 | }, 21 | "consul_catalog_entry": { 22 | "prefix":"tf-consul_catalog_entry", 23 | "description": "Defines consul_catalog_entry", 24 | "body": [ 25 | "resource \"consul_catalog_entry\" \"${MyResource}\" {", 26 | "}" 27 | ] 28 | }, 29 | "consul_key_prefix": { 30 | "prefix":"tf-consul_key_prefix", 31 | "description": "Defines consul_key_prefix", 32 | "body": [ 33 | "resource \"consul_key_prefix\" \"${MyResource}\" {", 34 | "}" 35 | ] 36 | }, 37 | "consul_node": { 38 | "prefix":"tf-consul_node", 39 | "description": "Defines consul_node", 40 | "body": [ 41 | "resource \"consul_node\" \"${MyResource}\" {", 42 | "}" 43 | ] 44 | }, 45 | "consul_prepared_query": { 46 | "prefix":"tf-consul_prepared_query", 47 | "description": "Defines consul_prepared_query", 48 | "body": [ 49 | "resource \"consul_prepared_query\" \"${MyResource}\" {", 50 | "}" 51 | ] 52 | }, 53 | "consul_service": { 54 | "prefix":"tf-consul_service", 55 | "description": "Defines consul_service", 56 | "body": [ 57 | "resource \"consul_service\" \"${MyResource}\" {", 58 | "}" 59 | ] 60 | } 61 | } -------------------------------------------------------------------------------- /src/providers/datadog.json: -------------------------------------------------------------------------------- 1 | { 2 | "datadog": { 3 | "prefix": "tf-datadog", 4 | "description": "define a datadog provider.", 5 | "body": [ 6 | "provider \"datadog\" {", 7 | " api_key = \"\\${var.datadog_api_key}\"", 8 | " app_key = \"\\${var.datadog_app_key}\"", 9 | "}" 10 | ] 11 | }, 12 | "datadog_monitor": { 13 | "prefix": "tf-datadog_monitor", 14 | "description": "define datadog_monitor resource.", 15 | "body": [ 16 | "resource \"datadog_monitor\" \"${myResourceName}\" {", 17 | " name = \"my-${myResourceName}\"", 18 | " description = \"my-description-${myResourceName}\"", 19 | " type = \"metric alert\"", 20 | " message = \"Monitor triggered. Notify: @hipchat-channel\"", 21 | " escalation_message = \"Escalation message @pagerduty\"\n", 22 | " query = \"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo} by {host} > 2\"\n", 23 | " thresholds {", 24 | " ok = 0", 25 | " warning = 1", 26 | " critical = 2", 27 | " }\n", 28 | " notify_no_data = false", 29 | " renotify_interval = 60\n", 30 | " notify_audit = false", 31 | " timeout_h = 60", 32 | " include_tags = true\n", 33 | " silenced {", 34 | " \"*\" = 0", 35 | " }", 36 | "}" 37 | ] 38 | }, 39 | "datadog_timeboard": { 40 | "prefix": "tf-datadog_timeboard", 41 | "description": "define datadog_timeboard resource.", 42 | "body": [ 43 | "resource \"datadog_timeboard\" \"${myResourceName}\" {", 44 | " name = \"my-${myResourceName}\"", 45 | " description = \"my-description-${myResourceName}\"", 46 | " title = \"Redis Timeboard (created via Terraform)\"", 47 | " read_only = true\n", 48 | " graph {", 49 | " title = \"Redis latency (ms)\"", 50 | " viz = \"timeseries\"", 51 | " request {", 52 | " q = \"avg:redis.info.latency_ms{$host}\"", 53 | " type = \"bars\"", 54 | " }", 55 | " }\n", 56 | " template_variable {", 57 | " name = \"host\"", 58 | " prefix = \"host\"", 59 | " }", 60 | 61 | "}" 62 | ] 63 | } 64 | } -------------------------------------------------------------------------------- /src/providers/digitalocean.json: -------------------------------------------------------------------------------- 1 | { 2 | "digitalocean": { 3 | "prefix":"tf-digitalocean", 4 | "description": "Defines digitalocean", 5 | "body": [ 6 | "provider \"digitalocean\" {", 7 | " token = \"\\${var.${do_token}}\"", 8 | "}" 9 | ] 10 | }, 11 | "digitalocean_domain": { 12 | "prefix":"tf-digitalocean_domain", 13 | "description": "Defines digitalocean_domain", 14 | "body": [ 15 | "resource \"digitalocean_domain\" \"${MyResource}\" {", 16 | "}" 17 | ] 18 | }, 19 | "digitalocean_droplet": { 20 | "prefix":"tf-digitalocean_droplet", 21 | "description": "Defines digitalocean_droplet", 22 | "body": [ 23 | "resource \"digitalocean_droplet\" \"${MyResource}\" {", 24 | "}" 25 | ] 26 | }, 27 | "digitalocean_floating_ip": { 28 | "prefix":"tf-digitalocean_floating_ip", 29 | "description": "Defines digitalocean_floating_ip", 30 | "body": [ 31 | "resource \"digitalocean_floating_ip\" \"${MyResource}\" {", 32 | "}" 33 | ] 34 | }, 35 | "digitalocean_record": { 36 | "prefix":"tf-digitalocean_record", 37 | "description": "Defines digitalocean_record", 38 | "body": [ 39 | "resource \"digitalocean_record\" \"${MyResource}\" {", 40 | "}" 41 | ] 42 | }, 43 | "digitalocean_ssh_key": { 44 | "prefix":"tf-digitalocean_ssh_key", 45 | "description": "Defines digitalocean_ssh_key", 46 | "body": [ 47 | "resource \"digitalocean_ssh_key\" \"${MyResource}\" {", 48 | "}" 49 | ] 50 | }, 51 | "digitalocean_tag": { 52 | "prefix":"tf-digitalocean_tag", 53 | "description": "Defines digitalocean_tag", 54 | "body": [ 55 | "resource \"digitalocean_tag\" \"${MyResource}\" {", 56 | "}" 57 | ] 58 | }, 59 | "digitalocean_volume": { 60 | "prefix":"tf-digitalocean_volume", 61 | "description": "Defines digitalocean_volume", 62 | "body": [ 63 | "resource \"digitalocean_volume\" \"${MyResource}\" {", 64 | "}" 65 | ] 66 | } 67 | } -------------------------------------------------------------------------------- /src/providers/dnsimple.json: -------------------------------------------------------------------------------- 1 | { 2 | "dnsimple": { 3 | "prefix": "tf-dnsimple", 4 | "description": "define a dnsimple provider.", 5 | "body": [ 6 | "provider \"dnsimple\" {", 7 | " token = \"\\${var.dnsimple_token}\"", 8 | " email = \"\\${var.dnsimple_email}\"", 9 | "}" 10 | ] 11 | }, 12 | "dnsimple_record": { 13 | "prefix": "tf-dnsimple_record", 14 | "description": "define dnsimple_record resource.", 15 | "body": [ 16 | "resource \"dnsimple_record\" \"${myResourceName}\" {", 17 | " name = \"my-${myResourceName}\"", 18 | " description = \"my-description-${myResourceName}\"\n", 19 | " # Add a record to the root domain", 20 | " domain = \"\\${var.dnsimple_domain}\"", 21 | " name = \"", 22 | " value = \"192.168.0.11\"", 23 | " type = \"A\"", 24 | " ttl = 3600", 25 | "}" 26 | ] 27 | } 28 | } -------------------------------------------------------------------------------- /src/providers/dnsmadeeasy.json: -------------------------------------------------------------------------------- 1 | { 2 | "dme": { 3 | "prefix": "tf-dme", 4 | "description": "define a dme provider.", 5 | "body": [ 6 | "provider \"dme\" {", 7 | " akey = \"\\${var.dme_akey}\"", 8 | " skey = \"\\${var.dme_skey}\"", 9 | " usesandbox = true", 10 | "}" 11 | ] 12 | }, 13 | "dme_record": { 14 | "prefix": "tf-dme_record", 15 | "description": "define dme_record resource.", 16 | "body": [ 17 | "resource \"dme_record\" \"${myResourceName}\" {", 18 | " name = \"my-${myResourceName}\"", 19 | " description = \"my-description-${myResourceName}\"", 20 | " domainid = \"123456\"", 21 | " name = \"www\"", 22 | " type = \"A\"", 23 | " value = \"192.168.1.1\"", 24 | " ttl = 3600", 25 | " gtdLocation = \"DEFAULT\"", 26 | "}" 27 | ] 28 | } 29 | } -------------------------------------------------------------------------------- /src/providers/docker.json: -------------------------------------------------------------------------------- 1 | { 2 | "docker_registry_image": { 3 | "prefix":"tf-docker_registry_image", 4 | "description": "Defines docker_registry_image", 5 | "body": [ 6 | "data \"docker_registry_image\" \"${ubuntu}\" {", 7 | " name = \"ubuntu:precise\"", 8 | "}" 9 | ] 10 | }, 11 | "docker_container": { 12 | "prefix":"tf-docker_container", 13 | "description": "Defines docker_container", 14 | "body": [ 15 | "resource \"docker_container\" \"${MyResource}\" {", 16 | "}" 17 | ] 18 | }, 19 | "docker_image": { 20 | "prefix":"tf-docker_image", 21 | "description": "Defines docker_image", 22 | "body": [ 23 | "resource \"docker_image\" \"${MyResource}\" {", 24 | "}" 25 | ] 26 | }, 27 | "docker_network": { 28 | "prefix":"tf-docker_network", 29 | "description": "Defines docker_network", 30 | "body": [ 31 | "resource \"docker_network\" \"${MyResource}\" {", 32 | "}" 33 | ] 34 | }, 35 | "docker_volume": { 36 | "prefix":"tf-docker_volume", 37 | "description": "Defines docker_volume", 38 | "body": [ 39 | "resource \"docker_volume\" \"${MyResource}\" {", 40 | "}" 41 | ] 42 | } 43 | } -------------------------------------------------------------------------------- /src/providers/dyn.json: -------------------------------------------------------------------------------- 1 | { 2 | "dyn": { 3 | "prefix": "tf-dyn", 4 | "description": "define a dyn provider.", 5 | "body": [ 6 | "provider \"dyn\" {", 7 | " customer_name = \"\\${var.dyn_customer_name}\"", 8 | " username = \"\\${var.dyn_username}\"", 9 | " password = \"\\${var.dyn_password}\"", 10 | "}" 11 | ] 12 | }, 13 | "dyn_record": { 14 | "prefix": "tf-dyn_record", 15 | "description": "define dyn_record resource.", 16 | "body": [ 17 | "resource \"dyn_record\" \"${myResourceName}\" {", 18 | " name = \"my-${myResourceName}\"", 19 | " description = \"my-description-${myResourceName}\"\n", 20 | " zone = \"\\${var.dyn_zone}\"", 21 | " name = \"terraform\"", 22 | " value = \"192.168.0.11\"", 23 | " type = \"A\"", 24 | " ttl = 3600", 25 | "}" 26 | ] 27 | } 28 | } -------------------------------------------------------------------------------- /src/providers/fastly.json: -------------------------------------------------------------------------------- 1 | { 2 | "fastly": { 3 | "prefix": "tf-fastly", 4 | "description": "define a fastly provider.", 5 | "body": [ 6 | "provider \"fastly\" {", 7 | " api_key = \"${fastlyApiKey}\"", 8 | "}" 9 | ] 10 | }, 11 | "fastly_ip_ranges": { 12 | "prefix": "tf-fastly_ip_ranges", 13 | "description": "define a fastly_ip_ranges data source.", 14 | "body": [ 15 | "data \"fastly_ip_ranges\" \"${myDataSource}\" {", 16 | "}" 17 | ] 18 | }, 19 | "fastly_service_v1": { 20 | "prefix": "tf-fastly_service_v1", 21 | "description": "define fastly_service_v1 resource.", 22 | "body": [ 23 | "resource \"fastly_service_v1\" \"${myResourceName}\" {", 24 | " name = \"my-${myResourceName}\"", 25 | " description = \"my-description-${myResourceName}\"\n", 26 | " domain {", 27 | " name = \"demo.notexample.com\"", 28 | " comment = \"demo\"", 29 | " }\n", 30 | " backend {", 31 | " address = \"127.0.0.1\"", 32 | " name = \"localhost\"", 33 | " port = 80", 34 | " }\n", 35 | " force_destroy = true", 36 | "}" 37 | ] 38 | } 39 | } -------------------------------------------------------------------------------- /src/providers/github.json: -------------------------------------------------------------------------------- 1 | { 2 | "github_membership": { 3 | "prefix":"tf-github_membership", 4 | "description": "Defines github_membership", 5 | "body": [ 6 | "resource \"github_membership\" \"${MyResource}\" {", 7 | "}" 8 | ] 9 | }, 10 | "github_repository": { 11 | "prefix":"tf-github_repository", 12 | "description": "Defines github_repository", 13 | "body": [ 14 | "resource \"github_repository\" \"${MyResource}\" {", 15 | " name = \"example\"", 16 | " description = \"example\"", 17 | "", 18 | "}" 19 | ] 20 | }, 21 | "github_repository_collaborator": { 22 | "prefix":"tf-github_repository_collaborator", 23 | "description": "Defines github_repository_collaborator", 24 | "body": [ 25 | "resource \"github_repository_collaborator\" \"${MyResource}\" {", 26 | "}" 27 | ] 28 | }, 29 | "github_team": { 30 | "prefix":"tf-github_team", 31 | "description": "Defines github_team", 32 | "body": [ 33 | "resource \"github_team\" \"${MyResource}\" {", 34 | "}" 35 | ] 36 | }, 37 | "github_team_membership": { 38 | "prefix":"tf-github_team_membership", 39 | "description": "Defines github_team_membership", 40 | "body": [ 41 | "resource \"github_team_membership\" \"${MyResource}\" {", 42 | "}" 43 | ] 44 | }, 45 | "github_team_repository": { 46 | "prefix":"tf-github_team_repository", 47 | "description": "Defines github_team_repository", 48 | "body": [ 49 | "resource \"github_team_repository\" \"${MyResource}\" {", 50 | "}" 51 | ] 52 | }, 53 | "github_issue_label": { 54 | "prefix":"tf-github_issue_label", 55 | "description": "Defines github_issue_label", 56 | "body": [ 57 | "resource \"github_issue_label\" \"${MyResource}\" {", 58 | "}" 59 | ] 60 | } 61 | } -------------------------------------------------------------------------------- /src/providers/gitlab.json: -------------------------------------------------------------------------------- 1 | { 2 | "gitlab": { 3 | "prefix": "tf-gitlab", 4 | "description": "define a GitLab provider.", 5 | "body": [ 6 | "provider \"gitlab\" {", 7 | " token = \"${myGitLabToken}\"", 8 | "}" 9 | ] 10 | }, 11 | "gitlab_deploy_key": { 12 | "prefix": "tf-gitlab_deploy_key", 13 | "description": "define a gitlab_deploy_key resource.", 14 | "body": [ 15 | "resource \"gitlab_deploy_key\" \"${example}\" {", 16 | " project = \"${example}/deploying\"", 17 | " title = \"${example} deploy key\"", 18 | " key = \"ssh-rsa AAAA\"", 19 | "}" 20 | ] 21 | }, 22 | "gitlab_group": { 23 | "prefix": "tf-gitlab_group", 24 | "description": "define a gitlab_group resource.", 25 | "body": [ 26 | "resource \"gitlab_group\" \"${example}\" {", 27 | " name = \"${example}\"", 28 | " path = \"${example}\"", 29 | " description = \"${example} description\"", 30 | "}" 31 | ] 32 | }, 33 | "gitlab_project_hook": { 34 | "prefix": "tf-gitlab_project_hook", 35 | "description": "define a gitlab_project_hook resource.", 36 | "body": [ 37 | "resource \"gitlab_project_hook\" \"${example}\" {", 38 | " project = \"${example}/hooked\"", 39 | " url = \"https://${example}.com/hooke/example\"", 40 | "}" 41 | ] 42 | }, 43 | "gitlab_project": { 44 | "prefix": "tf-gitlab_project", 45 | "description": "define a gitlab_project resource.", 46 | "body": [ 47 | "resource \"gitlab_project\" \"${example}\" {", 48 | " name = \"${example}\"", 49 | " description = \"${example}\"", 50 | "}" 51 | ] 52 | } 53 | } -------------------------------------------------------------------------------- /src/providers/google.json: -------------------------------------------------------------------------------- 1 | { 2 | "google": { 3 | "prefix":"tf-google", 4 | "description": "Defines google provider", 5 | "body": [ 6 | "provider \"google\" {", 7 | " credentials = \"credentials -example\"", 8 | " project = \"project-example\"", 9 | " region = \"us-central1\"", 10 | "}" 11 | ] 12 | }, 13 | "google_iam_policy": { 14 | "prefix":"tf-google_iam_policy", 15 | "description": "Defines google_iam_policy policy", 16 | "body": [ 17 | "data \"google_iam_policy\" \"${admin}\" {", 18 | " binding {", 19 | " role = \"roles/compute.instanceAdmin\"", 20 | " members = [", 21 | " \"serviceAccount:your-custom-sa@your-project.iam.gserviceaccount.com\",", 22 | " ]", 23 | " }", 24 | " binding {", 25 | " role = \"roles/storage.objectViewer\"", 26 | " members = [", 27 | " \"user:evanbrown@google.com\",", 28 | " ]", 29 | " }", 30 | "}" 31 | ] 32 | }, 33 | "google_project": { 34 | "prefix":"tf-google_project", 35 | "description": "Defines google_project resource", 36 | "body": [ 37 | "resource \"google_project\" \"${MyResource}\" {", 38 | " id = \"example-id\"", 39 | " policy_data = \"example-policy_data\"", 40 | "}" 41 | ] 42 | }, 43 | "google_compute_address": { 44 | "prefix":"tf-google_compute_address", 45 | "description": "Defines google_compute_address resource", 46 | "body": [ 47 | "resource \"google_compute_address\" \"${MyResource}\" {", 48 | " name = \"example-name\"", 49 | "}" 50 | ] 51 | }, 52 | "google_compute_autoscaler": { 53 | "prefix":"tf-google_compute_autoscaler", 54 | "description": "Defines google_compute_autoscaler resource", 55 | "body": [ 56 | "resource \"google_compute_autoscaler\" \"${MyResource}\" {", 57 | " name = \"example-name\"", 58 | " zone = \"example-zone\"", 59 | " target = \"example-target\"", 60 | " autoscaling_policy = {", 61 | " max_replicas = 5", 62 | " min_replicas = 1", 63 | " cooldown_period = 60\n", 64 | " cpu_utilization {", 65 | " target = 0.5", 66 | " }", 67 | " }", 68 | "}" 69 | ] 70 | }, 71 | "google_pubsub_subscription": { 72 | "prefix":"tf-google_pubsub_subscription", 73 | "description": "Defines google_pubsub_subscription resource", 74 | "body": [ 75 | "resource \"google_pubsub_subscription\" \"${MyResource}\" {", 76 | " name = \"example-name\"", 77 | " topic = \"example-topic\"", 78 | "}" 79 | ] 80 | }, 81 | "google_compute_backend_service": { 82 | "prefix":"tf-google_compute_backend_service", 83 | "description": "Defines google_compute_backend_service resource", 84 | "body": [ 85 | "resource \"google_compute_backend_service\" \"${MyResource}\" {", 86 | " name = \"example-name\"", 87 | " description = \"example-description\"", 88 | " health_checks = [\"example-health_checks\"]", 89 | "}" 90 | ] 91 | }, 92 | "google_compute_disk": { 93 | "prefix":"tf-google_compute_disk", 94 | "description": "Defines google_compute_disk resource", 95 | "body": [ 96 | "resource \"google_compute_disk\" \"${MyResource}\" {", 97 | " name = \"example-name\"", 98 | " type = \"pd-ssd\"", 99 | " zone = \"us-central1-a\"", 100 | " image = \"debian7-wheezy\"", 101 | "}" 102 | ] 103 | }, 104 | "google_compute_firewall": { 105 | "prefix":"tf-google_compute_firewall", 106 | "description": "Defines google_compute_firewall resource", 107 | "body": [ 108 | "resource \"google_compute_firewall\" \"${MyResource}\" {", 109 | " name = \"example-name\"", 110 | " network = \"example-network\"", 111 | " allow {", 112 | " protocol = \"icmp\"", 113 | " }", 114 | "}" 115 | ] 116 | }, 117 | "google_compute_forwarding_rule": { 118 | "prefix":"tf-google_compute_forwarding_rule", 119 | "description": "Defines google_compute_forwarding_rule resource", 120 | "body": [ 121 | "resource \"google_compute_forwarding_rule\" \"${MyResource}\" {", 122 | " name = \"example-name\"", 123 | " target = \"\\${google_compute_target_pool.default.self_link}\"", 124 | " port_range = \"80\"", 125 | "}" 126 | ] 127 | }, 128 | "google_compute_global_address": { 129 | "prefix":"tf-google_compute_global_address", 130 | "description": "Defines google_compute_global_address resource", 131 | "body": [ 132 | "resource \"google_compute_global_address\" \"${MyResource}\" {", 133 | " name = \"example-name\"", 134 | "}" 135 | ] 136 | }, 137 | "google_compute_global_forwarding_rule": { 138 | "prefix":"tf-google_compute_global_forwarding_rule", 139 | "description": "Defines google_compute_global_forwarding_rule resource", 140 | "body": [ 141 | "resource \"google_compute_global_forwarding_rule\" \"${MyResource}\" {", 142 | " name = \"example-name\"", 143 | " target = \"\\${google_compute_target_http_proxy.default.self_link}\"", 144 | " port_range = \"80\"", 145 | "}" 146 | ] 147 | }, 148 | "google_compute_http_health_check": { 149 | "prefix":"tf-google_compute_http_health_check", 150 | "description": "Defines google_compute_http_health_check resource", 151 | "body": [ 152 | "resource \"google_compute_http_health_check\" \"${MyResource}\" {", 153 | " name = \"example-name\"", 154 | " request_path = \"/health_check\"", 155 | " timeout_sec = 1", 156 | " check_interval_sec = 1", 157 | "}" 158 | ] 159 | }, 160 | "google_compute_https_health_check": { 161 | "prefix":"tf-google_compute_https_health_check", 162 | "description": "Defines google_compute_https_health_check resource", 163 | "body": [ 164 | "resource \"google_compute_https_health_check\" \"${MyResource}\" {", 165 | " name = \"example-name\"", 166 | " request_path = \"/health_check\"", 167 | " timeout_sec = 1", 168 | " check_interval_sec = 1", 169 | "}" 170 | ] 171 | }, 172 | "google_compute_image": { 173 | "prefix":"tf-google_compute_image", 174 | "description": "Defines google_compute_image resource", 175 | "body": [ 176 | "resource \"google_compute_image\" \"${MyResource}\" {", 177 | " name = \"example-name\"", 178 | " raw_disk {", 179 | " source = \"https://storage.googleapis.com/my-bucket/my-disk-image-tarball.tar.gz\"", 180 | " }", 181 | "}" 182 | ] 183 | }, 184 | "google_compute_instance": { 185 | "prefix":"tf-google_compute_instance", 186 | "description": "Defines google_compute_instance resource", 187 | "body": [ 188 | "resource \"google_compute_instance\" \"${MyResource}\" {", 189 | " name = \"example-name\"", 190 | " machine_type = \"n1-standard-1\"", 191 | " zone = \"us-central1-a\"", 192 | " disk { image = \"debian-cloud/debian-8\" }", 193 | "}" 194 | ] 195 | }, 196 | "google_compute_instance_group": { 197 | "prefix":"tf-google_compute_instance_group", 198 | "description": "Defines google_compute_instance_group resource", 199 | "body": [ 200 | "resource \"google_compute_instance_group\" \"${MyResource}\" {", 201 | " name = \"example-name\"", 202 | " description = \"example-description\"", 203 | " zone = \"us-central1-a\"", 204 | "}" 205 | ] 206 | }, 207 | "google_compute_instance_group_manager": { 208 | "prefix":"tf-google_compute_instance_group_manager", 209 | "description": "Defines google_compute_instance_group_manager resource", 210 | "body": [ 211 | "resource \"google_compute_instance_group_manager\" \"${MyResource}\" {", 212 | " name = \"example-name\"", 213 | " description = \"example-description\"", 214 | " base_instance_name = \"example-base_instance_name\"", 215 | " instance_template = \"\\${google_compute_instance_template.foobar.self_link}\"", 216 | " zone = \"us-central1-a\"", 217 | "}" 218 | ] 219 | }, 220 | "google_compute_instance_template": { 221 | "prefix":"tf-google_compute_instance_template", 222 | "description": "Defines google_compute_instance_template resource", 223 | "body": [ 224 | "resource \"google_compute_instance_template\" \"${MyResource}\" {", 225 | " name = \"example-name\"", 226 | " description = \"example-description\"", 227 | " machine_type = \"n1-standard-1\"", 228 | " disk {", 229 | " source_image = \"debian-cloud/debian-8\"", 230 | " auto_delete = true", 231 | " boot = true", 232 | " }", 233 | "}" 234 | ] 235 | }, 236 | "google_compute_network": { 237 | "prefix":"tf-google_compute_network", 238 | "description": "Defines google_compute_network resource", 239 | "body": [ 240 | "resource \"google_compute_network\" \"${MyResource}\" {", 241 | " name = \"example-name\"", 242 | " ipv4_range = \"10.0.0.0/16\"", 243 | "}" 244 | ] 245 | }, 246 | "google_compute_project_metadata": { 247 | "prefix":"tf-google_compute_project_metadata", 248 | "description": "Defines google_compute_project_metadata resource", 249 | "body": [ 250 | "resource \"google_compute_project_metadata\" \"${MyResource}\" {", 251 | " metadata {", 252 | " foo = \"bar\"", 253 | " fizz = \"buzz\"", 254 | " 13 = \"42\"", 255 | " }", 256 | "}" 257 | ] 258 | }, 259 | "google_compute_route": { 260 | "prefix":"tf-google_compute_route", 261 | "description": "Defines google_compute_route resource", 262 | "body": [ 263 | "resource \"google_compute_route\" \"${MyResource}\" {", 264 | " name = \"example-name\"", 265 | " dest_range = \"15.0.0.0/24\"", 266 | " network = \"\\${google_compute_network.foobar.name}\"", 267 | " next_hop_ip = \"10.0.1.5\"", 268 | " priority = 100", 269 | "}" 270 | ] 271 | }, 272 | "google_compute_ssl_certificate": { 273 | "prefix":"tf-google_compute_ssl_certificate", 274 | "description": "Defines google_compute_ssl_certificate resource", 275 | "body": [ 276 | "resource \"google_compute_ssl_certificate\" \"${MyResource}\" {", 277 | " name = \"example-name\"", 278 | " description = \"example-description\"", 279 | " private_key = \"\\${file(\"path/to/private.key\")}\"", 280 | " certificate = \"\\${file(\"path/to/certificate.crt\")}", 281 | "}" 282 | ] 283 | }, 284 | "google_compute_subnetwork": { 285 | "prefix":"tf-google_compute_subnetwork", 286 | "description": "Defines google_compute_subnetwork resource", 287 | "body": [ 288 | "resource \"google_compute_subnetwork\" \"${MyResource}\" {", 289 | " name = \"default-us-east1\"", 290 | " ip_cidr_range = \"10.0.0.0/16\"", 291 | " network = \"\\${google_compute_network.default.self_link}\"", 292 | " region = \"us-east1\"", 293 | "}" 294 | ] 295 | }, 296 | "google_compute_target_http_proxy": { 297 | "prefix":"tf-google_compute_target_http_proxy", 298 | "description": "Defines google_compute_target_http_proxy resource", 299 | "body": [ 300 | "resource \"google_compute_target_http_proxy\" \"${MyResource}\" {", 301 | " name = \"example-name\"", 302 | " description = \"example-description\"", 303 | " url_map = \"\\${google_compute_url_map.default.self_link}\"", 304 | "}" 305 | ] 306 | }, 307 | "google_compute_target_https_proxy": { 308 | "prefix":"tf-google_compute_target_https_proxy", 309 | "description": "Defines google_compute_target_https_proxy resource", 310 | "body": [ 311 | "resource \"google_compute_target_https_proxy\" \"${MyResource}\" {", 312 | " name = \"example-name\"", 313 | " description = \"example-description\"", 314 | " url_map = \"\\${google_compute_url_map.default.self_link}\"", 315 | " ssl_certificates = [\"\\${google_compute_ssl_certificate.default.self_link}\"]", 316 | "}" 317 | ] 318 | }, 319 | "google_compute_target_pool": { 320 | "prefix":"tf-google_compute_target_pool", 321 | "description": "Defines google_compute_target_pool resource", 322 | "body": [ 323 | "resource \"google_compute_target_pool\" \"${MyResource}\" {", 324 | " name = \"example-name\"", 325 | " description = \"example-description\"\n", 326 | " instances = [", 327 | " \"us-central1-a/myinstance1\",", 328 | " \"us-central1-b/myinstance2\",", 329 | " ]\n", 330 | " health_checks = [", 331 | " \"\\${google_compute_http_health_check.default.name}\",", 332 | " ]", 333 | "}" 334 | ] 335 | }, 336 | "google_compute_url_map": { 337 | "prefix":"tf-google_compute_url_map", 338 | "description": "Defines google_compute_url_map resource", 339 | "body": [ 340 | "resource \"google_compute_url_map\" \"${MyResource}\" {", 341 | " name = \"example-name\"", 342 | " description = \"example-description\"\n", 343 | " default_service = \"\\${google_compute_backend_service.home.self_link}\"", 344 | "}" 345 | ] 346 | }, 347 | "google_compute_vpn_gateway": { 348 | "prefix":"tf-google_compute_vpn_gateway", 349 | "description": "Defines google_compute_vpn_gateway resource", 350 | "body": [ 351 | "resource \"google_compute_vpn_gateway\" \"${MyResource}\" {", 352 | " name = \"example-name\"", 353 | " description = \"example-description\"\n", 354 | " network = \"\\${google_compute_network.network1.self_link}\"", 355 | " region = \"\\${var.region}\"", 356 | "}" 357 | ] 358 | }, 359 | "google_compute_vpn_tunnel": { 360 | "prefix":"tf-google_compute_vpn_tunnel", 361 | "description": "Defines google_compute_vpn_tunnel resource", 362 | "body": [ 363 | "resource \"google_compute_vpn_tunnel\" \"${MyResource}\" {", 364 | " name = \"example-name\"", 365 | " description = \"example-description\"\n", 366 | " peer_ip = \"15.0.0.120\"", 367 | " shared_secret = \"a shared_secret\"", 368 | " target_vpn_gateway = \"\\${google_compute_vpn_gateway.target_gateway.self_link}\"", 369 | "}" 370 | ] 371 | }, 372 | "google_container_cluster": { 373 | "prefix":"tf-google_container_cluster", 374 | "description": "Defines google_container_cluster resource", 375 | "body": [ 376 | "resource \"google_container_cluster\" \"${MyResource}\" {", 377 | " name = \"example-name\"", 378 | " description = \"example-description\"\n", 379 | " zone = \"us-central1-a\"", 380 | " initial_node_count = 1\n", 381 | " master_auth {", 382 | " username = \"mr.yoda\"", 383 | " password = \"adoy.rm\"", 384 | " }", 385 | "}" 386 | ] 387 | }, 388 | "google_dns_managed_zone": { 389 | "prefix":"tf-google_dns_managed_zone", 390 | "description": "Defines google_dns_managed_zone resource", 391 | "body": [ 392 | "resource \"google_dns_managed_zone\" \"${MyResource}\" {", 393 | " name = \"example-name\"", 394 | " description = \"example-description\"\n", 395 | " dns_name = \"prod.mydomain.com.\"", 396 | "}" 397 | ] 398 | }, 399 | "google_dns_record_set": { 400 | "prefix":"tf-google_dns_record_set", 401 | "description": "Defines google_dns_record_set resource", 402 | "body": [ 403 | "resource \"google_dns_record_set\" \"${MyResource}\" {", 404 | " name = \"example-name\"", 405 | " description = \"example-description\"\n", 406 | " type = \"A\"", 407 | " ttl = 300", 408 | "}" 409 | ] 410 | }, 411 | "google_pubsub_topic": { 412 | "prefix":"tf-google_pubsub_topic", 413 | "description": "Defines google_pubsub_topic resource", 414 | "body": [ 415 | "resource \"google_pubsub_topic\" \"${MyResource}\" {", 416 | " name = \"example-name\"", 417 | " description = \"example-description\"\n", 418 | "}" 419 | ] 420 | }, 421 | "google_sql_database": { 422 | "prefix":"tf-google_sql_database", 423 | "description": "Defines google_sql_database resource", 424 | "body": [ 425 | "resource \"google_sql_database\" \"${MyResource}\" {", 426 | " name = \"example-name\"", 427 | " description = \"example-description\"\n", 428 | " instance = \"\\${google_sql_database_instance.master.name}\"", 429 | "}" 430 | ] 431 | }, 432 | "google_sql_database_instance": { 433 | "prefix":"tf-google_sql_database_instance", 434 | "description": "Defines google_sql_database_instance resource", 435 | "body": [ 436 | "resource \"google_sql_database_instance\" \"${MyResource}\" {", 437 | " name = \"example-name\"", 438 | " description = \"example-description\"\n", 439 | " region = \"us-central", 440 | " settings { tier = \"D0\" }", 441 | "}" 442 | ] 443 | }, 444 | "google_sql_user": { 445 | "prefix":"tf-google_sql_user", 446 | "description": "Defines google_sql_user resource", 447 | "body": [ 448 | "resource \"google_sql_user\" \"${MyResource}\" {", 449 | " name = \"example-name\"", 450 | " description = \"example-description\"\n", 451 | " host = \"me.com", 452 | " password = \"example-password\"", 453 | " instance = \"\\${google_sql_database_instance.master.name}\"", 454 | "}" 455 | ] 456 | }, 457 | "google_storage_bucket": { 458 | "prefix":"tf-google_storage_bucket", 459 | "description": "Defines google_storage_bucket resource", 460 | "body": [ 461 | "resource \"google_storage_bucket\" \"${MyResource}\" {", 462 | " name = \"example-name\"", 463 | " description = \"example-description\"\n", 464 | "}" 465 | ] 466 | }, 467 | "google_storage_bucket_acl": { 468 | "prefix":"tf-google_storage_bucket_acl", 469 | "description": "Defines google_storage_bucket_acl resource", 470 | "body": [ 471 | "resource \"google_storage_bucket_acl\" \"${MyResource}\" {", 472 | " bucket = \"\\${google_storage_bucket.image_store.name}\"", 473 | "}" 474 | ] 475 | }, 476 | "google_storage_bucket_object": { 477 | "prefix":"tf-google_storage_bucket_object", 478 | "description": "Defines google_storage_bucket_object resource", 479 | "body": [ 480 | "resource \"google_storage_bucket_object\" \"${MyResource}\" {", 481 | " name = \"example-name\"", 482 | " bucket = \"bucket-store\"", 483 | " source = \"/images/nature/garden-tiger-moth.jpg\"", 484 | "}" 485 | ] 486 | }, 487 | "google_storage_object_acl": { 488 | "prefix":"tf-google_storage_object_acl", 489 | "description": "Defines google_storage_object_acl resource", 490 | "body": [ 491 | "resource \"google_storage_object_acl\" \"${MyResource}\" {", 492 | " bucket = \"\\${google_storage_bucket.image_store.name}\"", 493 | " object = \"\\${google_storage_bucket_object.image_store.name}\"", 494 | "}" 495 | ] 496 | } 497 | } -------------------------------------------------------------------------------- /src/providers/grafana.json: -------------------------------------------------------------------------------- 1 | { 2 | "grafana": { 3 | "prefix": "tf-grafana", 4 | "description": "define a grafana provider.", 5 | "body": [ 6 | "provider \"grafana\" {", 7 | " url = \"http://grafana.example.com/\"", 8 | " auth = \"1234abcd\"", 9 | "}" 10 | ] 11 | }, 12 | "grafana_dashboard": { 13 | "prefix": "tf-grafana_dashboard", 14 | "description": "define grafana_dashboard resource.", 15 | "body": [ 16 | "resource \"grafana_dashboard\" \"${myResourceName}\" {", 17 | " name = \"my-${myResourceName}\"", 18 | " description = \"my-description-${myResourceName}\"\n", 19 | " config_json = \"\\${file(\"grafana-dashboard.json\")}\"", 20 | "}" 21 | ] 22 | }, 23 | "grafana_data_source": { 24 | "prefix": "tf-grafana_data_source", 25 | "description": "define grafana_data_source resource.", 26 | "body": [ 27 | "resource \"grafana_data_source\" \"${myResourceName}\" {", 28 | " name = \"my-${myResourceName}\"", 29 | " description = \"my-description-${myResourceName}\"\n", 30 | " type = \"influxdb\"", 31 | " url = \"http://influxdb.example.net:8086/\"", 32 | " username = \"myapp\"", 33 | " password = \"foobarbaz\"", 34 | " database_name = \"\\${influxdb_database.metrics.name}\"", 35 | "}" 36 | ] 37 | } 38 | } -------------------------------------------------------------------------------- /src/providers/heroku.json: -------------------------------------------------------------------------------- 1 | { 2 | "heroku": { 3 | "prefix":"tf-heroku", 4 | "description": "Defines heroku", 5 | "body": [ 6 | "provider \"heroku\" {", 7 | " email = \"ops@company.com\"", 8 | " api_key = \"\\${var.heroku_api_key}\"", 9 | "}" 10 | ] 11 | }, 12 | "heroku_addon": { 13 | "prefix":"tf-heroku_addon", 14 | "description": "Defines heroku_addon", 15 | "body": [ 16 | "resource \"heroku_addon\" \"${MyResource}\" {", 17 | "}" 18 | ] 19 | }, 20 | "heroku_app": { 21 | "prefix":"tf-heroku_app", 22 | "description": "Defines heroku_app", 23 | "body": [ 24 | "resource \"heroku_app\" \"${MyResource}\" {", 25 | "}" 26 | ] 27 | }, 28 | "heroku_cert": { 29 | "prefix":"tf-heroku_cert", 30 | "description": "Defines heroku_cert", 31 | "body": [ 32 | "resource \"heroku_cert\" \"${MyResource}\" {", 33 | "}" 34 | ] 35 | }, 36 | "heroku_domain": { 37 | "prefix":"tf-heroku_domain", 38 | "description": "Defines heroku_domain", 39 | "body": [ 40 | "resource \"heroku_domain\" \"${MyResource}\" {", 41 | "}" 42 | ] 43 | }, 44 | "heroku_drain": { 45 | "prefix":"tf-heroku_drain", 46 | "description": "Defines heroku_drain", 47 | "body": [ 48 | "resource \"heroku_drain\" \"${MyResource}\" {", 49 | "}" 50 | ] 51 | } 52 | } -------------------------------------------------------------------------------- /src/providers/ibmcloud.json: -------------------------------------------------------------------------------- 1 | { 2 | "ibmcloud": { 3 | "prefix": "tf-ibm_provider", 4 | "description": "define IBM Cloud provider.", 5 | "body": [ 6 | "provider \"ibm\" {", 7 | " bluemix_api_key = \"\\${var.ibm_bmx_api_key}\"", 8 | " softlayer_username = \"\\${var.ibm_sl_username}\"", 9 | " softlayer_api_key = \"\\${var.ibm_sl_api_key}\"", 10 | "}" 11 | ] 12 | }, 13 | "ibm_compute_ssh_key": { 14 | "prefix": "tf-ibm_compute_ssh_key", 15 | "description": "create IBM Cloud infranstructure SSH key resource.", 16 | "body": [ 17 | "resource \"ibm_compute_ssh_key\" \"${myResourceName}\" {", 18 | " label = \"${myResourceName}\"", 19 | " public_key = \"${var.ssh_public_key}\"", 20 | "}" 21 | ] 22 | }, 23 | "ibm_compute_vm_instance": { 24 | "prefix": "tf-ibm_compute_vm_instance", 25 | "description": "Create virtual server with SSH key.", 26 | "body": [ 27 | "resource \"ibm_compute_vm_instance\" \"${myResourceName}\" {", 28 | " name = \"my-${myResourceName}\"", 29 | " domain = \"example.com\"", 30 | " image = \"DEBIAN_7_64\"", 31 | " region = \"ams01\"", 32 | " public_network_speed = 10", 33 | " hourly_billing = true", 34 | " private_network_only = false", 35 | " cpu = 1", 36 | " ram = 1024", 37 | " disks = [25, 10, 20]", 38 | " local_disk = false", 39 | " ssh_key_ids = \"${ibm_compute_ssh_key.myResourceName.id}\"]", 40 | "}" 41 | ] 42 | }, 43 | "ibm_org": { 44 | "prefix": "tf-ibm_org", 45 | "description": "define a ibm org resource.", 46 | "body": [ 47 | "data \"ibm_org\" \"${myResourceName}\" {", 48 | " org = \"my-org\"", 49 | "}" 50 | ] 51 | }, 52 | "ibm_space": { 53 | "prefix": "tf-ibm_space", 54 | "description": "define a ibm space resource.", 55 | "body": [ 56 | "data \"ibm_space\" \"${myResourceName}\" {", 57 | " org = \"my-org\"", 58 | " space = \"prod\"", 59 | "}" 60 | ] 61 | }, 62 | "ibm_account": { 63 | "prefix": "tf-ibm_account", 64 | "description": "define a ibm space resource.", 65 | "body": [ 66 | "data \"ibm_account\" \"${myResourceName}\" {", 67 | " org_guid = \"${data.ibm_org.myResourceName-org.id}\"", 68 | "}" 69 | ] 70 | }, 71 | "ibm_container_cluster": { 72 | "prefix": "tf-ibm_container_cluster", 73 | "description": "define a ibm container cluster resource.", 74 | "body": [ 75 | "resource \"ibm_container_cluster\" \"${myResourceName}\" {", 76 | " name = \"my-${myResourceName}\"", 77 | " datacenter = \"\"", 78 | " org_guid = \"${data.ibm_org.myResourceName-org.id}\"", 79 | " space_guid = \"${data.ibm_space.myResourceName-space.id}\"", 80 | " account_guid = \"${data.ibm_account.myResourceName-account.id}\"", 81 | " workers = [{", 82 | " name = \"worker1\"", 83 | " }]", 84 | " webhook = [{", 85 | " level = \"Normal\"" 86 | " type = \"slack\"" 87 | " url = \"\"" 88 | " }]" 89 | " machine_type = \"free\"", 90 | " isolation = \"public\"", 91 | " public_vlan_id = \"${ibm_network_vlan.myResourceName.id}\"", 92 | " private_vlan_id = \"${ibm_network_vlan.myResourceName.id}\"", 93 | "}" 94 | ] 95 | }, 96 | "ibm_network_vlan": { 97 | "prefix": "tf-ibm_network_vlan", 98 | "description": "define a ibm network vlan resource.", 99 | "body": [ 100 | "resource \"ibm_network_vlan\" \"${myResourceName}\" {", 101 | " name = \"my-${myResourceName}\"", 102 | " datacenter = \"\"", 103 | " type = \"PUBLIC\"", 104 | " subnet_size = 8", 105 | " router_hostname = \"\"", 106 | " tags = [", 107 | " \"collectd\",", 108 | " \"mesos-master\"", 109 | " ]", 110 | "}" 111 | ] 112 | }, 113 | "ibm_app": { 114 | "prefix": "tf-ibm_app", 115 | "description": "define a ibm app resource.", 116 | "body": [ 117 | "resource \"ibm_app\" \"${myResourceName}\" {", 118 | "name = \"my-${myResourceName}\"", 119 | "space_guid = \"${data.ibm_space.myResourceName-space.id}\"", 120 | "app_path = \"/test/app1.zip\"", 121 | "wait_time_minutes = 90", 122 | "}" 123 | ] 124 | }, 125 | "ibm_app_route": { 126 | "prefix": "tf-ibm_app_route", 127 | "description": "define a ibm app route resource.", 128 | "body": [ 129 | "data \"ibm_app_domain_shared\" \"${myResourceName}\" {", 130 | " name = \"\"", 131 | "}", 132 | "resource \"ibm_app_route\" \"${myResourceName}-route\" {", 133 | " domain_guid = \"${data.ibm_app_domain_shared.myResourceName-domain.id}\"", 134 | " space_guid = \"${data.ibm_space.myResourceName-space.id}\"", 135 | " host = \"myHost\"", 136 | " path = \"/app\"", 137 | "}" 138 | ] 139 | }, 140 | "ibm_app_domain_private": { 141 | "prefix": "tf-ibm_app_domain_private", 142 | "description": "define a ibm domain private resource.", 143 | "body": [ 144 | "resource \"ibm_app_domain_private\" \"${myResourceName}\" {", 145 | " name = \"${myResourceName}\"", 146 | " org_guid = \"${data.ibm_org.myResourceName-org.id}\"", 147 | "}", 148 | "data \"ibm_app_domain_private\" \"${myResourceName}-data-domain-private\" {", 149 | " name = \"${ibm_app_domain_private.myResourceName-domain-private.name}\"", 150 | "}" 151 | ] 152 | }, 153 | "ibm_compute_autoscale_group": { 154 | "prefix": "tf-ibm_compute_autoscale_group", 155 | "description": "define a ibm compute auto scale group resource.", 156 | "body": [ 157 | "resource \"ibm_lb\" \"${myResourceName}\" {", 158 | " connections = 250", 159 | " datacenter = \"\"", 160 | " ha_enabled = false", 161 | "}", 162 | "resource \"ibm_lb_service_group\" \"${myResourceName}-lb-service-group\" {", 163 | " load_balancer_id = \"${ibm_lb.local_lb_01.id}\"", 164 | " allocation = 100", 165 | " port = 80", 166 | " routing_method = \"ROUND_ROBIN\"", 167 | " routing_type = \"HTTP\"", 168 | "}", 169 | "resource \"ibm_compute_autoscale_group\" \"${myResourceName}\" {", 170 | " name = \"my-${myResourceName}\"", 171 | " regional_group = \"\"", 172 | " cooldown = 30", 173 | " minimum_member_count = 1", 174 | " maximum_member_count = 10", 175 | " termination_policy = \"\"", 176 | " virtual_server_id = \"${ibm_lb_service_group.myResourceName-lb-service-group.id}\"", 177 | " port = 8080", 178 | " health_check = {", 179 | " type = \"HTTP\"", 180 | " }", 181 | " virtual_guest_member_template = {", 182 | " hostname = \"my-Host\"", 183 | " domain = \"ibm.com\"", 184 | " cores = ", 185 | " memory = ", 186 | " network_speed = ", 187 | " hourly_billing = true", 188 | " os_reference_code = \"\"", 189 | " local_disk = false", 190 | " disks = [25,100]", 191 | " datacenter = \"\"", 192 | " post_install_script_uri = \"\"", 193 | " user_metadata = \"#!/bin/bash\"", 194 | " }", 195 | "}" 196 | ] 197 | }, 198 | "ibm_compute_autoscale_policy": { 199 | "prefix": "tf-ibm_compute_autoscale_policy", 200 | "description": "define a ibm compute auto scale policy resource.", 201 | "body": [ 202 | "resource \"ibm_compute_autoscale_policy\" \"${myResourceName}\" {", 203 | " name = \"${myResourceName}\"", 204 | " scale_type = \"\"", 205 | " scale_amount = ", 206 | " cooldown = ", 207 | " scale_group_id = \"${ibm_compute_autoscale_group.myResourceName-autoscale-group.id}\"", 208 | " triggers = {", 209 | " type = \"RESOURCE_USE\"", 210 | " watches = {", 211 | " metric = \"host.cpu.percent\"", 212 | " operator = \">\"", 213 | " value = \"80\"", 214 | " period = 120", 215 | " }", 216 | " }", 217 | " triggers = {", 218 | " type = \"ONE_TIME\"", 219 | " date = \"2009-11-11T23:00:00+00:00\"", 220 | " }", 221 | " triggers = {", 222 | " type = \"REPEATING\"", 223 | " schedule = \"0 1 ? * MON,WED *\"", 224 | " }", 225 | "}" 226 | ] 227 | }, 228 | "ibm_compute_monitor": { 229 | "prefix": "tf-ibm_compute_monitor", 230 | "description": "define a ibm compute monitor resource.", 231 | "body": [ 232 | "resource \"ibm_compute_monitor\" \"${myResourceName}\" {", 233 | " guest_id = \"${ibm_compute_vm_instance.myResourceName.id}\"", 234 | " ip_address = \"${ibm_compute_vm_instance.myResourceName.ipv4_address}\"", 235 | " query_type_id = 1", 236 | " response_action_id = 1", 237 | " wait_cycles = 5", 238 | " notified_users = [6575505]", 239 | "}" 240 | ] 241 | }, 242 | "ibm_compute_provisioning_hook": { 243 | "prefix": "tf-ibm_compute_provisioning_hook", 244 | "description": "define a ibm compute provisioning hook resource.", 245 | "body": [ 246 | "resource \"ibm_compute_provisioning_hook\" \"${myResourceName}\" {", 247 | " name = \"my-${myResourceName}\"", 248 | " uri = \"https://www.ibm.com\"", 249 | "}" 250 | ] 251 | }, 252 | "ibm_compute_user": { 253 | "prefix": "tf-ibm_compute_user", 254 | "description": "define a ibm compute user resource.", 255 | "body": [ 256 | "resource \"ibm_compute_user\" \"${myResourceName}\" {", 257 | " first_name = \"first_name\"", 258 | " last_name = \"last_name\"", 259 | " email = \"user@ibm.com\"", 260 | " company_name = \"company_name\"", 261 | " address1 = \"1 Main St.\"", 262 | " address2 = \"Suite 345\"", 263 | " city = \"\"", 264 | " state = \"\"", 265 | " country = \"\"", 266 | " timezone = \"\"", 267 | " username = \"\"", 268 | " password = \"\"", 269 | " permissions = [", 270 | " \"\",", 271 | " \"\"", 272 | " ]", 273 | " has_api_key = true", 274 | " }" 275 | ] 276 | }, 277 | "ibm_dns_domain": { 278 | "prefix": "tf-ibm_dns_domain", 279 | "description": "define a ibm dns domain resource.", 280 | "body": [ 281 | "resource \"ibm_dns_domain\" \"${myResourceName}\" {", 282 | "name = \"my-${myResourceName}\"", 283 | "target = \"172.16.0.100\"", 284 | "}" 285 | ] 286 | }, 287 | "ibm_dns_record": { 288 | "prefix": "tf-ibm_dns_record", 289 | "description": "define a ibm dns record resource.", 290 | "body": [ 291 | "resource \"ibm_dns_record\" \"${myResourceName}\" {", 292 | " data = \"127.0.0.1\"", 293 | " domain_id = \"${ibm_dns_domain.myResourceName.id}\"", 294 | " expire = 900", 295 | " minimum_ttl = 90", 296 | " mx_priority = 1", 297 | " refresh = 1", 298 | " host = \"%s\"", 299 | " responsible_person = \"user@ibm.com\"", 300 | " ttl = 900", 301 | " retry = 1", 302 | " type = \"a\"", 303 | "}" 304 | ] 305 | }, 306 | "ibm_firewall_policy": { 307 | "prefix": "tf-ibm_firewall_policy", 308 | "description": "define a ibm firewall policy resource.", 309 | "body": [ 310 | "resource \"ibm_firewall\" \"${myResourceName}\" {", 311 | " ha_enabled = false", 312 | " public_vlan_id = \"${ibm_compute_vm_instance.myResourceName.public_vlan_id}\"", 313 | " }", 314 | "resource \"ibm_firewall_policy\" \"rules\" {", 315 | " firewall_id = \"${ibm_firewall.accfw2.id}\"", 316 | " rules = {", 317 | " action = \"\"", 318 | " src_ip_address = \"\"", 319 | " src_ip_cidr = ", 320 | " dst_ip_address = \"\"", 321 | " dst_ip_cidr = ", 322 | " dst_port_range_start = 1", 323 | " dst_port_range_end = ", 324 | " notes = \"Deny all\"", 325 | " protocol = \"tcp\"", 326 | " }", 327 | "}" 328 | ] 329 | }, 330 | "ibm_lb_service": { 331 | "prefix": "tf-ibm_lb_service", 332 | "description": "define a ibm lb service resource.", 333 | "body": [ 334 | "resource \"ibm_lb\" \"${myResourceName}\" {", 335 | " connections = 250", 336 | " datacenter = \"\"", 337 | " ha_enabled = false", 338 | " dedicated = false", 339 | "}", 340 | "resource \"ibm_lb_service_group\" \"${myResourceName}\" {", 341 | " port = ", 342 | " routing_method = \"\"", 343 | " routing_type = \"HTTP\"", 344 | " load_balancer_id = \"${ibm_lb.myResourceName.id}\"", 345 | " allocation = ", 346 | "}", 347 | "resource \"ibm_lb_service\" \"${myResourceName}\" {", 348 | " port = 80", 349 | " enabled = true", 350 | " service_group_id = \"${ibm_lb_service_group.myResourceName_lb_service_group.service_group_id}\"", 351 | " weight = 1", 352 | " health_check_type = \"\"", 353 | " ip_address_id = \"${ibm_compute_vm_instance.myResourceName.ip_address_id}\"", 354 | "}" 355 | ] 356 | }, 357 | "ibm_network_public_ip": { 358 | "prefix": "tf-ibm_network_public_ip", 359 | "description": "define a ibm network public ip resource.", 360 | "body": [ 361 | "resource \"ibm_network_public_ip\" \"${myResourceName}\" {", 362 | " routes_to = \"${ibm_compute_vm_instance.myResourceName.ipv4_address}\"", 363 | " notes = \"public ip notes\"", 364 | "}" 365 | ] 366 | }, 367 | "ibm_service_instance": { 368 | "prefix": "tf-ibm_service_instance", 369 | "description": "define a ibm service instance resource.", 370 | "body": [ 371 | "resource \"ibm_service_instance\" \"${myResourceName}\" {", 372 | " name = \"my-${myResourceName}\"", 373 | " space_guid = \"${data.ibm_space.myResourceName-space.id}\"", 374 | " service = \"\"", 375 | " plan = \"\"", 376 | " tags = [\"cluster-service\",\"cluster-bind\"]", 377 | "}", 378 | "resource \"ibm_service_key\" \"serviceKey\" {", 379 | " name = \"my-${myResourceName}\"", 380 | " service_instance_guid = \"${ibm_service_instance.myResourceName.id}\"", 381 | "}" 382 | ] 383 | }, 384 | "ibm_storage_block": { 385 | "prefix": "tf-ibm_storage_block", 386 | "description": "define a ibm storage block resource.", 387 | "body": [ 388 | "resource \"ibm_storage_block\" \"${myResourceName}\" {", 389 | " type = \"\"", 390 | " datacenter = \"${ibm_compute_vm_instance.myResourceName.datacenter}\"", 391 | " capacity = 20", 392 | " iops = 0.25", 393 | " snapshot_capacity = 10", 394 | " os_format_type = \"\"", 395 | " notes = \"notes\"", 396 | "}" 397 | ] 398 | }, 399 | "ibm_storage_file": { 400 | "prefix": "tf-ibm_storage_file", 401 | "description": "define a ibm storage file resource.", 402 | "body": [ 403 | "resource \"ibm_storage_file\" \"${myResourceName}\" {", 404 | " type = \"\"", 405 | " datacenter = \"${ibm_compute_vm_instance.myResourceName.datacenter}\"", 406 | " capacity = 20", 407 | " iops = 0.25", 408 | " snapshot_capacity = 10", 409 | " notes = \"notes\"", 410 | "}" 411 | ] 412 | }, 413 | "ibm_compute_bare_metal": { 414 | "prefix": "tf-ibm_compute_bare_metal", 415 | "description": "define a ibm app resource.", 416 | "body": [ 417 | "resource \"ibm_compute_bare_metal\" \"${myResourceName}\" {", 418 | " hostname = \"myHost\"", 419 | " domain = \"ibm.com\"", 420 | " os_reference_code = \"\"", 421 | " datacenter = \"\"", 422 | " network_speed = ", 423 | " hourly_billing = true", 424 | " private_network_only = false", 425 | " user_metadata = \"{\\\"value\\\":\\\"newvalue\"}\\\"", 426 | " fixed_config_preset = \"\"", 427 | " tags = [\"collectd\"]", 428 | " notes = \"baremetal notes\"", 429 | "}" 430 | ] 431 | }, 432 | "ibm_compute_image_template": { 433 | "prefix": "tf-ibm_compute_image_template", 434 | "description": "define a ibm app resource.", 435 | "body": [ 436 | "data \"ibm_compute_image_template\" \"${myResourceName}\" {", 437 | " name = \"jumpbox\"", 438 | "}" 439 | ] 440 | }, 441 | "ibm_app_domain_shared": { 442 | "prefix": "tf-ibm_app_domain_shared", 443 | "description": "define a ibm app domain shared resource.", 444 | "body": [ 445 | "data \"ibm_app_domain_shared\" \"${myResourceName}\" {", 446 | " name = \"mybluemix.net\"", 447 | "}", 448 | "resource \"ibm_app_route\" \"${myResourceName}_route\" {", 449 | " domain_guid = \"${data.ibm_app_domain_shared.domain_shared.id}\"", 450 | " space_guid = \"${data.ibm_space.myResourceName-space.id}\"", 451 | " host = \"myHost\"", 452 | " path = \"/app\"", 453 | "}" 454 | ] 455 | }, 456 | "ibm_lb_vpx": { 457 | "prefix": "tf-ibm_lb_vpx", 458 | "description": "define a ibm lb vpx resource.", 459 | "body": [ 460 | "resource \"ibm_lb_vpx\" \"${myResourceName}\" {", 461 | " datacenter = \"dal09\"", 462 | " speed = 10", 463 | " version = \"10.1\"", 464 | " plan = \"Standard\"", 465 | " ip_count = 2", 466 | "}" 467 | ] 468 | }, 469 | "ibm_lb_vpx_vip": { 470 | "prefix": "tf-ibm_lb_vpx_vip", 471 | "description": "define a ibm lb vpx vip resource.", 472 | "body": [ 473 | "resource \"ibm_lb_vpx_vip\" \"${myResourceName}\" {", 474 | " name = \"test_load_balancer_vip\"", 475 | " nad_controller_id = \"${ibm_lb_vpx.lb_vpx.id}\"", 476 | " load_balancing_method = \"lc\"", 477 | " source_port = 80", 478 | " type = \"HTTP\"", 479 | " virtual_ip_address = \"${ibm_lb_vpx.lb_vpx.vip_pool[0]}\"", 480 | "}" 481 | ] 482 | }, 483 | "ibm_lb_vpx_service": { 484 | "prefix": "tf-ibm_lb_vpx_service", 485 | "description": "define a ibm lb vpx service resource.", 486 | "body": [ 487 | "resource \"ibm_lb_vpx_service\" \"${myResourceName}\" {", 488 | " name = \"test_load_balancer_service1\"", 489 | " vip_id = \"${ibm_lb_vpx_vip.testacc_vip.id}\"", 490 | " destination_ip_address = \"${ibm_compute_vm_instance.myResourceName.ipv4_address}\"", 491 | " destination_port = ", 492 | " weight = 55", 493 | " connection_limit = ", 494 | " health_check = \"HTTP\"", 495 | " }" 496 | ] 497 | }, 498 | "ibm_lb_vpx_ha": { 499 | "prefix": "tf-ibm_lb_vpx_ha", 500 | "description": "define a ibm lb vpx ha resource.", 501 | "body": [ 502 | "resource \"ibm_lb_vpx_ha\" \"${myResourceName}\" {", 503 | "primary_id = \"${ibm_lb_vpx.lb_vpx.id}\"", 504 | "secondary_id = \"${ibm_lb_vpx.lb_vpx.id}\"", 505 | "stay_secondary = true", 506 | "}" 507 | ] 508 | }, 509 | "ibm_lb": { 510 | "prefix": "tf-ibm_lb", 511 | "description": "define a ibm lb resource.", 512 | "body": [ 513 | "resource \"ibm_lb\" \"${myResourceName}\" {", 514 | " connections = ", 515 | " datacenter = \"\"", 516 | " ha_enabled = false", 517 | " dedicated = true", 518 | "}" 519 | ] 520 | }, 521 | "ibm_network_gateway": { 522 | "prefix": "tf-ibm_lb", 523 | "description": "define a ibm network gateway resource.", 524 | "body": [ 525 | "resource \"ibm_network_gateway\" \"${MyResource}\" {", 526 | " name = \"test\"", 527 | " ssh_key_ids = [\"${data.ibm_compute_ssh_key.key.id}\"]", 528 | " members {", 529 | " hostname = \"mygateway\"", 530 | " domain = \"ibm.com\"", 531 | " datacenter = \"\"", 532 | " network_speed = ", 533 | " private_network_only = false", 534 | " ssh_key_ids = [\"${data.ibm_compute_ssh_key.key.id}\"]", 535 | " tcp_monitoring = true", 536 | " process_key_name = \"\"", 537 | " os_key_name = \"\"", 538 | " redundant_network = false", 539 | " disk_key_names = [\"\"]", 540 | " public_bandwidth = ", 541 | " memory = ", 542 | " tags = [\"gateway tags 1\", \"terraform test tags 1\"]", 543 | " notes = \"gateway notes 1\"", 544 | " ipv6_enabled = true", 545 | " }" 546 | ] 547 | } 548 | } 549 | -------------------------------------------------------------------------------- /src/providers/influxdb.json: -------------------------------------------------------------------------------- 1 | { 2 | "influxdb": { 3 | "prefix": "tf-influxdb", 4 | "description": "define a influxdb provider.", 5 | "body": [ 6 | "provider \"influxdb\" {", 7 | " username = \"1234abcd\"", 8 | " url = \"http://influxdb.example.com/\"", 9 | "}" 10 | ] 11 | }, 12 | "influxdb_database": { 13 | "prefix": "tf-influxdb_database", 14 | "description": "define influxdb_database resource.", 15 | "body": [ 16 | "resource \"influxdb_database\" \"${myResourceName}\" {", 17 | " name = \"my-${myResourceName}\"", 18 | " description = \"my-description-${myResourceName}\"\n", 19 | "}" 20 | ] 21 | }, 22 | "influxdb_user": { 23 | "prefix": "tf-influxdb_user", 24 | "description": "define influxdb_user resource.", 25 | "body": [ 26 | "resource \"influxdb_user\" \"${myResourceName}\" {", 27 | " name = \"my-${myResourceName}\"", 28 | " description = \"my-description-${myResourceName}\"\n", 29 | " password = \"super-secret\"\n", 30 | " grant {", 31 | " database = \"\\${influxdb_database.green.name}\"", 32 | " privilege = \"write\"", 33 | " }", 34 | "}" 35 | ] 36 | }, 37 | "influxdb_continuous_query": { 38 | "prefix": "tf-influxdb_continuous_query", 39 | "description": "define influxdb_continuous_query resource.", 40 | "body": [ 41 | "resource \"influxdb_continuous_query\" \"${myResourceName}\" {", 42 | " name = \"my-${myResourceName}\"", 43 | " description = \"my-description-${myResourceName}\"\n", 44 | " database = \"\\${influxdb_database.test.name}\"", 45 | " query = \"SELECT min(mouse) INTO min_mouse FROM zoo GROUP BY time(30m)\"", 46 | "}" 47 | ] 48 | } 49 | } -------------------------------------------------------------------------------- /src/providers/kubernetes.json: -------------------------------------------------------------------------------- 1 | { 2 | "kubernetes": { 3 | "prefix": "tf-kubernetes", 4 | "description": "define a kubernetes provider.", 5 | "body": [ 6 | "provider \"kubernetes\" {", 7 | " config_context_auth_info = \"${1:ops}\"", 8 | " config_context_cluster = \"${2:mycluster}\"", 9 | "}" 10 | ] 11 | }, 12 | "kubernetes_config_map": { 13 | "prefix": "tf-kubernetes_config_map", 14 | "description": "define a kubernetes_config_map resource.", 15 | "body": [ 16 | "resource \"kubernetes_config_map\" \"${1:kubernetes_config_map_id}\" {", 17 | " metadata {", 18 | " name = \"${2:my-config}\"", 19 | " }", 20 | "}" 21 | ] 22 | }, 23 | "kubernetes_horizontal_pod_autoscaler": { 24 | "prefix": "tf-kubernetes_horizontal_pod_autoscaler", 25 | "description": "define a kubernetes_horizontal_pod_autoscaler resource.", 26 | "body": [ 27 | "resource \"kubernetes_horizontal_pod_autoscaler\" \"${1:kubernetes_horizontal_pod_autoscaler_id}\" {", 28 | " metadata {", 29 | " name = \"${2:my-metadata-name}\"", 30 | " }", 31 | " spec {", 32 | " max_replicas = \"${3:10}\"", 33 | " min_replicas = \"${4:8}\"", 34 | " scale_target_ref {", 35 | " kind = \"${5:ReplicationController}\"", 36 | " name = \"${6:MyApp}\"", 37 | " }", 38 | " }", 39 | "}" 40 | ] 41 | }, 42 | "kubernetes_limit_range": { 43 | "prefix": "tf-kubernetes_limit_range", 44 | "description": "define a kubernetes_limit_range resource.", 45 | "body": [ 46 | "resource \"kubernetes_limit_range\" \"${1:kubernetes_limit_range_id}\" {", 47 | " metadata {", 48 | " name = \"${2:my-metadata-name}\"", 49 | " }", 50 | " spec {", 51 | " limit {", 52 | " type = \"${3:Pod}\"", 53 | " max {", 54 | " cpu = \"${4:200m}\"", 55 | " memory = \"${5:1024M}\"", 56 | " }", 57 | " }", 58 | " }", 59 | "}" 60 | ] 61 | }, 62 | "kubernetes_namespace": { 63 | "prefix": "tf-kubernetes_namespace", 64 | "description": "define a kubernetes_namespace resource.", 65 | "body": [ 66 | "resource \"kubernetes_namespace\" \"${1:kubernetes_namespace_id}\" {", 67 | " name = \"${2:my-kubernetes-namespace}\"\n", 68 | " metadata {", 69 | " annotations {", 70 | " name = \"${3:my-annotations-name}\"", 71 | " }\n", 72 | " labels {", 73 | " mylabel = \"${4:mylabelValue}\"", 74 | " }", 75 | " }", 76 | "}" 77 | ] 78 | }, 79 | "kubernetes_persistent_volume": { 80 | "prefix": "tf-kubernetes_persistent_volume", 81 | "description": "define a kubernetes_persistent_volume resource.", 82 | "body": [ 83 | "resource \"kubernetes_persistent_volume\" \"${1:kubernetes_persistent_volume_id}\" {", 84 | " metadata {", 85 | " name = \"${2:my-metadata-name}\"", 86 | " }", 87 | " spec {", 88 | " capacity {", 89 | " storage = \"${3:2Gi}\"", 90 | " }\n", 91 | " access_modes = [\"${4:ReadWriteMany}\"]", 92 | " persistent_volume_source {", 93 | " vsphere_volume {", 94 | " volume_path = \"${5:/absolute/path}\"", 95 | " }", 96 | " }", 97 | " }", 98 | "}" 99 | ] 100 | }, 101 | "kubernetes_persistent_volume_claim": { 102 | "prefix": "tf-kubernetes_persistent_volume_claim", 103 | "description": "define a kubernetes_persistent_volume_claim resource.", 104 | "body": [ 105 | "resource \"kubernetes_persistent_volume_claim\" \"${1:kubernetes_persistent_volume_claim_id}\" {", 106 | " metadata {", 107 | " name = \"${2:my-metadata-name}\"", 108 | " }", 109 | " spec {", 110 | " access_modes = [\"${3:ReadWriteMany}\"]", 111 | " resources {", 112 | " requests {", 113 | " storage = \"${4:5Gi}\"", 114 | " }", 115 | " }", 116 | " volume_name = \"\\${kubernetes_persistent_volume.${5:kubernetes_persistent_volume_id}.metadata.0.name\\}\"", 117 | " }", 118 | "}" 119 | ] 120 | }, 121 | "kubernetes_resource_quota": { 122 | "prefix": "tf-kubernetes_resource_quota", 123 | "description": "define a kubernetes_resource_quota resource.", 124 | "body": [ 125 | "resource \"kubernetes_resource_quota\" \"${1:kubernetes_resource_quota_id}\" {", 126 | " metadata {", 127 | " name = \"${2:my-metadata-name}\"", 128 | " }", 129 | " spec {", 130 | " hard {", 131 | " pods = \"${4:10}\"", 132 | " }", 133 | " scopes = [\"${3:BestEffort}\"]", 134 | " }", 135 | "}" 136 | ] 137 | }, 138 | "kubernetes_secret": { 139 | "prefix": "tf-kubernetes_secret", 140 | "description": "define a kubernetes_secret resource.", 141 | "body": [ 142 | "resource \"kubernetes_secret\" \"${1:kubernetes_secret_id}\" {", 143 | " metadata {", 144 | " name = \"${2:my-metadata-name}\"", 145 | " }\n", 146 | " data {", 147 | " username = \"${3:admin}\"", 148 | " password = \"${4:P4ssw0rd}\"", 149 | " }\n", 150 | " type = \"${5:kubernetes.io/basic-auth}\"", 151 | "}" 152 | ] 153 | }, 154 | "kubernetes_secret_docker_config": { 155 | "prefix": "tf-kubernetes_secret_docker_config", 156 | "description": "define a kubernetes_secret resource with Docker example.", 157 | "body": [ 158 | "resource \"kubernetes_secret\" \"${1:kubernetes_secret_id}\" {", 159 | " metadata {", 160 | " name = \"${2:my-metadata-name}\"", 161 | " }\n", 162 | " data {", 163 | " # FIXME: remove extra \"\\\" after $", 164 | " \"${3:.dockercfg}\" = \"\\$\\\\{file(\"\\$\\\\{path.module\\}/.docker/config.json\")\\}\"", 165 | " }\n", 166 | " type = \"${4:kubernetes.io/dockercfg}\"", 167 | "}" 168 | ] 169 | }, 170 | "kubernetes_service": { 171 | "prefix": "tf-kubernetes_service", 172 | "description": "define a kubernetes_service resource.", 173 | "body": [ 174 | "resource \"kubernetes_service\" \"${1:kubernetes_service_id}\" {", 175 | " metadata {", 176 | " name = \"${2:my-metadata-name}\"", 177 | " }\n", 178 | " spec {", 179 | " selector {", 180 | " App = \"${3:MyApp}\"", 181 | " }", 182 | " session_affinity = \"${4:ClientIP}\"", 183 | " port {", 184 | " port = ${5:8080}", 185 | " target_port = ${6:808080}", 186 | " }", 187 | " type = \"${7:LoadBalancer}\"", 188 | " }\n", 189 | "}" 190 | ] 191 | } 192 | } -------------------------------------------------------------------------------- /src/providers/librato.json: -------------------------------------------------------------------------------- 1 | { 2 | "librato": { 3 | "prefix": "tf-librato", 4 | "description": "define a librato provider.", 5 | "body": [ 6 | "provider \"librato\" {", 7 | " email = \"ops@company.com\"", 8 | " token = \"\\${var.librato_token}\"", 9 | "}" 10 | ] 11 | }, 12 | "librato_alert": { 13 | "prefix": "tf-librato_alert", 14 | "description": "define librato_alert resource.", 15 | "body": [ 16 | "resource \"librato_alert\" \"${myResourceName}\" {", 17 | " name = \"my-${myResourceName}\"", 18 | " description = \"my-description-${myResourceName}\"\n", 19 | " services = [ \"\\${librato_service.myservice.id}\" ]", 20 | " condition {", 21 | " type = \"above\"", 22 | " threshold = 10", 23 | " metric_name = \"librato.cpu.percent.idle\"", 24 | " }", 25 | "}" 26 | ] 27 | }, 28 | "librato_service": { 29 | "prefix": "tf-librato_service", 30 | "description": "define librato_service resource.", 31 | "body": [ 32 | "resource \"librato_service\" \"${myResourceName}\" {", 33 | " name = \"my-${myResourceName}\"", 34 | " description = \"my-description-${myResourceName}\"\n", 35 | " title = \"Email the admins\"", 36 | " type = \"mail\"", 37 | " settings = <\"", 43 | "}" 44 | ] 45 | } 46 | } -------------------------------------------------------------------------------- /src/providers/statuscake.json: -------------------------------------------------------------------------------- 1 | { 2 | "statuscake": { 3 | "prefix": "tf-statuscake", 4 | "description": "define a statuscake provider.", 5 | "body": [ 6 | "provider \"statuscake\" {", 7 | " username = \"username\"", 8 | " apikey = \"apikey\"", 9 | "}" 10 | ] 11 | }, 12 | "statuscake_test": { 13 | "prefix": "tf-statuscake_test", 14 | "description": "define statuscake_test resource.", 15 | "body": [ 16 | "resource \"statuscake_test\" \"${myResourceName}\" {", 17 | " name = \"my-${myResourceName}\"", 18 | " description = \"my-description-${myResourceName}\"\n", 19 | " website_name = \"google.com\"", 20 | " website_url = \"www.google.com\"", 21 | " test_type = \"HTTP\"", 22 | " check_rate = 300", 23 | "}" 24 | ] 25 | } 26 | } -------------------------------------------------------------------------------- /src/providers/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "template_file": { 3 | "prefix": "tf-template_file", 4 | "description": "Define a template_file template from file", 5 | "body": [ 6 | "data \"template_file\" \"${init}\" {", 7 | " template = \"\\${file(\"\\${path.module}/${init}.tpl\")}\"\n", 8 | " vars {", 9 | " consul_address = \"\\${aws_instance.consul.private_ip}\"", 10 | " }", 11 | "}" 12 | ] 13 | }, 14 | "template_file-inline": { 15 | "prefix": "tf-template_file-inline", 16 | "description": "Define a template_file template inline", 17 | "body": [ 18 | "data \"template_file\" \"${init}\" {", 19 | " template = \"\\$\\${consul_address}:1234\"", 20 | " vars {", 21 | " consul_address = \"\\${aws_instance.consul.private_ip}\"", 22 | " }", 23 | "}" 24 | ] 25 | }, 26 | "template_cloudinit_config": { 27 | "prefix": "tf-template_cloudinit_config", 28 | "description": "Define a template_cloudinit_config template", 29 | "body": [ 30 | "data \"template_cloudinit_config\" \"${config}\" {", 31 | "}" 32 | ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/providers/tls.json: -------------------------------------------------------------------------------- 1 | { 2 | "tls_private_key": { 3 | "prefix": "tf-tls_private_key", 4 | "description": "define tls_private_key resource.", 5 | "body": [ 6 | "resource \"tls_private_key\" \"${myResourceName}\" {", 7 | " name = \"my-${myResourceName}\"", 8 | " description = \"my-description-${myResourceName}\"\n", 9 | " algorithm = \"ECDSA\"", 10 | " ecdsa_curve = \"P384\"", 11 | "}" 12 | ] 13 | }, 14 | "tls_self_signed_cert": { 15 | "prefix": "tf-tls_self_signed_cert", 16 | "description": "define tls_self_signed_cert resource.", 17 | "body": [ 18 | "resource \"tls_self_signed_cert\" \"${myResourceName}\" {", 19 | " name = \"my-${myResourceName}\"", 20 | " description = \"my-description-${myResourceName}\"\n", 21 | " key_algorithm = \"ECDSA\"", 22 | " private_key_pem = \"\\${file(\"private_key.pem\")}\"", 23 | " subject {", 24 | " common_name = \"example.com\"", 25 | " organization = \"ACME Examples, Inc\"", 26 | " }", 27 | " validity_period_hours = 12", 28 | " allowed_uses = [", 29 | " \"key_encipherment\",", 30 | " \"digital_signature\",", 31 | " \"server_auth\",", 32 | " ]", 33 | "}" 34 | ] 35 | }, 36 | "tls_locally_signed_cert": { 37 | "prefix": "tf-tls_locally_signed_cert", 38 | "description": "define tls_locally_signed_cert resource.", 39 | "body": [ 40 | "resource \"tls_locally_signed_cert\" \"${myResourceName}\" {", 41 | " name = \"my-${myResourceName}\"", 42 | " description = \"my-description-${myResourceName}\"\n", 43 | " cert_request_pem = \"\\${file(\\\"cert_request.pem\\\")}\"", 44 | " ca_key_algorithm = \"ECDSA\"", 45 | " ca_private_key_pem = \"\\${file(\\\"ca_private_key.pem\\\")}\"", 46 | " ca_cert_pem = \"\\${file(\\\"ca_cert.pem\\\")}\"", 47 | " validity_period_hours = 12", 48 | " allowed_uses = [", 49 | " \"key_encipherment\",", 50 | " \"digital_signature\",", 51 | " \"server_auth\",", 52 | " ]", 53 | "}" 54 | ] 55 | }, 56 | "tls_cert_request": { 57 | "prefix": "tf-tls_cert_request", 58 | "description": "define tls_cert_request resource.", 59 | "body": [ 60 | "resource \"tls_cert_request\" \"${myResourceName}\" {", 61 | " name = \"my-${myResourceName}\"", 62 | " description = \"my-description-${myResourceName}\"\n", 63 | " key_algorithm = \"ECDSA\"", 64 | " private_key_pem = \"\\${file(\\\"private_key.pem\\\")}\"", 65 | " subject {", 66 | " common_name = \"example.com\"", 67 | " organization = \"ACME Examples, Inc\"", 68 | " }", 69 | "}" 70 | ] 71 | } 72 | } -------------------------------------------------------------------------------- /src/providers/triton.json: -------------------------------------------------------------------------------- 1 | { 2 | "triton": { 3 | "prefix": "tf-triton", 4 | "description": "define a triton provider.", 5 | "body": [ 6 | "provider \"triton\" {", 7 | " account = \"AccountName\"", 8 | " key_material = \"\\${file(\"~/.ssh/id_rsa\")}\"", 9 | " key_id = \"25:d4:a9:fe:ef:e6:c0:bf:b4:4b:4b:d4:a8:8f:01:0f\"", 10 | " # If using a private installation of Triton, specify the URL", 11 | " url = \"https://us-west-1.api.joyentcloud.com\"", 12 | "}" 13 | ] 14 | }, 15 | "triton_firewall_rule": { 16 | "prefix": "tf-triton_firewall_rule", 17 | "description": "define triton_firewall_rule resource.", 18 | "body": [ 19 | "resource \"triton_firewall_rule\" \"${myResourceName}\" {", 20 | " name = \"my-${myResourceName}\"", 21 | " description = \"my-description-${myResourceName}\"\n", 22 | " rule = \"FROM any TO tag www ALLOW tcp (PORT 80 AND PORT 443)\"", 23 | " enabled = true", 24 | "}" 25 | ] 26 | }, 27 | "triton_key": { 28 | "prefix": "tf-triton_key", 29 | "description": "define triton_key resource.", 30 | "body": [ 31 | "resource \"triton_key\" \"${myResourceName}\" {", 32 | " name = \"my-${myResourceName}\"", 33 | " description = \"my-description-${myResourceName}\"\n", 34 | " key = \"\\${file(\"keys/id_rsa\")}\"", 35 | "}" 36 | ] 37 | }, 38 | "triton_machine": { 39 | "prefix": "tf-triton_machine", 40 | "description": "define triton_machine resource.", 41 | "body": [ 42 | "resource \"triton_machine\" \"${myResourceName}\" {", 43 | " name = \"my-${myResourceName}\"", 44 | " description = \"my-description-${myResourceName}\"\n", 45 | " package = \"g3-standard-0.25-smartos\"", 46 | " image = \"842e6fa6-6e9b-11e5-8402-1b490459e334\"", 47 | "}" 48 | ] 49 | } 50 | } -------------------------------------------------------------------------------- /src/providers/ultradns.json: -------------------------------------------------------------------------------- 1 | { 2 | "ultradns": { 3 | "prefix": "tf-ultradns", 4 | "description": "define a ultradns provider.", 5 | "body": [ 6 | "provider \"ultradns\" {", 7 | " username = \"\\${var.ultradns_username}\"", 8 | " password = \"\\${var.ultradns_password}\"", 9 | " baseurl = \"https://test-restapi.ultradns.com/\"", 10 | "}" 11 | ] 12 | }, 13 | "ultradns_record": { 14 | "prefix": "tf-ultradns_record", 15 | "description": "define ultradns_record resource.", 16 | "body": [ 17 | "resource \"ultradns_record\" \"${myResourceName}\" {", 18 | " name = \"my-${myResourceName}\"", 19 | " description = \"my-description-${myResourceName}\"\n", 20 | " zone = \"\\${var.ultradns_domain}\"", 21 | " name = \"terraform\"", 22 | " rdata = [ \"192.168.0.11\" ]", 23 | " type = \"A\"", 24 | " ttl = 3600", 25 | "}" 26 | ] 27 | } 28 | } -------------------------------------------------------------------------------- /src/providers/vault.json: -------------------------------------------------------------------------------- 1 | { 2 | "vault": { 3 | "prefix": "tf-vault", 4 | "description": "define vault provider.", 5 | "body": [ 6 | "provider \"vault\" {", 7 | " address = \"${1:myVaultAddress}\"", 8 | " token = \"${2:myVaultToken}\"", 9 | "}" 10 | ] 11 | }, 12 | "vault_auth_backend": { 13 | "prefix": "tf-vault_auth_backend", 14 | "description": "define vault_auth_backend resource.", 15 | "body": [ 16 | "resource \"vault_auth_backend\" \"${1:vault_auth_backend_id}\" {", 17 | " type = \"${2:myVaultPolicyName}\"", 18 | "}" 19 | ] 20 | }, 21 | "vault_generic_secret": { 22 | "prefix": "tf-vault_generic_secret", 23 | "description": "define vault_generic_secret resource.", 24 | "body": [ 25 | "resource \"vault_generic_secret\" \"${1:vault_generic_secret_id}\" {", 26 | " path = \"${2:secret/foo}\"", 27 | " data_json = <> private_ips.txt\"", 8 | " }" 9 | ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/provisioners/null-resource.json: -------------------------------------------------------------------------------- 1 | { 2 | "null_resource_provisioner": { 3 | "prefix": "tf-null_resource_provisioner", 4 | "description": "Define a null_resource provisioner", 5 | "body": [ 6 | "resource \"null_resource\" \"${cluster}\" {", 7 | " # Changes to any instance of the cluster requires re-provisioning", 8 | " triggers {", 9 | " cluster_instance_ids = \"\\${join(",", aws_instance.cluster.*.id)}\"", 10 | " }", 11 | "}" 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /src/provisioners/remote-exec.json: -------------------------------------------------------------------------------- 1 | { 2 | "remote_exec_provisioner": { 3 | "prefix": "tf-remote_exec_provisioner", 4 | "description": "Define a remote-exec provisioner", 5 | "body": [ 6 | " provisioner \"remote-exec\" {", 7 | " inline = [", 8 | " \"puppet apply\",", 9 | " \"consul join ${aws_instance.web.private_ip}\"", 10 | " ]", 11 | " }" 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /src/state/terraform.json: -------------------------------------------------------------------------------- 1 | { 2 | "terraform_remote_state": { 3 | "prefix": "tf-terraform_remote_state", 4 | "description": "Define a terraform_remote_state template", 5 | "body": [ 6 | "data \"terraform_remote_state\" \"${config}\" {", 7 | " backend = \"atlas\"", 8 | " config {", 9 | " name = \"hashicorp/vpc-prod\"", 10 | " }", 11 | "}" 12 | ] 13 | } 14 | } --------------------------------------------------------------------------------