-
Notifications
You must be signed in to change notification settings - Fork 53
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
Vault: enabled metrics_config and audit_log_config for HCP Vault #319
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a port of already approved PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just had two comments to address.
I did some local testing to see the impact on existing resources, and everything checks out.
- Existing Vault cluster
# config
resource "hcp_hvn" "hvn_1" {
hvn_id = "hvn-1"
cloud_provider = "aws"
region = "us-west-2"
cidr_block = "172.25.16.0/20"
}
resource "hcp_vault_cluster" "c1" {
cluster_id = "test-primary"
hvn_id = hcp_hvn.hvn_1.hvn_id
tier = "plus_small"
public_endpoint = true
# metrics_config {
# datadog_api_key = "test_datadog"
# datadog_region = "us1"
# }
# audit_log_config {
# datadog_api_key = "test_datadog"
# datadog_region = "us1"
# }
}
$ terraform apply
...
hcp_vault_cluster.c1: Creation complete after 5m32s [id=/project/project1/hashicorp.vault.cluster/test-primary]
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
- Add metrics config
# updated config
resource "hcp_vault_cluster" "c1" {
cluster_id = "test-primary"
hvn_id = hcp_hvn.hvn_1.hvn_id
tier = "plus_small"
public_endpoint = true
metrics_config {
datadog_api_key = "test_datadog"
datadog_region = "us1"
}
audit_log_config {
datadog_api_key = "test_datadog"
datadog_region = "us1"
}
}
$ terraform apply
...
hcp_vault_cluster.c1: Modifications complete after 11m25s [id=/project/project1/hashicorp.vault.cluster/test-primary]
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
Removing the config works too π
@@ -381,7 +469,7 @@ func TestAccPerformanceReplication_Validations(t *testing.T) { | |||
resource "hcp_vault_cluster" "c2" { | |||
cluster_id = "test-secondary" | |||
hvn_id = hcp_hvn.hvn1.hvn_id | |||
tier = hcp_vault_cluster.c1.tier | |||
tier = "plus_medium" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These references are here intentionally as best practice reference. Can you revert the tier changes?
@@ -277,6 +293,78 @@ resource "hcp_hvn" "hvn2" { | |||
`, vaultCluster) | |||
} | |||
|
|||
func TestGetValidObservabilityConfig(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might need to go in its own file, like peering_test.go, since I don't think unit tests and acceptance tests will run in the same file.
* Added metrics and audit log config for HCP Vault * Add the docs * Rollback changes from legacy cold on internal * put test in another file
π οΈ Description
Add support to metrics and audit log to the HCP Vault resource
π’ Release Note
Release note for CHANGELOG:
ποΈ Acceptance tests
Output from acceptance testing:
https://user-images.githubusercontent.com/97476714/170169244-73934537-7f0c-4ec6-a8d4-15e5a792955d.png
https://user-images.githubusercontent.com/97476714/170177128-9f341b0b-6bd9-4efd-90ac-568d0bd14dd8.png