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

Create Parameter store #17

Merged
merged 3 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions .github/workflows/tf_apply_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ env:
AWS_REGION: ca-central-1
TERRAFORM_VERSION: 1.10.4
TERRAGRUNT_VERSION: 0.72.3
TF_VAR_docdb_username: ${{ secrets.DOCDB_USERNAME}}
TF_VAR_docdb_password: ${{ secrets.DOCDB_PASSWORD}}

permissions:
id-token: write
Expand All @@ -40,6 +42,10 @@ jobs:
role-session-name: TFApply
aws-region: ${{ env.AWS_REGION }}

- name: Apply ssm
working-directory: terragrunt/env/staging/ssm
run: terragrunt apply --terragrunt-non-interactive -auto-approve

- name: Apply network
working-directory: terragrunt/env/staging/network
run: terragrunt apply --terragrunt-non-interactive -auto-approve
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tf_plan_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ env:
AWS_REGION: ca-central-1
TERRAFORM_VERSION: 1.10.4
TERRAGRUNT_VERSION: 0.72.3
TF_VAR_docdb_username: ${{ secrets.DOCDB_USERNAME}}
TF_VAR_docdb_password: ${{ secrets.DOCDB_PASSWORD}}

permissions:
id-token: write
Expand All @@ -28,6 +30,7 @@ jobs:
matrix:
include:
- module: ecr
- module: ssm
- module: network
- module: hosted_zone
runs-on: ubuntu-latest
Expand Down
11 changes: 11 additions & 0 deletions terragrunt/aws/ssm/inputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
variable "docdb_username" {
description = "The username of the documentdb cluseter"
sensitive = true
type = string
}

variable "docdb_password" {
description = "The password of the documentdb cluster"
sensitive = true
type = string
}
9 changes: 9 additions & 0 deletions terragrunt/aws/ssm/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
output "docdb_username_arn" {
description = "Arn of the document db username parameter"
value = aws_ssm_parameter.docdb_username.arn
}

output "docdb_password_arn" {
description = "Arn of the document db password parameter"
value = aws_ssm_parameter.docdb_password.arn
}
21 changes: 21 additions & 0 deletions terragrunt/aws/ssm/ssm.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "aws_ssm_parameter" "docdb_username" {
name = "docdb_username"
type = "SecureString"
value = var.docdb_username

tags = {
CostCentre = var.billing_code
Terraform = true
}
}

resource "aws_ssm_parameter" "docdb_password" {
name = "docdb_password"
type = "SecureString"
value = var.docdb_password

tags = {
CostCentre = var.billing_code
Terraform = true
}
}
25 changes: 25 additions & 0 deletions terragrunt/env/staging/ssm/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions terragrunt/env/staging/ssm/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
source = "../../../aws//ssm"
}

include {
path = find_in_parent_folders("root.hcl")
}