-
Notifications
You must be signed in to change notification settings - Fork 151
/
getDocument.go
96 lines (91 loc) · 2.63 KB
/
getDocument.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
// *** 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"
)
// Gets the contents of the specified Systems Manager document.
//
// ## Example Usage
//
// To get the contents of the document owned by AWS.
//
// ```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 {
// opt0 := "YAML"
// foo, err := ssm.LookupDocument(ctx, &ssm.LookupDocumentArgs{
// Name: "AWS-GatherSoftwareInventory",
// DocumentFormat: &opt0,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("content", foo.Content)
// return nil
// })
// }
// ```
//
// To get the contents of the custom document.
//
// ```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 {
// opt0 := "JSON"
// _, err := ssm.LookupDocument(ctx, &ssm.LookupDocumentArgs{
// Name: aws_ssm_document.Test.Name,
// DocumentFormat: &opt0,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func LookupDocument(ctx *pulumi.Context, args *LookupDocumentArgs, opts ...pulumi.InvokeOption) (*LookupDocumentResult, error) {
var rv LookupDocumentResult
err := ctx.Invoke("aws:ssm/getDocument:getDocument", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getDocument.
type LookupDocumentArgs struct {
// Returns the document in the specified format. The document format can be either JSON or YAML. JSON is the default format.
DocumentFormat *string `pulumi:"documentFormat"`
// The document version for which you want information.
DocumentVersion *string `pulumi:"documentVersion"`
// The name of the Systems Manager document.
Name string `pulumi:"name"`
}
// A collection of values returned by getDocument.
type LookupDocumentResult struct {
// The ARN of the document.
Arn string `pulumi:"arn"`
// The contents of the document.
Content string `pulumi:"content"`
DocumentFormat *string `pulumi:"documentFormat"`
// The type of the document.
DocumentType string `pulumi:"documentType"`
DocumentVersion *string `pulumi:"documentVersion"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
}