diff --git a/sysdig/data_source_sysdig_monitor_team.go b/sysdig/data_source_sysdig_monitor_team.go new file mode 100644 index 000000000..8fde20502 --- /dev/null +++ b/sysdig/data_source_sysdig_monitor_team.go @@ -0,0 +1,142 @@ +package sysdig + +import ( + "context" + "strconv" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceSysdigMonitorTeam() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceSysdigMonitorTeamRead, + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Required: true, + }, + "theme": { + Type: schema.TypeString, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + "description": { + Type: schema.TypeString, + Computed: true, + }, + "scope_by": { + Type: schema.TypeString, + Computed: true, + }, + "filter": { + Type: schema.TypeString, + Computed: true, + }, + "can_use_sysdig_capture": { + Type: schema.TypeBool, + Computed: true, + }, + "can_see_infrastructure_events": { + Type: schema.TypeBool, + Computed: true, + }, + "can_use_aws_data": { + Type: schema.TypeBool, + Computed: true, + }, + "default_team": { + Type: schema.TypeBool, + Computed: true, + }, + "enable_ibm_platform_metrics": { + Type: schema.TypeBool, + Computed: true, + }, + "ibm_platform_metrics": { + Type: schema.TypeString, + Computed: true, + }, + "user_roles": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "email": { + Type: schema.TypeString, + Computed: true, + }, + "role": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "entrypoint": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Computed: true, + }, + "selection": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "version": { + Type: schema.TypeInt, + Computed: true, + }, + }, + } +} + +func dataSourceSysdigMonitorTeamRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + clients := meta.(SysdigClients) + client, err := getMonitorTeamClient(clients) + if err != nil { + return diag.FromErr(err) + } + + id, err := strconv.Atoi(d.Get("id").(string)) + if err != nil { + return diag.FromErr(err) + } + + team, err := client.GetTeamById(ctx, id) + if err != nil { + return diag.FromErr(err) + } + + d.SetId(strconv.Itoa(team.ID)) + _ = d.Set("name", team.Name) + _ = d.Set("theme", team.Theme) + _ = d.Set("description", team.Description) + _ = d.Set("scope_by", team.Show) + _ = d.Set("filter", team.Filter) + _ = d.Set("can_use_sysdig_capture", team.CanUseSysdigCapture) + _ = d.Set("can_see_infrastructure_events", team.CanUseCustomEvents) + _ = d.Set("can_use_aws_data", team.CanUseAwsMetrics) + _ = d.Set("default_team", team.DefaultTeam) + _ = d.Set("user_roles", userMonitorRolesToSet(team.UserRoles)) + _ = d.Set("entrypoint", entrypointToSet(team.EntryPoint)) + _ = d.Set("version", team.Version) + + var ibmPlatformMetrics *string + if team.NamespaceFilters != nil { + ibmPlatformMetrics = team.NamespaceFilters.IBMPlatformMetrics + } + _ = d.Set("enable_ibm_platform_metrics", team.CanUseBeaconMetrics) + _ = d.Set("ibm_platform_metrics", ibmPlatformMetrics) + + return nil +} diff --git a/sysdig/data_source_sysdig_monitor_team_ibm_test.go b/sysdig/data_source_sysdig_monitor_team_ibm_test.go new file mode 100644 index 000000000..257634f6e --- /dev/null +++ b/sysdig/data_source_sysdig_monitor_team_ibm_test.go @@ -0,0 +1,53 @@ +//go:build tf_acc_ibm_monitor + +package sysdig_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/draios/terraform-provider-sysdig/sysdig" +) + +func TestAccDataSourceSysdigMonitorTeamIBM(t *testing.T) { + name := fmt.Sprintf("test-monitor-team-%s", randomText(5)) + resource.Test(t, resource.TestCase{ + PreCheck: preCheckAnyEnv(t, SysdigIBMMonitorAPIKeyEnv), + ProviderFactories: map[string]func() (*schema.Provider, error){ + "sysdig": func() (*schema.Provider, error) { + return sysdig.Provider(), nil + }, + }, + Steps: []resource.TestStep{ + { + Config: monitorTeamWithPlatformMetricsAndDatasourceIBM(name), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.sysdig_monitor_team.test", "name", name), + resource.TestCheckResourceAttr("data.sysdig_monitor_team.test", "enable_ibm_platform_metrics", "true"), + resource.TestCheckResourceAttr("data.sysdig_monitor_team.test", "ibm_platform_metrics", "foo in (\"0\") and bar in (\"3\")"), + ), + }, + }, + }) +} + +func monitorTeamWithPlatformMetricsAndDatasourceIBM(name string) string { + return fmt.Sprintf(` +resource "sysdig_monitor_team" "sample" { + name = "%s" + enable_ibm_platform_metrics = true + ibm_platform_metrics = "foo in (\"0\") and bar in (\"3\")" + + entrypoint { + type = "Dashboards" + } +} + +data "sysdig_monitor_team" "test" { + id = sysdig_monitor_team.sample.id +} +`, name) +} diff --git a/sysdig/data_source_sysdig_monitor_team_test.go b/sysdig/data_source_sysdig_monitor_team_test.go new file mode 100644 index 000000000..e24e0a3d0 --- /dev/null +++ b/sysdig/data_source_sysdig_monitor_team_test.go @@ -0,0 +1,61 @@ +//go:build tf_acc_sysdig_monitor || tf_acc_onprem_monitor + +package sysdig_test + +import ( + "fmt" + "testing" + + "github.com/draios/terraform-provider-sysdig/sysdig" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccDataSourceSysdigMonitorTeam(t *testing.T) { + name := fmt.Sprintf("test-monitor-team-%s", randomText(5)) + resource.Test(t, resource.TestCase{ + PreCheck: preCheckAnyEnv(t, SysdigMonitorApiTokenEnv), + ProviderFactories: map[string]func() (*schema.Provider, error){ + "sysdig": func() (*schema.Provider, error) { + return sysdig.Provider(), nil + }, + }, + Steps: []resource.TestStep{ + { + Config: monitorTeamResourceAndDatasource(name), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.sysdig_monitor_team.test", "name", name), + resource.TestCheckResourceAttr("data.sysdig_monitor_team.test", "description", "A monitor team"), + resource.TestCheckResourceAttr("data.sysdig_monitor_team.test", "scope_by", "host"), + resource.TestCheckResourceAttr("data.sysdig_monitor_team.test", "filter", "container.image.repo = \"sysdig/agent\""), + resource.TestCheckResourceAttr("data.sysdig_monitor_team.test", "can_use_sysdig_capture", "true"), + resource.TestCheckResourceAttr("data.sysdig_monitor_team.test", "can_see_infrastructure_events", "true"), + resource.TestCheckResourceAttr("data.sysdig_monitor_team.test", "can_use_aws_data", "true"), + ), + }, + }, + }) +} + +func monitorTeamResourceAndDatasource(name string) string { + return fmt.Sprintf(` +resource "sysdig_monitor_team" "sample" { + name = "%s" + description = "A monitor team" + scope_by = "host" + filter = "container.image.repo = \"sysdig/agent\"" + can_use_sysdig_capture = true + can_see_infrastructure_events = true + can_use_aws_data = true + + entrypoint { + type = "Dashboards" + } +} + +data "sysdig_monitor_team" "test" { + id = sysdig_monitor_team.sample.id +} +`, name) +} diff --git a/sysdig/data_source_sysdig_monitor_teams.go b/sysdig/data_source_sysdig_monitor_teams.go new file mode 100644 index 000000000..043e4808a --- /dev/null +++ b/sysdig/data_source_sysdig_monitor_teams.go @@ -0,0 +1,59 @@ +package sysdig + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceSysdigMonitorTeams() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceSysdigMonitorTeamsRead, + Schema: map[string]*schema.Schema{ + "teams": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeInt, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceSysdigMonitorTeamsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + clients := meta.(SysdigClients) + client, err := getMonitorTeamClient(clients) + if err != nil { + return diag.FromErr(err) + } + + teams, err := client.ListTeams(ctx) + if err != nil { + return diag.FromErr(err) + } + + var result []map[string]interface{} + for _, team := range teams { + result = append(result, map[string]interface{}{ + "id": team.ID, + "name": team.Name, + }) + } + d.SetId("sysdig_monitor_teams") + if err := d.Set("teams", result); err != nil { + return diag.FromErr(err) + } + + return nil +} diff --git a/sysdig/data_source_sysdig_monitor_teams_test.go b/sysdig/data_source_sysdig_monitor_teams_test.go new file mode 100644 index 000000000..e4de6a48f --- /dev/null +++ b/sysdig/data_source_sysdig_monitor_teams_test.go @@ -0,0 +1,50 @@ +//go:build tf_acc_sysdig_monitor || tf_acc_onprem_monitor || tf_acc_ibm_monitor + +package sysdig_test + +import ( + "fmt" + "github.com/draios/terraform-provider-sysdig/sysdig" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccDataSourceSysdigMonitorTeams(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: preCheckAnyEnv(t, SysdigMonitorApiTokenEnv, SysdigIBMMonitorAPIKeyEnv), + ProviderFactories: map[string]func() (*schema.Provider, error){ + "sysdig": func() (*schema.Provider, error) { + return sysdig.Provider(), nil + }, + }, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceSysdigMonitorTeamsConfig(randomText(10)), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.sysdig_monitor_teams.test", "teams.0.id"), + ), + }, + }, + }) +} + +func testAccDataSourceSysdigMonitorTeamsConfig(name string) string { + return fmt.Sprintf(` +resource "sysdig_monitor_team" "sample" { + name = "%s" + description = "A monitor secure team" + scope_by = "host" + filter = "container.image.repo = \"sysdig/agent\"" + can_use_sysdig_capture = true + can_see_infrastructure_events = true + + entrypoint { + type = "Dashboards" + } +} + +data "sysdig_monitor_teams" "test" {} +`, name) +} diff --git a/sysdig/data_source_sysdig_secure_team.go b/sysdig/data_source_sysdig_secure_team.go new file mode 100644 index 000000000..823fcead8 --- /dev/null +++ b/sysdig/data_source_sysdig_secure_team.go @@ -0,0 +1,113 @@ +package sysdig + +import ( + "context" + "strconv" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceSysdigSecureTeam() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceSysdigSecureTeamRead, + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Required: true, + }, + "theme": { + Type: schema.TypeString, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + "description": { + Type: schema.TypeString, + Computed: true, + }, + "scope_by": { + Type: schema.TypeString, + Computed: true, + }, + "filter": { + Type: schema.TypeString, + Computed: true, + }, + "use_sysdig_capture": { + Type: schema.TypeBool, + Computed: true, + }, + "default_team": { + Type: schema.TypeBool, + Computed: true, + }, + "user_roles": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "email": { + Type: schema.TypeString, + Computed: true, + }, + "role": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "version": { + Type: schema.TypeInt, + Computed: true, + }, + "zone_ids": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeInt, + }, + }, + "all_zones": { + Type: schema.TypeBool, + Computed: true, + }, + }, + } +} + +func dataSourceSysdigSecureTeamRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + clients := meta.(SysdigClients) + client, err := getSecureTeamClient(clients) + if err != nil { + return diag.FromErr(err) + } + + id, err := strconv.Atoi(d.Get("id").(string)) + if err != nil { + return diag.FromErr(err) + } + + team, err := client.GetTeamById(ctx, id) + if err != nil { + return diag.FromErr(err) + } + + d.SetId(strconv.Itoa(team.ID)) + _ = d.Set("name", team.Name) + _ = d.Set("theme", team.Theme) + _ = d.Set("description", team.Description) + _ = d.Set("scope_by", team.Show) + _ = d.Set("filter", team.Filter) + _ = d.Set("use_sysdig_capture", team.CanUseSysdigCapture) + _ = d.Set("default_team", team.DefaultTeam) + _ = d.Set("user_roles", userSecureRolesToSet(team.UserRoles)) + _ = d.Set("version", team.Version) + _ = d.Set("zone_ids", team.ZoneIDs) + _ = d.Set("all_zones", team.AllZones) + + return nil +} diff --git a/sysdig/data_source_sysdig_secure_team_test.go b/sysdig/data_source_sysdig_secure_team_test.go new file mode 100644 index 000000000..9d57e16e3 --- /dev/null +++ b/sysdig/data_source_sysdig_secure_team_test.go @@ -0,0 +1,55 @@ +//go:build tf_acc_sysdig_secure || tf_acc_onprem_secure + +package sysdig_test + +import ( + "fmt" + "testing" + + "github.com/draios/terraform-provider-sysdig/sysdig" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func TestAccDataSourceSysdigSecureTeam(t *testing.T) { + name := fmt.Sprintf("test-secure-team-%s", randomText(5)) + resource.Test(t, resource.TestCase{ + PreCheck: preCheckAnyEnv(t, SysdigSecureApiTokenEnv), + ProviderFactories: map[string]func() (*schema.Provider, error){ + "sysdig": func() (*schema.Provider, error) { + return sysdig.Provider(), nil + }, + }, + Steps: []resource.TestStep{ + { + Config: secureTeamAndDatasource(name), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.sysdig_secure_team.test", "name", name), + resource.TestCheckResourceAttr("data.sysdig_secure_team.test", "description", "A test secure team"), + resource.TestCheckResourceAttr("data.sysdig_secure_team.test", "scope_by", "container"), + resource.TestCheckResourceAttr("data.sysdig_secure_team.test", "filter", "container.image.repo = \"sysdig/agent\""), + resource.TestCheckResourceAttr("data.sysdig_secure_team.test", "version", "0"), + resource.TestCheckResourceAttr("data.sysdig_secure_team.test", "use_sysdig_capture", "true"), + resource.TestCheckResourceAttr("data.sysdig_secure_team.test", "all_zones", "true"), + ), + }, + }, + }) +} + +func secureTeamAndDatasource(name string) string { + return fmt.Sprintf(` +resource "sysdig_secure_team" "sample" { + name = "%s" + description = "A test secure team" + scope_by = "container" + use_sysdig_capture = true + filter = "container.image.repo = \"sysdig/agent\"" + all_zones = true +} + +data "sysdig_secure_team" "test" { + id = sysdig_secure_team.sample.id +} +`, name) +} diff --git a/sysdig/data_source_sysdig_secure_teams.go b/sysdig/data_source_sysdig_secure_teams.go new file mode 100644 index 000000000..59a5e565a --- /dev/null +++ b/sysdig/data_source_sysdig_secure_teams.go @@ -0,0 +1,59 @@ +package sysdig + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceSysdigSecureTeams() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceSysdigSecureTeamsRead, + Schema: map[string]*schema.Schema{ + "teams": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeInt, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceSysdigSecureTeamsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + clients := meta.(SysdigClients) + client, err := getSecureTeamClient(clients) + if err != nil { + return diag.FromErr(err) + } + + teams, err := client.ListTeams(ctx) + if err != nil { + return diag.FromErr(err) + } + + var result []map[string]interface{} + for _, team := range teams { + result = append(result, map[string]interface{}{ + "id": team.ID, + "name": team.Name, + }) + } + d.SetId("sysdig_secure_teams") + if err := d.Set("teams", result); err != nil { + return diag.FromErr(err) + } + + return nil +} diff --git a/sysdig/data_source_sysdig_secure_teams_test.go b/sysdig/data_source_sysdig_secure_teams_test.go new file mode 100644 index 000000000..4f2ee453e --- /dev/null +++ b/sysdig/data_source_sysdig_secure_teams_test.go @@ -0,0 +1,42 @@ +//go:build tf_acc_sysdig_secure || tf_acc_onprem_secure || tf_acc_ibm_secure + +package sysdig_test + +import ( + "fmt" + "github.com/draios/terraform-provider-sysdig/sysdig" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccDataSourceSysdigSecureTeams(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: preCheckAnyEnv(t, SysdigSecureApiTokenEnv, SysdigIBMSecureAPIKeyEnv), + ProviderFactories: map[string]func() (*schema.Provider, error){ + "sysdig": func() (*schema.Provider, error) { + return sysdig.Provider(), nil + }, + }, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceSysdigSecureTeamsConfig(randomText(5)), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.sysdig_secure_teams.test", "teams.0.id"), + ), + }, + }, + }) +} + +func testAccDataSourceSysdigSecureTeamsConfig(name string) string { + return fmt.Sprintf(` +resource "sysdig_secure_team" "test" { + name = "test-secure-team-%s" + description = "A test secure team" +} + +data "sysdig_secure_teams" "test" {} +`, name) +} diff --git a/sysdig/data_source_sysdig_secure_zone.go b/sysdig/data_source_sysdig_secure_zone.go index a39299c83..595cd3e65 100644 --- a/sysdig/data_source_sysdig_secure_zone.go +++ b/sysdig/data_source_sysdig_secure_zone.go @@ -3,10 +3,11 @@ package sysdig import ( "context" "fmt" - v2 "github.com/draios/terraform-provider-sysdig/sysdig/internal/client/v2" "strconv" "time" + v2 "github.com/draios/terraform-provider-sysdig/sysdig/internal/client/v2" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/sysdig/internal/client/v2/teams.go b/sysdig/internal/client/v2/teams.go index 5c0607e42..8688a8669 100644 --- a/sysdig/internal/client/v2/teams.go +++ b/sysdig/internal/client/v2/teams.go @@ -19,6 +19,11 @@ type TeamInterface interface { CreateTeam(ctx context.Context, tRequest Team) (t Team, err error) UpdateTeam(ctx context.Context, tRequest Team) (t Team, err error) DeleteTeam(ctx context.Context, id int) error + ListTeams(ctx context.Context) ([]Team, error) +} + +type teamsWrapper struct { + Teams []Team `json:"teams"` } func (client *Client) GetUserIDByEmail(ctx context.Context, userRoles []UserRoles) ([]UserRoles, error) { @@ -154,6 +159,25 @@ func (client *Client) DeleteTeam(ctx context.Context, id int) error { return nil } +func (client *Client) ListTeams(ctx context.Context) ([]Team, error) { + response, err := client.requester.Request(ctx, http.MethodGet, client.GetTeamsURL(), nil) + if err != nil { + return nil, err + } + defer response.Body.Close() + + if response.StatusCode != http.StatusOK { + return nil, client.ErrorFromResponse(response) + } + + wrapper, err := Unmarshal[teamsWrapper](response.Body) + if err != nil { + return nil, err + } + + return wrapper.Teams, nil +} + func (client *Client) GetUsersLightURL() string { return fmt.Sprintf(GetUsersLightPath, client.config.url) } diff --git a/sysdig/provider.go b/sysdig/provider.go index 82ca1fbf8..40394b872 100644 --- a/sysdig/provider.go +++ b/sysdig/provider.go @@ -238,6 +238,8 @@ func (p *SysdigProvider) Provider() *schema.Provider { "sysdig_secure_rule_stateful": dataSourceSysdigSecureRuleStateful(), "sysdig_secure_rule_stateful_count": dataSourceSysdigSecureRuleStatefulCount(), "sysdig_secure_zone": dataSourceSysdigSecureZone(), + "sysdig_secure_team": dataSourceSysdigSecureTeam(), + "sysdig_secure_teams": dataSourceSysdigSecureTeams(), "sysdig_current_user": dataSourceSysdigCurrentUser(), "sysdig_user": dataSourceSysdigUser(), @@ -260,6 +262,8 @@ func (p *SysdigProvider) Provider() *schema.Provider { "sysdig_monitor_notification_channel_ibm_event_notification": dataSourceSysdigMonitorNotificationChannelIBMEventNotification(), "sysdig_monitor_notification_channel_ibm_function": dataSourceSysdigMonitorNotificationChannelIBMFunction(), "sysdig_monitor_custom_role_permissions": dataSourceSysdigMonitorCustomRolePermissions(), + "sysdig_monitor_team": dataSourceSysdigMonitorTeam(), + "sysdig_monitor_teams": dataSourceSysdigMonitorTeams(), "sysdig_secure_posture_policy": dataSourceSysdigSecurePosturePolicy(), }, ConfigureContextFunc: p.providerConfigure, diff --git a/website/docs/d/monitor_team.md b/website/docs/d/monitor_team.md new file mode 100644 index 000000000..2b334aa84 --- /dev/null +++ b/website/docs/d/monitor_team.md @@ -0,0 +1,40 @@ +--- +subcategory: "Sysdig Monitor" +layout: "sysdig" +page_title: "Sysdig: sysdig_monitor_team" +description: |- + Retrieves information about a specific monitor team in Sysdig +--- + +# sysdig_monitor_team + +The `sysdig_monitor_team` data source retrieves information about a specific monitor team in Sysdig. + +## Example Usage + +```terraform +data "sysdig_monitor_team" "example" { + id = "812371" +} +``` + +## Argument Reference + +- `id` - (Required) The ID of the monitor team. + +## Attribute Reference + +- `name` - The name of the monitor team. +- `description` - The description of the monitor team. +- `entrypoint` - The entrypoint configuration for the team. +- `filter` - The filter applied to the team. +- `scope_by` - The scope of the team. +- `can_use_sysdig_capture` - Whether the team can use Sysdig capture. +- `can_see_infrastructure_events` - Whether the team can see infrastructure events. +- `can_use_aws_data` - Whether the team can use AWS data. +- `default_team` - Whether the team is the default team. +- `user_roles` - The roles assigned to users in the team. +- `version` - The version of the monitor team. +- `theme` - The theme of the monitor team. +- `enable_ibm_platform_metrics` - Whether the team can use IBM platform metrics. +- `ibm_platform_metrics` - The IBM platform metrics configuration for the team. diff --git a/website/docs/d/monitor_teams.md b/website/docs/d/monitor_teams.md new file mode 100644 index 000000000..ab756f200 --- /dev/null +++ b/website/docs/d/monitor_teams.md @@ -0,0 +1,23 @@ +--- +subcategory: "Sysdig Monitor" +layout: "sysdig" +page_title: "Sysdig: sysdig_monitor_teams" +description: |- + Retrieves information about a specific monitor teams in Sysdig +--- + +# sysdig_monitor_teams + +The `sysdig_monitor_teams` data source retrieves a list of all monitor teams in Sysdig. + +## Example Usage + +```terraform +data "sysdig_monitor_teams" "example" {} +``` + +## Attribute Reference + +- `teams` - A list of monitor teams. Each team has the following attributes: + - `id` - The ID of the monitor team. + - `name` - The name of the monitor team. diff --git a/website/docs/d/secure_team.md b/website/docs/d/secure_team.md new file mode 100644 index 000000000..13a1cdfe7 --- /dev/null +++ b/website/docs/d/secure_team.md @@ -0,0 +1,38 @@ +--- +subcategory: "Sysdig Secure" +layout: "sysdig" +page_title: "Sysdig: sysdig_secure_team" +description: |- + Retrieves information about a specific secure team in Sysdig +--- + +# sysdig_secure_team + +The `sysdig_secure_team` data source retrieves information about a specific secure team in Sysdig. + +## Example Usage + +```terraform +data "sysdig_secure_team" "example" { + id = "812371" +} +``` + +## Argument Reference + +- `id` - (Required) The ID of the secure team. + +## Attribute Reference + +- `name` - The name of the secure team. +- `description` - The description of the secure team. +- `filter` - The filter applied to the team. +- `scope_by` - The scope of the team. +- `use_sysdig_capture` - Whether the team can use Sysdig capture. +- `default_team` - Whether the team is the default team. +- `user_roles` - The roles assigned to users in the team. +- `zone_ids` - The IDs of the zones associated with the team. +- `all_zones` - Whether the team has access to all zones. +- `version` - The version of the secure team. +- `theme` - The theme of the secure team. + diff --git a/website/docs/d/secure_teams.md b/website/docs/d/secure_teams.md new file mode 100644 index 000000000..1c4574779 --- /dev/null +++ b/website/docs/d/secure_teams.md @@ -0,0 +1,23 @@ +--- +subcategory: "Sysdig Secure" +layout: "sysdig" +page_title: "Sysdig: sysdig_secure_teams" +description: |- + Retrieves information about a specific secure teams in Sysdig +--- + +# sysdig_secure_teams + +The `sysdig_secure_teams` data source retrieves a list of all secure teams in Sysdig. + +## Example Usage + +```terraform +data "sysdig_secure_teams" "example" {} +``` + +## Attribute Reference + +- `teams` - A list of secure teams. Each team has the following attributes: + - `id` - The ID of the secure team. + - `name` - The name of the secure team.