-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c79756
commit a40c1c9
Showing
676 changed files
with
33,415 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Tested Terraform Hierarchies | ||
|
||
This directory contains different hierarchies of root modules | ||
which the language server supports and is tested against. | ||
|
||
## Single Root | ||
|
||
- `single-root-ext-modules-only` | ||
- `single-root-local-and-ext-modules` | ||
- `single-root-local-modules-only` | ||
- `single-root-no-modules` | ||
|
||
## Nested Single Root | ||
|
||
- `nested-single-root-no-modules` | ||
- `nested-single-root-ext-modules` | ||
- `nested-single-root-local-submodules-down` | ||
- `nested-single-root-local-submodules-up` | ||
|
||
## Nested Multiple Roots | ||
|
||
- `main-module-multienv` - https://dev.to/piotrgwiazda/main-module-approach-for-handling-multiple-environments-in-terraform-1oln | ||
- `nested-multi-root-isolated-no-modules` | ||
- `nested-multi-root-isolated-ext-modules` | ||
- `nested-multi-root-isolated-local-submodules-down` | ||
- `nested-multi-root-isolated-local-submodules-up` - e.g. https://github.com/terraform-aws-modules/terraform-aws-security-group | ||
- `nested-multi-root-crosslinked-modules` |
1 change: 1 addition & 0 deletions
1
...erraform/rootmodule/testdata/main-module-multienv/env/dev/.terraform/modules/modules.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"Modules":[{"Key":"main.db","Source":"../modules/database","Dir":"../../modules/database"},{"Key":"main.gorilla-app","Source":"../modules/application","Dir":"../../modules/application"},{"Key":"","Source":"","Dir":"."},{"Key":"main","Source":"../../main","Dir":"../../main"}]} |
3 changes: 3 additions & 0 deletions
3
...ootmodule/testdata/main-module-multienv/env/dev/.terraform/plugins/darwin_amd64/lock.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"random": "7903b3f4d7067b3e8ca2440aa4342b57286310e074a806d0f1a673034969817b" | ||
} |
10 changes: 10 additions & 0 deletions
10
internal/terraform/rootmodule/testdata/main-module-multienv/env/dev/dev.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
provider "random" { | ||
version = "~>2.0" | ||
} | ||
|
||
module "main" { | ||
source = "../../main" | ||
environment_name = "dev" | ||
app_instances = 1 | ||
db_instances = 1 | ||
} |
1 change: 1 addition & 0 deletions
1
...rraform/rootmodule/testdata/main-module-multienv/env/prod/.terraform/modules/modules.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"Modules":[{"Key":"main","Source":"../../main","Dir":"../../main"},{"Key":"main.db","Source":"../modules/database","Dir":"../../modules/database"},{"Key":"main.gorilla-app","Source":"../modules/application","Dir":"../../modules/application"},{"Key":"","Source":"","Dir":"."}]} |
3 changes: 3 additions & 0 deletions
3
...otmodule/testdata/main-module-multienv/env/prod/.terraform/plugins/darwin_amd64/lock.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"random": "7903b3f4d7067b3e8ca2440aa4342b57286310e074a806d0f1a673034969817b" | ||
} |
10 changes: 10 additions & 0 deletions
10
internal/terraform/rootmodule/testdata/main-module-multienv/env/prod/prod.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
provider "random" { | ||
version = "~>2.0" | ||
} | ||
|
||
module "main" { | ||
source = "../../main" | ||
environment_name = "prod" | ||
app_instances = 5 | ||
db_instances = 3 | ||
} |
1 change: 1 addition & 0 deletions
1
...form/rootmodule/testdata/main-module-multienv/env/staging/.terraform/modules/modules.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"Modules":[{"Key":"","Source":"","Dir":"."},{"Key":"main","Source":"../../main","Dir":"../../main"},{"Key":"main.db","Source":"../modules/database","Dir":"../../modules/database"},{"Key":"main.gorilla-app","Source":"../modules/application","Dir":"../../modules/application"}]} |
3 changes: 3 additions & 0 deletions
3
...odule/testdata/main-module-multienv/env/staging/.terraform/plugins/darwin_amd64/lock.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"random": "7903b3f4d7067b3e8ca2440aa4342b57286310e074a806d0f1a673034969817b" | ||
} |
10 changes: 10 additions & 0 deletions
10
internal/terraform/rootmodule/testdata/main-module-multienv/env/staging/staging.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
provider "random" { | ||
version = "~>2.0" | ||
} | ||
|
||
module "main" { | ||
source = "../../main" | ||
environment_name = "staging" | ||
app_instances = 2 | ||
db_instances = 1 | ||
} |
25 changes: 25 additions & 0 deletions
25
internal/terraform/rootmodule/testdata/main-module-multienv/main/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
variable "environment_name" { | ||
type = string | ||
} | ||
|
||
variable "app_instances" { | ||
type = number | ||
} | ||
|
||
variable "db_instances" { | ||
type = number | ||
} | ||
|
||
module "db" { | ||
source = "../modules/database" | ||
environment_name = var.environment_name | ||
app_prefix = "foxtrot" | ||
instances = var.db_instances | ||
} | ||
|
||
module "gorilla-app" { | ||
source = "../modules/application" | ||
environment_name = var.environment_name | ||
app_prefix = "protect-gorillas" | ||
instances = var.app_instances | ||
} |
18 changes: 18 additions & 0 deletions
18
internal/terraform/rootmodule/testdata/main-module-multienv/modules/application/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
variable "environment_name" { | ||
type = string | ||
} | ||
|
||
variable "app_prefix" { | ||
type = string | ||
} | ||
|
||
variable "instances" { | ||
type = number | ||
} | ||
|
||
resource "random_pet" "application" { | ||
count = var.instances | ||
keepers = { | ||
unique = "${var.environment_name}-${var.app_prefix}" | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
internal/terraform/rootmodule/testdata/main-module-multienv/modules/database/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
variable "environment_name" { | ||
type = string | ||
} | ||
|
||
variable "db_prefix" { | ||
type = string | ||
} | ||
|
||
variable "instances" { | ||
type = number | ||
} | ||
|
||
resource "random_pet" "database" { | ||
count = var.instances | ||
keepers = { | ||
unique = "${var.environment_name}-${var.db_prefix}" | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...erraform/rootmodule/testdata/single-root-ext-modules-only/.terraform/modules/modules.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"Modules":[{"Key":"vpc1.vpc","Source":"./modules/vpc","Dir":".terraform/modules/vpc1/terraform-google-network-2.3.0/modules/vpc"},{"Key":"vpc2","Source":"terraform-google-modules/network/google","Version":"2.3.0","Dir":".terraform/modules/vpc2/terraform-google-network-2.3.0"},{"Key":"vpc2.routes","Source":"./modules/routes","Dir":".terraform/modules/vpc2/terraform-google-network-2.3.0/modules/routes"},{"Key":"vpc2.vpc","Source":"./modules/vpc","Dir":".terraform/modules/vpc2/terraform-google-network-2.3.0/modules/vpc"},{"Key":"vpc1.routes","Source":"./modules/routes","Dir":".terraform/modules/vpc1/terraform-google-network-2.3.0/modules/routes"},{"Key":"vpc1.subnets","Source":"./modules/subnets","Dir":".terraform/modules/vpc1/terraform-google-network-2.3.0/modules/subnets"},{"Key":"vpc2.subnets","Source":"./modules/subnets","Dir":".terraform/modules/vpc2/terraform-google-network-2.3.0/modules/subnets"},{"Key":"","Source":"","Dir":"."},{"Key":"vpc1","Source":"terraform-google-modules/network/google","Version":"2.3.0","Dir":".terraform/modules/vpc1/terraform-google-network-2.3.0"}]} |
2 changes: 2 additions & 0 deletions
2
...es-only/.terraform/modules/vpc1/terraform-google-network-2.3.0/.github/release-please.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
releaseType: terraform-module | ||
handleGHRelease: true |
47 changes: 47 additions & 0 deletions
47
...e-root-ext-modules-only/.terraform/modules/vpc1/terraform-google-network-2.3.0/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# OSX leaves these everywhere on SMB shares | ||
._* | ||
|
||
# OSX trash | ||
.DS_Store | ||
|
||
# Python | ||
*.pyc | ||
|
||
# Emacs save files | ||
*~ | ||
\#*\# | ||
.\#* | ||
|
||
# Vim-related files | ||
[._]*.s[a-w][a-z] | ||
[._]s[a-w][a-z] | ||
*.un~ | ||
Session.vim | ||
.netrwhist | ||
|
||
### https://raw.github.com/github/gitignore/90f149de451a5433aebd94d02d11b0e28843a1af/Terraform.gitignore | ||
|
||
# Local .terraform directories | ||
**/.terraform/* | ||
|
||
# .tfstate files | ||
*.tfstate | ||
*.tfstate.* | ||
|
||
# Crash log files | ||
crash.log | ||
|
||
# Kitchen files | ||
**/inspec.lock | ||
**/.kitchen | ||
**/.kitchen.local.yml | ||
**/Gemfile.lock | ||
|
||
# Ignore any .tfvars files that are generated automatically for each Terraform run. Most | ||
# .tfvars files are managed as part of configuration and so should be included in | ||
# version control. | ||
# | ||
# example.tfvars | ||
test/fixtures/shared/terraform.tfvars | ||
|
||
credentials.json |
162 changes: 162 additions & 0 deletions
162
...root-ext-modules-only/.terraform/modules/vpc1/terraform-google-network-2.3.0/.kitchen.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
# Copyright 2019 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- | ||
driver: | ||
name: "terraform" | ||
command_timeout: 1800 | ||
|
||
provisioner: | ||
name: "terraform" | ||
|
||
platforms: | ||
- name: local | ||
|
||
suites: | ||
- name: "simple_project" | ||
driver: | ||
name: "terraform" | ||
command_timeout: 1800 | ||
root_module_directory: test/fixtures/simple_project/ | ||
verifier: | ||
name: terraform | ||
color: true | ||
systems: | ||
- name: inspec-gcp | ||
backend: gcp | ||
controls: | ||
- gcp | ||
- name: local | ||
backend: local | ||
controls: | ||
- gcloud | ||
- name: "simple_project_with_regional_network" | ||
driver: | ||
name: "terraform" | ||
command_timeout: 1800 | ||
root_module_directory: test/fixtures/simple_project_with_regional_network/ | ||
verifier: | ||
name: terraform | ||
color: true | ||
systems: | ||
- name: inspec-gcp | ||
backend: gcp | ||
controls: | ||
- gcp | ||
- name: "secondary_ranges" | ||
driver: | ||
name: "terraform" | ||
command_timeout: 1800 | ||
root_module_directory: test/fixtures/secondary_ranges/ | ||
verifier: | ||
name: terraform | ||
color: true | ||
systems: | ||
- name: local | ||
attrs_outputs: | ||
customized_inspec_attribute: output_network_name | ||
customized_inspec_attribute: output_network_self_link | ||
customized_inspec_attribute: output_subnets_ips | ||
customized_inspec_attribute: output_routes | ||
customized_inspec_attribute: output_subnets_flow_logs | ||
customized_inspec_attribute: output_subnets_names | ||
customized_inspec_attribute: output_subnets_private_access | ||
customized_inspec_attribute: output_subnets_regions | ||
customized_inspec_attribute: output_subnets_secondary_ranges | ||
customized_inspec_attribute: output_project_id | ||
backend: local | ||
controls: | ||
- gcloud | ||
- inspec_attributes | ||
- name: "multi_vpc" | ||
driver: | ||
name: "terraform" | ||
command_timeout: 1800 | ||
root_module_directory: test/fixtures/multi_vpc/ | ||
verifier: | ||
name: terraform | ||
color: true | ||
systems: | ||
- name: local | ||
backend: local | ||
controls: | ||
- gcloud | ||
- name: "delete_default_gateway_routes" | ||
driver: | ||
name: "terraform" | ||
command_timeout: 1800 | ||
root_module_directory: test/fixtures/delete_default_gateway_routes/ | ||
verifier: | ||
name: terraform | ||
color: true | ||
systems: | ||
- name: local | ||
backend: local | ||
controls: | ||
- gcloud | ||
- name: "submodule_firewall" | ||
driver: | ||
name: "terraform" | ||
command_timeout: 1800 | ||
root_module_directory: test/fixtures/submodule_firewall/ | ||
verifier: | ||
name: terraform | ||
color: true | ||
systems: | ||
- name: inspec-gcp | ||
backend: gcp | ||
controls: | ||
- gcp | ||
- name: local | ||
attrs_outputs: | ||
customized_inspec_attribute: output_network_name | ||
customized_inspec_attribute: output_network_self_link | ||
customized_inspec_attribute: output_subnets_ips | ||
customized_inspec_attribute: output_routes | ||
customized_inspec_attribute: output_subnets_flow_logs | ||
customized_inspec_attribute: output_subnets_names | ||
customized_inspec_attribute: output_subnets_private_access | ||
customized_inspec_attribute: output_subnets_regions | ||
customized_inspec_attribute: output_subnets_secondary_ranges | ||
customized_inspec_attribute: output_project_id | ||
backend: local | ||
controls: | ||
- gcloud | ||
- inspec_attributes | ||
- name: "submodule_network_peering" | ||
driver: | ||
name: "terraform" | ||
command_timeout: 1800 | ||
root_module_directory: test/fixtures/submodule_network_peering/ | ||
verifier: | ||
name: terraform | ||
color: true | ||
systems: | ||
- name: local | ||
backend: local | ||
controls: | ||
- gcloud | ||
- name: "ilb_routing" | ||
driver: | ||
name: "terraform" | ||
command_timeout: 1800 | ||
root_module_directory: test/fixtures/ilb_routing/ | ||
verifier: | ||
name: terraform | ||
color: true | ||
systems: | ||
- name: local | ||
backend: local | ||
controls: | ||
- gcloud |
1 change: 1 addition & 0 deletions
1
...oot-ext-modules-only/.terraform/modules/vpc1/terraform-google-network-2.3.0/.ruby-version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2.5.3 |
Oops, something went wrong.