Skip to content

Commit b1ea380

Browse files
authored
add docs page for fix (#2310)
1 parent b22e0aa commit b1ea380

File tree

1 file changed

+50
-2
lines changed

1 file changed

+50
-2
lines changed
Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,57 @@
11
---
2-
title: "Setting up separate mgmt account"
2+
title: "Setting up separate management account"
33
---
44

55
You can use separate AWS accounts for Digger locks and target infrastructure.
66

7+
### Locks
8+
79
* If you only pass `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` env vars, same account will be used for both
810

9-
* If in addition you also pass `DIGGER_AWS_ACCESS_KEY_ID` and `DIGGER_AWS_SECRET_ACCESS_KEY` vars then those will be used for Digger locks, and the first pair will be used as target account
11+
* If in addition you also pass `DIGGER_AWS_ACCESS_KEY_ID` and `DIGGER_AWS_SECRET_ACCESS_KEY` vars then those will be used for Digger locks, and the first pair will be used as target account
12+
13+
14+
### State
15+
16+
In the digger.yml file, to use an alternate account for your state, you can pass the above credentials through `extra_args` and use the default AWS credentials as the `commands:` `env_vars`:
17+
18+
19+
```bash
20+
# digger.yml
21+
22+
23+
projects:
24+
- name: DEV
25+
dir: k8s_deployment
26+
workflow: terraform
27+
include_patterns: ["*.tf", "../_env_data/dev.json", "modules/**/*.tf", "modules/**/*.yaml"]
28+
workspace: dev
29+
30+
31+
32+
workflows:
33+
terraform:
34+
env_vars:
35+
commands:
36+
- name: AWS_ACCESS_KEY_ID
37+
value_from: AWS_ACCESS_KEY_ID
38+
- name: AWS_SECRET_ACCESS_KEY
39+
value_from: AWS_SECRET_ACCESS_KEY
40+
on_commit_to_default:
41+
- init
42+
- apply
43+
plan:
44+
steps:
45+
- init:
46+
extra_args: ["-backend-config=tf_backend.tfbackend","-backend-config=access_key=$DIGGER_AWS_ACCESS_KEY_ID","-backend-config=secret_key=$DIGGER_AWS_SECRET_ACCESS_KEY"]
47+
- plan
48+
apply:
49+
steps:
50+
- init:
51+
extra_args: ["-backend-config=tf_backend.tfbackend","-backend-config=access_key=$DIGGER_AWS_ACCESS_KEY_ID","-backend-config=secret_key=$DIGGER_AWS_SECRET_ACCESS_KEY"]
52+
- apply
53+
```
54+
55+
<Note>
56+
In the past, setting only the evironment variables would allow this separation but the CLI is not honoring them currently. We're looking into why.
57+
</Note>

0 commit comments

Comments
 (0)