diff --git a/blueprints/factories/project-factory/README.md b/blueprints/factories/project-factory/README.md index a5680781..32a1f8f0 100644 --- a/blueprints/factories/project-factory/README.md +++ b/blueprints/factories/project-factory/README.md @@ -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" } diff --git a/blueprints/gke/multitenant-fleet/README.md b/blueprints/gke/multitenant-fleet/README.md index 80d09ac1..52f26ced 100644 --- a/blueprints/gke/multitenant-fleet/README.md +++ b/blueprints/gke/multitenant-fleet/README.md @@ -78,7 +78,7 @@ 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" } } @@ -86,7 +86,7 @@ module "gke-fleet" { 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" } } @@ -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" } } @@ -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 } @@ -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" } } @@ -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 = { diff --git a/modules/api-gateway/README.md b/modules/api-gateway/README.md index 7c15f581..0b5fc928 100644 --- a/modules/api-gateway/README.md +++ b/modules/api-gateway/README.md @@ -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 = < 1: name += f' {index}' ids.append(name) + examples.append(Example(name, code, path, files[last_header])) elif isinstance(child, marko.block.Heading): last_header = child.children[0].children index = 0 diff --git a/tests/examples/test_plan.py b/tests/examples/test_plan.py index c7fd8dac..4248f641 100644 --- a/tests/examples/test_plan.py +++ b/tests/examples/test_plan.py @@ -13,6 +13,7 @@ # limitations under the License. import re +import subprocess from pathlib import Path BASE_PATH = Path(__file__).parent @@ -52,5 +53,12 @@ def test_example(plan_validator, tmp_path, example): assert expected_modules == num_modules, 'wrong number of modules' assert expected_resources == num_resources, 'wrong number of resources' + # TODO(jccb): this should probably be done in check_documentation + # but we already have all the data here. + result = subprocess.run( + 'terraform fmt -check -diff -no-color main.tf'.split(), cwd=tmp_path, + stdout=subprocess.PIPE, encoding='utf-8') + assert result.returncode == 0, f'terraform code not formatted correctly\n{result.stdout}' + else: assert False, "can't find tftest directive"