Skip to content

Latest commit

 

History

History
254 lines (153 loc) · 9.08 KB

API.md

File metadata and controls

254 lines (153 loc) · 9.08 KB

API Reference

Constructs

SesSmtpCredentials

This construct creates an access key for the given user and stores the generated SMTP credentials inside a secret.

Attaches an inline policy to the user allowing to send emails

const user = User.fromUserName("ses-user-example");
const credentials = new SesSmtpCredentials(this, 'SmtpCredentials', {
    user: user,
});
// smtpCredentials.secret contains json value {username: "<the generated access key id>", password: "<the calculated ses smtp password>"}

Initializers

import { SesSmtpCredentials } from '@pepperize/cdk-ses-smtp-credentials'

new SesSmtpCredentials(scope: Construct, id: string, props: SesSmtpCredentialsProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props SesSmtpCredentialsProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { SesSmtpCredentials } from '@pepperize/cdk-ses-smtp-credentials'

SesSmtpCredentials.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
secret aws-cdk-lib.aws_secretsmanager.ISecret The secret that contains the calculated AWS SES Smtp Credentials.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


secretRequired
public readonly secret: ISecret;
  • Type: aws-cdk-lib.aws_secretsmanager.ISecret

The secret that contains the calculated AWS SES Smtp Credentials.

import { aws_ecs } from "aws-cdk-lib";

const containerDefinitionOptions: aws_ecs.ContainerDefinitionOptions = {
    // ...
    secrets: {
        MAIL_USERNAME: aws_ecs.Secret.fromSecretsManager(smtpCredentials.secret, "username"),
        MAIL_PASSWORD: aws_ecs.Secret.fromSecretsManager(smtpCredentials.secret, "password"),
    }
}

Structs

SesSmtpCredentialsProps

Initializer

import { SesSmtpCredentialsProps } from '@pepperize/cdk-ses-smtp-credentials'

const sesSmtpCredentialsProps: SesSmtpCredentialsProps = { ... }

Properties

Name Type Description
passwordSecretKey string Optional, the key name to use in the secret to write the password to (defaults to Credentials.PASSWORD).
secret aws-cdk-lib.aws_secretsmanager.ISecret Optional, an SecretsManager secret to write the AWS SES Smtp credentials to.
user aws-cdk-lib.aws_iam.IUser The user for which to create an AWS Access Key and to generate the smtp password.
userName string Optional, a username to create a new user if no existing user is given.
userNameSecretKey string Optional, the key name to use in the secret to write the username to (defaults to Credentials.USERNAME).

passwordSecretKeyOptional
public readonly passwordSecretKey: string;
  • Type: string

Optional, the key name to use in the secret to write the password to (defaults to Credentials.PASSWORD).


secretOptional
public readonly secret: ISecret;
  • Type: aws-cdk-lib.aws_secretsmanager.ISecret

Optional, an SecretsManager secret to write the AWS SES Smtp credentials to.


userOptional
public readonly user: IUser;
  • Type: aws-cdk-lib.aws_iam.IUser

The user for which to create an AWS Access Key and to generate the smtp password.

If omitted a user will be created.


userNameOptional
public readonly userName: string;
  • Type: string

Optional, a username to create a new user if no existing user is given.


userNameSecretKeyOptional
public readonly userNameSecretKey: string;
  • Type: string

Optional, the key name to use in the secret to write the username to (defaults to Credentials.USERNAME).


Enums

Credentials

Members

Name Description
USERNAME The key of the username stored in the secretsmanager key/value json.
PASSWORD The key of the password stored in the secretsmanager key/value json.

USERNAME

The key of the username stored in the secretsmanager key/value json.


PASSWORD

The key of the password stored in the secretsmanager key/value json.