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

create terraform backends from the UI #145

Merged
merged 35 commits into from
Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
65b906f
create names and resources the same way
glennmusa Apr 1, 2021
3012f9c
branch on strategy
glennmusa Apr 1, 2021
23f5ebe
fail when not a valid strategy
glennmusa Apr 1, 2021
a210faa
setup tf state and service principals before creating container
glennmusa Apr 1, 2021
03ecd00
update using
glennmusa Apr 1, 2021
9bb58de
remove unused arguments
glennmusa Apr 2, 2021
95cff99
paths for conatiner-registry
glennmusa Apr 2, 2021
082c978
optional args on setup_ezdeploy
glennmusa Apr 2, 2021
de8e3fa
Merge branch 'glennmusa/setuptfstateforui' of github.com:Azure/missio…
glennmusa Apr 2, 2021
a1a8e42
incorrect number of args
glennmusa Apr 2, 2021
52ed685
line endings
glennmusa Apr 2, 2021
1d4e886
line endings
glennmusa Apr 2, 2021
ce07e8b
suppress keyvault output
glennmusa Apr 2, 2021
491d8b4
readme linting
brooke-hamilton Apr 2, 2021
e0a690a
get valid value for client secret
glennmusa Apr 2, 2021
0b6a456
Merge branch 'glennmusa/setuptfstateforui' of github.com:Azure/missio…
glennmusa Apr 2, 2021
4e256ed
fix image tag sytnax and add better logging
glennmusa Apr 2, 2021
9d11dab
create backends from frontend
glennmusa Apr 5, 2021
6cfd25a
create tf state from frontend
glennmusa Apr 5, 2021
9062c3c
misplaced default
glennmusa Apr 5, 2021
cb6019e
add a todo to replace vault endpoint
glennmusa Apr 5, 2021
31082d5
defer changing name to mlz.config
glennmusa Apr 5, 2021
0b1a3f1
move the mlz config to the root
glennmusa Apr 5, 2021
43f38f2
update defaults
glennmusa Apr 5, 2021
ddc0702
add support for multiple subscriptions
glennmusa Apr 5, 2021
9962e42
update help
glennmusa Apr 5, 2021
408a5ae
update comment
glennmusa Apr 5, 2021
b5c67d0
remove redundant assignment
glennmusa Apr 5, 2021
3b67102
better comments
glennmusa Apr 5, 2021
0559cb7
update docs
glennmusa Apr 5, 2021
fc44a62
Merge branch 'main' into glennmusa/setuptfstateforui
glennmusa Apr 5, 2021
681570a
default the tenant id
glennmusa Apr 6, 2021
5764ebb
Merge branch 'main' into glennmusa/setuptfstateforui
glennmusa Apr 7, 2021
d009afd
update docs
glennmusa Apr 7, 2021
c7191c9
get cloud specific endpoints for mlz config
glennmusa Apr 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/build/front_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,17 @@ az login --service-principal \
--allow-no-subscriptions \
--output none

. "${BASH_SOURCE%/*}/apply_tf.sh" "${1}" "${2}" "${3}" "${4}" "${5}" "${6}" "${7}"
src_dir=$(dirname "$(realpath "${BASH_SOURCE%/*}")")

# Create config resources given a subscription ID and terraform configuration folder path
create_tf_config() {
. "${src_dir}/scripts/config/config_create.sh" "${mlz_config}" "${1}" "${2}"
}

# create backends for terraform modules
create_tf_config "${mlz_saca_subid}" "${src_dir}/core/saca-hub"
create_tf_config "${mlz_tier0_subid}" "${src_dir}/core/tier-0"
create_tf_config "${mlz_tier1_subid}" "${src_dir}/core/tier-1"
create_tf_config "${mlz_tier2_subid}" "${src_dir}/core/tier-2"

. "${BASH_SOURCE%/*}/apply_tf.sh" "${1}" "${2}" "${3}" "${4}" "${5}" "${6}" "${7}"
8 changes: 4 additions & 4 deletions src/core/globals.front.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"varname": "tf_environment",
"type": "text",
"default_val": "env:TF_ENV",
"description": "Terraform deployment Environment https://www.terraform.io/docs/language/settings/backends/azurerm.html#environment",
"description": "Terraform azurerm environment (e.g. 'public') see: https://www.terraform.io/docs/language/settings/backends/azurerm.html#environment",
"options": []
},
{
Expand All @@ -19,21 +19,21 @@
"varname": "mlz_tenantid",
"type": "text",
"default_val": "env:TENANT_ID",
"description": "Tenant ID where your subscriptions liv",
"description": "Tenant ID where your subscriptions live",
"options": []
},
{
"varname": "mlz_metadatahost",
"type": "text",
"default_val": "management.azure.com",
"description": "Host for azure metadata: e.g 'management.azure.com' or 'management.usgovcloudapi.net'",
"description": "Azure Metadata Service endpoint. (e.g 'management.azure.com' or 'management.usgovcloudapi.net')",
"options": []
},
{
"varname": "mlz_location",
"type": "text",
"default_val": "env:MLZ_LOCATION",
"description": "The location that you're deploying to.",
"description": "The location that you're deploying to (e.g. 'eastus')",
"options": []
}
]
Expand Down
22 changes: 11 additions & 11 deletions src/core/saca-hub/saca-hub.front.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,35 @@
{
"varname": "deploymentname",
"type": "text",
"default_val": "mlzci",
"default_val": "mlz",
"description": "A unique name for your terraform deployment",
"options": []
},
{
"varname": "saca_subid",
"type": "text",
"default_val": "env:SUBSCRIPTION_ID",
"default_val": "env:HUB_SUBSCRIPTION_ID",
"description": "The subscription id where the SACA hub lives",
"options": []
},
{
"varname": "saca_rgname",
"type": "text",
"default_val": "rg-eastus-mlz-sacaci",
"default_val": "rg-eastus-mlz-saca",
"description": "Resource group name",
"options": []
},
{
"varname": "saca_vnetname",
"type": "text",
"default_val": "vn-eastus-mlz-sacaci",
"default_val": "vn-eastus-mlz-saca",
"description": "Virtual Network Name",
"options": []
},
{
"varname": "saca_lawsname",
"type": "text",
"default_val": "laws-eastus-mlz-sacaci",
"default_val": "laws-eastus-mlz-saca",
"description": "Name for log analytic workspace",
"options": []
},
Expand All @@ -48,42 +48,42 @@
{
"varname": "tier0_rgname",
"type": "text",
"default_val": "rg-eastus-mlz-t0ci",
"default_val": "rg-eastus-mlz-t0",
"description": "Tier 0 resource group name",
"options": []
},
{
"varname": "tier0_vnetname",
"type": "text",
"default_val": "vn-eastus-mlz-t0ci",
"default_val": "vn-eastus-mlz-t0",
"description": "Tier 0 virtual network name",
"options": []
},
{
"varname": "tier1_rgname",
"type": "text",
"default_val": "rg-eastus-mlz-t1ci",
"default_val": "rg-eastus-mlz-t1",
"description": "Tier 1 resource group name",
"options": []
},
{
"varname": "tier1_vnetname",
"type": "text",
"default_val": "vn-eastus-mlz-t1ci",
"default_val": "vn-eastus-mlz-t1",
"description": "Tier one virtual network name",
"options": []
},
{
"varname": "tier2_rgname",
"type": "text",
"default_val": "rg-eastus-mlz-t1ci",
"default_val": "rg-eastus-mlz-t2",
"description": "Tier 2 resource group name",
"options": []
},
{
"varname": "tier2_vnetname",
"type": "text",
"default_val": "vn-eastus-mlz-t2ci",
"default_val": "vn-eastus-mlz-t2",
"description": "Tier 2 virtual network name",
"options": []
},
Expand Down
18 changes: 9 additions & 9 deletions src/core/tier-0/tier-0.front.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,56 @@
{
"varname": "saca_subid",
"type": "text",
"default_val": "env:SUBSCRIPTION_ID",
"default_val": "env:HUB_SUBSCRIPTION_ID",
"description": "Saca Hub Subscription ID",
"options": []
},
{
"varname": "saca_rgname",
"type": "text",
"default_val": "rg-eastus-mlz-sacaci",
"default_val": "rg-eastus-mlz-saca",
"description": "Saca Hub Resource Group Name",
"options": []
},
{
"varname": "saca_vnetname",
"type": "text",
"default_val": "vn-eastus-mlz-sacaci",
"default_val": "vn-eastus-mlz-saca",
"description": "Saca Virtual Network Name",
"options": []
},
{
"varname": "saca_fwname",
"type": "text",
"default_val": "DemoFirewallci",
"default_val": "DemoFirewall",
"description": "Saca Firewall Name",
"options": []
},
{
"varname": "saca_lawsname",
"type": "text",
"default_val": "laws-eastus-mlz-sacaci",
"default_val": "laws-eastus-mlz-saca",
"description": "Saca Log Analytic Workspace Name",
"options": []
},
{
"varname": "tier0_subid",
"type": "text",
"default_val": "env:SUBSCRIPTION_ID",
"default_val": "env:TIER0_SUBSCRIPTION_ID",
"description": "Tier0 Subscription Id",
"options": []
},
{
"varname": "tier0_rgname",
"type": "text",
"default_val": "rg-eastus-mlz-t0ci",
"default_val": "rg-eastus-mlz-t0",
"description": "Tier0 Resource Group Name",
"options": []
},
{
"varname": "tier0_vnetname",
"type": "text",
"default_val": "vn-eastus-mlz-t0ci",
"default_val": "vn-eastus-mlz-t0",
"description": "Tier0 Virtual Network Name",
"options": []
},
Expand Down Expand Up @@ -125,7 +125,7 @@
{
"varname": "subnets.{TIER0_SUBNETVM_NAME}.routetable_name",
"type": "text",
"default_val": "tier0vmsrtci",
"default_val": "tier0vmsrt",
"description": "Tier 0 Routeable Subnet Name",
"options": []
}
Expand Down
18 changes: 9 additions & 9 deletions src/core/tier-1/tier-1.front.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,56 @@
{
"varname": "saca_subid",
"type": "text",
"default_val": "env:SUBSCRIPTION_ID",
"default_val": "env:HUB_SUBSCRIPTION_ID",
"description": "Saca Hub Subscription ID",
"options": []
},
{
"varname": "saca_rgname",
"type": "text",
"default_val": "rg-eastus-mlz-sacaci",
"default_val": "rg-eastus-mlz-saca",
"description": "Saca Hub Resource Group Name",
"options": []
},
{
"varname": "saca_vnetname",
"type": "text",
"default_val": "vn-eastus-mlz-sacaci",
"default_val": "vn-eastus-mlz-saca",
"description": "Saca Virtual Network Name",
"options": []
},
{
"varname": "saca_fwname",
"type": "text",
"default_val": "DemoFirewallci",
"default_val": "DemoFirewall",
"description": "Saca Firewall Name",
"options": []
},
{
"varname": "saca_lawsname",
"type": "text",
"default_val": "laws-eastus-mlz-sacaci",
"default_val": "laws-eastus-mlz-saca",
"description": "Saca Log Analytic Workspace Name",
"options": []
},
{
"varname": "tier1_subid",
"type": "text",
"default_val": "env:SUBSCRIPTION_ID",
"default_val": "env:TIER1_SUBSCRIPTION_ID",
"description": "Tier0 Subscription Id",
"options": []
},
{
"varname": "tier1_rgname",
"type": "text",
"default_val": "rg-eastus-mlz-t1ci",
"default_val": "rg-eastus-mlz-t1",
"description": "Tier0 Resource Group Name",
"options": []
},
{
"varname": "tier1_vnetname",
"type": "text",
"default_val": "vn-eastus-mlz-t1ci",
"default_val": "vn-eastus-mlz-t1",
"description": "Tier0 Virtual Network Name",
"options": []
},
Expand Down Expand Up @@ -125,7 +125,7 @@
{
"varname": "subnets.{TIER1_SUBNETVM_NAME}.routetable_name",
"type": "text",
"default_val": "tier1vmsrtci",
"default_val": "tier1vmsrt",
"description": "Tier 0 Routeable Subnet Name",
"options": []
}
Expand Down
18 changes: 9 additions & 9 deletions src/core/tier-2/tier-2.front.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,56 @@
{
"varname": "saca_subid",
"type": "text",
"default_val": "env:SUBSCRIPTION_ID",
"default_val": "env:HUB_SUBSCRIPTION_ID",
"description": "Saca Hub Subscription ID",
"options": []
},
{
"varname": "saca_rgname",
"type": "text",
"default_val": "rg-eastus-mlz-sacaci",
"default_val": "rg-eastus-mlz-saca",
"description": "Saca Hub Resource Group Name",
"options": []
},
{
"varname": "saca_vnetname",
"type": "text",
"default_val": "vn-eastus-mlz-sacaci",
"default_val": "vn-eastus-mlz-saca",
"description": "Saca Virtual Network Name",
"options": []
},
{
"varname": "saca_fwname",
"type": "text",
"default_val": "DemoFirewallci",
"default_val": "DemoFirewall",
"description": "Saca Firewall Name",
"options": []
},
{
"varname": "saca_lawsname",
"type": "text",
"default_val": "laws-eastus-mlz-sacaci",
"default_val": "laws-eastus-mlz-saca",
"description": "Saca Log Analytic Workspace Name",
"options": []
},
{
"varname": "tier2_subid",
"type": "text",
"default_val": "env:SUBSCRIPTION_ID",
"default_val": "env:TIER2_SUBSCRIPTION_ID",
"description": "Tier0 Subscription Id",
"options": []
},
{
"varname": "tier2_rgname",
"type": "text",
"default_val": "rg-eastus-mlz-t2ci",
"default_val": "rg-eastus-mlz-t2",
"description": "Tier2 Resource Group Name",
"options": []
},
{
"varname": "tier2_vnetname",
"type": "text",
"default_val": "vn-eastus-mlz-t2ci",
"default_val": "vn-eastus-mlz-t2",
"description": "Tier2 Virtual Network Name",
"options": []
},
Expand Down Expand Up @@ -125,7 +125,7 @@
{
"varname": "subnets.{TIER2_SUBNETVM_NAME}.routetable_name",
"type": "text",
"default_val": "tier2vmsrtci",
"default_val": "tier2vmsrt",
"description": "Tier 0 Routeable Subnet Name",
"options": []
}
Expand Down
2 changes: 1 addition & 1 deletion src/docs/command-line-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The MLZ deployment architecture uses a single Service Principal whose credential

chmod u+x src/scripts/mlz_tf_setup.sh

src/scripts/mlz_tf_setup.sh src/core/mlz_tf_cfg.var
src/scripts/mlz_tf_setup.sh src/mlz_tf_cfg.var
```

### Set Terraform Configuration Variables
Expand Down
Loading