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

merge jul #2

Merged
merged 51 commits into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
de07fe3
gjv9491/oauth refresh token (#495)
gjv9491 May 4, 2021
b8148a6
release version 0.25.1
alldoami May 4, 2021
6c34bd5
Similar to views we are supressing the diff if the SQL are the same. …
funes79 May 6, 2021
da8e4f1
role_grants: update read to only use grants specific to the tf resour…
cstkpk May 7, 2021
590c22e
feat: Resource to manage a user's public keys (#540)
May 12, 2021
3a81baa
release version 0.25.2
alldoami May 14, 2021
febd3b1
Update go.mod and go.sum (#543)
alldoami May 17, 2021
8b38400
Another dependency needing updats (#546)
alldoami May 17, 2021
624c2b3
release version 0.25.3
alldoami May 17, 2021
e860561
Add data source for SYSTEM$GET_PRIVATELINK_CONFIG() function (#545)
robbruce May 17, 2021
c1d394c
Release schedule
alldoami May 18, 2021
e6eec5e
Feature/table clustering (#548)
berosen May 21, 2021
1e6c6eb
Lower limit on warehouse auto-suspend setting (#552)
jnoynaert May 24, 2021
9520e0d
release version 0.25.4
alldoami May 24, 2021
d1b929e
Corrected mistakes within the snowflake_system_get_privatelink_config…
robbruce Jun 1, 2021
a7d2204
Remove snowflake_role_grants name example (#561)
Jun 2, 2021
19d397d
Add SCIM Integration Resource (#556)
ChrisIsidora Jun 4, 2021
28bdf96
Better Azure integration - Pipe + Notification Integration (#553)
arkadiuss Jun 4, 2021
c58f9e1
Add SCIM access token Datasource (#557)
ChrisIsidora Jun 4, 2021
14d8363
Update go files (#565)
alldoami Jun 7, 2021
dab2a6c
release version 0.25.5
alldoami Jun 7, 2021
7be1fc9
Add data source snowflake_current_account (#567)
robbruce Jun 11, 2021
d2142fd
feat: Add title lint (#570)
alldoami Jun 11, 2021
53a5d1c
Update Go files for release (#572)
alldoami Jun 15, 2021
a8f56ea
release version 0.25.6
alldoami Jun 15, 2021
3739d53
feat: Add importer to integration grant (#574)
alldoami Jun 16, 2021
a6d7f6f
fix: Add importer to account grant (#576)
alldoami Jun 16, 2021
3954741
fix: Escape String for AS in external table (#580)
alldoami Jun 17, 2021
3963193
feat: Add SHOW_INITIAL_ROWS to stream resource (#575)
alldoami Jun 17, 2021
b9d0e9e
feat: Add CREATE ROW ACCESS POLICY to schema grant priv list (#581)
alldoami Jun 17, 2021
ad90692
release version 0.25.7
alldoami Jun 18, 2021
6b95dcb
feat: Add file format resource (#577)
wookasz Jun 21, 2021
80b5cb9
release version 0.25.8
alldoami Jun 21, 2021
7fab82f
feat: Add a resource to manage sequences (#582)
Jun 23, 2021
fc3e78a
fix: Remove force_new from masking_expression (#588)
alldoami Jun 24, 2021
7f64bd3
bump-go (#590)
alldoami Jun 24, 2021
4075974
release version 0.25.9
alldoami Jun 24, 2021
3b44b74
Add Snowflake Platform Info Datasource (#589)
ChrisIsidora Jun 24, 2021
5c6d794
release version 0.25.10
alldoami Jun 28, 2021
780b8d5
DOCFIX: Remove misleading attribute from table doc (#597)
onelharrison Jul 7, 2021
632fd42
fix: Warehouse create and alter properties (#598)
alldoami Jul 8, 2021
8ff2a83
release version 0.25.11
alldoami Jul 12, 2021
90af4cf
feat: Add support for error notifications for Snowpipe (#595)
gouline Jul 13, 2021
0f433c5
use schema in show file formats (#600)
yonieilon Jul 13, 2021
b0417a8
feat: table constraints (#599)
berosen Jul 13, 2021
215acbe
Fix import format for snowflake_account_grant (#602)
kanata2 Jul 14, 2021
8a08ee6
feat: Add support for GCP notification integration (#603)
gary-beautypie Jul 16, 2021
9b4c38b
Update go files (#607)
alldoami Jul 19, 2021
258c7e1
release version 0.25.12
alldoami Jul 19, 2021
ff82626
fix partition_by error in external table (#609)
rarusun Jul 20, 2021
82a340a
fix: Add AWS_SQS_IAM_USER_ARN to notification integration (#610)
gouline Jul 20, 2021
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
1 change: 1 addition & 0 deletions .github/titleLint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
regex: (feat|fix|docs|chore|style|refactor|perf|test): .*
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ terraform-provider-snowflake*
crash.log
.envrc
bin
dist
dist

# JetBrains
.idea/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ If you are using the Standard Snowflake plan, it's recommended you also set up t

**Note: releases can only be done by those with keybase pgp keys allowed in the terraform registry.**

Releases will be performed once a week on **Monday around 11am PST**. If your change is more urgent and you need to use it sooner, use the commit hash.

Releases are done by [goreleaser](https://goreleaser.com/) and run by our make files. There two goreleaser configs, `.goreleaser.yml` for regular releases and `.goreleaser.prerelease.yml` for doing prereleases (for testing).

Releases are [published to the terraform registry](https://registry.terraform.io/providers/chanzuckerberg/snowflake/latest), which requires that releases by signed.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.25.0
0.25.12
38 changes: 38 additions & 0 deletions docs/data-sources/current_account.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "snowflake_current_account Data Source - terraform-provider-snowflake"
subcategory: ""
description: |-

---

# snowflake_current_account (Data Source)



## Example Usage

```terraform
data "snowflake_current_account" "this" {}

resource "aws_ssm_parameter" "snowflake_account_url" {
name = "/snowflake/account_url"
type = "String"
value = data.snowflake_current_account.this.url
}
```

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

### Optional

- **id** (String) The ID of this resource.

### Read-Only

- **account** (String) The Snowflake Account ID; as returned by CURRENT_ACCOUNT().
- **region** (String) The Snowflake Region; as returned by CURRENT_REGION()
- **url** (String) The Snowflake URL.


36 changes: 36 additions & 0 deletions docs/data-sources/system_generate_scim_access_token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "snowflake_system_generate_scim_access_token Data Source - terraform-provider-snowflake"
subcategory: ""
description: |-

---

# snowflake_system_generate_scim_access_token (Data Source)



## Example Usage

```terraform
data "snowflake_system_generate_scim_access_token" "scim" {
integration_name = "AAD_PROVISIONING"
}
```

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

### Required

- **integration_name** (String) SCIM Integration Name

### Optional

- **id** (String) The ID of this resource.

### Read-Only

- **access_token** (String) SCIM Access Token


85 changes: 85 additions & 0 deletions docs/data-sources/system_get_privatelink_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "snowflake_system_get_privatelink_config Data Source - terraform-provider-snowflake"
subcategory: ""
description: |-

---

# snowflake_system_get_privatelink_config (Data Source)



## Example Usage

```terraform
data "snowflake_system_get_privatelink_config" "snowflake_private_link" {}

resource "aws_security_group" "snowflake_private_link" {
vpc_id = var.vpc_id

ingress {
from_port = 80
to_port = 80
cidr_blocks = var.vpc_cidr
protocol = "tcp"
}

ingress {
from_port = 443
to_port = 443
cidr_blocks = var.vpc_cidr
protocol = "tcp"
}
}

resource "aws_vpc_endpoint" "snowflake_private_link" {
vpc_id = var.vpc_id
service_name = data.snowflake_system_get_privatelink_config.snowflake_private_link.aws_vpce_id
vpc_endpoint_type = "Interface"
security_group_ids = [aws_security_group.snowflake_private_link.id]
subnet_ids = var.subnet_ids
private_dns_enabled = false
}

resource "aws_route53_zone" "snowflake_private_link" {
name = "privatelink.snowflakecomputing.com"

vpc {
vpc_id = var.vpc_id
}
}

resource "aws_route53_record" "snowflake_private_link_url" {
zone_id = aws_route53_zone.snowflake_private_link.zone_id
name = data.snowflake_system_get_privatelink_config.snowflake_private_link.account_url
type = "CNAME"
ttl = "300"
records = [aws_vpc_endpoint.snowflake_private_link.dns_entry[0]["dns_name"]]
}

resource "aws_route53_record" "snowflake_private_link_oscp_url" {
zone_id = aws_route53_zone.snowflake_private_link_url.zone_id
name = data.snowflake_system_get_privatelink_config.snowflake_private_link.oscp_url
type = "CNAME"
ttl = "300"
records = [aws_vpc_endpoint.snowflake_private_link.dns_entry[0]["dns_name"]]
}
```

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

### Optional

- **id** (String) The ID of this resource.

### Read-Only

- **account_name** (String) The name of your Snowflake account.
- **account_url** (String) The URL used to connect to Snowflake through AWS PrivateLink or Azure Private Link.
- **aws_vpce_id** (String) The AWS VPCE ID for your account.
- **azure_pls_id** (String) The Azure Private Link Service ID for your account.
- **oscp_url** (String) The OCSP URL corresponding to your Snowflake account that uses AWS PrivateLink or Azure Private Link.


27 changes: 27 additions & 0 deletions docs/data-sources/system_get_snowflake_platform_info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "snowflake_system_get_snowflake_platform_info Data Source - terraform-provider-snowflake"
subcategory: ""
description: |-

---

# snowflake_system_get_snowflake_platform_info (Data Source)





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

### Optional

- **id** (String) The ID of this resource.

### Read-Only

- **aws_vpc_ids** (List of String) Snowflake AWS Virtual Private Cloud IDs
- **azure_vnet_subnet_ids** (List of String) Snowflake Azure Virtual Network Subnet IDs


50 changes: 45 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ provider snowflake {
region = "..."

// optional, at exactly one must be set
password = "..."
oauth_access_token = "..."
private_key_path = "..."
password = "..."
oauth_access_token = "..."
private_key_path = "..."
private_key = "..."
oauth_refresh_token = "..."
oauth_client_id = "..."
oauth_client_secret = "..."
oauth_endpoint = "..."
oauth_redirect_url = "..."

// optional
role = "..."
Expand All @@ -44,6 +50,11 @@ provider snowflake {

- **browser_auth** (Boolean)
- **oauth_access_token** (String, Sensitive)
- **oauth_client_id** (String, Sensitive)
- **oauth_client_secret** (String, Sensitive)
- **oauth_endpoint** (String, Sensitive)
- **oauth_redirect_url** (String, Sensitive)
- **oauth_refresh_token** (String, Sensitive)
- **password** (String, Sensitive)
- **private_key** (String, Sensitive)
- **private_key_path** (String, Sensitive)
Expand All @@ -56,6 +67,7 @@ The Snowflake provider support multiple ways to authenticate:

* Password
* OAuth Access Token
* OAuth Refresh Token
* Browser Auth
* Private Key

Expand Down Expand Up @@ -90,6 +102,20 @@ export SNOWFLAKE_OAUTH_ACCESS_TOKEN='...'

Note that once this access token expires, you'll need to request a new one through an external application.

### OAuth Refresh Token

If you have an OAuth Refresh token, export these credentials as environment variables:

```shell
export SNOWFLAKE_OAUTH_REFRESH_TOKEN='...'
export SNOWFLAKE_OAUTH_CLIENT_ID='...'
export SNOWFLAKE_OAUTH_CLIENT_SECRET='...'
export SNOWFLAKE_OAUTH_ENDPOINT='...'
export SNOWFLAKE_OAUTH_REDIRECT_URL='https://localhost.com'
```

Note because access token have a short life; typically 10 minutes, by passing refresh token new access token will be generated.

### Username and Password Environment Variables

If you choose to use Username and Password Authentication, export these credentials:
Expand All @@ -113,10 +139,24 @@ In addition to [generic `provider` arguments](https://www.terraform.io/docs/conf
* `password` - (optional) Password for username+password auth. Cannot be used with `browser_auth` or
`private_key_path`. Can be source from `SNOWFLAKE_PASSWORD` environment variable.
* `oauth_access_token` - (optional) Token for use with OAuth. Generating the token is left to other
tools. Cannot be used with `browser_auth`, `private_key_path` or `password`. Can be source from
`SNOWFLAKE_OAUTH_ACCESS_TOKEN` environment variable.
tools. Cannot be used with `browser_auth`, `private_key_path`, `oauth_refresh_token` or `password`.
Can be sourced from `SNOWFLAKE_OAUTH_ACCESS_TOKEN` environment variable.
* `oauth_refresh_token` - (optional) Token for use with OAuth. Setup and generation of the token is
left to other tools. Should be used in conjunction with `oauth_client_id`, `oauth_client_secret`,
`oauth_endpoint`, `oauth_redirect_url`. Cannot be used with `browser_auth`, `private_key_path`,
`oauth_access_token` or `password`. Can be sourced from `SNOWFLAKE_OAUTH_REFRESH_TOKEN` environment
variable.
* `oauth_client_id` - (optional) Required when `oauth_refresh_token` is used. Can be sourced from
`SNOWFLAKE_OAUTH_CLIENT_ID` environment variable.
* `oauth_client_secret` - (optional) Required when `oauth_refresh_token` is used. Can be sourced from
`SNOWFLAKE_OAUTH_CLIENT_SECRET` environment variable.
* `oauth_endpoint` - (optional) Required when `oauth_refresh_token` is used. Can be sourced from
`SNOWFLAKE_OAUTH_ENDPOINT` environment variable.
* `oauth_redirect_url` - (optional) Required when `oauth_refresh_token` is used. Can be sourced from
`SNOWFLAKE_OAUTH_REDIRECT_URL` environment variable.
* `private_key_path` - (optional) Path to a private key for using keypair authentication.. Cannot be
used with `browser_auth`, `oauth_access_token` or `password`. Can be source from
`SNOWFLAKE_PRIVATE_KEY_PATH` environment variable.
* `role` - (optional) Snowflake role to use for operations. If left unset, default role for user
will be used. Can come from the `SNOWFLAKE_ROLE` environment variable.

4 changes: 2 additions & 2 deletions docs/resources/account_grant.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ resource snowflake_account_grant grant {
Import is supported using the following syntax:

```shell
# format is account name | privilege | true/false for with_grant_option
terraform import snowflake_account_grant.example 'accountName|USAGE|true'
# format is account name | | | privilege | true/false for with_grant_option
terraform import snowflake_account_grant.example 'accountName|||USAGE|true'
```
77 changes: 77 additions & 0 deletions docs/resources/file_format.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "snowflake_file_format Resource - terraform-provider-snowflake"
subcategory: ""
description: |-

---

# snowflake_file_format (Resource)



## Example Usage

```terraform
resource "snowflake_file_format" "example_file_format" {
name = "EXAMPLE_FILE_FORMAT"
database = "EXAMPLE_DB"
schema = "EXAMPLE_SCHEMA"
format_type = "CSV"
}
```

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

### Required

- **database** (String) The database in which to create the file format.
- **format_type** (String) Specifies the format of the input files (for data loading) or output files (for data unloading).
- **name** (String) Specifies the identifier for the file format; must be unique for the database and schema in which the file format is created.
- **schema** (String) The schema in which to create the file format.

### Optional

- **allow_duplicate** (Boolean) Boolean that specifies to allow duplicate object field names (only the last one will be preserved).
- **binary_as_text** (Boolean) Boolean that specifies whether to interpret columns with no defined logical data type as UTF-8 text.
- **binary_format** (String) Defines the encoding format for binary input or output.
- **comment** (String) Specifies a comment for the file format.
- **compression** (String) Specifies the current compression algorithm for the data file.
- **date_format** (String) Defines the format of date values in the data files (data loading) or table (data unloading).
- **disable_auto_convert** (Boolean) Boolean that specifies whether the XML parser disables automatic conversion of numeric and Boolean values from text to native representation.
- **disable_snowflake_data** (Boolean) Boolean that specifies whether the XML parser disables recognition of Snowflake semi-structured data tags.
- **empty_field_as_null** (Boolean) Specifies whether to insert SQL NULL for empty fields in an input file, which are represented by two successive delimiters.
- **enable_octal** (Boolean) Boolean that enables parsing of octal numbers.
- **encoding** (String) String (constant) that specifies the character set of the source data when loading data into a table.
- **error_on_column_count_mismatch** (Boolean) Boolean that specifies whether to generate a parsing error if the number of delimited columns (i.e. fields) in an input file does not match the number of columns in the corresponding table.
- **escape** (String) Single character string used as the escape character for field values.
- **escape_unenclosed_field** (String) Single character string used as the escape character for unenclosed field values only.
- **field_delimiter** (String) Specifies one or more singlebyte or multibyte characters that separate fields in an input file (data loading) or unloaded file (data unloading).
- **field_optionally_enclosed_by** (String) Character used to enclose strings.
- **file_extension** (String) Specifies the extension for files unloaded to a stage.
- **id** (String) The ID of this resource.
- **ignore_utf8_errors** (Boolean) Boolean that specifies whether UTF-8 encoding errors produce error conditions.
- **null_if** (List of String) String used to convert to and from SQL NULL.
- **preserve_space** (Boolean) Boolean that specifies whether the XML parser preserves leading and trailing spaces in element content.
- **record_delimiter** (String) Specifies one or more singlebyte or multibyte characters that separate records in an input file (data loading) or unloaded file (data unloading).
- **replace_invalid_characters** (Boolean) Boolean that specifies whether to replace invalid UTF-8 characters with the Unicode replacement character (�).
- **skip_blank_lines** (Boolean) Boolean that specifies to skip any blank lines encountered in the data files.
- **skip_byte_order_mark** (Boolean) Boolean that specifies whether to skip the BOM (byte order mark), if present in a data file.
- **skip_header** (Number) Number of lines at the start of the file to skip.
- **strip_null_values** (Boolean) Boolean that instructs the JSON parser to remove object fields or array elements containing null values.
- **strip_outer_array** (Boolean) Boolean that instructs the JSON parser to remove outer brackets.
- **strip_outer_element** (Boolean) Boolean that specifies whether the XML parser strips out the outer XML element, exposing 2nd level elements as separate documents.
- **time_format** (String) Defines the format of time values in the data files (data loading) or table (data unloading).
- **timestamp_format** (String) Defines the format of timestamp values in the data files (data loading) or table (data unloading).
- **trim_space** (Boolean) Boolean that specifies whether to remove white space from fields.
- **validate_utf8** (Boolean) Boolean that specifies whether to validate UTF-8 character encoding in string column data.

## Import

Import is supported using the following syntax:

```shell
# format is database name | schema name | file format name
terraform import snowflake_file_format.example 'dbName|schemaName|fileFormatName'
```
Loading