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

fix: Randomize SSM parameter name for Grafana token #272

Merged
merged 3 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/existing-cluster-with-base-and-infra/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ if [[ $? -eq 0 && $destroy_output == *"Destroy complete!"* ]]; then
else
echo "FAILED: Terraform destroy of all targets failed"
exit 1
fi
fi
2 changes: 1 addition & 1 deletion examples/existing-cluster-with-base-and-infra/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
else
echo "FAILED: Terraform apply of all modules failed"
exit 1
fi
fi
2 changes: 2 additions & 0 deletions modules/eks-monitoring/add-ons/external-secrets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This deploys an EKS Cluster with the External Secrets Operator. The cluster is p
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.72 |
| <a name="provider_kubectl"></a> [kubectl](#provider\_kubectl) | >= 2.0.3 |
| <a name="provider_random"></a> [random](#provider\_random) | n/a |

## Modules

Expand All @@ -35,6 +36,7 @@ This deploys an EKS Cluster with the External Secrets Operator. The cluster is p
| [aws_ssm_parameter.secret](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_parameter) | resource |
| [kubectl_manifest.cluster_secretstore](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource |
| [kubectl_manifest.secret](https://registry.terraform.io/providers/alekc/kubectl/latest/docs/resources/manifest) | resource |
| [random_uuid.grafana_key_suffix](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/uuid) | resource |
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |

## Inputs
Expand Down
5 changes: 4 additions & 1 deletion modules/eks-monitoring/add-ons/external-secrets/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ YAML
depends_on = [module.external_secrets]
}

resource "random_uuid" "grafana_key_suffix" {
}

resource "aws_ssm_parameter" "secret" {
name = "/terraform-accelerator/grafana-api-key"
name = "/terraform-accelerator/grafana-api-key/${random_uuid.grafana_key_suffix.result}"
description = "SSM Secret to store grafana API Key"
type = "SecureString"
value = jsonencode({
Expand Down
Loading