Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: True bool variables not added to terraform.tfvars.json #212

Closed
1 task done
sdeguchi opened this issue Oct 3, 2024 · 2 comments
Closed
1 task done

Bug: True bool variables not added to terraform.tfvars.json #212

sdeguchi opened this issue Oct 3, 2024 · 2 comments
Assignees
Labels
Needs: Attention 👋 Needs attention from the maintainers Type: Bug 🪲 Something isn't working

Comments

@sdeguchi
Copy link
Collaborator

sdeguchi commented Oct 3, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Infrastrcuture as Code Type? (Required)

terraform

Module Versions (Required)

ALZ PowerShell Module: 4.0.0
Accelerator Bootstrap Modules: 4.0.3
Terraform Starter Modules: SLZ
Bicep Starter Modules: N/A

Input arguments of the ALZ-PowerShell-Module (Optional)


Basic Inputs

iac: "terraform"
bootstrap: "alz_local"
starter: "microsoft_cloud_for_sovereignty"

Shared Interface Inputs

bootstrap_location: "eastus"
starter_location: "eastus"
root_parent_management_group_id: ""
subscription_id_management: "d1c00641-bc8c-4285-9073-99ac12692ebb"
subscription_id_identity: "06398604-6d33-4ced-bbae-4f8430e0e78b"
subscription_id_connectivity: "d1608aee-3d80-47ab-8759-d75bf83c45ab"

Bootstrap Inputs

target_directory: ""
create_bootstrap_resources_in_azure: false
bootstrap_subscription_id: ""
service_name: "slz"
environment_name: "mgmt"
postfix_number: "1"
apply_alz_archetypes_via_architecture_definition_template: true
architecture_definition_template_path: ""

Starter Module Specific Variables

default_location: "eastus"
allowed_locations: ["eastus"]
allowed_locations_for_confidential_computing: ["eastus"]
default_prefix: "slz"
default_postfix: "sdeguchi1"
subscription_billing_scope: ""
automation_account_name: ""
private_dns_resource_group_id: ""
deploy_bastion: true
ddos_protection_resource_id: ""
log_analytics_workspace_retention_in_days: "365"
use_premium_firewall: true
deploy_ddos_protection: true
ms_defender_for_cloud_email_security_contact: "security_contact@replace_me.com"
policy_assignment_enforcement_mode: "Default"
landing_zone_management_group_children: {
"test": { "id": "test-child-management-group-sdeguchi", "displayName": "Test Child Management Group" }
}
deploy_log_analytics_workspace: false
policy_exemptions: {}
policy_effect: "Deny"
hub_network_address_prefix: "10.20.0.0/16"
customer_policy_sets: {}
customer: "Country/Region"
architecture_definition_override_path: ""
log_analytics_workspace_id: ""
az_firewall_policies_enabled: "true"
tags: {}

Debug Output/Panic Output (Optional)

{
  "allowed_locations": [
    "eastus"
  ],
  "allowed_locations_for_confidential_computing": [
    "eastus"
  ],
  "architecture_definition_override_path": "",
  "architecture_definition_template_path": "",
  "automation_account_name": "",
  "az_firewall_policies_enabled": "true",
  "bastion_outbound_ssh_rdp_ports": [
    "22",
    "3389"
  ],
  "custom_subnets": {
    "AzureBastionSubnet": {
      "address_prefixes": "10.20.15.0/24",
      "name": "AzureBastionSubnet",
      "networkSecurityGroupId": "",
      "routeTableId": ""
    },
    "AzureFirewallSubnet": {
      "address_prefixes": "10.20.254.0/24",
      "name": "AzureFirewallSubnet",
      "networkSecurityGroupId": "",
      "routeTableId": ""
    },
    "GatewaySubnet": {
      "address_prefixes": "10.20.252.0/24",
      "name": "GatewaySubnet",
      "networkSecurityGroupId": "",
      "routeTableId": ""
    }
  },
  "customer": "Country/Region",
  "customer_policy_sets": {},
  "ddos_protection_resource_id": "",
  "default_location": "eastus",
  "default_postfix": "sdeguchi1",
  "default_prefix": "slz",
  "deploy_hub_network": false,
  "deploy_log_analytics_workspace": false,
  "express_route_gateway_config": {
    "name": "noconfigEr"
  },
  "hub_network_address_prefix": "10.20.0.0/16",
  "landing_zone_management_group_children": {
    "test": {
      "id": "test-child-management-group-sdeguchi",
      "displayName": "Test Child Management Group"
    }
  },
  "log_analytics_workspace_id": "",
  "log_analytics_workspace_retention_in_days": "365",
  "ms_defender_for_cloud_email_security_contact": "security_contact@replace_me.com",
  "policy_assignment_enforcement_mode": "Default",
  "policy_effect": "Deny",
  "policy_exemptions": {},
  "private_dns_resource_group_id": "",
  "root_parent_management_group_id": "",
  "subscription_billing_scope": "",
  "subscription_id_connectivity": "d1608aee-3d80-47ab-8759-d75bf83c45ab",
  "subscription_id_identity": "06398604-6d33-4ced-bbae-4f8430e0e78b",
  "subscription_id_management": "d1c00641-bc8c-4285-9073-99ac12692ebb",
  "tags": {},
  "vpn_gateway_config": {
    "name": "noconfigVpn"
  }
}

Expected Behaviour (Required)

All variables have values set for them in the terraform.tfvars.json.

Actual Behaviour (Required)

Boolean variables with default value = true, and variables set to true in the inputs file are not included in the terraform.tfvars.json.

Setting a bool variable from the inputs file using string bool values works("true" or "false") works and interestingly using false also works, but using true does not.

Inputs set to false ("deploy_hub_network" and "deploy_log_analytics_workspace") are included correctly in the terraform.tfvars.json.

Inputs set to true ("apply_alz_archetypes_via_architecture_definition_template", "use_premium_firewall", and "deploy_ddos_protection") are not included in the terraform.tfvars.json.

Steps to Reproduce (Optional)

Use the provided inputs and run Deploy-Accelerator. Check terraform.tfvars.json file in starter module.

Important Factoids (Optional)

No response

References (Optional)

No response

@sdeguchi sdeguchi added Needs: Triage 🔍 Needs triaging by the team Type: Bug 🪲 Something isn't working labels Oct 3, 2024
@jaredfholgate
Copy link
Member

Will need to investigate and reproduce.

@jaredfholgate jaredfholgate added Needs: Attention 👋 Needs attention from the maintainers and removed Needs: Triage 🔍 Needs triaging by the team labels Oct 10, 2024
@jaredfholgate jaredfholgate self-assigned this Oct 10, 2024
jaredfholgate added a commit that referenced this issue Oct 14, 2024
# Pull Request

## Issue

Issue #212 

## Description

Resolve issue with exporting true boolean valued variables to TF VARS
file.

## License

By submitting this pull request, I confirm that my contribution is made
under the terms of the projects associated license.
@jaredfholgate
Copy link
Member

Released in 4.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention 👋 Needs attention from the maintainers Type: Bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants