Documentation
¶
Overview ¶
Package ec2 provides a client to make API requests to Amazon Elastic Compute Cloud.
Index ¶
- Constants
- Variables
- type AZ
- type EC2
- func (c *EC2) CloudFrontManagedPrefixListID() (string, error)
- func (c *EC2) HasDNSSupport(vpcID string) (bool, error)
- func (c *EC2) ListAZs() ([]AZ, error)
- func (c *EC2) ListVPCSubnets(vpcID string) (*VPCSubnets, error)
- func (c *EC2) ListVPCs() ([]VPC, error)
- func (c *EC2) PublicIP(eni string) (string, error)
- func (c *EC2) SecurityGroups(filters ...Filter) ([]string, error)
- func (c *EC2) SubnetIDs(filters ...Filter) ([]string, error)
- type Filter
- type Resource
- type Subnet
- type VPC
- type VPCSubnets
Constants ¶
const (
// FmtTagFilter is the filter name format for tag filters
FmtTagFilter = "tag:%s"
)
Variables ¶
var ( // FilterForDefaultVPCSubnets is a pre-defined filter for the default subnets at the availability zone. FilterForDefaultVPCSubnets = Filter{ Name: defaultForAZFilterName, Values: []string{"true"}, } )
Functions ¶
This section is empty.
Types ¶
type EC2 ¶
type EC2 struct {
// contains filtered or unexported fields
}
EC2 wraps an AWS EC2 client.
func (*EC2) CloudFrontManagedPrefixListID ¶ added in v1.20.0
CloudFrontManagedPrefixListID returns the PrefixListId of the associated cloudfront prefix list as a *string.
func (*EC2) HasDNSSupport ¶ added in v0.4.0
HasDNSSupport returns if DNS resolution is enabled for the VPC.
func (*EC2) ListAZs ¶ added in v1.14.0
ListAZs returns the list of opted-in and available availability zones.
func (*EC2) ListVPCSubnets ¶ added in v0.3.0
func (c *EC2) ListVPCSubnets(vpcID string) (*VPCSubnets, error)
ListVPCSubnets lists all subnets with a given VPC ID. Note that public subnets are subnets associated with an internet gateway through a route table. And the rest of the subnets are private.
func (*EC2) ListVPCs ¶ added in v0.4.0
ListVPCs returns names and IDs (or just IDs, if Name tag does not exist) of all VPCs.
func (*EC2) PublicIP ¶ added in v1.4.0
PublicIP returns the public ip associated with the network interface.
func (*EC2) SecurityGroups ¶
SecurityGroups finds the security group IDs with optional filters.
type Filter ¶
type Filter struct { // Name of a filter that will be applied to subnets, // for available filter names see: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html. Name string // Value of the filter. Values []string }
Filter contains the name and values of a filter.
func FilterForTags ¶ added in v1.21.0
FilterForTags takes a key and optional values to construct an EC2 filter.
type Resource ¶ added in v1.8.1
Resource contains the ID and name of a EC2 resource.
func (*Resource) String ¶ added in v1.8.1
String formats the elements of a VPC into a display-ready string. For example: VPCResource{"ID": "vpc-0576efeea396efee2", "Name": "video-store-test"} will return "vpc-0576efeea396efee2 (copilot-video-store-test)". while VPCResource{"ID": "subnet-018ccb78d353cec9b", "Name": "public-subnet-1"} will return "subnet-018ccb78d353cec9b (public-subnet-1)"
type Subnet ¶ added in v1.8.1
Subnet contains the ID and name of a subnet.
func ExtractSubnet ¶ added in v1.8.1
ExtractSubnet extracts the subnet ID from the resource display string.
type VPC ¶ added in v0.4.0
type VPC struct {
Resource
}
VPC contains the ID and name of a VPC.
func ExtractVPC ¶ added in v0.4.0
ExtractVPC extracts the vpc ID from the resource display string. For example: vpc-0576efeea396efee2 (copilot-video-store-test) will return VPC{ID: "vpc-0576efeea396efee2", Name: "copilot-video-store-test"}.
type VPCSubnets ¶ added in v1.8.1
VPCSubnets are all subnets within a VPC.