Secrets manager - SoftupTechnologies/infrastructure-components GitHub Wiki

Path: /lib/secrets-manager/index.ts

Exports: SecretsManager

Required construct packages: @aws-cdk/aws-secretsmanager

This construct stores a json object in secrets manager and also generate a secret value.

Usage

import * as cdk from '@aws-cdk/core';
import { SecretsManager } from './secrets-manager';

export class ServerlessInfrastructureCdkStack extends cdk.Stack {
  constructor(scope: cdk.App, id: string, props: StackProps) {
    super(scope, id);

    const secret = new SecretsManager(this, 'SuperSecretData', {
      secretName: superSecret,
      secretValue: {
        a: 1,
        b: 2,
      }
    });
  }
}

Construct props

Name Type Required Default Description
secretName string true undefined Secret name to identify it in Secrets Manager service.
secretValue json true undefined Secret value.

Properties

Name Type Description
secret secretsmanager.Secret Created secret instance.