Skip to content

UpdateResource

Source: src/AWS/CloudControl/UpdateResource.ts

Runtime binding for cloudformation:UpdateResource.

Applies an RFC 6902 JSON Patch to an existing resource’s properties. The call is asynchronous: poll the returned RequestToken with GetResourceRequestStatus until the operation settles. Because Cloud Control invokes the resource type’s update handler with the caller’s credentials, pass the handler’s underlying permissions via CloudControlBindingOptions.handlerPolicyStatements.

const updateResource = yield* CloudControl.UpdateResource({
handlerPolicyStatements: [
{
Effect: "Allow",
Action: ["ssm:PutParameter", "ssm:GetParameters"],
Resource: ["*"],
},
],
});
// runtime
const updated = yield* updateResource({
TypeName: "AWS::SSM::Parameter",
Identifier: "/tenants/acme/greeting",
PatchDocument: JSON.stringify([
{ op: "replace", path: "/Value", value: "howdy" },
]),
});