func (c *EC2Metadata) GetUserData() (string, error) {
	op := &request.Operation{
		Name:       "GetUserData",
		HTTPMethod: "GET",
		HTTPPath:   "/user-data",
	}
	output := &metadataOutput{}
	req := c.NewRequest(op, nil, output)
	err := req.Send()
	return output.Content, err
}
GetUserData returns the userdata that was configured for the service. If
there is no user-data setup for the EC2 instance a "NotFoundError" error
code will be returned.
package ec2metadata
import (
	"encoding/json"
	"fmt"
	"net/http"
	"strconv"
	"strings"
	"time"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/request"
	"github.com/aws/aws-sdk-go/internal/sdkuri"
)
func (c *EC2Metadata) getToken(duration time.Duration) (tokenOutput, error) {
	op := &request.Operation{
		Name:       "GetToken",
		HTTPMethod: "PUT",
		HTTPPath:   "/api/token",
	}
	var output tokenOutput
	req := c.NewRequest(op, nil, &output)
	req.Handlers.Sign.RemoveByName(fetchTokenHandlerName)
	req.Handlers.Unmarshal.Swap(unmarshalMetadataHandlerName, unmarshalTokenHandler)
	ttl := strconv.FormatInt(int64(duration/time.Second), 10)
	req.HTTPRequest.Header.Set(ttlHeader, ttl)
	err := req.Send()
	if err != nil {
		err = awserr.NewRequestFailure(
			awserr.New(req.HTTPResponse.Status, http.StatusText(req.HTTPResponse.StatusCode), err),
			req.HTTPResponse.StatusCode, req.RequestID)
	}
	return output, err
}
func (c *EC2Metadata) GetMetadata(p string) (string, error) {
	op := &request.Operation{
		Name:       "GetMetadata",
		HTTPMethod: "GET",
		HTTPPath:   sdkuri.PathJoin("/meta-data", p),
	}
	output := &metadataOutput{}
	req := c.NewRequest(op, nil, output)
	err := req.Send()
	return output.Content, err
}