UNPKG

@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)

272 lines (271 loc) • 11.6 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; import * as enums from "../types/enums"; /** * 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, * }); * * ``` */ export declare 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: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): Document; /** * 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: any): obj is Document; /** * A list of key and value pairs that describe attachments to a version of a document. */ readonly attachments: pulumi.Output<outputs.ssm.DocumentAttachmentsSource[] | undefined>; /** * The content for the Systems Manager document in JSON, YAML or String format. * * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::SSM::Document` for more information about the expected schema for this property. */ readonly content: pulumi.Output<any>; /** * Specify the document format for the request. The document format can be either JSON or YAML. JSON is the default format. */ readonly documentFormat: pulumi.Output<enums.ssm.DocumentFormat | undefined>; /** * The type of document to create. */ readonly documentType: pulumi.Output<enums.ssm.DocumentType | undefined>; /** * A name for the Systems Manager document. */ readonly name: pulumi.Output<string | undefined>; /** * A list of SSM documents required by a document. For example, an ApplicationConfiguration document requires an ApplicationConfigurationSchema document. */ readonly requires: pulumi.Output<outputs.ssm.DocumentRequires[] | undefined>; /** * Optional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. */ readonly tags: pulumi.Output<outputs.Tag[] | undefined>; /** * Specify a target type to define the kinds of resources the document can run on. */ readonly targetType: pulumi.Output<string | undefined>; /** * Update method - when set to 'Replace', the update will replace the existing document; when set to 'NewVersion', the update will create a new version. */ readonly updateMethod: pulumi.Output<enums.ssm.DocumentUpdateMethod | undefined>; /** * An optional field specifying the version of the artifact you are creating with the document. This value is unique across all versions of a document, and cannot be changed. */ readonly versionName: pulumi.Output<string | undefined>; /** * 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: string, args: DocumentArgs, opts?: pulumi.CustomResourceOptions); } /** * The set of arguments for constructing a Document resource. */ export interface DocumentArgs { /** * A list of key and value pairs that describe attachments to a version of a document. */ attachments?: pulumi.Input<pulumi.Input<inputs.ssm.DocumentAttachmentsSourceArgs>[]>; /** * The content for the Systems Manager document in JSON, YAML or String format. * * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::SSM::Document` for more information about the expected schema for this property. */ content: any; /** * Specify the document format for the request. The document format can be either JSON or YAML. JSON is the default format. */ documentFormat?: pulumi.Input<enums.ssm.DocumentFormat>; /** * The type of document to create. */ documentType?: pulumi.Input<enums.ssm.DocumentType>; /** * A name for the Systems Manager document. */ name?: pulumi.Input<string>; /** * A list of SSM documents required by a document. For example, an ApplicationConfiguration document requires an ApplicationConfigurationSchema document. */ requires?: pulumi.Input<pulumi.Input<inputs.ssm.DocumentRequiresArgs>[]>; /** * Optional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. */ tags?: pulumi.Input<pulumi.Input<inputs.TagArgs>[]>; /** * Specify a target type to define the kinds of resources the document can run on. */ targetType?: pulumi.Input<string>; /** * Update method - when set to 'Replace', the update will replace the existing document; when set to 'NewVersion', the update will create a new version. */ updateMethod?: pulumi.Input<enums.ssm.DocumentUpdateMethod>; /** * An optional field specifying the version of the artifact you are creating with the document. This value is unique across all versions of a document, and cannot be changed. */ versionName?: pulumi.Input<string>; }