pulumi-azure-native icon indicating copy to clipboard operation
pulumi-azure-native copied to clipboard

All Example Go SDK Code for Azure Insights do not Work

Open phillipedwards opened this issue 2 years ago • 2 comments

Hello!

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

Issue details

When copying the code from the azure-native Insights resources, for Go, all examples are broken. Specifically, the Alerts and Criteria properties report the error "Missing Method ElementType".

More info:

  • In the examples, []insights.MetricAlertActionArgs is used for the Alerts property, however, the type of Alerts is insights.MetricAlertActionArray`.
  • In the examples, insights.MetricAlert.........Criteria is used for the Criteria property, however, the type of Criteria is pulumi.Input.

Steps to reproduce

  1. Create a new pulumi go program with pulumi new azure-go
  2. Go to https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/metricalert/
  3. Copy any one of the Go SDK examples and paste it into your newly created Pulumi Azure program (main.go).
  4. View errors

Expected: Code copied from Pulumi examples to work Actual: Code copied from Pulumi examples does now work/compile.

phillipedwards avatar Mar 16 '22 16:03 phillipedwards

This is due to pulumi/pulumi#7735, point 4. As a codegen issue, it should be fixed in pulumi/pulumi. Marking as upstream.

thomas11 avatar Aug 23 '23 08:08 thomas11

Current status: the MetricAlertActionArgs vs MetricAlertActionArray is fixed. The Criteria issue is not.

thomas11 avatar Apr 10 '24 12:04 thomas11