pulumi / pulumi-snowflake

Apache License 2.0
17 stars 5 forks source link

Deprecation warning for snowflake.StageGrant uses TF name #288

Open jkodroff opened 1 year ago

jkodroff commented 1 year ago

What happened?

Creating a resource of type snowflake.StageGrant gives the user a deprecation warning that references the TF name:

Diagnostics:
  snowflake:index:StageGrant (snowpipe-stage-grant):
    warning: urn:pulumi:dev::snowflake-pulumi-search-export-py::snowflake:index/stageGrant:StageGrant::snowpipe-stage-grant verification warning: This resource is deprecated and will be removed in a future major version release. Please use snowflake_grant_privileges_to_role instead.

Expected Behavior

n/a

Steps to reproduce

n/a

Output of pulumi about

CLI          
Version      3.74.0
Go Version   go1.20.5
Go Compiler  gc

Plugins
NAME       VERSION
aws        5.41.0
command    0.7.2
python     unknown
snowflake  0.29.0

Host     
OS       darwin
Version  13.3.1
Arch     arm64

This project is written in python: executable='/Users/jkodroff/src/pulumi/examples/snowflake-py-pulumi-search-export/venv/bin/python3' version='3.11.4
'

Current Stack: jkodrofftest/snowflake-pulumi-search-export-py/dev

TYPE                                                   URN
pulumi:pulumi:Stack                                    urn:pulumi:dev::snowflake-pulumi-search-export-py::pulumi:pulumi:Stack::snowflake-pulumi-search-export-py-dev
pulumi:providers:aws                                   urn:pulumi:dev::snowflake-pulumi-search-export-py::pulumi:providers:aws::default
pulumi:providers:aws                                   urn:pulumi:dev::snowflake-pulumi-search-export-py::pulumi:providers:aws::default_5_41_0
aws:iam/role:Role                                      urn:pulumi:dev::snowflake-pulumi-search-export-py::aws:iam/role:Role::lambda-role
aws:s3/bucket:Bucket                                   urn:pulumi:dev::snowflake-pulumi-search-export-py::aws:s3/bucket:Bucket::pulumi-search-export
aws:ssm/parameter:Parameter                            urn:pulumi:dev::snowflake-pulumi-search-export-py::aws:ssm/parameter:Parameter::pulumi-token
pulumi:providers:command                               urn:pulumi:dev::snowflake-pulumi-search-export-py::pulumi:providers:command::default_0_7_2
pulumi:providers:snowflake                             urn:pulumi:dev::snowflake-pulumi-search-export-py::pulumi:providers:snowflake::default_0_29_0
snowflake:index/storageIntegration:StorageIntegration  urn:pulumi:dev::snowflake-pulumi-search-export-py::snowflake:index/storageIntegration:StorageIntegration::snowflake-storage-integration
aws:iam/rolePolicyAttachment:RolePolicyAttachment      urn:pulumi:dev::snowflake-pulumi-search-export-py::aws:iam/rolePolicyAttachment:RolePolicyAttachment::lambda-execute-policy
aws:iam/policy:Policy                                  urn:pulumi:dev::snowflake-pulumi-search-export-py::aws:iam/policy:Policy::snowflake-storage-integation-policy
aws:iam/policy:Policy                                  urn:pulumi:dev::snowflake-pulumi-search-export-py::aws:iam/policy:Policy::pulumi-search-export-to-s3-policy
aws:iam/role:Role                                      urn:pulumi:dev::snowflake-pulumi-search-export-py::aws:iam/role:Role::snowflake-integration-role
aws:iam/rolePolicyAttachment:RolePolicyAttachment      urn:pulumi:dev::snowflake-pulumi-search-export-py::aws:iam/rolePolicyAttachment:RolePolicyAttachment::ssm-params-attachment
snowflake:index/database:Database                      urn:pulumi:dev::snowflake-pulumi-search-export-py::snowflake:index/database:Database::pulumi-snowflake-integration
snowflake:index/schema:Schema                          urn:pulumi:dev::snowflake-pulumi-search-export-py::snowflake:index/schema:Schema::pulumi-snowflake-integration
snowflake:index/table:Table                            urn:pulumi:dev::snowflake-pulumi-search-export-py::snowflake:index/table:Table::pulumi-search-exports
command:local:Command                                  urn:pulumi:dev::snowflake-pulumi-search-export-py::command:local:Command::vendor-deps
aws:lambda/function:Function                           urn:pulumi:dev::snowflake-pulumi-search-export-py::aws:lambda/function:Function::pulumi-search-export-to-s3

Found no pending operations associated with dev

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/jkodroff
User           jkodroff
Organizations  jkodroff, oracle-workshop, jkodrofftest, zephyr, demo, pulumi

Dependencies:
NAME              VERSION
pip               23.1.2
pulumi-aws        5.41.0
pulumi-command    0.7.2
pulumi-snowflake  0.29.0
setuptools        67.6.1

Pulumi locates its logs in /var/folders/5m/4n1x3f8151s35wc80w06z5k80000gn/T/ by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

iwahbe commented 1 year ago

Thanks for reporting this @jkodroff. The fix will be in the bridge, so I opened https://github.com/pulumi/pulumi-terraform-bridge/issues/1297 to track.

rvasconcelossilva commented 1 year ago

Hi there,

I also got this message. In this case, what is the recommended action from our end?

iwahbe commented 1 year ago

You will need to switch to a non-deprecated resource. The Pulumi token is "snowflake:index/grantPrivilegesToRole:GrantPrivilegesToRole". This corresponds to:

CSharp: https://github.com/pulumi/pulumi-snowflake/blob/2434685933e63909217a3f720f9d018e14ca2998/sdk/dotnet/GrantPrivilegesToRole.cs#L109

Python: https://github.com/pulumi/pulumi-snowflake/blob/2434685933e63909217a3f720f9d018e14ca2998/sdk/python/pulumi_snowflake/grant_privileges_to_role.py#L287

Typescript: https://github.com/pulumi/pulumi-snowflake/blob/2434685933e63909217a3f720f9d018e14ca2998/sdk/nodejs/grantPrivilegesToRole.ts#L105

Go: https://github.com/pulumi/pulumi-snowflake/blob/2434685933e63909217a3f720f9d018e14ca2998/sdk/go/snowflake/grantPrivilegesToRole.go#L119

Java: https://github.com/pulumi/pulumi-snowflake/blob/2434685933e63909217a3f720f9d018e14ca2998/sdk/java/src/main/java/com/pulumi/snowflake/GrantPrivilegesToRole.java#L120

rvasconcelossilva commented 1 year ago

Is there any example?

rvasconcelossilva commented 1 year ago

That is a big change for the grant schema is there any documentation on it?

rvasconcelossilva commented 1 year ago

Sorry, one more question, does it make the grant stop working?

jkodroff commented 1 year ago

@rvasconcelossilva

Does it make the grant stop working?

Not entirely sure if this is what you're asking, but the StageGrant resource still works, it's just that you get a deprecation warning. I was not able to figure out the syntax for granting to a Stage using GrantPrivilegesToRole when I filed this issue and just continued using StageGrant. The code I was working on will eventually be publicly available (maybe even this week). I'll post the example I was working on if you let me know you want to see it.

However, I think that the docs might've gotten updated since I originally filed the issue, because it looks like GrantPrivilegesToRole.onSchemaObject is the right way to specify a grant to a STAGE: https://www.pulumi.com/registry/packages/snowflake/api-docs/grantprivilegestorole/#grantprivilegestoroleonschemaobject

Good luck, and please post your code if you get something working! I'll do the same if I can get GrantPrivilegesToRole working with a STAGE.

rvasconcelossilva commented 1 year ago

Is there some where I can see the change? I believe there are changes in the arguments and many other things right? I believe any deprecated resource should have a how to migrate to the new one. Is there a way to help with that?