Class: AWSCDK::IAM::AccessKeyProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
iam/access_key_props.rb

Overview

Properties for defining an IAM access key.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user:, serial: nil, status: nil) ⇒ AccessKeyProps

Returns a new instance of AccessKeyProps.

Parameters:

  • user (AWSCDK::IAM::IUser)

    The IAM user this key will belong to.

  • serial (Numeric, nil) (defaults to: nil)

    A CloudFormation-specific value that signifies the access key should be replaced/rotated.

  • status (AWSCDK::IAM::AccessKeyStatus, nil) (defaults to: nil)

    The status of the access key.



10
11
12
13
14
15
16
17
# File 'iam/access_key_props.rb', line 10

def initialize(user:, serial: nil, status: nil)
  @user = user
  Jsii::Type.check_type(@user, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklVc2VyIn0=")), "user")
  @serial = serial
  Jsii::Type.check_type(@serial, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "serial") unless @serial.nil?
  @status = status
  Jsii::Type.check_type(@status, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLkFjY2Vzc0tleVN0YXR1cyJ9")), "status") unless @status.nil?
end

Instance Attribute Details

#serialNumeric? (readonly)

Note:

Default: - No serial value

A CloudFormation-specific value that signifies the access key should be replaced/rotated.

This value can only be incremented. Incrementing this value will cause CloudFormation to replace the Access Key resource.

Returns:

  • (Numeric, nil)


34
35
36
# File 'iam/access_key_props.rb', line 34

def serial
  @serial
end

#statusAWSCDK::IAM::AccessKeyStatus? (readonly)

Note:

Default: - The access key is active

The status of the access key.

An Active access key is allowed to be used to make API calls; An Inactive key cannot.



42
43
44
# File 'iam/access_key_props.rb', line 42

def status
  @status
end

#userAWSCDK::IAM::IUser (readonly)

The IAM user this key will belong to.

Changing this value will result in the access key being deleted and a new access key (with a different ID and secret value) being assigned to the new user.

Returns:



26
27
28
# File 'iam/access_key_props.rb', line 26

def user
  @user
end

Class Method Details

.jsii_propertiesObject



44
45
46
47
48
49
50
# File 'iam/access_key_props.rb', line 44

def self.jsii_properties
  {
    :user => "user",
    :serial => "serial",
    :status => "status",
  }
end

Instance Method Details

#to_jsiiObject



52
53
54
55
56
57
58
59
60
# File 'iam/access_key_props.rb', line 52

def to_jsii
  result = {}
  result.merge!({
    "user" => @user,
    "serial" => @serial,
    "status" => @status,
  })
  result.compact
end