Class CfnGlobalTable.GlobalSecondaryIndexProperty
Allows you to specify a global secondary index for the global table.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.DynamoDB
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class GlobalSecondaryIndexProperty : Object, CfnGlobalTable.IGlobalSecondaryIndexProperty
Syntax (vb)
Public Class GlobalSecondaryIndexProperty
Inherits Object
Implements CfnGlobalTable.IGlobalSecondaryIndexProperty
Remarks
The index will be defined on all replicas.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.DynamoDB;
var globalSecondaryIndexProperty = new GlobalSecondaryIndexProperty {
IndexName = "indexName",
KeySchema = new [] { new KeySchemaProperty {
AttributeName = "attributeName",
KeyType = "keyType"
} },
Projection = new ProjectionProperty {
NonKeyAttributes = new [] { "nonKeyAttributes" },
ProjectionType = "projectionType"
},
// the properties below are optional
WarmThroughput = new WarmThroughputProperty {
ReadUnitsPerSecond = 123,
WriteUnitsPerSecond = 123
},
WriteOnDemandThroughputSettings = new WriteOnDemandThroughputSettingsProperty {
MaxWriteRequestUnits = 123
},
WriteProvisionedThroughputSettings = new WriteProvisionedThroughputSettingsProperty {
WriteCapacityAutoScalingSettings = new CapacityAutoScalingSettingsProperty {
MaxCapacity = 123,
MinCapacity = 123,
TargetTrackingScalingPolicyConfiguration = new TargetTrackingScalingPolicyConfigurationProperty {
TargetValue = 123,
// the properties below are optional
DisableScaleIn = false,
ScaleInCooldown = 123,
ScaleOutCooldown = 123
},
// the properties below are optional
SeedCapacity = 123
}
}
};
Synopsis
Constructors
Global |
Properties
Index |
The name of the global secondary index. |
Key |
The complete key schema for a global secondary index, which consists of one or more pairs of attribute names and key types: - |
Projection | Represents attributes that are copied (projected) from the table into the global secondary index. |
Warm |
Represents the warm throughput value (in read units per second and write units per second) for the specified secondary index. |
Write |
Sets the write request settings for a global table or a global secondary index. |
Write |
Defines write capacity settings for the global secondary index. |
Constructors
GlobalSecondaryIndexProperty()
public GlobalSecondaryIndexProperty()
Properties
IndexName
The name of the global secondary index.
public string IndexName { get; set; }
Property Value
System.
Remarks
The name must be unique among all other indexes on this table.
KeySchema
The complete key schema for a global secondary index, which consists of one or more pairs of attribute names and key types: - HASH
- partition key - RANGE
- sort key > The partition key of an item is also known as its hash attribute .
public object KeySchema { get; set; }
Property Value
System.
Remarks
The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
The sort key of an item is also known as its range attribute . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
Projection
Represents attributes that are copied (projected) from the table into the global secondary index.
public object Projection { get; set; }
Property Value
System.
Remarks
These are in addition to the primary key attributes and index key attributes, which are automatically projected.
WarmThroughput
Represents the warm throughput value (in read units per second and write units per second) for the specified secondary index.
public object WarmThroughput { get; set; }
Property Value
System.
Remarks
If you use this parameter, you must specify ReadUnitsPerSecond
, WriteUnitsPerSecond
, or both.
WriteOnDemandThroughputSettings
Sets the write request settings for a global table or a global secondary index.
public object WriteOnDemandThroughputSettings { get; set; }
Property Value
System.
Remarks
You can only specify this setting if your resource uses the PAY_PER_REQUEST
BillingMode
.
WriteProvisionedThroughputSettings
Defines write capacity settings for the global secondary index.
public object WriteProvisionedThroughputSettings { get; set; }
Property Value
System.
Remarks
You must specify a value for this property if the table's BillingMode
is PROVISIONED
. All replicas will have the same write capacity settings for this global secondary index.