https://pulumi.com logo
#google-cloud
Title
# google-cloud
g

gifted-room-26715

03/30/2023, 8:45 AM
Hi Guys, I'm trying to use google-native to create id-platform resources. Classic version works perfectly ok but google-native giving below message. Any thoughts how to resolve this? I'm authenticated using service-account. The below message appears for any resource of id-platform. { "error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", "status": "UNAUTHENTICATED", "details": [ { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "CREDENTIALS_MISSING", "domain": "googleapis.com", "metadata": { "service": "identitytoolkit.googleapis.com", "method": "google.cloud.identitytoolkit.admin.v2.ProjectConfigService.ListDefaultSupportedIdpConfigs" } } ] } }
s

stocky-restaurant-98004

03/30/2023, 2:13 PM
Google Native is pre-release. We recommend you stick to Google Classic unless you have compelling reason to use the native provider.
g

gifted-room-26715

03/31/2023, 11:08 AM
got it. is firebase available now? getting below output...but docs says it has
HostingVersion
class. trying to implement this
AttributeError: module 'pulumi_gcp.firebase' has no attribute 'HostingVersion'
error: an unhandled error occurred: python inline source runtime error: module 'pulumi_gcp.firebase' has no attribute 'HostingVersion' Traceback (most recent call last): File "/home/xaimpl/.local/lib/python3.10/site-packages/pulumi/automation/_server.py", line 81, in Run loop.run_until_complete(run_in_stack(self.program)) File "/home/xaimpl/anaconda3/envs/iacp/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/home/xaimpl/.local/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 136, in run_in_stack await run_pulumi_func(lambda: Stack(func)) File "/home/xaimpl/.local/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 49, in run_pulumi_func func() File "/home/xaimpl/.local/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 136, in <lambda> await run_pulumi_func(lambda: Stack(func)) File "/home/xaimpl/.local/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 159, in init func() File "/home/xaimpl/work/iacp/GCP/e2e_auto/24firebase.py", line 367, in pulumi_program basic_web_app, basic_web_app_config = fb_webapp() File "/home/xaimpl/work/iacp/GCP/e2e_auto/24firebase.py", line 276, in fb_webapp default_hosting_version = gcp.firebase.HostingVersion("defaultHostingVersion",
AttributeError: module 'pulumi_gcp.firebase' has no attribute 'HostingVersion'
s

stocky-restaurant-98004

03/31/2023, 12:50 PM
Any chance you are not using the latest version of the provider? Not to user-blame, but it's almost certainly something on your end. I'd be shocked if a resource in the registry was not actually in the provider since they come from the same source (the Pulumi provider schema).
g

gifted-room-26715

03/31/2023, 12:53 PM
using the latest version of gcp plugin gcp resource 6.52.0 136 MB 1 week ago 1 hour ago anything else I should look into? how can I use/install beta, if applicable? # opts=pulumi.ResourceOptions(provider=google_beta)
s

stocky-restaurant-98004

03/31/2023, 1:00 PM
There is no google beta. The Pulumi GCP Classic provider is actually based on the TF google-beta provider.
Before you post an issue in GH (next step), can you give me he minimal code to reproduce the issue? I'll try to eyeball it if I can.
g

gifted-room-26715

03/31/2023, 1:02 PM
sure, here it is default_hosting_site = gcp.firebase.HostingSite( "defaultHostingSite", project=GCP_project_ID, site_id="site-with-channel-1234", # opts=pulumi.ResourceOptions(provider=google_beta) ) default_hosting_version = gcp.firebase.HostingVersion( "defaultHostingVersion", site_id=default_hosting_site.site_id, config=gcp.firebase.HostingVersionConfigArgs( redirects=[gcp.firebase.HostingVersionConfigRedirectArgs( glob="/google/**", status_code=302, location="https://www.google.com", )], ), # opts=pulumi.ResourceOptions(provider=google_beta) )
s

stocky-restaurant-98004

03/31/2023, 1:03 PM
Let me run the example in the registry and see.
g

gifted-room-26715

03/31/2023, 1:06 PM
BTW, I'm able to create other firebase resources inculding hostingsite but not hostingversion and hostingrelease
s

stocky-restaurant-98004

03/31/2023, 1:08 PM
Yeah, checking now.
g

gifted-room-26715

03/31/2023, 1:08 PM
thanks much!!!
s

stocky-restaurant-98004

03/31/2023, 1:12 PM
Ok, this code previews, which I think proves it's something particular to your code. (It would not preview if the resource did not exist.)
Copy code
default_hosting_site = gcp.firebase.HostingSite("defaultHostingSite",
                                                project="my-project-name",
                                                site_id="site-id",
                                                )
default_hosting_version = gcp.firebase.HostingVersion("defaultHostingVersion",
                                                      site_id=default_hosting_site.site_id,
                                                      config=gcp.firebase.HostingVersionConfigArgs(
                                                          redirects=[gcp.firebase.HostingVersionConfigRedirectArgs(
                                                              glob="/google/**",
                                                              status_code=302,
                                                              location="<https://www.google.com>",
                                                          )],
                                                      ),
                                                      )
default_hosting_release = gcp.firebase.HostingRelease("defaultHostingRelease",
                                                      site_id=default_hosting_site.site_id,
                                                      version_name=default_hosting_version.name,
                                                      message="Redirect to Google",
                                                      )
This is just the example code from the HostingVersion registry page with the bad providers stripped out.
g

gifted-room-26715

03/31/2023, 1:22 PM
just copied it as-is and changed the project and site-id but still the same output
s

stocky-restaurant-98004

03/31/2023, 1:37 PM
What does
pip list
give you? Any chance you're not in the venv you think you are?
g

gifted-room-26715

03/31/2023, 1:39 PM
I'm in the correct env and created other stacks successfully including a stack with firebase resources. Created the github issue https://github.com/pulumi/pulumi/issues/12573 Pulumi About CLI Version 3.60.1 Go Version go1.20.2 Go Compiler gc Host OS ubuntu Version 22.04 Arch x86_64 Backend Name pulumi.com URL https://app.pulumi.com/mlops User mlops Organizations mlops
b

brainy-church-78120

03/31/2023, 1:41 PM
@gifted-room-26715 do you mind unchecking the also send to channel box if you send more messages? it makes this thread a bit difficult to follow
g

gifted-room-26715

03/31/2023, 1:47 PM
pip list output (iacp) xaimpl@ma:~/work/iacp$ pip list | grep pulumi pulumi 3.55.0 pulumi-aws 5.19.0 pulumi-docker 3.6.1 pulumi-gcp 6.49.0 pulumi-github 5.4.0 pulumi-google-native 0.28.0 pulumi-kafka 3.4.0 pulumi-kubernetes 3.24.0 pulumi-postgresql 3.6.0 pulumi-random 4.11.2
resolved by upgrading pulumi-gcp package
2 Views