-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Automatically refer to the appropriate, regional FireLens image with addFirelensLogRouter() #7366
Copy link
Copy link
Open
Labels
@aws-cdk/aws-ecrRelated to Amazon Elastic Container RegistryRelated to Amazon Elastic Container Registry@aws-cdk/aws-ecsRelated to Amazon Elastic ContainerRelated to Amazon Elastic Containereffort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortfeature-requestA feature should be added or improved.A feature should be added or improved.good first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp2
Description
The documentation suggests using Amazon's own ECR images for the FireLens container. However, image is a required property.
It would be a nice convenience if CDK could determine the destination stack's region and automatically use the proper ecr.Repository.fromRepositoryArn() behavior.
Use Case
Today, I can get this behavior manually, but I had to generate the reference myself:
// Amazon recommends pulling this image from their regional ECR repo
// https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html#firelens-using-fluentbit
const awsEcrRepo = ecr.Repository.fromRepositoryArn(
parent,
"AWSFireLensRepo",
"arn:aws:ecr:us-west-2:906394416424:repository/aws-for-fluent-bit",
);
taskDefinition.addFirelensLogRouter("DatadogFirelensLogRouter", {
image: ecs.ContainerImage.fromEcrRepository(awsEcrRepo, "latest"),
memoryReservationMiB: 50,
essential: true,
firelensConfig: {
type: ecs.FirelensLogRouterType.FLUENTBIT,
options: {
enableECSLogMetadata: true,
configFileType: ecs.FirelensConfigFileType.FILE,
configFileValue: "/fluent-bit/configs/parse-json.conf",
},
},
});Proposed Solution
Ideally, image on FirelensLogRouterDefinitionOptions is an optional parameter and defaults to the proper ECR image from this table in the docs.
Other
- 👋 I may be able to implement this feature request
-
⚠️ This feature might incur a breaking change
This is a 🚀 Feature Request
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-ecrRelated to Amazon Elastic Container RegistryRelated to Amazon Elastic Container Registry@aws-cdk/aws-ecsRelated to Amazon Elastic ContainerRelated to Amazon Elastic Containereffort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortfeature-requestA feature should be added or improved.A feature should be added or improved.good first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp2