-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7693e5d
commit 98ce354
Showing
2 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,30 @@ | ||
# replace this | ||
# 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](https://github.com/aws/aws-sdk-js-v3). | ||
|
||
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)](https://github.com/devops-at-home/cdk-iot-core-certificates) to work with aws-sdk-js-v3. | ||
|
||
## Installation | ||
|
||
```bash | ||
npm i cdk-iot-core-certificate-v3 | ||
``` | ||
|
||
## Usage | ||
|
||
```typescript | ||
import { ThingWithCert } from 'cdk-iot-core-certificate-v3'; | ||
|
||
const thing = new ThingWithCert(this, 'MyThing', { | ||
thingName: 'MyThing', | ||
saveToParamStore: true, | ||
paramPrefix: 'test', | ||
}); | ||
|
||
const thingArn = thing.thingArn; | ||
const certId = thing.certId; | ||
const certPem = thing.certPem; | ||
const privateKey = thing.privKey; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters