Skip to content

ResourceAssociation

Source: src/AWS/AppRegistry/ResourceAssociation.ts

Associates an AWS resource (a CloudFormation stack or a tag-value query) with an AppRegistry Application so the resource is inventoried under the application in myApplications.

Associate a CloudFormation Stack

import * as AppRegistry from "alchemy/AWS/AppRegistry";
import * as CloudFormation from "alchemy/AWS/CloudFormation";
const app = yield* AppRegistry.Application("Storefront", {});
const stack = yield* CloudFormation.Stack("Network", {
templateBody: networkTemplateJson,
});
const association = yield* AppRegistry.ResourceAssociation("StackAssoc", {
application: app.applicationId,
resourceType: "CFN_STACK",
resource: stack.stackName,
});

Associate Without Applying the Application Tag

const association = yield* AppRegistry.ResourceAssociation("StackAssoc", {
application: app.applicationId,
resourceType: "CFN_STACK",
resource: stack.stackName,
options: ["SKIP_APPLICATION_TAG"],
});