|
1 |
| - |
| 1 | +# aurora (Postgres) CfHighlander component |
| 2 | +## Parameters |
2 | 3 |
|
3 |
| -### Cfhighlander Aurora Postgres component |
| 4 | +| Name | Use | Default | Global | Type | Allowed Values | |
| 5 | +| ---- | --- | ------- | ------ | ---- | -------------- | |
| 6 | +| EnvironmentName | Tagging | dev | true | string |
| 7 | +| EnvironmentType | Tagging | development | true | string | ['development','production'] |
| 8 | +| VPCId | Security Groups | None | false | AWS::EC2::VPC::Id |
| 9 | +| DnsDomain | DNS domain to use | None | true | string |
| 10 | +| SubnetIds | List of subnets | None | false | CommaDelimitedList |
| 11 | +| KmsKeyId | KMS ID | None | false | string (arn) |
| 12 | +| NamespaceId | Service discovery namespace ID | None | false | string |
| 13 | +| SnapshotId | Snapshot ID to provision from | None | false | string |
| 14 | +| WriterInstanceType | Writer instance type *if engine is set to provisioned* | None | false | string |
| 15 | +| ReaderInstanceType | Reader instance type *if engine is set to provisioned* | None | false | string |
| 16 | +## Outputs/Exports |
4 | 17 |
|
5 |
| -```bash |
| 18 | +| Name | Value | Exported | |
| 19 | +| ---- | ----- | -------- | |
| 20 | +| SecurityGroup | Security Group name | true |
| 21 | +| ServiceRegistry | CloudMap service registry ID | true |
| 22 | +| DBClusterId | Database Cluster ID | true |
| 23 | + |
| 24 | +## Included Components |
6 | 25 |
|
7 |
| -# install highlander gem |
8 |
| -$ gem install cfhighlander |
| 26 | +[lib-ec2](https://github.com/theonestack/hl-component-lib-ec2) |
9 | 27 |
|
10 |
| -# build and validate standalone component |
11 |
| -$ cfcompile --validate |
| 28 | +## Example Configuration |
| 29 | +### Highlander |
| 30 | +``` |
| 31 | + Component name:'database', template: 'aurora-postgres' do |
| 32 | + parameter name: 'DnsDomain', value: root_domain |
| 33 | + parameter name: 'DnsFormat', value: FnSub("${EnvironmentName}.#{root_domain}") |
| 34 | + parameter name: 'SubnetIds', value: cfout('vpcv2', 'PersistenceSubnets') |
| 35 | + parameter name: 'WriterInstanceType', value: writer_instance |
| 36 | + parameter name: 'ReaderInstanceType', value: reader_instance |
| 37 | + parameter name: 'EnableReader', value: 'true' |
| 38 | + parameter name: 'StackOctet', value: '80' |
| 39 | + parameter name: 'NamespaceId', value: cfout('servicediscovery', 'NamespaceId') |
| 40 | + end |
| 41 | +``` |
12 | 42 |
|
| 43 | +### Aurora Postgres Configuration |
13 | 44 | ```
|
14 |
| -### Usage |
| 45 | +hostname: db |
| 46 | +database_name: appdb |
| 47 | +dns_format: ${DnsFormat} |
| 48 | +
|
| 49 | +storage_encrypted: true |
| 50 | +engine: aurora-postgres |
| 51 | +engine_version: '13.4' |
| 52 | +
|
| 53 | +writer_instance: db.r3.large |
| 54 | +reader_instance: db.r3.large |
| 55 | +
|
| 56 | +master_login: |
| 57 | + username_ssm_param: /${EnvironmentName}/myapp/dbuser |
| 58 | + password_ssm_param: /${EnvironmentName}/myapp/dbpass |
15 | 59 |
|
16 |
| -### Configuration options |
| 60 | +security_group: |
| 61 | + - |
| 62 | + rules: |
| 63 | + - |
| 64 | + IpProtocol: tcp |
| 65 | + FromPort: 5432 |
| 66 | + ToPort: 5432 |
| 67 | + ips: |
| 68 | + - stack |
| 69 | + - company_office |
| 70 | + - company_client_vpn |
17 | 71 |
|
18 |
| -TBD |
| 72 | +service_discovery: |
| 73 | + name: db |
| 74 | +``` |
19 | 75 |
|
20 |
| -### Parameters |
| 76 | +## Cfhighlander Setup |
21 | 77 |
|
22 |
| -TBD |
| 78 | +install cfhighlander [gem](https://github.com/theonestack/cfhighlander) |
23 | 79 |
|
24 |
| -### Configuration options |
| 80 | +```bash |
| 81 | +gem install cfhighlander |
| 82 | +``` |
25 | 83 |
|
26 |
| -TBD |
| 84 | +or via docker |
27 | 85 |
|
28 |
| -### Outputs |
| 86 | +```bash |
| 87 | +docker pull theonestack/cfhighlander |
| 88 | +``` |
| 89 | +## Testing Components |
| 90 | + |
| 91 | +Running the tests |
29 | 92 |
|
30 |
| -TBD |
| 93 | +```bash |
| 94 | +cfhighlander cftest aurora-postgres |
| 95 | +``` |
0 commit comments