add_user_to_group ( $group_name, $user_name, $opt )

Adds the specified user to the specified group.

Access

public

Parameters

Parameter

Type

Required

Description

$group_name

string

Required

Name of the group to update. [Constraints: The value must be between 1 and 128 characters, and must match the following regular expression pattern: [\w+=,.@-]*]

$user_name

string

Required

Name of the user to add. [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:

  • 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

Add a user to a group.

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

// Add a user to a group
$response = $iam->add_user_to_group('abcd_group', 'johndoe2');

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

Related Methods

Source

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

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

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback