Skip to content
GitHubXDiscord

Integration

The Integration resource lets you manage AWS Logs Integrations for collecting and processing log data from various sources.

Create a basic integration with required properties:

import AWS from "alchemy/aws/control";
const logIntegration = await AWS.Logs.Integration("basicIntegration", {
IntegrationName: "BasicIntegration",
ResourceConfig: {
// Resource configuration goes here
},
IntegrationType: "AWS::Logs::Integration"
});

Configure an integration with optional properties for enhanced functionality:

const advancedLogIntegration = await AWS.Logs.Integration("advancedIntegration", {
IntegrationName: "AdvancedIntegration",
ResourceConfig: {
// Resource configuration with additional settings
},
IntegrationType: "AWS::Logs::Integration",
adopt: true // Adopt existing resource if it exists
});

Specific Use Case: CloudWatch Logs Integration

Section titled “Specific Use Case: CloudWatch Logs Integration”

Set up an integration specifically for CloudWatch logs:

const cloudWatchIntegration = await AWS.Logs.Integration("cloudWatchIntegration", {
IntegrationName: "CloudWatchLogsIntegration",
ResourceConfig: {
LogGroupName: "MyLogGroup",
RoleArn: "arn:aws:iam::123456789012:role/MyLogsRole"
},
IntegrationType: "AWS::Logs::CloudWatchIntegration",
adopt: false // Do not adopt existing resource
});

Create an integration for processing logs from an S3 bucket:

const s3LogsIntegration = await AWS.Logs.Integration("s3LogsIntegration", {
IntegrationName: "S3LogsIntegration",
ResourceConfig: {
BucketName: "my-log-bucket",
Prefix: "logs/"
},
IntegrationType: "AWS::Logs::S3Integration",
adopt: false // Do not adopt existing resource
});