Skip to content
GitHubXDiscordRSS

Application

Learn how to create, update, and manage AWS OpenSearchService Applications using Alchemy Cloud Control.

The Application resource lets you manage AWS OpenSearchService Applications and their configuration settings.

Create a basic OpenSearchService application with required properties and a data source.

import AWS from "alchemy/aws/control";
const openSearchApp = await AWS.OpenSearchService.Application("myOpenSearchApp", {
name: "MySearchApplication",
dataSources: [{
type: "s3",
uri: "s3://my-data-source-bucket/data"
}],
endpoint: "https://mysearchapp.us-west-2.es.amazonaws.com",
tags: [{
key: "Environment",
value: "Development"
}]
});

Configure an OpenSearchService application with IAM Identity Center options and multiple data sources.

const advancedOpenSearchApp = await AWS.OpenSearchService.Application("advancedOpenSearchApp", {
name: "AdvancedSearchApplication",
dataSources: [
{
type: "s3",
uri: "s3://my-data-source-bucket/data"
},
{
type: "dynamoDB",
uri: "dynamodb://my-dynamodb-table"
}
],
iamIdentityCenterOptions: {
enabled: true,
identityStore: "my-identity-store"
},
tags: [{
key: "Project",
value: "SearchOptimization"
}]
});

Create an OpenSearchService application that adopts existing resources if available.

const adoptOpenSearchApp = await AWS.OpenSearchService.Application("adoptOpenSearchApp", {
name: "ExistingSearchApp",
adopt: true, // Adopt existing resource instead of failing
endpoint: "https://existingsearchapp.us-west-2.es.amazonaws.com",
tags: [{
key: "Purpose",
value: "Data Analysis"
}]
});

Demonstrate how to configure application settings and retrieve specific metadata.

const customAppConfig = await AWS.OpenSearchService.Application("customAppConfig", {
name: "CustomAppWithConfig",
appConfigs: [{
key: "maxResultSize",
value: "100"
}],
tags: [{
key: "Owner",
value: "Team Alpha"
}]
});
// Access application ARN and creation time
console.log(`Application ARN: ${customAppConfig.arn}`);
console.log(`Created on: ${customAppConfig.creationTime}`);