Azure / sg-aks-workshop

Security + Governance Workshop
Creative Commons Attribution 4.0 International
191 stars 272 forks source link

variables not set while running terraform plan #24

Open suneelsunkara opened 4 years ago

suneelsunkara commented 4 years ago

Hi,

I am using VS code for running the TF scripts in the sample. When i initalize the below variables i get an error that "expoort commend is not recognizable"

export TF_VAR_prefix=$PREFIX export TF_VAR_resource_group=$RG export TF_VAR_location=$LOC export TF_VAR_client_id=$APPID export TF_VAR_client_secret=$PASSWORD export TF_VAR_azure_subnet_id=$(az network vnet subnet show -g $RG --vnet-name $VNET_NAME --name $AKSSUBNET_NAME --query id -o tsv) export TF_VAR_azure_aag_subnet_id=$(az network vnet subnet show -g $RG --vnet-name $VNET_NAME --name $APPGWSUBNET_NAME --query id -o tsv) export TF_VAR_azure_subnet_name=$APPGWSUBNET_NAME export TF_VAR_azure_aag_name=$AGNAME export TF_VAR_azure_aag_public_ip=$(az network public-ip show -g $RG -n $AGPUBLICIP_NAME --query id -o tsv) export TF_VAR_azure_vnet_name=$VNET_NAME export TF_VAR_github_organization=Azure # PLEASE NOTE: This should be your github username if you forked the repository. export TF_VAR_github_token= export TF_VAR_aad_server_app_id= export TF_VAR_aad_server_app_secret= export TF_VAR_aad_client_app_id= export TF_VAR_aad_tenant_id=**

If i try to set the variables as below then when i am running terraform plan it shows variables are not getting set correctly and command keeps prompting for all variables starting from client_id to the bottom.

$TF_VAR_prefix=$PREFIX $TF_VAR_resource_group=$RG $TF_VAR_location=$LOC $TF_VAR_client_id=$SERVER_APPID $TF_VAR_client_secret=$PASSWORD $TF_VAR_azure_subnet_id=$(az network vnet subnet show -g $RG --vnet-name $VNET_NAME --name $AKSSUBNET_NAME --query id -o tsv) $TF_VAR_azure_aag_subnet_id=$(az network vnet subnet show -g $RG --vnet-name $VNET_NAME --name $APPGWSUBNET_NAME --query id -o tsv) $TF_VAR_azure_subnet_name=$APPGWSUBNET_NAME $TF_VAR_azure_aag_name=$AGNAME $TF_VAR_azure_aag_public_ip=$(az network public-ip show -g $RG -n $AGPUBLICIP_NAME --query id -o tsv) $TF_VAR_azure_vnet_name=$VNET_NAME $TF_VAR_github_organization= $GITHUB_ORG_NAME # PLEASE NOTE: This should be your github username if you forked the repository. $TF_VAR_github_token=$GITHUB_TOKEN $TF_VAR_aad_server_app_id=$SERVER_APPID $TF_VAR_aad_server_app_secret=$PASSWORD $TF_VAR_aad_client_app_id=$CLIENT_APPID $TF_VAR_aad_tenant_id=$TENANT_ID

Can anyone help how to resolve this issue?