Skip to content

Commit 91a7daf

Browse files
author
Néstor Salceda
authored
feat: Allow to use aws_cloudtrail policies (#96)
1 parent 7a76793 commit 91a7daf

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

sysdig/resource_sysdig_secure_policy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func resourceSysdigSecurePolicy() *schema.Resource {
5858
Type: schema.TypeString,
5959
Optional: true,
6060
Default: "falco",
61-
ValidateDiagFunc: validateDiagFunc(validation.StringInSlice([]string{"falco", "list_matching", "k8s_audit"}, false)),
61+
ValidateDiagFunc: validateDiagFunc(validation.StringInSlice([]string{"falco", "list_matching", "k8s_audit", "aws_cloudtrail"}, false)),
6262
},
6363
"severity": {
6464
Type: schema.TypeInt,

sysdig/resource_sysdig_secure_policy_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ func TestAccPolicy(t *testing.T) {
5050
{
5151
Config: policiesWithKillAction(rText()),
5252
},
53+
{
54+
Config: policiesForAWSCloudtrail(rText()),
55+
},
5356
},
5457
})
5558
}
@@ -159,3 +162,13 @@ resource "sysdig_secure_policy" "sample" {
159162
}
160163
`, name, name)
161164
}
165+
166+
func policiesForAWSCloudtrail(name string) string {
167+
return fmt.Sprintf(`
168+
resource "sysdig_secure_policy" "sample4" {
169+
name = "TERRAFORM TEST 4 %s"
170+
description = "TERRAFORM TEST %s"
171+
type = "aws_cloudtrail"
172+
}
173+
`, name, name)
174+
}

0 commit comments

Comments
 (0)