pepperize.cdk-ses-smtp-credentials


Namepepperize.cdk-ses-smtp-credentials JSON
Version 0.3.628 PyPI version JSON
download
home_pagehttps://github.com/pepperize/cdk-ses-smtp-credentials.git
SummaryGenerate SES smtp credentials for a given user and store the credentials in a SecretsManager Secret.
upload_time2023-12-29 22:31:27
maintainer
docs_urlNone
authorPatrick Florek<patrick.florek@gmail.com>
requires_python~=3.8
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)
[![GitHub](https://img.shields.io/github/license/pepperize/cdk-ses-smtp-credentials?style=flat-square)](https://github.com/pepperize/cdk-ses-smtp-credentials/blob/main/LICENSE)
[![npm (scoped)](https://img.shields.io/npm/v/@pepperize/cdk-ses-smtp-credentials?style=flat-square)](https://www.npmjs.com/package/@pepperize/cdk-ses-smtp-credentials)
[![PyPI](https://img.shields.io/pypi/v/pepperize.cdk-ses-smtp-credentials?style=flat-square)](https://pypi.org/project/pepperize.cdk-ses-smtp-credentials/)
[![Nuget](https://img.shields.io/nuget/v/Pepperize.CDK.SesSmtpCredentials?style=flat-square)](https://www.nuget.org/packages/Pepperize.CDK.SesSmtpCredentials/)
[![Sonatype Nexus (Releases)](https://img.shields.io/nexus/r/com.pepperize/cdk-ses-smtp-credentials?server=https%3A%2F%2Fs01.oss.sonatype.org%2F&style=flat-square)](https://s01.oss.sonatype.org/content/repositories/releases/com/pepperize/cdk-ses-smtp-credentials/)
[![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/pepperize/cdk-ses-smtp-credentials/release.yml?branch=main&label=release&style=flat-square)](https://github.com/pepperize/cdk-ses-smtp-credentials/actions/workflows/release.yml)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/pepperize/cdk-ses-smtp-credentials?sort=semver&style=flat-square)](https://github.com/pepperize/cdk-ses-smtp-credentials/releases)
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod&style=flat-square)](https://gitpod.io/#https://github.com/pepperize/cdk-ses-smtp-credentials)

# AWS CDK Ses Smtp Credentials

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

[![View on Construct Hub](https://constructs.dev/badge?package=%40pepperize%2Fcdk-ses-smtp-credentials)](https://constructs.dev/packages/@pepperize/cdk-ses-smtp-credentials)

## Install

### TypeScript

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

or

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

### Python

```shell
pip install pepperize.cdk-ses-smtp-credentials
```

### C# / .Net

```
dotnet add package Pepperize.CDK.SesSmtpCredentials
```

### Java

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

## Usage

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

See [API.md](https://github.com/pepperize/cdk-ses-smtp-credentials/blob/main/API.md).

### Create AWS SES Smtp Credentials for a given user

> Attaches an inline policy to the user allowing to send emails

```python
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](https://github.com/pepperize/cdk-ses-smtp-credentials/blob/main/API.md#sessmtpcredentials-)

### Create AWS SES Smtp Credentials and create a new user

> Attaches an inline policy to the user allowing to send emails

```python
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](https://github.com/pepperize/cdk-ses-smtp-credentials/blob/main/API.md#sessmtpcredentials-)

### Calculate the AWS SES Smtp password on your own

```python
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](https://docs.aws.amazon.com/ses/latest/dg/smtp-credentials.html#smtp-credentials-convert)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pepperize/cdk-ses-smtp-credentials.git",
    "name": "pepperize.cdk-ses-smtp-credentials",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "~=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "Patrick Florek<patrick.florek@gmail.com>",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/3a/b9/3057d56154e35830ca3af8314f3ceb853998b441fe0032543a4f7c31c931/pepperize.cdk-ses-smtp-credentials-0.3.628.tar.gz",
    "platform": null,
    "description": "[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)\n[![GitHub](https://img.shields.io/github/license/pepperize/cdk-ses-smtp-credentials?style=flat-square)](https://github.com/pepperize/cdk-ses-smtp-credentials/blob/main/LICENSE)\n[![npm (scoped)](https://img.shields.io/npm/v/@pepperize/cdk-ses-smtp-credentials?style=flat-square)](https://www.npmjs.com/package/@pepperize/cdk-ses-smtp-credentials)\n[![PyPI](https://img.shields.io/pypi/v/pepperize.cdk-ses-smtp-credentials?style=flat-square)](https://pypi.org/project/pepperize.cdk-ses-smtp-credentials/)\n[![Nuget](https://img.shields.io/nuget/v/Pepperize.CDK.SesSmtpCredentials?style=flat-square)](https://www.nuget.org/packages/Pepperize.CDK.SesSmtpCredentials/)\n[![Sonatype Nexus (Releases)](https://img.shields.io/nexus/r/com.pepperize/cdk-ses-smtp-credentials?server=https%3A%2F%2Fs01.oss.sonatype.org%2F&style=flat-square)](https://s01.oss.sonatype.org/content/repositories/releases/com/pepperize/cdk-ses-smtp-credentials/)\n[![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/pepperize/cdk-ses-smtp-credentials/release.yml?branch=main&label=release&style=flat-square)](https://github.com/pepperize/cdk-ses-smtp-credentials/actions/workflows/release.yml)\n[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/pepperize/cdk-ses-smtp-credentials?sort=semver&style=flat-square)](https://github.com/pepperize/cdk-ses-smtp-credentials/releases)\n[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod&style=flat-square)](https://gitpod.io/#https://github.com/pepperize/cdk-ses-smtp-credentials)\n\n# AWS CDK Ses Smtp Credentials\n\nGenerate SES smtp credentials for a user and store the credentials in a SecretsManager Secret.\n\n[![View on Construct Hub](https://constructs.dev/badge?package=%40pepperize%2Fcdk-ses-smtp-credentials)](https://constructs.dev/packages/@pepperize/cdk-ses-smtp-credentials)\n\n## Install\n\n### TypeScript\n\n```shell\nnpm install @pepperize/cdk-ses-smtp-credentials\n```\n\nor\n\n```shell\nyarn add @pepperize/cdk-ses-smtp-credentials\n```\n\n### Python\n\n```shell\npip install pepperize.cdk-ses-smtp-credentials\n```\n\n### C# / .Net\n\n```\ndotnet add package Pepperize.CDK.SesSmtpCredentials\n```\n\n### Java\n\n```xml\n<dependency>\n  <groupId>com.pepperize</groupId>\n  <artifactId>cdk-ses-smtp-credentials</artifactId>\n  <version>${cdkSesSmtpCredentials.version}</version>\n</dependency>\n```\n\n## Usage\n\n```shell\nnpm install @pepperize/cdk-ses-smtp-credentials\n```\n\nSee [API.md](https://github.com/pepperize/cdk-ses-smtp-credentials/blob/main/API.md).\n\n### Create AWS SES Smtp Credentials for a given user\n\n> Attaches an inline policy to the user allowing to send emails\n\n```python\nimport { User } from \"@aws-cdk/aws-iam\";\nimport { SesSmtpCredentials } from \"@pepperize/cdk-ses-smtp-credentials\";\n\nconst user = new User(stack, \"SesUser\", {\n  userName: \"ses-user\",\n});\nconst smtpCredentials = new SesSmtpCredentials(this, \"SmtpCredentials\", {\n  user: user,\n});\n\n// smtpCredentials.secret contains json value {username: \"<the generated access key id>\", password: \"<the calculated ses smtp password>\"}\n```\n\nSee [API Reference - SesSmtpCredentials](https://github.com/pepperize/cdk-ses-smtp-credentials/blob/main/API.md#sessmtpcredentials-)\n\n### Create AWS SES Smtp Credentials and create a new user\n\n> Attaches an inline policy to the user allowing to send emails\n\n```python\nimport { User } from \"@aws-cdk/aws-iam\";\nimport { SesSmtpCredentials } from \"@pepperize/cdk-ses-smtp-credentials\";\n\nconst smtpCredentials = new SesSmtpCredentials(this, \"SmtpCredentials\", {\n  userName: \"ses-user\",\n});\n\n// smtpCredentials.secret contains json value {username: \"<the generated access key id>\", password: \"<the calculated ses smtp password>\"}\n```\n\nSee [API Reference - SesSmtpCredentials](https://github.com/pepperize/cdk-ses-smtp-credentials/blob/main/API.md#sessmtpcredentials-)\n\n### Calculate the AWS SES Smtp password on your own\n\n```python\nimport * as AWS from \"aws-sdk\";\nimport { calculateSesSmtpPassword } from \"@pepperize/cdk-ses-smtp-credentials\";\n\nconst iam = new AWS.IAM();\nconst accessKey = await iam\n  .createAccessKey({\n    UserName: username,\n  })\n  .promise();\nconst accessKeyId = accessKey.AccessKey.AccessKeyId;\nconst secretAccessKey = accessKey.AccessKey.SecretAccessKey;\n\nconst password = calculateSesSmtpPassword(secretAccessKey, \"us-east-1\");\n\nconsole.log({\n  username: accessKeyId,\n  password: password,\n});\n```\n\nSee [Obtaining Amazon SES SMTP credentials by converting existing AWS credentials](https://docs.aws.amazon.com/ses/latest/dg/smtp-credentials.html#smtp-credentials-convert)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Generate SES smtp credentials for a given user and store the credentials in a SecretsManager Secret.",
    "version": "0.3.628",
    "project_urls": {
        "Homepage": "https://github.com/pepperize/cdk-ses-smtp-credentials.git",
        "Source": "https://github.com/pepperize/cdk-ses-smtp-credentials.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ea377db08b90e09693543adfb1f247b8df02d6627c778bb188924c2329d76a55",
                "md5": "758bc30f9e61ac329ec6543498ca993e",
                "sha256": "6916c547597f426e20d16171e32fa2670ef8368721c1361c6e29f366051dcfba"
            },
            "downloads": -1,
            "filename": "pepperize.cdk_ses_smtp_credentials-0.3.628-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "758bc30f9e61ac329ec6543498ca993e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.8",
            "size": 1707533,
            "upload_time": "2023-12-29T22:31:21",
            "upload_time_iso_8601": "2023-12-29T22:31:21.897248Z",
            "url": "https://files.pythonhosted.org/packages/ea/37/7db08b90e09693543adfb1f247b8df02d6627c778bb188924c2329d76a55/pepperize.cdk_ses_smtp_credentials-0.3.628-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3ab93057d56154e35830ca3af8314f3ceb853998b441fe0032543a4f7c31c931",
                "md5": "08c5e83073ea66099633525cf5879406",
                "sha256": "e50129e0345e0031c7f4882ad59bbcc67cfdfaaef219b69246a31932f77b0ae4"
            },
            "downloads": -1,
            "filename": "pepperize.cdk-ses-smtp-credentials-0.3.628.tar.gz",
            "has_sig": false,
            "md5_digest": "08c5e83073ea66099633525cf5879406",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.8",
            "size": 1706867,
            "upload_time": "2023-12-29T22:31:27",
            "upload_time_iso_8601": "2023-12-29T22:31:27.397106Z",
            "url": "https://files.pythonhosted.org/packages/3a/b9/3057d56154e35830ca3af8314f3ceb853998b441fe0032543a4f7c31c931/pepperize.cdk-ses-smtp-credentials-0.3.628.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-29 22:31:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pepperize",
    "github_project": "cdk-ses-smtp-credentials",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pepperize.cdk-ses-smtp-credentials"
}
        
Elapsed time: 0.20905s