-
Notifications
You must be signed in to change notification settings - Fork 151
/
getParameter.go
135 lines (114 loc) · 4.46 KB
/
getParameter.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
// *** 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 ssm
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an SSM Parameter data source.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ssm"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ssm.LookupParameter(ctx, &ssm.LookupParameterArgs{
// Name: "foo",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// > **Note:** The data source is currently following the behavior of the [SSM API](https://docs.aws.amazon.com/sdk-for-go/api/service/ssm/#Parameter) to return a string value, regardless of parameter type.
func LookupParameter(ctx *pulumi.Context, args *LookupParameterArgs, opts ...pulumi.InvokeOption) (*LookupParameterResult, error) {
var rv LookupParameterResult
err := ctx.Invoke("aws:ssm/getParameter:getParameter", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getParameter.
type LookupParameterArgs struct {
// The name of the parameter.
Name string `pulumi:"name"`
// Whether to return decrypted `SecureString` value. Defaults to `true`.
WithDecryption *bool `pulumi:"withDecryption"`
}
// A collection of values returned by getParameter.
type LookupParameterResult struct {
Arn string `pulumi:"arn"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
Type string `pulumi:"type"`
Value string `pulumi:"value"`
Version int `pulumi:"version"`
WithDecryption *bool `pulumi:"withDecryption"`
}
func LookupParameterOutput(ctx *pulumi.Context, args LookupParameterOutputArgs, opts ...pulumi.InvokeOption) LookupParameterResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupParameterResult, error) {
args := v.(LookupParameterArgs)
r, err := LookupParameter(ctx, &args, opts...)
return *r, err
}).(LookupParameterResultOutput)
}
// A collection of arguments for invoking getParameter.
type LookupParameterOutputArgs struct {
// The name of the parameter.
Name pulumi.StringInput `pulumi:"name"`
// Whether to return decrypted `SecureString` value. Defaults to `true`.
WithDecryption pulumi.BoolPtrInput `pulumi:"withDecryption"`
}
func (LookupParameterOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupParameterArgs)(nil)).Elem()
}
// A collection of values returned by getParameter.
type LookupParameterResultOutput struct{ *pulumi.OutputState }
func (LookupParameterResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupParameterResult)(nil)).Elem()
}
func (o LookupParameterResultOutput) ToLookupParameterResultOutput() LookupParameterResultOutput {
return o
}
func (o LookupParameterResultOutput) ToLookupParameterResultOutputWithContext(ctx context.Context) LookupParameterResultOutput {
return o
}
func (o LookupParameterResultOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v LookupParameterResult) string { return v.Arn }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupParameterResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupParameterResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupParameterResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupParameterResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o LookupParameterResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v LookupParameterResult) string { return v.Type }).(pulumi.StringOutput)
}
func (o LookupParameterResultOutput) Value() pulumi.StringOutput {
return o.ApplyT(func(v LookupParameterResult) string { return v.Value }).(pulumi.StringOutput)
}
func (o LookupParameterResultOutput) Version() pulumi.IntOutput {
return o.ApplyT(func(v LookupParameterResult) int { return v.Version }).(pulumi.IntOutput)
}
func (o LookupParameterResultOutput) WithDecryption() pulumi.BoolPtrOutput {
return o.ApplyT(func(v LookupParameterResult) *bool { return v.WithDecryption }).(pulumi.BoolPtrOutput)
}
func init() {
pulumi.RegisterOutputType(LookupParameterResultOutput{})
}