tadamw
tadamw

Reputation: 43

How to set a custom logs to S3 with AWS Elastic Beanstalk environment?

I have an AWS Elastic Beanstalk environment with some amazon linux instances running multi docker. I have enabled log rotation from the beanstalk console and I can see the logs getting published to S3 every hour.

I want to change this default S3 path( elasticbeanstalk-aws-region-xxxxx/resources/environments/logs/publish/yyyyy/i-zzzzz ) to my-bucket/eb/apps/logs.

How do I set a cutom path?

Upvotes: 0

Views: 555

Answers (2)

PPC-Coder
PPC-Coder

Reputation: 3632

The default path where it gets saved to the Elastic Beanstalk bucket is fixed but you can perform so post-processing in a Lambda to copy them to any bucket structure you want.

The high-level steps are:

  1. Create a lambda with appropriate execution role permissions to read/write to the source and destination buckets.
  2. Have the lambda copy logs from the beanstalk bucket to your destination bucket.
  3. Create a CloudWatch event to trigger the lambda on a schedule.

Upvotes: 0

Marcin
Marcin

Reputation: 238747

How do I set a cutom path?

You can't change it. Its name is fixed for EB service in general.

Upvotes: 1

Related Questions