Skip to content

Commit 2d522e8

Browse files
committed
test: add test for secret env-var use on free plan
1 parent a9d7321 commit 2d522e8

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

internal/provider/free_plan_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,31 @@ func TestAccFreeEnvVar(t *testing.T) {
3131
}, func(s *terraform.State) error { return nil })
3232
}
3333

34+
func TestAccFreeSecretEnvVar(t *testing.T) {
35+
accTest(t, []resource.TestStep{
36+
{
37+
Config: `resource "netlify_environment_variable" "site_level_secret" {
38+
team_id = "66e98216e3fe031846dc998a"
39+
site_id = "fbba82b0-f1e9-4e92-9203-eefc62857545"
40+
key = "TEST_SITE_LEVEL_SECRET"
41+
scopes = ["functions", "builds", "runtime"]
42+
secret_values = [
43+
{
44+
value = "ill-never-tell",
45+
context = "production",
46+
}
47+
]
48+
}
49+
`,
50+
Check: resource.ComposeAggregateTestCheckFunc(
51+
resource.TestCheckResourceAttr("netlify_environment_variable.site_level_secret", "team_id", "66e98216e3fe031846dc998a"),
52+
resource.TestCheckResourceAttr("netlify_environment_variable.site_level_secret", "site_id", "fbba82b0-f1e9-4e92-9203-eefc62857545"),
53+
resource.TestCheckResourceAttr("netlify_environment_variable.site_level_secret", "key", "TEST_SITE_LEVEL_SECRET"),
54+
),
55+
},
56+
}, func(s *terraform.State) error { return nil })
57+
}
58+
3459
func TestAccFreeSiteBuildSettings(t *testing.T) {
3560
accTest(t, []resource.TestStep{
3661
{

0 commit comments

Comments
 (0)