From 8935e16c6aaea8083ed04f66ab74bcd2ca611c51 Mon Sep 17 00:00:00 2001 From: "Eric J. Holmes" Date: Thu, 11 Aug 2016 11:58:11 -0700 Subject: [PATCH 1/3] Update aws-sdk-go --- .../aws/aws-sdk-go/aws/awserr/error.go | 4 +- .../aws/aws-sdk-go/aws/awserr/types.go | 2 +- .../github.com/aws/aws-sdk-go/aws/config.go | 129 +- .../aws/corehandlers/param_validator_test.go | 4 +- .../ec2rolecreds/ec2_role_provider_test.go | 12 +- .../aws/credentials/static_provider.go | 11 +- .../stscreds/assume_role_provider.go | 161 ++ .../stscreds/assume_role_provider_test.go | 56 + .../aws/aws-sdk-go/aws/defaults/defaults.go | 8 +- .../aws-sdk-go/aws/defaults/defaults_test.go | 4 +- .../aws-sdk-go/aws/ec2metadata/api_test.go | 20 +- .../aws/ec2metadata/service_test.go | 13 +- .../aws-sdk-go/aws/request/handlers_test.go | 2 +- .../aws/request/http_request_retry_test.go | 4 +- .../aws/request/request_1_6_test.go | 2 +- .../aws/aws-sdk-go/aws/session/doc.go | 229 +++ .../aws/aws-sdk-go/aws/session/env_config.go | 188 ++ .../aws-sdk-go/aws/session/env_config_test.go | 276 +++ .../aws/aws-sdk-go/aws/session/session.go | 344 +++- .../aws-sdk-go/aws/session/session_test.go | 330 +++- .../aws-sdk-go/aws/session/shared_config.go | 294 +++ .../aws/session/shared_config_test.go | 264 +++ .../aws/session/testdata/shared_config | 60 + .../testdata/shared_config_invalid_ini | 1 + .../aws/session/testdata/shared_config_other | 17 + .../aws/aws-sdk-go/aws/signer/v4/v4.go | 2 +- .../aws/aws-sdk-go/aws/signer/v4/v4_test.go | 14 +- .../github.com/aws/aws-sdk-go/aws/version.go | 2 +- .../aws/aws-sdk-go/awstesting/assert.go | 51 +- .../aws/aws-sdk-go/awstesting/client.go | 22 - .../aws/aws-sdk-go/awstesting/mock/mock.go | 43 + .../aws/aws-sdk-go/awstesting/mock/server.go | 20 - .../aws/aws-sdk-go/awstesting/unit/unit.go | 4 +- .../aws-sdk-go/private/endpoints/endpoints.go | 19 +- .../private/endpoints/endpoints.json | 3 + .../private/endpoints/endpoints_map.go | 3 + .../private/endpoints/endpoints_test.go | 22 +- .../private/protocol/ec2query/build.go | 2 +- .../private/protocol/ec2query/build_test.go | 32 +- .../protocol/ec2query/unmarshal_test.go | 29 +- .../private/protocol/json/jsonutil/build.go | 2 +- .../private/protocol/jsonrpc/build_test.go | 44 +- .../private/protocol/jsonrpc/jsonrpc.go | 2 +- .../protocol/jsonrpc/unmarshal_test.go | 23 +- .../private/protocol/query/build.go | 2 +- .../private/protocol/query/build_test.go | 71 +- .../private/protocol/query/unmarshal_test.go | 47 +- .../private/protocol/restjson/build_test.go | 89 +- .../private/protocol/restjson/restjson.go | 2 +- .../protocol/restjson/unmarshal_test.go | 35 +- .../private/protocol/restxml/build_test.go | 113 +- .../private/protocol/restxml/restxml.go | 2 +- .../protocol/restxml/unmarshal_test.go | 41 +- .../private/protocol/xml/xmlutil/build.go | 2 +- .../aws-sdk-go/service/cloudformation/api.go | 100 +- .../service/cloudformation/examples_test.go | 192 +- .../aws/aws-sdk-go/service/cloudfront/api.go | 821 +++++++- .../service/cloudfront/examples_test.go | 563 +++++- .../aws-sdk-go/service/cloudfront/service.go | 8 +- .../aws-sdk-go/service/cloudwatchlogs/api.go | 142 +- .../service/cloudwatchlogs/examples_test.go | 201 +- .../service/cloudwatchlogs/service.go | 8 +- .../service/dynamodb/dynamodbattribute/doc.go | 9 +- .../dynamodb/dynamodbattribute/encode.go | 16 +- .../dynamodb/dynamodbattribute/encode_test.go | 20 + .../service/dynamodb/examples_test.go | 112 +- .../aws/aws-sdk-go/service/ec2/api.go | 87 +- .../aws-sdk-go/service/ec2/customizations.go | 6 +- .../aws-sdk-go/service/ec2/examples_test.go | 1658 ++++++++++++++--- .../aws/aws-sdk-go/service/ecr/api.go | 43 +- .../aws-sdk-go/service/ecr/examples_test.go | 137 +- .../aws/aws-sdk-go/service/ecs/api.go | 70 +- .../aws-sdk-go/service/ecs/examples_test.go | 217 ++- .../service/elastictranscoder/api.go | 467 +++-- .../elastictranscoder/examples_test.go | 142 +- .../aws/aws-sdk-go/service/elb/api.go | 371 ++-- .../aws-sdk-go/service/elb/examples_test.go | 228 ++- .../aws/aws-sdk-go/service/elb/service.go | 29 +- .../service/kinesis/examples_test.go | 136 +- .../service/route53/examples_test.go | 384 +++- .../service/route53/unmarshal_error.go | 2 +- .../aws/aws-sdk-go/service/s3/api.go | 2 +- .../aws-sdk-go/service/s3/examples_test.go | 472 ++++- .../service/s3/host_style_bucket.go | 8 + .../aws-sdk-go/service/s3/unmarshal_error.go | 36 +- .../service/s3/unmarshal_error_test.go | 38 +- .../aws-sdk-go/service/sns/examples_test.go | 240 ++- .../aws/aws-sdk-go/service/sqs/api_test.go | 4 +- .../aws-sdk-go/service/sqs/examples_test.go | 136 +- .../aws/aws-sdk-go/service/sts/api.go | 1653 ++++++++++++++++ .../aws-sdk-go/service/sts/customizations.go | 12 + .../service/sts/customizations_test.go | 39 + .../aws-sdk-go/service/sts/examples_test.go | 208 +++ .../aws/aws-sdk-go/service/sts/service.go | 130 ++ vendor/vendor.json | 268 +-- 95 files changed, 10732 insertions(+), 1861 deletions(-) create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/session/doc.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/session/env_config_test.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/session/shared_config_test.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config_invalid_ini create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config_other create mode 100644 vendor/github.com/aws/aws-sdk-go/awstesting/mock/mock.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/awstesting/mock/server.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/sts/api.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/sts/customizations_test.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/sts/examples_test.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/sts/service.go diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go b/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go index e50771f80..56fdfc2bf 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go @@ -44,7 +44,7 @@ type Error interface { // BatchError is a batch of errors which also wraps lower level errors with // code, message, and original errors. Calling Error() will include all errors -// that occured in the batch. +// that occurred in the batch. // // Deprecated: Replaced with BatchedErrors. Only defined for backwards // compatibility. @@ -64,7 +64,7 @@ type BatchError interface { // BatchedErrors is a batch of errors which also wraps lower level errors with // code, message, and original errors. Calling Error() will include all errors -// that occured in the batch. +// that occurred in the batch. // // Replaces BatchError type BatchedErrors interface { diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go b/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go index e2d333b84..0202a008f 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go @@ -98,7 +98,7 @@ func (b baseError) OrigErr() error { return NewBatchError(err.Code(), err.Message(), b.errs[1:]) } return NewBatchError("BatchedErrors", - "multiple errors occured", b.errs) + "multiple errors occurred", b.errs) } } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/config.go b/vendor/github.com/aws/aws-sdk-go/aws/config.go index da72935be..fca922584 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/config.go @@ -7,24 +7,36 @@ import ( "github.com/aws/aws-sdk-go/aws/credentials" ) -// UseServiceDefaultRetries instructs the config to use the service's own default -// number of retries. This will be the default action if Config.MaxRetries -// is nil also. +// UseServiceDefaultRetries instructs the config to use the service's own +// default number of retries. This will be the default action if +// Config.MaxRetries is nil also. const UseServiceDefaultRetries = -1 -// RequestRetryer is an alias for a type that implements the request.Retryer interface. +// RequestRetryer is an alias for a type that implements the request.Retryer +// interface. type RequestRetryer interface{} // A Config provides service configuration for service clients. By default, -// all clients will use the {defaults.DefaultConfig} structure. +// all clients will use the defaults.DefaultConfig tructure. +// +// // Create Session with MaxRetry configuration to be shared by multiple +// // service clients. +// sess, err := session.NewSession(&aws.Config{ +// MaxRetries: aws.Int(3), +// }) +// +// // Create S3 service client with a specific Region. +// svc := s3.New(sess, &aws.Config{ +// Region: aws.String("us-west-2"), +// }) type Config struct { // Enables verbose error printing of all credential chain errors. - // Should be used when wanting to see all errors while attempting to retreive - // credentials. + // Should be used when wanting to see all errors while attempting to + // retrieve credentials. CredentialsChainVerboseErrors *bool - // The credentials object to use when signing requests. Defaults to - // a chain of credential providers to search for credentials in environment + // The credentials object to use when signing requests. Defaults to a + // chain of credential providers to search for credentials in environment // variables, shared credential file, and EC2 Instance Roles. Credentials *credentials.Credentials @@ -63,11 +75,12 @@ type Config struct { Logger Logger // The maximum number of times that a request will be retried for failures. - // Defaults to -1, which defers the max retry setting to the service specific - // configuration. + // Defaults to -1, which defers the max retry setting to the service + // specific configuration. MaxRetries *int - // Retryer guides how HTTP requests should be retried in case of recoverable failures. + // Retryer guides how HTTP requests should be retried in case of + // recoverable failures. // // When nil or the value does not implement the request.Retryer interface, // the request.DefaultRetryer will be used. @@ -82,8 +95,8 @@ type Config struct { // Retryer RequestRetryer - // Disables semantic parameter validation, which validates input for missing - // required fields and/or other semantic request input errors. + // Disables semantic parameter validation, which validates input for + // missing required fields and/or other semantic request input errors. DisableParamValidation *bool // Disables the computation of request and response checksums, e.g., @@ -91,8 +104,8 @@ type Config struct { DisableComputeChecksums *bool // Set this to `true` to force the request to use path-style addressing, - // i.e., `http://s3.amazonaws.com/BUCKET/KEY`. By default, the S3 client will - // use virtual hosted bucket addressing when possible + // i.e., `http://s3.amazonaws.com/BUCKET/KEY`. By default, the S3 client + // will use virtual hosted bucket addressing when possible // (`http://BUCKET.s3.amazonaws.com/KEY`). // // @note This configuration option is specific to the Amazon S3 service. @@ -109,36 +122,63 @@ type Config struct { // http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html // // 100-Continue is only enabled for Go 1.6 and above. See `http.Transport`'s - // `ExpectContinueTimeout` for information on adjusting the continue wait timeout. - // https://golang.org/pkg/net/http/#Transport + // `ExpectContinueTimeout` for information on adjusting the continue wait + // timeout. https://golang.org/pkg/net/http/#Transport // - // You should use this flag to disble 100-Continue if you experiance issues - // with proxies or thrid party S3 compatible services. + // You should use this flag to disble 100-Continue if you experience issues + // with proxies or third party S3 compatible services. S3Disable100Continue *bool - // Set this to `true` to enable S3 Accelerate feature. For all operations compatible - // with S3 Accelerate will use the accelerate endpoint for requests. Requests not compatible - // will fall back to normal S3 requests. + // Set this to `true` to enable S3 Accelerate feature. For all operations + // compatible with S3 Accelerate will use the accelerate endpoint for + // requests. Requests not compatible will fall back to normal S3 requests. // - // The bucket must be enable for accelerate to be used with S3 client with accelerate - // enabled. If the bucket is not enabled for accelerate an error will be returned. - // The bucket name must be DNS compatible to also work with accelerate. + // The bucket must be enable for accelerate to be used with S3 client with + // accelerate enabled. If the bucket is not enabled for accelerate an error + // will be returned. The bucket name must be DNS compatible to also work + // with accelerate. + // + // Not compatible with UseDualStack requests will fail if both flags are + // specified. S3UseAccelerate *bool // Set this to `true` to disable the EC2Metadata client from overriding the - // default http.Client's Timeout. This is helpful if you do not want the EC2Metadata - // client to create a new http.Client. This options is only meaningful if you're not - // already using a custom HTTP client with the SDK. Enabled by default. + // default http.Client's Timeout. This is helpful if you do not want the + // EC2Metadata client to create a new http.Client. This options is only + // meaningful if you're not already using a custom HTTP client with the + // SDK. Enabled by default. // - // Must be set and provided to the session.New() in order to disable the EC2Metadata - // overriding the timeout for default credentials chain. + // Must be set and provided to the session.NewSession() in order to disable + // the EC2Metadata overriding the timeout for default credentials chain. // // Example: - // sess := session.New(aws.NewConfig().WithEC2MetadataDiableTimeoutOverride(true)) + // sess, err := session.NewSession(aws.NewConfig().WithEC2MetadataDiableTimeoutOverride(true)) + // // svc := s3.New(sess) // EC2MetadataDisableTimeoutOverride *bool + // Instructs the endpiont to be generated for a service client to + // be the dual stack endpoint. The dual stack endpoint will support + // both IPv4 and IPv6 addressing. + // + // Setting this for a service which does not support dual stack will fail + // to make requets. It is not recommended to set this value on the session + // as it will apply to all service clients created with the session. Even + // services which don't support dual stack endpoints. + // + // If the Endpoint config value is also provided the UseDualStack flag + // will be ignored. + // + // Only supported with. + // + // sess, err := session.NewSession() + // + // svc := s3.New(sess, &aws.Config{ + // UseDualStack: aws.Bool(true), + // }) + UseDualStack *bool + // SleepDelay is an override for the func the SDK will call when sleeping // during the lifecycle of a request. Specifically this will be used for // request delays. This value should only be used for testing. To adjust @@ -147,11 +187,19 @@ type Config struct { SleepDelay func(time.Duration) } -// NewConfig returns a new Config pointer that can be chained with builder methods to -// set multiple configuration values inline without using pointers. +// NewConfig returns a new Config pointer that can be chained with builder +// methods to set multiple configuration values inline without using pointers. // -// sess := session.New(aws.NewConfig().WithRegion("us-west-2").WithMaxRetries(10)) +// // Create Session with MaxRetry configuration to be shared by multiple +// // service clients. +// sess, err := session.NewSession(aws.NewConfig(). +// WithMaxRetries(3), +// ) // +// // Create S3 service client with a specific Region. +// svc := s3.New(sess, aws.NewConfig(). +// WithRegion("us-west-2"), +// ) func NewConfig() *Config { return &Config{} } @@ -254,6 +302,13 @@ func (c *Config) WithS3UseAccelerate(enable bool) *Config { return c } +// WithUseDualStack sets a config UseDualStack value returning a Config +// pointer for chaining. +func (c *Config) WithUseDualStack(enable bool) *Config { + c.UseDualStack = &enable + return c +} + // WithEC2MetadataDisableTimeoutOverride sets a config EC2MetadataDisableTimeoutOverride value // returning a Config pointer for chaining. func (c *Config) WithEC2MetadataDisableTimeoutOverride(enable bool) *Config { @@ -340,6 +395,10 @@ func mergeInConfig(dst *Config, other *Config) { dst.S3UseAccelerate = other.S3UseAccelerate } + if other.UseDualStack != nil { + dst.UseDualStack = other.UseDualStack + } + if other.EC2MetadataDisableTimeoutOverride != nil { dst.EC2MetadataDisableTimeoutOverride = other.EC2MetadataDisableTimeoutOverride } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go index fb50a0bd8..66973ca01 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go @@ -12,7 +12,7 @@ import ( "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/corehandlers" "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/service/kinesis" "github.com/stretchr/testify/require" ) @@ -242,7 +242,7 @@ func BenchmarkValidateAny(b *testing.B) { input.Records = append(input.Records, record) } - req, _ := kinesis.New(session.New()).PutRecordsRequest(input) + req, _ := kinesis.New(unit.Session).PutRecordsRequest(input) b.ResetTimer() for i := 0; i < b.N; i++ { diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go index da3d8ed3e..cccd4bffe 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go @@ -13,7 +13,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/awstesting/unit" ) const credsRespTmpl = `{ @@ -55,7 +55,7 @@ func TestEC2RoleProvider(t *testing.T) { defer server.Close() p := &ec2rolecreds.EC2RoleProvider{ - Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), + Client: ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), } creds, err := p.Retrieve() @@ -71,7 +71,7 @@ func TestEC2RoleProviderFailAssume(t *testing.T) { defer server.Close() p := &ec2rolecreds.EC2RoleProvider{ - Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), + Client: ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), } creds, err := p.Retrieve() @@ -92,7 +92,7 @@ func TestEC2RoleProviderIsExpired(t *testing.T) { defer server.Close() p := &ec2rolecreds.EC2RoleProvider{ - Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), + Client: ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), } p.CurrentTime = func() time.Time { return time.Date(2014, 12, 15, 21, 26, 0, 0, time.UTC) @@ -117,7 +117,7 @@ func TestEC2RoleProviderExpiryWindowIsExpired(t *testing.T) { defer server.Close() p := &ec2rolecreds.EC2RoleProvider{ - Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), + Client: ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), ExpiryWindow: time.Hour * 1, } p.CurrentTime = func() time.Time { @@ -143,7 +143,7 @@ func BenchmarkEC3RoleProvider(b *testing.B) { defer server.Close() p := &ec2rolecreds.EC2RoleProvider{ - Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), + Client: ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), } _, err := p.Retrieve() if err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go index 6f075604e..4f5dab3fc 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go @@ -30,13 +30,22 @@ func NewStaticCredentials(id, secret, token string) *Credentials { }}) } +// NewStaticCredentialsFromCreds returns a pointer to a new Credentials object +// wrapping the static credentials value provide. Same as NewStaticCredentials +// but takes the creds Value instead of individual fields +func NewStaticCredentialsFromCreds(creds Value) *Credentials { + return NewCredentials(&StaticProvider{Value: creds}) +} + // Retrieve returns the credentials or error if the credentials are invalid. func (s *StaticProvider) Retrieve() (Value, error) { if s.AccessKeyID == "" || s.SecretAccessKey == "" { return Value{ProviderName: StaticProviderName}, ErrStaticCredentialsEmpty } - s.Value.ProviderName = StaticProviderName + if len(s.Value.ProviderName) == 0 { + s.Value.ProviderName = StaticProviderName + } return s.Value, nil } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go new file mode 100644 index 000000000..30c847ae2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go @@ -0,0 +1,161 @@ +// Package stscreds are credential Providers to retrieve STS AWS credentials. +// +// STS provides multiple ways to retrieve credentials which can be used when making +// future AWS service API operation calls. +package stscreds + +import ( + "fmt" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/service/sts" +) + +// ProviderName provides a name of AssumeRole provider +const ProviderName = "AssumeRoleProvider" + +// AssumeRoler represents the minimal subset of the STS client API used by this provider. +type AssumeRoler interface { + AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) +} + +// DefaultDuration is the default amount of time in minutes that the credentials +// will be valid for. +var DefaultDuration = time.Duration(15) * time.Minute + +// AssumeRoleProvider retrieves temporary credentials from the STS service, and +// keeps track of their expiration time. This provider must be used explicitly, +// as it is not included in the credentials chain. +type AssumeRoleProvider struct { + credentials.Expiry + + // STS client to make assume role request with. + Client AssumeRoler + + // Role to be assumed. + RoleARN string + + // Session name, if you wish to reuse the credentials elsewhere. + RoleSessionName string + + // Expiry duration of the STS credentials. Defaults to 15 minutes if not set. + Duration time.Duration + + // Optional ExternalID to pass along, defaults to nil if not set. + ExternalID *string + + // The policy plain text must be 2048 bytes or shorter. However, an internal + // conversion compresses it into a packed binary format with a separate limit. + // The PackedPolicySize response element indicates by percentage how close to + // the upper size limit the policy is, with 100% equaling the maximum allowed + // size. + Policy *string + + // The identification number of the MFA device that is associated with the user + // who is making the AssumeRole call. Specify this value if the trust policy + // of the role being assumed includes a condition that requires MFA authentication. + // The value is either the serial number for a hardware device (such as GAHT12345678) + // or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user). + SerialNumber *string + + // The value provided by the MFA device, if the trust policy of the role being + // assumed requires MFA (that is, if the policy includes a condition that tests + // for MFA). If the role being assumed requires MFA and if the TokenCode value + // is missing or expired, the AssumeRole call returns an "access denied" error. + TokenCode *string + + // ExpiryWindow will allow the credentials to trigger refreshing prior to + // the credentials actually expiring. This is beneficial so race conditions + // with expiring credentials do not cause request to fail unexpectedly + // due to ExpiredTokenException exceptions. + // + // So a ExpiryWindow of 10s would cause calls to IsExpired() to return true + // 10 seconds before the credentials are actually expired. + // + // If ExpiryWindow is 0 or less it will be ignored. + ExpiryWindow time.Duration +} + +// NewCredentials returns a pointer to a new Credentials object wrapping the +// AssumeRoleProvider. The credentials will expire every 15 minutes and the +// role will be named after a nanosecond timestamp of this operation. +// +// Takes a Config provider to create the STS client. The ConfigProvider is +// satisfied by the session.Session type. +func NewCredentials(c client.ConfigProvider, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials { + p := &AssumeRoleProvider{ + Client: sts.New(c), + RoleARN: roleARN, + Duration: DefaultDuration, + } + + for _, option := range options { + option(p) + } + + return credentials.NewCredentials(p) +} + +// NewCredentialsWithClient returns a pointer to a new Credentials object wrapping the +// AssumeRoleProvider. The credentials will expire every 15 minutes and the +// role will be named after a nanosecond timestamp of this operation. +// +// Takes an AssumeRoler which can be satisfiede by the STS client. +func NewCredentialsWithClient(svc AssumeRoler, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials { + p := &AssumeRoleProvider{ + Client: svc, + RoleARN: roleARN, + Duration: DefaultDuration, + } + + for _, option := range options { + option(p) + } + + return credentials.NewCredentials(p) +} + +// Retrieve generates a new set of temporary credentials using STS. +func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) { + + // Apply defaults where parameters are not set. + if p.RoleSessionName == "" { + // Try to work out a role name that will hopefully end up unique. + p.RoleSessionName = fmt.Sprintf("%d", time.Now().UTC().UnixNano()) + } + if p.Duration == 0 { + // Expire as often as AWS permits. + p.Duration = DefaultDuration + } + input := &sts.AssumeRoleInput{ + DurationSeconds: aws.Int64(int64(p.Duration / time.Second)), + RoleArn: aws.String(p.RoleARN), + RoleSessionName: aws.String(p.RoleSessionName), + ExternalId: p.ExternalID, + } + if p.Policy != nil { + input.Policy = p.Policy + } + if p.SerialNumber != nil && p.TokenCode != nil { + input.SerialNumber = p.SerialNumber + input.TokenCode = p.TokenCode + } + roleOutput, err := p.Client.AssumeRole(input) + + if err != nil { + return credentials.Value{ProviderName: ProviderName}, err + } + + // We will proactively generate new credentials before they expire. + p.SetExpiration(*roleOutput.Credentials.Expiration, p.ExpiryWindow) + + return credentials.Value{ + AccessKeyID: *roleOutput.Credentials.AccessKeyId, + SecretAccessKey: *roleOutput.Credentials.SecretAccessKey, + SessionToken: *roleOutput.Credentials.SessionToken, + ProviderName: ProviderName, + }, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go new file mode 100644 index 000000000..6bd6e9197 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go @@ -0,0 +1,56 @@ +package stscreds + +import ( + "testing" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/sts" + "github.com/stretchr/testify/assert" +) + +type stubSTS struct { +} + +func (s *stubSTS) AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) { + expiry := time.Now().Add(60 * time.Minute) + return &sts.AssumeRoleOutput{ + Credentials: &sts.Credentials{ + // Just reflect the role arn to the provider. + AccessKeyId: input.RoleArn, + SecretAccessKey: aws.String("assumedSecretAccessKey"), + SessionToken: aws.String("assumedSessionToken"), + Expiration: &expiry, + }, + }, nil +} + +func TestAssumeRoleProvider(t *testing.T) { + stub := &stubSTS{} + p := &AssumeRoleProvider{ + Client: stub, + RoleARN: "roleARN", + } + + creds, err := p.Retrieve() + assert.Nil(t, err, "Expect no error") + + assert.Equal(t, "roleARN", creds.AccessKeyID, "Expect access key ID to be reflected role ARN") + assert.Equal(t, "assumedSecretAccessKey", creds.SecretAccessKey, "Expect secret access key to match") + assert.Equal(t, "assumedSessionToken", creds.SessionToken, "Expect session token to match") +} + +func BenchmarkAssumeRoleProvider(b *testing.B) { + stub := &stubSTS{} + p := &AssumeRoleProvider{ + Client: stub, + RoleARN: "roleARN", + } + + b.ResetTimer() + for i := 0; i < b.N; i++ { + if _, err := p.Retrieve(); err != nil { + b.Fatal(err) + } + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go index 570417ffa..10b7d8649 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go @@ -90,12 +90,14 @@ func CredChain(cfg *aws.Config, handlers request.Handlers) *credentials.Credenti Providers: []credentials.Provider{ &credentials.EnvProvider{}, &credentials.SharedCredentialsProvider{Filename: "", Profile: ""}, - remoteCredProvider(*cfg, handlers), + RemoteCredProvider(*cfg, handlers), }, }) } -func remoteCredProvider(cfg aws.Config, handlers request.Handlers) credentials.Provider { +// RemoteCredProvider returns a credenitials provider for the default remote +// endpoints such as EC2 or ECS Roles. +func RemoteCredProvider(cfg aws.Config, handlers request.Handlers) credentials.Provider { ecsCredURI := os.Getenv("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI") if len(ecsCredURI) > 0 { @@ -118,7 +120,7 @@ func ecsCredProvider(cfg aws.Config, handlers request.Handlers, uri string) cred func ec2RoleProvider(cfg aws.Config, handlers request.Handlers) credentials.Provider { endpoint, signingRegion := endpoints.EndpointForRegion(ec2metadata.ServiceName, - aws.StringValue(cfg.Region), true) + aws.StringValue(cfg.Region), true, false) return &ec2rolecreds.EC2RoleProvider{ Client: ec2metadata.NewClient(cfg, handlers, endpoint, signingRegion), diff --git a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults_test.go b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults_test.go index c7910eda0..68226743f 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults_test.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults_test.go @@ -16,7 +16,7 @@ func TestECSCredProvider(t *testing.T) { defer os.Clearenv() os.Setenv("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI", "/abc/123") - provider := remoteCredProvider(aws.Config{}, request.Handlers{}) + provider := RemoteCredProvider(aws.Config{}, request.Handlers{}) assert.NotNil(t, provider) @@ -29,7 +29,7 @@ func TestECSCredProvider(t *testing.T) { } func TestDefaultEC2RoleProvider(t *testing.T) { - provider := remoteCredProvider(aws.Config{}, request.Handlers{}) + provider := RemoteCredProvider(aws.Config{}, request.Handlers{}) assert.NotNil(t, provider) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go index 37b74fb0c..be813aae2 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go @@ -15,7 +15,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/ec2metadata" "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/awstesting/unit" ) const instanceIdentityDocument = `{ @@ -61,7 +61,7 @@ func initTestServer(path string, resp string) *httptest.Server { } func TestEndpoint(t *testing.T) { - c := ec2metadata.New(session.New()) + c := ec2metadata.New(unit.Session) op := &request.Operation{ Name: "GetMetadata", HTTPMethod: "GET", @@ -79,7 +79,7 @@ func TestGetMetadata(t *testing.T) { "success", // real response includes suffix ) defer server.Close() - c := ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) + c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) resp, err := c.GetMetadata("some/path") @@ -93,7 +93,7 @@ func TestGetRegion(t *testing.T) { "us-west-2a", // real response includes suffix ) defer server.Close() - c := ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) + c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) region, err := c.Region() @@ -107,7 +107,7 @@ func TestMetadataAvailable(t *testing.T) { "instance-id", ) defer server.Close() - c := ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) + c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) available := c.Available() @@ -120,7 +120,7 @@ func TestMetadataIAMInfo_success(t *testing.T) { validIamInfo, ) defer server.Close() - c := ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) + c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) iamInfo, err := c.IAMInfo() assert.NoError(t, err) @@ -135,7 +135,7 @@ func TestMetadataIAMInfo_failure(t *testing.T) { unsuccessfulIamInfo, ) defer server.Close() - c := ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) + c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) iamInfo, err := c.IAMInfo() assert.NotNil(t, err) @@ -145,7 +145,7 @@ func TestMetadataIAMInfo_failure(t *testing.T) { } func TestMetadataNotAvailable(t *testing.T) { - c := ec2metadata.New(session.New()) + c := ec2metadata.New(unit.Session) c.Handlers.Send.Clear() c.Handlers.Send.PushBack(func(r *request.Request) { r.HTTPResponse = &http.Response{ @@ -163,7 +163,7 @@ func TestMetadataNotAvailable(t *testing.T) { } func TestMetadataErrorResponse(t *testing.T) { - c := ec2metadata.New(session.New()) + c := ec2metadata.New(unit.Session) c.Handlers.Send.Clear() c.Handlers.Send.PushBack(func(r *request.Request) { r.HTTPResponse = &http.Response{ @@ -185,7 +185,7 @@ func TestEC2RoleProviderInstanceIdentity(t *testing.T) { instanceIdentityDocument, ) defer server.Close() - c := ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) + c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) doc, err := c.GetInstanceIdentityDocument() assert.Nil(t, err, "Expect no error, %v", err) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service_test.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service_test.go index d10ecb303..c2bc21587 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service_test.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service_test.go @@ -9,25 +9,24 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/stretchr/testify/assert" ) func TestClientOverrideDefaultHTTPClientTimeout(t *testing.T) { - svc := ec2metadata.New(session.New()) + svc := ec2metadata.New(unit.Session) assert.NotEqual(t, http.DefaultClient, svc.Config.HTTPClient) assert.Equal(t, 5*time.Second, svc.Config.HTTPClient.Timeout) } func TestClientNotOverrideDefaultHTTPClientTimeout(t *testing.T) { - origClient := *http.DefaultClient http.DefaultClient.Transport = &http.Transport{} defer func() { - http.DefaultClient = &origClient + http.DefaultClient.Transport = nil }() - svc := ec2metadata.New(session.New()) + svc := ec2metadata.New(unit.Session) assert.Equal(t, http.DefaultClient, svc.Config.HTTPClient) @@ -38,7 +37,7 @@ func TestClientNotOverrideDefaultHTTPClientTimeout(t *testing.T) { } func TestClientDisableOverrideDefaultHTTPClientTimeout(t *testing.T) { - svc := ec2metadata.New(session.New(aws.NewConfig().WithEC2MetadataDisableTimeoutOverride(true))) + svc := ec2metadata.New(unit.Session, aws.NewConfig().WithEC2MetadataDisableTimeoutOverride(true)) assert.Equal(t, http.DefaultClient, svc.Config.HTTPClient) } @@ -69,7 +68,7 @@ func runEC2MetadataClients(t *testing.T, cfg *aws.Config, atOnce int) { wg.Add(atOnce) for i := 0; i < atOnce; i++ { go func() { - svc := ec2metadata.New(session.New(), cfg) + svc := ec2metadata.New(unit.Session, cfg) _, err := svc.Region() assert.NoError(t, err) wg.Done() diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/handlers_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/handlers_test.go index f2062c3e0..b32a6510d 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/handlers_test.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/handlers_test.go @@ -79,7 +79,7 @@ func TestStopHandlers(t *testing.T) { called++ }}) l.PushBackNamed(request.NamedHandler{Name: "name3", Fn: func(r *request.Request) { - assert.Fail(t, "thrid handler should not be called") + assert.Fail(t, "third handler should not be called") }}) l.Run(&request.Request{}) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/http_request_retry_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/http_request_retry_test.go index 7e5e68c76..fc0f46fb2 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/http_request_retry_test.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/http_request_retry_test.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/awstesting/mock" "github.com/stretchr/testify/assert" ) @@ -17,7 +17,7 @@ func TestRequestCancelRetry(t *testing.T) { c := make(chan struct{}) reqNum := 0 - s := awstesting.NewMockClient(aws.NewConfig().WithMaxRetries(10)) + s := mock.NewMockClient(aws.NewConfig().WithMaxRetries(10)) s.Handlers.Validate.Clear() s.Handlers.Unmarshal.Clear() s.Handlers.UnmarshalMeta.Clear() diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_6_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_6_test.go index f72f6d457..afa0d9468 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_6_test.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_6_test.go @@ -18,7 +18,7 @@ import ( // go version 1.4 and 1.5 do not return an error. Version 1.5 will url encode // the uri while 1.4 will not func TestRequestInvalidEndpoint(t *testing.T) { - endpoint, _ := endpoints.NormalizeEndpoint("localhost:80 ", "test-service", "test-region", false) + endpoint, _ := endpoints.NormalizeEndpoint("localhost:80 ", "test-service", "test-region", false, false) r := request.New( aws.Config{}, metadata.ClientInfo{Endpoint: endpoint}, diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go new file mode 100644 index 000000000..4ad78d7f3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go @@ -0,0 +1,229 @@ +/* +Package session provides configuration for the SDK's service clients. + +Sessions can be shared across all service clients that share the same base +configuration. The Session is built from the SDK's default configuration and +request handlers. + +Sessions should be cached when possible, because creating a new Session will +load all configuration values from the environment, and config files each time +the Session is created. Sharing the Session value across all of your service +clients will ensure the configuration is loaded the fewest number of times possible. + +Concurrency + +Sessions are safe to use concurrently as long as the Session is not being +modified. The SDK will not modify the Session once the Session has been created. +Creating service clients concurrently from a shared Session is safe. + +Sessions from Shared Config + +Sessions can be created using the method above that will only load the +additional config if the AWS_SDK_LOAD_CONFIG environment variable is set. +Alternatively you can explicitly create a Session with shared config enabled. +To do this you can use NewSessionWithOptions to configure how the Session will +be created. Using the NewSessionWithOptions with SharedConfigState set to +SharedConfigEnabled will create the session as if the AWS_SDK_LOAD_CONFIG +environment variable was set. + +Creating Sessions + +When creating Sessions optional aws.Config values can be passed in that will +override the default, or loaded config values the Session is being created +with. This allows you to provide additional, or case based, configuration +as needed. + +By default NewSession will only load credentials from the shared credentials +file (~/.aws/credentials). If the AWS_SDK_LOAD_CONFIG environment variable is +set to a truthy value the Session will be created from the configuration +values from the shared config (~/.aws/config) and shared credentials +(~/.aws/credentials) files. See the section Sessions from Shared Config for +more information. + +Create a Session with the default config and request handlers. With credentials +region, and profile loaded from the environment and shared config automatically. +Requires the AWS_PROFILE to be set, or "default" is used. + + // Create Session + sess, err := session.NewSession() + + // Create a Session with a custom region + sess, err := session.NewSession(&aws.Config{Region: aws.String("us-east-1")}) + + // Create a S3 client instance from a session + sess, err := session.NewSession() + if err != nil { + // Handle Session creation error + } + svc := s3.New(sess) + +Create Session With Option Overrides + +In addition to NewSession, Sessions can be created using NewSessionWithOptions. +This func allows you to control and override how the Session will be created +through code instead of being driven by environment variables only. + +Use NewSessionWithOptions when you want to provide the config profile, or +override the shared config state (AWS_SDK_LOAD_CONFIG). + + // Equivalent to session.New + sess, err := session.NewSessionWithOptions(session.Options{}) + + // Specify profile to load for the session's config + sess, err := session.NewSessionWithOptions(session.Options{ + Profile: "profile_name", + }) + + // Specify profile for config and region for requests + sess, err := session.NewSessionWithOptions(session.Options{ + Config: aws.Config{Region: aws.String("us-east-1")}, + Profile: "profile_name", + }) + + // Force enable Shared Config support + sess, err := session.NewSessionWithOptions(session.Options{ + SharedConfigState: SharedConfigEnable, + }) + +Deprecated "New" function + +The New session function has been deprecated because it does not provide good +way to return errors that occur when loading the configuration files and values. +Because of this, the NewWithError + +Adding Handlers + +You can add handlers to a session for processing HTTP requests. All service +clients that use the session inherit the handlers. For example, the following +handler logs every request and its payload made by a service client: + + // Create a session, and add additional handlers for all service + // clients created with the Session to inherit. Adds logging handler. + sess, err := session.NewSession() + sess.Handlers.Send.PushFront(func(r *request.Request) { + // Log every request made and its payload + logger.Println("Request: %s/%s, Payload: %s", + r.ClientInfo.ServiceName, r.Operation, r.Params) + }) + +Deprecated "New" function + +The New session function has been deprecated because it does not provide good +way to return errors that occur when loading the configuration files and values. +Because of this, NewSession was created so errors can be retrieved when +creating a session fails. + +Shared Config Fields + +By default the SDK will only load the shared credentials file's (~/.aws/credentials) +credentials values, and all other config is provided by the environment variables, +SDK defaults, and user provided aws.Config values. + +If the AWS_SDK_LOAD_CONFIG environment variable is set, or SharedConfigEnable +option is used to create the Session the full shared config values will be +loaded. This includes credentials, region, and support for assume role. In +addition the Session will load its configuration from both the shared config +file (~/.aws/config) and shared credentials file (~/.aws/credentials). Both +files have the same format. + +If both config files are present the configuration from both files will be +read. The Session will be created from configuration values from the shared +credentials file (~/.aws/credentials) over those in the shared credentials +file (~/.aws/config). + +Credentials are the values the SDK should use for authenticating requests with +AWS Services. They arfrom a configuration file will need to include both +aws_access_key_id and aws_secret_access_key must be provided together in the +same file to be considered valid. The values will be ignored if not a complete +group. aws_session_token is an optional field that can be provided if both of +the other two fields are also provided. + + aws_access_key_id = AKID + aws_secret_access_key = SECRET + aws_session_token = TOKEN + +Assume Role values allow you to configure the SDK to assume an IAM role using +a set of credentials provided in a config file via the source_profile field. +Both "role_arn" and "source_profile" are required. The SDK does not support +assuming a role with MFA token Via the Session's constructor. You can use the +stscreds.AssumeRoleProvider credentials provider to specify custom +configuration and support for MFA. + + role_arn = arn:aws:iam:::role/ + source_profile = profile_with_creds + external_id = 1234 + mfa_serial = not supported! + role_session_name = session_name + +Region is the region the SDK should use for looking up AWS service endpoints +and signing requests. + + region = us-east-1 + +Environment Variables + +When a Session is created several environment variables can be set to adjust +how the SDK functions, and what configuration data it loads when creating +Sessions. All environment values are optional, but some values like credentials +require multiple of the values to set or the partial values will be ignored. +All environment variable values are strings unless otherwise noted. + +Environment configuration values. If set both Access Key ID and Secret Access +Key must be provided. Session Token and optionally also be provided, but is +not required. + + # Access Key ID + AWS_ACCESS_KEY_ID=AKID + AWS_ACCESS_KEY=AKID # only read if AWS_ACCESS_KEY_ID is not set. + + # Secret Access Key + AWS_SECRET_ACCESS_KEY=SECRET + AWS_SECRET_KEY=SECRET=SECRET # only read if AWS_SECRET_ACCESS_KEY is not set. + + # Session Token + AWS_SESSION_TOKEN=TOKEN + +Region value will instruct the SDK where to make service API requests to. If is +not provided in the environment the region must be provided before a service +client request is made. + + AWS_REGION=us-east-1 + + # AWS_DEFAULT_REGION is only read if AWS_SDK_LOAD_CONFIG is also set, + # and AWS_REGION is not also set. + AWS_DEFAULT_REGION=us-east-1 + +Profile name the SDK should load use when loading shared config from the +configuration files. If not provided "default" will be used as the profile name. + + AWS_PROFILE=my_profile + + # AWS_DEFAULT_PROFILE is only read if AWS_SDK_LOAD_CONFIG is also set, + # and AWS_PROFILE is not also set. + AWS_DEFAULT_PROFILE=my_profile + +SDK load config instructs the SDK to load the shared config in addition to +shared credentials. This also expands the configuration loaded so the shared +credentials will have parity with the shared config file. This also enables +Region and Profile support for the AWS_DEFAULT_REGION and AWS_DEFAULT_PROFILE +env values as well. + + AWS_SDK_LOAD_CONFIG=1 + +Shared credentials file path can be set to instruct the SDK to use an alternative +file for the shared credentials. If not set the file will be loaded from +$HOME/.aws/credentials on Linux/Unix based systems, and +%USERPROFILE%\.aws\credentials on Windows. + + AWS_SHARED_CREDENTIALS_FILE=$HOME/my_shared_credentials + +Shared config file path can be set to instruct the SDK to use an alternative +file for the shared config. If not set the file will be loaded from +$HOME/.aws/config on Linux/Unix based systems, and +%USERPROFILE%\.aws\config on Windows. + + AWS_CONFIG_FILE=$HOME/my_shared_config + + +*/ +package session diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go new file mode 100644 index 000000000..d2f0c8448 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go @@ -0,0 +1,188 @@ +package session + +import ( + "os" + "path/filepath" + "strconv" + + "github.com/aws/aws-sdk-go/aws/credentials" +) + +// envConfig is a collection of environment values the SDK will read +// setup config from. All environment values are optional. But some values +// such as credentials require multiple values to be complete or the values +// will be ignored. +type envConfig struct { + // Environment configuration values. If set both Access Key ID and Secret Access + // Key must be provided. Session Token and optionally also be provided, but is + // not required. + // + // # Access Key ID + // AWS_ACCESS_KEY_ID=AKID + // AWS_ACCESS_KEY=AKID # only read if AWS_ACCESS_KEY_ID is not set. + // + // # Secret Access Key + // AWS_SECRET_ACCESS_KEY=SECRET + // AWS_SECRET_KEY=SECRET=SECRET # only read if AWS_SECRET_ACCESS_KEY is not set. + // + // # Session Token + // AWS_SESSION_TOKEN=TOKEN + Creds credentials.Value + + // Region value will instruct the SDK where to make service API requests to. If is + // not provided in the environment the region must be provided before a service + // client request is made. + // + // AWS_REGION=us-east-1 + // + // # AWS_DEFAULT_REGION is only read if AWS_SDK_LOAD_CONFIG is also set, + // # and AWS_REGION is not also set. + // AWS_DEFAULT_REGION=us-east-1 + Region string + + // Profile name the SDK should load use when loading shared configuration from the + // shared configuration files. If not provided "default" will be used as the + // profile name. + // + // AWS_PROFILE=my_profile + // + // # AWS_DEFAULT_PROFILE is only read if AWS_SDK_LOAD_CONFIG is also set, + // # and AWS_PROFILE is not also set. + // AWS_DEFAULT_PROFILE=my_profile + Profile string + + // SDK load config instructs the SDK to load the shared config in addition to + // shared credentials. This also expands the configuration loaded from the shared + // credentials to have parity with the shared config file. This also enables + // Region and Profile support for the AWS_DEFAULT_REGION and AWS_DEFAULT_PROFILE + // env values as well. + // + // AWS_SDK_LOAD_CONFIG=1 + EnableSharedConfig bool + + // Shared credentials file path can be set to instruct the SDK to use an alternate + // file for the shared credentials. If not set the file will be loaded from + // $HOME/.aws/credentials on Linux/Unix based systems, and + // %USERPROFILE%\.aws\credentials on Windows. + // + // AWS_SHARED_CREDENTIALS_FILE=$HOME/my_shared_credentials + SharedCredentialsFile string + + // Shared config file path can be set to instruct the SDK to use an alternate + // file for the shared config. If not set the file will be loaded from + // $HOME/.aws/config on Linux/Unix based systems, and + // %USERPROFILE%\.aws\config on Windows. + // + // AWS_CONFIG_FILE=$HOME/my_shared_config + SharedConfigFile string +} + +var ( + credAccessEnvKey = []string{ + "AWS_ACCESS_KEY_ID", + "AWS_ACCESS_KEY", + } + credSecretEnvKey = []string{ + "AWS_SECRET_ACCESS_KEY", + "AWS_SECRET_KEY", + } + credSessionEnvKey = []string{ + "AWS_SESSION_TOKEN", + } + + regionEnvKeys = []string{ + "AWS_REGION", + "AWS_DEFAULT_REGION", // Only read if AWS_SDK_LOAD_CONFIG is also set + } + profileEnvKeys = []string{ + "AWS_PROFILE", + "AWS_DEFAULT_PROFILE", // Only read if AWS_SDK_LOAD_CONFIG is also set + } +) + +// loadEnvConfig retrieves the SDK's environment configuration. +// See `envConfig` for the values that will be retrieved. +// +// If the environment variable `AWS_SDK_LOAD_CONFIG` is set to a truthy value +// the shared SDK config will be loaded in addition to the SDK's specific +// configuration values. +func loadEnvConfig() envConfig { + enableSharedConfig, _ := strconv.ParseBool(os.Getenv("AWS_SDK_LOAD_CONFIG")) + return envConfigLoad(enableSharedConfig) +} + +// loadEnvSharedConfig retrieves the SDK's environment configuration, and the +// SDK shared config. See `envConfig` for the values that will be retrieved. +// +// Loads the shared configuration in addition to the SDK's specific configuration. +// This will load the same values as `loadEnvConfig` if the `AWS_SDK_LOAD_CONFIG` +// environment variable is set. +func loadSharedEnvConfig() envConfig { + return envConfigLoad(true) +} + +func envConfigLoad(enableSharedConfig bool) envConfig { + cfg := envConfig{} + + cfg.EnableSharedConfig = enableSharedConfig + + setFromEnvVal(&cfg.Creds.AccessKeyID, credAccessEnvKey) + setFromEnvVal(&cfg.Creds.SecretAccessKey, credSecretEnvKey) + setFromEnvVal(&cfg.Creds.SessionToken, credSessionEnvKey) + + // Require logical grouping of credentials + if len(cfg.Creds.AccessKeyID) == 0 || len(cfg.Creds.SecretAccessKey) == 0 { + cfg.Creds = credentials.Value{} + } else { + cfg.Creds.ProviderName = "EnvConfigCredentials" + } + + regionKeys := regionEnvKeys + profileKeys := profileEnvKeys + if !cfg.EnableSharedConfig { + regionKeys = regionKeys[:1] + profileKeys = profileKeys[:1] + } + + setFromEnvVal(&cfg.Region, regionKeys) + setFromEnvVal(&cfg.Profile, profileKeys) + + cfg.SharedCredentialsFile = sharedCredentialsFilename() + cfg.SharedConfigFile = sharedConfigFilename() + + return cfg +} + +func setFromEnvVal(dst *string, keys []string) { + for _, k := range keys { + if v := os.Getenv(k); len(v) > 0 { + *dst = v + break + } + } +} + +func sharedCredentialsFilename() string { + if name := os.Getenv("AWS_SHARED_CREDENTIALS_FILE"); len(name) > 0 { + return name + } + + return filepath.Join(userHomeDir(), ".aws", "credentials") +} + +func sharedConfigFilename() string { + if name := os.Getenv("AWS_CONFIG_FILE"); len(name) > 0 { + return name + } + + return filepath.Join(userHomeDir(), ".aws", "config") +} + +func userHomeDir() string { + homeDir := os.Getenv("HOME") // *nix + if len(homeDir) == 0 { // windows + homeDir = os.Getenv("USERPROFILE") + } + + return homeDir +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config_test.go b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config_test.go new file mode 100644 index 000000000..5a6aa7d87 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config_test.go @@ -0,0 +1,276 @@ +package session + +import ( + "os" + "path/filepath" + "strings" + "testing" + + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/stretchr/testify/assert" +) + +func TestLoadEnvConfig_Creds(t *testing.T) { + env := stashEnv() + defer popEnv(env) + + cases := []struct { + Env map[string]string + Val credentials.Value + }{ + { + Env: map[string]string{ + "AWS_ACCESS_KEY": "AKID", + }, + Val: credentials.Value{}, + }, + { + Env: map[string]string{ + "AWS_ACCESS_KEY_ID": "AKID", + }, + Val: credentials.Value{}, + }, + { + Env: map[string]string{ + "AWS_SECRET_KEY": "SECRET", + }, + Val: credentials.Value{}, + }, + { + Env: map[string]string{ + "AWS_SECRET_ACCESS_KEY": "SECRET", + }, + Val: credentials.Value{}, + }, + { + Env: map[string]string{ + "AWS_ACCESS_KEY_ID": "AKID", + "AWS_SECRET_ACCESS_KEY": "SECRET", + }, + Val: credentials.Value{ + AccessKeyID: "AKID", SecretAccessKey: "SECRET", + ProviderName: "EnvConfigCredentials", + }, + }, + { + Env: map[string]string{ + "AWS_ACCESS_KEY": "AKID", + "AWS_SECRET_KEY": "SECRET", + }, + Val: credentials.Value{ + AccessKeyID: "AKID", SecretAccessKey: "SECRET", + ProviderName: "EnvConfigCredentials", + }, + }, + { + Env: map[string]string{ + "AWS_ACCESS_KEY": "AKID", + "AWS_SECRET_KEY": "SECRET", + "AWS_SESSION_TOKEN": "TOKEN", + }, + Val: credentials.Value{ + AccessKeyID: "AKID", SecretAccessKey: "SECRET", SessionToken: "TOKEN", + ProviderName: "EnvConfigCredentials", + }, + }, + } + + for _, c := range cases { + os.Clearenv() + + for k, v := range c.Env { + os.Setenv(k, v) + } + + cfg := loadEnvConfig() + assert.Equal(t, c.Val, cfg.Creds) + } +} + +func TestLoadEnvConfig(t *testing.T) { + env := stashEnv() + defer popEnv(env) + + cases := []struct { + Env map[string]string + Region, Profile string + UseSharedConfigCall bool + }{ + { + Env: map[string]string{ + "AWS_REGION": "region", + "AWS_PROFILE": "profile", + }, + Region: "region", Profile: "profile", + }, + { + Env: map[string]string{ + "AWS_REGION": "region", + "AWS_DEFAULT_REGION": "default_region", + "AWS_PROFILE": "profile", + "AWS_DEFAULT_PROFILE": "default_profile", + }, + Region: "region", Profile: "profile", + }, + { + Env: map[string]string{ + "AWS_REGION": "region", + "AWS_DEFAULT_REGION": "default_region", + "AWS_PROFILE": "profile", + "AWS_DEFAULT_PROFILE": "default_profile", + "AWS_SDK_LOAD_CONFIG": "1", + }, + Region: "region", Profile: "profile", + }, + { + Env: map[string]string{ + "AWS_DEFAULT_REGION": "default_region", + "AWS_DEFAULT_PROFILE": "default_profile", + }, + }, + { + Env: map[string]string{ + "AWS_DEFAULT_REGION": "default_region", + "AWS_DEFAULT_PROFILE": "default_profile", + "AWS_SDK_LOAD_CONFIG": "1", + }, + Region: "default_region", Profile: "default_profile", + }, + { + Env: map[string]string{ + "AWS_REGION": "region", + "AWS_PROFILE": "profile", + }, + Region: "region", Profile: "profile", + UseSharedConfigCall: true, + }, + { + Env: map[string]string{ + "AWS_REGION": "region", + "AWS_DEFAULT_REGION": "default_region", + "AWS_PROFILE": "profile", + "AWS_DEFAULT_PROFILE": "default_profile", + }, + Region: "region", Profile: "profile", + UseSharedConfigCall: true, + }, + { + Env: map[string]string{ + "AWS_REGION": "region", + "AWS_DEFAULT_REGION": "default_region", + "AWS_PROFILE": "profile", + "AWS_DEFAULT_PROFILE": "default_profile", + "AWS_SDK_LOAD_CONFIG": "1", + }, + Region: "region", Profile: "profile", + UseSharedConfigCall: true, + }, + { + Env: map[string]string{ + "AWS_DEFAULT_REGION": "default_region", + "AWS_DEFAULT_PROFILE": "default_profile", + }, + Region: "default_region", Profile: "default_profile", + UseSharedConfigCall: true, + }, + { + Env: map[string]string{ + "AWS_DEFAULT_REGION": "default_region", + "AWS_DEFAULT_PROFILE": "default_profile", + "AWS_SDK_LOAD_CONFIG": "1", + }, + Region: "default_region", Profile: "default_profile", + UseSharedConfigCall: true, + }, + } + + for _, c := range cases { + os.Clearenv() + + for k, v := range c.Env { + os.Setenv(k, v) + } + + var cfg envConfig + if c.UseSharedConfigCall { + cfg = loadSharedEnvConfig() + } else { + cfg = loadEnvConfig() + } + + assert.Equal(t, c.Region, cfg.Region) + assert.Equal(t, c.Profile, cfg.Profile) + } +} + +func TestSharedCredsFilename(t *testing.T) { + env := stashEnv() + defer popEnv(env) + + os.Setenv("USERPROFILE", "profile_dir") + expect := filepath.Join("profile_dir", ".aws", "credentials") + name := sharedCredentialsFilename() + assert.Equal(t, expect, name) + + os.Setenv("HOME", "home_dir") + expect = filepath.Join("home_dir", ".aws", "credentials") + name = sharedCredentialsFilename() + assert.Equal(t, expect, name) + + expect = filepath.Join("path/to/credentials/file") + os.Setenv("AWS_SHARED_CREDENTIALS_FILE", expect) + name = sharedCredentialsFilename() + assert.Equal(t, expect, name) +} + +func TestSharedConfigFilename(t *testing.T) { + env := stashEnv() + defer popEnv(env) + + os.Setenv("USERPROFILE", "profile_dir") + expect := filepath.Join("profile_dir", ".aws", "config") + name := sharedConfigFilename() + assert.Equal(t, expect, name) + + os.Setenv("HOME", "home_dir") + expect = filepath.Join("home_dir", ".aws", "config") + name = sharedConfigFilename() + assert.Equal(t, expect, name) + + expect = filepath.Join("path/to/config/file") + os.Setenv("AWS_CONFIG_FILE", expect) + name = sharedConfigFilename() + assert.Equal(t, expect, name) +} + +func TestSetEnvValue(t *testing.T) { + env := stashEnv() + defer popEnv(env) + + os.Setenv("empty_key", "") + os.Setenv("second_key", "2") + os.Setenv("third_key", "3") + + var dst string + setFromEnvVal(&dst, []string{ + "empty_key", "first_key", "second_key", "third_key", + }) + + assert.Equal(t, "2", dst) +} + +func stashEnv() []string { + env := os.Environ() + os.Clearenv() + + return env +} + +func popEnv(env []string) { + os.Clearenv() + + for _, e := range env { + p := strings.SplitN(e, "=", 2) + os.Setenv(p[0], p[1]) + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go index 6bc8f1be9..2374b1f27 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go @@ -1,17 +1,14 @@ -// Package session provides a way to create service clients with shared configuration -// and handlers. -// -// Generally this package should be used instead of the `defaults` package. -// -// A session should be used to share configurations and request handlers between multiple -// service clients. When service clients need specific configuration aws.Config can be -// used to provide additional configuration directly to the service client. package session import ( + "fmt" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/corehandlers" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/credentials/stscreds" "github.com/aws/aws-sdk-go/aws/defaults" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/endpoints" @@ -21,36 +18,199 @@ import ( // store configurations and request handlers for those services. // // Sessions are safe to create service clients concurrently, but it is not safe -// to mutate the session concurrently. +// to mutate the Session concurrently. +// +// The Session satisfies the service client's client.ClientConfigProvider. type Session struct { Config *aws.Config Handlers request.Handlers } -// New creates a new instance of the handlers merging in the provided Configs -// on top of the SDK's default configurations. Once the session is created it -// can be mutated to modify Configs or Handlers. The session is safe to be read -// concurrently, but it should not be written to concurrently. +// New creates a new instance of the handlers merging in the provided configs +// on top of the SDK's default configurations. Once the Session is created it +// can be mutated to modify the Config or Handlers. The Session is safe to be +// read concurrently, but it should not be written to concurrently. +// +// If the AWS_SDK_LOAD_CONFIG environment is set to a truthy value, the New +// method could now encounter an error when loading the configuration. When +// The environment variable is set, and an error occurs, New will return a +// session that will fail all requests reporting the error that occured while +// loading the session. Use NewSession to get the error when creating the +// session. +// +// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value +// the shared config file (~/.aws/config) will also be loaded, in addition to +// the shared credentials file (~/.aws/config). Values set in both the +// shared config, and shared credentials will be taken from the shared +// credentials file. +// +// Deprecated: Use NewSession functiions to create sessions instead. NewSession +// has the same functionality as New except an error can be returned when the +// func is called instead of waiting to receive an error until a request is made. +func New(cfgs ...*aws.Config) *Session { + // load initial config from environment + envCfg := loadEnvConfig() + + if envCfg.EnableSharedConfig { + s, err := newSession(envCfg, cfgs...) + if err != nil { + // Old session.New expected all errors to be discovered when + // a request is made, and would report the errors then. This + // needs to be replicated if an error occurs while creating + // the session. + msg := "failed to create session with AWS_SDK_LOAD_CONFIG enabled. " + + "Use session.NewSession to handle errors occuring during session creation." + + // Session creation failed, need to report the error and prevent + // any requests from succeeding. + s = &Session{Config: defaults.Config()} + s.Config.MergeIn(cfgs...) + s.Config.Logger.Log("ERROR:", msg, "Error:", err) + s.Handlers.Validate.PushBack(func(r *request.Request) { + r.Error = err + }) + } + return s + } + + return oldNewSession(cfgs...) +} + +// NewSession returns a new Session created from SDK defaults, config files, +// environment, and user provided config files. Once the Session is created +// it can be mutated to modify the Config or Handlers. The Session is safe to +// be read concurrently, but it should not be written to concurrently. +// +// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value +// the shared config file (~/.aws/config) will also be loaded in addition to +// the shared credentials file (~/.aws/config). Values set in both the +// shared config, and shared credentials will be taken from the shared +// credentials file. Enabling the Shared Config will also allow the Session +// to be built with retrieving credentials with AssumeRole set in the config. +// +// See the NewSessionWithOptions func for information on how to override or +// control through code how the Session will be created. Such as specifing the +// config profile, and controlling if shared config is enabled or not. +func NewSession(cfgs ...*aws.Config) (*Session, error) { + envCfg := loadEnvConfig() + + return newSession(envCfg, cfgs...) +} + +// SharedConfigState provides the ability to optionally override the state +// of the session's creation based on the shared config being enabled or +// disabled. +type SharedConfigState int + +const ( + // SharedConfigStateFromEnv does not override any state of the + // AWS_SDK_LOAD_CONFIG env var. It is the default value of the + // SharedConfigState type. + SharedConfigStateFromEnv SharedConfigState = iota + + // SharedConfigDisable overrides the AWS_SDK_LOAD_CONFIG env var value + // and disables the shared config functionality. + SharedConfigDisable + + // SharedConfigEnable overrides the AWS_SDK_LOAD_CONFIG env var value + // and enables the shared config functionality. + SharedConfigEnable +) + +// Options provides the means to control how a Session is created and what +// configuration values will be loaded. +// +type Options struct { + // Provides config values for the SDK to use when creating service clients + // and making API requests to services. Any value set in with this field + // will override the associated value provided by the SDK defaults, + // environment or config files where relevent. + // + // If not set, configuration values from from SDK defaults, environment, + // config will be used. + Config aws.Config + + // Overrides the config profile the Session should be created from. If not + // set the value of the environment variable will be loaded (AWS_PROFILE, + // or AWS_DEFAULT_PROFILE if the Shared Config is enabled). + // + // If not set and environment variables are not set the "default" + // (DefaultSharedConfigProfile) will be used as the profile to load the + // session config from. + Profile string + + // Instructs how the Session will be created based on the AWS_SDK_LOAD_CONFIG + // environment variable. By default a Session will be created using the + // value provided by the AWS_SDK_LOAD_CONFIG environment variable. + // + // Setting this value to SharedConfigEnable or SharedConfigDisable + // will allow you to override the AWS_SDK_LOAD_CONFIG environment variable + // and enable or disable the shared config functionality. + SharedConfigState SharedConfigState +} + +// NewSessionWithOptions returns a new Session created from SDK defaults, config files, +// environment, and user provided config files. This func uses the Options +// values to configure how the Session is created. // -// Example: -// // Create a session with the default config and request handlers. -// sess := session.New() +// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value +// the shared config file (~/.aws/config) will also be loaded in addition to +// the shared credentials file (~/.aws/config). Values set in both the +// shared config, and shared credentials will be taken from the shared +// credentials file. Enabling the Shared Config will also allow the Session +// to be built with retrieving credentials with AssumeRole set in the config. // -// // Create a session with a custom region -// sess := session.New(&aws.Config{Region: aws.String("us-east-1")}) +// // Equivalent to session.New +// sess, err := session.NewSessionWithOptions(session.Options{}) // -// // Create a session, and add additional handlers for all service -// // clients created with the session to inherit. Adds logging handler. -// sess := session.New() -// sess.Handlers.Send.PushFront(func(r *request.Request) { -// // Log every request made and its payload -// logger.Println("Request: %s/%s, Payload: %s", r.ClientInfo.ServiceName, r.Operation, r.Params) +// // Specify profile to load for the session's config +// sess, err := session.NewSessionWithOptions(session.Options{ +// Profile: "profile_name", // }) // -// // Create a S3 client instance from a session -// sess := session.New() -// svc := s3.New(sess) -func New(cfgs ...*aws.Config) *Session { +// // Specify profile for config and region for requests +// sess, err := session.NewSessionWithOptions(session.Options{ +// Config: aws.Config{Region: aws.String("us-east-1")}, +// Profile: "profile_name", +// }) +// +// // Force enable Shared Config support +// sess, err := session.NewSessionWithOptions(session.Options{ +// SharedConfigState: SharedConfigEnable, +// }) +func NewSessionWithOptions(opts Options) (*Session, error) { + envCfg := loadEnvConfig() + + if len(opts.Profile) > 0 { + envCfg.Profile = opts.Profile + } + + switch opts.SharedConfigState { + case SharedConfigDisable: + envCfg.EnableSharedConfig = false + case SharedConfigEnable: + envCfg.EnableSharedConfig = true + } + + return newSession(envCfg, &opts.Config) +} + +// Must is a helper function to ensure the Session is valid and there was no +// error when calling a NewSession function. +// +// This helper is intended to be used in variable initialization to load the +// Session and configuration at startup. Such as: +// +// var sess = session.Must(session.NewSession()) +func Must(sess *Session, err error) *Session { + if err != nil { + panic(err) + } + + return sess +} + +func oldNewSession(cfgs ...*aws.Config) *Session { cfg := defaults.Config() handlers := defaults.Handlers() @@ -72,6 +232,115 @@ func New(cfgs ...*aws.Config) *Session { return s } +func newSession(envCfg envConfig, cfgs ...*aws.Config) (*Session, error) { + cfg := defaults.Config() + handlers := defaults.Handlers() + + // Get a merged version of the user provided config to determine if + // credentials were. + userCfg := &aws.Config{} + userCfg.MergeIn(cfgs...) + + // Order config files will be loaded in with later files overwriting + // previous config file values. + cfgFiles := []string{envCfg.SharedConfigFile, envCfg.SharedCredentialsFile} + if !envCfg.EnableSharedConfig { + // The shared config file (~/.aws/config) is only loaded if instructed + // to load via the envConfig.EnableSharedConfig (AWS_SDK_LOAD_CONFIG). + cfgFiles = cfgFiles[1:] + } + + // Load additional config from file(s) + sharedCfg, err := loadSharedConfig(envCfg.Profile, cfgFiles) + if err != nil { + return nil, err + } + + mergeConfigSrcs(cfg, userCfg, envCfg, sharedCfg, handlers) + + s := &Session{ + Config: cfg, + Handlers: handlers, + } + + initHandlers(s) + + return s, nil +} + +func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig, handlers request.Handlers) { + // Merge in user provided configuration + cfg.MergeIn(userCfg) + + // Region if not already set by user + if len(aws.StringValue(cfg.Region)) == 0 { + if len(envCfg.Region) > 0 { + cfg.WithRegion(envCfg.Region) + } else if envCfg.EnableSharedConfig && len(sharedCfg.Region) > 0 { + cfg.WithRegion(sharedCfg.Region) + } + } + + // Configure credentials if not already set + if cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil { + if len(envCfg.Creds.AccessKeyID) > 0 { + cfg.Credentials = credentials.NewStaticCredentialsFromCreds( + envCfg.Creds, + ) + } else if envCfg.EnableSharedConfig && len(sharedCfg.AssumeRole.RoleARN) > 0 && sharedCfg.AssumeRoleSource != nil { + cfgCp := *cfg + cfgCp.Credentials = credentials.NewStaticCredentialsFromCreds( + sharedCfg.AssumeRoleSource.Creds, + ) + cfg.Credentials = stscreds.NewCredentials( + &Session{ + Config: &cfgCp, + Handlers: handlers.Copy(), + }, + sharedCfg.AssumeRole.RoleARN, + func(opt *stscreds.AssumeRoleProvider) { + opt.RoleSessionName = sharedCfg.AssumeRole.RoleSessionName + + if len(sharedCfg.AssumeRole.ExternalID) > 0 { + opt.ExternalID = aws.String(sharedCfg.AssumeRole.ExternalID) + } + + // MFA not supported + }, + ) + } else if len(sharedCfg.Creds.AccessKeyID) > 0 { + cfg.Credentials = credentials.NewStaticCredentialsFromCreds( + sharedCfg.Creds, + ) + } else { + // Fallback to default credentials provider, include mock errors + // for the credential chain so user can identify why credentials + // failed to be retrieved. + cfg.Credentials = credentials.NewCredentials(&credentials.ChainProvider{ + VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors), + Providers: []credentials.Provider{ + &credProviderError{Err: awserr.New("EnvAccessKeyNotFound", "failed to find credentials in the environment.", nil)}, + &credProviderError{Err: awserr.New("SharedCredsLoad", fmt.Sprintf("failed to load profile, %s.", envCfg.Profile), nil)}, + defaults.RemoteCredProvider(*cfg, handlers), + }, + }) + } + } +} + +type credProviderError struct { + Err error +} + +var emptyCreds = credentials.Value{} + +func (c credProviderError) Retrieve() (credentials.Value, error) { + return credentials.Value{}, c.Err +} +func (c credProviderError) IsExpired() bool { + return true +} + func initHandlers(s *Session) { // Add the Validate parameter handler if it is not disabled. s.Handlers.Validate.Remove(corehandlers.ValidateParametersHandler) @@ -80,12 +349,11 @@ func initHandlers(s *Session) { } } -// Copy creates and returns a copy of the current session, coping the config +// Copy creates and returns a copy of the current Session, coping the config // and handlers. If any additional configs are provided they will be merged -// on top of the session's copied config. +// on top of the Session's copied config. // -// Example: -// // Create a copy of the current session, configured for the us-west-2 region. +// // Create a copy of the current Session, configured for the us-west-2 region. // sess.Copy(&aws.Config{Region: aws.String("us-west-2")}) func (s *Session) Copy(cfgs ...*aws.Config) *Session { newSession := &Session{ @@ -101,15 +369,15 @@ func (s *Session) Copy(cfgs ...*aws.Config) *Session { // ClientConfig satisfies the client.ConfigProvider interface and is used to // configure the service client instances. Passing the Session to the service // client's constructor (New) will use this method to configure the client. -// -// Example: -// sess := session.New() -// s3.New(sess) func (s *Session) ClientConfig(serviceName string, cfgs ...*aws.Config) client.Config { s = s.Copy(cfgs...) endpoint, signingRegion := endpoints.NormalizeEndpoint( - aws.StringValue(s.Config.Endpoint), serviceName, - aws.StringValue(s.Config.Region), aws.BoolValue(s.Config.DisableSSL)) + aws.StringValue(s.Config.Endpoint), + serviceName, + aws.StringValue(s.Config.Region), + aws.BoolValue(s.Config.DisableSSL), + aws.BoolValue(s.Config.UseDualStack), + ) return client.Config{ Config: s.Config, diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/session_test.go b/vendor/github.com/aws/aws-sdk-go/aws/session/session_test.go index e56c02fc6..f8a8ae4b3 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/session_test.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/session_test.go @@ -1,20 +1,344 @@ -package session_test +package session import ( + "bytes" + "fmt" "net/http" + "net/http/httptest" + "os" "testing" + "time" "github.com/stretchr/testify/assert" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/defaults" + "github.com/aws/aws-sdk-go/service/s3" ) func TestNewDefaultSession(t *testing.T) { - s := session.New(&aws.Config{Region: aws.String("region")}) + oldEnv := initSessionTestEnv() + defer popEnv(oldEnv) + + s := New(&aws.Config{Region: aws.String("region")}) assert.Equal(t, "region", *s.Config.Region) assert.Equal(t, http.DefaultClient, s.Config.HTTPClient) assert.NotNil(t, s.Config.Logger) assert.Equal(t, aws.LogOff, *s.Config.LogLevel) } + +func TestNew_WithCustomCreds(t *testing.T) { + oldEnv := initSessionTestEnv() + defer popEnv(oldEnv) + + customCreds := credentials.NewStaticCredentials("AKID", "SECRET", "TOKEN") + s := New(&aws.Config{Credentials: customCreds}) + + assert.Equal(t, customCreds, s.Config.Credentials) +} + +type mockLogger struct { + *bytes.Buffer +} + +func (w mockLogger) Log(args ...interface{}) { + fmt.Fprintln(w, args...) +} + +func TestNew_WithSessionLoadError(t *testing.T) { + oldEnv := initSessionTestEnv() + defer popEnv(oldEnv) + + os.Setenv("AWS_SDK_LOAD_CONFIG", "1") + os.Setenv("AWS_CONFIG_FILE", testConfigFilename) + os.Setenv("AWS_PROFILE", "assume_role_invalid_source_profile") + + logger := bytes.Buffer{} + s := New(&aws.Config{Logger: &mockLogger{&logger}}) + + assert.NotNil(t, s) + + svc := s3.New(s) + _, err := svc.ListBuckets(&s3.ListBucketsInput{}) + + assert.Error(t, err) + assert.Contains(t, logger.String(), "ERROR: failed to create session with AWS_SDK_LOAD_CONFIG enabled") + assert.Contains(t, err.Error(), SharedConfigAssumeRoleError{ + RoleARN: "assume_role_invalid_source_profile_role_arn", + }.Error()) +} + +func TestSessionCopy(t *testing.T) { + oldEnv := initSessionTestEnv() + defer popEnv(oldEnv) + + os.Setenv("AWS_REGION", "orig_region") + + s := Session{ + Config: defaults.Config(), + Handlers: defaults.Handlers(), + } + + newSess := s.Copy(&aws.Config{Region: aws.String("new_region")}) + + assert.Equal(t, "orig_region", *s.Config.Region) + assert.Equal(t, "new_region", *newSess.Config.Region) +} + +func TestSessionClientConfig(t *testing.T) { + s, err := NewSession(&aws.Config{Region: aws.String("orig_region")}) + assert.NoError(t, err) + + cfg := s.ClientConfig("s3", &aws.Config{Region: aws.String("us-west-2")}) + + assert.Equal(t, "https://s3-us-west-2.amazonaws.com", cfg.Endpoint) + assert.Empty(t, cfg.SigningRegion) + assert.Equal(t, "us-west-2", *cfg.Config.Region) +} + +func TestNewSession_NoCredentials(t *testing.T) { + oldEnv := initSessionTestEnv() + defer popEnv(oldEnv) + + s, err := NewSession() + assert.NoError(t, err) + + assert.NotNil(t, s.Config.Credentials) + assert.NotEqual(t, credentials.AnonymousCredentials, s.Config.Credentials) +} + +func TestNewSessionWithOptions_OverrideProfile(t *testing.T) { + oldEnv := initSessionTestEnv() + defer popEnv(oldEnv) + + os.Setenv("AWS_SDK_LOAD_CONFIG", "1") + os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) + os.Setenv("AWS_PROFILE", "other_profile") + + s, err := NewSessionWithOptions(Options{ + Profile: "full_profile", + }) + assert.NoError(t, err) + + assert.Equal(t, "full_profile_region", *s.Config.Region) + + creds, err := s.Config.Credentials.Get() + assert.NoError(t, err) + assert.Equal(t, "full_profile_akid", creds.AccessKeyID) + assert.Equal(t, "full_profile_secret", creds.SecretAccessKey) + assert.Empty(t, creds.SessionToken) + assert.Contains(t, creds.ProviderName, "SharedConfigCredentials") +} + +func TestNewSessionWithOptions_OverrideSharedConfigEnable(t *testing.T) { + oldEnv := initSessionTestEnv() + defer popEnv(oldEnv) + + os.Setenv("AWS_SDK_LOAD_CONFIG", "0") + os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) + os.Setenv("AWS_PROFILE", "full_profile") + + s, err := NewSessionWithOptions(Options{ + SharedConfigState: SharedConfigEnable, + }) + assert.NoError(t, err) + + assert.Equal(t, "full_profile_region", *s.Config.Region) + + creds, err := s.Config.Credentials.Get() + assert.NoError(t, err) + assert.Equal(t, "full_profile_akid", creds.AccessKeyID) + assert.Equal(t, "full_profile_secret", creds.SecretAccessKey) + assert.Empty(t, creds.SessionToken) + assert.Contains(t, creds.ProviderName, "SharedConfigCredentials") +} + +func TestNewSessionWithOptions_OverrideSharedConfigDisable(t *testing.T) { + oldEnv := initSessionTestEnv() + defer popEnv(oldEnv) + + os.Setenv("AWS_SDK_LOAD_CONFIG", "1") + os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) + os.Setenv("AWS_PROFILE", "full_profile") + + s, err := NewSessionWithOptions(Options{ + SharedConfigState: SharedConfigDisable, + }) + assert.NoError(t, err) + + assert.Empty(t, *s.Config.Region) + + creds, err := s.Config.Credentials.Get() + assert.NoError(t, err) + assert.Equal(t, "full_profile_akid", creds.AccessKeyID) + assert.Equal(t, "full_profile_secret", creds.SecretAccessKey) + assert.Empty(t, creds.SessionToken) + assert.Contains(t, creds.ProviderName, "SharedConfigCredentials") +} + +func TestNewSessionWithOptions_Overrides(t *testing.T) { + cases := []struct { + InEnvs map[string]string + InProfile string + OutRegion string + OutCreds credentials.Value + }{ + { + InEnvs: map[string]string{ + "AWS_SDK_LOAD_CONFIG": "0", + "AWS_SHARED_CREDENTIALS_FILE": testConfigFilename, + "AWS_PROFILE": "other_profile", + }, + InProfile: "full_profile", + OutRegion: "full_profile_region", + OutCreds: credentials.Value{ + AccessKeyID: "full_profile_akid", + SecretAccessKey: "full_profile_secret", + ProviderName: "SharedConfigCredentials", + }, + }, + { + InEnvs: map[string]string{ + "AWS_SDK_LOAD_CONFIG": "0", + "AWS_SHARED_CREDENTIALS_FILE": testConfigFilename, + "AWS_REGION": "env_region", + "AWS_ACCESS_KEY": "env_akid", + "AWS_SECRET_ACCESS_KEY": "env_secret", + "AWS_PROFILE": "other_profile", + }, + InProfile: "full_profile", + OutRegion: "env_region", + OutCreds: credentials.Value{ + AccessKeyID: "env_akid", + SecretAccessKey: "env_secret", + ProviderName: "EnvConfigCredentials", + }, + }, + { + InEnvs: map[string]string{ + "AWS_SDK_LOAD_CONFIG": "0", + "AWS_SHARED_CREDENTIALS_FILE": testConfigFilename, + "AWS_CONFIG_FILE": testConfigOtherFilename, + "AWS_PROFILE": "shared_profile", + }, + InProfile: "config_file_load_order", + OutRegion: "shared_config_region", + OutCreds: credentials.Value{ + AccessKeyID: "shared_config_akid", + SecretAccessKey: "shared_config_secret", + ProviderName: "SharedConfigCredentials", + }, + }, + } + + for _, c := range cases { + oldEnv := initSessionTestEnv() + defer popEnv(oldEnv) + + for k, v := range c.InEnvs { + os.Setenv(k, v) + } + + s, err := NewSessionWithOptions(Options{ + Profile: c.InProfile, + SharedConfigState: SharedConfigEnable, + }) + assert.NoError(t, err) + + creds, err := s.Config.Credentials.Get() + assert.NoError(t, err) + assert.Equal(t, c.OutRegion, *s.Config.Region) + assert.Equal(t, c.OutCreds.AccessKeyID, creds.AccessKeyID) + assert.Equal(t, c.OutCreds.SecretAccessKey, creds.SecretAccessKey) + assert.Equal(t, c.OutCreds.SessionToken, creds.SessionToken) + assert.Contains(t, creds.ProviderName, c.OutCreds.ProviderName) + } +} + +func TestSesisonAssumeRole(t *testing.T) { + oldEnv := initSessionTestEnv() + defer popEnv(oldEnv) + + os.Setenv("AWS_REGION", "us-east-1") + os.Setenv("AWS_SDK_LOAD_CONFIG", "1") + os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) + os.Setenv("AWS_PROFILE", "assume_role_w_creds") + + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + const respMsg = ` + + + + arn:aws:sts::account_id:assumed-role/role/session_name + AKID:session_name + + + AKID + SECRET + SESSION_TOKEN + %s + + + + request-id + + +` + w.Write([]byte(fmt.Sprintf(respMsg, time.Now().Add(15*time.Minute).Format("2006-01-02T15:04:05Z")))) + })) + + s, err := NewSession(&aws.Config{Endpoint: aws.String(server.URL), DisableSSL: aws.Bool(true)}) + + creds, err := s.Config.Credentials.Get() + assert.NoError(t, err) + assert.Equal(t, "AKID", creds.AccessKeyID) + assert.Equal(t, "SECRET", creds.SecretAccessKey) + assert.Equal(t, "SESSION_TOKEN", creds.SessionToken) + assert.Contains(t, creds.ProviderName, "AssumeRoleProvider") +} + +func TestSessionAssumeRole_DisableSharedConfig(t *testing.T) { + // Backwards compatibility with Shared config disabled + // assume role should not be built into the config. + oldEnv := initSessionTestEnv() + defer popEnv(oldEnv) + + os.Setenv("AWS_SDK_LOAD_CONFIG", "0") + os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) + os.Setenv("AWS_PROFILE", "assume_role_w_creds") + + s, err := NewSession() + assert.NoError(t, err) + + creds, err := s.Config.Credentials.Get() + assert.NoError(t, err) + assert.Equal(t, "assume_role_w_creds_akid", creds.AccessKeyID) + assert.Equal(t, "assume_role_w_creds_secret", creds.SecretAccessKey) + assert.Contains(t, creds.ProviderName, "SharedConfigCredentials") +} + +func TestSessionAssumeRole_InvalidSourceProfile(t *testing.T) { + // Backwards compatibility with Shared config disabled + // assume role should not be built into the config. + oldEnv := initSessionTestEnv() + defer popEnv(oldEnv) + + os.Setenv("AWS_SDK_LOAD_CONFIG", "1") + os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) + os.Setenv("AWS_PROFILE", "assume_role_invalid_source_profile") + + s, err := NewSession() + assert.Error(t, err) + assert.Contains(t, err.Error(), "SharedConfigAssumeRoleError: failed to load assume role") + assert.Nil(t, s) +} + +func initSessionTestEnv() (oldEnv []string) { + oldEnv = stashEnv() + os.Setenv("AWS_CONFIG_FILE", "file_not_exists") + os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "file_not_exists") + + return oldEnv +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go new file mode 100644 index 000000000..0147eedeb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go @@ -0,0 +1,294 @@ +package session + +import ( + "fmt" + "os" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/go-ini/ini" +) + +const ( + // Static Credentials group + accessKeyIDKey = `aws_access_key_id` // group required + secretAccessKey = `aws_secret_access_key` // group required + sessionTokenKey = `aws_session_token` // optional + + // Assume Role Credentials group + roleArnKey = `role_arn` // group required + sourceProfileKey = `source_profile` // group required + externalIDKey = `external_id` // optional + mfaSerialKey = `mfa_serial` // optional + roleSessionNameKey = `role_session_name` // optional + + // Additional Config fields + regionKey = `region` + + // DefaultSharedConfigProfile is the default profile to be used when + // loading configuration from the config files if another profile name + // is not provided. + DefaultSharedConfigProfile = `default` +) + +type assumeRoleConfig struct { + RoleARN string + SourceProfile string + ExternalID string + MFASerial string + RoleSessionName string +} + +// sharedConfig represents the configuration fields of the SDK config files. +type sharedConfig struct { + // Credentials values from the config file. Both aws_access_key_id + // and aws_secret_access_key must be provided together in the same file + // to be considered valid. The values will be ignored if not a complete group. + // aws_session_token is an optional field that can be provided if both of the + // other two fields are also provided. + // + // aws_access_key_id + // aws_secret_access_key + // aws_session_token + Creds credentials.Value + + AssumeRole assumeRoleConfig + AssumeRoleSource *sharedConfig + + // Region is the region the SDK should use for looking up AWS service endpoints + // and signing requests. + // + // region + Region string +} + +type sharedConfigFile struct { + Filename string + IniData *ini.File +} + +// loadSharedConfig retrieves the configuration from the list of files +// using the profile provided. The order the files are listed will determine +// precedence. Values in subsequent files will overwrite values defined in +// earlier files. +// +// For example, given two files A and B. Both define credentials. If the order +// of the files are A then B, B's credential values will be used instead of A's. +// +// See sharedConfig.setFromFile for information how the config files +// will be loaded. +func loadSharedConfig(profile string, filenames []string) (sharedConfig, error) { + if len(profile) == 0 { + profile = DefaultSharedConfigProfile + } + + files, err := loadSharedConfigIniFiles(filenames) + if err != nil { + return sharedConfig{}, err + } + + cfg := sharedConfig{} + if err = cfg.setFromIniFiles(profile, files); err != nil { + return sharedConfig{}, err + } + + if len(cfg.AssumeRole.SourceProfile) > 0 { + if err := cfg.setAssumeRoleSource(profile, files); err != nil { + return sharedConfig{}, err + } + } + + return cfg, nil +} + +func loadSharedConfigIniFiles(filenames []string) ([]sharedConfigFile, error) { + files := make([]sharedConfigFile, 0, len(filenames)) + + for _, filename := range filenames { + if _, err := os.Stat(filename); os.IsNotExist(err) { + // Trim files from the list that don't exist. + continue + } + + f, err := ini.Load(filename) + if err != nil { + return nil, SharedConfigLoadError{Filename: filename} + } + + files = append(files, sharedConfigFile{ + Filename: filename, IniData: f, + }) + } + + return files, nil +} + +func (cfg *sharedConfig) setAssumeRoleSource(origProfile string, files []sharedConfigFile) error { + var assumeRoleSrc sharedConfig + + // Multiple level assume role chains are not support + if cfg.AssumeRole.SourceProfile == origProfile { + assumeRoleSrc = *cfg + assumeRoleSrc.AssumeRole = assumeRoleConfig{} + } else { + err := assumeRoleSrc.setFromIniFiles(cfg.AssumeRole.SourceProfile, files) + if err != nil { + return err + } + } + + if len(assumeRoleSrc.Creds.AccessKeyID) == 0 { + return SharedConfigAssumeRoleError{RoleARN: cfg.AssumeRole.RoleARN} + } + + cfg.AssumeRoleSource = &assumeRoleSrc + + return nil +} + +func (cfg *sharedConfig) setFromIniFiles(profile string, files []sharedConfigFile) error { + // Trim files from the list that don't exist. + for _, f := range files { + if err := cfg.setFromIniFile(profile, f); err != nil { + if _, ok := err.(SharedConfigProfileNotExistsError); ok { + // Ignore proviles missings + continue + } + return err + } + } + + return nil +} + +// setFromFile loads the configuration from the file using +// the profile provided. A sharedConfig pointer type value is used so that +// multiple config file loadings can be chained. +// +// Only loads complete logically grouped values, and will not set fields in cfg +// for incomplete grouped values in the config. Such as credentials. For example +// if a config file only includes aws_access_key_id but no aws_secret_access_key +// the aws_access_key_id will be ignored. +func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile) error { + section, err := file.IniData.GetSection(profile) + if err != nil { + // Fallback to to alternate profile name: profile + section, err = file.IniData.GetSection(fmt.Sprintf("profile %s", profile)) + if err != nil { + return SharedConfigProfileNotExistsError{Profile: profile, Err: err} + } + } + + // Shared Credentials + akid := section.Key(accessKeyIDKey).String() + secret := section.Key(secretAccessKey).String() + if len(akid) > 0 && len(secret) > 0 { + cfg.Creds = credentials.Value{ + AccessKeyID: akid, + SecretAccessKey: secret, + SessionToken: section.Key(sessionTokenKey).String(), + ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", file.Filename), + } + } + + // Assume Role + roleArn := section.Key(roleArnKey).String() + srcProfile := section.Key(sourceProfileKey).String() + if len(roleArn) > 0 && len(srcProfile) > 0 { + cfg.AssumeRole = assumeRoleConfig{ + RoleARN: roleArn, + SourceProfile: srcProfile, + ExternalID: section.Key(externalIDKey).String(), + MFASerial: section.Key(mfaSerialKey).String(), + RoleSessionName: section.Key(roleSessionNameKey).String(), + } + } + + // Region + if v := section.Key(regionKey).String(); len(v) > 0 { + cfg.Region = v + } + + return nil +} + +// SharedConfigLoadError is an error for the shared config file failed to load. +type SharedConfigLoadError struct { + Filename string + Err error +} + +// Code is the short id of the error. +func (e SharedConfigLoadError) Code() string { + return "SharedConfigLoadError" +} + +// Message is the description of the error +func (e SharedConfigLoadError) Message() string { + return fmt.Sprintf("failed to load config file, %s", e.Filename) +} + +// OrigErr is the underlying error that caused the failure. +func (e SharedConfigLoadError) OrigErr() error { + return e.Err +} + +// Error satisfies the error interface. +func (e SharedConfigLoadError) Error() string { + return awserr.SprintError(e.Code(), e.Message(), "", e.Err) +} + +// SharedConfigProfileNotExistsError is an error for the shared config when +// the profile was not find in the config file. +type SharedConfigProfileNotExistsError struct { + Profile string + Err error +} + +// Code is the short id of the error. +func (e SharedConfigProfileNotExistsError) Code() string { + return "SharedConfigProfileNotExistsError" +} + +// Message is the description of the error +func (e SharedConfigProfileNotExistsError) Message() string { + return fmt.Sprintf("failed to get profile, %s", e.Profile) +} + +// OrigErr is the underlying error that caused the failure. +func (e SharedConfigProfileNotExistsError) OrigErr() error { + return e.Err +} + +// Error satisfies the error interface. +func (e SharedConfigProfileNotExistsError) Error() string { + return awserr.SprintError(e.Code(), e.Message(), "", e.Err) +} + +// SharedConfigAssumeRoleError is an error for the shared config when the +// profile contains assume role information, but that information is invalid +// or not complete. +type SharedConfigAssumeRoleError struct { + RoleARN string +} + +// Code is the short id of the error. +func (e SharedConfigAssumeRoleError) Code() string { + return "SharedConfigAssumeRoleError" +} + +// Message is the description of the error +func (e SharedConfigAssumeRoleError) Message() string { + return fmt.Sprintf("failed to load assume role for %s, source profile has no shared credentials", + e.RoleARN) +} + +// OrigErr is the underlying error that caused the failure. +func (e SharedConfigAssumeRoleError) OrigErr() error { + return nil +} + +// Error satisfies the error interface. +func (e SharedConfigAssumeRoleError) Error() string { + return awserr.SprintError(e.Code(), e.Message(), "", nil) +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config_test.go b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config_test.go new file mode 100644 index 000000000..1a164d46d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config_test.go @@ -0,0 +1,264 @@ +package session + +import ( + "fmt" + "path/filepath" + "testing" + + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/go-ini/ini" + "github.com/stretchr/testify/assert" +) + +var ( + testConfigFilename = filepath.Join("testdata", "shared_config") + testConfigOtherFilename = filepath.Join("testdata", "shared_config_other") +) + +func TestLoadSharedConfig(t *testing.T) { + cases := []struct { + Filenames []string + Profile string + Expected sharedConfig + Err error + }{ + { + Filenames: []string{"file_not_exists"}, + Profile: "default", + }, + { + Filenames: []string{testConfigFilename}, + Expected: sharedConfig{ + Region: "default_region", + }, + }, + { + Filenames: []string{testConfigOtherFilename, testConfigFilename}, + Profile: "config_file_load_order", + Expected: sharedConfig{ + Region: "shared_config_region", + Creds: credentials.Value{ + AccessKeyID: "shared_config_akid", + SecretAccessKey: "shared_config_secret", + ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigFilename), + }, + }, + }, + { + Filenames: []string{testConfigFilename, testConfigOtherFilename}, + Profile: "config_file_load_order", + Expected: sharedConfig{ + Region: "shared_config_other_region", + Creds: credentials.Value{ + AccessKeyID: "shared_config_other_akid", + SecretAccessKey: "shared_config_other_secret", + ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigOtherFilename), + }, + }, + }, + { + Filenames: []string{testConfigOtherFilename, testConfigFilename}, + Profile: "assume_role", + Expected: sharedConfig{ + AssumeRole: assumeRoleConfig{ + RoleARN: "assume_role_role_arn", + SourceProfile: "complete_creds", + }, + AssumeRoleSource: &sharedConfig{ + Creds: credentials.Value{ + AccessKeyID: "complete_creds_akid", + SecretAccessKey: "complete_creds_secret", + ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigFilename), + }, + }, + }, + }, + { + Filenames: []string{testConfigOtherFilename, testConfigFilename}, + Profile: "assume_role_invalid_source_profile", + Expected: sharedConfig{ + AssumeRole: assumeRoleConfig{ + RoleARN: "assume_role_invalid_source_profile_role_arn", + SourceProfile: "profile_not_exists", + }, + }, + Err: SharedConfigAssumeRoleError{RoleARN: "assume_role_invalid_source_profile_role_arn"}, + }, + { + Filenames: []string{testConfigOtherFilename, testConfigFilename}, + Profile: "assume_role_w_creds", + Expected: sharedConfig{ + Creds: credentials.Value{ + AccessKeyID: "assume_role_w_creds_akid", + SecretAccessKey: "assume_role_w_creds_secret", + ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigFilename), + }, + AssumeRole: assumeRoleConfig{ + RoleARN: "assume_role_w_creds_role_arn", + SourceProfile: "assume_role_w_creds", + ExternalID: "1234", + RoleSessionName: "assume_role_w_creds_session_name", + }, + AssumeRoleSource: &sharedConfig{ + Creds: credentials.Value{ + AccessKeyID: "assume_role_w_creds_akid", + SecretAccessKey: "assume_role_w_creds_secret", + ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigFilename), + }, + }, + }, + }, + { + Filenames: []string{testConfigOtherFilename, testConfigFilename}, + Profile: "assume_role_wo_creds", + Expected: sharedConfig{ + AssumeRole: assumeRoleConfig{ + RoleARN: "assume_role_wo_creds_role_arn", + SourceProfile: "assume_role_wo_creds", + }, + }, + Err: SharedConfigAssumeRoleError{RoleARN: "assume_role_wo_creds_role_arn"}, + }, + { + Filenames: []string{filepath.Join("testdata", "shared_config_invalid_ini")}, + Profile: "profile_name", + Err: SharedConfigLoadError{Filename: filepath.Join("testdata", "shared_config_invalid_ini")}, + }, + } + + for i, c := range cases { + cfg, err := loadSharedConfig(c.Profile, c.Filenames) + if c.Err != nil { + assert.Contains(t, err.Error(), c.Err.Error(), "expected error, %d", i) + continue + } + + assert.NoError(t, err, "unexpected error, %d", i) + assert.Equal(t, c.Expected, cfg, "not equal, %d", i) + } +} + +func TestLoadSharedConfigFromFile(t *testing.T) { + filename := testConfigFilename + f, err := ini.Load(filename) + if err != nil { + t.Fatalf("failed to load test config file, %s, %v", filename, err) + } + iniFile := sharedConfigFile{IniData: f, Filename: filename} + + cases := []struct { + Profile string + Expected sharedConfig + Err error + }{ + { + Profile: "default", + Expected: sharedConfig{Region: "default_region"}, + }, + { + Profile: "alt_profile_name", + Expected: sharedConfig{Region: "alt_profile_name_region"}, + }, + { + Profile: "short_profile_name_first", + Expected: sharedConfig{Region: "short_profile_name_first_short"}, + }, + { + Profile: "partial_creds", + Expected: sharedConfig{}, + }, + { + Profile: "complete_creds", + Expected: sharedConfig{ + Creds: credentials.Value{ + AccessKeyID: "complete_creds_akid", + SecretAccessKey: "complete_creds_secret", + ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigFilename), + }, + }, + }, + { + Profile: "complete_creds_with_token", + Expected: sharedConfig{ + Creds: credentials.Value{ + AccessKeyID: "complete_creds_with_token_akid", + SecretAccessKey: "complete_creds_with_token_secret", + SessionToken: "complete_creds_with_token_token", + ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigFilename), + }, + }, + }, + { + Profile: "full_profile", + Expected: sharedConfig{ + Creds: credentials.Value{ + AccessKeyID: "full_profile_akid", + SecretAccessKey: "full_profile_secret", + ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigFilename), + }, + Region: "full_profile_region", + }, + }, + { + Profile: "partial_assume_role", + Expected: sharedConfig{}, + }, + { + Profile: "assume_role", + Expected: sharedConfig{ + AssumeRole: assumeRoleConfig{ + RoleARN: "assume_role_role_arn", + SourceProfile: "complete_creds", + }, + }, + }, + { + Profile: "does_not_exists", + Err: SharedConfigProfileNotExistsError{Profile: "does_not_exists"}, + }, + } + + for i, c := range cases { + cfg := sharedConfig{} + + err := cfg.setFromIniFile(c.Profile, iniFile) + if c.Err != nil { + assert.Contains(t, err.Error(), c.Err.Error(), "expected error, %d", i) + continue + } + + assert.NoError(t, err, "unexpected error, %d", i) + assert.Equal(t, c.Expected, cfg, "not equal, %d", i) + } +} + +func TestLoadSharedConfigIniFiles(t *testing.T) { + cases := []struct { + Filenames []string + Expected []sharedConfigFile + }{ + { + Filenames: []string{"not_exists", testConfigFilename}, + Expected: []sharedConfigFile{ + {Filename: testConfigFilename}, + }, + }, + { + Filenames: []string{testConfigFilename, testConfigOtherFilename}, + Expected: []sharedConfigFile{ + {Filename: testConfigFilename}, + {Filename: testConfigOtherFilename}, + }, + }, + } + + for i, c := range cases { + files, err := loadSharedConfigIniFiles(c.Filenames) + assert.NoError(t, err, "unexpected error, %d", i) + assert.Equal(t, len(c.Expected), len(files), "expected num files, %d", i) + + for i, expectedFile := range c.Expected { + assert.Equal(t, expectedFile.Filename, files[i].Filename) + } + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config b/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config new file mode 100644 index 000000000..e41fe2137 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config @@ -0,0 +1,60 @@ +[default] +s3 = + unsupported_key=123 + other_unsupported=abc + +region = default_region + +[profile alt_profile_name] +region = alt_profile_name_region + +[short_profile_name_first] +region = short_profile_name_first_short + +[profile short_profile_name_first] +region = short_profile_name_first_alt + +[partial_creds] +aws_access_key_id = partial_creds_akid + +[complete_creds] +aws_access_key_id = complete_creds_akid +aws_secret_access_key = complete_creds_secret + +[complete_creds_with_token] +aws_access_key_id = complete_creds_with_token_akid +aws_secret_access_key = complete_creds_with_token_secret +aws_session_token = complete_creds_with_token_token + +[full_profile] +aws_access_key_id = full_profile_akid +aws_secret_access_key = full_profile_secret +region = full_profile_region + +[config_file_load_order] +region = shared_config_region +aws_access_key_id = shared_config_akid +aws_secret_access_key = shared_config_secret + +[partial_assume_role] +role_arn = partial_assume_role_role_arn + +[assume_role] +role_arn = assume_role_role_arn +source_profile = complete_creds + +[assume_role_invalid_source_profile] +role_arn = assume_role_invalid_source_profile_role_arn +source_profile = profile_not_exists + +[assume_role_w_creds] +role_arn = assume_role_w_creds_role_arn +source_profile = assume_role_w_creds +external_id = 1234 +role_session_name = assume_role_w_creds_session_name +aws_access_key_id = assume_role_w_creds_akid +aws_secret_access_key = assume_role_w_creds_secret + +[assume_role_wo_creds] +role_arn = assume_role_wo_creds_role_arn +source_profile = assume_role_wo_creds diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config_invalid_ini b/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config_invalid_ini new file mode 100644 index 000000000..4db038952 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config_invalid_ini @@ -0,0 +1 @@ +[profile_nam diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config_other b/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config_other new file mode 100644 index 000000000..615831b1a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config_other @@ -0,0 +1,17 @@ +[default] +region = default_region + +[partial_creds] +aws_access_key_id = AKID + +[profile alt_profile_name] +region = alt_profile_name_region + +[creds_from_credentials] +aws_access_key_id = creds_from_config_akid +aws_secret_access_key = creds_from_config_secret + +[config_file_load_order] +region = shared_config_other_region +aws_access_key_id = shared_config_other_akid +aws_secret_access_key = shared_config_other_secret diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go index f040f9ce9..7d99f54d1 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go @@ -545,7 +545,7 @@ func (ctx *signingCtx) buildBodyDigest() { } else { hash = hex.EncodeToString(makeSha256Reader(ctx.Body)) } - if ctx.ServiceName == "s3" { + if ctx.ServiceName == "s3" || ctx.ServiceName == "glacier" { ctx.Request.Header.Set("X-Amz-Content-Sha256", hash) } } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4_test.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4_test.go index 5600a9b3d..7e932bb3b 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4_test.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4_test.go @@ -111,7 +111,7 @@ func TestSignRequest(t *testing.T) { assert.Equal(t, expectedDate, q.Get("X-Amz-Date")) } -func TestSignBody(t *testing.T) { +func TestSignBodyS3(t *testing.T) { req, body := buildRequest("s3", "us-east-1", "hello") signer := buildSigner() signer.Sign(req, body, "s3", "us-east-1", time.Now()) @@ -119,6 +119,14 @@ func TestSignBody(t *testing.T) { assert.Equal(t, "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", hash) } +func TestSignBodyGlacier(t *testing.T) { + req, body := buildRequest("glacier", "us-east-1", "hello") + signer := buildSigner() + signer.Sign(req, body, "glacier", "us-east-1", time.Now()) + hash := req.Header.Get("X-Amz-Content-Sha256") + assert.Equal(t, "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", hash) +} + func TestPresignEmptyBodyS3(t *testing.T) { req, body := buildRequest("s3", "us-east-1", "hello") signer := buildSigner() @@ -280,7 +288,7 @@ func TestPreResignRequestExpiredCreds(t *testing.T) { creds.Expire() signSDKRequestWithCurrTime(r, func() time.Time { - // Simulate the request occured 15 minutes in the past + // Simulate the request occurred 15 minutes in the past return time.Now().Add(-48 * time.Hour) }) assert.NotEqual(t, querySig, r.HTTPRequest.URL.Query().Get("X-Amz-Signature")) @@ -308,7 +316,7 @@ func TestResignRequestExpiredRequest(t *testing.T) { origSignedAt := r.LastSignedAt signSDKRequestWithCurrTime(r, func() time.Time { - // Simulate the request occured 15 minutes in the past + // Simulate the request occurred 15 minutes in the past return time.Now().Add(15 * time.Minute) }) assert.NotEqual(t, querySig, r.HTTPRequest.Header.Get("Authorization")) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go index 97a3f57f5..1fa57165f 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.2.5" +const SDKVersion = "1.4.1" diff --git a/vendor/github.com/aws/aws-sdk-go/awstesting/assert.go b/vendor/github.com/aws/aws-sdk-go/awstesting/assert.go index f97b228fc..10ad72767 100644 --- a/vendor/github.com/aws/aws-sdk-go/awstesting/assert.go +++ b/vendor/github.com/aws/aws-sdk-go/awstesting/assert.go @@ -5,11 +5,10 @@ import ( "encoding/xml" "fmt" "net/url" + "reflect" "regexp" "sort" "testing" - - "github.com/stretchr/testify/assert" ) // Match is a testing helper to test for testing error by comparing expected @@ -33,9 +32,9 @@ func AssertURL(t *testing.T, expect, actual string, msgAndArgs ...interface{}) b return false } - assert.Equal(t, expectURL.Host, actualURL.Host, msgAndArgs...) - assert.Equal(t, expectURL.Scheme, actualURL.Scheme, msgAndArgs...) - assert.Equal(t, expectURL.Path, actualURL.Path, msgAndArgs...) + equal(t, expectURL.Host, actualURL.Host, msgAndArgs...) + equal(t, expectURL.Scheme, actualURL.Scheme, msgAndArgs...) + equal(t, expectURL.Path, actualURL.Path, msgAndArgs...) return AssertQuery(t, expectURL.Query().Encode(), actualURL.Query().Encode(), msgAndArgs...) } @@ -54,7 +53,7 @@ func AssertQuery(t *testing.T, expect, actual string, msgAndArgs ...interface{}) } // Make sure the keys are the same - if !assert.Equal(t, queryValueKeys(expectQ), queryValueKeys(actualQ), msgAndArgs...) { + if !equal(t, queryValueKeys(expectQ), queryValueKeys(actualQ), msgAndArgs...) { return false } @@ -62,7 +61,7 @@ func AssertQuery(t *testing.T, expect, actual string, msgAndArgs ...interface{}) sort.Strings(expectQVals) actualQVals := actualQ[k] sort.Strings(actualQVals) - assert.Equal(t, expectQVals, actualQVals, msgAndArgs...) + equal(t, expectQVals, actualQVals, msgAndArgs...) } return true @@ -82,7 +81,7 @@ func AssertJSON(t *testing.T, expect, actual string, msgAndArgs ...interface{}) return false } - return assert.Equal(t, expectVal, actualVal, msgAndArgs...) + return equal(t, expectVal, actualVal, msgAndArgs...) } // AssertXML verifies that the expect xml string matches the actual. @@ -96,7 +95,39 @@ func AssertXML(t *testing.T, expect, actual string, container interface{}, msgAn if err := xml.Unmarshal([]byte(actual), &actualVal); err != nil { t.Errorf(errMsg("unable to parse actual XML", err, msgAndArgs...)) } - return assert.Equal(t, expectVal, actualVal, msgAndArgs...) + return equal(t, expectVal, actualVal, msgAndArgs...) +} + +// objectsAreEqual determines if two objects are considered equal. +// +// This function does no assertion of any kind. +// +// Based on github.com/stretchr/testify/assert.ObjectsAreEqual +// Copied locally to prevent non-test build dependencies on testify +func objectsAreEqual(expected, actual interface{}) bool { + if expected == nil || actual == nil { + return expected == actual + } + + return reflect.DeepEqual(expected, actual) +} + +// Equal asserts that two objects are equal. +// +// assert.Equal(t, 123, 123, "123 and 123 should be equal") +// +// Returns whether the assertion was successful (true) or not (false). +// +// Based on github.com/stretchr/testify/assert.Equal +// Copied locally to prevent non-test build dependencies on testify +func equal(t *testing.T, expected, actual interface{}, msgAndArgs ...interface{}) bool { + if !objectsAreEqual(expected, actual) { + t.Errorf("Not Equal:\n\t%#v (expected)\n\t%#v (actual), %s", + expected, actual, messageFromMsgAndArgs(msgAndArgs)) + return false + } + + return true } func errMsg(baseMsg string, err error, msgAndArgs ...interface{}) string { @@ -107,6 +138,8 @@ func errMsg(baseMsg string, err error, msgAndArgs ...interface{}) string { return fmt.Sprintf("%s%s, %v", message, baseMsg, err) } +// Based on github.com/stretchr/testify/assert.messageFromMsgAndArgs +// Copied locally to prevent non-test build dependencies on testify func messageFromMsgAndArgs(msgAndArgs []interface{}) string { if len(msgAndArgs) == 0 || msgAndArgs == nil { return "" diff --git a/vendor/github.com/aws/aws-sdk-go/awstesting/client.go b/vendor/github.com/aws/aws-sdk-go/awstesting/client.go index fd95259e0..ca64a4478 100644 --- a/vendor/github.com/aws/aws-sdk-go/awstesting/client.go +++ b/vendor/github.com/aws/aws-sdk-go/awstesting/client.go @@ -5,7 +5,6 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/defaults" - "github.com/aws/aws-sdk-go/awstesting/mock" ) // NewClient creates and initializes a generic service client for testing. @@ -19,24 +18,3 @@ func NewClient(cfgs ...*aws.Config) *client.Client { return client.New(*def.Config, info, def.Handlers) } - -// NewMockClient creates and initializes a client that will connect to the -// mock server -func NewMockClient(cfgs ...*aws.Config) *client.Client { - c := mock.Session.ClientConfig("Mock", cfgs...) - - svc := client.New( - *c.Config, - metadata.ClientInfo{ - ServiceName: "Mock", - SigningRegion: c.SigningRegion, - Endpoint: c.Endpoint, - APIVersion: "2015-12-08", - JSONVersion: "1.1", - TargetPrefix: "MockServer", - }, - c.Handlers, - ) - - return svc -} diff --git a/vendor/github.com/aws/aws-sdk-go/awstesting/mock/mock.go b/vendor/github.com/aws/aws-sdk-go/awstesting/mock/mock.go new file mode 100644 index 000000000..9f1800745 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/awstesting/mock/mock.go @@ -0,0 +1,43 @@ +package mock + +import ( + "net/http" + "net/http/httptest" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/session" +) + +// Session is a mock session which is used to hit the mock server +var Session = session.Must(session.NewSession(&aws.Config{ + DisableSSL: aws.Bool(true), + Endpoint: aws.String(server.URL[7:]), +})) + +// server is the mock server that simply writes a 200 status back to the client +var server = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) +})) + +// NewMockClient creates and initializes a client that will connect to the +// mock server +func NewMockClient(cfgs ...*aws.Config) *client.Client { + c := Session.ClientConfig("Mock", cfgs...) + + svc := client.New( + *c.Config, + metadata.ClientInfo{ + ServiceName: "Mock", + SigningRegion: c.SigningRegion, + Endpoint: c.Endpoint, + APIVersion: "2015-12-08", + JSONVersion: "1.1", + TargetPrefix: "MockServer", + }, + c.Handlers, + ) + + return svc +} diff --git a/vendor/github.com/aws/aws-sdk-go/awstesting/mock/server.go b/vendor/github.com/aws/aws-sdk-go/awstesting/mock/server.go deleted file mode 100644 index 026f7beb2..000000000 --- a/vendor/github.com/aws/aws-sdk-go/awstesting/mock/server.go +++ /dev/null @@ -1,20 +0,0 @@ -package mock - -import ( - "net/http" - "net/http/httptest" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" -) - -// Session is a mock session which is used to hit the mock server -var Session = session.New(&aws.Config{ - DisableSSL: aws.Bool(true), - Endpoint: aws.String(server.URL[7:]), -}) - -// server is the mock server that simply writes a 200 status back to the client -var server = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) -})) diff --git a/vendor/github.com/aws/aws-sdk-go/awstesting/unit/unit.go b/vendor/github.com/aws/aws-sdk-go/awstesting/unit/unit.go index e3ec33a82..1c6e60546 100644 --- a/vendor/github.com/aws/aws-sdk-go/awstesting/unit/unit.go +++ b/vendor/github.com/aws/aws-sdk-go/awstesting/unit/unit.go @@ -8,6 +8,6 @@ import ( ) // Session is a shared session for unit tests to use. -var Session = session.New(aws.NewConfig(). +var Session = session.Must(session.NewSession(aws.NewConfig(). WithCredentials(credentials.NewStaticCredentials("AKID", "SECRET", "SESSION")). - WithRegion("mock-region")) + WithRegion("mock-region"))) diff --git a/vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.go index 2b279e659..b4ad7405c 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.go @@ -14,9 +14,9 @@ import ( // normalized endpoint and signing region. If the endpoint is not an empty string // the service name and region will be used to look up the service's API endpoint. // If the endpoint is provided the scheme will be added if it is not present. -func NormalizeEndpoint(endpoint, serviceName, region string, disableSSL bool) (normEndpoint, signingRegion string) { +func NormalizeEndpoint(endpoint, serviceName, region string, disableSSL, useDualStack bool) (normEndpoint, signingRegion string) { if endpoint == "" { - return EndpointForRegion(serviceName, region, disableSSL) + return EndpointForRegion(serviceName, region, disableSSL, useDualStack) } return AddScheme(endpoint, disableSSL), "" @@ -24,12 +24,17 @@ func NormalizeEndpoint(endpoint, serviceName, region string, disableSSL bool) (n // EndpointForRegion returns an endpoint and its signing region for a service and region. // if the service and region pair are not found endpoint and signingRegion will be empty. -func EndpointForRegion(svcName, region string, disableSSL bool) (endpoint, signingRegion string) { +func EndpointForRegion(svcName, region string, disableSSL, useDualStack bool) (endpoint, signingRegion string) { + dualStackField := "" + if useDualStack { + dualStackField = "/dualstack" + } + derivedKeys := []string{ - region + "/" + svcName, - region + "/*", - "*/" + svcName, - "*/*", + region + "/" + svcName + dualStackField, + region + "/*" + dualStackField, + "*/" + svcName + dualStackField, + "*/*" + dualStackField, } for _, key := range derivedKeys { diff --git a/vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.json b/vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.json index 5f4991c2b..c5bf3c7c3 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.json +++ b/vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.json @@ -65,6 +65,9 @@ "*/s3": { "endpoint": "s3-{region}.amazonaws.com" }, + "*/s3/dualstack": { + "endpoint": "s3.dualstack.{region}.amazonaws.com" + }, "us-east-1/s3": { "endpoint": "s3.amazonaws.com" }, diff --git a/vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints_map.go b/vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints_map.go index e995315ab..a81d158c3 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints_map.go +++ b/vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints_map.go @@ -48,6 +48,9 @@ var endpointsMap = endpointStruct{ "*/s3": { Endpoint: "s3-{region}.amazonaws.com", }, + "*/s3/dualstack": { + Endpoint: "s3.dualstack.{region}.amazonaws.com", + }, "*/sts": { Endpoint: "sts.amazonaws.com", SigningRegion: "us-east-1", diff --git a/vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints_test.go b/vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints_test.go index 0c43c589f..271f8652a 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints_test.go +++ b/vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints_test.go @@ -13,7 +13,7 @@ func TestGenericEndpoint(t *testing.T) { name := "service" region := "mock-region-1" - ep, sr := endpoints.EndpointForRegion(name, region, false) + ep, sr := endpoints.EndpointForRegion(name, region, false, false) assert.Equal(t, fmt.Sprintf("https://%s.%s.amazonaws.com", name, region), ep) assert.Empty(t, sr) } @@ -23,18 +23,32 @@ func TestGlobalEndpoints(t *testing.T) { svcs := []string{"cloudfront", "iam", "importexport", "route53", "sts", "waf"} for _, name := range svcs { - ep, sr := endpoints.EndpointForRegion(name, region, false) + ep, sr := endpoints.EndpointForRegion(name, region, false, false) assert.Equal(t, fmt.Sprintf("https://%s.amazonaws.com", name), ep) assert.Equal(t, "us-east-1", sr) } } +func TestDualStackEndpoint(t *testing.T) { + ep, sr := endpoints.EndpointForRegion("s3", "mock-region-1", false, true) + assert.Equal(t, "https://s3.dualstack.mock-region-1.amazonaws.com", ep) + assert.Equal(t, "", sr) + + ep, sr = endpoints.EndpointForRegion("mock-svc", "mock-region-1", false, true) + assert.Equal(t, "", ep) + assert.Equal(t, "", sr) + + ep, sr = endpoints.EndpointForRegion("s3", "mock-region-1", false, false) + assert.Equal(t, "https://s3-mock-region-1.amazonaws.com", ep) + assert.Equal(t, "", sr) +} + func TestServicesInCN(t *testing.T) { region := "cn-north-1" svcs := []string{"cloudfront", "iam", "importexport", "route53", "sts", "s3", "waf"} for _, name := range svcs { - ep, sr := endpoints.EndpointForRegion(name, region, false) + ep, sr := endpoints.EndpointForRegion(name, region, false, false) assert.Equal(t, fmt.Sprintf("https://%s.%s.amazonaws.com.cn", name, region), ep) assert.Empty(t, sr) } @@ -44,7 +58,7 @@ func TestEC2MetadataEndpoints(t *testing.T) { regions := []string{"us-east-1", "us-gov-west-1", "cn-north-1", "mock-region-1"} for _, region := range regions { - ep, sr := endpoints.EndpointForRegion("ec2metadata", region, false) + ep, sr := endpoints.EndpointForRegion("ec2metadata", region, false, false) assert.Equal(t, "http://169.254.169.254/latest", ep) assert.Equal(t, "", sr) } diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go index 68e344d1f..bb0dae97a 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go @@ -1,4 +1,4 @@ -// Package ec2query provides serialisation of AWS EC2 requests and responses. +// Package ec2query provides serialization of AWS EC2 requests and responses. package ec2query //go:generate go run ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/ec2.json build_test.go diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_test.go index 84ddb2032..7dd00a930 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_test.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_test.go @@ -16,9 +16,9 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/ec2query" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" @@ -1123,8 +1123,7 @@ type InputService9TestShapeInputShape struct { // func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) { - sess := session.New() - svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService1TestShapeInputService1TestCaseOperation1Input{ Bar: aws.String("val2"), Foo: aws.String("val1"), @@ -1149,8 +1148,7 @@ func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) { } func TestInputService2ProtocolTestStructureWithLocationNameAndQueryNameAppliedToMembersCase1(t *testing.T) { - sess := session.New() - svc := NewInputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService2TestShapeInputService2TestCaseOperation1Input{ Bar: aws.String("val2"), Foo: aws.String("val1"), @@ -1176,8 +1174,7 @@ func TestInputService2ProtocolTestStructureWithLocationNameAndQueryNameAppliedTo } func TestInputService3ProtocolTestNestedStructureMembersCase1(t *testing.T) { - sess := session.New() - svc := NewInputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService3TestShapeInputService3TestCaseOperation1Input{ StructArg: &InputService3TestShapeStructType{ ScalarArg: aws.String("foo"), @@ -1203,8 +1200,7 @@ func TestInputService3ProtocolTestNestedStructureMembersCase1(t *testing.T) { } func TestInputService4ProtocolTestListTypesCase1(t *testing.T) { - sess := session.New() - svc := NewInputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService4TestShapeInputService4TestCaseOperation1Input{ ListArg: []*string{ aws.String("foo"), @@ -1232,8 +1228,7 @@ func TestInputService4ProtocolTestListTypesCase1(t *testing.T) { } func TestInputService5ProtocolTestListWithLocationNameAppliedToMemberCase1(t *testing.T) { - sess := session.New() - svc := NewInputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService5TestShapeInputService5TestCaseOperation1Input{ ListArg: []*string{ aws.String("a"), @@ -1261,8 +1256,7 @@ func TestInputService5ProtocolTestListWithLocationNameAppliedToMemberCase1(t *te } func TestInputService6ProtocolTestListWithLocationNameAndQueryNameCase1(t *testing.T) { - sess := session.New() - svc := NewInputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService6TestShapeInputService6TestCaseOperation1Input{ ListArg: []*string{ aws.String("a"), @@ -1290,8 +1284,7 @@ func TestInputService6ProtocolTestListWithLocationNameAndQueryNameCase1(t *testi } func TestInputService7ProtocolTestBase64EncodedBlobsCase1(t *testing.T) { - sess := session.New() - svc := NewInputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService7TestShapeInputService7TestCaseOperation1Input{ BlobArg: []byte("foo"), } @@ -1315,8 +1308,7 @@ func TestInputService7ProtocolTestBase64EncodedBlobsCase1(t *testing.T) { } func TestInputService8ProtocolTestTimestampValuesCase1(t *testing.T) { - sess := session.New() - svc := NewInputService8ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService8TestShapeInputService8TestCaseOperation1Input{ TimeArg: aws.Time(time.Unix(1422172800, 0)), } @@ -1340,8 +1332,7 @@ func TestInputService8ProtocolTestTimestampValuesCase1(t *testing.T) { } func TestInputService9ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { - sess := session.New() - svc := NewInputService9ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService9TestShapeInputShape{ Token: aws.String("abc123"), } @@ -1365,8 +1356,7 @@ func TestInputService9ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { } func TestInputService9ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) { - sess := session.New() - svc := NewInputService9ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService9TestShapeInputShape{} req, _ := svc.InputService9TestCaseOperation2Request(input) r := req.HTTPRequest diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal_test.go index 890e2d68b..2b57eddcf 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal_test.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal_test.go @@ -16,9 +16,9 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/ec2query" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" @@ -1059,8 +1059,7 @@ type OutputService9TestShapeOutputService9TestCaseOperation1Output struct { // func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("myname123falsetrue1.21.3200arequest-id")) req, out := svc.OutputService1TestCaseOperation1Request(nil) @@ -1087,8 +1086,7 @@ func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) { } func TestOutputService2ProtocolTestBlobCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("dmFsdWU=requestid")) req, out := svc.OutputService2TestCaseOperation1Request(nil) @@ -1108,8 +1106,7 @@ func TestOutputService2ProtocolTestBlobCase1(t *testing.T) { } func TestOutputService3ProtocolTestListsCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("abc123requestid")) req, out := svc.OutputService3TestCaseOperation1Request(nil) @@ -1130,8 +1127,7 @@ func TestOutputService3ProtocolTestListsCase1(t *testing.T) { } func TestOutputService4ProtocolTestListWithCustomMemberNameCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("abc123requestid")) req, out := svc.OutputService4TestCaseOperation1Request(nil) @@ -1152,8 +1148,7 @@ func TestOutputService4ProtocolTestListWithCustomMemberNameCase1(t *testing.T) { } func TestOutputService5ProtocolTestFlattenedListCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("abc123requestid")) req, out := svc.OutputService5TestCaseOperation1Request(nil) @@ -1174,8 +1169,7 @@ func TestOutputService5ProtocolTestFlattenedListCase1(t *testing.T) { } func TestOutputService6ProtocolTestNormalMapCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) req, out := svc.OutputService6TestCaseOperation1Request(nil) @@ -1196,8 +1190,7 @@ func TestOutputService6ProtocolTestNormalMapCase1(t *testing.T) { } func TestOutputService7ProtocolTestFlattenedMapCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) req, out := svc.OutputService7TestCaseOperation1Request(nil) @@ -1218,8 +1211,7 @@ func TestOutputService7ProtocolTestFlattenedMapCase1(t *testing.T) { } func TestOutputService8ProtocolTestNamedMapCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService8ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) req, out := svc.OutputService8TestCaseOperation1Request(nil) @@ -1240,8 +1232,7 @@ func TestOutputService8ProtocolTestNamedMapCase1(t *testing.T) { } func TestOutputService9ProtocolTestEmptyStringCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService9ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("requestid")) req, out := svc.OutputService9TestCaseOperation1Request(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go index 7ad674278..aedc4440f 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go @@ -1,4 +1,4 @@ -// Package jsonutil provides JSON serialisation of AWS requests and responses. +// Package jsonutil provides JSON serialization of AWS requests and responses. package jsonutil import ( diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/build_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/build_test.go index bd7315865..42d9ab0ea 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/build_test.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/build_test.go @@ -16,9 +16,9 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" @@ -1230,8 +1230,7 @@ type InputService7TestShapeInputShape struct { // func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) { - sess := session.New() - svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService1TestShapeInputService1TestCaseOperation1Input{ Name: aws.String("myname"), } @@ -1257,8 +1256,7 @@ func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) { } func TestInputService2ProtocolTestTimestampValuesCase1(t *testing.T) { - sess := session.New() - svc := NewInputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService2TestShapeInputService2TestCaseOperation1Input{ TimeArg: aws.Time(time.Unix(1422172800, 0)), } @@ -1284,8 +1282,7 @@ func TestInputService2ProtocolTestTimestampValuesCase1(t *testing.T) { } func TestInputService3ProtocolTestBase64EncodedBlobsCase1(t *testing.T) { - sess := session.New() - svc := NewInputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService3TestShapeInputShape{ BlobArg: []byte("foo"), } @@ -1311,8 +1308,7 @@ func TestInputService3ProtocolTestBase64EncodedBlobsCase1(t *testing.T) { } func TestInputService3ProtocolTestBase64EncodedBlobsCase2(t *testing.T) { - sess := session.New() - svc := NewInputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService3TestShapeInputShape{ BlobMap: map[string][]byte{ "key1": []byte("foo"), @@ -1341,8 +1337,7 @@ func TestInputService3ProtocolTestBase64EncodedBlobsCase2(t *testing.T) { } func TestInputService4ProtocolTestNestedBlobsCase1(t *testing.T) { - sess := session.New() - svc := NewInputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService4TestShapeInputService4TestCaseOperation1Input{ ListParam: [][]byte{ []byte("foo"), @@ -1371,8 +1366,7 @@ func TestInputService4ProtocolTestNestedBlobsCase1(t *testing.T) { } func TestInputService5ProtocolTestRecursiveShapesCase1(t *testing.T) { - sess := session.New() - svc := NewInputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService5TestShapeInputShape{ RecursiveStruct: &InputService5TestShapeRecursiveStructType{ NoRecurse: aws.String("foo"), @@ -1400,8 +1394,7 @@ func TestInputService5ProtocolTestRecursiveShapesCase1(t *testing.T) { } func TestInputService5ProtocolTestRecursiveShapesCase2(t *testing.T) { - sess := session.New() - svc := NewInputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService5TestShapeInputShape{ RecursiveStruct: &InputService5TestShapeRecursiveStructType{ RecursiveStruct: &InputService5TestShapeRecursiveStructType{ @@ -1431,8 +1424,7 @@ func TestInputService5ProtocolTestRecursiveShapesCase2(t *testing.T) { } func TestInputService5ProtocolTestRecursiveShapesCase3(t *testing.T) { - sess := session.New() - svc := NewInputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService5TestShapeInputShape{ RecursiveStruct: &InputService5TestShapeRecursiveStructType{ RecursiveStruct: &InputService5TestShapeRecursiveStructType{ @@ -1466,8 +1458,7 @@ func TestInputService5ProtocolTestRecursiveShapesCase3(t *testing.T) { } func TestInputService5ProtocolTestRecursiveShapesCase4(t *testing.T) { - sess := session.New() - svc := NewInputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService5TestShapeInputShape{ RecursiveStruct: &InputService5TestShapeRecursiveStructType{ RecursiveList: []*InputService5TestShapeRecursiveStructType{ @@ -1502,8 +1493,7 @@ func TestInputService5ProtocolTestRecursiveShapesCase4(t *testing.T) { } func TestInputService5ProtocolTestRecursiveShapesCase5(t *testing.T) { - sess := session.New() - svc := NewInputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService5TestShapeInputShape{ RecursiveStruct: &InputService5TestShapeRecursiveStructType{ RecursiveList: []*InputService5TestShapeRecursiveStructType{ @@ -1540,8 +1530,7 @@ func TestInputService5ProtocolTestRecursiveShapesCase5(t *testing.T) { } func TestInputService5ProtocolTestRecursiveShapesCase6(t *testing.T) { - sess := session.New() - svc := NewInputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService5TestShapeInputShape{ RecursiveStruct: &InputService5TestShapeRecursiveStructType{ RecursiveMap: map[string]*InputService5TestShapeRecursiveStructType{ @@ -1576,8 +1565,7 @@ func TestInputService5ProtocolTestRecursiveShapesCase6(t *testing.T) { } func TestInputService6ProtocolTestEmptyMapsCase1(t *testing.T) { - sess := session.New() - svc := NewInputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService6TestShapeInputService6TestCaseOperation1Input{ Map: map[string]*string{}, } @@ -1603,8 +1591,7 @@ func TestInputService6ProtocolTestEmptyMapsCase1(t *testing.T) { } func TestInputService7ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { - sess := session.New() - svc := NewInputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService7TestShapeInputShape{ Token: aws.String("abc123"), } @@ -1628,8 +1615,7 @@ func TestInputService7ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { } func TestInputService7ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) { - sess := session.New() - svc := NewInputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService7TestShapeInputShape{} req, _ := svc.InputService7TestCaseOperation2Request(input) r := req.HTTPRequest diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go index 7aff0e0fa..d5490cd7f 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go @@ -1,4 +1,4 @@ -// Package jsonrpc provides JSON RPC utilities for serialisation of AWS +// Package jsonrpc provides JSON RPC utilities for serialization of AWS // requests and responses. package jsonrpc diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_test.go index 5f6c4c989..e1fcac8b3 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_test.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_test.go @@ -16,9 +16,9 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" @@ -810,8 +810,7 @@ type OutputService6TestShapeOutputService6TestCaseOperation1Output struct { // func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{\"Str\": \"myname\", \"Num\": 123, \"FalseBool\": false, \"TrueBool\": true, \"Float\": 1.2, \"Double\": 1.3, \"Long\": 200, \"Char\": \"a\"}")) req, out := svc.OutputService1TestCaseOperation1Request(nil) @@ -838,8 +837,7 @@ func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) { } func TestOutputService2ProtocolTestBlobMembersCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{\"BlobMember\": \"aGkh\", \"StructMember\": {\"foo\": \"dGhlcmUh\"}}")) req, out := svc.OutputService2TestCaseOperation1Request(nil) @@ -860,8 +858,7 @@ func TestOutputService2ProtocolTestBlobMembersCase1(t *testing.T) { } func TestOutputService3ProtocolTestTimestampMembersCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{\"TimeMember\": 1398796238, \"StructMember\": {\"foo\": 1398796238}}")) req, out := svc.OutputService3TestCaseOperation1Request(nil) @@ -882,8 +879,7 @@ func TestOutputService3ProtocolTestTimestampMembersCase1(t *testing.T) { } func TestOutputService4ProtocolTestListsCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{\"ListMember\": [\"a\", \"b\"]}")) req, out := svc.OutputService4TestCaseOperation1Request(nil) @@ -904,8 +900,7 @@ func TestOutputService4ProtocolTestListsCase1(t *testing.T) { } func TestOutputService4ProtocolTestListsCase2(t *testing.T) { - sess := session.New() - svc := NewOutputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{\"ListMember\": [\"a\", null], \"ListMemberMap\": [{}, null, null, {}], \"ListMemberStruct\": [{}, null, null, {}]}")) req, out := svc.OutputService4TestCaseOperation2Request(nil) @@ -930,8 +925,7 @@ func TestOutputService4ProtocolTestListsCase2(t *testing.T) { } func TestOutputService5ProtocolTestMapsCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{\"MapMember\": {\"a\": [1, 2], \"b\": [3, 4]}}")) req, out := svc.OutputService5TestCaseOperation1Request(nil) @@ -954,8 +948,7 @@ func TestOutputService5ProtocolTestMapsCase1(t *testing.T) { } func TestOutputService6ProtocolTestIgnoresExtraDataCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{\"foo\": \"bar\"}")) req, out := svc.OutputService6TestCaseOperation1Request(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go index 56d69db05..c705481c3 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go @@ -1,4 +1,4 @@ -// Package query provides serialisation of AWS query requests, and responses. +// Package query provides serialization of AWS query requests, and responses. package query //go:generate go run ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/query.json build_test.go diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build_test.go index 6d05621ad..1496e94da 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build_test.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build_test.go @@ -16,9 +16,9 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/query" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" @@ -2055,8 +2055,7 @@ type InputService13TestShapeInputShape struct { // func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) { - sess := session.New() - svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService1TestShapeInputShape{ Bar: aws.String("val2"), Foo: aws.String("val1"), @@ -2081,8 +2080,7 @@ func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) { } func TestInputService1ProtocolTestScalarMembersCase2(t *testing.T) { - sess := session.New() - svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService1TestShapeInputShape{ Baz: aws.Bool(true), } @@ -2106,8 +2104,7 @@ func TestInputService1ProtocolTestScalarMembersCase2(t *testing.T) { } func TestInputService1ProtocolTestScalarMembersCase3(t *testing.T) { - sess := session.New() - svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService1TestShapeInputShape{ Baz: aws.Bool(false), } @@ -2131,8 +2128,7 @@ func TestInputService1ProtocolTestScalarMembersCase3(t *testing.T) { } func TestInputService2ProtocolTestNestedStructureMembersCase1(t *testing.T) { - sess := session.New() - svc := NewInputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService2TestShapeInputService2TestCaseOperation1Input{ StructArg: &InputService2TestShapeStructType{ ScalarArg: aws.String("foo"), @@ -2158,8 +2154,7 @@ func TestInputService2ProtocolTestNestedStructureMembersCase1(t *testing.T) { } func TestInputService3ProtocolTestListTypesCase1(t *testing.T) { - sess := session.New() - svc := NewInputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService3TestShapeInputShape{ ListArg: []*string{ aws.String("foo"), @@ -2187,8 +2182,7 @@ func TestInputService3ProtocolTestListTypesCase1(t *testing.T) { } func TestInputService3ProtocolTestListTypesCase2(t *testing.T) { - sess := session.New() - svc := NewInputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService3TestShapeInputShape{ ListArg: []*string{}, } @@ -2212,8 +2206,7 @@ func TestInputService3ProtocolTestListTypesCase2(t *testing.T) { } func TestInputService4ProtocolTestFlattenedListCase1(t *testing.T) { - sess := session.New() - svc := NewInputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService4TestShapeInputShape{ ListArg: []*string{ aws.String("a"), @@ -2242,8 +2235,7 @@ func TestInputService4ProtocolTestFlattenedListCase1(t *testing.T) { } func TestInputService4ProtocolTestFlattenedListCase2(t *testing.T) { - sess := session.New() - svc := NewInputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService4TestShapeInputShape{ NamedListArg: []*string{ aws.String("a"), @@ -2269,8 +2261,7 @@ func TestInputService4ProtocolTestFlattenedListCase2(t *testing.T) { } func TestInputService5ProtocolTestSerializeFlattenedMapTypeCase1(t *testing.T) { - sess := session.New() - svc := NewInputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService5TestShapeInputService5TestCaseOperation1Input{ MapArg: map[string]*string{ "key1": aws.String("val1"), @@ -2297,8 +2288,7 @@ func TestInputService5ProtocolTestSerializeFlattenedMapTypeCase1(t *testing.T) { } func TestInputService6ProtocolTestNonFlattenedListWithLocationNameCase1(t *testing.T) { - sess := session.New() - svc := NewInputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService6TestShapeInputService6TestCaseOperation1Input{ ListArg: []*string{ aws.String("a"), @@ -2326,8 +2316,7 @@ func TestInputService6ProtocolTestNonFlattenedListWithLocationNameCase1(t *testi } func TestInputService7ProtocolTestFlattenedListWithLocationNameCase1(t *testing.T) { - sess := session.New() - svc := NewInputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService7TestShapeInputService7TestCaseOperation1Input{ ListArg: []*string{ aws.String("a"), @@ -2356,8 +2345,7 @@ func TestInputService7ProtocolTestFlattenedListWithLocationNameCase1(t *testing. } func TestInputService8ProtocolTestSerializeMapTypeCase1(t *testing.T) { - sess := session.New() - svc := NewInputService8ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService8TestShapeInputService8TestCaseOperation1Input{ MapArg: map[string]*string{ "key1": aws.String("val1"), @@ -2384,8 +2372,7 @@ func TestInputService8ProtocolTestSerializeMapTypeCase1(t *testing.T) { } func TestInputService9ProtocolTestSerializeMapTypeWithLocationNameCase1(t *testing.T) { - sess := session.New() - svc := NewInputService9ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService9TestShapeInputService9TestCaseOperation1Input{ MapArg: map[string]*string{ "key1": aws.String("val1"), @@ -2412,8 +2399,7 @@ func TestInputService9ProtocolTestSerializeMapTypeWithLocationNameCase1(t *testi } func TestInputService10ProtocolTestBase64EncodedBlobsCase1(t *testing.T) { - sess := session.New() - svc := NewInputService10ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService10TestShapeInputService10TestCaseOperation1Input{ BlobArg: []byte("foo"), } @@ -2437,8 +2423,7 @@ func TestInputService10ProtocolTestBase64EncodedBlobsCase1(t *testing.T) { } func TestInputService11ProtocolTestTimestampValuesCase1(t *testing.T) { - sess := session.New() - svc := NewInputService11ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService11TestShapeInputService11TestCaseOperation1Input{ TimeArg: aws.Time(time.Unix(1422172800, 0)), } @@ -2462,8 +2447,7 @@ func TestInputService11ProtocolTestTimestampValuesCase1(t *testing.T) { } func TestInputService12ProtocolTestRecursiveShapesCase1(t *testing.T) { - sess := session.New() - svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService12TestShapeInputShape{ RecursiveStruct: &InputService12TestShapeRecursiveStructType{ NoRecurse: aws.String("foo"), @@ -2489,8 +2473,7 @@ func TestInputService12ProtocolTestRecursiveShapesCase1(t *testing.T) { } func TestInputService12ProtocolTestRecursiveShapesCase2(t *testing.T) { - sess := session.New() - svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService12TestShapeInputShape{ RecursiveStruct: &InputService12TestShapeRecursiveStructType{ RecursiveStruct: &InputService12TestShapeRecursiveStructType{ @@ -2518,8 +2501,7 @@ func TestInputService12ProtocolTestRecursiveShapesCase2(t *testing.T) { } func TestInputService12ProtocolTestRecursiveShapesCase3(t *testing.T) { - sess := session.New() - svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService12TestShapeInputShape{ RecursiveStruct: &InputService12TestShapeRecursiveStructType{ RecursiveStruct: &InputService12TestShapeRecursiveStructType{ @@ -2551,8 +2533,7 @@ func TestInputService12ProtocolTestRecursiveShapesCase3(t *testing.T) { } func TestInputService12ProtocolTestRecursiveShapesCase4(t *testing.T) { - sess := session.New() - svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService12TestShapeInputShape{ RecursiveStruct: &InputService12TestShapeRecursiveStructType{ RecursiveList: []*InputService12TestShapeRecursiveStructType{ @@ -2585,8 +2566,7 @@ func TestInputService12ProtocolTestRecursiveShapesCase4(t *testing.T) { } func TestInputService12ProtocolTestRecursiveShapesCase5(t *testing.T) { - sess := session.New() - svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService12TestShapeInputShape{ RecursiveStruct: &InputService12TestShapeRecursiveStructType{ RecursiveList: []*InputService12TestShapeRecursiveStructType{ @@ -2621,8 +2601,7 @@ func TestInputService12ProtocolTestRecursiveShapesCase5(t *testing.T) { } func TestInputService12ProtocolTestRecursiveShapesCase6(t *testing.T) { - sess := session.New() - svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService12TestShapeInputShape{ RecursiveStruct: &InputService12TestShapeRecursiveStructType{ RecursiveMap: map[string]*InputService12TestShapeRecursiveStructType{ @@ -2655,8 +2634,7 @@ func TestInputService12ProtocolTestRecursiveShapesCase6(t *testing.T) { } func TestInputService13ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { - sess := session.New() - svc := NewInputService13ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService13TestShapeInputShape{ Token: aws.String("abc123"), } @@ -2680,8 +2658,7 @@ func TestInputService13ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { } func TestInputService13ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) { - sess := session.New() - svc := NewInputService13ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService13TestShapeInputShape{} req, _ := svc.InputService13TestCaseOperation2Request(input) r := req.HTTPRequest diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_test.go index 98a82a73d..dbe0d99ed 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_test.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_test.go @@ -16,9 +16,9 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/query" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" @@ -1743,8 +1743,7 @@ type OutputService15TestShapeOutputService15TestCaseOperation1Output struct { // func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("myname123falsetrue1.21.3200a2015-01-25T08:00:00Zrequest-id")) req, out := svc.OutputService1TestCaseOperation1Request(nil) @@ -1772,8 +1771,7 @@ func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) { } func TestOutputService2ProtocolTestNotAllMembersInResponseCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("mynamerequest-id")) req, out := svc.OutputService2TestCaseOperation1Request(nil) @@ -1793,8 +1791,7 @@ func TestOutputService2ProtocolTestNotAllMembersInResponseCase1(t *testing.T) { } func TestOutputService3ProtocolTestBlobCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("dmFsdWU=requestid")) req, out := svc.OutputService3TestCaseOperation1Request(nil) @@ -1814,8 +1811,7 @@ func TestOutputService3ProtocolTestBlobCase1(t *testing.T) { } func TestOutputService4ProtocolTestListsCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("abc123requestid")) req, out := svc.OutputService4TestCaseOperation1Request(nil) @@ -1836,8 +1832,7 @@ func TestOutputService4ProtocolTestListsCase1(t *testing.T) { } func TestOutputService5ProtocolTestListWithCustomMemberNameCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("abc123requestid")) req, out := svc.OutputService5TestCaseOperation1Request(nil) @@ -1858,8 +1853,7 @@ func TestOutputService5ProtocolTestListWithCustomMemberNameCase1(t *testing.T) { } func TestOutputService6ProtocolTestFlattenedListCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("abc123requestid")) req, out := svc.OutputService6TestCaseOperation1Request(nil) @@ -1880,8 +1874,7 @@ func TestOutputService6ProtocolTestFlattenedListCase1(t *testing.T) { } func TestOutputService7ProtocolTestFlattenedSingleElementListCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("abcrequestid")) req, out := svc.OutputService7TestCaseOperation1Request(nil) @@ -1901,8 +1894,7 @@ func TestOutputService7ProtocolTestFlattenedSingleElementListCase1(t *testing.T) } func TestOutputService8ProtocolTestListOfStructuresCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService8ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("firstfoofirstbarfirstbazsecondfoosecondbarsecondbazrequestid")) req, out := svc.OutputService8TestCaseOperation1Request(nil) @@ -1927,8 +1919,7 @@ func TestOutputService8ProtocolTestListOfStructuresCase1(t *testing.T) { } func TestOutputService9ProtocolTestFlattenedListOfStructuresCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService9ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("firstfoofirstbarfirstbazsecondfoosecondbarsecondbazrequestid")) req, out := svc.OutputService9TestCaseOperation1Request(nil) @@ -1953,8 +1944,7 @@ func TestOutputService9ProtocolTestFlattenedListOfStructuresCase1(t *testing.T) } func TestOutputService10ProtocolTestFlattenedListWithLocationNameCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService10ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("abrequestid")) req, out := svc.OutputService10TestCaseOperation1Request(nil) @@ -1975,8 +1965,7 @@ func TestOutputService10ProtocolTestFlattenedListWithLocationNameCase1(t *testin } func TestOutputService11ProtocolTestNormalMapCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService11ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) req, out := svc.OutputService11TestCaseOperation1Request(nil) @@ -1997,8 +1986,7 @@ func TestOutputService11ProtocolTestNormalMapCase1(t *testing.T) { } func TestOutputService12ProtocolTestFlattenedMapCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) req, out := svc.OutputService12TestCaseOperation1Request(nil) @@ -2019,8 +2007,7 @@ func TestOutputService12ProtocolTestFlattenedMapCase1(t *testing.T) { } func TestOutputService13ProtocolTestFlattenedMapInShapeDefinitionCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService13ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("quxbarrequestid")) req, out := svc.OutputService13TestCaseOperation1Request(nil) @@ -2040,8 +2027,7 @@ func TestOutputService13ProtocolTestFlattenedMapInShapeDefinitionCase1(t *testin } func TestOutputService14ProtocolTestNamedMapCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService14ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService14ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) req, out := svc.OutputService14TestCaseOperation1Request(nil) @@ -2062,8 +2048,7 @@ func TestOutputService14ProtocolTestNamedMapCase1(t *testing.T) { } func TestOutputService15ProtocolTestEmptyStringCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService15ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("requestid")) req, out := svc.OutputService15TestCaseOperation1Request(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/build_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/build_test.go index e9d3c86f8..4d0269da1 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/build_test.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/build_test.go @@ -16,9 +16,9 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/restjson" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" @@ -2814,8 +2814,7 @@ type InputService19TestShapeInputShape struct { // func TestInputService1ProtocolTestNoParametersCase1(t *testing.T) { - sess := session.New() - svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) req, _ := svc.InputService1TestCaseOperation1Request(nil) r := req.HTTPRequest @@ -2831,8 +2830,7 @@ func TestInputService1ProtocolTestNoParametersCase1(t *testing.T) { } func TestInputService2ProtocolTestURIParameterOnlyWithNoLocationNameCase1(t *testing.T) { - sess := session.New() - svc := NewInputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService2TestShapeInputService2TestCaseOperation1Input{ PipelineId: aws.String("foo"), } @@ -2851,8 +2849,7 @@ func TestInputService2ProtocolTestURIParameterOnlyWithNoLocationNameCase1(t *tes } func TestInputService3ProtocolTestURIParameterOnlyWithLocationNameCase1(t *testing.T) { - sess := session.New() - svc := NewInputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService3TestShapeInputService3TestCaseOperation1Input{ Foo: aws.String("bar"), } @@ -2871,8 +2868,7 @@ func TestInputService3ProtocolTestURIParameterOnlyWithLocationNameCase1(t *testi } func TestInputService4ProtocolTestQuerystringListOfStringsCase1(t *testing.T) { - sess := session.New() - svc := NewInputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService4TestShapeInputService4TestCaseOperation1Input{ Items: []*string{ aws.String("value1"), @@ -2894,8 +2890,7 @@ func TestInputService4ProtocolTestQuerystringListOfStringsCase1(t *testing.T) { } func TestInputService5ProtocolTestStringToStringMapsInQuerystringCase1(t *testing.T) { - sess := session.New() - svc := NewInputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService5TestShapeInputService5TestCaseOperation1Input{ PipelineId: aws.String("foo"), QueryDoc: map[string]*string{ @@ -2918,8 +2913,7 @@ func TestInputService5ProtocolTestStringToStringMapsInQuerystringCase1(t *testin } func TestInputService6ProtocolTestStringToStringListMapsInQuerystringCase1(t *testing.T) { - sess := session.New() - svc := NewInputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService6TestShapeInputService6TestCaseOperation1Input{ PipelineId: aws.String("id"), QueryDoc: map[string][]*string{ @@ -2948,8 +2942,7 @@ func TestInputService6ProtocolTestStringToStringListMapsInQuerystringCase1(t *te } func TestInputService7ProtocolTestURIParameterAndQuerystringParamsCase1(t *testing.T) { - sess := session.New() - svc := NewInputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService7TestShapeInputService7TestCaseOperation1Input{ Ascending: aws.String("true"), PageToken: aws.String("bar"), @@ -2970,8 +2963,7 @@ func TestInputService7ProtocolTestURIParameterAndQuerystringParamsCase1(t *testi } func TestInputService8ProtocolTestURIParameterQuerystringParamsAndJSONBodyCase1(t *testing.T) { - sess := session.New() - svc := NewInputService8ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService8TestShapeInputService8TestCaseOperation1Input{ Ascending: aws.String("true"), Config: &InputService8TestShapeStructType{ @@ -3001,8 +2993,7 @@ func TestInputService8ProtocolTestURIParameterQuerystringParamsAndJSONBodyCase1( } func TestInputService9ProtocolTestURIParameterQuerystringParamsHeadersAndJSONBodyCase1(t *testing.T) { - sess := session.New() - svc := NewInputService9ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService9TestShapeInputService9TestCaseOperation1Input{ Ascending: aws.String("true"), Checksum: aws.String("12345"), @@ -3034,8 +3025,7 @@ func TestInputService9ProtocolTestURIParameterQuerystringParamsHeadersAndJSONBod } func TestInputService10ProtocolTestStreamingPayloadCase1(t *testing.T) { - sess := session.New() - svc := NewInputService10ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService10TestShapeInputService10TestCaseOperation1Input{ Body: aws.ReadSeekCloser(bytes.NewBufferString("contents")), Checksum: aws.String("foo"), @@ -3062,8 +3052,7 @@ func TestInputService10ProtocolTestStreamingPayloadCase1(t *testing.T) { } func TestInputService11ProtocolTestSerializeBlobsInBodyCase1(t *testing.T) { - sess := session.New() - svc := NewInputService11ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService11TestShapeInputService11TestCaseOperation1Input{ Bar: []byte("Blob param"), Foo: aws.String("foo_name"), @@ -3088,8 +3077,7 @@ func TestInputService11ProtocolTestSerializeBlobsInBodyCase1(t *testing.T) { } func TestInputService12ProtocolTestBlobPayloadCase1(t *testing.T) { - sess := session.New() - svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService12TestShapeInputShape{ Foo: []byte("bar"), } @@ -3113,8 +3101,7 @@ func TestInputService12ProtocolTestBlobPayloadCase1(t *testing.T) { } func TestInputService12ProtocolTestBlobPayloadCase2(t *testing.T) { - sess := session.New() - svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService12TestShapeInputShape{} req, _ := svc.InputService12TestCaseOperation2Request(input) r := req.HTTPRequest @@ -3131,8 +3118,7 @@ func TestInputService12ProtocolTestBlobPayloadCase2(t *testing.T) { } func TestInputService13ProtocolTestStructurePayloadCase1(t *testing.T) { - sess := session.New() - svc := NewInputService13ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService13TestShapeInputShape{ Foo: &InputService13TestShapeFooShape{ Baz: aws.String("bar"), @@ -3158,8 +3144,7 @@ func TestInputService13ProtocolTestStructurePayloadCase1(t *testing.T) { } func TestInputService13ProtocolTestStructurePayloadCase2(t *testing.T) { - sess := session.New() - svc := NewInputService13ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService13TestShapeInputShape{} req, _ := svc.InputService13TestCaseOperation2Request(input) r := req.HTTPRequest @@ -3176,8 +3161,7 @@ func TestInputService13ProtocolTestStructurePayloadCase2(t *testing.T) { } func TestInputService14ProtocolTestOmitsNullQueryParamsButSerializesEmptyStringsCase1(t *testing.T) { - sess := session.New() - svc := NewInputService14ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService14ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService14TestShapeInputShape{} req, _ := svc.InputService14TestCaseOperation1Request(input) r := req.HTTPRequest @@ -3194,8 +3178,7 @@ func TestInputService14ProtocolTestOmitsNullQueryParamsButSerializesEmptyStrings } func TestInputService14ProtocolTestOmitsNullQueryParamsButSerializesEmptyStringsCase2(t *testing.T) { - sess := session.New() - svc := NewInputService14ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService14ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService14TestShapeInputShape{ Foo: aws.String(""), } @@ -3214,8 +3197,7 @@ func TestInputService14ProtocolTestOmitsNullQueryParamsButSerializesEmptyStrings } func TestInputService15ProtocolTestRecursiveShapesCase1(t *testing.T) { - sess := session.New() - svc := NewInputService15ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService15TestShapeInputShape{ RecursiveStruct: &InputService15TestShapeRecursiveStructType{ NoRecurse: aws.String("foo"), @@ -3241,8 +3223,7 @@ func TestInputService15ProtocolTestRecursiveShapesCase1(t *testing.T) { } func TestInputService15ProtocolTestRecursiveShapesCase2(t *testing.T) { - sess := session.New() - svc := NewInputService15ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService15TestShapeInputShape{ RecursiveStruct: &InputService15TestShapeRecursiveStructType{ RecursiveStruct: &InputService15TestShapeRecursiveStructType{ @@ -3270,8 +3251,7 @@ func TestInputService15ProtocolTestRecursiveShapesCase2(t *testing.T) { } func TestInputService15ProtocolTestRecursiveShapesCase3(t *testing.T) { - sess := session.New() - svc := NewInputService15ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService15TestShapeInputShape{ RecursiveStruct: &InputService15TestShapeRecursiveStructType{ RecursiveStruct: &InputService15TestShapeRecursiveStructType{ @@ -3303,8 +3283,7 @@ func TestInputService15ProtocolTestRecursiveShapesCase3(t *testing.T) { } func TestInputService15ProtocolTestRecursiveShapesCase4(t *testing.T) { - sess := session.New() - svc := NewInputService15ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService15TestShapeInputShape{ RecursiveStruct: &InputService15TestShapeRecursiveStructType{ RecursiveList: []*InputService15TestShapeRecursiveStructType{ @@ -3337,8 +3316,7 @@ func TestInputService15ProtocolTestRecursiveShapesCase4(t *testing.T) { } func TestInputService15ProtocolTestRecursiveShapesCase5(t *testing.T) { - sess := session.New() - svc := NewInputService15ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService15TestShapeInputShape{ RecursiveStruct: &InputService15TestShapeRecursiveStructType{ RecursiveList: []*InputService15TestShapeRecursiveStructType{ @@ -3373,8 +3351,7 @@ func TestInputService15ProtocolTestRecursiveShapesCase5(t *testing.T) { } func TestInputService15ProtocolTestRecursiveShapesCase6(t *testing.T) { - sess := session.New() - svc := NewInputService15ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService15TestShapeInputShape{ RecursiveStruct: &InputService15TestShapeRecursiveStructType{ RecursiveMap: map[string]*InputService15TestShapeRecursiveStructType{ @@ -3407,8 +3384,7 @@ func TestInputService15ProtocolTestRecursiveShapesCase6(t *testing.T) { } func TestInputService16ProtocolTestTimestampValuesCase1(t *testing.T) { - sess := session.New() - svc := NewInputService16ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService16ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService16TestShapeInputShape{ TimeArg: aws.Time(time.Unix(1422172800, 0)), } @@ -3432,8 +3408,7 @@ func TestInputService16ProtocolTestTimestampValuesCase1(t *testing.T) { } func TestInputService16ProtocolTestTimestampValuesCase2(t *testing.T) { - sess := session.New() - svc := NewInputService16ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService16ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService16TestShapeInputShape{ TimeArgInHeader: aws.Time(time.Unix(1422172800, 0)), } @@ -3453,8 +3428,7 @@ func TestInputService16ProtocolTestTimestampValuesCase2(t *testing.T) { } func TestInputService17ProtocolTestNamedLocationsInJSONBodyCase1(t *testing.T) { - sess := session.New() - svc := NewInputService17ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService17ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService17TestShapeInputService17TestCaseOperation1Input{ TimeArg: aws.Time(time.Unix(1422172800, 0)), } @@ -3478,8 +3452,7 @@ func TestInputService17ProtocolTestNamedLocationsInJSONBodyCase1(t *testing.T) { } func TestInputService18ProtocolTestStringPayloadCase1(t *testing.T) { - sess := session.New() - svc := NewInputService18ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService18ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService18TestShapeInputService18TestCaseOperation1Input{ Foo: aws.String("bar"), } @@ -3503,8 +3476,7 @@ func TestInputService18ProtocolTestStringPayloadCase1(t *testing.T) { } func TestInputService19ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { - sess := session.New() - svc := NewInputService19ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService19ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService19TestShapeInputShape{ Token: aws.String("abc123"), } @@ -3528,8 +3500,7 @@ func TestInputService19ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { } func TestInputService19ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) { - sess := session.New() - svc := NewInputService19ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService19ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService19TestShapeInputShape{} req, _ := svc.InputService19TestCaseOperation2Request(input) r := req.HTTPRequest diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/restjson.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/restjson.go index 2c95a9858..9e98525bb 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/restjson.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/restjson.go @@ -1,4 +1,4 @@ -// Package restjson provides RESTful JSON serialisation of AWS +// Package restjson provides RESTful JSON serialization of AWS // requests and responses. package restjson diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_test.go index 4011c003a..d6590c9b9 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_test.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_test.go @@ -16,9 +16,9 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/restjson" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" @@ -1312,8 +1312,7 @@ type OutputService11TestShapeOutputService11TestCaseOperation1Output struct { // func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{\"Str\": \"myname\", \"Num\": 123, \"FalseBool\": false, \"TrueBool\": true, \"Float\": 1.2, \"Double\": 1.3, \"Long\": 200, \"Char\": \"a\"}")) req, out := svc.OutputService1TestCaseOperation1Request(nil) @@ -1345,8 +1344,7 @@ func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) { } func TestOutputService2ProtocolTestBlobMembersCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{\"BlobMember\": \"aGkh\", \"StructMember\": {\"foo\": \"dGhlcmUh\"}}")) req, out := svc.OutputService2TestCaseOperation1Request(nil) @@ -1367,8 +1365,7 @@ func TestOutputService2ProtocolTestBlobMembersCase1(t *testing.T) { } func TestOutputService3ProtocolTestTimestampMembersCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{\"TimeMember\": 1398796238, \"StructMember\": {\"foo\": 1398796238}}")) req, out := svc.OutputService3TestCaseOperation1Request(nil) @@ -1389,8 +1386,7 @@ func TestOutputService3ProtocolTestTimestampMembersCase1(t *testing.T) { } func TestOutputService4ProtocolTestListsCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{\"ListMember\": [\"a\", \"b\"]}")) req, out := svc.OutputService4TestCaseOperation1Request(nil) @@ -1411,8 +1407,7 @@ func TestOutputService4ProtocolTestListsCase1(t *testing.T) { } func TestOutputService5ProtocolTestListsWithStructureMemberCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{\"ListMember\": [{\"Foo\": \"a\"}, {\"Foo\": \"b\"}]}")) req, out := svc.OutputService5TestCaseOperation1Request(nil) @@ -1433,8 +1428,7 @@ func TestOutputService5ProtocolTestListsWithStructureMemberCase1(t *testing.T) { } func TestOutputService6ProtocolTestMapsCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{\"MapMember\": {\"a\": [1, 2], \"b\": [3, 4]}}")) req, out := svc.OutputService6TestCaseOperation1Request(nil) @@ -1457,8 +1451,7 @@ func TestOutputService6ProtocolTestMapsCase1(t *testing.T) { } func TestOutputService7ProtocolTestComplexMapValuesCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{\"MapMember\": {\"a\": 1398796238, \"b\": 1398796238}}")) req, out := svc.OutputService7TestCaseOperation1Request(nil) @@ -1479,8 +1472,7 @@ func TestOutputService7ProtocolTestComplexMapValuesCase1(t *testing.T) { } func TestOutputService8ProtocolTestIgnoresExtraDataCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService8ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{\"foo\": \"bar\"}")) req, out := svc.OutputService8TestCaseOperation1Request(nil) @@ -1499,8 +1491,7 @@ func TestOutputService8ProtocolTestIgnoresExtraDataCase1(t *testing.T) { } func TestOutputService9ProtocolTestSupportsHeaderMapsCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService9ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{}")) req, out := svc.OutputService9TestCaseOperation1Request(nil) @@ -1527,8 +1518,7 @@ func TestOutputService9ProtocolTestSupportsHeaderMapsCase1(t *testing.T) { } func TestOutputService10ProtocolTestJSONPayloadCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService10ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("{\"Foo\": \"abc\"}")) req, out := svc.OutputService10TestCaseOperation1Request(nil) @@ -1550,8 +1540,7 @@ func TestOutputService10ProtocolTestJSONPayloadCase1(t *testing.T) { } func TestOutputService11ProtocolTestStreamingPayloadCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService11ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("abc")) req, out := svc.OutputService11TestCaseOperation1Request(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/build_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/build_test.go index 947487de7..6263877e2 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/build_test.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/build_test.go @@ -16,9 +16,9 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/restxml" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" @@ -3474,8 +3474,7 @@ type InputService23TestShapeInputShape struct { // func TestInputService1ProtocolTestBasicXMLSerializationCase1(t *testing.T) { - sess := session.New() - svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService1TestShapeInputShape{ Description: aws.String("bar"), Name: aws.String("foo"), @@ -3500,8 +3499,7 @@ func TestInputService1ProtocolTestBasicXMLSerializationCase1(t *testing.T) { } func TestInputService1ProtocolTestBasicXMLSerializationCase2(t *testing.T) { - sess := session.New() - svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService1TestShapeInputShape{ Description: aws.String("bar"), Name: aws.String("foo"), @@ -3526,8 +3524,7 @@ func TestInputService1ProtocolTestBasicXMLSerializationCase2(t *testing.T) { } func TestInputService1ProtocolTestBasicXMLSerializationCase3(t *testing.T) { - sess := session.New() - svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService1TestShapeInputService1TestCaseOperation3Input{} req, _ := svc.InputService1TestCaseOperation3Request(input) r := req.HTTPRequest @@ -3544,8 +3541,7 @@ func TestInputService1ProtocolTestBasicXMLSerializationCase3(t *testing.T) { } func TestInputService2ProtocolTestSerializeOtherScalarTypesCase1(t *testing.T) { - sess := session.New() - svc := NewInputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService2TestShapeInputService2TestCaseOperation1Input{ First: aws.Bool(true), Fourth: aws.Int64(3), @@ -3572,8 +3568,7 @@ func TestInputService2ProtocolTestSerializeOtherScalarTypesCase1(t *testing.T) { } func TestInputService3ProtocolTestNestedStructuresCase1(t *testing.T) { - sess := session.New() - svc := NewInputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService3TestShapeInputShape{ Description: aws.String("baz"), SubStructure: &InputService3TestShapeSubStructure{ @@ -3601,8 +3596,7 @@ func TestInputService3ProtocolTestNestedStructuresCase1(t *testing.T) { } func TestInputService3ProtocolTestNestedStructuresCase2(t *testing.T) { - sess := session.New() - svc := NewInputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService3TestShapeInputShape{ Description: aws.String("baz"), SubStructure: &InputService3TestShapeSubStructure{ @@ -3629,8 +3623,7 @@ func TestInputService3ProtocolTestNestedStructuresCase2(t *testing.T) { } func TestInputService4ProtocolTestNestedStructuresCase1(t *testing.T) { - sess := session.New() - svc := NewInputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService4TestShapeInputService4TestCaseOperation1Input{ Description: aws.String("baz"), SubStructure: &InputService4TestShapeSubStructure{}, @@ -3655,8 +3648,7 @@ func TestInputService4ProtocolTestNestedStructuresCase1(t *testing.T) { } func TestInputService5ProtocolTestNonFlattenedListsCase1(t *testing.T) { - sess := session.New() - svc := NewInputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService5TestShapeInputService5TestCaseOperation1Input{ ListParam: []*string{ aws.String("one"), @@ -3684,8 +3676,7 @@ func TestInputService5ProtocolTestNonFlattenedListsCase1(t *testing.T) { } func TestInputService6ProtocolTestNonFlattenedListsWithLocationNameCase1(t *testing.T) { - sess := session.New() - svc := NewInputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService6TestShapeInputService6TestCaseOperation1Input{ ListParam: []*string{ aws.String("one"), @@ -3713,8 +3704,7 @@ func TestInputService6ProtocolTestNonFlattenedListsWithLocationNameCase1(t *test } func TestInputService7ProtocolTestFlattenedListsCase1(t *testing.T) { - sess := session.New() - svc := NewInputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService7TestShapeInputService7TestCaseOperation1Input{ ListParam: []*string{ aws.String("one"), @@ -3742,8 +3732,7 @@ func TestInputService7ProtocolTestFlattenedListsCase1(t *testing.T) { } func TestInputService8ProtocolTestFlattenedListsWithLocationNameCase1(t *testing.T) { - sess := session.New() - svc := NewInputService8ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService8TestShapeInputService8TestCaseOperation1Input{ ListParam: []*string{ aws.String("one"), @@ -3771,8 +3760,7 @@ func TestInputService8ProtocolTestFlattenedListsWithLocationNameCase1(t *testing } func TestInputService9ProtocolTestListOfStructuresCase1(t *testing.T) { - sess := session.New() - svc := NewInputService9ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService9TestShapeInputService9TestCaseOperation1Input{ ListParam: []*InputService9TestShapeSingleFieldStruct{ { @@ -3806,8 +3794,7 @@ func TestInputService9ProtocolTestListOfStructuresCase1(t *testing.T) { } func TestInputService10ProtocolTestBlobAndTimestampShapesCase1(t *testing.T) { - sess := session.New() - svc := NewInputService10ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService10TestShapeInputService10TestCaseOperation1Input{ StructureParam: &InputService10TestShapeStructureShape{ B: []byte("foo"), @@ -3834,8 +3821,7 @@ func TestInputService10ProtocolTestBlobAndTimestampShapesCase1(t *testing.T) { } func TestInputService11ProtocolTestHeaderMapsCase1(t *testing.T) { - sess := session.New() - svc := NewInputService11ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService11TestShapeInputService11TestCaseOperation1Input{ Foo: map[string]*string{ "a": aws.String("b"), @@ -3859,8 +3845,7 @@ func TestInputService11ProtocolTestHeaderMapsCase1(t *testing.T) { } func TestInputService12ProtocolTestQuerystringListOfStringsCase1(t *testing.T) { - sess := session.New() - svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService12TestShapeInputService12TestCaseOperation1Input{ Items: []*string{ aws.String("value1"), @@ -3882,8 +3867,7 @@ func TestInputService12ProtocolTestQuerystringListOfStringsCase1(t *testing.T) { } func TestInputService13ProtocolTestStringToStringMapsInQuerystringCase1(t *testing.T) { - sess := session.New() - svc := NewInputService13ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService13TestShapeInputService13TestCaseOperation1Input{ PipelineId: aws.String("foo"), QueryDoc: map[string]*string{ @@ -3906,8 +3890,7 @@ func TestInputService13ProtocolTestStringToStringMapsInQuerystringCase1(t *testi } func TestInputService14ProtocolTestStringToStringListMapsInQuerystringCase1(t *testing.T) { - sess := session.New() - svc := NewInputService14ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService14ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService14TestShapeInputService14TestCaseOperation1Input{ PipelineId: aws.String("id"), QueryDoc: map[string][]*string{ @@ -3936,8 +3919,7 @@ func TestInputService14ProtocolTestStringToStringListMapsInQuerystringCase1(t *t } func TestInputService15ProtocolTestStringPayloadCase1(t *testing.T) { - sess := session.New() - svc := NewInputService15ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService15TestShapeInputService15TestCaseOperation1Input{ Foo: aws.String("bar"), } @@ -3961,8 +3943,7 @@ func TestInputService15ProtocolTestStringPayloadCase1(t *testing.T) { } func TestInputService16ProtocolTestBlobPayloadCase1(t *testing.T) { - sess := session.New() - svc := NewInputService16ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService16ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService16TestShapeInputShape{ Foo: []byte("bar"), } @@ -3986,8 +3967,7 @@ func TestInputService16ProtocolTestBlobPayloadCase1(t *testing.T) { } func TestInputService16ProtocolTestBlobPayloadCase2(t *testing.T) { - sess := session.New() - svc := NewInputService16ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService16ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService16TestShapeInputShape{} req, _ := svc.InputService16TestCaseOperation2Request(input) r := req.HTTPRequest @@ -4004,8 +3984,7 @@ func TestInputService16ProtocolTestBlobPayloadCase2(t *testing.T) { } func TestInputService17ProtocolTestStructurePayloadCase1(t *testing.T) { - sess := session.New() - svc := NewInputService17ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService17ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService17TestShapeInputShape{ Foo: &InputService17TestShapeFooShape{ Baz: aws.String("bar"), @@ -4031,8 +4010,7 @@ func TestInputService17ProtocolTestStructurePayloadCase1(t *testing.T) { } func TestInputService17ProtocolTestStructurePayloadCase2(t *testing.T) { - sess := session.New() - svc := NewInputService17ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService17ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService17TestShapeInputShape{} req, _ := svc.InputService17TestCaseOperation2Request(input) r := req.HTTPRequest @@ -4049,8 +4027,7 @@ func TestInputService17ProtocolTestStructurePayloadCase2(t *testing.T) { } func TestInputService17ProtocolTestStructurePayloadCase3(t *testing.T) { - sess := session.New() - svc := NewInputService17ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService17ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService17TestShapeInputShape{ Foo: &InputService17TestShapeFooShape{}, } @@ -4074,8 +4051,7 @@ func TestInputService17ProtocolTestStructurePayloadCase3(t *testing.T) { } func TestInputService17ProtocolTestStructurePayloadCase4(t *testing.T) { - sess := session.New() - svc := NewInputService17ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService17ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService17TestShapeInputShape{} req, _ := svc.InputService17TestCaseOperation4Request(input) r := req.HTTPRequest @@ -4092,8 +4068,7 @@ func TestInputService17ProtocolTestStructurePayloadCase4(t *testing.T) { } func TestInputService18ProtocolTestXMLAttributeCase1(t *testing.T) { - sess := session.New() - svc := NewInputService18ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService18ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService18TestShapeInputService18TestCaseOperation1Input{ Grant: &InputService18TestShapeGrant{ Grantee: &InputService18TestShapeGrantee{ @@ -4122,8 +4097,7 @@ func TestInputService18ProtocolTestXMLAttributeCase1(t *testing.T) { } func TestInputService19ProtocolTestGreedyKeysCase1(t *testing.T) { - sess := session.New() - svc := NewInputService19ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService19ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService19TestShapeInputService19TestCaseOperation1Input{ Bucket: aws.String("my/bucket"), Key: aws.String("testing /123"), @@ -4143,8 +4117,7 @@ func TestInputService19ProtocolTestGreedyKeysCase1(t *testing.T) { } func TestInputService20ProtocolTestOmitsNullQueryParamsButSerializesEmptyStringsCase1(t *testing.T) { - sess := session.New() - svc := NewInputService20ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService20ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService20TestShapeInputShape{} req, _ := svc.InputService20TestCaseOperation1Request(input) r := req.HTTPRequest @@ -4161,8 +4134,7 @@ func TestInputService20ProtocolTestOmitsNullQueryParamsButSerializesEmptyStrings } func TestInputService20ProtocolTestOmitsNullQueryParamsButSerializesEmptyStringsCase2(t *testing.T) { - sess := session.New() - svc := NewInputService20ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService20ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService20TestShapeInputShape{ Foo: aws.String(""), } @@ -4181,8 +4153,7 @@ func TestInputService20ProtocolTestOmitsNullQueryParamsButSerializesEmptyStrings } func TestInputService21ProtocolTestRecursiveShapesCase1(t *testing.T) { - sess := session.New() - svc := NewInputService21ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService21ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService21TestShapeInputShape{ RecursiveStruct: &InputService21TestShapeRecursiveStructType{ NoRecurse: aws.String("foo"), @@ -4208,8 +4179,7 @@ func TestInputService21ProtocolTestRecursiveShapesCase1(t *testing.T) { } func TestInputService21ProtocolTestRecursiveShapesCase2(t *testing.T) { - sess := session.New() - svc := NewInputService21ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService21ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService21TestShapeInputShape{ RecursiveStruct: &InputService21TestShapeRecursiveStructType{ RecursiveStruct: &InputService21TestShapeRecursiveStructType{ @@ -4237,8 +4207,7 @@ func TestInputService21ProtocolTestRecursiveShapesCase2(t *testing.T) { } func TestInputService21ProtocolTestRecursiveShapesCase3(t *testing.T) { - sess := session.New() - svc := NewInputService21ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService21ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService21TestShapeInputShape{ RecursiveStruct: &InputService21TestShapeRecursiveStructType{ RecursiveStruct: &InputService21TestShapeRecursiveStructType{ @@ -4270,8 +4239,7 @@ func TestInputService21ProtocolTestRecursiveShapesCase3(t *testing.T) { } func TestInputService21ProtocolTestRecursiveShapesCase4(t *testing.T) { - sess := session.New() - svc := NewInputService21ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService21ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService21TestShapeInputShape{ RecursiveStruct: &InputService21TestShapeRecursiveStructType{ RecursiveList: []*InputService21TestShapeRecursiveStructType{ @@ -4304,8 +4272,7 @@ func TestInputService21ProtocolTestRecursiveShapesCase4(t *testing.T) { } func TestInputService21ProtocolTestRecursiveShapesCase5(t *testing.T) { - sess := session.New() - svc := NewInputService21ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService21ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService21TestShapeInputShape{ RecursiveStruct: &InputService21TestShapeRecursiveStructType{ RecursiveList: []*InputService21TestShapeRecursiveStructType{ @@ -4340,8 +4307,7 @@ func TestInputService21ProtocolTestRecursiveShapesCase5(t *testing.T) { } func TestInputService21ProtocolTestRecursiveShapesCase6(t *testing.T) { - sess := session.New() - svc := NewInputService21ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService21ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService21TestShapeInputShape{ RecursiveStruct: &InputService21TestShapeRecursiveStructType{ RecursiveMap: map[string]*InputService21TestShapeRecursiveStructType{ @@ -4374,8 +4340,7 @@ func TestInputService21ProtocolTestRecursiveShapesCase6(t *testing.T) { } func TestInputService22ProtocolTestTimestampInHeaderCase1(t *testing.T) { - sess := session.New() - svc := NewInputService22ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService22ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService22TestShapeInputService22TestCaseOperation1Input{ TimeArgInHeader: aws.Time(time.Unix(1422172800, 0)), } @@ -4395,8 +4360,7 @@ func TestInputService22ProtocolTestTimestampInHeaderCase1(t *testing.T) { } func TestInputService23ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { - sess := session.New() - svc := NewInputService23ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService23ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService23TestShapeInputShape{ Token: aws.String("abc123"), } @@ -4420,8 +4384,7 @@ func TestInputService23ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { } func TestInputService23ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) { - sess := session.New() - svc := NewInputService23ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewInputService23ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) input := &InputService23TestShapeInputShape{} req, _ := svc.InputService23TestCaseOperation2Request(input) r := req.HTTPRequest diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go index c74088bfe..c74b97e17 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go @@ -1,4 +1,4 @@ -// Package restxml provides RESTful XML serialisation of AWS +// Package restxml provides RESTful XML serialization of AWS // requests and responses. package restxml diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/unmarshal_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/unmarshal_test.go index 42d9887d5..700edb49a 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/unmarshal_test.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/unmarshal_test.go @@ -16,9 +16,9 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/restxml" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" @@ -1469,8 +1469,7 @@ type OutputService12TestShapeOutputService12TestCaseOperation1Output struct { // func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("myname123falsetrue1.21.3200a2015-01-25T08:00:00Z")) req, out := svc.OutputService1TestCaseOperation1Request(nil) @@ -1502,8 +1501,7 @@ func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) { } func TestOutputService1ProtocolTestScalarMembersCase2(t *testing.T) { - sess := session.New() - svc := NewOutputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("123falsetrue1.21.3200a2015-01-25T08:00:00Z")) req, out := svc.OutputService1TestCaseOperation2Request(nil) @@ -1535,8 +1533,7 @@ func TestOutputService1ProtocolTestScalarMembersCase2(t *testing.T) { } func TestOutputService2ProtocolTestBlobCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("dmFsdWU=")) req, out := svc.OutputService2TestCaseOperation1Request(nil) @@ -1556,8 +1553,7 @@ func TestOutputService2ProtocolTestBlobCase1(t *testing.T) { } func TestOutputService3ProtocolTestListsCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("abc123")) req, out := svc.OutputService3TestCaseOperation1Request(nil) @@ -1578,8 +1574,7 @@ func TestOutputService3ProtocolTestListsCase1(t *testing.T) { } func TestOutputService4ProtocolTestListWithCustomMemberNameCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("abc123")) req, out := svc.OutputService4TestCaseOperation1Request(nil) @@ -1600,8 +1595,7 @@ func TestOutputService4ProtocolTestListWithCustomMemberNameCase1(t *testing.T) { } func TestOutputService5ProtocolTestFlattenedListCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("abc123")) req, out := svc.OutputService5TestCaseOperation1Request(nil) @@ -1622,8 +1616,7 @@ func TestOutputService5ProtocolTestFlattenedListCase1(t *testing.T) { } func TestOutputService6ProtocolTestNormalMapCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("quxbarbazbam")) req, out := svc.OutputService6TestCaseOperation1Request(nil) @@ -1644,8 +1637,7 @@ func TestOutputService6ProtocolTestNormalMapCase1(t *testing.T) { } func TestOutputService7ProtocolTestFlattenedMapCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("quxbarbazbam")) req, out := svc.OutputService7TestCaseOperation1Request(nil) @@ -1666,8 +1658,7 @@ func TestOutputService7ProtocolTestFlattenedMapCase1(t *testing.T) { } func TestOutputService8ProtocolTestNamedMapCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService8ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("quxbarbazbam")) req, out := svc.OutputService8TestCaseOperation1Request(nil) @@ -1688,8 +1679,7 @@ func TestOutputService8ProtocolTestNamedMapCase1(t *testing.T) { } func TestOutputService9ProtocolTestXMLPayloadCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService9ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("abc")) req, out := svc.OutputService9TestCaseOperation1Request(nil) @@ -1711,8 +1701,7 @@ func TestOutputService9ProtocolTestXMLPayloadCase1(t *testing.T) { } func TestOutputService10ProtocolTestStreamingPayloadCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService10ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("abc")) req, out := svc.OutputService10TestCaseOperation1Request(nil) @@ -1732,8 +1721,7 @@ func TestOutputService10ProtocolTestStreamingPayloadCase1(t *testing.T) { } func TestOutputService11ProtocolTestScalarMembersInHeadersCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService11ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("")) req, out := svc.OutputService11TestCaseOperation1Request(nil) @@ -1770,8 +1758,7 @@ func TestOutputService11ProtocolTestScalarMembersInHeadersCase1(t *testing.T) { } func TestOutputService12ProtocolTestEmptyStringCase1(t *testing.T) { - sess := session.New() - svc := NewOutputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + svc := NewOutputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) buf := bytes.NewReader([]byte("requestid")) req, out := svc.OutputService12TestCaseOperation1Request(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go index ceb4132c5..221029baf 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go @@ -1,4 +1,4 @@ -// Package xmlutil provides XML serialisation of AWS requests and responses. +// Package xmlutil provides XML serialization of AWS requests and responses. package xmlutil import ( diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go index 5ec08091c..432c6e93e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go @@ -1606,14 +1606,14 @@ func (s ContinueUpdateRollbackOutput) GoString() string { type CreateChangeSetInput struct { _ struct{} `type:"structure"` - // A list of capabilities that you must specify before AWS CloudFormation can - // update certain stacks. Some stack templates might include resources that - // can affect permissions in your AWS account, for example, by creating new - // AWS Identity and Access Management (IAM) users. For those stacks, you must - // explicitly acknowledge their capabilities by specifying this parameter. + // A list of values that you must specify before AWS CloudFormation can update + // certain stacks. Some stack templates might include resources that can affect + // permissions in your AWS account, for example, by creating new AWS Identity + // and Access Management (IAM) users. For those stacks, you must explicitly + // acknowledge their capabilities by specifying this parameter. // - // Currently, the only valid value is CAPABILITY_IAM, which is required for - // the following resources: AWS::IAM::AccessKey (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html), + // The only valid values are CAPABILITY_IAM and CAPABILITY_NAMED_IAM. The following + // resources require you to specify this parameter: AWS::IAM::AccessKey (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html), // AWS::IAM::Group (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html), // AWS::IAM::InstanceProfile (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html), // AWS::IAM::Policy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html), @@ -1622,8 +1622,14 @@ type CreateChangeSetInput struct { // and AWS::IAM::UserToGroupAddition (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html). // If your stack template contains these resources, we recommend that you review // all permissions associated with them and edit their permissions if necessary. - // If your template contains any of the listed resources and you don't specify - // this parameter, this action returns an InsufficientCapabilities error. + // + // If you have IAM resources, you can specify either capability. If you have + // IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM. If + // you don't specify this parameter, this action returns an InsufficientCapabilities + // error. + // + // For more information, see Acknowledging IAM Resources in AWS CloudFormation + // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). Capabilities []*string `type:"list"` // The name of the change set. The name must be unique among all change sets @@ -1763,14 +1769,14 @@ func (s CreateChangeSetOutput) GoString() string { type CreateStackInput struct { _ struct{} `type:"structure"` - // A list of capabilities that you must specify before AWS CloudFormation can - // create certain stacks. Some stack templates might include resources that - // can affect permissions in your AWS account, for example, by creating new - // AWS Identity and Access Management (IAM) users. For those stacks, you must - // explicitly acknowledge their capabilities by specifying this parameter. + // A list of values that you must specify before AWS CloudFormation can create + // certain stacks. Some stack templates might include resources that can affect + // permissions in your AWS account, for example, by creating new AWS Identity + // and Access Management (IAM) users. For those stacks, you must explicitly + // acknowledge their capabilities by specifying this parameter. // - // Currently, the only valid value is CAPABILITY_IAM, which is required for - // the following resources: AWS::IAM::AccessKey (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html), + // The only valid values are CAPABILITY_IAM and CAPABILITY_NAMED_IAM. The following + // resources require you to specify this parameter: AWS::IAM::AccessKey (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html), // AWS::IAM::Group (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html), // AWS::IAM::InstanceProfile (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html), // AWS::IAM::Policy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html), @@ -1779,8 +1785,14 @@ type CreateStackInput struct { // and AWS::IAM::UserToGroupAddition (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html). // If your stack template contains these resources, we recommend that you review // all permissions associated with them and edit their permissions if necessary. - // If your template contains any of the listed resources and you don't specify - // this parameter, this action returns an InsufficientCapabilities error. + // + // If you have IAM resources, you can specify either capability. If you have + // IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM. If + // you don't specify this parameter, this action returns an InsufficientCapabilities + // error. + // + // For more information, see Acknowledging IAM Resources in AWS CloudFormation + // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). Capabilities []*string `type:"list"` // Set to true to disable rollback of the stack if stack creation failed. You @@ -2778,11 +2790,14 @@ func (s *GetTemplateSummaryInput) Validate() error { type GetTemplateSummaryOutput struct { _ struct{} `type:"structure"` - // The capabilities found within the template. Currently, AWS CloudFormation - // supports only the CAPABILITY_IAM capability. If your template contains IAM - // resources, you must specify the CAPABILITY_IAM value for this parameter when - // you use the CreateStack or UpdateStack actions with your template; otherwise, - // those actions return an InsufficientCapabilities error. + // The capabilities found within the template. If your template contains IAM + // resources, you must specify the CAPABILITY_IAM or CAPABILITY_NAMED_IAM value + // for this parameter when you use the CreateStack or UpdateStack actions with + // your template; otherwise, those actions return an InsufficientCapabilities + // error. + // + // For more information, see Acknowledging IAM Resources in AWS CloudFormation + // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). Capabilities []*string `type:"list"` // The list of resources that generated the values in the Capabilities response @@ -3744,14 +3759,14 @@ func (s TemplateParameter) GoString() string { type UpdateStackInput struct { _ struct{} `type:"structure"` - // A list of capabilities that you must specify before AWS CloudFormation can - // update certain stacks. Some stack templates might include resources that - // can affect permissions in your AWS account, for example, by creating new - // AWS Identity and Access Management (IAM) users. For those stacks, you must - // explicitly acknowledge their capabilities by specifying this parameter. + // A list of values that you must specify before AWS CloudFormation can update + // certain stacks. Some stack templates might include resources that can affect + // permissions in your AWS account, for example, by creating new AWS Identity + // and Access Management (IAM) users. For those stacks, you must explicitly + // acknowledge their capabilities by specifying this parameter. // - // Currently, the only valid value is CAPABILITY_IAM, which is required for - // the following resources: AWS::IAM::AccessKey (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html), + // The only valid values are CAPABILITY_IAM and CAPABILITY_NAMED_IAM. The following + // resources require you to specify this parameter: AWS::IAM::AccessKey (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html), // AWS::IAM::Group (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html), // AWS::IAM::InstanceProfile (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html), // AWS::IAM::Policy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html), @@ -3760,8 +3775,14 @@ type UpdateStackInput struct { // and AWS::IAM::UserToGroupAddition (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html). // If your stack template contains these resources, we recommend that you review // all permissions associated with them and edit their permissions if necessary. - // If your template contains any of the listed resources and you don't specify - // this parameter, this action returns an InsufficientCapabilities error. + // + // If you have IAM resources, you can specify either capability. If you have + // IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM. If + // you don't specify this parameter, this action returns an InsufficientCapabilities + // error. + // + // For more information, see Acknowledging IAM Resources in AWS CloudFormation + // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). Capabilities []*string `type:"list"` // Amazon Simple Notification Service topic Amazon Resource Names (ARNs) that @@ -3969,11 +3990,14 @@ func (s *ValidateTemplateInput) Validate() error { type ValidateTemplateOutput struct { _ struct{} `type:"structure"` - // The capabilities found within the template. Currently, AWS CloudFormation - // supports only the CAPABILITY_IAM capability. If your template contains IAM - // resources, you must specify the CAPABILITY_IAM value for this parameter when - // you use the CreateStack or UpdateStack actions with your template; otherwise, - // those actions return an InsufficientCapabilities error. + // The capabilities found within the template. If your template contains IAM + // resources, you must specify the CAPABILITY_IAM or CAPABILITY_NAMED_IAM value + // for this parameter when you use the CreateStack or UpdateStack actions with + // your template; otherwise, those actions return an InsufficientCapabilities + // error. + // + // For more information, see Acknowledging IAM Resources in AWS CloudFormation + // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). Capabilities []*string `type:"list"` // The list of resources that generated the values in the Capabilities response @@ -4000,6 +4024,8 @@ func (s ValidateTemplateOutput) GoString() string { const ( // @enum Capability CapabilityCapabilityIam = "CAPABILITY_IAM" + // @enum Capability + CapabilityCapabilityNamedIam = "CAPABILITY_NAMED_IAM" ) const ( diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/examples_test.go index 695686a05..e5bf53dbe 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/examples_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/examples_test.go @@ -16,7 +16,13 @@ var _ time.Duration var _ bytes.Buffer func ExampleCloudFormation_CancelUpdateStack() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.CancelUpdateStackInput{ StackName: aws.String("StackName"), // Required @@ -35,7 +41,13 @@ func ExampleCloudFormation_CancelUpdateStack() { } func ExampleCloudFormation_ContinueUpdateRollback() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.ContinueUpdateRollbackInput{ StackName: aws.String("StackNameOrId"), // Required @@ -54,7 +66,13 @@ func ExampleCloudFormation_ContinueUpdateRollback() { } func ExampleCloudFormation_CreateChangeSet() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.CreateChangeSetInput{ ChangeSetName: aws.String("ChangeSetName"), // Required @@ -106,7 +124,13 @@ func ExampleCloudFormation_CreateChangeSet() { } func ExampleCloudFormation_CreateStack() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.CreateStackInput{ StackName: aws.String("StackName"), // Required @@ -159,7 +183,13 @@ func ExampleCloudFormation_CreateStack() { } func ExampleCloudFormation_DeleteChangeSet() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.DeleteChangeSetInput{ ChangeSetName: aws.String("ChangeSetNameOrId"), // Required @@ -179,7 +209,13 @@ func ExampleCloudFormation_DeleteChangeSet() { } func ExampleCloudFormation_DeleteStack() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.DeleteStackInput{ StackName: aws.String("StackName"), // Required @@ -202,7 +238,13 @@ func ExampleCloudFormation_DeleteStack() { } func ExampleCloudFormation_DescribeAccountLimits() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.DescribeAccountLimitsInput{ NextToken: aws.String("NextToken"), @@ -221,7 +263,13 @@ func ExampleCloudFormation_DescribeAccountLimits() { } func ExampleCloudFormation_DescribeChangeSet() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.DescribeChangeSetInput{ ChangeSetName: aws.String("ChangeSetNameOrId"), // Required @@ -242,7 +290,13 @@ func ExampleCloudFormation_DescribeChangeSet() { } func ExampleCloudFormation_DescribeStackEvents() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.DescribeStackEventsInput{ NextToken: aws.String("NextToken"), @@ -262,7 +316,13 @@ func ExampleCloudFormation_DescribeStackEvents() { } func ExampleCloudFormation_DescribeStackResource() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.DescribeStackResourceInput{ LogicalResourceId: aws.String("LogicalResourceId"), // Required @@ -282,7 +342,13 @@ func ExampleCloudFormation_DescribeStackResource() { } func ExampleCloudFormation_DescribeStackResources() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.DescribeStackResourcesInput{ LogicalResourceId: aws.String("LogicalResourceId"), @@ -303,7 +369,13 @@ func ExampleCloudFormation_DescribeStackResources() { } func ExampleCloudFormation_DescribeStacks() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.DescribeStacksInput{ NextToken: aws.String("NextToken"), @@ -323,7 +395,13 @@ func ExampleCloudFormation_DescribeStacks() { } func ExampleCloudFormation_EstimateTemplateCost() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.EstimateTemplateCostInput{ Parameters: []*cloudformation.Parameter{ @@ -351,7 +429,13 @@ func ExampleCloudFormation_EstimateTemplateCost() { } func ExampleCloudFormation_ExecuteChangeSet() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.ExecuteChangeSetInput{ ChangeSetName: aws.String("ChangeSetNameOrId"), // Required @@ -371,7 +455,13 @@ func ExampleCloudFormation_ExecuteChangeSet() { } func ExampleCloudFormation_GetStackPolicy() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.GetStackPolicyInput{ StackName: aws.String("StackName"), // Required @@ -390,7 +480,13 @@ func ExampleCloudFormation_GetStackPolicy() { } func ExampleCloudFormation_GetTemplate() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.GetTemplateInput{ StackName: aws.String("StackName"), // Required @@ -409,7 +505,13 @@ func ExampleCloudFormation_GetTemplate() { } func ExampleCloudFormation_GetTemplateSummary() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.GetTemplateSummaryInput{ StackName: aws.String("StackNameOrId"), @@ -430,7 +532,13 @@ func ExampleCloudFormation_GetTemplateSummary() { } func ExampleCloudFormation_ListChangeSets() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.ListChangeSetsInput{ StackName: aws.String("StackNameOrId"), // Required @@ -450,7 +558,13 @@ func ExampleCloudFormation_ListChangeSets() { } func ExampleCloudFormation_ListStackResources() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.ListStackResourcesInput{ StackName: aws.String("StackName"), // Required @@ -470,7 +584,13 @@ func ExampleCloudFormation_ListStackResources() { } func ExampleCloudFormation_ListStacks() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.ListStacksInput{ NextToken: aws.String("NextToken"), @@ -493,7 +613,13 @@ func ExampleCloudFormation_ListStacks() { } func ExampleCloudFormation_SetStackPolicy() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.SetStackPolicyInput{ StackName: aws.String("StackName"), // Required @@ -514,7 +640,13 @@ func ExampleCloudFormation_SetStackPolicy() { } func ExampleCloudFormation_SignalResource() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.SignalResourceInput{ LogicalResourceId: aws.String("LogicalResourceId"), // Required @@ -536,7 +668,13 @@ func ExampleCloudFormation_SignalResource() { } func ExampleCloudFormation_UpdateStack() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.UpdateStackInput{ StackName: aws.String("StackName"), // Required @@ -589,7 +727,13 @@ func ExampleCloudFormation_UpdateStack() { } func ExampleCloudFormation_ValidateTemplate() { - svc := cloudformation.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudformation.New(sess) params := &cloudformation.ValidateTemplateInput{ TemplateBody: aws.String("TemplateBody"), diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/api.go index f9bd33f6b..b6058d77a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/api.go @@ -13,7 +13,7 @@ import ( "github.com/aws/aws-sdk-go/private/protocol/restxml" ) -const opCreateCloudFrontOriginAccessIdentity = "CreateCloudFrontOriginAccessIdentity2016_01_28" +const opCreateCloudFrontOriginAccessIdentity = "CreateCloudFrontOriginAccessIdentity2016_08_01" // CreateCloudFrontOriginAccessIdentityRequest generates a "aws/request.Request" representing the // client's request for the CreateCloudFrontOriginAccessIdentity operation. The "output" return @@ -41,7 +41,7 @@ func (c *CloudFront) CreateCloudFrontOriginAccessIdentityRequest(input *CreateCl op := &request.Operation{ Name: opCreateCloudFrontOriginAccessIdentity, HTTPMethod: "POST", - HTTPPath: "/2016-01-28/origin-access-identity/cloudfront", + HTTPPath: "/2016-08-01/origin-access-identity/cloudfront", } if input == nil { @@ -61,7 +61,7 @@ func (c *CloudFront) CreateCloudFrontOriginAccessIdentity(input *CreateCloudFron return out, err } -const opCreateDistribution = "CreateDistribution2016_01_28" +const opCreateDistribution = "CreateDistribution2016_08_01" // CreateDistributionRequest generates a "aws/request.Request" representing the // client's request for the CreateDistribution operation. The "output" return @@ -89,7 +89,7 @@ func (c *CloudFront) CreateDistributionRequest(input *CreateDistributionInput) ( op := &request.Operation{ Name: opCreateDistribution, HTTPMethod: "POST", - HTTPPath: "/2016-01-28/distribution", + HTTPPath: "/2016-08-01/distribution", } if input == nil { @@ -109,7 +109,55 @@ func (c *CloudFront) CreateDistribution(input *CreateDistributionInput) (*Create return out, err } -const opCreateInvalidation = "CreateInvalidation2016_01_28" +const opCreateDistributionWithTags = "CreateDistributionWithTags2016_08_01" + +// CreateDistributionWithTagsRequest generates a "aws/request.Request" representing the +// client's request for the CreateDistributionWithTags operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the CreateDistributionWithTags method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the CreateDistributionWithTagsRequest method. +// req, resp := client.CreateDistributionWithTagsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +func (c *CloudFront) CreateDistributionWithTagsRequest(input *CreateDistributionWithTagsInput) (req *request.Request, output *CreateDistributionWithTagsOutput) { + op := &request.Operation{ + Name: opCreateDistributionWithTags, + HTTPMethod: "POST", + HTTPPath: "/2016-08-01/distribution?WithTags", + } + + if input == nil { + input = &CreateDistributionWithTagsInput{} + } + + req = c.newRequest(op, input, output) + output = &CreateDistributionWithTagsOutput{} + req.Data = output + return +} + +// Create a new distribution with tags. +func (c *CloudFront) CreateDistributionWithTags(input *CreateDistributionWithTagsInput) (*CreateDistributionWithTagsOutput, error) { + req, out := c.CreateDistributionWithTagsRequest(input) + err := req.Send() + return out, err +} + +const opCreateInvalidation = "CreateInvalidation2016_08_01" // CreateInvalidationRequest generates a "aws/request.Request" representing the // client's request for the CreateInvalidation operation. The "output" return @@ -137,7 +185,7 @@ func (c *CloudFront) CreateInvalidationRequest(input *CreateInvalidationInput) ( op := &request.Operation{ Name: opCreateInvalidation, HTTPMethod: "POST", - HTTPPath: "/2016-01-28/distribution/{DistributionId}/invalidation", + HTTPPath: "/2016-08-01/distribution/{DistributionId}/invalidation", } if input == nil { @@ -157,7 +205,7 @@ func (c *CloudFront) CreateInvalidation(input *CreateInvalidationInput) (*Create return out, err } -const opCreateStreamingDistribution = "CreateStreamingDistribution2016_01_28" +const opCreateStreamingDistribution = "CreateStreamingDistribution2016_08_01" // CreateStreamingDistributionRequest generates a "aws/request.Request" representing the // client's request for the CreateStreamingDistribution operation. The "output" return @@ -185,7 +233,7 @@ func (c *CloudFront) CreateStreamingDistributionRequest(input *CreateStreamingDi op := &request.Operation{ Name: opCreateStreamingDistribution, HTTPMethod: "POST", - HTTPPath: "/2016-01-28/streaming-distribution", + HTTPPath: "/2016-08-01/streaming-distribution", } if input == nil { @@ -205,7 +253,55 @@ func (c *CloudFront) CreateStreamingDistribution(input *CreateStreamingDistribut return out, err } -const opDeleteCloudFrontOriginAccessIdentity = "DeleteCloudFrontOriginAccessIdentity2016_01_28" +const opCreateStreamingDistributionWithTags = "CreateStreamingDistributionWithTags2016_08_01" + +// CreateStreamingDistributionWithTagsRequest generates a "aws/request.Request" representing the +// client's request for the CreateStreamingDistributionWithTags operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the CreateStreamingDistributionWithTags method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the CreateStreamingDistributionWithTagsRequest method. +// req, resp := client.CreateStreamingDistributionWithTagsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +func (c *CloudFront) CreateStreamingDistributionWithTagsRequest(input *CreateStreamingDistributionWithTagsInput) (req *request.Request, output *CreateStreamingDistributionWithTagsOutput) { + op := &request.Operation{ + Name: opCreateStreamingDistributionWithTags, + HTTPMethod: "POST", + HTTPPath: "/2016-08-01/streaming-distribution?WithTags", + } + + if input == nil { + input = &CreateStreamingDistributionWithTagsInput{} + } + + req = c.newRequest(op, input, output) + output = &CreateStreamingDistributionWithTagsOutput{} + req.Data = output + return +} + +// Create a new streaming distribution with tags. +func (c *CloudFront) CreateStreamingDistributionWithTags(input *CreateStreamingDistributionWithTagsInput) (*CreateStreamingDistributionWithTagsOutput, error) { + req, out := c.CreateStreamingDistributionWithTagsRequest(input) + err := req.Send() + return out, err +} + +const opDeleteCloudFrontOriginAccessIdentity = "DeleteCloudFrontOriginAccessIdentity2016_08_01" // DeleteCloudFrontOriginAccessIdentityRequest generates a "aws/request.Request" representing the // client's request for the DeleteCloudFrontOriginAccessIdentity operation. The "output" return @@ -233,7 +329,7 @@ func (c *CloudFront) DeleteCloudFrontOriginAccessIdentityRequest(input *DeleteCl op := &request.Operation{ Name: opDeleteCloudFrontOriginAccessIdentity, HTTPMethod: "DELETE", - HTTPPath: "/2016-01-28/origin-access-identity/cloudfront/{Id}", + HTTPPath: "/2016-08-01/origin-access-identity/cloudfront/{Id}", } if input == nil { @@ -255,7 +351,7 @@ func (c *CloudFront) DeleteCloudFrontOriginAccessIdentity(input *DeleteCloudFron return out, err } -const opDeleteDistribution = "DeleteDistribution2016_01_28" +const opDeleteDistribution = "DeleteDistribution2016_08_01" // DeleteDistributionRequest generates a "aws/request.Request" representing the // client's request for the DeleteDistribution operation. The "output" return @@ -283,7 +379,7 @@ func (c *CloudFront) DeleteDistributionRequest(input *DeleteDistributionInput) ( op := &request.Operation{ Name: opDeleteDistribution, HTTPMethod: "DELETE", - HTTPPath: "/2016-01-28/distribution/{Id}", + HTTPPath: "/2016-08-01/distribution/{Id}", } if input == nil { @@ -305,7 +401,7 @@ func (c *CloudFront) DeleteDistribution(input *DeleteDistributionInput) (*Delete return out, err } -const opDeleteStreamingDistribution = "DeleteStreamingDistribution2016_01_28" +const opDeleteStreamingDistribution = "DeleteStreamingDistribution2016_08_01" // DeleteStreamingDistributionRequest generates a "aws/request.Request" representing the // client's request for the DeleteStreamingDistribution operation. The "output" return @@ -333,7 +429,7 @@ func (c *CloudFront) DeleteStreamingDistributionRequest(input *DeleteStreamingDi op := &request.Operation{ Name: opDeleteStreamingDistribution, HTTPMethod: "DELETE", - HTTPPath: "/2016-01-28/streaming-distribution/{Id}", + HTTPPath: "/2016-08-01/streaming-distribution/{Id}", } if input == nil { @@ -355,7 +451,7 @@ func (c *CloudFront) DeleteStreamingDistribution(input *DeleteStreamingDistribut return out, err } -const opGetCloudFrontOriginAccessIdentity = "GetCloudFrontOriginAccessIdentity2016_01_28" +const opGetCloudFrontOriginAccessIdentity = "GetCloudFrontOriginAccessIdentity2016_08_01" // GetCloudFrontOriginAccessIdentityRequest generates a "aws/request.Request" representing the // client's request for the GetCloudFrontOriginAccessIdentity operation. The "output" return @@ -383,7 +479,7 @@ func (c *CloudFront) GetCloudFrontOriginAccessIdentityRequest(input *GetCloudFro op := &request.Operation{ Name: opGetCloudFrontOriginAccessIdentity, HTTPMethod: "GET", - HTTPPath: "/2016-01-28/origin-access-identity/cloudfront/{Id}", + HTTPPath: "/2016-08-01/origin-access-identity/cloudfront/{Id}", } if input == nil { @@ -403,7 +499,7 @@ func (c *CloudFront) GetCloudFrontOriginAccessIdentity(input *GetCloudFrontOrigi return out, err } -const opGetCloudFrontOriginAccessIdentityConfig = "GetCloudFrontOriginAccessIdentityConfig2016_01_28" +const opGetCloudFrontOriginAccessIdentityConfig = "GetCloudFrontOriginAccessIdentityConfig2016_08_01" // GetCloudFrontOriginAccessIdentityConfigRequest generates a "aws/request.Request" representing the // client's request for the GetCloudFrontOriginAccessIdentityConfig operation. The "output" return @@ -431,7 +527,7 @@ func (c *CloudFront) GetCloudFrontOriginAccessIdentityConfigRequest(input *GetCl op := &request.Operation{ Name: opGetCloudFrontOriginAccessIdentityConfig, HTTPMethod: "GET", - HTTPPath: "/2016-01-28/origin-access-identity/cloudfront/{Id}/config", + HTTPPath: "/2016-08-01/origin-access-identity/cloudfront/{Id}/config", } if input == nil { @@ -451,7 +547,7 @@ func (c *CloudFront) GetCloudFrontOriginAccessIdentityConfig(input *GetCloudFron return out, err } -const opGetDistribution = "GetDistribution2016_01_28" +const opGetDistribution = "GetDistribution2016_08_01" // GetDistributionRequest generates a "aws/request.Request" representing the // client's request for the GetDistribution operation. The "output" return @@ -479,7 +575,7 @@ func (c *CloudFront) GetDistributionRequest(input *GetDistributionInput) (req *r op := &request.Operation{ Name: opGetDistribution, HTTPMethod: "GET", - HTTPPath: "/2016-01-28/distribution/{Id}", + HTTPPath: "/2016-08-01/distribution/{Id}", } if input == nil { @@ -499,7 +595,7 @@ func (c *CloudFront) GetDistribution(input *GetDistributionInput) (*GetDistribut return out, err } -const opGetDistributionConfig = "GetDistributionConfig2016_01_28" +const opGetDistributionConfig = "GetDistributionConfig2016_08_01" // GetDistributionConfigRequest generates a "aws/request.Request" representing the // client's request for the GetDistributionConfig operation. The "output" return @@ -527,7 +623,7 @@ func (c *CloudFront) GetDistributionConfigRequest(input *GetDistributionConfigIn op := &request.Operation{ Name: opGetDistributionConfig, HTTPMethod: "GET", - HTTPPath: "/2016-01-28/distribution/{Id}/config", + HTTPPath: "/2016-08-01/distribution/{Id}/config", } if input == nil { @@ -547,7 +643,7 @@ func (c *CloudFront) GetDistributionConfig(input *GetDistributionConfigInput) (* return out, err } -const opGetInvalidation = "GetInvalidation2016_01_28" +const opGetInvalidation = "GetInvalidation2016_08_01" // GetInvalidationRequest generates a "aws/request.Request" representing the // client's request for the GetInvalidation operation. The "output" return @@ -575,7 +671,7 @@ func (c *CloudFront) GetInvalidationRequest(input *GetInvalidationInput) (req *r op := &request.Operation{ Name: opGetInvalidation, HTTPMethod: "GET", - HTTPPath: "/2016-01-28/distribution/{DistributionId}/invalidation/{Id}", + HTTPPath: "/2016-08-01/distribution/{DistributionId}/invalidation/{Id}", } if input == nil { @@ -595,7 +691,7 @@ func (c *CloudFront) GetInvalidation(input *GetInvalidationInput) (*GetInvalidat return out, err } -const opGetStreamingDistribution = "GetStreamingDistribution2016_01_28" +const opGetStreamingDistribution = "GetStreamingDistribution2016_08_01" // GetStreamingDistributionRequest generates a "aws/request.Request" representing the // client's request for the GetStreamingDistribution operation. The "output" return @@ -623,7 +719,7 @@ func (c *CloudFront) GetStreamingDistributionRequest(input *GetStreamingDistribu op := &request.Operation{ Name: opGetStreamingDistribution, HTTPMethod: "GET", - HTTPPath: "/2016-01-28/streaming-distribution/{Id}", + HTTPPath: "/2016-08-01/streaming-distribution/{Id}", } if input == nil { @@ -643,7 +739,7 @@ func (c *CloudFront) GetStreamingDistribution(input *GetStreamingDistributionInp return out, err } -const opGetStreamingDistributionConfig = "GetStreamingDistributionConfig2016_01_28" +const opGetStreamingDistributionConfig = "GetStreamingDistributionConfig2016_08_01" // GetStreamingDistributionConfigRequest generates a "aws/request.Request" representing the // client's request for the GetStreamingDistributionConfig operation. The "output" return @@ -671,7 +767,7 @@ func (c *CloudFront) GetStreamingDistributionConfigRequest(input *GetStreamingDi op := &request.Operation{ Name: opGetStreamingDistributionConfig, HTTPMethod: "GET", - HTTPPath: "/2016-01-28/streaming-distribution/{Id}/config", + HTTPPath: "/2016-08-01/streaming-distribution/{Id}/config", } if input == nil { @@ -691,7 +787,7 @@ func (c *CloudFront) GetStreamingDistributionConfig(input *GetStreamingDistribut return out, err } -const opListCloudFrontOriginAccessIdentities = "ListCloudFrontOriginAccessIdentities2016_01_28" +const opListCloudFrontOriginAccessIdentities = "ListCloudFrontOriginAccessIdentities2016_08_01" // ListCloudFrontOriginAccessIdentitiesRequest generates a "aws/request.Request" representing the // client's request for the ListCloudFrontOriginAccessIdentities operation. The "output" return @@ -719,7 +815,7 @@ func (c *CloudFront) ListCloudFrontOriginAccessIdentitiesRequest(input *ListClou op := &request.Operation{ Name: opListCloudFrontOriginAccessIdentities, HTTPMethod: "GET", - HTTPPath: "/2016-01-28/origin-access-identity/cloudfront", + HTTPPath: "/2016-08-01/origin-access-identity/cloudfront", Paginator: &request.Paginator{ InputTokens: []string{"Marker"}, OutputTokens: []string{"CloudFrontOriginAccessIdentityList.NextMarker"}, @@ -770,7 +866,7 @@ func (c *CloudFront) ListCloudFrontOriginAccessIdentitiesPages(input *ListCloudF }) } -const opListDistributions = "ListDistributions2016_01_28" +const opListDistributions = "ListDistributions2016_08_01" // ListDistributionsRequest generates a "aws/request.Request" representing the // client's request for the ListDistributions operation. The "output" return @@ -798,7 +894,7 @@ func (c *CloudFront) ListDistributionsRequest(input *ListDistributionsInput) (re op := &request.Operation{ Name: opListDistributions, HTTPMethod: "GET", - HTTPPath: "/2016-01-28/distribution", + HTTPPath: "/2016-08-01/distribution", Paginator: &request.Paginator{ InputTokens: []string{"Marker"}, OutputTokens: []string{"DistributionList.NextMarker"}, @@ -849,7 +945,7 @@ func (c *CloudFront) ListDistributionsPages(input *ListDistributionsInput, fn fu }) } -const opListDistributionsByWebACLId = "ListDistributionsByWebACLId2016_01_28" +const opListDistributionsByWebACLId = "ListDistributionsByWebACLId2016_08_01" // ListDistributionsByWebACLIdRequest generates a "aws/request.Request" representing the // client's request for the ListDistributionsByWebACLId operation. The "output" return @@ -877,7 +973,7 @@ func (c *CloudFront) ListDistributionsByWebACLIdRequest(input *ListDistributions op := &request.Operation{ Name: opListDistributionsByWebACLId, HTTPMethod: "GET", - HTTPPath: "/2016-01-28/distributionsByWebACLId/{WebACLId}", + HTTPPath: "/2016-08-01/distributionsByWebACLId/{WebACLId}", } if input == nil { @@ -897,7 +993,7 @@ func (c *CloudFront) ListDistributionsByWebACLId(input *ListDistributionsByWebAC return out, err } -const opListInvalidations = "ListInvalidations2016_01_28" +const opListInvalidations = "ListInvalidations2016_08_01" // ListInvalidationsRequest generates a "aws/request.Request" representing the // client's request for the ListInvalidations operation. The "output" return @@ -925,7 +1021,7 @@ func (c *CloudFront) ListInvalidationsRequest(input *ListInvalidationsInput) (re op := &request.Operation{ Name: opListInvalidations, HTTPMethod: "GET", - HTTPPath: "/2016-01-28/distribution/{DistributionId}/invalidation", + HTTPPath: "/2016-08-01/distribution/{DistributionId}/invalidation", Paginator: &request.Paginator{ InputTokens: []string{"Marker"}, OutputTokens: []string{"InvalidationList.NextMarker"}, @@ -976,7 +1072,7 @@ func (c *CloudFront) ListInvalidationsPages(input *ListInvalidationsInput, fn fu }) } -const opListStreamingDistributions = "ListStreamingDistributions2016_01_28" +const opListStreamingDistributions = "ListStreamingDistributions2016_08_01" // ListStreamingDistributionsRequest generates a "aws/request.Request" representing the // client's request for the ListStreamingDistributions operation. The "output" return @@ -1004,7 +1100,7 @@ func (c *CloudFront) ListStreamingDistributionsRequest(input *ListStreamingDistr op := &request.Operation{ Name: opListStreamingDistributions, HTTPMethod: "GET", - HTTPPath: "/2016-01-28/streaming-distribution", + HTTPPath: "/2016-08-01/streaming-distribution", Paginator: &request.Paginator{ InputTokens: []string{"Marker"}, OutputTokens: []string{"StreamingDistributionList.NextMarker"}, @@ -1055,7 +1151,155 @@ func (c *CloudFront) ListStreamingDistributionsPages(input *ListStreamingDistrib }) } -const opUpdateCloudFrontOriginAccessIdentity = "UpdateCloudFrontOriginAccessIdentity2016_01_28" +const opListTagsForResource = "ListTagsForResource2016_08_01" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the ListTagsForResource method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +func (c *CloudFront) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { + op := &request.Operation{ + Name: opListTagsForResource, + HTTPMethod: "GET", + HTTPPath: "/2016-08-01/tagging", + } + + if input == nil { + input = &ListTagsForResourceInput{} + } + + req = c.newRequest(op, input, output) + output = &ListTagsForResourceOutput{} + req.Data = output + return +} + +// List tags for a CloudFront resource. +func (c *CloudFront) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + err := req.Send() + return out, err +} + +const opTagResource = "TagResource2016_08_01" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the TagResource method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +func (c *CloudFront) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { + op := &request.Operation{ + Name: opTagResource, + HTTPMethod: "POST", + HTTPPath: "/2016-08-01/tagging?Operation=Tag", + } + + if input == nil { + input = &TagResourceInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &TagResourceOutput{} + req.Data = output + return +} + +// Add tags to a CloudFront resource. +func (c *CloudFront) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + err := req.Send() + return out, err +} + +const opUntagResource = "UntagResource2016_08_01" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the UntagResource method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +func (c *CloudFront) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { + op := &request.Operation{ + Name: opUntagResource, + HTTPMethod: "POST", + HTTPPath: "/2016-08-01/tagging?Operation=Untag", + } + + if input == nil { + input = &UntagResourceInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &UntagResourceOutput{} + req.Data = output + return +} + +// Remove tags from a CloudFront resource. +func (c *CloudFront) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + err := req.Send() + return out, err +} + +const opUpdateCloudFrontOriginAccessIdentity = "UpdateCloudFrontOriginAccessIdentity2016_08_01" // UpdateCloudFrontOriginAccessIdentityRequest generates a "aws/request.Request" representing the // client's request for the UpdateCloudFrontOriginAccessIdentity operation. The "output" return @@ -1083,7 +1327,7 @@ func (c *CloudFront) UpdateCloudFrontOriginAccessIdentityRequest(input *UpdateCl op := &request.Operation{ Name: opUpdateCloudFrontOriginAccessIdentity, HTTPMethod: "PUT", - HTTPPath: "/2016-01-28/origin-access-identity/cloudfront/{Id}/config", + HTTPPath: "/2016-08-01/origin-access-identity/cloudfront/{Id}/config", } if input == nil { @@ -1103,7 +1347,7 @@ func (c *CloudFront) UpdateCloudFrontOriginAccessIdentity(input *UpdateCloudFron return out, err } -const opUpdateDistribution = "UpdateDistribution2016_01_28" +const opUpdateDistribution = "UpdateDistribution2016_08_01" // UpdateDistributionRequest generates a "aws/request.Request" representing the // client's request for the UpdateDistribution operation. The "output" return @@ -1131,7 +1375,7 @@ func (c *CloudFront) UpdateDistributionRequest(input *UpdateDistributionInput) ( op := &request.Operation{ Name: opUpdateDistribution, HTTPMethod: "PUT", - HTTPPath: "/2016-01-28/distribution/{Id}/config", + HTTPPath: "/2016-08-01/distribution/{Id}/config", } if input == nil { @@ -1151,7 +1395,7 @@ func (c *CloudFront) UpdateDistribution(input *UpdateDistributionInput) (*Update return out, err } -const opUpdateStreamingDistribution = "UpdateStreamingDistribution2016_01_28" +const opUpdateStreamingDistribution = "UpdateStreamingDistribution2016_08_01" // UpdateStreamingDistributionRequest generates a "aws/request.Request" representing the // client's request for the UpdateStreamingDistribution operation. The "output" return @@ -1179,7 +1423,7 @@ func (c *CloudFront) UpdateStreamingDistributionRequest(input *UpdateStreamingDi op := &request.Operation{ Name: opUpdateStreamingDistribution, HTTPMethod: "PUT", - HTTPPath: "/2016-01-28/streaming-distribution/{Id}/config", + HTTPPath: "/2016-08-01/streaming-distribution/{Id}/config", } if input == nil { @@ -1785,6 +2029,67 @@ func (s CreateDistributionOutput) GoString() string { return s.String() } +// The request to create a new distribution with tags +type CreateDistributionWithTagsInput struct { + _ struct{} `type:"structure" payload:"DistributionConfigWithTags"` + + // The distribution's configuration information. + DistributionConfigWithTags *DistributionConfigWithTags `locationName:"DistributionConfigWithTags" type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateDistributionWithTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDistributionWithTagsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateDistributionWithTagsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateDistributionWithTagsInput"} + if s.DistributionConfigWithTags == nil { + invalidParams.Add(request.NewErrParamRequired("DistributionConfigWithTags")) + } + if s.DistributionConfigWithTags != nil { + if err := s.DistributionConfigWithTags.Validate(); err != nil { + invalidParams.AddNested("DistributionConfigWithTags", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The returned result of the corresponding request. +type CreateDistributionWithTagsOutput struct { + _ struct{} `type:"structure" payload:"Distribution"` + + // The distribution's information. + Distribution *Distribution `type:"structure"` + + // The current version of the distribution created. + ETag *string `location:"header" locationName:"ETag" type:"string"` + + // The fully qualified URI of the new distribution resource just created. For + // example: https://cloudfront.amazonaws.com/2010-11-01/distribution/EDFDVBD632BHDS5. + Location *string `location:"header" locationName:"Location" type:"string"` +} + +// String returns the string representation +func (s CreateDistributionWithTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDistributionWithTagsOutput) GoString() string { + return s.String() +} + // The request to create an invalidation. type CreateInvalidationInput struct { _ struct{} `type:"structure" payload:"InvalidationBatch"` @@ -1910,6 +2215,67 @@ func (s CreateStreamingDistributionOutput) GoString() string { return s.String() } +// The request to create a new streaming distribution with tags. +type CreateStreamingDistributionWithTagsInput struct { + _ struct{} `type:"structure" payload:"StreamingDistributionConfigWithTags"` + + // The streaming distribution's configuration information. + StreamingDistributionConfigWithTags *StreamingDistributionConfigWithTags `locationName:"StreamingDistributionConfigWithTags" type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateStreamingDistributionWithTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateStreamingDistributionWithTagsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateStreamingDistributionWithTagsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateStreamingDistributionWithTagsInput"} + if s.StreamingDistributionConfigWithTags == nil { + invalidParams.Add(request.NewErrParamRequired("StreamingDistributionConfigWithTags")) + } + if s.StreamingDistributionConfigWithTags != nil { + if err := s.StreamingDistributionConfigWithTags.Validate(); err != nil { + invalidParams.AddNested("StreamingDistributionConfigWithTags", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The returned result of the corresponding request. +type CreateStreamingDistributionWithTagsOutput struct { + _ struct{} `type:"structure" payload:"StreamingDistribution"` + + // The current version of the streaming distribution created. + ETag *string `location:"header" locationName:"ETag" type:"string"` + + // The fully qualified URI of the new streaming distribution resource just created. + // For example: https://cloudfront.amazonaws.com/2010-11-01/streaming-distribution/EGTXBD79H29TRA8. + Location *string `location:"header" locationName:"Location" type:"string"` + + // The streaming distribution's information. + StreamingDistribution *StreamingDistribution `type:"structure"` +} + +// String returns the string representation +func (s CreateStreamingDistributionWithTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateStreamingDistributionWithTagsOutput) GoString() string { + return s.String() +} + // A complex type that describes how you'd prefer CloudFront to respond to requests // that result in either a 4xx or 5xx response. You can control whether a custom // error page should be displayed, what the desired response code should be @@ -2406,6 +2772,10 @@ func (s DeleteStreamingDistributionOutput) GoString() string { type Distribution struct { _ struct{} `type:"structure"` + // The ARN (Amazon Resource Name) for the distribution. For example: arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, + // where 123456789012 is your AWS account Id. + ARN *string `type:"string" required:"true"` + // CloudFront automatically adds this element to the response only if you've // set up the distribution to serve private content with signed URLs. The element // lists the key pair IDs that CloudFront is aware of for each trusted signer. @@ -2586,6 +2956,54 @@ func (s *DistributionConfig) Validate() error { return nil } +// A distribution Configuration and a list of tags to be associated with the +// distribution. +type DistributionConfigWithTags struct { + _ struct{} `type:"structure"` + + // A distribution Configuration. + DistributionConfig *DistributionConfig `type:"structure" required:"true"` + + // A complex type that contains zero or more Tag elements. + Tags *Tags `type:"structure" required:"true"` +} + +// String returns the string representation +func (s DistributionConfigWithTags) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DistributionConfigWithTags) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DistributionConfigWithTags) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DistributionConfigWithTags"} + if s.DistributionConfig == nil { + invalidParams.Add(request.NewErrParamRequired("DistributionConfig")) + } + if s.Tags == nil { + invalidParams.Add(request.NewErrParamRequired("Tags")) + } + if s.DistributionConfig != nil { + if err := s.DistributionConfig.Validate(); err != nil { + invalidParams.AddNested("DistributionConfig", err.(request.ErrInvalidParams)) + } + } + if s.Tags != nil { + if err := s.Tags.Validate(); err != nil { + invalidParams.AddNested("Tags", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // A distribution list. type DistributionList struct { _ struct{} `type:"structure"` @@ -2629,6 +3047,10 @@ func (s DistributionList) GoString() string { type DistributionSummary struct { _ struct{} `type:"structure"` + // The ARN (Amazon Resource Name) for the distribution. For example: arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, + // where 123456789012 is your AWS account Id. + ARN *string `type:"string" required:"true"` + // A complex type that contains information about CNAMEs (alternate domain names), // if any, for this distribution. Aliases *Aliases `type:"structure" required:"true"` @@ -3646,6 +4068,55 @@ func (s ListStreamingDistributionsOutput) GoString() string { return s.String() } +// The request to list tags for a CloudFront resource. +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // An ARN of a CloudFront resource. + Resource *string `location:"querystring" locationName:"Resource" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListTagsForResourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTagsForResourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTagsForResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} + if s.Resource == nil { + invalidParams.Add(request.NewErrParamRequired("Resource")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The returned result of the corresponding request. +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure" payload:"Tags"` + + // A complex type that contains zero or more Tag elements. + Tags *Tags `type:"structure" required:"true"` +} + +// String returns the string representation +func (s ListTagsForResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTagsForResourceOutput) GoString() string { + return s.String() +} + // A complex type that controls whether access logs are written for the distribution. type LoggingConfig struct { _ struct{} `type:"structure"` @@ -4238,6 +4709,11 @@ func (s Signer) GoString() string { type StreamingDistribution struct { _ struct{} `type:"structure"` + // The ARN (Amazon Resource Name) for the streaming distribution. For example: + // arn:aws:cloudfront::123456789012:streaming-distribution/EDFDVBD632BHDS5, + // where 123456789012 is your AWS account Id. + ARN *string `type:"string" required:"true"` + // CloudFront automatically adds this element to the response only if you've // set up the distribution to serve private content with signed URLs. The element // lists the key pair IDs that CloudFront is aware of for each trusted signer. @@ -4385,6 +4861,54 @@ func (s *StreamingDistributionConfig) Validate() error { return nil } +// A streaming distribution Configuration and a list of tags to be associated +// with the streaming distribution. +type StreamingDistributionConfigWithTags struct { + _ struct{} `type:"structure"` + + // A streaming distribution Configuration. + StreamingDistributionConfig *StreamingDistributionConfig `type:"structure" required:"true"` + + // A complex type that contains zero or more Tag elements. + Tags *Tags `type:"structure" required:"true"` +} + +// String returns the string representation +func (s StreamingDistributionConfigWithTags) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StreamingDistributionConfigWithTags) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StreamingDistributionConfigWithTags) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StreamingDistributionConfigWithTags"} + if s.StreamingDistributionConfig == nil { + invalidParams.Add(request.NewErrParamRequired("StreamingDistributionConfig")) + } + if s.Tags == nil { + invalidParams.Add(request.NewErrParamRequired("Tags")) + } + if s.StreamingDistributionConfig != nil { + if err := s.StreamingDistributionConfig.Validate(); err != nil { + invalidParams.AddNested("StreamingDistributionConfig", err.(request.ErrInvalidParams)) + } + } + if s.Tags != nil { + if err := s.Tags.Validate(); err != nil { + invalidParams.AddNested("Tags", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // A streaming distribution list. type StreamingDistributionList struct { _ struct{} `type:"structure"` @@ -4429,6 +4953,11 @@ func (s StreamingDistributionList) GoString() string { type StreamingDistributionSummary struct { _ struct{} `type:"structure"` + // The ARN (Amazon Resource Name) for the streaming distribution. For example: + // arn:aws:cloudfront::123456789012:streaming-distribution/EDFDVBD632BHDS5, + // where 123456789012 is your AWS account Id. + ARN *string `type:"string" required:"true"` + // A complex type that contains information about CNAMEs (alternate domain names), // if any, for this streaming distribution. Aliases *Aliases `type:"structure" required:"true"` @@ -4535,6 +5064,159 @@ func (s *StreamingLoggingConfig) Validate() error { return nil } +// A complex type that contains Tag key and Tag value. +type Tag struct { + _ struct{} `type:"structure"` + + // A string that contains Tag key. The string length should be between 1 and + // 128 characters. Valid characters include a-z, A-Z, 0-9, space, and the special + // characters _ - . : / = + @. + Key *string `min:"1" type:"string" required:"true"` + + // A string that contains an optional Tag value. The string length should be + // between 0 and 256 characters. Valid characters include a-z, A-Z, 0-9, space, + // and the special characters _ - . : / = + @. + Value *string `type:"string"` +} + +// String returns the string representation +func (s Tag) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Tag) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Tag) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Tag"} + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// A complex type that contains zero or more Tag elements. +type TagKeys struct { + _ struct{} `type:"structure"` + + // A complex type that contains Tag key elements + Items []*string `locationNameList:"Key" type:"list"` +} + +// String returns the string representation +func (s TagKeys) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagKeys) GoString() string { + return s.String() +} + +// The request to add tags to a CloudFront resource. +type TagResourceInput struct { + _ struct{} `type:"structure" payload:"Tags"` + + // An ARN of a CloudFront resource. + Resource *string `location:"querystring" locationName:"Resource" type:"string" required:"true"` + + // A complex type that contains zero or more Tag elements. + Tags *Tags `locationName:"Tags" type:"structure" required:"true"` +} + +// String returns the string representation +func (s TagResourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagResourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TagResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} + if s.Resource == nil { + invalidParams.Add(request.NewErrParamRequired("Resource")) + } + if s.Tags == nil { + invalidParams.Add(request.NewErrParamRequired("Tags")) + } + if s.Tags != nil { + if err := s.Tags.Validate(); err != nil { + invalidParams.AddNested("Tags", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type TagResourceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s TagResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagResourceOutput) GoString() string { + return s.String() +} + +// A complex type that contains zero or more Tag elements. +type Tags struct { + _ struct{} `type:"structure"` + + // A complex type that contains Tag elements + Items []*Tag `locationNameList:"Tag" type:"list"` +} + +// String returns the string representation +func (s Tags) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Tags) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Tags) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Tags"} + if s.Items != nil { + for i, v := range s.Items { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Items", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // A complex type that specifies the AWS accounts, if any, that you want to // allow to create signed URLs for private content. If you want to require signed // URLs in requests for objects in the target origin that match the PathPattern @@ -4587,6 +5269,57 @@ func (s *TrustedSigners) Validate() error { return nil } +// The request to remove tags from a CloudFront resource. +type UntagResourceInput struct { + _ struct{} `type:"structure" payload:"TagKeys"` + + // An ARN of a CloudFront resource. + Resource *string `location:"querystring" locationName:"Resource" type:"string" required:"true"` + + // A complex type that contains zero or more Tag key elements. + TagKeys *TagKeys `locationName:"TagKeys" type:"structure" required:"true"` +} + +// String returns the string representation +func (s UntagResourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UntagResourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UntagResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} + if s.Resource == nil { + invalidParams.Add(request.NewErrParamRequired("Resource")) + } + if s.TagKeys == nil { + invalidParams.Add(request.NewErrParamRequired("TagKeys")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type UntagResourceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UntagResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UntagResourceOutput) GoString() string { + return s.String() +} + // The request to update an origin access identity. type UpdateCloudFrontOriginAccessIdentityInput struct { _ struct{} `type:"structure" payload:"CloudFrontOriginAccessIdentityConfig"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/examples_test.go index a10507eb5..09171dc17 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/examples_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/examples_test.go @@ -16,7 +16,13 @@ var _ time.Duration var _ bytes.Buffer func ExampleCloudFront_CreateCloudFrontOriginAccessIdentity() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.CreateCloudFrontOriginAccessIdentityInput{ CloudFrontOriginAccessIdentityConfig: &cloudfront.OriginAccessIdentityConfig{ // Required @@ -38,7 +44,13 @@ func ExampleCloudFront_CreateCloudFrontOriginAccessIdentity() { } func ExampleCloudFront_CreateDistribution() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.CreateDistributionInput{ DistributionConfig: &cloudfront.DistributionConfig{ // Required @@ -252,8 +264,246 @@ func ExampleCloudFront_CreateDistribution() { fmt.Println(resp) } +func ExampleCloudFront_CreateDistributionWithTags() { + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) + + params := &cloudfront.CreateDistributionWithTagsInput{ + DistributionConfigWithTags: &cloudfront.DistributionConfigWithTags{ // Required + DistributionConfig: &cloudfront.DistributionConfig{ // Required + CallerReference: aws.String("string"), // Required + Comment: aws.String("string"), // Required + DefaultCacheBehavior: &cloudfront.DefaultCacheBehavior{ // Required + ForwardedValues: &cloudfront.ForwardedValues{ // Required + Cookies: &cloudfront.CookiePreference{ // Required + Forward: aws.String("ItemSelection"), // Required + WhitelistedNames: &cloudfront.CookieNames{ + Quantity: aws.Int64(1), // Required + Items: []*string{ + aws.String("string"), // Required + // More values... + }, + }, + }, + QueryString: aws.Bool(true), // Required + Headers: &cloudfront.Headers{ + Quantity: aws.Int64(1), // Required + Items: []*string{ + aws.String("string"), // Required + // More values... + }, + }, + }, + MinTTL: aws.Int64(1), // Required + TargetOriginId: aws.String("string"), // Required + TrustedSigners: &cloudfront.TrustedSigners{ // Required + Enabled: aws.Bool(true), // Required + Quantity: aws.Int64(1), // Required + Items: []*string{ + aws.String("string"), // Required + // More values... + }, + }, + ViewerProtocolPolicy: aws.String("ViewerProtocolPolicy"), // Required + AllowedMethods: &cloudfront.AllowedMethods{ + Items: []*string{ // Required + aws.String("Method"), // Required + // More values... + }, + Quantity: aws.Int64(1), // Required + CachedMethods: &cloudfront.CachedMethods{ + Items: []*string{ // Required + aws.String("Method"), // Required + // More values... + }, + Quantity: aws.Int64(1), // Required + }, + }, + Compress: aws.Bool(true), + DefaultTTL: aws.Int64(1), + MaxTTL: aws.Int64(1), + SmoothStreaming: aws.Bool(true), + }, + Enabled: aws.Bool(true), // Required + Origins: &cloudfront.Origins{ // Required + Quantity: aws.Int64(1), // Required + Items: []*cloudfront.Origin{ + { // Required + DomainName: aws.String("string"), // Required + Id: aws.String("string"), // Required + CustomHeaders: &cloudfront.CustomHeaders{ + Quantity: aws.Int64(1), // Required + Items: []*cloudfront.OriginCustomHeader{ + { // Required + HeaderName: aws.String("string"), // Required + HeaderValue: aws.String("string"), // Required + }, + // More values... + }, + }, + CustomOriginConfig: &cloudfront.CustomOriginConfig{ + HTTPPort: aws.Int64(1), // Required + HTTPSPort: aws.Int64(1), // Required + OriginProtocolPolicy: aws.String("OriginProtocolPolicy"), // Required + OriginSslProtocols: &cloudfront.OriginSslProtocols{ + Items: []*string{ // Required + aws.String("SslProtocol"), // Required + // More values... + }, + Quantity: aws.Int64(1), // Required + }, + }, + OriginPath: aws.String("string"), + S3OriginConfig: &cloudfront.S3OriginConfig{ + OriginAccessIdentity: aws.String("string"), // Required + }, + }, + // More values... + }, + }, + Aliases: &cloudfront.Aliases{ + Quantity: aws.Int64(1), // Required + Items: []*string{ + aws.String("string"), // Required + // More values... + }, + }, + CacheBehaviors: &cloudfront.CacheBehaviors{ + Quantity: aws.Int64(1), // Required + Items: []*cloudfront.CacheBehavior{ + { // Required + ForwardedValues: &cloudfront.ForwardedValues{ // Required + Cookies: &cloudfront.CookiePreference{ // Required + Forward: aws.String("ItemSelection"), // Required + WhitelistedNames: &cloudfront.CookieNames{ + Quantity: aws.Int64(1), // Required + Items: []*string{ + aws.String("string"), // Required + // More values... + }, + }, + }, + QueryString: aws.Bool(true), // Required + Headers: &cloudfront.Headers{ + Quantity: aws.Int64(1), // Required + Items: []*string{ + aws.String("string"), // Required + // More values... + }, + }, + }, + MinTTL: aws.Int64(1), // Required + PathPattern: aws.String("string"), // Required + TargetOriginId: aws.String("string"), // Required + TrustedSigners: &cloudfront.TrustedSigners{ // Required + Enabled: aws.Bool(true), // Required + Quantity: aws.Int64(1), // Required + Items: []*string{ + aws.String("string"), // Required + // More values... + }, + }, + ViewerProtocolPolicy: aws.String("ViewerProtocolPolicy"), // Required + AllowedMethods: &cloudfront.AllowedMethods{ + Items: []*string{ // Required + aws.String("Method"), // Required + // More values... + }, + Quantity: aws.Int64(1), // Required + CachedMethods: &cloudfront.CachedMethods{ + Items: []*string{ // Required + aws.String("Method"), // Required + // More values... + }, + Quantity: aws.Int64(1), // Required + }, + }, + Compress: aws.Bool(true), + DefaultTTL: aws.Int64(1), + MaxTTL: aws.Int64(1), + SmoothStreaming: aws.Bool(true), + }, + // More values... + }, + }, + CustomErrorResponses: &cloudfront.CustomErrorResponses{ + Quantity: aws.Int64(1), // Required + Items: []*cloudfront.CustomErrorResponse{ + { // Required + ErrorCode: aws.Int64(1), // Required + ErrorCachingMinTTL: aws.Int64(1), + ResponseCode: aws.String("string"), + ResponsePagePath: aws.String("string"), + }, + // More values... + }, + }, + DefaultRootObject: aws.String("string"), + Logging: &cloudfront.LoggingConfig{ + Bucket: aws.String("string"), // Required + Enabled: aws.Bool(true), // Required + IncludeCookies: aws.Bool(true), // Required + Prefix: aws.String("string"), // Required + }, + PriceClass: aws.String("PriceClass"), + Restrictions: &cloudfront.Restrictions{ + GeoRestriction: &cloudfront.GeoRestriction{ // Required + Quantity: aws.Int64(1), // Required + RestrictionType: aws.String("GeoRestrictionType"), // Required + Items: []*string{ + aws.String("string"), // Required + // More values... + }, + }, + }, + ViewerCertificate: &cloudfront.ViewerCertificate{ + ACMCertificateArn: aws.String("string"), + Certificate: aws.String("string"), + CertificateSource: aws.String("CertificateSource"), + CloudFrontDefaultCertificate: aws.Bool(true), + IAMCertificateId: aws.String("string"), + MinimumProtocolVersion: aws.String("MinimumProtocolVersion"), + SSLSupportMethod: aws.String("SSLSupportMethod"), + }, + WebACLId: aws.String("string"), + }, + Tags: &cloudfront.Tags{ // Required + Items: []*cloudfront.Tag{ + { // Required + Key: aws.String("TagKey"), // Required + Value: aws.String("TagValue"), + }, + // More values... + }, + }, + }, + } + resp, err := svc.CreateDistributionWithTags(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + func ExampleCloudFront_CreateInvalidation() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.CreateInvalidationInput{ DistributionId: aws.String("string"), // Required @@ -282,7 +532,13 @@ func ExampleCloudFront_CreateInvalidation() { } func ExampleCloudFront_CreateStreamingDistribution() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.CreateStreamingDistributionInput{ StreamingDistributionConfig: &cloudfront.StreamingDistributionConfig{ // Required @@ -329,8 +585,79 @@ func ExampleCloudFront_CreateStreamingDistribution() { fmt.Println(resp) } +func ExampleCloudFront_CreateStreamingDistributionWithTags() { + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) + + params := &cloudfront.CreateStreamingDistributionWithTagsInput{ + StreamingDistributionConfigWithTags: &cloudfront.StreamingDistributionConfigWithTags{ // Required + StreamingDistributionConfig: &cloudfront.StreamingDistributionConfig{ // Required + CallerReference: aws.String("string"), // Required + Comment: aws.String("string"), // Required + Enabled: aws.Bool(true), // Required + S3Origin: &cloudfront.S3Origin{ // Required + DomainName: aws.String("string"), // Required + OriginAccessIdentity: aws.String("string"), // Required + }, + TrustedSigners: &cloudfront.TrustedSigners{ // Required + Enabled: aws.Bool(true), // Required + Quantity: aws.Int64(1), // Required + Items: []*string{ + aws.String("string"), // Required + // More values... + }, + }, + Aliases: &cloudfront.Aliases{ + Quantity: aws.Int64(1), // Required + Items: []*string{ + aws.String("string"), // Required + // More values... + }, + }, + Logging: &cloudfront.StreamingLoggingConfig{ + Bucket: aws.String("string"), // Required + Enabled: aws.Bool(true), // Required + Prefix: aws.String("string"), // Required + }, + PriceClass: aws.String("PriceClass"), + }, + Tags: &cloudfront.Tags{ // Required + Items: []*cloudfront.Tag{ + { // Required + Key: aws.String("TagKey"), // Required + Value: aws.String("TagValue"), + }, + // More values... + }, + }, + }, + } + resp, err := svc.CreateStreamingDistributionWithTags(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + func ExampleCloudFront_DeleteCloudFrontOriginAccessIdentity() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.DeleteCloudFrontOriginAccessIdentityInput{ Id: aws.String("string"), // Required @@ -350,7 +677,13 @@ func ExampleCloudFront_DeleteCloudFrontOriginAccessIdentity() { } func ExampleCloudFront_DeleteDistribution() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.DeleteDistributionInput{ Id: aws.String("string"), // Required @@ -370,7 +703,13 @@ func ExampleCloudFront_DeleteDistribution() { } func ExampleCloudFront_DeleteStreamingDistribution() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.DeleteStreamingDistributionInput{ Id: aws.String("string"), // Required @@ -390,7 +729,13 @@ func ExampleCloudFront_DeleteStreamingDistribution() { } func ExampleCloudFront_GetCloudFrontOriginAccessIdentity() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.GetCloudFrontOriginAccessIdentityInput{ Id: aws.String("string"), // Required @@ -409,7 +754,13 @@ func ExampleCloudFront_GetCloudFrontOriginAccessIdentity() { } func ExampleCloudFront_GetCloudFrontOriginAccessIdentityConfig() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.GetCloudFrontOriginAccessIdentityConfigInput{ Id: aws.String("string"), // Required @@ -428,7 +779,13 @@ func ExampleCloudFront_GetCloudFrontOriginAccessIdentityConfig() { } func ExampleCloudFront_GetDistribution() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.GetDistributionInput{ Id: aws.String("string"), // Required @@ -447,7 +804,13 @@ func ExampleCloudFront_GetDistribution() { } func ExampleCloudFront_GetDistributionConfig() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.GetDistributionConfigInput{ Id: aws.String("string"), // Required @@ -466,7 +829,13 @@ func ExampleCloudFront_GetDistributionConfig() { } func ExampleCloudFront_GetInvalidation() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.GetInvalidationInput{ DistributionId: aws.String("string"), // Required @@ -486,7 +855,13 @@ func ExampleCloudFront_GetInvalidation() { } func ExampleCloudFront_GetStreamingDistribution() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.GetStreamingDistributionInput{ Id: aws.String("string"), // Required @@ -505,7 +880,13 @@ func ExampleCloudFront_GetStreamingDistribution() { } func ExampleCloudFront_GetStreamingDistributionConfig() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.GetStreamingDistributionConfigInput{ Id: aws.String("string"), // Required @@ -524,7 +905,13 @@ func ExampleCloudFront_GetStreamingDistributionConfig() { } func ExampleCloudFront_ListCloudFrontOriginAccessIdentities() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.ListCloudFrontOriginAccessIdentitiesInput{ Marker: aws.String("string"), @@ -544,7 +931,13 @@ func ExampleCloudFront_ListCloudFrontOriginAccessIdentities() { } func ExampleCloudFront_ListDistributions() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.ListDistributionsInput{ Marker: aws.String("string"), @@ -564,7 +957,13 @@ func ExampleCloudFront_ListDistributions() { } func ExampleCloudFront_ListDistributionsByWebACLId() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.ListDistributionsByWebACLIdInput{ WebACLId: aws.String("string"), // Required @@ -585,7 +984,13 @@ func ExampleCloudFront_ListDistributionsByWebACLId() { } func ExampleCloudFront_ListInvalidations() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.ListInvalidationsInput{ DistributionId: aws.String("string"), // Required @@ -606,7 +1011,13 @@ func ExampleCloudFront_ListInvalidations() { } func ExampleCloudFront_ListStreamingDistributions() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.ListStreamingDistributionsInput{ Marker: aws.String("string"), @@ -625,8 +1036,104 @@ func ExampleCloudFront_ListStreamingDistributions() { fmt.Println(resp) } +func ExampleCloudFront_ListTagsForResource() { + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) + + params := &cloudfront.ListTagsForResourceInput{ + Resource: aws.String("ResourceARN"), // Required + } + resp, err := svc.ListTagsForResource(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleCloudFront_TagResource() { + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) + + params := &cloudfront.TagResourceInput{ + Resource: aws.String("ResourceARN"), // Required + Tags: &cloudfront.Tags{ // Required + Items: []*cloudfront.Tag{ + { // Required + Key: aws.String("TagKey"), // Required + Value: aws.String("TagValue"), + }, + // More values... + }, + }, + } + resp, err := svc.TagResource(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleCloudFront_UntagResource() { + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) + + params := &cloudfront.UntagResourceInput{ + Resource: aws.String("ResourceARN"), // Required + TagKeys: &cloudfront.TagKeys{ // Required + Items: []*string{ + aws.String("TagKey"), // Required + // More values... + }, + }, + } + resp, err := svc.UntagResource(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + func ExampleCloudFront_UpdateCloudFrontOriginAccessIdentity() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.UpdateCloudFrontOriginAccessIdentityInput{ CloudFrontOriginAccessIdentityConfig: &cloudfront.OriginAccessIdentityConfig{ // Required @@ -650,7 +1157,13 @@ func ExampleCloudFront_UpdateCloudFrontOriginAccessIdentity() { } func ExampleCloudFront_UpdateDistribution() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.UpdateDistributionInput{ DistributionConfig: &cloudfront.DistributionConfig{ // Required @@ -867,7 +1380,13 @@ func ExampleCloudFront_UpdateDistribution() { } func ExampleCloudFront_UpdateStreamingDistribution() { - svc := cloudfront.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudfront.New(sess) params := &cloudfront.UpdateStreamingDistributionInput{ Id: aws.String("string"), // Required diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/service.go index 99d23c72e..d3ef6b076 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/service.go @@ -11,7 +11,11 @@ import ( "github.com/aws/aws-sdk-go/private/protocol/restxml" ) -// CloudFront is a client for CloudFront. +// Amazon CloudFront is a global content delivery network (CDN) service that +// accelerates delivery of your websites, APIs, video content or other web assets. +// It integrates with other Amazon Web Services products to give developers +// and businesses an easy way to accelerate content to end users with no minimum +// usage commitments. //The service client's operations are safe to be used concurrently. // It is not safe to mutate any of the client's properties though. type CloudFront struct { @@ -51,7 +55,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceName: ServiceName, SigningRegion: signingRegion, Endpoint: endpoint, - APIVersion: "2016-01-28", + APIVersion: "2016-08-01", }, handlers, ), diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/api.go index d2f65e266..991cd6e17 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/api.go @@ -106,13 +106,13 @@ func (c *CloudWatchLogs) CreateExportTaskRequest(input *CreateExportTaskInput) ( // Creates an ExportTask which allows you to efficiently export data from a // Log Group to your Amazon S3 bucket. // -// This is an asynchronous call. If all the required information is provided, +// This is an asynchronous call. If all the required information is provided, // this API will initiate an export task and respond with the task Id. Once // started, DescribeExportTasks can be used to get the status of an export task. // You can only have one active (RUNNING or PENDING) export task at a time, // per account. // -// You can export logs from multiple log groups or multiple time ranges to +// You can export logs from multiple log groups or multiple time ranges to // the same Amazon S3 bucket. To separate out log data for each export task, // you can specify a prefix that will be used as the Amazon S3 key prefix for // all exported objects. @@ -169,9 +169,12 @@ func (c *CloudWatchLogs) CreateLogGroupRequest(input *CreateLogGroupInput) (req // must be unique within a region for an AWS account. You can create up to 500 // log groups per account. // -// You must use the following guidelines when naming a log group: Log group -// names can be between 1 and 512 characters long. Allowed characters are a-z, -// A-Z, 0-9, '_' (underscore), '-' (hyphen), '/' (forward slash), and '.' (period). +// You must use the following guidelines when naming a log group: +// +// Log group names can be between 1 and 512 characters long. +// +// Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), +// '/' (forward slash), and '.' (period). func (c *CloudWatchLogs) CreateLogGroup(input *CreateLogGroupInput) (*CreateLogGroupOutput, error) { req, out := c.CreateLogGroupRequest(input) err := req.Send() @@ -225,9 +228,11 @@ func (c *CloudWatchLogs) CreateLogStreamRequest(input *CreateLogStreamInput) (re // stream must be unique within the log group. There is no limit on the number // of log streams that can exist in a log group. // -// You must use the following guidelines when naming a log stream: Log stream -// names can be between 1 and 512 characters long. The ':' colon character is -// not allowed. +// You must use the following guidelines when naming a log stream: +// +// Log stream names can be between 1 and 512 characters long. +// +// The ':' colon character is not allowed. func (c *CloudWatchLogs) CreateLogStream(input *CreateLogStreamInput) (*CreateLogStreamOutput, error) { req, out := c.CreateLogStreamRequest(input) err := req.Send() @@ -590,10 +595,10 @@ func (c *CloudWatchLogs) DescribeDestinationsRequest(input *DescribeDestinations // the request. The list returned in the response is ASCII-sorted by destination // name. // -// By default, this operation returns up to 50 destinations. If there are -// more destinations to list, the response would contain a nextToken value in -// the response body. You can also limit the number of destinations returned -// in the response by specifying the limit parameter in the request. +// By default, this operation returns up to 50 destinations. If there are more +// destinations to list, the response would contain a nextToken value in the +// response body. You can also limit the number of destinations returned in +// the response by specifying the limit parameter in the request. func (c *CloudWatchLogs) DescribeDestinations(input *DescribeDestinationsInput) (*DescribeDestinationsOutput, error) { req, out := c.DescribeDestinationsRequest(input) err := req.Send() @@ -669,7 +674,7 @@ func (c *CloudWatchLogs) DescribeExportTasksRequest(input *DescribeExportTasksIn // Returns all the export tasks that are associated with the AWS account making // the request. The export tasks can be filtered based on TaskId or TaskStatus. // -// By default, this operation returns up to 50 export tasks that satisfy the +// By default, this operation returns up to 50 export tasks that satisfy the // specified filters. If there are more export tasks to list, the response would // contain a nextToken value in the response body. You can also limit the number // of export tasks returned in the response by specifying the limit parameter @@ -731,7 +736,7 @@ func (c *CloudWatchLogs) DescribeLogGroupsRequest(input *DescribeLogGroupsInput) // the request. The list returned in the response is ASCII-sorted by log group // name. // -// By default, this operation returns up to 50 log groups. If there are more +// By default, this operation returns up to 50 log groups. If there are more // log groups to list, the response would contain a nextToken value in the response // body. You can also limit the number of log groups returned in the response // by specifying the limit parameter in the request. @@ -816,7 +821,7 @@ func (c *CloudWatchLogs) DescribeLogStreamsRequest(input *DescribeLogStreamsInpu // Returns all the log streams that are associated with the specified log group. // The list returned in the response is ASCII-sorted by log stream name. // -// By default, this operation returns up to 50 log streams. If there are more +// By default, this operation returns up to 50 log streams. If there are more // log streams to list, the response would contain a nextToken value in the // response body. You can also limit the number of log streams returned in the // response by specifying the limit parameter in the request. This operation @@ -903,7 +908,7 @@ func (c *CloudWatchLogs) DescribeMetricFiltersRequest(input *DescribeMetricFilte // Returns all the metrics filters associated with the specified log group. // The list returned in the response is ASCII-sorted by filter name. // -// By default, this operation returns up to 50 metric filters. If there are +// By default, this operation returns up to 50 metric filters. If there are // more metric filters to list, the response would contain a nextToken value // in the response body. You can also limit the number of metric filters returned // in the response by specifying the limit parameter in the request. @@ -988,7 +993,7 @@ func (c *CloudWatchLogs) DescribeSubscriptionFiltersRequest(input *DescribeSubsc // Returns all the subscription filters associated with the specified log group. // The list returned in the response is ASCII-sorted by filter name. // -// By default, this operation returns up to 50 subscription filters. If there +// By default, this operation returns up to 50 subscription filters. If there // are more subscription filters to list, the response would contain a nextToken // value in the response body. You can also limit the number of subscription // filters returned in the response by specifying the limit parameter in the @@ -1076,14 +1081,14 @@ func (c *CloudWatchLogs) FilterLogEventsRequest(input *FilterLogEventsInput) (re // the event timestamp. You can limit the streams searched to an explicit list // of logStreamNames. // -// By default, this operation returns as much matching log events as can fit +// By default, this operation returns as much matching log events as can fit // in a response size of 1MB, up to 10,000 log events, or all the events found // within a time-bounded scan window. If the response includes a nextToken, // then there is more data to search, and the search can be resumed with a new // request providing the nextToken. The response will contain a list of searchedLogStreams // that contains information about which streams were searched in the request // and whether they have been searched completely or require further pagination. -// The limit parameter in the request. can be used to specify the maximum number +// The limit parameter in the request can be used to specify the maximum number // of events to return in a page. func (c *CloudWatchLogs) FilterLogEvents(input *FilterLogEventsInput) (*FilterLogEventsOutput, error) { req, out := c.FilterLogEventsRequest(input) @@ -1166,7 +1171,7 @@ func (c *CloudWatchLogs) GetLogEventsRequest(input *GetLogEventsInput) (req *req // Retrieves log events from the specified log stream. You can provide an optional // time range to filter the results on the event timestamp. // -// By default, this operation returns as much log events as can fit in a response +// By default, this operation returns as much log events as can fit in a response // size of 1MB, up to 10,000 log events. The response will always include a // nextForwardToken and a nextBackwardToken in the response body. You can use // any of these tokens in subsequent GetLogEvents requests to paginate through @@ -1251,7 +1256,7 @@ func (c *CloudWatchLogs) PutDestinationRequest(input *PutDestinationInput) (req // Currently, the only supported physical resource is a Amazon Kinesis stream // belonging to the same account as the destination. // -// A destination controls what is written to its Amazon Kinesis stream through +// A destination controls what is written to its Amazon Kinesis stream through // an access policy. By default, PutDestination does not set any access policy // with the destination, which means a cross-account user will not be able to // call PutSubscriptionFilter against this destination. To enable that, the @@ -1358,19 +1363,28 @@ func (c *CloudWatchLogs) PutLogEventsRequest(input *PutLogEventsInput) (req *req // Uploads a batch of log events to the specified log stream. // -// Every PutLogEvents request must include the sequenceToken obtained from +// Every PutLogEvents request must include the sequenceToken obtained from // the response of the previous request. An upload in a newly created log stream -// does not require a sequenceToken. -// -// The batch of events must satisfy the following constraints: The maximum -// batch size is 1,048,576 bytes, and this size is calculated as the sum of -// all event messages in UTF-8, plus 26 bytes for each log event. None of the -// log events in the batch can be more than 2 hours in the future. None of the -// log events in the batch can be older than 14 days or the retention period -// of the log group. The log events in the batch must be in chronological ordered -// by their timestamp. The maximum number of log events in a batch is 10,000. -// A batch of log events in a single PutLogEvents request cannot span more than -// 24 hours. Otherwise, the PutLogEvents operation will fail. +// does not require a sequenceToken. You can also get the sequenceToken using +// DescribeLogStreams. +// +// The batch of events must satisfy the following constraints: +// +// The maximum batch size is 1,048,576 bytes, and this size is calculated +// as the sum of all event messages in UTF-8, plus 26 bytes for each log event. +// +// None of the log events in the batch can be more than 2 hours in the future. +// +// None of the log events in the batch can be older than 14 days or the retention +// period of the log group. +// +// The log events in the batch must be in chronological ordered by their +// timestamp. +// +// The maximum number of log events in a batch is 10,000. +// +// A batch of log events in a single PutLogEvents request cannot span more +// than 24 hours. Otherwise, the PutLogEvents operation will fail. func (c *CloudWatchLogs) PutLogEvents(input *PutLogEventsInput) (*PutLogEventsOutput, error) { req, out := c.PutLogEventsRequest(input) err := req.Send() @@ -1424,8 +1438,8 @@ func (c *CloudWatchLogs) PutMetricFilterRequest(input *PutMetricFilterInput) (re // group. Metric filters allow you to configure rules to extract metric data // from log events ingested through PutLogEvents requests. // -// The maximum number of metric filters that can be associated with a log -// group is 100. +// The maximum number of metric filters that can be associated with a log group +// is 100. func (c *CloudWatchLogs) PutMetricFilter(input *PutMetricFilterInput) (*PutMetricFilterOutput, error) { req, out := c.PutMetricFilterRequest(input) err := req.Send() @@ -1530,17 +1544,22 @@ func (c *CloudWatchLogs) PutSubscriptionFilterRequest(input *PutSubscriptionFilt // Creates or updates a subscription filter and associates it with the specified // log group. Subscription filters allow you to subscribe to a real-time stream // of log events ingested through PutLogEvents requests and have them delivered -// to a specific destination. Currently, the supported destinations are: An -// Amazon Kinesis stream belonging to the same account as the subscription filter, -// for same-account delivery. A logical destination (used via an ARN of Destination) -// belonging to a different account, for cross-account delivery. An Amazon -// Kinesis Firehose stream belonging to the same account as the subscription -// filter, for same-account delivery. An AWS Lambda function belonging to -// the same account as the subscription filter, for same-account delivery. +// to a specific destination. Currently, the supported destinations are: +// +// An Amazon Kinesis stream belonging to the same account as the subscription +// filter, for same-account delivery. +// +// A logical destination (used via an ARN of Destination) belonging to a +// different account, for cross-account delivery. // +// An Amazon Kinesis Firehose stream belonging to the same account as the +// subscription filter, for same-account delivery. // -// Currently there can only be one subscription filter associated with a log -// group. +// An AWS Lambda function belonging to the same account as the subscription +// filter, for same-account delivery. +// +// Currently there can only be one subscription filter associated with a +// log group. func (c *CloudWatchLogs) PutSubscriptionFilter(input *PutSubscriptionFilterInput) (*PutSubscriptionFilterOutput, error) { req, out := c.PutSubscriptionFilterRequest(input) err := req.Send() @@ -1649,7 +1668,7 @@ type CreateExportTaskInput struct { // Name of Amazon S3 bucket to which the log data will be exported. // - // Note: Only buckets in the same AWS region are supported. + // Note: Only buckets in the same AWS region are supported. Destination *string `locationName:"destination" min:"1" type:"string" required:"true"` // Prefix that will be used as the start of Amazon S3 key for every object exported. @@ -3121,17 +3140,18 @@ func (s MetricFilterMatchRecord) GoString() string { type MetricTransformation struct { _ struct{} `type:"structure"` - // The name of the CloudWatch metric to which the monitored log information - // should be published. For example, you may publish to a metric called ErrorCount. + // (Optional) A default value to emit when a filter pattern does not match a + // log event. Can be null. + DefaultValue *float64 `locationName:"defaultValue" type:"double"` + + // Name of the metric. MetricName *string `locationName:"metricName" type:"string" required:"true"` - // The destination namespace of the new CloudWatch metric. + // Namespace to which the metric belongs. MetricNamespace *string `locationName:"metricNamespace" type:"string" required:"true"` - // What to publish to the metric. For example, if you're counting the occurrences - // of a particular term like "Error", the value will be "1" for each occurrence. - // If you're counting the bytes transferred the published value will be the - // value in the log event. + // A string representing a value to publish to this metric when a filter pattern + // matches a log event. MetricValue *string `locationName:"metricValue" type:"string" required:"true"` } @@ -3195,7 +3215,7 @@ type PutDestinationInput struct { DestinationName *string `locationName:"destinationName" min:"1" type:"string" required:"true"` // The ARN of an IAM role that grants CloudWatch Logs permissions to do Amazon - // Kinesis PutRecord requests on the desitnation stream. + // Kinesis PutRecord requests on the destination stream. RoleArn *string `locationName:"roleArn" min:"1" type:"string" required:"true"` // The ARN of an Amazon Kinesis stream to deliver matching log events to. @@ -3544,11 +3564,17 @@ type PutSubscriptionFilterInput struct { _ struct{} `type:"structure"` // The ARN of the destination to deliver matching log events to. Currently, - // the supported destinations are: An Amazon Kinesis stream belonging to the - // same account as the subscription filter, for same-account delivery. A logical - // destination (used via an ARN of Destination) belonging to a different account, - // for cross-account delivery. An Amazon Kinesis Firehose stream belonging - // to the same account as the subscription filter, for same-account delivery. + // the supported destinations are: + // + // An Amazon Kinesis stream belonging to the same account as the subscription + // filter, for same-account delivery. + // + // A logical destination (used via an ARN of Destination) belonging to a + // different account, for cross-account delivery. + // + // An Amazon Kinesis Firehose stream belonging to the same account as the + // subscription filter, for same-account delivery. + // // An AWS Lambda function belonging to the same account as the subscription // filter, for same-account delivery. DestinationArn *string `locationName:"destinationArn" min:"1" type:"string" required:"true"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/examples_test.go index 13c56fc88..421971122 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/examples_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/examples_test.go @@ -16,7 +16,13 @@ var _ time.Duration var _ bytes.Buffer func ExampleCloudWatchLogs_CancelExportTask() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.CancelExportTaskInput{ TaskId: aws.String("ExportTaskId"), // Required @@ -35,7 +41,13 @@ func ExampleCloudWatchLogs_CancelExportTask() { } func ExampleCloudWatchLogs_CreateExportTask() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.CreateExportTaskInput{ Destination: aws.String("ExportDestinationBucket"), // Required @@ -60,7 +72,13 @@ func ExampleCloudWatchLogs_CreateExportTask() { } func ExampleCloudWatchLogs_CreateLogGroup() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.CreateLogGroupInput{ LogGroupName: aws.String("LogGroupName"), // Required @@ -79,7 +97,13 @@ func ExampleCloudWatchLogs_CreateLogGroup() { } func ExampleCloudWatchLogs_CreateLogStream() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.CreateLogStreamInput{ LogGroupName: aws.String("LogGroupName"), // Required @@ -99,7 +123,13 @@ func ExampleCloudWatchLogs_CreateLogStream() { } func ExampleCloudWatchLogs_DeleteDestination() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.DeleteDestinationInput{ DestinationName: aws.String("DestinationName"), // Required @@ -118,7 +148,13 @@ func ExampleCloudWatchLogs_DeleteDestination() { } func ExampleCloudWatchLogs_DeleteLogGroup() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.DeleteLogGroupInput{ LogGroupName: aws.String("LogGroupName"), // Required @@ -137,7 +173,13 @@ func ExampleCloudWatchLogs_DeleteLogGroup() { } func ExampleCloudWatchLogs_DeleteLogStream() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.DeleteLogStreamInput{ LogGroupName: aws.String("LogGroupName"), // Required @@ -157,7 +199,13 @@ func ExampleCloudWatchLogs_DeleteLogStream() { } func ExampleCloudWatchLogs_DeleteMetricFilter() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.DeleteMetricFilterInput{ FilterName: aws.String("FilterName"), // Required @@ -177,7 +225,13 @@ func ExampleCloudWatchLogs_DeleteMetricFilter() { } func ExampleCloudWatchLogs_DeleteRetentionPolicy() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.DeleteRetentionPolicyInput{ LogGroupName: aws.String("LogGroupName"), // Required @@ -196,7 +250,13 @@ func ExampleCloudWatchLogs_DeleteRetentionPolicy() { } func ExampleCloudWatchLogs_DeleteSubscriptionFilter() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.DeleteSubscriptionFilterInput{ FilterName: aws.String("FilterName"), // Required @@ -216,7 +276,13 @@ func ExampleCloudWatchLogs_DeleteSubscriptionFilter() { } func ExampleCloudWatchLogs_DescribeDestinations() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.DescribeDestinationsInput{ DestinationNamePrefix: aws.String("DestinationName"), @@ -237,7 +303,13 @@ func ExampleCloudWatchLogs_DescribeDestinations() { } func ExampleCloudWatchLogs_DescribeExportTasks() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.DescribeExportTasksInput{ Limit: aws.Int64(1), @@ -259,7 +331,13 @@ func ExampleCloudWatchLogs_DescribeExportTasks() { } func ExampleCloudWatchLogs_DescribeLogGroups() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.DescribeLogGroupsInput{ Limit: aws.Int64(1), @@ -280,7 +358,13 @@ func ExampleCloudWatchLogs_DescribeLogGroups() { } func ExampleCloudWatchLogs_DescribeLogStreams() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.DescribeLogStreamsInput{ LogGroupName: aws.String("LogGroupName"), // Required @@ -304,7 +388,13 @@ func ExampleCloudWatchLogs_DescribeLogStreams() { } func ExampleCloudWatchLogs_DescribeMetricFilters() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.DescribeMetricFiltersInput{ LogGroupName: aws.String("LogGroupName"), // Required @@ -326,7 +416,13 @@ func ExampleCloudWatchLogs_DescribeMetricFilters() { } func ExampleCloudWatchLogs_DescribeSubscriptionFilters() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.DescribeSubscriptionFiltersInput{ LogGroupName: aws.String("LogGroupName"), // Required @@ -348,7 +444,13 @@ func ExampleCloudWatchLogs_DescribeSubscriptionFilters() { } func ExampleCloudWatchLogs_FilterLogEvents() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.FilterLogEventsInput{ LogGroupName: aws.String("LogGroupName"), // Required @@ -377,7 +479,13 @@ func ExampleCloudWatchLogs_FilterLogEvents() { } func ExampleCloudWatchLogs_GetLogEvents() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.GetLogEventsInput{ LogGroupName: aws.String("LogGroupName"), // Required @@ -402,7 +510,13 @@ func ExampleCloudWatchLogs_GetLogEvents() { } func ExampleCloudWatchLogs_PutDestination() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.PutDestinationInput{ DestinationName: aws.String("DestinationName"), // Required @@ -423,7 +537,13 @@ func ExampleCloudWatchLogs_PutDestination() { } func ExampleCloudWatchLogs_PutDestinationPolicy() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.PutDestinationPolicyInput{ AccessPolicy: aws.String("AccessPolicy"), // Required @@ -443,7 +563,13 @@ func ExampleCloudWatchLogs_PutDestinationPolicy() { } func ExampleCloudWatchLogs_PutLogEvents() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.PutLogEventsInput{ LogEvents: []*cloudwatchlogs.InputLogEvent{ // Required @@ -471,7 +597,13 @@ func ExampleCloudWatchLogs_PutLogEvents() { } func ExampleCloudWatchLogs_PutMetricFilter() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.PutMetricFilterInput{ FilterName: aws.String("FilterName"), // Required @@ -482,6 +614,7 @@ func ExampleCloudWatchLogs_PutMetricFilter() { MetricName: aws.String("MetricName"), // Required MetricNamespace: aws.String("MetricNamespace"), // Required MetricValue: aws.String("MetricValue"), // Required + DefaultValue: aws.Float64(1.0), }, // More values... }, @@ -500,7 +633,13 @@ func ExampleCloudWatchLogs_PutMetricFilter() { } func ExampleCloudWatchLogs_PutRetentionPolicy() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.PutRetentionPolicyInput{ LogGroupName: aws.String("LogGroupName"), // Required @@ -520,7 +659,13 @@ func ExampleCloudWatchLogs_PutRetentionPolicy() { } func ExampleCloudWatchLogs_PutSubscriptionFilter() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.PutSubscriptionFilterInput{ DestinationArn: aws.String("DestinationArn"), // Required @@ -543,7 +688,13 @@ func ExampleCloudWatchLogs_PutSubscriptionFilter() { } func ExampleCloudWatchLogs_TestMetricFilter() { - svc := cloudwatchlogs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := cloudwatchlogs.New(sess) params := &cloudwatchlogs.TestMetricFilterInput{ FilterPattern: aws.String("FilterPattern"), // Required diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/service.go index 064110304..c769589cf 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/service.go @@ -19,7 +19,7 @@ import ( // // You can use CloudWatch Logs to: // -// Monitor Logs from Amazon EC2 Instances in Real-time: You can use CloudWatch +// Monitor Logs from Amazon EC2 Instances in Real-time: You can use CloudWatch // Logs to monitor applications and systems using log data. For example, CloudWatch // Logs can track the number of errors that occur in your application logs and // send you a notification whenever the rate of errors exceeds a threshold you @@ -30,12 +30,12 @@ import ( // codes in an Apache access log). When the term you are searching for is found, // CloudWatch Logs reports the data to a Amazon CloudWatch metric that you specify. // -// Monitor Amazon CloudTrail Logged Events: You can create alarms in Amazon +// Monitor Amazon CloudTrail Logged Events: You can create alarms in Amazon // CloudWatch and receive notifications of particular API activity as captured // by CloudTrail and use the notification to perform troubleshooting. // -// Archive Log Data: You can use CloudWatch Logs to store your log data in -// highly durable storage. You can change the log retention setting so that +// Archive Log Data: You can use CloudWatch Logs to store your log data +// in highly durable storage. You can change the log retention setting so that // any log events older than this setting are automatically deleted. The CloudWatch // Logs agent makes it easy to quickly send both rotated and non-rotated log // data off of a host and into the log service. You can then access the raw diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/doc.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/doc.go index 3d46f736b..b603b5840 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/doc.go @@ -31,7 +31,12 @@ // // Marshal Go value type for DynamoDB.PutItem: // -// sess := session.New() +// sess, err := session.NewSession() +// if err != nil { +// fmt.Println("Failed create session", err) +// return +// } +// // svc := dynamodb.New(sess) // item, err := dynamodbattribute.MarshalMap(r) // if err != nil { @@ -57,4 +62,6 @@ // the json.Marshaler and json.Unmarshaler interfaces have been removed and // replaced with have been replaced with dynamodbattribute.Marshaler and // dynamodbattribute.Unmarshaler interfaces. +// +// `time.Time` is marshaled as RFC3339 format. package dynamodbattribute diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode.go index 72c07fee8..dac9ef8d1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/dynamodb" ) -// A Marshaler is an interface to provide custom marshalling of Go value types +// A Marshaler is an interface to provide custom marshaling of Go value types // to AttributeValues. Use this to provide custom logic determining how a // Go Value type should be marshaled. // @@ -183,6 +183,12 @@ func (e *Encoder) Encode(in interface{}) (*dynamodb.AttributeValue, error) { } func (e *Encoder) encode(av *dynamodb.AttributeValue, v reflect.Value, fieldTag tag) error { + // We should check for omitted values first before dereferencing. + if fieldTag.OmitEmpty && emptyValue(v) { + encodeNull(av) + return nil + } + // Handle both pointers and interface conversion into types v = valueElem(v) @@ -192,11 +198,6 @@ func (e *Encoder) encode(av *dynamodb.AttributeValue, v reflect.Value, fieldTag } } - if fieldTag.OmitEmpty && emptyValue(v) { - encodeNull(av) - return nil - } - switch v.Kind() { case reflect.Invalid: encodeNull(av) @@ -235,6 +236,9 @@ func (e *Encoder) encodeStruct(av *dynamodb.AttributeValue, v reflect.Value) err fv := v.FieldByIndex(f.Index) elem := &dynamodb.AttributeValue{} err := e.encode(elem, fv, f.tag) + if err != nil { + return err + } skip, err := keepOrOmitEmpty(f.OmitEmpty, elem, err) if err != nil { return err diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode_test.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode_test.go index 46028c946..c5d0cf5e8 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode_test.go @@ -124,3 +124,23 @@ func TestMarshalMapOmitEmptyElem(t *testing.T) { assert.NoError(t, err) assert.Equal(t, expect, actual) } + +type testOmitEmptyScalar struct { + IntZero int `dynamodbav:",omitempty"` + IntPtrNil *int `dynamodbav:",omitempty"` + IntPtrSetZero *int `dynamodbav:",omitempty"` +} + +func TestMarshalOmitEmpty(t *testing.T) { + expect := &dynamodb.AttributeValue{ + M: map[string]*dynamodb.AttributeValue{ + "IntPtrSetZero": {N: aws.String("0")}, + }, + } + + m := testOmitEmptyScalar{IntPtrSetZero: aws.Int(0)} + + actual, err := Marshal(m) + assert.NoError(t, err) + assert.Equal(t, expect, actual) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/examples_test.go index 060d1abdb..0a96cd8d2 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/examples_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/examples_test.go @@ -16,7 +16,13 @@ var _ time.Duration var _ bytes.Buffer func ExampleDynamoDB_BatchGetItem() { - svc := dynamodb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := dynamodb.New(sess) params := &dynamodb.BatchGetItemInput{ RequestItems: map[string]*dynamodb.KeysAndAttributes{ // Required @@ -87,7 +93,13 @@ func ExampleDynamoDB_BatchGetItem() { } func ExampleDynamoDB_BatchWriteItem() { - svc := dynamodb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := dynamodb.New(sess) params := &dynamodb.BatchWriteItemInput{ RequestItems: map[string][]*dynamodb.WriteRequest{ // Required @@ -187,7 +199,13 @@ func ExampleDynamoDB_BatchWriteItem() { } func ExampleDynamoDB_CreateTable() { - svc := dynamodb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := dynamodb.New(sess) params := &dynamodb.CreateTableInput{ AttributeDefinitions: []*dynamodb.AttributeDefinition{ // Required @@ -272,7 +290,13 @@ func ExampleDynamoDB_CreateTable() { } func ExampleDynamoDB_DeleteItem() { - svc := dynamodb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := dynamodb.New(sess) params := &dynamodb.DeleteItemInput{ Key: map[string]*dynamodb.AttributeValue{ // Required @@ -440,7 +464,13 @@ func ExampleDynamoDB_DeleteItem() { } func ExampleDynamoDB_DeleteTable() { - svc := dynamodb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := dynamodb.New(sess) params := &dynamodb.DeleteTableInput{ TableName: aws.String("TableName"), // Required @@ -459,7 +489,13 @@ func ExampleDynamoDB_DeleteTable() { } func ExampleDynamoDB_DescribeLimits() { - svc := dynamodb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := dynamodb.New(sess) var params *dynamodb.DescribeLimitsInput resp, err := svc.DescribeLimits(params) @@ -476,7 +512,13 @@ func ExampleDynamoDB_DescribeLimits() { } func ExampleDynamoDB_DescribeTable() { - svc := dynamodb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := dynamodb.New(sess) params := &dynamodb.DescribeTableInput{ TableName: aws.String("TableName"), // Required @@ -495,7 +537,13 @@ func ExampleDynamoDB_DescribeTable() { } func ExampleDynamoDB_GetItem() { - svc := dynamodb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := dynamodb.New(sess) params := &dynamodb.GetItemInput{ Key: map[string]*dynamodb.AttributeValue{ // Required @@ -559,7 +607,13 @@ func ExampleDynamoDB_GetItem() { } func ExampleDynamoDB_ListTables() { - svc := dynamodb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := dynamodb.New(sess) params := &dynamodb.ListTablesInput{ ExclusiveStartTableName: aws.String("TableName"), @@ -579,7 +633,13 @@ func ExampleDynamoDB_ListTables() { } func ExampleDynamoDB_PutItem() { - svc := dynamodb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := dynamodb.New(sess) params := &dynamodb.PutItemInput{ Item: map[string]*dynamodb.AttributeValue{ // Required @@ -747,7 +807,13 @@ func ExampleDynamoDB_PutItem() { } func ExampleDynamoDB_Query() { - svc := dynamodb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := dynamodb.New(sess) params := &dynamodb.QueryInput{ TableName: aws.String("TableName"), // Required @@ -932,7 +998,13 @@ func ExampleDynamoDB_Query() { } func ExampleDynamoDB_Scan() { - svc := dynamodb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := dynamodb.New(sess) params := &dynamodb.ScanInput{ TableName: aws.String("TableName"), // Required @@ -1077,7 +1149,13 @@ func ExampleDynamoDB_Scan() { } func ExampleDynamoDB_UpdateItem() { - svc := dynamodb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := dynamodb.New(sess) params := &dynamodb.UpdateItemInput{ Key: map[string]*dynamodb.AttributeValue{ // Required @@ -1283,7 +1361,13 @@ func ExampleDynamoDB_UpdateItem() { } func ExampleDynamoDB_UpdateTable() { - svc := dynamodb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := dynamodb.New(sess) params := &dynamodb.UpdateTableInput{ TableName: aws.String("TableName"), // Required diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go index 170405fa1..bc903ec09 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go @@ -1416,6 +1416,9 @@ func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *request.Reques // To copy an encrypted snapshot that has been shared from another account, // you must have permissions for the CMK used to encrypt the snapshot. // +// Snapshots created by the CopySnapshot action have an arbitrary volume +// ID that should not be used for any purpose. +// // For more information, see Copying an Amazon EBS Snapshot (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-copy-snapshot.html) // in the Amazon Elastic Compute Cloud User Guide. func (c *EC2) CopySnapshot(input *CopySnapshotInput) (*CopySnapshotOutput, error) { @@ -1546,17 +1549,20 @@ func (c *EC2) CreateDhcpOptionsRequest(input *CreateDhcpOptionsInput) (req *requ // domain-name-servers - The IP addresses of up to four domain name servers, // or AmazonProvidedDNS. The default DHCP option set specifies AmazonProvidedDNS. // If specifying more than one domain name server, specify the IP addresses -// in a single parameter, separated by commas. +// in a single parameter, separated by commas. If you want your instance to +// receive a custom DNS hostname as specified in domain-name, you must set domain-name-servers +// to a custom DNS server. // // domain-name - If you're using AmazonProvidedDNS in "us-east-1", specify // "ec2.internal". If you're using AmazonProvidedDNS in another region, specify // "region.compute.internal" (for example, "ap-northeast-1.compute.internal"). -// Otherwise, specify a domain name (for example, "MyCompany.com"). Important: -// Some Linux operating systems accept multiple domain names separated by spaces. -// However, Windows and other Linux operating systems treat the value as a single -// domain, which results in unexpected behavior. If your DHCP options set is -// associated with a VPC that has instances with multiple operating systems, -// specify only one domain name. +// Otherwise, specify a domain name (for example, "MyCompany.com"). This value +// is used to complete unqualified DNS hostnames. Important: Some Linux operating +// systems accept multiple domain names separated by spaces. However, Windows +// and other Linux operating systems treat the value as a single domain, which +// results in unexpected behavior. If your DHCP options set is associated with +// a VPC that has instances with multiple operating systems, specify only one +// domain name. // // ntp-servers - The IP addresses of up to four Network Time Protocol (NTP) // servers. @@ -9439,6 +9445,11 @@ func (c *EC2) ModifyImageAttributeRequest(input *ModifyImageAttributeInput) (req // // AWS Marketplace product codes cannot be modified. Images with an AWS Marketplace // product code cannot be made public. +// +// The SriovNetSupport enhanced networking attribute cannot be changed using +// this command. Instead, enable SriovNetSupport on an instance and create an +// AMI from the instance. This will result in an image with SriovNetSupport +// enabled. func (c *EC2) ModifyImageAttribute(input *ModifyImageAttributeInput) (*ModifyImageAttributeOutput, error) { req, out := c.ModifyImageAttributeRequest(input) err := req.Send() @@ -10060,12 +10071,15 @@ func (c *EC2) ModifyVpcPeeringConnectionOptionsRequest(input *ModifyVpcPeeringCo // Enable/disable communication over the peering connection between instances // in your VPC and an EC2-Classic instance that's linked to the peer VPC. // +// Enable/disable a local VPC to resolve public DNS hostnames to private +// IP addresses when queried from instances in the peer VPC. +// // If the peered VPCs are in different accounts, each owner must initiate -// a separate request to enable or disable communication in either direction, -// depending on whether their VPC was the requester or accepter for the VPC -// peering connection. If the peered VPCs are in the same account, you can modify -// the requester and accepter options in the same request. To confirm which -// VPC is the accepter and requester for a VPC peering connection, use the DescribeVpcPeeringConnections +// a separate request to modify the peering connection options, depending on +// whether their VPC was the requester or accepter for the VPC peering connection. +// If the peered VPCs are in the same account, you can modify the requester +// and accepter options in the same request. To confirm which VPC is the accepter +// and requester for a VPC peering connection, use the DescribeVpcPeeringConnections // command. func (c *EC2) ModifyVpcPeeringConnectionOptions(input *ModifyVpcPeeringConnectionOptionsInput) (*ModifyVpcPeeringConnectionOptionsOutput, error) { req, out := c.ModifyVpcPeeringConnectionOptionsRequest(input) @@ -12819,7 +12833,8 @@ type AuthorizeSecurityGroupIngressInput struct { IpPermissions []*IpPermission `locationNameList:"item" type:"list"` // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). - // (VPC only) Use -1 to specify all. + // (VPC only) Use -1 to specify all traffic. If you specify -1, traffic on all + // ports is allowed, regardless of any ports you specify. IpProtocol *string `type:"string"` // [EC2-Classic, default VPC] The name of the source security group. You can't @@ -26274,16 +26289,6 @@ func (s *ModifyVpcPeeringConnectionOptionsInput) Validate() error { if s.VpcPeeringConnectionId == nil { invalidParams.Add(request.NewErrParamRequired("VpcPeeringConnectionId")) } - if s.AccepterPeeringConnectionOptions != nil { - if err := s.AccepterPeeringConnectionOptions.Validate(); err != nil { - invalidParams.AddNested("AccepterPeeringConnectionOptions", err.(request.ErrInvalidParams)) - } - } - if s.RequesterPeeringConnectionOptions != nil { - if err := s.RequesterPeeringConnectionOptions.Validate(); err != nil { - invalidParams.AddNested("RequesterPeeringConnectionOptions", err.(request.ErrInvalidParams)) - } - } if invalidParams.Len() > 0 { return invalidParams @@ -26884,6 +26889,10 @@ func (s NewDhcpConfiguration) GoString() string { type PeeringConnectionOptions struct { _ struct{} `type:"structure"` + // If true, enables a local VPC to resolve public DNS hostnames to private IP + // addresses when queried from instances in the peer VPC. + AllowDnsResolutionFromRemoteVpc *bool `locationName:"allowDnsResolutionFromRemoteVpc" type:"boolean"` + // If true, enables outbound communication from an EC2-Classic instance that's // linked to a local VPC via ClassicLink to instances in a peer VPC. AllowEgressFromLocalClassicLinkToRemoteVpc *bool `locationName:"allowEgressFromLocalClassicLinkToRemoteVpc" type:"boolean"` @@ -26907,13 +26916,17 @@ func (s PeeringConnectionOptions) GoString() string { type PeeringConnectionOptionsRequest struct { _ struct{} `type:"structure"` + // If true, enables a local VPC to resolve public DNS hostnames to private IP + // addresses when queried from instances in the peer VPC. + AllowDnsResolutionFromRemoteVpc *bool `type:"boolean"` + // If true, enables outbound communication from an EC2-Classic instance that's // linked to a local VPC via ClassicLink to instances in a peer VPC. - AllowEgressFromLocalClassicLinkToRemoteVpc *bool `type:"boolean" required:"true"` + AllowEgressFromLocalClassicLinkToRemoteVpc *bool `type:"boolean"` // If true, enables outbound communication from instances in a local VPC to // an EC2-Classic instance that's linked to a peer VPC via ClassicLink. - AllowEgressFromLocalVpcToRemoteClassicLink *bool `type:"boolean" required:"true"` + AllowEgressFromLocalVpcToRemoteClassicLink *bool `type:"boolean"` } // String returns the string representation @@ -26926,22 +26939,6 @@ func (s PeeringConnectionOptionsRequest) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *PeeringConnectionOptionsRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PeeringConnectionOptionsRequest"} - if s.AllowEgressFromLocalClassicLinkToRemoteVpc == nil { - invalidParams.Add(request.NewErrParamRequired("AllowEgressFromLocalClassicLinkToRemoteVpc")) - } - if s.AllowEgressFromLocalVpcToRemoteClassicLink == nil { - invalidParams.Add(request.NewErrParamRequired("AllowEgressFromLocalVpcToRemoteClassicLink")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - // Describes the placement for the instance. type Placement struct { _ struct{} `type:"structure"` @@ -30351,7 +30348,9 @@ type Snapshot struct { // Any tags assigned to the snapshot. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - // The ID of the volume that was used to create the snapshot. + // The ID of the volume that was used to create the snapshot. Snapshots created + // by the CopySnapshot action have an arbitrary volume ID that should not be + // used for any purpose. VolumeId *string `locationName:"volumeId" type:"string"` // The size of the volume, in GiB. @@ -32065,6 +32064,10 @@ func (s VpcPeeringConnection) GoString() string { type VpcPeeringConnectionOptionsDescription struct { _ struct{} `type:"structure"` + // Indicates whether a local VPC can resolve public DNS hostnames to private + // IP addresses when queried from instances in a peer VPC. + AllowDnsResolutionFromRemoteVpc *bool `locationName:"allowDnsResolutionFromRemoteVpc" type:"boolean"` + // Indicates whether a local ClassicLink connection can communicate with the // peer VPC over the VPC peering connection. AllowEgressFromLocalClassicLinkToRemoteVpc *bool `locationName:"allowEgressFromLocalClassicLinkToRemoteVpc" type:"boolean"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go index 9e94fe671..36181d991 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go @@ -40,7 +40,11 @@ func fillPresignedURL(r *request.Request) { clientInfo := r.ClientInfo clientInfo.Endpoint, clientInfo.SigningRegion = endpoints.EndpointForRegion( - clientInfo.ServiceName, aws.StringValue(cfg.Region), aws.BoolValue(cfg.DisableSSL)) + clientInfo.ServiceName, + aws.StringValue(cfg.Region), + aws.BoolValue(cfg.DisableSSL), + aws.BoolValue(cfg.UseDualStack), + ) // Presign a CopySnapshot request with modified params req := request.New(*cfg, clientInfo, r.Handlers, r.Retryer, r.Operation, newParams, r.Data) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/examples_test.go index 7e39c218a..39892068e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/examples_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/examples_test.go @@ -16,7 +16,13 @@ var _ time.Duration var _ bytes.Buffer func ExampleEC2_AcceptVpcPeeringConnection() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.AcceptVpcPeeringConnectionInput{ DryRun: aws.Bool(true), @@ -36,7 +42,13 @@ func ExampleEC2_AcceptVpcPeeringConnection() { } func ExampleEC2_AllocateAddress() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.AllocateAddressInput{ Domain: aws.String("DomainType"), @@ -56,7 +68,13 @@ func ExampleEC2_AllocateAddress() { } func ExampleEC2_AllocateHosts() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.AllocateHostsInput{ AvailabilityZone: aws.String("String"), // Required @@ -79,7 +97,13 @@ func ExampleEC2_AllocateHosts() { } func ExampleEC2_AssignPrivateIpAddresses() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.AssignPrivateIpAddressesInput{ NetworkInterfaceId: aws.String("String"), // Required @@ -104,7 +128,13 @@ func ExampleEC2_AssignPrivateIpAddresses() { } func ExampleEC2_AssociateAddress() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.AssociateAddressInput{ AllocationId: aws.String("String"), @@ -129,7 +159,13 @@ func ExampleEC2_AssociateAddress() { } func ExampleEC2_AssociateDhcpOptions() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.AssociateDhcpOptionsInput{ DhcpOptionsId: aws.String("String"), // Required @@ -150,7 +186,13 @@ func ExampleEC2_AssociateDhcpOptions() { } func ExampleEC2_AssociateRouteTable() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.AssociateRouteTableInput{ RouteTableId: aws.String("String"), // Required @@ -171,7 +213,13 @@ func ExampleEC2_AssociateRouteTable() { } func ExampleEC2_AttachClassicLinkVpc() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.AttachClassicLinkVpcInput{ Groups: []*string{ // Required @@ -196,7 +244,13 @@ func ExampleEC2_AttachClassicLinkVpc() { } func ExampleEC2_AttachInternetGateway() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.AttachInternetGatewayInput{ InternetGatewayId: aws.String("String"), // Required @@ -217,7 +271,13 @@ func ExampleEC2_AttachInternetGateway() { } func ExampleEC2_AttachNetworkInterface() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.AttachNetworkInterfaceInput{ DeviceIndex: aws.Int64(1), // Required @@ -239,7 +299,13 @@ func ExampleEC2_AttachNetworkInterface() { } func ExampleEC2_AttachVolume() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.AttachVolumeInput{ Device: aws.String("String"), // Required @@ -261,7 +327,13 @@ func ExampleEC2_AttachVolume() { } func ExampleEC2_AttachVpnGateway() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.AttachVpnGatewayInput{ VpcId: aws.String("String"), // Required @@ -282,7 +354,13 @@ func ExampleEC2_AttachVpnGateway() { } func ExampleEC2_AuthorizeSecurityGroupEgress() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.AuthorizeSecurityGroupEgressInput{ GroupId: aws.String("String"), // Required @@ -339,7 +417,13 @@ func ExampleEC2_AuthorizeSecurityGroupEgress() { } func ExampleEC2_AuthorizeSecurityGroupIngress() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.AuthorizeSecurityGroupIngressInput{ CidrIp: aws.String("String"), @@ -397,7 +481,13 @@ func ExampleEC2_AuthorizeSecurityGroupIngress() { } func ExampleEC2_BundleInstance() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.BundleInstanceInput{ InstanceId: aws.String("String"), // Required @@ -426,7 +516,13 @@ func ExampleEC2_BundleInstance() { } func ExampleEC2_CancelBundleTask() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CancelBundleTaskInput{ BundleId: aws.String("String"), // Required @@ -446,7 +542,13 @@ func ExampleEC2_CancelBundleTask() { } func ExampleEC2_CancelConversionTask() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CancelConversionTaskInput{ ConversionTaskId: aws.String("String"), // Required @@ -467,7 +569,13 @@ func ExampleEC2_CancelConversionTask() { } func ExampleEC2_CancelExportTask() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CancelExportTaskInput{ ExportTaskId: aws.String("String"), // Required @@ -486,7 +594,13 @@ func ExampleEC2_CancelExportTask() { } func ExampleEC2_CancelImportTask() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CancelImportTaskInput{ CancelReason: aws.String("String"), @@ -507,7 +621,13 @@ func ExampleEC2_CancelImportTask() { } func ExampleEC2_CancelReservedInstancesListing() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CancelReservedInstancesListingInput{ ReservedInstancesListingId: aws.String("String"), // Required @@ -526,7 +646,13 @@ func ExampleEC2_CancelReservedInstancesListing() { } func ExampleEC2_CancelSpotFleetRequests() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CancelSpotFleetRequestsInput{ SpotFleetRequestIds: []*string{ // Required @@ -550,7 +676,13 @@ func ExampleEC2_CancelSpotFleetRequests() { } func ExampleEC2_CancelSpotInstanceRequests() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CancelSpotInstanceRequestsInput{ SpotInstanceRequestIds: []*string{ // Required @@ -573,7 +705,13 @@ func ExampleEC2_CancelSpotInstanceRequests() { } func ExampleEC2_ConfirmProductInstance() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ConfirmProductInstanceInput{ InstanceId: aws.String("String"), // Required @@ -594,7 +732,13 @@ func ExampleEC2_ConfirmProductInstance() { } func ExampleEC2_CopyImage() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CopyImageInput{ Name: aws.String("String"), // Required @@ -620,7 +764,13 @@ func ExampleEC2_CopyImage() { } func ExampleEC2_CopySnapshot() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CopySnapshotInput{ SourceRegion: aws.String("String"), // Required @@ -646,7 +796,13 @@ func ExampleEC2_CopySnapshot() { } func ExampleEC2_CreateCustomerGateway() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateCustomerGatewayInput{ BgpAsn: aws.Int64(1), // Required @@ -668,7 +824,13 @@ func ExampleEC2_CreateCustomerGateway() { } func ExampleEC2_CreateDhcpOptions() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateDhcpOptionsInput{ DhcpConfigurations: []*ec2.NewDhcpConfiguration{ // Required @@ -697,7 +859,13 @@ func ExampleEC2_CreateDhcpOptions() { } func ExampleEC2_CreateFlowLogs() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateFlowLogsInput{ DeliverLogsPermissionArn: aws.String("String"), // Required @@ -724,7 +892,13 @@ func ExampleEC2_CreateFlowLogs() { } func ExampleEC2_CreateImage() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateImageInput{ InstanceId: aws.String("String"), // Required @@ -763,7 +937,13 @@ func ExampleEC2_CreateImage() { } func ExampleEC2_CreateInstanceExportTask() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateInstanceExportTaskInput{ InstanceId: aws.String("String"), // Required @@ -790,7 +970,13 @@ func ExampleEC2_CreateInstanceExportTask() { } func ExampleEC2_CreateInternetGateway() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateInternetGatewayInput{ DryRun: aws.Bool(true), @@ -809,7 +995,13 @@ func ExampleEC2_CreateInternetGateway() { } func ExampleEC2_CreateKeyPair() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateKeyPairInput{ KeyName: aws.String("String"), // Required @@ -829,7 +1021,13 @@ func ExampleEC2_CreateKeyPair() { } func ExampleEC2_CreateNatGateway() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateNatGatewayInput{ AllocationId: aws.String("String"), // Required @@ -850,7 +1048,13 @@ func ExampleEC2_CreateNatGateway() { } func ExampleEC2_CreateNetworkAcl() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateNetworkAclInput{ VpcId: aws.String("String"), // Required @@ -870,7 +1074,13 @@ func ExampleEC2_CreateNetworkAcl() { } func ExampleEC2_CreateNetworkAclEntry() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateNetworkAclEntryInput{ CidrBlock: aws.String("String"), // Required @@ -903,7 +1113,13 @@ func ExampleEC2_CreateNetworkAclEntry() { } func ExampleEC2_CreateNetworkInterface() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateNetworkInterfaceInput{ SubnetId: aws.String("String"), // Required @@ -937,7 +1153,13 @@ func ExampleEC2_CreateNetworkInterface() { } func ExampleEC2_CreatePlacementGroup() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreatePlacementGroupInput{ GroupName: aws.String("String"), // Required @@ -958,7 +1180,13 @@ func ExampleEC2_CreatePlacementGroup() { } func ExampleEC2_CreateReservedInstancesListing() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateReservedInstancesListingInput{ ClientToken: aws.String("String"), // Required @@ -987,7 +1215,13 @@ func ExampleEC2_CreateReservedInstancesListing() { } func ExampleEC2_CreateRoute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateRouteInput{ DestinationCidrBlock: aws.String("String"), // Required @@ -1013,7 +1247,13 @@ func ExampleEC2_CreateRoute() { } func ExampleEC2_CreateRouteTable() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateRouteTableInput{ VpcId: aws.String("String"), // Required @@ -1033,7 +1273,13 @@ func ExampleEC2_CreateRouteTable() { } func ExampleEC2_CreateSecurityGroup() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateSecurityGroupInput{ Description: aws.String("String"), // Required @@ -1055,7 +1301,13 @@ func ExampleEC2_CreateSecurityGroup() { } func ExampleEC2_CreateSnapshot() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateSnapshotInput{ VolumeId: aws.String("String"), // Required @@ -1076,7 +1328,13 @@ func ExampleEC2_CreateSnapshot() { } func ExampleEC2_CreateSpotDatafeedSubscription() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateSpotDatafeedSubscriptionInput{ Bucket: aws.String("String"), // Required @@ -1097,7 +1355,13 @@ func ExampleEC2_CreateSpotDatafeedSubscription() { } func ExampleEC2_CreateSubnet() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateSubnetInput{ CidrBlock: aws.String("String"), // Required @@ -1119,7 +1383,13 @@ func ExampleEC2_CreateSubnet() { } func ExampleEC2_CreateTags() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateTagsInput{ Resources: []*string{ // Required @@ -1149,7 +1419,13 @@ func ExampleEC2_CreateTags() { } func ExampleEC2_CreateVolume() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateVolumeInput{ AvailabilityZone: aws.String("String"), // Required @@ -1175,7 +1451,13 @@ func ExampleEC2_CreateVolume() { } func ExampleEC2_CreateVpc() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateVpcInput{ CidrBlock: aws.String("String"), // Required @@ -1196,7 +1478,13 @@ func ExampleEC2_CreateVpc() { } func ExampleEC2_CreateVpcEndpoint() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateVpcEndpointInput{ ServiceName: aws.String("String"), // Required @@ -1223,7 +1511,13 @@ func ExampleEC2_CreateVpcEndpoint() { } func ExampleEC2_CreateVpcPeeringConnection() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateVpcPeeringConnectionInput{ DryRun: aws.Bool(true), @@ -1245,7 +1539,13 @@ func ExampleEC2_CreateVpcPeeringConnection() { } func ExampleEC2_CreateVpnConnection() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateVpnConnectionInput{ CustomerGatewayId: aws.String("String"), // Required @@ -1270,7 +1570,13 @@ func ExampleEC2_CreateVpnConnection() { } func ExampleEC2_CreateVpnConnectionRoute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateVpnConnectionRouteInput{ DestinationCidrBlock: aws.String("String"), // Required @@ -1290,7 +1596,13 @@ func ExampleEC2_CreateVpnConnectionRoute() { } func ExampleEC2_CreateVpnGateway() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.CreateVpnGatewayInput{ Type: aws.String("GatewayType"), // Required @@ -1311,7 +1623,13 @@ func ExampleEC2_CreateVpnGateway() { } func ExampleEC2_DeleteCustomerGateway() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteCustomerGatewayInput{ CustomerGatewayId: aws.String("String"), // Required @@ -1331,7 +1649,13 @@ func ExampleEC2_DeleteCustomerGateway() { } func ExampleEC2_DeleteDhcpOptions() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteDhcpOptionsInput{ DhcpOptionsId: aws.String("String"), // Required @@ -1351,7 +1675,13 @@ func ExampleEC2_DeleteDhcpOptions() { } func ExampleEC2_DeleteFlowLogs() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteFlowLogsInput{ FlowLogIds: []*string{ // Required @@ -1373,7 +1703,13 @@ func ExampleEC2_DeleteFlowLogs() { } func ExampleEC2_DeleteInternetGateway() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteInternetGatewayInput{ InternetGatewayId: aws.String("String"), // Required @@ -1393,7 +1729,13 @@ func ExampleEC2_DeleteInternetGateway() { } func ExampleEC2_DeleteKeyPair() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteKeyPairInput{ KeyName: aws.String("String"), // Required @@ -1413,7 +1755,13 @@ func ExampleEC2_DeleteKeyPair() { } func ExampleEC2_DeleteNatGateway() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteNatGatewayInput{ NatGatewayId: aws.String("String"), // Required @@ -1432,7 +1780,13 @@ func ExampleEC2_DeleteNatGateway() { } func ExampleEC2_DeleteNetworkAcl() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteNetworkAclInput{ NetworkAclId: aws.String("String"), // Required @@ -1452,7 +1806,13 @@ func ExampleEC2_DeleteNetworkAcl() { } func ExampleEC2_DeleteNetworkAclEntry() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteNetworkAclEntryInput{ Egress: aws.Bool(true), // Required @@ -1474,7 +1834,13 @@ func ExampleEC2_DeleteNetworkAclEntry() { } func ExampleEC2_DeleteNetworkInterface() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteNetworkInterfaceInput{ NetworkInterfaceId: aws.String("String"), // Required @@ -1494,7 +1860,13 @@ func ExampleEC2_DeleteNetworkInterface() { } func ExampleEC2_DeletePlacementGroup() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeletePlacementGroupInput{ GroupName: aws.String("String"), // Required @@ -1514,7 +1886,13 @@ func ExampleEC2_DeletePlacementGroup() { } func ExampleEC2_DeleteRoute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteRouteInput{ DestinationCidrBlock: aws.String("String"), // Required @@ -1535,7 +1913,13 @@ func ExampleEC2_DeleteRoute() { } func ExampleEC2_DeleteRouteTable() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteRouteTableInput{ RouteTableId: aws.String("String"), // Required @@ -1555,7 +1939,13 @@ func ExampleEC2_DeleteRouteTable() { } func ExampleEC2_DeleteSecurityGroup() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteSecurityGroupInput{ DryRun: aws.Bool(true), @@ -1576,7 +1966,13 @@ func ExampleEC2_DeleteSecurityGroup() { } func ExampleEC2_DeleteSnapshot() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteSnapshotInput{ SnapshotId: aws.String("String"), // Required @@ -1596,7 +1992,13 @@ func ExampleEC2_DeleteSnapshot() { } func ExampleEC2_DeleteSpotDatafeedSubscription() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteSpotDatafeedSubscriptionInput{ DryRun: aws.Bool(true), @@ -1615,7 +2017,13 @@ func ExampleEC2_DeleteSpotDatafeedSubscription() { } func ExampleEC2_DeleteSubnet() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteSubnetInput{ SubnetId: aws.String("String"), // Required @@ -1635,7 +2043,13 @@ func ExampleEC2_DeleteSubnet() { } func ExampleEC2_DeleteTags() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteTagsInput{ Resources: []*string{ // Required @@ -1665,7 +2079,13 @@ func ExampleEC2_DeleteTags() { } func ExampleEC2_DeleteVolume() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteVolumeInput{ VolumeId: aws.String("String"), // Required @@ -1685,7 +2105,13 @@ func ExampleEC2_DeleteVolume() { } func ExampleEC2_DeleteVpc() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteVpcInput{ VpcId: aws.String("String"), // Required @@ -1705,7 +2131,13 @@ func ExampleEC2_DeleteVpc() { } func ExampleEC2_DeleteVpcEndpoints() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteVpcEndpointsInput{ VpcEndpointIds: []*string{ // Required @@ -1728,7 +2160,13 @@ func ExampleEC2_DeleteVpcEndpoints() { } func ExampleEC2_DeleteVpcPeeringConnection() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteVpcPeeringConnectionInput{ VpcPeeringConnectionId: aws.String("String"), // Required @@ -1748,7 +2186,13 @@ func ExampleEC2_DeleteVpcPeeringConnection() { } func ExampleEC2_DeleteVpnConnection() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteVpnConnectionInput{ VpnConnectionId: aws.String("String"), // Required @@ -1768,7 +2212,13 @@ func ExampleEC2_DeleteVpnConnection() { } func ExampleEC2_DeleteVpnConnectionRoute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteVpnConnectionRouteInput{ DestinationCidrBlock: aws.String("String"), // Required @@ -1788,7 +2238,13 @@ func ExampleEC2_DeleteVpnConnectionRoute() { } func ExampleEC2_DeleteVpnGateway() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeleteVpnGatewayInput{ VpnGatewayId: aws.String("String"), // Required @@ -1808,7 +2264,13 @@ func ExampleEC2_DeleteVpnGateway() { } func ExampleEC2_DeregisterImage() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DeregisterImageInput{ ImageId: aws.String("String"), // Required @@ -1828,7 +2290,13 @@ func ExampleEC2_DeregisterImage() { } func ExampleEC2_DescribeAccountAttributes() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeAccountAttributesInput{ AttributeNames: []*string{ @@ -1851,7 +2319,13 @@ func ExampleEC2_DescribeAccountAttributes() { } func ExampleEC2_DescribeAddresses() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeAddressesInput{ AllocationIds: []*string{ @@ -1888,7 +2362,13 @@ func ExampleEC2_DescribeAddresses() { } func ExampleEC2_DescribeAvailabilityZones() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeAvailabilityZonesInput{ DryRun: aws.Bool(true), @@ -1921,7 +2401,13 @@ func ExampleEC2_DescribeAvailabilityZones() { } func ExampleEC2_DescribeBundleTasks() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeBundleTasksInput{ BundleIds: []*string{ @@ -1954,7 +2440,13 @@ func ExampleEC2_DescribeBundleTasks() { } func ExampleEC2_DescribeClassicLinkInstances() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeClassicLinkInstancesInput{ DryRun: aws.Bool(true), @@ -1989,7 +2481,13 @@ func ExampleEC2_DescribeClassicLinkInstances() { } func ExampleEC2_DescribeConversionTasks() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeConversionTasksInput{ ConversionTaskIds: []*string{ @@ -2022,7 +2520,13 @@ func ExampleEC2_DescribeConversionTasks() { } func ExampleEC2_DescribeCustomerGateways() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeCustomerGatewaysInput{ CustomerGatewayIds: []*string{ @@ -2055,7 +2559,13 @@ func ExampleEC2_DescribeCustomerGateways() { } func ExampleEC2_DescribeDhcpOptions() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeDhcpOptionsInput{ DhcpOptionsIds: []*string{ @@ -2088,7 +2598,13 @@ func ExampleEC2_DescribeDhcpOptions() { } func ExampleEC2_DescribeExportTasks() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeExportTasksInput{ ExportTaskIds: []*string{ @@ -2110,7 +2626,13 @@ func ExampleEC2_DescribeExportTasks() { } func ExampleEC2_DescribeFlowLogs() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeFlowLogsInput{ Filter: []*ec2.Filter{ @@ -2144,7 +2666,13 @@ func ExampleEC2_DescribeFlowLogs() { } func ExampleEC2_DescribeHosts() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeHostsInput{ Filter: []*ec2.Filter{ @@ -2178,7 +2706,13 @@ func ExampleEC2_DescribeHosts() { } func ExampleEC2_DescribeIdFormat() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeIdFormatInput{ Resource: aws.String("String"), @@ -2197,7 +2731,13 @@ func ExampleEC2_DescribeIdFormat() { } func ExampleEC2_DescribeIdentityIdFormat() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeIdentityIdFormatInput{ PrincipalArn: aws.String("String"), // Required @@ -2217,7 +2757,13 @@ func ExampleEC2_DescribeIdentityIdFormat() { } func ExampleEC2_DescribeImageAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeImageAttributeInput{ Attribute: aws.String("ImageAttributeName"), // Required @@ -2238,7 +2784,13 @@ func ExampleEC2_DescribeImageAttribute() { } func ExampleEC2_DescribeImages() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeImagesInput{ DryRun: aws.Bool(true), @@ -2279,7 +2831,13 @@ func ExampleEC2_DescribeImages() { } func ExampleEC2_DescribeImportImageTasks() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeImportImageTasksInput{ DryRun: aws.Bool(true), @@ -2314,7 +2872,13 @@ func ExampleEC2_DescribeImportImageTasks() { } func ExampleEC2_DescribeImportSnapshotTasks() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeImportSnapshotTasksInput{ DryRun: aws.Bool(true), @@ -2349,7 +2913,13 @@ func ExampleEC2_DescribeImportSnapshotTasks() { } func ExampleEC2_DescribeInstanceAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeInstanceAttributeInput{ Attribute: aws.String("InstanceAttributeName"), // Required @@ -2370,7 +2940,13 @@ func ExampleEC2_DescribeInstanceAttribute() { } func ExampleEC2_DescribeInstanceStatus() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeInstanceStatusInput{ DryRun: aws.Bool(true), @@ -2406,7 +2982,13 @@ func ExampleEC2_DescribeInstanceStatus() { } func ExampleEC2_DescribeInstances() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeInstancesInput{ DryRun: aws.Bool(true), @@ -2441,7 +3023,13 @@ func ExampleEC2_DescribeInstances() { } func ExampleEC2_DescribeInternetGateways() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeInternetGatewaysInput{ DryRun: aws.Bool(true), @@ -2474,7 +3062,13 @@ func ExampleEC2_DescribeInternetGateways() { } func ExampleEC2_DescribeKeyPairs() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeKeyPairsInput{ DryRun: aws.Bool(true), @@ -2507,7 +3101,13 @@ func ExampleEC2_DescribeKeyPairs() { } func ExampleEC2_DescribeMovingAddresses() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeMovingAddressesInput{ DryRun: aws.Bool(true), @@ -2542,7 +3142,13 @@ func ExampleEC2_DescribeMovingAddresses() { } func ExampleEC2_DescribeNatGateways() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeNatGatewaysInput{ Filter: []*ec2.Filter{ @@ -2576,7 +3182,13 @@ func ExampleEC2_DescribeNatGateways() { } func ExampleEC2_DescribeNetworkAcls() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeNetworkAclsInput{ DryRun: aws.Bool(true), @@ -2609,7 +3221,13 @@ func ExampleEC2_DescribeNetworkAcls() { } func ExampleEC2_DescribeNetworkInterfaceAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeNetworkInterfaceAttributeInput{ NetworkInterfaceId: aws.String("String"), // Required @@ -2630,7 +3248,13 @@ func ExampleEC2_DescribeNetworkInterfaceAttribute() { } func ExampleEC2_DescribeNetworkInterfaces() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeNetworkInterfacesInput{ DryRun: aws.Bool(true), @@ -2663,7 +3287,13 @@ func ExampleEC2_DescribeNetworkInterfaces() { } func ExampleEC2_DescribePlacementGroups() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribePlacementGroupsInput{ DryRun: aws.Bool(true), @@ -2696,7 +3326,13 @@ func ExampleEC2_DescribePlacementGroups() { } func ExampleEC2_DescribePrefixLists() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribePrefixListsInput{ DryRun: aws.Bool(true), @@ -2731,7 +3367,13 @@ func ExampleEC2_DescribePrefixLists() { } func ExampleEC2_DescribeRegions() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeRegionsInput{ DryRun: aws.Bool(true), @@ -2764,7 +3406,13 @@ func ExampleEC2_DescribeRegions() { } func ExampleEC2_DescribeReservedInstances() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeReservedInstancesInput{ DryRun: aws.Bool(true), @@ -2798,7 +3446,13 @@ func ExampleEC2_DescribeReservedInstances() { } func ExampleEC2_DescribeReservedInstancesListings() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeReservedInstancesListingsInput{ Filters: []*ec2.Filter{ @@ -2828,7 +3482,13 @@ func ExampleEC2_DescribeReservedInstancesListings() { } func ExampleEC2_DescribeReservedInstancesModifications() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeReservedInstancesModificationsInput{ Filters: []*ec2.Filter{ @@ -2861,7 +3521,13 @@ func ExampleEC2_DescribeReservedInstancesModifications() { } func ExampleEC2_DescribeReservedInstancesOfferings() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeReservedInstancesOfferingsInput{ AvailabilityZone: aws.String("String"), @@ -2905,7 +3571,13 @@ func ExampleEC2_DescribeReservedInstancesOfferings() { } func ExampleEC2_DescribeRouteTables() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeRouteTablesInput{ DryRun: aws.Bool(true), @@ -2938,7 +3610,13 @@ func ExampleEC2_DescribeRouteTables() { } func ExampleEC2_DescribeScheduledInstanceAvailability() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeScheduledInstanceAvailabilityInput{ FirstSlotStartTimeRange: &ec2.SlotDateTimeRangeRequest{ // Required @@ -2985,7 +3663,13 @@ func ExampleEC2_DescribeScheduledInstanceAvailability() { } func ExampleEC2_DescribeScheduledInstances() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeScheduledInstancesInput{ DryRun: aws.Bool(true), @@ -3024,7 +3708,13 @@ func ExampleEC2_DescribeScheduledInstances() { } func ExampleEC2_DescribeSecurityGroupReferences() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeSecurityGroupReferencesInput{ GroupId: []*string{ // Required @@ -3047,7 +3737,13 @@ func ExampleEC2_DescribeSecurityGroupReferences() { } func ExampleEC2_DescribeSecurityGroups() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeSecurityGroupsInput{ DryRun: aws.Bool(true), @@ -3084,7 +3780,13 @@ func ExampleEC2_DescribeSecurityGroups() { } func ExampleEC2_DescribeSnapshotAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeSnapshotAttributeInput{ Attribute: aws.String("SnapshotAttributeName"), // Required @@ -3105,7 +3807,13 @@ func ExampleEC2_DescribeSnapshotAttribute() { } func ExampleEC2_DescribeSnapshots() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeSnapshotsInput{ DryRun: aws.Bool(true), @@ -3148,7 +3856,13 @@ func ExampleEC2_DescribeSnapshots() { } func ExampleEC2_DescribeSpotDatafeedSubscription() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeSpotDatafeedSubscriptionInput{ DryRun: aws.Bool(true), @@ -3167,7 +3881,13 @@ func ExampleEC2_DescribeSpotDatafeedSubscription() { } func ExampleEC2_DescribeSpotFleetInstances() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeSpotFleetInstancesInput{ SpotFleetRequestId: aws.String("String"), // Required @@ -3189,7 +3909,13 @@ func ExampleEC2_DescribeSpotFleetInstances() { } func ExampleEC2_DescribeSpotFleetRequestHistory() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeSpotFleetRequestHistoryInput{ SpotFleetRequestId: aws.String("String"), // Required @@ -3213,7 +3939,13 @@ func ExampleEC2_DescribeSpotFleetRequestHistory() { } func ExampleEC2_DescribeSpotFleetRequests() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeSpotFleetRequestsInput{ DryRun: aws.Bool(true), @@ -3238,7 +3970,13 @@ func ExampleEC2_DescribeSpotFleetRequests() { } func ExampleEC2_DescribeSpotInstanceRequests() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeSpotInstanceRequestsInput{ DryRun: aws.Bool(true), @@ -3271,7 +4009,13 @@ func ExampleEC2_DescribeSpotInstanceRequests() { } func ExampleEC2_DescribeSpotPriceHistory() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeSpotPriceHistoryInput{ AvailabilityZone: aws.String("String"), @@ -3313,7 +4057,13 @@ func ExampleEC2_DescribeSpotPriceHistory() { } func ExampleEC2_DescribeStaleSecurityGroups() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeStaleSecurityGroupsInput{ VpcId: aws.String("String"), // Required @@ -3335,7 +4085,13 @@ func ExampleEC2_DescribeStaleSecurityGroups() { } func ExampleEC2_DescribeSubnets() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeSubnetsInput{ DryRun: aws.Bool(true), @@ -3368,7 +4124,13 @@ func ExampleEC2_DescribeSubnets() { } func ExampleEC2_DescribeTags() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeTagsInput{ DryRun: aws.Bool(true), @@ -3399,7 +4161,13 @@ func ExampleEC2_DescribeTags() { } func ExampleEC2_DescribeVolumeAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeVolumeAttributeInput{ VolumeId: aws.String("String"), // Required @@ -3420,7 +4188,13 @@ func ExampleEC2_DescribeVolumeAttribute() { } func ExampleEC2_DescribeVolumeStatus() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeVolumeStatusInput{ DryRun: aws.Bool(true), @@ -3455,7 +4229,13 @@ func ExampleEC2_DescribeVolumeStatus() { } func ExampleEC2_DescribeVolumes() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeVolumesInput{ DryRun: aws.Bool(true), @@ -3490,7 +4270,13 @@ func ExampleEC2_DescribeVolumes() { } func ExampleEC2_DescribeVpcAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeVpcAttributeInput{ Attribute: aws.String("VpcAttributeName"), // Required @@ -3511,7 +4297,13 @@ func ExampleEC2_DescribeVpcAttribute() { } func ExampleEC2_DescribeVpcClassicLink() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeVpcClassicLinkInput{ DryRun: aws.Bool(true), @@ -3544,7 +4336,13 @@ func ExampleEC2_DescribeVpcClassicLink() { } func ExampleEC2_DescribeVpcClassicLinkDnsSupport() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeVpcClassicLinkDnsSupportInput{ MaxResults: aws.Int64(1), @@ -3568,7 +4366,13 @@ func ExampleEC2_DescribeVpcClassicLinkDnsSupport() { } func ExampleEC2_DescribeVpcEndpointServices() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeVpcEndpointServicesInput{ DryRun: aws.Bool(true), @@ -3589,7 +4393,13 @@ func ExampleEC2_DescribeVpcEndpointServices() { } func ExampleEC2_DescribeVpcEndpoints() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeVpcEndpointsInput{ DryRun: aws.Bool(true), @@ -3624,7 +4434,13 @@ func ExampleEC2_DescribeVpcEndpoints() { } func ExampleEC2_DescribeVpcPeeringConnections() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeVpcPeeringConnectionsInput{ DryRun: aws.Bool(true), @@ -3657,7 +4473,13 @@ func ExampleEC2_DescribeVpcPeeringConnections() { } func ExampleEC2_DescribeVpcs() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeVpcsInput{ DryRun: aws.Bool(true), @@ -3690,7 +4512,13 @@ func ExampleEC2_DescribeVpcs() { } func ExampleEC2_DescribeVpnConnections() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeVpnConnectionsInput{ DryRun: aws.Bool(true), @@ -3723,7 +4551,13 @@ func ExampleEC2_DescribeVpnConnections() { } func ExampleEC2_DescribeVpnGateways() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DescribeVpnGatewaysInput{ DryRun: aws.Bool(true), @@ -3756,7 +4590,13 @@ func ExampleEC2_DescribeVpnGateways() { } func ExampleEC2_DetachClassicLinkVpc() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DetachClassicLinkVpcInput{ InstanceId: aws.String("String"), // Required @@ -3777,7 +4617,13 @@ func ExampleEC2_DetachClassicLinkVpc() { } func ExampleEC2_DetachInternetGateway() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DetachInternetGatewayInput{ InternetGatewayId: aws.String("String"), // Required @@ -3798,7 +4644,13 @@ func ExampleEC2_DetachInternetGateway() { } func ExampleEC2_DetachNetworkInterface() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DetachNetworkInterfaceInput{ AttachmentId: aws.String("String"), // Required @@ -3819,7 +4671,13 @@ func ExampleEC2_DetachNetworkInterface() { } func ExampleEC2_DetachVolume() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DetachVolumeInput{ VolumeId: aws.String("String"), // Required @@ -3842,7 +4700,13 @@ func ExampleEC2_DetachVolume() { } func ExampleEC2_DetachVpnGateway() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DetachVpnGatewayInput{ VpcId: aws.String("String"), // Required @@ -3863,7 +4727,13 @@ func ExampleEC2_DetachVpnGateway() { } func ExampleEC2_DisableVgwRoutePropagation() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DisableVgwRoutePropagationInput{ GatewayId: aws.String("String"), // Required @@ -3883,7 +4753,13 @@ func ExampleEC2_DisableVgwRoutePropagation() { } func ExampleEC2_DisableVpcClassicLink() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DisableVpcClassicLinkInput{ VpcId: aws.String("String"), // Required @@ -3903,7 +4779,13 @@ func ExampleEC2_DisableVpcClassicLink() { } func ExampleEC2_DisableVpcClassicLinkDnsSupport() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DisableVpcClassicLinkDnsSupportInput{ VpcId: aws.String("String"), @@ -3922,7 +4804,13 @@ func ExampleEC2_DisableVpcClassicLinkDnsSupport() { } func ExampleEC2_DisassociateAddress() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DisassociateAddressInput{ AssociationId: aws.String("String"), @@ -3943,7 +4831,13 @@ func ExampleEC2_DisassociateAddress() { } func ExampleEC2_DisassociateRouteTable() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.DisassociateRouteTableInput{ AssociationId: aws.String("String"), // Required @@ -3963,7 +4857,13 @@ func ExampleEC2_DisassociateRouteTable() { } func ExampleEC2_EnableVgwRoutePropagation() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.EnableVgwRoutePropagationInput{ GatewayId: aws.String("String"), // Required @@ -3983,7 +4883,13 @@ func ExampleEC2_EnableVgwRoutePropagation() { } func ExampleEC2_EnableVolumeIO() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.EnableVolumeIOInput{ VolumeId: aws.String("String"), // Required @@ -4003,7 +4909,13 @@ func ExampleEC2_EnableVolumeIO() { } func ExampleEC2_EnableVpcClassicLink() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.EnableVpcClassicLinkInput{ VpcId: aws.String("String"), // Required @@ -4023,7 +4935,13 @@ func ExampleEC2_EnableVpcClassicLink() { } func ExampleEC2_EnableVpcClassicLinkDnsSupport() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.EnableVpcClassicLinkDnsSupportInput{ VpcId: aws.String("String"), @@ -4042,7 +4960,13 @@ func ExampleEC2_EnableVpcClassicLinkDnsSupport() { } func ExampleEC2_GetConsoleOutput() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.GetConsoleOutputInput{ InstanceId: aws.String("String"), // Required @@ -4062,7 +4986,13 @@ func ExampleEC2_GetConsoleOutput() { } func ExampleEC2_GetConsoleScreenshot() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.GetConsoleScreenshotInput{ InstanceId: aws.String("String"), // Required @@ -4083,7 +5013,13 @@ func ExampleEC2_GetConsoleScreenshot() { } func ExampleEC2_GetPasswordData() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.GetPasswordDataInput{ InstanceId: aws.String("String"), // Required @@ -4103,7 +5039,13 @@ func ExampleEC2_GetPasswordData() { } func ExampleEC2_ImportImage() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ImportImageInput{ Architecture: aws.String("String"), @@ -4149,7 +5091,13 @@ func ExampleEC2_ImportImage() { } func ExampleEC2_ImportInstance() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ImportInstanceInput{ Platform: aws.String("PlatformValues"), // Required @@ -4211,7 +5159,13 @@ func ExampleEC2_ImportInstance() { } func ExampleEC2_ImportKeyPair() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ImportKeyPairInput{ KeyName: aws.String("String"), // Required @@ -4232,7 +5186,13 @@ func ExampleEC2_ImportKeyPair() { } func ExampleEC2_ImportSnapshot() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ImportSnapshotInput{ ClientData: &ec2.ClientData{ @@ -4269,7 +5229,13 @@ func ExampleEC2_ImportSnapshot() { } func ExampleEC2_ImportVolume() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ImportVolumeInput{ AvailabilityZone: aws.String("String"), // Required @@ -4298,7 +5264,13 @@ func ExampleEC2_ImportVolume() { } func ExampleEC2_ModifyHosts() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ModifyHostsInput{ AutoPlacement: aws.String("AutoPlacement"), // Required @@ -4321,7 +5293,13 @@ func ExampleEC2_ModifyHosts() { } func ExampleEC2_ModifyIdFormat() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ModifyIdFormatInput{ Resource: aws.String("String"), // Required @@ -4341,7 +5319,13 @@ func ExampleEC2_ModifyIdFormat() { } func ExampleEC2_ModifyIdentityIdFormat() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ModifyIdentityIdFormatInput{ PrincipalArn: aws.String("String"), // Required @@ -4362,7 +5346,13 @@ func ExampleEC2_ModifyIdentityIdFormat() { } func ExampleEC2_ModifyImageAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ModifyImageAttributeInput{ ImageId: aws.String("String"), // Required @@ -4416,7 +5406,13 @@ func ExampleEC2_ModifyImageAttribute() { } func ExampleEC2_ModifyInstanceAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ModifyInstanceAttributeInput{ InstanceId: aws.String("String"), // Required @@ -4484,7 +5480,13 @@ func ExampleEC2_ModifyInstanceAttribute() { } func ExampleEC2_ModifyInstancePlacement() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ModifyInstancePlacementInput{ InstanceId: aws.String("String"), // Required @@ -4506,7 +5508,13 @@ func ExampleEC2_ModifyInstancePlacement() { } func ExampleEC2_ModifyNetworkInterfaceAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ModifyNetworkInterfaceAttributeInput{ NetworkInterfaceId: aws.String("String"), // Required @@ -4540,7 +5548,13 @@ func ExampleEC2_ModifyNetworkInterfaceAttribute() { } func ExampleEC2_ModifyReservedInstances() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ModifyReservedInstancesInput{ ReservedInstancesIds: []*string{ // Required @@ -4572,7 +5586,13 @@ func ExampleEC2_ModifyReservedInstances() { } func ExampleEC2_ModifySnapshotAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ModifySnapshotAttributeInput{ SnapshotId: aws.String("String"), // Required @@ -4618,7 +5638,13 @@ func ExampleEC2_ModifySnapshotAttribute() { } func ExampleEC2_ModifySpotFleetRequest() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ModifySpotFleetRequestInput{ SpotFleetRequestId: aws.String("String"), // Required @@ -4639,7 +5665,13 @@ func ExampleEC2_ModifySpotFleetRequest() { } func ExampleEC2_ModifySubnetAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ModifySubnetAttributeInput{ SubnetId: aws.String("String"), // Required @@ -4661,7 +5693,13 @@ func ExampleEC2_ModifySubnetAttribute() { } func ExampleEC2_ModifyVolumeAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ModifyVolumeAttributeInput{ VolumeId: aws.String("String"), // Required @@ -4684,7 +5722,13 @@ func ExampleEC2_ModifyVolumeAttribute() { } func ExampleEC2_ModifyVpcAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ModifyVpcAttributeInput{ VpcId: aws.String("String"), // Required @@ -4709,7 +5753,13 @@ func ExampleEC2_ModifyVpcAttribute() { } func ExampleEC2_ModifyVpcEndpoint() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ModifyVpcEndpointInput{ VpcEndpointId: aws.String("String"), // Required @@ -4739,18 +5789,26 @@ func ExampleEC2_ModifyVpcEndpoint() { } func ExampleEC2_ModifyVpcPeeringConnectionOptions() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ModifyVpcPeeringConnectionOptionsInput{ VpcPeeringConnectionId: aws.String("String"), // Required AccepterPeeringConnectionOptions: &ec2.PeeringConnectionOptionsRequest{ - AllowEgressFromLocalClassicLinkToRemoteVpc: aws.Bool(true), // Required - AllowEgressFromLocalVpcToRemoteClassicLink: aws.Bool(true), // Required + AllowDnsResolutionFromRemoteVpc: aws.Bool(true), + AllowEgressFromLocalClassicLinkToRemoteVpc: aws.Bool(true), + AllowEgressFromLocalVpcToRemoteClassicLink: aws.Bool(true), }, DryRun: aws.Bool(true), RequesterPeeringConnectionOptions: &ec2.PeeringConnectionOptionsRequest{ - AllowEgressFromLocalClassicLinkToRemoteVpc: aws.Bool(true), // Required - AllowEgressFromLocalVpcToRemoteClassicLink: aws.Bool(true), // Required + AllowDnsResolutionFromRemoteVpc: aws.Bool(true), + AllowEgressFromLocalClassicLinkToRemoteVpc: aws.Bool(true), + AllowEgressFromLocalVpcToRemoteClassicLink: aws.Bool(true), }, } resp, err := svc.ModifyVpcPeeringConnectionOptions(params) @@ -4767,7 +5825,13 @@ func ExampleEC2_ModifyVpcPeeringConnectionOptions() { } func ExampleEC2_MonitorInstances() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.MonitorInstancesInput{ InstanceIds: []*string{ // Required @@ -4790,7 +5854,13 @@ func ExampleEC2_MonitorInstances() { } func ExampleEC2_MoveAddressToVpc() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.MoveAddressToVpcInput{ PublicIp: aws.String("String"), // Required @@ -4810,7 +5880,13 @@ func ExampleEC2_MoveAddressToVpc() { } func ExampleEC2_PurchaseReservedInstancesOffering() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.PurchaseReservedInstancesOfferingInput{ InstanceCount: aws.Int64(1), // Required @@ -4835,7 +5911,13 @@ func ExampleEC2_PurchaseReservedInstancesOffering() { } func ExampleEC2_PurchaseScheduledInstances() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.PurchaseScheduledInstancesInput{ PurchaseRequests: []*ec2.PurchaseRequest{ // Required @@ -4862,7 +5944,13 @@ func ExampleEC2_PurchaseScheduledInstances() { } func ExampleEC2_RebootInstances() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.RebootInstancesInput{ InstanceIds: []*string{ // Required @@ -4885,7 +5973,13 @@ func ExampleEC2_RebootInstances() { } func ExampleEC2_RegisterImage() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.RegisterImageInput{ Name: aws.String("String"), // Required @@ -4930,7 +6024,13 @@ func ExampleEC2_RegisterImage() { } func ExampleEC2_RejectVpcPeeringConnection() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.RejectVpcPeeringConnectionInput{ VpcPeeringConnectionId: aws.String("String"), // Required @@ -4950,7 +6050,13 @@ func ExampleEC2_RejectVpcPeeringConnection() { } func ExampleEC2_ReleaseAddress() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ReleaseAddressInput{ AllocationId: aws.String("String"), @@ -4971,7 +6077,13 @@ func ExampleEC2_ReleaseAddress() { } func ExampleEC2_ReleaseHosts() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ReleaseHostsInput{ HostIds: []*string{ // Required @@ -4993,7 +6105,13 @@ func ExampleEC2_ReleaseHosts() { } func ExampleEC2_ReplaceNetworkAclAssociation() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ReplaceNetworkAclAssociationInput{ AssociationId: aws.String("String"), // Required @@ -5014,7 +6132,13 @@ func ExampleEC2_ReplaceNetworkAclAssociation() { } func ExampleEC2_ReplaceNetworkAclEntry() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ReplaceNetworkAclEntryInput{ CidrBlock: aws.String("String"), // Required @@ -5047,7 +6171,13 @@ func ExampleEC2_ReplaceNetworkAclEntry() { } func ExampleEC2_ReplaceRoute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ReplaceRouteInput{ DestinationCidrBlock: aws.String("String"), // Required @@ -5073,7 +6203,13 @@ func ExampleEC2_ReplaceRoute() { } func ExampleEC2_ReplaceRouteTableAssociation() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ReplaceRouteTableAssociationInput{ AssociationId: aws.String("String"), // Required @@ -5094,7 +6230,13 @@ func ExampleEC2_ReplaceRouteTableAssociation() { } func ExampleEC2_ReportInstanceStatus() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ReportInstanceStatusInput{ Instances: []*string{ // Required @@ -5125,7 +6267,13 @@ func ExampleEC2_ReportInstanceStatus() { } func ExampleEC2_RequestSpotFleet() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.RequestSpotFleetInput{ SpotFleetRequestConfig: &ec2.SpotFleetRequestConfigData{ // Required @@ -5231,7 +6379,13 @@ func ExampleEC2_RequestSpotFleet() { } func ExampleEC2_RequestSpotInstances() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.RequestSpotInstancesInput{ SpotPrice: aws.String("String"), // Required @@ -5329,7 +6483,13 @@ func ExampleEC2_RequestSpotInstances() { } func ExampleEC2_ResetImageAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ResetImageAttributeInput{ Attribute: aws.String("ResetImageAttributeName"), // Required @@ -5350,7 +6510,13 @@ func ExampleEC2_ResetImageAttribute() { } func ExampleEC2_ResetInstanceAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ResetInstanceAttributeInput{ Attribute: aws.String("InstanceAttributeName"), // Required @@ -5371,7 +6537,13 @@ func ExampleEC2_ResetInstanceAttribute() { } func ExampleEC2_ResetNetworkInterfaceAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ResetNetworkInterfaceAttributeInput{ NetworkInterfaceId: aws.String("String"), // Required @@ -5392,7 +6564,13 @@ func ExampleEC2_ResetNetworkInterfaceAttribute() { } func ExampleEC2_ResetSnapshotAttribute() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.ResetSnapshotAttributeInput{ Attribute: aws.String("SnapshotAttributeName"), // Required @@ -5413,7 +6591,13 @@ func ExampleEC2_ResetSnapshotAttribute() { } func ExampleEC2_RestoreAddressToClassic() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.RestoreAddressToClassicInput{ PublicIp: aws.String("String"), // Required @@ -5433,7 +6617,13 @@ func ExampleEC2_RestoreAddressToClassic() { } func ExampleEC2_RevokeSecurityGroupEgress() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.RevokeSecurityGroupEgressInput{ GroupId: aws.String("String"), // Required @@ -5490,7 +6680,13 @@ func ExampleEC2_RevokeSecurityGroupEgress() { } func ExampleEC2_RevokeSecurityGroupIngress() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.RevokeSecurityGroupIngressInput{ CidrIp: aws.String("String"), @@ -5548,7 +6744,13 @@ func ExampleEC2_RevokeSecurityGroupIngress() { } func ExampleEC2_RunInstances() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.RunInstancesInput{ ImageId: aws.String("String"), // Required @@ -5644,7 +6846,13 @@ func ExampleEC2_RunInstances() { } func ExampleEC2_RunScheduledInstances() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.RunScheduledInstancesInput{ LaunchSpecification: &ec2.ScheduledInstancesLaunchSpecification{ // Required @@ -5731,7 +6939,13 @@ func ExampleEC2_RunScheduledInstances() { } func ExampleEC2_StartInstances() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.StartInstancesInput{ InstanceIds: []*string{ // Required @@ -5755,7 +6969,13 @@ func ExampleEC2_StartInstances() { } func ExampleEC2_StopInstances() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.StopInstancesInput{ InstanceIds: []*string{ // Required @@ -5779,7 +6999,13 @@ func ExampleEC2_StopInstances() { } func ExampleEC2_TerminateInstances() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.TerminateInstancesInput{ InstanceIds: []*string{ // Required @@ -5802,7 +7028,13 @@ func ExampleEC2_TerminateInstances() { } func ExampleEC2_UnassignPrivateIpAddresses() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.UnassignPrivateIpAddressesInput{ NetworkInterfaceId: aws.String("String"), // Required @@ -5825,7 +7057,13 @@ func ExampleEC2_UnassignPrivateIpAddresses() { } func ExampleEC2_UnmonitorInstances() { - svc := ec2.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ec2.New(sess) params := &ec2.UnmonitorInstancesInput{ InstanceIds: []*string{ // Required diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go b/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go index aa162c0be..b6ffa5109 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go @@ -1159,7 +1159,7 @@ func (s *CreateRepositoryInput) Validate() error { type CreateRepositoryOutput struct { _ struct{} `type:"structure"` - // Object representing a repository. + // An object representing a repository. Repository *Repository `locationName:"repository" type:"structure"` } @@ -1216,7 +1216,7 @@ func (s *DeleteRepositoryInput) Validate() error { type DeleteRepositoryOutput struct { _ struct{} `type:"structure"` - // Object representing a repository. + // An object representing a repository. Repository *Repository `locationName:"repository" type:"structure"` } @@ -1309,6 +1309,9 @@ type DescribeRepositoriesInput struct { // parameter. Pagination continues from the end of the previous results that // returned the nextToken value. This value is null when there are no more results // to return. + // + // This token should be treated as an opaque identifier that is only used + // to retrieve the next items in a list and not for other programmatic purposes. NextToken *string `locationName:"nextToken" type:"string"` // The AWS account ID associated with the registry that contains the repositories @@ -1543,7 +1546,7 @@ func (s GetRepositoryPolicyOutput) GoString() string { return s.String() } -// Object representing an image. +// An object representing an Amazon ECR image. type Image struct { _ struct{} `type:"structure"` @@ -1570,6 +1573,7 @@ func (s Image) GoString() string { return s.String() } +// An object representing an Amazon ECR image failure. type ImageFailure struct { _ struct{} `type:"structure"` @@ -1593,6 +1597,7 @@ func (s ImageFailure) GoString() string { return s.String() } +// An object with identifying information for an Amazon ECR image. type ImageIdentifier struct { _ struct{} `type:"structure"` @@ -1672,6 +1677,7 @@ func (s InitiateLayerUploadOutput) GoString() string { return s.String() } +// An object representing an Amazon ECR image layer. type Layer struct { _ struct{} `type:"structure"` @@ -1696,6 +1702,7 @@ func (s Layer) GoString() string { return s.String() } +// An object representing an Amazon ECR image layer failure. type LayerFailure struct { _ struct{} `type:"structure"` @@ -1719,9 +1726,27 @@ func (s LayerFailure) GoString() string { return s.String() } +type ListImagesFilter struct { + _ struct{} `type:"structure"` + + TagStatus *string `locationName:"tagStatus" type:"string" enum:"TagStatus"` +} + +// String returns the string representation +func (s ListImagesFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListImagesFilter) GoString() string { + return s.String() +} + type ListImagesInput struct { _ struct{} `type:"structure"` + Filter *ListImagesFilter `locationName:"filter" type:"structure"` + // The maximum number of image results returned by ListImages in paginated output. // When this parameter is used, ListImages only returns maxResults results in // a single page along with a nextToken response element. The remaining results @@ -1735,6 +1760,9 @@ type ListImagesInput struct { // where maxResults was used and the results exceeded the value of that parameter. // Pagination continues from the end of the previous results that returned the // nextToken value. This value is null when there are no more results to return. + // + // This token should be treated as an opaque identifier that is only used + // to retrieve the next items in a list and not for other programmatic purposes. NextToken *string `locationName:"nextToken" type:"string"` // The AWS account ID associated with the registry that contains the repository @@ -1859,7 +1887,7 @@ func (s PutImageOutput) GoString() string { return s.String() } -// Object representing a repository. +// An object representing a repository. type Repository struct { _ struct{} `type:"structure"` @@ -2077,3 +2105,10 @@ const ( // @enum LayerFailureCode LayerFailureCodeMissingLayerDigest = "MissingLayerDigest" ) + +const ( + // @enum TagStatus + TagStatusTagged = "TAGGED" + // @enum TagStatus + TagStatusUntagged = "UNTAGGED" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecr/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/ecr/examples_test.go index 95e088bae..f0b78a005 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecr/examples_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecr/examples_test.go @@ -16,7 +16,13 @@ var _ time.Duration var _ bytes.Buffer func ExampleECR_BatchCheckLayerAvailability() { - svc := ecr.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecr.New(sess) params := &ecr.BatchCheckLayerAvailabilityInput{ LayerDigests: []*string{ // Required @@ -40,7 +46,13 @@ func ExampleECR_BatchCheckLayerAvailability() { } func ExampleECR_BatchDeleteImage() { - svc := ecr.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecr.New(sess) params := &ecr.BatchDeleteImageInput{ ImageIds: []*ecr.ImageIdentifier{ // Required @@ -67,7 +79,13 @@ func ExampleECR_BatchDeleteImage() { } func ExampleECR_BatchGetImage() { - svc := ecr.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecr.New(sess) params := &ecr.BatchGetImageInput{ ImageIds: []*ecr.ImageIdentifier{ // Required @@ -94,7 +112,13 @@ func ExampleECR_BatchGetImage() { } func ExampleECR_CompleteLayerUpload() { - svc := ecr.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecr.New(sess) params := &ecr.CompleteLayerUploadInput{ LayerDigests: []*string{ // Required @@ -119,7 +143,13 @@ func ExampleECR_CompleteLayerUpload() { } func ExampleECR_CreateRepository() { - svc := ecr.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecr.New(sess) params := &ecr.CreateRepositoryInput{ RepositoryName: aws.String("RepositoryName"), // Required @@ -138,7 +168,13 @@ func ExampleECR_CreateRepository() { } func ExampleECR_DeleteRepository() { - svc := ecr.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecr.New(sess) params := &ecr.DeleteRepositoryInput{ RepositoryName: aws.String("RepositoryName"), // Required @@ -159,7 +195,13 @@ func ExampleECR_DeleteRepository() { } func ExampleECR_DeleteRepositoryPolicy() { - svc := ecr.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecr.New(sess) params := &ecr.DeleteRepositoryPolicyInput{ RepositoryName: aws.String("RepositoryName"), // Required @@ -179,7 +221,13 @@ func ExampleECR_DeleteRepositoryPolicy() { } func ExampleECR_DescribeRepositories() { - svc := ecr.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecr.New(sess) params := &ecr.DescribeRepositoriesInput{ MaxResults: aws.Int64(1), @@ -204,7 +252,13 @@ func ExampleECR_DescribeRepositories() { } func ExampleECR_GetAuthorizationToken() { - svc := ecr.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecr.New(sess) params := &ecr.GetAuthorizationTokenInput{ RegistryIds: []*string{ @@ -226,7 +280,13 @@ func ExampleECR_GetAuthorizationToken() { } func ExampleECR_GetDownloadUrlForLayer() { - svc := ecr.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecr.New(sess) params := &ecr.GetDownloadUrlForLayerInput{ LayerDigest: aws.String("LayerDigest"), // Required @@ -247,7 +307,13 @@ func ExampleECR_GetDownloadUrlForLayer() { } func ExampleECR_GetRepositoryPolicy() { - svc := ecr.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecr.New(sess) params := &ecr.GetRepositoryPolicyInput{ RepositoryName: aws.String("RepositoryName"), // Required @@ -267,7 +333,13 @@ func ExampleECR_GetRepositoryPolicy() { } func ExampleECR_InitiateLayerUpload() { - svc := ecr.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecr.New(sess) params := &ecr.InitiateLayerUploadInput{ RepositoryName: aws.String("RepositoryName"), // Required @@ -287,13 +359,22 @@ func ExampleECR_InitiateLayerUpload() { } func ExampleECR_ListImages() { - svc := ecr.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecr.New(sess) params := &ecr.ListImagesInput{ RepositoryName: aws.String("RepositoryName"), // Required - MaxResults: aws.Int64(1), - NextToken: aws.String("NextToken"), - RegistryId: aws.String("RegistryId"), + Filter: &ecr.ListImagesFilter{ + TagStatus: aws.String("TagStatus"), + }, + MaxResults: aws.Int64(1), + NextToken: aws.String("NextToken"), + RegistryId: aws.String("RegistryId"), } resp, err := svc.ListImages(params) @@ -309,7 +390,13 @@ func ExampleECR_ListImages() { } func ExampleECR_PutImage() { - svc := ecr.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecr.New(sess) params := &ecr.PutImageInput{ ImageManifest: aws.String("ImageManifest"), // Required @@ -330,7 +417,13 @@ func ExampleECR_PutImage() { } func ExampleECR_SetRepositoryPolicy() { - svc := ecr.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecr.New(sess) params := &ecr.SetRepositoryPolicyInput{ PolicyText: aws.String("RepositoryPolicyText"), // Required @@ -352,7 +445,13 @@ func ExampleECR_SetRepositoryPolicy() { } func ExampleECR_UploadLayerPart() { - svc := ecr.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecr.New(sess) params := &ecr.UploadLayerPartInput{ LayerPartBlob: []byte("PAYLOAD"), // Required diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go index 21bf3c381..c3fea11fb 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go @@ -110,6 +110,8 @@ func (c *ECS) CreateServiceRequest(input *CreateServiceInput) (req *request.Requ // In addition to maintaining the desired count of tasks in your service, you // can optionally run your service behind a load balancer. The load balancer // distributes traffic across the tasks that are associated with the service. +// For more information, see Service Load Balancing (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html) +// in the Amazon EC2 Container Service Developer Guide. // // You can optionally specify a deployment configuration for your service. // During a deployment (which is triggered by changing the task definition of @@ -1989,7 +1991,7 @@ type ContainerDefinition struct { // containers, see https://docs.docker.com/userguide/dockerlinks/ (https://docs.docker.com/userguide/dockerlinks/). // This parameter maps to Links in the Create a container (https://docs.docker.com/reference/api/docker_remote_api_v1.19/#create-a-container) // section of the Docker Remote API (https://docs.docker.com/reference/api/docker_remote_api_v1.19/) - // and the --link option to docker run (https://docs.docker.com/reference/commandline/run/). + // and the --link option to docker run (https://docs.docker.com/reference/commandline/run/). // // Containers that are collocated on a single container instance may be able // to communicate with each other without requiring links or host port mappings. @@ -2299,9 +2301,23 @@ type CreateServiceInput struct { // keep running on your cluster. DesiredCount *int64 `locationName:"desiredCount" type:"integer" required:"true"` - // A list of load balancer objects, containing the load balancer name, the container - // name (as it appears in a container definition), and the container port to - // access from the load balancer. + // A load balancer object representing the load balancer to use with your service. + // Currently, you are limited to one load balancer per service. After you create + // a service, the load balancer name, container name, and container port specified + // in the service definition are immutable. + // + // For Elastic Load Balancing Classic load balancers, this object must contain + // the load balancer name, the container name (as it appears in a container + // definition), and the container port to access from the load balancer. When + // a task from this service is placed on a container instance, the container + // instance is registered with the load balancer specified here. + // + // For Elastic Load Balancing Application load balancers, this object must + // contain the load balancer target group ARN, the container name (as it appears + // in a container definition), and the container port to access from the load + // balancer. When a task from this service is placed on a container instance, + // the container instance and port combination is registered as a target in + // the target group specified here. LoadBalancers []*LoadBalancer `locationName:"loadBalancers" type:"list"` // The name or full Amazon Resource Name (ARN) of the IAM role that allows Amazon @@ -2478,7 +2494,7 @@ func (s DeleteServiceOutput) GoString() string { type Deployment struct { _ struct{} `type:"structure"` - // The Unix time in seconds and milliseconds when the service was created. + // The Unix timestamp for when the service was created. CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` // The most recent desired count of tasks that was specified for the service @@ -2503,7 +2519,7 @@ type Deployment struct { // The most recent task definition that was specified for the service to use. TaskDefinition *string `locationName:"taskDefinition" type:"string"` - // The Unix time in seconds and milliseconds when the service was last updated. + // The Unix timestamp for when the service was last updated. UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"unix"` } @@ -3408,11 +3424,11 @@ type ListTasksInput struct { // limits the results to tasks that belong to that container instance. ContainerInstance *string `locationName:"containerInstance" type:"string"` - // The task status with which to filter the ListTasks results. Specifying a - // desiredStatus of STOPPED limits the results to tasks that are in the STOPPED - // status, which can be useful for debugging tasks that are not starting properly - // or have died or finished. The default status filter is status filter is RUNNING, - // which shows tasks that ECS has set the desired status to RUNNING. + // The task desired status with which to filter the ListTasks results. Specifying + // a desiredStatus of STOPPED limits the results to tasks that ECS has set the + // desired status to STOPPED, which can be useful for debugging tasks that are + // not starting properly or have died or finished. The default status filter + // is RUNNING, which shows tasks that ECS has set the desired status to RUNNING. // // Although you can filter results based on a desired status of PENDING, this // will not return any results because ECS never sets the desired status of @@ -3499,6 +3515,10 @@ type LoadBalancer struct { // The name of the load balancer. LoadBalancerName *string `locationName:"loadBalancerName" type:"string"` + + // The full Amazon Resource Name (ARN) of the Elastic Load Balancing target + // group associated with a service. + TargetGroupArn *string `locationName:"targetGroupArn" type:"string"` } // String returns the string representation @@ -3960,7 +3980,7 @@ type Service struct { // The Amazon Resource Name (ARN) of the cluster that hosts the service. ClusterArn *string `locationName:"clusterArn" type:"string"` - // The Unix time in seconds and milliseconds when the service was created. + // The Unix timestamp for when the service was created. CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` // Optional deployment parameters that control how many tasks run during the @@ -3979,9 +3999,9 @@ type Service struct { // are displayed. Events []*ServiceEvent `locationName:"events" type:"list"` - // A list of load balancer objects, containing the load balancer name, the container - // name (as it appears in a container definition), and the container port to - // access from the load balancer. + // A list of Elastic Load Balancing load balancer objects, containing the load + // balancer name, the container name (as it appears in a container definition), + // and the container port to access from the load balancer. LoadBalancers []*LoadBalancer `locationName:"loadBalancers" type:"list"` // The number of tasks in the cluster that are in the PENDING state. @@ -3989,7 +4009,7 @@ type Service struct { // The Amazon Resource Name (ARN) of the IAM role associated with the service // that allows the Amazon ECS container agent to register container instances - // with a load balancer. + // with an Elastic Load Balancing load balancer. RoleArn *string `locationName:"roleArn" type:"string"` // The number of tasks in the cluster that are in the RUNNING state. @@ -4030,7 +4050,7 @@ func (s Service) GoString() string { type ServiceEvent struct { _ struct{} `type:"structure"` - // The Unix time in seconds and milliseconds when the event was triggered. + // The Unix timestamp for when the event was triggered. CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` // The ID string of the event. @@ -4310,8 +4330,8 @@ type Task struct { // The containers associated with the task. Containers []*Container `locationName:"containers" type:"list"` - // The Unix time in seconds and milliseconds when the task was created (the - // task entered the PENDING state). + // The Unix timestamp for when the task was created (the task entered the PENDING + // state). CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` // The desired status of the task. @@ -4323,8 +4343,8 @@ type Task struct { // One or more container overrides. Overrides *TaskOverride `locationName:"overrides" type:"structure"` - // The Unix time in seconds and milliseconds when the task was started (the - // task transitioned from the PENDING state to the RUNNING state). + // The Unix timestamp for when the task was started (the task transitioned from + // the PENDING state to the RUNNING state). StartedAt *time.Time `locationName:"startedAt" type:"timestamp" timestampFormat:"unix"` // The tag specified when a task is started. If the task is started by an Amazon @@ -4332,8 +4352,8 @@ type Task struct { // service that starts it. StartedBy *string `locationName:"startedBy" type:"string"` - // The Unix time in seconds and milliseconds when the task was stopped (the - // task transitioned from the RUNNING state to the STOPPED state). + // The Unix timestamp for when the task was stopped (the task transitioned from + // the RUNNING state to the STOPPED state). StoppedAt *time.Time `locationName:"stoppedAt" type:"timestamp" timestampFormat:"unix"` // The reason the task was stopped. @@ -4362,7 +4382,7 @@ type TaskDefinition struct { // A list of container definitions in JSON format that describe the different // containers that make up your task. For more information about container definition - // parameters and defaults, see Amazon ECS Task Definitions (http://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonECS/latest/developerguidetask_defintions.html) + // parameters and defaults, see Amazon ECS Task Definitions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) // in the Amazon EC2 Container Service Developer Guide. ContainerDefinitions []*ContainerDefinition `locationName:"containerDefinitions" type:"list"` @@ -4391,7 +4411,7 @@ type TaskDefinition struct { TaskRoleArn *string `locationName:"taskRoleArn" type:"string"` // The list of volumes in a task. For more information about volume definition - // parameters and defaults, see Amazon ECS Task Definitions (http://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonECS/latest/developerguidetask_defintions.html) + // parameters and defaults, see Amazon ECS Task Definitions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) // in the Amazon EC2 Container Service Developer Guide. Volumes []*Volume `locationName:"volumes" type:"list"` } diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/examples_test.go index be496ffe0..5723cbc3f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/examples_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecs/examples_test.go @@ -16,7 +16,13 @@ var _ time.Duration var _ bytes.Buffer func ExampleECS_CreateCluster() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.CreateClusterInput{ ClusterName: aws.String("String"), @@ -35,7 +41,13 @@ func ExampleECS_CreateCluster() { } func ExampleECS_CreateService() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.CreateServiceInput{ DesiredCount: aws.Int64(1), // Required @@ -52,6 +64,7 @@ func ExampleECS_CreateService() { ContainerName: aws.String("String"), ContainerPort: aws.Int64(1), LoadBalancerName: aws.String("String"), + TargetGroupArn: aws.String("String"), }, // More values... }, @@ -71,7 +84,13 @@ func ExampleECS_CreateService() { } func ExampleECS_DeleteCluster() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.DeleteClusterInput{ Cluster: aws.String("String"), // Required @@ -90,7 +109,13 @@ func ExampleECS_DeleteCluster() { } func ExampleECS_DeleteService() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.DeleteServiceInput{ Service: aws.String("String"), // Required @@ -110,7 +135,13 @@ func ExampleECS_DeleteService() { } func ExampleECS_DeregisterContainerInstance() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.DeregisterContainerInstanceInput{ ContainerInstance: aws.String("String"), // Required @@ -131,7 +162,13 @@ func ExampleECS_DeregisterContainerInstance() { } func ExampleECS_DeregisterTaskDefinition() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.DeregisterTaskDefinitionInput{ TaskDefinition: aws.String("String"), // Required @@ -150,7 +187,13 @@ func ExampleECS_DeregisterTaskDefinition() { } func ExampleECS_DescribeClusters() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.DescribeClustersInput{ Clusters: []*string{ @@ -172,7 +215,13 @@ func ExampleECS_DescribeClusters() { } func ExampleECS_DescribeContainerInstances() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.DescribeContainerInstancesInput{ ContainerInstances: []*string{ // Required @@ -195,7 +244,13 @@ func ExampleECS_DescribeContainerInstances() { } func ExampleECS_DescribeServices() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.DescribeServicesInput{ Services: []*string{ // Required @@ -218,7 +273,13 @@ func ExampleECS_DescribeServices() { } func ExampleECS_DescribeTaskDefinition() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.DescribeTaskDefinitionInput{ TaskDefinition: aws.String("String"), // Required @@ -237,7 +298,13 @@ func ExampleECS_DescribeTaskDefinition() { } func ExampleECS_DescribeTasks() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.DescribeTasksInput{ Tasks: []*string{ // Required @@ -260,7 +327,13 @@ func ExampleECS_DescribeTasks() { } func ExampleECS_DiscoverPollEndpoint() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.DiscoverPollEndpointInput{ Cluster: aws.String("String"), @@ -280,7 +353,13 @@ func ExampleECS_DiscoverPollEndpoint() { } func ExampleECS_ListClusters() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.ListClustersInput{ MaxResults: aws.Int64(1), @@ -300,7 +379,13 @@ func ExampleECS_ListClusters() { } func ExampleECS_ListContainerInstances() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.ListContainerInstancesInput{ Cluster: aws.String("String"), @@ -321,7 +406,13 @@ func ExampleECS_ListContainerInstances() { } func ExampleECS_ListServices() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.ListServicesInput{ Cluster: aws.String("String"), @@ -342,7 +433,13 @@ func ExampleECS_ListServices() { } func ExampleECS_ListTaskDefinitionFamilies() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.ListTaskDefinitionFamiliesInput{ FamilyPrefix: aws.String("String"), @@ -364,7 +461,13 @@ func ExampleECS_ListTaskDefinitionFamilies() { } func ExampleECS_ListTaskDefinitions() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.ListTaskDefinitionsInput{ FamilyPrefix: aws.String("String"), @@ -387,7 +490,13 @@ func ExampleECS_ListTaskDefinitions() { } func ExampleECS_ListTasks() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.ListTasksInput{ Cluster: aws.String("String"), @@ -413,7 +522,13 @@ func ExampleECS_ListTasks() { } func ExampleECS_RegisterContainerInstance() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.RegisterContainerInstanceInput{ Attributes: []*ecs.Attribute{ @@ -461,7 +576,13 @@ func ExampleECS_RegisterContainerInstance() { } func ExampleECS_RegisterTaskDefinition() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.RegisterTaskDefinitionInput{ ContainerDefinitions: []*ecs.ContainerDefinition{ // Required @@ -586,7 +707,13 @@ func ExampleECS_RegisterTaskDefinition() { } func ExampleECS_RunTask() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.RunTaskInput{ TaskDefinition: aws.String("String"), // Required @@ -628,7 +755,13 @@ func ExampleECS_RunTask() { } func ExampleECS_StartTask() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.StartTaskInput{ ContainerInstances: []*string{ // Required @@ -673,7 +806,13 @@ func ExampleECS_StartTask() { } func ExampleECS_StopTask() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.StopTaskInput{ Task: aws.String("String"), // Required @@ -694,7 +833,13 @@ func ExampleECS_StopTask() { } func ExampleECS_SubmitContainerStateChange() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.SubmitContainerStateChangeInput{ Cluster: aws.String("String"), @@ -727,7 +872,13 @@ func ExampleECS_SubmitContainerStateChange() { } func ExampleECS_SubmitTaskStateChange() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.SubmitTaskStateChangeInput{ Cluster: aws.String("String"), @@ -749,7 +900,13 @@ func ExampleECS_SubmitTaskStateChange() { } func ExampleECS_UpdateContainerAgent() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.UpdateContainerAgentInput{ ContainerInstance: aws.String("String"), // Required @@ -769,7 +926,13 @@ func ExampleECS_UpdateContainerAgent() { } func ExampleECS_UpdateService() { - svc := ecs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := ecs.New(sess) params := &ecs.UpdateServiceInput{ Service: aws.String("String"), // Required diff --git a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/api.go b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/api.go index af931b4f1..2d0685ddf 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/api.go @@ -1056,22 +1056,22 @@ type Artwork struct { // Specify one of the following values to control scaling of the output album // art: // - // Fit: Elastic Transcoder scales the output art so it matches the value + // Fit: Elastic Transcoder scales the output art so it matches the value // that you specified in either MaxWidth or MaxHeight without exceeding the - // other value. Fill: Elastic Transcoder scales the output art so it matches + // other value. Fill: Elastic Transcoder scales the output art so it matches // the value that you specified in either MaxWidth or MaxHeight and matches // or exceeds the other value. Elastic Transcoder centers the output art and // then crops it in the dimension (if any) that exceeds the maximum value. - // Stretch: Elastic Transcoder stretches the output art to match the values + // Stretch: Elastic Transcoder stretches the output art to match the values // that you specified for MaxWidth and MaxHeight. If the relative proportions // of the input art and the output art are different, the output art will be - // distorted. Keep: Elastic Transcoder does not scale the output art. If either + // distorted. Keep: Elastic Transcoder does not scale the output art. If either // dimension of the input art exceeds the values that you specified for MaxWidth - // and MaxHeight, Elastic Transcoder crops the output art. ShrinkToFit: Elastic + // and MaxHeight, Elastic Transcoder crops the output art. ShrinkToFit: Elastic // Transcoder scales the output art down so that its dimensions match the values // that you specified for at least one of MaxWidth and MaxHeight without exceeding // either value. If you specify this option, Elastic Transcoder does not scale - // the art up. ShrinkToFill Elastic Transcoder scales the output art down so + // the art up. ShrinkToFill Elastic Transcoder scales the output art down so // that its dimensions match the values that you specified for at least one // of MaxWidth and MaxHeight without dropping below either value. If you specify // this option, Elastic Transcoder does not scale the art up. @@ -1131,11 +1131,11 @@ type AudioCodecOptions struct { // Specify the AAC profile for the output file. Elastic Transcoder supports // the following profiles: // - // auto: If you specify auto, Elastic Transcoder will select the profile - // based on the bit rate selected for the output file. AAC-LC: The most common - // AAC profile. Use for bit rates larger than 64 kbps. HE-AAC: Not supported - // on some older players and devices. Use for bit rates between 40 and 80 kbps. - // HE-AACv2: Not supported on some players and devices. Use for bit rates less + // auto: If you specify auto, Elastic Transcoder will select the profile based + // on the bit rate selected for the output file. AAC-LC: The most common AAC + // profile. Use for bit rates larger than 64 kbps. HE-AAC: Not supported on + // some older players and devices. Use for bit rates between 40 and 80 kbps. + // HE-AACv2: Not supported on some players and devices. Use for bit rates less // than 48 kbps. All outputs in a Smooth playlist must have the same value // for Profile. // @@ -1184,15 +1184,15 @@ type AudioParameters struct { // The outputs of SingleTrack for a specific channel value and inputs are as // follows: // - // 0 channels with any input: Audio omitted from the output 1, 2, or auto - // channels with no audio input: Audio omitted from the output 1 channel - // with any input with audio: One track with one channel, downmixed if necessary - // 2 channels with one track with one channel: One track with two identical - // channels 2 or auto channels with two tracks with one channel each: One - // track with two channels 2 or auto channels with one track with two channels: - // One track with two channels 2 channels with one track with multiple channels: - // One track with two channels auto channels with one track with one channel: - // One track with one channel auto channels with one track with multiple channels: + // 0 channels with any input: Audio omitted from the output 1, 2, or auto + // channels with no audio input: Audio omitted from the output 1 channel with + // any input with audio: One track with one channel, downmixed if necessary + // 2 channels with one track with one channel: One track with two identical + // channels 2 or auto channels with two tracks with one channel each: One track + // with two channels 2 or auto channels with one track with two channels: One + // track with two channels 2 channels with one track with multiple channels: + // One track with two channels auto channels with one track with one channel: + // One track with one channel auto channels with one track with multiple channels: // One track with multiple channels When you specify OneChannelPerTrack, Elastic // Transcoder creates a new track for every channel in your output. Your output // can have up to eight single-channel tracks. @@ -1200,34 +1200,34 @@ type AudioParameters struct { // The outputs of OneChannelPerTrack for a specific channel value and inputs // are as follows: // - // 0 channels with any input: Audio omitted from the output 1, 2, or auto - // channels with no audio input: Audio omitted from the output 1 channel - // with any input with audio: One track with one channel, downmixed if necessary - // 2 channels with one track with one channel: Two tracks with one identical - // channel each 2 or auto channels with two tracks with one channel each: - // Two tracks with one channel each 2 or auto channels with one track with - // two channels: Two tracks with one channel each 2 channels with one track - // with multiple channels: Two tracks with one channel each auto channels - // with one track with one channel: One track with one channel auto channels - // with one track with multiple channels: Up to eight tracks with one channel - // each When you specify OneChannelPerTrackWithMosTo8Tracks, Elastic Transcoder - // creates eight single-channel tracks for your output. All tracks that do not - // contain audio data from an input channel are MOS, or Mit Out Sound, tracks. + // 0 channels with any input: Audio omitted from the output 1, 2, or auto + // channels with no audio input: Audio omitted from the output 1 channel with + // any input with audio: One track with one channel, downmixed if necessary + // 2 channels with one track with one channel: Two tracks with one identical + // channel each 2 or auto channels with two tracks with one channel each: Two + // tracks with one channel each 2 or auto channels with one track with two + // channels: Two tracks with one channel each 2 channels with one track with + // multiple channels: Two tracks with one channel each auto channels with one + // track with one channel: One track with one channel auto channels with one + // track with multiple channels: Up to eight tracks with one channel each When + // you specify OneChannelPerTrackWithMosTo8Tracks, Elastic Transcoder creates + // eight single-channel tracks for your output. All tracks that do not contain + // audio data from an input channel are MOS, or Mit Out Sound, tracks. // // The outputs of OneChannelPerTrackWithMosTo8Tracks for a specific channel // value and inputs are as follows: // - // 0 channels with any input: Audio omitted from the output 1, 2, or auto - // channels with no audio input: Audio omitted from the output 1 channel - // with any input with audio: One track with one channel, downmixed if necessary, - // plus six MOS tracks 2 channels with one track with one channel: Two tracks - // with one identical channel each, plus six MOS tracks 2 or auto channels + // 0 channels with any input: Audio omitted from the output 1, 2, or auto + // channels with no audio input: Audio omitted from the output 1 channel with + // any input with audio: One track with one channel, downmixed if necessary, + // plus six MOS tracks 2 channels with one track with one channel: Two tracks + // with one identical channel each, plus six MOS tracks 2 or auto channels // with two tracks with one channel each: Two tracks with one channel each, - // plus six MOS tracks 2 or auto channels with one track with two channels: - // Two tracks with one channel each, plus six MOS tracks 2 channels with one + // plus six MOS tracks 2 or auto channels with one track with two channels: + // Two tracks with one channel each, plus six MOS tracks 2 channels with one // track with multiple channels: Two tracks with one channel each, plus six - // MOS tracks auto channels with one track with one channel: One track with - // one channel, plus seven MOS tracks auto channels with one track with multiple + // MOS tracks auto channels with one track with one channel: One track with + // one channel, plus seven MOS tracks auto channels with one track with multiple // channels: Up to eight tracks with one channel each, plus MOS tracks until // there are eight tracks in all AudioPackingMode *string `type:"string"` @@ -1250,11 +1250,11 @@ type AudioParameters struct { // // The output of a specific channel value and inputs are as follows: // - // auto channel specified, with any input: Pass through up to eight input - // channels. 0 channels specified, with any input: Audio omitted from the output. - // 1 channel specified, with at least one input channel: Mono sound. 2 channels + // auto channel specified, with any input: Pass through up to eight input + // channels. 0 channels specified, with any input: Audio omitted from the output. + // 1 channel specified, with at least one input channel: Mono sound. 2 channels // specified, with any input: Two identical mono channels or stereo. For more - // information about tracks, see Audio:AudioPackingMode. For more information + // information about tracks, see Audio:AudioPackingMode. For more information // about how Elastic Transcoder organizes channels and tracks, see Audio:AudioPackingMode. Channels *string `type:"string"` @@ -1353,7 +1353,7 @@ type CaptionFormat struct { // The format you specify determines whether Elastic Transcoder generates an // embedded or sidecar caption for this output. // - // Valid Embedded Caption Formats: + // Valid Embedded Caption Formats: // // for FLAC: None // @@ -1367,7 +1367,7 @@ type CaptionFormat struct { // // For webm: None // - // Valid Sidecar Caption Formats: Elastic Transcoder supports dfxp (first + // Valid Sidecar Caption Formats: Elastic Transcoder supports dfxp (first // div element only), scc, srt, and webvtt. If you want ttml or smpte-tt compatible // captions, specify dfxp as your output format. // @@ -1380,7 +1380,7 @@ type CaptionFormat struct { // The prefix for caption filenames, in the form description-{language}, where: // - // description is a description of the video. {language} is a literal value + // description is a description of the video. {language} is a literal value // that Elastic Transcoder replaces with the two- or three-letter code for the // language of the caption in the output file names. If you don't include {language} // in the file name pattern, Elastic Transcoder automatically appends "{language}" @@ -1665,7 +1665,7 @@ type CreateJobOutput struct { // from one format to another. All captions must be in UTF-8. Elastic Transcoder // supports two types of captions: // - // Embedded: Embedded captions are included in the same file as the audio + // Embedded: Embedded captions are included in the same file as the audio // and video. Elastic Transcoder supports only one embedded caption per language, // to a maximum of 300 embedded captions per file. // @@ -1676,7 +1676,7 @@ type CreateJobOutput struct { // // Elastic Transcoder supports a maximum of one embedded format per output. // - // Sidecar: Sidecar captions are kept in a separate metadata file from the + // Sidecar: Sidecar captions are kept in a separate metadata file from the // audio and video data. Sidecar captions require a player that is capable of // understanding the relationship between the video file and the sidecar file. // Elastic Transcoder supports only one sidecar caption per language, to a maximum @@ -1687,7 +1687,7 @@ type CreateJobOutput struct { // // Valid outputs include: dfxp (first div element only), scc, srt, and webvtt. // - // If you want ttml or smpte-tt compatible captions, specify dfxp as your + // If you want ttml or smpte-tt compatible captions, specify dfxp as your // output format. // // Elastic Transcoder does not support OCR (Optical Character Recognition), @@ -1978,21 +1978,21 @@ type CreatePipelineInput struct { // If you specify values for ContentConfig and ThumbnailConfig, omit the OutputBucket // object. // - // Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to save - // transcoded files and playlists. Permissions (Optional): The Permissions - // object specifies which users you want to have access to transcoded files - // and the type of access you want them to have. You can grant permissions to - // a maximum of 30 users and/or predefined Amazon S3 groups. Grantee Type: - // Specify the type of value that appears in the Grantee object: Canonical: - // The value in the Grantee object is either the canonical user ID for an AWS - // account or an origin access identity for an Amazon CloudFront distribution. - // For more information about canonical user IDs, see Access Control List (ACL) - // Overview in the Amazon Simple Storage Service Developer Guide. For more information + // Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to save + // transcoded files and playlists. Permissions (Optional): The Permissions object + // specifies which users you want to have access to transcoded files and the + // type of access you want them to have. You can grant permissions to a maximum + // of 30 users and/or predefined Amazon S3 groups. Grantee Type: Specify the + // type of value that appears in the Grantee object: Canonical: The value in + // the Grantee object is either the canonical user ID for an AWS account or + // an origin access identity for an Amazon CloudFront distribution. For more + // information about canonical user IDs, see Access Control List (ACL) Overview + // in the Amazon Simple Storage Service Developer Guide. For more information // about using CloudFront origin access identities to require that users use // CloudFront URLs instead of Amazon S3 URLs, see Using an Origin Access Identity // to Restrict Access to Your Amazon S3 Content. A canonical user ID is not - // the same as an AWS account number. Email: The value in the Grantee object - // is the registered email address of an AWS account. Group: The value in the + // the same as an AWS account number. Email: The value in the Grantee object + // is the registered email address of an AWS account. Group: The value in the // Grantee object is one of the following predefined Amazon S3 groups: AllUsers, // AuthenticatedUsers, or LogDelivery. Grantee: The AWS user or group that // you want to have access to transcoded files and playlists. To identify the @@ -2001,12 +2001,12 @@ type CreatePipelineInput struct { // address of an AWS account, or a predefined Amazon S3 group Access: The // permission that you want to give to the AWS user that you specified in Grantee. // Permissions are granted on the files that Elastic Transcoder adds to the - // bucket, including playlists and video files. Valid values include: READ: + // bucket, including playlists and video files. Valid values include: READ: // The grantee can read the objects and metadata for objects that Elastic Transcoder - // adds to the Amazon S3 bucket. READ_ACP: The grantee can read the object - // ACL for objects that Elastic Transcoder adds to the Amazon S3 bucket. WRITE_ACP: + // adds to the Amazon S3 bucket. READ_ACP: The grantee can read the object ACL + // for objects that Elastic Transcoder adds to the Amazon S3 bucket. WRITE_ACP: // The grantee can write the ACL for the objects that Elastic Transcoder adds - // to the Amazon S3 bucket. FULL_CONTROL: The grantee has READ, READ_ACP, and + // to the Amazon S3 bucket. FULL_CONTROL: The grantee has READ, READ_ACP, and // WRITE_ACP permissions for the objects that Elastic Transcoder adds to the // Amazon S3 bucket. StorageClass: The Amazon S3 storage class, Standard // or ReducedRedundancy, that you want Elastic Transcoder to assign to the video @@ -2027,17 +2027,17 @@ type CreatePipelineInput struct { // notify to report job status. // // To receive notifications, you must also subscribe to the new topic in the - // Amazon SNS console. Progressing: The topic ARN for the Amazon Simple Notification + // Amazon SNS console. Progressing: The topic ARN for the Amazon Simple Notification // Service (Amazon SNS) topic that you want to notify when Elastic Transcoder // has started to process a job in this pipeline. This is the ARN that Amazon // SNS returned when you created the topic. For more information, see Create - // a Topic in the Amazon Simple Notification Service Developer Guide. Completed: + // a Topic in the Amazon Simple Notification Service Developer Guide. Completed: // The topic ARN for the Amazon SNS topic that you want to notify when Elastic // Transcoder has finished processing a job in this pipeline. This is the ARN - // that Amazon SNS returned when you created the topic. Warning: The topic - // ARN for the Amazon SNS topic that you want to notify when Elastic Transcoder + // that Amazon SNS returned when you created the topic. Warning: The topic ARN + // for the Amazon SNS topic that you want to notify when Elastic Transcoder // encounters a warning condition while processing a job in this pipeline. This - // is the ARN that Amazon SNS returned when you created the topic. Error: The + // is the ARN that Amazon SNS returned when you created the topic. Error: The // topic ARN for the Amazon SNS topic that you want to notify when Elastic Transcoder // encounters an error condition while processing a job in this pipeline. This // is the ARN that Amazon SNS returned when you created the topic. @@ -2052,7 +2052,7 @@ type CreatePipelineInput struct { // to the transcoded files, thumbnails, and playlists. You do not want to specify // the permissions that Elastic Transcoder grants to the files. When Elastic // Transcoder saves files in OutputBucket, it grants full control over the files - // only to the AWS account that owns the role that is specified by Role. You + // only to the AWS account that owns the role that is specified by Role. You // want to associate the transcoded files and thumbnails with the Amazon S3 // Standard storage class. // @@ -2077,8 +2077,8 @@ type CreatePipelineInput struct { // If you specify values for ContentConfig and ThumbnailConfig, omit the OutputBucket // object. // - // Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to save - // thumbnail files. Permissions (Optional): The Permissions object specifies + // Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to save + // thumbnail files. Permissions (Optional): The Permissions object specifies // which users and/or predefined Amazon S3 groups you want to have access to // thumbnail files, and the type of access you want them to have. You can grant // permissions to a maximum of 30 users and/or predefined Amazon S3 groups. @@ -2086,25 +2086,25 @@ type CreatePipelineInput struct { // Canonical: The value in the Grantee object is either the canonical user // ID for an AWS account or an origin access identity for an Amazon CloudFront // distribution. A canonical user ID is not the same as an AWS account number. - // Email: The value in the Grantee object is the registered email address - // of an AWS account. Group: The value in the Grantee object is one of the - // following predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery. + // Email: The value in the Grantee object is the registered email address of + // an AWS account. Group: The value in the Grantee object is one of the following + // predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery. // Grantee: The AWS user or group that you want to have access to thumbnail // files. To identify the user or group, you can specify the canonical user // ID for an AWS account, an origin access identity for a CloudFront distribution, // the registered email address of an AWS account, or a predefined Amazon S3 // group. Access: The permission that you want to give to the AWS user that // you specified in Grantee. Permissions are granted on the thumbnail files - // that Elastic Transcoder adds to the bucket. Valid values include: READ: + // that Elastic Transcoder adds to the bucket. Valid values include: READ: // The grantee can read the thumbnails and metadata for objects that Elastic - // Transcoder adds to the Amazon S3 bucket. READ_ACP: The grantee can read - // the object ACL for thumbnails that Elastic Transcoder adds to the Amazon - // S3 bucket. WRITE_ACP: The grantee can write the ACL for the thumbnails - // that Elastic Transcoder adds to the Amazon S3 bucket. FULL_CONTROL: The - // grantee has READ, READ_ACP, and WRITE_ACP permissions for the thumbnails - // that Elastic Transcoder adds to the Amazon S3 bucket. StorageClass: The - // Amazon S3 storage class, Standard or ReducedRedundancy, that you want Elastic - // Transcoder to assign to the thumbnails that it stores in your Amazon S3 bucket. + // Transcoder adds to the Amazon S3 bucket. READ_ACP: The grantee can read the + // object ACL for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket. + // WRITE_ACP: The grantee can write the ACL for the thumbnails that Elastic + // Transcoder adds to the Amazon S3 bucket. FULL_CONTROL: The grantee has READ, + // READ_ACP, and WRITE_ACP permissions for the thumbnails that Elastic Transcoder + // adds to the Amazon S3 bucket. StorageClass: The Amazon S3 storage class, + // Standard or ReducedRedundancy, that you want Elastic Transcoder to assign + // to the thumbnails that it stores in your Amazon S3 bucket. ThumbnailConfig *PipelineOutputConfig `type:"structure"` } @@ -2623,10 +2623,10 @@ type JobAlbumArt struct { // A policy that determines how Elastic Transcoder will handle the existence // of multiple album artwork files. // - // Replace: The specified album art will replace any existing album art. - // Prepend: The specified album art will be placed in front of any existing - // album art. Append: The specified album art will be placed after any existing - // album art. Fallback: If the original input file contains artwork, Elastic + // Replace: The specified album art will replace any existing album art. + // Prepend: The specified album art will be placed in front of any existing + // album art. Append: The specified album art will be placed after any existing + // album art. Fallback: If the original input file contains artwork, Elastic // Transcoder will use that artwork for the output. If the original input does // not contain artwork, Elastic Transcoder will use the specified album art // file. @@ -2773,7 +2773,7 @@ type JobOutput struct { // from one format to another. All captions must be in UTF-8. Elastic Transcoder // supports two types of captions: // - // Embedded: Embedded captions are included in the same file as the audio + // Embedded: Embedded captions are included in the same file as the audio // and video. Elastic Transcoder supports only one embedded caption per language, // to a maximum of 300 embedded captions per file. // @@ -2784,7 +2784,7 @@ type JobOutput struct { // // Elastic Transcoder supports a maximum of one embedded format per output. // - // Sidecar: Sidecar captions are kept in a separate metadata file from the + // Sidecar: Sidecar captions are kept in a separate metadata file from the // audio and video data. Sidecar captions require a player that is capable of // understanding the relationship between the video file and the sidecar file. // Elastic Transcoder supports only one sidecar caption per language, to a maximum @@ -2795,7 +2795,7 @@ type JobOutput struct { // // Valid outputs include: dfxp (first div element only), scc, srt, and webvtt. // - // If you want ttml or smpte-tt compatible captions, specify dfxp as your + // If you want ttml or smpte-tt compatible captions, specify dfxp as your // output format. // // Elastic Transcoder does not support OCR (Optical Character Recognition), @@ -2888,7 +2888,7 @@ type JobOutput struct { // The status of one output in a job. If you specified only one output for the // job, Outputs:Status is always the same as Job:Status. If you specified more - // than one output: Job:Status and Outputs:Status for all of the outputs is + // than one output: Job:Status and Outputs:Status for all of the outputs is // Submitted until Elastic Transcoder starts to process the first output. When // Elastic Transcoder starts to process the first output, Outputs:Status for // that output and Job:Status both change to Progressing. For each output, the @@ -3280,11 +3280,11 @@ type Permission struct { _ struct{} `type:"structure"` // The permission that you want to give to the AWS user that is listed in Grantee. - // Valid values include: READ: The grantee can read the thumbnails and metadata - // for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket. READ_ACP: + // Valid values include: READ: The grantee can read the thumbnails and metadata + // for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket. READ_ACP: // The grantee can read the object ACL for thumbnails that Elastic Transcoder - // adds to the Amazon S3 bucket. WRITE_ACP: The grantee can write the ACL for - // the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket. FULL_CONTROL: + // adds to the Amazon S3 bucket. WRITE_ACP: The grantee can write the ACL for + // the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket. FULL_CONTROL: // The grantee has READ, READ_ACP, and WRITE_ACP permissions for the thumbnails // that Elastic Transcoder adds to the Amazon S3 bucket. Access []*string `type:"list"` @@ -3296,11 +3296,11 @@ type Permission struct { // group. Grantee *string `min:"1" type:"string"` - // The type of value that appears in the Grantee object: Canonical: Either + // The type of value that appears in the Grantee object: Canonical: Either // the canonical user ID for an AWS account or an origin access identity for // an Amazon CloudFront distribution. A canonical user ID is not the same as - // an AWS account number. Email: The registered email address of an AWS account. - // Group: One of the following predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, + // an AWS account number. Email: The registered email address of an AWS account. + // Group: One of the following predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, // or LogDelivery. GranteeType *string `type:"string"` } @@ -3349,27 +3349,26 @@ type Pipeline struct { // to save transcoded files and playlists. Either you specify both ContentConfig // and ThumbnailConfig, or you specify OutputBucket. // - // Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to save - // transcoded files and playlists. Permissions: A list of the users and/or - // predefined Amazon S3 groups you want to have access to transcoded files and - // playlists, and the type of access that you want them to have. GranteeType: - // The type of value that appears in the Grantee object: Canonical: Either - // the canonical user ID for an AWS account or an origin access identity for - // an Amazon CloudFront distribution. Email: The registered email address of - // an AWS account. Group: One of the following predefined Amazon S3 groups: - // AllUsers, AuthenticatedUsers, or LogDelivery. Grantee: The AWS user or - // group that you want to have access to transcoded files and playlists. Access: - // The permission that you want to give to the AWS user that is listed in Grantee. - // Valid values include: READ: The grantee can read the objects and metadata - // for objects that Elastic Transcoder adds to the Amazon S3 bucket. READ_ACP: - // The grantee can read the object ACL for objects that Elastic Transcoder adds - // to the Amazon S3 bucket. WRITE_ACP: The grantee can write the ACL for the - // objects that Elastic Transcoder adds to the Amazon S3 bucket. FULL_CONTROL: - // The grantee has READ, READ_ACP, and WRITE_ACP permissions for the objects - // that Elastic Transcoder adds to the Amazon S3 bucket. StorageClass: - // The Amazon S3 storage class, Standard or ReducedRedundancy, that you want - // Elastic Transcoder to assign to the video files and playlists that it stores - // in your Amazon S3 bucket. + // Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to save + // transcoded files and playlists. Permissions: A list of the users and/or predefined + // Amazon S3 groups you want to have access to transcoded files and playlists, + // and the type of access that you want them to have. GranteeType: The type + // of value that appears in the Grantee object: Canonical: Either the canonical + // user ID for an AWS account or an origin access identity for an Amazon CloudFront + // distribution. Email: The registered email address of an AWS account. Group: + // One of the following predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, + // or LogDelivery. Grantee: The AWS user or group that you want to have access + // to transcoded files and playlists. Access: The permission that you want to + // give to the AWS user that is listed in Grantee. Valid values include: READ: + // The grantee can read the objects and metadata for objects that Elastic Transcoder + // adds to the Amazon S3 bucket. READ_ACP: The grantee can read the object ACL + // for objects that Elastic Transcoder adds to the Amazon S3 bucket. WRITE_ACP: + // The grantee can write the ACL for the objects that Elastic Transcoder adds + // to the Amazon S3 bucket. FULL_CONTROL: The grantee has READ, READ_ACP, and + // WRITE_ACP permissions for the objects that Elastic Transcoder adds to the + // Amazon S3 bucket. StorageClass: The Amazon S3 storage class, Standard + // or ReducedRedundancy, that you want Elastic Transcoder to assign to the video + // files and playlists that it stores in your Amazon S3 bucket. ContentConfig *PipelineOutputConfig `type:"structure"` // The identifier for the pipeline. You use this value to identify the pipeline @@ -3391,12 +3390,12 @@ type Pipeline struct { // notify to report job status. // // To receive notifications, you must also subscribe to the new topic in the - // Amazon SNS console. Progressing (optional): The Amazon Simple Notification + // Amazon SNS console. Progressing (optional): The Amazon Simple Notification // Service (Amazon SNS) topic that you want to notify when Elastic Transcoder - // has started to process the job. Completed (optional): The Amazon SNS topic + // has started to process the job. Completed (optional): The Amazon SNS topic // that you want to notify when Elastic Transcoder has finished processing the - // job. Warning (optional): The Amazon SNS topic that you want to notify when - // Elastic Transcoder encounters a warning condition. Error (optional): The + // job. Warning (optional): The Amazon SNS topic that you want to notify when + // Elastic Transcoder encounters a warning condition. Error (optional): The // Amazon SNS topic that you want to notify when Elastic Transcoder encounters // an error condition. Notifications *Notifications `type:"structure"` @@ -3412,35 +3411,34 @@ type Pipeline struct { // The current status of the pipeline: // - // Active: The pipeline is processing jobs. Paused: The pipeline is not - // currently processing jobs. + // Active: The pipeline is processing jobs. Paused: The pipeline is not currently + // processing jobs. Status *string `type:"string"` // Information about the Amazon S3 bucket in which you want Elastic Transcoder // to save thumbnail files. Either you specify both ContentConfig and ThumbnailConfig, // or you specify OutputBucket. // - // Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to save - // thumbnail files. Permissions: A list of the users and/or predefined Amazon + // Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to save + // thumbnail files. Permissions: A list of the users and/or predefined Amazon // S3 groups you want to have access to thumbnail files, and the type of access // that you want them to have. GranteeType: The type of value that appears - // in the Grantee object: Canonical: Either the canonical user ID for an AWS + // in the Grantee object: Canonical: Either the canonical user ID for an AWS // account or an origin access identity for an Amazon CloudFront distribution. - // A canonical user ID is not the same as an AWS account number. Email: The - // registered email address of an AWS account. Group: One of the following - // predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery. - // Grantee: The AWS user or group that you want to have access to thumbnail - // files. Access: The permission that you want to give to the AWS user that - // is listed in Grantee. Valid values include: READ: The grantee can read - // the thumbnails and metadata for thumbnails that Elastic Transcoder adds to - // the Amazon S3 bucket. READ_ACP: The grantee can read the object ACL for - // thumbnails that Elastic Transcoder adds to the Amazon S3 bucket. WRITE_ACP: - // The grantee can write the ACL for the thumbnails that Elastic Transcoder - // adds to the Amazon S3 bucket. FULL_CONTROL: The grantee has READ, READ_ACP, - // and WRITE_ACP permissions for the thumbnails that Elastic Transcoder adds - // to the Amazon S3 bucket. StorageClass: The Amazon S3 storage class, - // Standard or ReducedRedundancy, that you want Elastic Transcoder to assign - // to the thumbnails that it stores in your Amazon S3 bucket. + // A canonical user ID is not the same as an AWS account number. Email: The + // registered email address of an AWS account. Group: One of the following predefined + // Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery. Grantee: + // The AWS user or group that you want to have access to thumbnail files. Access: + // The permission that you want to give to the AWS user that is listed in Grantee. + // Valid values include: READ: The grantee can read the thumbnails and metadata + // for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket. READ_ACP: + // The grantee can read the object ACL for thumbnails that Elastic Transcoder + // adds to the Amazon S3 bucket. WRITE_ACP: The grantee can write the ACL for + // the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket. FULL_CONTROL: + // The grantee has READ, READ_ACP, and WRITE_ACP permissions for the thumbnails + // that Elastic Transcoder adds to the Amazon S3 bucket. StorageClass: The + // Amazon S3 storage class, Standard or ReducedRedundancy, that you want Elastic + // Transcoder to assign to the thumbnails that it stores in your Amazon S3 bucket. ThumbnailConfig *PipelineOutputConfig `type:"structure"` } @@ -3757,10 +3755,10 @@ type PresetWatermark struct { _ struct{} `type:"structure"` // The horizontal position of the watermark unless you specify a non-zero value - // for HorizontalOffset: Left: The left edge of the watermark is aligned with - // the left border of the video. Right: The right edge of the watermark is - // aligned with the right border of the video. Center: The watermark is centered - // between the left and right borders. + // for HorizontalOffset: Left: The left edge of the watermark is aligned with + // the left border of the video. Right: The right edge of the watermark is aligned + // with the right border of the video. Center: The watermark is centered between + // the left and right borders. HorizontalAlign *string `type:"string"` // The amount by which you want the horizontal position of the watermark to @@ -3814,25 +3812,25 @@ type PresetWatermark struct { // a value of 0 for Opacity. The .jpg file format doesn't support transparency. Opacity *string `type:"string"` - // A value that controls scaling of the watermark: Fit: Elastic Transcoder + // A value that controls scaling of the watermark: Fit: Elastic Transcoder // scales the watermark so it matches the value that you specified in either - // MaxWidth or MaxHeight without exceeding the other value. Stretch: Elastic + // MaxWidth or MaxHeight without exceeding the other value. Stretch: Elastic // Transcoder stretches the watermark to match the values that you specified // for MaxWidth and MaxHeight. If the relative proportions of the watermark // and the values of MaxWidth and MaxHeight are different, the watermark will - // be distorted. ShrinkToFit: Elastic Transcoder scales the watermark down - // so that its dimensions match the values that you specified for at least one + // be distorted. ShrinkToFit: Elastic Transcoder scales the watermark down so + // that its dimensions match the values that you specified for at least one // of MaxWidth and MaxHeight without exceeding either value. If you specify // this option, Elastic Transcoder does not scale the watermark up. SizingPolicy *string `type:"string"` // A value that determines how Elastic Transcoder interprets values that you // specified for HorizontalOffset, VerticalOffset, MaxWidth, and MaxHeight: - // Content: HorizontalOffset and VerticalOffset values are calculated based + // Content: HorizontalOffset and VerticalOffset values are calculated based // on the borders of the video excluding black bars added by Elastic Transcoder, // if any. In addition, MaxWidth and MaxHeight, if specified as a percentage, // are calculated based on the borders of the video excluding black bars added - // by Elastic Transcoder, if any. Frame: HorizontalOffset and VerticalOffset + // by Elastic Transcoder, if any. Frame: HorizontalOffset and VerticalOffset // values are calculated based on the borders of the video including black bars // added by Elastic Transcoder, if any. In addition, MaxWidth and MaxHeight, // if specified as a percentage, are calculated based on the borders of the @@ -3840,10 +3838,10 @@ type PresetWatermark struct { Target *string `type:"string"` // The vertical position of the watermark unless you specify a non-zero value - // for VerticalOffset: Top: The top edge of the watermark is aligned with - // the top border of the video. Bottom: The bottom edge of the watermark is - // aligned with the bottom border of the video. Center: The watermark is centered - // between the top and bottom borders. + // for VerticalOffset: Top: The top edge of the watermark is aligned with the + // top border of the video. Bottom: The bottom edge of the watermark is aligned + // with the bottom border of the video. Center: The watermark is centered between + // the top and bottom borders. VerticalAlign *string `type:"string"` // VerticalOffset The amount by which you want the vertical position of the @@ -4177,22 +4175,22 @@ type Thumbnails struct { // Specify one of the following values to control scaling of thumbnails: // - // Fit: Elastic Transcoder scales thumbnails so they match the value that + // Fit: Elastic Transcoder scales thumbnails so they match the value that // you specified in thumbnail MaxWidth or MaxHeight settings without exceeding - // the other value. Fill: Elastic Transcoder scales thumbnails so they match + // the other value. Fill: Elastic Transcoder scales thumbnails so they match // the value that you specified in thumbnail MaxWidth or MaxHeight settings // and matches or exceeds the other value. Elastic Transcoder centers the image // in thumbnails and then crops in the dimension (if any) that exceeds the maximum - // value. Stretch: Elastic Transcoder stretches thumbnails to match the values + // value. Stretch: Elastic Transcoder stretches thumbnails to match the values // that you specified for thumbnail MaxWidth and MaxHeight settings. If the // relative proportions of the input video and thumbnails are different, the - // thumbnails will be distorted. Keep: Elastic Transcoder does not scale thumbnails. + // thumbnails will be distorted. Keep: Elastic Transcoder does not scale thumbnails. // If either dimension of the input video exceeds the values that you specified // for thumbnail MaxWidth and MaxHeight settings, Elastic Transcoder crops the - // thumbnails. ShrinkToFit: Elastic Transcoder scales thumbnails down so that + // thumbnails. ShrinkToFit: Elastic Transcoder scales thumbnails down so that // their dimensions match the values that you specified for at least one of // thumbnail MaxWidth and MaxHeight without exceeding either value. If you specify - // this option, Elastic Transcoder does not scale thumbnails up. ShrinkToFill: + // this option, Elastic Transcoder does not scale thumbnails up. ShrinkToFill: // Elastic Transcoder scales thumbnails down so that their dimensions match // the values that you specified for at least one of MaxWidth and MaxHeight // without dropping below either value. If you specify this option, Elastic @@ -4290,21 +4288,21 @@ type UpdatePipelineInput struct { // If you specify values for ContentConfig and ThumbnailConfig, omit the OutputBucket // object. // - // Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to save - // transcoded files and playlists. Permissions (Optional): The Permissions - // object specifies which users you want to have access to transcoded files - // and the type of access you want them to have. You can grant permissions to - // a maximum of 30 users and/or predefined Amazon S3 groups. Grantee Type: - // Specify the type of value that appears in the Grantee object: Canonical: - // The value in the Grantee object is either the canonical user ID for an AWS - // account or an origin access identity for an Amazon CloudFront distribution. - // For more information about canonical user IDs, see Access Control List (ACL) - // Overview in the Amazon Simple Storage Service Developer Guide. For more information + // Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to save + // transcoded files and playlists. Permissions (Optional): The Permissions object + // specifies which users you want to have access to transcoded files and the + // type of access you want them to have. You can grant permissions to a maximum + // of 30 users and/or predefined Amazon S3 groups. Grantee Type: Specify the + // type of value that appears in the Grantee object: Canonical: The value in + // the Grantee object is either the canonical user ID for an AWS account or + // an origin access identity for an Amazon CloudFront distribution. For more + // information about canonical user IDs, see Access Control List (ACL) Overview + // in the Amazon Simple Storage Service Developer Guide. For more information // about using CloudFront origin access identities to require that users use // CloudFront URLs instead of Amazon S3 URLs, see Using an Origin Access Identity // to Restrict Access to Your Amazon S3 Content. A canonical user ID is not - // the same as an AWS account number. Email: The value in the Grantee object - // is the registered email address of an AWS account. Group: The value in the + // the same as an AWS account number. Email: The value in the Grantee object + // is the registered email address of an AWS account. Group: The value in the // Grantee object is one of the following predefined Amazon S3 groups: AllUsers, // AuthenticatedUsers, or LogDelivery. Grantee: The AWS user or group that // you want to have access to transcoded files and playlists. To identify the @@ -4313,12 +4311,12 @@ type UpdatePipelineInput struct { // address of an AWS account, or a predefined Amazon S3 group Access: The // permission that you want to give to the AWS user that you specified in Grantee. // Permissions are granted on the files that Elastic Transcoder adds to the - // bucket, including playlists and video files. Valid values include: READ: + // bucket, including playlists and video files. Valid values include: READ: // The grantee can read the objects and metadata for objects that Elastic Transcoder - // adds to the Amazon S3 bucket. READ_ACP: The grantee can read the object - // ACL for objects that Elastic Transcoder adds to the Amazon S3 bucket. WRITE_ACP: + // adds to the Amazon S3 bucket. READ_ACP: The grantee can read the object ACL + // for objects that Elastic Transcoder adds to the Amazon S3 bucket. WRITE_ACP: // The grantee can write the ACL for the objects that Elastic Transcoder adds - // to the Amazon S3 bucket. FULL_CONTROL: The grantee has READ, READ_ACP, and + // to the Amazon S3 bucket. FULL_CONTROL: The grantee has READ, READ_ACP, and // WRITE_ACP permissions for the objects that Elastic Transcoder adds to the // Amazon S3 bucket. StorageClass: The Amazon S3 storage class, Standard // or ReducedRedundancy, that you want Elastic Transcoder to assign to the video @@ -4360,8 +4358,8 @@ type UpdatePipelineInput struct { // If you specify values for ContentConfig and ThumbnailConfig, omit the OutputBucket // object. // - // Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to save - // thumbnail files. Permissions (Optional): The Permissions object specifies + // Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to save + // thumbnail files. Permissions (Optional): The Permissions object specifies // which users and/or predefined Amazon S3 groups you want to have access to // thumbnail files, and the type of access you want them to have. You can grant // permissions to a maximum of 30 users and/or predefined Amazon S3 groups. @@ -4369,25 +4367,25 @@ type UpdatePipelineInput struct { // Canonical: The value in the Grantee object is either the canonical user // ID for an AWS account or an origin access identity for an Amazon CloudFront // distribution. A canonical user ID is not the same as an AWS account number. - // Email: The value in the Grantee object is the registered email address - // of an AWS account. Group: The value in the Grantee object is one of the - // following predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery. + // Email: The value in the Grantee object is the registered email address of + // an AWS account. Group: The value in the Grantee object is one of the following + // predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery. // Grantee: The AWS user or group that you want to have access to thumbnail // files. To identify the user or group, you can specify the canonical user // ID for an AWS account, an origin access identity for a CloudFront distribution, // the registered email address of an AWS account, or a predefined Amazon S3 // group. Access: The permission that you want to give to the AWS user that // you specified in Grantee. Permissions are granted on the thumbnail files - // that Elastic Transcoder adds to the bucket. Valid values include: READ: + // that Elastic Transcoder adds to the bucket. Valid values include: READ: // The grantee can read the thumbnails and metadata for objects that Elastic - // Transcoder adds to the Amazon S3 bucket. READ_ACP: The grantee can read - // the object ACL for thumbnails that Elastic Transcoder adds to the Amazon - // S3 bucket. WRITE_ACP: The grantee can write the ACL for the thumbnails - // that Elastic Transcoder adds to the Amazon S3 bucket. FULL_CONTROL: The - // grantee has READ, READ_ACP, and WRITE_ACP permissions for the thumbnails - // that Elastic Transcoder adds to the Amazon S3 bucket. StorageClass: The - // Amazon S3 storage class, Standard or ReducedRedundancy, that you want Elastic - // Transcoder to assign to the thumbnails that it stores in your Amazon S3 bucket. + // Transcoder adds to the Amazon S3 bucket. READ_ACP: The grantee can read the + // object ACL for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket. + // WRITE_ACP: The grantee can write the ACL for the thumbnails that Elastic + // Transcoder adds to the Amazon S3 bucket. FULL_CONTROL: The grantee has READ, + // READ_ACP, and WRITE_ACP permissions for the thumbnails that Elastic Transcoder + // adds to the Amazon S3 bucket. StorageClass: The Amazon S3 storage class, + // Standard or ReducedRedundancy, that you want Elastic Transcoder to assign + // to the thumbnails that it stores in your Amazon S3 bucket. ThumbnailConfig *PipelineOutputConfig `type:"structure"` } @@ -4439,15 +4437,15 @@ type UpdatePipelineNotificationsInput struct { // that you want to notify to report job status. // // To receive notifications, you must also subscribe to the new topic in the - // Amazon SNS console. Progressing: The topic ARN for the Amazon Simple Notification + // Amazon SNS console. Progressing: The topic ARN for the Amazon Simple Notification // Service (Amazon SNS) topic that you want to notify when Elastic Transcoder // has started to process jobs that are added to this pipeline. This is the - // ARN that Amazon SNS returned when you created the topic. Completed: The - // topic ARN for the Amazon SNS topic that you want to notify when Elastic Transcoder + // ARN that Amazon SNS returned when you created the topic. Completed: The topic + // ARN for the Amazon SNS topic that you want to notify when Elastic Transcoder // has finished processing a job. This is the ARN that Amazon SNS returned when - // you created the topic. Warning: The topic ARN for the Amazon SNS topic that + // you created the topic. Warning: The topic ARN for the Amazon SNS topic that // you want to notify when Elastic Transcoder encounters a warning condition. - // This is the ARN that Amazon SNS returned when you created the topic. Error: + // This is the ARN that Amazon SNS returned when you created the topic. Error: // The topic ARN for the Amazon SNS topic that you want to notify when Elastic // Transcoder encounters an error condition. This is the ARN that Amazon SNS // returned when you created the topic. @@ -4632,9 +4630,9 @@ type VideoParameters struct { // The H.264 profile that you want to use for the output file. Elastic Transcoder // supports the following profiles: // - // baseline: The profile most commonly used for videoconferencing and for - // mobile applications. main: The profile used for standard-definition digital - // TV broadcasts. high: The profile used for high-definition digital TV broadcasts + // baseline: The profile most commonly used for videoconferencing and for + // mobile applications. main: The profile used for standard-definition digital + // TV broadcasts. high: The profile used for high-definition digital TV broadcasts // and for Blu-ray discs. Level (H.264 Only) // // The H.264 level that you want to use for the output file. Elastic Transcoder @@ -4704,11 +4702,11 @@ type VideoParameters struct { // is null, and you are using one of the resolution changes from the list below, // Elastic Transcoder applies the following color space conversions: // - // Standard to HD, 720x480 to 1920x1080 - Elastic Transcoder applies Bt601ToBt709 - // Standard to HD, 720x576 to 1920x1080 - Elastic Transcoder applies Bt601ToBt709 - // HD to Standard, 1920x1080 to 720x480 - Elastic Transcoder applies Bt709ToBt601 - // HD to Standard, 1920x1080 to 720x576 - Elastic Transcoder applies Bt709ToBt601 - // Elastic Transcoder may change the behavior of the ColorspaceConversionMode + // Standard to HD, 720x480 to 1920x1080 - Elastic Transcoder applies Bt601ToBt709 + // Standard to HD, 720x576 to 1920x1080 - Elastic Transcoder applies Bt601ToBt709 + // HD to Standard, 1920x1080 to 720x480 - Elastic Transcoder applies Bt709ToBt601 + // HD to Standard, 1920x1080 to 720x576 - Elastic Transcoder applies Bt709ToBt601 + // Elastic Transcoder may change the behavior of the ColorspaceConversionMode // Auto mode in the future. All outputs in a playlist must use the same ColorSpaceConversionMode. // If you do not specify a ColorSpaceConversionMode, Elastic Transcoder does // not change the color space of a file. If you are unsure what ColorSpaceConversionMode @@ -4739,9 +4737,9 @@ type VideoParameters struct { // // Whether to use a fixed value for FixedGOP. Valid values are true and false: // - // true: Elastic Transcoder uses the value of KeyframesMaxDist for the distance + // true: Elastic Transcoder uses the value of KeyframesMaxDist for the distance // between key frames (the number of frames in a group of pictures, or GOP). - // false: The distance between key frames can vary. FixedGOP must be set to + // false: The distance between key frames can vary. FixedGOP must be set to // true for fmp4 containers. FixedGOP *string `type:"string"` @@ -4759,8 +4757,8 @@ type VideoParameters struct { // // where: // - // width in pixels and height in pixels represent the Resolution of the output - // video. maximum recommended decoding speed in Luma samples/second is less + // width in pixels and height in pixels represent the Resolution of the output + // video. maximum recommended decoding speed in Luma samples/second is less // than or equal to the maximum value listed in the following table, based on // the value that you specified for Level. The maximum recommended decoding // speed in Luma samples/second for each level is described in the following @@ -4825,9 +4823,9 @@ type VideoParameters struct { // The width and height of the video in the output file, in pixels. Valid // values are auto and width x height: // - // auto: Elastic Transcoder attempts to preserve the width and height of - // the input file, subject to the following rules. width x height: The width - // and height of the output video in pixels. Note the following about specifying + // auto: Elastic Transcoder attempts to preserve the width and height of the + // input file, subject to the following rules. width x height: The width and + // height of the output video in pixels. Note the following about specifying // the width and height: // // The width must be an even integer between 128 and 4096, inclusive. The @@ -4845,26 +4843,25 @@ type VideoParameters struct { // Specify one of the following values to control scaling of the output video: // - // Fit: Elastic Transcoder scales the output video so it matches the value + // Fit: Elastic Transcoder scales the output video so it matches the value // that you specified in either MaxWidth or MaxHeight without exceeding the - // other value. Fill: Elastic Transcoder scales the output video so it matches + // other value. Fill: Elastic Transcoder scales the output video so it matches // the value that you specified in either MaxWidth or MaxHeight and matches // or exceeds the other value. Elastic Transcoder centers the output video and - // then crops it in the dimension (if any) that exceeds the maximum value. - // Stretch: Elastic Transcoder stretches the output video to match the values - // that you specified for MaxWidth and MaxHeight. If the relative proportions - // of the input video and the output video are different, the output video will - // be distorted. Keep: Elastic Transcoder does not scale the output video. - // If either dimension of the input video exceeds the values that you specified - // for MaxWidth and MaxHeight, Elastic Transcoder crops the output video. ShrinkToFit: - // Elastic Transcoder scales the output video down so that its dimensions match - // the values that you specified for at least one of MaxWidth and MaxHeight - // without exceeding either value. If you specify this option, Elastic Transcoder - // does not scale the video up. ShrinkToFill: Elastic Transcoder scales the - // output video down so that its dimensions match the values that you specified - // for at least one of MaxWidth and MaxHeight without dropping below either - // value. If you specify this option, Elastic Transcoder does not scale the - // video up. + // then crops it in the dimension (if any) that exceeds the maximum value. Stretch: + // Elastic Transcoder stretches the output video to match the values that you + // specified for MaxWidth and MaxHeight. If the relative proportions of the + // input video and the output video are different, the output video will be + // distorted. Keep: Elastic Transcoder does not scale the output video. If either + // dimension of the input video exceeds the values that you specified for MaxWidth + // and MaxHeight, Elastic Transcoder crops the output video. ShrinkToFit: Elastic + // Transcoder scales the output video down so that its dimensions match the + // values that you specified for at least one of MaxWidth and MaxHeight without + // exceeding either value. If you specify this option, Elastic Transcoder does + // not scale the video up. ShrinkToFill: Elastic Transcoder scales the output + // video down so that its dimensions match the values that you specified for + // at least one of MaxWidth and MaxHeight without dropping below either value. + // If you specify this option, Elastic Transcoder does not scale the video up. SizingPolicy *string `type:"string"` // Settings for the size, location, and opacity of graphics that you want Elastic diff --git a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/examples_test.go index c9f63bca5..2b076930d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/examples_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/examples_test.go @@ -16,7 +16,13 @@ var _ time.Duration var _ bytes.Buffer func ExampleElasticTranscoder_CancelJob() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.CancelJobInput{ Id: aws.String("Id"), // Required @@ -35,7 +41,13 @@ func ExampleElasticTranscoder_CancelJob() { } func ExampleElasticTranscoder_CreateJob() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.CreateJobInput{ Input: &elastictranscoder.JobInput{ // Required @@ -56,7 +68,7 @@ func ExampleElasticTranscoder_CreateJob() { }, FrameRate: aws.String("FrameRate"), Interlaced: aws.String("Interlaced"), - Key: aws.String("Key"), + Key: aws.String("LongKey"), Resolution: aws.String("Resolution"), }, PipelineId: aws.String("Id"), // Required @@ -103,7 +115,7 @@ func ExampleElasticTranscoder_CreateJob() { KeyMd5: aws.String("Base64EncodedString"), Mode: aws.String("EncryptionMode"), }, - Key: aws.String("Key"), + Key: aws.String("LongKey"), Label: aws.String("Name"), Language: aws.String("Key"), TimeOffset: aws.String("TimeOffset"), @@ -197,7 +209,7 @@ func ExampleElasticTranscoder_CreateJob() { KeyMd5: aws.String("Base64EncodedString"), Mode: aws.String("EncryptionMode"), }, - Key: aws.String("Key"), + Key: aws.String("LongKey"), Label: aws.String("Name"), Language: aws.String("Key"), TimeOffset: aws.String("TimeOffset"), @@ -294,7 +306,13 @@ func ExampleElasticTranscoder_CreateJob() { } func ExampleElasticTranscoder_CreatePipeline() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.CreatePipelineInput{ InputBucket: aws.String("BucketName"), // Required @@ -353,7 +371,13 @@ func ExampleElasticTranscoder_CreatePipeline() { } func ExampleElasticTranscoder_CreatePreset() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.CreatePresetInput{ Container: aws.String("PresetContainer"), // Required @@ -431,7 +455,13 @@ func ExampleElasticTranscoder_CreatePreset() { } func ExampleElasticTranscoder_DeletePipeline() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.DeletePipelineInput{ Id: aws.String("Id"), // Required @@ -450,7 +480,13 @@ func ExampleElasticTranscoder_DeletePipeline() { } func ExampleElasticTranscoder_DeletePreset() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.DeletePresetInput{ Id: aws.String("Id"), // Required @@ -469,7 +505,13 @@ func ExampleElasticTranscoder_DeletePreset() { } func ExampleElasticTranscoder_ListJobsByPipeline() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.ListJobsByPipelineInput{ PipelineId: aws.String("Id"), // Required @@ -490,7 +532,13 @@ func ExampleElasticTranscoder_ListJobsByPipeline() { } func ExampleElasticTranscoder_ListJobsByStatus() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.ListJobsByStatusInput{ Status: aws.String("JobStatus"), // Required @@ -511,7 +559,13 @@ func ExampleElasticTranscoder_ListJobsByStatus() { } func ExampleElasticTranscoder_ListPipelines() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.ListPipelinesInput{ Ascending: aws.String("Ascending"), @@ -531,7 +585,13 @@ func ExampleElasticTranscoder_ListPipelines() { } func ExampleElasticTranscoder_ListPresets() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.ListPresetsInput{ Ascending: aws.String("Ascending"), @@ -551,7 +611,13 @@ func ExampleElasticTranscoder_ListPresets() { } func ExampleElasticTranscoder_ReadJob() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.ReadJobInput{ Id: aws.String("Id"), // Required @@ -570,7 +636,13 @@ func ExampleElasticTranscoder_ReadJob() { } func ExampleElasticTranscoder_ReadPipeline() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.ReadPipelineInput{ Id: aws.String("Id"), // Required @@ -589,7 +661,13 @@ func ExampleElasticTranscoder_ReadPipeline() { } func ExampleElasticTranscoder_ReadPreset() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.ReadPresetInput{ Id: aws.String("Id"), // Required @@ -608,7 +686,13 @@ func ExampleElasticTranscoder_ReadPreset() { } func ExampleElasticTranscoder_TestRole() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.TestRoleInput{ InputBucket: aws.String("BucketName"), // Required @@ -633,7 +717,13 @@ func ExampleElasticTranscoder_TestRole() { } func ExampleElasticTranscoder_UpdatePipeline() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.UpdatePipelineInput{ Id: aws.String("Id"), // Required @@ -692,7 +782,13 @@ func ExampleElasticTranscoder_UpdatePipeline() { } func ExampleElasticTranscoder_UpdatePipelineNotifications() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.UpdatePipelineNotificationsInput{ Id: aws.String("Id"), // Required @@ -717,7 +813,13 @@ func ExampleElasticTranscoder_UpdatePipelineNotifications() { } func ExampleElasticTranscoder_UpdatePipelineStatus() { - svc := elastictranscoder.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elastictranscoder.New(sess) params := &elastictranscoder.UpdatePipelineStatusInput{ Id: aws.String("Id"), // Required diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/api.go b/vendor/github.com/aws/aws-sdk-go/service/elb/api.go index 46c912729..7c0f327d8 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elb/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/api.go @@ -58,8 +58,8 @@ func (c *ELB) AddTagsRequest(input *AddTagsInput) (req *request.Request, output // Each tag consists of a key and an optional value. If a tag with the same // key is already associated with the load balancer, AddTags updates its value. // -// For more information, see Tag Your Load Balancer (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/add-remove-tags.html) -// in the Elastic Load Balancing Developer Guide. +// For more information, see Tag Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/add-remove-tags.html) +// in the Classic Load Balancers Guide. func (c *ELB) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { req, out := c.AddTagsRequest(input) err := req.Send() @@ -111,8 +111,8 @@ func (c *ELB) ApplySecurityGroupsToLoadBalancerRequest(input *ApplySecurityGroup // private cloud (VPC). The specified security groups override the previously // associated security groups. // -// For more information, see Security Groups for Load Balancers in a VPC (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-security-groups.html#elb-vpc-security-groups) -// in the Elastic Load Balancing Developer Guide. +// For more information, see Security Groups for Load Balancers in a VPC (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-groups.html#elb-vpc-security-groups) +// in the Classic Load Balancers Guide. func (c *ELB) ApplySecurityGroupsToLoadBalancer(input *ApplySecurityGroupsToLoadBalancerInput) (*ApplySecurityGroupsToLoadBalancerOutput, error) { req, out := c.ApplySecurityGroupsToLoadBalancerRequest(input) err := req.Send() @@ -165,8 +165,8 @@ func (c *ELB) AttachLoadBalancerToSubnetsRequest(input *AttachLoadBalancerToSubn // // The load balancer evenly distributes requests across all registered subnets. // For more information, see Add or Remove Subnets for Your Load Balancer in -// a VPC (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-manage-subnets.html) -// in the Elastic Load Balancing Developer Guide. +// a VPC (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-manage-subnets.html) +// in the Classic Load Balancers Guide. func (c *ELB) AttachLoadBalancerToSubnets(input *AttachLoadBalancerToSubnetsInput) (*AttachLoadBalancerToSubnetsOutput, error) { req, out := c.AttachLoadBalancerToSubnetsRequest(input) err := req.Send() @@ -215,10 +215,11 @@ func (c *ELB) ConfigureHealthCheckRequest(input *ConfigureHealthCheckInput) (req } // Specifies the health check settings to use when evaluating the health state -// of your back-end instances. +// of your EC2 instances. // -// For more information, see Configure Health Checks (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-healthchecks.html) -// in the Elastic Load Balancing Developer Guide. +// For more information, see Configure Health Checks for Your Load Balancer +// (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-healthchecks.html) +// in the Classic Load Balancers Guide. func (c *ELB) ConfigureHealthCheck(input *ConfigureHealthCheckInput) (*ConfigureHealthCheckOutput, error) { req, out := c.ConfigureHealthCheckRequest(input) err := req.Send() @@ -279,8 +280,8 @@ func (c *ELB) CreateAppCookieStickinessPolicyRequest(input *CreateAppCookieStick // If the application cookie is explicitly removed or expires, the session // stops being sticky until a new application cookie is issued. // -// For more information, see Application-Controlled Session Stickiness (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-sticky-sessions.html#enable-sticky-sessions-application) -// in the Elastic Load Balancing Developer Guide. +// For more information, see Application-Controlled Session Stickiness (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-application) +// in the Classic Load Balancers Guide. func (c *ELB) CreateAppCookieStickinessPolicy(input *CreateAppCookieStickinessPolicyInput) (*CreateAppCookieStickinessPolicyOutput, error) { req, out := c.CreateAppCookieStickinessPolicyRequest(input) err := req.Send() @@ -333,18 +334,18 @@ func (c *ELB) CreateLBCookieStickinessPolicyRequest(input *CreateLBCookieStickin // This policy can be associated only with HTTP/HTTPS listeners. // // When a load balancer implements this policy, the load balancer uses a special -// cookie to track the back-end server instance for each request. When the load -// balancer receives a request, it first checks to see if this cookie is present -// in the request. If so, the load balancer sends the request to the application -// server specified in the cookie. If not, the load balancer sends the request -// to a server that is chosen based on the existing load-balancing algorithm. +// cookie to track the instance for each request. When the load balancer receives +// a request, it first checks to see if this cookie is present in the request. +// If so, the load balancer sends the request to the application server specified +// in the cookie. If not, the load balancer sends the request to a server that +// is chosen based on the existing load-balancing algorithm. // // A cookie is inserted into the response for binding subsequent requests from // the same user to that server. The validity of the cookie is based on the // cookie expiration time, which is specified in the policy configuration. // -// For more information, see Duration-Based Session Stickiness (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-sticky-sessions.html#enable-sticky-sessions-duration) -// in the Elastic Load Balancing Developer Guide. +// For more information, see Duration-Based Session Stickiness (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-duration) +// in the Classic Load Balancers Guide. func (c *ELB) CreateLBCookieStickinessPolicy(input *CreateLBCookieStickinessPolicyInput) (*CreateLBCookieStickinessPolicyOutput, error) { req, out := c.CreateLBCookieStickinessPolicyRequest(input) err := req.Send() @@ -392,18 +393,19 @@ func (c *ELB) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) (req *re return } -// Creates a load balancer. +// Creates a Classic load balancer. // -// If the call completes successfully, a new load balancer is created with -// a unique Domain Name Service (DNS) name. The load balancer receives incoming -// traffic and routes it to the registered instances. For more information, -// see How Elastic Load Balancing Works (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/how-elb-works.html) -// in the Elastic Load Balancing Developer Guide. +// You can add listeners, security groups, subnets, and tags when you create +// your load balancer, or you can add them later using CreateLoadBalancerListeners, +// ApplySecurityGroupsToLoadBalancer, AttachLoadBalancerToSubnets, and AddTags. +// +// To describe your current load balancers, see DescribeLoadBalancers. When +// you are finished with a load balancer, you can delete it using DeleteLoadBalancer. // // You can create up to 20 load balancers per region per account. You can request // an increase for the number of load balancers for your account. For more information, -// see Elastic Load Balancing Limits (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-limits.html) -// in the Elastic Load Balancing Developer Guide. +// see Limits for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-limits.html) +// in the Classic Load Balancers Guide. func (c *ELB) CreateLoadBalancer(input *CreateLoadBalancerInput) (*CreateLoadBalancerOutput, error) { req, out := c.CreateLoadBalancerRequest(input) err := req.Send() @@ -456,8 +458,8 @@ func (c *ELB) CreateLoadBalancerListenersRequest(input *CreateLoadBalancerListen // the properties of the new listener must match the properties of the existing // listener. // -// For more information, see Add a Listener to Your Load Balancer (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/us-add-listener.html) -// in the Elastic Load Balancing Developer Guide. +// For more information, see Listeners for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) +// in the Classic Load Balancers Guide. func (c *ELB) CreateLoadBalancerListeners(input *CreateLoadBalancerListenersInput) (*CreateLoadBalancerListenersOutput, error) { req, out := c.CreateLoadBalancerListenersRequest(input) err := req.Send() @@ -508,8 +510,8 @@ func (c *ELB) CreateLoadBalancerPolicyRequest(input *CreateLoadBalancerPolicyInp // Creates a policy with the specified attributes for the specified load balancer. // // Policies are settings that are saved for your load balancer and that can -// be applied to the front-end listener or the back-end application server, -// depending on the policy type. +// be applied to the listener or the application server, depending on the policy +// type. func (c *ELB) CreateLoadBalancerPolicy(input *CreateLoadBalancerPolicyInput) (*CreateLoadBalancerPolicyOutput, error) { req, out := c.CreateLoadBalancerPolicyRequest(input) err := req.Send() @@ -563,7 +565,7 @@ func (c *ELB) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) (req *re // all settings. The DNS name associated with a deleted load balancer are no // longer usable. The name and associated DNS record of the deleted load balancer // no longer exist and traffic sent to any of its IP addresses is no longer -// delivered to back-end instances. +// delivered to your instances. // // If the load balancer does not exist or has already been deleted, the call // to DeleteLoadBalancer still succeeds. @@ -718,8 +720,8 @@ func (c *ELB) DeregisterInstancesFromLoadBalancerRequest(input *DeregisterInstan // You can use DescribeLoadBalancers to verify that the instance is deregistered // from the load balancer. // -// For more information, see Deregister and Register Amazon EC2 Instances (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/US_DeReg_Reg_Instances.html) -// in the Elastic Load Balancing Developer Guide. +// For more information, see Register or De-Register EC2 Instances (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-deregister-register-instances.html) +// in the Classic Load Balancers Guide. func (c *ELB) DeregisterInstancesFromLoadBalancer(input *DeregisterInstancesFromLoadBalancerInput) (*DeregisterInstancesFromLoadBalancerOutput, error) { req, out := c.DeregisterInstancesFromLoadBalancerRequest(input) err := req.Send() @@ -923,10 +925,18 @@ func (c *ELB) DescribeLoadBalancerPolicyTypesRequest(input *DescribeLoadBalancer return } -// Describes the specified load balancer policy types. +// Describes the specified load balancer policy types or all load balancer policy +// types. +// +// The description of each type indicates how it can be used. For example, +// some policies can be used only with layer 7 listeners, some policies can +// be used only with layer 4 listeners, and some policies can be used only with +// your EC2 instances. // -// You can use these policy types with CreateLoadBalancerPolicy to create policy -// configurations for a load balancer. +// You can use CreateLoadBalancerPolicy to create a policy configuration for +// any of these policy types. Then, depending on the policy type, use either +// SetLoadBalancerPoliciesOfListener or SetLoadBalancerPoliciesForBackendServer +// to set the policy. func (c *ELB) DescribeLoadBalancerPolicyTypes(input *DescribeLoadBalancerPolicyTypesInput) (*DescribeLoadBalancerPolicyTypesOutput, error) { req, out := c.DescribeLoadBalancerPolicyTypesRequest(input) err := req.Send() @@ -1164,9 +1174,8 @@ func (c *ELB) DisableAvailabilityZonesForLoadBalancerRequest(input *DisableAvail // the OutOfService state. Then, the load balancer attempts to equally balance // the traffic among its remaining Availability Zones. // -// For more information, see Disable an Availability Zone from a Load-Balanced -// Application (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/US_ShrinkLBApp04.html) -// in the Elastic Load Balancing Developer Guide. +// For more information, see Add or Remove Availability Zones (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-az.html) +// in the Classic Load Balancers Guide. func (c *ELB) DisableAvailabilityZonesForLoadBalancer(input *DisableAvailabilityZonesForLoadBalancerInput) (*DisableAvailabilityZonesForLoadBalancerOutput, error) { req, out := c.DisableAvailabilityZonesForLoadBalancerRequest(input) err := req.Send() @@ -1220,8 +1229,8 @@ func (c *ELB) EnableAvailabilityZonesForLoadBalancerRequest(input *EnableAvailab // The load balancer evenly distributes requests across all its registered // Availability Zones that contain instances. // -// For more information, see Add Availability Zone (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/US_AddLBAvailabilityZone.html) -// in the Elastic Load Balancing Developer Guide. +// For more information, see Add or Remove Availability Zones (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-az.html) +// in the Classic Load Balancers Guide. func (c *ELB) EnableAvailabilityZonesForLoadBalancer(input *EnableAvailabilityZonesForLoadBalancerInput) (*EnableAvailabilityZonesForLoadBalancerOutput, error) { req, out := c.EnableAvailabilityZonesForLoadBalancerRequest(input) err := req.Send() @@ -1276,13 +1285,15 @@ func (c *ELB) ModifyLoadBalancerAttributesRequest(input *ModifyLoadBalancerAttri // can modify the load balancer attribute ConnectionSettings by specifying an // idle connection timeout value for your load balancer. // -// For more information, see the following in the Elastic Load Balancing Developer -// Guide: +// For more information, see the following in the Classic Load Balancers Guide: +// +// Cross-Zone Load Balancing (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html) +// +// Connection Draining (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html) +// +// Access Logs (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/access-log-collection.html) // -// Cross-Zone Load Balancing (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#request-routing) -// Connection Draining (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#conn-drain) -// Access Logs (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/access-log-collection.html) -// Idle Connection Timeout (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#idle-timeout) +// Idle Connection Timeout (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html) func (c *ELB) ModifyLoadBalancerAttributes(input *ModifyLoadBalancerAttributesInput) (*ModifyLoadBalancerAttributesOutput, error) { req, out := c.ModifyLoadBalancerAttributesRequest(input) err := req.Send() @@ -1349,15 +1360,10 @@ func (c *ELB) RegisterInstancesWithLoadBalancerRequest(input *RegisterInstancesW // If an Availability Zone is added to the load balancer later, any instances // registered with the load balancer move to the InService state. // -// If you stop an instance registered with a load balancer and then start it, -// the IP addresses associated with the instance changes. Elastic Load Balancing -// cannot recognize the new IP address, which prevents it from routing traffic -// to the instances. We recommend that you use the following sequence: stop -// the instance, deregister the instance, start the instance, and then register -// the instance. To deregister instances from a load balancer, use DeregisterInstancesFromLoadBalancer. +// To deregister instances from a load balancer, use DeregisterInstancesFromLoadBalancer. // -// For more information, see Deregister and Register EC2 Instances (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/US_DeReg_Reg_Instances.html) -// in the Elastic Load Balancing Developer Guide. +// For more information, see Register or De-Register EC2 Instances (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-deregister-register-instances.html) +// in the Classic Load Balancers Guide. func (c *ELB) RegisterInstancesWithLoadBalancer(input *RegisterInstancesWithLoadBalancerInput) (*RegisterInstancesWithLoadBalancerOutput, error) { req, out := c.RegisterInstancesWithLoadBalancerRequest(input) err := req.Send() @@ -1457,9 +1463,9 @@ func (c *ELB) SetLoadBalancerListenerSSLCertificateRequest(input *SetLoadBalance // The specified certificate replaces any prior certificate that was used on // the same load balancer and port. // -// For more information about updating your SSL certificate, see Updating an -// SSL Certificate for a Load Balancer (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/US_UpdatingLoadBalancerSSL.html) -// in the Elastic Load Balancing Developer Guide. +// For more information about updating your SSL certificate, see Replace the +// SSL Certificate for Your Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-update-ssl-cert.html) +// in the Classic Load Balancers Guide. func (c *ELB) SetLoadBalancerListenerSSLCertificate(input *SetLoadBalancerListenerSSLCertificateInput) (*SetLoadBalancerListenerSSLCertificateOutput, error) { req, out := c.SetLoadBalancerListenerSSLCertificateRequest(input) err := req.Send() @@ -1508,16 +1514,22 @@ func (c *ELB) SetLoadBalancerPoliciesForBackendServerRequest(input *SetLoadBalan } // Replaces the set of policies associated with the specified port on which -// the back-end server is listening with a new set of policies. At this time, -// only the back-end server authentication policy type can be applied to the -// back-end ports; this policy type is composed of multiple public key policies. +// the EC2 instance is listening with a new set of policies. At this time, only +// the back-end server authentication policy type can be applied to the instance +// ports; this policy type is composed of multiple public key policies. // // Each time you use SetLoadBalancerPoliciesForBackendServer to enable the // policies, use the PolicyNames parameter to list the policies that you want // to enable. // // You can use DescribeLoadBalancers or DescribeLoadBalancerPolicies to verify -// that the policy is associated with the back-end server. +// that the policy is associated with the EC2 instance. +// +// For more information about enabling back-end instance authentication, see +// Configure Back-end Instance Authentication (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-create-https-ssl-load-balancer.html#configure_backendauth_clt) +// in the Classic Load Balancers Guide. For more information about Proxy Protocol, +// see Configure Proxy Protocol Support (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-proxy-protocol.html) +// in the Classic Load Balancers Guide. func (c *ELB) SetLoadBalancerPoliciesForBackendServer(input *SetLoadBalancerPoliciesForBackendServerInput) (*SetLoadBalancerPoliciesForBackendServerOutput, error) { req, out := c.SetLoadBalancerPoliciesForBackendServerRequest(input) err := req.Send() @@ -1565,8 +1577,16 @@ func (c *ELB) SetLoadBalancerPoliciesOfListenerRequest(input *SetLoadBalancerPol return } -// Associates, updates, or disables a policy with a listener for the specified -// load balancer. You can associate multiple policies with a listener. +// Replaces the current set of policies for the specified load balancer port +// with the specified set of policies. +// +// To enable back-end server authentication, use SetLoadBalancerPoliciesForBackendServer. +// +// For more information about setting policies, see Update the SSL Negotiation +// Configuration (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/ssl-config-update.html), +// Duration-Based Session Stickiness (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-duration), +// and Application-Controlled Session Stickiness (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-application) +// in the Classic Load Balancers Guide. func (c *ELB) SetLoadBalancerPoliciesOfListener(input *SetLoadBalancerPoliciesOfListenerInput) (*SetLoadBalancerPoliciesOfListenerOutput, error) { req, out := c.SetLoadBalancerPoliciesOfListenerRequest(input) err := req.Send() @@ -1583,7 +1603,7 @@ type AccessLog struct { // Default: 60 minutes EmitInterval *int64 `type:"integer"` - // Specifies whether access log is enabled for the load balancer. + // Specifies whether access logs are enabled for the load balancer. Enabled *bool `type:"boolean" required:"true"` // The name of the Amazon S3 bucket where the access logs are stored. @@ -1618,6 +1638,7 @@ func (s *AccessLog) Validate() error { return nil } +// Contains the parameters for AddTags. type AddTagsInput struct { _ struct{} `type:"structure"` @@ -1667,6 +1688,7 @@ func (s *AddTagsInput) Validate() error { return nil } +// Contains the output of AddTags. type AddTagsOutput struct { _ struct{} `type:"structure"` } @@ -1724,6 +1746,7 @@ func (s AppCookieStickinessPolicy) GoString() string { return s.String() } +// Contains the parameters for ApplySecurityGroupsToLoadBalancer. type ApplySecurityGroupsToLoadBalancerInput struct { _ struct{} `type:"structure"` @@ -1761,6 +1784,7 @@ func (s *ApplySecurityGroupsToLoadBalancerInput) Validate() error { return nil } +// Contains the output of ApplySecurityGroupsToLoadBalancer. type ApplySecurityGroupsToLoadBalancerOutput struct { _ struct{} `type:"structure"` @@ -1778,14 +1802,15 @@ func (s ApplySecurityGroupsToLoadBalancerOutput) GoString() string { return s.String() } +// Contains the parameters for AttachLoaBalancerToSubnets. type AttachLoadBalancerToSubnetsInput struct { _ struct{} `type:"structure"` // The name of the load balancer. LoadBalancerName *string `type:"string" required:"true"` - // The IDs of the subnets to add for the load balancer. You can add only one - // subnet per Availability Zone. + // The IDs of the subnets to add. You can add only one subnet per Availability + // Zone. Subnets []*string `type:"list" required:"true"` } @@ -1815,6 +1840,7 @@ func (s *AttachLoadBalancerToSubnetsInput) Validate() error { return nil } +// Contains the output of AttachLoadBalancerToSubnets. type AttachLoadBalancerToSubnetsOutput struct { _ struct{} `type:"structure"` @@ -1832,14 +1858,14 @@ func (s AttachLoadBalancerToSubnetsOutput) GoString() string { return s.String() } -// Information about the configuration of a back-end server. +// Information about the configuration of an EC2 instance. type BackendServerDescription struct { _ struct{} `type:"structure"` - // The port on which the back-end server is listening. + // The port on which the EC2 instance is listening. InstancePort *int64 `min:"1" type:"integer"` - // The names of the policies enabled for the back-end server. + // The names of the policies enabled for the EC2 instance. PolicyNames []*string `type:"list"` } @@ -1853,10 +1879,11 @@ func (s BackendServerDescription) GoString() string { return s.String() } +// Contains the parameters for ConfigureHealthCheck. type ConfigureHealthCheckInput struct { _ struct{} `type:"structure"` - // The configuration information for the new health check. + // The configuration information. HealthCheck *HealthCheck `type:"structure" required:"true"` // The name of the load balancer. @@ -1894,6 +1921,7 @@ func (s *ConfigureHealthCheckInput) Validate() error { return nil } +// Contains the output of ConfigureHealthCheck. type ConfigureHealthCheckOutput struct { _ struct{} `type:"structure"` @@ -1981,6 +2009,7 @@ func (s *ConnectionSettings) Validate() error { return nil } +// Contains the parameters for CreateAppCookieStickinessPolicy. type CreateAppCookieStickinessPolicyInput struct { _ struct{} `type:"structure"` @@ -2025,6 +2054,7 @@ func (s *CreateAppCookieStickinessPolicyInput) Validate() error { return nil } +// Contains the output for CreateAppCookieStickinessPolicy. type CreateAppCookieStickinessPolicyOutput struct { _ struct{} `type:"structure"` } @@ -2039,12 +2069,14 @@ func (s CreateAppCookieStickinessPolicyOutput) GoString() string { return s.String() } +// Contains the parameters for CreateLBCookieStickinessPolicy. type CreateLBCookieStickinessPolicyInput struct { _ struct{} `type:"structure"` // The time period, in seconds, after which the cookie should be considered - // stale. If you do not specify this parameter, the sticky session lasts for - // the duration of the browser session. + // stale. If you do not specify this parameter, the default value is 0, which + // indicates that the sticky session should last for the duration of the browser + // session. CookieExpirationPeriod *int64 `type:"long"` // The name of the load balancer. @@ -2082,6 +2114,7 @@ func (s *CreateLBCookieStickinessPolicyInput) Validate() error { return nil } +// Contains the output for CreateLBCookieStickinessPolicy. type CreateLBCookieStickinessPolicyOutput struct { _ struct{} `type:"structure"` } @@ -2096,11 +2129,11 @@ func (s CreateLBCookieStickinessPolicyOutput) GoString() string { return s.String() } +// Contains the parameters for CreateLoadBalancer. type CreateLoadBalancerInput struct { _ struct{} `type:"structure"` // One or more Availability Zones from the same region as the load balancer. - // Traffic is equally distributed across all specified Availability Zones. // // You must specify at least one Availability Zone. // @@ -2110,8 +2143,8 @@ type CreateLoadBalancerInput struct { // The listeners. // - // For more information, see Listeners for Your Load Balancer (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-listener-config.html) - // in the Elastic Load Balancing Developer Guide. + // For more information, see Listeners for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) + // in the Classic Load Balancers Guide. Listeners []*Listener `type:"list" required:"true"` // The name of the load balancer. @@ -2124,13 +2157,13 @@ type CreateLoadBalancerInput struct { // The type of a load balancer. Valid only for load balancers in a VPC. // // By default, Elastic Load Balancing creates an Internet-facing load balancer - // with a publicly resolvable DNS name, which resolves to public IP addresses. - // For more information about Internet-facing and Internal load balancers, see - // Internet-facing and Internal Load Balancers (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/vpc-loadbalancer-types.html) - // in the Elastic Load Balancing Developer Guide. + // with a DNS name that resolves to public IP addresses. For more information + // about Internet-facing and Internal load balancers, see Load Balancer Scheme + // (http://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/how-elastic-load-balancing-works.html#load-balancer-scheme) + // in the Elastic Load Balancing User Guide. // - // Specify internal to create an internal load balancer with a DNS name that - // resolves to private IP addresses. + // Specify internal to create a load balancer with a DNS name that resolves + // to private IP addresses. Scheme *string `type:"string"` // The IDs of the security groups to assign to the load balancer. @@ -2142,8 +2175,9 @@ type CreateLoadBalancerInput struct { // A list of tags to assign to the load balancer. // - // For more information about tagging your load balancer, see Tagging (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#tagging-elb) - // in the Elastic Load Balancing Developer Guide. + // For more information about tagging your load balancer, see Tag Your Classic + // Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/add-remove-tags.html) + // in the Classic Load Balancers Guide. Tags []*Tag `min:"1" type:"list"` } @@ -2196,6 +2230,7 @@ func (s *CreateLoadBalancerInput) Validate() error { return nil } +// Contains the parameters for CreateLoadBalancerListeners. type CreateLoadBalancerListenersInput struct { _ struct{} `type:"structure"` @@ -2242,6 +2277,7 @@ func (s *CreateLoadBalancerListenersInput) Validate() error { return nil } +// Contains the parameters for CreateLoadBalancerListener. type CreateLoadBalancerListenersOutput struct { _ struct{} `type:"structure"` } @@ -2256,6 +2292,7 @@ func (s CreateLoadBalancerListenersOutput) GoString() string { return s.String() } +// Contains the output for CreateLoadBalancer. type CreateLoadBalancerOutput struct { _ struct{} `type:"structure"` @@ -2273,13 +2310,14 @@ func (s CreateLoadBalancerOutput) GoString() string { return s.String() } +// Contains the parameters for CreateLoadBalancerPolicy. type CreateLoadBalancerPolicyInput struct { _ struct{} `type:"structure"` // The name of the load balancer. LoadBalancerName *string `type:"string" required:"true"` - // The attributes for the policy. + // The policy attributes. PolicyAttributes []*PolicyAttribute `type:"list"` // The name of the load balancer policy to be created. This name must be unique @@ -2319,6 +2357,7 @@ func (s *CreateLoadBalancerPolicyInput) Validate() error { return nil } +// Contains the output of CreateLoadBalancerPolicy. type CreateLoadBalancerPolicyOutput struct { _ struct{} `type:"structure"` } @@ -2364,6 +2403,7 @@ func (s *CrossZoneLoadBalancing) Validate() error { return nil } +// Contains the parameters for DeleteLoadBalancer. type DeleteLoadBalancerInput struct { _ struct{} `type:"structure"` @@ -2394,6 +2434,7 @@ func (s *DeleteLoadBalancerInput) Validate() error { return nil } +// Contains the parameters for DeleteLoadBalancerListeners. type DeleteLoadBalancerListenersInput struct { _ struct{} `type:"structure"` @@ -2430,6 +2471,7 @@ func (s *DeleteLoadBalancerListenersInput) Validate() error { return nil } +// Contains the output of DeleteLoadBalancerListeners. type DeleteLoadBalancerListenersOutput struct { _ struct{} `type:"structure"` } @@ -2444,6 +2486,7 @@ func (s DeleteLoadBalancerListenersOutput) GoString() string { return s.String() } +// Contains the output of DeleteLoadBalancer. type DeleteLoadBalancerOutput struct { _ struct{} `type:"structure"` } @@ -2458,7 +2501,7 @@ func (s DeleteLoadBalancerOutput) GoString() string { return s.String() } -// = +// Contains the parameters for DeleteLoadBalancerPolicy. type DeleteLoadBalancerPolicyInput struct { _ struct{} `type:"structure"` @@ -2495,6 +2538,7 @@ func (s *DeleteLoadBalancerPolicyInput) Validate() error { return nil } +// Contains the output of DeleteLoadBalancerPolicy. type DeleteLoadBalancerPolicyOutput struct { _ struct{} `type:"structure"` } @@ -2509,6 +2553,7 @@ func (s DeleteLoadBalancerPolicyOutput) GoString() string { return s.String() } +// Contains the parameters for DeregisterInstancesFromLoadBalancer. type DeregisterInstancesFromLoadBalancerInput struct { _ struct{} `type:"structure"` @@ -2545,6 +2590,7 @@ func (s *DeregisterInstancesFromLoadBalancerInput) Validate() error { return nil } +// Contains the output of DeregisterInstancesFromLoadBalancer. type DeregisterInstancesFromLoadBalancerOutput struct { _ struct{} `type:"structure"` @@ -2562,6 +2608,7 @@ func (s DeregisterInstancesFromLoadBalancerOutput) GoString() string { return s.String() } +// Contains the parameters for DescribeInstanceHealth. type DescribeInstanceHealthInput struct { _ struct{} `type:"structure"` @@ -2595,6 +2642,7 @@ func (s *DescribeInstanceHealthInput) Validate() error { return nil } +// Contains the output for DescribeInstanceHealth. type DescribeInstanceHealthOutput struct { _ struct{} `type:"structure"` @@ -2612,6 +2660,7 @@ func (s DescribeInstanceHealthOutput) GoString() string { return s.String() } +// Contains the parameters for DescribeLoadBalancerAttributes. type DescribeLoadBalancerAttributesInput struct { _ struct{} `type:"structure"` @@ -2642,6 +2691,7 @@ func (s *DescribeLoadBalancerAttributesInput) Validate() error { return nil } +// Contains the output of DescribeLoadBalancerAttributes. type DescribeLoadBalancerAttributesOutput struct { _ struct{} `type:"structure"` @@ -2659,6 +2709,7 @@ func (s DescribeLoadBalancerAttributesOutput) GoString() string { return s.String() } +// Contains the parameters for DescribeLoadBalancerPolicies. type DescribeLoadBalancerPoliciesInput struct { _ struct{} `type:"structure"` @@ -2679,6 +2730,7 @@ func (s DescribeLoadBalancerPoliciesInput) GoString() string { return s.String() } +// Contains the output of DescribeLoadBalancerPolicies. type DescribeLoadBalancerPoliciesOutput struct { _ struct{} `type:"structure"` @@ -2696,6 +2748,7 @@ func (s DescribeLoadBalancerPoliciesOutput) GoString() string { return s.String() } +// Contains the parameters for DescribeLoadBalancerPolicyTypes. type DescribeLoadBalancerPolicyTypesInput struct { _ struct{} `type:"structure"` @@ -2714,6 +2767,7 @@ func (s DescribeLoadBalancerPolicyTypesInput) GoString() string { return s.String() } +// Contains the output of DescribeLoadBalancerPolicyTypes. type DescribeLoadBalancerPolicyTypesOutput struct { _ struct{} `type:"structure"` @@ -2731,6 +2785,7 @@ func (s DescribeLoadBalancerPolicyTypesOutput) GoString() string { return s.String() } +// Contains the parameters for DescribeLoadBalancers. type DescribeLoadBalancersInput struct { _ struct{} `type:"structure"` @@ -2769,6 +2824,7 @@ func (s *DescribeLoadBalancersInput) Validate() error { return nil } +// Contains the parameters for DescribeLoadBalancers. type DescribeLoadBalancersOutput struct { _ struct{} `type:"structure"` @@ -2790,6 +2846,7 @@ func (s DescribeLoadBalancersOutput) GoString() string { return s.String() } +// Contains the parameters for DescribeTags. type DescribeTagsInput struct { _ struct{} `type:"structure"` @@ -2823,6 +2880,7 @@ func (s *DescribeTagsInput) Validate() error { return nil } +// Contains the output for DescribeTags. type DescribeTagsOutput struct { _ struct{} `type:"structure"` @@ -2840,6 +2898,7 @@ func (s DescribeTagsOutput) GoString() string { return s.String() } +// Contains the parameters for DetachLoadBalancerFromSubnets. type DetachLoadBalancerFromSubnetsInput struct { _ struct{} `type:"structure"` @@ -2876,6 +2935,7 @@ func (s *DetachLoadBalancerFromSubnetsInput) Validate() error { return nil } +// Contains the output of DetachLoadBalancerFromSubnets. type DetachLoadBalancerFromSubnetsOutput struct { _ struct{} `type:"structure"` @@ -2893,6 +2953,7 @@ func (s DetachLoadBalancerFromSubnetsOutput) GoString() string { return s.String() } +// Contains the parameters for DisableAvailabilityZonesForLoadBalancer. type DisableAvailabilityZonesForLoadBalancerInput struct { _ struct{} `type:"structure"` @@ -2929,6 +2990,7 @@ func (s *DisableAvailabilityZonesForLoadBalancerInput) Validate() error { return nil } +// Contains the output for DisableAvailabilityZonesForLoadBalancer. type DisableAvailabilityZonesForLoadBalancerOutput struct { _ struct{} `type:"structure"` @@ -2946,6 +3008,7 @@ func (s DisableAvailabilityZonesForLoadBalancerOutput) GoString() string { return s.String() } +// Contains the parameters for EnableAvailabilityZonesForLoadBalancer. type EnableAvailabilityZonesForLoadBalancerInput struct { _ struct{} `type:"structure"` @@ -2982,6 +3045,7 @@ func (s *EnableAvailabilityZonesForLoadBalancerInput) Validate() error { return nil } +// Contains the output of EnableAvailabilityZonesForLoadBalancer. type EnableAvailabilityZonesForLoadBalancerOutput struct { _ struct{} `type:"structure"` @@ -3009,7 +3073,7 @@ type HealthCheck struct { // The approximate interval, in seconds, between health checks of an individual // instance. - Interval *int64 `min:"1" type:"integer" required:"true"` + Interval *int64 `min:"5" type:"integer" required:"true"` // The instance being checked. The protocol is either TCP, HTTP, HTTPS, or SSL. // The range of valid ports is one (1) through 65535. @@ -3035,7 +3099,7 @@ type HealthCheck struct { // check. // // This value must be less than the Interval value. - Timeout *int64 `min:"1" type:"integer" required:"true"` + Timeout *int64 `min:"2" type:"integer" required:"true"` // The number of consecutive health check failures required before moving the // instance to the Unhealthy state. @@ -3064,8 +3128,8 @@ func (s *HealthCheck) Validate() error { if s.Interval == nil { invalidParams.Add(request.NewErrParamRequired("Interval")) } - if s.Interval != nil && *s.Interval < 1 { - invalidParams.Add(request.NewErrParamMinValue("Interval", 1)) + if s.Interval != nil && *s.Interval < 5 { + invalidParams.Add(request.NewErrParamMinValue("Interval", 5)) } if s.Target == nil { invalidParams.Add(request.NewErrParamRequired("Target")) @@ -3073,8 +3137,8 @@ func (s *HealthCheck) Validate() error { if s.Timeout == nil { invalidParams.Add(request.NewErrParamRequired("Timeout")) } - if s.Timeout != nil && *s.Timeout < 1 { - invalidParams.Add(request.NewErrParamMinValue("Timeout", 1)) + if s.Timeout != nil && *s.Timeout < 2 { + invalidParams.Add(request.NewErrParamMinValue("Timeout", 2)) } if s.UnhealthyThreshold == nil { invalidParams.Add(request.NewErrParamRequired("UnhealthyThreshold")) @@ -3089,11 +3153,11 @@ func (s *HealthCheck) Validate() error { return nil } -// The ID of a back-end instance. +// The ID of an EC2 instance. type Instance struct { _ struct{} `type:"structure"` - // The ID of the instance. + // The instance ID. InstanceId *string `type:"string"` } @@ -3107,39 +3171,39 @@ func (s Instance) GoString() string { return s.String() } -// Information about the state of a back-end instance. +// Information about the state of an EC2 instance. type InstanceState struct { _ struct{} `type:"structure"` // A description of the instance state. This string can contain one or more // of the following messages. // - // N/A + // N/A // - // A transient error occurred. Please try again later. + // A transient error occurred. Please try again later. // - // Instance has failed at least the UnhealthyThreshold number of health checks - // consecutively. + // Instance has failed at least the UnhealthyThreshold number of health + // checks consecutively. // - // Instance has not passed the configured HealthyThreshold number of health + // Instance has not passed the configured HealthyThreshold number of health // checks consecutively. // - // Instance registration is still in progress. + // Instance registration is still in progress. // - // Instance is in the EC2 Availability Zone for which LoadBalancer is not + // Instance is in the EC2 Availability Zone for which LoadBalancer is not // configured to route traffic to. // - // Instance is not currently registered with the LoadBalancer. + // Instance is not currently registered with the LoadBalancer. // - // Instance deregistration currently in progress. + // Instance deregistration currently in progress. // - // Disable Availability Zone is currently in progress. + // Disable Availability Zone is currently in progress. // - // Instance is in pending state. + // Instance is in pending state. // - // Instance is in stopped state. + // Instance is in stopped state. // - // Instance is in terminated state. + // Instance is in terminated state. Description *string `type:"string"` // The ID of the instance. @@ -3176,8 +3240,8 @@ type LBCookieStickinessPolicy struct { // the duration of the browser session. CookieExpirationPeriod *int64 `type:"long"` - // The name for the policy being created. The name must be unique within the - // set of policies for this load balancer. + // The name of the policy. This name must be unique within the set of policies + // for this load balancer. PolicyName *string `type:"string"` } @@ -3194,16 +3258,16 @@ func (s LBCookieStickinessPolicy) GoString() string { // Information about a listener. // // For information about the protocols and the ports supported by Elastic Load -// Balancing, see Listener Configurations for Elastic Load Balancing (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-listener-config.html) -// in the Elastic Load Balancing Developer Guide. +// Balancing, see Listeners for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) +// in the Classic Load Balancers Guide. type Listener struct { _ struct{} `type:"structure"` // The port on which the instance is listening. InstancePort *int64 `min:"1" type:"integer" required:"true"` - // The protocol to use for routing traffic to back-end instances: HTTP, HTTPS, - // TCP, or SSL. + // The protocol to use for routing traffic to instances: HTTP, HTTPS, TCP, or + // SSL. // // If the front-end protocol is HTTP, HTTPS, TCP, or SSL, InstanceProtocol // must be at the same protocol. @@ -3267,8 +3331,8 @@ type ListenerDescription struct { // Information about a listener. // // For information about the protocols and the ports supported by Elastic Load - // Balancing, see Listener Configurations for Elastic Load Balancing (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-listener-config.html) - // in the Elastic Load Balancing Developer Guide. + // Balancing, see Listeners for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) + // in the Classic Load Balancers Guide. Listener *Listener `type:"structure"` // The policies. If there are no policies enabled, the list is empty. @@ -3292,19 +3356,18 @@ type LoadBalancerAttributes struct { // If enabled, the load balancer captures detailed information of all requests // and delivers the information to the Amazon S3 bucket that you specify. // - // For more information, see Enable Access Logs (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-access-logs.html) - // in the Elastic Load Balancing Developer Guide. + // For more information, see Enable Access Logs (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-access-logs.html) + // in the Classic Load Balancers Guide. AccessLog *AccessLog `type:"structure"` // This parameter is reserved. AdditionalAttributes []*AdditionalAttribute `type:"list"` // If enabled, the load balancer allows existing requests to complete before - // the load balancer shifts traffic away from a deregistered or unhealthy back-end - // instance. + // the load balancer shifts traffic away from a deregistered or unhealthy instance. // - // For more information, see Enable Connection Draining (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-conn-drain.html) - // in the Elastic Load Balancing Developer Guide. + // For more information, see Configure Connection Draining (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html) + // in the Classic Load Balancers Guide. ConnectionDraining *ConnectionDraining `type:"structure"` // If enabled, the load balancer allows the connections to remain idle (no data @@ -3312,15 +3375,15 @@ type LoadBalancerAttributes struct { // // By default, Elastic Load Balancing maintains a 60-second idle connection // timeout for both front-end and back-end connections of your load balancer. - // For more information, see Configure Idle Connection Timeout (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/config-idle-timeout.html) - // in the Elastic Load Balancing Developer Guide. + // For more information, see Configure Idle Connection Timeout (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html) + // in the Classic Load Balancers Guide. ConnectionSettings *ConnectionSettings `type:"structure"` // If enabled, the load balancer routes the request traffic evenly across all - // back-end instances regardless of the Availability Zones. + // instances regardless of the Availability Zones. // - // For more information, see Enable Cross-Zone Load Balancing (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-disable-crosszone-lb.html) - // in the Elastic Load Balancing Developer Guide. + // For more information, see Configure Cross-Zone Load Balancing (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html) + // in the Classic Load Balancers Guide. CrossZoneLoadBalancing *CrossZoneLoadBalancing `type:"structure"` } @@ -3371,23 +3434,22 @@ type LoadBalancerDescription struct { // The Availability Zones for the load balancer. AvailabilityZones []*string `type:"list"` - // Information about the back-end servers. + // Information about your EC2 instances. BackendServerDescriptions []*BackendServerDescription `type:"list"` - // The Amazon Route 53 hosted zone associated with the load balancer. + // The DNS name of the load balancer. // - // For more information, see Using Domain Names With Elastic Load Balancing - // (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/using-domain-names-with-elb.html) - // in the Elastic Load Balancing Developer Guide. + // For more information, see Configure a Custom Domain Name (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/using-domain-names-with-elb.html) + // in the Classic Load Balancers Guide. CanonicalHostedZoneName *string `type:"string"` - // The ID of the Amazon Route 53 hosted zone name associated with the load balancer. + // The ID of the Amazon Route 53 hosted zone for the load balancer. CanonicalHostedZoneNameID *string `type:"string"` // The date and time the load balancer was created. CreatedTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - // The external DNS name of the load balancer. + // The DNS name of the load balancer. DNSName *string `type:"string"` // Information about the health checks conducted on the load balancer. @@ -3418,10 +3480,10 @@ type LoadBalancerDescription struct { // in a VPC. SecurityGroups []*string `type:"list"` - // The security group that you can use as part of your inbound rules for your - // load balancer's back-end application instances. To only allow traffic from - // load balancers, add a security group rule to your back end instance that - // specifies this source security group as the inbound source. + // The security group for the load balancer, which you can use as part of your + // inbound rules for your registered instances. To only allow traffic from load + // balancers, add a security group rule that specifies this source security + // group as the inbound source. SourceSecurityGroup *SourceSecurityGroup `type:"structure"` // The IDs of the subnets for the load balancer. @@ -3441,6 +3503,7 @@ func (s LoadBalancerDescription) GoString() string { return s.String() } +// Contains the parameters for ModifyLoadBalancerAttributes. type ModifyLoadBalancerAttributesInput struct { _ struct{} `type:"structure"` @@ -3482,6 +3545,7 @@ func (s *ModifyLoadBalancerAttributesInput) Validate() error { return nil } +// Contains the output of ModifyLoadBalancerAttributes. type ModifyLoadBalancerAttributesOutput struct { _ struct{} `type:"structure"` @@ -3582,9 +3646,13 @@ type PolicyAttributeTypeDescription struct { // // Valid values: // - // ONE(1) : Single value required ZERO_OR_ONE(0..1) : Up to one value can - // be supplied ZERO_OR_MORE(0..*) : Optional. Multiple values are allowed ONE_OR_MORE(1..*0) - // : Required. Multiple values are allowed + // ONE(1) : Single value required + // + // ZERO_OR_ONE(0..1) : Up to one value is allowed + // + // ZERO_OR_MORE(0..*) : Optional. Multiple values are allowed + // + // ONE_OR_MORE(1..*0) : Required. Multiple values are allowed Cardinality *string `type:"string"` // The default value of the attribute, if applicable. @@ -3653,6 +3721,7 @@ func (s PolicyTypeDescription) GoString() string { return s.String() } +// Contains the parameters for RegisterInstancesWithLoadBalancer. type RegisterInstancesWithLoadBalancerInput struct { _ struct{} `type:"structure"` @@ -3689,6 +3758,7 @@ func (s *RegisterInstancesWithLoadBalancerInput) Validate() error { return nil } +// Contains the output of RegisterInstancesWithLoadBalancer. type RegisterInstancesWithLoadBalancerOutput struct { _ struct{} `type:"structure"` @@ -3706,6 +3776,7 @@ func (s RegisterInstancesWithLoadBalancerOutput) GoString() string { return s.String() } +// Contains the parameters for RemoveTags. type RemoveTagsInput struct { _ struct{} `type:"structure"` @@ -3756,6 +3827,7 @@ func (s *RemoveTagsInput) Validate() error { return nil } +// Contains the output of RemoveTags. type RemoveTagsOutput struct { _ struct{} `type:"structure"` } @@ -3770,6 +3842,7 @@ func (s RemoveTagsOutput) GoString() string { return s.String() } +// Contains the parameters for SetLoadBalancerListenerSSLCertificate. type SetLoadBalancerListenerSSLCertificateInput struct { _ struct{} `type:"structure"` @@ -3812,6 +3885,7 @@ func (s *SetLoadBalancerListenerSSLCertificateInput) Validate() error { return nil } +// Contains the output of SetLoadBalancerListenerSSLCertificate. type SetLoadBalancerListenerSSLCertificateOutput struct { _ struct{} `type:"structure"` } @@ -3826,17 +3900,18 @@ func (s SetLoadBalancerListenerSSLCertificateOutput) GoString() string { return s.String() } +// Contains the parameters for SetLoadBalancerPoliciesForBackendServer. type SetLoadBalancerPoliciesForBackendServerInput struct { _ struct{} `type:"structure"` - // The port number associated with the back-end server. + // The port number associated with the EC2 instance. InstancePort *int64 `type:"integer" required:"true"` // The name of the load balancer. LoadBalancerName *string `type:"string" required:"true"` // The names of the policies. If the list is empty, then all current polices - // are removed from the back-end server. + // are removed from the EC2 instance. PolicyNames []*string `type:"list" required:"true"` } @@ -3869,6 +3944,7 @@ func (s *SetLoadBalancerPoliciesForBackendServerInput) Validate() error { return nil } +// Contains the output of SetLoadBalancerPoliciesForBackendServer. type SetLoadBalancerPoliciesForBackendServerOutput struct { _ struct{} `type:"structure"` } @@ -3883,17 +3959,19 @@ func (s SetLoadBalancerPoliciesForBackendServerOutput) GoString() string { return s.String() } +// Contains the parameters for SetLoadBalancePoliciesOfListener. type SetLoadBalancerPoliciesOfListenerInput struct { _ struct{} `type:"structure"` // The name of the load balancer. LoadBalancerName *string `type:"string" required:"true"` - // The external port of the load balancer for the policy. + // The external port of the load balancer. LoadBalancerPort *int64 `type:"integer" required:"true"` - // The names of the policies. If the list is empty, the current policy is removed - // from the listener. + // The names of the policies. This list must include all policies to be enabled. + // If you omit a policy that is currently enabled, it is disabled. If the list + // is empty, all current policies are disabled. PolicyNames []*string `type:"list" required:"true"` } @@ -3926,6 +4004,7 @@ func (s *SetLoadBalancerPoliciesOfListenerInput) Validate() error { return nil } +// Contains the output of SetLoadBalancePoliciesOfListener. type SetLoadBalancerPoliciesOfListenerOutput struct { _ struct{} `type:"structure"` } diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/elb/examples_test.go index d1da802e6..a1c1421fd 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elb/examples_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/examples_test.go @@ -16,7 +16,13 @@ var _ time.Duration var _ bytes.Buffer func ExampleELB_AddTags() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.AddTagsInput{ LoadBalancerNames: []*string{ // Required @@ -45,7 +51,13 @@ func ExampleELB_AddTags() { } func ExampleELB_ApplySecurityGroupsToLoadBalancer() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.ApplySecurityGroupsToLoadBalancerInput{ LoadBalancerName: aws.String("AccessPointName"), // Required @@ -68,7 +80,13 @@ func ExampleELB_ApplySecurityGroupsToLoadBalancer() { } func ExampleELB_AttachLoadBalancerToSubnets() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.AttachLoadBalancerToSubnetsInput{ LoadBalancerName: aws.String("AccessPointName"), // Required @@ -91,7 +109,13 @@ func ExampleELB_AttachLoadBalancerToSubnets() { } func ExampleELB_ConfigureHealthCheck() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.ConfigureHealthCheckInput{ HealthCheck: &elb.HealthCheck{ // Required @@ -117,7 +141,13 @@ func ExampleELB_ConfigureHealthCheck() { } func ExampleELB_CreateAppCookieStickinessPolicy() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.CreateAppCookieStickinessPolicyInput{ CookieName: aws.String("CookieName"), // Required @@ -138,7 +168,13 @@ func ExampleELB_CreateAppCookieStickinessPolicy() { } func ExampleELB_CreateLBCookieStickinessPolicy() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.CreateLBCookieStickinessPolicyInput{ LoadBalancerName: aws.String("AccessPointName"), // Required @@ -159,7 +195,13 @@ func ExampleELB_CreateLBCookieStickinessPolicy() { } func ExampleELB_CreateLoadBalancer() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.CreateLoadBalancerInput{ Listeners: []*elb.Listener{ // Required @@ -208,7 +250,13 @@ func ExampleELB_CreateLoadBalancer() { } func ExampleELB_CreateLoadBalancerListeners() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.CreateLoadBalancerListenersInput{ Listeners: []*elb.Listener{ // Required @@ -237,7 +285,13 @@ func ExampleELB_CreateLoadBalancerListeners() { } func ExampleELB_CreateLoadBalancerPolicy() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.CreateLoadBalancerPolicyInput{ LoadBalancerName: aws.String("AccessPointName"), // Required @@ -265,7 +319,13 @@ func ExampleELB_CreateLoadBalancerPolicy() { } func ExampleELB_DeleteLoadBalancer() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.DeleteLoadBalancerInput{ LoadBalancerName: aws.String("AccessPointName"), // Required @@ -284,7 +344,13 @@ func ExampleELB_DeleteLoadBalancer() { } func ExampleELB_DeleteLoadBalancerListeners() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.DeleteLoadBalancerListenersInput{ LoadBalancerName: aws.String("AccessPointName"), // Required @@ -307,7 +373,13 @@ func ExampleELB_DeleteLoadBalancerListeners() { } func ExampleELB_DeleteLoadBalancerPolicy() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.DeleteLoadBalancerPolicyInput{ LoadBalancerName: aws.String("AccessPointName"), // Required @@ -327,7 +399,13 @@ func ExampleELB_DeleteLoadBalancerPolicy() { } func ExampleELB_DeregisterInstancesFromLoadBalancer() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.DeregisterInstancesFromLoadBalancerInput{ Instances: []*elb.Instance{ // Required @@ -352,7 +430,13 @@ func ExampleELB_DeregisterInstancesFromLoadBalancer() { } func ExampleELB_DescribeInstanceHealth() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.DescribeInstanceHealthInput{ LoadBalancerName: aws.String("AccessPointName"), // Required @@ -377,7 +461,13 @@ func ExampleELB_DescribeInstanceHealth() { } func ExampleELB_DescribeLoadBalancerAttributes() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.DescribeLoadBalancerAttributesInput{ LoadBalancerName: aws.String("AccessPointName"), // Required @@ -396,7 +486,13 @@ func ExampleELB_DescribeLoadBalancerAttributes() { } func ExampleELB_DescribeLoadBalancerPolicies() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.DescribeLoadBalancerPoliciesInput{ LoadBalancerName: aws.String("AccessPointName"), @@ -419,7 +515,13 @@ func ExampleELB_DescribeLoadBalancerPolicies() { } func ExampleELB_DescribeLoadBalancerPolicyTypes() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.DescribeLoadBalancerPolicyTypesInput{ PolicyTypeNames: []*string{ @@ -441,7 +543,13 @@ func ExampleELB_DescribeLoadBalancerPolicyTypes() { } func ExampleELB_DescribeLoadBalancers() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.DescribeLoadBalancersInput{ LoadBalancerNames: []*string{ @@ -465,7 +573,13 @@ func ExampleELB_DescribeLoadBalancers() { } func ExampleELB_DescribeTags() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.DescribeTagsInput{ LoadBalancerNames: []*string{ // Required @@ -487,7 +601,13 @@ func ExampleELB_DescribeTags() { } func ExampleELB_DetachLoadBalancerFromSubnets() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.DetachLoadBalancerFromSubnetsInput{ LoadBalancerName: aws.String("AccessPointName"), // Required @@ -510,7 +630,13 @@ func ExampleELB_DetachLoadBalancerFromSubnets() { } func ExampleELB_DisableAvailabilityZonesForLoadBalancer() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.DisableAvailabilityZonesForLoadBalancerInput{ AvailabilityZones: []*string{ // Required @@ -533,7 +659,13 @@ func ExampleELB_DisableAvailabilityZonesForLoadBalancer() { } func ExampleELB_EnableAvailabilityZonesForLoadBalancer() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.EnableAvailabilityZonesForLoadBalancerInput{ AvailabilityZones: []*string{ // Required @@ -556,7 +688,13 @@ func ExampleELB_EnableAvailabilityZonesForLoadBalancer() { } func ExampleELB_ModifyLoadBalancerAttributes() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.ModifyLoadBalancerAttributesInput{ LoadBalancerAttributes: &elb.LoadBalancerAttributes{ // Required @@ -568,8 +706,8 @@ func ExampleELB_ModifyLoadBalancerAttributes() { }, AdditionalAttributes: []*elb.AdditionalAttribute{ { // Required - Key: aws.String("StringVal"), - Value: aws.String("StringVal"), + Key: aws.String("AdditionalAttributeKey"), + Value: aws.String("AdditionalAttributeValue"), }, // More values... }, @@ -600,7 +738,13 @@ func ExampleELB_ModifyLoadBalancerAttributes() { } func ExampleELB_RegisterInstancesWithLoadBalancer() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.RegisterInstancesWithLoadBalancerInput{ Instances: []*elb.Instance{ // Required @@ -625,7 +769,13 @@ func ExampleELB_RegisterInstancesWithLoadBalancer() { } func ExampleELB_RemoveTags() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.RemoveTagsInput{ LoadBalancerNames: []*string{ // Required @@ -653,7 +803,13 @@ func ExampleELB_RemoveTags() { } func ExampleELB_SetLoadBalancerListenerSSLCertificate() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.SetLoadBalancerListenerSSLCertificateInput{ LoadBalancerName: aws.String("AccessPointName"), // Required @@ -674,7 +830,13 @@ func ExampleELB_SetLoadBalancerListenerSSLCertificate() { } func ExampleELB_SetLoadBalancerPoliciesForBackendServer() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.SetLoadBalancerPoliciesForBackendServerInput{ InstancePort: aws.Int64(1), // Required @@ -698,7 +860,13 @@ func ExampleELB_SetLoadBalancerPoliciesForBackendServer() { } func ExampleELB_SetLoadBalancerPoliciesOfListener() { - svc := elb.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := elb.New(sess) params := &elb.SetLoadBalancerPoliciesOfListenerInput{ LoadBalancerName: aws.String("AccessPointName"), // Required diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/service.go b/vendor/github.com/aws/aws-sdk-go/service/elb/service.go index 3dc5c73fb..57f3e1943 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elb/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/service.go @@ -11,15 +11,30 @@ import ( "github.com/aws/aws-sdk-go/private/protocol/query" ) -// Elastic Load Balancing distributes incoming traffic across your EC2 instances. +// A load balancer distributes incoming traffic across your EC2 instances. This +// enables you to increase the availability of your application. The load balancer +// also monitors the health of its registered instances and ensures that it +// routes traffic only to healthy instances. You configure your load balancer +// to accept incoming traffic by specifying one or more listeners, which are +// configured with a protocol and port number for connections from clients to +// the load balancer and a protocol and port number for connections from the +// load balancer to the instances. // -// For information about the features of Elastic Load Balancing, see What Is -// Elastic Load Balancing? (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elastic-load-balancing.html) -// in the Elastic Load Balancing Developer Guide. +// Elastic Load Balancing supports two types of load balancers: Classic load +// balancers and Application load balancers (new). A Classic load balancer makes +// routing and load balancing decisions either at the transport layer (TCP/SSL) +// or the application layer (HTTP/HTTPS), and supports either EC2-Classic or +// a VPC. An Application load balancer makes routing and load balancing decisions +// at the application layer (HTTP/HTTPS), supports path-based routing, and can +// route requests to one or more ports on each EC2 instance or container instance +// in your virtual private cloud (VPC). For more information, see the . // -// For information about the AWS regions supported by Elastic Load Balancing, -// see Regions and Endpoints - Elastic Load Balancing (http://docs.aws.amazon.com/general/latest/gr/rande.html#elb_region) -// in the Amazon Web Services General Reference. +// This reference covers the 2012-06-01 API, which supports Classic load balancers. +// The 2015-12-01 API supports Application load balancers. +// +// To get started, create a load balancer with one or more listeners using +// CreateLoadBalancer. Register your instances with the load balancer using +// RegisterInstancesWithLoadBalancer. // // All Elastic Load Balancing operations are idempotent, which means that they // complete at most one time. If you repeat an operation, it succeeds with a diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesis/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/kinesis/examples_test.go index ffbb78bea..50923928b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/examples_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesis/examples_test.go @@ -16,7 +16,13 @@ var _ time.Duration var _ bytes.Buffer func ExampleKinesis_AddTagsToStream() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.AddTagsToStreamInput{ StreamName: aws.String("StreamName"), // Required @@ -39,7 +45,13 @@ func ExampleKinesis_AddTagsToStream() { } func ExampleKinesis_CreateStream() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.CreateStreamInput{ ShardCount: aws.Int64(1), // Required @@ -59,7 +71,13 @@ func ExampleKinesis_CreateStream() { } func ExampleKinesis_DecreaseStreamRetentionPeriod() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.DecreaseStreamRetentionPeriodInput{ RetentionPeriodHours: aws.Int64(1), // Required @@ -79,7 +97,13 @@ func ExampleKinesis_DecreaseStreamRetentionPeriod() { } func ExampleKinesis_DeleteStream() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.DeleteStreamInput{ StreamName: aws.String("StreamName"), // Required @@ -98,7 +122,13 @@ func ExampleKinesis_DeleteStream() { } func ExampleKinesis_DescribeStream() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.DescribeStreamInput{ StreamName: aws.String("StreamName"), // Required @@ -119,7 +149,13 @@ func ExampleKinesis_DescribeStream() { } func ExampleKinesis_DisableEnhancedMonitoring() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.DisableEnhancedMonitoringInput{ ShardLevelMetrics: []*string{ // Required @@ -142,7 +178,13 @@ func ExampleKinesis_DisableEnhancedMonitoring() { } func ExampleKinesis_EnableEnhancedMonitoring() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.EnableEnhancedMonitoringInput{ ShardLevelMetrics: []*string{ // Required @@ -165,7 +207,13 @@ func ExampleKinesis_EnableEnhancedMonitoring() { } func ExampleKinesis_GetRecords() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.GetRecordsInput{ ShardIterator: aws.String("ShardIterator"), // Required @@ -185,7 +233,13 @@ func ExampleKinesis_GetRecords() { } func ExampleKinesis_GetShardIterator() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.GetShardIteratorInput{ ShardId: aws.String("ShardId"), // Required @@ -208,7 +262,13 @@ func ExampleKinesis_GetShardIterator() { } func ExampleKinesis_IncreaseStreamRetentionPeriod() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.IncreaseStreamRetentionPeriodInput{ RetentionPeriodHours: aws.Int64(1), // Required @@ -228,7 +288,13 @@ func ExampleKinesis_IncreaseStreamRetentionPeriod() { } func ExampleKinesis_ListStreams() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.ListStreamsInput{ ExclusiveStartStreamName: aws.String("StreamName"), @@ -248,7 +314,13 @@ func ExampleKinesis_ListStreams() { } func ExampleKinesis_ListTagsForStream() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.ListTagsForStreamInput{ StreamName: aws.String("StreamName"), // Required @@ -269,7 +341,13 @@ func ExampleKinesis_ListTagsForStream() { } func ExampleKinesis_MergeShards() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.MergeShardsInput{ AdjacentShardToMerge: aws.String("ShardId"), // Required @@ -290,7 +368,13 @@ func ExampleKinesis_MergeShards() { } func ExampleKinesis_PutRecord() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.PutRecordInput{ Data: []byte("PAYLOAD"), // Required @@ -313,7 +397,13 @@ func ExampleKinesis_PutRecord() { } func ExampleKinesis_PutRecords() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.PutRecordsInput{ Records: []*kinesis.PutRecordsRequestEntry{ // Required @@ -340,7 +430,13 @@ func ExampleKinesis_PutRecords() { } func ExampleKinesis_RemoveTagsFromStream() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.RemoveTagsFromStreamInput{ StreamName: aws.String("StreamName"), // Required @@ -363,7 +459,13 @@ func ExampleKinesis_RemoveTagsFromStream() { } func ExampleKinesis_SplitShard() { - svc := kinesis.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := kinesis.New(sess) params := &kinesis.SplitShardInput{ NewStartingHashKey: aws.String("HashKey"), // Required diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/route53/examples_test.go index cdbfea1fb..02e39d4d1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/examples_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/examples_test.go @@ -16,7 +16,13 @@ var _ time.Duration var _ bytes.Buffer func ExampleRoute53_AssociateVPCWithHostedZone() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.AssociateVPCWithHostedZoneInput{ HostedZoneId: aws.String("ResourceId"), // Required @@ -40,7 +46,13 @@ func ExampleRoute53_AssociateVPCWithHostedZone() { } func ExampleRoute53_ChangeResourceRecordSets() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ChangeResourceRecordSetsInput{ ChangeBatch: &route53.ChangeBatch{ // Required @@ -95,7 +107,13 @@ func ExampleRoute53_ChangeResourceRecordSets() { } func ExampleRoute53_ChangeTagsForResource() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ChangeTagsForResourceInput{ ResourceId: aws.String("TagResourceId"), // Required @@ -126,7 +144,13 @@ func ExampleRoute53_ChangeTagsForResource() { } func ExampleRoute53_CreateHealthCheck() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.CreateHealthCheckInput{ CallerReference: aws.String("HealthCheckNonce"), // Required @@ -172,7 +196,13 @@ func ExampleRoute53_CreateHealthCheck() { } func ExampleRoute53_CreateHostedZone() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.CreateHostedZoneInput{ CallerReference: aws.String("Nonce"), // Required @@ -201,7 +231,13 @@ func ExampleRoute53_CreateHostedZone() { } func ExampleRoute53_CreateReusableDelegationSet() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.CreateReusableDelegationSetInput{ CallerReference: aws.String("Nonce"), // Required @@ -221,7 +257,13 @@ func ExampleRoute53_CreateReusableDelegationSet() { } func ExampleRoute53_CreateTrafficPolicy() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.CreateTrafficPolicyInput{ Document: aws.String("TrafficPolicyDocument"), // Required @@ -242,7 +284,13 @@ func ExampleRoute53_CreateTrafficPolicy() { } func ExampleRoute53_CreateTrafficPolicyInstance() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.CreateTrafficPolicyInstanceInput{ HostedZoneId: aws.String("ResourceId"), // Required @@ -265,7 +313,13 @@ func ExampleRoute53_CreateTrafficPolicyInstance() { } func ExampleRoute53_CreateTrafficPolicyVersion() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.CreateTrafficPolicyVersionInput{ Document: aws.String("TrafficPolicyDocument"), // Required @@ -286,7 +340,13 @@ func ExampleRoute53_CreateTrafficPolicyVersion() { } func ExampleRoute53_DeleteHealthCheck() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.DeleteHealthCheckInput{ HealthCheckId: aws.String("HealthCheckId"), // Required @@ -305,7 +365,13 @@ func ExampleRoute53_DeleteHealthCheck() { } func ExampleRoute53_DeleteHostedZone() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.DeleteHostedZoneInput{ Id: aws.String("ResourceId"), // Required @@ -324,7 +390,13 @@ func ExampleRoute53_DeleteHostedZone() { } func ExampleRoute53_DeleteReusableDelegationSet() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.DeleteReusableDelegationSetInput{ Id: aws.String("ResourceId"), // Required @@ -343,7 +415,13 @@ func ExampleRoute53_DeleteReusableDelegationSet() { } func ExampleRoute53_DeleteTrafficPolicy() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.DeleteTrafficPolicyInput{ Id: aws.String("TrafficPolicyId"), // Required @@ -363,7 +441,13 @@ func ExampleRoute53_DeleteTrafficPolicy() { } func ExampleRoute53_DeleteTrafficPolicyInstance() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.DeleteTrafficPolicyInstanceInput{ Id: aws.String("TrafficPolicyInstanceId"), // Required @@ -382,7 +466,13 @@ func ExampleRoute53_DeleteTrafficPolicyInstance() { } func ExampleRoute53_DisassociateVPCFromHostedZone() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.DisassociateVPCFromHostedZoneInput{ HostedZoneId: aws.String("ResourceId"), // Required @@ -406,7 +496,13 @@ func ExampleRoute53_DisassociateVPCFromHostedZone() { } func ExampleRoute53_GetChange() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.GetChangeInput{ Id: aws.String("ResourceId"), // Required @@ -425,7 +521,13 @@ func ExampleRoute53_GetChange() { } func ExampleRoute53_GetChangeDetails() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.GetChangeDetailsInput{ Id: aws.String("ResourceId"), // Required @@ -444,7 +546,13 @@ func ExampleRoute53_GetChangeDetails() { } func ExampleRoute53_GetCheckerIpRanges() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) var params *route53.GetCheckerIpRangesInput resp, err := svc.GetCheckerIpRanges(params) @@ -461,7 +569,13 @@ func ExampleRoute53_GetCheckerIpRanges() { } func ExampleRoute53_GetGeoLocation() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.GetGeoLocationInput{ ContinentCode: aws.String("GeoLocationContinentCode"), @@ -482,7 +596,13 @@ func ExampleRoute53_GetGeoLocation() { } func ExampleRoute53_GetHealthCheck() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.GetHealthCheckInput{ HealthCheckId: aws.String("HealthCheckId"), // Required @@ -501,7 +621,13 @@ func ExampleRoute53_GetHealthCheck() { } func ExampleRoute53_GetHealthCheckCount() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) var params *route53.GetHealthCheckCountInput resp, err := svc.GetHealthCheckCount(params) @@ -518,7 +644,13 @@ func ExampleRoute53_GetHealthCheckCount() { } func ExampleRoute53_GetHealthCheckLastFailureReason() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.GetHealthCheckLastFailureReasonInput{ HealthCheckId: aws.String("HealthCheckId"), // Required @@ -537,7 +669,13 @@ func ExampleRoute53_GetHealthCheckLastFailureReason() { } func ExampleRoute53_GetHealthCheckStatus() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.GetHealthCheckStatusInput{ HealthCheckId: aws.String("HealthCheckId"), // Required @@ -556,7 +694,13 @@ func ExampleRoute53_GetHealthCheckStatus() { } func ExampleRoute53_GetHostedZone() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.GetHostedZoneInput{ Id: aws.String("ResourceId"), // Required @@ -575,7 +719,13 @@ func ExampleRoute53_GetHostedZone() { } func ExampleRoute53_GetHostedZoneCount() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) var params *route53.GetHostedZoneCountInput resp, err := svc.GetHostedZoneCount(params) @@ -592,7 +742,13 @@ func ExampleRoute53_GetHostedZoneCount() { } func ExampleRoute53_GetReusableDelegationSet() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.GetReusableDelegationSetInput{ Id: aws.String("ResourceId"), // Required @@ -611,7 +767,13 @@ func ExampleRoute53_GetReusableDelegationSet() { } func ExampleRoute53_GetTrafficPolicy() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.GetTrafficPolicyInput{ Id: aws.String("TrafficPolicyId"), // Required @@ -631,7 +793,13 @@ func ExampleRoute53_GetTrafficPolicy() { } func ExampleRoute53_GetTrafficPolicyInstance() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.GetTrafficPolicyInstanceInput{ Id: aws.String("TrafficPolicyInstanceId"), // Required @@ -650,7 +818,13 @@ func ExampleRoute53_GetTrafficPolicyInstance() { } func ExampleRoute53_GetTrafficPolicyInstanceCount() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) var params *route53.GetTrafficPolicyInstanceCountInput resp, err := svc.GetTrafficPolicyInstanceCount(params) @@ -667,7 +841,13 @@ func ExampleRoute53_GetTrafficPolicyInstanceCount() { } func ExampleRoute53_ListChangeBatchesByHostedZone() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ListChangeBatchesByHostedZoneInput{ EndDate: aws.String("Date"), // Required @@ -690,7 +870,13 @@ func ExampleRoute53_ListChangeBatchesByHostedZone() { } func ExampleRoute53_ListChangeBatchesByRRSet() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ListChangeBatchesByRRSetInput{ EndDate: aws.String("Date"), // Required @@ -716,7 +902,13 @@ func ExampleRoute53_ListChangeBatchesByRRSet() { } func ExampleRoute53_ListGeoLocations() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ListGeoLocationsInput{ MaxItems: aws.String("PageMaxItems"), @@ -738,7 +930,13 @@ func ExampleRoute53_ListGeoLocations() { } func ExampleRoute53_ListHealthChecks() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ListHealthChecksInput{ Marker: aws.String("PageMarker"), @@ -758,7 +956,13 @@ func ExampleRoute53_ListHealthChecks() { } func ExampleRoute53_ListHostedZones() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ListHostedZonesInput{ DelegationSetId: aws.String("ResourceId"), @@ -779,7 +983,13 @@ func ExampleRoute53_ListHostedZones() { } func ExampleRoute53_ListHostedZonesByName() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ListHostedZonesByNameInput{ DNSName: aws.String("DNSName"), @@ -800,7 +1010,13 @@ func ExampleRoute53_ListHostedZonesByName() { } func ExampleRoute53_ListResourceRecordSets() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ListResourceRecordSetsInput{ HostedZoneId: aws.String("ResourceId"), // Required @@ -823,7 +1039,13 @@ func ExampleRoute53_ListResourceRecordSets() { } func ExampleRoute53_ListReusableDelegationSets() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ListReusableDelegationSetsInput{ Marker: aws.String("PageMarker"), @@ -843,7 +1065,13 @@ func ExampleRoute53_ListReusableDelegationSets() { } func ExampleRoute53_ListTagsForResource() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ListTagsForResourceInput{ ResourceId: aws.String("TagResourceId"), // Required @@ -863,7 +1091,13 @@ func ExampleRoute53_ListTagsForResource() { } func ExampleRoute53_ListTagsForResources() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ListTagsForResourcesInput{ ResourceIds: []*string{ // Required @@ -886,7 +1120,13 @@ func ExampleRoute53_ListTagsForResources() { } func ExampleRoute53_ListTrafficPolicies() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ListTrafficPoliciesInput{ MaxItems: aws.String("PageMaxItems"), @@ -906,7 +1146,13 @@ func ExampleRoute53_ListTrafficPolicies() { } func ExampleRoute53_ListTrafficPolicyInstances() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ListTrafficPolicyInstancesInput{ HostedZoneIdMarker: aws.String("ResourceId"), @@ -928,7 +1174,13 @@ func ExampleRoute53_ListTrafficPolicyInstances() { } func ExampleRoute53_ListTrafficPolicyInstancesByHostedZone() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ListTrafficPolicyInstancesByHostedZoneInput{ HostedZoneId: aws.String("ResourceId"), // Required @@ -950,7 +1202,13 @@ func ExampleRoute53_ListTrafficPolicyInstancesByHostedZone() { } func ExampleRoute53_ListTrafficPolicyInstancesByPolicy() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ListTrafficPolicyInstancesByPolicyInput{ TrafficPolicyId: aws.String("TrafficPolicyId"), // Required @@ -974,7 +1232,13 @@ func ExampleRoute53_ListTrafficPolicyInstancesByPolicy() { } func ExampleRoute53_ListTrafficPolicyVersions() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.ListTrafficPolicyVersionsInput{ Id: aws.String("TrafficPolicyId"), // Required @@ -995,7 +1259,13 @@ func ExampleRoute53_ListTrafficPolicyVersions() { } func ExampleRoute53_UpdateHealthCheck() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.UpdateHealthCheckInput{ HealthCheckId: aws.String("HealthCheckId"), // Required @@ -1037,7 +1307,13 @@ func ExampleRoute53_UpdateHealthCheck() { } func ExampleRoute53_UpdateHostedZoneComment() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.UpdateHostedZoneCommentInput{ Id: aws.String("ResourceId"), // Required @@ -1057,7 +1333,13 @@ func ExampleRoute53_UpdateHostedZoneComment() { } func ExampleRoute53_UpdateTrafficPolicyComment() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.UpdateTrafficPolicyCommentInput{ Comment: aws.String("TrafficPolicyComment"), // Required @@ -1078,7 +1360,13 @@ func ExampleRoute53_UpdateTrafficPolicyComment() { } func ExampleRoute53_UpdateTrafficPolicyInstance() { - svc := route53.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := route53.New(sess) params := &route53.UpdateTrafficPolicyInstanceInput{ Id: aws.String("TrafficPolicyInstanceId"), // Required diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error.go index e91375dc4..266e9a8ba 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error.go +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error.go @@ -69,7 +69,7 @@ func unmarshalInvalidChangeBatchError(r *request.Request, requestBody []byte) { } r.Error = awserr.NewRequestFailure( - awserr.NewBatchError(errorCode, "ChangeBatch errors occured", errors), + awserr.NewBatchError(errorCode, "ChangeBatch errors occurred", errors), r.HTTPResponse.StatusCode, r.RequestID, ) diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go index 5132954f3..553b0e4a3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go @@ -1242,7 +1242,7 @@ func (c *S3) GetBucketReplicationRequest(input *GetBucketReplicationInput) (req return } -// Deprecated, see the GetBucketReplicationConfiguration operation. +// Returns the replication configuration of a bucket. func (c *S3) GetBucketReplication(input *GetBucketReplicationInput) (*GetBucketReplicationOutput, error) { req, out := c.GetBucketReplicationRequest(input) err := req.Send() diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/examples_test.go index 1f613f575..f61ab6676 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/examples_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/examples_test.go @@ -16,7 +16,13 @@ var _ time.Duration var _ bytes.Buffer func ExampleS3_AbortMultipartUpload() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.AbortMultipartUploadInput{ Bucket: aws.String("BucketName"), // Required @@ -38,7 +44,13 @@ func ExampleS3_AbortMultipartUpload() { } func ExampleS3_CompleteMultipartUpload() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.CompleteMultipartUploadInput{ Bucket: aws.String("BucketName"), // Required @@ -69,7 +81,13 @@ func ExampleS3_CompleteMultipartUpload() { } func ExampleS3_CopyObject() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.CopyObjectInput{ Bucket: aws.String("BucketName"), // Required @@ -121,7 +139,13 @@ func ExampleS3_CopyObject() { } func ExampleS3_CreateBucket() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.CreateBucketInput{ Bucket: aws.String("BucketName"), // Required @@ -149,7 +173,13 @@ func ExampleS3_CreateBucket() { } func ExampleS3_CreateMultipartUpload() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.CreateMultipartUploadInput{ Bucket: aws.String("BucketName"), // Required @@ -192,7 +222,13 @@ func ExampleS3_CreateMultipartUpload() { } func ExampleS3_DeleteBucket() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.DeleteBucketInput{ Bucket: aws.String("BucketName"), // Required @@ -211,7 +247,13 @@ func ExampleS3_DeleteBucket() { } func ExampleS3_DeleteBucketCors() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.DeleteBucketCorsInput{ Bucket: aws.String("BucketName"), // Required @@ -230,7 +272,13 @@ func ExampleS3_DeleteBucketCors() { } func ExampleS3_DeleteBucketLifecycle() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.DeleteBucketLifecycleInput{ Bucket: aws.String("BucketName"), // Required @@ -249,7 +297,13 @@ func ExampleS3_DeleteBucketLifecycle() { } func ExampleS3_DeleteBucketPolicy() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.DeleteBucketPolicyInput{ Bucket: aws.String("BucketName"), // Required @@ -268,7 +322,13 @@ func ExampleS3_DeleteBucketPolicy() { } func ExampleS3_DeleteBucketReplication() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.DeleteBucketReplicationInput{ Bucket: aws.String("BucketName"), // Required @@ -287,7 +347,13 @@ func ExampleS3_DeleteBucketReplication() { } func ExampleS3_DeleteBucketTagging() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.DeleteBucketTaggingInput{ Bucket: aws.String("BucketName"), // Required @@ -306,7 +372,13 @@ func ExampleS3_DeleteBucketTagging() { } func ExampleS3_DeleteBucketWebsite() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.DeleteBucketWebsiteInput{ Bucket: aws.String("BucketName"), // Required @@ -325,7 +397,13 @@ func ExampleS3_DeleteBucketWebsite() { } func ExampleS3_DeleteObject() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.DeleteObjectInput{ Bucket: aws.String("BucketName"), // Required @@ -348,7 +426,13 @@ func ExampleS3_DeleteObject() { } func ExampleS3_DeleteObjects() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.DeleteObjectsInput{ Bucket: aws.String("BucketName"), // Required @@ -379,7 +463,13 @@ func ExampleS3_DeleteObjects() { } func ExampleS3_GetBucketAccelerateConfiguration() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetBucketAccelerateConfigurationInput{ Bucket: aws.String("BucketName"), // Required @@ -398,7 +488,13 @@ func ExampleS3_GetBucketAccelerateConfiguration() { } func ExampleS3_GetBucketAcl() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetBucketAclInput{ Bucket: aws.String("BucketName"), // Required @@ -417,7 +513,13 @@ func ExampleS3_GetBucketAcl() { } func ExampleS3_GetBucketCors() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetBucketCorsInput{ Bucket: aws.String("BucketName"), // Required @@ -436,7 +538,13 @@ func ExampleS3_GetBucketCors() { } func ExampleS3_GetBucketLifecycle() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetBucketLifecycleInput{ Bucket: aws.String("BucketName"), // Required @@ -455,7 +563,13 @@ func ExampleS3_GetBucketLifecycle() { } func ExampleS3_GetBucketLifecycleConfiguration() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetBucketLifecycleConfigurationInput{ Bucket: aws.String("BucketName"), // Required @@ -474,7 +588,13 @@ func ExampleS3_GetBucketLifecycleConfiguration() { } func ExampleS3_GetBucketLocation() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetBucketLocationInput{ Bucket: aws.String("BucketName"), // Required @@ -493,7 +613,13 @@ func ExampleS3_GetBucketLocation() { } func ExampleS3_GetBucketLogging() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetBucketLoggingInput{ Bucket: aws.String("BucketName"), // Required @@ -512,7 +638,13 @@ func ExampleS3_GetBucketLogging() { } func ExampleS3_GetBucketNotification() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetBucketNotificationConfigurationRequest{ Bucket: aws.String("BucketName"), // Required @@ -531,7 +663,13 @@ func ExampleS3_GetBucketNotification() { } func ExampleS3_GetBucketNotificationConfiguration() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetBucketNotificationConfigurationRequest{ Bucket: aws.String("BucketName"), // Required @@ -550,7 +688,13 @@ func ExampleS3_GetBucketNotificationConfiguration() { } func ExampleS3_GetBucketPolicy() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetBucketPolicyInput{ Bucket: aws.String("BucketName"), // Required @@ -569,7 +713,13 @@ func ExampleS3_GetBucketPolicy() { } func ExampleS3_GetBucketReplication() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetBucketReplicationInput{ Bucket: aws.String("BucketName"), // Required @@ -588,7 +738,13 @@ func ExampleS3_GetBucketReplication() { } func ExampleS3_GetBucketRequestPayment() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetBucketRequestPaymentInput{ Bucket: aws.String("BucketName"), // Required @@ -607,7 +763,13 @@ func ExampleS3_GetBucketRequestPayment() { } func ExampleS3_GetBucketTagging() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetBucketTaggingInput{ Bucket: aws.String("BucketName"), // Required @@ -626,7 +788,13 @@ func ExampleS3_GetBucketTagging() { } func ExampleS3_GetBucketVersioning() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetBucketVersioningInput{ Bucket: aws.String("BucketName"), // Required @@ -645,7 +813,13 @@ func ExampleS3_GetBucketVersioning() { } func ExampleS3_GetBucketWebsite() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetBucketWebsiteInput{ Bucket: aws.String("BucketName"), // Required @@ -664,7 +838,13 @@ func ExampleS3_GetBucketWebsite() { } func ExampleS3_GetObject() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetObjectInput{ Bucket: aws.String("BucketName"), // Required @@ -700,7 +880,13 @@ func ExampleS3_GetObject() { } func ExampleS3_GetObjectAcl() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetObjectAclInput{ Bucket: aws.String("BucketName"), // Required @@ -722,7 +908,13 @@ func ExampleS3_GetObjectAcl() { } func ExampleS3_GetObjectTorrent() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.GetObjectTorrentInput{ Bucket: aws.String("BucketName"), // Required @@ -743,7 +935,13 @@ func ExampleS3_GetObjectTorrent() { } func ExampleS3_HeadBucket() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.HeadBucketInput{ Bucket: aws.String("BucketName"), // Required @@ -762,7 +960,13 @@ func ExampleS3_HeadBucket() { } func ExampleS3_HeadObject() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.HeadObjectInput{ Bucket: aws.String("BucketName"), // Required @@ -792,7 +996,13 @@ func ExampleS3_HeadObject() { } func ExampleS3_ListBuckets() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) var params *s3.ListBucketsInput resp, err := svc.ListBuckets(params) @@ -809,7 +1019,13 @@ func ExampleS3_ListBuckets() { } func ExampleS3_ListMultipartUploads() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.ListMultipartUploadsInput{ Bucket: aws.String("BucketName"), // Required @@ -834,7 +1050,13 @@ func ExampleS3_ListMultipartUploads() { } func ExampleS3_ListObjectVersions() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.ListObjectVersionsInput{ Bucket: aws.String("BucketName"), // Required @@ -859,7 +1081,13 @@ func ExampleS3_ListObjectVersions() { } func ExampleS3_ListObjects() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.ListObjectsInput{ Bucket: aws.String("BucketName"), // Required @@ -883,7 +1111,13 @@ func ExampleS3_ListObjects() { } func ExampleS3_ListObjectsV2() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.ListObjectsV2Input{ Bucket: aws.String("BucketName"), // Required @@ -909,7 +1143,13 @@ func ExampleS3_ListObjectsV2() { } func ExampleS3_ListParts() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.ListPartsInput{ Bucket: aws.String("BucketName"), // Required @@ -933,7 +1173,13 @@ func ExampleS3_ListParts() { } func ExampleS3_PutBucketAccelerateConfiguration() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.PutBucketAccelerateConfigurationInput{ AccelerateConfiguration: &s3.AccelerateConfiguration{ // Required @@ -955,7 +1201,13 @@ func ExampleS3_PutBucketAccelerateConfiguration() { } func ExampleS3_PutBucketAcl() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.PutBucketAclInput{ Bucket: aws.String("BucketName"), // Required @@ -999,7 +1251,13 @@ func ExampleS3_PutBucketAcl() { } func ExampleS3_PutBucketCors() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.PutBucketCorsInput{ Bucket: aws.String("BucketName"), // Required @@ -1042,7 +1300,13 @@ func ExampleS3_PutBucketCors() { } func ExampleS3_PutBucketLifecycle() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.PutBucketLifecycleInput{ Bucket: aws.String("BucketName"), // Required @@ -1091,7 +1355,13 @@ func ExampleS3_PutBucketLifecycle() { } func ExampleS3_PutBucketLifecycleConfiguration() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.PutBucketLifecycleConfigurationInput{ Bucket: aws.String("BucketName"), // Required @@ -1146,7 +1416,13 @@ func ExampleS3_PutBucketLifecycleConfiguration() { } func ExampleS3_PutBucketLogging() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.PutBucketLoggingInput{ Bucket: aws.String("BucketName"), // Required @@ -1184,7 +1460,13 @@ func ExampleS3_PutBucketLogging() { } func ExampleS3_PutBucketNotification() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.PutBucketNotificationInput{ Bucket: aws.String("BucketName"), // Required @@ -1233,7 +1515,13 @@ func ExampleS3_PutBucketNotification() { } func ExampleS3_PutBucketNotificationConfiguration() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.PutBucketNotificationConfigurationInput{ Bucket: aws.String("BucketName"), // Required @@ -1320,7 +1608,13 @@ func ExampleS3_PutBucketNotificationConfiguration() { } func ExampleS3_PutBucketPolicy() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.PutBucketPolicyInput{ Bucket: aws.String("BucketName"), // Required @@ -1340,7 +1634,13 @@ func ExampleS3_PutBucketPolicy() { } func ExampleS3_PutBucketReplication() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.PutBucketReplicationInput{ Bucket: aws.String("BucketName"), // Required @@ -1374,7 +1674,13 @@ func ExampleS3_PutBucketReplication() { } func ExampleS3_PutBucketRequestPayment() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.PutBucketRequestPaymentInput{ Bucket: aws.String("BucketName"), // Required @@ -1396,7 +1702,13 @@ func ExampleS3_PutBucketRequestPayment() { } func ExampleS3_PutBucketTagging() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.PutBucketTaggingInput{ Bucket: aws.String("BucketName"), // Required @@ -1424,7 +1736,13 @@ func ExampleS3_PutBucketTagging() { } func ExampleS3_PutBucketVersioning() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.PutBucketVersioningInput{ Bucket: aws.String("BucketName"), // Required @@ -1448,7 +1766,13 @@ func ExampleS3_PutBucketVersioning() { } func ExampleS3_PutBucketWebsite() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.PutBucketWebsiteInput{ Bucket: aws.String("BucketName"), // Required @@ -1495,7 +1819,13 @@ func ExampleS3_PutBucketWebsite() { } func ExampleS3_PutObject() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.PutObjectInput{ Bucket: aws.String("BucketName"), // Required @@ -1540,7 +1870,13 @@ func ExampleS3_PutObject() { } func ExampleS3_PutObjectAcl() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.PutObjectAclInput{ Bucket: aws.String("BucketName"), // Required @@ -1587,7 +1923,13 @@ func ExampleS3_PutObjectAcl() { } func ExampleS3_RestoreObject() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.RestoreObjectInput{ Bucket: aws.String("BucketName"), // Required @@ -1612,7 +1954,13 @@ func ExampleS3_RestoreObject() { } func ExampleS3_UploadPart() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.UploadPartInput{ Bucket: aws.String("BucketName"), // Required @@ -1640,7 +1988,13 @@ func ExampleS3_UploadPart() { } func ExampleS3_UploadPartCopy() { - svc := s3.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := s3.New(sess) params := &s3.UploadPartCopyInput{ Bucket: aws.String("BucketName"), // Required diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go b/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go index 517292903..ccbf5cc1a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go @@ -37,6 +37,14 @@ var accelerateOpBlacklist = operationBlacklist{ func updateEndpointForS3Config(r *request.Request) { forceHostStyle := aws.BoolValue(r.Config.S3ForcePathStyle) accelerate := aws.BoolValue(r.Config.S3UseAccelerate) + useDualStack := aws.BoolValue(r.Config.UseDualStack) + + if useDualStack && accelerate { + r.Error = awserr.New("InvalidParameterException", + fmt.Sprintf("configuration aws.Config.UseDualStack is not compatible with aws.Config.Accelerate"), + nil) + return + } if accelerate && accelerateOpBlacklist.Continue(r) { if forceHostStyle { diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go index 59e4950b8..ed91c5872 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go @@ -23,6 +23,8 @@ func unmarshalError(r *request.Request) { defer r.HTTPResponse.Body.Close() defer io.Copy(ioutil.Discard, r.HTTPResponse.Body) + // Bucket exists in a different region, and request needs + // to be made to the correct region. if r.HTTPResponse.StatusCode == http.StatusMovedPermanently { r.Error = awserr.NewRequestFailure( awserr.New("BucketRegionError", @@ -35,25 +37,29 @@ func unmarshalError(r *request.Request) { return } - if r.HTTPResponse.ContentLength == 0 { - // No body, use status code to generate an awserr.Error - r.Error = awserr.NewRequestFailure( - awserr.New(strings.Replace(r.HTTPResponse.Status, " ", "", -1), r.HTTPResponse.Status, nil), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - return - } + var errCode, errMsg string + // Attempt to parse error from body if it is known resp := &xmlErrorResponse{} err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp) if err != nil && err != io.EOF { - r.Error = awserr.New("SerializationError", "failed to decode S3 XML error response", nil) + errCode = "SerializationError" + errMsg = "failed to decode S3 XML error response" } else { - r.Error = awserr.NewRequestFailure( - awserr.New(resp.Code, resp.Message, nil), - r.HTTPResponse.StatusCode, - r.RequestID, - ) + errCode = resp.Code + errMsg = resp.Message } + + // Fallback to status code converted to message if still no error code + if len(errCode) == 0 { + statusText := http.StatusText(r.HTTPResponse.StatusCode) + errCode = strings.Replace(statusText, " ", "", -1) + errMsg = statusText + } + + r.Error = awserr.NewRequestFailure( + awserr.New(errCode, errMsg, nil), + r.HTTPResponse.StatusCode, + r.RequestID, + ) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error_test.go index deddc702f..7ee89d1e4 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error_test.go @@ -2,6 +2,7 @@ package s3_test import ( "bytes" + "fmt" "io/ioutil" "net/http" "strings" @@ -17,9 +18,10 @@ import ( ) type testErrorCase struct { - RespFn func() *http.Response - ReqID string - Code, Msg string + RespFn func() *http.Response + ReqID string + Code, Msg string + WithoutStatusMsg bool } var testUnmarshalCases = []testErrorCase{ @@ -84,6 +86,30 @@ var testUnmarshalCases = []testErrorCase{ ReqID: "abc123", Code: "SomeException", Msg: "Exception message", }, + { + RespFn: func() *http.Response { + return &http.Response{ + StatusCode: 404, + Header: http.Header{"X-Amz-Request-Id": []string{"abc123"}}, + Body: ioutil.NopCloser(bytes.NewReader(nil)), + ContentLength: -1, + } + }, + ReqID: "abc123", + Code: "NotFound", Msg: "Not Found", WithoutStatusMsg: true, + }, + { + RespFn: func() *http.Response { + return &http.Response{ + StatusCode: 404, + Header: http.Header{"X-Amz-Request-Id": []string{"abc123"}}, + Body: ioutil.NopCloser(bytes.NewReader(nil)), + ContentLength: -1, + } + }, + ReqID: "abc123", + Code: "NotFound", Msg: "Not Found", + }, } func TestUnmarshalError(t *testing.T) { @@ -92,7 +118,11 @@ func TestUnmarshalError(t *testing.T) { s.Handlers.Send.Clear() s.Handlers.Send.PushBack(func(r *request.Request) { r.HTTPResponse = c.RespFn() - r.HTTPResponse.Status = http.StatusText(r.HTTPResponse.StatusCode) + if !c.WithoutStatusMsg { + r.HTTPResponse.Status = fmt.Sprintf("%d%s", + r.HTTPResponse.StatusCode, + http.StatusText(r.HTTPResponse.StatusCode)) + } }) _, err := s.PutBucketAcl(&s3.PutBucketAclInput{ Bucket: aws.String("bucket"), ACL: aws.String("public-read"), diff --git a/vendor/github.com/aws/aws-sdk-go/service/sns/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/sns/examples_test.go index e2b8cce07..4fe35b39d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sns/examples_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sns/examples_test.go @@ -16,7 +16,13 @@ var _ time.Duration var _ bytes.Buffer func ExampleSNS_AddPermission() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.AddPermissionInput{ AWSAccountId: []*string{ // Required @@ -44,7 +50,13 @@ func ExampleSNS_AddPermission() { } func ExampleSNS_CheckIfPhoneNumberIsOptedOut() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.CheckIfPhoneNumberIsOptedOutInput{ PhoneNumber: aws.String("PhoneNumber"), // Required @@ -63,7 +75,13 @@ func ExampleSNS_CheckIfPhoneNumberIsOptedOut() { } func ExampleSNS_ConfirmSubscription() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.ConfirmSubscriptionInput{ Token: aws.String("token"), // Required @@ -84,7 +102,13 @@ func ExampleSNS_ConfirmSubscription() { } func ExampleSNS_CreatePlatformApplication() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.CreatePlatformApplicationInput{ Attributes: map[string]*string{ // Required @@ -108,7 +132,13 @@ func ExampleSNS_CreatePlatformApplication() { } func ExampleSNS_CreatePlatformEndpoint() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.CreatePlatformEndpointInput{ PlatformApplicationArn: aws.String("String"), // Required @@ -133,7 +163,13 @@ func ExampleSNS_CreatePlatformEndpoint() { } func ExampleSNS_CreateTopic() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.CreateTopicInput{ Name: aws.String("topicName"), // Required @@ -152,7 +188,13 @@ func ExampleSNS_CreateTopic() { } func ExampleSNS_DeleteEndpoint() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.DeleteEndpointInput{ EndpointArn: aws.String("String"), // Required @@ -171,7 +213,13 @@ func ExampleSNS_DeleteEndpoint() { } func ExampleSNS_DeletePlatformApplication() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.DeletePlatformApplicationInput{ PlatformApplicationArn: aws.String("String"), // Required @@ -190,7 +238,13 @@ func ExampleSNS_DeletePlatformApplication() { } func ExampleSNS_DeleteTopic() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.DeleteTopicInput{ TopicArn: aws.String("topicARN"), // Required @@ -209,7 +263,13 @@ func ExampleSNS_DeleteTopic() { } func ExampleSNS_GetEndpointAttributes() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.GetEndpointAttributesInput{ EndpointArn: aws.String("String"), // Required @@ -228,7 +288,13 @@ func ExampleSNS_GetEndpointAttributes() { } func ExampleSNS_GetPlatformApplicationAttributes() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.GetPlatformApplicationAttributesInput{ PlatformApplicationArn: aws.String("String"), // Required @@ -247,7 +313,13 @@ func ExampleSNS_GetPlatformApplicationAttributes() { } func ExampleSNS_GetSMSAttributes() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.GetSMSAttributesInput{ Attributes: []*string{ @@ -269,7 +341,13 @@ func ExampleSNS_GetSMSAttributes() { } func ExampleSNS_GetSubscriptionAttributes() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.GetSubscriptionAttributesInput{ SubscriptionArn: aws.String("subscriptionARN"), // Required @@ -288,7 +366,13 @@ func ExampleSNS_GetSubscriptionAttributes() { } func ExampleSNS_GetTopicAttributes() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.GetTopicAttributesInput{ TopicArn: aws.String("topicARN"), // Required @@ -307,7 +391,13 @@ func ExampleSNS_GetTopicAttributes() { } func ExampleSNS_ListEndpointsByPlatformApplication() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.ListEndpointsByPlatformApplicationInput{ PlatformApplicationArn: aws.String("String"), // Required @@ -327,7 +417,13 @@ func ExampleSNS_ListEndpointsByPlatformApplication() { } func ExampleSNS_ListPhoneNumbersOptedOut() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.ListPhoneNumbersOptedOutInput{ NextToken: aws.String("string"), @@ -346,7 +442,13 @@ func ExampleSNS_ListPhoneNumbersOptedOut() { } func ExampleSNS_ListPlatformApplications() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.ListPlatformApplicationsInput{ NextToken: aws.String("String"), @@ -365,7 +467,13 @@ func ExampleSNS_ListPlatformApplications() { } func ExampleSNS_ListSubscriptions() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.ListSubscriptionsInput{ NextToken: aws.String("nextToken"), @@ -384,7 +492,13 @@ func ExampleSNS_ListSubscriptions() { } func ExampleSNS_ListSubscriptionsByTopic() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.ListSubscriptionsByTopicInput{ TopicArn: aws.String("topicARN"), // Required @@ -404,7 +518,13 @@ func ExampleSNS_ListSubscriptionsByTopic() { } func ExampleSNS_ListTopics() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.ListTopicsInput{ NextToken: aws.String("nextToken"), @@ -423,7 +543,13 @@ func ExampleSNS_ListTopics() { } func ExampleSNS_OptInPhoneNumber() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.OptInPhoneNumberInput{ PhoneNumber: aws.String("PhoneNumber"), // Required @@ -442,7 +568,13 @@ func ExampleSNS_OptInPhoneNumber() { } func ExampleSNS_Publish() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.PublishInput{ Message: aws.String("message"), // Required @@ -474,7 +606,13 @@ func ExampleSNS_Publish() { } func ExampleSNS_RemovePermission() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.RemovePermissionInput{ Label: aws.String("label"), // Required @@ -494,7 +632,13 @@ func ExampleSNS_RemovePermission() { } func ExampleSNS_SetEndpointAttributes() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.SetEndpointAttributesInput{ Attributes: map[string]*string{ // Required @@ -517,7 +661,13 @@ func ExampleSNS_SetEndpointAttributes() { } func ExampleSNS_SetPlatformApplicationAttributes() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.SetPlatformApplicationAttributesInput{ Attributes: map[string]*string{ // Required @@ -540,7 +690,13 @@ func ExampleSNS_SetPlatformApplicationAttributes() { } func ExampleSNS_SetSMSAttributes() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.SetSMSAttributesInput{ Attributes: map[string]*string{ // Required @@ -562,7 +718,13 @@ func ExampleSNS_SetSMSAttributes() { } func ExampleSNS_SetSubscriptionAttributes() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.SetSubscriptionAttributesInput{ AttributeName: aws.String("attributeName"), // Required @@ -583,7 +745,13 @@ func ExampleSNS_SetSubscriptionAttributes() { } func ExampleSNS_SetTopicAttributes() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.SetTopicAttributesInput{ AttributeName: aws.String("attributeName"), // Required @@ -604,7 +772,13 @@ func ExampleSNS_SetTopicAttributes() { } func ExampleSNS_Subscribe() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.SubscribeInput{ Protocol: aws.String("protocol"), // Required @@ -625,7 +799,13 @@ func ExampleSNS_Subscribe() { } func ExampleSNS_Unsubscribe() { - svc := sns.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sns.New(sess) params := &sns.UnsubscribeInput{ SubscriptionArn: aws.String("subscriptionARN"), // Required diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/api_test.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/api_test.go index 3f5517e60..4cec7788d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/api_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sqs/api_test.go @@ -8,12 +8,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/service/sqs" ) func TestFlattenedTraits(t *testing.T) { - s := sqs.New(session.New()) + s := sqs.New(unit.Session) _, err := s.DeleteMessageBatch(&sqs.DeleteMessageBatchInput{ QueueURL: aws.String("QUEUE"), Entries: []*sqs.DeleteMessageBatchRequestEntry{ diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/examples_test.go index 2b8626773..b39289e2a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/examples_test.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sqs/examples_test.go @@ -16,7 +16,13 @@ var _ time.Duration var _ bytes.Buffer func ExampleSQS_AddPermission() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.AddPermissionInput{ AWSAccountIds: []*string{ // Required @@ -44,7 +50,13 @@ func ExampleSQS_AddPermission() { } func ExampleSQS_ChangeMessageVisibility() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.ChangeMessageVisibilityInput{ QueueUrl: aws.String("String"), // Required @@ -65,7 +77,13 @@ func ExampleSQS_ChangeMessageVisibility() { } func ExampleSQS_ChangeMessageVisibilityBatch() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.ChangeMessageVisibilityBatchInput{ Entries: []*sqs.ChangeMessageVisibilityBatchRequestEntry{ // Required @@ -92,7 +110,13 @@ func ExampleSQS_ChangeMessageVisibilityBatch() { } func ExampleSQS_CreateQueue() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.CreateQueueInput{ QueueName: aws.String("String"), // Required @@ -115,7 +139,13 @@ func ExampleSQS_CreateQueue() { } func ExampleSQS_DeleteMessage() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.DeleteMessageInput{ QueueUrl: aws.String("String"), // Required @@ -135,7 +165,13 @@ func ExampleSQS_DeleteMessage() { } func ExampleSQS_DeleteMessageBatch() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.DeleteMessageBatchInput{ Entries: []*sqs.DeleteMessageBatchRequestEntry{ // Required @@ -161,7 +197,13 @@ func ExampleSQS_DeleteMessageBatch() { } func ExampleSQS_DeleteQueue() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.DeleteQueueInput{ QueueUrl: aws.String("String"), // Required @@ -180,7 +222,13 @@ func ExampleSQS_DeleteQueue() { } func ExampleSQS_GetQueueAttributes() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.GetQueueAttributesInput{ QueueUrl: aws.String("String"), // Required @@ -203,7 +251,13 @@ func ExampleSQS_GetQueueAttributes() { } func ExampleSQS_GetQueueUrl() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.GetQueueUrlInput{ QueueName: aws.String("String"), // Required @@ -223,7 +277,13 @@ func ExampleSQS_GetQueueUrl() { } func ExampleSQS_ListDeadLetterSourceQueues() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.ListDeadLetterSourceQueuesInput{ QueueUrl: aws.String("String"), // Required @@ -242,7 +302,13 @@ func ExampleSQS_ListDeadLetterSourceQueues() { } func ExampleSQS_ListQueues() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.ListQueuesInput{ QueueNamePrefix: aws.String("String"), @@ -261,7 +327,13 @@ func ExampleSQS_ListQueues() { } func ExampleSQS_PurgeQueue() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.PurgeQueueInput{ QueueUrl: aws.String("String"), // Required @@ -280,7 +352,13 @@ func ExampleSQS_PurgeQueue() { } func ExampleSQS_ReceiveMessage() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.ReceiveMessageInput{ QueueUrl: aws.String("String"), // Required @@ -310,7 +388,13 @@ func ExampleSQS_ReceiveMessage() { } func ExampleSQS_RemovePermission() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.RemovePermissionInput{ Label: aws.String("String"), // Required @@ -330,7 +414,13 @@ func ExampleSQS_RemovePermission() { } func ExampleSQS_SendMessage() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.SendMessageInput{ MessageBody: aws.String("String"), // Required @@ -367,7 +457,13 @@ func ExampleSQS_SendMessage() { } func ExampleSQS_SendMessageBatch() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.SendMessageBatchInput{ Entries: []*sqs.SendMessageBatchRequestEntry{ // Required @@ -410,7 +506,13 @@ func ExampleSQS_SendMessageBatch() { } func ExampleSQS_SetQueueAttributes() { - svc := sqs.New(session.New()) + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sqs.New(sess) params := &sqs.SetQueueAttributesInput{ Attributes: map[string]*string{ // Required diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go new file mode 100644 index 000000000..f11e8675f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go @@ -0,0 +1,1653 @@ +// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. + +// Package sts provides a client for AWS Security Token Service. +package sts + +import ( + "time" + + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" +) + +const opAssumeRole = "AssumeRole" + +// AssumeRoleRequest generates a "aws/request.Request" representing the +// client's request for the AssumeRole operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the AssumeRole method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the AssumeRoleRequest method. +// req, resp := client.AssumeRoleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, output *AssumeRoleOutput) { + op := &request.Operation{ + Name: opAssumeRole, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AssumeRoleInput{} + } + + req = c.newRequest(op, input, output) + output = &AssumeRoleOutput{} + req.Data = output + return +} + +// Returns a set of temporary security credentials (consisting of an access +// key ID, a secret access key, and a security token) that you can use to access +// AWS resources that you might not normally have access to. Typically, you +// use AssumeRole for cross-account access or federation. For a comparison of +// AssumeRole with the other APIs that produce temporary credentials, see Requesting +// Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// in the IAM User Guide. +// +// Important: You cannot call AssumeRole by using AWS root account credentials; +// access is denied. You must use credentials for an IAM user or an IAM role +// to call AssumeRole. +// +// For cross-account access, imagine that you own multiple accounts and need +// to access resources in each account. You could create long-term credentials +// in each account to access those resources. However, managing all those credentials +// and remembering which one can access which account can be time consuming. +// Instead, you can create one set of long-term credentials in one account and +// then use temporary security credentials to access all the other accounts +// by assuming roles in those accounts. For more information about roles, see +// IAM Roles (Delegation and Federation) (http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html) +// in the IAM User Guide. +// +// For federation, you can, for example, grant single sign-on access to the +// AWS Management Console. If you already have an identity and authentication +// system in your corporate network, you don't have to recreate user identities +// in AWS in order to grant those user identities access to AWS. Instead, after +// a user has been authenticated, you call AssumeRole (and specify the role +// with the appropriate permissions) to get temporary security credentials for +// that user. With those temporary security credentials, you construct a sign-in +// URL that users can use to access the console. For more information, see Common +// Scenarios for Temporary Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html#sts-introduction) +// in the IAM User Guide. +// +// The temporary security credentials are valid for the duration that you specified +// when calling AssumeRole, which can be from 900 seconds (15 minutes) to a +// maximum of 3600 seconds (1 hour). The default is 1 hour. +// +// The temporary security credentials created by AssumeRole can be used to +// make API calls to any AWS service with the following exception: you cannot +// call the STS service's GetFederationToken or GetSessionToken APIs. +// +// Optionally, you can pass an IAM access policy to this operation. If you +// choose not to pass a policy, the temporary security credentials that are +// returned by the operation have the permissions that are defined in the access +// policy of the role that is being assumed. If you pass a policy to this operation, +// the temporary security credentials that are returned by the operation have +// the permissions that are allowed by both the access policy of the role that +// is being assumed, and the policy that you pass. This gives you a way to +// further restrict the permissions for the resulting temporary security credentials. +// You cannot use the passed policy to grant permissions that are in excess +// of those allowed by the access policy of the role that is being assumed. +// For more information, see Permissions for AssumeRole, AssumeRoleWithSAML, +// and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) +// in the IAM User Guide. +// +// To assume a role, your AWS account must be trusted by the role. The trust +// relationship is defined in the role's trust policy when the role is created. +// That trust policy states which accounts are allowed to delegate access to +// this account's role. +// +// The user who wants to access the role must also have permissions delegated +// from the role's administrator. If the user is in a different account than +// the role, then the user's administrator must attach a policy that allows +// the user to call AssumeRole on the ARN of the role in the other account. +// If the user is in the same account as the role, then you can either attach +// a policy to the user (identical to the previous different account user), +// or you can add the user as a principal directly in the role's trust policy +// +// Using MFA with AssumeRole +// +// You can optionally include multi-factor authentication (MFA) information +// when you call AssumeRole. This is useful for cross-account scenarios in which +// you want to make sure that the user who is assuming the role has been authenticated +// using an AWS MFA device. In that scenario, the trust policy of the role being +// assumed includes a condition that tests for MFA authentication; if the caller +// does not include valid MFA information, the request to assume the role is +// denied. The condition in a trust policy that tests for MFA authentication +// might look like the following example. +// +// "Condition": {"Bool": {"aws:MultiFactorAuthPresent": true}} +// +// For more information, see Configuring MFA-Protected API Access (http://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html) +// in the IAM User Guide guide. +// +// To use MFA with AssumeRole, you pass values for the SerialNumber and TokenCode +// parameters. The SerialNumber value identifies the user's hardware or virtual +// MFA device. The TokenCode is the time-based one-time password (TOTP) that +// the MFA devices produces. +func (c *STS) AssumeRole(input *AssumeRoleInput) (*AssumeRoleOutput, error) { + req, out := c.AssumeRoleRequest(input) + err := req.Send() + return out, err +} + +const opAssumeRoleWithSAML = "AssumeRoleWithSAML" + +// AssumeRoleWithSAMLRequest generates a "aws/request.Request" representing the +// client's request for the AssumeRoleWithSAML operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the AssumeRoleWithSAML method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the AssumeRoleWithSAMLRequest method. +// req, resp := client.AssumeRoleWithSAMLRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *request.Request, output *AssumeRoleWithSAMLOutput) { + op := &request.Operation{ + Name: opAssumeRoleWithSAML, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AssumeRoleWithSAMLInput{} + } + + req = c.newRequest(op, input, output) + output = &AssumeRoleWithSAMLOutput{} + req.Data = output + return +} + +// Returns a set of temporary security credentials for users who have been authenticated +// via a SAML authentication response. This operation provides a mechanism for +// tying an enterprise identity store or directory to role-based AWS access +// without user-specific credentials or configuration. For a comparison of AssumeRoleWithSAML +// with the other APIs that produce temporary credentials, see Requesting Temporary +// Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// in the IAM User Guide. +// +// The temporary security credentials returned by this operation consist of +// an access key ID, a secret access key, and a security token. Applications +// can use these temporary security credentials to sign calls to AWS services. +// +// The temporary security credentials are valid for the duration that you specified +// when calling AssumeRole, or until the time specified in the SAML authentication +// response's SessionNotOnOrAfter value, whichever is shorter. The duration +// can be from 900 seconds (15 minutes) to a maximum of 3600 seconds (1 hour). +// The default is 1 hour. +// +// The temporary security credentials created by AssumeRoleWithSAML can be +// used to make API calls to any AWS service with the following exception: you +// cannot call the STS service's GetFederationToken or GetSessionToken APIs. +// +// Optionally, you can pass an IAM access policy to this operation. If you +// choose not to pass a policy, the temporary security credentials that are +// returned by the operation have the permissions that are defined in the access +// policy of the role that is being assumed. If you pass a policy to this operation, +// the temporary security credentials that are returned by the operation have +// the permissions that are allowed by the intersection of both the access policy +// of the role that is being assumed, and the policy that you pass. This means +// that both policies must grant the permission for the action to be allowed. +// This gives you a way to further restrict the permissions for the resulting +// temporary security credentials. You cannot use the passed policy to grant +// permissions that are in excess of those allowed by the access policy of the +// role that is being assumed. For more information, see Permissions for AssumeRole, +// AssumeRoleWithSAML, and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) +// in the IAM User Guide. +// +// Before your application can call AssumeRoleWithSAML, you must configure +// your SAML identity provider (IdP) to issue the claims required by AWS. Additionally, +// you must use AWS Identity and Access Management (IAM) to create a SAML provider +// entity in your AWS account that represents your identity provider, and create +// an IAM role that specifies this SAML provider in its trust policy. +// +// Calling AssumeRoleWithSAML does not require the use of AWS security credentials. +// The identity of the caller is validated by using keys in the metadata document +// that is uploaded for the SAML provider entity for your identity provider. +// +// Calling AssumeRoleWithSAML can result in an entry in your AWS CloudTrail +// logs. The entry includes the value in the NameID element of the SAML assertion. +// We recommend that you use a NameIDType that is not associated with any personally +// identifiable information (PII). For example, you could instead use the Persistent +// Identifier (urn:oasis:names:tc:SAML:2.0:nameid-format:persistent). +// +// For more information, see the following resources: +// +// About SAML 2.0-based Federation (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html) +// in the IAM User Guide. +// +// Creating SAML Identity Providers (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html) +// in the IAM User Guide. +// +// Configuring a Relying Party and Claims (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html) +// in the IAM User Guide. +// +// Creating a Role for SAML 2.0 Federation (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html) +// in the IAM User Guide. +func (c *STS) AssumeRoleWithSAML(input *AssumeRoleWithSAMLInput) (*AssumeRoleWithSAMLOutput, error) { + req, out := c.AssumeRoleWithSAMLRequest(input) + err := req.Send() + return out, err +} + +const opAssumeRoleWithWebIdentity = "AssumeRoleWithWebIdentity" + +// AssumeRoleWithWebIdentityRequest generates a "aws/request.Request" representing the +// client's request for the AssumeRoleWithWebIdentity operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the AssumeRoleWithWebIdentity method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the AssumeRoleWithWebIdentityRequest method. +// req, resp := client.AssumeRoleWithWebIdentityRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityInput) (req *request.Request, output *AssumeRoleWithWebIdentityOutput) { + op := &request.Operation{ + Name: opAssumeRoleWithWebIdentity, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AssumeRoleWithWebIdentityInput{} + } + + req = c.newRequest(op, input, output) + output = &AssumeRoleWithWebIdentityOutput{} + req.Data = output + return +} + +// Returns a set of temporary security credentials for users who have been authenticated +// in a mobile or web application with a web identity provider, such as Amazon +// Cognito, Login with Amazon, Facebook, Google, or any OpenID Connect-compatible +// identity provider. +// +// For mobile applications, we recommend that you use Amazon Cognito. You +// can use Amazon Cognito with the AWS SDK for iOS (http://aws.amazon.com/sdkforios/) +// and the AWS SDK for Android (http://aws.amazon.com/sdkforandroid/) to uniquely +// identify a user and supply the user with a consistent identity throughout +// the lifetime of an application. +// +// To learn more about Amazon Cognito, see Amazon Cognito Overview (http://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/cognito-auth.html#d0e840) +// in the AWS SDK for Android Developer Guide guide and Amazon Cognito Overview +// (http://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-auth.html#d0e664) +// in the AWS SDK for iOS Developer Guide. +// +// Calling AssumeRoleWithWebIdentity does not require the use of AWS security +// credentials. Therefore, you can distribute an application (for example, on +// mobile devices) that requests temporary security credentials without including +// long-term AWS credentials in the application, and without deploying server-based +// proxy services that use long-term AWS credentials. Instead, the identity +// of the caller is validated by using a token from the web identity provider. +// For a comparison of AssumeRoleWithWebIdentity with the other APIs that produce +// temporary credentials, see Requesting Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// in the IAM User Guide. +// +// The temporary security credentials returned by this API consist of an access +// key ID, a secret access key, and a security token. Applications can use these +// temporary security credentials to sign calls to AWS service APIs. +// +// The credentials are valid for the duration that you specified when calling +// AssumeRoleWithWebIdentity, which can be from 900 seconds (15 minutes) to +// a maximum of 3600 seconds (1 hour). The default is 1 hour. +// +// The temporary security credentials created by AssumeRoleWithWebIdentity +// can be used to make API calls to any AWS service with the following exception: +// you cannot call the STS service's GetFederationToken or GetSessionToken APIs. +// +// Optionally, you can pass an IAM access policy to this operation. If you +// choose not to pass a policy, the temporary security credentials that are +// returned by the operation have the permissions that are defined in the access +// policy of the role that is being assumed. If you pass a policy to this operation, +// the temporary security credentials that are returned by the operation have +// the permissions that are allowed by both the access policy of the role that +// is being assumed, and the policy that you pass. This gives you a way to +// further restrict the permissions for the resulting temporary security credentials. +// You cannot use the passed policy to grant permissions that are in excess +// of those allowed by the access policy of the role that is being assumed. +// For more information, see Permissions for AssumeRole, AssumeRoleWithSAML, +// and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) +// in the IAM User Guide. +// +// Before your application can call AssumeRoleWithWebIdentity, you must have +// an identity token from a supported identity provider and create a role that +// the application can assume. The role that your application assumes must trust +// the identity provider that is associated with the identity token. In other +// words, the identity provider must be specified in the role's trust policy. +// +// Calling AssumeRoleWithWebIdentity can result in an entry in your AWS CloudTrail +// logs. The entry includes the Subject (http://openid.net/specs/openid-connect-core-1_0.html#Claims) +// of the provided Web Identity Token. We recommend that you avoid using any +// personally identifiable information (PII) in this field. For example, you +// could instead use a GUID or a pairwise identifier, as suggested in the OIDC +// specification (http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes). +// +// For more information about how to use web identity federation and the AssumeRoleWithWebIdentity +// API, see the following resources: +// +// Using Web Identity Federation APIs for Mobile Apps (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual) +// and Federation Through a Web-based Identity Provider (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity). +// +// Web Identity Federation Playground (https://web-identity-federation-playground.s3.amazonaws.com/index.html). +// This interactive website lets you walk through the process of authenticating +// via Login with Amazon, Facebook, or Google, getting temporary security credentials, +// and then using those credentials to make a request to AWS. +// +// AWS SDK for iOS (http://aws.amazon.com/sdkforios/) and AWS SDK for Android +// (http://aws.amazon.com/sdkforandroid/). These toolkits contain sample apps +// that show how to invoke the identity providers, and then how to use the information +// from these providers to get and use temporary security credentials. +// +// Web Identity Federation with Mobile Applications (http://aws.amazon.com/articles/4617974389850313). +// This article discusses web identity federation and shows an example of how +// to use web identity federation to get access to content in Amazon S3. +func (c *STS) AssumeRoleWithWebIdentity(input *AssumeRoleWithWebIdentityInput) (*AssumeRoleWithWebIdentityOutput, error) { + req, out := c.AssumeRoleWithWebIdentityRequest(input) + err := req.Send() + return out, err +} + +const opDecodeAuthorizationMessage = "DecodeAuthorizationMessage" + +// DecodeAuthorizationMessageRequest generates a "aws/request.Request" representing the +// client's request for the DecodeAuthorizationMessage operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the DecodeAuthorizationMessage method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the DecodeAuthorizationMessageRequest method. +// req, resp := client.DecodeAuthorizationMessageRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessageInput) (req *request.Request, output *DecodeAuthorizationMessageOutput) { + op := &request.Operation{ + Name: opDecodeAuthorizationMessage, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DecodeAuthorizationMessageInput{} + } + + req = c.newRequest(op, input, output) + output = &DecodeAuthorizationMessageOutput{} + req.Data = output + return +} + +// Decodes additional information about the authorization status of a request +// from an encoded message returned in response to an AWS request. +// +// For example, if a user is not authorized to perform an action that he or +// she has requested, the request returns a Client.UnauthorizedOperation response +// (an HTTP 403 response). Some AWS actions additionally return an encoded message +// that can provide details about this authorization failure. +// +// Only certain AWS actions return an encoded authorization message. The documentation +// for an individual action indicates whether that action returns an encoded +// message in addition to returning an HTTP code. +// +// The message is encoded because the details of the authorization status +// can constitute privileged information that the user who requested the action +// should not see. To decode an authorization status message, a user must be +// granted permissions via an IAM policy to request the DecodeAuthorizationMessage +// (sts:DecodeAuthorizationMessage) action. +// +// The decoded message includes the following type of information: +// +// Whether the request was denied due to an explicit deny or due to the absence +// of an explicit allow. For more information, see Determining Whether a Request +// is Allowed or Denied (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow) +// in the IAM User Guide. +// +// The principal who made the request. +// +// The requested action. +// +// The requested resource. +// +// The values of condition keys in the context of the user's request. +func (c *STS) DecodeAuthorizationMessage(input *DecodeAuthorizationMessageInput) (*DecodeAuthorizationMessageOutput, error) { + req, out := c.DecodeAuthorizationMessageRequest(input) + err := req.Send() + return out, err +} + +const opGetCallerIdentity = "GetCallerIdentity" + +// GetCallerIdentityRequest generates a "aws/request.Request" representing the +// client's request for the GetCallerIdentity operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the GetCallerIdentity method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the GetCallerIdentityRequest method. +// req, resp := client.GetCallerIdentityRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *request.Request, output *GetCallerIdentityOutput) { + op := &request.Operation{ + Name: opGetCallerIdentity, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetCallerIdentityInput{} + } + + req = c.newRequest(op, input, output) + output = &GetCallerIdentityOutput{} + req.Data = output + return +} + +// Returns details about the IAM identity whose credentials are used to call +// the API. +func (c *STS) GetCallerIdentity(input *GetCallerIdentityInput) (*GetCallerIdentityOutput, error) { + req, out := c.GetCallerIdentityRequest(input) + err := req.Send() + return out, err +} + +const opGetFederationToken = "GetFederationToken" + +// GetFederationTokenRequest generates a "aws/request.Request" representing the +// client's request for the GetFederationToken operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the GetFederationToken method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the GetFederationTokenRequest method. +// req, resp := client.GetFederationTokenRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *request.Request, output *GetFederationTokenOutput) { + op := &request.Operation{ + Name: opGetFederationToken, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetFederationTokenInput{} + } + + req = c.newRequest(op, input, output) + output = &GetFederationTokenOutput{} + req.Data = output + return +} + +// Returns a set of temporary security credentials (consisting of an access +// key ID, a secret access key, and a security token) for a federated user. +// A typical use is in a proxy application that gets temporary security credentials +// on behalf of distributed applications inside a corporate network. Because +// you must call the GetFederationToken action using the long-term security +// credentials of an IAM user, this call is appropriate in contexts where those +// credentials can be safely stored, usually in a server-based application. +// For a comparison of GetFederationToken with the other APIs that produce temporary +// credentials, see Requesting Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// in the IAM User Guide. +// +// If you are creating a mobile-based or browser-based app that can authenticate +// users using a web identity provider like Login with Amazon, Facebook, Google, +// or an OpenID Connect-compatible identity provider, we recommend that you +// use Amazon Cognito (http://aws.amazon.com/cognito/) or AssumeRoleWithWebIdentity. +// For more information, see Federation Through a Web-based Identity Provider +// (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity). +// +// The GetFederationToken action must be called by using the long-term AWS +// security credentials of an IAM user. You can also call GetFederationToken +// using the security credentials of an AWS root account, but we do not recommended +// it. Instead, we recommend that you create an IAM user for the purpose of +// the proxy application and then attach a policy to the IAM user that limits +// federated users to only the actions and resources that they need access to. +// For more information, see IAM Best Practices (http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) +// in the IAM User Guide. +// +// The temporary security credentials that are obtained by using the long-term +// credentials of an IAM user are valid for the specified duration, from 900 +// seconds (15 minutes) up to a maximium of 129600 seconds (36 hours). The default +// is 43200 seconds (12 hours). Temporary credentials that are obtained by using +// AWS root account credentials have a maximum duration of 3600 seconds (1 hour). +// +// The temporary security credentials created by GetFederationToken can be +// used to make API calls to any AWS service with the following exceptions: +// +// You cannot use these credentials to call any IAM APIs. +// +// You cannot call any STS APIs. +// +// Permissions +// +// The permissions for the temporary security credentials returned by GetFederationToken +// are determined by a combination of the following: +// +// The policy or policies that are attached to the IAM user whose credentials +// are used to call GetFederationToken. +// +// The policy that is passed as a parameter in the call. +// +// The passed policy is attached to the temporary security credentials that +// result from the GetFederationToken API call--that is, to the federated user. +// When the federated user makes an AWS request, AWS evaluates the policy attached +// to the federated user in combination with the policy or policies attached +// to the IAM user whose credentials were used to call GetFederationToken. AWS +// allows the federated user's request only when both the federated user and +// the IAM user are explicitly allowed to perform the requested action. The +// passed policy cannot grant more permissions than those that are defined in +// the IAM user policy. +// +// A typical use case is that the permissions of the IAM user whose credentials +// are used to call GetFederationToken are designed to allow access to all the +// actions and resources that any federated user will need. Then, for individual +// users, you pass a policy to the operation that scopes down the permissions +// to a level that's appropriate to that individual user, using a policy that +// allows only a subset of permissions that are granted to the IAM user. +// +// If you do not pass a policy, the resulting temporary security credentials +// have no effective permissions. The only exception is when the temporary security +// credentials are used to access a resource that has a resource-based policy +// that specifically allows the federated user to access the resource. +// +// For more information about how permissions work, see Permissions for GetFederationToken +// (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html). +// For information about using GetFederationToken to create temporary security +// credentials, see GetFederationToken—Federation Through a Custom Identity +// Broker (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken). +func (c *STS) GetFederationToken(input *GetFederationTokenInput) (*GetFederationTokenOutput, error) { + req, out := c.GetFederationTokenRequest(input) + err := req.Send() + return out, err +} + +const opGetSessionToken = "GetSessionToken" + +// GetSessionTokenRequest generates a "aws/request.Request" representing the +// client's request for the GetSessionToken operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the GetSessionToken method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the GetSessionTokenRequest method. +// req, resp := client.GetSessionTokenRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request.Request, output *GetSessionTokenOutput) { + op := &request.Operation{ + Name: opGetSessionToken, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetSessionTokenInput{} + } + + req = c.newRequest(op, input, output) + output = &GetSessionTokenOutput{} + req.Data = output + return +} + +// Returns a set of temporary credentials for an AWS account or IAM user. The +// credentials consist of an access key ID, a secret access key, and a security +// token. Typically, you use GetSessionToken if you want to use MFA to protect +// programmatic calls to specific AWS APIs like Amazon EC2 StopInstances. MFA-enabled +// IAM users would need to call GetSessionToken and submit an MFA code that +// is associated with their MFA device. Using the temporary security credentials +// that are returned from the call, IAM users can then make programmatic calls +// to APIs that require MFA authentication. If you do not supply a correct MFA +// code, then the API returns an access denied error. For a comparison of GetSessionToken +// with the other APIs that produce temporary credentials, see Requesting Temporary +// Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// in the IAM User Guide. +// +// The GetSessionToken action must be called by using the long-term AWS security +// credentials of the AWS account or an IAM user. Credentials that are created +// by IAM users are valid for the duration that you specify, from 900 seconds +// (15 minutes) up to a maximum of 129600 seconds (36 hours), with a default +// of 43200 seconds (12 hours); credentials that are created by using account +// credentials can range from 900 seconds (15 minutes) up to a maximum of 3600 +// seconds (1 hour), with a default of 1 hour. +// +// The temporary security credentials created by GetSessionToken can be used +// to make API calls to any AWS service with the following exceptions: +// +// You cannot call any IAM APIs unless MFA authentication information is +// included in the request. +// +// You cannot call any STS API except AssumeRole. +// +// We recommend that you do not call GetSessionToken with root account credentials. +// Instead, follow our best practices (http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users) +// by creating one or more IAM users, giving them the necessary permissions, +// and using IAM users for everyday interaction with AWS. +// +// The permissions associated with the temporary security credentials returned +// by GetSessionToken are based on the permissions associated with account or +// IAM user whose credentials are used to call the action. If GetSessionToken +// is called using root account credentials, the temporary credentials have +// root account permissions. Similarly, if GetSessionToken is called using the +// credentials of an IAM user, the temporary credentials have the same permissions +// as the IAM user. +// +// For more information about using GetSessionToken to create temporary credentials, +// go to Temporary Credentials for Users in Untrusted Environments (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken) +// in the IAM User Guide. +func (c *STS) GetSessionToken(input *GetSessionTokenInput) (*GetSessionTokenOutput, error) { + req, out := c.GetSessionTokenRequest(input) + err := req.Send() + return out, err +} + +type AssumeRoleInput struct { + _ struct{} `type:"structure"` + + // The duration, in seconds, of the role session. The value can range from 900 + // seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set + // to 3600 seconds. + // + // This is separate from the duration of a console session that you might + // request using the returned credentials. The request to the federation endpoint + // for a console sign-in token takes a SessionDuration parameter that specifies + // the maximum length of the console session, separately from the DurationSeconds + // parameter on this API. For more information, see Creating a URL that Enables + // Federated Users to Access the AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) + // in the IAM User Guide. + DurationSeconds *int64 `min:"900" type:"integer"` + + // A unique identifier that is used by third parties when assuming roles in + // their customers' accounts. For each role that the third party can assume, + // they should instruct their customers to ensure the role's trust policy checks + // for the external ID that the third party generated. Each time the third party + // assumes the role, they should pass the customer's external ID. The external + // ID is useful in order to help third parties bind a role to the customer who + // created it. For more information about the external ID, see How to Use an + // External ID When Granting Access to Your AWS Resources to a Third Party (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html) + // in the IAM User Guide. + // + // The format for this parameter, as described by its regex pattern, is a string + // of characters consisting of upper- and lower-case alphanumeric characters + // with no spaces. You can also include underscores or any of the following + // characters: =,.@:\/- + ExternalId *string `min:"2" type:"string"` + + // An IAM policy in JSON format. + // + // This parameter is optional. If you pass a policy, the temporary security + // credentials that are returned by the operation have the permissions that + // are allowed by both (the intersection of) the access policy of the role that + // is being assumed, and the policy that you pass. This gives you a way to further + // restrict the permissions for the resulting temporary security credentials. + // You cannot use the passed policy to grant permissions that are in excess + // of those allowed by the access policy of the role that is being assumed. + // For more information, see Permissions for AssumeRole, AssumeRoleWithSAML, + // and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) + // in the IAM User Guide. + // + // The format for this parameter, as described by its regex pattern, is a string + // of characters up to 2048 characters in length. The characters can be any + // ASCII character from the space character to the end of the valid character + // list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), + // and carriage return (\u000D) characters. + // + // The policy plain text must be 2048 bytes or shorter. However, an internal + // conversion compresses it into a packed binary format with a separate limit. + // The PackedPolicySize response element indicates by percentage how close to + // the upper size limit the policy is, with 100% equaling the maximum allowed + // size. + Policy *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the role to assume. + RoleArn *string `min:"20" type:"string" required:"true"` + + // An identifier for the assumed role session. + // + // Use the role session name to uniquely identify a session when the same role + // is assumed by different principals or for different reasons. In cross-account + // scenarios, the role session name is visible to, and can be logged by the + // account that owns the role. The role session name is also used in the ARN + // of the assumed role principal. This means that subsequent cross-account API + // requests using the temporary security credentials will expose the role session + // name to the external account in their CloudTrail logs. + // + // The format for this parameter, as described by its regex pattern, is a string + // of characters consisting of upper- and lower-case alphanumeric characters + // with no spaces. You can also include underscores or any of the following + // characters: =,.@- + RoleSessionName *string `min:"2" type:"string" required:"true"` + + // The identification number of the MFA device that is associated with the user + // who is making the AssumeRole call. Specify this value if the trust policy + // of the role being assumed includes a condition that requires MFA authentication. + // The value is either the serial number for a hardware device (such as GAHT12345678) + // or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user). + // + // The format for this parameter, as described by its regex pattern, is a string + // of characters consisting of upper- and lower-case alphanumeric characters + // with no spaces. You can also include underscores or any of the following + // characters: =,.@- + SerialNumber *string `min:"9" type:"string"` + + // The value provided by the MFA device, if the trust policy of the role being + // assumed requires MFA (that is, if the policy includes a condition that tests + // for MFA). If the role being assumed requires MFA and if the TokenCode value + // is missing or expired, the AssumeRole call returns an "access denied" error. + // + // The format for this parameter, as described by its regex pattern, is a sequence + // of six numeric digits. + TokenCode *string `min:"6" type:"string"` +} + +// String returns the string representation +func (s AssumeRoleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssumeRoleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssumeRoleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssumeRoleInput"} + if s.DurationSeconds != nil && *s.DurationSeconds < 900 { + invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) + } + if s.ExternalId != nil && len(*s.ExternalId) < 2 { + invalidParams.Add(request.NewErrParamMinLen("ExternalId", 2)) + } + if s.Policy != nil && len(*s.Policy) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.RoleArn != nil && len(*s.RoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) + } + if s.RoleSessionName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleSessionName")) + } + if s.RoleSessionName != nil && len(*s.RoleSessionName) < 2 { + invalidParams.Add(request.NewErrParamMinLen("RoleSessionName", 2)) + } + if s.SerialNumber != nil && len(*s.SerialNumber) < 9 { + invalidParams.Add(request.NewErrParamMinLen("SerialNumber", 9)) + } + if s.TokenCode != nil && len(*s.TokenCode) < 6 { + invalidParams.Add(request.NewErrParamMinLen("TokenCode", 6)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Contains the response to a successful AssumeRole request, including temporary +// AWS credentials that can be used to make AWS requests. +type AssumeRoleOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers + // that you can use to refer to the resulting temporary security credentials. + // For example, you can reference these credentials as a principal in a resource-based + // policy by using the ARN or assumed role ID. The ARN and ID include the RoleSessionName + // that you specified when you called AssumeRole. + AssumedRoleUser *AssumedRoleUser `type:"structure"` + + // The temporary security credentials, which include an access key ID, a secret + // access key, and a security (or session) token. + // + // Note: The size of the security token that STS APIs return is not fixed. + // We strongly recommend that you make no assumptions about the maximum size. + // As of this writing, the typical size is less than 4096 bytes, but that can + // vary. Also, future updates to AWS might require larger sizes. + Credentials *Credentials `type:"structure"` + + // A percentage value that indicates the size of the policy in packed form. + // The service rejects any policy with a packed size greater than 100 percent, + // which means the policy exceeded the allowed space. + PackedPolicySize *int64 `type:"integer"` +} + +// String returns the string representation +func (s AssumeRoleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssumeRoleOutput) GoString() string { + return s.String() +} + +type AssumeRoleWithSAMLInput struct { + _ struct{} `type:"structure"` + + // The duration, in seconds, of the role session. The value can range from 900 + // seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set + // to 3600 seconds. An expiration can also be specified in the SAML authentication + // response's SessionNotOnOrAfter value. The actual expiration time is whichever + // value is shorter. + // + // This is separate from the duration of a console session that you might + // request using the returned credentials. The request to the federation endpoint + // for a console sign-in token takes a SessionDuration parameter that specifies + // the maximum length of the console session, separately from the DurationSeconds + // parameter on this API. For more information, see Enabling SAML 2.0 Federated + // Users to Access the AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-saml.html) + // in the IAM User Guide. + DurationSeconds *int64 `min:"900" type:"integer"` + + // An IAM policy in JSON format. + // + // The policy parameter is optional. If you pass a policy, the temporary security + // credentials that are returned by the operation have the permissions that + // are allowed by both the access policy of the role that is being assumed, + // and the policy that you pass. This gives you a way to further restrict + // the permissions for the resulting temporary security credentials. You cannot + // use the passed policy to grant permissions that are in excess of those allowed + // by the access policy of the role that is being assumed. For more information, + // Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) + // in the IAM User Guide. + // + // The format for this parameter, as described by its regex pattern, is a string + // of characters up to 2048 characters in length. The characters can be any + // ASCII character from the space character to the end of the valid character + // list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), + // and carriage return (\u000D) characters. + // + // The policy plain text must be 2048 bytes or shorter. However, an internal + // conversion compresses it into a packed binary format with a separate limit. + // The PackedPolicySize response element indicates by percentage how close to + // the upper size limit the policy is, with 100% equaling the maximum allowed + // size. + Policy *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the SAML provider in IAM that describes + // the IdP. + PrincipalArn *string `min:"20" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the role that the caller is assuming. + RoleArn *string `min:"20" type:"string" required:"true"` + + // The base-64 encoded SAML authentication response provided by the IdP. + // + // For more information, see Configuring a Relying Party and Adding Claims + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html) + // in the Using IAM guide. + SAMLAssertion *string `min:"4" type:"string" required:"true"` +} + +// String returns the string representation +func (s AssumeRoleWithSAMLInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssumeRoleWithSAMLInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssumeRoleWithSAMLInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssumeRoleWithSAMLInput"} + if s.DurationSeconds != nil && *s.DurationSeconds < 900 { + invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) + } + if s.Policy != nil && len(*s.Policy) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) + } + if s.PrincipalArn == nil { + invalidParams.Add(request.NewErrParamRequired("PrincipalArn")) + } + if s.PrincipalArn != nil && len(*s.PrincipalArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("PrincipalArn", 20)) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.RoleArn != nil && len(*s.RoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) + } + if s.SAMLAssertion == nil { + invalidParams.Add(request.NewErrParamRequired("SAMLAssertion")) + } + if s.SAMLAssertion != nil && len(*s.SAMLAssertion) < 4 { + invalidParams.Add(request.NewErrParamMinLen("SAMLAssertion", 4)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Contains the response to a successful AssumeRoleWithSAML request, including +// temporary AWS credentials that can be used to make AWS requests. +type AssumeRoleWithSAMLOutput struct { + _ struct{} `type:"structure"` + + // The identifiers for the temporary security credentials that the operation + // returns. + AssumedRoleUser *AssumedRoleUser `type:"structure"` + + // The value of the Recipient attribute of the SubjectConfirmationData element + // of the SAML assertion. + Audience *string `type:"string"` + + // The temporary security credentials, which include an access key ID, a secret + // access key, and a security (or session) token. + // + // Note: The size of the security token that STS APIs return is not fixed. + // We strongly recommend that you make no assumptions about the maximum size. + // As of this writing, the typical size is less than 4096 bytes, but that can + // vary. Also, future updates to AWS might require larger sizes. + Credentials *Credentials `type:"structure"` + + // The value of the Issuer element of the SAML assertion. + Issuer *string `type:"string"` + + // A hash value based on the concatenation of the Issuer response value, the + // AWS account ID, and the friendly name (the last part of the ARN) of the SAML + // provider in IAM. The combination of NameQualifier and Subject can be used + // to uniquely identify a federated user. + // + // The following pseudocode shows how the hash value is calculated: + // + // BASE64 ( SHA1 ( "https://example.com/saml" + "123456789012" + "/MySAMLIdP" + // ) ) + NameQualifier *string `type:"string"` + + // A percentage value that indicates the size of the policy in packed form. + // The service rejects any policy with a packed size greater than 100 percent, + // which means the policy exceeded the allowed space. + PackedPolicySize *int64 `type:"integer"` + + // The value of the NameID element in the Subject element of the SAML assertion. + Subject *string `type:"string"` + + // The format of the name ID, as defined by the Format attribute in the NameID + // element of the SAML assertion. Typical examples of the format are transient + // or persistent. + // + // If the format includes the prefix urn:oasis:names:tc:SAML:2.0:nameid-format, + // that prefix is removed. For example, urn:oasis:names:tc:SAML:2.0:nameid-format:transient + // is returned as transient. If the format includes any other prefix, the format + // is returned with no modifications. + SubjectType *string `type:"string"` +} + +// String returns the string representation +func (s AssumeRoleWithSAMLOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssumeRoleWithSAMLOutput) GoString() string { + return s.String() +} + +type AssumeRoleWithWebIdentityInput struct { + _ struct{} `type:"structure"` + + // The duration, in seconds, of the role session. The value can range from 900 + // seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set + // to 3600 seconds. + // + // This is separate from the duration of a console session that you might + // request using the returned credentials. The request to the federation endpoint + // for a console sign-in token takes a SessionDuration parameter that specifies + // the maximum length of the console session, separately from the DurationSeconds + // parameter on this API. For more information, see Creating a URL that Enables + // Federated Users to Access the AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) + // in the IAM User Guide. + DurationSeconds *int64 `min:"900" type:"integer"` + + // An IAM policy in JSON format. + // + // The policy parameter is optional. If you pass a policy, the temporary security + // credentials that are returned by the operation have the permissions that + // are allowed by both the access policy of the role that is being assumed, + // and the policy that you pass. This gives you a way to further restrict + // the permissions for the resulting temporary security credentials. You cannot + // use the passed policy to grant permissions that are in excess of those allowed + // by the access policy of the role that is being assumed. For more information, + // see Permissions for AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) + // in the IAM User Guide. + // + // The format for this parameter, as described by its regex pattern, is a string + // of characters up to 2048 characters in length. The characters can be any + // ASCII character from the space character to the end of the valid character + // list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), + // and carriage return (\u000D) characters. + // + // The policy plain text must be 2048 bytes or shorter. However, an internal + // conversion compresses it into a packed binary format with a separate limit. + // The PackedPolicySize response element indicates by percentage how close to + // the upper size limit the policy is, with 100% equaling the maximum allowed + // size. + Policy *string `min:"1" type:"string"` + + // The fully qualified host component of the domain name of the identity provider. + // + // Specify this value only for OAuth 2.0 access tokens. Currently www.amazon.com + // and graph.facebook.com are the only supported identity providers for OAuth + // 2.0 access tokens. Do not include URL schemes and port numbers. + // + // Do not specify this value for OpenID Connect ID tokens. + ProviderId *string `min:"4" type:"string"` + + // The Amazon Resource Name (ARN) of the role that the caller is assuming. + RoleArn *string `min:"20" type:"string" required:"true"` + + // An identifier for the assumed role session. Typically, you pass the name + // or identifier that is associated with the user who is using your application. + // That way, the temporary security credentials that your application will use + // are associated with that user. This session name is included as part of the + // ARN and assumed role ID in the AssumedRoleUser response element. + // + // The format for this parameter, as described by its regex pattern, is a string + // of characters consisting of upper- and lower-case alphanumeric characters + // with no spaces. You can also include underscores or any of the following + // characters: =,.@- + RoleSessionName *string `min:"2" type:"string" required:"true"` + + // The OAuth 2.0 access token or OpenID Connect ID token that is provided by + // the identity provider. Your application must get this token by authenticating + // the user who is using your application with a web identity provider before + // the application makes an AssumeRoleWithWebIdentity call. + WebIdentityToken *string `min:"4" type:"string" required:"true"` +} + +// String returns the string representation +func (s AssumeRoleWithWebIdentityInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssumeRoleWithWebIdentityInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssumeRoleWithWebIdentityInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssumeRoleWithWebIdentityInput"} + if s.DurationSeconds != nil && *s.DurationSeconds < 900 { + invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) + } + if s.Policy != nil && len(*s.Policy) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) + } + if s.ProviderId != nil && len(*s.ProviderId) < 4 { + invalidParams.Add(request.NewErrParamMinLen("ProviderId", 4)) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.RoleArn != nil && len(*s.RoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) + } + if s.RoleSessionName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleSessionName")) + } + if s.RoleSessionName != nil && len(*s.RoleSessionName) < 2 { + invalidParams.Add(request.NewErrParamMinLen("RoleSessionName", 2)) + } + if s.WebIdentityToken == nil { + invalidParams.Add(request.NewErrParamRequired("WebIdentityToken")) + } + if s.WebIdentityToken != nil && len(*s.WebIdentityToken) < 4 { + invalidParams.Add(request.NewErrParamMinLen("WebIdentityToken", 4)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Contains the response to a successful AssumeRoleWithWebIdentity request, +// including temporary AWS credentials that can be used to make AWS requests. +type AssumeRoleWithWebIdentityOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers + // that you can use to refer to the resulting temporary security credentials. + // For example, you can reference these credentials as a principal in a resource-based + // policy by using the ARN or assumed role ID. The ARN and ID include the RoleSessionName + // that you specified when you called AssumeRole. + AssumedRoleUser *AssumedRoleUser `type:"structure"` + + // The intended audience (also known as client ID) of the web identity token. + // This is traditionally the client identifier issued to the application that + // requested the web identity token. + Audience *string `type:"string"` + + // The temporary security credentials, which include an access key ID, a secret + // access key, and a security token. + // + // Note: The size of the security token that STS APIs return is not fixed. + // We strongly recommend that you make no assumptions about the maximum size. + // As of this writing, the typical size is less than 4096 bytes, but that can + // vary. Also, future updates to AWS might require larger sizes. + Credentials *Credentials `type:"structure"` + + // A percentage value that indicates the size of the policy in packed form. + // The service rejects any policy with a packed size greater than 100 percent, + // which means the policy exceeded the allowed space. + PackedPolicySize *int64 `type:"integer"` + + // The issuing authority of the web identity token presented. For OpenID Connect + // ID Tokens this contains the value of the iss field. For OAuth 2.0 access + // tokens, this contains the value of the ProviderId parameter that was passed + // in the AssumeRoleWithWebIdentity request. + Provider *string `type:"string"` + + // The unique user identifier that is returned by the identity provider. This + // identifier is associated with the WebIdentityToken that was submitted with + // the AssumeRoleWithWebIdentity call. The identifier is typically unique to + // the user and the application that acquired the WebIdentityToken (pairwise + // identifier). For OpenID Connect ID tokens, this field contains the value + // returned by the identity provider as the token's sub (Subject) claim. + SubjectFromWebIdentityToken *string `min:"6" type:"string"` +} + +// String returns the string representation +func (s AssumeRoleWithWebIdentityOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssumeRoleWithWebIdentityOutput) GoString() string { + return s.String() +} + +// The identifiers for the temporary security credentials that the operation +// returns. +type AssumedRoleUser struct { + _ struct{} `type:"structure"` + + // The ARN of the temporary security credentials that are returned from the + // AssumeRole action. For more information about ARNs and how to use them in + // policies, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) + // in Using IAM. + Arn *string `min:"20" type:"string" required:"true"` + + // A unique identifier that contains the role ID and the role session name of + // the role that is being assumed. The role ID is generated by AWS when the + // role is created. + AssumedRoleId *string `min:"2" type:"string" required:"true"` +} + +// String returns the string representation +func (s AssumedRoleUser) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssumedRoleUser) GoString() string { + return s.String() +} + +// AWS credentials for API authentication. +type Credentials struct { + _ struct{} `type:"structure"` + + // The access key ID that identifies the temporary security credentials. + AccessKeyId *string `min:"16" type:"string" required:"true"` + + // The date on which the current credentials expire. + Expiration *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` + + // The secret access key that can be used to sign requests. + SecretAccessKey *string `type:"string" required:"true"` + + // The token that users must pass to the service API to use the temporary credentials. + SessionToken *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s Credentials) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Credentials) GoString() string { + return s.String() +} + +type DecodeAuthorizationMessageInput struct { + _ struct{} `type:"structure"` + + // The encoded message that was returned with the response. + EncodedMessage *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DecodeAuthorizationMessageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DecodeAuthorizationMessageInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DecodeAuthorizationMessageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DecodeAuthorizationMessageInput"} + if s.EncodedMessage == nil { + invalidParams.Add(request.NewErrParamRequired("EncodedMessage")) + } + if s.EncodedMessage != nil && len(*s.EncodedMessage) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EncodedMessage", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// A document that contains additional information about the authorization status +// of a request from an encoded message that is returned in response to an AWS +// request. +type DecodeAuthorizationMessageOutput struct { + _ struct{} `type:"structure"` + + // An XML document that contains the decoded message. + DecodedMessage *string `type:"string"` +} + +// String returns the string representation +func (s DecodeAuthorizationMessageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DecodeAuthorizationMessageOutput) GoString() string { + return s.String() +} + +// Identifiers for the federated user that is associated with the credentials. +type FederatedUser struct { + _ struct{} `type:"structure"` + + // The ARN that specifies the federated user that is associated with the credentials. + // For more information about ARNs and how to use them in policies, see IAM + // Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) + // in Using IAM. + Arn *string `min:"20" type:"string" required:"true"` + + // The string that identifies the federated user associated with the credentials, + // similar to the unique ID of an IAM user. + FederatedUserId *string `min:"2" type:"string" required:"true"` +} + +// String returns the string representation +func (s FederatedUser) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FederatedUser) GoString() string { + return s.String() +} + +type GetCallerIdentityInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s GetCallerIdentityInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCallerIdentityInput) GoString() string { + return s.String() +} + +// Contains the response to a successful GetCallerIdentity request, including +// information about the entity making the request. +type GetCallerIdentityOutput struct { + _ struct{} `type:"structure"` + + // The AWS account ID number of the account that owns or contains the calling + // entity. + Account *string `type:"string"` + + // The AWS ARN associated with the calling entity. + Arn *string `min:"20" type:"string"` + + // The unique identifier of the calling entity. The exact value depends on the + // type of entity making the call. The values returned are those listed in the + // aws:userid column in the Principal table (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable) + // found on the Policy Variables reference page in the IAM User Guide. + UserId *string `type:"string"` +} + +// String returns the string representation +func (s GetCallerIdentityOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCallerIdentityOutput) GoString() string { + return s.String() +} + +type GetFederationTokenInput struct { + _ struct{} `type:"structure"` + + // The duration, in seconds, that the session should last. Acceptable durations + // for federation sessions range from 900 seconds (15 minutes) to 129600 seconds + // (36 hours), with 43200 seconds (12 hours) as the default. Sessions obtained + // using AWS account (root) credentials are restricted to a maximum of 3600 + // seconds (one hour). If the specified duration is longer than one hour, the + // session obtained by using AWS account (root) credentials defaults to one + // hour. + DurationSeconds *int64 `min:"900" type:"integer"` + + // The name of the federated user. The name is used as an identifier for the + // temporary security credentials (such as Bob). For example, you can reference + // the federated user name in a resource-based policy, such as in an Amazon + // S3 bucket policy. + // + // The format for this parameter, as described by its regex pattern, is a string + // of characters consisting of upper- and lower-case alphanumeric characters + // with no spaces. You can also include underscores or any of the following + // characters: =,.@- + Name *string `min:"2" type:"string" required:"true"` + + // An IAM policy in JSON format that is passed with the GetFederationToken call + // and evaluated along with the policy or policies that are attached to the + // IAM user whose credentials are used to call GetFederationToken. The passed + // policy is used to scope down the permissions that are available to the IAM + // user, by allowing only a subset of the permissions that are granted to the + // IAM user. The passed policy cannot grant more permissions than those granted + // to the IAM user. The final permissions for the federated user are the most + // restrictive set based on the intersection of the passed policy and the IAM + // user policy. + // + // If you do not pass a policy, the resulting temporary security credentials + // have no effective permissions. The only exception is when the temporary security + // credentials are used to access a resource that has a resource-based policy + // that specifically allows the federated user to access the resource. + // + // The format for this parameter, as described by its regex pattern, is a string + // of characters up to 2048 characters in length. The characters can be any + // ASCII character from the space character to the end of the valid character + // list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), + // and carriage return (\u000D) characters. + // + // The policy plain text must be 2048 bytes or shorter. However, an internal + // conversion compresses it into a packed binary format with a separate limit. + // The PackedPolicySize response element indicates by percentage how close to + // the upper size limit the policy is, with 100% equaling the maximum allowed + // size. + // + // For more information about how permissions work, see Permissions for GetFederationToken + // (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html). + Policy *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s GetFederationTokenInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFederationTokenInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetFederationTokenInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetFederationTokenInput"} + if s.DurationSeconds != nil && *s.DurationSeconds < 900 { + invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 2 { + invalidParams.Add(request.NewErrParamMinLen("Name", 2)) + } + if s.Policy != nil && len(*s.Policy) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Contains the response to a successful GetFederationToken request, including +// temporary AWS credentials that can be used to make AWS requests. +type GetFederationTokenOutput struct { + _ struct{} `type:"structure"` + + // The temporary security credentials, which include an access key ID, a secret + // access key, and a security (or session) token. + // + // Note: The size of the security token that STS APIs return is not fixed. + // We strongly recommend that you make no assumptions about the maximum size. + // As of this writing, the typical size is less than 4096 bytes, but that can + // vary. Also, future updates to AWS might require larger sizes. + Credentials *Credentials `type:"structure"` + + // Identifiers for the federated user associated with the credentials (such + // as arn:aws:sts::123456789012:federated-user/Bob or 123456789012:Bob). You + // can use the federated user's ARN in your resource-based policies, such as + // an Amazon S3 bucket policy. + FederatedUser *FederatedUser `type:"structure"` + + // A percentage value indicating the size of the policy in packed form. The + // service rejects policies for which the packed size is greater than 100 percent + // of the allowed value. + PackedPolicySize *int64 `type:"integer"` +} + +// String returns the string representation +func (s GetFederationTokenOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFederationTokenOutput) GoString() string { + return s.String() +} + +type GetSessionTokenInput struct { + _ struct{} `type:"structure"` + + // The duration, in seconds, that the credentials should remain valid. Acceptable + // durations for IAM user sessions range from 900 seconds (15 minutes) to 129600 + // seconds (36 hours), with 43200 seconds (12 hours) as the default. Sessions + // for AWS account owners are restricted to a maximum of 3600 seconds (one hour). + // If the duration is longer than one hour, the session for AWS account owners + // defaults to one hour. + DurationSeconds *int64 `min:"900" type:"integer"` + + // The identification number of the MFA device that is associated with the IAM + // user who is making the GetSessionToken call. Specify this value if the IAM + // user has a policy that requires MFA authentication. The value is either the + // serial number for a hardware device (such as GAHT12345678) or an Amazon Resource + // Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user). + // You can find the device for an IAM user by going to the AWS Management Console + // and viewing the user's security credentials. + // + // The format for this parameter, as described by its regex pattern, is a string + // of characters consisting of upper- and lower-case alphanumeric characters + // with no spaces. You can also include underscores or any of the following + // characters: =,.@- + SerialNumber *string `min:"9" type:"string"` + + // The value provided by the MFA device, if MFA is required. If any policy requires + // the IAM user to submit an MFA code, specify this value. If MFA authentication + // is required, and the user does not provide a code when requesting a set of + // temporary security credentials, the user will receive an "access denied" + // response when requesting resources that require MFA authentication. + // + // The format for this parameter, as described by its regex pattern, is a sequence + // of six numeric digits. + TokenCode *string `min:"6" type:"string"` +} + +// String returns the string representation +func (s GetSessionTokenInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSessionTokenInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetSessionTokenInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSessionTokenInput"} + if s.DurationSeconds != nil && *s.DurationSeconds < 900 { + invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) + } + if s.SerialNumber != nil && len(*s.SerialNumber) < 9 { + invalidParams.Add(request.NewErrParamMinLen("SerialNumber", 9)) + } + if s.TokenCode != nil && len(*s.TokenCode) < 6 { + invalidParams.Add(request.NewErrParamMinLen("TokenCode", 6)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Contains the response to a successful GetSessionToken request, including +// temporary AWS credentials that can be used to make AWS requests. +type GetSessionTokenOutput struct { + _ struct{} `type:"structure"` + + // The temporary security credentials, which include an access key ID, a secret + // access key, and a security (or session) token. + // + // Note: The size of the security token that STS APIs return is not fixed. + // We strongly recommend that you make no assumptions about the maximum size. + // As of this writing, the typical size is less than 4096 bytes, but that can + // vary. Also, future updates to AWS might require larger sizes. + Credentials *Credentials `type:"structure"` +} + +// String returns the string representation +func (s GetSessionTokenOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSessionTokenOutput) GoString() string { + return s.String() +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go new file mode 100644 index 000000000..4010cc7fa --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go @@ -0,0 +1,12 @@ +package sts + +import "github.com/aws/aws-sdk-go/aws/request" + +func init() { + initRequest = func(r *request.Request) { + switch r.Operation.Name { + case opAssumeRoleWithSAML, opAssumeRoleWithWebIdentity: + r.Handlers.Sign.Clear() // these operations are unsigned + } + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/customizations_test.go b/vendor/github.com/aws/aws-sdk-go/service/sts/customizations_test.go new file mode 100644 index 000000000..6f870d35e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/customizations_test.go @@ -0,0 +1,39 @@ +package sts_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/awstesting/unit" + "github.com/aws/aws-sdk-go/service/sts" +) + +var svc = sts.New(unit.Session, &aws.Config{ + Region: aws.String("mock-region"), +}) + +func TestUnsignedRequest_AssumeRoleWithSAML(t *testing.T) { + req, _ := svc.AssumeRoleWithSAMLRequest(&sts.AssumeRoleWithSAMLInput{ + PrincipalArn: aws.String("ARN01234567890123456789"), + RoleArn: aws.String("ARN01234567890123456789"), + SAMLAssertion: aws.String("ASSERT"), + }) + + err := req.Sign() + assert.NoError(t, err) + assert.Equal(t, "", req.HTTPRequest.Header.Get("Authorization")) +} + +func TestUnsignedRequest_AssumeRoleWithWebIdentity(t *testing.T) { + req, _ := svc.AssumeRoleWithWebIdentityRequest(&sts.AssumeRoleWithWebIdentityInput{ + RoleArn: aws.String("ARN01234567890123456789"), + RoleSessionName: aws.String("SESSION"), + WebIdentityToken: aws.String("TOKEN"), + }) + + err := req.Sign() + assert.NoError(t, err) + assert.Equal(t, "", req.HTTPRequest.Header.Get("Authorization")) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/sts/examples_test.go new file mode 100644 index 000000000..2724ed4d4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/examples_test.go @@ -0,0 +1,208 @@ +// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. + +package sts_test + +import ( + "bytes" + "fmt" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/sts" +) + +var _ time.Duration +var _ bytes.Buffer + +func ExampleSTS_AssumeRole() { + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sts.New(sess) + + params := &sts.AssumeRoleInput{ + RoleArn: aws.String("arnType"), // Required + RoleSessionName: aws.String("roleSessionNameType"), // Required + DurationSeconds: aws.Int64(1), + ExternalId: aws.String("externalIdType"), + Policy: aws.String("sessionPolicyDocumentType"), + SerialNumber: aws.String("serialNumberType"), + TokenCode: aws.String("tokenCodeType"), + } + resp, err := svc.AssumeRole(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleSTS_AssumeRoleWithSAML() { + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sts.New(sess) + + params := &sts.AssumeRoleWithSAMLInput{ + PrincipalArn: aws.String("arnType"), // Required + RoleArn: aws.String("arnType"), // Required + SAMLAssertion: aws.String("SAMLAssertionType"), // Required + DurationSeconds: aws.Int64(1), + Policy: aws.String("sessionPolicyDocumentType"), + } + resp, err := svc.AssumeRoleWithSAML(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleSTS_AssumeRoleWithWebIdentity() { + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sts.New(sess) + + params := &sts.AssumeRoleWithWebIdentityInput{ + RoleArn: aws.String("arnType"), // Required + RoleSessionName: aws.String("roleSessionNameType"), // Required + WebIdentityToken: aws.String("clientTokenType"), // Required + DurationSeconds: aws.Int64(1), + Policy: aws.String("sessionPolicyDocumentType"), + ProviderId: aws.String("urlType"), + } + resp, err := svc.AssumeRoleWithWebIdentity(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleSTS_DecodeAuthorizationMessage() { + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sts.New(sess) + + params := &sts.DecodeAuthorizationMessageInput{ + EncodedMessage: aws.String("encodedMessageType"), // Required + } + resp, err := svc.DecodeAuthorizationMessage(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleSTS_GetCallerIdentity() { + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sts.New(sess) + + var params *sts.GetCallerIdentityInput + resp, err := svc.GetCallerIdentity(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleSTS_GetFederationToken() { + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sts.New(sess) + + params := &sts.GetFederationTokenInput{ + Name: aws.String("userNameType"), // Required + DurationSeconds: aws.Int64(1), + Policy: aws.String("sessionPolicyDocumentType"), + } + resp, err := svc.GetFederationToken(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleSTS_GetSessionToken() { + sess, err := session.NewSession() + if err != nil { + fmt.Println("failed to create session,", err) + return + } + + svc := sts.New(sess) + + params := &sts.GetSessionTokenInput{ + DurationSeconds: aws.Int64(1), + SerialNumber: aws.String("serialNumberType"), + TokenCode: aws.String("tokenCodeType"), + } + resp, err := svc.GetSessionToken(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/service.go b/vendor/github.com/aws/aws-sdk-go/service/sts/service.go new file mode 100644 index 000000000..c938e6ca1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/service.go @@ -0,0 +1,130 @@ +// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. + +package sts + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" + "github.com/aws/aws-sdk-go/private/protocol/query" +) + +// The AWS Security Token Service (STS) is a web service that enables you to +// request temporary, limited-privilege credentials for AWS Identity and Access +// Management (IAM) users or for users that you authenticate (federated users). +// This guide provides descriptions of the STS API. For more detailed information +// about using this service, go to Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html). +// +// As an alternative to using the API, you can use one of the AWS SDKs, which +// consist of libraries and sample code for various programming languages and +// platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient +// way to create programmatic access to STS. For example, the SDKs take care +// of cryptographically signing requests, managing errors, and retrying requests +// automatically. For information about the AWS SDKs, including how to download +// and install them, see the Tools for Amazon Web Services page (http://aws.amazon.com/tools/). +// +// For information about setting up signatures and authorization through the +// API, go to Signing AWS API Requests (http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html) +// in the AWS General Reference. For general information about the Query API, +// go to Making Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html) +// in Using IAM. For information about using security tokens with other AWS +// products, go to AWS Services That Work with IAM (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html) +// in the IAM User Guide. +// +// If you're new to AWS and need additional technical information about a specific +// AWS product, you can find the product's technical documentation at http://aws.amazon.com/documentation/ +// (http://aws.amazon.com/documentation/). +// +// Endpoints +// +// The AWS Security Token Service (STS) has a default endpoint of https://sts.amazonaws.com +// that maps to the US East (N. Virginia) region. Additional regions are available +// and are activated by default. For more information, see Activating and Deactivating +// AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// in the IAM User Guide. +// +// For information about STS endpoints, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#sts_region) +// in the AWS General Reference. +// +// Recording API requests +// +// STS supports AWS CloudTrail, which is a service that records AWS calls for +// your AWS account and delivers log files to an Amazon S3 bucket. By using +// information collected by CloudTrail, you can determine what requests were +// successfully made to STS, who made the request, when it was made, and so +// on. To learn more about CloudTrail, including how to turn it on and find +// your log files, see the AWS CloudTrail User Guide (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html). +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type STS struct { + *client.Client +} + +// Used for custom client initialization logic +var initClient func(*client.Client) + +// Used for custom request initialization logic +var initRequest func(*request.Request) + +// A ServiceName is the name of the service the client will make API calls to. +const ServiceName = "sts" + +// New creates a new instance of the STS 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: +// // Create a STS client from just a session. +// svc := sts.New(mySession) +// +// // Create a STS client with additional configuration +// svc := sts.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *STS { + c := p.ClientConfig(ServiceName, cfgs...) + return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *STS { + svc := &STS{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2011-06-15", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) + svc.Handlers.Build.PushBackNamed(query.BuildHandler) + svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) + svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) + svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a STS operation and runs any +// custom request initialization. +func (c *STS) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + // Run custom request initialization if present + if initRequest != nil { + initRequest(req) + } + + return req +} diff --git a/vendor/vendor.json b/vendor/vendor.json index 65ece086c..bcbbab464 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -24,280 +24,292 @@ "revisionTime": "2016-03-29T13:52:53Z" }, { - "checksumSHA1": "cd0bMwFvxcXV2eGQddRPPIWjJhk=", + "checksumSHA1": "+/Gdsex02bu/UiE7a81GbVD0nAQ=", "path": "github.com/aws/aws-sdk-go/aws", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "AWg3FBA1NTPdIVZipaQf/rGx38o=", + "checksumSHA1": "Y9W+4GimK4Fuxq+vyIskVYFRnX4=", "path": "github.com/aws/aws-sdk-go/aws/awserr", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { "checksumSHA1": "6YvMGcO1vw1iDoTD5jCYxTKVHyE=", "path": "github.com/aws/aws-sdk-go/aws/awsutil", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { "checksumSHA1": "RsYlRfQceaAgqjIrExwNsb/RBEM=", "path": "github.com/aws/aws-sdk-go/aws/client", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { "checksumSHA1": "ieAJ+Cvp/PKv1LpUEnUXpc3OI6E=", "path": "github.com/aws/aws-sdk-go/aws/client/metadata", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "2kisALlB2/LZkxlucVvCm+1/mZ8=", + "checksumSHA1": "L1TY4KXh7j9yxOl+ycSCzz+NuBc=", "path": "github.com/aws/aws-sdk-go/aws/corehandlers", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "CC8BP+QNXIs3MprvuXAT6j5oQfs=", + "checksumSHA1": "7B+YYz8+XfI/ZNuLTiD9SrqrOXI=", "path": "github.com/aws/aws-sdk-go/aws/credentials", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "Yh3b24h9uG8ztCuGrzBWB3YwVVo=", + "checksumSHA1": "9VQxp2QbvjOFDVhAt/duav5MKBk=", "path": "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { "checksumSHA1": "3gcwv0Ttdiby3736WSTLqc6hsNk=", "path": "github.com/aws/aws-sdk-go/aws/credentials/endpointcreds", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "M+guiPKDRgN+UiWi7XvOLzvrCTg=", + "checksumSHA1": "hLaDzYTAhvemkEVmTLrbZncbtEo=", + "path": "github.com/aws/aws-sdk-go/aws/credentials/stscreds", + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" + }, + { + "checksumSHA1": "QvaXR3969pX8okRa24e5KlbKYvM=", "path": "github.com/aws/aws-sdk-go/aws/defaults", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "2HqBdkS1hmV6tRoCWENP7zhP76c=", + "checksumSHA1": "6WkSKiDKyy5fLbVUImLCUcE044o=", "path": "github.com/aws/aws-sdk-go/aws/ec2metadata", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "mwugyLtLV9uacjf+XYXGv3UpUko=", + "checksumSHA1": "WgHBLXiXuIoJkLcAtZdj88LH6LE=", "path": "github.com/aws/aws-sdk-go/aws/request", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "JZWWt+LwSsUHDHqRyBRLf1BAT4s=", + "checksumSHA1": "uXdKO0aCUavub4GJS9kCOeV7Wx8=", "path": "github.com/aws/aws-sdk-go/aws/session", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "XFTGU2ApGEO3lpYP8C0FC+R92zI=", + "checksumSHA1": "NYkcvm3VpU1HszAnKlO3Vbb0Zus=", "path": "github.com/aws/aws-sdk-go/aws/signer/v4", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "pKrneJCsQv3jpiSlOlxN9PxcnhQ=", + "checksumSHA1": "esX8WhTJEaVSI8bIPHU3Zxc8Vq0=", "path": "github.com/aws/aws-sdk-go/awstesting", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "fY/HE8hjs/8eAK3FLmh0LJFF8No=", + "checksumSHA1": "rVOBmIlMWNf9odB4+3XMaxrGYZI=", "path": "github.com/aws/aws-sdk-go/awstesting/mock", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "EH5bYi2J/M/U8nmx+3Ewai/NCzc=", + "checksumSHA1": "MIp5H1niMhCZFAwYsjJx9NxmHIc=", "path": "github.com/aws/aws-sdk-go/awstesting/unit", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "zQ53hIbmk6OBHojC2TqZARrsrIU=", + "checksumSHA1": "EwGo5cMy2pMoNWn7ktBuHO3pyi4=", "path": "github.com/aws/aws-sdk-go/private/endpoints", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { "checksumSHA1": "YVb6IGbsYv0bBxIflqDLow+vnmY=", "path": "github.com/aws/aws-sdk-go/private/protocol", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "hweLpuDFGlO2S/yWsHYUPeeW9ck=", + "checksumSHA1": "mx1S8GpO5s3KqIhsHiGb6LdSTyo=", "path": "github.com/aws/aws-sdk-go/private/protocol/ec2query", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "a5aOQgdCqa6fuvy8DUVVHX4Twe4=", + "checksumSHA1": "5xvYC52/zmt8tyIT2usGUS/ipJ0=", "path": "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "ndzY8VCNtlHyyj2AKPJdZEP88Bg=", + "checksumSHA1": "gMYxNvoK/thKchEEUPbWWaJBtt4=", "path": "github.com/aws/aws-sdk-go/private/protocol/jsonrpc", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "KJceL/Q6o3qXyQfn+vXwv34K7dg=", + "checksumSHA1": "Rx1LN1TG+hYxZQqR7BEATFw95KU=", "path": "github.com/aws/aws-sdk-go/private/protocol/query", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { "checksumSHA1": "5xzix1R8prUyWxgLnzUQoxTsfik=", "path": "github.com/aws/aws-sdk-go/private/protocol/query/queryutil", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { "checksumSHA1": "TW/7U+/8ormL7acf6z2rv2hDD+s=", "path": "github.com/aws/aws-sdk-go/private/protocol/rest", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "WkstFGAC/qQkfhDUBeGKBwfG9wM=", + "checksumSHA1": "nsSoC+hesCKaUTt4wWI+yS+05gE=", "path": "github.com/aws/aws-sdk-go/private/protocol/restjson", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "3KvJTtdyUolBR67g2CUxmySfiV4=", + "checksumSHA1": "LgfoCQivD8PAMInD3qGNFFu2S1I=", "path": "github.com/aws/aws-sdk-go/private/protocol/restxml", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "LsCIsjbzX2r3n/AhpNJvAC5ueNA=", + "checksumSHA1": "eUEkjyMPAuekKBE4ou+nM9tXEas=", "path": "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { "checksumSHA1": "01b4hmyUzoReoOyEDylDinWBSdA=", "path": "github.com/aws/aws-sdk-go/private/util", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { "checksumSHA1": "QbEoYQYx91JTBRjDy+uyerMim+Y=", "path": "github.com/aws/aws-sdk-go/private/waiter", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "fsL/7p6FRIag9UCHURK1BLmoRyM=", + "checksumSHA1": "YEx9E2357gm7GQTgPIlcxmg6UrY=", "path": "github.com/aws/aws-sdk-go/service/cloudformation", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "T8ehAGE47SQWm0aV+A+w1dRd2tA=", + "checksumSHA1": "dHnEMjh9xBSnDjTKuzBpoA8G9X8=", "path": "github.com/aws/aws-sdk-go/service/cloudfront", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "CjFK9xbsgv7GyDcPcHU6PZYgbK4=", + "checksumSHA1": "FjCKPA7gxB0+YYXZY9XHRz/blr0=", "path": "github.com/aws/aws-sdk-go/service/cloudwatchlogs", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "qh4LiL5Rpbw79urNdMtJTkxNVvM=", + "checksumSHA1": "l0BCJS2A1Bku+evb1MPStzQPhQ8=", "path": "github.com/aws/aws-sdk-go/service/dynamodb", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "q42AHIsN21AWl4GwjBrtkLlvidQ=", + "checksumSHA1": "vfoskQVcBfl9KcJgXwPtk+ehL+k=", "path": "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "wxfIsqqdlhKhc18m+sakdWNPUwU=", + "checksumSHA1": "vpNvutYaVesDA7TeAFXlQmBv68Y=", "path": "github.com/aws/aws-sdk-go/service/ec2", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "1wFPNe28FfaA29yYov7PKet2CpM=", + "checksumSHA1": "O/2vKlc2qa/qbyHRcAjfot+u2mo=", "path": "github.com/aws/aws-sdk-go/service/ecr", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "srf8TWL0DkqTMfxtlxKgsi+uBmo=", + "checksumSHA1": "dKEUUchPbPOPyp0tKXzJvCav8QU=", "path": "github.com/aws/aws-sdk-go/service/ecs", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "EiKYTbUUg5b4XeWSH9PofN1su/M=", + "checksumSHA1": "nk6xVWp5JUPxkRcIBpabAXh5ojE=", "path": "github.com/aws/aws-sdk-go/service/elastictranscoder", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "IMN3x2O3Tn4hEt63TAQeF6qgrJQ=", + "checksumSHA1": "N2XjQVx7FBg1kL9yV6riF00RkoI=", "path": "github.com/aws/aws-sdk-go/service/elb", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "OL0xwyKehfjuXBGU/EvqewS0MCY=", + "checksumSHA1": "nuqeo2fPLj5Qyn2wrOyrSMPjIoo=", "path": "github.com/aws/aws-sdk-go/service/kinesis", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { "checksumSHA1": "fgZ1cdh2T0cWRorIZkMGFDADMQw=", "path": "github.com/aws/aws-sdk-go/service/kinesis/kinesisiface", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "37gLZABCd4asF1aFiXX1G9c2etg=", + "checksumSHA1": "PTU43XPBy7fOC5BpIV7P+lYgj5w=", "path": "github.com/aws/aws-sdk-go/service/route53", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "/l26dn/k0muvpgDScP0PObbWUjw=", + "checksumSHA1": "5JU5urw9w5gwKwOZpYOSl1mab3w=", "path": "github.com/aws/aws-sdk-go/service/s3", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "ljpmeBvpiHKfuneAfvZZuNFZ644=", + "checksumSHA1": "HnScYQElrxlTjw4l2VrBgAZXZF0=", "path": "github.com/aws/aws-sdk-go/service/sns", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { - "checksumSHA1": "EKwE+pctBWOSJSz8pfufm77cKYs=", + "checksumSHA1": "vl0diz87pyWOsZ6SV3FWLfuLqXk=", "path": "github.com/aws/aws-sdk-go/service/sqs", - "revision": "3c37d29820480639ff03fd66df00a0f27984f88d", - "revisionTime": "2016-07-13T21:13:24Z" + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" + }, + { + "checksumSHA1": "2eGq+BbUsbmgxdxiD+Xy13JlYcM=", + "path": "github.com/aws/aws-sdk-go/service/sts", + "revision": "f80e7d0182a463dff0c0da6bbed57f21369d4346", + "revisionTime": "2016-08-11T16:24:59Z" }, { "path": "github.com/bgentry/go-netrc/netrc", From c0ffa3714900d39955901565e5f86721588429ba Mon Sep 17 00:00:00 2001 From: "Eric J. Holmes" Date: Thu, 11 Aug 2016 11:58:30 -0700 Subject: [PATCH 2/3] Switch to Application Load Balancers. --- cmd/empire/factories.go | 1 + cmd/empire/main.go | 6 + docs/cloudformation.json | 11 +- pkg/troposphere/troposphere.go | 1 + scheduler/cloudformation/template.go | 237 +++++++--- scheduler/cloudformation/template_test.go | 78 ++++ .../cloudformation/templates/basic-alb.json | 319 ++++++++++++++ .../cloudformation/templates/https-alb.json | 416 ++++++++++++++++++ server/cloudformation/ecs.go | 2 + 9 files changed, 1000 insertions(+), 71 deletions(-) create mode 100644 scheduler/cloudformation/templates/basic-alb.json create mode 100644 scheduler/cloudformation/templates/https-alb.json diff --git a/cmd/empire/factories.go b/cmd/empire/factories.go index 0675b57b3..4ebae6f99 100644 --- a/cmd/empire/factories.go +++ b/cmd/empire/factories.go @@ -149,6 +149,7 @@ func newCloudFormationScheduler(db *empire.DB, c *Context) (*cloudformation.Sche } t := &cloudformation.EmpireTemplate{ + VpcId: c.String(FlagELBVpcId), Cluster: c.String(FlagECSCluster), InternalSecurityGroupID: c.String(FlagELBSGPrivate), ExternalSecurityGroupID: c.String(FlagELBSGPublic), diff --git a/cmd/empire/main.go b/cmd/empire/main.go index b12606842..8dda1f339 100644 --- a/cmd/empire/main.go +++ b/cmd/empire/main.go @@ -53,6 +53,7 @@ const ( FlagELBSGPrivate = "elb.sg.private" FlagELBSGPublic = "elb.sg.public" + FlagELBVpcId = "elb.vpc.id" FlagEC2SubnetsPrivate = "ec2.subnets.private" FlagEC2SubnetsPublic = "ec2.subnets.public" @@ -278,6 +279,11 @@ var EmpireFlags = []cli.Flag{ Usage: "The ELB security group to assign public load balancers", EnvVar: "EMPIRE_ELB_SG_PUBLIC", }, + cli.StringFlag{ + Name: FlagELBVpcId, + Usage: "The comma separated private subnet ids", + EnvVar: "EMPIRE_ELB_VPC_ID", + }, cli.StringSliceFlag{ Name: FlagEC2SubnetsPrivate, Value: &cli.StringSlice{}, diff --git a/docs/cloudformation.json b/docs/cloudformation.json index 2448e6a42..76027dc62 100644 --- a/docs/cloudformation.json +++ b/docs/cloudformation.json @@ -507,16 +507,7 @@ { "Effect": "Allow", "Action": [ - "elasticloadbalancing:DeleteLoadBalancer", - "elasticloadbalancing:CreateLoadBalancer", - "elasticloadbalancing:DescribeLoadBalancers", - "elasticloadbalancing:DescribeTags", - "elasticloadbalancing:ConfigureHealthCheck", - "elasticloadbalancing:ModifyLoadBalancerAttributes", - "elasticloadbalancing:SetLoadBalancerListenerSSLCertificate", - "elasticloadbalancing:CreateLoadBalancerListeners", - "elasticloadbalancing:DeleteLoadBalancerListeners", - "elasticloadbalancing:SetLoadBalancerPoliciesOfListener" + "elasticloadbalancing:*" ], "Resource": ["*"] }, diff --git a/pkg/troposphere/troposphere.go b/pkg/troposphere/troposphere.go index 6c5c548d4..f365d3f37 100644 --- a/pkg/troposphere/troposphere.go +++ b/pkg/troposphere/troposphere.go @@ -45,6 +45,7 @@ type Output struct { // Resource represents a CloudFormation Resource. type Resource struct { Condition interface{} `json:"Condition,omitempty"` + DependsOn interface{} `json:"DependsOn,omitempty"` Properties interface{} `json:"Properties,omitempty"` Type interface{} `json:"Type,omitempty"` Version interface{} `json:"Version,omitempty"` diff --git a/scheduler/cloudformation/template.go b/scheduler/cloudformation/template.go index 55d2d7a1c..89c980d4d 100644 --- a/scheduler/cloudformation/template.go +++ b/scheduler/cloudformation/template.go @@ -28,6 +28,12 @@ var ( Join = troposphere.Join ) +// Load balancer types +var ( + classicLoadBalancer = "elb" + applicationLoadBalancer = "alb" +) + const ( // For HTTP/HTTPS/TCP services, we allocate an ELB and map it's instance port to // the container port. This is the port that processes within the container @@ -59,6 +65,10 @@ type EmpireTemplate struct { // The ECS cluster to run the services in. Cluster string + // The VPC to create ALB target groups within. Should be the same VPC + // that ECS services will run within. + VpcId string + // The hosted zone to add CNAME's to. HostedZone *route53.HostedZone @@ -93,6 +103,9 @@ func (t *EmpireTemplate) Validate() error { return errors.New(fmt.Sprintf("%s is required", n)) } + if t.VpcId == "" { + return r("VpcId") + } if t.Cluster == "" { return r("Cluster") } @@ -321,6 +334,7 @@ func (t *EmpireTemplate) addService(tmpl *troposphere.Template, app *scheduler.A var portMappings []*PortMappingProperties + var serviceDependencies []string loadBalancers := []map[string]interface{}{} if p.Exposure != nil { scheme := schemeInternal @@ -333,72 +347,167 @@ func (t *EmpireTemplate) addService(tmpl *troposphere.Template, app *scheduler.A subnets = t.ExternalSubnetIDs } - instancePort := fmt.Sprintf("%s%dInstancePort", key, ContainerPort) - tmpl.Resources[instancePort] = troposphere.Resource{ - Type: "Custom::InstancePort", - Version: "1.0", - Properties: map[string]interface{}{ - "ServiceToken": t.CustomResourcesTopic, - }, - } + p.Env["PORT"] = fmt.Sprintf("%d", ContainerPort) - listeners := []map[string]interface{}{ - map[string]interface{}{ - "LoadBalancerPort": 80, - "Protocol": "http", - "InstancePort": GetAtt(instancePort, "InstancePort"), - "InstanceProtocol": "http", - }, + loadBalancerType := classicLoadBalancer + if v, ok := app.Env["LOAD_BALANCER_TYPE"]; ok { + loadBalancerType = v } - if e, ok := p.Exposure.Type.(*scheduler.HTTPSExposure); ok { - var cert interface{} - if _, err := arn.Parse(e.Cert); err == nil { - cert = e.Cert - } else { - cert = Join("", "arn:aws:iam::", Ref("AWS::AccountId"), ":server-certificate/", e.Cert) + var loadBalancer string + switch loadBalancerType { + case applicationLoadBalancer: + loadBalancer = fmt.Sprintf("%sApplicationLoadBalancer", key) + tmpl.Resources[loadBalancer] = troposphere.Resource{ + Type: "AWS::ElasticLoadBalancingV2::LoadBalancer", + Properties: map[string]interface{}{ + "Scheme": scheme, + "SecurityGroups": []string{sg}, + "Subnets": subnets, + "Tags": []map[string]string{ + map[string]string{ + "Key": "empire.app.process", + "Value": p.Type, + }, + }, + }, + } + + targetGroup := fmt.Sprintf("%sTargetGroup", key) + tmpl.Resources[targetGroup] = troposphere.Resource{ + Type: "AWS::ElasticLoadBalancingV2::TargetGroup", + Properties: map[string]interface{}{ + "Port": 65535, // Not used. ECS sets a port override when registering targets. + "Protocol": "HTTP", + "VpcId": t.VpcId, + }, } - listeners = append(listeners, map[string]interface{}{ - "LoadBalancerPort": 443, - "Protocol": "https", - "InstancePort": GetAtt(instancePort, "InstancePort"), - "SSLCertificateId": cert, - "InstanceProtocol": "http", + httpListener := fmt.Sprintf("%sPort%dListener", loadBalancer, 80) + tmpl.Resources[httpListener] = troposphere.Resource{ + Type: "AWS::ElasticLoadBalancingV2::Listener", + Properties: map[string]interface{}{ + "LoadBalancerArn": Ref(loadBalancer), + "Port": 80, + "Protocol": "HTTP", + "DefaultActions": []interface{}{ + map[string]interface{}{ + "TargetGroupArn": Ref(targetGroup), + "Type": "forward", + }, + }, + }, + } + serviceDependencies = append(serviceDependencies, httpListener) + + if e, ok := p.Exposure.Type.(*scheduler.HTTPSExposure); ok { + var cert interface{} + if _, err := arn.Parse(e.Cert); err == nil { + cert = e.Cert + } else { + cert = Join("", "arn:aws:iam::", Ref("AWS::AccountId"), ":server-certificate/", e.Cert) + } + + httpsListener := fmt.Sprintf("%sPort%dListener", loadBalancer, 443) + tmpl.Resources[httpsListener] = troposphere.Resource{ + Type: "AWS::ElasticLoadBalancingV2::Listener", + Properties: map[string]interface{}{ + "Certificates": []interface{}{ + map[string]interface{}{ + "CertificateArn": cert, + }, + }, + "LoadBalancerArn": GetAtt(loadBalancer, "Arn"), + "Port": 443, + "Protocol": "HTTPS", + "DefaultActions": []interface{}{ + map[string]interface{}{ + "TargetGroupArn": Ref(targetGroup), + "Type": "forward", + }, + }, + }, + } + serviceDependencies = append(serviceDependencies, httpsListener) + } + + loadBalancers = append(loadBalancers, map[string]interface{}{ + "ContainerName": p.Type, + "ContainerPort": ContainerPort, + "TargetGroupArn": Ref(targetGroup), }) - } + portMappings = append(portMappings, &PortMappingProperties{ + ContainerPort: ContainerPort, + HostPort: 0, + }) + default: + loadBalancer = fmt.Sprintf("%sLoadBalancer", key) - portMappings = append(portMappings, &PortMappingProperties{ - ContainerPort: ContainerPort, - HostPort: GetAtt(instancePort, "InstancePort"), - }) - p.Env["PORT"] = fmt.Sprintf("%d", ContainerPort) + instancePort := fmt.Sprintf("%s%dInstancePort", key, ContainerPort) + tmpl.Resources[instancePort] = troposphere.Resource{ + Type: "Custom::InstancePort", + Version: "1.0", + Properties: map[string]interface{}{ + "ServiceToken": t.CustomResourcesTopic, + }, + } - loadBalancer := fmt.Sprintf("%sLoadBalancer", key) - loadBalancers = append(loadBalancers, map[string]interface{}{ - "ContainerName": p.Type, - "ContainerPort": ContainerPort, - "LoadBalancerName": Ref(loadBalancer), - }) - tmpl.Resources[loadBalancer] = troposphere.Resource{ - Type: "AWS::ElasticLoadBalancing::LoadBalancer", - Properties: map[string]interface{}{ - "Scheme": scheme, - "SecurityGroups": []string{sg}, - "Subnets": subnets, - "Listeners": listeners, - "CrossZone": true, - "Tags": []map[string]string{ - map[string]string{ - "Key": "empire.app.process", - "Value": p.Type, - }, + listeners := []map[string]interface{}{ + map[string]interface{}{ + "LoadBalancerPort": 80, + "Protocol": "http", + "InstancePort": GetAtt(instancePort, "InstancePort"), + "InstanceProtocol": "http", }, - "ConnectionDrainingPolicy": map[string]interface{}{ - "Enabled": true, - "Timeout": defaultConnectionDrainingTimeout, + } + + if e, ok := p.Exposure.Type.(*scheduler.HTTPSExposure); ok { + var cert interface{} + if _, err := arn.Parse(e.Cert); err == nil { + cert = e.Cert + } else { + cert = Join("", "arn:aws:iam::", Ref("AWS::AccountId"), ":server-certificate/", e.Cert) + } + + listeners = append(listeners, map[string]interface{}{ + "LoadBalancerPort": 443, + "Protocol": "https", + "InstancePort": GetAtt(instancePort, "InstancePort"), + "SSLCertificateId": cert, + "InstanceProtocol": "http", + }) + } + + tmpl.Resources[loadBalancer] = troposphere.Resource{ + Type: "AWS::ElasticLoadBalancing::LoadBalancer", + Properties: map[string]interface{}{ + "Scheme": scheme, + "SecurityGroups": []string{sg}, + "Subnets": subnets, + "Listeners": listeners, + "CrossZone": true, + "Tags": []map[string]string{ + map[string]string{ + "Key": "empire.app.process", + "Value": p.Type, + }, + }, + "ConnectionDrainingPolicy": map[string]interface{}{ + "Enabled": true, + "Timeout": defaultConnectionDrainingTimeout, + }, }, - }, + } + + loadBalancers = append(loadBalancers, map[string]interface{}{ + "ContainerName": p.Type, + "ContainerPort": ContainerPort, + "LoadBalancerName": Ref(loadBalancer), + }) + portMappings = append(portMappings, &PortMappingProperties{ + ContainerPort: ContainerPort, + HostPort: GetAtt(instancePort, "InstancePort"), + }) } if p.Type == "web" { @@ -421,7 +530,6 @@ func (t *EmpireTemplate) addService(tmpl *troposphere.Template, app *scheduler.A containerDefinition.DockerLabels[restartLabel] = Ref(restartParameter) containerDefinition.PortMappings = portMappings - service := fmt.Sprintf("%sService", key) serviceProperties := map[string]interface{}{ "Cluster": t.Cluster, "DesiredCount": Ref(scaleParameter(p.Type)), @@ -433,11 +541,18 @@ func (t *EmpireTemplate) addService(tmpl *troposphere.Template, app *scheduler.A if len(loadBalancers) > 0 { serviceProperties["Role"] = t.ServiceRole } - tmpl.Resources[service] = troposphere.Resource{ - Type: ecsServiceType, - Properties: serviceProperties, + service := troposphere.NamedResource{ + Name: fmt.Sprintf("%sService", key), + Resource: troposphere.Resource{ + Type: ecsServiceType, + Properties: serviceProperties, + }, + } + if len(serviceDependencies) > 0 { + service.Resource.DependsOn = serviceDependencies } - return service + tmpl.AddResource(service) + return service.Name } // If the ServiceRole option is not an ARN, it will return a CloudFormation diff --git a/scheduler/cloudformation/template_test.go b/scheduler/cloudformation/template_test.go index 674b00c0a..68e6546ba 100644 --- a/scheduler/cloudformation/template_test.go +++ b/scheduler/cloudformation/template_test.go @@ -65,6 +65,52 @@ func TestEmpireTemplate(t *testing.T) { }, }, + { + "basic-alb.json", + &scheduler.App{ + ID: "1234", + Release: "v1", + Name: "acme-inc", + Env: map[string]string{ + // These should get re-sorted in + // alphabetical order. + "C": "foo", + "A": "foobar", + "B": "bar", + + "LOAD_BALANCER_TYPE": "alb", + }, + Processes: []*scheduler.Process{ + { + Type: "web", + Image: image.Image{Repository: "remind101/acme-inc", Tag: "latest"}, + Command: []string{"./bin/web"}, + Exposure: &scheduler.Exposure{ + Type: &scheduler.HTTPExposure{}, + }, + Labels: map[string]string{ + "empire.app.process": "web", + }, + MemoryLimit: 128 * bytesize.MB, + CPUShares: 256, + Instances: 1, + Nproc: 256, + }, + { + Type: "worker", + Image: image.Image{Repository: "remind101/acme-inc", Tag: "latest"}, + Command: []string{"./bin/worker"}, + Labels: map[string]string{ + "empire.app.process": "worker", + }, + Env: map[string]string{ + "FOO": "BAR", + }, + }, + }, + }, + }, + { "https.json", &scheduler.App{ @@ -94,6 +140,38 @@ func TestEmpireTemplate(t *testing.T) { }, }, + { + "https-alb.json", + &scheduler.App{ + ID: "1234", + Release: "v1", + Name: "acme-inc", + Env: map[string]string{ + "LOAD_BALANCER_TYPE": "alb", + }, + Processes: []*scheduler.Process{ + { + Type: "web", + Command: []string{"./bin/web"}, + Exposure: &scheduler.Exposure{ + Type: &scheduler.HTTPSExposure{ + Cert: "arn:aws:iam::012345678901:server-certificate/AcmeIncDotCom", + }, + }, + }, + { + Type: "api", + Command: []string{"./bin/api"}, + Exposure: &scheduler.Exposure{ + Type: &scheduler.HTTPSExposure{ + Cert: "AcmeIncDotCom", // Simple cert format. + }, + }, + }, + }, + }, + }, + { "custom.json", &scheduler.App{ diff --git a/scheduler/cloudformation/templates/basic-alb.json b/scheduler/cloudformation/templates/basic-alb.json new file mode 100644 index 000000000..c6c22c393 --- /dev/null +++ b/scheduler/cloudformation/templates/basic-alb.json @@ -0,0 +1,319 @@ +{ + "Conditions": { + "DNSCondition": { + "Fn::Equals": [ + { + "Ref": "DNS" + }, + "true" + ] + } + }, + "Outputs": { + "Deployments": { + "Value": { + "Fn::Join": [ + ",", + [ + { + "Fn::Join": [ + "=", + [ + "web", + { + "Fn::GetAtt": [ + "webService", + "DeploymentId" + ] + } + ] + ] + }, + { + "Fn::Join": [ + "=", + [ + "worker", + { + "Fn::GetAtt": [ + "workerService", + "DeploymentId" + ] + } + ] + ] + } + ] + ] + } + }, + "EmpireVersion": { + "Value": "x.x.x" + }, + "Release": { + "Value": "v1" + }, + "Services": { + "Value": { + "Fn::Join": [ + ",", + [ + { + "Fn::Join": [ + "=", + [ + "web", + { + "Ref": "webService" + } + ] + ] + }, + { + "Fn::Join": [ + "=", + [ + "worker", + { + "Ref": "workerService" + } + ] + ] + } + ] + ] + } + } + }, + "Parameters": { + "DNS": { + "Type": "String", + "Description": "When set to `true`, CNAME's will be altered", + "Default": "true" + }, + "RestartKey": { + "Type": "String", + "Description": "Key used to trigger a restart of an app", + "Default": "default" + }, + "webScale": { + "Type": "String" + }, + "workerScale": { + "Type": "String" + } + }, + "Resources": { + "CNAME": { + "Condition": "DNSCondition", + "Properties": { + "HostedZoneId": "Z3DG6IL3SJCGPX", + "Name": "acme-inc.empire", + "ResourceRecords": [ + { + "Fn::GetAtt": [ + "webApplicationLoadBalancer", + "DNSName" + ] + } + ], + "TTL": 60, + "Type": "CNAME" + }, + "Type": "AWS::Route53::RecordSet" + }, + "webApplicationLoadBalancer": { + "Properties": { + "Scheme": "internal", + "SecurityGroups": [ + "sg-e7387381" + ], + "Subnets": [ + "subnet-bb01c4cd", + "subnet-c85f4091" + ], + "Tags": [ + { + "Key": "empire.app.process", + "Value": "web" + } + ] + }, + "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer" + }, + "webApplicationLoadBalancerPort80Listener": { + "Properties": { + "DefaultActions": [ + { + "TargetGroupArn": { + "Ref": "webTargetGroup" + }, + "Type": "forward" + } + ], + "LoadBalancerArn": { + "Ref": "webApplicationLoadBalancer" + }, + "Port": 80, + "Protocol": "HTTP" + }, + "Type": "AWS::ElasticLoadBalancingV2::Listener" + }, + "webService": { + "DependsOn": [ + "webApplicationLoadBalancerPort80Listener" + ], + "Properties": { + "Cluster": "cluster", + "DesiredCount": { + "Ref": "webScale" + }, + "LoadBalancers": [ + { + "ContainerName": "web", + "ContainerPort": 8080, + "TargetGroupArn": { + "Ref": "webTargetGroup" + } + } + ], + "Role": "ecsServiceRole", + "ServiceName": "acme-inc-web", + "ServiceToken": "sns topic arn", + "TaskDefinition": { + "Ref": "webTaskDefinition" + } + }, + "Type": "Custom::ECSService" + }, + "webTargetGroup": { + "Properties": { + "Port": 65535, + "Protocol": "HTTP", + "VpcId": "" + }, + "Type": "AWS::ElasticLoadBalancingV2::TargetGroup" + }, + "webTaskDefinition": { + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "./bin/web" + ], + "Cpu": 256, + "DockerLabels": { + "cloudformation.restart-key": { + "Ref": "RestartKey" + }, + "empire.app.process": "web" + }, + "Environment": [ + { + "Name": "A", + "Value": "foobar" + }, + { + "Name": "B", + "Value": "bar" + }, + { + "Name": "C", + "Value": "foo" + }, + { + "Name": "LOAD_BALANCER_TYPE", + "Value": "alb" + }, + { + "Name": "PORT", + "Value": "8080" + } + ], + "Essential": true, + "Image": "remind101/acme-inc:latest", + "Memory": 128, + "Name": "web", + "PortMappings": [ + { + "ContainerPort": 8080, + "HostPort": 0 + } + ], + "Ulimits": [ + { + "HardLimit": 256, + "Name": "nproc", + "SoftLimit": 256 + } + ] + } + ], + "Volumes": [] + }, + "Type": "AWS::ECS::TaskDefinition" + }, + "workerService": { + "Properties": { + "Cluster": "cluster", + "DesiredCount": { + "Ref": "workerScale" + }, + "LoadBalancers": [], + "ServiceName": "acme-inc-worker", + "ServiceToken": "sns topic arn", + "TaskDefinition": { + "Ref": "workerTaskDefinition" + } + }, + "Type": "Custom::ECSService" + }, + "workerTaskDefinition": { + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "./bin/worker" + ], + "Cpu": 0, + "DockerLabels": { + "cloudformation.restart-key": { + "Ref": "RestartKey" + }, + "empire.app.process": "worker" + }, + "Environment": [ + { + "Name": "A", + "Value": "foobar" + }, + { + "Name": "B", + "Value": "bar" + }, + { + "Name": "C", + "Value": "foo" + }, + { + "Name": "FOO", + "Value": "BAR" + }, + { + "Name": "LOAD_BALANCER_TYPE", + "Value": "alb" + } + ], + "Essential": true, + "Image": "remind101/acme-inc:latest", + "Memory": 0, + "Name": "worker", + "Ulimits": [] + } + ], + "Volumes": [] + }, + "Type": "AWS::ECS::TaskDefinition" + } + } +} \ No newline at end of file diff --git a/scheduler/cloudformation/templates/https-alb.json b/scheduler/cloudformation/templates/https-alb.json new file mode 100644 index 000000000..1449f95c8 --- /dev/null +++ b/scheduler/cloudformation/templates/https-alb.json @@ -0,0 +1,416 @@ +{ + "Conditions": { + "DNSCondition": { + "Fn::Equals": [ + { + "Ref": "DNS" + }, + "true" + ] + } + }, + "Outputs": { + "Deployments": { + "Value": { + "Fn::Join": [ + ",", + [ + { + "Fn::Join": [ + "=", + [ + "web", + { + "Fn::GetAtt": [ + "webService", + "DeploymentId" + ] + } + ] + ] + }, + { + "Fn::Join": [ + "=", + [ + "api", + { + "Fn::GetAtt": [ + "apiService", + "DeploymentId" + ] + } + ] + ] + } + ] + ] + } + }, + "EmpireVersion": { + "Value": "x.x.x" + }, + "Release": { + "Value": "v1" + }, + "Services": { + "Value": { + "Fn::Join": [ + ",", + [ + { + "Fn::Join": [ + "=", + [ + "web", + { + "Ref": "webService" + } + ] + ] + }, + { + "Fn::Join": [ + "=", + [ + "api", + { + "Ref": "apiService" + } + ] + ] + } + ] + ] + } + } + }, + "Parameters": { + "DNS": { + "Type": "String", + "Description": "When set to `true`, CNAME's will be altered", + "Default": "true" + }, + "RestartKey": { + "Type": "String", + "Description": "Key used to trigger a restart of an app", + "Default": "default" + }, + "apiScale": { + "Type": "String" + }, + "webScale": { + "Type": "String" + } + }, + "Resources": { + "CNAME": { + "Condition": "DNSCondition", + "Properties": { + "HostedZoneId": "Z3DG6IL3SJCGPX", + "Name": "acme-inc.empire", + "ResourceRecords": [ + { + "Fn::GetAtt": [ + "webApplicationLoadBalancer", + "DNSName" + ] + } + ], + "TTL": 60, + "Type": "CNAME" + }, + "Type": "AWS::Route53::RecordSet" + }, + "apiApplicationLoadBalancer": { + "Properties": { + "Scheme": "internal", + "SecurityGroups": [ + "sg-e7387381" + ], + "Subnets": [ + "subnet-bb01c4cd", + "subnet-c85f4091" + ], + "Tags": [ + { + "Key": "empire.app.process", + "Value": "api" + } + ] + }, + "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer" + }, + "apiApplicationLoadBalancerPort443Listener": { + "Properties": { + "Certificates": [ + { + "CertificateArn": { + "Fn::Join": [ + "", + [ + "arn:aws:iam::", + { + "Ref": "AWS::AccountId" + }, + ":server-certificate/", + "AcmeIncDotCom" + ] + ] + } + } + ], + "DefaultActions": [ + { + "TargetGroupArn": { + "Ref": "apiTargetGroup" + }, + "Type": "forward" + } + ], + "LoadBalancerArn": { + "Fn::GetAtt": [ + "apiApplicationLoadBalancer", + "Arn" + ] + }, + "Port": 443, + "Protocol": "HTTPS" + }, + "Type": "AWS::ElasticLoadBalancingV2::Listener" + }, + "apiApplicationLoadBalancerPort80Listener": { + "Properties": { + "DefaultActions": [ + { + "TargetGroupArn": { + "Ref": "apiTargetGroup" + }, + "Type": "forward" + } + ], + "LoadBalancerArn": { + "Ref": "apiApplicationLoadBalancer" + }, + "Port": 80, + "Protocol": "HTTP" + }, + "Type": "AWS::ElasticLoadBalancingV2::Listener" + }, + "apiService": { + "DependsOn": [ + "apiApplicationLoadBalancerPort80Listener", + "apiApplicationLoadBalancerPort443Listener" + ], + "Properties": { + "Cluster": "cluster", + "DesiredCount": { + "Ref": "apiScale" + }, + "LoadBalancers": [ + { + "ContainerName": "api", + "ContainerPort": 8080, + "TargetGroupArn": { + "Ref": "apiTargetGroup" + } + } + ], + "Role": "ecsServiceRole", + "ServiceName": "acme-inc-api", + "ServiceToken": "sns topic arn", + "TaskDefinition": { + "Ref": "apiTaskDefinition" + } + }, + "Type": "Custom::ECSService" + }, + "apiTargetGroup": { + "Properties": { + "Port": 65535, + "Protocol": "HTTP", + "VpcId": "" + }, + "Type": "AWS::ElasticLoadBalancingV2::TargetGroup" + }, + "apiTaskDefinition": { + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "./bin/api" + ], + "Cpu": 0, + "DockerLabels": { + "cloudformation.restart-key": { + "Ref": "RestartKey" + } + }, + "Environment": [ + { + "Name": "LOAD_BALANCER_TYPE", + "Value": "alb" + }, + { + "Name": "PORT", + "Value": "8080" + } + ], + "Essential": true, + "Image": "", + "Memory": 0, + "Name": "api", + "PortMappings": [ + { + "ContainerPort": 8080, + "HostPort": 0 + } + ], + "Ulimits": [] + } + ], + "Volumes": [] + }, + "Type": "AWS::ECS::TaskDefinition" + }, + "webApplicationLoadBalancer": { + "Properties": { + "Scheme": "internal", + "SecurityGroups": [ + "sg-e7387381" + ], + "Subnets": [ + "subnet-bb01c4cd", + "subnet-c85f4091" + ], + "Tags": [ + { + "Key": "empire.app.process", + "Value": "web" + } + ] + }, + "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer" + }, + "webApplicationLoadBalancerPort443Listener": { + "Properties": { + "Certificates": [ + { + "CertificateArn": "arn:aws:iam::012345678901:server-certificate/AcmeIncDotCom" + } + ], + "DefaultActions": [ + { + "TargetGroupArn": { + "Ref": "webTargetGroup" + }, + "Type": "forward" + } + ], + "LoadBalancerArn": { + "Fn::GetAtt": [ + "webApplicationLoadBalancer", + "Arn" + ] + }, + "Port": 443, + "Protocol": "HTTPS" + }, + "Type": "AWS::ElasticLoadBalancingV2::Listener" + }, + "webApplicationLoadBalancerPort80Listener": { + "Properties": { + "DefaultActions": [ + { + "TargetGroupArn": { + "Ref": "webTargetGroup" + }, + "Type": "forward" + } + ], + "LoadBalancerArn": { + "Ref": "webApplicationLoadBalancer" + }, + "Port": 80, + "Protocol": "HTTP" + }, + "Type": "AWS::ElasticLoadBalancingV2::Listener" + }, + "webService": { + "DependsOn": [ + "webApplicationLoadBalancerPort80Listener", + "webApplicationLoadBalancerPort443Listener" + ], + "Properties": { + "Cluster": "cluster", + "DesiredCount": { + "Ref": "webScale" + }, + "LoadBalancers": [ + { + "ContainerName": "web", + "ContainerPort": 8080, + "TargetGroupArn": { + "Ref": "webTargetGroup" + } + } + ], + "Role": "ecsServiceRole", + "ServiceName": "acme-inc-web", + "ServiceToken": "sns topic arn", + "TaskDefinition": { + "Ref": "webTaskDefinition" + } + }, + "Type": "Custom::ECSService" + }, + "webTargetGroup": { + "Properties": { + "Port": 65535, + "Protocol": "HTTP", + "VpcId": "" + }, + "Type": "AWS::ElasticLoadBalancingV2::TargetGroup" + }, + "webTaskDefinition": { + "Properties": { + "ContainerDefinitions": [ + { + "Command": [ + "./bin/web" + ], + "Cpu": 0, + "DockerLabels": { + "cloudformation.restart-key": { + "Ref": "RestartKey" + } + }, + "Environment": [ + { + "Name": "LOAD_BALANCER_TYPE", + "Value": "alb" + }, + { + "Name": "PORT", + "Value": "8080" + } + ], + "Essential": true, + "Image": "", + "Memory": 0, + "Name": "web", + "PortMappings": [ + { + "ContainerPort": 8080, + "HostPort": 0 + } + ], + "Ulimits": [] + } + ], + "Volumes": [] + }, + "Type": "AWS::ECS::TaskDefinition" + } + } +} \ No newline at end of file diff --git a/server/cloudformation/ecs.go b/server/cloudformation/ecs.go index c18b8139e..aeb236925 100644 --- a/server/cloudformation/ecs.go +++ b/server/cloudformation/ecs.go @@ -47,6 +47,7 @@ type LoadBalancer struct { ContainerName *string ContainerPort *customresources.IntValue LoadBalancerName *string + TargetGroupArn *string } // ECSServiceProperties represents the properties for the Custom::ECSService @@ -133,6 +134,7 @@ func (p *ECSServiceResource) create(ctx context.Context, clientToken string, pro ContainerName: v.ContainerName, ContainerPort: v.ContainerPort.Value(), LoadBalancerName: v.LoadBalancerName, + TargetGroupArn: v.TargetGroupArn, }) } From 2b16da460310cd983d9e29342c437e55e2f04ab3 Mon Sep 17 00:00:00 2001 From: "Eric J. Holmes" Date: Thu, 11 Aug 2016 13:26:53 -0700 Subject: [PATCH 3/3] Update CHANGELOG. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01c6aeffe..46cd4ae70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * Empire now supports sending internal metrics to statsd or dogstatsd [#953](https://github.com/remind101/empire/pull/953) * Attached and detached runs now have an `empire.user` label attached to them [#965](https://github.com/remind101/empire/pull/965) * You can now provide the name of a process defined in the Procfile when calling `emp run` [#967](https://github.com/remind101/empire/pull/967) +* Empire now includes experimental support for the new [Application Load Balancers](https://aws.amazon.com/blogs/aws/new-aws-application-load-balancer/) by setting the `LOAD_BALANCER_TYPE=alb` environment variable. [#969](https://github.com/remind101/empire/pull/969) **Improvements**