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 ¶
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 ¶
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.