create_group ( $group_name, $opt )

Creates a new group.

For information about the number of groups you can create, see Limitations on IAM Entities in Using AWS Identity and Access Management.

Access

public

Parameters

Parameter

Type

Required

Description

$group_name

string

Required

Name of the group to create. Do not include the path in this value. [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:

  • Path - string - Optional - The path to the group. For more information about paths, see Identifiers for IAM Entities in Using AWS Identity and Access Management. This parameter is optional. If it is not included, it defaults to a slash (/). [Constraints: The value must be between 1 and 512 characters, and must match the following regular expression pattern: (\u002F)|(\u002F[\u0021-\u007F]+\u002F)]
  • 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

Create a new user group.

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

// Create a new parent group
$response = $iam->create_group('abc_group');

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

Create a new user group.

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

// Create a new child group
$response = $iam->create_group('xyz_group', array(
	'Path' => '/abc_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 create_group($group_name, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['GroupName'] = $group_name;
    
    return $this->authenticate('CreateGroup', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback