aws

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTags

func NewTags(name string) map[string]string

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(logger *slog.Logger, cfg Config) Client

func (Client) CreateInstanceFlowLogs

func (c Client) CreateInstanceFlowLogs(instances ec2.Instances) (string, error)

func (Client) CreateNatGatewayFlowLogs

func (c Client) CreateNatGatewayFlowLogs(natGateway ec2.NatGateway) (string, error)

func (Client) CreateSecurityGroupFlowLogs

func (c Client) CreateSecurityGroupFlowLogs(securityGroup ec2.SecurityGroup) (string, error)

func (Client) CreateSubnetFlowLogs

func (c Client) CreateSubnetFlowLogs(subnet ec2.Subnet) (string, error)

func (Client) CreateVPCFlowLogs

func (c Client) CreateVPCFlowLogs(vpc ec2.VPC) (string, error)

func (Client) DeleteFlowLogs

func (c Client) DeleteFlowLogs(flowLogs ec2.FlowLogs) error

func (Client) DeleteIAMRoles

func (c Client) DeleteIAMRoles(flowLogs ec2.FlowLogs) error

func (Client) DeleteLogGroups

func (c Client) DeleteLogGroups(flowLogs ec2.FlowLogs) error

func (Client) DeleteResources

func (c Client) DeleteResources(flowLogs ec2.FlowLogs) error

DeleteResources delete flow logs, IAM roles and cloud watch log groups

func (Client) ListFlowLogs

func (c Client) ListFlowLogs(flowLogType FlowLogType) (ec2.FlowLogs, error)

func (Client) ListInstances

func (c Client) ListInstances(vpcId string) (ec2.Instances, error)

func (Client) ListNatGateways

func (c Client) ListNatGateways(vpcId string) (ec2.NatGateways, error)

func (Client) ListNetworkInterfaces added in v0.0.2

func (c Client) ListNetworkInterfaces() (ec2.NetworkInterfaces, error)

func (Client) ListSecurityGroups

func (c Client) ListSecurityGroups(vpcId string) (ec2.SecurityGroups, error)

func (Client) ListSubnets

func (c Client) ListSubnets(vpcId string) (ec2.Subnets, error)

func (Client) ListVPCs

func (c Client) ListVPCs() (ec2.VPCs, error)

func (Client) QueryFlowLogs

func (c Client) QueryFlowLogs(flowLogs ec2.FlowLogs, query query.Query) ([]map[string]string, error)

QueryFlowLogs run query on specified flow logs

type Config

type Config struct {
	Account string
	Region  string
	Config  aws.Config
}

func NewConfig

func NewConfig(awsRegion string) (Config, error)

type FlowLogType

type FlowLogType string
const (
	FlowLogTypeInstance      FlowLogType = "instance-"
	FlowLogTypeSecurityGroup FlowLogType = "sg-"
	FlowLogTypeNatGateway    FlowLogType = "nat-"
	FlowLogTypeSubnet        FlowLogType = "subnet-"
	FlowLogTypeVPC           FlowLogType = "vpc-"
	FlowLogTypeAll           FlowLogType = ""
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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