antonbabenko / modules.tf-lambda

Infrastructure as code generator - from visual diagrams created with Cloudcraft.co to Terraform
https://www.cloudcraft.co/
MIT License
350 stars 56 forks source link

Add support for SG rules #17

Open antonbabenko opened 4 years ago

ebahsini commented 4 years ago

When exporting a minimal config, would it be possible to remove the default ingress rule:

  # List of IPv4 CIDR ranges to use on all ingress rules
  # type: list(string)
  ingress_cidr_blocks = ["0.0.0.0/0"]

Here is a Cloudcraft JSON respresentation, for an example export:

{"nodes":[{"type":"ec2","id":"e39584f4-208a-472d-a99d-7e963faa7867","mapPos":[5,5],"region":"us-east-1","transparent":false,"platform":"linux","instanceType":"m5","instanceSize":"24xlarge","color":{"isometric":"#ececed","2d":"#d86613"},"accentColor":{"isometric":"#4286c5","2d":"#d86613"},"billingOptions":{"type":"ri","utilization":1,"leaseContractLength":36,"purchaseOption":"All Upfront","offeringClass":"standard"}},{"type":"elb","id":"c2d0d77d-4627-470b-b1c3-553eac59d141","mapPos":[5,11],"region":"us-east-1","color":{"isometric":"#ececed","2d":"#693cc5"},"accentColor":{"isometric":"#4286c5","2d":"#ffffff"},"elbType":"classic","lcu":1,"dataGb":10},{"type":"vpc","region":"us-east-1","id":"2a0f9c73-5830-4ff5-8fda-8071b01e3921","nodes":["c2d0d77d-4627-470b-b1c3-553eac59d141","e39584f4-208a-472d-a99d-7e963faa7867","19d6b0a1-21b5-463f-9ddc-775c71a0a554","5346d5dc-a9e8-4417-97fc-a7d26c4e896c"],"color":{"isometric":"#9c27b0","2d":"#9c27b0"},"name":"vpc-web","peeringConnections":[],"padding":1.5,"shape":"rectangular"},{"type":"sg","region":"us-east-1","id":"19d6b0a1-21b5-463f-9ddc-775c71a0a554","nodes":["c2d0d77d-4627-470b-b1c3-553eac59d141"],"color":{"isometric":"#9c27b0","2d":"#9c27b0"},"name":"web-lb","inboundRules":[],"outboundRules":[],"padding":1.5,"shape":"dynamic"},{"type":"sg","region":"us-east-1","id":"5346d5dc-a9e8-4417-97fc-a7d26c4e896c","nodes":["e39584f4-208a-472d-a99d-7e963faa7867"],"color":{"isometric":"#03a9f4","2d":"#03a9f4"},"name":"web-ec2","inboundRules":[{"portRange":"80","protocol":"tcp","target":"19d6b0a1-21b5-463f-9ddc-775c71a0a554","targetType":"sg","description":"","hidden":false}],"outboundRules":[],"padding":1.5,"shape":"dynamic"}],"edges":[],"boundingRect":{"x":2,"y":2,"width":7,"height":13}}