update_group ( $group_name, $opt )

Updates the name and/or the path of the specified group.

You should understand the implications of changing a group’s path or name. For more information, see Renaming Users and Groups in Using AWS Identity and Access Management.

To change a group name the requester must have appropriate permissions on both the source object and the target object. For example, to change Managers to MGRs, the entity making the request must have permission on Managers and MGRs, or must have permission on all (*). For more information about permissions, see Permissions and Policies.

Access

public

Parameters

Parameter

Type

Required

Description

$group_name

string

Required

Name of the group to update. If you’re changing the name of the group, this is the original name. [Constraints: The value must be between 1 and 128 characters, and must match the following regular expression pattern: [\w+=,.@-]*]

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • NewPath - string - Optional - New path for the group. Only include this if changing the group’s path. [Constraints: The value must be between 1 and 512 characters, and must match the following regular expression pattern: (\u002F)|(\u002F[\u0021-\u007F]+\u002F)]
  • NewGroupName - string - Optional - New name for the group. Only include this if changing the group’s name. [Constraints: The value must be between 1 and 128 characters, and must match the following regular expression pattern: [\w+=,.@-]*]
  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Update an existing user group.

// Instantiate the class
$iam = new AmazonIAM();

// Create a new parent group
$response = $iam->update_group('xyz_group', array(
	'NewGroupName' => 'wxyz_group'
));

// Success?
var_dump($response->isOK());
Result:
bool(true)

Update an existing user group.

// Instantiate the class
$iam = new AmazonIAM();

// Create a new parent group
$response = $iam->update_group('abc_group', array(
	'NewGroupName' => 'abcd_group'
));

// Success?
var_dump($response->isOK());
Result:
bool(true)

Related Methods

Source

Method defined in services/iam.class.php | Toggle source view (7 lines) | View on GitHub

public function update_group($group_name, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['GroupName'] = $group_name;
    
    return $this->authenticate('UpdateGroup', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback