Table of Contents

Class CfnAccessKey

Namespace
Amazon.CDK.AWS.IAM
Assembly
Amazon.CDK.AWS.IAM.dll

A CloudFormation AWS::IAM::AccessKey.

public class CfnAccessKey : CfnResource, IInspectable
Inheritance
CfnAccessKey
Implements
IInspectable

Examples

// The code below shows an example of how to instantiate this type.
             // The values are placeholders you should change.
             using Amazon.CDK.AWS.IAM;

             var cfnAccessKey = new CfnAccessKey(this, "MyCfnAccessKey", new CfnAccessKeyProps {
                 UserName = "userName",

                 // the properties below are optional
                 Serial = 123,
                 Status = "status"
             });

Remarks

Creates a new AWS secret access key and corresponding AWS access key ID for the specified user. The default status for new keys is Active .

For information about quotas on the number of keys you can create, see IAM and AWS STS quotas in the IAM User Guide .

To ensure the security of your AWS account , the secret access key is accessible only during key and user creation. You must save the key (for example, in a text file) if you want to be able to access it again. If a secret key is lost, you can rotate access keys by increasing the value of the <code>serial</code> property.

CloudformationResource: AWS::IAM::AccessKey

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html

ExampleMetadata: fixture=_generated

Constructors

CfnAccessKey(Construct, string, ICfnAccessKeyProps)

Create a new AWS::IAM::AccessKey.

public CfnAccessKey(Construct scope, string id, ICfnAccessKeyProps props)

Parameters

scope Construct
  • scope in which this resource is defined.
id string
  • scoped id of the resource.
props ICfnAccessKeyProps
  • resource properties.

Properties

AttrSecretAccessKey

Returns the secret access key for the specified AWS::IAM::AccessKey resource.

public virtual string AttrSecretAccessKey { get; }

Property Value

string

Remarks

For example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY.

CloudformationAttribute: SecretAccessKey

CFN_RESOURCE_TYPE_NAME

The CloudFormation resource type name for this resource class.

public static string CFN_RESOURCE_TYPE_NAME { get; }

Property Value

string

CfnProperties

protected override IDictionary<string, object> CfnProperties { get; }

Property Value

IDictionary<string, object>

Serial

This value is specific to CloudFormation and can only be incremented .

public virtual double? Serial { get; set; }

Property Value

double?

Remarks

Incrementing this value notifies CloudFormation that you want to rotate your access key. When you update your stack, CloudFormation will replace the existing access key with a new key.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html#cfn-iam-accesskey-serial

Status

The status of the access key.

public virtual string? Status { get; set; }

Property Value

string

Remarks

Active means that the key is valid for API calls, while Inactive means it is not.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html#cfn-iam-accesskey-status

UserName

The name of the IAM user that the new key will belong to.

public virtual string UserName { get; set; }

Property Value

string

Remarks

This parameter allows (through its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html#cfn-iam-accesskey-username

Methods

Inspect(TreeInspector)

Examines the CloudFormation resource and discloses attributes.

public virtual void Inspect(TreeInspector inspector)

Parameters

inspector TreeInspector
  • tree inspector to collect and process attributes.

RenderProperties(IDictionary<string, object>)

protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)

Parameters

props IDictionary<string, object>

Returns

IDictionary<string, object>