Skip to content

GetResource

Source: src/AWS/CloudControl/GetResource.ts

Runtime binding for cloudformation:GetResource.

Reads the current state of any Cloud Control-supported resource — whether or not it was provisioned through Cloud Control. Because Cloud Control invokes the resource type’s read handler with the caller’s credentials, pass the handler’s underlying permissions via CloudControlBindingOptions.handlerPolicyStatements.

// init — account-level; grant the read handler's permissions too
const getResource = yield* CloudControl.GetResource({
handlerPolicyStatements: [
{ Effect: "Allow", Action: ["ssm:GetParameters"], Resource: ["*"] },
],
});
// runtime
const result = yield* getResource({
TypeName: "AWS::SSM::Parameter",
Identifier: "/app/greeting",
});