/
getVariable.go
144 lines (123 loc) · 4.87 KB
/
getVariable.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package runtimeconfig
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// To get more information about RuntimeConfigs, see:
//
// * [API documentation](https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs)
// * How-to Guides
// * [Runtime Configurator Fundamentals](https://cloud.google.com/deployment-manager/runtime-configurator/)
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-gcp/sdk/v5/go/gcp/runtimeconfig"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := runtimeconfig.LookupVariable(ctx, &runtimeconfig.LookupVariableArgs{
// Name: "prod-variables/hostname",
// Parent: "my-service",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func LookupVariable(ctx *pulumi.Context, args *LookupVariableArgs, opts ...pulumi.InvokeOption) (*LookupVariableResult, error) {
var rv LookupVariableResult
err := ctx.Invoke("gcp:runtimeconfig/getVariable:getVariable", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getVariable.
type LookupVariableArgs struct {
// The name of the Runtime Configurator configuration.
Name string `pulumi:"name"`
// The name of the RuntimeConfig resource containing this variable.
Parent string `pulumi:"parent"`
// The project in which the resource belongs. If it
// is not provided, the provider project is used.
Project *string `pulumi:"project"`
}
// A collection of values returned by getVariable.
type LookupVariableResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
Parent string `pulumi:"parent"`
Project *string `pulumi:"project"`
Text string `pulumi:"text"`
UpdateTime string `pulumi:"updateTime"`
Value string `pulumi:"value"`
}
func LookupVariableOutput(ctx *pulumi.Context, args LookupVariableOutputArgs, opts ...pulumi.InvokeOption) LookupVariableResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupVariableResult, error) {
args := v.(LookupVariableArgs)
r, err := LookupVariable(ctx, &args, opts...)
return *r, err
}).(LookupVariableResultOutput)
}
// A collection of arguments for invoking getVariable.
type LookupVariableOutputArgs struct {
// The name of the Runtime Configurator configuration.
Name pulumi.StringInput `pulumi:"name"`
// The name of the RuntimeConfig resource containing this variable.
Parent pulumi.StringInput `pulumi:"parent"`
// The project in which the resource belongs. If it
// is not provided, the provider project is used.
Project pulumi.StringPtrInput `pulumi:"project"`
}
func (LookupVariableOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupVariableArgs)(nil)).Elem()
}
// A collection of values returned by getVariable.
type LookupVariableResultOutput struct{ *pulumi.OutputState }
func (LookupVariableResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupVariableResult)(nil)).Elem()
}
func (o LookupVariableResultOutput) ToLookupVariableResultOutput() LookupVariableResultOutput {
return o
}
func (o LookupVariableResultOutput) ToLookupVariableResultOutputWithContext(ctx context.Context) LookupVariableResultOutput {
return o
}
// The provider-assigned unique ID for this managed resource.
func (o LookupVariableResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupVariableResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupVariableResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupVariableResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o LookupVariableResultOutput) Parent() pulumi.StringOutput {
return o.ApplyT(func(v LookupVariableResult) string { return v.Parent }).(pulumi.StringOutput)
}
func (o LookupVariableResultOutput) Project() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupVariableResult) *string { return v.Project }).(pulumi.StringPtrOutput)
}
func (o LookupVariableResultOutput) Text() pulumi.StringOutput {
return o.ApplyT(func(v LookupVariableResult) string { return v.Text }).(pulumi.StringOutput)
}
func (o LookupVariableResultOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupVariableResult) string { return v.UpdateTime }).(pulumi.StringOutput)
}
func (o LookupVariableResultOutput) Value() pulumi.StringOutput {
return o.ApplyT(func(v LookupVariableResult) string { return v.Value }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupVariableResultOutput{})
}