AwsDocumentDatabase

Service-level Amazon DocumentDB component.

Remarks

Creates exactly one capability: a private, encrypted DocumentDB cluster with stable keyed instances, or an independently managed DocumentDB cluster parameter group. Cluster passwords are always AWS-managed in Secrets Manager. Cluster deletion protection is enabled by default and final snapshots are always created; the explicit decommission workflow is required before later removal.

Naming:

  • This root uses type token ${namespace}:aws:AwsDocumentDatabase. The cluster capability uses ${env}-${projectHash}-documentdb-cluster-${sanitised args.cluster.identity} with logical-only args.cluster.identity. The parameterGroup capability uses ${env}-${projectHash}-documentdb-parameter-group-${sanitised args.parameterGroup.name} and shares args.parameterGroup.name with its provider naming purpose.
  • The internal cluster root uses the matching documentdb-cluster capability and args.cluster.identity; its aws:docdb/cluster:Cluster child uses [args.cluster.identity]. Its aws:docdb/clusterInstance:ClusterInstance children use [args.cluster.identity, args.cluster.instances.<index>].
  • The internal parameter-group root uses the matching documentdb-parameter-group capability and args.parameterGroup.name; its aws:docdb/clusterParameterGroup:ClusterParameterGroup child uses [args.parameterGroup.name].
  • Cluster AWS identifiers use stackOnly: ${env}-${projectHash}. Instance identifiers use stackAndIndex: ${env}-${projectHash}-${index}. Parameter-group AWS names use lower-case stackAndPurpose: ${env}-${projectHash}-${lowerCase purpose}.
  • Exception: final snapshot identifiers append the component-defined -final suffix to the cluster identifier: ${env}-${projectHash}-final. Snapshots do not use an AWS resource naming style. Intentional.

Example

CODE
import { AwsDocumentDatabase } from '@jobcloud/aws-documentdb';

const tuning = new AwsDocumentDatabase({ parameterGroup: { name: 'ordersTuning', family: 'docdb5.0' } });
const database = new AwsDocumentDatabase({
  cluster: {
    identity: 'orders',
    engineVersion: '5.0.0',
    dbSubnetGroup: 'shared-documentdb',
    securityGroups: ['sg-123'],
    parameterGroup: tuning,
    availabilityZones: ['eu-west-1a', 'eu-west-1b', 'eu-west-1c'],
    instances: { '01': { instanceClass: 'db.r6g.large' } },
  },
});

Constructors

new AwsDocumentDatabase( args: AwsDocumentDatabaseArgs, options?: ComponentResourceOptions, ): AwsDocumentDatabase

Parameters

  • args (AwsDocumentDatabaseArgs) — Exactly one DocumentDB capability configuration.
  • options (ComponentResourceOptions, optional) — Standard Pulumi resource options.

Returns

AwsDocumentDatabase

Hierarchy

  • ComponentResource
  • AwsDocumentDatabase

Properties

cluster: Cluster

readonly

Managed cluster when the cluster capability is selected.

clusterArn: Output<string>

readonly

ARN of the managed cluster.

endpoint: Output<string>

readonly

Writer endpoint of the managed cluster.

instances: Record<string, ClusterInstance>

readonly

Managed instances keyed by their stable two-digit index.

masterUserSecretArn: Output<string>

readonly

AWS Secrets Manager ARN containing the AWS-managed master credentials.

parameterGroup: ClusterParameterGroup

readonly

Managed parameter group when the parameterGroup capability is selected.

port: OutputInstance<number | undefined>

readonly

Listener port of the managed cluster.

readerEndpoint: Output<string>

readonly

Load-balanced reader endpoint of the managed cluster.

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>