amipublisher

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Apache-2.0 Imports: 28 Imported by: 4

Documentation

Index

Constants

View Source
const ExpiresAtFormat = "2006-01-02 15:04:05"

Variables

This section is empty.

Functions

func AddVolumes

func AddVolumes(targets awsutil.TargetList, skipList awsutil.TargetList,
	tags libtags.Tags, unpackerName string, size uint64,
	logger log.Logger) error

func CopyBootstrapImage

func CopyBootstrapImage(streamName string, targets awsutil.TargetList,
	skipList awsutil.TargetList, marketplaceImage, marketplaceLoginName string,
	newImageTags libtags.Tags, unpackerName string,
	vpcSearchTags, subnetSearchTags, securityGroupSearchTags libtags.Tags,
	instanceType string, sshKeyName string, logger log.Logger) error

func DeleteResources

func DeleteResources(resources []Resource, logger log.Logger) error

func DeleteTags

func DeleteTags(resources []Resource, tagKeys []string,
	logger log.Logger) error

func DeleteTagsOnUnpackers

func DeleteTagsOnUnpackers(targets awsutil.TargetList,
	skipList awsutil.TargetList, name string, tagKeys []string,
	logger log.Logger) error

func ExpireResources

func ExpireResources(targets awsutil.TargetList, skipList awsutil.TargetList,
	logger log.Logger) error

func ImportKeyPair

func ImportKeyPair(targets awsutil.TargetList, skipList awsutil.TargetList,
	keyName string, publicKey []byte, logger log.Logger) error

func ListStreams

func ListStreams(targets awsutil.TargetList, skipList awsutil.TargetList,
	unpackerName string, logger log.Logger) (map[string]struct{}, error)

func PrepareUnpackers

func PrepareUnpackers(streamName string, targets awsutil.TargetList,
	skipList awsutil.TargetList, name string, logger log.Logger) error

func RemoveUnusedVolumes

func RemoveUnusedVolumes(targets awsutil.TargetList,
	skipList awsutil.TargetList, unpackerName string, logger log.Logger) error

func SetExclusiveTags

func SetExclusiveTags(resources []Resource, tagKey string, tagValue string,
	logger log.Logger) error

func SetTags

func SetTags(targets awsutil.TargetList, skipList awsutil.TargetList,
	name string, tags map[string]string, logger log.Logger) error

func StopIdleUnpackers

func StopIdleUnpackers(targets awsutil.TargetList, skipList awsutil.TargetList,
	name string, idleTimeout time.Duration, logger log.Logger) error

func TerminateInstances

func TerminateInstances(targets awsutil.TargetList,
	skipList awsutil.TargetList, name string, logger log.Logger) error

Types

type Image

type Image struct {
	awsutil.Target
	AmiId        string
	AmiName      string
	CreationDate string
	Description  string
	Size         uint // Size in GiB.
	Tags         libtags.Tags
}

func ListImages

func ListImages(targets awsutil.TargetList, skipList awsutil.TargetList,
	searchTags, excludeSearchTags libtags.Tags, minImageAge time.Duration,
	logger log.DebugLogger) ([]Image, error)

type Instance

type Instance struct {
	awsutil.Target
	AmiId      string
	InstanceId string
	LaunchTime string
	Tags       libtags.Tags
}

type InstanceResult

type InstanceResult struct {
	awsutil.Target
	InstanceId string
	PrivateIp  string
	Error      error
}

func LaunchInstances

func LaunchInstances(targets awsutil.TargetList, skipList awsutil.TargetList,
	imageSearchTags, vpcSearchTags, subnetSearchTags,
	securityGroupSearchTags libtags.Tags, instanceType string,
	rootVolumeSize uint, sshKeyName string, tags map[string]string,
	replaceInstances bool, logger log.Logger) ([]InstanceResult, error)

func LaunchInstancesForImages

func LaunchInstancesForImages(images []Resource,
	vpcSearchTags, subnetSearchTags, securityGroupSearchTags libtags.Tags,
	instanceType string, rootVolumeSize uint, sshKeyName string,
	tags map[string]string, logger log.Logger) ([]InstanceResult, error)

func StartInstances

func StartInstances(targets awsutil.TargetList,
	skipList awsutil.TargetList, name string, logger log.Logger) (
	[]InstanceResult, error)

func (InstanceResult) MarshalJSON

func (v InstanceResult) MarshalJSON() ([]byte, error)

type PublishOptions

type PublishOptions struct {
	EnaSupport bool
}

type Resource

type Resource struct {
	awsutil.Target
	SharedFrom     string
	SnapshotId     string
	S3Bucket       string
	S3ManifestFile string
	AmiId          string
}

type Results

type Results []TargetResult

func Publish

func Publish(imageServerAddress string, streamName string, imageLeafName string,
	minFreeBytes uint64, amiName string, tags map[string]string,
	targets awsutil.TargetList, skipList awsutil.TargetList,
	unpackerName string, s3Bucket string, s3Folder string,
	sharingAccountName string, publishOptions PublishOptions,
	logger log.Logger) (Results, error)

type TargetResult

type TargetResult struct {
	awsutil.Target
	SharedFrom     string
	SnapshotId     string
	S3Bucket       string
	S3ManifestFile string
	AmiId          string
	Size           uint // Size in GiB.
	Error          error
}

func (TargetResult) MarshalJSON

func (v TargetResult) MarshalJSON() ([]byte, error)

type TargetUnpackers

type TargetUnpackers struct {
	awsutil.Target
	Unpackers []Unpacker
}

func ListUnpackers

func ListUnpackers(targets awsutil.TargetList, skipList awsutil.TargetList,
	unpackerName string, logger log.Logger) (
	[]TargetUnpackers, error)

type Unpacker

type Unpacker struct {
	InstanceId        string
	IpAddress         string
	State             string
	TimeSinceLastUsed string `json:",omitempty"`
}

type UnusedImagesResult

type UnusedImagesResult struct {
	UnusedImages []Image
	OldInstances []Instance
}

func DeleteUnusedImages

func DeleteUnusedImages(targets awsutil.TargetList, skipList awsutil.TargetList,
	searchTags, excludeSearchTags libtags.Tags, minImageAge time.Duration,
	logger log.DebugLogger) (UnusedImagesResult, error)

func ListUnusedImages

func ListUnusedImages(targets awsutil.TargetList, skipList awsutil.TargetList,
	searchTags, excludeSearchTags libtags.Tags, minImageAge time.Duration,
	logger log.DebugLogger) (UnusedImagesResult, error)

type UsedImagesResult

type UsedImagesResult struct {
	UsedImages     []Image
	UsingInstances []Instance
}

func ListUsedImages

func ListUsedImages(targets awsutil.TargetList, skipList awsutil.TargetList,
	searchTags, excludeSearchTags libtags.Tags,
	logger log.DebugLogger) (UsedImagesResult, error)

Jump to

Keyboard shortcuts

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