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. Theclustercapability uses${env}-${projectHash}-documentdb-cluster-${sanitised args.cluster.identity}with logical-onlyargs.cluster.identity. TheparameterGroupcapability uses${env}-${projectHash}-documentdb-parameter-group-${sanitised args.parameterGroup.name}and sharesargs.parameterGroup.namewith its provider naming purpose. - The internal cluster root uses the matching
documentdb-clustercapability andargs.cluster.identity; itsaws:docdb/cluster:Clusterchild uses[args.cluster.identity]. Itsaws:docdb/clusterInstance:ClusterInstancechildren use[args.cluster.identity, args.cluster.instances.<index>]. - The internal parameter-group root uses the matching
documentdb-parameter-groupcapability andargs.parameterGroup.name; itsaws:docdb/clusterParameterGroup:ClusterParameterGroupchild uses[args.parameterGroup.name]. - Cluster AWS identifiers use
stackOnly:${env}-${projectHash}. Instance identifiers usestackAndIndex:${env}-${projectHash}-${index}. Parameter-group AWS names use lower-casestackAndPurpose:${env}-${projectHash}-${lowerCase purpose}. - Exception: final snapshot identifiers append the component-defined
-finalsuffix to the cluster identifier:${env}-${projectHash}-final. Snapshots do not use an AWS resource naming style. Intentional.
Example
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
ComponentResourceAwsDocumentDatabase
Properties
cluster: Cluster
Managed cluster when the cluster capability is selected.
clusterArn: Output<string>
ARN of the managed cluster.
endpoint: Output<string>
Writer endpoint of the managed cluster.
instances: Record<string, ClusterInstance>
Managed instances keyed by their stable two-digit index.
masterUserSecretArn: Output<string>
AWS Secrets Manager ARN containing the AWS-managed master credentials.
parameterGroup: ClusterParameterGroup
Managed parameter group when the parameterGroup capability is selected.
port: OutputInstance<number | undefined>
Listener port of the managed cluster.
readerEndpoint: Output<string>
Load-balanced reader endpoint of the managed cluster.
urn: Output<string>
Inherited from urn
The stable logical URN used to distinctly address a resource, both before and after deployments.
Methods
getData(): Promise<any>
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>
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
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>
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>