From 5eb9a85c4a34c8e264207a698bc7df469b1a5938 Mon Sep 17 00:00:00 2001 From: Eric Lund Date: Wed, 12 Jun 2024 13:49:33 -0500 Subject: [PATCH] Add mechanism in terragrunt templates to turn off external IPs --- .../virtual-blade/compute_instance/deploy/terragrunt.hcl | 2 ++ vtds_provider_gcp/private/virtual_blade.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/vtds_provider_gcp/private/terragrunt/templates/system/platform/virtual-blade/compute_instance/deploy/terragrunt.hcl b/vtds_provider_gcp/private/terragrunt/templates/system/platform/virtual-blade/compute_instance/deploy/terragrunt.hcl index 0444268..82d5031 100644 --- a/vtds_provider_gcp/private/terragrunt/templates/system/platform/virtual-blade/compute_instance/deploy/terragrunt.hcl +++ b/vtds_provider_gcp/private/terragrunt/templates/system/platform/virtual-blade/compute_instance/deploy/terragrunt.hcl @@ -70,7 +70,9 @@ inputs = { network = "" subnetwork = format("{{ interconnect_name }}-%s", local.vtds_vars.provider.project.region) subnetwork_project = dependency.service_project.outputs.project_id + {% if access_config %} access_config = local.vtds_vars.{{ config_path }}.access_config + {% endif %} add_hostname_suffix = local.vtds_vars.{{ config_path }}.add_hostname_suffix hostname_suffix_separator = local.vtds_vars.{{ config_path }}.hostname_suffix_separator hostname = local.vtds_vars.{{ config_path }}.hostname diff --git a/vtds_provider_gcp/private/virtual_blade.py b/vtds_provider_gcp/private/virtual_blade.py index 160fce1..b413595 100644 --- a/vtds_provider_gcp/private/virtual_blade.py +++ b/vtds_provider_gcp/private/virtual_blade.py @@ -68,6 +68,7 @@ def initialize(self, key, blade_config): try: interconnect = blade_config['blade_interconnect'] boot_disk = blade_config.get('vm', {})['boot_disk'] + access_config = blade_config.get('access_config', []) except KeyError as err: raise ContextualError( "missing config in the Virtual Blade class '%s': %s" % ( @@ -79,7 +80,8 @@ def initialize(self, key, blade_config): 'blade_class': key, 'interconnect_name': interconnect['subnetwork'], 'config_path': "provider.virtual_blades.%s" % key, - 'source_image_private': boot_disk['source_image_private'] + 'source_image_private': boot_disk['source_image_private'], + 'access_config': access_config, } except KeyError as err: raise ContextualError(