Prerequisites
Prerequisites
- A Checkly CLI project with
checklyinstalled as a dependency. - An AWS account with your values stored in AWS Secrets Manager.
- A GitHub repository with Actions enabled.
- A protected GitHub environment named
checkly-production. Restrict its deployment branches and reviewers as appropriate. - The repository or environment variables
AWS_ROLE_ARN,AWS_REGION, andCHECKLY_ACCOUNT_ID. - Permission to create an AWS IAM OIDC provider and role.
This guide uses a fictional payments service; replace its names, paths, and
URL with your own application values. Checkly requires
CHECKLY_API_KEY and
CHECKLY_ACCOUNT_ID; AWS_ROLE_ARN and AWS_REGION configure this workflow.Configure AWS access
Follow AWS’s guide for using Secrets Manager in GitHub jobs to create an OIDC provider and IAM role. Restrict the role’s trust policy to the repository and protected GitHub environment that deploy Checkly. Grant the rolesecretsmanager:GetSecretValue only for the secrets listed in this workflow. The retrieval action also requires secretsmanager:ListSecrets; secrets encrypted with a customer-managed KMS key require kms:Decrypt on that key. Store the role ARN and region in AWS_ROLE_ARN and AWS_REGION GitHub Actions variables.
Scope secrets in your constructs
Usesecret() to read CHECKLY_SECRET_* from the deploy process. Set secret: true so Checkly stores the value as a non-retrievable secret. Attach each value at the narrowest level that needs it:
checks/payments.check.ts
secret('PAYMENTS_API_KEY') reads CHECKLY_SECRET_PAYMENTS_API_KEY during deployment and fails if it is missing. The shorter key PAYMENTS_API_KEY is what your check receives at runtime.
Fetch and deploy in GitHub Actions
Fetch each AWS secret with an explicitCHECKLY_SECRET_* alias. The retrieval action masks the values and adds them to the environment of subsequent steps.
.github/workflows/checkly-deploy.yml
aws-secretsmanager-get-secrets are available to every later step in the job, not only the deploy command.
Rotate a secret
When you rotate a value in AWS Secrets Manager, run this workflow again. Checkly receives a copy duringcheckly deploy; rotation in AWS does not update an already deployed Checkly secret automatically.