Skip to content

Commit

Permalink
feat(terraform): default to local backend for lower barrier to entry
Browse files Browse the repository at this point in the history
  • Loading branch information
julie-ng committed Jun 11, 2021
1 parent ebf58ee commit 2a2ab95
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions TERRAFORM.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ source ./.env
Assuming you are logged in with `az login`, just run

```
terraform init -backend=false
terraform init
```

Then continue to [Create Deployment Plan →](##create-deployment-plan)
Expand Down Expand Up @@ -118,7 +118,7 @@ sas_token="?sv=2019-12-12…"
Finally run `init` with our new backend config.

```
terraform init -backend-config=./backend.hcl
terraform init -backend=true -backend-config=./backend.hcl
```


Expand Down
1 change: 1 addition & 0 deletions azure-pipelines/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ variables:
steps:
- bash: |
terraform init \
-backend=true \
-backend-config="storage_account_name=$TF_STATE_BLOB_ACCOUNT_NAME" \
-backend-config="container_name=$TF_STATE_BLOB_CONTAINER_NAME" \
-backend-config="key=$TF_STATE_BLOB_FILE" \
Expand Down
3 changes: 2 additions & 1 deletion azure-pipelines/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ stages:
- bash: terraform version
displayName: terraform version

- bash: terraform init -backend=false
- bash: terraform init
displayName: terraform init

- bash: |
Expand All @@ -44,6 +44,7 @@ stages:
steps:
- bash: |
terraform init \
-backend=true \
-backend-config="storage_account_name=$TF_STATE_BLOB_ACCOUNT_NAME" \
-backend-config="container_name=$TF_STATE_BLOB_CONTAINER_NAME" \
-backend-config="key=$TF_STATE_BLOB_FILE" \
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pool:
vmImage: 'ubuntu-18.04'

steps:
- bash: terraform init -backend=false
- bash: terraform init
displayName: init

- bash: terraform validate
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines/detect-drift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ stages:
# Step - terraform init
- bash: |
terraform init \
-backend=true \
-backend-config="storage_account_name=$TF_STATE_BLOB_ACCOUNT_NAME" \
-backend-config="container_name=$TF_STATE_BLOB_CONTAINER_NAME" \
-backend-config="key=$TF_STATE_BLOB_FILE" \
Expand Down
4 changes: 0 additions & 4 deletions provider.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
terraform {
# Store Terraform Stage in Azure Storage Account (see backend.hcl.sample)
backend "azurerm" {
}

required_providers {
azuread = {
source = "hashicorp/azuread"
Expand Down

0 comments on commit 2a2ab95

Please sign in to comment.