@pulumi/aws-native
Version:
The Pulumi AWS Cloud Control Provider enables you to build, deploy, and manage [any AWS resource that's supported by the AWS Cloud Control API](https://github.com/pulumi/pulumi-aws-native/blob/master/provider/cmd/pulumi-gen-aws-native/supported-types.txt)
230 lines • 9.41 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Document = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* The AWS::SSM::Document resource is an SSM document in AWS Systems Manager that defines the actions that Systems Manager performs, which can be used to set up and run commands on your instances.
*
* ## Example Usage
* ### Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws_native from "@pulumi/aws-native";
*
* const sessionPreferencesDocument = new aws_native.ssm.Document("sessionPreferencesDocument", {
* name: "SSM-SessionManagerRunShell",
* content: {
* schemaVersion: "1.0",
* description: "Document to hold regional settings for Session Manager",
* sessionType: "Standard_Stream",
* inputs: {
* s3BucketName: "DOC-EXAMPLE-BUCKET",
* s3KeyPrefix: "MyBucketPrefix",
* s3EncryptionEnabled: true,
* cloudWatchLogGroupName: "MyLogGroupName",
* cloudWatchEncryptionEnabled: true,
* cloudWatchStreamingEnabled: false,
* kmsKeyId: "MyKMSKeyID",
* runAsEnabled: false,
* runAsDefaultUser: "MyDefaultRunAsUser",
* idleSessionTimeout: "20",
* shellProfile: {
* windows: "example commands",
* linux: "example commands",
* },
* },
* },
* documentType: aws_native.ssm.DocumentType.Session,
* });
* export const documentName = "SSM-SessionManagerRunShell";
*
* ```
* ### Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws_native from "@pulumi/aws-native";
*
* const sessionPreferencesDocument = new aws_native.ssm.Document("sessionPreferencesDocument", {
* name: "SSM-SessionManagerRunShell",
* content: {
* schemaVersion: "1.0",
* description: "Document to hold regional settings for Session Manager",
* sessionType: "Standard_Stream",
* inputs: {
* s3BucketName: "DOC-EXAMPLE-BUCKET",
* s3KeyPrefix: "MyBucketPrefix",
* s3EncryptionEnabled: true,
* cloudWatchLogGroupName: "MyLogGroupName",
* cloudWatchEncryptionEnabled: true,
* cloudWatchStreamingEnabled: false,
* kmsKeyId: "MyKMSKeyID",
* runAsEnabled: false,
* runAsDefaultUser: "MyDefaultRunAsUser",
* idleSessionTimeout: "20",
* shellProfile: {
* windows: "example commands",
* linux: "example commands",
* },
* },
* },
* documentFormat: aws_native.ssm.DocumentFormat.Yaml,
* documentType: aws_native.ssm.DocumentType.Session,
* });
* export const documentName = "SSM-SessionManagerRunShell";
*
* ```
* ### Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws_native from "@pulumi/aws-native";
*
* const examplePackageDocument = new aws_native.ssm.Document("examplePackageDocument", {
* content: "{\"files\": {\"NewPackage_WINDOWS.zip\": {\"checksums\": {\"sha256\": \"36aeb0ec2c706013cf8c68163459678f7f6daa9489cd3f91d52799331EXAMPLE\"}}}, \"publisher\": \"publisherName\", \"schemaVersion\": \"2.0\", \"packages\": {\"_any\": {\"_any\": {\"x86_64\": {\"file\": \"NewPackage_WINDOWS.zip\"}}}}, \"version\": \"1.0\"}",
* documentType: aws_native.ssm.DocumentType.Package,
* attachments: [{
* key: aws_native.ssm.DocumentAttachmentsSourceKey.SourceUrl,
* values: ["s3://example-package-path/valid-package"],
* }],
* });
*
* ```
* ### Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws_native from "@pulumi/aws-native";
*
* const examplePackageDocument = new aws_native.ssm.Document("examplePackageDocument", {
* content: "{\\\"files\\\": {\\\"NewPackage_WINDOWS.zip\\\": {\\\"checksums\\\": {\\\"sha256\\\": \\\"36aeb0ec2c706013cf8c68163459678f7f6daa9489cd3f91d52799331EXAMPLE\\\"}}}, \\\"publisher\\\": \\\"publisherName\\\", \\\"schemaVersion\\\": \\\"2.0\\\", \\\"packages\\\": {\\\"_any\\\": {\\\"_any\\\": {\\\"x86_64\\\": {\\\"file\\\": \\\"NewPackage_WINDOWS.zip\\\"}}}}, \\\"version\\\": \\\"1.0\\\"}",
* documentType: aws_native.ssm.DocumentType.Package,
* attachments: [{
* key: aws_native.ssm.DocumentAttachmentsSourceKey.SourceUrl,
* values: ["s3://example-package-path/valid-package"],
* }],
* });
*
* ```
* ### Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws_native from "@pulumi/aws-native";
*
* const exampleChangeCalendarDocument = new aws_native.ssm.Document("exampleChangeCalendarDocument", {
* content: `BEGIN:VCALENDAR\\r
* PRODID:-//AWS//Change Calendar 1.0//EN\\r
* VERSION:2.0\\r
* X-CALENDAR-TYPE:DEFAULT_OPEN\\r
* X-WR-CALDESC:test\\r
* BEGIN:VTODO\\r
* DTSTAMP:20200320T004207Z\\r
* UID:3b5af39a-d0b3-4049-a839-d7bb8af01f92\\r
* SUMMARY:Add events to this calendar.\\r
* END:VTODO\\r
* END:VCALENDAR\\r
* `,
* documentType: aws_native.ssm.DocumentType.ChangeCalendar,
* documentFormat: aws_native.ssm.DocumentFormat.Text,
* });
*
* ```
* ### Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws_native from "@pulumi/aws-native";
*
* const exampleChangeCalendarDocument = new aws_native.ssm.Document("exampleChangeCalendarDocument", {
* content: `BEGIN:VCALENDAR\\r
* PRODID:-//AWS//Change Calendar 1.0//EN\\r
* VERSION:2.0\\r
* X-CALENDAR-TYPE:DEFAULT_OPEN\\r
* X-WR-CALDESC:test\\r
* BEGIN:VTODO\\r
* DTSTAMP:20200320T004207Z\\r
* UID:3b5af39a-d0b3-4049-a839-d7bb8af01f92\\r
* SUMMARY:Add events to this calendar.\\r
* END:VTODO\\r
* END:VCALENDAR\\r
* `,
* documentType: aws_native.ssm.DocumentType.ChangeCalendar,
* documentFormat: aws_native.ssm.DocumentFormat.Text,
* });
*
* ```
*/
class Document extends pulumi.CustomResource {
/**
* Get an existing Document resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, opts) {
return new Document(name, undefined, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Document. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Document.__pulumiType;
}
/**
* Create a Document resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name, args, opts) {
let resourceInputs = {};
opts = opts || {};
if (!opts.id) {
if (args?.content === undefined && !opts.urn) {
throw new Error("Missing required property 'content'");
}
resourceInputs["attachments"] = args?.attachments;
resourceInputs["content"] = args?.content;
resourceInputs["documentFormat"] = args?.documentFormat;
resourceInputs["documentType"] = args?.documentType;
resourceInputs["name"] = args?.name;
resourceInputs["requires"] = args?.requires;
resourceInputs["tags"] = args?.tags;
resourceInputs["targetType"] = args?.targetType;
resourceInputs["updateMethod"] = args?.updateMethod;
resourceInputs["versionName"] = args?.versionName;
}
else {
resourceInputs["attachments"] = undefined /*out*/;
resourceInputs["content"] = undefined /*out*/;
resourceInputs["documentFormat"] = undefined /*out*/;
resourceInputs["documentType"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["requires"] = undefined /*out*/;
resourceInputs["tags"] = undefined /*out*/;
resourceInputs["targetType"] = undefined /*out*/;
resourceInputs["updateMethod"] = undefined /*out*/;
resourceInputs["versionName"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const replaceOnChanges = { replaceOnChanges: ["documentType", "name"] };
opts = pulumi.mergeOptions(opts, replaceOnChanges);
super(Document.__pulumiType, name, resourceInputs, opts);
}
}
exports.Document = Document;
/** @internal */
Document.__pulumiType = 'aws-native:ssm:Document';
//# sourceMappingURL=document.js.map