Class: AWSCDK::DynamoDB::CfnTable::AttributeDefinitionProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
dynamo_db/cfn_table.rb

Overview

Represents an attribute for describing the schema for the table and indexes.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribute_name:, attribute_type:) ⇒ AttributeDefinitionProperty

Returns a new instance of AttributeDefinitionProperty.

Parameters:

  • attribute_name (String)

    A name for the attribute.

  • attribute_type (String)

    The data type for the attribute, where:.



820
821
822
823
824
825
# File 'dynamo_db/cfn_table.rb', line 820

def initialize(attribute_name:, attribute_type:)
  @attribute_name = attribute_name
  Jsii::Type.check_type(@attribute_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "attributeName")
  @attribute_type = attribute_type
  Jsii::Type.check_type(@attribute_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "attributeType")
end

Instance Attribute Details

#attribute_nameString (readonly)

A name for the attribute.



831
832
833
# File 'dynamo_db/cfn_table.rb', line 831

def attribute_name
  @attribute_name
end

#attribute_typeString (readonly)

The data type for the attribute, where:.

  • S - the attribute is of type String
  • N - the attribute is of type Number
  • B - the attribute is of type Binary


840
841
842
# File 'dynamo_db/cfn_table.rb', line 840

def attribute_type
  @attribute_type
end

Class Method Details

.jsii_propertiesObject



842
843
844
845
846
847
# File 'dynamo_db/cfn_table.rb', line 842

def self.jsii_properties
  {
    :attribute_name => "attributeName",
    :attribute_type => "attributeType",
  }
end

Instance Method Details

#to_jsiiObject



849
850
851
852
853
854
855
856
# File 'dynamo_db/cfn_table.rb', line 849

def to_jsii
  result = {}
  result.merge!({
    "attributeName" => @attribute_name,
    "attributeType" => @attribute_type,
  })
  result.compact
end