aurora (Postgres) CfHighlander component

May 11, 2026 ยท View on GitHub

Parameters

NameUseDefaultGlobalTypeAllowed Values
EnvironmentNameTaggingdevtruestring
EnvironmentTypeTaggingdevelopmenttruestring['development','production']
VPCIdSecurity GroupsNonefalseAWS::EC2::VPC::Id
DnsDomainDNS domain to useNonetruestring
SubnetIdsList of subnetsNonefalseCommaDelimitedList
KmsKeyIdKMS IDNonefalsestring (arn)
NamespaceIdService discovery namespace IDNonefalsestring
SnapshotIdSnapshot ID to provision fromNonefalsestring
WriterInstanceTypeWriter instance type if engine is set to provisionedNonefalsestring
ReaderInstanceTypeReader instance type if engine is set to provisionedNonefalsestring
EnhancedMonitoringIntervalEnhanced Monitoring granularity in seconds. Set to 0 to disable.0falsestring['0','1','5','10','15','30','60']

Outputs/Exports

NameValueExported
SecurityGroupSecurity Group nametrue
ServiceRegistryCloudMap service registry IDtrue
DBClusterIdDatabase Cluster IDtrue

Included Components

lib-ec2

Example Configuration

Highlander

  Component name:'database', template: 'aurora-postgres' do
    parameter name: 'DnsDomain', value: root_domain
    parameter name: 'DnsFormat', value: FnSub("${EnvironmentName}.#{root_domain}")
    parameter name: 'SubnetIds', value: cfout('vpcv2', 'PersistenceSubnets')
    parameter name: 'WriterInstanceType', value: writer_instance
    parameter name: 'ReaderInstanceType', value: reader_instance
    parameter name: 'EnableReader', value: 'true'
    parameter name: 'StackOctet', value: '80'
    parameter name: 'NamespaceId', value: cfout('servicediscovery', 'NamespaceId')
  end

Aurora Postgres Configuration

hostname: db
database_name: appdb
dns_format: ${DnsFormat}

storage_encrypted: true
engine: aurora-postgres
engine_version: '13.4'

writer_instance: db.r3.large
reader_instance: db.r3.large

master_login: 
    username_ssm_param: /${EnvironmentName}/myapp/dbuser
    password_ssm_param: /${EnvironmentName}/myapp/dbpass

security_group:
  -
    rules:
      -
        IpProtocol: tcp
        FromPort: 5432
        ToPort: 5432
    ips:
      - stack
      - company_office
      - company_client_vpn

service_discovery:
  name: db

Enhanced Monitoring

RDS Enhanced Monitoring provides OS-level metrics (CPU, memory, file system, disk I/O) at up to per-second granularity.

Enable at deploy time by setting the EnhancedMonitoringInterval parameter:

EnhancedMonitoringInterval=60

When enabled, the component creates an IAM role with the AmazonRDSEnhancedMonitoringRole managed policy and configures monitoring on all DB instances (writer, reader, serverless). Set to 0 to disable (default).

Cfhighlander Setup

install cfhighlander gem

gem install cfhighlander

or via docker

docker pull theonestack/cfhighlander

Testing Components

Running the tests

cfhighlander cftest aurora-postgres