From 9be038c04983d6940b1299283fd376a9c34f26c1 Mon Sep 17 00:00:00 2001 From: Mike Gouline <1960272+gouline@users.noreply.github.com> Date: Mon, 20 Dec 2021 10:30:25 +1100 Subject: [PATCH 1/2] Recreate notification integration when type changes --- pkg/resources/notification_integration.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/resources/notification_integration.go b/pkg/resources/notification_integration.go index 978738e0bc..41ec2bcfbd 100644 --- a/pkg/resources/notification_integration.go +++ b/pkg/resources/notification_integration.go @@ -29,12 +29,14 @@ var notificationIntegrationSchema = map[string]*schema.Schema{ Default: "QUEUE", ValidateFunc: validation.StringInSlice([]string{"QUEUE"}, true), Description: "A type of integration", + ForceNew: true, }, "direction": &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateFunc: validation.StringInSlice([]string{"INBOUND", "OUTBOUND"}, true), Description: "Direction of the cloud messaging with respect to Snowflake (required only for error notifications)", + ForceNew: true, }, // This part of the schema is the cloudProviderParams in the Snowflake documentation and differs between vendors "notification_provider": &schema.Schema{ @@ -42,6 +44,7 @@ var notificationIntegrationSchema = map[string]*schema.Schema{ Optional: true, ValidateFunc: validation.StringInSlice([]string{"AZURE_STORAGE_QUEUE", "AWS_SQS", "AWS_SNS", "GCP_PUBSUB"}, true), Description: "The third-party cloud message queuing service (e.g. AZURE_STORAGE_QUEUE, AWS_SQS, AWS_SNS)", + ForceNew: true, }, "azure_storage_queue_primary_uri": &schema.Schema{ Type: schema.TypeString, @@ -94,9 +97,9 @@ var notificationIntegrationSchema = map[string]*schema.Schema{ Description: "AWS IAM role ARN for notification integration to assume", }, "comment": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "A comment for the integration", + Type: schema.TypeString, + Optional: true, + Description: "A comment for the integration", }, "created_on": &schema.Schema{ Type: schema.TypeString, From 416c488e77312702428a9caa18bfcff3cbe0e102 Mon Sep 17 00:00:00 2001 From: Mike Gouline <1960272+gouline@users.noreply.github.com> Date: Tue, 21 Dec 2021 10:08:01 +1100 Subject: [PATCH 2/2] make docs --- docs/resources/notification_integration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/notification_integration.md b/docs/resources/notification_integration.md index 6cc3e462c6..180b886341 100644 --- a/docs/resources/notification_integration.md +++ b/docs/resources/notification_integration.md @@ -53,7 +53,7 @@ resource snowflake_notification_integration integration { - **aws_sqs_role_arn** (String) AWS IAM role ARN for notification integration to assume - **azure_storage_queue_primary_uri** (String) The queue ID for the Azure Queue Storage queue created for Event Grid notifications - **azure_tenant_id** (String) The ID of the Azure Active Directory tenant used for identity management -- **comment** (String) +- **comment** (String) A comment for the integration - **direction** (String) Direction of the cloud messaging with respect to Snowflake (required only for error notifications) - **enabled** (Boolean) - **gcp_pubsub_subscription_name** (String) The subscription id that Snowflake will listen to when using the GCP_PUBSUB provider.