Skip to content

Commit

Permalink
fix: Recreate notification integration when type changes (#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
gouline committed Dec 21, 2021
1 parent 6884748 commit e9768bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/resources/notification_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 6 additions & 3 deletions pkg/resources/notification_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,22 @@ 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{
Type: schema.TypeString,
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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e9768bf

Please sign in to comment.