Skip to content

ListResources

Source: src/AWS/CloudControl/ListResources.ts

Runtime binding for cloudformation:ListResources.

Discovers resources of a given CloudFormation type in the account and Region — whether or not they were provisioned through Cloud Control. Because Cloud Control invokes the resource type’s list handler with the caller’s credentials, pass the handler’s underlying permissions via CloudControlBindingOptions.handlerPolicyStatements.

// init — account-level; grant the list handler's permissions too
const listResources = yield* CloudControl.ListResources({
handlerPolicyStatements: [
{ Effect: "Allow", Action: ["ssm:DescribeParameters"], Resource: ["*"] },
],
});
// runtime
const page = yield* listResources({
TypeName: "AWS::SSM::Parameter",
MaxResults: 100,
});
const identifiers = (page.ResourceDescriptions ?? []).map((r) => r.Identifier);