Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 792a6ac

Browse files
authoredApr 16, 2025··
feat(team): add missing features to teams (#628)
* feat(team): add prometheus_remote_write_metrics_filter * feat(team): add all possible entrypoints and visibility options * feat(team): remove platform metric related attributes from secure_team
1 parent 983be59 commit 792a6ac

15 files changed

+245
-131
lines changed
 

‎sysdig/data_source_sysdig_monitor_team.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ func dataSourceSysdigMonitorTeam() *schema.Resource {
3636
Type: schema.TypeString,
3737
Computed: true,
3838
},
39+
"prometheus_remote_write_metrics_filter": {
40+
Type: schema.TypeString,
41+
Computed: true,
42+
},
3943
"can_use_sysdig_capture": {
4044
Type: schema.TypeBool,
4145
Computed: true,
@@ -48,6 +52,10 @@ func dataSourceSysdigMonitorTeam() *schema.Resource {
4852
Type: schema.TypeBool,
4953
Computed: true,
5054
},
55+
"can_use_agent_cli": {
56+
Type: schema.TypeBool,
57+
Computed: true,
58+
},
5159
"default_team": {
5260
Type: schema.TypeBool,
5361
Computed: true,
@@ -126,17 +134,21 @@ func dataSourceSysdigMonitorTeamRead(ctx context.Context, d *schema.ResourceData
126134
_ = d.Set("can_use_sysdig_capture", team.CanUseSysdigCapture)
127135
_ = d.Set("can_see_infrastructure_events", team.CanUseCustomEvents)
128136
_ = d.Set("can_use_aws_data", team.CanUseAwsMetrics)
137+
_ = d.Set("can_use_agent_cli", team.CanUseAgentCli)
129138
_ = d.Set("default_team", team.DefaultTeam)
130139
_ = d.Set("user_roles", userMonitorRolesToSet(team.UserRoles))
131140
_ = d.Set("entrypoint", entrypointToSet(team.EntryPoint))
132141
_ = d.Set("version", team.Version)
133142

134143
var ibmPlatformMetrics *string
144+
var prometheusRemoteWrite *string
135145
if team.NamespaceFilters != nil {
136146
ibmPlatformMetrics = team.NamespaceFilters.IBMPlatformMetrics
147+
prometheusRemoteWrite = team.NamespaceFilters.PrometheusRemoteWrite
137148
}
138149
_ = d.Set("enable_ibm_platform_metrics", team.CanUseBeaconMetrics)
139150
_ = d.Set("ibm_platform_metrics", ibmPlatformMetrics)
151+
_ = d.Set("prometheus_remote_write_metrics_filter", prometheusRemoteWrite)
140152

141153
return nil
142154
}

‎sysdig/data_source_sysdig_monitor_team_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ func TestAccDataSourceSysdigMonitorTeam(t *testing.T) {
3232
resource.TestCheckResourceAttr("data.sysdig_monitor_team.test", "can_use_sysdig_capture", "true"),
3333
resource.TestCheckResourceAttr("data.sysdig_monitor_team.test", "can_see_infrastructure_events", "true"),
3434
resource.TestCheckResourceAttr("data.sysdig_monitor_team.test", "can_use_aws_data", "true"),
35+
resource.TestCheckResourceAttr("data.sysdig_monitor_team.test", "can_use_agent_cli", "false"),
36+
resource.TestCheckResourceAttr("data.sysdig_monitor_team.test", "prometheus_remote_write_metrics_filter", "kube_cluster_name in (\"test-cluster\")"),
3537
),
3638
},
3739
},
@@ -48,9 +50,10 @@ resource "sysdig_monitor_team" "sample" {
4850
can_use_sysdig_capture = true
4951
can_see_infrastructure_events = true
5052
can_use_aws_data = true
51-
53+
can_use_agent_cli = false
54+
prometheus_remote_write_metrics_filter = "kube_cluster_name in (\"test-cluster\")"
5255
entrypoint {
53-
type = "Dashboards"
56+
type = "Dashboards"
5457
}
5558
}
5659

‎sysdig/data_source_sysdig_secure_team.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ func dataSourceSysdigSecureTeam() *schema.Resource {
4040
Type: schema.TypeBool,
4141
Computed: true,
4242
},
43+
"can_use_agent_cli": {
44+
Type: schema.TypeBool,
45+
Computed: true,
46+
},
47+
"can_use_rapid_response": {
48+
Type: schema.TypeBool,
49+
Computed: true,
50+
},
4351
"default_team": {
4452
Type: schema.TypeBool,
4553
Computed: true,
@@ -103,6 +111,8 @@ func dataSourceSysdigSecureTeamRead(ctx context.Context, d *schema.ResourceData,
103111
_ = d.Set("scope_by", team.Show)
104112
_ = d.Set("filter", team.Filter)
105113
_ = d.Set("use_sysdig_capture", team.CanUseSysdigCapture)
114+
_ = d.Set("can_use_agent_cli", team.CanUseAgentCli)
115+
_ = d.Set("can_use_rapid_response", team.CanUseRapidResponse)
106116
_ = d.Set("default_team", team.DefaultTeam)
107117
_ = d.Set("user_roles", userSecureRolesToSet(team.UserRoles))
108118
_ = d.Set("version", team.Version)

‎sysdig/data_source_sysdig_secure_team_test.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ func TestAccDataSourceSysdigSecureTeam(t *testing.T) {
3131
resource.TestCheckResourceAttr("data.sysdig_secure_team.test", "version", "0"),
3232
resource.TestCheckResourceAttr("data.sysdig_secure_team.test", "use_sysdig_capture", "true"),
3333
resource.TestCheckResourceAttr("data.sysdig_secure_team.test", "all_zones", "true"),
34+
resource.TestCheckResourceAttr("data.sysdig_secure_team.test", "can_use_agent_cli", "false"),
35+
resource.TestCheckResourceAttr("data.sysdig_secure_team.test", "can_use_rapid_response", "true"),
3436
),
3537
},
3638
},
@@ -40,12 +42,14 @@ func TestAccDataSourceSysdigSecureTeam(t *testing.T) {
4042
func secureTeamAndDatasource(name string) string {
4143
return fmt.Sprintf(`
4244
resource "sysdig_secure_team" "sample" {
43-
name = "%s"
44-
description = "A test secure team"
45-
scope_by = "container"
46-
use_sysdig_capture = true
47-
filter = "container.image.repo = \"sysdig/agent\""
48-
all_zones = true
45+
name = "%s"
46+
description = "A test secure team"
47+
scope_by = "container"
48+
use_sysdig_capture = true
49+
filter = "container.image.repo = \"sysdig/agent\""
50+
all_zones = true
51+
can_use_agent_cli = false
52+
can_use_rapid_response = true
4953
}
5054
5155
data "sysdig_secure_team" "test" {

‎sysdig/internal/client/v2/model.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ type Team struct {
2626
CanUseCustomEvents *bool `json:"canUseCustomEvents,omitempty"`
2727
CanUseAwsMetrics *bool `json:"canUseAwsMetrics,omitempty"`
2828
CanUseBeaconMetrics *bool `json:"canUseBeaconMetrics,omitempty"`
29+
CanUseRapidResponse *bool `json:"canUseRapidResponse,omitempty"`
30+
CanUseAgentCli *bool `json:"canUseAgentCli,omitempty"`
2931
UserCount int `json:"userCount,omitempty"`
3032
Filter string `json:"filter,omitempty"`
3133
NamespaceFilters *NamespaceFilters `json:"namespaceFilters,omitempty"`
@@ -35,7 +37,8 @@ type Team struct {
3537
}
3638

3739
type NamespaceFilters struct {
38-
IBMPlatformMetrics *string `json:"ibmPlatformMetrics"`
40+
IBMPlatformMetrics *string `json:"ibmPlatformMetrics,omitempty"`
41+
PrometheusRemoteWrite *string `json:"prometheusRemoteWrite,omitempty"`
3942
}
4043

4144
type UserRoles struct {

‎sysdig/resource_sysdig_monitor_team.go

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,16 @@ func resourceSysdigMonitorTeam() *schema.Resource {
4646
Optional: true,
4747
},
4848
"scope_by": {
49+
Type: schema.TypeString,
50+
Optional: true,
51+
Default: "host",
52+
ValidateFunc: validation.StringInSlice([]string{"host", "container"}, false),
53+
},
54+
"filter": {
4955
Type: schema.TypeString,
5056
Optional: true,
51-
Default: "host",
5257
},
53-
"filter": {
58+
"prometheus_remote_write_metrics_filter": {
5459
Type: schema.TypeString,
5560
Optional: true,
5661
},
@@ -77,6 +82,11 @@ func resourceSysdigMonitorTeam() *schema.Resource {
7782
Optional: true,
7883
Default: false,
7984
},
85+
"can_use_agent_cli": {
86+
Type: schema.TypeBool,
87+
Optional: true,
88+
Default: true,
89+
},
8090
"user_roles": {
8191
Type: schema.TypeSet,
8292
Optional: true,
@@ -102,7 +112,7 @@ func resourceSysdigMonitorTeam() *schema.Resource {
102112
"type": {
103113
Type: schema.TypeString,
104114
Required: true,
105-
ValidateFunc: validation.StringInSlice([]string{"Explore", "Dashboards", "Events", "Alerts", "Settings"}, false),
115+
ValidateFunc: validation.StringInSlice([]string{"Explore", "Dashboards", "Events", "Alerts", "Settings", "DashboardTemplates", "Advisor"}, false),
106116
},
107117

108118
"selection": {
@@ -187,12 +197,21 @@ func resourceSysdigMonitorTeamRead(ctx context.Context, d *schema.ResourceData,
187197
_ = d.Set("filter", t.Filter)
188198
_ = d.Set("can_use_sysdig_capture", t.CanUseSysdigCapture)
189199
_ = d.Set("can_see_infrastructure_events", t.CanUseCustomEvents)
200+
_ = d.Set("can_use_agent_cli", t.CanUseAgentCli)
190201
_ = d.Set("can_use_aws_data", t.CanUseAwsMetrics)
191202
_ = d.Set("default_team", t.DefaultTeam)
192203
_ = d.Set("user_roles", userMonitorRolesToSet(t.UserRoles))
193204
_ = d.Set("entrypoint", entrypointToSet(t.EntryPoint))
194205

195-
resourceSysdigTeamReadIBM(d, &t)
206+
var ibmPlatformMetrics *string
207+
var prometheusRemoteWrite *string
208+
if t.NamespaceFilters != nil {
209+
ibmPlatformMetrics = t.NamespaceFilters.IBMPlatformMetrics
210+
prometheusRemoteWrite = t.NamespaceFilters.PrometheusRemoteWrite
211+
}
212+
_ = d.Set("enable_ibm_platform_metrics", t.CanUseBeaconMetrics)
213+
_ = d.Set("ibm_platform_metrics", ibmPlatformMetrics)
214+
_ = d.Set("prometheus_remote_write_metrics_filter", prometheusRemoteWrite)
196215

197216
return nil
198217
}
@@ -217,8 +236,12 @@ func entrypointToSet(entrypoint *v2.EntryPoint) (res []map[string]interface{}) {
217236
return
218237
}
219238

239+
module := entrypoint.Module
240+
if module == "Overview" {
241+
module = "Advisor"
242+
}
220243
entrypointMap := map[string]interface{}{
221-
"type": entrypoint.Module,
244+
"type": module,
222245
"selection": entrypoint.Selection,
223246
}
224247
return append(res, entrypointMap)
@@ -264,8 +287,8 @@ func resourceSysdigMonitorTeamDelete(ctx context.Context, d *schema.ResourceData
264287
func teamFromResourceData(d *schema.ResourceData, clientType ClientType) v2.Team {
265288
canUseSysdigCapture := d.Get("can_use_sysdig_capture").(bool)
266289
canUseCustomEvents := d.Get("can_see_infrastructure_events").(bool)
290+
canUseAgentCli := d.Get("can_use_agent_cli").(bool)
267291
canUseAwsMetrics := d.Get("can_use_aws_data").(bool)
268-
canUseBeaconMetrics := false
269292
t := v2.Team{
270293
Theme: d.Get("theme").(string),
271294
Name: d.Get("name").(string),
@@ -275,7 +298,7 @@ func teamFromResourceData(d *schema.ResourceData, clientType ClientType) v2.Team
275298
CanUseSysdigCapture: &canUseSysdigCapture,
276299
CanUseCustomEvents: &canUseCustomEvents,
277300
CanUseAwsMetrics: &canUseAwsMetrics,
278-
CanUseBeaconMetrics: &canUseBeaconMetrics,
301+
CanUseAgentCli: &canUseAgentCli,
279302
DefaultTeam: d.Get("default_team").(bool),
280303
}
281304

@@ -291,11 +314,31 @@ func teamFromResourceData(d *schema.ResourceData, clientType ClientType) v2.Team
291314

292315
t.EntryPoint = &v2.EntryPoint{}
293316
t.EntryPoint.Module = d.Get("entrypoint.0.type").(string)
317+
if t.EntryPoint.Module == "Advisor" {
318+
t.EntryPoint.Module = "Overview"
319+
}
294320
if val, ok := d.GetOk("entrypoint.0.selection"); ok {
295321
t.EntryPoint.Selection = val.(string)
296322
}
297323

298-
teamFromResourceDataIBM(d, &t)
324+
canUseBeaconMetrics := d.Get("enable_ibm_platform_metrics").(bool)
325+
t.CanUseBeaconMetrics = &canUseBeaconMetrics
326+
327+
if v, ok := d.GetOk("ibm_platform_metrics"); ok {
328+
metrics := v.(string)
329+
if t.NamespaceFilters == nil {
330+
t.NamespaceFilters = &v2.NamespaceFilters{}
331+
}
332+
t.NamespaceFilters.IBMPlatformMetrics = &metrics
333+
}
334+
335+
if v, ok := d.GetOk("prometheus_remote_write_metrics_filter"); ok {
336+
metrics := v.(string)
337+
if t.NamespaceFilters == nil {
338+
t.NamespaceFilters = &v2.NamespaceFilters{}
339+
}
340+
t.NamespaceFilters.PrometheusRemoteWrite = &metrics
341+
}
299342

300343
return t
301344
}

‎sysdig/resource_sysdig_monitor_team_ibm_test.go

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ func TestAccMonitorIBMTeam(t *testing.T) {
4141
{
4242
Config: monitorTeamWithPlatformMetricsIBM(rText()),
4343
},
44+
{
45+
Config: monitorTeamWithPlatformMetricsAndPrwMetricsIBM(rText()),
46+
},
4447
{
4548
ResourceName: "sysdig_monitor_team.sample",
4649
ImportState: true,
@@ -53,28 +56,42 @@ func TestAccMonitorIBMTeam(t *testing.T) {
5356
func monitorTeamWithFullConfigIBM(name string) string {
5457
return fmt.Sprintf(`
5558
resource "sysdig_monitor_team" "sample" {
56-
name = "sample-%s"
57-
description = "%s"
58-
scope_by = "host"
59-
filter = "container.image.repo = \"sysdig/agent\""
60-
can_use_sysdig_capture = true
61-
can_see_infrastructure_events = true
62-
59+
name = "sample-%s"
60+
description = "%s"
61+
scope_by = "host"
62+
filter = "container.image.repo = \"sysdig/agent\""
63+
prometheus_remote_write_metrics_filter = "kube_cluster_name in (\"test-cluster\", \"test-k8s-data\") and kube_deployment_name = \"coredns\" and my_metric starts with \"prefix\" and not my_metric contains \"prefix-test\""
64+
can_use_sysdig_capture = true
65+
can_see_infrastructure_events = true
66+
6367
entrypoint {
64-
type = "Dashboards"
68+
type = "Dashboards"
6569
}
6670
}`, name, name)
6771
}
6872

6973
func monitorTeamWithPlatformMetricsIBM(name string) string {
7074
return fmt.Sprintf(`
7175
resource "sysdig_monitor_team" "sample" {
72-
name = "sample-%s"
76+
name = "sample-%s"
7377
enable_ibm_platform_metrics = true
74-
ibm_platform_metrics = "foo in (\"0\") and bar in (\"3\")"
78+
ibm_platform_metrics = "foo in (\"0\") and bar in (\"3\")"
79+
80+
entrypoint {
81+
type = "Dashboards"
82+
}
83+
}`, name)
84+
}
85+
86+
func monitorTeamWithPlatformMetricsAndPrwMetricsIBM(name string) string {
87+
return fmt.Sprintf(`
88+
resource "sysdig_monitor_team" "sample" {
89+
name = "sample-%s"
90+
enable_ibm_platform_metrics = true
91+
prometheus_remote_write_metrics_filter = "kube_cluster_name in (\"test-cluster\", \"test-k8s-data\") and kube_deployment_name = \"coredns\" and my_metric starts with \"prefix\" and not my_metric contains \"prefix-test\""
7592
7693
entrypoint {
77-
type = "Dashboards"
94+
type = "Dashboards"
7895
}
7996
}`, name)
8097
}

‎sysdig/resource_sysdig_monitor_team_test.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,18 @@ func TestAccMonitorTeam(t *testing.T) {
5050
func monitorTeamWithFullConfig(name string) string {
5151
return fmt.Sprintf(`
5252
resource "sysdig_monitor_team" "sample" {
53-
name = "sample-%s"
54-
description = "%s"
55-
scope_by = "host"
56-
filter = "container.image.repo = \"sysdig/agent\""
57-
can_use_sysdig_capture = true
58-
can_see_infrastructure_events = true
59-
can_use_aws_data = true
60-
53+
name = "sample-%s"
54+
description = "%s"
55+
scope_by = "host"
56+
filter = "container.image.repo = \"sysdig/agent\""
57+
prometheus_remote_write_metrics_filter = "kube_cluster_name in (\"test-cluster\", \"test-k8s-data\") and kube_deployment_name = \"coredns\" and my_metric starts with \"prefix\" and not my_metric contains \"prefix-test\""
58+
can_use_sysdig_capture = true
59+
can_see_infrastructure_events = true
60+
can_use_aws_data = true
61+
can_use_agent_cli = true
62+
6163
entrypoint {
62-
type = "Dashboards"
64+
type = "Dashboards"
6365
}
6466
}`, name, name)
6567
}

‎sysdig/resource_sysdig_secure_team.go

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1212
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
13+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
1314
)
1415

1516
func resourceSysdigSecureTeam() *schema.Resource {
@@ -61,27 +62,40 @@ func resourceSysdigSecureTeam() *schema.Resource {
6162
Optional: true,
6263
},
6364
"scope_by": {
64-
Type: schema.TypeString,
65-
Optional: true,
66-
Default: "container",
65+
Type: schema.TypeString,
66+
Optional: true,
67+
Default: "container",
68+
ValidateFunc: validation.StringInSlice([]string{"host", "container"}, false),
6769
},
6870
"filter": {
6971
Type: schema.TypeString,
7072
Optional: true,
7173
},
7274
"enable_ibm_platform_metrics": {
73-
Type: schema.TypeBool,
74-
Optional: true,
75+
Type: schema.TypeBool,
76+
Optional: true,
77+
Deprecated: "This option should be not used anymore and will be removed in the future",
7578
},
7679
"ibm_platform_metrics": {
77-
Type: schema.TypeString,
78-
Optional: true,
80+
Type: schema.TypeString,
81+
Optional: true,
82+
Deprecated: "This option should be not used anymore and will be removed in the future",
7983
},
8084
"use_sysdig_capture": {
8185
Type: schema.TypeBool,
8286
Optional: true,
8387
Default: true,
8488
},
89+
"can_use_agent_cli": {
90+
Type: schema.TypeBool,
91+
Optional: true,
92+
Default: true,
93+
},
94+
"can_use_rapid_response": {
95+
Type: schema.TypeBool,
96+
Optional: true,
97+
Default: false,
98+
},
8599
"user_roles": {
86100
Type: schema.TypeSet,
87101
Optional: true,
@@ -187,6 +201,8 @@ func resourceSysdigSecureTeamRead(ctx context.Context, d *schema.ResourceData, m
187201
_ = d.Set("scope_by", t.Show)
188202
_ = d.Set("filter", t.Filter)
189203
_ = d.Set("use_sysdig_capture", t.CanUseSysdigCapture)
204+
_ = d.Set("can_use_agent_cli", t.CanUseAgentCli)
205+
_ = d.Set("can_use_rapid_response", t.CanUseRapidResponse)
190206
_ = d.Set("default_team", t.DefaultTeam)
191207
_ = d.Set("user_roles", userSecureRolesToSet(t.UserRoles))
192208

@@ -200,7 +216,12 @@ func resourceSysdigSecureTeamRead(ctx context.Context, d *schema.ResourceData, m
200216
return diag.FromErr(err)
201217
}
202218

203-
resourceSysdigTeamReadIBM(d, &t)
219+
var ibmPlatformMetrics *string
220+
if t.NamespaceFilters != nil {
221+
ibmPlatformMetrics = t.NamespaceFilters.IBMPlatformMetrics
222+
}
223+
_ = d.Set("enable_ibm_platform_metrics", t.CanUseBeaconMetrics)
224+
_ = d.Set("ibm_platform_metrics", ibmPlatformMetrics)
204225

205226
return nil
206227
}
@@ -258,6 +279,8 @@ func resourceSysdigSecureTeamDelete(ctx context.Context, d *schema.ResourceData,
258279

259280
func secureTeamFromResourceData(d *schema.ResourceData, clientType ClientType) v2.Team {
260281
canUseSysdigCapture := d.Get("use_sysdig_capture").(bool)
282+
canUseAgentCli := d.Get("can_use_agent_cli").(bool)
283+
canUseRapidResponse := d.Get("can_use_rapid_response").(bool)
261284
canUseAwsMetrics := new(bool)
262285
allZones := d.Get(SchemaAllZones).(bool)
263286
t := v2.Team{
@@ -268,6 +291,8 @@ func secureTeamFromResourceData(d *schema.ResourceData, clientType ClientType) v
268291
Filter: d.Get("filter").(string),
269292
CanUseSysdigCapture: &canUseSysdigCapture,
270293
CanUseAwsMetrics: canUseAwsMetrics,
294+
CanUseAgentCli: &canUseAgentCli,
295+
CanUseRapidResponse: &canUseRapidResponse,
271296
DefaultTeam: d.Get("default_team").(bool),
272297
AllZones: allZones,
273298
}
@@ -288,7 +313,16 @@ func secureTeamFromResourceData(d *schema.ResourceData, clientType ClientType) v
288313
t.ZoneIDs[i] = z.(int)
289314
}
290315

291-
teamFromResourceDataIBM(d, &t)
316+
canUseBeaconMetrics := d.Get("enable_ibm_platform_metrics").(bool)
317+
t.CanUseBeaconMetrics = &canUseBeaconMetrics
318+
319+
if v, ok := d.GetOk("ibm_platform_metrics"); ok {
320+
metrics := v.(string)
321+
if t.NamespaceFilters == nil {
322+
t.NamespaceFilters = &v2.NamespaceFilters{}
323+
}
324+
t.NamespaceFilters.IBMPlatformMetrics = &metrics
325+
}
292326

293327
return t
294328
}

‎sysdig/resource_sysdig_secure_team_test.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ func TestAccSecureTeam(t *testing.T) {
2727
{
2828
Config: secureTeamWithName(randomText(10)),
2929
},
30+
{
31+
Config: secureTeamWithAgentCliAndRapidResponse(randomText(10)),
32+
},
3033
{
3134
Config: secureTeamMinimumConfiguration(randomText(10)),
3235
},
@@ -74,19 +77,31 @@ resource "sysdig_secure_team" "sample" {
7477
`, name, name)
7578
}
7679

80+
func secureTeamWithAgentCliAndRapidResponse(name string) string {
81+
return fmt.Sprintf(`
82+
resource "sysdig_secure_team" "sample" {
83+
name = "sample-%s"
84+
description = "%s"
85+
scope_by = "container"
86+
can_use_agent_cli = false
87+
can_use_rapid_response = true
88+
}
89+
`, name, name)
90+
}
91+
7792
func secureTeamMinimumConfiguration(name string) string {
7893
return fmt.Sprintf(`
7994
resource "sysdig_secure_team" "sample" {
80-
name = "sample-%s"
95+
name = "sample-%s"
8196
}`, name)
8297
}
8398

8499
func secureTeamWithPlatformMetricsIBM(name string) string {
85100
return fmt.Sprintf(`
86101
resource "sysdig_secure_team" "sample" {
87-
name = "sample-%s"
102+
name = "sample-%s"
88103
enable_ibm_platform_metrics = true
89-
ibm_platform_metrics = "foo in (\"0\") and bar in (\"3\")"
104+
ibm_platform_metrics = "foo in (\"0\") and bar in (\"3\")"
90105
}`, name)
91106
}
92107

‎sysdig/resource_sysdig_team_common.go

Lines changed: 0 additions & 39 deletions
This file was deleted.

‎website/docs/d/monitor_team.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ data "sysdig_monitor_team" "example" {
2828
- `description` - The description of the monitor team.
2929
- `entrypoint` - The entrypoint configuration for the team.
3030
- `filter` - The filter applied to the team.
31+
- `prometheus_remote_write_metrics_filter` - The Prometheus remote write metrics filter for the team.
3132
- `scope_by` - The scope of the team.
3233
- `can_use_sysdig_capture` - Whether the team can use Sysdig capture.
3334
- `can_see_infrastructure_events` - Whether the team can see infrastructure events.
35+
- `can_use_agent_cli` - Whether the team can use the agent CLI.
3436
- `can_use_aws_data` - Whether the team can use AWS data.
3537
- `default_team` - Whether the team is the default team.
3638
- `user_roles` - The roles assigned to users in the team.

‎website/docs/d/secure_team.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ data "sysdig_secure_team" "example" {
2929
- `filter` - The filter applied to the team.
3030
- `scope_by` - The scope of the team.
3131
- `use_sysdig_capture` - Whether the team can use Sysdig capture.
32+
- `can_use_agent_cli` - Whether the team can use the agent CLI.
33+
- `can_use_rapid_response` - Whether the team can use rapid response.
3234
- `default_team` - Whether the team is the default team.
3335
- `user_roles` - The roles assigned to users in the team.
3436
- `zone_ids` - The IDs of the zones associated with the team.
3537
- `all_zones` - Whether the team has access to all zones.
3638
- `version` - The version of the secure team.
3739
- `theme` - The theme of the secure team.
38-

‎website/docs/r/monitor_team.md

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ resource "sysdig_monitor_team" "devops" {
1919
name = "Monitoring DevOps team"
2020
2121
entrypoint {
22-
type = "Explore"
22+
type = "DashboardTemplates"
23+
selection = "view.net.http"
2324
}
24-
25+
2526
user_roles {
2627
email = data.sysdig_current_user.me.email
2728
role = "ROLE_TEAM_MANAGER"
@@ -36,8 +37,11 @@ resource "sysdig_monitor_team" "devops" {
3637
email = "john.smith@example.com"
3738
role = data.sysdig_custom_role.custom_role.id
3839
}
40+
41+
filter = "kubernetes.namespace.name in (\"kube-system\") and kubernetes.deployment.name in (\"coredns\")"
42+
prometheus_remote_write_metrics_filter = "kube_cluster_name in (\"test-cluster\", \"test-k8s-data\") and kube_deployment_name = \"coredns\" and my_metric starts with \"prefix\" and not my_metric contains \"prefix-test\""
3943
}
40-
44+
4145
data "sysdig_current_user" "me" {
4246
}
4347
@@ -50,24 +54,28 @@ data "sysdig_custom_role" "custom_role" {
5054

5155
* `name` - (Required) The name of the Monitor Team. It must be unique and must not exist in Secure.
5256

53-
* `entrypoint` - (Required) Main entry point for the current team in the product.
57+
* `entrypoint` - (Required) Main entry point for the current team in the product.
5458
See the Entrypoint argument reference section for more information.
5559

5660
* `description` - (Optional) A description of the team.
5761

58-
* `theme` - (Optional) Colour of the team. Default: "#73A1F7".
62+
* `theme` - (Optional) Colour of the team. Default: `#05C391`.
63+
64+
* `scope_by` - (Optional) Scope for the team, either `container` or `host`. Default: `host`. If set to `host`, team members can see all host-level and container-level information. If set to `container`, team members can see only Container-level information.
65+
66+
* `filter` - (Optional) Use this option to select which Agent Metrics data users of this team can view. Not setting it will allow users to see all Agent Metrics data.
67+
68+
* `prometheus_remote_write_metrics_filter` - (Optional) Use this option to select which Prometheus Remote Write data users of this team can view. Not setting it will allow users to see all Prometheus Remote Write data.
69+
70+
* `can_use_sysdig_capture` - (Optional) Defines if the team is able to create Sysdig Capture files. Default: `true`.
71+
72+
* `can_see_infrastructure_events` - (Optional) Enable this option to allow this team to view all Infrastructure and Custom Events from every user and agent. Otherwise, this team will only see infrastructure events sent specifically to this team. Default: `false`.
5973

60-
* `scope_by` - (Optional) Scope for the team. Default: "container".
74+
* `can_use_aws_data` - (Optional) Enable this option to give this team access to AWS metrics and tags. All AWS data is made available, regardless of the team’s Scope. Default: `false`.
6175

62-
* `filter` - (Optional) If the team can only see some resources,
63-
write down a filter of such resources.
64-
65-
* `use_sysdig_capture` - (Optional) Defines if the team is able to create Sysdig Capture files.
66-
Default: true.
67-
68-
* `can_see_infrastructure_events` - (Optional) TODO. Default: false.
76+
* `can_use_agent_cli` - (Optional) Enable this option to give this team access to Using the Agent Console. Default: `true`.
6977

70-
* `can_use_aws_data` - (Optional) TODO. Default: false.
78+
* `default_team` - (Optional) Defines if the team is the default one. Warning: only one can be the default, if you define multiple default teams, Terraform will be updating the API in every execution, even if the state hasn't changed.
7179

7280
* `user_roles` - (Optional) Multiple user roles can be specified.
7381
Administrators of the account will be automatically added
@@ -77,31 +85,32 @@ data "sysdig_custom_role" "custom_role" {
7785
### Entrypoint Argument Reference
7886

7987
* `type` - (Required) Main entrypoint for the team.
80-
Valid options are: Explore, Dashboards, Events, Alerts, Settings.
88+
Valid options are: `Explore`, `Dashboards`, `Events`, `Alerts`, `Settings`, `DashboardTemplates`, `Advisor`.
8189

8290
* `selection` - (Optional) Sets up the defined Dashboard name as entrypoint.
83-
Warning: This field must only be added if the `type` is "Dashboards".
91+
Warning: This field must only be added if the `type` is `Dashboards`, and the value is the numeric id of the selected dashboard, or `DashboardTemplates`, and the value is the id (dotted name) of the selected dashboard template.
8492

8593
### User Role Argument Reference
8694

8795
* `email` - (Required) The email of the user in the group.
8896

8997
* `role` - (Optional) The role for the user in this group.
90-
Valid roles are: ROLE_TEAM_STANDARD, ROLE_TEAM_EDIT, ROLE_TEAM_READ, ROLE_TEAM_MANAGER or CustomRole ID.<br/>
91-
Default: ROLE_TEAM_STANDARD.<br/>
98+
Valid roles are: `ROLE_TEAM_STANDARD`, `ROLE_TEAM_EDIT`, `ROLE_TEAM_READ`, `ROLE_TEAM_MANAGER` or CustomRole ID.<br/>
99+
Default: `ROLE_TEAM_STANDARD`.<br/>
92100
Note: CustomRole ID can be referenced from `sysdig_custom_role` resource or `sysdig_custom_role` data source
93101

94102
## Attributes Reference
95103

96104
In addition to all arguments above, the following attributes are exported:
97105

98-
* `default_team` - (Optional) Mark team as default team. Users with no designated team will be added to this team by default.
106+
* `id` - ID of the created team.
107+
* `version` - Current version of the resource.
99108

100109
### IBM Cloud Monitoring arguments
101110

102-
* `enable_ibm_platform_metrics` - (Optional) Enable platform metrics on IBM Cloud Monitoring.
111+
* `enable_ibm_platform_metrics` - (Optional) Enable Platform Metrics on IBM Cloud Monitoring.
103112

104-
* `ibm_platform_metrics` - (Optional) Define platform metrics on IBM Cloud Monitoring.
113+
* `ibm_platform_metrics` - (Optional) Use this option to select which Platform Metrics data users of this team can view. Not setting it will allow users to see all Platform Metrics data.
105114

106115
## Import
107116

‎website/docs/r/secure_team.md

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Creates a Sysdig Secure Team.
1717
```terraform
1818
resource "sysdig_secure_team" "devops" {
1919
name = "DevOps team"
20-
20+
2121
user_roles {
2222
email = data.sysdig_current_user.me.email
2323
role = "ROLE_TEAM_MANAGER"
@@ -33,7 +33,7 @@ resource "sysdig_secure_team" "devops" {
3333
role = data.sysdig_custom_role.custom_role.id
3434
}
3535
}
36-
36+
3737
data "sysdig_current_user" "me" {
3838
}
3939
@@ -48,19 +48,20 @@ data "sysdig_custom_role" "custom_role" {
4848

4949
* `description` - (Optional) A description of the team.
5050

51-
* `theme` - (Optional) Colour of the team. Default: "#73A1F7".
51+
* `theme` - (Optional) Colour of the team. Default: `#73A1F7`.
5252

53-
* `scope_by` - (Optional) Scope for the team. Default: "container".
53+
* `scope_by` - (Optional) Scope for the team, either `container` or `host`. Default: `container`. If set to `host`, team members can see all host-level and container-level information. If set to `container`, team members can see only Container-level information.
5454

55-
* `filter` - (Optional) If the team can only see some resources,
55+
* `filter` - (Optional) If the team can only see some resources,
5656
write down a filter of such resources.
57-
58-
* `use_sysdig_capture` - (Optional) Defines if the team is able to create Sysdig Capture files.
59-
Default: true.
60-
61-
* `default_team` - (Optional) Defines if the team is the default one. Warning: only one can be the default,
62-
if you define multiple default teams, Terraform will be updating the API in every execution,
63-
even if the state hasn't changed.
57+
58+
* `use_sysdig_capture` - (Optional) Defines if the team is able to create Sysdig Capture files. Default: `true`.
59+
60+
* `can_use_agent_cli` - (Optional) Enable this option to give this team access to Using the Agent Console. Default: `true`.
61+
62+
* `can_use_rapid_response` - (Optional) Enable this option to give this Secure team access to Rapid Response. Default: `false`.
63+
64+
* `default_team` - (Optional) Defines if the team is the default one. Warning: only one can be the default, if you define multiple default teams, Terraform will be updating the API in every execution, even if the state hasn't changed.
6465

6566
* `user_roles` - (Optional) Multiple user roles can be specified.
6667
Administrators of the account will be automatically added
@@ -70,25 +71,22 @@ data "sysdig_custom_role" "custom_role" {
7071
* `zone_ids` - (Optional) List of zone IDs attached to the team. If `all_zones` is specified this argument needs to be omitted.
7172

7273
* `all_zones` - (Optional) Attach all zones to the team. If this argument is enabled then `zone_ids` needs to be omitted.
73-
74+
7475
### User Role Argument Reference
7576

7677
* `email` - (Required) The email of the user in the group.
7778

7879
* `role` - (Optional) The role for the user in this group.
79-
Valid roles are: ROLE_TEAM_STANDARD, ROLE_TEAM_EDIT, ROLE_TEAM_READ, ROLE_TEAM_MANAGER or CustomRole ID.<br/>
80-
Default: ROLE_TEAM_STANDARD.<br/>
80+
Valid roles are: `ROLE_TEAM_STANDARD`, `ROLE_TEAM_EDIT`, `ROLE_TEAM_READ`, `ROLE_TEAM_MANAGER` or CustomRole ID.<br/>
81+
Default: `ROLE_TEAM_STANDARD`.<br/>
8182
Note: CustomRole ID can be referenced from `sysdig_custom_role` resource or `sysdig_custom_role` data source
8283

8384
## Attributes Reference
8485

85-
No additional attributes are exported.
86-
87-
### IBM Workload protection arguments
88-
89-
* `enable_ibm_platform_metrics` - (Optional) Enable platform metrics on IBM Cloud Monitoring.
86+
In addition to all arguments above, the following attributes are exported:
9087

91-
* `ibm_platform_metrics` - (Optional) Define platform metrics on IBM Cloud Monitoring.
88+
* `id` - ID of the created team.
89+
* `version` - Current version of the resource.
9290

9391
## Import
9492

0 commit comments

Comments
 (0)
Please sign in to comment.