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.

New

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

func New(p client.ConfigProvider, cfgs ...*aws.Config) *EC2Metadata

New creates a new instance of the EC2Metadata client with a session. This client is safe to use across multiple goroutines.

Example:

// Create a EC2Metadata client from just a session. svc := ec2metadata.New(mySession) // Create a EC2Metadata client with additional configuration svc := ec2metadata.New(mySession, aws.NewConfig().WithLogLevel(aws.LogDebugHTTPBody))

p

Type: client.ConfigProvider

cfgs

Type: ...*aws.Config

EC2Metadata

Type: type EC2Metadata struct { *client.Client }

A EC2Metadata is an EC2 Metadata service Client.

On this page: