/
getParameter.go
63 lines (58 loc) · 1.87 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
// *** 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 (
"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"`
}