Class: AWSCDK::CloudFront::PublicKeyProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_front/public_key_props.rb

Overview

Properties for creating a Public Key.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(encoded_key:, comment: nil, public_key_name: nil) ⇒ PublicKeyProps

Returns a new instance of PublicKeyProps.

Parameters:

  • encoded_key (String)

    The public key that you can use with signed URLs and signed cookies, or with field-level encryption.

  • comment (String, nil) (defaults to: nil)

    A comment to describe the public key.

  • public_key_name (String, nil) (defaults to: nil)

    A name to identify the public key.



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

def initialize(encoded_key:, comment: nil, public_key_name: nil)
  @encoded_key = encoded_key
  Jsii::Type.check_type(@encoded_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "encodedKey")
  @comment = comment
  Jsii::Type.check_type(@comment, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "comment") unless @comment.nil?
  @public_key_name = public_key_name
  Jsii::Type.check_type(@public_key_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "publicKeyName") unless @public_key_name.nil?
end

Instance Attribute Details

#commentString? (readonly)

Note:

Default: - no comment

A comment to describe the public key.

Returns:

  • (String, nil)


30
31
32
# File 'cloud_front/public_key_props.rb', line 30

def comment
  @comment
end

#encoded_keyString (readonly)

The public key that you can use with signed URLs and signed cookies, or with field-level encryption.

The encoded_key parameter must include -----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY----- lines.



25
26
27
# File 'cloud_front/public_key_props.rb', line 25

def encoded_key
  @encoded_key
end

#public_key_nameString? (readonly)

Note:

Default: - generated from the id

A name to identify the public key.

Returns:

  • (String, nil)


35
36
37
# File 'cloud_front/public_key_props.rb', line 35

def public_key_name
  @public_key_name
end

Class Method Details

.jsii_propertiesObject



37
38
39
40
41
42
43
# File 'cloud_front/public_key_props.rb', line 37

def self.jsii_properties
  {
    :encoded_key => "encodedKey",
    :comment => "comment",
    :public_key_name => "publicKeyName",
  }
end

Instance Method Details

#to_jsiiObject



45
46
47
48
49
50
51
52
53
# File 'cloud_front/public_key_props.rb', line 45

def to_jsii
  result = {}
  result.merge!({
    "encodedKey" => @encoded_key,
    "comment" => @comment,
    "publicKeyName" => @public_key_name,
  })
  result.compact
end