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

google-native:recaptchaenterprise/v1:Key creation fails #928

Open
bindermuehle opened this issue Sep 12, 2023 · 3 comments
Open

google-native:recaptchaenterprise/v1:Key creation fails #928

bindermuehle opened this issue Sep 12, 2023 · 3 comments
Labels
area/providers impact/blocker kind/bug Some behavior is incorrect or out of spec

Comments

@bindermuehle
Copy link

bindermuehle commented Sep 12, 2023

What happened?

creating a recaptcha enterprise key failed with following message:

google-native:recaptchaenterprise/v1:Key (primary):
    error: object retrieval failure after successful create / read state: googleapi: Error 400: Invalid Key resource name 'projects/<PROJECT_NAME>/keys/primary-7fd671d'. Should be projects/{project ID or number}/keys/{site key id, 40 character long}

Expected Behavior

the key gets created and registered

Steps to reproduce

import * as pulumi from "@pulumi/pulumi";
import * as google_native from "@pulumi/google-native";

const config = new pulumi.Config();
const projectName = "YOUR_PROJECT_ID";
const keyName = "YOUR_DISPLAY_NAME";

// Create a google-native.recaptchaenterprise/v1.Key resource
const recaptchaKey = new google_native.recaptchaenterprise.v1.Key(keyName, {
    project: projectName,
    displayName: keyName,
    webSettings: {
        allowAllDomains: true,
        integrationType: "CHECKBOX", 
    },
});

// Export the name of the key
export const recaptchaKeyName = recaptchaKey.name;

Output of pulumi about

CLI
Version 3.81.0
Go Version go1.21.1
Go Compiler gc

Plugins
NAME VERSION
gcp 6.65.0
google-native 0.31.1
nodejs unknown
random 4.13.2

Host
OS darwin
Version 13.1
Arch arm64

This project is written in nodejs: executable='/Users/user/.nvm/versions/node/v18.16.1/bin/node' version='v18.16.1'

Dependencies:
NAME VERSION
@pulumi/gcp 6.65.0
@pulumi/google-native 0.31.1
@pulumi/pulumi 3.81.0
@pulumi/random 4.13.2
@types/node 16.18.38

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).

@bindermuehle bindermuehle added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Sep 12, 2023
@mikhailshilkov
Copy link
Member

Thank you for reporting this @bindermuehle! It looks like auto-naming doesn't produce the valid format here.

As a workaround, could you try specifying the name explicitly?

const recaptchaKey = new google_native.recaptchaenterprise.v1.Key(keyName, {
    project: projectName,
    displayName: keyName,
    name: "specify the full key id in the required format",
    webSettings: {
        allowAllDomains: true,
        integrationType: "CHECKBOX", 
    },
});

@mikhailshilkov mikhailshilkov added area/providers and removed needs-triage Needs attention from the triage team labels Sep 13, 2023
@bindermuehle
Copy link
Author

bindermuehle commented Sep 13, 2023

the format of the name is as following.
"projects/{project}/keys/{key}".
I'm not sure how to generate the key.
reading through the API it seems the key has to be created using the API

https://pkg.go.dev/cloud.google.com/go/recaptchaenterprise/v2/apiv1/recaptchaenterprisepb#Key

@lukehoban
Copy link

Note that this resources is now supported in Google Classic as well. In general, it is likely best to use that in the near term.

https://www.pulumi.com/registry/packages/gcp/api-docs/recaptcha/enterprisekey/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/providers impact/blocker kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

3 participants