Skip to main content

AWS IoT Core Thing with Certificate v3 construct

This is a CDK construct that creates an AWS IoT Core Thing with a certificate and policy using aws-sdk-js-v3.

elements

Cloudformation does not support creating a certificate for an IoT Thing, so this construct uses the AWS SDK to create a certificate and attach it to the Thing.

This construct is a modified version of this excellent construct (cdk-iot-core-certificate) to work with aws-sdk-js-v3.

View on Construct Hub Open in Visual Studio Code npm version Build Status Release Status License Downloads npm downloads

Installation

npm i cdk-iot-core-certificates-v3

Usage

import * as s3 from 'aws-cdk-lib/aws-s3';
import { ThingWithCert } from 'cdk-iot-core-certificates-v3';

declare const saveFileBucket: s3.IBucket;

const { thingArn, certId, certPem, privKey } = new ThingWithCert(this, 'MyThing', {
  // The name of the thing
  thingName: 'MyThing',
  // Whether to save the certificate and private key to the SSM Parameter Store
  saveToParamStore: true,
  // The prefix to use for the SSM Parameter Store parameters
  paramPrefix: 'test',
  // The bucket to save the certificate and private key to
  // Both files are saved at `{thingName}/{thingName}.private.key` and `{thingName}/{thingName}.cert.pem`
  // If not provided, the certificate and private key will not be saved
  saveFileBucket,
});

If you want to create multiple things and save certificates and private keys to the same bucket, you should not use saveFileBucket prop and save them at once by BucketDeployment construct.

This is because the each saveFileBucket prop will share a custom resource for each thing, which will cause the deployment to fail.

import * as s3 from 'aws-cdk-lib/aws-s3';
import * as s3deploy from 'aws-cdk-lib/aws-s3-deployment';
import { ThingWithCert } from 'cdk-iot-core-certificates-v3';

const thingNames = ['Thing1', 'Thing2', 'Thing3'];
const certBucket = new s3.Bucket(this, "CertBucket");
const sources: s3deploy.ISource[] = [];

thingNames.forEach((thingName, index) => {
  const { certPem, privKey } = new ThingWithCert(this, `Thing${index}`, {
    thingName,
    saveToParamStore: true,
  });
  sources.push(
    s3deploy.Source.data(`${thingName}/${thingName}.cert.pem`, certPem),
    s3deploy.Source.data(`${thingName}/${thingName}.private.key`, privKey)
  );
});

// Deploy the certificate and private key to the S3 bucket at once
new s3deploy.BucketDeployment(this, "DeployCerts", {
  sources,
  destinationBucket: certBucket,
});

Metadata

Release files for cdk-iot-core-certificates-v3 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cdk-iot-core-certificates-v3 0.1.6
File Size Uploaded Provenance Actions
cdk_iot_core_certificates_v3-0.1.6.tar.gz 34.3 MB With provenance Details for cdk_iot_core_certificates_v3-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cdk-iot-core-certificates-v3 0.1.6
File Interpreter ABI Platform Actions
cdk_iot_core_certificates_v3-0.1.6-py3-none-any.whl Python 3 none any Details for cdk_iot_core_certificates_v3-0.1.6-py3-none-any.whl

Total release size: 68.7 MB

Release files / cdk_iot_core_certificates_v3-0.1.6.tar.gz

Download URL cdk_iot_core_certificates_v3-0.1.6.tar.gz
Size 34.3 MB
Tags Source
SHA-256 checksum
How to use checksums
bf7b7b9ebf33ddcced98386f8dffbf8379af3706bff84c4b936c5583059953aa
BLAKE2b-256 checksum
How to use checksums
b1897886e18f7c393f0f1738313d784f8c1d5c171c81d2790331ed39cb82816d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.14.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / cdk_iot_core_certificates_v3-0.1.6-py3-none-any.whl

Download URL cdk_iot_core_certificates_v3-0.1.6-py3-none-any.whl
Size 34.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
637f2ceaf6e56be95f0e77535ec7c0710e1bd49a79982f61e3b3bbfd2f6dcda9
BLAKE2b-256 checksum
How to use checksums
8b695dd9b7339d16cc9e083b797c728738491278edf4c9a4359e94bc836003ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.14.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Security for cdk-iot-core-certificates-v3 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cdk_iot_core_certificates_v3-0.1.6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page