Skip to content

Commit 02d5116

Browse files
author
Terje Torkelsen
committed
Update documentation
1 parent 0abff61 commit 02d5116

File tree

7 files changed

+27
-23
lines changed

7 files changed

+27
-23
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Remote backend
22

3-
Terraform module to deploy a remote backend storage with Key Vault to manage SAS Token and key rotation. To access the remote state the retrieve the SAS Token from Key Vault, do not use the access keys on storage account. SAS Token retrieved from Key Vault grants 1 day access, after that it will have to be refreshed. The access keys on storage account will automatically rotate on a 30 day schedule, this can be adjusted with the input variable `key_rotation_days`.
3+
Terraform module to deploy a remote backend storage with Key Vault to manage SAS Token and key rotation. To access the remote state retrieve the SAS Token from Key Vault, do not use the access keys on storage account. SAS Token retrieved from Key Vault grants 1 day access, after that it will have to be refreshed. The access keys on storage account will automatically rotate on a 30 day schedule, this can be adjusted with the input variable `key_rotation_days`.
44

5-
Each backend creates a new storage account and Key Vault. The Key Vault can also be used for storing other secrets related to terraform.
5+
Each backend creates a new storage account and Key Vault. The Key Vault can also be used for storing other secrets related to terraform. Use the `access_policies` variable to define users that should have access. It is recommended to read [Secure access to a key vault](https://docs.microsoft.com/en-us/azure/key-vault/key-vault-secure-your-key-vault) documentation for which policies to apply.
66

77
**Terraform has to run with Owner priviledge in Azure.**
88

@@ -37,15 +37,15 @@ inputs {
3737
}
3838
```
3939

40-
2. Run tau init, plan and apply, but do not create any overrides (skips backend)
40+
2. Run tau init, plan and apply, but do not create any overrides (skips backend configuration)
4141

4242
```bash
4343
tau init --no-overrides
4444
tau plan
4545
tau apply
4646
```
4747

48-
3. State should now be stored locally. Reconfigure to backend
48+
3. State should now be stored locally. Reconfigure to move to defined backend
4949

5050
```bash
5151
tau init --reconfigure
@@ -81,7 +81,7 @@ access_policies = [
8181

8282
## SAS Token
8383

84-
The SAS Token is stored in Key Vault as a secret with name `{storageaccount_name}-terraformsastoken`. So to access for example below run following command to get in clear text:
84+
The SAS Token is stored in Key Vault as a secret with name `{storageaccount_name}-terraformsastoken`. So to access for example above run following command to get in clear text:
8585

8686
```bash
8787
az keyvault secret show --vault-name tfstatedevkv --name tfstatedevsa-terraformsastoken --query value -o tsv

examples/access_policy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Example: Access policy example
22

3-
This example shows how to assign access policies on Key Vault.
3+
This example shows how to assign access policies on Key Vault. In example it defines a standard user access and admin access following [Microsoft documentation]((https://docs.microsoft.com/en-us/azure/key-vault/key-vault-secure-your-key-vault)) on how to secure access.

examples/access_policy/main.tf

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
module "simple" {
2-
source = "../../"
2+
source = "avinor/remote-backend/azurerm"
3+
version = "1.0.1"
34

45
name = "simple"
56
resource_group_name = "simple-rg"
67
location = "westeurope"
78

8-
backends = ["dev"]
9-
109
access_policies = [
1110
{
12-
object_id = "guid",
13-
backends = ["dev"],
14-
certificate_permissions = [],
15-
key_permissions = [],
16-
secret_permissions = ["get"],
11+
// Security team, "admin" access
12+
object_id = "guid"
13+
certificate_permissions = []
14+
key_permissions = ["backup", "create", "delete", "get", "import", "list", "restore"]
15+
secret_permissions = ["backup", "delete", "get", "list", "purge", "recover", "restore", "set"]
16+
},
17+
{
18+
// Read only access
19+
object_id = "guid"
20+
certificate_permissions = []
21+
key_permissions = ["sign"]
22+
secret_permissions = ["get"]
1723
}
1824
]
1925
}

examples/network-rules/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Example: Network-rules
22

3-
Creates a remote backend with network rules defined on storage account.
3+
Creates a remote backend with network rules defined on storage account. Network rules will restrict access to the storage account from certain IP ranges. Since remote state has to be accessed from output of Azure it does not restrict on subnet level, only on IP.

examples/network-rules/main.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
module "simple" {
2-
source = "../../"
2+
source = "avinor/remote-backend/azurerm"
3+
version = "1.0.1"
34

45
name = "simple"
56
resource_group_name = "simple-rg"
67
location = "westeurope"
78

8-
backends = ["dev"]
9-
109
network_rules = {
1110
bypass = ["None"],
1211
ip_rules = ["127.0.0.1"],

examples/simple/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Example: Simple
22

3-
A simple example that only assigns the required variables.
3+
A simple example that only assigns the required variables. It creates a storage account and key vault, but with no additional access policies to key vault.

examples/simple/main.tf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
module "simple" {
2-
source = "../../"
2+
source = "avinor/remote-backend/azurerm"
3+
version = "1.0.1"
34

4-
name = "simple"
5+
name = "simplestate"
56
resource_group_name = "simple-rg"
67
location = "westeurope"
7-
8-
backends = ["dev"]
98
}

0 commit comments

Comments
 (0)