Skip to content
GitHubXDiscord

AppBlock

The AppBlock resource allows you to create and manage AWS AppStream AppBlocks, which are used to define the applications that can be streamed to users. AppBlocks contain the applications and their associated settings.

Create a basic AppBlock with the required properties and a few optional configurations.

import AWS from "alchemy/aws/control";
const appBlock = await AWS.AppStream.AppBlock("basicAppBlock", {
Name: "BasicAppBlock",
SourceS3Location: {
S3Bucket: "my-app-bucket",
S3Key: "my-app.zip"
},
DisplayName: "Basic Application Block",
Description: "An AppBlock for a basic application setup."
});

Configure an AppBlock with setup and post-setup script details for additional customization.

const advancedAppBlock = await AWS.AppStream.AppBlock("advancedAppBlock", {
Name: "AdvancedAppBlock",
SourceS3Location: {
S3Bucket: "my-app-bucket",
S3Key: "my-advanced-app.zip"
},
SetupScriptDetails: {
ScriptS3Location: {
S3Bucket: "my-scripts-bucket",
S3Key: "setup-script.sh"
},
TimeoutInSeconds: 300
},
PostSetupScriptDetails: {
ScriptS3Location: {
S3Bucket: "my-scripts-bucket",
S3Key: "post-setup-script.sh"
},
TimeoutInSeconds: 300
},
Tags: [
{ Key: "Environment", Value: "Production" },
{ Key: "Department", Value: "IT" }
]
});

Create an AppBlock that adopts an existing resource if it is already present.

const adoptAppBlock = await AWS.AppStream.AppBlock("adoptAppBlock", {
Name: "ExistingAppBlock",
SourceS3Location: {
S3Bucket: "another-app-bucket",
S3Key: "existing-app.zip"
},
adopt: true
});

Specify a packaging type when creating an AppBlock to define how the application will be delivered.

const packagedAppBlock = await AWS.AppStream.AppBlock("packagedAppBlock", {
Name: "PackagedAppBlock",
SourceS3Location: {
S3Bucket: "my-packaged-app-bucket",
S3Key: "packaged-app.zip"
},
PackagingType: "WINDOWS"
});