Hi, I’m having trouble with creating organization ...
# golang
m
Hi, I’m having trouble with creating organization policies in GCP with golang (I am new to Go and trying to learn by doing 😅 ) Here’s what I’m trying:
Copy code
pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := orgpolicy.NewPolicy(ctx, "primary", &orgpolicy.PolicyArgs{
			Parent: pulumi.String(org),
			Name:   pulumi.String("gcp.resourceLocations"),
			Spec: &orgpolicy.PolicySpecArgs{
				Rules: orgpolicy.PolicySpecRuleArray{
					&orgpolicy.PolicySpecRuleArgs{
						Enforce: pulumi.String("TRUE"),
						Values: orgpolicy.PolicySpecRuleValues{
							AllowedValues: []string{"region1", "region2"},
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
but I’m getting an error :
Copy code
cannot use orgpolicy.PolicySpecRuleValues{...} (type orgpolicy.PolicySpecRuleValues) as type orgpolicy.PolicySpecRuleValuesPtrInput in field value:
        orgpolicy.PolicySpecRuleValues does not implement orgpolicy.PolicySpecRuleValuesPtrInput (missing ElementType method)
anyone experienced this?