https://pulumi.com logo
Title
n

narrow-airport-65967

03/30/2021, 9:05 PM
Hi!, I have a question. I have: Uri pulumi.Input
pulumi:"uri"
, how to use pulumi.Input, I tried, Uri: pulumi.Input{"string"}, but don't work, I tried Uri: pulumi.Input{"key":"value"}, but dont work too, somebody help me ?
l

little-cartoon-10569

03/30/2021, 9:16 PM
Do you have a variable uri that you want to pass it to a property in a Pulumi resource? We need to know the resource type and the current variable type, to give you an accurate answer. Can you post a little code?
You can use the text snippet tool, in the lightning menu <==
n

narrow-airport-65967

03/30/2021, 9:19 PM
type VirtualServiceSpecHttpMatchArgs struct {
	Authority pulumi.Input `pulumi:"authority"`
	// Names of gateways where the rule should be applied.
	Gateways pulumi.StringArrayInput `pulumi:"gateways"`
	Headers  pulumi.MapInput         `pulumi:"headers"`
	// Flag to specify whether the URI matching should be case-insensitive.
	IgnoreUriCase pulumi.BoolPtrInput `pulumi:"ignoreUriCase"`
	Method        pulumi.Input        `pulumi:"method"`
	// The name assigned to a match.
	Name pulumi.StringPtrInput `pulumi:"name"`
	// Specifies the ports on the host that is being addressed.
	Port pulumi.IntPtrInput `pulumi:"port"`
	// Query parameters for matching.
	QueryParams  pulumi.MapInput       `pulumi:"queryParams"`
	Scheme       pulumi.Input          `pulumi:"scheme"`
	SourceLabels pulumi.StringMapInput `pulumi:"sourceLabels"`
	// Source namespace constraining the applicability of a rule to workloads in that namespace.
	SourceNamespace pulumi.StringPtrInput `pulumi:"sourceNamespace"`
	Uri             pulumi.Input          `pulumi:"uri"`
	// withoutHeader has the same syntax with the header, but has opposite meaning.
	WithoutHeaders pulumi.MapInput `pulumi:"withoutHeaders"`
this is my type
Spec: v1beta1.VirtualServiceSpecArgs{
					Gateways: pulumi.StringArray{pulumi.String("tj-istio-gateway.istio-system.svc.cluster.local")},
					Hosts:    pulumi.StringArray{pulumi.String("<http://workflow-julioleal.saj6.softplan.com.br|workflow-julioleal.saj6.softplan.com.br>")},
					Http: v1beta1.VirtualServiceSpecHttpArray{
						v1beta1.VirtualServiceSpecHttpArgs{
							Name: pulumi.String(ctx.Project()),
							Match: v1beta1.VirtualServiceSpecHttpMatchArray{
								v1beta1.VirtualServiceSpecHttpMatchArgs{
									Name: pulumi.String(ctx.Project() + "-match"),
									Uri: pulumi.Input{
										pulumi.String(`{"prefix": "/"}`),
									},
								},
							},
						},
					},
				},
this is my code
l

little-cartoon-10569

03/30/2021, 9:20 PM
Is that golang?
n

narrow-airport-65967

03/30/2021, 9:31 PM
Yes
l

little-cartoon-10569

03/30/2021, 9:32 PM
That's over my head, I'm afraid. Maybe someone over in #golang might be able to help?