delete_access_key ( $access_key_id, $opt )

Deletes the access key associated with the specified user.

If you do not specify a user name, IAM determines the user name implicitly based on the AWS Access Key ID signing the request. Because this action works for access keys under the AWS account, you can use this API to manage root credentials even if the AWS account has no associated users.

Access

public

Parameters

Parameter

Type

Required

Description

$access_key_id

string

Required

The Access Key ID for the Access Key ID and Secret Access Key you want to delete. [Constraints: The value must be between 16 and 32 characters, and must match the following regular expression pattern: [\w]*]

$opt

array

Optional

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

  • UserName - string - Optional - Name of the user whose key you want to delete. [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

Delete an access key.

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

$response = $iam->delete_access_key('AKIAIN7OWEXAMPLENN2A', array(
	'UserName' => 'johndoe2'
));

// 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 delete_access_key($access_key_id, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['AccessKeyId'] = $access_key_id;
    
    return $this->authenticate('DeleteAccessKey', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback