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

[FEAT]: Notification & API Integrations #190

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
11 changes: 10 additions & 1 deletion docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,33 @@
## Resources

* [APIAuthenticationSecurityIntegration](resources/api_authentication_security_integration.md)
* [APIIntegration](resources/api_integration.md)
* [AWSAPIIntegration](resources/awsapi_integration.md)
* [AWSOutboundNotificationIntegration](resources/aws_outbound_notification_integration.md)
* [AccountParameter](resources/account_parameter.md)
* [AggregationPolicy](resources/aggregation_policy.md)
* [Alert](resources/alert.md)
* [AuthenticationPolicy](resources/authentication_policy.md)
* [AzureAPIIntegration](resources/azure_api_integration.md)
* [AzureInboundNotificationIntegration](resources/azure_inbound_notification_integration.md)
* [AzureOutboundNotificationIntegration](resources/azure_outbound_notification_integration.md)
* [AzureStorageIntegration](resources/azure_storage_integration.md)
* [ComputePool](resources/compute_pool.md)
* [Database](resources/database.md)
* [DatabaseRole](resources/database_role.md)
* [DatabaseRoleGrant](resources/database_role_grant.md)
* [DynamicTable](resources/dynamic_table.md)
* [EmailNotificationIntegration](resources/email_notification_integration.md)
* [EventTable](resources/event_table.md)
* [ExternalAccessIntegration](resources/external_access_integration.md)
* [ExternalStage](resources/external_stage.md)
* [FailoverGroup](resources/failover_group.md)
* [FutureGrant](resources/future_grant.md)
* [GCPAPIIntegration](resources/gcpapi_integration.md)
* [GCPInboundNotificationIntegration](resources/gcp_inbound_notification_integration.md)
* [GCPOutboundNotificationIntegration](resources/gcp_outbound_notification_integration.md)
* [GCSStorageIntegration](resources/gcs_storage_integration.md)
* [GenericSecret](resources/generic_secret.md)
* [GitAPIIntegration](resources/git_api_integration.md)
* [GlueCatalogIntegration](resources/glue_catalog_integration.md)
* [Grant](resources/grant.md)
* [GrantOnAll](resources/grant_on_all.md)
Expand Down
59 changes: 59 additions & 0 deletions docs/resources/aws_outbound_notification_integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
description: >-

---

# AWSOutboundNotificationIntegration

[Snowflake Documentation](https://docs.snowflake.com/en/sql-reference/sql/create-notification-integration)

Manages the configuration for AWS SNS notification integrations within Snowflake. This integration
allows specifying an AWS SNS topic that will receive a notification.


## Examples

### Python

```python
sns_notification_integration = NotificationIntegration(
name="some_sns_notification_integration",
type="queue",
notification_provider="aws_sns",
enabled=True,
direction="outbound"
aws_sns_topic_arn="arn:aws:sns:<region>:<account>:<sns_topic_name>",
aws_sns_role_arn="arn:aws:iam::<account>:role/<iam_role_name>",
comment="Example email notification integration"
)
```


### YAML

```yaml
notification_integrations:
- name: some_sns_notification_integration
type: QUEUE
notification_provider: AWS_SNS
enabled: true
direction: OUTBOUND
aws_sns_topic_arn: arn:aws:sns:<region>:<account>:<sns_topic_name>
aws_sns_role_arn: arn:aws:iam::<account>:role/<iam_role_name>
comment: Example sns notification integration
```


## Fields

* `name` (string, required) - The name of the AWS SNS notification integration.
* `type` (string, required) - Specifies that this is a notification integration between Snowflake and a 3rd party cloud message-queuing service.
* `notification_provider` (string, required) - Specifies AWS SNS as the 3rd party cloud message-queuing service.
* `enabled` (bool, required) - Specifies whether the notification integration is enabled.
* `direction` (string, required) - The direction of the notification integration ("OUTBOUND").
* `aws_sns_topic_arn` (string, required) - The ARN of the SNS topic that notifications will be sent to.
* `aws_sns_role_arn` (string, required) - The ARN of the IAM role that has permissions to push messages to the SNS topic.
* `comment` (string) - An optional comment about the notification integration.
* `owner` (string or [Role](role.md)) - The owner role of the notification integration. Defaults to "ACCOUNTADMIN".


Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: >-

---

# APIIntegration
# AWSAPIIntegration

[Snowflake Documentation](https://docs.snowflake.com/en/sql-reference/sql/create-api-integration)

Expand Down
54 changes: 54 additions & 0 deletions docs/resources/azure_api_integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
description: >-

---

# AzureAPIIntegration

[Snowflake Documentation](https://docs.snowflake.com/en/sql-reference/sql/create-api-integration)

Manages API integrations in Snowflake, allowing external services to interact with Snowflake resources securely.
This class supports creating, replacing, and checking the existence of API integrations with various configurations.


## Examples

### Python

```python
api_integration = APIIntegration(
name="some_api_integration",
api_provider="GOOGLE_API_GATEWAU",
google_audience="<google_audience>",
enabled=True,
api_allowed_prefixes=["https://some_url.com"],
comment="Example GCP API integration"
)
```


### YAML

```yaml
api_integrations:
- name: some_api_integration
api_provider: GOOGLE_API_GATEWAY
google_audience: <google_audience>
enabled: true
api_allowed_prefixes:
- https://some_url.com
comment: "Example GCP API integration"
```


## Fields

* `name` (string, required) - The unique name of the API integration.
* `api_provider` (string or [ApiProvider](api_provider.md), required) - The provider of the API service.
* `google_audience` (string, required) - The audience claim when generating the JWT to authenticate with the Google API Gateway.
* `api_allowed_prefixes` (list, required) - The list of allowed prefixes for the API endpoints.
* `api_blocked_prefixes` (list) - The list of blocked prefixes for the API endpoints.
* `enabled` (bool, required) - Specifies if the API integration is enabled. Defaults to TRUE.
* `comment` (string) - A comment or description for the API integration.


56 changes: 56 additions & 0 deletions docs/resources/azure_inbound_notification_integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
description: >-

---

# AzureInboundNotificationIntegration

[Snowflake Documentation](https://docs.snowflake.com/en/sql-reference/sql/create-notification-integration)

Manages the configuration for Azure Event Grid notification integrations within Snowflake. This integration
allows specifying an Azure Event Grid topic that will publish a notification to Snowflake.


## Examples

### Python

```python
event_grid_notification_integration = NotificationIntegration(
name="some_event_grid_notification_integration",
type="queue",
notification_provider="azure_event_grid",
enabled=True,
azure_storage_queue_primary_uri="https://<storage_queue_account>.queue.core.windows.net/<storage_queue_name>",
azure_tenant_id="<ad_directory_id>",
comment="Example inbound event grid notification integration"
)
```


### YAML

```yaml
notification_integrations:
- name: some_event_grid_notification_integration
type: QUEUE
notification_provider: AZURE_EVENT_GRID
enabled: true
azure_storage_queue_primary_uri: https://<storage_queue_account>.queue.core.windows.net/<storage_queue_name>
azure_tenant_id: <ad_directory_id>
comment: Example inbound event grid notification integration
```


## Fields

* `name` (string, required) - The name of the notification integration.
* `type` (string, required) - Specifies that this is a notification integration between Snowflake and a 3rd party cloud message-queuing service.
* `notification_provider` (string, required) - Specifies Azure Event Grid as the 3rd party cloud message-queuing service.
* `enabled` (bool, required) - Specifies whether the notification integration is enabled.
* `azure_storage_queue_primary_uri` (string, required) - The URL for the Azure Queue Storage queue create for Event Grid notifications.
* `azure_tenant_id` (string, required) - The ID of the Azure AD tenant used for identity management.
* `comment` (string) - An optional comment about the notification integration.
* `owner` (string or [Role](role.md)) - The owner role of the notification integration. Defaults to "ACCOUNTADMIN".


59 changes: 59 additions & 0 deletions docs/resources/azure_outbound_notification_integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
description: >-

---

# AzureOutboundNotificationIntegration

[Snowflake Documentation](https://docs.snowflake.com/en/sql-reference/sql/create-notification-integration)

Manages the configuration for Azure Event Grid notification integrations within Snowflake. This integration
allows specifying an Azure Event Grid topic that will receive a notification.


## Examples

### Python

```python
event_grid_notification_integration = NotificationIntegration(
name="some_event_grid_notification_integration",
type="queue",
notification_provider="azure_event_grid",
enabled=True,
direction="outbound"
azure_event_grid_topic_endpoint="<event_grid_topic_endpoint>",
azure_tenant_id="<ad_directory_id>",
comment="Example outbound event grid notification integration"
)
```


### YAML

```yaml
notification_integrations:
- name: some_event_grid_notification_integration
type: QUEUE
notification_provider: AZURE_EVENT_GRID
enabled: true
direction: OUTBOUND
azure_event_grid_topic_endpoint: <event_grid_topic_endpoint>
azure_tenant_id: <ad_directory_id>
comment: Example outbound event grid notification integration
```


## Fields

* `name` (string, required) - The name of the notification integration.
* `type` (string, required) - Specifies that this is a notification integration between Snowflake and a 3rd party cloud message-queuing service.
* `notification_provider` (string, required) - Specifies Azure Event Grid as the 3rd party cloud message-queuing service.
* `enabled` (bool, required) - Specifies whether the notification integration is enabled.
* `direction` (string, required) - The direction of the notification integration ("OUTBOUND").
* `azure_event_grid_topic_endpoint` (string, required) - The endpoint of the Event Grid topic that notifications will be sent to.
* `azure_tenant_id` (string, required) - The ID of the Azure AD tenant used for identity management.
* `comment` (string) - An optional comment about the notification integration.
* `owner` (string or [Role](role.md)) - The owner role of the notification integration. Defaults to "ACCOUNTADMIN".


2 changes: 1 addition & 1 deletion docs/resources/compute_pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ compute_pools:
* `owner` (string or [Role](role.md)) - The owner of the compute pool. Defaults to "ACCOUNTADMIN".
* `min_nodes` (int) - The minimum number of nodes in the compute pool.
* `max_nodes` (int) - The maximum number of nodes in the compute pool.
* `instance_family` (string or [InstanceFamily](instance_family.md)) - The family of instances to use for the compute nodes.
* `instance_family` (string) - The family of instances to use for the compute nodes.
* `auto_resume` (bool) - Whether the compute pool should automatically resume when queries are submitted. Defaults to True.
* `initially_suspended` (bool) - Whether the compute pool should start in a suspended state.
* `auto_suspend_secs` (int) - The number of seconds of inactivity after which the compute pool should automatically suspend. Defaults to 3600.
Expand Down
44 changes: 44 additions & 0 deletions docs/resources/database_role_grant.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
description: >-

---

# DatabaseRoleGrant

[Snowflake Documentation](https://docs.snowflake.com/en/sql-reference/sql/grant-database-role)

Represents a grant of a database role to another role or database role in Snowflake.


## Examples

### Python

```python
# Grant to Database Role:
role_grant = DatabaseRoleGrant(database_role="somedb.somerole", to_database_role="somedb.someotherrole")
role_grant = DatabaseRoleGrant(database_role="somedb.somerole", to=DatabaseRole(database="somedb", name="someotherrole"))
# Grant to Role:
role_grant = DatabaseRoleGrant(database_role="somedb.somerole", to_role="somerole")
role_grant = DatabaseRoleGrant(database_role="somedb.somerole", to=Role(name="somerole"))
```


### YAML

```yaml
database_role_grants:
- database_role: somedb.somerole
to_database_role: somedb.someotherrole
- database_role: somedb.somerole
to_role: somerole
```


## Fields

* `database_role` (string or [Role](role.md), required) - The database role to be granted.
* `to_role` (string or [Role](role.md)) - The role to which the database role is granted.
* `to_database_role` (string or [User](user.md)) - The database role to which the database role is granted.


7 changes: 5 additions & 2 deletions docs/resources/email_notification_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ allows specifying recipients who will receive notifications via email.
### Python

```python
email_notification_integration = EmailNotificationIntegration(
email_notification_integration = NotificationIntegration(
name="some_email_notification_integration",
type="email",
enabled=True,
allowed_recipients=["[email protected]", "[email protected]"],
comment="Example email notification integration"
Expand All @@ -28,8 +29,9 @@ email_notification_integration = EmailNotificationIntegration(
### YAML

```yaml
email_notification_integrations:
notification_integrations:
- name: some_email_notification_integration
type: EMAIL
enabled: true
allowed_recipients:
- [email protected]
Expand All @@ -41,6 +43,7 @@ email_notification_integrations:
## Fields
* `name` (string, required) - The name of the email notification integration.
* `type` (string, required) - Specifies that this is an email notification integration.
* `enabled` (bool, required) - Specifies whether the notification integration is enabled.
* `allowed_recipients` (list) - A list of email addresses that are allowed to receive notifications.
* `comment` (string) - An optional comment about the notification integration.
Expand Down
Loading
Loading