-
Notifications
You must be signed in to change notification settings - Fork 57
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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'); |
There was a problem hiding this comment.
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'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'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'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'subnets' => env('SIDECAR_VPC_SUBNETS'), | |
'subnets' => explode(',', env('SIDECAR_VPC_SUBNETS', '')), |
{ | ||
$subnets = config('sidecar.vpc.subnets'); | ||
|
||
$sg = config('sidecar.vpc.security_group'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$sg = config('sidecar.vpc.security_group'); | |
$securityGroups = config('sidecar.vpc.security_groups'); |
|
||
if ($subnets && $sg) { | ||
return [ | ||
'SecurityGroupIds' => Arr::wrap($sg), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'SecurityGroupIds' => Arr::wrap($sg), | |
'SecurityGroupIds' => $securityGroups, |
if ($subnets && $sg) { | ||
return [ | ||
'SecurityGroupIds' => Arr::wrap($sg), | ||
'SubnetIds' => Arr::wrap($subnets), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'SubnetIds' => Arr::wrap($subnets), | |
'SubnetIds' => $subnets, |
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. |
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! |
Just wondering if you found any issues regarding the VPC setup by Sidecar? Having this built-in would help streamline our deployments |
Any news regarding this? I use laravel vapor with a private network and can't access the database... |
I also wonder when this will be merged as my team really needs this feature |
Is there any update on when this might be merged please? This would be very useful for our team. |
This pull request enhances sidecar abilities to allow developers to deploy sidecar Lambda functions inside a VPC.