Skip to content

Commit eebfad8

Browse files
fix(serverless-agent): mark the access key as optional (#299)
Signed-off-by: francesco-racciatti <[email protected]>
1 parent 59e69cb commit eebfad8

File tree

3 files changed

+34
-7
lines changed

3 files changed

+34
-7
lines changed

sysdig/data_source_sysdig_fargate_workload_agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func dataSourceSysdigFargateWorkloadAgent() *schema.Resource {
5050
"sysdig_access_key": {
5151
Type: schema.TypeString,
5252
Description: "the Sysdig access key",
53-
Required: true,
53+
Optional: true,
5454
},
5555
"workload_agent_image": {
5656
Type: schema.TypeString,

sysdig/data_source_sysdig_fargate_workload_agent_test.go

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import (
1111
"github.com/draios/terraform-provider-sysdig/sysdig"
1212
)
1313

14-
func TestAccSysdigFargateWorkloadAgent(t *testing.T) {
14+
// Direct connection mode has been deprecated in Prod envs
15+
func TestAccSysdigFargateWorkloadAgentDirectConnection(t *testing.T) {
1516
resource.ParallelTest(t, resource.TestCase{
1617
ProviderFactories: map[string]func() (*schema.Provider, error){
1718
"sysdig": func() (*schema.Provider, error) {
@@ -20,13 +21,13 @@ func TestAccSysdigFargateWorkloadAgent(t *testing.T) {
2021
},
2122
Steps: []resource.TestStep{
2223
{
23-
Config: getFargateWorkloadAgent(),
24+
Config: getFargateWorkloadAgentDirectConnection(),
2425
},
2526
},
2627
})
2728
}
2829

29-
func getFargateWorkloadAgent() string {
30+
func getFargateWorkloadAgentDirectConnection() string {
3031
return `
3132
data "sysdig_fargate_workload_agent" "test" {
3233
container_definitions = "[]"
@@ -40,3 +41,31 @@ data "sysdig_fargate_workload_agent" "test" {
4041
}
4142
`
4243
}
44+
45+
func TestAccSysdigFargateWorkloadAgentOrchestrated(t *testing.T) {
46+
resource.ParallelTest(t, resource.TestCase{
47+
ProviderFactories: map[string]func() (*schema.Provider, error){
48+
"sysdig": func() (*schema.Provider, error) {
49+
return sysdig.Provider(), nil
50+
},
51+
},
52+
Steps: []resource.TestStep{
53+
{
54+
Config: getFargateWorkloadAgentOrchestrated(),
55+
},
56+
},
57+
})
58+
}
59+
60+
func getFargateWorkloadAgentOrchestrated() string {
61+
return `
62+
data "sysdig_fargate_workload_agent" "test" {
63+
container_definitions = "[]"
64+
65+
orchestrator_host = "sysdig.orchestrator.agent.com"
66+
orchestrator_port = 6667
67+
workload_agent_image = "quay.io/sysdig/workload-agent:latest"
68+
sysdig_logging = "info"
69+
}
70+
`
71+
}

website/docs/d/fargate_workload_agent.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ data "sysdig_fargate_workload_agent" "instrumented_containers" {
2222
2323
image_auth_secret = ""
2424
workload_agent_image = "quay.io/sysdig/workload-agent:latest"
25-
26-
sysdig_access_key = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
25+
2726
orchestrator_host = module.fargate-orchestrator-agent.orchestrator_host
2827
orchestrator_port = module.fargate-orchestrator-agent.orchestrator_port
2928
}
@@ -32,7 +31,6 @@ data "sysdig_fargate_workload_agent" "instrumented_containers" {
3231
## Argument Reference
3332

3433
* `container_definitions` - (Required) The input Fargate container definitions to instrument with the Sysdig workload agent.
35-
* `sysdig_access_key` - (Required) The Sysdig Access Key (Agent token).
3634
* `orchestrator_host` - (Required) The orchestrator host to connect to.
3735
* `orchestrator_port` - (Required) The orchestrator port to connect to.
3836
* `workload_agent_image` - (Required) The Sysdig workload agent image.

0 commit comments

Comments
 (0)