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

VPC configuration not working inside stage #689

Closed
spidie opened this Issue Jul 21, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@spidie
Copy link

spidie commented Jul 21, 2018

Hi there, was so happy to see recently that we now have VPC support for Apex Up in the configuration rather than having to do the manual workaround. Thankyou to whoever did that!

Currently it works for me if I do something like this.

{
  "name": "api",
  "lambda": {
    "memory": 512,
    "vpc": {
      "subnets": [
        "subnet-aaaaaaa",
        "subnet-bbbbbbb",
        "subnet-ccccccc",
      ],
      "security_groups": [
        "sg-xxxxxxx"
      ]
    }
  }
}

but if I want to put it inside a particular stage so that I can have different VPCs for staging and production for instance - it reverts back to the no VPC behaviour.

{
  "name": "api",
  "lambda": {
    "memory": 512,
  },
  "stages": {
    "staging": {
      "lambda": {
        "vpc": {
          "subnets": [
            "subnet-aaaaaaa",
            "subnet-bbbbbbb",
            "subnet-ccccccc",
          ],
          "security_groups": [
            "sg-xxxxxxx"
          ]
        }
      }
    }
  }
}

Had a look at up config and it is definitely putting it into the config - there is nothing in the verbose output for either case that refers to setting up VPC - so I suspect the VPC part of the deployment is just not logged.

Any help much appreciated. Happy to dig a bit more if anyone can give me some pointers.

@tj tj added the Feature Accepted label Jul 22, 2018

@tj

This comment has been minimized.

Copy link
Member

tj commented Jul 22, 2018

ahhh you're right! There's no stage-level overrides at the moment, but I don't see a reason why not, I'll try to get that in soon

@spidie

This comment has been minimized.

Copy link
Author

spidie commented Jul 22, 2018

Awesome - thanks @tj - I haven't deployed to prod yet - so not stopping me doing work at the moment. Is there something that can go in the verbose logging for VPC setup too - that would be useful for debugging. I couldn't see anything in there.

@tj tj closed this in f1bee26 Jul 22, 2018

@tj

This comment has been minimized.

Copy link
Member

tj commented Jul 22, 2018

@spidie which logging did you have in mind there? The flow logs?

@spidie

This comment has been minimized.

Copy link
Author

spidie commented Jul 22, 2018

Just in the verbose logging where I can see it creating the lambdas. I was being a good citizen following the bug submission guidelines (this was my first) and couldn't see any references to VPC in my log output.

I was expecting to see something in your "DEBU track "Deploy"" lines at the end relating to subnets and security groups. No big deal just thought it might be useful for future debugging.

@tj

This comment has been minimized.

Copy link
Member

tj commented Jul 23, 2018

Good point haha yeah I should probably output all of the function config, I'll open an issue. I'm just pushing 0.7.2 which will have this VPC fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.