Class: AWSCDK::EC2::KeyPairProps
- Inherits:
-
ResourceProps
- Object
- ResourceProps
- AWSCDK::EC2::KeyPairProps
- Defined in:
- ec2/key_pair_props.rb
Overview
The properties of a Key Pair.
Instance Attribute Summary collapse
-
#account ⇒ String?
readonly
The AWS account ID this resource belongs to.
-
#environment_from_arn ⇒ String?
readonly
ARN to deduce region and account from.
-
#format ⇒ AWSCDK::EC2::KeyPairFormat?
readonly
The format of the key pair.
-
#key_pair_name ⇒ String?
readonly
A unique name for the key pair.
-
#physical_name ⇒ String?
readonly
The value passed in by users to the physical name prop of the resource.
-
#public_key_material ⇒ String?
readonly
The public key material.
-
#region ⇒ String?
readonly
The AWS region this resource belongs to.
-
#type ⇒ AWSCDK::EC2::KeyPairType?
readonly
The type of key pair.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(account: nil, environment_from_arn: nil, physical_name: nil, region: nil, format: nil, key_pair_name: nil, public_key_material: nil, type: nil) ⇒ KeyPairProps
constructor
A new instance of KeyPairProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(account: nil, environment_from_arn: nil, physical_name: nil, region: nil, format: nil, key_pair_name: nil, public_key_material: nil, type: nil) ⇒ KeyPairProps
Returns a new instance of KeyPairProps.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'ec2/key_pair_props.rb', line 15 def initialize(account: nil, environment_from_arn: nil, physical_name: nil, region: nil, format: nil, key_pair_name: nil, public_key_material: nil, type: nil) @account = account Jsii::Type.check_type(@account, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "account") unless @account.nil? @environment_from_arn = environment_from_arn Jsii::Type.check_type(@environment_from_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "environmentFromArn") unless @environment_from_arn.nil? @physical_name = physical_name Jsii::Type.check_type(@physical_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "physicalName") unless @physical_name.nil? @region = region Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless @region.nil? @format = format Jsii::Type.check_type(@format, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLktleVBhaXJGb3JtYXQifQ==")), "format") unless @format.nil? @key_pair_name = key_pair_name Jsii::Type.check_type(@key_pair_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "keyPairName") unless @key_pair_name.nil? @public_key_material = public_key_material Jsii::Type.check_type(@public_key_material, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "publicKeyMaterial") unless @public_key_material.nil? @type = type Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLktleVBhaXJUeXBlIn0=")), "type") unless @type.nil? end |
Instance Attribute Details
#account ⇒ String? (readonly)
Default: - the resource is in the same account as the stack it belongs to
The AWS account ID this resource belongs to.
38 39 40 |
# File 'ec2/key_pair_props.rb', line 38 def account @account end |
#environment_from_arn ⇒ String? (readonly)
Default: - take environment from account, region parameters, or use Stack environment.
ARN to deduce region and account from.
The ARN is parsed and the account and region are taken from the ARN. This should be used for imported resources.
Cannot be supplied together with either account or region.
48 49 50 |
# File 'ec2/key_pair_props.rb', line 48 def environment_from_arn @environment_from_arn end |
#format ⇒ AWSCDK::EC2::KeyPairFormat? (readonly)
Default: PEM
The format of the key pair.
69 70 71 |
# File 'ec2/key_pair_props.rb', line 69 def format @format end |
#key_pair_name ⇒ String? (readonly)
Default: A generated name
A unique name for the key pair.
74 75 76 |
# File 'ec2/key_pair_props.rb', line 74 def key_pair_name @key_pair_name end |
#physical_name ⇒ String? (readonly)
Default: - The physical name will be allocated by CloudFormation at deployment time
The value passed in by users to the physical name prop of the resource.
undefinedimplies that a physical name will be allocated by CloudFormation during deployment.- a concrete value implies a specific physical name
PhysicalName.GENERATE_IF_NEEDEDis a marker that indicates that a physical will only be generated by the CDK if it is needed for cross-environment references. Otherwise, it will be allocated by CloudFormation.
59 60 61 |
# File 'ec2/key_pair_props.rb', line 59 def physical_name @physical_name end |
#public_key_material ⇒ String? (readonly)
Default: a public and private key will be generated
The public key material.
If this is provided the key is considered "imported". For imported keys, it is assumed that you already have the private key material so the private key material will not be returned or stored in AWS Systems Manager Parameter Store.
84 85 86 |
# File 'ec2/key_pair_props.rb', line 84 def public_key_material @public_key_material end |
#region ⇒ String? (readonly)
Default: - the resource is in the same region as the stack it belongs to
The AWS region this resource belongs to.
64 65 66 |
# File 'ec2/key_pair_props.rb', line 64 def region @region end |
#type ⇒ AWSCDK::EC2::KeyPairType? (readonly)
Default: RSA (ignored if keyMaterial is provided)
The type of key pair.
89 90 91 |
# File 'ec2/key_pair_props.rb', line 89 def type @type end |
Class Method Details
.jsii_properties ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'ec2/key_pair_props.rb', line 91 def self.jsii_properties { :account => "account", :environment_from_arn => "environmentFromArn", :physical_name => "physicalName", :region => "region", :format => "format", :key_pair_name => "keyPairName", :public_key_material => "publicKeyMaterial", :type => "type", } end |
Instance Method Details
#to_jsii ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'ec2/key_pair_props.rb', line 104 def to_jsii result = {} result.merge!(super) result.merge!({ "account" => @account, "environmentFromArn" => @environment_from_arn, "physicalName" => @physical_name, "region" => @region, "format" => @format, "keyPairName" => @key_pair_name, "publicKeyMaterial" => @public_key_material, "type" => @type, }) result.compact end |