{{#unless (has-feature "DR Replication")}} {{upgrade-page title="Replication"}} {{else if (or cluster.allReplicationDisabled cluster.replicationAttrs.replicationDisabled)}}

{{#if initialReplicationMode}} {{#if (eq initialReplicationMode 'dr')}} Enable Disaster Recovery Replication {{else if (eq initialReplicationMode 'performance')}} Enable Performance Replication {{/if}} {{else}} Enable Replication {{/if}}

{{message-error errors=errors}} {{#if initialReplicationMode}} {{#if (eq initialReplicationMode 'dr')}}

{{replication-mode-description 'dr'}}

{{else if (eq initialReplicationMode 'performance')}}

{{#unless (has-feature "Performance Replication")}}

Performance Replication is a feature of Vault Enterprise Premium

{{else}}

{{replication-mode-description 'performance'}}

{{/unless}} {{/if}} {{else}}

In both Performance and Disaster Recovery (DR) Replication, secondaries share the underlying configuration, policies, and supporting secrets as their primary cluster.

{{/if}}
{{#if (eq mode 'secondary')}} {{/if}}
{{#if (eq mode 'primary')}} {{#if cluster.canEnablePrimary}}
{{input class="input" id="primary_cluster_addr" name="primary_cluster_addr" value=primary_cluster_addr}}

Overrides the cluster address that the primary gives to secondary nodes.

{{else}}

The token you are using is not authorized to enable primary replication.

{{/if}} {{else}} {{#if cluster.canEnableSecondary}} {{#if (and (eq replicationMode 'dr') (not cluster.performance.replicationDisabled) (has-feature "Performance Replication") ) }}
{{toggle-button toggleTarget=this toggleAttr='showExplanation' openLabel="Disable Performance Replication in order to enable this cluster as a DR secondary." closedLabel="Disable Performance Replication in order to enable this cluster as a DR secondary." class="has-text-danger" }} {{#if showExplanation}}

When running as a DR Secondary Vault is read only. For this reason, we don't allow other Replication modes to operate at the same time. This cluster is also currently operating as a Performance {{capitalize cluster.performance.modeForUrl}}.

{{/if}}
{{else}}
{{textarea value=token id="secondary-token" name="secondary-token" class="textarea"}}
{{input value=primary_api_addr id="primary_api_addr" name="primary_api_addr" class="input"}}

{{#if (and token (not tokenIncludesAPIAddr))}} The supplied token does not contain an embedded address for the primary cluster. Please enter the primary cluster's API address (normal Vault address). {{else}} Set this to the API address (normal Vault address) to override the value embedded in the token. {{/if}}

{{input value=ca_file id="ca_file" name="ca_file" class="input"}}

Specifies the path to a CA root file (PEM format) that the secondary can use when unwrapping the token from the primary.

{{input value=ca_path id="ca_path" name="ca_file" class="input"}}

Specifies the path to a CA root directory containing PEM-format files that the secondary can use when unwrapping the token from the primary.

Note: If both CA file and CA path are not given, they default to system CA roots.

{{/if}} {{else}}

The token you are using is not authorized to enable secondary replication.

{{/if}} {{/if}}
{{#if (or (and (eq mode 'primary') cluster.canEnablePrimary) (and (eq mode 'secondary') cluster.canEnableSecondary))}}
{{/if}}
{{else if showModeSummary}} {{#unless (and cluster.dr.replicationEnabled cluster.performance.replicationEnabled)}}

Replication

{{/unless}} {{#if (and (eq cluster.dr.mode "primary") (eq cluster.performance.mode "primary")) }} {{else}}

{{#if cluster.dr.replicationEnabled}} {{#if submit.isRunning }} {{else}} {{#link-to "mode.index" "dr" class="link-plain" }} {{replication-mode-summary mode="dr" cluster=cluster tagName="span" }} {{/link-to}} {{/if}} {{else}} {{replication-mode-summary mode="dr" cluster=cluster tagName="div" }} {{/if}}
{{#unless (and submit.isRunning (eq cluster.dr.mode "bootstrapping"))}}

{{#link-to "mode.index" "performance" class="link-plain" }} {{replication-mode-summary mode="performance" cluster=cluster tagName="span" }} {{/link-to}}
{{/unless}} {{/if}} {{else}} {{#if (eq replicationAttrs.mode 'initializing')}} The cluster is initializing replication. This may take some time. {{else}}

{{cluster.replicationModeStatus.cluster_id}}

{{#if (eq replicationAttrs.mode 'secondary')}} {{else}} {{/if}}
{{/if}} {{/unless}}