Skip to content

Commit

Permalink
Dev #35: adding environment argument
Browse files Browse the repository at this point in the history
  • Loading branch information
JimCircadian committed Feb 27, 2023
1 parent 7119967 commit babb6e2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion setup_terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ def main():
parser = argparse.ArgumentParser(
description="Initialise the Azure infrastructure needed by Terraform"
)
parser.add_argument(
"-e",
"--environment",
default="dev",
help="Environment name to create, will be used to identify ALL resources (make it short)"
)
parser.add_argument(
"-g",
"--azure-group-id",
Expand Down Expand Up @@ -145,7 +151,7 @@ def get_azure_ids(credential, subscription_name):


def write_terraform_configs(
subscription_id, tenant_id, group_id, user_ip_addresses, storage_key
subscription_id, tenant_id, group_id, user_ip_addresses, storage_key, environment
):
"""Write Terraform config files"""
# Backend secrets
Expand All @@ -166,6 +172,7 @@ def write_terraform_configs(
"tenant_id": tenant_id,
"developers_group_id": group_id,
"users_ip_addresses": user_ip_addresses,
"environment": environment,
}
with open(azure_secrets_path, "w") as f_out:
for key, value in azure_vars.items():
Expand Down

0 comments on commit babb6e2

Please sign in to comment.