<commit_before># AWS ElasticBeanstalk deployment hooks

...or: How to run a script after Elastic Beanstalk deployment finishes.

In this article we will have a look on [AWS ElasticBeanstalk](https://aws.amazon.com/elasticbeanstalk/) post/pre deployment configuration
costum. and script running.

I will assume you know how [`eb` CLI](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3.html) works,
I assume you know how to use  `eb deploy` to do  the deployment
and I assume you are executing command from a folder where is your `.elasticbeanstalk/config.yml` (or `Dockerrun.aws.json`)

> I will be updating this article each time I learn a new trick related to `.ebextensions` or come up with new example

## Using Post deployment hook folder

[AWS ElasticBeanstalk](https://aws.amazon.com/elasticbeanstalk/)  provides "hooks" folders that you can configure
to run various scripts before/after deployment

I will not go into depth but in short:  in you EC2 instance provisioned by AWS ElasticBeanstalk you have a folders:

```bash<commit_msg>update aws eb hooks<commit_after># AWS ElasticBeanstalk deployment hooks

...or: How to run a script after Elastic Beanstalk deployment finishes.

In this article we will have a look on [AWS ElasticBeanstalk](https://aws.amazon.com/elasticbeanstalk/) post/pre deployment script running.

I will assume you know how [`eb` CLI](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3.html) works,
I assume you know how to use  `eb deploy` to do  the deployment
and I assume you are executing command from a folder where is your `.elasticbeanstalk/config.yml` (or `Dockerrun.aws.json`)

> I will be updating this article each time I learn a new trick related to `.ebextensions` or come up with new example

## Using Post deployment hook folder

[AWS ElasticBeanstalk](https://aws.amazon.com/elasticbeanstalk/)  provides "hooks" folders that you can configure
to run various scripts before/after deployment

I will not go into depth but in short:  in you EC2 instance provisioned by AWS ElasticBeanstalk you have a folders:

```bash
{'fraction_non_alphanumeric': 0.07614942528735633, 'fraction_numerical': 0.0019157088122605363, 'mean_word_length': 4.615591397849462, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4259880', 'n_tokens_mistral': 616, 'n_tokens_neox': 576, 'n_words': 271}