Socket
Socket
Sign inDemoInstall

@pepperize/cdk-ses-smtp-credentials

Package Overview
Dependencies
41
Maintainers
2
Versions
1372
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @pepperize/cdk-ses-smtp-credentials

Generate SES smtp credentials for a given user and store the credentials in a SecretsManager Secret.


Version published
Weekly downloads
6.7K
decreased by-15.62%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

PRs Welcome GitHub npm (scoped) PyPI Nuget Sonatype Nexus (Releases) GitHub Workflow Status (branch) GitHub release (latest SemVer) Gitpod ready-to-code

AWS CDK Ses Smtp Credentials

Generate SES smtp credentials for a user and store the credentials in a SecretsManager Secret.

View on Construct Hub

Install

TypeScript

npm install @pepperize/cdk-ses-smtp-credentials

or

yarn add @pepperize/cdk-ses-smtp-credentials

Python

pip install pepperize.cdk-ses-smtp-credentials

C# / .Net

dotnet add package Pepperize.CDK.SesSmtpCredentials

Java

<dependency>
  <groupId>com.pepperize</groupId>
  <artifactId>cdk-ses-smtp-credentials</artifactId>
  <version>${cdkSesSmtpCredentials.version}</version>
</dependency>

Usage

npm install @pepperize/cdk-ses-smtp-credentials

See API.md.

Create AWS SES Smtp Credentials for a given user

Attaches an inline policy to the user allowing to send emails

import { User } from "@aws-cdk/aws-iam";
import { SesSmtpCredentials } from "@pepperize/cdk-ses-smtp-credentials";

const user = new User(stack, "SesUser", {
  userName: "ses-user",
});
const smtpCredentials = new SesSmtpCredentials(this, "SmtpCredentials", {
  user: user,
});

// smtpCredentials.secret contains json value {username: "<the generated access key id>", password: "<the calculated ses smtp password>"}

See API Reference - SesSmtpCredentials

Create AWS SES Smtp Credentials and create a new user

Attaches an inline policy to the user allowing to send emails

import { User } from "@aws-cdk/aws-iam";
import { SesSmtpCredentials } from "@pepperize/cdk-ses-smtp-credentials";

const smtpCredentials = new SesSmtpCredentials(this, "SmtpCredentials", {
  userName: "ses-user",
});

// smtpCredentials.secret contains json value {username: "<the generated access key id>", password: "<the calculated ses smtp password>"}

See API Reference - SesSmtpCredentials

Calculate the AWS SES Smtp password on your own

import * as AWS from "aws-sdk";
import { calculateSesSmtpPassword } from "@pepperize/cdk-ses-smtp-credentials";

const iam = new AWS.IAM();
const accessKey = await iam
  .createAccessKey({
    UserName: username,
  })
  .promise();
const accessKeyId = accessKey.AccessKey.AccessKeyId;
const secretAccessKey = accessKey.AccessKey.SecretAccessKey;

const password = calculateSesSmtpPassword(secretAccessKey, "us-east-1");

console.log({
  username: accessKeyId,
  password: password,
});

See Obtaining Amazon SES SMTP credentials by converting existing AWS credentials

Keywords

FAQs

Last updated on 30 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc