AwsDynamodb

Service-level AWS DynamoDB table component.

Remarks

This component creates a single DynamoDB table with service-level validation and key schema orchestration, including optional TTL, streams, warm throughput, and global secondary indexes. Encryption at rest remains enabled by default using AWS-managed service encryption.

Naming:

  • Root: type ${namespace}:aws:AwsDynamodb; capability dynamodb; identity is the raw args.name; target ${env}-${projectHash}-dynamodb-${sanitiseNamePart(args.name)}.
  • aws:dynamodb/table:Table has parent AwsDynamodb, tuple [args.name], and target ${env}-${projectHash}-${sanitiseNamePart(args.name)}.
  • AWS provider name: Table name (source args.name) uses stackAndPurpose ${env}-${projectHash}-${purpose} through buildAwsNameFromCamelCasePurpose(...). Global secondary indexes are inline table configuration and preserve their raw args.globalSecondaryIndexes[].name provider values.

Example

CODE
import { AwsDynamodb } from '@jobcloud/aws-dynamodb';

const table = new AwsDynamodb({
  name: 'orders',
  scenario: 'provisioned',
  partitionKey: 'orderId',
  partitionKeyType: 'STRING',
  readCapacity: 5,
  writeCapacity: 5,
  streamEnabled: true,
  tags: {
    owner: 'platform',
  },
});

Constructors

new AwsDynamodb( args: AwsDynamodbArgs, options?: ComponentResourceOptions, ): AwsDynamodb

Parameters

  • args (AwsDynamodbArgs) — Service-level DynamoDB table configuration.args.name is the component logical identity source. The child resource logical name follows ${env}-${projectHash}-dynamodb-*, while the AWS provider table name is generated separately using stackAndPurpose naming.
  • options (ComponentResourceOptions, optional) — Optional settings controlling resource behaviour.

Returns

AwsDynamodb

Hierarchy

  • ComponentResource
  • AwsDynamodb

Properties

streamArn: Output<string | undefined>

readonly

Stream ARN when streams are enabled; otherwise undefined.

table: Table

readonly

Underlying DynamoDB table resource.

tableArn: Output<string>

readonly

ARN of the created table.

tableName: Output<string>

readonly

Resolved provider table name.

urn: Output<string>

readonly

Inherited from urn

The stable logical URN used to distinctly address a resource, both before and after deployments.

Methods

getData(): Promise<any>

protectedasync

Inherited from getData

Retrieves the data produces by initialize. The data is immediately available in a derived class's constructor after the super(...) call to ComponentResource.

Returns

  • Promise<any>

getProvider(moduleMember: string): ProviderResource | undefined

Inherited from getProvider

Returns the provider for the given module member, if one exists.

Parameters

  • moduleMember (string)

Returns

  • ProviderResource | undefined

initialize( args: Inputs, opts?: ComponentResourceOptions, name?: string, type?: string, ): Promise<any>

protectedasync

Inherited from initialize

Can be overridden by a subclass to asynchronously initialize data for this component automatically when constructed. The data will be available immediately for subclass constructors to use. To access the data use getData.

Parameters

  • args (Inputs)
  • opts (ComponentResourceOptions, optional)
  • name (string, optional)
  • type (string, optional)

Returns

  • Promise<any>

registerOutputs( outputs?: Inputs | Promise<Inputs> | Output<Inputs>, ): void

protected

Inherited from registerOutputs

Registers synthetic outputs that a component has initialized, usually by allocating other child sub-resources and propagating their resulting property values.

Component resources can call this at the end of their constructor to indicate that they are done creating child resources. This is not strictly necessary as this will automatically be called after the initialize method completes.

Parameters

  • outputs (Inputs | Promise<Inputs> | Output<Inputs>, optional)

Returns

  • void

Static Methods

isInstance(obj: any): obj is ComponentResource<any>

static

Inherited from isInstance

Returns true if the given object is a CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

Parameters

  • obj (any)

Returns

  • obj is ComponentResource<any>