AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

NewClient

import "github.com/aws/aws-sdk-go/aws/ec2metadata"

func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string, opts ...func(*client.Client)) *EC2Metadata

NewClient returns a new EC2Metadata client. Should be used to create a client when not using a session. Generally using just New with a session is preferred.

If an unmodified HTTP client is provided from the stdlib default, or no client the EC2RoleProvider's EC2Metadata HTTP client's timeout will be shortened. To disable this set Config.EC2MetadataDisableTimeoutOverride to false. Enabled by default.

cfg

Type: aws.Config

handlers

Type: request.Handlers

endpoint

Type: string

signingRegion

Type: string

opts

Type: ...func(*client.Client)

EC2Metadata

Type: type EC2Metadata struct { *client.Client }

A EC2Metadata is an EC2 Metadata service Client.

On this page: