Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@uhuru/awsiot-thing-creator
Advanced tools
- `npm install @uhuru/awsiot-thing-creator` - `yarn add @uhuru/awsiot-thing-creator`
npm install @uhuru/awsiot-thing-creator
yarn add @uhuru/awsiot-thing-creator
Supported environment variables:
ENV DESCRIPTION
AWS_ACCESS_KEY_ID AWS access key ID
AWS_SECRET_ACCESS_KEY AWS secret access key
AWS_IOT_REGION AWS IoT region
AWS_IOT_THING_NAME The name of the AWS IoT thing to be created
This library can be called by npm-start command.
$ npm start -- --aws-access-key-id=hoge --aws-secret-access-key=foo --aws-iot-region=bar --aws-iot-thing-name=buzz --thing-attribute-payload={\"attributes\":{\"string1\":\"string2\"}} --thing-type-name=Device
Note that you need to build this package before running npm start.
$ npm run build
Argument | Required | Description | Example |
---|---|---|---|
--aws-access-key-id | Yes | AWS access key ID | AKIAJWWCHDEPQJD456PQ |
--aws-secret-access-key | Yes | AWS secret access key | 6qtl9JJ90ue5CMeHSJKm1I4iRRwKOQKLCpzt9Y94 |
--aws-iot-region | Yes | AWS IoT region | us-west-2 |
--aws-iot-thing-name | Yes | The name of the AWS IoT thing to be created | enebular-agent-test |
--thing-attribute-payload | No | The attribute payload | {\"attributes\":{\"string1\":\"string2\"} |
--thing-type-name | No | The name of the thing type | Device |
For more details about above arguments, please refer to AWS document
IoT Client - AWS SDK for JavaScript v3
This library can also be used as ECMAScript Module.
import { AWSIoTThingCreator } from '@uhuru/awsiot-thing-creator';
const attributePayload = {
atrributes: {
key: "value"
}
}
const config = {
awsAccessKeyId: process.env.AWS_ACCESS_KEY_ID,
awsSecretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
awsIotRegion: process.env.AWS_IOT_REGION,
thingName: "enebular-agent-test",
thingTypeName: "Device",
thingAttributePayload: attributePayload
}
// Check required variables
if (
!config.awsAccessKeyId ||
!config.awsIotRegion ||
!config.awsSecretAccessKey ||
!config.thingName
) {
throw new Error(`
A configuration is required.
Verify that these required environment variables are set:
- AWS_ACCESS_KEY_ID
- AWS_IOT_REGION
- AWS_SECRET_ACCESS_KEY
- awsIotThingName
`)
}
const creator = new AWSIoTThingCreator(config)
const result = await creator.createThing().catch((error) => {
console.error(error.message)
throw new Error('Failed to create thing.')
})
return {
config: result.config,
rootPem: result.rootPem,
clientPem: result.clientPem,
privateKey: result.privateKey
}
FAQs
- `npm install @uhuru/awsiot-thing-creator` - `yarn add @uhuru/awsiot-thing-creator`
The npm package @uhuru/awsiot-thing-creator receives a total of 29 weekly downloads. As such, @uhuru/awsiot-thing-creator popularity was classified as not popular.
We found that @uhuru/awsiot-thing-creator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.