/
getDocument.ts
97 lines (91 loc) · 2.69 KB
/
getDocument.ts
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
// *** 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! ***
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "../utilities";
/**
* Gets the contents of the specified Systems Manager document.
*
* ## Example Usage
*
* To get the contents of the document owned by AWS.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const foo = pulumi.output(aws.ssm.getDocument({
* documentFormat: "YAML",
* name: "AWS-GatherSoftwareInventory",
* }));
*
* export const content = foo.content;
* ```
* To get the contents of the custom document.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = aws_ssm_document_test.name.apply(name => aws.ssm.getDocument({
* documentFormat: "JSON",
* name: name,
* }));
* ```
*
* > This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/d/ssm_document.html.markdown.
*/
export function getDocument(args: GetDocumentArgs, opts?: pulumi.InvokeOptions): Promise<GetDocumentResult> & GetDocumentResult {
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
const promise: Promise<GetDocumentResult> = pulumi.runtime.invoke("aws:ssm/getDocument:getDocument", {
"documentFormat": args.documentFormat,
"documentVersion": args.documentVersion,
"name": args.name,
}, opts);
return pulumi.utils.liftProperties(promise, opts);
}
/**
* A collection of arguments for invoking getDocument.
*/
export interface GetDocumentArgs {
/**
* Returns the document in the specified format. The document format can be either JSON or YAML. JSON is the default format.
*/
readonly documentFormat?: string;
/**
* The document version for which you want information.
*/
readonly documentVersion?: string;
/**
* The name of the Systems Manager document.
*/
readonly name: string;
}
/**
* A collection of values returned by getDocument.
*/
export interface GetDocumentResult {
/**
* The ARN of the document.
*/
readonly arn: string;
/**
* The contents of the document.
*/
readonly content: string;
readonly documentFormat?: string;
/**
* The type of the document.
*/
readonly documentType: string;
readonly documentVersion?: string;
readonly name: string;
/**
* id is the provider-assigned unique ID for this managed resource.
*/
readonly id: string;
}