ec2

package
v0.53.2-rc.18 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package ec2 provides helpers for creating and managing AWS EC2 resources.

Index

Constants

View Source
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.

func SearchAMI

func SearchAMI(e aws.Environment, owner, name, arch string) (string, error)

SearchAMI searches for an AMI by owner, name pattern, and architecture.

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.

Jump to

Keyboard shortcuts

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