-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: External Oauth integration v1 readiness (#2907)
<!-- Feel free to delete comments as you fill this in --> <!-- summary of changes --> Add new resources covering External Oauth security integration. Also, there are minor fixes in SDK to match actual behavior of Snowflake. ## Test Plan <!-- detail ways in which this PR has been tested or needs to be tested --> * [x] acceptance tests ## References <!-- issues documentation links, etc --> https://docs.snowflake.com/en/sql-reference/sql/create-security-integration-oauth-external --------- Co-authored-by: Jan Cieślak <jan.cieslak@snowflake.com>
- Loading branch information
1 parent
d9b557f
commit ed237c3
Showing
35 changed files
with
2,273 additions
and
593 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
examples/resources/snowflake_external_oauth_integration/import.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
terraform import snowflake_external_oauth_integration.example name | ||
terraform import snowflake_external_oauth_integration.example "name" |
52 changes: 42 additions & 10 deletions
52
examples/resources/snowflake_external_oauth_integration/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,42 @@ | ||
resource "snowflake_external_oauth_integration" "azure" { | ||
name = "AZURE_POWERBI" | ||
type = "AZURE" | ||
enabled = true | ||
issuer = "https://sts.windows.net/00000000-0000-0000-0000-000000000000" | ||
snowflake_user_mapping_attribute = "LOGIN_NAME" | ||
jws_keys_urls = ["https://login.windows.net/common/discovery/keys"] | ||
audience_urls = ["https://analysis.windows.net/powerbi/connector/Snowflake"] | ||
token_user_mapping_claims = ["upn"] | ||
} | ||
# basic resource | ||
resource "snowflake_external_oauth_integration" "test" { | ||
enabled = true | ||
external_oauth_issuer = "issuer" | ||
external_oauth_snowflake_user_mapping_attribute = "LOGIN_NAME" | ||
external_oauth_token_user_mapping_claim = ["upn"] | ||
name = "test" | ||
external_oauth_type = "CUSTOM" | ||
} | ||
# resource with all fields set (jws keys url and allowed roles) | ||
resource "snowflake_external_oauth_integration" "test" { | ||
comment = "comment" | ||
enabled = true | ||
external_oauth_allowed_roles_list = ["user1"] | ||
external_oauth_any_role_mode = "ENABLED" | ||
external_oauth_audience_list = ["https://example.com"] | ||
external_oauth_issuer = "issuer" | ||
external_oauth_jws_keys_url = ["https://example.com"] | ||
external_oauth_scope_delimiter = "," | ||
external_oauth_scope_mapping_attribute = "scope" | ||
external_oauth_snowflake_user_mapping_attribute = "LOGIN_NAME" | ||
external_oauth_token_user_mapping_claim = ["upn"] | ||
name = "test" | ||
external_oauth_type = "CUSTOM" | ||
} | ||
# resource with all fields set (rsa public keys and blocked roles) | ||
resource "snowflake_external_oauth_integration" "test" { | ||
comment = "comment" | ||
enabled = true | ||
external_oauth_any_role_mode = "ENABLED" | ||
external_oauth_audience_list = ["https://example.com"] | ||
external_oauth_blocked_roles_list = ["user1"] | ||
external_oauth_issuer = "issuer" | ||
external_oauth_rsa_public_key = file("key.pem") | ||
external_oauth_rsa_public_key_2 = file("key2.pem") | ||
external_oauth_scope_delimiter = "," | ||
external_oauth_scope_mapping_attribute = "scope" | ||
external_oauth_snowflake_user_mapping_attribute = "LOGIN_NAME" | ||
external_oauth_token_user_mapping_claim = ["upn"] | ||
name = "test" | ||
external_oauth_type = "CUSTOM" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.