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 import format for snowflake_database_grant #429

Merged
merged 2 commits into from
Feb 8, 2021

Conversation

kanata2
Copy link
Contributor

@kanata2 kanata2 commented Jan 22, 2021

Description

According to the following code, we must pass 4 or 5 pipe-delimited values in order to use terraform import, but the documentation says that you should pass 3 values.
Indeed, `terraform import snowflake_database_grant.xxx 'xxx|||USAGE|false' works correctly, so I fixed the documentation.

https://github.com/chanzuckerberg/terraform-provider-snowflake/blob/a4240bb6bd399141f3614b3a5e1ff54476de70b4/pkg/resources/grant_helpers.go#L114-L116

Current Behaviour

$ terraform import snowflake_database_grant.xxx 'xxx|||USAGE|false'
...
snowflake_database_grant.xxx: Refreshing state... [id=xxx|USAGE|false]

Error: 4 or 5 fields allowed

@kanata2 kanata2 requested a review from a team as a code owner January 22, 2021 14:24
@kanata2 kanata2 requested a review from alldoami January 22, 2021 14:24
@kanata2
Copy link
Contributor Author

kanata2 commented Jan 22, 2021

Ah, I found same cases which should be fixed and will fix its later.

@kanata2
Copy link
Contributor Author

kanata2 commented Jan 22, 2021

Fixed in 8cdb7ca

@ryanking
Copy link
Contributor

@kanata2 what version was this on? We had a regression in, I think v0.20, related to this which was later reverted.

@kanata2
Copy link
Contributor Author

kanata2 commented Jan 22, 2021

@ryanking I used v0.18.1, but main branch seems to have the same problem.

@kanata2
Copy link
Contributor Author

kanata2 commented Jan 22, 2021

I triedterraform import snowflake_database_grant.xxx 'xxx|USAGE|false'in v0.22.0 again, but got the same result.

$ terraform import snowflake_database_grant.xxx 'xxx|USAGE|false'
snowflake_database_grant.xxx: Importing from ID "xxx|USAGE|false"...
snowflake_database_grant.xxx: Import prepared!
  Prepared snowflake_database_grant for import
snowflake_database_grant.xxx: Refreshing state... [id=xxx|USAGE|false]

Error: 4 or 5 fields allowed


$ terraform import snowflake_database_grant.xxx 'xxx|||USAGE|false'
snowflake_database_grant.xxx: Importing from ID "xxx|||USAGE|false"...
snowflake_database_grant.xxx: Import prepared!
  Prepared snowflake_database_grant for import
snowflake_database_grant.xxx: Refreshing state... [id=xxx|||USAGE|false]

Import successful!

The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.

@alldoami
Copy link
Contributor

/ok-to-test sha=b29b2b1

@github-actions
Copy link

Integration tests success for b29b2b1

Copy link
Contributor

@ryanking ryanking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for all the other files

docs/resources/database_grant.md Show resolved Hide resolved
* snowflake_database_grant
* snowflake_schema_grant
* snowflake_table_grant
* snowflake_stage_grant
* snowflake_warehouse_grant
@alldoami
Copy link
Contributor

alldoami commented Feb 8, 2021

/ok-to-test sha=c8f9e2e

@github-actions
Copy link

github-actions bot commented Feb 8, 2021

Integration tests success for c8f9e2e

@ryanking ryanking dismissed their stale review February 8, 2021 22:05

allison has it

@alldoami
Copy link
Contributor

alldoami commented Feb 8, 2021

@kanata2 can you update your branch with main?

@czimergebot czimergebot merged commit ff69fc2 into Snowflake-Labs:main Feb 8, 2021
@kanata2 kanata2 deleted the fix_database_grant_doc branch February 9, 2021 00:07
gjv9491 pushed a commit to gjv9491/terraform-provider-snowflake that referenced this pull request Mar 19, 2021
## Description
According to the following code, we must pass 4 or 5 pipe-delimited values in order to use `terraform import`, but the documentation says that you should pass 3 values.
Indeed, `terraform import snowflake_database_grant.xxx 'xxx|||USAGE|false' works correctly, so I fixed the documentation.

https://github.com/chanzuckerberg/terraform-provider-snowflake/blob/a4240bb6bd399141f3614b3a5e1ff54476de70b4/pkg/resources/grant_helpers.go#L114-L116

### Current Behaviour

```
$ terraform import snowflake_database_grant.xxx 'xxx|||USAGE|false'
...
snowflake_database_grant.xxx: Refreshing state... [id=xxx|USAGE|false]

Error: 4 or 5 fields allowed
```
kanata2 added a commit to kanata2/terraform-provider-snowflake that referenced this pull request Jul 13, 2021
Same problem as Snowflake-Labs#429.
The argument of `grantIDFromString` named `stringID` expects 4 or 5 fields delimitered by "|".
anton-chekanov pushed a commit to anton-chekanov/terraform-provider-snowflake that referenced this pull request Jan 25, 2022
## Description
According to the following code, we must pass 4 or 5 pipe-delimited values in order to use `terraform import`, but the documentation says that you should pass 3 values.
Indeed, `terraform import snowflake_database_grant.xxx 'xxx|||USAGE|false' works correctly, so I fixed the documentation.

https://github.com/chanzuckerberg/terraform-provider-snowflake/blob/a4240bb6bd399141f3614b3a5e1ff54476de70b4/pkg/resources/grant_helpers.go#L114-L116

### Current Behaviour

```
$ terraform import snowflake_database_grant.xxx 'xxx|||USAGE|false'
...
snowflake_database_grant.xxx: Refreshing state... [id=xxx|USAGE|false]

Error: 4 or 5 fields allowed
```
daniepett pushed a commit to daniepett/terraform-provider-snowflake that referenced this pull request Feb 9, 2022
## Description
According to the following code, we must pass 4 or 5 pipe-delimited values in order to use `terraform import`, but the documentation says that you should pass 3 values.
Indeed, `terraform import snowflake_database_grant.xxx 'xxx|||USAGE|false' works correctly, so I fixed the documentation.

https://github.com/chanzuckerberg/terraform-provider-snowflake/blob/a4240bb6bd399141f3614b3a5e1ff54476de70b4/pkg/resources/grant_helpers.go#L114-L116

### Current Behaviour

```
$ terraform import snowflake_database_grant.xxx 'xxx|||USAGE|false'
...
snowflake_database_grant.xxx: Refreshing state... [id=xxx|USAGE|false]

Error: 4 or 5 fields allowed
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants