Skip to content
GitHubXDiscord

ApplicationFleetAssociation

The ApplicationFleetAssociation resource lets you associate an application with a fleet in AWS AppStream. This is crucial for deploying applications to users in a managed environment. For more details, visit the AWS AppStream ApplicationFleetAssociations documentation.

Create a basic association between an application and a fleet using required properties.

import AWS from "alchemy/aws/control";
const appFleetAssociation = await AWS.AppStream.ApplicationFleetAssociation("appFleetAssociation", {
FleetName: "myAppStreamFleet",
ApplicationArn: "arn:aws:appstream:us-west-2:123456789012:application/myApplication"
});

This example demonstrates how to create an association while adopting an existing resource if it already exists.

const advancedAppFleetAssociation = await AWS.AppStream.ApplicationFleetAssociation("advancedAppFleetAssociation", {
FleetName: "myAppStreamFleet",
ApplicationArn: "arn:aws:appstream:us-west-2:123456789012:application/myApplication",
adopt: true
});

Use Case: Updating an Existing Association

Section titled “Use Case: Updating an Existing Association”

If you need to update an existing application-fleet association, you can do so by specifying the same FleetName and ApplicationArn.

const updateAppFleetAssociation = await AWS.AppStream.ApplicationFleetAssociation("updateAppFleetAssociation", {
FleetName: "myAppStreamFleet",
ApplicationArn: "arn:aws:appstream:us-west-2:123456789012:application/myApplication"
});

You can retrieve the ARN and creation times of the application-fleet association after it has been created.

const { Arn, CreationTime } = await AWS.AppStream.ApplicationFleetAssociation("appFleetAssociation", {
FleetName: "myAppStreamFleet",
ApplicationArn: "arn:aws:appstream:us-west-2:123456789012:application/myApplication"
});
// Log the ARN and creation time
console.log(`ARN: ${Arn}, Created At: ${CreationTime}`);