<#import "/templates/guide.adoc" as tmpl>
<#import "/templates/links.adoc" as links>

<@tmpl.guide
title="Deploying AWS Aurora in multiple availability zones"
summary="Deploy an AWS Aurora as the database building block in a single-cluster deployment."
tileVisible="false" >

This topic describes how to deploy an Aurora regional deployment of a PostgreSQL instance across multiple availability zones to tolerate one or more availability zone failures in a given AWS region.

This deployment is intended to be used with the setup described in the <@links.ha id="single-cluster-concepts"/> {section}.
Use this deployment with the other building blocks outlined in the <@links.ha id="single-cluster-building-blocks"/> {section}.

include::../partials/blueprint-disclaimer.adoc[]

<#include "/high-availability/partials/aurora/aurora-single-site.adoc" />

[#single-cluster-aurora-connecting]
== Connecting Aurora database with {project_name}

Now that an Aurora database has been established and linked with all of your ROSA clusters, here are the relevant {project_name} CR options to connect the Aurora database with {project_name}. These changes will be required in the <@links.ha id="single-cluster-deploy-keycloak" /> {section}. The JDBC url is configured to use the Aurora database writer endpoint.

. Update `spec.db.url` to be `jdbc:aws-wrapper:postgresql://$HOST:5432/keycloak` where `$HOST` is the
<<aurora-writer-url, Aurora writer endpoint URL>>.

. Ensure that the Secrets referenced by `spec.db.usernameSecret` and `spec.db.passwordSecret` contain usernames and passwords defined when creating Aurora.

</@tmpl.guide>

== Next steps

After successful deployment of the Aurora database continue with <@links.ha id="single-cluster-deploy-keycloak" />
