Class: AWSCDK::Organizations::CfnOrganizationalUnitProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
organizations/cfn_organizational_unit_props.rb

Overview

Properties for defining a CfnOrganizationalUnit.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, parent_id:, tags: nil) ⇒ CfnOrganizationalUnitProps

Returns a new instance of CfnOrganizationalUnitProps.

Parameters:

  • name (String)

    The friendly name of this OU.

  • parent_id (String)

    The unique identifier (ID) of the parent root or OU that you want to create the new OU in.

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

    A list of tags that you want to attach to the newly created OU.



12
13
14
15
16
17
18
19
# File 'organizations/cfn_organizational_unit_props.rb', line 12

def initialize(name:, parent_id:, tags: nil)
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @parent_id = parent_id
  Jsii::Type.check_type(@parent_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "parentId")
  @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?
end

Instance Attribute Details

#nameString (readonly)

The friendly name of this OU.

The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.



27
28
29
# File 'organizations/cfn_organizational_unit_props.rb', line 27

def name
  @name
end

#parent_idString (readonly)

The unique identifier (ID) of the parent root or OU that you want to create the new OU in.

To update the ParentId parameter value, you must first remove all accounts attached to the organizational unit (OU). OUs can't be moved within the organization with accounts still attached.

The regex pattern for a parent ID string requires one of the following:

  • Root - A string that begins with "r-" followed by from 4 to 32 lowercase letters or digits.
  • Organizational unit (OU) - A string that begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This string is followed by a second "-" dash and from 8 to 32 additional lowercase letters or digits.


39
40
41
# File 'organizations/cfn_organizational_unit_props.rb', line 39

def parent_id
  @parent_id
end

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

A list of tags that you want to attach to the newly created OU.

For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null . For more information about tagging, see Tagging AWS Organizations resources in the AWS Organizations User Guide.

If any one of the tags is not valid or if you exceed the allowed number of tags for an OU, then the entire request fails and the OU is not created.



48
49
50
# File 'organizations/cfn_organizational_unit_props.rb', line 48

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



50
51
52
53
54
55
56
# File 'organizations/cfn_organizational_unit_props.rb', line 50

def self.jsii_properties
  {
    :name => "name",
    :parent_id => "parentId",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



58
59
60
61
62
63
64
65
66
# File 'organizations/cfn_organizational_unit_props.rb', line 58

def to_jsii
  result = {}
  result.merge!({
    "name" => @name,
    "parentId" => @parent_id,
    "tags" => @tags,
  })
  result.compact
end