Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Recreate notification integration when type changes #792

Merged
merged 2 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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