Class CfnDocument

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:37.737Z") @Stability(Stable) public class CfnDocument extends CfnResource implements IInspectable
A CloudFormation AWS::SSM::Document.

The AWS::SSM::Document resource creates a Systems Manager (SSM) document in AWS Systems Manager . This document defines the actions that Systems Manager performs on your AWS resources.

This resource does not support CloudFormation drift detection.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.ssm.*;
 Object content;
 CfnDocument cfnDocument = CfnDocument.Builder.create(this, "MyCfnDocument")
         .content(content)
         // the properties below are optional
         .attachments(List.of(AttachmentsSourceProperty.builder()
                 .key("key")
                 .name("name")
                 .values(List.of("values"))
                 .build()))
         .documentFormat("documentFormat")
         .documentType("documentType")
         .name("name")
         .requires(List.of(DocumentRequiresProperty.builder()
                 .name("name")
                 .version("version")
                 .build()))
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .targetType("targetType")
         .updateMethod("updateMethod")
         .versionName("versionName")
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnDocument

      protected CfnDocument(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnDocument

      protected CfnDocument(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnDocument

      @Stability(Stable) public CfnDocument(@NotNull Construct scope, @NotNull String id, @NotNull CfnDocumentProps props)
      Create a new AWS::SSM::Document.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      AWS CloudFormation resource tags to apply to the document.

      Use tags to help you identify and categorize resources.

    • getContent

      @Stability(Stable) @NotNull public Object getContent()
      The content for the new SSM document in JSON or YAML.

      For more information about the schemas for SSM document content, see SSM document schema features and examples in the AWS Systems Manager User Guide .

      This parameter also supports String data types.

    • setContent

      @Stability(Stable) public void setContent(@NotNull Object value)
      The content for the new SSM document in JSON or YAML.

      For more information about the schemas for SSM document content, see SSM document schema features and examples in the AWS Systems Manager User Guide .

      This parameter also supports String data types.

    • getAttachments

      @Stability(Stable) @Nullable public Object getAttachments()
      A list of key-value pairs that describe attachments to a version of a document.
    • setAttachments

      @Stability(Stable) public void setAttachments(@Nullable IResolvable value)
      A list of key-value pairs that describe attachments to a version of a document.
    • setAttachments

      @Stability(Stable) public void setAttachments(@Nullable List<Object> value)
      A list of key-value pairs that describe attachments to a version of a document.
    • getDocumentFormat

      @Stability(Stable) @Nullable public String getDocumentFormat()
      Specify the document format for the request.

      JSON is the default format.

    • setDocumentFormat

      @Stability(Stable) public void setDocumentFormat(@Nullable String value)
      Specify the document format for the request.

      JSON is the default format.

    • getDocumentType

      @Stability(Stable) @Nullable public String getDocumentType()
      The type of document to create.

      Allowed Values : ApplicationConfigurationSchema | Automation | Automation.ChangeTemplate | Command | DeploymentStrategy | Package | Policy | Session

    • setDocumentType

      @Stability(Stable) public void setDocumentType(@Nullable String value)
      The type of document to create.

      Allowed Values : ApplicationConfigurationSchema | Automation | Automation.ChangeTemplate | Command | DeploymentStrategy | Package | Policy | Session

    • getName

      @Stability(Stable) @Nullable public String getName()
      A name for the SSM document.

      You can't use the following strings as document name prefixes. These are reserved by AWS for use as document name prefixes:

      • aws
      • amazon
      • amzn

    • setName

      @Stability(Stable) public void setName(@Nullable String value)
      A name for the SSM document.

      You can't use the following strings as document name prefixes. These are reserved by AWS for use as document name prefixes:

      • aws
      • amazon
      • amzn

    • getRequires

      @Stability(Stable) @Nullable public Object getRequires()
      A list of SSM documents required by a document.

      This parameter is used exclusively by AWS AppConfig . When a user creates an AWS AppConfig configuration in an SSM document, the user must also specify a required document for validation purposes. In this case, an ApplicationConfiguration document requires an ApplicationConfigurationSchema document for validation purposes. For more information, see What is AWS AppConfig ? in the AWS AppConfig User Guide .

    • setRequires

      @Stability(Stable) public void setRequires(@Nullable IResolvable value)
      A list of SSM documents required by a document.

      This parameter is used exclusively by AWS AppConfig . When a user creates an AWS AppConfig configuration in an SSM document, the user must also specify a required document for validation purposes. In this case, an ApplicationConfiguration document requires an ApplicationConfigurationSchema document for validation purposes. For more information, see What is AWS AppConfig ? in the AWS AppConfig User Guide .

    • setRequires

      @Stability(Stable) public void setRequires(@Nullable List<Object> value)
      A list of SSM documents required by a document.

      This parameter is used exclusively by AWS AppConfig . When a user creates an AWS AppConfig configuration in an SSM document, the user must also specify a required document for validation purposes. In this case, an ApplicationConfiguration document requires an ApplicationConfigurationSchema document for validation purposes. For more information, see What is AWS AppConfig ? in the AWS AppConfig User Guide .

    • getTargetType

      @Stability(Stable) @Nullable public String getTargetType()
      Specify a target type to define the kinds of resources the document can run on.

      For example, to run a document on EC2 instances, specify the following value: /AWS::EC2::Instance . If you specify a value of '/' the document can run on all types of resources. If you don't specify a value, the document can't run on any resources. For a list of valid resource types, see AWS resource and property types reference in the AWS CloudFormation User Guide .

    • setTargetType

      @Stability(Stable) public void setTargetType(@Nullable String value)
      Specify a target type to define the kinds of resources the document can run on.

      For example, to run a document on EC2 instances, specify the following value: /AWS::EC2::Instance . If you specify a value of '/' the document can run on all types of resources. If you don't specify a value, the document can't run on any resources. For a list of valid resource types, see AWS resource and property types reference in the AWS CloudFormation User Guide .

    • getUpdateMethod

      @Stability(Stable) @Nullable public String getUpdateMethod()
      If the document resource you specify in your template already exists, this parameter determines whether a new version of the existing document is created, or the existing document is replaced.

      Replace is the default method. If you specify NewVersion for the UpdateMethod parameter, and the Name of the document does not match an existing resource, a new document is created. When you specify NewVersion , the default version of the document is changed to the newly created version.

    • setUpdateMethod

      @Stability(Stable) public void setUpdateMethod(@Nullable String value)
      If the document resource you specify in your template already exists, this parameter determines whether a new version of the existing document is created, or the existing document is replaced.

      Replace is the default method. If you specify NewVersion for the UpdateMethod parameter, and the Name of the document does not match an existing resource, a new document is created. When you specify NewVersion , the default version of the document is changed to the newly created version.

    • getVersionName

      @Stability(Stable) @Nullable public String getVersionName()
      An optional field specifying the version of the artifact you are creating with the document.

      For example, Release12.1 . This value is unique across all versions of a document, and can't be changed.

    • setVersionName

      @Stability(Stable) public void setVersionName(@Nullable String value)
      An optional field specifying the version of the artifact you are creating with the document.

      For example, Release12.1 . This value is unique across all versions of a document, and can't be changed.