Skip to content

Deployment

Source: src/AWS/GreengrassV2/Deployment.ts

An IoT Greengrass V2 continuous deployment that installs a set of component versions on a target IoT thing or thing group.

Updating the deployment’s components or name creates a new deployment revision for the target (the deploymentId attribute changes); the previous revision is canceled and deleted.

Deploy a component to a thing

import * as GreengrassV2 from "alchemy/AWS/GreengrassV2";
import * as IoT from "alchemy/AWS/IoT";
const core = yield* IoT.Thing("Core", {});
const component = yield* GreengrassV2.ComponentVersion("Hello", { recipe });
const deployment = yield* GreengrassV2.Deployment("Rollout", {
targetArn: core.thingArn,
components: {
[component.componentName]: {
componentVersion: component.componentVersion,
},
},
});

Deployment with a configuration update

const deployment = yield* GreengrassV2.Deployment("Rollout", {
targetArn: core.thingArn,
components: {
"com.example.Hello": {
componentVersion: "1.0.0",
configurationUpdate: { merge: JSON.stringify({ interval: 30 }) },
},
},
});