Class: AWSCDK::SSM::CfnDocumentProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ssm/cfn_document_props.rb

Overview

Properties for defining a CfnDocument.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content:, attachments: nil, document_format: nil, document_type: nil, name: nil, requires: nil, tags: nil, target_type: nil, update_method: nil, version_name: nil) ⇒ CfnDocumentProps

Returns a new instance of CfnDocumentProps.

Parameters:

  • content (Object)

    The content for the new SSM document in JSON or YAML.

  • attachments (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::SSM::CfnDocument::AttachmentsSourceProperty>, nil) (defaults to: nil)

    A list of key-value pairs that describe attachments to a version of a document.

  • document_format (String, nil) (defaults to: nil)

    Specify the document format for the request.

  • document_type (String, nil) (defaults to: nil)

    The type of document to create.

  • name (String, nil) (defaults to: nil)

    A name for the SSM document.

  • requires (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::SSM::CfnDocument::DocumentRequiresProperty>, nil) (defaults to: nil)

    A list of SSM documents required by a document.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    AWS CloudFormation resource tags to apply to the document.

  • target_type (String, nil) (defaults to: nil)

    Specify a target type to define the kinds of resources the document can run on.

  • update_method (String, nil) (defaults to: nil)

    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.

  • version_name (String, nil) (defaults to: nil)

    An optional field specifying the version of the artifact you are creating with the document.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'ssm/cfn_document_props.rb', line 19

def initialize(content:, attachments: nil, document_format: nil, document_type: nil, name: nil, requires: nil, tags: nil, target_type: nil, update_method: nil, version_name: nil)
  @content = content
  Jsii::Type.check_type(@content, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "content")
  @attachments = attachments
  Jsii::Type.check_type(@attachments, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3NtLkNmbkRvY3VtZW50LkF0dGFjaG1lbnRzU291cmNlUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "attachments") unless @attachments.nil?
  @document_format = document_format
  Jsii::Type.check_type(@document_format, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "documentFormat") unless @document_format.nil?
  @document_type = document_type
  Jsii::Type.check_type(@document_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "documentType") unless @document_type.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @requires = requires
  Jsii::Type.check_type(@requires, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3NtLkNmbkRvY3VtZW50LkRvY3VtZW50UmVxdWlyZXNQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "requires") unless @requires.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
  @target_type = target_type
  Jsii::Type.check_type(@target_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "targetType") unless @target_type.nil?
  @update_method = update_method
  Jsii::Type.check_type(@update_method, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "updateMethod") unless @update_method.nil?
  @version_name = version_name
  Jsii::Type.check_type(@version_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "versionName") unless @version_name.nil?
end

Instance Attribute Details

#attachmentsAWSCDK::IResolvable, ... (readonly)

A list of key-value pairs that describe attachments to a version of a document.



55
56
57
# File 'ssm/cfn_document_props.rb', line 55

def attachments
  @attachments
end

#contentObject (readonly)

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.



50
51
52
# File 'ssm/cfn_document_props.rb', line 50

def content
  @content
end

#document_formatString? (readonly)

Note:

Default: - "JSON"

Specify the document format for the request.

JSON is the default format.



63
64
65
# File 'ssm/cfn_document_props.rb', line 63

def document_format
  @document_format
end

#document_typeString? (readonly)

The type of document to create.



68
69
70
# File 'ssm/cfn_document_props.rb', line 68

def document_type
  @document_type
end

#nameString? (readonly)

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
  • AWSEC2
  • AWSConfigRemediation
  • AWSSupport


82
83
84
# File 'ssm/cfn_document_props.rb', line 82

def name
  @name
end

#requiresAWSCDK::IResolvable, ... (readonly)

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 .



89
90
91
# File 'ssm/cfn_document_props.rb', line 89

def requires
  @requires
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

AWS CloudFormation resource tags to apply to the document.

Use tags to help you identify and categorize resources.



96
97
98
# File 'ssm/cfn_document_props.rb', line 96

def tags
  @tags
end

#target_typeString? (readonly)

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 .



103
104
105
# File 'ssm/cfn_document_props.rb', line 103

def target_type
  @target_type
end

#update_methodString? (readonly)

Note:

Default: - "Replace"

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.



111
112
113
# File 'ssm/cfn_document_props.rb', line 111

def update_method
  @update_method
end

#version_nameString? (readonly)

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.



118
119
120
# File 'ssm/cfn_document_props.rb', line 118

def version_name
  @version_name
end

Class Method Details

.jsii_propertiesObject



120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'ssm/cfn_document_props.rb', line 120

def self.jsii_properties
  {
    :content => "content",
    :attachments => "attachments",
    :document_format => "documentFormat",
    :document_type => "documentType",
    :name => "name",
    :requires => "requires",
    :tags => "tags",
    :target_type => "targetType",
    :update_method => "updateMethod",
    :version_name => "versionName",
  }
end

Instance Method Details

#to_jsiiObject



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'ssm/cfn_document_props.rb', line 135

def to_jsii
  result = {}
  result.merge!({
    "content" => @content,
    "attachments" => @attachments,
    "documentFormat" => @document_format,
    "documentType" => @document_type,
    "name" => @name,
    "requires" => @requires,
    "tags" => @tags,
    "targetType" => @target_type,
    "updateMethod" => @update_method,
    "versionName" => @version_name,
  })
  result.compact
end