awsec2

package
v0.0.0-...-82ab749 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AmazonLinuxAMINamePattern = "al2023-ami-*"
	AmazonLinuxAMIOwner       = "137112412989"

	ARM    = types.ArchitectureTypeArm64
	X86_64 = types.ArchitectureTypeX8664

	InvalidLaunchTemplateName_NotFound = "InvalidLaunchTemplateName.NotFound"
	Unsupported                        = "Unsupported"
	UnsupportedOperation               = "UnsupportedOperation"
)
View Source
const (
	InvalidParameterValue             = "InvalidParameterValue"
	RouteAlreadyExists                = "RouteAlreadyExists"
	VpcPeeringConnectionAlreadyExists = "VpcPeeringConnectionAlreadyExists"
)
View Source
const InvalidLaunchTemplateName_NotFoundException = "InvalidLaunchTemplateName.NotFoundException"

Variables

This section is empty.

Functions

func CreateTags

func CreateTags(
	ctx context.Context,
	cfg *awscfg.Config,
	resources []string,
	tags tagging.Map,
) error

func DeleteEIP

func DeleteEIP(
	ctx context.Context,
	cfg *awscfg.Config,
	ownerTagValue string,
) (err error)

func DeleteNATGateway

func DeleteNATGateway(
	ctx context.Context,
	cfg *awscfg.Config,
	publicSubnetId string,
) error

func DeleteRouteIPv4

func DeleteRouteIPv4(
	ctx context.Context,
	cfg *awscfg.Config,
	routeTableId string,
	ipv4 cidr.IPv4,
) error

func DeleteVPC

func DeleteVPC(
	ctx context.Context,
	cfg *awscfg.Config,
	vpcId string,
) error

func EnsureEgressOnlyInternetGatewayRouteIPv6

func EnsureEgressOnlyInternetGatewayRouteIPv6(
	ctx context.Context,
	cfg *awscfg.Config,
	routeTableId string,
	ipv6 cidr.IPv6,
	egressOnlyInternetGatewayId string,
) error

func EnsureGatewayVPCEndpoint

func EnsureGatewayVPCEndpoint(
	ctx context.Context,
	cfg *awscfg.Config,
	vpcId string,
	routeTableIds []string,
	serviceName string,
	tags tagging.Map,
) error

func EnsureInternetGatewayRouteIPv4

func EnsureInternetGatewayRouteIPv4(
	ctx context.Context,
	cfg *awscfg.Config,
	routeTableId string,
	ipv4 cidr.IPv4,
	internetGatewayId string,
) error

func EnsureInternetGatewayRouteIPv6

func EnsureInternetGatewayRouteIPv6(
	ctx context.Context,
	cfg *awscfg.Config,
	routeTableId string,
	ipv6 cidr.IPv6,
	internetGatewayId string,
) error

func EnsureNATGatewayRouteIPv4

func EnsureNATGatewayRouteIPv4(
	ctx context.Context,
	cfg *awscfg.Config,
	routeTableId string,
	ipv4 cidr.IPv4,
	natGatewayId string,
) error

func EnsureVPCPeeringRouteIPv4

func EnsureVPCPeeringRouteIPv4(
	ctx context.Context,
	cfg *awscfg.Config,
	routeTableId string,
	ipv4 cidr.IPv4,
	vpcPeeringConnectionId string,
) error

func EnsureVPCPeeringRouteIPv6

func EnsureVPCPeeringRouteIPv6(
	ctx context.Context,
	cfg *awscfg.Config,
	routeTableId string,
	ipv6 cidr.IPv6,
	vpcPeeringConnectionId string,
) error

func ImportKeyPair

func ImportKeyPair(
	ctx context.Context,
	cfg *awscfg.Config,
	name, publicKeyMaterial string,
) (*ec2.ImportKeyPairOutput, error)

func TerminateInstance

func TerminateInstance(
	ctx context.Context,
	cfg *awscfg.Config,
	instanceId string,
) error

Types

type ArchitectureType

type ArchitectureType = types.ArchitectureType

type AvailabilityZone

type AvailabilityZone = types.AvailabilityZone

func DescribeAvailabilityZones

func DescribeAvailabilityZones(
	ctx context.Context,
	cfg *awscfg.Config,
	region string,
) ([]AvailabilityZone, error)

type EIP

type EIP struct {
	AllocationId, IPv4 string
	// contains filtered or unexported fields
}

func DescribeEIP

func DescribeEIP(
	ctx context.Context,
	cfg *awscfg.Config,
	ownerTagValue string,
) (*EIP, error)

func EnsureEIP

func EnsureEIP(
	ctx context.Context,
	cfg *awscfg.Config,
	ownerTagValue string,
	tags tagging.Map,
) (*EIP, error)

type EgressOnlyInternetGateway

type EgressOnlyInternetGateway = types.EgressOnlyInternetGateway

func DescribeEgressOnlyInternetGateway

func DescribeEgressOnlyInternetGateway(ctx context.Context, cfg *awscfg.Config, vpcId string) (*EgressOnlyInternetGateway, error)

func DescribeEgressOnlyInternetGateways

func DescribeEgressOnlyInternetGateways(ctx context.Context, cfg *awscfg.Config) (gateways []EgressOnlyInternetGateway, err error)

func EnsureEgressOnlyInternetGateway

func EnsureEgressOnlyInternetGateway(
	ctx context.Context,
	cfg *awscfg.Config,
	vpcId string,
	tags tagging.Map,
) (*EgressOnlyInternetGateway, error)

type Filter

type Filter = types.Filter

type Image

type Image = types.Image

func DescribeImages

func DescribeImages(
	ctx context.Context,
	cfg *awscfg.Config,
	arch ArchitectureType,
	name, owner string,
) ([]Image, error)

func LatestAmazonLinuxAMI

func LatestAmazonLinuxAMI(
	ctx context.Context,
	cfg *awscfg.Config,
	arch ArchitectureType,
) (*Image, error)

type Instance

type Instance = types.Instance

func DescribeInstances

func DescribeInstances(
	ctx context.Context,
	cfg *awscfg.Config,
	filters []Filter,
) ([]Instance, error)

type InstanceType

type InstanceType = types.InstanceType

type InstanceTypeInfo

type InstanceTypeInfo = types.InstanceTypeInfo

func DescribeInstanceTypes

func DescribeInstanceTypes(
	ctx context.Context,
	cfg *awscfg.Config,
	instanceTypes []InstanceType,
) (infos []InstanceTypeInfo, err error)

type InstanceTypeOffering

type InstanceTypeOffering = types.InstanceTypeOffering

func DescribeInstanceTypeOfferings

func DescribeInstanceTypeOfferings(
	ctx context.Context,
	cfg *awscfg.Config,
) (offerings []InstanceTypeOffering, err error)

type InternetGateway

type InternetGateway = types.InternetGateway

func DescribeInternetGateway

func DescribeInternetGateway(ctx context.Context, cfg *awscfg.Config, vpcId string) (*InternetGateway, error)

func DescribeInternetGateways

func DescribeInternetGateways(ctx context.Context, cfg *awscfg.Config) (gateways []InternetGateway, err error)

func EnsureInternetGateway

func EnsureInternetGateway(
	ctx context.Context,
	cfg *awscfg.Config,
	vpcId string,
	tags tagging.Map,
) (*InternetGateway, error)

type KeyPairInfo

type KeyPairInfo = types.KeyPairInfo

func DescribeKeyPairs

func DescribeKeyPairs(
	ctx context.Context,
	cfg *awscfg.Config,
	name string,
) ([]KeyPairInfo, error)

type LaunchTemplate

type LaunchTemplate = types.LaunchTemplate

func DescribeLaunchTemplate

func DescribeLaunchTemplate(
	ctx context.Context,
	cfg *awscfg.Config,
	name string,
) (*LaunchTemplate, error)

type LaunchTemplateVersion

type LaunchTemplateVersion = types.LaunchTemplateVersion

func DescribeLaunchTemplateVersion

func DescribeLaunchTemplateVersion(
	ctx context.Context,
	cfg *awscfg.Config,
	name string,
) (*LaunchTemplateVersion, error)

type NATGateway

type NATGateway = types.NatGateway

func DescribeNATGateway

func DescribeNATGateway(ctx context.Context, cfg *awscfg.Config, publicSubnetId string) (*NATGateway, error)

func DescribeNATGateways

func DescribeNATGateways(ctx context.Context, cfg *awscfg.Config) (gateways []NATGateway, err error)

func EnsureNATGateway

func EnsureNATGateway(
	ctx context.Context,
	cfg *awscfg.Config,
	publicSubnetId string,
	tags tagging.Map,
) (*NATGateway, error)

type RouteTable

type RouteTable = types.RouteTable

func CreateRouteTable

func CreateRouteTable(
	ctx context.Context,
	cfg *awscfg.Config,
	vpcId, subnetId string,
	tags tagging.Map,
) (*RouteTable, error)

func DescribeRouteTables

func DescribeRouteTables(
	ctx context.Context,
	cfg *awscfg.Config,
	vpcId string,
) (
	public *RouteTable,
	private map[string]*RouteTable,
	err error,
)

type RunInstancesOutput

type RunInstancesOutput = ec2.RunInstancesOutput

func RunInstance

func RunInstance(
	ctx context.Context,
	cfg *awscfg.Config,
	iamInstanceProfile, imageId string,
	instanceType InstanceType,
	keyName, launchTemplateName string,
	rootVolumeSize int32,
	securityGroupId, subnetId string,
	tags []Tag,
) (reservation *RunInstancesOutput, err error)

type SecurityGroup

type SecurityGroup = types.SecurityGroup

func DescribeSecurityGroups

func DescribeSecurityGroups(
	ctx context.Context,
	cfg *awscfg.Config,
	vpcId, name string,
) ([]SecurityGroup, error)

func EnsureSecurityGroup

func EnsureSecurityGroup(
	ctx context.Context,
	cfg *awscfg.Config,
	vpcId, name string,
	tcpIngressPorts []int,
) (*SecurityGroup, error)

type Subnet

type Subnet = types.Subnet

func DescribeSubnets

func DescribeSubnets(
	ctx context.Context,
	cfg *awscfg.Config,
	vpcId string,
) ([]Subnet, error)

func EnsureSubnet

func EnsureSubnet(
	ctx context.Context,
	cfg *awscfg.Config,
	vpcId string,
	az string,
	ipv4 cidr.IPv4,
	ipv6 cidr.IPv6,
	tags tagging.Map,
) (*Subnet, error)

type Tag

type Tag = types.Tag

type VPC

type VPC = types.Vpc

func DescribeVPC

func DescribeVPC(
	ctx context.Context,
	cfg *awscfg.Config,
	environment, quality string,
) (*VPC, error)

func DescribeVPCs

func DescribeVPCs(
	ctx context.Context,
	cfg *awscfg.Config,
	environment, quality string,
) ([]VPC, error)

func EnsureVPC

func EnsureVPC(
	ctx context.Context,
	cfg *awscfg.Config,
	environment, quality string,
	ipv4 cidr.IPv4,
	tags tagging.Map,
) (*VPC, error)

type VPCEndpoint

type VPCEndpoint = types.VpcEndpoint

type VPCPeeringConnection

type VPCPeeringConnection = types.VpcPeeringConnection

func DescribeVPCPeeringConnections

func DescribeVPCPeeringConnections(
	ctx context.Context,
	cfg *awscfg.Config,
) ([]VPCPeeringConnection, error)

func EnsureVPCPeeringConnection

func EnsureVPCPeeringConnection(
	ctx context.Context,
	cfg *awscfg.Config,
	environment0, quality0, region0, vpcId0 string,
	environment1, quality1, region1, vpcId1 string,
) (conn *VPCPeeringConnection, err error)

Jump to

Keyboard shortcuts

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