Documentation ¶
Index ¶
- Variables
- func InitiateVariablesAndResources(tfModule *tfconfigs.Module) (*hcl2.EvalContext, error)
- type DBInstance
- type DBSubnetGroup
- type Data
- func (a *Data) CreateDefaultNodes(tfModule *tfconfigs.Module, graph *gographviz.Escape) error
- func (a *Data) CreateGraphEdges(graph *gographviz.Escape) error
- func (a *Data) CreateGraphNodes(graph *gographviz.Escape) error
- func (a *Data) ParseTfResources(tfModule *tfconfigs.Module, ctx *hcl2.EvalContext, graph *gographviz.Escape) error
- func (a *Data) PrintUnsupportedResources()
- type Instance
- type S3
- type SGRule
- type SecurityGroup
- type Subnet
- type Vpc
Constants ¶
This section is empty.
Variables ¶
var IgnoreEgress bool
IgnoreEgress can be used to not create edges for Egress rules
var IgnoreIngress bool
IgnoreIngress can be used to not create edges for Ingress rules
var Verbose bool
Verbose enables verbose mode if set to true
Functions ¶
func InitiateVariablesAndResources ¶
func InitiateVariablesAndResources(tfModule *tfconfigs.Module) (*hcl2.EvalContext, error)
InitiateVariablesAndResources parses TF file to create Variables / Obj references for interpolation
Types ¶
type DBInstance ¶
type DBInstance struct { // The allocated storage in Gb AllocatedStorage *int `hcl:"allocated_storage"` // Name of DB subnet group DBSubnetGroupName *string `hcl:"db_subnet_group_name"` // The database engine to use Engine *string `hcl:"engine"` // The instance type of the RDS instance InstanceClass *string `hcl:"instance_class"` // Password for the master DB user Password *string `hcl:"password"` // Bool to control if instance is publicly accessible PubliclyAccessible *bool `hcl:"publicly_accessible"` // Username for the master DB user Username *string `hcl:"username"` // List of VPC security groups to associate VpcSecurityGroupIDs *[]string `hcl:"vpc_security_group_ids"` // Other arguments Remain hcl2.Body `hcl:",remain"` }
DBInstance is a structure for AWS RDS instance resources
type DBSubnetGroup ¶
type DBSubnetGroup struct { // A list of VPC subnet IDs SubnetIDs []string `hcl:"subnet_ids"` // Other arguments Remain hcl2.Body `hcl:",remain"` }
DBSubnetGroup is a structure for RDS DB subnet group resources
type Data ¶
type Data struct { Vpc map[string]Vpc Subnet map[string]Subnet Instance map[string]Instance DBInstance map[string]DBInstance DBSubnetGroup map[string]DBSubnetGroup SecurityGroup map[string]SecurityGroup S3 map[string]S3 // map of resources linked to a security group SecurityGroupNodeLinks map[string][]string // contains filtered or unexported fields }
Data is a structure that contain maps of TF parsed resources
func (*Data) CreateDefaultNodes ¶
CreateDefaultNodes creates default VPC/Subnet/Security Groups if they don't exist in the TF module
func (*Data) CreateGraphEdges ¶
func (a *Data) CreateGraphEdges(graph *gographviz.Escape) error
CreateGraphEdges creates edges for the graph
func (*Data) CreateGraphNodes ¶
func (a *Data) CreateGraphNodes(graph *gographviz.Escape) error
CreateGraphNodes creates the nodes for the graph
func (*Data) ParseTfResources ¶
func (a *Data) ParseTfResources(tfModule *tfconfigs.Module, ctx *hcl2.EvalContext, graph *gographviz.Escape) error
ParseTfResources parse the TF file / module to identify resources that will be used later on to create the graph
func (*Data) PrintUnsupportedResources ¶
func (a *Data) PrintUnsupportedResources()
PrintUnsupportedResources displays all resources currently unsupported by tfviz
type Instance ¶
type Instance struct { // The type of instance to start InstanceType string `hcl:"instance_type"` // The AMI to use for the instance AMI string `hcl:"ami"` // A list of security group names (EC2-Classic) or IDs (default VPC) to associate with SecurityGroups *[]string `hcl:"security_groups"` // A list of security group IDs to associate with (VPC only) VpcSecurityGroupIDs *[]string `hcl:"vpc_security_group_ids"` // The VPC Subnet ID to launch in SubnetID *string `hcl:"subnet_id"` // Other arguments Remain hcl2.Body `hcl:",remain"` }
Instance is a structure for AWS EC2 instance resources
type S3 ¶
type S3 struct { // The name of the bucket Bucket *string `hcl:"bucket"` // Other arguments Remain hcl2.Body `hcl:",remain"` }
S3 is a structure for AWS S3 bucket resources
type SGRule ¶
type SGRule struct { // The start port (or ICMP type number if protocol is "icmp" or "icmpv6") FromPort int `hcl:"from_port"` // The end range port (or ICMP code if protocol is "icmp") ToPort int `hcl:"to_port"` // If true, the security group itself will be added as a source to this ingress/egress rule Self *bool `hcl:"self"` // The protocol. icmp, icmpv6, tcp, udp, "-1" (all) Protocol string `hcl:"protocol"` // List of CIDR blocks CidrBlocks *[]string `hcl:"cidr_blocks"` // List of IPv6 CIDR blocks IPv6CidrBlocks *[]string `hcl:"ipv6_cidr_blocks"` // List of security group Group Names if using EC2-Classic, or Group IDs if using a VPC SecurityGroups *[]string `hcl:"security_groups"` // Other arguments Remain hcl2.Body `hcl:",remain"` }
SGRule is a structure for AWS Security Group ingress/egress blocks
type SecurityGroup ¶
type SecurityGroup struct { // The VPC ID VpcID *string `hcl:"vpc_id"` // A list of ingress rules Ingress []SGRule `hcl:"ingress,block"` // FIXME make it optional? // A list of egress rules Egress []SGRule `hcl:"egress,block"` // FIXME make it optional? // Other arguments Remain hcl2.Body `hcl:",remain"` }
SecurityGroup is a structure for AWS Security Group resources