/
getConfig.go
126 lines (108 loc) · 4.09 KB
/
getConfig.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
// *** 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:
//
// !> This datasource has been deprecated in the google (GA) provider, and will only be available in the google-beta provider in a future release.
//
// * [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.LookupConfig(ctx, &runtimeconfig.LookupConfigArgs{
// Name: "my-service",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func LookupConfig(ctx *pulumi.Context, args *LookupConfigArgs, opts ...pulumi.InvokeOption) (*LookupConfigResult, error) {
var rv LookupConfigResult
err := ctx.Invoke("gcp:runtimeconfig/getConfig:getConfig", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getConfig.
type LookupConfigArgs struct {
// The name of the Runtime Configurator configuration.
Name string `pulumi:"name"`
// 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 getConfig.
type LookupConfigResult struct {
Description string `pulumi:"description"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
Project *string `pulumi:"project"`
}
func LookupConfigOutput(ctx *pulumi.Context, args LookupConfigOutputArgs, opts ...pulumi.InvokeOption) LookupConfigResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupConfigResult, error) {
args := v.(LookupConfigArgs)
r, err := LookupConfig(ctx, &args, opts...)
return *r, err
}).(LookupConfigResultOutput)
}
// A collection of arguments for invoking getConfig.
type LookupConfigOutputArgs struct {
// The name of the Runtime Configurator configuration.
Name pulumi.StringInput `pulumi:"name"`
// The project in which the resource belongs. If it
// is not provided, the provider project is used.
Project pulumi.StringPtrInput `pulumi:"project"`
}
func (LookupConfigOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupConfigArgs)(nil)).Elem()
}
// A collection of values returned by getConfig.
type LookupConfigResultOutput struct{ *pulumi.OutputState }
func (LookupConfigResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupConfigResult)(nil)).Elem()
}
func (o LookupConfigResultOutput) ToLookupConfigResultOutput() LookupConfigResultOutput {
return o
}
func (o LookupConfigResultOutput) ToLookupConfigResultOutputWithContext(ctx context.Context) LookupConfigResultOutput {
return o
}
func (o LookupConfigResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupConfigResult) string { return v.Description }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupConfigResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupConfigResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupConfigResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupConfigResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o LookupConfigResultOutput) Project() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupConfigResult) *string { return v.Project }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(LookupConfigResultOutput{})
}