AWS.GreengrassV2 reference
BatchAssociateClientDeviceWithCoreDevice
Section titled “BatchAssociateClientDeviceWithCoreDevice”Source:
src/AWS/GreengrassV2/BatchAssociateClientDeviceWithCoreDevice.ts
Runtime binding for greengrass:BatchAssociateClientDeviceWithCoreDevice.
Associates up to 100 client devices with a core device so they can use it
as their local MQTT broker — the write half of client-device fleet
management. The caller supplies the core device thing name and the client
device entries at runtime. Provide the implementation with
Effect.provide(AWS.GreengrassV2.BatchAssociateClientDeviceWithCoreDeviceHttp).
BatchAssociateClientDeviceWithCoreDevice: Managing Client Devices
Section titled “BatchAssociateClientDeviceWithCoreDevice: Managing Client Devices”// init — account-level binding, no resource argumentconst associateClientDevices = yield* AWS.GreengrassV2.BatchAssociateClientDeviceWithCoreDevice();
// runtimeconst { errorEntries } = yield* associateClientDevices({ coreDeviceThingName: "MyCore", entries: [{ thingName: "Sensor1" }, { thingName: "Sensor2" }],});BatchDisassociateClientDeviceFromCoreDevice
Section titled “BatchDisassociateClientDeviceFromCoreDevice”Source:
src/AWS/GreengrassV2/BatchDisassociateClientDeviceFromCoreDevice.ts
Runtime binding for greengrass:BatchDisassociateClientDeviceFromCoreDevice.
Removes up to 100 client-device associations from a core device — the
cleanup half of client-device fleet management. The caller supplies the
core device thing name and the client device entries at runtime. Provide
the implementation with
Effect.provide(AWS.GreengrassV2.BatchDisassociateClientDeviceFromCoreDeviceHttp).
BatchDisassociateClientDeviceFromCoreDevice: Managing Client Devices
Section titled “BatchDisassociateClientDeviceFromCoreDevice: Managing Client Devices”// init — account-level binding, no resource argumentconst disassociateClientDevices = yield* AWS.GreengrassV2.BatchDisassociateClientDeviceFromCoreDevice();
// runtimeconst { errorEntries } = yield* disassociateClientDevices({ coreDeviceThingName: "MyCore", entries: [{ thingName: "RetiredSensor" }],});CancelDeployment
Section titled “CancelDeployment”Source:
src/AWS/GreengrassV2/CancelDeployment.ts
Runtime binding for greengrass:CancelDeployment.
Halts the bound Deployment’s rollout: core devices that already
received it keep running its components, but devices that have not yet
applied it never will. The deployment id is injected from the binding —
the canonical emergency-stop for a bad rollout. Provide the implementation
with Effect.provide(AWS.GreengrassV2.CancelDeploymentHttp).
CancelDeployment: Monitoring Deployments
Section titled “CancelDeployment: Monitoring Deployments”// init — bind the operation to the deploymentconst cancelDeployment = yield* AWS.GreengrassV2.CancelDeployment(deployment);
// runtimeyield* cancelDeployment();ComponentVersion
Section titled “ComponentVersion”Source:
src/AWS/GreengrassV2/ComponentVersion.ts
An IoT Greengrass V2 component version created from an inline recipe. Components are software modules that run on Greengrass core devices.
Component versions are immutable in the cloud: any change to the recipe replaces the component version (a new name/version pair is registered and the previous one is deleted). Only tags are mutable in place.
ComponentVersion: Creating Component Versions
Section titled “ComponentVersion: Creating Component Versions”Component from an inline JSON recipe
import * as GreengrassV2 from "alchemy/AWS/GreengrassV2";
const component = yield* GreengrassV2.ComponentVersion("Hello", { recipe: JSON.stringify({ RecipeFormatVersion: "2020-01-25", ComponentName: "com.example.Hello", ComponentVersion: "1.0.0", ComponentDescription: "Prints a greeting", ComponentPublisher: "Example", Manifests: [ { Platform: { os: "linux" }, Lifecycle: { run: "echo hello" }, }, ], }),});Tagged component version
const component = yield* GreengrassV2.ComponentVersion("Hello", { recipe, tags: { team: "edge" },});DeleteCoreDevice
Section titled “DeleteCoreDevice”Source:
src/AWS/GreengrassV2/DeleteCoreDevice.ts
Runtime binding for greengrass:DeleteCoreDevice.
Deregisters a core device from IoT Greengrass (the backing IoT thing is
untouched) — the fleet-decommissioning primitive for automation that
retires devices. The caller supplies the core device thing name at
runtime. Provide the implementation with
Effect.provide(AWS.GreengrassV2.DeleteCoreDeviceHttp).
DeleteCoreDevice: Managing Core Devices
Section titled “DeleteCoreDevice: Managing Core Devices”// init — account-level binding, no resource argumentconst deleteCoreDevice = yield* AWS.GreengrassV2.DeleteCoreDevice();
// runtimeyield* deleteCoreDevice({ coreDeviceThingName: "RetiredCore" });Deployment
Section titled “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.
Deployment: Creating Deployments
Section titled “Deployment: Creating Deployments”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 }) }, }, },});DescribeComponent
Section titled “DescribeComponent”Source:
src/AWS/GreengrassV2/DescribeComponent.ts
Runtime binding for greengrass:DescribeComponent.
Reads the bound ComponentVersion’s cloud metadata — publisher,
description, lifecycle status (DEPLOYABLE, FAILED, DEPRECATED),
platforms, and tags — so a function can audit component health before
rolling out a deployment. The component version ARN is injected from the
binding. Provide the implementation with
Effect.provide(AWS.GreengrassV2.DescribeComponentHttp).
DescribeComponent: Reading Components
Section titled “DescribeComponent: Reading Components”// init — bind the operation to the component versionconst describeComponent = yield* AWS.GreengrassV2.DescribeComponent(component);
// runtimeconst metadata = yield* describeComponent();if (metadata.status?.componentState === "DEPRECATED") { yield* Effect.logWarning(`${metadata.componentName} is deprecated`);}GetComponent
Section titled “GetComponent”Source:
src/AWS/GreengrassV2/GetComponent.ts
Runtime binding for greengrass:GetComponent.
Fetches the bound ComponentVersion’s recipe (JSON or YAML, as raw
bytes) so a function can inspect or mirror the component definition. The
component version ARN is injected from the binding. Provide the
implementation with Effect.provide(AWS.GreengrassV2.GetComponentHttp).
GetComponent: Reading Components
Section titled “GetComponent: Reading Components”// init — bind the operation to the component versionconst getComponent = yield* AWS.GreengrassV2.GetComponent(component);
// runtimeconst { recipe } = yield* getComponent({ recipeOutputFormat: "JSON" });const text = new TextDecoder().decode(recipe);GetComponentVersionArtifact
Section titled “GetComponentVersionArtifact”Source:
src/AWS/GreengrassV2/GetComponentVersionArtifact.ts
Runtime binding for greengrass:GetComponentVersionArtifact.
Mints a pre-signed download URL for one of the bound
ComponentVersion’s artifacts (the same API core devices use to
fetch artifacts during installation). The component version ARN is
injected from the binding; the caller names the artifact. Provide the
implementation with
Effect.provide(AWS.GreengrassV2.GetComponentVersionArtifactHttp).
GetComponentVersionArtifact: Reading Components
Section titled “GetComponentVersionArtifact: Reading Components”// init — bind the operation to the component versionconst getArtifact = yield* AWS.GreengrassV2.GetComponentVersionArtifact(component);
// runtimeconst { preSignedUrl } = yield* getArtifact({ artifactName: "installer.zip" });GetConnectivityInfo
Section titled “GetConnectivityInfo”Source:
src/AWS/GreengrassV2/GetConnectivityInfo.ts
Runtime binding for greengrass:GetConnectivityInfo.
Reads a core device’s connectivity information — the endpoints and ports
where client devices can reach the core’s local MQTT broker (the same data
the IoT Greengrass discovery API serves). The caller supplies the core
device’s thing name at runtime. Provide the implementation with
Effect.provide(AWS.GreengrassV2.GetConnectivityInfoHttp).
GetConnectivityInfo: Managing Client Devices
Section titled “GetConnectivityInfo: Managing Client Devices”// init — account-level binding, no resource argumentconst getConnectivityInfo = yield* AWS.GreengrassV2.GetConnectivityInfo();
// runtimeconst { connectivityInfo } = yield* getConnectivityInfo({ thingName: "MyCore",});GetCoreDevice
Section titled “GetCoreDevice”Source:
src/AWS/GreengrassV2/GetCoreDevice.ts
Runtime binding for greengrass:GetCoreDevice.
Reads one core device’s metadata — status (HEALTHY / UNHEALTHY),
nucleus version, platform, and last status-update timestamp. Core devices
register themselves (they are not Alchemy resources), so the caller
supplies the core device thing name at runtime. Provide the implementation
with Effect.provide(AWS.GreengrassV2.GetCoreDeviceHttp).
GetCoreDevice: Managing Core Devices
Section titled “GetCoreDevice: Managing Core Devices”// init — account-level binding, no resource argumentconst getCoreDevice = yield* AWS.GreengrassV2.GetCoreDevice();
// runtimeconst device = yield* getCoreDevice({ coreDeviceThingName: "MyCore" });yield* Effect.log(`${device.coreDeviceThingName} is ${device.status}`);GetDeployment
Section titled “GetDeployment”Source:
src/AWS/GreengrassV2/GetDeployment.ts
Runtime binding for greengrass:GetDeployment.
Reads the bound Deployment’s full detail — status (ACTIVE,
COMPLETED, CANCELED, FAILED), component specs, IoT job linkage, and
whether it is still the latest revision for its target — so a function can
monitor a rollout. The deployment id is injected from the binding. Provide
the implementation with
Effect.provide(AWS.GreengrassV2.GetDeploymentHttp).
GetDeployment: Monitoring Deployments
Section titled “GetDeployment: Monitoring Deployments”// init — bind the operation to the deploymentconst getDeployment = yield* AWS.GreengrassV2.GetDeployment(deployment);
// runtimeconst detail = yield* getDeployment();yield* Effect.log(`rollout is ${detail.deploymentStatus}`);ListClientDevicesAssociatedWithCoreDevice
Section titled “ListClientDevicesAssociatedWithCoreDevice”Source:
src/AWS/GreengrassV2/ListClientDevicesAssociatedWithCoreDevice.ts
Runtime binding for greengrass:ListClientDevicesAssociatedWithCoreDevice.
Enumerates the client devices associated with a core device (the IoT
things allowed to connect to the core’s local MQTT broker). The caller
supplies the core device thing name at runtime. Provide the implementation
with
Effect.provide(AWS.GreengrassV2.ListClientDevicesAssociatedWithCoreDeviceHttp).
ListClientDevicesAssociatedWithCoreDevice: Managing Client Devices
Section titled “ListClientDevicesAssociatedWithCoreDevice: Managing Client Devices”// init — account-level binding, no resource argumentconst listClientDevices = yield* AWS.GreengrassV2.ListClientDevicesAssociatedWithCoreDevice();
// runtimeconst { associatedClientDevices } = yield* listClientDevices({ coreDeviceThingName: "MyCore",});ListComponents
Section titled “ListComponents”Source:
src/AWS/GreengrassV2/ListComponents.ts
Runtime binding for greengrass:ListComponents.
Enumerates the account’s component definitions (latest version of each),
optionally scoped to PRIVATE or PUBLIC components — the entry point
for fleet-software inventory tooling. Provide the implementation with
Effect.provide(AWS.GreengrassV2.ListComponentsHttp).
ListComponents: Reading Components
Section titled “ListComponents: Reading Components”// init — account-level binding, no resource argumentconst listComponents = yield* AWS.GreengrassV2.ListComponents();
// runtimeconst { components } = yield* listComponents({ scope: "PRIVATE" });ListComponentVersions
Section titled “ListComponentVersions”Source:
src/AWS/GreengrassV2/ListComponentVersions.ts
Runtime binding for greengrass:ListComponentVersions.
Enumerates every registered version of a component, newest first. The
caller supplies the component’s base ARN
(arn:aws:greengrass:…:components:{name}, without the :versions:
suffix). Provide the implementation with
Effect.provide(AWS.GreengrassV2.ListComponentVersionsHttp).
ListComponentVersions: Reading Components
Section titled “ListComponentVersions: Reading Components”// init — account-level binding, no resource argumentconst listComponentVersions = yield* AWS.GreengrassV2.ListComponentVersions();
// runtimeconst { componentVersions } = yield* listComponentVersions({ arn: componentBaseArn,});ListCoreDevices
Section titled “ListCoreDevices”Source:
src/AWS/GreengrassV2/ListCoreDevices.ts
Runtime binding for greengrass:ListCoreDevices.
Enumerates the account’s Greengrass core devices, optionally filtered by
status (HEALTHY / UNHEALTHY), thing group, or nucleus runtime — the
entry point for fleet-health dashboards. Provide the implementation with
Effect.provide(AWS.GreengrassV2.ListCoreDevicesHttp).
ListCoreDevices: Managing Core Devices
Section titled “ListCoreDevices: Managing Core Devices”// init — account-level binding, no resource argumentconst listCoreDevices = yield* AWS.GreengrassV2.ListCoreDevices();
// runtimeconst { coreDevices } = yield* listCoreDevices({ status: "UNHEALTHY" });ListDeployments
Section titled “ListDeployments”Source:
src/AWS/GreengrassV2/ListDeployments.ts
Runtime binding for greengrass:ListDeployments.
Enumerates the account’s deployments, optionally filtered to one target
thing/thing group or to the latest revision per target — a fleet-wide view
of what is rolling out where. Provide the implementation with
Effect.provide(AWS.GreengrassV2.ListDeploymentsHttp).
ListDeployments: Monitoring Deployments
Section titled “ListDeployments: Monitoring Deployments”// init — account-level binding, no resource argumentconst listDeployments = yield* AWS.GreengrassV2.ListDeployments();
// runtimeconst { deployments } = yield* listDeployments({ historyFilter: "LATEST_ONLY",});ListEffectiveDeployments
Section titled “ListEffectiveDeployments”Source:
src/AWS/GreengrassV2/ListEffectiveDeployments.ts
Runtime binding for greengrass:ListEffectiveDeployments.
Enumerates the deployments that apply to a core device, with each one’s
per-device execution status (SUCCEEDED, FAILED, IN_PROGRESS, …) —
how a rollout monitor tracks a deployment landing on real hardware. The
caller supplies the core device thing name at runtime. Provide the
implementation with
Effect.provide(AWS.GreengrassV2.ListEffectiveDeploymentsHttp).
ListEffectiveDeployments: Managing Core Devices
Section titled “ListEffectiveDeployments: Managing Core Devices”// init — account-level binding, no resource argumentconst listEffectiveDeployments = yield* AWS.GreengrassV2.ListEffectiveDeployments();
// runtimeconst { effectiveDeployments } = yield* listEffectiveDeployments({ coreDeviceThingName: "MyCore",});ListInstalledComponents
Section titled “ListInstalledComponents”Source:
src/AWS/GreengrassV2/ListInstalledComponents.ts
Runtime binding for greengrass:ListInstalledComponents.
Enumerates the components actually installed on a core device (name,
version, lifecycle state such as RUNNING or BROKEN, and last status
report) — the ground truth for “what is this device really running”. The
caller supplies the core device thing name at runtime. Provide the
implementation with
Effect.provide(AWS.GreengrassV2.ListInstalledComponentsHttp).
ListInstalledComponents: Managing Core Devices
Section titled “ListInstalledComponents: Managing Core Devices”// init — account-level binding, no resource argumentconst listInstalledComponents = yield* AWS.GreengrassV2.ListInstalledComponents();
// runtimeconst { installedComponents } = yield* listInstalledComponents({ coreDeviceThingName: "MyCore",});ResolveComponentCandidates
Section titled “ResolveComponentCandidates”Source:
src/AWS/GreengrassV2/ResolveComponentCandidates.ts
Runtime binding for greengrass:ResolveComponentCandidates.
Resolves a set of component candidates against a target platform,
returning the exact component versions (and their recipes) that satisfy
the version requirements — the same dependency-resolution API the
Greengrass nucleus calls during a deployment. Provide the implementation
with Effect.provide(AWS.GreengrassV2.ResolveComponentCandidatesHttp).
NOTE: per the AWS API reference, this operation must be called through the
Greengrass data plane endpoint authenticated with an AWS IoT device
certificate. Calls signed with plain IAM credentials (e.g. from a Lambda
role) are rejected with a typed AccessDeniedException even when the
greengrass:ResolveComponentCandidates permission is granted — use this
binding only from device-credentialed contexts.
ResolveComponentCandidates: Reading Components
Section titled “ResolveComponentCandidates: Reading Components”// init — account-level binding, no resource argumentconst resolveComponentCandidates = yield* AWS.GreengrassV2.ResolveComponentCandidates();
// runtimeconst { resolvedComponentVersions } = yield* resolveComponentCandidates({ platform: { attributes: { os: "linux", architecture: "amd64" } }, componentCandidates: [ { componentName: "com.example.Hello", versionRequirements: { req: ">=1.0.0" } }, ],});UpdateConnectivityInfo
Section titled “UpdateConnectivityInfo”Source:
src/AWS/GreengrassV2/UpdateConnectivityInfo.ts
Runtime binding for greengrass:UpdateConnectivityInfo.
Replaces a core device’s connectivity information — the endpoints and
ports client devices use to reach the core’s local MQTT broker. Typically
driven by automation that knows the core’s current IP (e.g. reacting to a
DHCP change). The caller supplies the core device’s thing name and the new
endpoint list at runtime. Provide the implementation with
Effect.provide(AWS.GreengrassV2.UpdateConnectivityInfoHttp).
UpdateConnectivityInfo: Managing Client Devices
Section titled “UpdateConnectivityInfo: Managing Client Devices”// init — account-level binding, no resource argumentconst updateConnectivityInfo = yield* AWS.GreengrassV2.UpdateConnectivityInfo();
// runtimeyield* updateConnectivityInfo({ thingName: "MyCore", connectivityInfo: [ { id: "lan", hostAddress: "192.168.1.20", portNumber: 8883 }, ],});