pulumi / pulumi-gcp

A Google Cloud Platform (GCP) Pulumi resource package, providing multi-language access to GCP
Apache License 2.0
183 stars 53 forks source link

gcp.certificatemanager.CertificateMap docs golang example does not match implementation #2349

Open smithrobs opened 2 months ago

smithrobs commented 2 months ago

Describe what happened

gcp.certificatemanager.CertificateMap golang examples do not match the underlying code.

Example:

_, err := certificatemanager.NewCertificateMap(ctx, "default", &certificatemanager.CertificateMapArgs{

should be

_, err := certificatemanager.NewCertificateMapResource(ctx, "certificate_map", &certificatemanager.CertificateMapResourceArgs{

Other langs seem unaffected? (I checked dotnet only)

This PR seems to be when it deviated.

Sample program

Non-working example from docs:

_, err := certificatemanager.NewCertificateMap(ctx, "default", &certificatemanager.CertificateMapArgs{
    Name:        pulumi.String("cert-map"),
     Description: pulumi.String("My acceptance test certificate map"),
     Labels: pulumi.StringMap{
        "terraform": pulumi.String("true"),
        "acc-test":  pulumi.String("true"),
    },
})

This works:

rsrc, _ := certificatemanager.NewCertificateMapResource(ctx, "certificate_map", &certificatemanager.CertificateMapResourceArgs{
    Name:        pulumi.String("cert-map-entry"),
    Description: pulumi.String("My acceptance test certificate map"),
    Labels: pulumi.StringMap{
        "terraform": pulumi.String("true"),
        "acc-test":  pulumi.String("true"),
    },
})

Log output

No response

Affected Resource(s)

No response

Output of pulumi about

CLI          
Version      3.130.0
Go Version   go1.22.6
Go Compiler  gc

Plugins
KIND      NAME  VERSION
resource  gcp   7.23.0
language  go    unknown

Host     
OS       darwin
Version  14.6.1
Arch     arm64

This project is written in go: executable='/usr/local/go/bin/go' version='go version go1.22.5 darwin/arm64'

TYPE                  URN
pulumi:pulumi:Stack   urn:pulumi:dev::gcp-go-scratch::pulumi:pulumi:Stack::gcp-go-scratch-dev
pulumi:providers:gcp  urn:pulumi:dev::gcp-go-scratch::pulumi:providers:gcp::default_7_23_0

Found no pending operations associated with dev

Backend        
Name           pulumi.com
Token type     personal

Dependencies:
NAME                                 VERSION
github.com/pulumi/pulumi-gcp/sdk/v7  v7.23.0
github.com/pulumi/pulumi/sdk/v3      v3.117.0

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 2 months ago

Hi @smithrobs. Thanks for reporting this. The underlying issue is in pulumi/pulumi's code generation. I'll open an issue upstream.

iwahbe commented 2 months ago

Upstream issue is https://github.com/pulumi/pulumi/issues/17085.