Method: Aws::Organizations::Client#update_organizational_unit

Defined in:
lib/aws-sdk-organizations/client.rb

#update_organizational_unit(params = {}) ⇒ Types::UpdateOrganizationalUnitResponse

Renames the specified organizational unit (OU). The ID and ARN do not change. The child OUs and accounts remain in place, and any attached policies of the OU remain attached.

This operation can be called only from the organization’s master account.

Examples:

Example: To rename an organizational unit


# The following example shows how to rename an OU. The output confirms the new name:/n/n

resp = client.update_organizational_unit({
  name: "AccountingOU", 
  organizational_unit_id: "ou-examplerootid111-exampleouid111", 
})

resp.to_h outputs the following:
{
  organizational_unit: {
    arn: "arn:aws:organizations::111111111111:ou/o-exampleorgid/ou-examplerootid111-exampleouid111", 
    id: "ou-examplerootid111-exampleouid111", 
    name: "AccountingOU", 
  }, 
}

Request syntax with placeholder values


resp = client.update_organizational_unit({
  organizational_unit_id: "OrganizationalUnitId", # required
  name: "OrganizationalUnitName",
})

Response structure


resp.organizational_unit.id #=> String
resp.organizational_unit.arn #=> String
resp.organizational_unit.name #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :organizational_unit_id (required, String)

    The unique identifier (ID) of the OU that you want to rename. You can get the ID from the ListOrganizationalUnitsForParent operation.

    The [regex pattern] for an organizational unit ID string requires “ou-” followed by from 4 to 32 lower-case letters or digits (the ID of the root that contains the OU) followed by a second “-” dash and from 8 to 32 additional lower-case letters or digits.

    [1]: wikipedia.org/wiki/regex

  • :name (String)

    The new name that you want to assign to the OU.

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

    [1]: wikipedia.org/wiki/regex

Returns:

See Also:



4140
4141
4142
4143
# File 'lib/aws-sdk-organizations/client.rb', line 4140

def update_organizational_unit(params = {}, options = {})
  req = build_request(:update_organizational_unit, params)
  req.send_request(options)
end