-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support terraform to run in Powershell. (#168)
- Loading branch information
Showing
59 changed files
with
769 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
cache/spring-cloud-azure-starter/spring-cloud-azure-sample-cache/terraform/setup_env.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
$env:AZURE_SUBSCRIPTION_ID=$(terraform -chdir=terraform output -raw AZURE_SUBSCRIPTION_ID) | ||
$env:AZURE_RESOURCE_GROUP=$(terraform -chdir=terraform output -raw AZURE_RESOURCE_GROUP) | ||
$env:AZURE_CACHE_REDIS_NAME=$(terraform -chdir=terraform output -raw AZURE_CACHE_REDIS_NAME) | ||
|
||
echo AZURE_SUBSCRIPTION_ID=$env:AZURE_SUBSCRIPTION_ID | ||
echo AZURE_RESOURCE_GROUP=$env:AZURE_RESOURCE_GROUP | ||
echo AZURE_CACHE_REDIS_NAME=$env:AZURE_CACHE_REDIS_NAME |
4 changes: 4 additions & 0 deletions
4
cache/spring-cloud-azure-starter/spring-cloud-azure-sample-cache/terraform/setup_env.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
export AZURE_SUBSCRIPTION_ID=$(terraform -chdir=./terraform output -raw AZURE_SUBSCRIPTION_ID) | ||
export AZURE_RESOURCE_GROUP=$(terraform -chdir=./terraform output -raw AZURE_RESOURCE_GROUP) | ||
export AZURE_CACHE_REDIS_NAME=$(terraform -chdir=./terraform output -raw AZURE_CACHE_REDIS_NAME) | ||
|
||
echo AZURE_SUBSCRIPTION_ID=$AZURE_SUBSCRIPTION_ID | ||
echo AZURE_RESOURCE_GROUP=$AZURE_RESOURCE_GROUP | ||
echo AZURE_CACHE_REDIS_NAME=$AZURE_CACHE_REDIS_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...pring-cloud-azure-starter-cosmos/spring-cloud-azure-cosmos-sample/terraform/setup_env.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
$env:AZURE_COSMOS_ENDPOINT=$(terraform -chdir=terraform output -raw azure_cosmos_endpoint) | ||
$azure_cosmos_account=$(terraform -chdir=terraform output -raw azure_cosmos_account) | ||
# resourceGroupName | ||
$resourceGroupName=$(terraform -chdir=terraform output -raw resource_group_name) | ||
$principalId=$(terraform -chdir=terraform output -raw object_id) | ||
$readOnlyRoleDefinitionId=$(terraform -chdir=terraform output -raw cosmos_application_id)+"/sqlRoleDefinitions/00000000-0000-0000-0000-000000000001" | ||
$writeOnlyRoleDefinitionId=$(terraform -chdir=terraform output -raw cosmos_application_id)+"/sqlRoleDefinitions/00000000-0000-0000-0000-000000000002" | ||
# assign current Cosmos DB Built-in Data Reader | ||
# https://docs.microsoft.com/azure/cosmos-db/how-to-setup-rbac#using-the-azure-cli-1 | ||
az cosmosdb sql role assignment create --account-name $azure_cosmos_account --resource-group $resourceGroupName --scope "/" --principal-id $principalId --role-definition-id $readOnlyRoleDefinitionId | ||
# assign current Cosmos DB Built-in Data Contributor | ||
az cosmosdb sql role assignment create --account-name $azure_cosmos_account --resource-group $resourceGroupName --scope "/" --principal-id $principalId --role-definition-id $writeOnlyRoleDefinitionId | ||
|
||
echo AZURE_COSMOS_ENDPOINT=$env:AZURE_COSMOS_ENDPOINT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...d-azure-starter-data-cosmos/spring-cloud-azure-data-cosmos-sample/terraform/setup_env.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
$env:AZURE_COSMOS_ENDPOINT=$(terraform -chdir=terraform output -raw azure_cosmos_endpoint) | ||
$env:COSMOS_DATABASE=$(terraform -chdir=terraform output -raw cosmos_database_name) | ||
$azure_cosmos_account=$(terraform -chdir=terraform output -raw azure_cosmos_account) | ||
|
||
# resourceGroupName | ||
$resourceGroupName=$(terraform -chdir=terraform output -raw resource_group_name) | ||
$principalId=$(terraform -chdir=terraform output -raw object_id) | ||
$readOnlyRoleDefinitionId=$(terraform -chdir=terraform output -raw cosmos_application_id)+"/sqlRoleDefinitions/00000000-0000-0000-0000-000000000001" | ||
$writeOnlyRoleDefinitionId=$(terraform -chdir=terraform output -raw cosmos_application_id)+"/sqlRoleDefinitions/00000000-0000-0000-0000-000000000002" | ||
# assign current Cosmos DB Built-in Data Reader | ||
# https://docs.microsoft.com/azure/cosmos-db/how-to-setup-rbac#using-the-azure-cli-1 | ||
az cosmosdb sql role assignment create --account-name $azure_cosmos_account --resource-group $resourceGroupName --scope "/" --principal-id $principalId --role-definition-id $readOnlyRoleDefinitionId | ||
# assign current Cosmos DB Built-in Data Contributor | ||
az cosmosdb sql role assignment create --account-name $azure_cosmos_account --resource-group $resourceGroupName --scope "/" --principal-id $principalId --role-definition-id $writeOnlyRoleDefinitionId | ||
|
||
echo AZURE_COSMOS_ENDPOINT=$env:AZURE_COSMOS_ENDPOINT | ||
echo COSMOS_DATABASE=$env:COSMOS_DATABASE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...g-cloud-azure-starter-integration-eventhubs/eventhubs-integration/terraform/setup_env.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
$env:AZURE_EVENTHUBS_NAMESPACE=$(terraform -chdir=terraform output -raw AZURE_EVENTHUBS_NAMESPACE) | ||
$env:AZURE_STORAGE_CONTAINER_NAME=$(terraform -chdir=terraform output -raw AZURE_STORAGE_CONTAINER_NAME) | ||
$env:AZURE_STORAGE_ACCOUNT_NAME=$(terraform -chdir=terraform output -raw AZURE_STORAGE_ACCOUNT_NAME) | ||
|
||
echo AZURE_EVENTHUBS_NAMESPACE=$env:AZURE_EVENTHUBS_NAMESPACE | ||
echo AZURE_STORAGE_CONTAINER_NAME=$env:AZURE_STORAGE_CONTAINER_NAME | ||
echo AZURE_STORAGE_ACCOUNT_NAME=$env:AZURE_STORAGE_ACCOUNT_NAME |
6 changes: 5 additions & 1 deletion
6
...ng-cloud-azure-starter-integration-eventhubs/eventhubs-integration/terraform/setup_env.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
export AZURE_EVENTHUBS_NAMESPACE=$(terraform -chdir=./terraform output -raw AZURE_EVENTHUBS_NAMESPACE) | ||
export AZURE_STORAGE_CONTAINER_NAME=$(terraform -chdir=./terraform output -raw AZURE_STORAGE_CONTAINER_NAME) | ||
export AZURE_STORAGE_ACCOUNT_NAME=$(terraform -chdir=./terraform output -raw AZURE_STORAGE_ACCOUNT_NAME) | ||
export AZURE_STORAGE_ACCOUNT_NAME=$(terraform -chdir=./terraform output -raw AZURE_STORAGE_ACCOUNT_NAME) | ||
|
||
echo AZURE_EVENTHUBS_NAMESPACE=$AZURE_EVENTHUBS_NAMESPACE | ||
echo AZURE_STORAGE_CONTAINER_NAME=$AZURE_STORAGE_CONTAINER_NAME | ||
echo AZURE_STORAGE_ACCOUNT_NAME=$AZURE_STORAGE_ACCOUNT_NAME |
Oops, something went wrong.