From 14fc58e4c44cde6abaa72ece96738ad91fc52fbf Mon Sep 17 00:00:00 2001 From: Wilson de Carvalho <796900+wcmjunior@users.noreply.github.com> Date: Mon, 20 Nov 2023 23:58:33 -0800 Subject: [PATCH] Migrate slack, teams and samlcertificate to new framework --- cyral/internal/integration/slack/model.go | 20 ++++ cyral/internal/integration/slack/resource.go | 51 +++++++++ ...resource_cyral_integration_slack_alerts.go | 100 ------------------ ..._slack_alerts_test.go => resource_test.go} | 0 .../integration/slack/schema_loader.go | 24 +++++ cyral/internal/integration/teams/model.go | 20 ++++ cyral/internal/integration/teams/resource.go | 64 +++++++++++ .../teams/resource_cyral_integration_teams.go | 100 ------------------ ...gration_teams_test.go => resource_test.go} | 0 .../integration/teams/schema_loader.go | 24 +++++ ...yral_saml_certificate.go => datasource.go} | 13 +-- ...certificate_test.go => datasource_test.go} | 0 cyral/internal/samlcertificate/model.go | 16 +++ .../internal/samlcertificate/schema_loader.go | 24 +++++ cyral/provider/provider.go | 6 -- cyral/provider/schema_loader.go | 6 ++ 16 files changed, 250 insertions(+), 218 deletions(-) create mode 100644 cyral/internal/integration/slack/model.go create mode 100644 cyral/internal/integration/slack/resource.go delete mode 100644 cyral/internal/integration/slack/resource_cyral_integration_slack_alerts.go rename cyral/internal/integration/slack/{resource_cyral_integration_slack_alerts_test.go => resource_test.go} (100%) create mode 100644 cyral/internal/integration/slack/schema_loader.go create mode 100644 cyral/internal/integration/teams/model.go create mode 100644 cyral/internal/integration/teams/resource.go delete mode 100644 cyral/internal/integration/teams/resource_cyral_integration_teams.go rename cyral/internal/integration/teams/{resource_cyral_integration_teams_test.go => resource_test.go} (100%) create mode 100644 cyral/internal/integration/teams/schema_loader.go rename cyral/internal/samlcertificate/{data_source_cyral_saml_certificate.go => datasource.go} (80%) rename cyral/internal/samlcertificate/{data_source_cyral_saml_certificate_test.go => datasource_test.go} (100%) create mode 100644 cyral/internal/samlcertificate/model.go create mode 100644 cyral/internal/samlcertificate/schema_loader.go diff --git a/cyral/internal/integration/slack/model.go b/cyral/internal/integration/slack/model.go new file mode 100644 index 00000000..9802751d --- /dev/null +++ b/cyral/internal/integration/slack/model.go @@ -0,0 +1,20 @@ +package slack + +import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + +type SlackAlertsIntegration struct { + Name string `json:"name"` + URL string `json:"url"` +} + +func (data SlackAlertsIntegration) WriteToSchema(d *schema.ResourceData) error { + d.Set("name", data.Name) + d.Set("url", data.URL) + return nil +} + +func (data *SlackAlertsIntegration) ReadFromSchema(d *schema.ResourceData) error { + data.Name = d.Get("name").(string) + data.URL = d.Get("url").(string) + return nil +} diff --git a/cyral/internal/integration/slack/resource.go b/cyral/internal/integration/slack/resource.go new file mode 100644 index 00000000..7804f1f1 --- /dev/null +++ b/cyral/internal/integration/slack/resource.go @@ -0,0 +1,51 @@ +package slack + +import ( + "fmt" + + "github.com/cyralinc/terraform-provider-cyral/cyral/client" + "github.com/cyralinc/terraform-provider-cyral/cyral/core" + "github.com/cyralinc/terraform-provider-cyral/cyral/core/types/resourcetype" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +var resourceContextHandler = core.DefaultContextHandler{ + ResourceName: "Slack Integration", + ResourceType: resourcetype.Resource, + SchemaReaderFactory: func() core.SchemaReader { return &SlackAlertsIntegration{} }, + SchemaWriterFactory: func(_ *schema.ResourceData) core.SchemaWriter { return &SlackAlertsIntegration{} }, + BaseURLFactory: func(d *schema.ResourceData, c *client.Client) string { + return fmt.Sprintf("https://%s/v1/integrations/notifications/slack", c.ControlPlane) + }, +} + +func resourceSchema() *schema.Resource { + return &schema.Resource{ + Description: "Manages [integration with Slack to push alerts](https://cyral.com/docs/integrations/messaging/slack).", + CreateContext: resourceContextHandler.CreateContext(), + ReadContext: resourceContextHandler.ReadContext(), + UpdateContext: resourceContextHandler.UpdateContext(), + DeleteContext: resourceContextHandler.DeleteContext(), + Schema: map[string]*schema.Schema{ + "id": { + Description: "ID of this resource in Cyral environment", + Type: schema.TypeString, + Computed: true, + }, + "name": { + Description: "Integration name that will be used internally in the control plane.", + Type: schema.TypeString, + Required: true, + }, + "url": { + Description: "Slack Alert Webhook url.", + Type: schema.TypeString, + Required: true, + Sensitive: true, + }, + }, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + } +} diff --git a/cyral/internal/integration/slack/resource_cyral_integration_slack_alerts.go b/cyral/internal/integration/slack/resource_cyral_integration_slack_alerts.go deleted file mode 100644 index c863b164..00000000 --- a/cyral/internal/integration/slack/resource_cyral_integration_slack_alerts.go +++ /dev/null @@ -1,100 +0,0 @@ -package slack - -import ( - "fmt" - "net/http" - - "github.com/cyralinc/terraform-provider-cyral/cyral/client" - "github.com/cyralinc/terraform-provider-cyral/cyral/core" - "github.com/cyralinc/terraform-provider-cyral/cyral/core/types/operationtype" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -type SlackAlertsIntegration struct { - Name string `json:"name"` - URL string `json:"url"` -} - -func (data SlackAlertsIntegration) WriteToSchema(d *schema.ResourceData) error { - d.Set("name", data.Name) - d.Set("url", data.URL) - return nil -} - -func (data *SlackAlertsIntegration) ReadFromSchema(d *schema.ResourceData) error { - data.Name = d.Get("name").(string) - data.URL = d.Get("url").(string) - return nil -} - -var ReadSlackAlertsConfig = core.ResourceOperationConfig{ - ResourceName: "SlackAlertsResourceRead", - Type: operationtype.Read, - HttpMethod: http.MethodGet, - URLFactory: func(d *schema.ResourceData, c *client.Client) string { - return fmt.Sprintf("https://%s/v1/integrations/notifications/slack/%s", c.ControlPlane, d.Id()) - }, - SchemaWriterFactory: func(_ *schema.ResourceData) core.SchemaWriter { return &SlackAlertsIntegration{} }, - RequestErrorHandler: &core.ReadIgnoreHttpNotFound{ResName: "Integration Slack"}, -} - -func ResourceIntegrationSlackAlerts() *schema.Resource { - return &schema.Resource{ - Description: "Manages [integration with Slack to push alerts](https://cyral.com/docs/integrations/messaging/slack).", - CreateContext: core.CreateResource( - core.ResourceOperationConfig{ - ResourceName: "SlackAlertsResourceCreate", - Type: operationtype.Create, - HttpMethod: http.MethodPost, - URLFactory: func(d *schema.ResourceData, c *client.Client) string { - return fmt.Sprintf("https://%s/v1/integrations/notifications/slack", c.ControlPlane) - }, - SchemaReaderFactory: func() core.SchemaReader { return &SlackAlertsIntegration{} }, - }, ReadSlackAlertsConfig, - ), - ReadContext: core.ReadResource(ReadSlackAlertsConfig), - UpdateContext: core.UpdateResource( - core.ResourceOperationConfig{ - ResourceName: "SlackAlertsResourceUpdate", - Type: operationtype.Update, - HttpMethod: http.MethodPut, - URLFactory: func(d *schema.ResourceData, c *client.Client) string { - return fmt.Sprintf("https://%s/v1/integrations/notifications/slack/%s", c.ControlPlane, d.Id()) - }, - SchemaReaderFactory: func() core.SchemaReader { return &SlackAlertsIntegration{} }, - }, ReadSlackAlertsConfig, - ), - DeleteContext: core.DeleteResource( - core.ResourceOperationConfig{ - ResourceName: "SlackAlertsResourceDelete", - Type: operationtype.Delete, - HttpMethod: http.MethodDelete, - URLFactory: func(d *schema.ResourceData, c *client.Client) string { - return fmt.Sprintf("https://%s/v1/integrations/notifications/slack/%s", c.ControlPlane, d.Id()) - }, - }, - ), - - Schema: map[string]*schema.Schema{ - "id": { - Description: "ID of this resource in Cyral environment", - Type: schema.TypeString, - Computed: true, - }, - "name": { - Description: "Integration name that will be used internally in the control plane.", - Type: schema.TypeString, - Required: true, - }, - "url": { - Description: "Slack Alert Webhook url.", - Type: schema.TypeString, - Required: true, - Sensitive: true, - }, - }, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - } -} diff --git a/cyral/internal/integration/slack/resource_cyral_integration_slack_alerts_test.go b/cyral/internal/integration/slack/resource_test.go similarity index 100% rename from cyral/internal/integration/slack/resource_cyral_integration_slack_alerts_test.go rename to cyral/internal/integration/slack/resource_test.go diff --git a/cyral/internal/integration/slack/schema_loader.go b/cyral/internal/integration/slack/schema_loader.go new file mode 100644 index 00000000..3a21bbcc --- /dev/null +++ b/cyral/internal/integration/slack/schema_loader.go @@ -0,0 +1,24 @@ +package slack + +import "github.com/cyralinc/terraform-provider-cyral/cyral/core" + +type packageSchema struct { +} + +func (p *packageSchema) Name() string { + return "Slack Integration" +} + +func (p *packageSchema) Schemas() []*core.SchemaDescriptor { + return []*core.SchemaDescriptor{ + { + Name: "cyral_integration_slack_alerts", + Type: core.ResourceSchemaType, + Schema: resourceSchema, + }, + } +} + +func PackageSchema() core.PackageSchema { + return &packageSchema{} +} diff --git a/cyral/internal/integration/teams/model.go b/cyral/internal/integration/teams/model.go new file mode 100644 index 00000000..ce6196a8 --- /dev/null +++ b/cyral/internal/integration/teams/model.go @@ -0,0 +1,20 @@ +package teams + +import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + +type MsTeamsIntegration struct { + Name string `json:"name"` + URL string `json:"url"` +} + +func (data MsTeamsIntegration) WriteToSchema(d *schema.ResourceData) error { + d.Set("name", data.Name) + d.Set("url", data.URL) + return nil +} + +func (data *MsTeamsIntegration) ReadFromSchema(d *schema.ResourceData) error { + data.Name = d.Get("name").(string) + data.URL = d.Get("url").(string) + return nil +} diff --git a/cyral/internal/integration/teams/resource.go b/cyral/internal/integration/teams/resource.go new file mode 100644 index 00000000..1fce92b3 --- /dev/null +++ b/cyral/internal/integration/teams/resource.go @@ -0,0 +1,64 @@ +package teams + +import ( + "fmt" + "net/http" + + "github.com/cyralinc/terraform-provider-cyral/cyral/client" + "github.com/cyralinc/terraform-provider-cyral/cyral/core" + "github.com/cyralinc/terraform-provider-cyral/cyral/core/types/operationtype" + "github.com/cyralinc/terraform-provider-cyral/cyral/core/types/resourcetype" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +var resourceContextHandler = core.DefaultContextHandler{ + ResourceName: "Microsoft Teams Integration", + ResourceType: resourcetype.Resource, + SchemaReaderFactory: func() core.SchemaReader { return &MsTeamsIntegration{} }, + SchemaWriterFactory: func(_ *schema.ResourceData) core.SchemaWriter { return &MsTeamsIntegration{} }, + BaseURLFactory: func(d *schema.ResourceData, c *client.Client) string { + return fmt.Sprintf("https://%s/v1/integrations/notifications/teams", c.ControlPlane) + }, +} + +var ReadMsTeamsConfig = core.ResourceOperationConfig{ + ResourceName: "MsTeamsResourceRead", + Type: operationtype.Read, + HttpMethod: http.MethodGet, + URLFactory: func(d *schema.ResourceData, c *client.Client) string { + return fmt.Sprintf("https://%s/v1/integrations/notifications/teams/%s", c.ControlPlane, d.Id()) + }, + SchemaWriterFactory: func(_ *schema.ResourceData) core.SchemaWriter { return &MsTeamsIntegration{} }, + RequestErrorHandler: &core.ReadIgnoreHttpNotFound{ResName: "Integration Teams"}, +} + +func resourceSchema() *schema.Resource { + return &schema.Resource{ + Description: "Manages [integration with Microsoft Teams](https://cyral.com/docs/integrations/messaging/microsoft-teams/).", + CreateContext: resourceContextHandler.CreateContext(), + ReadContext: resourceContextHandler.ReadContext(), + UpdateContext: resourceContextHandler.UpdateContext(), + DeleteContext: resourceContextHandler.DeleteContext(), + Schema: map[string]*schema.Schema{ + "id": { + Description: "ID of this resource in Cyral environment", + Type: schema.TypeString, + Computed: true, + }, + "name": { + Description: "Integration name that will be used internally in the control plane.", + Type: schema.TypeString, + Required: true, + }, + "url": { + Description: "Microsoft Teams webhook URL.", + Type: schema.TypeString, + Required: true, + Sensitive: true, + }, + }, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + } +} diff --git a/cyral/internal/integration/teams/resource_cyral_integration_teams.go b/cyral/internal/integration/teams/resource_cyral_integration_teams.go deleted file mode 100644 index 0eee26e2..00000000 --- a/cyral/internal/integration/teams/resource_cyral_integration_teams.go +++ /dev/null @@ -1,100 +0,0 @@ -package teams - -import ( - "fmt" - "net/http" - - "github.com/cyralinc/terraform-provider-cyral/cyral/client" - "github.com/cyralinc/terraform-provider-cyral/cyral/core" - "github.com/cyralinc/terraform-provider-cyral/cyral/core/types/operationtype" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -type MsTeamsIntegration struct { - Name string `json:"name"` - URL string `json:"url"` -} - -func (data MsTeamsIntegration) WriteToSchema(d *schema.ResourceData) error { - d.Set("name", data.Name) - d.Set("url", data.URL) - return nil -} - -func (data *MsTeamsIntegration) ReadFromSchema(d *schema.ResourceData) error { - data.Name = d.Get("name").(string) - data.URL = d.Get("url").(string) - return nil -} - -var ReadMsTeamsConfig = core.ResourceOperationConfig{ - ResourceName: "MsTeamsResourceRead", - Type: operationtype.Read, - HttpMethod: http.MethodGet, - URLFactory: func(d *schema.ResourceData, c *client.Client) string { - return fmt.Sprintf("https://%s/v1/integrations/notifications/teams/%s", c.ControlPlane, d.Id()) - }, - SchemaWriterFactory: func(_ *schema.ResourceData) core.SchemaWriter { return &MsTeamsIntegration{} }, - RequestErrorHandler: &core.ReadIgnoreHttpNotFound{ResName: "Integration Teams"}, -} - -func ResourceIntegrationMsTeams() *schema.Resource { - return &schema.Resource{ - Description: "Manages [integration with Microsoft Teams](https://cyral.com/docs/integrations/messaging/microsoft-teams/).", - CreateContext: core.CreateResource( - core.ResourceOperationConfig{ - ResourceName: "MsTeamsResourceCreate", - Type: operationtype.Create, - HttpMethod: http.MethodPost, - URLFactory: func(d *schema.ResourceData, c *client.Client) string { - return fmt.Sprintf("https://%s/v1/integrations/notifications/teams", c.ControlPlane) - }, - SchemaReaderFactory: func() core.SchemaReader { return &MsTeamsIntegration{} }, - }, ReadMsTeamsConfig, - ), - ReadContext: core.ReadResource(ReadMsTeamsConfig), - UpdateContext: core.UpdateResource( - core.ResourceOperationConfig{ - ResourceName: "MsTeamsResourceUpdate", - Type: operationtype.Update, - HttpMethod: http.MethodPut, - URLFactory: func(d *schema.ResourceData, c *client.Client) string { - return fmt.Sprintf("https://%s/v1/integrations/notifications/teams/%s", c.ControlPlane, d.Id()) - }, - SchemaReaderFactory: func() core.SchemaReader { return &MsTeamsIntegration{} }, - }, ReadMsTeamsConfig, - ), - DeleteContext: core.DeleteResource( - core.ResourceOperationConfig{ - ResourceName: "MsTeamsResourceDelete", - Type: operationtype.Delete, - HttpMethod: http.MethodDelete, - URLFactory: func(d *schema.ResourceData, c *client.Client) string { - return fmt.Sprintf("https://%s/v1/integrations/notifications/teams/%s", c.ControlPlane, d.Id()) - }, - }, - ), - - Schema: map[string]*schema.Schema{ - "id": { - Description: "ID of this resource in Cyral environment", - Type: schema.TypeString, - Computed: true, - }, - "name": { - Description: "Integration name that will be used internally in the control plane.", - Type: schema.TypeString, - Required: true, - }, - "url": { - Description: "Microsoft Teams webhook URL.", - Type: schema.TypeString, - Required: true, - Sensitive: true, - }, - }, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - } -} diff --git a/cyral/internal/integration/teams/resource_cyral_integration_teams_test.go b/cyral/internal/integration/teams/resource_test.go similarity index 100% rename from cyral/internal/integration/teams/resource_cyral_integration_teams_test.go rename to cyral/internal/integration/teams/resource_test.go diff --git a/cyral/internal/integration/teams/schema_loader.go b/cyral/internal/integration/teams/schema_loader.go new file mode 100644 index 00000000..aae8a94e --- /dev/null +++ b/cyral/internal/integration/teams/schema_loader.go @@ -0,0 +1,24 @@ +package teams + +import "github.com/cyralinc/terraform-provider-cyral/cyral/core" + +type packageSchema struct { +} + +func (p *packageSchema) Name() string { + return "Microsoft Teams Integration" +} + +func (p *packageSchema) Schemas() []*core.SchemaDescriptor { + return []*core.SchemaDescriptor{ + { + Name: "cyral_integration_microsoft_teams", + Type: core.ResourceSchemaType, + Schema: resourceSchema, + }, + } +} + +func PackageSchema() core.PackageSchema { + return &packageSchema{} +} diff --git a/cyral/internal/samlcertificate/data_source_cyral_saml_certificate.go b/cyral/internal/samlcertificate/datasource.go similarity index 80% rename from cyral/internal/samlcertificate/data_source_cyral_saml_certificate.go rename to cyral/internal/samlcertificate/datasource.go index cccdb6dd..bfea510e 100644 --- a/cyral/internal/samlcertificate/data_source_cyral_saml_certificate.go +++ b/cyral/internal/samlcertificate/datasource.go @@ -7,11 +7,10 @@ import ( "github.com/cyralinc/terraform-provider-cyral/cyral/client" "github.com/cyralinc/terraform-provider-cyral/cyral/core" "github.com/cyralinc/terraform-provider-cyral/cyral/core/types/operationtype" - "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func DataSourceSAMLCertificate() *schema.Resource { +func dataSourceSchema() *schema.Resource { return &schema.Resource{ Description: "Retrieves a X.509 certificate used for signing SAML requests." + "\n\nSee also the remaining SAML-related resources and data sources.", @@ -38,13 +37,3 @@ func DataSourceSAMLCertificate() *schema.Resource { }, } } - -type SAMLCertificateData struct { - Certificate string `json:"certificate,omitempty"` -} - -func (data SAMLCertificateData) WriteToSchema(d *schema.ResourceData) error { - d.SetId(uuid.New().String()) - d.Set("certificate", data.Certificate) - return nil -} diff --git a/cyral/internal/samlcertificate/data_source_cyral_saml_certificate_test.go b/cyral/internal/samlcertificate/datasource_test.go similarity index 100% rename from cyral/internal/samlcertificate/data_source_cyral_saml_certificate_test.go rename to cyral/internal/samlcertificate/datasource_test.go diff --git a/cyral/internal/samlcertificate/model.go b/cyral/internal/samlcertificate/model.go new file mode 100644 index 00000000..0c79723e --- /dev/null +++ b/cyral/internal/samlcertificate/model.go @@ -0,0 +1,16 @@ +package samlcertificate + +import ( + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +type SAMLCertificateData struct { + Certificate string `json:"certificate,omitempty"` +} + +func (data SAMLCertificateData) WriteToSchema(d *schema.ResourceData) error { + d.SetId(uuid.New().String()) + d.Set("certificate", data.Certificate) + return nil +} diff --git a/cyral/internal/samlcertificate/schema_loader.go b/cyral/internal/samlcertificate/schema_loader.go new file mode 100644 index 00000000..34c6ceea --- /dev/null +++ b/cyral/internal/samlcertificate/schema_loader.go @@ -0,0 +1,24 @@ +package samlcertificate + +import "github.com/cyralinc/terraform-provider-cyral/cyral/core" + +type packageSchema struct { +} + +func (p *packageSchema) Name() string { + return "SAML Certificate" +} + +func (p *packageSchema) Schemas() []*core.SchemaDescriptor { + return []*core.SchemaDescriptor{ + { + Name: "cyral_saml_certificate", + Type: core.DataSourceSchemaType, + Schema: dataSourceSchema, + }, + } +} + +func PackageSchema() core.PackageSchema { + return &packageSchema{} +} diff --git a/cyral/provider/provider.go b/cyral/provider/provider.go index 01910861..0a7dbcd0 100644 --- a/cyral/provider/provider.go +++ b/cyral/provider/provider.go @@ -17,8 +17,6 @@ import ( "github.com/cyralinc/terraform-provider-cyral/cyral/internal/integration/confextension/pagerduty" "github.com/cyralinc/terraform-provider-cyral/cyral/internal/integration/idpsaml" "github.com/cyralinc/terraform-provider-cyral/cyral/internal/integration/logging" - "github.com/cyralinc/terraform-provider-cyral/cyral/internal/integration/slack" - "github.com/cyralinc/terraform-provider-cyral/cyral/internal/integration/teams" "github.com/cyralinc/terraform-provider-cyral/cyral/internal/permission" "github.com/cyralinc/terraform-provider-cyral/cyral/internal/policy" "github.com/cyralinc/terraform-provider-cyral/cyral/internal/policy/rule" @@ -31,7 +29,6 @@ import ( "github.com/cyralinc/terraform-provider-cyral/cyral/internal/repository/confauth" "github.com/cyralinc/terraform-provider-cyral/cyral/internal/repository/network" "github.com/cyralinc/terraform-provider-cyral/cyral/internal/role" - "github.com/cyralinc/terraform-provider-cyral/cyral/internal/samlcertificate" "github.com/cyralinc/terraform-provider-cyral/cyral/internal/samlconfiguration" "github.com/cyralinc/terraform-provider-cyral/cyral/internal/serviceaccount" "github.com/cyralinc/terraform-provider-cyral/cyral/internal/sidecar" @@ -117,7 +114,6 @@ func getDataSourceMap(ps []core.PackageSchema) map[string]*schema.Resource { schemaMap["cyral_permission"] = permission.DataSourcePermission() schemaMap["cyral_repository"] = repository.DataSourceRepository() schemaMap["cyral_role"] = role.DataSourceRole() - schemaMap["cyral_saml_certificate"] = samlcertificate.DataSourceSAMLCertificate() schemaMap["cyral_saml_configuration"] = samlconfiguration.DataSourceSAMLConfiguration() schemaMap["cyral_sidecar_bound_ports"] = sidecar.DataSourceSidecarBoundPorts() schemaMap["cyral_sidecar_cft_template"] = deprecated.DataSourceSidecarCftTemplate() @@ -157,9 +153,7 @@ func getResourceMap(ps []core.PackageSchema) map[string]*schema.Resource { schemaMap["cyral_integration_elk"] = deprecated.ResourceIntegrationELK() schemaMap["cyral_integration_logstash"] = deprecated.ResourceIntegrationLogstash() schemaMap["cyral_integration_looker"] = deprecated.ResourceIntegrationLooker() - schemaMap["cyral_integration_microsoft_teams"] = teams.ResourceIntegrationMsTeams() schemaMap["cyral_integration_pager_duty"] = pagerduty.ResourceIntegrationPagerDuty() - schemaMap["cyral_integration_slack_alerts"] = slack.ResourceIntegrationSlackAlerts() schemaMap["cyral_integration_splunk"] = deprecated.ResourceIntegrationSplunk() schemaMap["cyral_integration_idp_aad"] = deprecated.ResourceIntegrationIdP("aad", idpDeprecationMessage) schemaMap["cyral_integration_idp_adfs"] = deprecated.ResourceIntegrationIdP("adfs-2016", idpDeprecationMessage) diff --git a/cyral/provider/schema_loader.go b/cyral/provider/schema_loader.go index 469e9f61..cbca9156 100644 --- a/cyral/provider/schema_loader.go +++ b/cyral/provider/schema_loader.go @@ -4,8 +4,11 @@ import ( "github.com/cyralinc/terraform-provider-cyral/cyral/core" "github.com/cyralinc/terraform-provider-cyral/cyral/internal/datalabel" "github.com/cyralinc/terraform-provider-cyral/cyral/internal/integration/hcvault" + "github.com/cyralinc/terraform-provider-cyral/cyral/internal/integration/slack" + "github.com/cyralinc/terraform-provider-cyral/cyral/internal/integration/teams" "github.com/cyralinc/terraform-provider-cyral/cyral/internal/repository/datamap" "github.com/cyralinc/terraform-provider-cyral/cyral/internal/repository/useraccount" + "github.com/cyralinc/terraform-provider-cyral/cyral/internal/samlcertificate" ) func packagesSchemas() []core.PackageSchema { @@ -13,6 +16,9 @@ func packagesSchemas() []core.PackageSchema { datalabel.PackageSchema(), datamap.PackageSchema(), hcvault.PackageSchema(), + samlcertificate.PackageSchema(), + slack.PackageSchema(), + teams.PackageSchema(), useraccount.PackageSchema(), } return v