ebextensions not working in AWS Elasticbeanstalk

493 Views Asked by At

When deploying in elasticbeanstalk, I am trying to execute a script through an ebextension file.

The log says that the script was executed normally, but it doesn't seem to be applied.

The exact content of the script is a script that sends logs from laravel to cloudwatch through cloudwatch agent.

Below is the contents of the script and the log that the script was executed normally.

ebextention_file.config

files:
    "/etc/awslogs/config/laravel_log.conf" :
        mode: "060606"
        owner: root
        group: root
        content: |
            [/var/app/current/storage/logs/laravel*]
            datetime_format = %Y-%m-%d %H:%M:%S
            log_group_name = `{"Fn::Join":["/", ["/aws/elasticbeanstalk", { "Ref":"AWSEBEnvironmentName" }, "var/app/current/storage/logs/laravel.log"]]}`
            log_stream_name = {instance_id}
            file = /var/app/current/storage/logs/laravel*
            multi_line_start_pattern = {datetime_format}

commands:
    "01":
      command: chkconfig awslogs on
    "02":
      command: service awslogs restart

cfn-init.log:

2020-09-17 03:43:19,921 [INFO] Command 01 succeeded
2020-09-17 03:43:22,056 [INFO] Command 02 succeeded

It is not possible after deployment,

so if i directly connect to each instance with ssh and execute 01 command and 02 command, logs are normally entered in cloudwatch.

I don't know what this is

Deployment policy: rolling with additional batch

Rolling update type: rolling based on Health

What are some more things I should check

0

There are 0 best solutions below