Documentation
¶
Overview ¶
Package ec2 provides a client to make API requests to Amazon Elastic Compute Cloud.
Index ¶
- Constants
- Variables
- type EC2
- func (c *EC2) HasDNSSupport(vpcID string) (bool, error)
- func (c *EC2) ListVPCSubnets(vpcID string, opts ...ListVPCSubnetsOpts) ([]string, error)
- func (c *EC2) ListVPCs() ([]VPC, error)
- func (c *EC2) PublicSubnetIDs(filters ...Filter) ([]string, error)
- func (c *EC2) SecurityGroups(filters ...Filter) ([]string, error)
- func (c *EC2) SubnetIDs(filters ...Filter) ([]string, error)
- type Filter
- type ListVPCSubnetsOpts
- type VPC
Constants ¶
const (
// TagFilterName is the filter name format for tag filters
TagFilterName = "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) HasDNSSupport ¶ added in v0.4.0
HasDNSSupport returns if DNS resolution is enabled for the VPC.
func (*EC2) ListVPCSubnets ¶ added in v0.3.0
func (c *EC2) ListVPCSubnets(vpcID string, opts ...ListVPCSubnetsOpts) ([]string, error)
ListVPCSubnets lists all subnets given a VPC ID.
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) PublicSubnetIDs ¶
PublicSubnetIDs finds the public subnet IDs with optional filters.
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.
type ListVPCSubnetsOpts ¶ added in v0.3.0
ListVPCSubnetsOpts sets up optional parameters for ListVPCSubnets function.
func FilterForPrivateSubnets ¶ added in v0.3.0
func FilterForPrivateSubnets() ListVPCSubnetsOpts
FilterForPrivateSubnets is used to filter to get private subnets.
func FilterForPublicSubnets ¶ added in v0.3.0
func FilterForPublicSubnets() ListVPCSubnetsOpts
FilterForPublicSubnets is used to filter to get public subnets.
type VPC ¶ added in v0.4.0
VPC contains the ID and name of a VPC.
func ExtractVPC ¶ added in v0.4.0
ExtractVPC extracts the VPC ID from the VPC display string. For example: vpc-0576efeea396efee2 (copilot-video-store-test) will return VPC{ID: "vpc-0576efeea396efee2", Name: "copilot-video-store-test"}.