ec2

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ec2 contains all logic and data structures relevant to enumerating EC2 instances and their related, resources, including security groups and network interfaces. It is primarily utilized by the `methodaws ec2` an `methodaws securitygroup` subcommands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instances

type Instances struct {
	EC2Instances []types.Instance `json:"ec2_instances" yaml:"ec2_instances"`
}

Instances represents all of the EC2 instances that were returned during the reporting process

type ResourceReport

type ResourceReport struct {
	Resources Instances `json:"resources" yaml:"resources"`
	Errors    []string  `json:"errors" yaml:"errors"`
}

ResourceReport contains the EC2 instances and any errors that occurred during the execution of the `methodaws ec2 enumerate` subcommand. Non-fatal errors are stored in the Errors field.

func EnumerateEc2

func EnumerateEc2(ctx context.Context, cfg aws.Config) (*ResourceReport, error)

EnumerateEc2 enumerates all of the EC2 instances that the caller has access to. It returns a ResourceReport struct that contains the EC2 instances and any non-fatal errors that occurred during the execution of the subcommand.

type SecurityGroupReport

type SecurityGroupReport struct {
	AccountID      string                `json:"account_id" yaml:"account_id"`
	SecurityGroups []types.SecurityGroup `json:"security_groups" yaml:"security_groups"`
	Errors         []string              `json:"errors" yaml:"errors"`
}

SecurityGroupReport contains the security groups and any errors that occurred during the execution of the `methodaws securitygroup enumerate` subcommand. Non-fatal errors are stored in the Errors field.

func EnumerateSecurityGroups

func EnumerateSecurityGroups(ctx context.Context, cfg aws.Config, vpcID *string) (SecurityGroupReport, error)

EnumerateSecurityGroups lists all of the security groups available to the caller alongside any non-fatal errors that occurred during the execution of the `methodaws securitygroup enumerate` subcommand. If vpcID is not nil, it will only return security groups associated with that VPC.

Jump to

Keyboard shortcuts

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