jorgebastida / jorgebastida/gordon

Make it possible for Lambda VPCs to be a reference

Open
#44 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
2k
Forks
132
PR merge metrics
No merged PRs in 30d

Description

I have the following use case, which seems to be currently unsupported based on reading through the docs and source:
- One set of lambdas (one app) that essentially call each other in a chain
- e.g. `lambda_one -> lambda_two -> lambda_three`
- Two environments which I need to deploy immutable copies of these lambdas to (dev + prod)
- Each environment lives in it's own VPC (Dev-VPC/Prod-VPC) and has it's own subnets/databases

The problem here is that I can't see any way to conditionally specify a VPC per stage on a per-lambda basis. I've looked through the docs and source and it seems that vpc is just hardcoded to be grabbed from the root `settings.yaml` file by string match.

Ideally, I could use a ref and the config could look something like this:
`settings.yaml`:

```
...
vpcs:
Dev-VPC:
security-groups;
...
subnet-ids:
...
```

`app/settings.yml`:

```
lambdas:
lambda_one:
vpc: ref://MyVPC
```

`parameters/dev.yaml`:

```
MyVpc: "Dev-VPC"
```

and then the ref would somehow auto-resolve the vpc `Dev-VPV` to the mapping present in `settings.yaml`. Looking at the code, I'm not sure how this could be done, so I'm putting this in an issue instead of a pull request. I do have an experimental patch at jwisdom1@2e16877878388f15d6aea78d3ed959c79836195d, but this requires you to re-specify the entire VPC mapping in your parameter .yaml files.

Any support here would be much appreciated.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the VPC handling described in the repository source and the root settings.yaml, app/settings.yml, and parameters/dev.yaml examples. Compare that behavior with the experimental patch at jwisdom1@2e16877878388f15d6aea78d3ed959c79836195d; done means a per-stage VPC reference resolves to the VPC mapping without requiring the full mapping to be repeated in parameter files.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.