Skip to content

Commit

Permalink
Enforce terraform fmt in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
juliocc committed Dec 16, 2022
1 parent 1981820 commit 0eca8a0
Show file tree
Hide file tree
Showing 45 changed files with 368 additions and 360 deletions.
4 changes: 2 additions & 2 deletions blueprints/factories/project-factory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ locals {
trimsuffix(f, ".yaml") => yamldecode(file("${local._data_dir}/${f}"))
}
# these are usually set via variables
_base_dir = "./fabric/blueprints/factories/project-factory"
_data_dir = "${local._base_dir}/sample-data/projects/"
_base_dir = "./fabric/blueprints/factories/project-factory"
_data_dir = "${local._base_dir}/sample-data/projects/"
_defaults_file = "${local._base_dir}/sample-data/defaults.yaml"
}
Expand Down
24 changes: 12 additions & 12 deletions blueprints/gke/multitenant-fleet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ module "gke-fleet" {
location = "europe-west1"
private_cluster_config = local.cluster_defaults.private_cluster_config
vpc_config = {
subnetwork = local.subnet_self_links.ew1
subnetwork = local.subnet_self_links.ew1
master_ipv4_cidr_block = "172.16.10.0/28"
}
}
cluster-1 = {
location = "europe-west3"
private_cluster_config = local.cluster_defaults.private_cluster_config
vpc_config = {
subnetwork = local.subnet_self_links.ew3
subnetwork = local.subnet_self_links.ew3
master_ipv4_cidr_block = "172.16.20.0/28"
}
}
Expand All @@ -95,16 +95,16 @@ module "gke-fleet" {
cluster-0 = {
nodepool-0 = {
node_config = {
disk_type = "pd-balanced"
disk_type = "pd-balanced"
machine_type = "n2-standard-4"
spot = true
spot = true
}
}
}
cluster-1 = {
nodepool-0 = {
node_config = {
disk_type = "pd-balanced"
disk_type = "pd-balanced"
machine_type = "n2-standard-4"
}
}
Expand Down Expand Up @@ -143,13 +143,13 @@ module "gke" {
prefix = "myprefix"
clusters = {
cluster-0 = {
location = "europe-west1"
location = "europe-west1"
vpc_config = {
subnetwork = local.subnet_self_links.ew1
}
}
cluster-1 = {
location = "europe-west3"
location = "europe-west3"
vpc_config = {
subnetwork = local.subnet_self_links.ew3
}
Expand All @@ -159,16 +159,16 @@ module "gke" {
cluster-0 = {
nodepool-0 = {
node_config = {
disk_type = "pd-balanced"
disk_type = "pd-balanced"
machine_type = "n2-standard-4"
spot = true
spot = true
}
}
}
cluster-1 = {
nodepool-0 = {
node_config = {
disk_type = "pd-balanced"
disk_type = "pd-balanced"
machine_type = "n2-standard-4"
}
}
Expand Down Expand Up @@ -205,14 +205,14 @@ module "gke" {
enable_hierarchical_resource_quota = true
enable_pod_tree_labels = true
}
policy_controller = {
policy_controller = {
audit_interval_seconds = 30
exemptable_namespaces = ["kube-system"]
log_denies_enabled = true
referential_rules_enabled = true
template_library_installed = true
}
version = "1.10.2"
version = "1.10.2"
}
}
fleet_configmanagement_clusters = {
Expand Down
26 changes: 13 additions & 13 deletions modules/api-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ This module allows creating an API with its associated API config and API gatewa
## Basic example
```hcl
module "gateway" {
source = "./fabric/modules/api-gateway"
project_id = "my-project"
api_id = "api"
region = "europe-west1"
spec = <<EOT
source = "./fabric/modules/api-gateway"
project_id = "my-project"
api_id = "api"
region = "europe-west1"
spec = <<EOT
# The OpenAPI spec contents
# ...
EOT
Expand All @@ -31,7 +31,7 @@ module "gateway" {
EOT
service_account_email = "sa@my-project.iam.gserviceaccount.com"
iam = {
"roles/apigateway.admin" = [ "user:user@example.com" ]
"roles/apigateway.admin" = ["user:user@example.com"]
}
}
# tftest modules=1 resources=7
Expand All @@ -40,18 +40,18 @@ module "gateway" {
## Basic example + service account creation
```hcl
module "gateway" {
source = "./fabric/modules/api-gateway"
project_id = "my-project"
api_id = "api"
region = "europe-west1"
spec = <<EOT
source = "./fabric/modules/api-gateway"
project_id = "my-project"
api_id = "api"
region = "europe-west1"
spec = <<EOT
# The OpenAPI spec contents
# ...
EOT
service_account_create = true
iam = {
"roles/apigateway.admin" = [ "user:mirene@google.com" ]
"roles/apigateway.viewer" = [ "user:mirene@google.com" ]
"roles/apigateway.admin" = ["user:mirene@google.com"]
"roles/apigateway.viewer" = ["user:mirene@google.com"]
}
}
# tftest modules=1 resources=11
Expand Down
38 changes: 19 additions & 19 deletions modules/apigee/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ module "apigee" {
}
environments = {
apis-test = {
display_name = "APIs test"
description = "APIs Test"
envgroups = ["test"]
display_name = "APIs test"
description = "APIs Test"
envgroups = ["test"]
}
apis-prod = {
display_name = "APIs prod"
description = "APIs prod"
envgroups = ["prod"]
display_name = "APIs prod"
description = "APIs prod"
envgroups = ["prod"]
iam = {
"roles/viewer" = ["group:devops@myorg.com"]
}
Expand Down Expand Up @@ -71,25 +71,25 @@ module "apigee" {
source = "./fabric/modules/apigee"
project_id = "my-project"
organization = {
display_name = "My Organization"
description = "My Organization"
runtime_type = "HYBRID"
analytics_region = "europe-west1"
display_name = "My Organization"
description = "My Organization"
runtime_type = "HYBRID"
analytics_region = "europe-west1"
}
envgroups = {
test = ["test.example.com"]
prod = ["prod.example.com"]
}
environments = {
apis-test = {
display_name = "APIs test"
description = "APIs Test"
envgroups = ["test"]
display_name = "APIs test"
description = "APIs Test"
envgroups = ["test"]
}
apis-prod = {
display_name = "APIs prod"
description = "APIs prod"
envgroups = ["prod"]
display_name = "APIs prod"
description = "APIs prod"
envgroups = ["prod"]
iam = {
"roles/viewer" = ["group:devops@myorg.com"]
}
Expand Down Expand Up @@ -120,9 +120,9 @@ module "apigee" {
project_id = "my-project"
environments = {
apis-test = {
display_name = "APIs test"
description = "APIs Test"
envgroups = ["test"]
display_name = "APIs test"
description = "APIs Test"
envgroups = ["test"]
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions modules/bigquery-dataset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The access variables are split into `access` and `access_identities` variables,
module "bigquery-dataset" {
source = "./fabric/modules/bigquery-dataset"
project_id = "my-project"
id = "my-dataset"
id = "my-dataset"
access = {
reader-group = { role = "READER", type = "group" }
owner = { role = "OWNER", type = "user" }
Expand All @@ -46,7 +46,7 @@ Access configuration can also be specified via IAM instead of basic roles via th
module "bigquery-dataset" {
source = "./fabric/modules/bigquery-dataset"
project_id = "my-project"
id = "my-dataset"
id = "my-dataset"
iam = {
"roles/bigquery.dataOwner" = ["user:user1@example.org"]
}
Expand Down
36 changes: 18 additions & 18 deletions modules/bigtable-instance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ This module allows managing a single BigTable instance, including access configu
```hcl
module "bigtable-instance" {
source = "./fabric/modules/bigtable-instance"
project_id = "my-project"
name = "instance"
cluster_id = "instance"
zone = "europe-west1-b"
tables = {
source = "./fabric/modules/bigtable-instance"
project_id = "my-project"
name = "instance"
cluster_id = "instance"
zone = "europe-west1-b"
tables = {
test1 = null,
test2 = {
split_keys = ["a", "b", "c"]
column_family = null
}
}
iam = {
iam = {
"roles/bigtable.user" = ["user:viewer@testdomain.com"]
}
}
Expand Down Expand Up @@ -59,11 +59,11 @@ If you use autoscaling, you should not set the variable `num_nodes`.
```hcl
module "bigtable-instance" {
source = "./fabric/modules/bigtable-instance"
project_id = "my-project"
name = "instance"
cluster_id = "instance"
zone = "europe-southwest1-b"
source = "./fabric/modules/bigtable-instance"
project_id = "my-project"
name = "instance"
cluster_id = "instance"
zone = "europe-southwest1-b"
autoscaling_config = {
min_nodes = 3
max_nodes = 7
Expand All @@ -78,12 +78,12 @@ module "bigtable-instance" {
```hcl
module "bigtable-instance" {
source = "./fabric/modules/bigtable-instance"
project_id = "my-project"
name = "instance"
cluster_id = "instance"
zone = "europe-southwest1-a"
storage_type = "SSD"
source = "./fabric/modules/bigtable-instance"
project_id = "my-project"
name = "instance"
cluster_id = "instance"
zone = "europe-southwest1-a"
storage_type = "SSD"
autoscaling_config = {
min_nodes = 3
max_nodes = 7
Expand Down
2 changes: 1 addition & 1 deletion modules/billing-budget/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module "budget" {
]
email_recipients = {
project_id = "my-project"
emails = ["user@example.com"]
emails = ["user@example.com"]
}
}
# tftest modules=1 resources=2
Expand Down
28 changes: 14 additions & 14 deletions modules/binauthz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ This module simplifies the creation of a Binary Authorization policy, attestors

```hcl
module "binauthz" {
source = "./fabric/modules/binauthz"
project_id = "my_project"
source = "./fabric/modules/binauthz"
project_id = "my_project"
global_policy_evaluation_mode = "DISABLE"
default_admission_rule = {
evaluation_mode = "ALWAYS_DENY"
Expand All @@ -18,16 +18,16 @@ module "binauthz" {
}
cluster_admission_rules = {
"europe-west1-c.cluster" = {
evaluation_mode = "REQUIRE_ATTESTATION"
enforcement_mode = "ENFORCED_BLOCK_AND_AUDIT_LOG"
attestors = [ "test" ]
evaluation_mode = "REQUIRE_ATTESTATION"
enforcement_mode = "ENFORCED_BLOCK_AND_AUDIT_LOG"
attestors = ["test"]
}
}
attestors_config = {
"test": {
note_reference = null
pgp_public_keys = [
<<EOT
"test" : {
note_reference = null
pgp_public_keys = [
<<EOT
mQENBFtP0doBCADF+joTiXWKVuP8kJt3fgpBSjT9h8ezMfKA4aXZctYLx5wslWQl
bB7Iu2ezkECNzoEeU7WxUe8a61pMCh9cisS9H5mB2K2uM4Jnf8tgFeXn3akJDVo0
oR1IC+Dp9mXbRSK3MAvKkOwWlG99sx3uEdvmeBRHBOO+grchLx24EThXFOyP9Fk6
Expand All @@ -44,11 +44,11 @@ module "binauthz" {
qoIRW6y0+UlAc+MbqfL0ziHDOAmcqz1GnROg
=6Bvm
EOT
]
pkix_public_keys = null
iam = {
"roles/viewer" = ["user:user1@my_org.com"]
}
]
pkix_public_keys = null
iam = {
"roles/viewer" = ["user:user1@my_org.com"]
}
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions modules/cloud-config-container/coredns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This example will create a `cloud-config` that uses the module's defaults, creat

```hcl
module "cos-coredns" {
source = "./fabric/modules/cloud-config-container/coredns"
source = "./fabric/modules/cloud-config-container/coredns"
}
module "vm" {
Expand Down Expand Up @@ -56,15 +56,15 @@ This example will create a `cloud-config` using a custom CoreDNS configuration,

```hcl
module "cos-coredns" {
source = "./fabric/modules/cloud-config-container/coredns"
source = "./fabric/modules/cloud-config-container/coredns"
coredns_config = "./fabric/modules/cloud-config-container/coredns/Corefile-hosts"
files = {
"/etc/coredns/example.hosts" = {
content = "127.0.0.2 foo.example.org foo"
owner = null
permissions = "0644"
}
}
}
}
# tftest modules=0 resources=0
```
Expand Down

0 comments on commit 0eca8a0

Please sign in to comment.