Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External dbs observability and management v2 #856

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mitoeth
Copy link
Collaborator

@mitoeth mitoeth commented Feb 22, 2024

NOTE: New pull request after adding password placeholders in db_credentials.json and db_credentials_example.json

I made a Terraform configuration to enable the following services in Observability & Management for external databases with agents.

Database Management
Operations Insights
Stack Monitoring

The configuration will do the setup based on input from two JSON-files: db_systems.json and db_credentials.json

@mitoeth mitoeth added the new Creation of a new asset label Feb 22, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 22, 2024
}
}

variable "external_cdb_connector_connection_credentials_password" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding a validation? Like value != ""?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Have provided !="" validation for credential and connection variables to make sure it´s set to something before applying anything (See commit: "Connection and credential variables validated for empty strings"

}
}

variable "external_pdb_connector_connection_credentials_password" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding a validation, like value != ""?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Have provided !="" validation for credential and connection variables to make sure it´s set to something before applying anything (See commit: "Connection and credential variables validated for empty strings")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a warning that the password values may be present in clear text in the tfstate.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. See commit: 1203619

At line 53, it´s noted that the Terraform config will set port to 1521 if no value is provided in JSON-input
At line 84-85, it´s noted that credential details are visible as plain text in both the JSON-input and in the tfstate, so both files should be managed securely
In variables for DB system connections, it´s validated whether usernames, passwords, hosts, service names, and agent IDs are provided in JSON-input as empty strings. This is to stop apply early before anything is actually created in OCI

Port and protocol variable definitions have not been changed since the former has a default value and the latter has alternative validation
Copy link
Member

@oheimburger oheimburger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes.

condition = var.external_database_connector_agent_id != ""
error_message = "The value of 'managementAgentId' in the JSON-input for database systems is an empty string"
}
#default = "ocid1.managementagent.oc1..XXXXXXX"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove line.

variable "external_database_connector_agent_id" {
description = "The OCID for the management agent used for database connections"
type = string
#default = "ocid1.managementagent.oc1..XXXXXXX"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove line.

variable "compartment_ocid" {
description = "Compartment OCID"
type = string
default = "ocid1.compartment.oc1..XXXXXX"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new Creation of a new asset OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants