You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ce/getting-started/with-terraform.mdx
+54-3Lines changed: 54 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ title: "With Terraform"
5
5
In this tutorial, you will set up Digger to automate terraform pull requests using Github Actions
6
6
7
7
**Prerequisites**
8
-
- A GitHub repository with valid terraform code
8
+
- A GitHub repository with valid terraform code, don't have one? see [here](#demo-repositories)
9
9
- Your cloud provider credentials:
10
10
- For AWS: [Hashicorp's AWS tutorial](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/aws-build)
11
11
- For GCP: [Hashicorp's GCP tutorial](https://developer.hashicorp.com/terraform/tutorials/gcp-get-started/google-cloud-platform-build)
@@ -16,7 +16,11 @@ In this tutorial, you will set up Digger to automate terraform pull requests usi
16
16
17
17
Head to [ui.digger.dev](https://ui.digger.dev) and sign up using your preferred method.
18
18
19
-
You should see an empty dashboard after you sign up.
19
+
Post sign up, your dashboard should look like this:
20
+
21
+

22
+
23
+
20
24
</Step>
21
25
22
26
<Steptitle="Install the Digger GitHub App">
@@ -40,17 +44,52 @@ In GitHub repository settings, go to Secrets and Variables - Actions. Create the
40
44
-`AWS_ACCESS_KEY_ID` - `AWS_SECRET_ACCESS_KEY` You can also [use
41
45
OIDC](/ce/cloud-providers/authenticating-with-oidc-on-aws) for AWS
42
46
authentication.
47
+
48
+
<Accordiontitle="Tip: Set GitHub Action secrets with gh CLI">
49
+
From the repository root (with GitHub CLI installed):
50
+
51
+
```bash
52
+
# Set AWS credentials as repository Action secrets
53
+
gh secret set AWS_ACCESS_KEY_ID --body "$AWS_ACCESS_KEY_ID"
54
+
gh secret set AWS_SECRET_ACCESS_KEY --body "$AWS_SECRET_ACCESS_KEY"
55
+
```
56
+
</Accordion>
43
57
</Tab>
44
58
<Tabtitle="GCP">
45
59
-`GCP_CREDENTIALS` - contents of your GCP Service Account Key json file You
46
60
can also [use OIDC](/gcp/federated-oidc-access/) for GCP authentication.
61
+
62
+
<Accordiontitle="Tip: Set GitHub Action secrets with gh CLI">
63
+
If your Service Account key is saved to a file, you can pipe it directly:
64
+
65
+
```bash
66
+
# Set GCP credentials secret from a JSON key file
67
+
gh secret set GCP_CREDENTIALS < path/to/service-account-key.json
68
+
```
69
+
70
+
Or set from an environment variable/string:
71
+
72
+
```bash
73
+
gh secret set GCP_CREDENTIALS --body "$(cat path/to/service-account-key.json)"
74
+
```
75
+
</Accordion>
47
76
</Tab>
48
77
<Tabtitle="Azure">
49
78
-`AZURE_CLIENT_ID` - Your Azure App Registration Client ID
50
79
-`AZURE_TENANT_ID` - Your Azure Tenant ID
51
80
-`AZURE_SUBSCRIPTION_ID` - Your Azure Subscription ID
52
81
53
82
You'll need to configure OIDC authentication by setting up federated credentials in your Azure App Registration. See [Azure OIDC setup](/ce/azure-specific/azure) for details.
83
+
84
+
<Accordiontitle="Tip: Set GitHub Action secrets with gh CLI">
85
+
From the repository root (with GitHub CLI installed):
86
+
87
+
```bash
88
+
gh secret set AZURE_CLIENT_ID --body "$AZURE_CLIENT_ID"
89
+
gh secret set AZURE_TENANT_ID --body "$AZURE_TENANT_ID"
90
+
gh secret set AZURE_SUBSCRIPTION_ID --body "$AZURE_SUBSCRIPTION_ID"
91
+
```
92
+
</Accordion>
54
93
</Tab>
55
94
</Tabs>
56
95
</Step>
@@ -230,13 +269,25 @@ Terraform will run an existing plan against your code.
230
269
231
270
Make any change to your terraform code e.g. add a blank line. An action run should start (you can see log output in Actions). After some time you should see output of Terraform Plan added as a comment to your PR.
232
271
272
+
273
+
<Info>If you forked one of the demo repositories you will need to enable Actions in your repository.</Info>
233
274
Then you can add a comment like `digger apply` and shortly after apply output will be added as comment too.
0 commit comments