Documentation
¶
Overview ¶
Package ec2 provides helpers for creating and managing AWS EC2 resources.
Index ¶
- Constants
- func CreateLaunchTemplate(e aws.Environment, name string, ...) (*ec2.LaunchTemplate, error)
- func GetAMIFromSSM(e aws.Environment, paramName string) (string, error)
- func LatestUbuntuAMI(e aws.Environment, arch string) (string, error)
- func NewAutoscalingGroup(e aws.Environment, name string, launchTemplateID pulumi.StringInput, ...) (*autoscaling.Group, error)
- func NewDedicatedHost(e aws.Environment, name string, args DedicatedHostArgs, ...) (*ec2.DedicatedHost, error)
- func NewInstance(e aws.Environment, name string, args InstanceArgs, ...) (*ec2.Instance, error)
- func SearchAMI(e aws.Environment, owner, name, arch string) (string, error)
- type DedicatedHostArgs
- type InstanceArgs
Constants ¶
const ( AMD64Arch = "x86_64" ARM64Arch = "arm64" )
AMI architecture constants.
Variables ¶
This section is empty.
Functions ¶
func CreateLaunchTemplate ¶
func CreateLaunchTemplate(e aws.Environment, name string, ami, instanceType, iamProfileArn, keyPair, userData pulumi.StringInput) (*ec2.LaunchTemplate, error)
CreateLaunchTemplate creates an EC2 launch template with the given parameters.
func GetAMIFromSSM ¶
func GetAMIFromSSM(e aws.Environment, paramName string) (string, error)
GetAMIFromSSM retrieves an AMI ID from an SSM parameter.
func LatestUbuntuAMI ¶
func LatestUbuntuAMI(e aws.Environment, arch string) (string, error)
LatestUbuntuAMI returns the latest Ubuntu 22.04 (jammy) AMI for the given architecture.
func NewAutoscalingGroup ¶
func NewAutoscalingGroup(e aws.Environment, name string, launchTemplateID pulumi.StringInput, launchTemplateVersion pulumi.IntInput, desiredCapacity, minSize, maxSize int, ) (*autoscaling.Group, error)
NewAutoscalingGroup creates an EC2 autoscaling group with the given parameters.
func NewDedicatedHost ¶
func NewDedicatedHost(e aws.Environment, name string, args DedicatedHostArgs, opts ...pulumi.ResourceOption) (*ec2.DedicatedHost, error)
NewDedicatedHost creates an EC2 Dedicated Host for Mac instances
func NewInstance ¶
func NewInstance(e aws.Environment, name string, args InstanceArgs, opts ...pulumi.ResourceOption) (*ec2.Instance, error)
NewInstance creates a new EC2 instance with the given parameters.
Types ¶
type DedicatedHostArgs ¶
type DedicatedHostArgs struct {
// Mandatory
InstanceType string // e.g., "mac1.metal", "mac2.metal"
// Optional
AvailabilityZone string // If not specified, will use first available zone
HostRecovery string // "on" or "off", defaults to "off"
Tags pulumi.StringMap
}
DedicatedHostArgs defines the parameters for creating a dedicated host.
type InstanceArgs ¶
type InstanceArgs struct {
// Mandatory
AMI string
// Defaulted
InstanceType string // Note that caller must ensure it matches with AMI Architecture
KeyPairName string
Tenancy string
StorageSize int
InstanceProfile string
// Optional
UserData string
HTTPTokensRequired bool
HostID pulumi.StringInput // For dedicated host tenancy
VolumeThroughput int // GP3 volume throughput in MiB/s (125-1000)
}
InstanceArgs defines the parameters for creating an EC2 instance.