Skip to content

Commit e73a679

Browse files
committed
eli-304 dealing with ssm + secrets
1 parent 3e887c6 commit e73a679

File tree

8 files changed

+24
-16
lines changed

8 files changed

+24
-16
lines changed

.github/workflows/base-deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ jobs:
131131
TF_VAR_API_CA_CERT: ${{ secrets.API_CA_CERT }}
132132
TF_VAR_API_CLIENT_CERT: ${{ secrets.API_CLIENT_CERT }}
133133
TF_VAR_API_PRIVATE_KEY_CERT: ${{ secrets.API_PRIVATE_KEY_CERT }}
134+
TF_VAR_SPLUNK_HEC_TOKEN: ${{ secrets.SPLUNK_HEC_TOKEN }}
135+
TF_VAR_SPLUNK_HEC_ENDPOINT: ${{ secrets.SPLUNK_HEC_ENDPOINT }}
136+
134137
working-directory: ./infrastructure
135138
shell: bash
136139
run: |

.github/workflows/cicd-2-publish.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,15 @@ jobs:
9393
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/service-roles/github-actions-api-deployment-role
9494
aws-region: eu-west-2
9595

96-
- name: "Terraform Plan Stacks"
96+
- name: "Terraform Apply"
9797
env:
9898
ENVIRONMENT: dev
9999
WORKSPACE: "default"
100100
TF_VAR_API_CA_CERT: ${{ secrets.API_CA_CERT }}
101101
TF_VAR_API_CLIENT_CERT: ${{ secrets.API_CLIENT_CERT }}
102102
TF_VAR_API_PRIVATE_KEY_CERT: ${{ secrets.API_PRIVATE_KEY_CERT }}
103+
TF_VAR_SPLUNK_HEC_TOKEN: ${{ secrets.SPLUNK_HEC_TOKEN }}
104+
TF_VAR_SPLUNK_HEC_ENDPOINT: ${{ secrets.SPLUNK_HEC_ENDPOINT }}
103105

104106
# just planning for now for safety and until review
105107
run: |

.github/workflows/cicd-3-test.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ jobs:
119119
TF_VAR_API_CA_CERT: ${{ secrets.API_CA_CERT }}
120120
TF_VAR_API_CLIENT_CERT: ${{ secrets.API_CLIENT_CERT }}
121121
TF_VAR_API_PRIVATE_KEY_CERT: ${{ secrets.API_PRIVATE_KEY_CERT }}
122-
122+
TF_VAR_SPLUNK_HEC_TOKEN: ${{ secrets.SPLUNK_HEC_TOKEN }}
123+
TF_VAR_SPLUNK_HEC_ENDPOINT: ${{ secrets.SPLUNK_HEC_ENDPOINT }}
123124
run: |
124125
mkdir -p ./build
125126
echo "Running: make terraform env=$ENVIRONMENT workspace=$WORKSPACE stack=networking tf-command=apply"

.github/workflows/manual-terraform-apply.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ jobs:
6363
TF_VAR_API_CA_CERT: ${{ secrets.API_CA_CERT }}
6464
TF_VAR_API_CLIENT_CERT: ${{ secrets.API_CLIENT_CERT }}
6565
TF_VAR_API_PRIVATE_KEY_CERT: ${{ secrets.API_PRIVATE_KEY_CERT }}
66-
66+
TF_VAR_SPLUNK_HEC_TOKEN: ${{ secrets.SPLUNK_HEC_TOKEN }}
67+
TF_VAR_SPLUNK_HEC_ENDPOINT: ${{ secrets.SPLUNK_HEC_ENDPOINT }}
6768
run: |
6869
mkdir -p ./build
6970
echo "Running: make terraform env=$ENVIRONMENT workspace=$WORKSPACE stack=networking tf-command=plan args=\"-auto-approve\""

infrastructure/stacks/api-layer/data.tf

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,3 @@ data "aws_ssm_parameter" "mtls_api_ca_cert" {
2828
name = "/${var.environment}/mtls/api_ca_cert"
2929
with_decryption = true
3030
}
31-
32-
data "aws_ssm_parameter" "splunk_hec_token" {
33-
name = "/splunk/hec/token"
34-
with_decryption = true
35-
}
36-
data "aws_ssm_parameter" "splunk_hec_endpoint" {
37-
name = "/splunk/hec/endpoint"
38-
with_decryption = true
39-
}

infrastructure/stacks/api-layer/splunk_forwarder.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module "splunk_forwarder" {
22
source = "../../modules/splunk_forwarder"
33

4-
splunk_hec_endpoint = data.aws_ssm_parameter.splunk_hec_endpoint.value
5-
splunk_hec_token = data.aws_ssm_parameter.splunk_hec_token.value
4+
splunk_hec_endpoint = aws_ssm_parameter.splunk_hec_endpoint.value
5+
splunk_hec_token = aws_ssm_parameter.splunk_hec_token.value
66
splunk_firehose_s3_role_arn = aws_iam_role.splunk_firehose_assume_role.arn
77
splunk_firehose_s3_backup_arn = module.s3_firehose_backup_bucket.storage_bucket_arn
88

infrastructure/stacks/api-layer/ssm.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ resource "aws_ssm_parameter" "splunk_hec_token" {
5858
description = "Splunk HEC token"
5959
type = "SecureString"
6060
key_id = aws_kms_key.splunk_hec_kms.id # Will migrate to customer key after initial creation
61-
value = "PLACEHOLDER" # This will be ignored due to lifecycle rule
61+
value = var.splunk_hec_token
6262
tier = "Advanced"
6363

6464
tags = {
@@ -78,7 +78,7 @@ resource "aws_ssm_parameter" "splunk_hec_endpoint" {
7878
description = "Splunk HEC endpoint"
7979
type = "SecureString"
8080
key_id = aws_kms_key.splunk_hec_kms.id # Will migrate to customer key after initial creation
81-
value = "PLACEHOLDER" # This will be ignored due to lifecycle rule
81+
value = var.splunk_hec_endpoint
8282
tier = "Advanced"
8383

8484
tags = {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
variable "splunk_hec_token" {
2+
type = string
3+
description = "The HEC token for ITOC splunk"
4+
sensitive = true
5+
}
6+
variable "splunk_hec_endpoint" {
7+
type = string
8+
description = "The HEC endpoint url for ITOC splunk"
9+
sensitive = true
10+
}

0 commit comments

Comments
 (0)