serverless-tag-resources
Version:
Datamart: Tag all AWS resources with dual legacy + datamart:* tag support
26 lines (20 loc) • 578 B
JavaScript
;
const {
PinpointClient,
GetAppCommand,
TagResourceCommand,
} = require("@aws-sdk/client-pinpoint");
const { getClient } = require("../aws-clients");
async function tagPinpointApp(config, resource, tagsMap) {
const client = getClient(PinpointClient, config);
const app = await client.send(
new GetAppCommand({ ApplicationId: resource.PhysicalResourceId })
);
await client.send(
new TagResourceCommand({
ResourceArn: app.ApplicationResponse.Arn,
TagsModel: { tags: tagsMap },
})
);
}
module.exports = { tagPinpointApp };