Skip to main content

CDK Construct for managing EC2 key pairs

Project description

CDK SSM Document

Source Docs npm version PyPI version NuGet version GitHub

AWS CDK L3 construct for managing EC2 Key Pairs.

CloudFormation does not directly support creation of EC2 Key Pairs. This construct provides an easy interface for creating Key Pairs through a custom CloudFormation resource. The private key is stored in AWS Secrets Manager.

Usage

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
import aws_cdk.core as cdk
from cdk_ec2_key_pair import KeyPair

# Create the Private Key
key = KeyPair(self, "A-Key-Pair",
    name="a-key-pair",
    description="This is a Key Pair"
)

# Grant read access to a role or user
key.grant_read(some_role)

The private key will be stored in AWS Secrets Manager. The secret name is prefixed with ec2-private-key/, so in this example it will be saved as ec2-private-key/a-key-pair.

Roadmap

  • Automated Tests
  • Tagging support in a more standard way

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cdk-ec2-key-pair-0.2.0.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cdk_ec2_key_pair-0.2.0-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file cdk-ec2-key-pair-0.2.0.tar.gz.

File metadata

  • Download URL: cdk-ec2-key-pair-0.2.0.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for cdk-ec2-key-pair-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fbe1586ad23afee006e32c94024d6a435f9372aecd21930b06f120fa24cfecb2
MD5 76906b861f272614793c09e9b33c231f
BLAKE2b-256 dfb4d6ebb10e7e0880ba3472fb91b496137e4587dd63c26dfb615fb96ff19d40

See more details on using hashes here.

File details

Details for the file cdk_ec2_key_pair-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cdk_ec2_key_pair-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 25.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for cdk_ec2_key_pair-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a32cd3ce0b3d0d6d38901b383c65a2fe43a6c5fd48cddd2f539cc9dee4bffb8
MD5 a1382f94400f9fd439807e10d9c6804a
BLAKE2b-256 9ddade7269e1619d5ab4e93bf9daca06aee930a85303939bb137e617adbef4ca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page