Skip to content
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
30 changes: 3 additions & 27 deletions .gitlab/scripts/get_secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,15 @@ fi

printf "Getting AWS External ID...\n"

EXTERNAL_ID=$(aws ssm get-parameter \
--region us-east-1 \
--name "ci.datadog-lambda-extension.$EXTERNAL_ID_NAME" \
--with-decryption \
--query "Parameter.Value" \
--out text)
EXTERNAL_ID=$(vault kv get -field="$EXTERNAL_ID_NAME" kv/k8s/gitlab-runner/datadog-lambda-extension/secrets)

printf "Getting DD API KEY...\n"

export DD_API_KEY=$(aws ssm get-parameter \
--region us-east-1 \
--name ci.datadog-lambda-extension.dd-api-key \
--with-decryption \
--query "Parameter.Value" \
--out text)

printf "Getting DD API KEY Secret ARN...\n"

export DATADOG_API_SECRET_ARN=$(aws ssm get-parameter \
--region us-east-1 \
--name ci.datadog-lambda-extension.dd-api-key-secret-arn \
--with-decryption \
--query "Parameter.Value" \
--out text)
export DD_API_KEY=$(vault kv get -field=dd-api-key kv/k8s/gitlab-runner/datadog-lambda-extension/secrets)

printf "Getting DD APP KEY...\n"

export DD_APP_KEY=$(aws ssm get-parameter \
--region us-east-1 \
--name ci.datadog-lambda-extension.dd-app-key \
--with-decryption \
--query "Parameter.Value" \
--out text)
export DD_APP_KEY=$(vault kv get -field=dd-app-key kv/k8s/gitlab-runner/datadog-lambda-extension/secrets)

printf "Assuming role...\n"

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as lambda from 'aws-cdk-lib/aws-lambda';
import { LayerVersion } from "aws-cdk-lib/aws-lambda";
import {ACCOUNT, REGION} from "../config";

export const datadogSecretArn = process.env.DATADOG_API_SECRET_ARN!;
export const datadogSecretArn = 'arn:aws:secretsmanager:us-east-1:425362996713:secret:extension-integration-tests-api-key-PnEPHz';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: We may need to document this for future maintenance.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah, this was an overkill, this wasn't designed with ideal secret manager handling, ideally we'd move this into creation on the project and then cleaning it up, but overall, having a secret in the project is still overkill

export const extensionLayerArn = process.env.EXTENSION_LAYER_ARN!;

export const defaultNodeRuntime = lambda.Runtime.NODEJS_24_X;
Expand Down
Loading