aws

package
v0.0.0-...-13d473d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IgnoreEgress bool

IgnoreEgress can be used to not create edges for Egress rules

View Source
var IgnoreIngress bool

IgnoreIngress can be used to not create edges for Ingress rules

View Source
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

func (a *Data) CreateDefaultNodes(tfModule *tfconfigs.Module, graph *gographviz.Escape) error

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

type Subnet

type Subnet struct {
	// The CIDR block for the subnet
	CidrBlock string `hcl:"cidr_block"`
	// The VPC ID
	VpcID string `hcl:"vpc_id"`
	// Other arguments
	Remain hcl2.Body `hcl:",remain"`
}

Subnet is a structure for AWS Subnet resources

type Vpc

type Vpc struct {
	// The CIDR block for the VPC
	CidrBlock string `hcl:"cidr_block"`
	// Other arguments
	Remain hcl2.Body `hcl:",remain"`
}

Vpc is a structure for AWS VPC resources

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL