ec2instanceconnect

package
v1.51.24 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 38

Documentation

Overview

Package ec2instanceconnect provides the client and types for making API requests to AWS EC2 Instance Connect.

This is the Amazon EC2 Instance Connect API Reference. It provides descriptions, syntax, and usage examples for each of the actions for Amazon EC2 Instance Connect. Amazon EC2 Instance Connect enables system administrators to publish one-time use SSH public keys to EC2, providing users a simple and secure way to connect to their instances.

To view the Amazon EC2 Instance Connect content in the Amazon EC2 User Guide, see Connect to your Linux instance using EC2 Instance Connect (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Connect-using-EC2-Instance-Connect.html).

For Amazon EC2 APIs, see the Amazon EC2 API Reference (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Welcome.html).

See https://docs.aws.amazon.com/goto/WebAPI/ec2-instance-connect-2018-04-02 for more information on this service.

See ec2instanceconnect package documentation for more information. https://docs.aws.amazon.com/sdk-for-go/api/service/ec2instanceconnect/

Using the Client

To contact AWS EC2 Instance Connect with the SDK use the New function to create a new service client. With that client you can make API requests to the service. These clients are safe to use concurrently.

See the SDK's documentation for more information on how to use the SDK. https://docs.aws.amazon.com/sdk-for-go/api/

See aws.Config documentation for more information on configuring SDK clients. https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config

See the AWS EC2 Instance Connect client EC2InstanceConnect for more information on creating client for this service. https://docs.aws.amazon.com/sdk-for-go/api/service/ec2instanceconnect/#New

Index

Examples

Constants

View Source
const (

	// ErrCodeAuthException for service response error code
	// "AuthException".
	//
	// Either your AWS credentials are not valid or you do not have access to the
	// EC2 instance.
	ErrCodeAuthException = "AuthException"

	// ErrCodeEC2InstanceNotFoundException for service response error code
	// "EC2InstanceNotFoundException".
	//
	// The specified instance was not found.
	ErrCodeEC2InstanceNotFoundException = "EC2InstanceNotFoundException"

	// ErrCodeEC2InstanceStateInvalidException for service response error code
	// "EC2InstanceStateInvalidException".
	//
	// Unable to connect because the instance is not in a valid state. Connecting
	// to a stopped or terminated instance is not supported. If the instance is
	// stopped, start your instance, and try to connect again.
	ErrCodeEC2InstanceStateInvalidException = "EC2InstanceStateInvalidException"

	// ErrCodeEC2InstanceTypeInvalidException for service response error code
	// "EC2InstanceTypeInvalidException".
	//
	// The instance type is not supported for connecting via the serial console.
	// Only Nitro instance types are currently supported.
	ErrCodeEC2InstanceTypeInvalidException = "EC2InstanceTypeInvalidException"

	// ErrCodeEC2InstanceUnavailableException for service response error code
	// "EC2InstanceUnavailableException".
	//
	// The instance is currently unavailable. Wait a few minutes and try again.
	ErrCodeEC2InstanceUnavailableException = "EC2InstanceUnavailableException"

	// ErrCodeInvalidArgsException for service response error code
	// "InvalidArgsException".
	//
	// One of the parameters is not valid.
	ErrCodeInvalidArgsException = "InvalidArgsException"

	// ErrCodeSerialConsoleAccessDisabledException for service response error code
	// "SerialConsoleAccessDisabledException".
	//
	// Your account is not authorized to use the EC2 Serial Console. To authorize
	// your account, run the EnableSerialConsoleAccess API. For more information,
	// see EnableSerialConsoleAccess (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EnableSerialConsoleAccess.html)
	// in the Amazon EC2 API Reference.
	ErrCodeSerialConsoleAccessDisabledException = "SerialConsoleAccessDisabledException"

	// ErrCodeSerialConsoleSessionLimitExceededException for service response error code
	// "SerialConsoleSessionLimitExceededException".
	//
	// The instance currently has 1 active serial console session. Only 1 session
	// is supported at a time.
	ErrCodeSerialConsoleSessionLimitExceededException = "SerialConsoleSessionLimitExceededException"

	// ErrCodeSerialConsoleSessionUnavailableException for service response error code
	// "SerialConsoleSessionUnavailableException".
	//
	// Unable to start a serial console session. Please try again.
	ErrCodeSerialConsoleSessionUnavailableException = "SerialConsoleSessionUnavailableException"

	// ErrCodeSerialConsoleSessionUnsupportedException for service response error code
	// "SerialConsoleSessionUnsupportedException".
	//
	// Your instance's BIOS version is unsupported for serial console connection.
	// Reboot your instance to update its BIOS, and then try again to connect.
	ErrCodeSerialConsoleSessionUnsupportedException = "SerialConsoleSessionUnsupportedException"

	// ErrCodeServiceException for service response error code
	// "ServiceException".
	//
	// The service encountered an error. Follow the instructions in the error message
	// and try again.
	ErrCodeServiceException = "ServiceException"

	// ErrCodeThrottlingException for service response error code
	// "ThrottlingException".
	//
	// The requests were made too frequently and have been throttled. Wait a while
	// and try again. To increase the limit on your request frequency, contact AWS
	// Support.
	ErrCodeThrottlingException = "ThrottlingException"
)
View Source
const (
	ServiceName = "EC2 Instance Connect" // Name of service.
	EndpointsID = "ec2-instance-connect" // ID to lookup a service endpoint with.
	ServiceID   = "EC2 Instance Connect" // ServiceID is a unique identifier of a specific service.
)

Service information constants

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthException added in v1.28.0

type AuthException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"Message" type:"string"`
	// contains filtered or unexported fields
}

Either your AWS credentials are not valid or you do not have access to the EC2 instance.

func (*AuthException) Code added in v1.28.0

func (s *AuthException) Code() string

Code returns the exception type name.

func (*AuthException) Error added in v1.28.0

func (s *AuthException) Error() string

func (AuthException) GoString added in v1.28.0

func (s AuthException) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*AuthException) Message added in v1.28.0

func (s *AuthException) Message() string

Message returns the exception's message.

func (*AuthException) OrigErr added in v1.28.0

func (s *AuthException) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*AuthException) RequestID added in v1.28.0

func (s *AuthException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*AuthException) StatusCode added in v1.28.0

func (s *AuthException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (AuthException) String added in v1.28.0

func (s AuthException) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type EC2InstanceConnect

type EC2InstanceConnect struct {
	*client.Client
}

EC2InstanceConnect provides the API operation methods for making requests to AWS EC2 Instance Connect. See this package's package overview docs for details on the service.

EC2InstanceConnect methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

func New

New creates a new instance of the EC2InstanceConnect client with a session. If additional configuration is needed for the client instance use the optional aws.Config parameter to add your extra config.

Example:

mySession := session.Must(session.NewSession())

// Create a EC2InstanceConnect client from just a session.
svc := ec2instanceconnect.New(mySession)

// Create a EC2InstanceConnect client with additional configuration
svc := ec2instanceconnect.New(mySession, aws.NewConfig().WithRegion("us-west-2"))

func (*EC2InstanceConnect) SendSSHPublicKey

func (c *EC2InstanceConnect) SendSSHPublicKey(input *SendSSHPublicKeyInput) (*SendSSHPublicKeyOutput, error)

SendSSHPublicKey API operation for AWS EC2 Instance Connect.

Pushes an SSH public key to the specified EC2 instance for use by the specified user. The key remains for 60 seconds. For more information, see Connect to your Linux instance using EC2 Instance Connect (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Connect-using-EC2-Instance-Connect.html) in the Amazon EC2 User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS EC2 Instance Connect's API operation SendSSHPublicKey for usage and error information.

Returned Error Types:

  • AuthException Either your AWS credentials are not valid or you do not have access to the EC2 instance.

  • InvalidArgsException One of the parameters is not valid.

  • ServiceException The service encountered an error. Follow the instructions in the error message and try again.

  • ThrottlingException The requests were made too frequently and have been throttled. Wait a while and try again. To increase the limit on your request frequency, contact AWS Support.

  • EC2InstanceNotFoundException The specified instance was not found.

  • EC2InstanceStateInvalidException Unable to connect because the instance is not in a valid state. Connecting to a stopped or terminated instance is not supported. If the instance is stopped, start your instance, and try to connect again.

  • EC2InstanceUnavailableException The instance is currently unavailable. Wait a few minutes and try again.

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-instance-connect-2018-04-02/SendSSHPublicKey

Example (Shared00)

To push an SSH key to an EC2 instance The following example pushes a sample SSH public key to the EC2 instance i-abcd1234 in AZ us-west-2b for use by the instance OS user ec2-user.

// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.

package main

import (
	"fmt"
	"strings"
	"time"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/ec2instanceconnect"
)

var _ time.Duration
var _ strings.Reader
var _ aws.Config

func parseTime(layout, value string) *time.Time {
	t, err := time.Parse(layout, value)
	if err != nil {
		panic(err)
	}
	return &t
}

// To push an SSH key to an EC2 instance
// The following example pushes a sample SSH public key to the EC2 instance i-abcd1234
// in AZ us-west-2b for use by the instance OS user ec2-user.
func main() {
	svc := ec2instanceconnect.New(session.New())
	input := &ec2instanceconnect.SendSSHPublicKeyInput{
		AvailabilityZone: aws.String("us-west-2a"),
		InstanceId:       aws.String("i-abcd1234"),
		InstanceOSUser:   aws.String("ec2-user"),
		SSHPublicKey:     aws.String("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3FlHqj2eqCdrGHuA6dRjfZXQ4HX5lXEIRHaNbxEwE5Te7xNF7StwhrDtiV7IdT5fDqbRyGw/szPj3xGkNTVoElCZ2dDFb2qYZ1WLIpZwj/UhO9l2mgfjR56UojjQut5Jvn2KZ1OcyrNO0J83kCaJCV7JoVbXY79FBMUccYNY45zmv9+1FMCfY6i2jdIhwR6+yLk8oubL8lIPyq7X+6b9S0yKCkB7Peml1DvghlybpAIUrC9vofHt6XP4V1i0bImw1IlljQS+DUmULRFSccATDscCX9ajnj7Crhm0HAZC0tBPXpFdHkPwL3yzYo546SCS9LKEwz62ymxxbL9k7h09t"),
	}

	result, err := svc.SendSSHPublicKey(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case ec2instanceconnect.ErrCodeAuthException:
				fmt.Println(ec2instanceconnect.ErrCodeAuthException, aerr.Error())
			case ec2instanceconnect.ErrCodeInvalidArgsException:
				fmt.Println(ec2instanceconnect.ErrCodeInvalidArgsException, aerr.Error())
			case ec2instanceconnect.ErrCodeServiceException:
				fmt.Println(ec2instanceconnect.ErrCodeServiceException, aerr.Error())
			case ec2instanceconnect.ErrCodeThrottlingException:
				fmt.Println(ec2instanceconnect.ErrCodeThrottlingException, aerr.Error())
			case ec2instanceconnect.ErrCodeEC2InstanceNotFoundException:
				fmt.Println(ec2instanceconnect.ErrCodeEC2InstanceNotFoundException, aerr.Error())
			case ec2instanceconnect.ErrCodeEC2InstanceStateInvalidException:
				fmt.Println(ec2instanceconnect.ErrCodeEC2InstanceStateInvalidException, aerr.Error())
			case ec2instanceconnect.ErrCodeEC2InstanceUnavailableException:
				fmt.Println(ec2instanceconnect.ErrCodeEC2InstanceUnavailableException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			// Print the error, cast err to awserr.Error to get the Code and
			// Message from an error.
			fmt.Println(err.Error())
		}
		return
	}

	fmt.Println(result)
}
Output:

func (*EC2InstanceConnect) SendSSHPublicKeyRequest

func (c *EC2InstanceConnect) SendSSHPublicKeyRequest(input *SendSSHPublicKeyInput) (req *request.Request, output *SendSSHPublicKeyOutput)

SendSSHPublicKeyRequest generates a "aws/request.Request" representing the client's request for the SendSSHPublicKey operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See SendSSHPublicKey for more information on using the SendSSHPublicKey API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the SendSSHPublicKeyRequest method.
req, resp := client.SendSSHPublicKeyRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-instance-connect-2018-04-02/SendSSHPublicKey

func (*EC2InstanceConnect) SendSSHPublicKeyWithContext

func (c *EC2InstanceConnect) SendSSHPublicKeyWithContext(ctx aws.Context, input *SendSSHPublicKeyInput, opts ...request.Option) (*SendSSHPublicKeyOutput, error)

SendSSHPublicKeyWithContext is the same as SendSSHPublicKey with the addition of the ability to pass a context and additional request options.

See SendSSHPublicKey for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*EC2InstanceConnect) SendSerialConsoleSSHPublicKey added in v1.38.9

SendSerialConsoleSSHPublicKey API operation for AWS EC2 Instance Connect.

Pushes an SSH public key to the specified EC2 instance. The key remains for 60 seconds, which gives you 60 seconds to establish a serial console connection to the instance using SSH. For more information, see EC2 Serial Console (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-serial-console.html) in the Amazon EC2 User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS EC2 Instance Connect's API operation SendSerialConsoleSSHPublicKey for usage and error information.

Returned Error Types:

  • AuthException Either your AWS credentials are not valid or you do not have access to the EC2 instance.

  • SerialConsoleAccessDisabledException Your account is not authorized to use the EC2 Serial Console. To authorize your account, run the EnableSerialConsoleAccess API. For more information, see EnableSerialConsoleAccess (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EnableSerialConsoleAccess.html) in the Amazon EC2 API Reference.

  • InvalidArgsException One of the parameters is not valid.

  • ServiceException The service encountered an error. Follow the instructions in the error message and try again.

  • ThrottlingException The requests were made too frequently and have been throttled. Wait a while and try again. To increase the limit on your request frequency, contact AWS Support.

  • EC2InstanceNotFoundException The specified instance was not found.

  • EC2InstanceTypeInvalidException The instance type is not supported for connecting via the serial console. Only Nitro instance types are currently supported.

  • SerialConsoleSessionLimitExceededException The instance currently has 1 active serial console session. Only 1 session is supported at a time.

  • SerialConsoleSessionUnavailableException Unable to start a serial console session. Please try again.

  • EC2InstanceStateInvalidException Unable to connect because the instance is not in a valid state. Connecting to a stopped or terminated instance is not supported. If the instance is stopped, start your instance, and try to connect again.

  • EC2InstanceUnavailableException The instance is currently unavailable. Wait a few minutes and try again.

  • SerialConsoleSessionUnsupportedException Your instance's BIOS version is unsupported for serial console connection. Reboot your instance to update its BIOS, and then try again to connect.

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-instance-connect-2018-04-02/SendSerialConsoleSSHPublicKey

func (*EC2InstanceConnect) SendSerialConsoleSSHPublicKeyRequest added in v1.38.9

func (c *EC2InstanceConnect) SendSerialConsoleSSHPublicKeyRequest(input *SendSerialConsoleSSHPublicKeyInput) (req *request.Request, output *SendSerialConsoleSSHPublicKeyOutput)

SendSerialConsoleSSHPublicKeyRequest generates a "aws/request.Request" representing the client's request for the SendSerialConsoleSSHPublicKey operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See SendSerialConsoleSSHPublicKey for more information on using the SendSerialConsoleSSHPublicKey API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the SendSerialConsoleSSHPublicKeyRequest method.
req, resp := client.SendSerialConsoleSSHPublicKeyRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-instance-connect-2018-04-02/SendSerialConsoleSSHPublicKey

func (*EC2InstanceConnect) SendSerialConsoleSSHPublicKeyWithContext added in v1.38.9

func (c *EC2InstanceConnect) SendSerialConsoleSSHPublicKeyWithContext(ctx aws.Context, input *SendSerialConsoleSSHPublicKeyInput, opts ...request.Option) (*SendSerialConsoleSSHPublicKeyOutput, error)

SendSerialConsoleSSHPublicKeyWithContext is the same as SendSerialConsoleSSHPublicKey with the addition of the ability to pass a context and additional request options.

See SendSerialConsoleSSHPublicKey for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

type EC2InstanceNotFoundException added in v1.28.0

type EC2InstanceNotFoundException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"Message" type:"string"`
	// contains filtered or unexported fields
}

The specified instance was not found.

func (*EC2InstanceNotFoundException) Code added in v1.28.0

Code returns the exception type name.

func (*EC2InstanceNotFoundException) Error added in v1.28.0

func (EC2InstanceNotFoundException) GoString added in v1.28.0

func (s EC2InstanceNotFoundException) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*EC2InstanceNotFoundException) Message added in v1.28.0

func (s *EC2InstanceNotFoundException) Message() string

Message returns the exception's message.

func (*EC2InstanceNotFoundException) OrigErr added in v1.28.0

func (s *EC2InstanceNotFoundException) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*EC2InstanceNotFoundException) RequestID added in v1.28.0

func (s *EC2InstanceNotFoundException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*EC2InstanceNotFoundException) StatusCode added in v1.28.0

func (s *EC2InstanceNotFoundException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (EC2InstanceNotFoundException) String added in v1.28.0

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type EC2InstanceStateInvalidException added in v1.42.37

type EC2InstanceStateInvalidException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"Message" type:"string"`
	// contains filtered or unexported fields
}

Unable to connect because the instance is not in a valid state. Connecting to a stopped or terminated instance is not supported. If the instance is stopped, start your instance, and try to connect again.

func (*EC2InstanceStateInvalidException) Code added in v1.42.37

Code returns the exception type name.

func (*EC2InstanceStateInvalidException) Error added in v1.42.37

func (EC2InstanceStateInvalidException) GoString added in v1.42.37

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*EC2InstanceStateInvalidException) Message added in v1.42.37

Message returns the exception's message.

func (*EC2InstanceStateInvalidException) OrigErr added in v1.42.37

OrigErr always returns nil, satisfies awserr.Error interface.

func (*EC2InstanceStateInvalidException) RequestID added in v1.42.37

RequestID returns the service's response RequestID for request.

func (*EC2InstanceStateInvalidException) StatusCode added in v1.42.37

func (s *EC2InstanceStateInvalidException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (EC2InstanceStateInvalidException) String added in v1.42.37

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type EC2InstanceTypeInvalidException added in v1.38.9

type EC2InstanceTypeInvalidException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"Message" type:"string"`
	// contains filtered or unexported fields
}

The instance type is not supported for connecting via the serial console. Only Nitro instance types are currently supported.

func (*EC2InstanceTypeInvalidException) Code added in v1.38.9

Code returns the exception type name.

func (*EC2InstanceTypeInvalidException) Error added in v1.38.9

func (EC2InstanceTypeInvalidException) GoString added in v1.38.9

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*EC2InstanceTypeInvalidException) Message added in v1.38.9

Message returns the exception's message.

func (*EC2InstanceTypeInvalidException) OrigErr added in v1.38.9

OrigErr always returns nil, satisfies awserr.Error interface.

func (*EC2InstanceTypeInvalidException) RequestID added in v1.38.9

func (s *EC2InstanceTypeInvalidException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*EC2InstanceTypeInvalidException) StatusCode added in v1.38.9

func (s *EC2InstanceTypeInvalidException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (EC2InstanceTypeInvalidException) String added in v1.38.9

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type EC2InstanceUnavailableException added in v1.44.60

type EC2InstanceUnavailableException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"Message" type:"string"`
	// contains filtered or unexported fields
}

The instance is currently unavailable. Wait a few minutes and try again.

func (*EC2InstanceUnavailableException) Code added in v1.44.60

Code returns the exception type name.

func (*EC2InstanceUnavailableException) Error added in v1.44.60

func (EC2InstanceUnavailableException) GoString added in v1.44.60

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*EC2InstanceUnavailableException) Message added in v1.44.60

Message returns the exception's message.

func (*EC2InstanceUnavailableException) OrigErr added in v1.44.60

OrigErr always returns nil, satisfies awserr.Error interface.

func (*EC2InstanceUnavailableException) RequestID added in v1.44.60

func (s *EC2InstanceUnavailableException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*EC2InstanceUnavailableException) StatusCode added in v1.44.60

func (s *EC2InstanceUnavailableException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (EC2InstanceUnavailableException) String added in v1.44.60

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type InvalidArgsException added in v1.28.0

type InvalidArgsException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"Message" type:"string"`
	// contains filtered or unexported fields
}

One of the parameters is not valid.

func (*InvalidArgsException) Code added in v1.28.0

func (s *InvalidArgsException) Code() string

Code returns the exception type name.

func (*InvalidArgsException) Error added in v1.28.0

func (s *InvalidArgsException) Error() string

func (InvalidArgsException) GoString added in v1.28.0

func (s InvalidArgsException) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*InvalidArgsException) Message added in v1.28.0

func (s *InvalidArgsException) Message() string

Message returns the exception's message.

func (*InvalidArgsException) OrigErr added in v1.28.0

func (s *InvalidArgsException) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*InvalidArgsException) RequestID added in v1.28.0

func (s *InvalidArgsException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*InvalidArgsException) StatusCode added in v1.28.0

func (s *InvalidArgsException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (InvalidArgsException) String added in v1.28.0

func (s InvalidArgsException) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type SendSSHPublicKeyInput

type SendSSHPublicKeyInput struct {

	// The Availability Zone in which the EC2 instance was launched.
	AvailabilityZone *string `min:"6" type:"string"`

	// The ID of the EC2 instance.
	//
	// InstanceId is a required field
	InstanceId *string `min:"10" type:"string" required:"true"`

	// The OS user on the EC2 instance for whom the key can be used to authenticate.
	//
	// InstanceOSUser is a required field
	InstanceOSUser *string `min:"1" type:"string" required:"true"`

	// The public key material. To use the public key, you must have the matching
	// private key.
	//
	// SSHPublicKey is a required field
	SSHPublicKey *string `min:"80" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (SendSSHPublicKeyInput) GoString

func (s SendSSHPublicKeyInput) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*SendSSHPublicKeyInput) SetAvailabilityZone

func (s *SendSSHPublicKeyInput) SetAvailabilityZone(v string) *SendSSHPublicKeyInput

SetAvailabilityZone sets the AvailabilityZone field's value.

func (*SendSSHPublicKeyInput) SetInstanceId

func (s *SendSSHPublicKeyInput) SetInstanceId(v string) *SendSSHPublicKeyInput

SetInstanceId sets the InstanceId field's value.

func (*SendSSHPublicKeyInput) SetInstanceOSUser

func (s *SendSSHPublicKeyInput) SetInstanceOSUser(v string) *SendSSHPublicKeyInput

SetInstanceOSUser sets the InstanceOSUser field's value.

func (*SendSSHPublicKeyInput) SetSSHPublicKey

func (s *SendSSHPublicKeyInput) SetSSHPublicKey(v string) *SendSSHPublicKeyInput

SetSSHPublicKey sets the SSHPublicKey field's value.

func (SendSSHPublicKeyInput) String

func (s SendSSHPublicKeyInput) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*SendSSHPublicKeyInput) Validate

func (s *SendSSHPublicKeyInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type SendSSHPublicKeyOutput

type SendSSHPublicKeyOutput struct {

	// The ID of the request. Please provide this ID when contacting AWS Support
	// for assistance.
	RequestId *string `type:"string"`

	// Is true if the request succeeds and an error otherwise.
	Success *bool `type:"boolean"`
	// contains filtered or unexported fields
}

func (SendSSHPublicKeyOutput) GoString

func (s SendSSHPublicKeyOutput) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*SendSSHPublicKeyOutput) SetRequestId

SetRequestId sets the RequestId field's value.

func (*SendSSHPublicKeyOutput) SetSuccess

SetSuccess sets the Success field's value.

func (SendSSHPublicKeyOutput) String

func (s SendSSHPublicKeyOutput) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type SendSerialConsoleSSHPublicKeyInput added in v1.38.9

type SendSerialConsoleSSHPublicKeyInput struct {

	// The ID of the EC2 instance.
	//
	// InstanceId is a required field
	InstanceId *string `min:"10" type:"string" required:"true"`

	// The public key material. To use the public key, you must have the matching
	// private key. For information about the supported key formats and lengths,
	// see Requirements for key pairs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#how-to-generate-your-own-key-and-import-it-to-aws)
	// in the Amazon EC2 User Guide.
	//
	// SSHPublicKey is a required field
	SSHPublicKey *string `min:"80" type:"string" required:"true"`

	// The serial port of the EC2 instance. Currently only port 0 is supported.
	//
	// Default: 0
	SerialPort *int64 `type:"integer"`
	// contains filtered or unexported fields
}

func (SendSerialConsoleSSHPublicKeyInput) GoString added in v1.38.9

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*SendSerialConsoleSSHPublicKeyInput) SetInstanceId added in v1.38.9

SetInstanceId sets the InstanceId field's value.

func (*SendSerialConsoleSSHPublicKeyInput) SetSSHPublicKey added in v1.38.9

SetSSHPublicKey sets the SSHPublicKey field's value.

func (*SendSerialConsoleSSHPublicKeyInput) SetSerialPort added in v1.38.9

SetSerialPort sets the SerialPort field's value.

func (SendSerialConsoleSSHPublicKeyInput) String added in v1.38.9

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*SendSerialConsoleSSHPublicKeyInput) Validate added in v1.38.9

Validate inspects the fields of the type to determine if they are valid.

type SendSerialConsoleSSHPublicKeyOutput added in v1.38.9

type SendSerialConsoleSSHPublicKeyOutput struct {

	// The ID of the request. Please provide this ID when contacting AWS Support
	// for assistance.
	RequestId *string `type:"string"`

	// Is true if the request succeeds and an error otherwise.
	Success *bool `type:"boolean"`
	// contains filtered or unexported fields
}

func (SendSerialConsoleSSHPublicKeyOutput) GoString added in v1.38.9

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*SendSerialConsoleSSHPublicKeyOutput) SetRequestId added in v1.38.9

SetRequestId sets the RequestId field's value.

func (*SendSerialConsoleSSHPublicKeyOutput) SetSuccess added in v1.38.9

SetSuccess sets the Success field's value.

func (SendSerialConsoleSSHPublicKeyOutput) String added in v1.38.9

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type SerialConsoleAccessDisabledException added in v1.38.9

type SerialConsoleAccessDisabledException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"Message" type:"string"`
	// contains filtered or unexported fields
}

Your account is not authorized to use the EC2 Serial Console. To authorize your account, run the EnableSerialConsoleAccess API. For more information, see EnableSerialConsoleAccess (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EnableSerialConsoleAccess.html) in the Amazon EC2 API Reference.

func (*SerialConsoleAccessDisabledException) Code added in v1.38.9

Code returns the exception type name.

func (*SerialConsoleAccessDisabledException) Error added in v1.38.9

func (SerialConsoleAccessDisabledException) GoString added in v1.38.9

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*SerialConsoleAccessDisabledException) Message added in v1.38.9

Message returns the exception's message.

func (*SerialConsoleAccessDisabledException) OrigErr added in v1.38.9

OrigErr always returns nil, satisfies awserr.Error interface.

func (*SerialConsoleAccessDisabledException) RequestID added in v1.38.9

RequestID returns the service's response RequestID for request.

func (*SerialConsoleAccessDisabledException) StatusCode added in v1.38.9

func (s *SerialConsoleAccessDisabledException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (SerialConsoleAccessDisabledException) String added in v1.38.9

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type SerialConsoleSessionLimitExceededException added in v1.38.9

type SerialConsoleSessionLimitExceededException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"Message" type:"string"`
	// contains filtered or unexported fields
}

The instance currently has 1 active serial console session. Only 1 session is supported at a time.

func (*SerialConsoleSessionLimitExceededException) Code added in v1.38.9

Code returns the exception type name.

func (*SerialConsoleSessionLimitExceededException) Error added in v1.38.9

func (SerialConsoleSessionLimitExceededException) GoString added in v1.38.9

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*SerialConsoleSessionLimitExceededException) Message added in v1.38.9

Message returns the exception's message.

func (*SerialConsoleSessionLimitExceededException) OrigErr added in v1.38.9

OrigErr always returns nil, satisfies awserr.Error interface.

func (*SerialConsoleSessionLimitExceededException) RequestID added in v1.38.9

RequestID returns the service's response RequestID for request.

func (*SerialConsoleSessionLimitExceededException) StatusCode added in v1.38.9

Status code returns the HTTP status code for the request's response error.

func (SerialConsoleSessionLimitExceededException) String added in v1.38.9

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type SerialConsoleSessionUnavailableException added in v1.38.9

type SerialConsoleSessionUnavailableException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"Message" type:"string"`
	// contains filtered or unexported fields
}

Unable to start a serial console session. Please try again.

func (*SerialConsoleSessionUnavailableException) Code added in v1.38.9

Code returns the exception type name.

func (*SerialConsoleSessionUnavailableException) Error added in v1.38.9

func (SerialConsoleSessionUnavailableException) GoString added in v1.38.9

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*SerialConsoleSessionUnavailableException) Message added in v1.38.9

Message returns the exception's message.

func (*SerialConsoleSessionUnavailableException) OrigErr added in v1.38.9

OrigErr always returns nil, satisfies awserr.Error interface.

func (*SerialConsoleSessionUnavailableException) RequestID added in v1.38.9

RequestID returns the service's response RequestID for request.

func (*SerialConsoleSessionUnavailableException) StatusCode added in v1.38.9

Status code returns the HTTP status code for the request's response error.

func (SerialConsoleSessionUnavailableException) String added in v1.38.9

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type SerialConsoleSessionUnsupportedException added in v1.51.0

type SerialConsoleSessionUnsupportedException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"Message" type:"string"`
	// contains filtered or unexported fields
}

Your instance's BIOS version is unsupported for serial console connection. Reboot your instance to update its BIOS, and then try again to connect.

func (*SerialConsoleSessionUnsupportedException) Code added in v1.51.0

Code returns the exception type name.

func (*SerialConsoleSessionUnsupportedException) Error added in v1.51.0

func (SerialConsoleSessionUnsupportedException) GoString added in v1.51.0

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*SerialConsoleSessionUnsupportedException) Message added in v1.51.0

Message returns the exception's message.

func (*SerialConsoleSessionUnsupportedException) OrigErr added in v1.51.0

OrigErr always returns nil, satisfies awserr.Error interface.

func (*SerialConsoleSessionUnsupportedException) RequestID added in v1.51.0

RequestID returns the service's response RequestID for request.

func (*SerialConsoleSessionUnsupportedException) StatusCode added in v1.51.0

Status code returns the HTTP status code for the request's response error.

func (SerialConsoleSessionUnsupportedException) String added in v1.51.0

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ServiceException added in v1.28.0

type ServiceException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"Message" type:"string"`
	// contains filtered or unexported fields
}

The service encountered an error. Follow the instructions in the error message and try again.

func (*ServiceException) Code added in v1.28.0

func (s *ServiceException) Code() string

Code returns the exception type name.

func (*ServiceException) Error added in v1.28.0

func (s *ServiceException) Error() string

func (ServiceException) GoString added in v1.28.0

func (s ServiceException) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ServiceException) Message added in v1.28.0

func (s *ServiceException) Message() string

Message returns the exception's message.

func (*ServiceException) OrigErr added in v1.28.0

func (s *ServiceException) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*ServiceException) RequestID added in v1.28.0

func (s *ServiceException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*ServiceException) StatusCode added in v1.28.0

func (s *ServiceException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (ServiceException) String added in v1.28.0

func (s ServiceException) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ThrottlingException added in v1.28.0

type ThrottlingException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"Message" type:"string"`
	// contains filtered or unexported fields
}

The requests were made too frequently and have been throttled. Wait a while and try again. To increase the limit on your request frequency, contact AWS Support.

func (*ThrottlingException) Code added in v1.28.0

func (s *ThrottlingException) Code() string

Code returns the exception type name.

func (*ThrottlingException) Error added in v1.28.0

func (s *ThrottlingException) Error() string

func (ThrottlingException) GoString added in v1.28.0

func (s ThrottlingException) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ThrottlingException) Message added in v1.28.0

func (s *ThrottlingException) Message() string

Message returns the exception's message.

func (*ThrottlingException) OrigErr added in v1.28.0

func (s *ThrottlingException) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*ThrottlingException) RequestID added in v1.28.0

func (s *ThrottlingException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*ThrottlingException) StatusCode added in v1.28.0

func (s *ThrottlingException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (ThrottlingException) String added in v1.28.0

func (s ThrottlingException) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

Directories

Path Synopsis
Package ec2instanceconnectiface provides an interface to enable mocking the AWS EC2 Instance Connect service client for testing your code.
Package ec2instanceconnectiface provides an interface to enable mocking the AWS EC2 Instance Connect service client for testing your code.

Jump to

Keyboard shortcuts

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