{{! Copyright (c) HashiCorp, Inc. SPDX-License-Identifier: BUSL-1.1 }}

{{#if (eq @mode "create")}} Create Connection {{else if (eq @mode "edit")}} Edit Connection {{else}} {{@model.id}} {{/if}}

{{#if @model.isAvailablePlugin}} {{#if (eq @mode "show")}} {{#if @model.canDelete}} {{/if}} {{#if @model.canReset}} {{/if}} {{#if (or @model.canReset @model.canDelete)}}
{{/if}} {{#if @model.canRotateRoot}} {{! template-lint-disable quotes }} {{! template-lint-enable }} {{/if}} {{#if @model.canAddRole}} Add role {{/if}} {{#if @model.canEdit}} Edit configuration {{/if}}
{{/if}} {{/if}} {{#if (eq @mode "create")}} {{#if (eq @model.plugin_name "vault-plugin-database-oracle")}} Warning Please ensure that your Oracle plugin has the default name of vault-plugin-database-oracle. Custom naming is not supported in the UI at this time. If the plugin is already named vault-plugin-database-oracle, disregard this warning. {{/if}}
{{#each @model.fieldAttrs as |attr|}} {{#if (not-eq attr.options.readOnly true)}} {{/if}} {{/each}} {{! Plugin Config Section }}
Plugin config {{#if @model.pluginFieldGroups}} {{#each @model.pluginFieldGroups as |fieldGroup|}} {{#each-in fieldGroup as |group fields|}} {{#if (eq group "default")}}
{{#each fields as |attr|}} {{#if (includes attr.name (array "max_open_connections" "max_idle_connections" "max_connection_lifetime")) }}
{{else}}
{{/if}} {{/each}}
{{else}} {{#let (camelize (concat "show" group)) as |prop|}} {{#if (get this prop)}}
{{#each fields as |attr|}} {{/each}}
{{/if}} {{/let}} {{/if}} {{/each-in}} {{/each}} {{else}} {{/if}}
{{! Statements Section }} {{! template-lint-configure simple-unless "warn" }} {{#unless (and @model.plugin_name (not @model.statementFields))}}

Statements

{{#if (eq @model.statementFields null)}} {{else}} {{#each @model.statementFields as |attr|}} {{/each}} {{/if}}
{{/unless}}
{{else if (and (eq @mode "edit") @model.isAvailablePlugin)}}
{{#each @model.fieldAttrs as |attr|}} {{#if (or (eq attr.name "name") (eq attr.name "plugin_name"))}} {{else if (not-eq attr.options.readOnly true)}} {{/if}} {{/each}} {{! Plugin Config Edit }}
Plugin config {{#each @model.pluginFieldGroups as |fieldGroup|}} {{#each-in fieldGroup as |group fields|}} {{#if (eq group "default")}}
{{#each fields as |attr|}} {{#if (includes attr.name (array "max_open_connections" "max_idle_connections" "max_connection_lifetime")) }}
{{else if (eq attr.name "password")}}
Update password
{{if this.showPasswordField "The new password that will be used when connecting to the database" "Vault will use the existing password" }}
{{#if this.showPasswordField}} {{/if}}
{{else}}
{{/if}} {{/each}}
{{else}} {{#let (camelize (concat "show" group)) as |prop|}} {{#if (get this prop)}}
{{#each fields as |attr|}} {{/each}}
{{/if}} {{/let}} {{/if}} {{/each-in}} {{/each}}
{{! Statements Edit Section }} {{#if (not (and @model.plugin_name (not @model.statementFields)))}}
Statements {{#each @model.statementFields as |attr|}} {{/each}}
{{/if}}
{{else if (eq @model.isAvailablePlugin false)}} {{else}} {{#each @model.showAttrs as |attr|}} {{#let attr.options.defaultShown as |defaultDisplay|}} {{#if (eq attr.type "object")}} {{else if (eq attr.type "array")}} {{else if (eq attr.name "skip_static_role_rotation_import")}} {{else}} {{/if}} {{/let}} {{/each}} {{/if}} {{#if this.showSaveModal}} Rotate your root credentials?

It’s best practice to rotate the root credential immediately after the initial configuration of each database. Once rotated, only Vault knows the new root password.

Would you like to rotate your new credentials? You can also do this later.

{{/if}}

Deleting the connection means that any associated roles won't be able to generate credentials until the connection is reconfigured.