AwsAccountDefaultsRdsAndDocdbSubnetGroupArgs

interface AwsAccountDefaultsRdsAndDocdbSubnetGroupArgs { enabled?: boolean; purpose: string; vpc: AwsVpc; }

Capability arguments for creating a shared RDS/DocDB subnet group for an AwsVpc.

Remarks

Amazon RDS and Amazon DocumentDB share DB subnet groups. This capability creates one aws.rds.SubnetGroup using stackAndPurpose AWS naming (${environmentCode}-${projectHash}-${purpose}) and the referenced VPC private subnets (vpc.privateSubnetIds) as subnet membership. AWS uses this RDS DB subnet-group resource for both RDS and DocumentDB DB subnet groups in this account baseline, so this component intentionally does not create a separate aws.docdb.SubnetGroup.

Example

CODE
import * as awsx from '@pulumi/awsx';
import { AwsAccountDefaults } from '@jobcloud/aws-account-defaults';
import { AwsVpc } from '@jobcloud/aws-vpc';

const vpc = new AwsVpc({
  name: 'shared',
  vpc: {
    ipv4CidrBlock: '192.0.2.0/24',
    availabilityZones: {
      euw1a: 'eu-west-1a',
      euw1b: 'eu-west-1b',
    },
    subnetSpecs: {
      databasePrivateA: {
        type: awsx.ec2.SubnetType.Private,
        name: 'databasePrivateA',
        cidrBlocks: ['192.0.2.0/28', '192.0.2.16/28'],
      },
      databasePrivateB: {
        type: awsx.ec2.SubnetType.Private,
        name: 'databasePrivateB',
        cidrBlocks: ['192.0.2.32/28', '192.0.2.48/28'],
      },
    },
  },
});

new AwsAccountDefaults({
  identity: 'account-defaults',
  rdsAndDocdbSubnetGroup: {
    enabled: true,
    purpose: 'sharedDatabase',
    vpc,
  },
});

Properties

enabled: boolean

Enables shared RDS/DocDB DB subnet group creation. Defaults to true when this block is set.

purpose: string

Stable purpose segment used for Pulumi logical naming and AWS subnet-group naming.

Remarks

This value must be a plain, non-empty, synchronous camelCase string (letters and digits only, starting with a lowercase letter; no spaces, hyphens, underscores, or dots). It is used both as the child resource logical identity segment and as the purpose input for the lowercased stackAndPurpose AWS name (${environmentCode}-${projectHash}-${purpose}); RDS/DocDB store subnet-group names lowercase, so the purpose is lowercased in the AWS name. Changing it intentionally renames the Pulumi logical resource and the AWS DB subnet-group name.

vpc: AwsVpc

VPC whose private subnets are used for the shared RDS/DocDB DB subnet group.

Remarks

Pulumi logical naming and the AWS subnet-group name are both derived from purpose, while the referenced VPC only provides subnet membership.