theonestack / cfhighlander

Cloudformation DSL and component library
MIT License
25 stars 23 forks source link

Add VpcConfig property for lambda functions in lambda_helper #82

Open Guslington opened 5 years ago

toshke commented 5 years ago

There will be 3 supported modes 1) for out-of-the-box functionality auto will be supported as vpc property value for lambda config 2) for fine-tuning, and providing other than compute subnets, following format shall be used: 3) Tweak of the previous mode

# Example1:  Pull Subnets from VPC Component automatically
lambdas:
  function1:
     vpc: auto
# Example2: Define your own security groups
lambdas:
  function1:
     vpc:
        subnets: <SUBNETDEFINITIONHERE>
        secgroups: <SECURITYGROUPSDEFINITIONHERE>
# Example3: Define security groups on group of functions
lambdas:
  vpc: auto  | example2 above
  functions:
    func1:
     ...
    func2:

@aaronwalker @Guslington let me know what you think on the format

toshke commented 5 years ago

If auto mode is used, component rendering lambdas will need to have dependency on vpc (that is, az_conditional_resources function defined.

toshke commented 5 years ago

@Guslington @aaronwalker implementation for auto behaviour can be found on feature branch on my fork

Instructions for testing can be found at https://github.com/toshke/hl-component-vpc-lambdas

Guslington commented 5 years ago

@toshke what about passing around the subnets using List<AWS::EC2::Subnet::Id> ? I'm going to do some testing with this in other components to see if we can drop the dependency of the vpc component.