Class: AWSCDK::Location::CfnAPIKeyProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
location/cfn_api_key_props.rb

Overview

Properties for defining a CfnAPIKey.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key_name:, restrictions:, description: nil, expire_time: nil, force_delete: nil, force_update: nil, no_expiry: nil, tags: nil) ⇒ CfnAPIKeyProps

Returns a new instance of CfnAPIKeyProps.

Parameters:

  • key_name (String)

    A custom name for the API key resource.

  • restrictions (AWSCDK::IResolvable, AWSCDK::Location::CfnAPIKey::APIKeyRestrictionsProperty)

    The API key restrictions for the API key resource.

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

    Updates the description for the API key resource.

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

    The optional timestamp for when the API key resource will expire in ISO 8601 format .

  • force_delete (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    ForceDelete bypasses an API key's expiry conditions and deletes the key.

  • force_update (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    The boolean flag to be included for updating ExpireTime or Restrictions details.

  • no_expiry (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Whether the API key should expire.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    Applies one or more tags to the map resource.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'location/cfn_api_key_props.rb', line 17

def initialize(key_name:, restrictions:, description: nil, expire_time: nil, force_delete: nil, force_update: nil, no_expiry: nil, tags: nil)
  @key_name = key_name
  Jsii::Type.check_type(@key_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "keyName")
  @restrictions = restrictions.is_a?(Hash) ? ::AWSCDK::Location::CfnAPIKey::APIKeyRestrictionsProperty.new(**restrictions.transform_keys(&:to_sym)) : restrictions
  Jsii::Type.check_type(@restrictions, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19sb2NhdGlvbi5DZm5BUElLZXkuQXBpS2V5UmVzdHJpY3Rpb25zUHJvcGVydHkifV19fQ==")), "restrictions")
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @expire_time = expire_time
  Jsii::Type.check_type(@expire_time, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "expireTime") unless @expire_time.nil?
  @force_delete = force_delete
  Jsii::Type.check_type(@force_delete, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "forceDelete") unless @force_delete.nil?
  @force_update = force_update
  Jsii::Type.check_type(@force_update, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "forceUpdate") unless @force_update.nil?
  @no_expiry = no_expiry
  Jsii::Type.check_type(@no_expiry, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "noExpiry") unless @no_expiry.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#descriptionString? (readonly)

Updates the description for the API key resource.



56
57
58
# File 'location/cfn_api_key_props.rb', line 56

def description
  @description
end

#expire_timeString? (readonly)

The optional timestamp for when the API key resource will expire in ISO 8601 format .



61
62
63
# File 'location/cfn_api_key_props.rb', line 61

def expire_time
  @expire_time
end

#force_deleteBoolean, ... (readonly)

ForceDelete bypasses an API key's expiry conditions and deletes the key.

Set the parameter true to delete the key or to false to not preemptively delete the API key.

Valid values: true , or false .

This action is irreversible. Only use ForceDelete if you are certain the key is no longer in use.



72
73
74
# File 'location/cfn_api_key_props.rb', line 72

def force_delete
  @force_delete
end

#force_updateBoolean, ... (readonly)

The boolean flag to be included for updating ExpireTime or Restrictions details.

Must be set to true to update an API key resource that has been used in the past 7 days. False if force update is not preferred.



79
80
81
# File 'location/cfn_api_key_props.rb', line 79

def force_update
  @force_update
end

#key_nameString (readonly)

A custom name for the API key resource.

Requirements:

  • Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).
  • Must be a unique API key name.
  • No spaces allowed. For example, ExampleAPIKey .


46
47
48
# File 'location/cfn_api_key_props.rb', line 46

def key_name
  @key_name
end

#no_expiryBoolean, ... (readonly)

Whether the API key should expire.

Set to true to set the API key to have no expiration time.



86
87
88
# File 'location/cfn_api_key_props.rb', line 86

def no_expiry
  @no_expiry
end

#restrictionsAWSCDK::IResolvable, AWSCDK::Location::CfnAPIKey::APIKeyRestrictionsProperty (readonly)

The API key restrictions for the API key resource.



51
52
53
# File 'location/cfn_api_key_props.rb', line 51

def restrictions
  @restrictions
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

Applies one or more tags to the map resource.

A tag is a key-value pair that helps manage, identify, search, and filter your resources by labelling them.



93
94
95
# File 'location/cfn_api_key_props.rb', line 93

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



95
96
97
98
99
100
101
102
103
104
105
106
# File 'location/cfn_api_key_props.rb', line 95

def self.jsii_properties
  {
    :key_name => "keyName",
    :restrictions => "restrictions",
    :description => "description",
    :expire_time => "expireTime",
    :force_delete => "forceDelete",
    :force_update => "forceUpdate",
    :no_expiry => "noExpiry",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'location/cfn_api_key_props.rb', line 108

def to_jsii
  result = {}
  result.merge!({
    "keyName" => @key_name,
    "restrictions" => @restrictions,
    "description" => @description,
    "expireTime" => @expire_time,
    "forceDelete" => @force_delete,
    "forceUpdate" => @force_update,
    "noExpiry" => @no_expiry,
    "tags" => @tags,
  })
  result.compact
end