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: Secret resource #3110

Merged
merged 73 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
58d5794
initial secret_def file for sdk
sfc-gh-fbudzynski Sep 12, 2024
f1488ca
naming changes to secret create options
sfc-gh-fbudzynski Sep 12, 2024
752f924
create secrets and alter with two basic tests
sfc-gh-fbudzynski Sep 13, 2024
d7ae12f
unit tests for alter
sfc-gh-fbudzynski Sep 13, 2024
57ca19a
add tests for all four create types
sfc-gh-fbudzynski Sep 13, 2024
8d55a63
rename previous secret to secretReference in common_types.go due to n…
sfc-gh-fbudzynski Sep 16, 2024
9894799
secrets gen with drop, show and desc
sfc-gh-fbudzynski Sep 16, 2024
e4a0827
all unit tests
sfc-gh-fbudzynski Sep 16, 2024
3bb8c85
init for integration tests
sfc-gh-fbudzynski Sep 16, 2024
4130618
added secret to client.go and created secret_client
sfc-gh-fbudzynski Sep 17, 2024
fc85c66
added like and in to showByID for secret
sfc-gh-fbudzynski Sep 17, 2024
aa64511
init for integration tests
sfc-gh-fbudzynski Sep 17, 2024
ab8bee1
secret_def changes
sfc-gh-fbudzynski Sep 17, 2024
3541c70
tests for two methods of creating secret
sfc-gh-fbudzynski Sep 17, 2024
180a7ce
changed refresh token expiry time from string to time.Time
sfc-gh-fbudzynski Sep 18, 2024
7a9ad92
added remaining integration tests
sfc-gh-fbudzynski Sep 19, 2024
0e9cf94
linter
sfc-gh-fbudzynski Sep 19, 2024
deadc65
linting
sfc-gh-fbudzynski Sep 19, 2024
235fbe5
removing comment
sfc-gh-fbudzynski Sep 19, 2024
73eeb63
mid review commit before generating assertions
sfc-gh-fbudzynski Sep 20, 2024
bd0b64f
rebase conflict resolved
sfc-gh-fbudzynski Sep 23, 2024
2050b85
tests pass after changing to []string for oauthScopes
sfc-gh-fbudzynski Sep 23, 2024
59c7b14
readded unit tests
sfc-gh-fbudzynski Sep 23, 2024
df7a8ff
added CreateApiAuthenticationWithRequest to security integration client
sfc-gh-fbudzynski Sep 24, 2024
eed310a
changes to secret after review, all tests pass
sfc-gh-fbudzynski Sep 24, 2024
af2e030
added assert for details
sfc-gh-fbudzynski Sep 24, 2024
4ccc4e7
linter hints applied
sfc-gh-fbudzynski Sep 24, 2024
34983af
updated generator README with validation issue for ConflictingFields …
sfc-gh-fbudzynski Sep 24, 2024
bdf2585
updated after re-review
sfc-gh-fbudzynski Sep 24, 2024
7791f33
test changed to use errMoreThanOneOf
sfc-gh-fbudzynski Sep 25, 2024
1f1fb2b
init commit for secret resource
sfc-gh-fbudzynski Sep 26, 2024
366313f
adding secret common to avoid duplication
sfc-gh-fbudzynski Sep 26, 2024
a383ac4
acc tests pass with usage of secret_common
sfc-gh-fbudzynski Sep 26, 2024
40179ec
Secret with authorization code acceptance test, diff suppress
sfc-gh-fbudzynski Sep 27, 2024
04d3feb
helper function for snowflake datetime for secret
sfc-gh-fbudzynski Sep 27, 2024
fa408fd
check destroy and few cleanups
sfc-gh-fbudzynski Sep 27, 2024
d3e54db
Wrapped OAuth Scopes in separate queryStructField to allow empty list…
sfc-gh-fbudzynski Sep 30, 2024
0e18136
Linter adjustments
sfc-gh-fbudzynski Sep 30, 2024
f60985c
init commit for secret resource
sfc-gh-fbudzynski Sep 26, 2024
8348809
adding secret common to avoid duplication
sfc-gh-fbudzynski Sep 26, 2024
4753096
acc tests pass with usage of secret_common
sfc-gh-fbudzynski Sep 26, 2024
46e2181
Secret with authorization code acceptance test, diff suppress
sfc-gh-fbudzynski Sep 27, 2024
c3f3ea7
helper function for snowflake datetime for secret
sfc-gh-fbudzynski Sep 27, 2024
91269d6
check destroy and few cleanups
sfc-gh-fbudzynski Sep 27, 2024
b91b97c
adding secret with basic authentication flow
sfc-gh-fbudzynski Sep 30, 2024
8de6e84
checking secret with optional oauth_scopes
sfc-gh-fbudzynski Sep 30, 2024
c64a1ed
secret basic authentication flow acceptance tests and fix for parsing…
sfc-gh-fbudzynski Oct 1, 2024
ccdf9f8
Merge remote-tracking branch 'origin/secret-resource' into secret-res…
sfc-gh-fbudzynski Oct 1, 2024
fde6908
removed unwanted duplicats after merge
sfc-gh-fbudzynski Oct 1, 2024
a147b99
All secret flows with acceptance tests and change to handle different…
sfc-gh-fbudzynski Oct 2, 2024
356d98c
linter pre-push changes
sfc-gh-fbudzynski Oct 2, 2024
83ccafc
generated documentation for each secret flow
sfc-gh-fbudzynski Oct 2, 2024
07dc9e2
Merge branch 'main' into secret-resource
sfc-gh-fbudzynski Oct 2, 2024
de99b68
delete unused _ext assert
sfc-gh-fbudzynski Oct 3, 2024
5c6d9ee
self-review cleanup
sfc-gh-fbudzynski Oct 3, 2024
805c61e
docs regenerate
sfc-gh-fbudzynski Oct 3, 2024
044c484
example resource naming fix for secret with generic_string
sfc-gh-fbudzynski Oct 3, 2024
bc43a72
docs fixes
sfc-gh-fbudzynski Oct 3, 2024
4ae36a4
make docs-check error fix
sfc-gh-fbudzynski Oct 3, 2024
4ac851a
Merge branch 'main' into secret-resource
sfc-gh-fbudzynski Oct 4, 2024
ac37669
Merge branch 'main' into secret-resource
sfc-gh-fbudzynski Oct 7, 2024
f3cd4b1
Jakub comments resolved
sfc-gh-fbudzynski Oct 8, 2024
e098f69
comments resolved
sfc-gh-fbudzynski Oct 9, 2024
39f3cdd
Merge branch 'main' into secret-resource
sfc-gh-fbudzynski Oct 9, 2024
d5b6db0
added tests to check for external changes to refresh_token_expiry_tim…
sfc-gh-fbudzynski Oct 9, 2024
e304793
resolved to Arturs comments
sfc-gh-fbudzynski Oct 10, 2024
c1115fa
linter suggestions
sfc-gh-fbudzynski Oct 10, 2024
9dea35c
Merge branch 'main' into secret-resource
sfc-gh-fbudzynski Oct 10, 2024
bdb7fff
refactor after Kuba re-review comments
sfc-gh-fbudzynski Oct 11, 2024
dba8478
changes not to abuse pointer on models
sfc-gh-fbudzynski Oct 14, 2024
40ecd49
linter adjustments
sfc-gh-fbudzynski Oct 14, 2024
1a9a6db
changed username to sensitive, adjusted docs and migration guide to p…
sfc-gh-fbudzynski Oct 14, 2024
b202fdd
Merge branch 'main' into secret-resource
sfc-gh-fbudzynski Oct 15, 2024
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
93 changes: 93 additions & 0 deletions docs/resources/secret_with_authorization_code_grant.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
page_title: "snowflake_secret_with_authorization_code_grant Resource - terraform-provider-snowflake"
subcategory: ""
description: |-
Secret with OAuth authorization code grant where Secrets Type attribute is set to OAUTH2.
---

sfc-gh-jcieslak marked this conversation as resolved.
Show resolved Hide resolved
# snowflake_secret_with_authorization_code_grant (Resource)

Secret with OAuth authorization code grant where Secrets Type attribute is set to OAUTH2.

## Example Usage

```terraform
# basic resource
resource "snowflake_secret_with_authorization_code_grant" "test" {
name = "EXAMPLE_SECRET"
database = "EXAMPLE_DB"
schema = "EXAMPLE_SCHEMA"
api_authentication = "EXAMPLE_SECURITY_INTEGRATION_NAME"
oauth_refresh_token = "EXAMPLE_TOKEN"
oauth_refresh_token_expiry_time = "2025-01-02 15:04:01"
comment = "EXAMPLE_COMMENT"
}
```

-> **Note** Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult [identifiers guide](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/guides/identifiers#new-computed-fully-qualified-name-field-in-resources).
<!-- TODO(SNOW-1634854): include an example showing both methods-->

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `api_authentication` (String) Specifies the name value of the Snowflake security integration that connects Snowflake to an external service when setting Type to OAUTH2.
- `database` (String) The database in which to create the secret Due to technical limitations (read more [here](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/identifiers_rework_design_decisions.md#known-limitations-and-identifier-recommendations)), avoid using the following characters: `|`, `.`, `(`, `)`, `"`
- `name` (String) String that specifies the identifier (i.e. name) for the secret, must be unique in your schema. Due to technical limitations (read more [here](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/identifiers_rework_design_decisions.md#known-limitations-and-identifier-recommendations)), avoid using the following characters: `|`, `.`, `(`, `)`, `"`
- `oauth_refresh_token` (String) Specifies the token as a string that is used to obtain a new access token from the OAuth authorization server when the access token expires.
- `oauth_refresh_token_expiry_time` (String) Specifies the timestamp as a string when the OAuth refresh token expires. Accepted string formats: YYYY-MM-DD, YYYY-MM-DD HH:MI, YYYY-MM-DD HH:MI:SS, YYYY-MM-DD HH:MI <timezone>
- `schema` (String) The schema in which to create the secret. Due to technical limitations (read more [here](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/identifiers_rework_design_decisions.md#known-limitations-and-identifier-recommendations)), avoid using the following characters: `|`, `.`, `(`, `)`, `"`

### Optional

- `comment` (String) Specifies a comment for the secret.

### Read-Only

- `describe_output` (List of Object) Outputs the result of `DESCRIBE SECRET` for the given secret. (see [below for nested schema](#nestedatt--describe_output))
- `fully_qualified_name` (String) Fully qualified name of the resource. For more information, see [object name resolution](https://docs.snowflake.com/en/sql-reference/name-resolution).
- `id` (String) The ID of this resource.
- `show_output` (List of Object) Outputs the result of `SHOW SECRET` for the given secret. (see [below for nested schema](#nestedatt--show_output))

<a id="nestedatt--describe_output"></a>
### Nested Schema for `describe_output`

Read-Only:

- `comment` (String)
- `created_on` (String)
- `database_name` (String)
- `integration_name` (String)
- `name` (String)
- `oauth_access_token_expiry_time` (String)
- `oauth_refresh_token_expiry_time` (String)
- `oauth_scopes` (Set of String)
- `owner` (String)
- `schema_name` (String)
- `secret_type` (String)
- `username` (String)


<a id="nestedatt--show_output"></a>
### Nested Schema for `show_output`

Read-Only:

- `comment` (String)
- `created_on` (String)
- `database_name` (String)
- `name` (String)
- `oauth_scopes` (Set of String)
- `owner` (String)
- `owner_role_type` (String)
- `schema_name` (String)
- `secret_type` (String)

## Import

Import is supported using the following syntax:

```shell
terraform import snowflake_secret_with_authorization_code_grant.example '"<database_name>"."<schema_name>"."<secret_name>"'
```
91 changes: 91 additions & 0 deletions docs/resources/secret_with_basic_authentication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
page_title: "snowflake_secret_with_basic_authentication Resource - terraform-provider-snowflake"
subcategory: ""
description: |-
Secret with Basic Authentication where Secrets Type attribute is set to PASSWORD.
---

# snowflake_secret_with_basic_authentication (Resource)

Secret with Basic Authentication where Secrets Type attribute is set to PASSWORD.

## Example Usage

```terraform
# basic resource
resource "snowflake_secret_with_basic_authentication" "test" {
name = "EXAMPLE_SECRET"
database = "EXAMPLE_DB"
schema = "EXAMPLE_SCHEMA"
username = "EXAMPLE_USERNAME"
password = "EXAMPLE_PASSWORD"
comment = "EXAMPLE_COMMENT"
}
```

-> **Note** Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult [identifiers guide](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/guides/identifiers#new-computed-fully-qualified-name-field-in-resources).
<!-- TODO(SNOW-1634854): include an example showing both methods-->

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `database` (String) The database in which to create the secret Due to technical limitations (read more [here](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/identifiers_rework_design_decisions.md#known-limitations-and-identifier-recommendations)), avoid using the following characters: `|`, `.`, `(`, `)`, `"`
- `name` (String) String that specifies the identifier (i.e. name) for the secret, must be unique in your schema. Due to technical limitations (read more [here](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/identifiers_rework_design_decisions.md#known-limitations-and-identifier-recommendations)), avoid using the following characters: `|`, `.`, `(`, `)`, `"`
- `password` (String) Specifies the password value to store in the secret when setting the TYPE value to PASSWORD.
- `schema` (String) The schema in which to create the secret. Due to technical limitations (read more [here](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/identifiers_rework_design_decisions.md#known-limitations-and-identifier-recommendations)), avoid using the following characters: `|`, `.`, `(`, `)`, `"`
- `username` (String) Specifies the username value to store in the secret when setting the TYPE value to PASSWORD.

### Optional

- `comment` (String) Specifies a comment for the secret.

### Read-Only

- `describe_output` (List of Object) Outputs the result of `DESCRIBE SECRET` for the given secret. (see [below for nested schema](#nestedatt--describe_output))
- `fully_qualified_name` (String) Fully qualified name of the resource. For more information, see [object name resolution](https://docs.snowflake.com/en/sql-reference/name-resolution).
- `id` (String) The ID of this resource.
- `show_output` (List of Object) Outputs the result of `SHOW SECRET` for the given secret. (see [below for nested schema](#nestedatt--show_output))

<a id="nestedatt--describe_output"></a>
### Nested Schema for `describe_output`

Read-Only:

- `comment` (String)
- `created_on` (String)
- `database_name` (String)
- `integration_name` (String)
- `name` (String)
- `oauth_access_token_expiry_time` (String)
- `oauth_refresh_token_expiry_time` (String)
- `oauth_scopes` (Set of String)
- `owner` (String)
- `schema_name` (String)
- `secret_type` (String)
- `username` (String)


<a id="nestedatt--show_output"></a>
### Nested Schema for `show_output`

Read-Only:

- `comment` (String)
- `created_on` (String)
- `database_name` (String)
- `name` (String)
- `oauth_scopes` (Set of String)
- `owner` (String)
- `owner_role_type` (String)
- `schema_name` (String)
- `secret_type` (String)

## Import

Import is supported using the following syntax:

```shell
terraform import snowflake_secret_with_basic_authentication.example '"<database_name>"."<schema_name>"."<secret_name>"'
```
91 changes: 91 additions & 0 deletions docs/resources/secret_with_client_credentials.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
page_title: "snowflake_secret_with_client_credentials Resource - terraform-provider-snowflake"
subcategory: ""
description: |-
Secret with OAuth Client Credentials where Secrets Type attribute is set to OAUTH2.
---

# snowflake_secret_with_client_credentials (Resource)

Secret with OAuth Client Credentials where Secrets Type attribute is set to OAUTH2.

## Example Usage

```terraform
# basic resource
resource "snowflake_secret_with_client_credentials" "test" {
name = "EXAMPLE_SECRET"
database = "EXAMPLE_DB"
schema = "EXAMPLE_SCHEMA"
api_authentication = "EXAMPLE_SECURITY_INTEGRATION_NAME"
oauth_scopes = ["useraccount", "testscope"]
comment = "EXAMPLE_COMMENT"
}
```

-> **Note** Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult [identifiers guide](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/guides/identifiers#new-computed-fully-qualified-name-field-in-resources).
<!-- TODO(SNOW-1634854): include an example showing both methods-->

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `api_authentication` (String) Specifies the name value of the Snowflake security integration that connects Snowflake to an external service when setting Type to OAUTH2.
- `database` (String) The database in which to create the secret Due to technical limitations (read more [here](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/identifiers_rework_design_decisions.md#known-limitations-and-identifier-recommendations)), avoid using the following characters: `|`, `.`, `(`, `)`, `"`
- `name` (String) String that specifies the identifier (i.e. name) for the secret, must be unique in your schema. Due to technical limitations (read more [here](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/identifiers_rework_design_decisions.md#known-limitations-and-identifier-recommendations)), avoid using the following characters: `|`, `.`, `(`, `)`, `"`
- `oauth_scopes` (Set of String) Specifies a list of scopes to use when making a request from the OAuth server by a role with USAGE on the integration during the OAuth client credentials flow.
- `schema` (String) The schema in which to create the secret. Due to technical limitations (read more [here](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/identifiers_rework_design_decisions.md#known-limitations-and-identifier-recommendations)), avoid using the following characters: `|`, `.`, `(`, `)`, `"`

### Optional

- `comment` (String) Specifies a comment for the secret.

### Read-Only

- `describe_output` (List of Object) Outputs the result of `DESCRIBE SECRET` for the given secret. (see [below for nested schema](#nestedatt--describe_output))
- `fully_qualified_name` (String) Fully qualified name of the resource. For more information, see [object name resolution](https://docs.snowflake.com/en/sql-reference/name-resolution).
- `id` (String) The ID of this resource.
- `show_output` (List of Object) Outputs the result of `SHOW SECRET` for the given secret. (see [below for nested schema](#nestedatt--show_output))

<a id="nestedatt--describe_output"></a>
### Nested Schema for `describe_output`

Read-Only:

- `comment` (String)
- `created_on` (String)
- `database_name` (String)
- `integration_name` (String)
- `name` (String)
- `oauth_access_token_expiry_time` (String)
- `oauth_refresh_token_expiry_time` (String)
- `oauth_scopes` (Set of String)
- `owner` (String)
- `schema_name` (String)
- `secret_type` (String)
- `username` (String)


<a id="nestedatt--show_output"></a>
### Nested Schema for `show_output`

Read-Only:

- `comment` (String)
- `created_on` (String)
- `database_name` (String)
- `name` (String)
- `oauth_scopes` (Set of String)
- `owner` (String)
- `owner_role_type` (String)
- `schema_name` (String)
- `secret_type` (String)

## Import

Import is supported using the following syntax:

```shell
terraform import snowflake_secret_with_client_credentials.example '"<database_name>"."<schema_name>"."<secret_name>"'
```
89 changes: 89 additions & 0 deletions docs/resources/secret_with_generic_string.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
page_title: "snowflake_secret_with_generic_string Resource - terraform-provider-snowflake"
subcategory: ""
description: |-
Secret with Generic string where Secrets Type attribute is set to GENERIC_STRING.
---

# snowflake_secret_with_generic_string (Resource)

Secret with Generic string where Secrets Type attribute is set to GENERIC_STRING.

## Example Usage

```terraform
# basic resource
resource "snowflake_secret_with_generic_string" "test" {
name = "EXAMPLE_SECRET"
database = "EXAMPLE_DB"
schema = "EXAMPLE_SCHEMA"
secret_string = "EXAMPLE_SECRET_STRING"
comment = "EXAMPLE_COMMENT"
}
```

-> **Note** Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult [identifiers guide](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/guides/identifiers#new-computed-fully-qualified-name-field-in-resources).
<!-- TODO(SNOW-1634854): include an example showing both methods-->

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `database` (String) The database in which to create the secret Due to technical limitations (read more [here](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/identifiers_rework_design_decisions.md#known-limitations-and-identifier-recommendations)), avoid using the following characters: `|`, `.`, `(`, `)`, `"`
- `name` (String) String that specifies the identifier (i.e. name) for the secret, must be unique in your schema. Due to technical limitations (read more [here](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/identifiers_rework_design_decisions.md#known-limitations-and-identifier-recommendations)), avoid using the following characters: `|`, `.`, `(`, `)`, `"`
- `schema` (String) The schema in which to create the secret. Due to technical limitations (read more [here](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/identifiers_rework_design_decisions.md#known-limitations-and-identifier-recommendations)), avoid using the following characters: `|`, `.`, `(`, `)`, `"`
- `secret_string` (String) Specifies the string to store in the secret. The string can be an API token or a string of sensitive value that can be used in the handler code of a UDF or stored procedure. For details, see [Creating and using an external access integration](https://docs.snowflake.com/en/developer-guide/external-network-access/creating-using-external-network-access). You should not use this property to store any kind of OAuth token; use one of the other secret types for your OAuth use cases.

### Optional

- `comment` (String) Specifies a comment for the secret.

### Read-Only

- `describe_output` (List of Object) Outputs the result of `DESCRIBE SECRET` for the given secret. (see [below for nested schema](#nestedatt--describe_output))
- `fully_qualified_name` (String) Fully qualified name of the resource. For more information, see [object name resolution](https://docs.snowflake.com/en/sql-reference/name-resolution).
- `id` (String) The ID of this resource.
- `show_output` (List of Object) Outputs the result of `SHOW SECRET` for the given secret. (see [below for nested schema](#nestedatt--show_output))

<a id="nestedatt--describe_output"></a>
### Nested Schema for `describe_output`

Read-Only:

- `comment` (String)
- `created_on` (String)
- `database_name` (String)
- `integration_name` (String)
- `name` (String)
- `oauth_access_token_expiry_time` (String)
- `oauth_refresh_token_expiry_time` (String)
- `oauth_scopes` (Set of String)
- `owner` (String)
- `schema_name` (String)
- `secret_type` (String)
- `username` (String)


<a id="nestedatt--show_output"></a>
### Nested Schema for `show_output`

Read-Only:

- `comment` (String)
- `created_on` (String)
- `database_name` (String)
- `name` (String)
- `oauth_scopes` (Set of String)
- `owner` (String)
- `owner_role_type` (String)
- `schema_name` (String)
- `secret_type` (String)

## Import

Import is supported using the following syntax:

```shell
terraform import snowflake_secret_with_generic_string.example '"<database_name>"."<schema_name>"."<secret_name>"'
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import snowflake_secret_with_authorization_code_grant.example '"<database_name>"."<schema_name>"."<secret_name>"'
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# basic resource
sfc-gh-jcieslak marked this conversation as resolved.
Show resolved Hide resolved
resource "snowflake_secret_with_authorization_code_grant" "test" {
name = "EXAMPLE_SECRET"
database = "EXAMPLE_DB"
schema = "EXAMPLE_SCHEMA"
api_authentication = "EXAMPLE_SECURITY_INTEGRATION_NAME"
oauth_refresh_token = "EXAMPLE_TOKEN"
oauth_refresh_token_expiry_time = "2025-01-02 15:04:01"
comment = "EXAMPLE_COMMENT"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import snowflake_secret_with_basic_authentication.example '"<database_name>"."<schema_name>"."<secret_name>"'
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# basic resource
resource "snowflake_secret_with_basic_authentication" "test" {
name = "EXAMPLE_SECRET"
database = "EXAMPLE_DB"
schema = "EXAMPLE_SCHEMA"
username = "EXAMPLE_USERNAME"
password = "EXAMPLE_PASSWORD"
comment = "EXAMPLE_COMMENT"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import snowflake_secret_with_client_credentials.example '"<database_name>"."<schema_name>"."<secret_name>"'
Loading
Loading