Class: AWSCDK::DynamoDB::CfnTable::ProjectionProperty

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

Overview

Represents attributes that are copied (projected) from the table into an index.

These are in addition to the primary key attributes and index key attributes, which are automatically projected.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(non_key_attributes: nil, projection_type: nil) ⇒ ProjectionProperty

Returns a new instance of ProjectionProperty.

Parameters:

  • non_key_attributes (Array<String>, nil) (defaults to: nil)

    Represents the non-key attribute names which will be projected into the index.

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

    The set of attributes that are projected into the index:.



1430
1431
1432
1433
1434
1435
# File 'dynamo_db/cfn_table.rb', line 1430

def initialize(non_key_attributes: nil, projection_type: nil)
  @non_key_attributes = non_key_attributes
  Jsii::Type.check_type(@non_key_attributes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "nonKeyAttributes") unless @non_key_attributes.nil?
  @projection_type = projection_type
  Jsii::Type.check_type(@projection_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "projectionType") unless @projection_type.nil?
end

Instance Attribute Details

#non_key_attributesArray<String>? (readonly)

Represents the non-key attribute names which will be projected into the index.

For global and local secondary indexes, the total count of NonKeyAttributes summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total. This limit only applies when you specify the ProjectionType of INCLUDE . You still can specify the ProjectionType of ALL to project all attributes from the source table, even if the table has more than 100 attributes.



1443
1444
1445
# File 'dynamo_db/cfn_table.rb', line 1443

def non_key_attributes
  @non_key_attributes
end

#projection_typeString? (readonly)

The set of attributes that are projected into the index:.

  • KEYS_ONLY - Only the index and primary keys are projected into the index.
  • INCLUDE - In addition to the attributes described in KEYS_ONLY , the secondary index will include other non-key attributes that you specify.
  • ALL - All of the table attributes are projected into the index.

When using the DynamoDB console, ALL is selected by default.



1454
1455
1456
# File 'dynamo_db/cfn_table.rb', line 1454

def projection_type
  @projection_type
end

Class Method Details

.jsii_propertiesObject



1456
1457
1458
1459
1460
1461
# File 'dynamo_db/cfn_table.rb', line 1456

def self.jsii_properties
  {
    :non_key_attributes => "nonKeyAttributes",
    :projection_type => "projectionType",
  }
end

Instance Method Details

#to_jsiiObject



1463
1464
1465
1466
1467
1468
1469
1470
# File 'dynamo_db/cfn_table.rb', line 1463

def to_jsii
  result = {}
  result.merge!({
    "nonKeyAttributes" => @non_key_attributes,
    "projectionType" => @projection_type,
  })
  result.compact
end