-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup an Aurora PostgreSQL database (#431)
* Setup an Aurora PostgreSQL database. Resolves #420
- Loading branch information
1 parent
ec8d80c
commit 534f2c0
Showing
30 changed files
with
836 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Create Aurora Deployment | ||
description: Create AWS Aurora DB Deployment | ||
|
||
inputs: | ||
name: | ||
description: 'The name of the Aurora DB cluster to deploy' | ||
required: true | ||
region: | ||
description: 'The AWS region used to host the Aurora DB' | ||
required: true | ||
engineVersion: | ||
description: 'The Postgres engine version to use' | ||
instanceClass: | ||
description: 'Instance class for the Aurora DB' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- id: provision_aurora | ||
shell: bash | ||
run: ./aurora_create.sh | ||
working-directory: provision/aws/rds | ||
env: | ||
AURORA_CLUSTER: ${{ inputs.name }} | ||
AURORA_ENGINE_VERSION: ${{ inputs.engineVersion }} | ||
AURORA_INSTANCE_CLASS: ${{ inputs.instanceClass }} | ||
AWS_REGION: ${{ inputs.region }} |
25 changes: 25 additions & 0 deletions
25
.github/actions/aurora-create-peering-connection/action.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Create Aurora Peering Connection | ||
description: Create AWS Peering Connection between Aurora DB and a ROSA cluster | ||
|
||
inputs: | ||
name: | ||
description: 'The name of the Aurora DB cluster' | ||
required: true | ||
region: | ||
description: 'The AWS region used to host the Aurora DB' | ||
required: true | ||
clusterName: | ||
description: 'The name of the ROSA cluster' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- id: create_peering_connection | ||
shell: bash | ||
run: ./aurora_create_peering_connection.sh | ||
working-directory: provision/aws/rds | ||
env: | ||
AURORA_CLUSTER: ${{ inputs.name }} | ||
AURORA_REGION: ${{ inputs.region }} | ||
CLUSTER_NAME: ${{ inputs.clusterName }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Delete Aurora Deployment | ||
description: Delete AWS Aurora DB Deployment | ||
|
||
inputs: | ||
name: | ||
description: 'The name of the Aurora DB cluster to delete' | ||
required: true | ||
region: | ||
description: 'The AWS region used to host the Aurora DB' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- id: provision_aurora | ||
shell: bash | ||
run: ./aurora_delete.sh | ||
working-directory: provision/aws/rds | ||
env: | ||
AURORA_CLUSTER: ${{ inputs.name }} | ||
AWS_REGION: ${{ inputs.region }} |
25 changes: 25 additions & 0 deletions
25
.github/actions/aurora-delete-peering-connection/action.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Delete Aurora Peering Connection | ||
description: Delete AWS Peering Connection between Aurora DB and a ROSA cluster | ||
|
||
inputs: | ||
clusterName: | ||
description: 'The name of the ROSA cluster' | ||
required: true | ||
auroraCluster: | ||
description: 'The name of the Aurora DB cluster' | ||
required: true | ||
auroraRegion: | ||
description: 'The AWS region used to host the Aurora DB' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- id: delete_peering_connection | ||
shell: bash | ||
run: ./aurora_delete_peering_connection.sh | ||
working-directory: provision/aws/rds | ||
env: | ||
AURORA_CLUSTER: ${{ inputs.auroraCluster }} | ||
AURORA_REGION: ${{ inputs.auroraRegion }} | ||
CLUSTER_NAME: ${{ inputs.clusterName }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
.github/workflows/aurora-cluster-auto-delete-on-schedule.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Aurora Scheduled Delete | ||
|
||
on: | ||
schedule: | ||
# Runs every day at 7:10 PM UTC. This should be scheduled slightly after the ROSA auto-delete to ensure that no | ||
# Peering Connections remain between the ROSA and Aurora VPCs. | ||
- cron: '10 19 * * *' | ||
|
||
jobs: | ||
|
||
checkout: | ||
name: Aurora Scheduled Delete cluster(s) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- if: github.event_name != 'schedule' || github.repository == 'keycloak/keycloak-benchmark' | ||
run: ./provision/aws/rds/aurora_cluster_reaper.sh | ||
env: | ||
AWS_REGION: ${{ vars.AWS_DEFAULT_REGION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Aurora Create | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
name: | ||
description: 'The name of the Aurora DB cluster' | ||
type: string | ||
required: true | ||
region: | ||
description: 'The AWS region used to host the Aurora DB' | ||
type: string | ||
required: true | ||
engineVersion: | ||
description: 'The Postgres engine version to use' | ||
type: string | ||
instanceClass: | ||
description: 'Instance class for the Aurora DB' | ||
type: string | ||
|
||
jobs: | ||
prepare: | ||
name: Create Aurora DB | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup ROSA CLI | ||
uses: ./.github/actions/rosa-cli-setup | ||
with: | ||
aws-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-default-region: ${{ vars.AWS_DEFAULT_REGION }} | ||
rosa-token: ${{ secrets.ROSA_TOKEN }} | ||
|
||
- name: Create Aurora Cluster | ||
uses: ./.github/actions/aurora-create-database | ||
with: | ||
name: ${{ inputs.name }} | ||
region: ${{ inputs.region }} | ||
engineVersion: ${{ inputs.engineVersion }} | ||
instanceClass: ${{ inputs.instanceClass }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Aurora Delete | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
name: | ||
description: 'The name of the Aurora DB cluster' | ||
type: string | ||
required: true | ||
region: | ||
description: 'The AWS region used to host the Aurora DB' | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
prepare: | ||
name: Delete Aurora DB | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup ROSA CLI | ||
uses: ./.github/actions/rosa-cli-setup | ||
with: | ||
aws-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-default-region: ${{ vars.AWS_DEFAULT_REGION }} | ||
rosa-token: ${{ secrets.ROSA_TOKEN }} | ||
|
||
- name: Delete Aurora | ||
uses: ./.github/actions/aurora-delete-database | ||
with: | ||
name: ${{ inputs.name }} | ||
region: ${{ inputs.region }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.