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

Allow to deploy Lambda inside VPC #52

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

deleugpn
Copy link

This pull request enhances sidecar abilities to allow developers to deploy sidecar Lambda functions inside a VPC.

Copy link
Contributor

@datashaman datashaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Random internet stranger's 2c. :)

{
$subnets = config('sidecar.vpc.subnets');

$sg = config('sidecar.vpc.security_group');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The AWS config is SecurityGroupIds, it should be plural and an array.

* to place sidecar lambda functions inside a VPC.
*/
'vpc' => [
'security_groups' => env('SIDECAR_VPC_SECURITY_GROUP'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'security_groups' => env('SIDECAR_VPC_SECURITY_GROUP'),
'security_groups' => explode(',', env('SIDECAR_VPC_SECURITY_GROUPS', '')),

*/
'vpc' => [
'security_groups' => env('SIDECAR_VPC_SECURITY_GROUP'),
'subnets' => env('SIDECAR_VPC_SUBNETS'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'subnets' => env('SIDECAR_VPC_SUBNETS'),
'subnets' => explode(',', env('SIDECAR_VPC_SUBNETS', '')),

{
$subnets = config('sidecar.vpc.subnets');

$sg = config('sidecar.vpc.security_group');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$sg = config('sidecar.vpc.security_group');
$securityGroups = config('sidecar.vpc.security_groups');


if ($subnets && $sg) {
return [
'SecurityGroupIds' => Arr::wrap($sg),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'SecurityGroupIds' => Arr::wrap($sg),
'SecurityGroupIds' => $securityGroups,

if ($subnets && $sg) {
return [
'SecurityGroupIds' => Arr::wrap($sg),
'SubnetIds' => Arr::wrap($subnets),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'SubnetIds' => Arr::wrap($subnets),
'SubnetIds' => $subnets,

@deleugpn
Copy link
Author

deleugpn commented Feb 14, 2022

I appreciate the suggested review but I would argue that most use cases will be a single sg and potentially hard-coded subnets instead of environment variables.

The config file just gives an idea how to go about it. Using Arr::wrap gives the flexibility of allowing users set an array or a single string. Advanced VPC users will know how to proceed for array-style in their own preferred approach.

@aarondfrancis
Copy link
Owner

Mmm this is great, thanks for doing this @deleugpn. And thanks for the extra set of eyes @datashaman!

Let me review the Lambda docs on this and see if I can get it merged this week. I'll get back to ya!

@matthewdevine
Copy link

Just wondering if you found any issues regarding the VPC setup by Sidecar? Having this built-in would help streamline our deployments

@lautaroml
Copy link

Any news regarding this?

I use laravel vapor with a private network and can't access the database...

@d8vjork
Copy link

d8vjork commented Nov 8, 2023

I also wonder when this will be merged as my team really needs this feature

@flfw
Copy link

flfw commented Aug 5, 2024

Is there any update on when this might be merged please? This would be very useful for our team.

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

Successfully merging this pull request may close these issues.

7 participants