Skip to content

Commit 18c6858

Browse files
committed
Test early eval with remote workspaces
1 parent fd8d536 commit 18c6858

File tree

4 files changed

+88
-6
lines changed

4 files changed

+88
-6
lines changed

.github/workflows/test-early-eval.yaml

+41-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permissions:
77
contents: read
88

99
jobs:
10-
plan:
10+
s3-backend:
1111
runs-on: ubuntu-24.04
1212
name: Plan with early eval
1313
env:
@@ -19,34 +19,69 @@ jobs:
1919
with:
2020
persist-credentials: false
2121

22-
- name: terraform plan
22+
- name: tofu plan
2323
uses: ./tofu-plan
2424
with:
25-
path: tests/workflows/test-plan/early-eval/tofu
25+
path: tests/workflows/test-early-eval/s3
2626
add_github_comment: false
2727
variables: |
2828
passphrase = "tofuqwertyuiopasdfgh"
2929
3030
- name: Create workspace
3131
uses: ./tofu-new-workspace
3232
with:
33-
path: tests/workflows/test-plan/early-eval/tofu
33+
path: tests/workflows/test-early-eval/s3
3434
workspace: test-workspace
3535
variables: |
3636
passphrase = "tofuqwertyuiopasdfgh"
3737
3838
- name: Create workspace again
3939
uses: ./tofu-new-workspace
4040
with:
41-
path: tests/workflows/test-plan/early-eval/tofu
41+
path: tests/workflows/test-early-eval/s3
4242
workspace: test-workspace
4343
variables: |
4444
passphrase = "tofuqwertyuiopasdfgh"
4545
4646
- name: Destroy workspace
4747
uses: ./tofu-destroy-workspace
4848
with:
49-
path: tests/workflows/test-plan/early-eval/tofu
49+
path: tests/workflows/test-early-eval/s3
5050
workspace: test-workspace
5151
variables: |
5252
passphrase = "tofuqwertyuiopasdfgh"
53+
54+
remote-backend:
55+
runs-on: ubuntu-24.04
56+
name: Remote plan with early eval
57+
env:
58+
TERRAFORM_CLOUD_TOKENS: dflook.scalr.io=${{ secrets.SCALR_TOKEN }}
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v4
62+
with:
63+
persist-credentials: false
64+
65+
- name: Create workspace
66+
uses: ./tofu-new-workspace
67+
with:
68+
path: tests/workflows/test-early-eval/scalr
69+
workspace: ${{ github.head_ref }}-early-eval
70+
variables: |
71+
passphrase = "tofuqwertyuiopasdfgh"
72+
73+
- name: Create workspace again
74+
uses: ./tofu-new-workspace
75+
with:
76+
path: tests/workflows/test-early-eval/scalr
77+
workspace: ${{ github.head_ref }}-early-eval
78+
variables: |
79+
passphrase = "tofuqwertyuiopasdfgh"
80+
81+
- name: Destroy workspace
82+
uses: ./tofu-destroy-workspace
83+
with:
84+
path: tests/workflows/test-early-eval/scalr
85+
workspace: ${{ github.head_ref }}-early-eval
86+
variables: |
87+
passphrase = "tofuqwertyuiopasdfgh"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
terraform {
2+
backend "remote" {
3+
hostname = "dflook.scalr.io"
4+
organization = "Environment-A"
5+
6+
workspaces {
7+
prefix = "scalr-"
8+
}
9+
}
10+
}
11+
12+
provider "aws" {
13+
region = "eu-west-2"
14+
}
15+
16+
variable "module_version" {
17+
type = string
18+
default = "4.3.0"
19+
}
20+
21+
variable "passphrase" {
22+
type = string
23+
sensitive = true
24+
}
25+
26+
module "s3-bucket" {
27+
source = "terraform-aws-modules/s3-bucket/aws"
28+
version = var.module_version
29+
}
30+
31+
terraform {
32+
encryption {
33+
key_provider "pbkdf2" "my_passphrase" {
34+
passphrase = var.passphrase
35+
}
36+
37+
method "aes_gcm" "my_method" {
38+
keys = key_provider.pbkdf2.my_passphrase
39+
}
40+
41+
state {
42+
method = method.aes_gcm.my_method
43+
}
44+
}
45+
46+
required_version = "1.8.8"
47+
}

0 commit comments

Comments
 (0)