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

400 when creating monitoring.v3.UptimeCheckConfig, name is provided when it should be omitted #317

Closed
Tracked by #291
ColeSiegelTR opened this issue Jan 31, 2022 · 3 comments
Labels
kind/bug Some behavior is incorrect or out of spec resolution/duplicate This issue is a duplicate of another issue

Comments

@ColeSiegelTR
Copy link

Version: "@pulumi/google-native": "0.13.0"

const test = new gcp.monitoring.v3.UptimeCheckConfig('th_uptime_check', {
    project: config.project.id,
    monitoredResource: {
        type: "uptime_url",
        labels: {
            project_id: `${config.project.id}`,
        }
    },
    httpCheck: {
        useSsl: true,
        path: "/test",
        port: 443,
        headers: {
        },
        validateSsl: true,
        requestMethod: "GET"
        },
    period: "60s",
    timeout: "20s",
        selectedRegions: [
            "USA"
        ],
        checkerType: "STATIC_IP_CHECKERS"
});
Updating (a207874_dep-monitoring-dev):
     Type                                              Name                                               Status                  Info
     pulumi:pulumi:Stack                               a207874_dep-monitoring-a207874_dep-monitoring-dev  **failed**              1 error
 +   └─ google-native:monitoring/v3:UptimeCheckConfig  th_uptime_check                                    **creating failed**     1 error
 
Diagnostics:
  google-native:monitoring/v3:UptimeCheckConfig (th_uptime_check):
    error: error sending request: googleapi: Error 400: Cannot specify name in an UptimeCheckConfig sent to Create: "https://monitoring.googleapis.com/v3/projects/x/uptimeCheckConfigs" map[checkerType:STATIC_IP_CHECKERS httpCheck:map[headers:map[] path:/test port:443 requestMethod:GET useSsl:true validateSsl:true] monitoredResource:map[labels:map[project_id:x] type:uptime_url] name:projects/x/uptimeCheckConfigs/th_uptime_check-ffc0642 period:60s project:xselectedRegions:[USA] timeout:20s]

Suspected cause

https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.uptimeCheckConfigs#UptimeCheckConfig

This field should be omitted when creating the Uptime check configuration; on create, the resource name is assigned by the server and included in the response.

@ColeSiegelTR ColeSiegelTR added the kind/bug Some behavior is incorrect or out of spec label Jan 31, 2022
@ColeSiegelTR
Copy link
Author

I think #291 should fix this apologies if this should be closed instead, not sure how you prefer to track the issues

@danielrbradley danielrbradley added the resolution/duplicate This issue is a duplicate of another issue label Feb 3, 2022
@danielrbradley
Copy link
Member

Yes, this looks like an extension to the autonaming issue. Thanks for the detail. I've included your specific case in #291 and will close here.

@nick-verida
Copy link

Hi - unclear if this is fixed.

Issue #291 seems to be closed, but https://www.pulumi.com/registry/packages/google-native/api-docs/monitoring/v3/uptimecheckconfig/#monitoredresource still requires a name.

If I do

  const myUptimeCheckConfig = new google_native.monitoring.v3.UptimeCheckConfig("uptimename",{...

I get the 400 error above. I can't set it to null or undefined as the type is string and a zero length string still gives the 400 error.

How am I supposed to use this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec resolution/duplicate This issue is a duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants