ec2

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client defines the client for interacting with the Amazon EC2 service

func NewFromAPI

func NewFromAPI(api ClientAPI) *Client

NewFromAPI returns a new client from the provided EC2 API implementation

func (*Client) ToggleInstanceMetadataTags

func (c *Client) ToggleInstanceMetadataTags(ctx context.Context, id string, toggle InstanceMetadataToggle) error

ToggleInstanceMetadataTags will modify the parameters of a running EC2 instance, by toggling the availability of EC2 instance tags within the Instance Metadata Service.

The equivalent operation can be achieved through the CLI using:

aws ec2 modify-instance-metadata-options --instance-id <INSTANCE_ID> --instance-metadata-tags enabled

type ClientAPI

type ClientAPI interface {
	// ModifyInstanceMetadataOptions modifies the parameters of a running EC2 instance,
	// by toggling the availability of EC2 instances tags within the Instance Metadata
	// Service (IMDS)
	ModifyInstanceMetadataOptions(ctx context.Context, params *awsec2.ModifyInstanceMetadataOptionsInput, optFns ...func(*awsec2.Options)) (*awsec2.ModifyInstanceMetadataOptionsOutput, error)
}

ClientAPI defines the API for interacting with the Amazon EC2 service

type InstanceMetadataToggle

type InstanceMetadataToggle string

InstanceMetadataToggle allows the enabling and disabling of EC2 instance tags within IMDS

const (
	InstanceMetadataToggleEnabled  InstanceMetadataToggle = "enabled"
	InstanceMetadataToggleDisabled InstanceMetadataToggle = "disabled"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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