You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,21 @@
1
1
# Changelog
2
-
3
2
## Unreleased
4
3
4
+
## 0.2.0 - 2021-07-12
5
+
5
6
### Added
6
7
- New `sidecar.env` config option to separate Sidecar environment from application environment. Useful mostly for teams who have multiple developers that all have an app env of `local` and don't want to be constantly overwriting each other's functions.
7
8
- New `sidecar:warm` command ([#6](https://github.com/hammerstonedev/sidecar/pull/6))
8
9
- Better error reporting when `sidecar:deploy` is called and there are no functions.
9
10
- Better error reporting when a function is not found.
10
-
- Implemented Sweeping to remove old, unused function versions ([#15](https://github.com/hammerstonedev/sidecar/pull/15))
11
+
- Implemented sweeping to remove old, unused function versions ([#15](https://github.com/hammerstonedev/sidecar/pull/15))
11
12
-`--pre-warm` options to `sidecar:deploy` and `sidecar:active` commands ([Commit](https://github.com/hammerstonedev/sidecar/commit/4794e6d4bfc5ddb4976c4686939ca1ee0c0ae979))
12
13
-`latestVersionHasAlias` method to the LambdaClient ([Commit](https://github.com/hammerstonedev/sidecar/commit/a54f4e59aef9bfeac57ced7fb50b0c25ff268ab9))
13
14
14
15
### Changed
15
16
- Warming is now opt-in. 0 instances are configured by default. ([Commit](https://github.com/hammerstonedev/sidecar/commit/ba53467368bcb253034fdbae7726fb0916b28de2))
16
17
- Moved some methods into the Sidecar\LambdaClient ([#15](https://github.com/hammerstonedev/sidecar/pull/15))
17
-
- Break out logging & environment concerns from the Labmda Client. ([Commit](https://github.com/hammerstonedev/sidecar/commit/20e368c9773c4aae2262021c7682cf72737af270))
18
+
- Break out logging & environment concerns from the Lambda Client. ([Commit](https://github.com/hammerstonedev/sidecar/commit/20e368c9773c4aae2262021c7682cf72737af270))
18
19
19
20
### Fixed
20
21
- Allow spacing in `APP_NAME`[#17](https://github.com/hammerstonedev/sidecar/pull/17)
After running `php artisan sidecar:install`, you should have a `sidecar.php` file in your `config` folder.
5
+
6
+
There are several configuration options in that file, which we'll cover in this section.
7
+
8
+
## AWS Credentials
5
9
6
10
Sidecar requires a few very specific things be set up in your AWS in order to have the proper permissions to deploy and execute your functions.
7
11
8
-
In order to save you from the frustration of AWS IAM, we have written a single, interactive command that can handle everything for you.
12
+
In order to save you from the frustration of using AWS IAM we have written a single, interactive command that can handle everything for you.
9
13
10
14
To get started, run the following command:
11
15
12
-
```text
16
+
```shell
13
17
php artisan sidecar:configure
14
18
```
15
19
16
-
The first thing it will do is guide you through creating a new AWS user, which it will then use to create everything else it needs.
20
+
The first thing it will do is guide you through creating a new AWS user in the web interface, which it will then use to create everything else it needs.
17
21
18
22
Note that this won't start any services, it just creates some policies in IAM.
19
23
20
-
This is the same method that Vapor uses: you provide it with Admin Access and then it configures itself.
24
+
This is the same general method that Laravel Vapor uses: you provide it with Admin Access and then it configures itself. Sidecar takes it a step further and provides you the option to self-destruct the admin keys once it has configured itself.
21
25
22
26
If you'd like to manually set everything up, take a look at the command to see exactly what it's doing, and you can recreate it in the IAM portal.
23
27
24
28
## Registering Functions
25
29
26
30
Each function that you make will need to be registered in the `functions` key of your `sidecar.php`
The timeout and memory can be customized on a per-function basis, but if they aren't, the defaults from your `sidecar.php` file will be used.
101
-
102
-
### Package Base Path
65
+
## Package Base Path
103
66
104
67
By default, all of your Lambda resources are going to be relative to the `base_path()` of your application. That means when you're defining your code packages, you'll use the root of your application as the starting point.
105
68
106
69
If all of your Lambda code lives in e.g. `resources/lambda`, then you can update your `package_base_path` to reflect that.
107
70
108
-
sidecar.php {.filename}
71
+
config/sidecar.php {.filename}
109
72
```php
110
73
return [
111
-
// [tl! collapse-start closed]
112
-
/*
113
-
* All of your function classes that you'd like to deploy go here.
* The default timeout for your functions, in seconds.
160
-
* This can be overridden per function.
161
-
*/
162
-
'timeout' => env('SIDECAR_TIMEOUT', 300),
89
+
By default, the environment name that Sidecar uses is your `APP_ENV` from your `.env` file. This usually works great for staging and production, but if you are working on a team, you'll have multiple people using an environment named `local`, potentially interfering with one another.
163
90
164
-
/*
165
-
* The default memory for your functions, in megabytes.
166
-
* This can be overridden per function.
167
-
*/
168
-
'memory' => env('SIDECAR_MEMORY', 512),
91
+
If you'd like to use something other than the `APP_ENV`, you can do so by providing a `SIDECAR_ENV` environment variable.
169
92
170
-
/*
171
-
* The base path for your package files. If you e.g. keep
172
-
* all your Lambda package files in your resource path,
173
-
* you may change the base path here.
93
+
```php
94
+
return [
95
+
/*
96
+
* Sidecar separates functions by environment. If you'd like to change
97
+
* your Sidecar environment without changing your entire application
Sidecar functions are separated by environment, so that your local development functions don't overwrite your production functions. You can have as many environments as you please.
5
+
6
+
By default, Sidecar will use the environment from your Laravel application, which itself comes from the `APP_ENV` environment variable.
7
+
8
+
If you'd rather use a dedicated environment variable for Sidecar, you can use the `SIDECAR_ENV` variable.
9
+
10
+
```php
11
+
<?php
12
+
13
+
return [
14
+
/*
15
+
* Sidecar separates functions by environment. If you'd like to change
16
+
* your Sidecar environment without changing your entire application
17
+
* environment, you may do so here.
18
+
*/
19
+
'env' => env('SIDECAR_ENV', env('APP_ENV')),
20
+
];
21
+
```
22
+
23
+
This can be particularly useful when you're developing in a team. If everyone on your team has `APP_ENV=local` in their environment file, then it's likely that functions will inadvertently be overwritten by your teammates, which is both confusing and frustrating.
24
+
25
+
In this case, it would make sense to set your Sidecar environment to e.g. `SIDECAR_ENV=aaron_local`, `SIDECAR_ENV=sean_local`, etc.
26
+
27
+
This way Sean & Aaron have different environments and won't overwrite each other's work.
28
+
29
+
## Faking the Environment
30
+
31
+
If you need to deploy an environment other than the one you are in, you can override the environment from the config by passing an `--env` flag to the Deploy and Activate commands.
32
+
33
+
```shell
34
+
php artisan sidecar:deploy --env=production
35
+
php artisan sidecar:activate --env=production
36
+
```
37
+
38
+
This is useful when you want to build and deploy from either your local machine, your CI pipeline, or GitHub Actions, and then you want to activate as your Laravel application rolls out.
39
+
40
+
Head over to the [Deploying section](functions/deploying) to read more about activating & deploying your functions.
0 commit comments