AwsDynamodbArgs

interface AwsDynamodbArgs { globalSecondaryIndexes?: AwsDynamodbGlobalSecondaryIndexArgs[]; name: string; partitionKey: string; partitionKeyType: AwsDynamodbAttributeType; readCapacity?: number; scenario: AwsDynamodbScenario; sortKey?: string; sortKeyType?: AwsDynamodbAttributeType; streamEnabled?: boolean; streamViewType?: AwsDynamodbStreamViewType; tags?: Input<Record<string, Input<string>>>; ttlAttributeName?: string; ttlEnabled?: boolean; warmThroughput?: AwsDynamodbWarmThroughputArgs; writeCapacity?: number; }

Input arguments for AwsDynamodb.

Remarks

The component enforces deterministic naming and validation before any resource is created. args.name is the single logical identity input for this component and must be a synchronous plain string.

Pulumi logical names follow ${env}-${projectHash}-dynamodb-*, while the AWS provider table name is a separate stackAndPurpose name (${environmentCode}-${projectHash}-${purpose}). DynamoDB encryption at rest remains enabled by default using AWS-managed service encryption, and this component does not expose an option to disable encryption.

Example

CODE
const table = new AwsDynamodb({
  name: 'orders',
  scenario: 'on-demand',
  partitionKey: 'orderId',
  partitionKeyType: 'STRING',
  ttlEnabled: true,
  ttlAttributeName: 'expiresAt',
  streamEnabled: true,
  globalSecondaryIndexes: [
    {
      name: 'by-customer',
      partitionKey: 'customerId',
      partitionKeyType: 'STRING',
      projection: {
        type: 'INCLUDE',
        nonKeyAttributes: ['status'],
      },
    },
  ],
});

Properties

globalSecondaryIndexes: AwsDynamodbGlobalSecondaryIndexArgs[]

Optional list of global secondary index definitions.

name: string

Required logical identity and provider naming purpose.

Must be a synchronous plain string (not an Input, Output, promise, or apply-derived value) and a camelCase alphanumeric purpose (for example orders); hyphens, underscores, spaces, and dots are rejected. This value drives both:

  • Pulumi logical identity for the component and child table logical names.
  • AWS provider table name generation with stackAndPurpose naming (${environmentCode}-${projectHash}-${purpose}).

partitionKey: string

Required table partition key attribute name.

partitionKeyType: AwsDynamodbAttributeType

Required table partition key attribute type.

readCapacity: number

Required when scenario is provisioned.

scenario: AwsDynamodbScenario

Billing scenario controlling provisioned versus on-demand behaviour.

sortKey: string

Optional table sort key attribute name. Required when sortKeyType is provided.

sortKeyType: AwsDynamodbAttributeType

Required when sortKey is provided, and must not be set when sortKey is omitted.

streamEnabled: boolean

Whether DynamoDB streams are enabled.

streamViewType: AwsDynamodbStreamViewType

Optional explicit stream view type. Defaults to NEW_AND_OLD_IMAGES when streams are enabled.

tags: Input<Record<string, Input<string>>>

Additional tags merged with default project/environment tags and Name.

ttlAttributeName: string

Required when ttlEnabled is true.

ttlEnabled: boolean

Whether table TTL is enabled.

warmThroughput: AwsDynamodbWarmThroughputArgs

Optional warm throughput configuration for the table. When set, at least one of readUnitsPerSecond or writeUnitsPerSecond is required.

writeCapacity: number

Required when scenario is provisioned.