Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposing the ability add ContainerDefinitions #338

Open
kepta opened this issue May 21, 2020 · 2 comments
Open

Exposing the ability add ContainerDefinitions #338

kepta opened this issue May 21, 2020 · 2 comments

Comments

@kepta
Copy link

kepta commented May 21, 2020

I am requesting for a feature that allows adding one or more container definitions (guess that is also known as sidecar?) on top of the builtin watchbot container.

One of the use case in my mind is using AWS CloudWatch agent, which runs as a separate docker instance to handle cloudwatch logs via the Nodejs EMF SDK. Currently I have to do a messy code injection to achieve this functionality in Alerts, see code.

@rclark
Copy link
Contributor

rclark commented May 21, 2020

const ref = {
logGroup: cf.ref(prefixed('LogGroup')),
topic: options.fifo ? undefined : cf.ref(prefixed('Topic')),
queueUrl: cf.ref(prefixed('Queue')),
queueArn: cf.getAtt(prefixed('Queue'), 'Arn'),
queueName: cf.getAtt(prefixed('Queue'), 'QueueName'),
notificationTopic: cf.ref(prefixed('NotificationTopic'))
};

This set of template resources / values end up being returned in an object by the function call that generates the watchbot template.

Would adding a pointer here to the watchbot task definition meet your need? For example:

const params = { ... };
const template = watchbot.template(params);
const { taskDefinition } = template.ref;

taskDefinition.containerDefinitions.push({ ... });
...

@kepta
Copy link
Author

kepta commented May 21, 2020

Agh, I didnt know about this ref functionality, it seems neat!

Would adding a pointer here to the watchbot task definition meet your need? For example:

I think that should do it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants