Skip to content

Commit 3e35c0b

Browse files
authored
Merge pull request #7433 from ameukam/azure-fix-region
azure/bash: Fix location variable
2 parents d5ba5e5 + 7241504 commit 3e35c0b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

infra/azure/bash/ensure-resource-groups.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ if ! [[ -x "$(command -v az)" ]]; then
3535
fi
3636

3737
RESOURCE_GROUP="k8s-infra-tf-states-rg"
38-
RESOURCE_GROUP_LOCATION=$(az group show --name $RESOURCE_GROUP --output tsv --query 'location')
38+
RESOURCE_GROUP_LOCATION="${RESOURCE_GROUP_LOCATION:-eastus}"
3939
TAGS="${TAGS:-"DO-NOT-DELETE=true [email protected]"}"
4040

4141
# storage accounts rules: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftstorage
4242
#TODO define a role assignement with Azure Entra Groups
4343
readonly TERRAFORM_STATE_BUCKET_ENTRIES=(
4444
k8sinfratfstatesub
45-
k8sinfratfstatekops
45+
k8sinfratfstateprow
4646
)
4747

4848
function ensure_terraform_state_containers() {
@@ -69,15 +69,15 @@ function ensure_terraform_state_containers() {
6969

7070
if [[ $container_exists != "false" ]]; then
7171
echo "Creating storage container terraform-state in $storage_account"
72-
az storage container create --name "terraform-state" --connection-string "$storage_connection_string" --tags "${TAGS}"
72+
az storage container create --name "terraform-state" --connection-string "$storage_connection_string"
7373
fi
7474
done
7575
}
7676

7777
function main() {
7878
if [ "$(az group exists --name $RESOURCE_GROUP)" = false ]; then
7979
echo "creating resource group $RESOURCE_GROUP..."
80-
az group create -n "$RESOURCE_GROUP" -l "$LOCATION" --tags "${TAGS}" -o none
80+
az group create -n "$RESOURCE_GROUP" -l "$RESOURCE_GROUP_LOCATION" --tags "${TAGS}" -o none
8181
echo "resource group $RESOURCE_GROUP created"
8282
else
8383
echo "resource group $RESOURCE_GROUP already exists"

0 commit comments

Comments
 (0)