vendor: terraform-providers/terraform-provider-aws@v1.29.0 and aws/aws-sdk-go@v1.14.31

This commit is contained in:
Brian Flad 2018-07-30 18:07:29 -04:00
parent 10ad1858fe
commit bbeabcc055
542 changed files with 122022 additions and 7139 deletions

View File

@ -91,6 +91,6 @@ func (c *Client) AddDebugHandlers() {
return
}
c.Handlers.Send.PushFrontNamed(request.NamedHandler{Name: "awssdk.client.LogRequest", Fn: logRequest})
c.Handlers.Send.PushBackNamed(request.NamedHandler{Name: "awssdk.client.LogResponse", Fn: logResponse})
c.Handlers.Send.PushFrontNamed(LogHTTPRequestHandler)
c.Handlers.Send.PushBackNamed(LogHTTPResponseHandler)
}

View File

@ -44,12 +44,22 @@ func (reader *teeReaderCloser) Close() error {
return reader.Source.Close()
}
// LogHTTPRequestHandler is a SDK request handler to log the HTTP request sent
// to a service. Will include the HTTP request body if the LogLevel of the
// request matches LogDebugWithHTTPBody.
var LogHTTPRequestHandler = request.NamedHandler{
Name: "awssdk.client.LogRequest",
Fn: logRequest,
}
func logRequest(r *request.Request) {
logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody)
bodySeekable := aws.IsReaderSeekable(r.Body)
dumpedBody, err := httputil.DumpRequestOut(r.HTTPRequest, logBody)
b, err := httputil.DumpRequestOut(r.HTTPRequest, logBody)
if err != nil {
r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, r.ClientInfo.ServiceName, r.Operation.Name, err))
r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg,
r.ClientInfo.ServiceName, r.Operation.Name, err))
return
}
@ -63,7 +73,28 @@ func logRequest(r *request.Request) {
r.ResetBody()
}
r.Config.Logger.Log(fmt.Sprintf(logReqMsg, r.ClientInfo.ServiceName, r.Operation.Name, string(dumpedBody)))
r.Config.Logger.Log(fmt.Sprintf(logReqMsg,
r.ClientInfo.ServiceName, r.Operation.Name, string(b)))
}
// LogHTTPRequestHeaderHandler is a SDK request handler to log the HTTP request sent
// to a service. Will only log the HTTP request's headers. The request payload
// will not be read.
var LogHTTPRequestHeaderHandler = request.NamedHandler{
Name: "awssdk.client.LogRequestHeader",
Fn: logRequestHeader,
}
func logRequestHeader(r *request.Request) {
b, err := httputil.DumpRequestOut(r.HTTPRequest, false)
if err != nil {
r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg,
r.ClientInfo.ServiceName, r.Operation.Name, err))
return
}
r.Config.Logger.Log(fmt.Sprintf(logReqMsg,
r.ClientInfo.ServiceName, r.Operation.Name, string(b)))
}
const logRespMsg = `DEBUG: Response %s/%s Details:
@ -76,27 +107,44 @@ const logRespErrMsg = `DEBUG ERROR: Response %s/%s:
%s
-----------------------------------------------------`
// LogHTTPResponseHandler is a SDK request handler to log the HTTP response
// received from a service. Will include the HTTP response body if the LogLevel
// of the request matches LogDebugWithHTTPBody.
var LogHTTPResponseHandler = request.NamedHandler{
Name: "awssdk.client.LogResponse",
Fn: logResponse,
}
func logResponse(r *request.Request) {
lw := &logWriter{r.Config.Logger, bytes.NewBuffer(nil)}
r.HTTPResponse.Body = &teeReaderCloser{
Reader: io.TeeReader(r.HTTPResponse.Body, lw),
Source: r.HTTPResponse.Body,
logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody)
if logBody {
r.HTTPResponse.Body = &teeReaderCloser{
Reader: io.TeeReader(r.HTTPResponse.Body, lw),
Source: r.HTTPResponse.Body,
}
}
handlerFn := func(req *request.Request) {
body, err := httputil.DumpResponse(req.HTTPResponse, false)
b, err := httputil.DumpResponse(req.HTTPResponse, false)
if err != nil {
lw.Logger.Log(fmt.Sprintf(logRespErrMsg, req.ClientInfo.ServiceName, req.Operation.Name, err))
lw.Logger.Log(fmt.Sprintf(logRespErrMsg,
req.ClientInfo.ServiceName, req.Operation.Name, err))
return
}
b, err := ioutil.ReadAll(lw.buf)
if err != nil {
lw.Logger.Log(fmt.Sprintf(logRespErrMsg, req.ClientInfo.ServiceName, req.Operation.Name, err))
return
}
lw.Logger.Log(fmt.Sprintf(logRespMsg, req.ClientInfo.ServiceName, req.Operation.Name, string(body)))
if req.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) {
lw.Logger.Log(fmt.Sprintf(logRespMsg,
req.ClientInfo.ServiceName, req.Operation.Name, string(b)))
if logBody {
b, err := ioutil.ReadAll(lw.buf)
if err != nil {
lw.Logger.Log(fmt.Sprintf(logRespErrMsg,
req.ClientInfo.ServiceName, req.Operation.Name, err))
return
}
lw.Logger.Log(string(b))
}
}
@ -110,3 +158,27 @@ func logResponse(r *request.Request) {
Name: handlerName, Fn: handlerFn,
})
}
// LogHTTPResponseHeaderHandler is a SDK request handler to log the HTTP
// response received from a service. Will only log the HTTP response's headers.
// The response payload will not be read.
var LogHTTPResponseHeaderHandler = request.NamedHandler{
Name: "awssdk.client.LogResponseHeader",
Fn: logResponseHeader,
}
func logResponseHeader(r *request.Request) {
if r.Config.Logger == nil {
return
}
b, err := httputil.DumpResponse(r.HTTPResponse, false)
if err != nil {
r.Config.Logger.Log(fmt.Sprintf(logRespErrMsg,
r.ClientInfo.ServiceName, r.Operation.Name, err))
return
}
r.Config.Logger.Log(fmt.Sprintf(logRespMsg,
r.ClientInfo.ServiceName, r.Operation.Name, string(b)))
}

View File

@ -3,6 +3,7 @@ package metadata
// ClientInfo wraps immutable data from the client.Client structure.
type ClientInfo struct {
ServiceName string
ServiceID string
APIVersion string
Endpoint string
SigningName string

View File

@ -178,7 +178,8 @@ func (e *Expiry) IsExpired() bool {
type Credentials struct {
creds Value
forceRefresh bool
m sync.Mutex
m sync.RWMutex
provider Provider
}
@ -201,6 +202,17 @@ func NewCredentials(provider Provider) *Credentials {
// If Credentials.Expire() was called the credentials Value will be force
// expired, and the next call to Get() will cause them to be refreshed.
func (c *Credentials) Get() (Value, error) {
// Check the cached credentials first with just the read lock.
c.m.RLock()
if !c.isExpired() {
creds := c.creds
c.m.RUnlock()
return creds, nil
}
c.m.RUnlock()
// Credentials are expired need to retrieve the credentials taking the full
// lock.
c.m.Lock()
defer c.m.Unlock()
@ -234,8 +246,8 @@ func (c *Credentials) Expire() {
// If the Credentials were forced to be expired with Expire() this will
// reflect that override.
func (c *Credentials) IsExpired() bool {
c.m.Lock()
defer c.m.Unlock()
c.m.RLock()
defer c.m.RUnlock()
return c.isExpired()
}

View File

@ -4,7 +4,6 @@ import (
"bufio"
"encoding/json"
"fmt"
"path"
"strings"
"time"
@ -12,6 +11,7 @@ import (
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/internal/sdkuri"
)
// ProviderName provides a name of EC2Role provider
@ -125,7 +125,7 @@ type ec2RoleCredRespBody struct {
Message string
}
const iamSecurityCredsPath = "/iam/security-credentials"
const iamSecurityCredsPath = "iam/security-credentials/"
// requestCredList requests a list of credentials from the EC2 service.
// If there are no credentials, or there is an error making or receiving the request
@ -153,7 +153,7 @@ func requestCredList(client *ec2metadata.EC2Metadata) ([]string, error) {
// If the credentials cannot be found, or there is an error reading the response
// and error will be returned.
func requestCred(client *ec2metadata.EC2Metadata, credsName string) (ec2RoleCredRespBody, error) {
resp, err := client.GetMetadata(path.Join(iamSecurityCredsPath, credsName))
resp, err := client.GetMetadata(sdkuri.PathJoin(iamSecurityCredsPath, credsName))
if err != nil {
return ec2RoleCredRespBody{},
awserr.New("EC2RoleRequestError",

46
vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go generated vendored Normal file
View File

@ -0,0 +1,46 @@
// Package csm provides Client Side Monitoring (CSM) which enables sending metrics
// via UDP connection. Using the Start function will enable the reporting of
// metrics on a given port. If Start is called, with different parameters, again,
// a panic will occur.
//
// Pause can be called to pause any metrics publishing on a given port. Sessions
// that have had their handlers modified via InjectHandlers may still be used.
// However, the handlers will act as a no-op meaning no metrics will be published.
//
// Example:
// r, err := csm.Start("clientID", ":31000")
// if err != nil {
// panic(fmt.Errorf("failed starting CSM: %v", err))
// }
//
// sess, err := session.NewSession(&aws.Config{})
// if err != nil {
// panic(fmt.Errorf("failed loading session: %v", err))
// }
//
// r.InjectHandlers(&sess.Handlers)
//
// client := s3.New(sess)
// resp, err := client.GetObject(&s3.GetObjectInput{
// Bucket: aws.String("bucket"),
// Key: aws.String("key"),
// })
//
// // Will pause monitoring
// r.Pause()
// resp, err = client.GetObject(&s3.GetObjectInput{
// Bucket: aws.String("bucket"),
// Key: aws.String("key"),
// })
//
// // Resume monitoring
// r.Continue()
//
// Start returns a Reporter that is used to enable or disable monitoring. If
// access to the Reporter is required later, calling Get will return the Reporter
// singleton.
//
// Example:
// r := csm.Get()
// r.Continue()
package csm

67
vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go generated vendored Normal file
View File

@ -0,0 +1,67 @@
package csm
import (
"fmt"
"sync"
)
var (
lock sync.Mutex
)
// Client side metric handler names
const (
APICallMetricHandlerName = "awscsm.SendAPICallMetric"
APICallAttemptMetricHandlerName = "awscsm.SendAPICallAttemptMetric"
)
// Start will start the a long running go routine to capture
// client side metrics. Calling start multiple time will only
// start the metric listener once and will panic if a different
// client ID or port is passed in.
//
// Example:
// r, err := csm.Start("clientID", "127.0.0.1:8094")
// if err != nil {
// panic(fmt.Errorf("expected no error, but received %v", err))
// }
// sess := session.NewSession()
// r.InjectHandlers(sess.Handlers)
//
// svc := s3.New(sess)
// out, err := svc.GetObject(&s3.GetObjectInput{
// Bucket: aws.String("bucket"),
// Key: aws.String("key"),
// })
func Start(clientID string, url string) (*Reporter, error) {
lock.Lock()
defer lock.Unlock()
if sender == nil {
sender = newReporter(clientID, url)
} else {
if sender.clientID != clientID {
panic(fmt.Errorf("inconsistent client IDs. %q was expected, but received %q", sender.clientID, clientID))
}
if sender.url != url {
panic(fmt.Errorf("inconsistent URLs. %q was expected, but received %q", sender.url, url))
}
}
if err := connect(url); err != nil {
sender = nil
return nil, err
}
return sender, nil
}
// Get will return a reporter if one exists, if one does not exist, nil will
// be returned.
func Get() *Reporter {
lock.Lock()
defer lock.Unlock()
return sender
}

51
vendor/github.com/aws/aws-sdk-go/aws/csm/metric.go generated vendored Normal file
View File

@ -0,0 +1,51 @@
package csm
import (
"strconv"
"time"
)
type metricTime time.Time
func (t metricTime) MarshalJSON() ([]byte, error) {
ns := time.Duration(time.Time(t).UnixNano())
return []byte(strconv.FormatInt(int64(ns/time.Millisecond), 10)), nil
}
type metric struct {
ClientID *string `json:"ClientId,omitempty"`
API *string `json:"Api,omitempty"`
Service *string `json:"Service,omitempty"`
Timestamp *metricTime `json:"Timestamp,omitempty"`
Type *string `json:"Type,omitempty"`
Version *int `json:"Version,omitempty"`
AttemptCount *int `json:"AttemptCount,omitempty"`
Latency *int `json:"Latency,omitempty"`
Fqdn *string `json:"Fqdn,omitempty"`
UserAgent *string `json:"UserAgent,omitempty"`
AttemptLatency *int `json:"AttemptLatency,omitempty"`
SessionToken *string `json:"SessionToken,omitempty"`
Region *string `json:"Region,omitempty"`
AccessKey *string `json:"AccessKey,omitempty"`
HTTPStatusCode *int `json:"HttpStatusCode,omitempty"`
XAmzID2 *string `json:"XAmzId2,omitempty"`
XAmzRequestID *string `json:"XAmznRequestId,omitempty"`
AWSException *string `json:"AwsException,omitempty"`
AWSExceptionMessage *string `json:"AwsExceptionMessage,omitempty"`
SDKException *string `json:"SdkException,omitempty"`
SDKExceptionMessage *string `json:"SdkExceptionMessage,omitempty"`
DestinationIP *string `json:"DestinationIp,omitempty"`
ConnectionReused *int `json:"ConnectionReused,omitempty"`
AcquireConnectionLatency *int `json:"AcquireConnectionLatency,omitempty"`
ConnectLatency *int `json:"ConnectLatency,omitempty"`
RequestLatency *int `json:"RequestLatency,omitempty"`
DNSLatency *int `json:"DnsLatency,omitempty"`
TCPLatency *int `json:"TcpLatency,omitempty"`
SSLLatency *int `json:"SslLatency,omitempty"`
}

View File

@ -0,0 +1,54 @@
package csm
import (
"sync/atomic"
)
const (
runningEnum = iota
pausedEnum
)
var (
// MetricsChannelSize of metrics to hold in the channel
MetricsChannelSize = 100
)
type metricChan struct {
ch chan metric
paused int64
}
func newMetricChan(size int) metricChan {
return metricChan{
ch: make(chan metric, size),
}
}
func (ch *metricChan) Pause() {
atomic.StoreInt64(&ch.paused, pausedEnum)
}
func (ch *metricChan) Continue() {
atomic.StoreInt64(&ch.paused, runningEnum)
}
func (ch *metricChan) IsPaused() bool {
v := atomic.LoadInt64(&ch.paused)
return v == pausedEnum
}
// Push will push metrics to the metric channel if the channel
// is not paused
func (ch *metricChan) Push(m metric) bool {
if ch.IsPaused() {
return false
}
select {
case ch.ch <- m:
return true
default:
return false
}
}

231
vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go generated vendored Normal file
View File

@ -0,0 +1,231 @@
package csm
import (
"encoding/json"
"net"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
)
const (
// DefaultPort is used when no port is specified
DefaultPort = "31000"
)
// Reporter will gather metrics of API requests made and
// send those metrics to the CSM endpoint.
type Reporter struct {
clientID string
url string
conn net.Conn
metricsCh metricChan
done chan struct{}
}
var (
sender *Reporter
)
func connect(url string) error {
const network = "udp"
if err := sender.connect(network, url); err != nil {
return err
}
if sender.done == nil {
sender.done = make(chan struct{})
go sender.start()
}
return nil
}
func newReporter(clientID, url string) *Reporter {
return &Reporter{
clientID: clientID,
url: url,
metricsCh: newMetricChan(MetricsChannelSize),
}
}
func (rep *Reporter) sendAPICallAttemptMetric(r *request.Request) {
if rep == nil {
return
}
now := time.Now()
creds, _ := r.Config.Credentials.Get()
m := metric{
ClientID: aws.String(rep.clientID),
API: aws.String(r.Operation.Name),
Service: aws.String(r.ClientInfo.ServiceID),
Timestamp: (*metricTime)(&now),
UserAgent: aws.String(r.HTTPRequest.Header.Get("User-Agent")),
Region: r.Config.Region,
Type: aws.String("ApiCallAttempt"),
Version: aws.Int(1),
XAmzRequestID: aws.String(r.RequestID),
AttemptCount: aws.Int(r.RetryCount + 1),
AttemptLatency: aws.Int(int(now.Sub(r.AttemptTime).Nanoseconds() / int64(time.Millisecond))),
AccessKey: aws.String(creds.AccessKeyID),
}
if r.HTTPResponse != nil {
m.HTTPStatusCode = aws.Int(r.HTTPResponse.StatusCode)
}
if r.Error != nil {
if awserr, ok := r.Error.(awserr.Error); ok {
setError(&m, awserr)
}
}
rep.metricsCh.Push(m)
}
func setError(m *metric, err awserr.Error) {
msg := err.Error()
code := err.Code()
switch code {
case "RequestError",
"SerializationError",
request.CanceledErrorCode:
m.SDKException = &code
m.SDKExceptionMessage = &msg
default:
m.AWSException = &code
m.AWSExceptionMessage = &msg
}
}
func (rep *Reporter) sendAPICallMetric(r *request.Request) {
if rep == nil {
return
}
now := time.Now()
m := metric{
ClientID: aws.String(rep.clientID),
API: aws.String(r.Operation.Name),
Service: aws.String(r.ClientInfo.ServiceID),
Timestamp: (*metricTime)(&now),
Type: aws.String("ApiCall"),
AttemptCount: aws.Int(r.RetryCount + 1),
Latency: aws.Int(int(time.Now().Sub(r.Time) / time.Millisecond)),
XAmzRequestID: aws.String(r.RequestID),
}
// TODO: Probably want to figure something out for logging dropped
// metrics
rep.metricsCh.Push(m)
}
func (rep *Reporter) connect(network, url string) error {
if rep.conn != nil {
rep.conn.Close()
}
conn, err := net.Dial(network, url)
if err != nil {
return awserr.New("UDPError", "Could not connect", err)
}
rep.conn = conn
return nil
}
func (rep *Reporter) close() {
if rep.done != nil {
close(rep.done)
}
rep.metricsCh.Pause()
}
func (rep *Reporter) start() {
defer func() {
rep.metricsCh.Pause()
}()
for {
select {
case <-rep.done:
rep.done = nil
return
case m := <-rep.metricsCh.ch:
// TODO: What to do with this error? Probably should just log
b, err := json.Marshal(m)
if err != nil {
continue
}
rep.conn.Write(b)
}
}
}
// Pause will pause the metric channel preventing any new metrics from
// being added.
func (rep *Reporter) Pause() {
lock.Lock()
defer lock.Unlock()
if rep == nil {
return
}
rep.close()
}
// Continue will reopen the metric channel and allow for monitoring
// to be resumed.
func (rep *Reporter) Continue() {
lock.Lock()
defer lock.Unlock()
if rep == nil {
return
}
if !rep.metricsCh.IsPaused() {
return
}
rep.metricsCh.Continue()
}
// InjectHandlers will will enable client side metrics and inject the proper
// handlers to handle how metrics are sent.
//
// Example:
// // Start must be called in order to inject the correct handlers
// r, err := csm.Start("clientID", "127.0.0.1:8094")
// if err != nil {
// panic(fmt.Errorf("expected no error, but received %v", err))
// }
//
// sess := session.NewSession()
// r.InjectHandlers(&sess.Handlers)
//
// // create a new service client with our client side metric session
// svc := s3.New(sess)
func (rep *Reporter) InjectHandlers(handlers *request.Handlers) {
if rep == nil {
return
}
apiCallHandler := request.NamedHandler{Name: APICallMetricHandlerName, Fn: rep.sendAPICallMetric}
apiCallAttemptHandler := request.NamedHandler{Name: APICallAttemptMetricHandlerName, Fn: rep.sendAPICallAttemptMetric}
handlers.Complete.PushFrontNamed(apiCallHandler)
handlers.Complete.PushFrontNamed(apiCallAttemptHandler)
handlers.AfterRetry.PushFrontNamed(apiCallAttemptHandler)
}

View File

@ -92,14 +92,25 @@ func Handlers() request.Handlers {
func CredChain(cfg *aws.Config, handlers request.Handlers) *credentials.Credentials {
return credentials.NewCredentials(&credentials.ChainProvider{
VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors),
Providers: []credentials.Provider{
&credentials.EnvProvider{},
&credentials.SharedCredentialsProvider{Filename: "", Profile: ""},
RemoteCredProvider(*cfg, handlers),
},
Providers: CredProviders(cfg, handlers),
})
}
// CredProviders returns the slice of providers used in
// the default credential chain.
//
// For applications that need to use some other provider (for example use
// different environment variables for legacy reasons) but still fall back
// on the default chain of providers. This allows that default chaint to be
// automatically updated
func CredProviders(cfg *aws.Config, handlers request.Handlers) []credentials.Provider {
return []credentials.Provider{
&credentials.EnvProvider{},
&credentials.SharedCredentialsProvider{Filename: "", Profile: ""},
RemoteCredProvider(*cfg, handlers),
}
}
const (
httpProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_FULL_URI"
ecsCredsProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"

View File

@ -4,12 +4,12 @@ import (
"encoding/json"
"fmt"
"net/http"
"path"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/internal/sdkuri"
)
// GetMetadata uses the path provided to request information from the EC2
@ -19,7 +19,7 @@ func (c *EC2Metadata) GetMetadata(p string) (string, error) {
op := &request.Operation{
Name: "GetMetadata",
HTTPMethod: "GET",
HTTPPath: path.Join("/", "meta-data", p),
HTTPPath: sdkuri.PathJoin("/meta-data", p),
}
output := &metadataOutput{}
@ -35,7 +35,7 @@ func (c *EC2Metadata) GetUserData() (string, error) {
op := &request.Operation{
Name: "GetUserData",
HTTPMethod: "GET",
HTTPPath: path.Join("/", "user-data"),
HTTPPath: "/user-data",
}
output := &metadataOutput{}
@ -56,7 +56,7 @@ func (c *EC2Metadata) GetDynamicData(p string) (string, error) {
op := &request.Operation{
Name: "GetDynamicData",
HTTPMethod: "GET",
HTTPPath: path.Join("/", "dynamic", p),
HTTPPath: sdkuri.PathJoin("/dynamic", p),
}
output := &metadataOutput{}

View File

@ -47,6 +47,8 @@ const (
const (
A4bServiceID = "a4b" // A4b.
AcmServiceID = "acm" // Acm.
AcmPcaServiceID = "acm-pca" // AcmPca.
ApiMediatailorServiceID = "api.mediatailor" // ApiMediatailor.
ApiPricingServiceID = "api.pricing" // ApiPricing.
ApigatewayServiceID = "apigateway" // Apigateway.
ApplicationAutoscalingServiceID = "application-autoscaling" // ApplicationAutoscaling.
@ -99,6 +101,7 @@ const (
EsServiceID = "es" // Es.
EventsServiceID = "events" // Events.
FirehoseServiceID = "firehose" // Firehose.
FmsServiceID = "fms" // Fms.
GameliftServiceID = "gamelift" // Gamelift.
GlacierServiceID = "glacier" // Glacier.
GlueServiceID = "glue" // Glue.
@ -121,12 +124,14 @@ const (
MediaconvertServiceID = "mediaconvert" // Mediaconvert.
MedialiveServiceID = "medialive" // Medialive.
MediapackageServiceID = "mediapackage" // Mediapackage.
MediastoreServiceID = "mediastore" // Mediastore.
MeteringMarketplaceServiceID = "metering.marketplace" // MeteringMarketplace.
MghServiceID = "mgh" // Mgh.
MobileanalyticsServiceID = "mobileanalytics" // Mobileanalytics.
ModelsLexServiceID = "models.lex" // ModelsLex.
MonitoringServiceID = "monitoring" // Monitoring.
MturkRequesterServiceID = "mturk-requester" // MturkRequester.
NeptuneServiceID = "neptune" // Neptune.
OpsworksServiceID = "opsworks" // Opsworks.
OpsworksCmServiceID = "opsworks-cm" // OpsworksCm.
OrganizationsServiceID = "organizations" // Organizations.
@ -143,6 +148,7 @@ const (
S3ServiceID = "s3" // S3.
SagemakerServiceID = "sagemaker" // Sagemaker.
SdbServiceID = "sdb" // Sdb.
SecretsmanagerServiceID = "secretsmanager" // Secretsmanager.
ServerlessrepoServiceID = "serverlessrepo" // Serverlessrepo.
ServicecatalogServiceID = "servicecatalog" // Servicecatalog.
ServicediscoveryServiceID = "servicediscovery" // Servicediscovery.
@ -287,6 +293,32 @@ var awsPartition = partition{
"us-west-2": endpoint{},
},
},
"acm-pca": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"api.mediatailor": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
},
},
"api.pricing": service{
Defaults: endpoint{
CredentialScope: credentialScope{
@ -414,6 +446,7 @@ var awsPartition = partition{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
@ -538,6 +571,7 @@ var awsPartition = partition{
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
@ -635,6 +669,7 @@ var awsPartition = partition{
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@ -804,6 +839,7 @@ var awsPartition = partition{
"eu-west-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
@ -1024,6 +1060,7 @@ var awsPartition = partition{
"elasticfilesystem": service{
Endpoints: endpoints{
"ap-northeast-2": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
@ -1157,8 +1194,10 @@ var awsPartition = partition{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
@ -1167,6 +1206,16 @@ var awsPartition = partition{
"us-west-2": endpoint{},
},
},
"fms": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"gamelift": service{
Endpoints: endpoints{
@ -1211,9 +1260,13 @@ var awsPartition = partition{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
@ -1313,6 +1366,7 @@ var awsPartition = partition{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
@ -1405,12 +1459,15 @@ var awsPartition = partition{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
@ -1472,9 +1529,12 @@ var awsPartition = partition{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
@ -1494,6 +1554,17 @@ var awsPartition = partition{
"us-west-2": endpoint{},
},
},
"mediastore": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"metering.marketplace": service{
Defaults: endpoint{
CredentialScope: credentialScope{
@ -1539,6 +1610,7 @@ var awsPartition = partition{
Endpoints: endpoints{
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"monitoring": service{
@ -1573,6 +1645,35 @@ var awsPartition = partition{
"us-east-1": endpoint{},
},
},
"neptune": service{
Endpoints: endpoints{
"eu-west-1": endpoint{
Hostname: "rds.eu-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-1",
},
},
"us-east-1": endpoint{
Hostname: "rds.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{
Hostname: "rds.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-2": endpoint{
Hostname: "rds.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"opsworks": service{
Endpoints: endpoints{
@ -1750,15 +1851,17 @@ var awsPartition = partition{
Endpoints: endpoints{
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"runtime.sagemaker": service{
Endpoints: endpoints{
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
"ap-northeast-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"s3": service{
@ -1823,10 +1926,12 @@ var awsPartition = partition{
"sagemaker": service{
Endpoints: endpoints{
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"sdb": service{
@ -1847,6 +1952,25 @@ var awsPartition = partition{
"us-west-2": endpoint{},
},
},
"secretsmanager": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"serverlessrepo": service{
Defaults: endpoint{
Protocols: []string{"https"},
@ -1922,6 +2046,7 @@ var awsPartition = partition{
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
@ -1948,6 +2073,7 @@ var awsPartition = partition{
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
@ -2011,7 +2137,31 @@ var awsPartition = partition{
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "sqs-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "sqs-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "sqs-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "sqs-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"sa-east-1": endpoint{},
"us-east-1": endpoint{
SSLCommonName: "queue.{dnsSuffix}",
},
@ -2044,6 +2194,7 @@ var awsPartition = partition{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
@ -2052,6 +2203,7 @@ var awsPartition = partition{
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
@ -2214,6 +2366,7 @@ var awsPartition = partition{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
@ -2240,6 +2393,7 @@ var awsPartition = partition{
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
@ -2272,6 +2426,7 @@ var awsPartition = partition{
"ap-northeast-2": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
@ -2334,7 +2489,8 @@ var awscnPartition = partition{
"apigateway": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"application-autoscaling": service{
@ -2400,6 +2556,13 @@ var awscnPartition = partition{
"cn-northwest-1": endpoint{},
},
},
"ds": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"dynamodb": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
@ -2432,13 +2595,15 @@ var awscnPartition = partition{
"ecr": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"ecs": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"elasticache": service{
@ -2528,7 +2693,8 @@ var awscnPartition = partition{
"lambda": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"logs": service{
@ -2574,7 +2740,8 @@ var awscnPartition = partition{
"sms": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"snowball": service{
@ -2709,6 +2876,16 @@ var awsusgovPartition = partition{
"us-gov-west-1": endpoint{},
},
},
"cloudhsmv2": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "cloudhsm",
},
},
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
},
"cloudtrail": service{
Endpoints: endpoints{
@ -2841,6 +3018,12 @@ var awsusgovPartition = partition{
},
},
},
"inspector": service{
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
},
"kinesis": service{
Endpoints: endpoints{
@ -2957,6 +3140,12 @@ var awsusgovPartition = partition{
"us-gov-west-1": endpoint{},
},
},
"storagegateway": service{
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
},
"streams.dynamodb": service{
Defaults: endpoint{
CredentialScope: credentialScope{
@ -2991,5 +3180,13 @@ var awsusgovPartition = partition{
"us-gov-west-1": endpoint{},
},
},
"translate": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
},
},
}

View File

@ -206,10 +206,11 @@ func (p Partition) EndpointFor(service, region string, opts ...func(*Options)) (
// enumerating over the regions in a partition.
func (p Partition) Regions() map[string]Region {
rs := map[string]Region{}
for id := range p.p.Regions {
for id, r := range p.p.Regions {
rs[id] = Region{
id: id,
p: p.p,
id: id,
desc: r.Description,
p: p.p,
}
}
@ -240,6 +241,10 @@ type Region struct {
// ID returns the region's identifier.
func (r Region) ID() string { return r.id }
// Description returns the region's description. The region description
// is free text, it can be empty, and it may change between SDK releases.
func (r Region) Description() string { return r.desc }
// ResolveEndpoint resolves an endpoint from the context of the region given
// a service. See Partition.EndpointFor for usage and errors that can be returned.
func (r Region) ResolveEndpoint(service string, opts ...func(*Options)) (ResolvedEndpoint, error) {
@ -284,10 +289,11 @@ func (s Service) ResolveEndpoint(region string, opts ...func(*Options)) (Resolve
func (s Service) Regions() map[string]Region {
rs := map[string]Region{}
for id := range s.p.Services[s.id].Endpoints {
if _, ok := s.p.Regions[id]; ok {
if r, ok := s.p.Regions[id]; ok {
rs[id] = Region{
id: id,
p: s.p,
id: id,
desc: r.Description,
p: s.p,
}
}
}

View File

@ -71,6 +71,12 @@ const (
// LogDebugWithRequestErrors states the SDK should log when service requests fail
// to build, send, validate, or unmarshal.
LogDebugWithRequestErrors
// LogDebugWithEventStreamBody states the SDK should log EventStream
// request and response bodys. This should be used to log the EventStream
// wire unmarshaled message content of requests and responses made while
// using the SDK Will also enable LogDebug.
LogDebugWithEventStreamBody
)
// A Logger is a minimalistic interface for the SDK to log messages to. Should

View File

@ -14,6 +14,7 @@ type Handlers struct {
Send HandlerList
ValidateResponse HandlerList
Unmarshal HandlerList
UnmarshalStream HandlerList
UnmarshalMeta HandlerList
UnmarshalError HandlerList
Retry HandlerList
@ -30,6 +31,7 @@ func (h *Handlers) Copy() Handlers {
Send: h.Send.copy(),
ValidateResponse: h.ValidateResponse.copy(),
Unmarshal: h.Unmarshal.copy(),
UnmarshalStream: h.UnmarshalStream.copy(),
UnmarshalError: h.UnmarshalError.copy(),
UnmarshalMeta: h.UnmarshalMeta.copy(),
Retry: h.Retry.copy(),
@ -45,6 +47,7 @@ func (h *Handlers) Clear() {
h.Send.Clear()
h.Sign.Clear()
h.Unmarshal.Clear()
h.UnmarshalStream.Clear()
h.UnmarshalMeta.Clear()
h.UnmarshalError.Clear()
h.ValidateResponse.Clear()
@ -172,6 +175,21 @@ func (l *HandlerList) SwapNamed(n NamedHandler) (swapped bool) {
return swapped
}
// Swap will swap out all handlers matching the name passed in. The matched
// handlers will be swapped in. True is returned if the handlers were swapped.
func (l *HandlerList) Swap(name string, replace NamedHandler) bool {
var swapped bool
for i := 0; i < len(l.list); i++ {
if l.list[i].Name == name {
l.list[i] = replace
swapped = true
}
}
return swapped
}
// SetBackNamed will replace the named handler if it exists in the handler list.
// If the handler does not exist the handler will be added to the end of the list.
func (l *HandlerList) SetBackNamed(n NamedHandler) {

View File

@ -46,6 +46,7 @@ type Request struct {
Handlers Handlers
Retryer
AttemptTime time.Time
Time time.Time
Operation *Operation
HTTPRequest *http.Request
@ -121,6 +122,7 @@ func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers,
Handlers: handlers.Copy(),
Retryer: retryer,
AttemptTime: time.Now(),
Time: time.Now(),
ExpireTime: 0,
Operation: operation,
@ -368,9 +370,9 @@ func (r *Request) Build() error {
return r.Error
}
// Sign will sign the request returning error if errors are encountered.
// Sign will sign the request, returning error if errors are encountered.
//
// Send will build the request prior to signing. All Sign Handlers will
// Sign will build the request prior to signing. All Sign Handlers will
// be executed in the order they were set.
func (r *Request) Sign() error {
r.Build()
@ -440,7 +442,7 @@ func (r *Request) GetBody() io.ReadSeeker {
return r.safeBody
}
// Send will send the request returning error if errors are encountered.
// Send will send the request, returning error if errors are encountered.
//
// Send will sign the request prior to sending. All Send Handlers will
// be executed in the order they were set.
@ -461,6 +463,7 @@ func (r *Request) Send() error {
}()
for {
r.AttemptTime = time.Now()
if aws.BoolValue(r.Retryable) {
if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) {
r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d",

View File

@ -21,7 +21,7 @@ func (noBody) WriteTo(io.Writer) (int64, error) { return 0, nil }
var NoBody = noBody{}
// ResetBody rewinds the request body back to its starting position, and
// set's the HTTP Request body reference. When the body is read prior
// sets the HTTP Request body reference. When the body is read prior
// to being sent in the HTTP request it will need to be rewound.
//
// ResetBody will automatically be called by the SDK's build handler, but if

View File

@ -11,7 +11,7 @@ import (
var NoBody = http.NoBody
// ResetBody rewinds the request body back to its starting position, and
// set's the HTTP Request body reference. When the body is read prior
// sets the HTTP Request body reference. When the body is read prior
// to being sent in the HTTP request it will need to be rewound.
//
// ResetBody will automatically be called by the SDK's build handler, but if

View File

@ -35,8 +35,12 @@ type Pagination struct {
// NewRequest should always be built from the same API operations. It is
// undefined if different API operations are returned on subsequent calls.
NewRequest func() (*Request, error)
// EndPageOnSameToken, when enabled, will allow the paginator to stop on
// token that are the same as its previous tokens.
EndPageOnSameToken bool
started bool
prevTokens []interface{}
nextTokens []interface{}
err error
@ -49,7 +53,15 @@ type Pagination struct {
//
// Will always return true if Next has not been called yet.
func (p *Pagination) HasNextPage() bool {
return !(p.started && len(p.nextTokens) == 0)
if !p.started {
return true
}
hasNextPage := len(p.nextTokens) != 0
if p.EndPageOnSameToken {
return hasNextPage && !awsutil.DeepEqual(p.nextTokens, p.prevTokens)
}
return hasNextPage
}
// Err returns the error Pagination encountered when retrieving the next page.
@ -96,6 +108,7 @@ func (p *Pagination) Next() bool {
return false
}
p.prevTokens = p.nextTokens
p.nextTokens = req.nextPageTokens()
p.curPage = req.Data

View File

@ -97,7 +97,7 @@ func isNestedErrorRetryable(parentErr awserr.Error) bool {
}
if t, ok := err.(temporaryError); ok {
return t.Temporary()
return t.Temporary() || isErrConnectionReset(err)
}
return isErrConnectionReset(err)

View File

@ -128,7 +128,7 @@ read. The Session will be created from configuration values from the shared
credentials file (~/.aws/credentials) over those in the shared config 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 Services. They are from 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

View File

@ -96,9 +96,23 @@ type envConfig struct {
//
// AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle
CustomCABundle string
csmEnabled string
CSMEnabled bool
CSMPort string
CSMClientID string
}
var (
csmEnabledEnvKey = []string{
"AWS_CSM_ENABLED",
}
csmPortEnvKey = []string{
"AWS_CSM_PORT",
}
csmClientIDEnvKey = []string{
"AWS_CSM_CLIENT_ID",
}
credAccessEnvKey = []string{
"AWS_ACCESS_KEY_ID",
"AWS_ACCESS_KEY",
@ -157,6 +171,12 @@ func envConfigLoad(enableSharedConfig bool) envConfig {
setFromEnvVal(&cfg.Creds.SecretAccessKey, credSecretEnvKey)
setFromEnvVal(&cfg.Creds.SessionToken, credSessionEnvKey)
// CSM environment variables
setFromEnvVal(&cfg.csmEnabled, csmEnabledEnvKey)
setFromEnvVal(&cfg.CSMPort, csmPortEnvKey)
setFromEnvVal(&cfg.CSMClientID, csmClientIDEnvKey)
cfg.CSMEnabled = len(cfg.csmEnabled) > 0
// Require logical grouping of credentials
if len(cfg.Creds.AccessKeyID) == 0 || len(cfg.Creds.SecretAccessKey) == 0 {
cfg.Creds = credentials.Value{}

View File

@ -15,6 +15,7 @@ import (
"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/csm"
"github.com/aws/aws-sdk-go/aws/defaults"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/request"
@ -81,10 +82,16 @@ func New(cfgs ...*aws.Config) *Session {
r.Error = err
})
}
return s
}
return deprecatedNewSession(cfgs...)
s := deprecatedNewSession(cfgs...)
if envCfg.CSMEnabled {
enableCSM(&s.Handlers, envCfg.CSMClientID, envCfg.CSMPort, s.Config.Logger)
}
return s
}
// NewSession returns a new Session created from SDK defaults, config files,
@ -300,10 +307,22 @@ func deprecatedNewSession(cfgs ...*aws.Config) *Session {
}
initHandlers(s)
return s
}
func enableCSM(handlers *request.Handlers, clientID string, port string, logger aws.Logger) {
logger.Log("Enabling CSM")
if len(port) == 0 {
port = csm.DefaultPort
}
r, err := csm.Start(clientID, "127.0.0.1:"+port)
if err != nil {
return
}
r.InjectHandlers(handlers)
}
func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, error) {
cfg := defaults.Config()
handlers := defaults.Handlers()
@ -343,6 +362,9 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session,
}
initHandlers(s)
if envCfg.CSMEnabled {
enableCSM(&s.Handlers, envCfg.CSMClientID, envCfg.CSMPort, s.Config.Logger)
}
// Setup HTTP client with custom cert bundle if enabled
if opts.CustomCABundle != nil {

View File

@ -98,25 +98,25 @@ var ignoredHeaders = rules{
var requiredSignedHeaders = rules{
whitelist{
mapRule{
"Cache-Control": struct{}{},
"Content-Disposition": struct{}{},
"Content-Encoding": struct{}{},
"Content-Language": struct{}{},
"Content-Md5": struct{}{},
"Content-Type": struct{}{},
"Expires": struct{}{},
"If-Match": struct{}{},
"If-Modified-Since": struct{}{},
"If-None-Match": struct{}{},
"If-Unmodified-Since": struct{}{},
"Range": struct{}{},
"X-Amz-Acl": struct{}{},
"X-Amz-Copy-Source": struct{}{},
"X-Amz-Copy-Source-If-Match": struct{}{},
"X-Amz-Copy-Source-If-Modified-Since": struct{}{},
"X-Amz-Copy-Source-If-None-Match": struct{}{},
"X-Amz-Copy-Source-If-Unmodified-Since": struct{}{},
"X-Amz-Copy-Source-Range": struct{}{},
"Cache-Control": struct{}{},
"Content-Disposition": struct{}{},
"Content-Encoding": struct{}{},
"Content-Language": struct{}{},
"Content-Md5": struct{}{},
"Content-Type": struct{}{},
"Expires": struct{}{},
"If-Match": struct{}{},
"If-Modified-Since": struct{}{},
"If-None-Match": struct{}{},
"If-Unmodified-Since": struct{}{},
"Range": struct{}{},
"X-Amz-Acl": struct{}{},
"X-Amz-Copy-Source": struct{}{},
"X-Amz-Copy-Source-If-Match": struct{}{},
"X-Amz-Copy-Source-If-Modified-Since": struct{}{},
"X-Amz-Copy-Source-If-None-Match": struct{}{},
"X-Amz-Copy-Source-If-Unmodified-Since": struct{}{},
"X-Amz-Copy-Source-Range": struct{}{},
"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm": struct{}{},
"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key": struct{}{},
"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5": struct{}{},
@ -135,6 +135,7 @@ var requiredSignedHeaders = rules{
"X-Amz-Server-Side-Encryption-Customer-Key-Md5": struct{}{},
"X-Amz-Storage-Class": struct{}{},
"X-Amz-Website-Redirect-Location": struct{}{},
"X-Amz-Content-Sha256": struct{}{},
},
},
patterns{"X-Amz-Meta-"},
@ -671,8 +672,15 @@ func (ctx *signingCtx) buildSignature() {
func (ctx *signingCtx) buildBodyDigest() error {
hash := ctx.Request.Header.Get("X-Amz-Content-Sha256")
if hash == "" {
if ctx.unsignedPayload || (ctx.isPresign && ctx.ServiceName == "s3") {
includeSHA256Header := ctx.unsignedPayload ||
ctx.ServiceName == "s3" ||
ctx.ServiceName == "glacier"
s3Presign := ctx.isPresign && ctx.ServiceName == "s3"
if ctx.unsignedPayload || s3Presign {
hash = "UNSIGNED-PAYLOAD"
includeSHA256Header = !s3Presign
} else if ctx.Body == nil {
hash = emptyStringSHA256
} else {
@ -681,7 +689,8 @@ func (ctx *signingCtx) buildBodyDigest() error {
}
hash = hex.EncodeToString(makeSha256Reader(ctx.Body))
}
if ctx.unsignedPayload || ctx.ServiceName == "s3" || ctx.ServiceName == "glacier" {
if includeSHA256Header {
ctx.Request.Header.Set("X-Amz-Content-Sha256", hash)
}
}

View File

@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK
const SDKVersion = "1.13.28"
const SDKVersion = "1.14.31"

View File

@ -0,0 +1,23 @@
package sdkuri
import (
"path"
"strings"
)
// PathJoin will join the elements of the path delimited by the "/"
// character. Similar to path.Join with the exception the trailing "/"
// character is preserved if present.
func PathJoin(elems ...string) string {
if len(elems) == 0 {
return ""
}
hasTrailing := strings.HasSuffix(elems[len(elems)-1], "/")
str := path.Join(elems...)
if hasTrailing && str != "/" {
str += "/"
}
return str
}

View File

@ -0,0 +1,144 @@
package eventstream
import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"strconv"
)
type decodedMessage struct {
rawMessage
Headers decodedHeaders `json:"headers"`
}
type jsonMessage struct {
Length json.Number `json:"total_length"`
HeadersLen json.Number `json:"headers_length"`
PreludeCRC json.Number `json:"prelude_crc"`
Headers decodedHeaders `json:"headers"`
Payload []byte `json:"payload"`
CRC json.Number `json:"message_crc"`
}
func (d *decodedMessage) UnmarshalJSON(b []byte) (err error) {
var jsonMsg jsonMessage
if err = json.Unmarshal(b, &jsonMsg); err != nil {
return err
}
d.Length, err = numAsUint32(jsonMsg.Length)
if err != nil {
return err
}
d.HeadersLen, err = numAsUint32(jsonMsg.HeadersLen)
if err != nil {
return err
}
d.PreludeCRC, err = numAsUint32(jsonMsg.PreludeCRC)
if err != nil {
return err
}
d.Headers = jsonMsg.Headers
d.Payload = jsonMsg.Payload
d.CRC, err = numAsUint32(jsonMsg.CRC)
if err != nil {
return err
}
return nil
}
func (d *decodedMessage) MarshalJSON() ([]byte, error) {
jsonMsg := jsonMessage{
Length: json.Number(strconv.Itoa(int(d.Length))),
HeadersLen: json.Number(strconv.Itoa(int(d.HeadersLen))),
PreludeCRC: json.Number(strconv.Itoa(int(d.PreludeCRC))),
Headers: d.Headers,
Payload: d.Payload,
CRC: json.Number(strconv.Itoa(int(d.CRC))),
}
return json.Marshal(jsonMsg)
}
func numAsUint32(n json.Number) (uint32, error) {
v, err := n.Int64()
if err != nil {
return 0, fmt.Errorf("failed to get int64 json number, %v", err)
}
return uint32(v), nil
}
func (d decodedMessage) Message() Message {
return Message{
Headers: Headers(d.Headers),
Payload: d.Payload,
}
}
type decodedHeaders Headers
func (hs *decodedHeaders) UnmarshalJSON(b []byte) error {
var jsonHeaders []struct {
Name string `json:"name"`
Type valueType `json:"type"`
Value interface{} `json:"value"`
}
decoder := json.NewDecoder(bytes.NewReader(b))
decoder.UseNumber()
if err := decoder.Decode(&jsonHeaders); err != nil {
return err
}
var headers Headers
for _, h := range jsonHeaders {
value, err := valueFromType(h.Type, h.Value)
if err != nil {
return err
}
headers.Set(h.Name, value)
}
(*hs) = decodedHeaders(headers)
return nil
}
func valueFromType(typ valueType, val interface{}) (Value, error) {
switch typ {
case trueValueType:
return BoolValue(true), nil
case falseValueType:
return BoolValue(false), nil
case int8ValueType:
v, err := val.(json.Number).Int64()
return Int8Value(int8(v)), err
case int16ValueType:
v, err := val.(json.Number).Int64()
return Int16Value(int16(v)), err
case int32ValueType:
v, err := val.(json.Number).Int64()
return Int32Value(int32(v)), err
case int64ValueType:
v, err := val.(json.Number).Int64()
return Int64Value(v), err
case bytesValueType:
v, err := base64.StdEncoding.DecodeString(val.(string))
return BytesValue(v), err
case stringValueType:
v, err := base64.StdEncoding.DecodeString(val.(string))
return StringValue(string(v)), err
case timestampValueType:
v, err := val.(json.Number).Int64()
return TimestampValue(timeFromEpochMilli(v)), err
case uuidValueType:
v, err := base64.StdEncoding.DecodeString(val.(string))
var tv UUIDValue
copy(tv[:], v)
return tv, err
default:
panic(fmt.Sprintf("unknown type, %s, %T", typ.String(), val))
}
}

View File

@ -0,0 +1,199 @@
package eventstream
import (
"bytes"
"encoding/binary"
"encoding/hex"
"encoding/json"
"fmt"
"hash"
"hash/crc32"
"io"
"github.com/aws/aws-sdk-go/aws"
)
// Decoder provides decoding of an Event Stream messages.
type Decoder struct {
r io.Reader
logger aws.Logger
}
// NewDecoder initializes and returns a Decoder for decoding event
// stream messages from the reader provided.
func NewDecoder(r io.Reader) *Decoder {
return &Decoder{
r: r,
}
}
// Decode attempts to decode a single message from the event stream reader.
// Will return the event stream message, or error if Decode fails to read
// the message from the stream.
func (d *Decoder) Decode(payloadBuf []byte) (m Message, err error) {
reader := d.r
if d.logger != nil {
debugMsgBuf := bytes.NewBuffer(nil)
reader = io.TeeReader(reader, debugMsgBuf)
defer func() {
logMessageDecode(d.logger, debugMsgBuf, m, err)
}()
}
crc := crc32.New(crc32IEEETable)
hashReader := io.TeeReader(reader, crc)
prelude, err := decodePrelude(hashReader, crc)
if err != nil {
return Message{}, err
}
if prelude.HeadersLen > 0 {
lr := io.LimitReader(hashReader, int64(prelude.HeadersLen))
m.Headers, err = decodeHeaders(lr)
if err != nil {
return Message{}, err
}
}
if payloadLen := prelude.PayloadLen(); payloadLen > 0 {
buf, err := decodePayload(payloadBuf, io.LimitReader(hashReader, int64(payloadLen)))
if err != nil {
return Message{}, err
}
m.Payload = buf
}
msgCRC := crc.Sum32()
if err := validateCRC(reader, msgCRC); err != nil {
return Message{}, err
}
return m, nil
}
// UseLogger specifies the Logger that that the decoder should use to log the
// message decode to.
func (d *Decoder) UseLogger(logger aws.Logger) {
d.logger = logger
}
func logMessageDecode(logger aws.Logger, msgBuf *bytes.Buffer, msg Message, decodeErr error) {
w := bytes.NewBuffer(nil)
defer func() { logger.Log(w.String()) }()
fmt.Fprintf(w, "Raw message:\n%s\n",
hex.Dump(msgBuf.Bytes()))
if decodeErr != nil {
fmt.Fprintf(w, "Decode error: %v\n", decodeErr)
return
}
rawMsg, err := msg.rawMessage()
if err != nil {
fmt.Fprintf(w, "failed to create raw message, %v\n", err)
return
}
decodedMsg := decodedMessage{
rawMessage: rawMsg,
Headers: decodedHeaders(msg.Headers),
}
fmt.Fprintf(w, "Decoded message:\n")
encoder := json.NewEncoder(w)
if err := encoder.Encode(decodedMsg); err != nil {
fmt.Fprintf(w, "failed to generate decoded message, %v\n", err)
}
}
func decodePrelude(r io.Reader, crc hash.Hash32) (messagePrelude, error) {
var p messagePrelude
var err error
p.Length, err = decodeUint32(r)
if err != nil {
return messagePrelude{}, err
}
p.HeadersLen, err = decodeUint32(r)
if err != nil {
return messagePrelude{}, err
}
if err := p.ValidateLens(); err != nil {
return messagePrelude{}, err
}
preludeCRC := crc.Sum32()
if err := validateCRC(r, preludeCRC); err != nil {
return messagePrelude{}, err
}
p.PreludeCRC = preludeCRC
return p, nil
}
func decodePayload(buf []byte, r io.Reader) ([]byte, error) {
w := bytes.NewBuffer(buf[0:0])
_, err := io.Copy(w, r)
return w.Bytes(), err
}
func decodeUint8(r io.Reader) (uint8, error) {
type byteReader interface {
ReadByte() (byte, error)
}
if br, ok := r.(byteReader); ok {
v, err := br.ReadByte()
return uint8(v), err
}
var b [1]byte
_, err := io.ReadFull(r, b[:])
return uint8(b[0]), err
}
func decodeUint16(r io.Reader) (uint16, error) {
var b [2]byte
bs := b[:]
_, err := io.ReadFull(r, bs)
if err != nil {
return 0, err
}
return binary.BigEndian.Uint16(bs), nil
}
func decodeUint32(r io.Reader) (uint32, error) {
var b [4]byte
bs := b[:]
_, err := io.ReadFull(r, bs)
if err != nil {
return 0, err
}
return binary.BigEndian.Uint32(bs), nil
}
func decodeUint64(r io.Reader) (uint64, error) {
var b [8]byte
bs := b[:]
_, err := io.ReadFull(r, bs)
if err != nil {
return 0, err
}
return binary.BigEndian.Uint64(bs), nil
}
func validateCRC(r io.Reader, expect uint32) error {
msgCRC, err := decodeUint32(r)
if err != nil {
return err
}
if msgCRC != expect {
return ChecksumError{}
}
return nil
}

View File

@ -0,0 +1,114 @@
package eventstream
import (
"bytes"
"encoding/binary"
"hash"
"hash/crc32"
"io"
)
// Encoder provides EventStream message encoding.
type Encoder struct {
w io.Writer
headersBuf *bytes.Buffer
}
// NewEncoder initializes and returns an Encoder to encode Event Stream
// messages to an io.Writer.
func NewEncoder(w io.Writer) *Encoder {
return &Encoder{
w: w,
headersBuf: bytes.NewBuffer(nil),
}
}
// Encode encodes a single EventStream message to the io.Writer the Encoder
// was created with. An error is returned if writing the message fails.
func (e *Encoder) Encode(msg Message) error {
e.headersBuf.Reset()
err := encodeHeaders(e.headersBuf, msg.Headers)
if err != nil {
return err
}
crc := crc32.New(crc32IEEETable)
hashWriter := io.MultiWriter(e.w, crc)
headersLen := uint32(e.headersBuf.Len())
payloadLen := uint32(len(msg.Payload))
if err := encodePrelude(hashWriter, crc, headersLen, payloadLen); err != nil {
return err
}
if headersLen > 0 {
if _, err := io.Copy(hashWriter, e.headersBuf); err != nil {
return err
}
}
if payloadLen > 0 {
if _, err := hashWriter.Write(msg.Payload); err != nil {
return err
}
}
msgCRC := crc.Sum32()
return binary.Write(e.w, binary.BigEndian, msgCRC)
}
func encodePrelude(w io.Writer, crc hash.Hash32, headersLen, payloadLen uint32) error {
p := messagePrelude{
Length: minMsgLen + headersLen + payloadLen,
HeadersLen: headersLen,
}
if err := p.ValidateLens(); err != nil {
return err
}
err := binaryWriteFields(w, binary.BigEndian,
p.Length,
p.HeadersLen,
)
if err != nil {
return err
}
p.PreludeCRC = crc.Sum32()
err = binary.Write(w, binary.BigEndian, p.PreludeCRC)
if err != nil {
return err
}
return nil
}
func encodeHeaders(w io.Writer, headers Headers) error {
for _, h := range headers {
hn := headerName{
Len: uint8(len(h.Name)),
}
copy(hn.Name[:hn.Len], h.Name)
if err := hn.encode(w); err != nil {
return err
}
if err := h.Value.encode(w); err != nil {
return err
}
}
return nil
}
func binaryWriteFields(w io.Writer, order binary.ByteOrder, vs ...interface{}) error {
for _, v := range vs {
if err := binary.Write(w, order, v); err != nil {
return err
}
}
return nil
}

View File

@ -0,0 +1,23 @@
package eventstream
import "fmt"
// LengthError provides the error for items being larger than a maximum length.
type LengthError struct {
Part string
Want int
Have int
Value interface{}
}
func (e LengthError) Error() string {
return fmt.Sprintf("%s length invalid, %d/%d, %v",
e.Part, e.Want, e.Have, e.Value)
}
// ChecksumError provides the error for message checksum invalidation errors.
type ChecksumError struct{}
func (e ChecksumError) Error() string {
return "message checksum mismatch"
}

View File

@ -0,0 +1,196 @@
package eventstreamapi
import (
"fmt"
"io"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/eventstream"
)
// Unmarshaler provides the interface for unmarshaling a EventStream
// message into a SDK type.
type Unmarshaler interface {
UnmarshalEvent(protocol.PayloadUnmarshaler, eventstream.Message) error
}
// EventStream headers with specific meaning to async API functionality.
const (
MessageTypeHeader = `:message-type` // Identifies type of message.
EventMessageType = `event`
ErrorMessageType = `error`
ExceptionMessageType = `exception`
// Message Events
EventTypeHeader = `:event-type` // Identifies message event type e.g. "Stats".
// Message Error
ErrorCodeHeader = `:error-code`
ErrorMessageHeader = `:error-message`
// Message Exception
ExceptionTypeHeader = `:exception-type`
)
// EventReader provides reading from the EventStream of an reader.
type EventReader struct {
reader io.ReadCloser
decoder *eventstream.Decoder
unmarshalerForEventType func(string) (Unmarshaler, error)
payloadUnmarshaler protocol.PayloadUnmarshaler
payloadBuf []byte
}
// NewEventReader returns a EventReader built from the reader and unmarshaler
// provided. Use ReadStream method to start reading from the EventStream.
func NewEventReader(
reader io.ReadCloser,
payloadUnmarshaler protocol.PayloadUnmarshaler,
unmarshalerForEventType func(string) (Unmarshaler, error),
) *EventReader {
return &EventReader{
reader: reader,
decoder: eventstream.NewDecoder(reader),
payloadUnmarshaler: payloadUnmarshaler,
unmarshalerForEventType: unmarshalerForEventType,
payloadBuf: make([]byte, 10*1024),
}
}
// UseLogger instructs the EventReader to use the logger and log level
// specified.
func (r *EventReader) UseLogger(logger aws.Logger, logLevel aws.LogLevelType) {
if logger != nil && logLevel.Matches(aws.LogDebugWithEventStreamBody) {
r.decoder.UseLogger(logger)
}
}
// ReadEvent attempts to read a message from the EventStream and return the
// unmarshaled event value that the message is for.
//
// For EventStream API errors check if the returned error satisfies the
// awserr.Error interface to get the error's Code and Message components.
//
// EventUnmarshalers called with EventStream messages must take copies of the
// message's Payload. The payload will is reused between events read.
func (r *EventReader) ReadEvent() (event interface{}, err error) {
msg, err := r.decoder.Decode(r.payloadBuf)
if err != nil {
return nil, err
}
defer func() {
// Reclaim payload buffer for next message read.
r.payloadBuf = msg.Payload[0:0]
}()
typ, err := GetHeaderString(msg, MessageTypeHeader)
if err != nil {
return nil, err
}
switch typ {
case EventMessageType:
return r.unmarshalEventMessage(msg)
case ExceptionMessageType:
err = r.unmarshalEventException(msg)
return nil, err
case ErrorMessageType:
return nil, r.unmarshalErrorMessage(msg)
default:
return nil, fmt.Errorf("unknown eventstream message type, %v", typ)
}
}
func (r *EventReader) unmarshalEventMessage(
msg eventstream.Message,
) (event interface{}, err error) {
eventType, err := GetHeaderString(msg, EventTypeHeader)
if err != nil {
return nil, err
}
ev, err := r.unmarshalerForEventType(eventType)
if err != nil {
return nil, err
}
err = ev.UnmarshalEvent(r.payloadUnmarshaler, msg)
if err != nil {
return nil, err
}
return ev, nil
}
func (r *EventReader) unmarshalEventException(
msg eventstream.Message,
) (err error) {
eventType, err := GetHeaderString(msg, ExceptionTypeHeader)
if err != nil {
return err
}
ev, err := r.unmarshalerForEventType(eventType)
if err != nil {
return err
}
err = ev.UnmarshalEvent(r.payloadUnmarshaler, msg)
if err != nil {
return err
}
var ok bool
err, ok = ev.(error)
if !ok {
err = messageError{
code: "SerializationError",
msg: fmt.Sprintf(
"event stream exception %s mapped to non-error %T, %v",
eventType, ev, ev,
),
}
}
return err
}
func (r *EventReader) unmarshalErrorMessage(msg eventstream.Message) (err error) {
var msgErr messageError
msgErr.code, err = GetHeaderString(msg, ErrorCodeHeader)
if err != nil {
return err
}
msgErr.msg, err = GetHeaderString(msg, ErrorMessageHeader)
if err != nil {
return err
}
return msgErr
}
// Close closes the EventReader's EventStream reader.
func (r *EventReader) Close() error {
return r.reader.Close()
}
// GetHeaderString returns the value of the header as a string. If the header
// is not set or the value is not a string an error will be returned.
func GetHeaderString(msg eventstream.Message, headerName string) (string, error) {
headerVal := msg.Headers.Get(headerName)
if headerVal == nil {
return "", fmt.Errorf("error header %s not present", headerName)
}
v, ok := headerVal.Get().(string)
if !ok {
return "", fmt.Errorf("error header value is not a string, %T", headerVal)
}
return v, nil
}

View File

@ -0,0 +1,24 @@
package eventstreamapi
import "fmt"
type messageError struct {
code string
msg string
}
func (e messageError) Code() string {
return e.code
}
func (e messageError) Message() string {
return e.msg
}
func (e messageError) Error() string {
return fmt.Sprintf("%s: %s", e.code, e.msg)
}
func (e messageError) OrigErr() error {
return nil
}

View File

@ -0,0 +1,166 @@
package eventstream
import (
"encoding/binary"
"fmt"
"io"
)
// Headers are a collection of EventStream header values.
type Headers []Header
// Header is a single EventStream Key Value header pair.
type Header struct {
Name string
Value Value
}
// Set associates the name with a value. If the header name already exists in
// the Headers the value will be replaced with the new one.
func (hs *Headers) Set(name string, value Value) {
var i int
for ; i < len(*hs); i++ {
if (*hs)[i].Name == name {
(*hs)[i].Value = value
return
}
}
*hs = append(*hs, Header{
Name: name, Value: value,
})
}
// Get returns the Value associated with the header. Nil is returned if the
// value does not exist.
func (hs Headers) Get(name string) Value {
for i := 0; i < len(hs); i++ {
if h := hs[i]; h.Name == name {
return h.Value
}
}
return nil
}
// Del deletes the value in the Headers if it exists.
func (hs *Headers) Del(name string) {
for i := 0; i < len(*hs); i++ {
if (*hs)[i].Name == name {
copy((*hs)[i:], (*hs)[i+1:])
(*hs) = (*hs)[:len(*hs)-1]
}
}
}
func decodeHeaders(r io.Reader) (Headers, error) {
hs := Headers{}
for {
name, err := decodeHeaderName(r)
if err != nil {
if err == io.EOF {
// EOF while getting header name means no more headers
break
}
return nil, err
}
value, err := decodeHeaderValue(r)
if err != nil {
return nil, err
}
hs.Set(name, value)
}
return hs, nil
}
func decodeHeaderName(r io.Reader) (string, error) {
var n headerName
var err error
n.Len, err = decodeUint8(r)
if err != nil {
return "", err
}
name := n.Name[:n.Len]
if _, err := io.ReadFull(r, name); err != nil {
return "", err
}
return string(name), nil
}
func decodeHeaderValue(r io.Reader) (Value, error) {
var raw rawValue
typ, err := decodeUint8(r)
if err != nil {
return nil, err
}
raw.Type = valueType(typ)
var v Value
switch raw.Type {
case trueValueType:
v = BoolValue(true)
case falseValueType:
v = BoolValue(false)
case int8ValueType:
var tv Int8Value
err = tv.decode(r)
v = tv
case int16ValueType:
var tv Int16Value
err = tv.decode(r)
v = tv
case int32ValueType:
var tv Int32Value
err = tv.decode(r)
v = tv
case int64ValueType:
var tv Int64Value
err = tv.decode(r)
v = tv
case bytesValueType:
var tv BytesValue
err = tv.decode(r)
v = tv
case stringValueType:
var tv StringValue
err = tv.decode(r)
v = tv
case timestampValueType:
var tv TimestampValue
err = tv.decode(r)
v = tv
case uuidValueType:
var tv UUIDValue
err = tv.decode(r)
v = tv
default:
panic(fmt.Sprintf("unknown value type %d", raw.Type))
}
// Error could be EOF, let caller deal with it
return v, err
}
const maxHeaderNameLen = 255
type headerName struct {
Len uint8
Name [maxHeaderNameLen]byte
}
func (v headerName) encode(w io.Writer) error {
if err := binary.Write(w, binary.BigEndian, v.Len); err != nil {
return err
}
_, err := w.Write(v.Name[:v.Len])
return err
}

View File

@ -0,0 +1,501 @@
package eventstream
import (
"encoding/base64"
"encoding/binary"
"fmt"
"io"
"strconv"
"time"
)
const maxHeaderValueLen = 1<<15 - 1 // 2^15-1 or 32KB - 1
// valueType is the EventStream header value type.
type valueType uint8
// Header value types
const (
trueValueType valueType = iota
falseValueType
int8ValueType // Byte
int16ValueType // Short
int32ValueType // Integer
int64ValueType // Long
bytesValueType
stringValueType
timestampValueType
uuidValueType
)
func (t valueType) String() string {
switch t {
case trueValueType:
return "bool"
case falseValueType:
return "bool"
case int8ValueType:
return "int8"
case int16ValueType:
return "int16"
case int32ValueType:
return "int32"
case int64ValueType:
return "int64"
case bytesValueType:
return "byte_array"
case stringValueType:
return "string"
case timestampValueType:
return "timestamp"
case uuidValueType:
return "uuid"
default:
return fmt.Sprintf("unknown value type %d", uint8(t))
}
}
type rawValue struct {
Type valueType
Len uint16 // Only set for variable length slices
Value []byte // byte representation of value, BigEndian encoding.
}
func (r rawValue) encodeScalar(w io.Writer, v interface{}) error {
return binaryWriteFields(w, binary.BigEndian,
r.Type,
v,
)
}
func (r rawValue) encodeFixedSlice(w io.Writer, v []byte) error {
binary.Write(w, binary.BigEndian, r.Type)
_, err := w.Write(v)
return err
}
func (r rawValue) encodeBytes(w io.Writer, v []byte) error {
if len(v) > maxHeaderValueLen {
return LengthError{
Part: "header value",
Want: maxHeaderValueLen, Have: len(v),
Value: v,
}
}
r.Len = uint16(len(v))
err := binaryWriteFields(w, binary.BigEndian,
r.Type,
r.Len,
)
if err != nil {
return err
}
_, err = w.Write(v)
return err
}
func (r rawValue) encodeString(w io.Writer, v string) error {
if len(v) > maxHeaderValueLen {
return LengthError{
Part: "header value",
Want: maxHeaderValueLen, Have: len(v),
Value: v,
}
}
r.Len = uint16(len(v))
type stringWriter interface {
WriteString(string) (int, error)
}
err := binaryWriteFields(w, binary.BigEndian,
r.Type,
r.Len,
)
if err != nil {
return err
}
if sw, ok := w.(stringWriter); ok {
_, err = sw.WriteString(v)
} else {
_, err = w.Write([]byte(v))
}
return err
}
func decodeFixedBytesValue(r io.Reader, buf []byte) error {
_, err := io.ReadFull(r, buf)
return err
}
func decodeBytesValue(r io.Reader) ([]byte, error) {
var raw rawValue
var err error
raw.Len, err = decodeUint16(r)
if err != nil {
return nil, err
}
buf := make([]byte, raw.Len)
_, err = io.ReadFull(r, buf)
if err != nil {
return nil, err
}
return buf, nil
}
func decodeStringValue(r io.Reader) (string, error) {
v, err := decodeBytesValue(r)
return string(v), err
}
// Value represents the abstract header value.
type Value interface {
Get() interface{}
String() string
valueType() valueType
encode(io.Writer) error
}
// An BoolValue provides eventstream encoding, and representation
// of a Go bool value.
type BoolValue bool
// Get returns the underlying type
func (v BoolValue) Get() interface{} {
return bool(v)
}
// valueType returns the EventStream header value type value.
func (v BoolValue) valueType() valueType {
if v {
return trueValueType
}
return falseValueType
}
func (v BoolValue) String() string {
return strconv.FormatBool(bool(v))
}
// encode encodes the BoolValue into an eventstream binary value
// representation.
func (v BoolValue) encode(w io.Writer) error {
return binary.Write(w, binary.BigEndian, v.valueType())
}
// An Int8Value provides eventstream encoding, and representation of a Go
// int8 value.
type Int8Value int8
// Get returns the underlying value.
func (v Int8Value) Get() interface{} {
return int8(v)
}
// valueType returns the EventStream header value type value.
func (Int8Value) valueType() valueType {
return int8ValueType
}
func (v Int8Value) String() string {
return fmt.Sprintf("0x%02x", int8(v))
}
// encode encodes the Int8Value into an eventstream binary value
// representation.
func (v Int8Value) encode(w io.Writer) error {
raw := rawValue{
Type: v.valueType(),
}
return raw.encodeScalar(w, v)
}
func (v *Int8Value) decode(r io.Reader) error {
n, err := decodeUint8(r)
if err != nil {
return err
}
*v = Int8Value(n)
return nil
}
// An Int16Value provides eventstream encoding, and representation of a Go
// int16 value.
type Int16Value int16
// Get returns the underlying value.
func (v Int16Value) Get() interface{} {
return int16(v)
}
// valueType returns the EventStream header value type value.
func (Int16Value) valueType() valueType {
return int16ValueType
}
func (v Int16Value) String() string {
return fmt.Sprintf("0x%04x", int16(v))
}
// encode encodes the Int16Value into an eventstream binary value
// representation.
func (v Int16Value) encode(w io.Writer) error {
raw := rawValue{
Type: v.valueType(),
}
return raw.encodeScalar(w, v)
}
func (v *Int16Value) decode(r io.Reader) error {
n, err := decodeUint16(r)
if err != nil {
return err
}
*v = Int16Value(n)
return nil
}
// An Int32Value provides eventstream encoding, and representation of a Go
// int32 value.
type Int32Value int32
// Get returns the underlying value.
func (v Int32Value) Get() interface{} {
return int32(v)
}
// valueType returns the EventStream header value type value.
func (Int32Value) valueType() valueType {
return int32ValueType
}
func (v Int32Value) String() string {
return fmt.Sprintf("0x%08x", int32(v))
}
// encode encodes the Int32Value into an eventstream binary value
// representation.
func (v Int32Value) encode(w io.Writer) error {
raw := rawValue{
Type: v.valueType(),
}
return raw.encodeScalar(w, v)
}
func (v *Int32Value) decode(r io.Reader) error {
n, err := decodeUint32(r)
if err != nil {
return err
}
*v = Int32Value(n)
return nil
}
// An Int64Value provides eventstream encoding, and representation of a Go
// int64 value.
type Int64Value int64
// Get returns the underlying value.
func (v Int64Value) Get() interface{} {
return int64(v)
}
// valueType returns the EventStream header value type value.
func (Int64Value) valueType() valueType {
return int64ValueType
}
func (v Int64Value) String() string {
return fmt.Sprintf("0x%016x", int64(v))
}
// encode encodes the Int64Value into an eventstream binary value
// representation.
func (v Int64Value) encode(w io.Writer) error {
raw := rawValue{
Type: v.valueType(),
}
return raw.encodeScalar(w, v)
}
func (v *Int64Value) decode(r io.Reader) error {
n, err := decodeUint64(r)
if err != nil {
return err
}
*v = Int64Value(n)
return nil
}
// An BytesValue provides eventstream encoding, and representation of a Go
// byte slice.
type BytesValue []byte
// Get returns the underlying value.
func (v BytesValue) Get() interface{} {
return []byte(v)
}
// valueType returns the EventStream header value type value.
func (BytesValue) valueType() valueType {
return bytesValueType
}
func (v BytesValue) String() string {
return base64.StdEncoding.EncodeToString([]byte(v))
}
// encode encodes the BytesValue into an eventstream binary value
// representation.
func (v BytesValue) encode(w io.Writer) error {
raw := rawValue{
Type: v.valueType(),
}
return raw.encodeBytes(w, []byte(v))
}
func (v *BytesValue) decode(r io.Reader) error {
buf, err := decodeBytesValue(r)
if err != nil {
return err
}
*v = BytesValue(buf)
return nil
}
// An StringValue provides eventstream encoding, and representation of a Go
// string.
type StringValue string
// Get returns the underlying value.
func (v StringValue) Get() interface{} {
return string(v)
}
// valueType returns the EventStream header value type value.
func (StringValue) valueType() valueType {
return stringValueType
}
func (v StringValue) String() string {
return string(v)
}
// encode encodes the StringValue into an eventstream binary value
// representation.
func (v StringValue) encode(w io.Writer) error {
raw := rawValue{
Type: v.valueType(),
}
return raw.encodeString(w, string(v))
}
func (v *StringValue) decode(r io.Reader) error {
s, err := decodeStringValue(r)
if err != nil {
return err
}
*v = StringValue(s)
return nil
}
// An TimestampValue provides eventstream encoding, and representation of a Go
// timestamp.
type TimestampValue time.Time
// Get returns the underlying value.
func (v TimestampValue) Get() interface{} {
return time.Time(v)
}
// valueType returns the EventStream header value type value.
func (TimestampValue) valueType() valueType {
return timestampValueType
}
func (v TimestampValue) epochMilli() int64 {
nano := time.Time(v).UnixNano()
msec := nano / int64(time.Millisecond)
return msec
}
func (v TimestampValue) String() string {
msec := v.epochMilli()
return strconv.FormatInt(msec, 10)
}
// encode encodes the TimestampValue into an eventstream binary value
// representation.
func (v TimestampValue) encode(w io.Writer) error {
raw := rawValue{
Type: v.valueType(),
}
msec := v.epochMilli()
return raw.encodeScalar(w, msec)
}
func (v *TimestampValue) decode(r io.Reader) error {
n, err := decodeUint64(r)
if err != nil {
return err
}
*v = TimestampValue(timeFromEpochMilli(int64(n)))
return nil
}
func timeFromEpochMilli(t int64) time.Time {
secs := t / 1e3
msec := t % 1e3
return time.Unix(secs, msec*int64(time.Millisecond)).UTC()
}
// An UUIDValue provides eventstream encoding, and representation of a UUID
// value.
type UUIDValue [16]byte
// Get returns the underlying value.
func (v UUIDValue) Get() interface{} {
return v[:]
}
// valueType returns the EventStream header value type value.
func (UUIDValue) valueType() valueType {
return uuidValueType
}
func (v UUIDValue) String() string {
return fmt.Sprintf(`%X-%X-%X-%X-%X`, v[0:4], v[4:6], v[6:8], v[8:10], v[10:])
}
// encode encodes the UUIDValue into an eventstream binary value
// representation.
func (v UUIDValue) encode(w io.Writer) error {
raw := rawValue{
Type: v.valueType(),
}
return raw.encodeFixedSlice(w, v[:])
}
func (v *UUIDValue) decode(r io.Reader) error {
tv := (*v)[:]
return decodeFixedBytesValue(r, tv)
}

View File

@ -0,0 +1,103 @@
package eventstream
import (
"bytes"
"encoding/binary"
"hash/crc32"
)
const preludeLen = 8
const preludeCRCLen = 4
const msgCRCLen = 4
const minMsgLen = preludeLen + preludeCRCLen + msgCRCLen
const maxPayloadLen = 1024 * 1024 * 16 // 16MB
const maxHeadersLen = 1024 * 128 // 128KB
const maxMsgLen = minMsgLen + maxHeadersLen + maxPayloadLen
var crc32IEEETable = crc32.MakeTable(crc32.IEEE)
// A Message provides the eventstream message representation.
type Message struct {
Headers Headers
Payload []byte
}
func (m *Message) rawMessage() (rawMessage, error) {
var raw rawMessage
if len(m.Headers) > 0 {
var headers bytes.Buffer
if err := encodeHeaders(&headers, m.Headers); err != nil {
return rawMessage{}, err
}
raw.Headers = headers.Bytes()
raw.HeadersLen = uint32(len(raw.Headers))
}
raw.Length = raw.HeadersLen + uint32(len(m.Payload)) + minMsgLen
hash := crc32.New(crc32IEEETable)
binaryWriteFields(hash, binary.BigEndian, raw.Length, raw.HeadersLen)
raw.PreludeCRC = hash.Sum32()
binaryWriteFields(hash, binary.BigEndian, raw.PreludeCRC)
if raw.HeadersLen > 0 {
hash.Write(raw.Headers)
}
// Read payload bytes and update hash for it as well.
if len(m.Payload) > 0 {
raw.Payload = m.Payload
hash.Write(raw.Payload)
}
raw.CRC = hash.Sum32()
return raw, nil
}
type messagePrelude struct {
Length uint32
HeadersLen uint32
PreludeCRC uint32
}
func (p messagePrelude) PayloadLen() uint32 {
return p.Length - p.HeadersLen - minMsgLen
}
func (p messagePrelude) ValidateLens() error {
if p.Length == 0 || p.Length > maxMsgLen {
return LengthError{
Part: "message prelude",
Want: maxMsgLen,
Have: int(p.Length),
}
}
if p.HeadersLen > maxHeadersLen {
return LengthError{
Part: "message headers",
Want: maxHeadersLen,
Have: int(p.HeadersLen),
}
}
if payloadLen := p.PayloadLen(); payloadLen > maxPayloadLen {
return LengthError{
Part: "message payload",
Want: maxPayloadLen,
Have: int(payloadLen),
}
}
return nil
}
type rawMessage struct {
messagePrelude
Headers []byte
Payload []byte
CRC uint32
}

View File

@ -216,7 +216,17 @@ func buildScalar(v reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) erro
default:
switch converted := value.Interface().(type) {
case time.Time:
buf.Write(strconv.AppendInt(scratch[:0], converted.UTC().Unix(), 10))
format := tag.Get("timestampFormat")
if len(format) == 0 {
format = protocol.UnixTimeFormatName
}
ts := protocol.FormatTime(format, converted)
if format != protocol.UnixTimeFormatName {
ts = `"` + ts + `"`
}
buf.WriteString(ts)
case []byte:
if !value.IsNil() {
buf.WriteByte('"')

View File

@ -172,9 +172,6 @@ func unmarshalMap(value reflect.Value, data interface{}, tag reflect.StructTag)
}
func unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTag) error {
errf := func() error {
return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type())
}
switch d := data.(type) {
case nil:
@ -189,6 +186,17 @@ func unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTa
return err
}
value.Set(reflect.ValueOf(b))
case *time.Time:
format := tag.Get("timestampFormat")
if len(format) == 0 {
format = protocol.ISO8601TimeFormatName
}
t, err := protocol.ParseTime(format, d)
if err != nil {
return err
}
value.Set(reflect.ValueOf(&t))
case aws.JSONValue:
// No need to use escaping as the value is a non-quoted string.
v, err := protocol.DecodeJSONValue(d, protocol.NoEscape)
@ -197,7 +205,7 @@ func unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTa
}
value.Set(reflect.ValueOf(v))
default:
return errf()
return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type())
}
case float64:
switch value.Interface().(type) {
@ -207,17 +215,18 @@ func unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTa
case *float64:
value.Set(reflect.ValueOf(&d))
case *time.Time:
// Time unmarshaled from a float64 can only be epoch seconds
t := time.Unix(int64(d), 0).UTC()
value.Set(reflect.ValueOf(&t))
default:
return errf()
return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type())
}
case bool:
switch value.Interface().(type) {
case *bool:
value.Set(reflect.ValueOf(&d))
default:
return errf()
return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type())
}
default:
return fmt.Errorf("unsupported JSON value (%v)", data)

View File

@ -0,0 +1,81 @@
package protocol
import (
"io"
"io/ioutil"
"net/http"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
)
// PayloadUnmarshaler provides the interface for unmarshaling a payload's
// reader into a SDK shape.
type PayloadUnmarshaler interface {
UnmarshalPayload(io.Reader, interface{}) error
}
// HandlerPayloadUnmarshal implements the PayloadUnmarshaler from a
// HandlerList. This provides the support for unmarshaling a payload reader to
// a shape without needing a SDK request first.
type HandlerPayloadUnmarshal struct {
Unmarshalers request.HandlerList
}
// UnmarshalPayload unmarshals the io.Reader payload into the SDK shape using
// the Unmarshalers HandlerList provided. Returns an error if unable
// unmarshaling fails.
func (h HandlerPayloadUnmarshal) UnmarshalPayload(r io.Reader, v interface{}) error {
req := &request.Request{
HTTPRequest: &http.Request{},
HTTPResponse: &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: ioutil.NopCloser(r),
},
Data: v,
}
h.Unmarshalers.Run(req)
return req.Error
}
// PayloadMarshaler provides the interface for marshaling a SDK shape into and
// io.Writer.
type PayloadMarshaler interface {
MarshalPayload(io.Writer, interface{}) error
}
// HandlerPayloadMarshal implements the PayloadMarshaler from a HandlerList.
// This provides support for marshaling a SDK shape into an io.Writer without
// needing a SDK request first.
type HandlerPayloadMarshal struct {
Marshalers request.HandlerList
}
// MarshalPayload marshals the SDK shape into the io.Writer using the
// Marshalers HandlerList provided. Returns an error if unable if marshal
// fails.
func (h HandlerPayloadMarshal) MarshalPayload(w io.Writer, v interface{}) error {
req := request.New(
aws.Config{},
metadata.ClientInfo{},
request.Handlers{},
nil,
&request.Operation{HTTPMethod: "GET"},
v,
nil,
)
h.Marshalers.Run(req)
if req.Error != nil {
return req.Error
}
io.Copy(w, req.GetBody())
return nil
}

View File

@ -233,7 +233,12 @@ func (q *queryParser) parseScalar(v url.Values, r reflect.Value, name string, ta
v.Set(name, strconv.FormatFloat(float64(value), 'f', -1, 32))
case time.Time:
const ISO8601UTC = "2006-01-02T15:04:05Z"
v.Set(name, value.UTC().Format(ISO8601UTC))
format := tag.Get("timestampFormat")
if len(format) == 0 {
format = protocol.ISO8601TimeFormatName
}
v.Set(name, protocol.FormatTime(format, value))
default:
return fmt.Errorf("unsupported value for param %s: %v (%s)", name, r.Interface(), r.Type().Name())
}

View File

@ -20,9 +20,6 @@ import (
"github.com/aws/aws-sdk-go/private/protocol"
)
// RFC822 returns an RFC822 formatted timestamp for AWS protocols
const RFC822 = "Mon, 2 Jan 2006 15:04:05 GMT"
// Whether the byte value can be sent without escaping in AWS URLs
var noEscape [256]bool
@ -270,7 +267,14 @@ func convertType(v reflect.Value, tag reflect.StructTag) (str string, err error)
case float64:
str = strconv.FormatFloat(value, 'f', -1, 64)
case time.Time:
str = value.UTC().Format(RFC822)
format := tag.Get("timestampFormat")
if len(format) == 0 {
format = protocol.RFC822TimeFormatName
if tag.Get("location") == "querystring" {
format = protocol.ISO8601TimeFormatName
}
}
str = protocol.FormatTime(format, value)
case aws.JSONValue:
if len(value) == 0 {
return "", errValueNotSet

View File

@ -198,7 +198,11 @@ func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) erro
}
v.Set(reflect.ValueOf(&f))
case *time.Time:
t, err := time.Parse(RFC822, header)
format := tag.Get("timestampFormat")
if len(format) == 0 {
format = protocol.RFC822TimeFormatName
}
t, err := protocol.ParseTime(format, header)
if err != nil {
return err
}

View File

@ -0,0 +1,72 @@
package protocol
import (
"strconv"
"time"
)
// Names of time formats supported by the SDK
const (
RFC822TimeFormatName = "rfc822"
ISO8601TimeFormatName = "iso8601"
UnixTimeFormatName = "unixTimestamp"
)
// Time formats supported by the SDK
const (
// RFC 7231#section-7.1.1.1 timetamp format. e.g Tue, 29 Apr 2014 18:30:38 GMT
RFC822TimeFormat = "Mon, 2 Jan 2006 15:04:05 GMT"
// RFC3339 a subset of the ISO8601 timestamp format. e.g 2014-04-29T18:30:38Z
ISO8601TimeFormat = "2006-01-02T15:04:05Z"
)
// IsKnownTimestampFormat returns if the timestamp format name
// is know to the SDK's protocols.
func IsKnownTimestampFormat(name string) bool {
switch name {
case RFC822TimeFormatName:
fallthrough
case ISO8601TimeFormatName:
fallthrough
case UnixTimeFormatName:
return true
default:
return false
}
}
// FormatTime returns a string value of the time.
func FormatTime(name string, t time.Time) string {
t = t.UTC()
switch name {
case RFC822TimeFormatName:
return t.Format(RFC822TimeFormat)
case ISO8601TimeFormatName:
return t.Format(ISO8601TimeFormat)
case UnixTimeFormatName:
return strconv.FormatInt(t.Unix(), 10)
default:
panic("unknown timestamp format name, " + name)
}
}
// ParseTime attempts to parse the time given the format. Returns
// the time if it was able to be parsed, and fails otherwise.
func ParseTime(formatName, value string) (time.Time, error) {
switch formatName {
case RFC822TimeFormatName:
return time.Parse(RFC822TimeFormat, value)
case ISO8601TimeFormatName:
return time.Parse(ISO8601TimeFormat, value)
case UnixTimeFormatName:
v, err := strconv.ParseFloat(value, 64)
if err != nil {
return time.Time{}, err
}
return time.Unix(int64(v), 0), nil
default:
panic("unknown timestamp format name, " + formatName)
}
}

View File

@ -13,9 +13,13 @@ import (
"github.com/aws/aws-sdk-go/private/protocol"
)
// BuildXML will serialize params into an xml.Encoder.
// Error will be returned if the serialization of any of the params or nested values fails.
// BuildXML will serialize params into an xml.Encoder. Error will be returned
// if the serialization of any of the params or nested values fails.
func BuildXML(params interface{}, e *xml.Encoder) error {
return buildXML(params, e, false)
}
func buildXML(params interface{}, e *xml.Encoder, sorted bool) error {
b := xmlBuilder{encoder: e, namespaces: map[string]string{}}
root := NewXMLElement(xml.Name{})
if err := b.buildValue(reflect.ValueOf(params), root, ""); err != nil {
@ -23,7 +27,7 @@ func BuildXML(params interface{}, e *xml.Encoder) error {
}
for _, c := range root.Children {
for _, v := range c {
return StructToXML(e, v, false)
return StructToXML(e, v, sorted)
}
}
return nil
@ -278,8 +282,12 @@ func (b *xmlBuilder) buildScalar(value reflect.Value, current *XMLNode, tag refl
case float32:
str = strconv.FormatFloat(float64(converted), 'f', -1, 32)
case time.Time:
const ISO8601UTC = "2006-01-02T15:04:05Z"
str = converted.UTC().Format(ISO8601UTC)
format := tag.Get("timestampFormat")
if len(format) == 0 {
format = protocol.ISO8601TimeFormatName
}
str = protocol.FormatTime(format, converted)
default:
return fmt.Errorf("unsupported value for param %s: %v (%s)",
tag.Get("locationName"), value.Interface(), value.Type().Name())

View File

@ -9,6 +9,8 @@ import (
"strconv"
"strings"
"time"
"github.com/aws/aws-sdk-go/private/protocol"
)
// UnmarshalXML deserializes an xml.Decoder into the container v. V
@ -52,9 +54,15 @@ func parse(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
if t == "" {
switch rtype.Kind() {
case reflect.Struct:
t = "structure"
// also it can't be a time object
if _, ok := r.Interface().(*time.Time); !ok {
t = "structure"
}
case reflect.Slice:
t = "list"
// also it can't be a byte slice
if _, ok := r.Interface().([]byte); !ok {
t = "list"
}
case reflect.Map:
t = "map"
}
@ -247,8 +255,12 @@ func parseScalar(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
}
r.Set(reflect.ValueOf(&v))
case *time.Time:
const ISO8601UTC = "2006-01-02T15:04:05Z"
t, err := time.Parse(ISO8601UTC, node.Text)
format := tag.Get("timestampFormat")
if len(format) == 0 {
format = protocol.ISO8601TimeFormatName
}
t, err := protocol.ParseTime(format, node.Text)
if err != nil {
return err
}

View File

@ -29,6 +29,7 @@ func NewXMLElement(name xml.Name) *XMLNode {
// AddChild adds child to the XMLNode.
func (n *XMLNode) AddChild(child *XMLNode) {
child.parent = n
if _, ok := n.Children[child.Name.Local]; !ok {
n.Children[child.Name.Local] = []*XMLNode{}
}

View File

@ -71,7 +71,7 @@ func (c *ACM) AddTagsToCertificateRequest(input *AddTagsToCertificateInput) (req
// if you want to specify a relationship among those resources. For example,
// you can add the same tag to an ACM certificate and an Elastic Load Balancing
// load balancer to indicate that they are both used by the same website. For
// more information, see Tagging ACM certificates (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/tags.html).
// more information, see Tagging ACM certificates (http://docs.aws.amazon.com/acm/latest/userguide/tags.html).
//
// To remove one or more tags, use the RemoveTagsFromCertificate action. To
// view all of the tags that have been applied to the certificate, use the ListTagsForCertificate
@ -345,12 +345,13 @@ func (c *ACM) ExportCertificateRequest(input *ExportCertificateInput) (req *requ
// ExportCertificate API operation for AWS Certificate Manager.
//
// Exports a certificate for use anywhere. You can export the certificate, the
// certificate chain, and the encrypted private key associated with the public
// key embedded in the certificate. You must store the private key securely.
// The private key is a 2048 bit RSA key. You must provide a passphrase for
// the private key when exporting it. You can use the following OpenSSL command
// to decrypt it later. Provide the passphrase when prompted.
// Exports a private certificate issued by a private certificate authority (CA)
// for use anywhere. You can export the certificate, the certificate chain,
// and the encrypted private key associated with the public key embedded in
// the certificate. You must store the private key securely. The private key
// is a 2048 bit RSA key. You must provide a passphrase for the private key
// when exporting it. You can use the following OpenSSL command to decrypt it
// later. Provide the passphrase when prompted.
//
// openssl rsa -in encrypted_key.pem -out decrypted_key.pem
//
@ -532,15 +533,15 @@ func (c *ACM) ImportCertificateRequest(input *ImportCertificateInput) (req *requ
// ImportCertificate API operation for AWS Certificate Manager.
//
// Imports a certificate into AWS Certificate Manager (ACM) to use with services
// that are integrated with ACM. Note that integrated services (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/acm-services.html)
// that are integrated with ACM. Note that integrated services (http://docs.aws.amazon.com/acm/latest/userguide/acm-services.html)
// allow only certificate types and keys they support to be associated with
// their resources. Further, their support differs depending on whether the
// certificate is imported into IAM or into ACM. For more information, see the
// documentation for each service. For more information about importing certificates
// into ACM, see Importing Certificates (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/import-certificate.html)
// into ACM, see Importing Certificates (http://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html)
// in the AWS Certificate Manager User Guide.
//
// ACM does not provide managed renewal (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/acm-renewal.html)
// ACM does not provide managed renewal (http://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html)
// for certificates that you import.
//
// Note the following guidelines when importing third party certificates:
@ -569,13 +570,17 @@ func (c *ACM) ImportCertificateRequest(input *ImportCertificateInput) (req *requ
// * To import a new certificate, omit the CertificateArn argument. Include
// this argument only when you want to replace a previously imported certificate.
//
// * When you import a certificate by using the CLI or one of the SDKs, you
// must specify the certificate, the certificate chain, and the private key
// by their file names preceded by file://. For example, you can specify
// a certificate saved in the C:\temp folder as file://C:\temp\certificate_to_import.pem.
// * When you import a certificate by using the CLI, you must specify the
// certificate, the certificate chain, and the private key by their file
// names preceded by file://. For example, you can specify a certificate
// saved in the C:\temp folder as file://C:\temp\certificate_to_import.pem.
// If you are making an HTTP or HTTPS Query request, include these arguments
// as BLOBs.
//
// * When you import a certificate by using an SDK, you must specify the
// certificate, the certificate chain, and the private key files in the manner
// required by the programming language you're using.
//
// This operation returns the Amazon Resource Name (ARN) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the imported certificate.
//
@ -975,22 +980,17 @@ func (c *ACM) RequestCertificateRequest(input *RequestCertificateInput) (req *re
// RequestCertificate API operation for AWS Certificate Manager.
//
// Requests an ACM certificate for use with other AWS services. To request an
// ACM certificate, you must specify the fully qualified domain name (FQDN)
// for your site in the DomainName parameter. You can also specify additional
// FQDNs in the SubjectAlternativeNames parameter.
// ACM certificate, you must specify a fully qualified domain name (FQDN) in
// the DomainName parameter. You can also specify additional FQDNs in the SubjectAlternativeNames
// parameter.
//
// Each domain name that you specify must be validated to verify that you own
// or control the domain. You can use DNS validation (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/gs-acm-validate-dns.html)
// or email validation (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/gs-acm-validate-email.html).
// We recommend that you use DNS validation.
//
// If you choose email validation, email is sent to the domain owner to request
// approval to issue the certificate. Email is sent to three registered contact
// addresses in the WHOIS database and to five common system administration
// addresses formed from the DomainName you enter or the optional ValidationDomain
// parameter. For more information, see Validate with Email (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/gs-acm-validate-email.html).
//
// After receiving approval from the domain owner, the ACM certificate is issued.
// If you are requesting a private certificate, domain validation is not required.
// If you are requesting a public certificate, each domain name that you specify
// must be validated to verify that you own or control the domain. You can use
// DNS validation (http://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html)
// or email validation (http://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-email.html).
// We recommend that you use DNS validation. ACM issues public certificates
// after receiving approval from the domain owner.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@ -1087,7 +1087,7 @@ func (c *ACM) ResendValidationEmailRequest(input *ResendValidationEmailInput) (r
// more than 72 hours have elapsed since your original request or since your
// last attempt to resend validation mail, you must request a new certificate.
// For more information about setting up your contact email addresses, see Configure
// Email for your Domain (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/setup-email.html).
// Email for your Domain (http://docs.aws.amazon.com/acm/latest/userguide/setup-email.html).
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@ -1181,7 +1181,7 @@ func (c *ACM) UpdateCertificateOptionsRequest(input *UpdateCertificateOptionsInp
// Updates a certificate. Currently, you can use this function to specify whether
// to opt in to or out of recording your certificate in a certificate transparency
// log. For more information, see Opting Out of Certificate Transparency Logging
// (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/acm-bestpractices.html#best-practices-transparency).
// (http://docs.aws.amazon.com/acm/latest/userguide/acm-bestpractices.html#best-practices-transparency).
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@ -1332,7 +1332,7 @@ type CertificateDetail struct {
// The time at which the certificate was requested. This value exists only when
// the certificate type is AMAZON_ISSUED.
CreatedAt *time.Time `type:"timestamp" timestampFormat:"unix"`
CreatedAt *time.Time `type:"timestamp"`
// The fully qualified domain name for the certificate, such as www.example.com
// or example.com.
@ -1350,13 +1350,13 @@ type CertificateDetail struct {
// The reason the certificate request failed. This value exists only when the
// certificate status is FAILED. For more information, see Certificate Request
// Failed (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/troubleshooting.html#troubleshooting-failed)
// Failed (http://docs.aws.amazon.com/acm/latest/userguide/troubleshooting.html#troubleshooting-failed)
// in the AWS Certificate Manager User Guide.
FailureReason *string `type:"string" enum:"FailureReason"`
// The date and time at which the certificate was imported. This value exists
// only when the certificate type is IMPORTED.
ImportedAt *time.Time `type:"timestamp" timestampFormat:"unix"`
ImportedAt *time.Time `type:"timestamp"`
// A list of ARNs for the AWS resources that are using the certificate. A certificate
// can be used by multiple AWS resources.
@ -1364,7 +1364,7 @@ type CertificateDetail struct {
// The time at which the certificate was issued. This value exists only when
// the certificate type is AMAZON_ISSUED.
IssuedAt *time.Time `type:"timestamp" timestampFormat:"unix"`
IssuedAt *time.Time `type:"timestamp"`
// The name of the certificate authority that issued and signed the certificate.
Issuer *string `type:"string"`
@ -1379,10 +1379,10 @@ type CertificateDetail struct {
KeyUsages []*KeyUsage `type:"list"`
// The time after which the certificate is not valid.
NotAfter *time.Time `type:"timestamp" timestampFormat:"unix"`
NotAfter *time.Time `type:"timestamp"`
// The time before which the certificate is not valid.
NotBefore *time.Time `type:"timestamp" timestampFormat:"unix"`
NotBefore *time.Time `type:"timestamp"`
// Value that specifies whether to add the certificate to a transparency log.
// Certificate transparency makes it possible to detect SSL certificates that
@ -1394,7 +1394,7 @@ type CertificateDetail struct {
// Specifies whether the certificate is eligible for renewal.
RenewalEligibility *string `type:"string" enum:"RenewalEligibility"`
// Contains information about the status of ACM's managed renewal (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/acm-renewal.html)
// Contains information about the status of ACM's managed renewal (http://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html)
// for the certificate. This field exists only when the certificate type is
// AMAZON_ISSUED.
RenewalSummary *RenewalSummary `type:"structure"`
@ -1405,7 +1405,7 @@ type CertificateDetail struct {
// The time at which the certificate was revoked. This value exists only when
// the certificate status is REVOKED.
RevokedAt *time.Time `type:"timestamp" timestampFormat:"unix"`
RevokedAt *time.Time `type:"timestamp"`
// The serial number of the certificate.
Serial *string `type:"string"`
@ -1429,10 +1429,10 @@ type CertificateDetail struct {
// The source of the certificate. For certificates provided by ACM, this value
// is AMAZON_ISSUED. For certificates that you imported with ImportCertificate,
// this value is IMPORTED. ACM does not provide managed renewal (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/acm-renewal.html)
// this value is IMPORTED. ACM does not provide managed renewal (http://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html)
// for imported certificates. For more information about the differences between
// certificates that you import and those that ACM provides, see Importing Certificates
// (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/import-certificate.html)
// (http://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html)
// in the AWS Certificate Manager User Guide.
Type *string `type:"string" enum:"CertificateType"`
}
@ -1609,7 +1609,7 @@ func (s *CertificateDetail) SetType(v string) *CertificateDetail {
// be recorded in a log. Certificates that are not logged typically generate
// a browser error. Transparency makes it possible for you to detect SSL/TLS
// certificates that have been mistakenly or maliciously issued for your domain.
// For general information, see Certificate Transparency Logging (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/acm-concepts.html#concept-transparency).
// For general information, see Certificate Transparency Logging (http://docs.aws.amazon.com/acm/latest/userguide/acm-concepts.html#concept-transparency).
type CertificateOptions struct {
_ struct{} `type:"structure"`
@ -1815,7 +1815,7 @@ type DomainValidation struct {
DomainName *string `min:"1" type:"string" required:"true"`
// Contains the CNAME record that you add to your DNS database for domain validation.
// For more information, see Use DNS to Validate Domain Ownership (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/gs-acm-validate-dns.html).
// For more information, see Use DNS to Validate Domain Ownership (http://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html).
ResourceRecord *ResourceRecord `type:"structure"`
// The domain name that ACM used to send domain validation emails.
@ -2647,14 +2647,14 @@ func (s RemoveTagsFromCertificateOutput) GoString() string {
return s.String()
}
// Contains information about the status of ACM's managed renewal (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/acm-renewal.html)
// Contains information about the status of ACM's managed renewal (http://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html)
// for the certificate. This structure exists only when the certificate type
// is AMAZON_ISSUED.
type RenewalSummary struct {
_ struct{} `type:"structure"`
// Contains information about the validation of each domain name in the certificate,
// as it pertains to ACM's managed renewal (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/acm-renewal.html).
// as it pertains to ACM's managed renewal (http://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html).
// This is different from the initial validation that occurs as a result of
// the RequestCertificate request. This field exists only when the certificate
// type is AMAZON_ISSUED.
@ -2662,7 +2662,7 @@ type RenewalSummary struct {
// DomainValidationOptions is a required field
DomainValidationOptions []*DomainValidation `min:"1" type:"list" required:"true"`
// The status of ACM's managed renewal (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/acm-renewal.html)
// The status of ACM's managed renewal (http://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html)
// of the certificate.
//
// RenewalStatus is a required field
@ -2695,18 +2695,19 @@ type RequestCertificateInput struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of the private certificate authority (CA)
// that will be used to issue the certificate. For more information about private
// CAs, see the AWS Certificate Manager Private Certificate Authority (PCA)
// (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm-pca/latest/userguide/PcaWelcome.html)
// that will be used to issue the certificate. If you do not provide an ARN
// and you are trying to request a private certificate, ACM will attempt to
// issue a public certificate. For more information about private CAs, see the
// AWS Certificate Manager Private Certificate Authority (PCA) (http://docs.aws.amazon.com/acm-pca/latest/userguide/PcaWelcome.html)
// user guide. The ARN must have the following form:
//
// arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
CertificateAuthorityArn *string `min:"20" type:"string"`
// Fully qualified domain name (FQDN), such as www.example.com, of the site
// that you want to secure with an ACM Certificate. Use an asterisk (*) to create
// a wildcard certificate that protects several sites in the same domain. For
// example, *.example.com protects www.example.com, site.example.com, and images.example.com.
// Fully qualified domain name (FQDN), such as www.example.com, that you want
// to secure with an ACM certificate. Use an asterisk (*) to create a wildcard
// certificate that protects several sites in the same domain. For example,
// *.example.com protects www.example.com, site.example.com, and images.example.com.
//
// The first domain name you enter cannot exceed 63 octets, including periods.
// Each subsequent Subject Alternative Name (SAN), however, can be up to 253
@ -2732,7 +2733,7 @@ type RequestCertificateInput struct {
// to detect SSL/TLS certificates that have been mistakenly or maliciously issued.
// Certificates that have not been logged typically produce an error message
// in a browser. For more information, see Opting Out of Certificate Transparency
// Logging (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/acm-bestpractices.html#best-practices-transparency).
// Logging (http://docs.aws.amazon.com/acm/latest/userguide/acm-bestpractices.html#best-practices-transparency).
Options *CertificateOptions `type:"structure"`
// Additional FQDNs to be included in the Subject Alternative Name extension
@ -2741,7 +2742,7 @@ type RequestCertificateInput struct {
// site by using either name. The maximum number of domain names that you can
// add to an ACM certificate is 100. However, the initial limit is 10 domain
// names. If you need more than 10 names, you must request a limit increase.
// For more information, see Limits (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/acm-limits.html).
// For more information, see Limits (http://docs.aws.amazon.com/acm/latest/userguide/acm-limits.html).
//
// The maximum length of a SAN DNS name is 253 octets. The name is made up of
// multiple labels separated by periods. No label can be longer than 63 octets.
@ -2759,9 +2760,9 @@ type RequestCertificateInput struct {
// the total length of the DNS name (63+1+63+1+63+1+62) exceeds 253 octets.
SubjectAlternativeNames []*string `min:"1" type:"list"`
// The method you want to use to validate that you own or control domain. You
// can validate with DNS (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/gs-acm-validate-dns.html)
// or validate with email (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/gs-acm-validate-email.html).
// The method you want to use if you are requesting a public certificate to
// validate that you own or control domain. You can validate with DNS (http://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html)
// or validate with email (http://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-email.html).
// We recommend that you use DNS validation.
ValidationMethod *string `type:"string" enum:"ValidationMethod"`
}

View File

@ -7,7 +7,7 @@
//
// You can use ACM to manage SSL/TLS certificates for your AWS-based websites
// and applications. For general information about using ACM, see the AWS Certificate
// Manager User Guide (http://docs.aws.amazon.com/http:/docs.aws.amazon.comacm/latest/userguide/).
// Manager User Guide (http://docs.aws.amazon.com/acm/latest/userguide/).
//
// See https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08 for more information on this service.
//

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "acm" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "acm" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "ACM" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the ACM client with a session.
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

View File

@ -0,0 +1,71 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package acm
import (
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
)
// WaitUntilCertificateValidated uses the ACM API operation
// DescribeCertificate to wait for a condition to be met before returning.
// If the condition is not met within the max attempt window, an error will
// be returned.
func (c *ACM) WaitUntilCertificateValidated(input *DescribeCertificateInput) error {
return c.WaitUntilCertificateValidatedWithContext(aws.BackgroundContext(), input)
}
// WaitUntilCertificateValidatedWithContext is an extended version of WaitUntilCertificateValidated.
// With the support for passing in a context and options to configure the
// Waiter and the underlying request options.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *ACM) WaitUntilCertificateValidatedWithContext(ctx aws.Context, input *DescribeCertificateInput, opts ...request.WaiterOption) error {
w := request.Waiter{
Name: "WaitUntilCertificateValidated",
MaxAttempts: 40,
Delay: request.ConstantWaiterDelay(60 * time.Second),
Acceptors: []request.WaiterAcceptor{
{
State: request.SuccessWaiterState,
Matcher: request.PathAllWaiterMatch, Argument: "Certificate.DomainValidationOptions[].ValidationStatus",
Expected: "SUCCESS",
},
{
State: request.RetryWaiterState,
Matcher: request.PathAnyWaiterMatch, Argument: "Certificate.DomainValidationOptions[].ValidationStatus",
Expected: "PENDING_VALIDATION",
},
{
State: request.FailureWaiterState,
Matcher: request.PathWaiterMatch, Argument: "Certificate.Status",
Expected: "FAILED",
},
{
State: request.FailureWaiterState,
Matcher: request.ErrorWaiterMatch,
Expected: "ResourceNotFoundException",
},
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
var inCpy *DescribeCertificateInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeCertificateRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx)
}

4053
vendor/github.com/aws/aws-sdk-go/service/acmpca/api.go generated vendored Normal file

File diff suppressed because it is too large Load Diff

55
vendor/github.com/aws/aws-sdk-go/service/acmpca/doc.go generated vendored Normal file
View File

@ -0,0 +1,55 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package acmpca provides the client and types for making API
// requests to AWS Certificate Manager Private Certificate Authority.
//
// You can use the ACM PCA API to create a private certificate authority (CA).
// You must first call the CreateCertificateAuthority operation. If successful,
// the operation returns an Amazon Resource Name (ARN) for your private CA.
// Use this ARN as input to the GetCertificateAuthorityCsr operation to retrieve
// the certificate signing request (CSR) for your private CA certificate. Sign
// the CSR using the root or an intermediate CA in your on-premises PKI hierarchy,
// and call the ImportCertificateAuthorityCertificate to import your signed
// private CA certificate into ACM PCA.
//
// Use your private CA to issue and revoke certificates. These are private certificates
// that identify and secure client computers, servers, applications, services,
// devices, and users over SSLS/TLS connections within your organization. Call
// the IssueCertificate operation to issue a certificate. Call the RevokeCertificate
// operation to revoke a certificate.
//
// Certificates issued by your private CA can be trusted only within your organization,
// not publicly.
//
// Your private CA can optionally create a certificate revocation list (CRL)
// to track the certificates you revoke. To create a CRL, you must specify a
// RevocationConfiguration object when you call the CreateCertificateAuthority
// operation. ACM PCA writes the CRL to an S3 bucket that you specify. You must
// specify a bucket policy that grants ACM PCA write permission.
//
// You can also call the CreateCertificateAuthorityAuditReport to create an
// optional audit report that lists every time the CA private key is used. The
// private key is used for signing when the IssueCertificate or RevokeCertificate
// operation is called.
//
// See https://docs.aws.amazon.com/goto/WebAPI/acm-pca-2017-08-22 for more information on this service.
//
// See acmpca package documentation for more information.
// https://docs.aws.amazon.com/sdk-for-go/api/service/acmpca/
//
// Using the Client
//
// To contact AWS Certificate Manager Private Certificate Authority with the SDK use the New function to create
// a new service client. With that client you can make API requests to the service.
// These clients are safe to use concurrently.
//
// See the SDK's documentation for more information on how to use the SDK.
// https://docs.aws.amazon.com/sdk-for-go/api/
//
// See aws.Config documentation for more information on configuring SDK clients.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
//
// See the AWS Certificate Manager Private Certificate Authority client ACMPCA for more
// information on creating client for this service.
// https://docs.aws.amazon.com/sdk-for-go/api/service/acmpca/#New
package acmpca

View File

@ -0,0 +1,109 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package acmpca
const (
// ErrCodeCertificateMismatchException for service response error code
// "CertificateMismatchException".
//
// The certificate authority certificate you are importing does not comply with
// conditions specified in the certificate that signed it.
ErrCodeCertificateMismatchException = "CertificateMismatchException"
// ErrCodeConcurrentModificationException for service response error code
// "ConcurrentModificationException".
//
// A previous update to your private CA is still ongoing.
ErrCodeConcurrentModificationException = "ConcurrentModificationException"
// ErrCodeInvalidArgsException for service response error code
// "InvalidArgsException".
//
// One or more of the specified arguments was not valid.
ErrCodeInvalidArgsException = "InvalidArgsException"
// ErrCodeInvalidArnException for service response error code
// "InvalidArnException".
//
// The requested Amazon Resource Name (ARN) does not refer to an existing resource.
ErrCodeInvalidArnException = "InvalidArnException"
// ErrCodeInvalidNextTokenException for service response error code
// "InvalidNextTokenException".
//
// The token specified in the NextToken argument is not valid. Use the token
// returned from your previous call to ListCertificateAuthorities.
ErrCodeInvalidNextTokenException = "InvalidNextTokenException"
// ErrCodeInvalidPolicyException for service response error code
// "InvalidPolicyException".
//
// The S3 bucket policy is not valid. The policy must give ACM PCA rights to
// read from and write to the bucket and find the bucket location.
ErrCodeInvalidPolicyException = "InvalidPolicyException"
// ErrCodeInvalidStateException for service response error code
// "InvalidStateException".
//
// The private CA is in a state during which a report cannot be generated.
ErrCodeInvalidStateException = "InvalidStateException"
// ErrCodeInvalidTagException for service response error code
// "InvalidTagException".
//
// The tag associated with the CA is not valid. The invalid argument is contained
// in the message field.
ErrCodeInvalidTagException = "InvalidTagException"
// ErrCodeLimitExceededException for service response error code
// "LimitExceededException".
//
// An ACM PCA limit has been exceeded. See the exception message returned to
// determine the limit that was exceeded.
ErrCodeLimitExceededException = "LimitExceededException"
// ErrCodeMalformedCSRException for service response error code
// "MalformedCSRException".
//
// The certificate signing request is invalid.
ErrCodeMalformedCSRException = "MalformedCSRException"
// ErrCodeMalformedCertificateException for service response error code
// "MalformedCertificateException".
//
// One or more fields in the certificate are invalid.
ErrCodeMalformedCertificateException = "MalformedCertificateException"
// ErrCodeRequestAlreadyProcessedException for service response error code
// "RequestAlreadyProcessedException".
//
// Your request has already been completed.
ErrCodeRequestAlreadyProcessedException = "RequestAlreadyProcessedException"
// ErrCodeRequestFailedException for service response error code
// "RequestFailedException".
//
// The request has failed for an unspecified reason.
ErrCodeRequestFailedException = "RequestFailedException"
// ErrCodeRequestInProgressException for service response error code
// "RequestInProgressException".
//
// Your request is already in progress.
ErrCodeRequestInProgressException = "RequestInProgressException"
// ErrCodeResourceNotFoundException for service response error code
// "ResourceNotFoundException".
//
// A resource such as a private CA, S3 bucket, certificate, or audit report
// cannot be found.
ErrCodeResourceNotFoundException = "ResourceNotFoundException"
// ErrCodeTooManyTagsException for service response error code
// "TooManyTagsException".
//
// You can associate up to 50 tags with a private CA. Exception information
// is contained in the exception message field.
ErrCodeTooManyTagsException = "TooManyTagsException"
)

View File

@ -0,0 +1,97 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package acmpca
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/jsonrpc"
)
// ACMPCA provides the API operation methods for making requests to
// AWS Certificate Manager Private Certificate Authority. See this package's package overview docs
// for details on the service.
//
// ACMPCA methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type ACMPCA 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)
// Service information constants
const (
ServiceName = "acm-pca" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "ACM PCA" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the ACMPCA 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 ACMPCA client from just a session.
// svc := acmpca.New(mySession)
//
// // Create a ACMPCA client with additional configuration
// svc := acmpca.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func New(p client.ConfigProvider, cfgs ...*aws.Config) *ACMPCA {
c := p.ClientConfig(EndpointsID, cfgs...)
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
}
// newClient creates, initializes and returns a new service client instance.
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ACMPCA {
svc := &ACMPCA{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2017-08-22",
JSONVersion: "1.1",
TargetPrefix: "ACMPrivateCA",
},
handlers,
),
}
// Handlers
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
// Run custom client initialization if present
if initClient != nil {
initClient(svc.Client)
}
return svc
}
// newRequest creates a new request for a ACMPCA operation and runs any
// custom request initialization.
func (c *ACMPCA) 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
}

View File

@ -11462,7 +11462,7 @@ type ApiKey struct {
_ struct{} `type:"structure"`
// The timestamp when the API Key was created.
CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"unix"`
CreatedDate *time.Time `locationName:"createdDate" type:"timestamp"`
// An AWS Marketplace customer identifier , when integrating with the AWS SaaS
// Marketplace.
@ -11478,7 +11478,7 @@ type ApiKey struct {
Id *string `locationName:"id" type:"string"`
// The timestamp when the API Key was last updated.
LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"unix"`
LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp"`
// The name of the API Key.
Name *string `locationName:"name" type:"string"`
@ -11563,6 +11563,10 @@ type ApiStage struct {
// API stage name of the associated API stage in a usage plan.
Stage *string `locationName:"stage" type:"string"`
// Map containing method level throttling information for API stage in a usage
// plan.
Throttle map[string]*ThrottleSettings `locationName:"throttle" type:"map"`
}
// String returns the string representation
@ -11587,6 +11591,12 @@ func (s *ApiStage) SetStage(v string) *ApiStage {
return s
}
// SetThrottle sets the Throttle field's value.
func (s *ApiStage) SetThrottle(v map[string]*ThrottleSettings) *ApiStage {
s.Throttle = v
return s
}
// Represents an authorization layer for methods. If enabled on a method, API
// Gateway will activate the authorizer when a client calls the method.
//
@ -11851,13 +11861,13 @@ type ClientCertificate struct {
ClientCertificateId *string `locationName:"clientCertificateId" type:"string"`
// The timestamp when the client certificate was created.
CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"unix"`
CreatedDate *time.Time `locationName:"createdDate" type:"timestamp"`
// The description of the client certificate.
Description *string `locationName:"description" type:"string"`
// The timestamp when the client certificate will expire.
ExpirationDate *time.Time `locationName:"expirationDate" type:"timestamp" timestampFormat:"unix"`
ExpirationDate *time.Time `locationName:"expirationDate" type:"timestamp"`
// The PEM-encoded public key of the client certificate, which can be used to
// configure certificate authentication in the integration endpoint .
@ -14747,7 +14757,7 @@ type Deployment struct {
ApiSummary map[string]map[string]*MethodSnapshot `locationName:"apiSummary" type:"map"`
// The date and time that the deployment resource was created.
CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"unix"`
CreatedDate *time.Time `locationName:"createdDate" type:"timestamp"`
// The description for the deployment resource.
Description *string `locationName:"description" type:"string"`
@ -15014,7 +15024,7 @@ type DocumentationVersion struct {
_ struct{} `type:"structure"`
// The date when the API documentation snapshot is created.
CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"unix"`
CreatedDate *time.Time `locationName:"createdDate" type:"timestamp"`
// The description of the API documentation snapshot.
Description *string `locationName:"description" type:"string"`
@ -15077,7 +15087,7 @@ type DomainName struct {
// The timestamp when the certificate that was used by edge-optimized endpoint
// for this domain name was uploaded.
CertificateUploadDate *time.Time `locationName:"certificateUploadDate" type:"timestamp" timestampFormat:"unix"`
CertificateUploadDate *time.Time `locationName:"certificateUploadDate" type:"timestamp"`
// The domain name of the Amazon CloudFront distribution associated with this
// custom domain name for an edge-optimized endpoint. You set up this association
@ -15203,7 +15213,7 @@ type EndpointConfiguration struct {
// A list of endpoint types of an API (RestApi) or its custom domain name (DomainName).
// For an edge-optimized API and its custom domain name, the endpoint type is
// "EDGE". For a regional API and its custom domain name, the endpoint type
// is REGIONAL.
// is REGIONAL. For a private API, the endpoint type is PRIVATE.
Types []*string `locationName:"types" type:"list"`
}
@ -16577,11 +16587,11 @@ type GetExportInput struct {
// A key-value map of query string parameters that specify properties of the
// export, depending on the requested exportType. For exportTypeswagger, any
// combination of the following parameters are supported: integrations will
// export the API with x-amazon-apigateway-integration extensions. authorizers
// will export the API with x-amazon-apigateway-authorizer extensions. postman
// will export the API with Postman extensions, allowing for import to the Postman
// tool
// combination of the following parameters are supported: extensions='integrations'
// or extensions='apigateway' will export the API with x-amazon-apigateway-integration
// extensions. extensions='authorizers' will export the API with x-amazon-apigateway-authorizer
// extensions. postman will export the API with Postman extensions, allowing
// for import to the Postman tool
Parameters map[string]*string `location:"querystring" locationName:"parameters" type:"map"`
// [Required] The string identifier of the associated RestApi.
@ -19141,8 +19151,9 @@ type ImportRestApiInput struct {
//
// To exclude DocumentationParts from the import, set parameters as ignore=documentation.
//
// To configure the endpoint type, set parameters as endpointConfigurationTypes=EDGE
// orendpointConfigurationTypes=REGIONAL. The default endpoint type is EDGE.
// To configure the endpoint type, set parameters as endpointConfigurationTypes=EDGE,
// endpointConfigurationTypes=REGIONAL, or endpointConfigurationTypes=PRIVATE.
// The default endpoint type is EDGE.
//
// To handle imported basePath, set parameters as basePath=ignore, basePath=prepend
// or basePath=split.
@ -19151,11 +19162,11 @@ type ImportRestApiInput struct {
// API is:
//
// aws apigateway import-rest-api --parameters ignore=documentation --body
// 'file:///path/to/imported-api-body.json
// 'file:///path/to/imported-api-body.json'
// The AWS CLI command to set the regional endpoint on the imported API is:
//
// aws apigateway import-rest-api --parameters endpointConfigurationTypes=REGIONAL
// --body 'file:///path/to/imported-api-body.json
// --body 'file:///path/to/imported-api-body.json'
Parameters map[string]*string `location:"querystring" locationName:"parameters" type:"map"`
}
@ -20996,7 +21007,7 @@ type PutRestApiInput struct {
// Custom header parameters as part of the request. For example, to exclude
// DocumentationParts from an imported API, set ignore=documentation as a parameters
// value, as in the AWS CLI command of aws apigateway import-rest-api --parameters
// ignore=documentation --body 'file:///path/to/imported-api-body.json.
// ignore=documentation --body 'file:///path/to/imported-api-body.json'.
Parameters map[string]*string `location:"querystring" locationName:"parameters" type:"map"`
// [Required] The string identifier of the associated RestApi.
@ -21241,7 +21252,7 @@ type RestApi struct {
BinaryMediaTypes []*string `locationName:"binaryMediaTypes" type:"list"`
// The timestamp when the API was created.
CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"unix"`
CreatedDate *time.Time `locationName:"createdDate" type:"timestamp"`
// The API's description.
Description *string `locationName:"description" type:"string"`
@ -21490,7 +21501,7 @@ type Stage struct {
ClientCertificateId *string `locationName:"clientCertificateId" type:"string"`
// The timestamp when the stage was created.
CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"unix"`
CreatedDate *time.Time `locationName:"createdDate" type:"timestamp"`
// The identifier of the Deployment that the stage points to.
DeploymentId *string `locationName:"deploymentId" type:"string"`
@ -21502,7 +21513,7 @@ type Stage struct {
DocumentationVersion *string `locationName:"documentationVersion" type:"string"`
// The timestamp when the stage last updated.
LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"unix"`
LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp"`
// A map that defines the method settings for a Stage resource. Keys (designated
// as /{method_setting_key below) are method paths defined as {resource_path}/{http_method}
@ -24162,15 +24173,19 @@ const (
DocumentationPartTypeResponseBody = "RESPONSE_BODY"
)
// The endpoint type. The valid value is EDGE for edge-optimized API setup,
// most suitable for mobile applications, REGIONAL for regional API endpoint
// setup, most suitable for calling from AWS Region
// The endpoint type. The valid values are EDGE for edge-optimized API setup,
// most suitable for mobile applications; REGIONAL for regional API endpoint
// setup, most suitable for calling from AWS Region; and PRIVATE for private
// APIs.
const (
// EndpointTypeRegional is a EndpointType enum value
EndpointTypeRegional = "REGIONAL"
// EndpointTypeEdge is a EndpointType enum value
EndpointTypeEdge = "EDGE"
// EndpointTypePrivate is a EndpointType enum value
EndpointTypePrivate = "PRIVATE"
)
const (

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "apigateway" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "apigateway" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "API Gateway" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the APIGateway client with a session.
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

View File

@ -1362,6 +1362,11 @@ type DeleteScalingPolicyInput struct {
// * Amazon SageMaker endpoint variants - The resource type is variant and
// the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering.
//
// * Custom resources are not supported with a resource type. This parameter
// must specify the OutputValue from the CloudFormation template stack used
// to access the resources. The unique identifier is defined by the service
// provider.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
@ -1397,11 +1402,15 @@ type DeleteScalingPolicyInput struct {
// * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances
// for an Amazon SageMaker model endpoint variant.
//
// * custom-resource:ResourceType:Property - The scalable dimension for a
// custom resource provided by your own application or service.
//
// ScalableDimension is a required field
ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
// (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// The namespace of the AWS service that provides the resource or custom-resource
// for a resource provided by your own application or service. For more information,
// see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// in the Amazon Web Services General Reference.
//
// ServiceNamespace is a required field
@ -1514,6 +1523,11 @@ type DeleteScheduledActionInput struct {
// * Amazon SageMaker endpoint variants - The resource type is variant and
// the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering.
//
// * Custom resources are not supported with a resource type. This parameter
// must specify the OutputValue from the CloudFormation template stack used
// to access the resources. The unique identifier is defined by the service
// provider.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
@ -1548,6 +1562,9 @@ type DeleteScheduledActionInput struct {
//
// * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances
// for an Amazon SageMaker model endpoint variant.
//
// * custom-resource:ResourceType:Property - The scalable dimension for a
// custom resource provided by your own application or service.
ScalableDimension *string `type:"string" enum:"ScalableDimension"`
// The name of the scheduled action.
@ -1555,8 +1572,9 @@ type DeleteScheduledActionInput struct {
// ScheduledActionName is a required field
ScheduledActionName *string `min:"1" type:"string" required:"true"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
// (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// The namespace of the AWS service that provides the resource or custom-resource
// for a resource provided by your own application or service. For more information,
// see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// in the Amazon Web Services General Reference.
//
// ServiceNamespace is a required field
@ -1666,6 +1684,11 @@ type DeregisterScalableTargetInput struct {
// * Amazon SageMaker endpoint variants - The resource type is variant and
// the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering.
//
// * Custom resources are not supported with a resource type. This parameter
// must specify the OutputValue from the CloudFormation template stack used
// to access the resources. The unique identifier is defined by the service
// provider.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
@ -1701,11 +1724,15 @@ type DeregisterScalableTargetInput struct {
// * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances
// for an Amazon SageMaker model endpoint variant.
//
// * custom-resource:ResourceType:Property - The scalable dimension for a
// custom resource provided by your own application or service.
//
// ScalableDimension is a required field
ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
// (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// The namespace of the AWS service that provides the resource or custom-resource
// for a resource provided by your own application or service. For more information,
// see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// in the Amazon Web Services General Reference.
//
// ServiceNamespace is a required field
@ -1818,6 +1845,11 @@ type DescribeScalableTargetsInput struct {
//
// * Amazon SageMaker endpoint variants - The resource type is variant and
// the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering.
//
// * Custom resources are not supported with a resource type. This parameter
// must specify the OutputValue from the CloudFormation template stack used
// to access the resources. The unique identifier is defined by the service
// provider.
ResourceIds []*string `type:"list"`
// The scalable dimension associated with the scalable target. This string consists
@ -1852,10 +1884,14 @@ type DescribeScalableTargetsInput struct {
//
// * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances
// for an Amazon SageMaker model endpoint variant.
//
// * custom-resource:ResourceType:Property - The scalable dimension for a
// custom resource provided by your own application or service.
ScalableDimension *string `type:"string" enum:"ScalableDimension"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
// (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// The namespace of the AWS service that provides the resource or custom-resource
// for a resource provided by your own application or service. For more information,
// see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// in the Amazon Web Services General Reference.
//
// ServiceNamespace is a required field
@ -1990,6 +2026,11 @@ type DescribeScalingActivitiesInput struct {
//
// * Amazon SageMaker endpoint variants - The resource type is variant and
// the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering.
//
// * Custom resources are not supported with a resource type. This parameter
// must specify the OutputValue from the CloudFormation template stack used
// to access the resources. The unique identifier is defined by the service
// provider.
ResourceId *string `min:"1" type:"string"`
// The scalable dimension. This string consists of the service namespace, resource
@ -2024,10 +2065,14 @@ type DescribeScalingActivitiesInput struct {
//
// * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances
// for an Amazon SageMaker model endpoint variant.
//
// * custom-resource:ResourceType:Property - The scalable dimension for a
// custom resource provided by your own application or service.
ScalableDimension *string `type:"string" enum:"ScalableDimension"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
// (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// The namespace of the AWS service that provides the resource or custom-resource
// for a resource provided by your own application or service. For more information,
// see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// in the Amazon Web Services General Reference.
//
// ServiceNamespace is a required field
@ -2168,6 +2213,11 @@ type DescribeScalingPoliciesInput struct {
//
// * Amazon SageMaker endpoint variants - The resource type is variant and
// the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering.
//
// * Custom resources are not supported with a resource type. This parameter
// must specify the OutputValue from the CloudFormation template stack used
// to access the resources. The unique identifier is defined by the service
// provider.
ResourceId *string `min:"1" type:"string"`
// The scalable dimension. This string consists of the service namespace, resource
@ -2202,10 +2252,14 @@ type DescribeScalingPoliciesInput struct {
//
// * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances
// for an Amazon SageMaker model endpoint variant.
//
// * custom-resource:ResourceType:Property - The scalable dimension for a
// custom resource provided by your own application or service.
ScalableDimension *string `type:"string" enum:"ScalableDimension"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
// (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// The namespace of the AWS service that provides the resource or custom-resource
// for a resource provided by your own application or service. For more information,
// see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// in the Amazon Web Services General Reference.
//
// ServiceNamespace is a required field
@ -2349,6 +2403,11 @@ type DescribeScheduledActionsInput struct {
//
// * Amazon SageMaker endpoint variants - The resource type is variant and
// the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering.
//
// * Custom resources are not supported with a resource type. This parameter
// must specify the OutputValue from the CloudFormation template stack used
// to access the resources. The unique identifier is defined by the service
// provider.
ResourceId *string `min:"1" type:"string"`
// The scalable dimension. This string consists of the service namespace, resource
@ -2383,13 +2442,17 @@ type DescribeScheduledActionsInput struct {
//
// * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances
// for an Amazon SageMaker model endpoint variant.
//
// * custom-resource:ResourceType:Property - The scalable dimension for a
// custom resource provided by your own application or service.
ScalableDimension *string `type:"string" enum:"ScalableDimension"`
// The names of the scheduled actions to describe.
ScheduledActionNames []*string `type:"list"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
// (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// The namespace of the AWS service that provides the resource or custom-resource
// for a resource provided by your own application or service. For more information,
// see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// in the Amazon Web Services General Reference.
//
// ServiceNamespace is a required field
@ -2649,6 +2712,11 @@ type PutScalingPolicyInput struct {
// * Amazon SageMaker endpoint variants - The resource type is variant and
// the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering.
//
// * Custom resources are not supported with a resource type. This parameter
// must specify the OutputValue from the CloudFormation template stack used
// to access the resources. The unique identifier is defined by the service
// provider.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
@ -2684,11 +2752,15 @@ type PutScalingPolicyInput struct {
// * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances
// for an Amazon SageMaker model endpoint variant.
//
// * custom-resource:ResourceType:Property - The scalable dimension for a
// custom resource provided by your own application or service.
//
// ScalableDimension is a required field
ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
// (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// The namespace of the AWS service that provides the resource or custom-resource
// for a resource provided by your own application or service. For more information,
// see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// in the Amazon Web Services General Reference.
//
// ServiceNamespace is a required field
@ -2835,7 +2907,7 @@ type PutScheduledActionInput struct {
_ struct{} `type:"structure"`
// The date and time for the scheduled action to end.
EndTime *time.Time `type:"timestamp" timestampFormat:"unix"`
EndTime *time.Time `type:"timestamp"`
// The identifier of the resource associated with the scheduled action. This
// string consists of the resource type and unique identifier.
@ -2864,6 +2936,11 @@ type PutScheduledActionInput struct {
// * Amazon SageMaker endpoint variants - The resource type is variant and
// the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering.
//
// * Custom resources are not supported with a resource type. This parameter
// must specify the OutputValue from the CloudFormation template stack used
// to access the resources. The unique identifier is defined by the service
// provider.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
@ -2899,6 +2976,9 @@ type PutScheduledActionInput struct {
//
// * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances
// for an Amazon SageMaker model endpoint variant.
//
// * custom-resource:ResourceType:Property - The scalable dimension for a
// custom resource provided by your own application or service.
ScalableDimension *string `type:"string" enum:"ScalableDimension"`
// The new minimum and maximum capacity. You can set both values or just one.
@ -2921,7 +3001,8 @@ type PutScheduledActionInput struct {
// For rate expressions, value is a positive integer and unit is minute | minutes
// | hour | hours | day | days.
//
// For more information about cron expressions, see Cron (https://en.wikipedia.org/wiki/Cron).
// For more information about cron expressions, see Cron Expressions (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions)
// in the Amazon CloudWatch Events User Guide.
Schedule *string `min:"1" type:"string"`
// The name of the scheduled action.
@ -2929,15 +3010,16 @@ type PutScheduledActionInput struct {
// ScheduledActionName is a required field
ScheduledActionName *string `min:"1" type:"string" required:"true"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
// (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// The namespace of the AWS service that provides the resource or custom-resource
// for a resource provided by your own application or service. For more information,
// see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// in the Amazon Web Services General Reference.
//
// ServiceNamespace is a required field
ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"`
// The date and time for the scheduled action to start.
StartTime *time.Time `type:"timestamp" timestampFormat:"unix"`
StartTime *time.Time `type:"timestamp"`
}
// String returns the string representation
@ -3078,12 +3160,17 @@ type RegisterScalableTargetInput struct {
// * Amazon SageMaker endpoint variants - The resource type is variant and
// the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering.
//
// * Custom resources are not supported with a resource type. This parameter
// must specify the OutputValue from the CloudFormation template stack used
// to access the resources. The unique identifier is defined by the service
// provider.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
// Application Auto Scaling creates a service-linked role that grants it permissions
// to modify the scalable target on your behalf. For more information, see Service-Linked
// Roles for Application Auto Scaling (http://docs.aws.amazon.com/ApplicationAutoScaling/latest/APIReference/application-autoscaling-service-linked-roles.html).
// Roles for Application Auto Scaling (http://docs.aws.amazon.com/autoscaling/application/userguide/application-autoscaling-service-linked-roles.html).
//
// For resources that are not supported using a service-linked role, this parameter
// is required and must specify the ARN of an IAM role that allows Application
@ -3122,11 +3209,15 @@ type RegisterScalableTargetInput struct {
// * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances
// for an Amazon SageMaker model endpoint variant.
//
// * custom-resource:ResourceType:Property - The scalable dimension for a
// custom resource provided by your own application or service.
//
// ScalableDimension is a required field
ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
// (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// The namespace of the AWS service that provides the resource or custom-resource
// for a resource provided by your own application or service. For more information,
// see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// in the Amazon Web Services General Reference.
//
// ServiceNamespace is a required field
@ -3225,7 +3316,7 @@ type ScalableTarget struct {
// The Unix timestamp for when the scalable target was created.
//
// CreationTime is a required field
CreationTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"`
CreationTime *time.Time `type:"timestamp" required:"true"`
// The maximum value to scale to in response to a scale out event.
//
@ -3264,6 +3355,11 @@ type ScalableTarget struct {
// * Amazon SageMaker endpoint variants - The resource type is variant and
// the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering.
//
// * Custom resources are not supported with a resource type. This parameter
// must specify the OutputValue from the CloudFormation template stack used
// to access the resources. The unique identifier is defined by the service
// provider.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
@ -3305,11 +3401,15 @@ type ScalableTarget struct {
// * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances
// for an Amazon SageMaker model endpoint variant.
//
// * custom-resource:ResourceType:Property - The scalable dimension for a
// custom resource provided by your own application or service.
//
// ScalableDimension is a required field
ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
// (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// The namespace of the AWS service that provides the resource or custom-resource
// for a resource provided by your own application or service. For more information,
// see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// in the Amazon Web Services General Reference.
//
// ServiceNamespace is a required field
@ -3424,7 +3524,7 @@ type ScalingActivity struct {
Details *string `type:"string"`
// The Unix timestamp for when the scaling activity ended.
EndTime *time.Time `type:"timestamp" timestampFormat:"unix"`
EndTime *time.Time `type:"timestamp"`
// The identifier of the resource associated with the scaling activity. This
// string consists of the resource type and unique identifier.
@ -3453,6 +3553,11 @@ type ScalingActivity struct {
// * Amazon SageMaker endpoint variants - The resource type is variant and
// the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering.
//
// * Custom resources are not supported with a resource type. This parameter
// must specify the OutputValue from the CloudFormation template stack used
// to access the resources. The unique identifier is defined by the service
// provider.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
@ -3488,11 +3593,15 @@ type ScalingActivity struct {
// * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances
// for an Amazon SageMaker model endpoint variant.
//
// * custom-resource:ResourceType:Property - The scalable dimension for a
// custom resource provided by your own application or service.
//
// ScalableDimension is a required field
ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
// (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// The namespace of the AWS service that provides the resource or custom-resource
// for a resource provided by your own application or service. For more information,
// see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// in the Amazon Web Services General Reference.
//
// ServiceNamespace is a required field
@ -3501,7 +3610,7 @@ type ScalingActivity struct {
// The Unix timestamp for when the scaling activity began.
//
// StartTime is a required field
StartTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"`
StartTime *time.Time `type:"timestamp" required:"true"`
// Indicates the status of the scaling activity.
//
@ -3598,7 +3707,7 @@ type ScalingPolicy struct {
// The Unix timestamp for when the scaling policy was created.
//
// CreationTime is a required field
CreationTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"`
CreationTime *time.Time `type:"timestamp" required:"true"`
// The Amazon Resource Name (ARN) of the scaling policy.
//
@ -3642,6 +3751,11 @@ type ScalingPolicy struct {
// * Amazon SageMaker endpoint variants - The resource type is variant and
// the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering.
//
// * Custom resources are not supported with a resource type. This parameter
// must specify the OutputValue from the CloudFormation template stack used
// to access the resources. The unique identifier is defined by the service
// provider.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
@ -3677,11 +3791,15 @@ type ScalingPolicy struct {
// * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances
// for an Amazon SageMaker model endpoint variant.
//
// * custom-resource:ResourceType:Property - The scalable dimension for a
// custom resource provided by your own application or service.
//
// ScalableDimension is a required field
ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
// (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// The namespace of the AWS service that provides the resource or custom-resource
// for a resource provided by your own application or service. For more information,
// see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// in the Amazon Web Services General Reference.
//
// ServiceNamespace is a required field
@ -3771,10 +3889,10 @@ type ScheduledAction struct {
// The date and time that the scheduled action was created.
//
// CreationTime is a required field
CreationTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"`
CreationTime *time.Time `type:"timestamp" required:"true"`
// The date and time that the action is scheduled to end.
EndTime *time.Time `type:"timestamp" timestampFormat:"unix"`
EndTime *time.Time `type:"timestamp"`
// The identifier of the resource associated with the scaling policy. This string
// consists of the resource type and unique identifier.
@ -3803,6 +3921,11 @@ type ScheduledAction struct {
// * Amazon SageMaker endpoint variants - The resource type is variant and
// the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering.
//
// * Custom resources are not supported with a resource type. This parameter
// must specify the OutputValue from the CloudFormation template stack used
// to access the resources. The unique identifier is defined by the service
// provider.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
@ -3837,6 +3960,9 @@ type ScheduledAction struct {
//
// * sagemaker:variant:DesiredInstanceCount - The number of EC2 instances
// for an Amazon SageMaker model endpoint variant.
//
// * custom-resource:ResourceType:Property - The scalable dimension for a
// custom resource provided by your own application or service.
ScalableDimension *string `type:"string" enum:"ScalableDimension"`
// The new minimum and maximum capacity. You can set both values or just one.
@ -3859,7 +3985,8 @@ type ScheduledAction struct {
// For rate expressions, value is a positive integer and unit is minute | minutes
// | hour | hours | day | days.
//
// For more information about cron expressions, see Cron (https://en.wikipedia.org/wiki/Cron).
// For more information about cron expressions, see Cron Expressions (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions)
// in the Amazon CloudWatch Events User Guide.
//
// Schedule is a required field
Schedule *string `min:"1" type:"string" required:"true"`
@ -3874,15 +4001,16 @@ type ScheduledAction struct {
// ScheduledActionName is a required field
ScheduledActionName *string `min:"1" type:"string" required:"true"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
// (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// The namespace of the AWS service that provides the resource or custom-resource
// for a resource provided by your own application or service. For more information,
// see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
// in the Amazon Web Services General Reference.
//
// ServiceNamespace is a required field
ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"`
// The date and time that the action is scheduled to begin.
StartTime *time.Time `type:"timestamp" timestampFormat:"unix"`
StartTime *time.Time `type:"timestamp"`
}
// String returns the string representation
@ -4381,6 +4509,9 @@ const (
// ScalableDimensionSagemakerVariantDesiredInstanceCount is a ScalableDimension enum value
ScalableDimensionSagemakerVariantDesiredInstanceCount = "sagemaker:variant:DesiredInstanceCount"
// ScalableDimensionCustomResourceResourceTypeProperty is a ScalableDimension enum value
ScalableDimensionCustomResourceResourceTypeProperty = "custom-resource:ResourceType:Property"
)
const (
@ -4424,4 +4555,7 @@ const (
// ServiceNamespaceSagemaker is a ServiceNamespace enum value
ServiceNamespaceSagemaker = "sagemaker"
// ServiceNamespaceCustomResource is a ServiceNamespace enum value
ServiceNamespaceCustomResource = "custom-resource"
)

View File

@ -4,10 +4,10 @@
// requests to Application Auto Scaling.
//
// With Application Auto Scaling, you can configure automatic scaling for your
// scalable AWS resources. You can use Application Auto Scaling to accomplish
// the following tasks:
// scalable resources. You can use Application Auto Scaling to accomplish the
// following tasks:
//
// * Define scaling policies to automatically scale your AWS resources
// * Define scaling policies to automatically scale your AWS or custom resources
//
// * Scale your resources in response to CloudWatch alarms
//
@ -15,7 +15,7 @@
//
// * View the history of your scaling events
//
// Application Auto Scaling can scale the following AWS resources:
// Application Auto Scaling can scale the following resources:
//
// * Amazon ECS services. For more information, see Service Auto Scaling
// (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-auto-scaling.html)
@ -41,16 +41,19 @@
// * Amazon Aurora Replicas. For more information, see Using Amazon Aurora
// Auto Scaling with Aurora Replicas (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Integrating.AutoScaling.html).
//
// * Amazon SageMaker endpoints. For more information, see Automatically
// * Amazon SageMaker endpoint variants. For more information, see Automatically
// Scaling Amazon SageMaker Models (http://docs.aws.amazon.com/sagemaker/latest/dg/endpoint-auto-scaling.html).
//
// * Custom resources provided by your own applications or services. More
// information is available in our GitHub repository (https://github.com/aws/aws-auto-scaling-custom-resource).
//
//
// To learn more about Application Auto Scaling, see the Application Auto Scaling
// User Guide (http://docs.aws.amazon.com/autoscaling/application/userguide/what-is-application-auto-scaling.html).
//
// To configure automatic scaling for multiple resources across multiple services,
// use AWS Auto Scaling to create a scaling plan for your application. For more
// information, see AWS Auto Scaling (http://aws.amazon.com/autoscaling).
//
// For a list of supported regions, see AWS Regions and Endpoints: Application
// Auto Scaling (http://docs.aws.amazon.com/general/latest/gr/rande.html#as-app_region)
// in the AWS General Reference.
// information, see the AWS Auto Scaling User Guide (http://docs.aws.amazon.com/autoscaling/plans/userguide/what-is-aws-auto-scaling.html).
//
// See https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06 for more information on this service.
//

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "autoscaling" // Service endpoint prefix API calls made to.
EndpointsID = "application-autoscaling" // Service ID for Regions and Endpoints metadata.
ServiceName = "autoscaling" // Name of service.
EndpointsID = "application-autoscaling" // ID to lookup a service endpoint with.
ServiceID = "Application Auto Scaling" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the ApplicationAutoScaling client with a session.
@ -58,6 +59,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

View File

@ -87,7 +87,8 @@ func (c *AppSync) CreateApiKeyRequest(input *CreateApiKeyInput) (req *request.Re
// The API key exceeded a limit. Try your request again.
//
// * ErrCodeApiKeyValidityOutOfBoundsException "ApiKeyValidityOutOfBoundsException"
// The API key expiration must be set to a value between 1 and 365 days.
// The API key expiration must be set to a value between 1 and 365 days from
// creation (for CreateApiKey) or from update (for UpdateApiKey).
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/CreateApiKey
func (c *AppSync) CreateApiKey(input *CreateApiKeyInput) (*CreateApiKeyOutput, error) {
@ -276,9 +277,6 @@ func (c *AppSync) CreateGraphqlApiRequest(input *CreateGraphqlApiInput) (req *re
// * ErrCodeInternalFailureException "InternalFailureException"
// An internal AWS AppSync error occurred. Try your request again.
//
// * ErrCodeLimitExceededException "LimitExceededException"
// The request exceeded a limit. Try your request again.
//
// * ErrCodeApiLimitExceededException "ApiLimitExceededException"
// The GraphQL API exceeded a limit. Try your request again.
//
@ -1543,6 +1541,11 @@ func (c *AppSync) ListApiKeysRequest(input *ListApiKeysInput) (req *request.Requ
//
// Lists the API keys for a given API.
//
// API keys are deleted automatically sometime after they expire. However, they
// may still be included in the response until they have actually been deleted.
// You can safely call DeleteApiKey to manually delete a key before it's automatically
// deleted.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
@ -2115,7 +2118,8 @@ func (c *AppSync) UpdateApiKeyRequest(input *UpdateApiKeyInput) (req *request.Re
// An internal AWS AppSync error occurred. Try your request again.
//
// * ErrCodeApiKeyValidityOutOfBoundsException "ApiKeyValidityOutOfBoundsException"
// The API key expiration must be set to a value between 1 and 365 days.
// The API key expiration must be set to a value between 1 and 365 days from
// creation (for CreateApiKey) or from update (for UpdateApiKey).
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/UpdateApiKey
func (c *AppSync) UpdateApiKey(input *UpdateApiKeyInput) (*UpdateApiKeyOutput, error) {
@ -2512,6 +2516,43 @@ func (c *AppSync) UpdateTypeWithContext(ctx aws.Context, input *UpdateTypeInput,
}
// Describes an API key.
//
// Customers invoke AWS AppSync GraphQL APIs with API keys as an identity mechanism.
// There are two key versions:
//
// da1: This version was introduced at launch in November 2017. These keys always
// expire after 7 days. Key expiration is managed by DynamoDB TTL. The keys
// will cease to be valid after Feb 21, 2018 and should not be used after that
// date.
//
// * ListApiKeys returns the expiration time in milliseconds.
//
// * CreateApiKey returns the expiration time in milliseconds.
//
// * UpdateApiKey is not available for this key version.
//
// * DeleteApiKey deletes the item from the table.
//
// * Expiration is stored in DynamoDB as milliseconds. This results in a
// bug where keys are not automatically deleted because DynamoDB expects
// the TTL to be stored in seconds. As a one-time action, we will delete
// these keys from the table after Feb 21, 2018.
//
// da2: This version was introduced in February 2018 when AppSync added support
// to extend key expiration.
//
// * ListApiKeys returns the expiration time in seconds.
//
// * CreateApiKey returns the expiration time in seconds and accepts a user-provided
// expiration time in seconds.
//
// * UpdateApiKey returns the expiration time in seconds and accepts a user-provided
// expiration time in seconds. Key expiration can only be updated while the
// key has not expired.
//
// * DeleteApiKey deletes the item from the table.
//
// * Expiration is stored in DynamoDB as seconds.
type ApiKey struct {
_ struct{} `type:"structure"`
@ -2565,9 +2606,10 @@ type CreateApiKeyInput struct {
// A description of the purpose of the API key.
Description *string `locationName:"description" type:"string"`
// The time after which the API key expires. The date is represented as seconds
// since the epoch, rounded down to the nearest hour. The default value for
// this parameter is 7 days from creation time.
// The time from creation time after which the API key expires. The date is
// represented as seconds since the epoch, rounded down to the nearest hour.
// The default value for this parameter is 7 days from creation time. For more
// information, see .
Expires *int64 `locationName:"expires" type:"long"`
}
@ -2652,6 +2694,9 @@ type CreateDataSourceInput struct {
// Amazon Elasticsearch settings.
ElasticsearchConfig *ElasticsearchDataSourceConfig `locationName:"elasticsearchConfig" type:"structure"`
// Http endpoint settings.
HttpConfig *HttpDataSourceConfig `locationName:"httpConfig" type:"structure"`
// AWS Lambda settings.
LambdaConfig *LambdaDataSourceConfig `locationName:"lambdaConfig" type:"structure"`
@ -2738,6 +2783,12 @@ func (s *CreateDataSourceInput) SetElasticsearchConfig(v *ElasticsearchDataSourc
return s
}
// SetHttpConfig sets the HttpConfig field's value.
func (s *CreateDataSourceInput) SetHttpConfig(v *HttpDataSourceConfig) *CreateDataSourceInput {
s.HttpConfig = v
return s
}
// SetLambdaConfig sets the LambdaConfig field's value.
func (s *CreateDataSourceInput) SetLambdaConfig(v *LambdaDataSourceConfig) *CreateDataSourceInput {
s.LambdaConfig = v
@ -2793,11 +2844,17 @@ type CreateGraphqlApiInput struct {
// AuthenticationType is a required field
AuthenticationType *string `locationName:"authenticationType" type:"string" required:"true" enum:"AuthenticationType"`
// The Amazon CloudWatch logs configuration.
LogConfig *LogConfig `locationName:"logConfig" type:"structure"`
// A user-supplied name for the GraphqlApi.
//
// Name is a required field
Name *string `locationName:"name" type:"string" required:"true"`
// The Open Id Connect configuration configuration.
OpenIDConnectConfig *OpenIDConnectConfig `locationName:"openIDConnectConfig" type:"structure"`
// The Amazon Cognito User Pool configuration.
UserPoolConfig *UserPoolConfig `locationName:"userPoolConfig" type:"structure"`
}
@ -2821,6 +2878,16 @@ func (s *CreateGraphqlApiInput) Validate() error {
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.LogConfig != nil {
if err := s.LogConfig.Validate(); err != nil {
invalidParams.AddNested("LogConfig", err.(request.ErrInvalidParams))
}
}
if s.OpenIDConnectConfig != nil {
if err := s.OpenIDConnectConfig.Validate(); err != nil {
invalidParams.AddNested("OpenIDConnectConfig", err.(request.ErrInvalidParams))
}
}
if s.UserPoolConfig != nil {
if err := s.UserPoolConfig.Validate(); err != nil {
invalidParams.AddNested("UserPoolConfig", err.(request.ErrInvalidParams))
@ -2839,12 +2906,24 @@ func (s *CreateGraphqlApiInput) SetAuthenticationType(v string) *CreateGraphqlAp
return s
}
// SetLogConfig sets the LogConfig field's value.
func (s *CreateGraphqlApiInput) SetLogConfig(v *LogConfig) *CreateGraphqlApiInput {
s.LogConfig = v
return s
}
// SetName sets the Name field's value.
func (s *CreateGraphqlApiInput) SetName(v string) *CreateGraphqlApiInput {
s.Name = &v
return s
}
// SetOpenIDConnectConfig sets the OpenIDConnectConfig field's value.
func (s *CreateGraphqlApiInput) SetOpenIDConnectConfig(v *OpenIDConnectConfig) *CreateGraphqlApiInput {
s.OpenIDConnectConfig = v
return s
}
// SetUserPoolConfig sets the UserPoolConfig field's value.
func (s *CreateGraphqlApiInput) SetUserPoolConfig(v *UserPoolConfig) *CreateGraphqlApiInput {
s.UserPoolConfig = v
@ -2899,10 +2978,10 @@ type CreateResolverInput struct {
// in Apache Velocity Template Language (VTL).
//
// RequestMappingTemplate is a required field
RequestMappingTemplate *string `locationName:"requestMappingTemplate" type:"string" required:"true"`
RequestMappingTemplate *string `locationName:"requestMappingTemplate" min:"1" type:"string" required:"true"`
// The mapping template to be used for responses from the data source.
ResponseMappingTemplate *string `locationName:"responseMappingTemplate" type:"string"`
ResponseMappingTemplate *string `locationName:"responseMappingTemplate" min:"1" type:"string"`
// The name of the Type.
//
@ -2935,6 +3014,12 @@ func (s *CreateResolverInput) Validate() error {
if s.RequestMappingTemplate == nil {
invalidParams.Add(request.NewErrParamRequired("RequestMappingTemplate"))
}
if s.RequestMappingTemplate != nil && len(*s.RequestMappingTemplate) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RequestMappingTemplate", 1))
}
if s.ResponseMappingTemplate != nil && len(*s.ResponseMappingTemplate) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ResponseMappingTemplate", 1))
}
if s.TypeName == nil {
invalidParams.Add(request.NewErrParamRequired("TypeName"))
}
@ -3111,6 +3196,9 @@ type DataSource struct {
// Amazon Elasticsearch settings.
ElasticsearchConfig *ElasticsearchDataSourceConfig `locationName:"elasticsearchConfig" type:"structure"`
// Http endpoint settings.
HttpConfig *HttpDataSourceConfig `locationName:"httpConfig" type:"structure"`
// Lambda settings.
LambdaConfig *LambdaDataSourceConfig `locationName:"lambdaConfig" type:"structure"`
@ -3130,8 +3218,12 @@ type DataSource struct {
//
// * AWS_LAMBDA: The data source is an AWS Lambda function.
//
// * NONE: There is no data source. This type is used when the required information
// can be computed on the fly without connecting to a back-end data source.
// * NONE: There is no data source. This type is used when when you wish
// to invoke a GraphQL operation without connecting to a data source, such
// as performing data transformation with resolvers or triggering a subscription
// to be invoked from a mutation.
//
// * HTTP: The data source is an HTTP endpoint.
Type *string `locationName:"type" type:"string" enum:"DataSourceType"`
}
@ -3169,6 +3261,12 @@ func (s *DataSource) SetElasticsearchConfig(v *ElasticsearchDataSourceConfig) *D
return s
}
// SetHttpConfig sets the HttpConfig field's value.
func (s *DataSource) SetHttpConfig(v *HttpDataSourceConfig) *DataSource {
s.HttpConfig = v
return s
}
// SetLambdaConfig sets the LambdaConfig field's value.
func (s *DataSource) SetLambdaConfig(v *LambdaDataSourceConfig) *DataSource {
s.LambdaConfig = v
@ -4113,9 +4211,15 @@ type GraphqlApi struct {
// The authentication type.
AuthenticationType *string `locationName:"authenticationType" type:"string" enum:"AuthenticationType"`
// The Amazon CloudWatch Logs configuration.
LogConfig *LogConfig `locationName:"logConfig" type:"structure"`
// The API name.
Name *string `locationName:"name" type:"string"`
// The Open Id Connect configuration.
OpenIDConnectConfig *OpenIDConnectConfig `locationName:"openIDConnectConfig" type:"structure"`
// The URIs.
Uris map[string]*string `locationName:"uris" type:"map"`
@ -4151,12 +4255,24 @@ func (s *GraphqlApi) SetAuthenticationType(v string) *GraphqlApi {
return s
}
// SetLogConfig sets the LogConfig field's value.
func (s *GraphqlApi) SetLogConfig(v *LogConfig) *GraphqlApi {
s.LogConfig = v
return s
}
// SetName sets the Name field's value.
func (s *GraphqlApi) SetName(v string) *GraphqlApi {
s.Name = &v
return s
}
// SetOpenIDConnectConfig sets the OpenIDConnectConfig field's value.
func (s *GraphqlApi) SetOpenIDConnectConfig(v *OpenIDConnectConfig) *GraphqlApi {
s.OpenIDConnectConfig = v
return s
}
// SetUris sets the Uris field's value.
func (s *GraphqlApi) SetUris(v map[string]*string) *GraphqlApi {
s.Uris = v
@ -4169,6 +4285,33 @@ func (s *GraphqlApi) SetUserPoolConfig(v *UserPoolConfig) *GraphqlApi {
return s
}
// Describes a Http data source configuration.
type HttpDataSourceConfig struct {
_ struct{} `type:"structure"`
// The Http url endpoint. You can either specify the domain name or ip and port
// combination and the url scheme must be http(s). If the port is not specified,
// AWS AppSync will use the default port 80 for http endpoint and port 443 for
// https endpoints.
Endpoint *string `locationName:"endpoint" type:"string"`
}
// String returns the string representation
func (s HttpDataSourceConfig) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s HttpDataSourceConfig) GoString() string {
return s.String()
}
// SetEndpoint sets the Endpoint field's value.
func (s *HttpDataSourceConfig) SetEndpoint(v string) *HttpDataSourceConfig {
s.Endpoint = &v
return s
}
// Describes a Lambda data source configuration.
type LambdaDataSourceConfig struct {
_ struct{} `type:"structure"`
@ -4662,6 +4805,147 @@ func (s *ListTypesOutput) SetTypes(v []*Type) *ListTypesOutput {
return s
}
// The CloudWatch Logs configuration.
type LogConfig struct {
_ struct{} `type:"structure"`
// The service role that AWS AppSync will assume to publish to Amazon CloudWatch
// logs in your account.
//
// CloudWatchLogsRoleArn is a required field
CloudWatchLogsRoleArn *string `locationName:"cloudWatchLogsRoleArn" type:"string" required:"true"`
// The field logging level. Values can be NONE, ERROR, ALL.
//
// * NONE: No field-level logs are captured.
//
// * ERROR: Logs the following information only for the fields that are in
// error:
//
// The error section in the server response.
//
// Field-level errors.
//
// The generated request/response functions that got resolved for error fields.
//
// * ALL: The following information is logged for all fields in the query:
//
// Field-level tracing information.
//
// The generated request/response functions that got resolved for each field.
//
// FieldLogLevel is a required field
FieldLogLevel *string `locationName:"fieldLogLevel" type:"string" required:"true" enum:"FieldLogLevel"`
}
// String returns the string representation
func (s LogConfig) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s LogConfig) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *LogConfig) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "LogConfig"}
if s.CloudWatchLogsRoleArn == nil {
invalidParams.Add(request.NewErrParamRequired("CloudWatchLogsRoleArn"))
}
if s.FieldLogLevel == nil {
invalidParams.Add(request.NewErrParamRequired("FieldLogLevel"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value.
func (s *LogConfig) SetCloudWatchLogsRoleArn(v string) *LogConfig {
s.CloudWatchLogsRoleArn = &v
return s
}
// SetFieldLogLevel sets the FieldLogLevel field's value.
func (s *LogConfig) SetFieldLogLevel(v string) *LogConfig {
s.FieldLogLevel = &v
return s
}
// Describes an Open Id Connect configuration.
type OpenIDConnectConfig struct {
_ struct{} `type:"structure"`
// The number of milliseconds a token is valid after being authenticated.
AuthTTL *int64 `locationName:"authTTL" type:"long"`
// The client identifier of the Relying party at the OpenID Provider. This identifier
// is typically obtained when the Relying party is registered with the OpenID
// Provider. You can specify a regular expression so the AWS AppSync can validate
// against multiple client identifiers at a time
ClientId *string `locationName:"clientId" type:"string"`
// The number of milliseconds a token is valid after being issued to a user.
IatTTL *int64 `locationName:"iatTTL" type:"long"`
// The issuer for the open id connect configuration. The issuer returned by
// discovery MUST exactly match the value of iss in the ID Token.
//
// Issuer is a required field
Issuer *string `locationName:"issuer" type:"string" required:"true"`
}
// String returns the string representation
func (s OpenIDConnectConfig) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s OpenIDConnectConfig) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *OpenIDConnectConfig) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "OpenIDConnectConfig"}
if s.Issuer == nil {
invalidParams.Add(request.NewErrParamRequired("Issuer"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetAuthTTL sets the AuthTTL field's value.
func (s *OpenIDConnectConfig) SetAuthTTL(v int64) *OpenIDConnectConfig {
s.AuthTTL = &v
return s
}
// SetClientId sets the ClientId field's value.
func (s *OpenIDConnectConfig) SetClientId(v string) *OpenIDConnectConfig {
s.ClientId = &v
return s
}
// SetIatTTL sets the IatTTL field's value.
func (s *OpenIDConnectConfig) SetIatTTL(v int64) *OpenIDConnectConfig {
s.IatTTL = &v
return s
}
// SetIssuer sets the Issuer field's value.
func (s *OpenIDConnectConfig) SetIssuer(v string) *OpenIDConnectConfig {
s.Issuer = &v
return s
}
// Describes a resolver.
type Resolver struct {
_ struct{} `type:"structure"`
@ -4673,13 +4957,13 @@ type Resolver struct {
FieldName *string `locationName:"fieldName" type:"string"`
// The request mapping template.
RequestMappingTemplate *string `locationName:"requestMappingTemplate" type:"string"`
RequestMappingTemplate *string `locationName:"requestMappingTemplate" min:"1" type:"string"`
// The resolver ARN.
ResolverArn *string `locationName:"resolverArn" type:"string"`
// The response mapping template.
ResponseMappingTemplate *string `locationName:"responseMappingTemplate" type:"string"`
ResponseMappingTemplate *string `locationName:"responseMappingTemplate" min:"1" type:"string"`
// The resolver type name.
TypeName *string `locationName:"typeName" type:"string"`
@ -4880,8 +5164,8 @@ type UpdateApiKeyInput struct {
// A description of the purpose of the API key.
Description *string `locationName:"description" type:"string"`
// The time after which the API key expires. The date is represented as seconds
// since the epoch.
// The time from update time after which the API key expires. The date is represented
// as seconds since the epoch. For more information, see .
Expires *int64 `locationName:"expires" type:"long"`
// The API key ID.
@ -4980,6 +5264,9 @@ type UpdateDataSourceInput struct {
// The new Elasticsearch configuration.
ElasticsearchConfig *ElasticsearchDataSourceConfig `locationName:"elasticsearchConfig" type:"structure"`
// The new http endpoint configuration
HttpConfig *HttpDataSourceConfig `locationName:"httpConfig" type:"structure"`
// The new Lambda configuration.
LambdaConfig *LambdaDataSourceConfig `locationName:"lambdaConfig" type:"structure"`
@ -5065,6 +5352,12 @@ func (s *UpdateDataSourceInput) SetElasticsearchConfig(v *ElasticsearchDataSourc
return s
}
// SetHttpConfig sets the HttpConfig field's value.
func (s *UpdateDataSourceInput) SetHttpConfig(v *HttpDataSourceConfig) *UpdateDataSourceInput {
s.HttpConfig = v
return s
}
// SetLambdaConfig sets the LambdaConfig field's value.
func (s *UpdateDataSourceInput) SetLambdaConfig(v *LambdaDataSourceConfig) *UpdateDataSourceInput {
s.LambdaConfig = v
@ -5123,11 +5416,17 @@ type UpdateGraphqlApiInput struct {
// The new authentication type for the GraphqlApi object.
AuthenticationType *string `locationName:"authenticationType" type:"string" enum:"AuthenticationType"`
// The Amazon CloudWatch logs configuration for the GraphqlApi object.
LogConfig *LogConfig `locationName:"logConfig" type:"structure"`
// The new name for the GraphqlApi object.
//
// Name is a required field
Name *string `locationName:"name" type:"string" required:"true"`
// The Open Id Connect configuration configuration for the GraphqlApi object.
OpenIDConnectConfig *OpenIDConnectConfig `locationName:"openIDConnectConfig" type:"structure"`
// The new Amazon Cognito User Pool configuration for the GraphqlApi object.
UserPoolConfig *UserPoolConfig `locationName:"userPoolConfig" type:"structure"`
}
@ -5151,6 +5450,16 @@ func (s *UpdateGraphqlApiInput) Validate() error {
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.LogConfig != nil {
if err := s.LogConfig.Validate(); err != nil {
invalidParams.AddNested("LogConfig", err.(request.ErrInvalidParams))
}
}
if s.OpenIDConnectConfig != nil {
if err := s.OpenIDConnectConfig.Validate(); err != nil {
invalidParams.AddNested("OpenIDConnectConfig", err.(request.ErrInvalidParams))
}
}
if s.UserPoolConfig != nil {
if err := s.UserPoolConfig.Validate(); err != nil {
invalidParams.AddNested("UserPoolConfig", err.(request.ErrInvalidParams))
@ -5175,12 +5484,24 @@ func (s *UpdateGraphqlApiInput) SetAuthenticationType(v string) *UpdateGraphqlAp
return s
}
// SetLogConfig sets the LogConfig field's value.
func (s *UpdateGraphqlApiInput) SetLogConfig(v *LogConfig) *UpdateGraphqlApiInput {
s.LogConfig = v
return s
}
// SetName sets the Name field's value.
func (s *UpdateGraphqlApiInput) SetName(v string) *UpdateGraphqlApiInput {
s.Name = &v
return s
}
// SetOpenIDConnectConfig sets the OpenIDConnectConfig field's value.
func (s *UpdateGraphqlApiInput) SetOpenIDConnectConfig(v *OpenIDConnectConfig) *UpdateGraphqlApiInput {
s.OpenIDConnectConfig = v
return s
}
// SetUserPoolConfig sets the UserPoolConfig field's value.
func (s *UpdateGraphqlApiInput) SetUserPoolConfig(v *UserPoolConfig) *UpdateGraphqlApiInput {
s.UserPoolConfig = v
@ -5231,10 +5552,10 @@ type UpdateResolverInput struct {
// The new request mapping template.
//
// RequestMappingTemplate is a required field
RequestMappingTemplate *string `locationName:"requestMappingTemplate" type:"string" required:"true"`
RequestMappingTemplate *string `locationName:"requestMappingTemplate" min:"1" type:"string" required:"true"`
// The new response mapping template.
ResponseMappingTemplate *string `locationName:"responseMappingTemplate" type:"string"`
ResponseMappingTemplate *string `locationName:"responseMappingTemplate" min:"1" type:"string"`
// The new type name.
//
@ -5267,6 +5588,12 @@ func (s *UpdateResolverInput) Validate() error {
if s.RequestMappingTemplate == nil {
invalidParams.Add(request.NewErrParamRequired("RequestMappingTemplate"))
}
if s.RequestMappingTemplate != nil && len(*s.RequestMappingTemplate) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RequestMappingTemplate", 1))
}
if s.ResponseMappingTemplate != nil && len(*s.ResponseMappingTemplate) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ResponseMappingTemplate", 1))
}
if s.TypeName == nil {
invalidParams.Add(request.NewErrParamRequired("TypeName"))
}
@ -5522,6 +5849,9 @@ const (
// AuthenticationTypeAmazonCognitoUserPools is a AuthenticationType enum value
AuthenticationTypeAmazonCognitoUserPools = "AMAZON_COGNITO_USER_POOLS"
// AuthenticationTypeOpenidConnect is a AuthenticationType enum value
AuthenticationTypeOpenidConnect = "OPENID_CONNECT"
)
const (
@ -5536,6 +5866,9 @@ const (
// DataSourceTypeNone is a DataSourceType enum value
DataSourceTypeNone = "NONE"
// DataSourceTypeHttp is a DataSourceType enum value
DataSourceTypeHttp = "HTTP"
)
const (
@ -5546,6 +5879,17 @@ const (
DefaultActionDeny = "DENY"
)
const (
// FieldLogLevelNone is a FieldLogLevel enum value
FieldLogLevelNone = "NONE"
// FieldLogLevelError is a FieldLogLevel enum value
FieldLogLevelError = "ERROR"
// FieldLogLevelAll is a FieldLogLevel enum value
FieldLogLevelAll = "ALL"
)
const (
// OutputTypeSdl is a OutputType enum value
OutputTypeSdl = "SDL"

View File

@ -13,7 +13,8 @@ const (
// ErrCodeApiKeyValidityOutOfBoundsException for service response error code
// "ApiKeyValidityOutOfBoundsException".
//
// The API key expiration must be set to a value between 1 and 365 days.
// The API key expiration must be set to a value between 1 and 365 days from
// creation (for CreateApiKey) or from update (for UpdateApiKey).
ErrCodeApiKeyValidityOutOfBoundsException = "ApiKeyValidityOutOfBoundsException"
// ErrCodeApiLimitExceededException for service response error code

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "appsync" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "appsync" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "AppSync" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the AppSync client with a session.
@ -58,6 +59,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

View File

@ -2212,7 +2212,7 @@ type QueryExecutionStatus struct {
_ struct{} `type:"structure"`
// The date and time that the query completed.
CompletionDateTime *time.Time `type:"timestamp" timestampFormat:"unix"`
CompletionDateTime *time.Time `type:"timestamp"`
// The state of query execution. SUBMITTED indicates that the query is queued
// for execution. RUNNING indicates that the query is scanning data and returning
@ -2225,7 +2225,7 @@ type QueryExecutionStatus struct {
StateChangeReason *string `type:"string"`
// The date and time that the query was submitted.
SubmissionDateTime *time.Time `type:"timestamp" timestampFormat:"unix"`
SubmissionDateTime *time.Time `type:"timestamp"`
}
// String returns the string representation

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "athena" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "athena" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "Athena" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the Athena client with a session.
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

View File

@ -5112,7 +5112,7 @@ type Activity struct {
Details *string `type:"string"`
// The end time of the activity.
EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
EndTime *time.Time `type:"timestamp"`
// A value between 0 and 100 that indicates the progress of the activity.
Progress *int64 `type:"integer"`
@ -5120,7 +5120,7 @@ type Activity struct {
// The start time of the activity.
//
// StartTime is a required field
StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
StartTime *time.Time `type:"timestamp" required:"true"`
// The current status of the activity.
//
@ -8018,7 +8018,7 @@ type DescribeScheduledActionsInput struct {
// The latest scheduled start time to return. If scheduled action names are
// provided, this parameter is ignored.
EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
EndTime *time.Time `type:"timestamp"`
// The maximum number of items to return with this call. The default value is
// 50 and the maximum value is 100.
@ -8039,7 +8039,7 @@ type DescribeScheduledActionsInput struct {
// The earliest scheduled start time to return. If scheduled action names are
// provided, this parameter is ignored.
StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
StartTime *time.Time `type:"timestamp"`
}
// String returns the string representation
@ -9143,7 +9143,7 @@ type Group struct {
// The date and time the group was created.
//
// CreatedTime is a required field
CreatedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
CreatedTime *time.Time `type:"timestamp" required:"true"`
// The amount of time, in seconds, after a scaling activity completes before
// another scaling activity can start.
@ -9625,7 +9625,7 @@ type LaunchConfiguration struct {
// The creation date and time for the launch configuration.
//
// CreatedTime is a required field
CreatedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
CreatedTime *time.Time `type:"timestamp" required:"true"`
// Controls whether the instance is optimized for EBS I/O (true) or not (false).
EbsOptimized *bool `type:"boolean"`
@ -11007,7 +11007,7 @@ type PutScheduledUpdateGroupActionInput struct {
// The time for the recurring schedule to end. Auto Scaling does not perform
// the action after this time.
EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
EndTime *time.Time `type:"timestamp"`
// The maximum size for the Auto Scaling group.
MaxSize *int64 `type:"integer"`
@ -11032,10 +11032,10 @@ type PutScheduledUpdateGroupActionInput struct {
//
// If you try to schedule your action in the past, Auto Scaling returns an error
// message.
StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
StartTime *time.Time `type:"timestamp"`
// This parameter is deprecated.
Time *time.Time `type:"timestamp" timestampFormat:"iso8601"`
Time *time.Time `type:"timestamp"`
}
// String returns the string representation
@ -11483,7 +11483,7 @@ type ScheduledUpdateGroupAction struct {
// The date and time that the action is scheduled to end. This date and time
// can be up to one month in the future.
EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
EndTime *time.Time `type:"timestamp"`
// The maximum size of the group.
MaxSize *int64 `type:"integer"`
@ -11505,10 +11505,10 @@ type ScheduledUpdateGroupAction struct {
//
// When StartTime and EndTime are specified with Recurrence, they form the boundaries
// of when the recurring action will start and stop.
StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
StartTime *time.Time `type:"timestamp"`
// This parameter is deprecated.
Time *time.Time `type:"timestamp" timestampFormat:"iso8601"`
Time *time.Time `type:"timestamp"`
}
// String returns the string representation

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "autoscaling" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "autoscaling" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "Auto Scaling" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the AutoScaling client with a session.
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

View File

@ -1581,16 +1581,18 @@ type AttemptDetail struct {
// Details about the container in this job attempt.
Container *AttemptContainerDetail `locationName:"container" type:"structure"`
// The Unix time stamp for when the attempt was started (when the attempt transitioned
// from the STARTING state to the RUNNING state).
// The Unix time stamp (in seconds and milliseconds) for when the attempt was
// started (when the attempt transitioned from the STARTING state to the RUNNING
// state).
StartedAt *int64 `locationName:"startedAt" type:"long"`
// A short, human-readable string to provide additional details about the current
// status of the job attempt.
StatusReason *string `locationName:"statusReason" type:"string"`
// The Unix time stamp for when the attempt was stopped (when the attempt transitioned
// from the RUNNING state to a terminal state, such as SUCCEEDED or FAILED).
// The Unix time stamp (in seconds and milliseconds) for when the attempt was
// stopped (when the attempt transitioned from the RUNNING state to a terminal
// state, such as SUCCEEDED or FAILED).
StoppedAt *int64 `locationName:"stoppedAt" type:"long"`
}
@ -2393,6 +2395,11 @@ type ContainerProperties struct {
// and the --memory option to docker run (https://docs.docker.com/engine/reference/run/).
// You must specify at least 4 MiB of memory for a job.
//
// If you are trying to maximize your resource utilization by providing your
// jobs as much memory as possible for a particular instance type, see Memory
// Management (http://docs.aws.amazon.com/batch/latest/userguide/memory-management.html)
// in the AWS Batch User Guide.
//
// Memory is a required field
Memory *int64 `locationName:"memory" type:"integer" required:"true"`
@ -3429,6 +3436,11 @@ type JobDefinition struct {
// The status of the job definition.
Status *string `locationName:"status" type:"string"`
// The timeout configuration for jobs that are submitted with this job definition.
// You can specify a timeout duration after which AWS Batch terminates your
// jobs if they have not finished.
Timeout *JobTimeout `locationName:"timeout" type:"structure"`
// The type of job definition.
//
// Type is a required field
@ -3487,6 +3499,12 @@ func (s *JobDefinition) SetStatus(v string) *JobDefinition {
return s
}
// SetTimeout sets the Timeout field's value.
func (s *JobDefinition) SetTimeout(v *JobTimeout) *JobDefinition {
s.Timeout = v
return s
}
// SetType sets the Type field's value.
func (s *JobDefinition) SetType(v string) *JobDefinition {
s.Type = &v
@ -3540,10 +3558,11 @@ type JobDetail struct {
// the job.
Container *ContainerDetail `locationName:"container" type:"structure"`
// The Unix time stamp for when the job was created. For non-array jobs and
// parent array jobs, this is when the job entered the SUBMITTED state (at the
// time SubmitJob was called). For array child jobs, this is when the child
// job was spawned by its parent and entered the PENDING state.
// The Unix time stamp (in seconds and milliseconds) for when the job was created.
// For non-array jobs and parent array jobs, this is when the job entered the
// SUBMITTED state (at the time SubmitJob was called). For array child jobs,
// this is when the child job was spawned by its parent and entered the PENDING
// state.
CreatedAt *int64 `locationName:"createdAt" type:"long"`
// A list of job names or IDs on which this job depends.
@ -3577,8 +3596,8 @@ type JobDetail struct {
// The retry strategy to use for this job if an attempt fails.
RetryStrategy *RetryStrategy `locationName:"retryStrategy" type:"structure"`
// The Unix time stamp for when the job was started (when the job transitioned
// from the STARTING state to the RUNNING state).
// The Unix time stamp (in seconds and milliseconds) for when the job was started
// (when the job transitioned from the STARTING state to the RUNNING state).
//
// StartedAt is a required field
StartedAt *int64 `locationName:"startedAt" type:"long" required:"true"`
@ -3592,9 +3611,13 @@ type JobDetail struct {
// status of the job.
StatusReason *string `locationName:"statusReason" type:"string"`
// The Unix time stamp for when the job was stopped (when the job transitioned
// from the RUNNING state to a terminal state, such as SUCCEEDED or FAILED).
// The Unix time stamp (in seconds and milliseconds) for when the job was stopped
// (when the job transitioned from the RUNNING state to a terminal state, such
// as SUCCEEDED or FAILED).
StoppedAt *int64 `locationName:"stoppedAt" type:"long"`
// The timeout configuration for the job.
Timeout *JobTimeout `locationName:"timeout" type:"structure"`
}
// String returns the string representation
@ -3697,6 +3720,12 @@ func (s *JobDetail) SetStoppedAt(v int64) *JobDetail {
return s
}
// SetTimeout sets the Timeout field's value.
func (s *JobDetail) SetTimeout(v *JobTimeout) *JobDetail {
s.Timeout = v
return s
}
// An object representing the details of an AWS Batch job queue.
type JobQueueDetail struct {
_ struct{} `type:"structure"`
@ -3895,6 +3924,31 @@ func (s *JobSummary) SetStoppedAt(v int64) *JobSummary {
return s
}
// An object representing a job timeout configuration.
type JobTimeout struct {
_ struct{} `type:"structure"`
// The time duration in seconds (measured from the job attempt's startedAt timestamp)
// after which AWS Batch terminates your jobs if they have not finished.
AttemptDurationSeconds *int64 `locationName:"attemptDurationSeconds" type:"integer"`
}
// String returns the string representation
func (s JobTimeout) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s JobTimeout) GoString() string {
return s.String()
}
// SetAttemptDurationSeconds sets the AttemptDurationSeconds field's value.
func (s *JobTimeout) SetAttemptDurationSeconds(v int64) *JobTimeout {
s.AttemptDurationSeconds = &v
return s
}
// A key-value pair object.
type KeyValuePair struct {
_ struct{} `type:"structure"`
@ -4105,9 +4159,19 @@ type RegisterJobDefinitionInput struct {
// The retry strategy to use for failed jobs that are submitted with this job
// definition. Any retry strategy that is specified during a SubmitJob operation
// overrides the retry strategy defined here.
// overrides the retry strategy defined here. If a job is terminated due to
// a timeout, it is not retried.
RetryStrategy *RetryStrategy `locationName:"retryStrategy" type:"structure"`
// The timeout configuration for jobs that are submitted with this job definition,
// after which AWS Batch terminates your jobs if they have not finished. If
// a job is terminated due to a timeout, it is not retried. The minimum value
// for the timeout is 60 seconds. Any timeout configuration that is specified
// during a SubmitJob operation overrides the timeout configuration defined
// here. For more information, see Job Timeouts (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/job_timeouts.html)
// in the Amazon Elastic Container Service Developer Guide.
Timeout *JobTimeout `locationName:"timeout" type:"structure"`
// The type of job definition.
//
// Type is a required field
@ -4169,6 +4233,12 @@ func (s *RegisterJobDefinitionInput) SetRetryStrategy(v *RetryStrategy) *Registe
return s
}
// SetTimeout sets the Timeout field's value.
func (s *RegisterJobDefinitionInput) SetTimeout(v *JobTimeout) *RegisterJobDefinitionInput {
s.Timeout = v
return s
}
// SetType sets the Type field's value.
func (s *RegisterJobDefinitionInput) SetType(v string) *RegisterJobDefinitionInput {
s.Type = &v
@ -4304,6 +4374,16 @@ type SubmitJobInput struct {
// When a retry strategy is specified here, it overrides the retry strategy
// defined in the job definition.
RetryStrategy *RetryStrategy `locationName:"retryStrategy" type:"structure"`
// The timeout configuration for this SubmitJob operation. You can specify a
// timeout duration after which AWS Batch terminates your jobs if they have
// not finished. If a job is terminated due to a timeout, it is not retried.
// The minimum value for the timeout is 60 seconds. This configuration overrides
// any timeout configuration specified in the job definition. For array jobs,
// child jobs have the same timeout configuration as the parent job. For more
// information, see Job Timeouts (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/job_timeouts.html)
// in the Amazon Elastic Container Service Developer Guide.
Timeout *JobTimeout `locationName:"timeout" type:"structure"`
}
// String returns the string representation
@ -4383,6 +4463,12 @@ func (s *SubmitJobInput) SetRetryStrategy(v *RetryStrategy) *SubmitJobInput {
return s
}
// SetTimeout sets the Timeout field's value.
func (s *SubmitJobInput) SetTimeout(v *JobTimeout) *SubmitJobInput {
s.Timeout = v
return s
}
type SubmitJobOutput struct {
_ struct{} `type:"structure"`

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "batch" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "batch" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "Batch" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the Batch client with a session.
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

3254
vendor/github.com/aws/aws-sdk-go/service/budgets/api.go generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,61 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package budgets provides the client and types for making API
// requests to AWS Budgets.
//
// Budgets enable you to plan your service usage, service costs, and your RI
// utilization. You can also track how close your plan is to your budgeted amount
// or to the free tier limits. Budgets provide you with a quick way to see your
// usage-to-date and current estimated charges from AWS and to see how much
// your predicted usage accrues in charges by the end of the month. Budgets
// also compare current estimates and charges to the amount that you indicated
// you want to use or spend and lets you see how much of your budget has been
// used. AWS updates your budget status several times a day. Budgets track your
// unblended costs, subscriptions, and refunds. You can create the following
// types of budgets:
//
// * Cost budgets allow you to say how much you want to spend on a service.
//
// * Usage budgets allow you to say how many hours you want to use for one
// or more services.
//
// * RI utilization budgets allow you to define a utilization threshold and
// receive alerts when RIs are tracking below that threshold.
//
// You can create up to 20,000 budgets per AWS master account. Your first two
// budgets are free of charge. Each additional budget costs $0.02 per day. You
// can set up optional notifications that warn you if you exceed, or are forecasted
// to exceed, your budgeted amount. You can have notifications sent to an Amazon
// SNS topic, to an email address, or to both. For more information, see Creating
// an Amazon SNS Topic for Budget Notifications (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/budgets-sns-policy.html).
// AWS Free Tier usage alerts via AWS Budgets are provided for you, and do not
// count toward your budget limits.
//
// Service Endpoint
//
// The AWS Budgets API provides the following endpoint:
//
// * https://budgets.amazonaws.com
//
// For information about costs associated with the AWS Budgets API, see AWS
// Cost Management Pricing (https://aws.amazon.com/aws-cost-management/pricing/).
//
// See budgets package documentation for more information.
// https://docs.aws.amazon.com/sdk-for-go/api/service/budgets/
//
// Using the Client
//
// To contact AWS Budgets with the SDK use the New function to create
// a new service client. With that client you can make API requests to the service.
// These clients are safe to use concurrently.
//
// See the SDK's documentation for more information on how to use the SDK.
// https://docs.aws.amazon.com/sdk-for-go/api/
//
// See aws.Config documentation for more information on configuring SDK clients.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
//
// See the AWS Budgets client Budgets for more
// information on creating client for this service.
// https://docs.aws.amazon.com/sdk-for-go/api/service/budgets/#New
package budgets

View File

@ -0,0 +1,50 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package budgets
const (
// ErrCodeCreationLimitExceededException for service response error code
// "CreationLimitExceededException".
//
// You've exceeded the notification or subscriber limit.
ErrCodeCreationLimitExceededException = "CreationLimitExceededException"
// ErrCodeDuplicateRecordException for service response error code
// "DuplicateRecordException".
//
// The budget name already exists. Budget names must be unique within an account.
ErrCodeDuplicateRecordException = "DuplicateRecordException"
// ErrCodeExpiredNextTokenException for service response error code
// "ExpiredNextTokenException".
//
// The pagination token expired.
ErrCodeExpiredNextTokenException = "ExpiredNextTokenException"
// ErrCodeInternalErrorException for service response error code
// "InternalErrorException".
//
// An error on the server occurred during the processing of your request. Try
// again later.
ErrCodeInternalErrorException = "InternalErrorException"
// ErrCodeInvalidNextTokenException for service response error code
// "InvalidNextTokenException".
//
// The pagination token is invalid.
ErrCodeInvalidNextTokenException = "InvalidNextTokenException"
// ErrCodeInvalidParameterException for service response error code
// "InvalidParameterException".
//
// An error on the client occurred. Typically, the cause is an invalid input
// value.
ErrCodeInvalidParameterException = "InvalidParameterException"
// ErrCodeNotFoundException for service response error code
// "NotFoundException".
//
// We cant locate the resource that you specified.
ErrCodeNotFoundException = "NotFoundException"
)

View File

@ -0,0 +1,97 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package budgets
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/jsonrpc"
)
// Budgets provides the API operation methods for making requests to
// AWS Budgets. See this package's package overview docs
// for details on the service.
//
// Budgets methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type Budgets 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)
// Service information constants
const (
ServiceName = "budgets" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "Budgets" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the Budgets 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 Budgets client from just a session.
// svc := budgets.New(mySession)
//
// // Create a Budgets client with additional configuration
// svc := budgets.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func New(p client.ConfigProvider, cfgs ...*aws.Config) *Budgets {
c := p.ClientConfig(EndpointsID, cfgs...)
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
}
// newClient creates, initializes and returns a new service client instance.
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Budgets {
svc := &Budgets{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2016-10-20",
JSONVersion: "1.1",
TargetPrefix: "AWSBudgetServiceGateway",
},
handlers,
),
}
// Handlers
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
// Run custom client initialization if present
if initClient != nil {
initClient(svc.Client)
}
return svc
}
// newRequest creates a new request for a Budgets operation and runs any
// custom request initialization.
func (c *Budgets) 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
}

View File

@ -1791,7 +1791,7 @@ type EnvironmentMember struct {
// The time, expressed in epoch time format, when the environment member last
// opened the environment.
LastAccess *time.Time `locationName:"lastAccess" type:"timestamp" timestampFormat:"unix"`
LastAccess *time.Time `locationName:"lastAccess" type:"timestamp"`
// The type of environment member permissions associated with this environment
// member. Available values include:

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "cloud9" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "cloud9" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "Cloud9" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the Cloud9 client with a session.
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

View File

@ -3618,7 +3618,8 @@ func (c *CloudFormation) UpdateStackSetRequest(input *UpdateStackSetInput) (req
// UpdateStackSet API operation for AWS CloudFormation.
//
// Updates the stack set and all associated stack instances.
// Updates the stack set, and associated stack instances in the specified accounts
// and regions.
//
// Even if the stack set operation created by updating the stack set fails (completely
// or partially, below or above a specified failure tolerance), the stack set
@ -3650,6 +3651,9 @@ func (c *CloudFormation) UpdateStackSetRequest(input *UpdateStackSetInput) (req
// * ErrCodeInvalidOperationException "InvalidOperationException"
// The specified operation isn't valid.
//
// * ErrCodeStackInstanceNotFoundException "StackInstanceNotFoundException"
// The specified stack instance doesn't exist.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackSet
func (c *CloudFormation) UpdateStackSet(input *UpdateStackSetInput) (*UpdateStackSetOutput, error) {
req, out := c.UpdateStackSetRequest(input)
@ -4052,7 +4056,7 @@ type ChangeSetSummary struct {
ChangeSetName *string `min:"1" type:"string"`
// The start time when the change set was created, in UTC.
CreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
CreationTime *time.Time `type:"timestamp"`
// Descriptive information about the change set.
Description *string `min:"1" type:"string"`
@ -5130,8 +5134,8 @@ type CreateStackSetInput struct {
//
// Specify an IAM role only if you are using customized administrator roles
// to control which users or groups can manage specific stack sets within the
// same administrator account. For more information, see Define Permissions
// for Multiple Administrators (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html)
// same administrator account. For more information, see Prerequisites: Granting
// Permissions for Stack Set Operations (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html)
// in the AWS CloudFormation User Guide.
AdministrationRoleARN *string `min:"20" type:"string"`
@ -5184,6 +5188,14 @@ type CreateStackSetInput struct {
// stack set's purpose or other important information.
Description *string `min:"1" type:"string"`
// The name of the IAM execution role to use to create the stack set. If you
// do not specify an execution role, AWS CloudFormation uses the AWSCloudFormationStackSetExecutionRole
// role for the stack set operation.
//
// Specify an IAM role only if you are using customized execution roles to control
// which stack resources users and groups can include in their stack sets.
ExecutionRoleName *string `min:"1" type:"string"`
// The input parameters for the stack set template.
Parameters []*Parameter `type:"list"`
@ -5248,6 +5260,9 @@ func (s *CreateStackSetInput) Validate() error {
if s.Description != nil && len(*s.Description) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Description", 1))
}
if s.ExecutionRoleName != nil && len(*s.ExecutionRoleName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ExecutionRoleName", 1))
}
if s.StackSetName == nil {
invalidParams.Add(request.NewErrParamRequired("StackSetName"))
}
@ -5298,6 +5313,12 @@ func (s *CreateStackSetInput) SetDescription(v string) *CreateStackSetInput {
return s
}
// SetExecutionRoleName sets the ExecutionRoleName field's value.
func (s *CreateStackSetInput) SetExecutionRoleName(v string) *CreateStackSetInput {
s.ExecutionRoleName = &v
return s
}
// SetParameters sets the Parameters field's value.
func (s *CreateStackSetInput) SetParameters(v []*Parameter) *CreateStackSetInput {
s.Parameters = v
@ -5890,7 +5911,7 @@ type DescribeChangeSetOutput struct {
Changes []*Change `type:"list"`
// The start time when the change set was created, in UTC.
CreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
CreationTime *time.Time `type:"timestamp"`
// Information about the change set.
Description *string `min:"1" type:"string"`
@ -8901,10 +8922,10 @@ type Stack struct {
// The time at which the stack was created.
//
// CreationTime is a required field
CreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
CreationTime *time.Time `type:"timestamp" required:"true"`
// The time the stack was deleted.
DeletionTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
DeletionTime *time.Time `type:"timestamp"`
// A user-defined description associated with the stack.
Description *string `min:"1" type:"string"`
@ -8927,7 +8948,7 @@ type Stack struct {
// The time the stack was last updated. This field will only be returned if
// the stack has been updated at least once.
LastUpdatedTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
LastUpdatedTime *time.Time `type:"timestamp"`
// SNS topic ARNs to which stack related events are published.
NotificationARNs []*string `type:"list"`
@ -9178,7 +9199,7 @@ type StackEvent struct {
// Time the status was updated.
//
// Timestamp is a required field
Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
Timestamp *time.Time `type:"timestamp" required:"true"`
}
// String returns the string representation
@ -9488,7 +9509,7 @@ type StackResource struct {
// Time the status was updated.
//
// Timestamp is a required field
Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
Timestamp *time.Time `type:"timestamp" required:"true"`
}
// String returns the string representation
@ -9565,7 +9586,7 @@ type StackResourceDetail struct {
// Time the status was updated.
//
// LastUpdatedTimestamp is a required field
LastUpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
LastUpdatedTimestamp *time.Time `type:"timestamp" required:"true"`
// The logical name of the resource specified in the template.
//
@ -9680,7 +9701,7 @@ type StackResourceSummary struct {
// Time the status was updated.
//
// LastUpdatedTimestamp is a required field
LastUpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
LastUpdatedTimestamp *time.Time `type:"timestamp" required:"true"`
// The logical name of the resource specified in the template.
//
@ -9765,7 +9786,7 @@ type StackSet struct {
//
// Use customized administrator roles to control which users or groups can manage
// specific stack sets within the same administrator account. For more information,
// see Define Permissions for Multiple Administrators (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html)
// see Prerequisites: Granting Permissions for Stack Set Operations (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html)
// in the AWS CloudFormation User Guide.
AdministrationRoleARN *string `min:"20" type:"string"`
@ -9780,6 +9801,12 @@ type StackSet struct {
// or updated.
Description *string `min:"1" type:"string"`
// The name of the IAM execution role used to create or update the stack set.
//
// Use customized execution roles to control which stack resources users and
// groups can include in their stack sets.
ExecutionRoleName *string `min:"1" type:"string"`
// A list of input parameters for a stack set.
Parameters []*Parameter `type:"list"`
@ -9832,6 +9859,12 @@ func (s *StackSet) SetDescription(v string) *StackSet {
return s
}
// SetExecutionRoleName sets the ExecutionRoleName field's value.
func (s *StackSet) SetExecutionRoleName(v string) *StackSet {
s.ExecutionRoleName = &v
return s
}
// SetParameters sets the Parameters field's value.
func (s *StackSet) SetParameters(v []*Parameter) *StackSet {
s.Parameters = v
@ -9898,12 +9931,18 @@ type StackSetOperation struct {
// stacks themselves. This is because AWS CloudFormation needs to perform preparatory
// work for the operation, such as dispatching the work to the requested regions,
// before actually creating the first stacks.
CreationTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
CreationTimestamp *time.Time `type:"timestamp"`
// The time at which the stack set operation ended, across all accounts and
// regions specified. Note that this doesn't necessarily mean that the stack
// set operation was successful, or even attempted, in each account or region.
EndTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
EndTimestamp *time.Time `type:"timestamp"`
// The name of the IAM execution role used to create or update the stack set.
//
// Use customized execution roles to control which stack resources users and
// groups can include in their stack sets.
ExecutionRoleName *string `min:"1" type:"string"`
// The unique ID of a stack set operation.
OperationId *string `min:"1" type:"string"`
@ -9976,6 +10015,12 @@ func (s *StackSetOperation) SetEndTimestamp(v time.Time) *StackSetOperation {
return s
}
// SetExecutionRoleName sets the ExecutionRoleName field's value.
func (s *StackSetOperation) SetExecutionRoleName(v string) *StackSetOperation {
s.ExecutionRoleName = &v
return s
}
// SetOperationId sets the OperationId field's value.
func (s *StackSetOperation) SetOperationId(v string) *StackSetOperation {
s.OperationId = &v
@ -10220,12 +10265,12 @@ type StackSetOperationSummary struct {
// stacks themselves. This is because AWS CloudFormation needs to perform preparatory
// work for the operation, such as dispatching the work to the requested regions,
// before actually creating the first stacks.
CreationTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
CreationTimestamp *time.Time `type:"timestamp"`
// The time at which the stack set operation ended, across all accounts and
// regions specified. Note that this doesn't necessarily mean that the stack
// set operation was successful, or even attempted, in each account or region.
EndTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
EndTimestamp *time.Time `type:"timestamp"`
// The unique ID of the stack set operation.
OperationId *string `min:"1" type:"string"`
@ -10352,14 +10397,14 @@ type StackSummary struct {
// The time the stack was created.
//
// CreationTime is a required field
CreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
CreationTime *time.Time `type:"timestamp" required:"true"`
// The time the stack was deleted.
DeletionTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
DeletionTime *time.Time `type:"timestamp"`
// The time the stack was last updated. This field will only be returned if
// the stack has been updated at least once.
LastUpdatedTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
LastUpdatedTime *time.Time `type:"timestamp"`
// For nested stacks--stacks created as resources for another stack--the stack
// ID of the direct parent of this stack. For the first level of nested stacks,
@ -11168,6 +11213,23 @@ func (s *UpdateStackOutput) SetStackId(v string) *UpdateStackOutput {
type UpdateStackSetInput struct {
_ struct{} `type:"structure"`
// The accounts in which to update associated stack instances. If you specify
// accounts, you must also specify the regions in which to update stack set
// instances.
//
// To update all the stack instances associated with this stack set, do not
// specify the Accounts or Regions properties.
//
// If the stack set update includes changes to the template (that is, if the
// TemplateBody or TemplateURL properties are specified), or the Parameters
// property, AWS CloudFormation marks all stack instances with a status of OUTDATED
// prior to updating the stack instances in the specified accounts and regions.
// If the stack set update does not include changes to the template or parameters,
// AWS CloudFormation updates the stack instances in the specified accounts
// and regions, while leaving all other stack instances with their existing
// stack instance status.
Accounts []*string `type:"list"`
// The Amazon Resource Number (ARN) of the IAM role to use to update this stack
// set.
//
@ -11223,6 +11285,20 @@ type UpdateStackSetInput struct {
// A brief description of updates that you are making.
Description *string `min:"1" type:"string"`
// The name of the IAM execution role to use to update the stack set. If you
// do not specify an execution role, AWS CloudFormation uses the AWSCloudFormationStackSetExecutionRole
// role for the stack set operation.
//
// Specify an IAM role only if you are using customized execution roles to control
// which stack resources users and groups can include in their stack sets.
//
// If you specify a customized execution role, AWS CloudFormation uses that
// role to update the stack. If you do not specify a customized execution role,
// AWS CloudFormation performs the update using the role previously associated
// with the stack set, so long as you have permissions to perform operations
// on the stack set.
ExecutionRoleName *string `min:"1" type:"string"`
// The unique ID for this stack set operation.
//
// The operation ID also functions as an idempotency token, to ensure that AWS
@ -11242,6 +11318,22 @@ type UpdateStackSetInput struct {
// A list of input parameters for the stack set template.
Parameters []*Parameter `type:"list"`
// The regions in which to update associated stack instances. If you specify
// regions, you must also specify accounts in which to update stack set instances.
//
// To update all the stack instances associated with this stack set, do not
// specify the Accounts or Regions properties.
//
// If the stack set update includes changes to the template (that is, if the
// TemplateBody or TemplateURL properties are specified), or the Parameters
// property, AWS CloudFormation marks all stack instances with a status of OUTDATED
// prior to updating the stack instances in the specified accounts and regions.
// If the stack set update does not include changes to the template or parameters,
// AWS CloudFormation updates the stack instances in the specified accounts
// and regions, while leaving all other stack instances with their existing
// stack instance status.
Regions []*string `type:"list"`
// The name or unique ID of the stack set that you want to update.
//
// StackSetName is a required field
@ -11321,6 +11413,9 @@ func (s *UpdateStackSetInput) Validate() error {
if s.Description != nil && len(*s.Description) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Description", 1))
}
if s.ExecutionRoleName != nil && len(*s.ExecutionRoleName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ExecutionRoleName", 1))
}
if s.OperationId != nil && len(*s.OperationId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("OperationId", 1))
}
@ -11355,6 +11450,12 @@ func (s *UpdateStackSetInput) Validate() error {
return nil
}
// SetAccounts sets the Accounts field's value.
func (s *UpdateStackSetInput) SetAccounts(v []*string) *UpdateStackSetInput {
s.Accounts = v
return s
}
// SetAdministrationRoleARN sets the AdministrationRoleARN field's value.
func (s *UpdateStackSetInput) SetAdministrationRoleARN(v string) *UpdateStackSetInput {
s.AdministrationRoleARN = &v
@ -11373,6 +11474,12 @@ func (s *UpdateStackSetInput) SetDescription(v string) *UpdateStackSetInput {
return s
}
// SetExecutionRoleName sets the ExecutionRoleName field's value.
func (s *UpdateStackSetInput) SetExecutionRoleName(v string) *UpdateStackSetInput {
s.ExecutionRoleName = &v
return s
}
// SetOperationId sets the OperationId field's value.
func (s *UpdateStackSetInput) SetOperationId(v string) *UpdateStackSetInput {
s.OperationId = &v
@ -11391,6 +11498,12 @@ func (s *UpdateStackSetInput) SetParameters(v []*Parameter) *UpdateStackSetInput
return s
}
// SetRegions sets the Regions field's value.
func (s *UpdateStackSetInput) SetRegions(v []*string) *UpdateStackSetInput {
s.Regions = v
return s
}
// SetStackSetName sets the StackSetName field's value.
func (s *UpdateStackSetInput) SetStackSetName(v string) *UpdateStackSetInput {
s.StackSetName = &v

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "cloudformation" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "cloudformation" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "CloudFormation" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the CloudFormation client with a session.
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

View File

@ -72,7 +72,7 @@ func (c *CloudFront) CreateCloudFrontOriginAccessIdentityRequest(input *CreateCl
// API operation CreateCloudFrontOriginAccessIdentity for usage and error information.
//
// Returned Error Codes:
// * ErrCodeOriginAccessIdentityAlreadyExists "OriginAccessIdentityAlreadyExists"
// * ErrCodeOriginAccessIdentityAlreadyExists "CloudFrontOriginAccessIdentityAlreadyExists"
// If the CallerReference is a value you already sent in a previous request
// to create an identity but the content of the CloudFrontOriginAccessIdentityConfig
// is different from the original request, CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists
@ -1239,7 +1239,7 @@ func (c *CloudFront) DeleteCloudFrontOriginAccessIdentityRequest(input *DeleteCl
// The precondition given in one or more of the request-header fields evaluated
// to false.
//
// * ErrCodeOriginAccessIdentityInUse "OriginAccessIdentityInUse"
// * ErrCodeOriginAccessIdentityInUse "CloudFrontOriginAccessIdentityInUse"
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-10-30/DeleteCloudFrontOriginAccessIdentity
func (c *CloudFront) DeleteCloudFrontOriginAccessIdentity(input *DeleteCloudFrontOriginAccessIdentityInput) (*DeleteCloudFrontOriginAccessIdentityOutput, error) {
@ -1638,92 +1638,6 @@ func (c *CloudFront) DeletePublicKeyWithContext(ctx aws.Context, input *DeletePu
return out, req.Send()
}
const opDeleteServiceLinkedRole = "DeleteServiceLinkedRole2017_10_30"
// DeleteServiceLinkedRoleRequest generates a "aws/request.Request" representing the
// client's request for the DeleteServiceLinkedRole operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeleteServiceLinkedRole for more information on using the DeleteServiceLinkedRole
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DeleteServiceLinkedRoleRequest method.
// req, resp := client.DeleteServiceLinkedRoleRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-10-30/DeleteServiceLinkedRole
func (c *CloudFront) DeleteServiceLinkedRoleRequest(input *DeleteServiceLinkedRoleInput) (req *request.Request, output *DeleteServiceLinkedRoleOutput) {
op := &request.Operation{
Name: opDeleteServiceLinkedRole,
HTTPMethod: "DELETE",
HTTPPath: "/2017-10-30/service-linked-role/{RoleName}",
}
if input == nil {
input = &DeleteServiceLinkedRoleInput{}
}
output = &DeleteServiceLinkedRoleOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// DeleteServiceLinkedRole API operation for Amazon CloudFront.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudFront's
// API operation DeleteServiceLinkedRole for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidArgument "InvalidArgument"
// The argument is invalid.
//
// * ErrCodeAccessDenied "AccessDenied"
// Access denied.
//
// * ErrCodeResourceInUse "ResourceInUse"
//
// * ErrCodeNoSuchResource "NoSuchResource"
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-10-30/DeleteServiceLinkedRole
func (c *CloudFront) DeleteServiceLinkedRole(input *DeleteServiceLinkedRoleInput) (*DeleteServiceLinkedRoleOutput, error) {
req, out := c.DeleteServiceLinkedRoleRequest(input)
return out, req.Send()
}
// DeleteServiceLinkedRoleWithContext is the same as DeleteServiceLinkedRole with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteServiceLinkedRole for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudFront) DeleteServiceLinkedRoleWithContext(ctx aws.Context, input *DeleteServiceLinkedRoleInput, opts ...request.Option) (*DeleteServiceLinkedRoleOutput, error) {
req, out := c.DeleteServiceLinkedRoleRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteStreamingDistribution = "DeleteStreamingDistribution2017_10_30"
// DeleteStreamingDistributionRequest generates a "aws/request.Request" representing the
@ -7551,56 +7465,6 @@ func (s DeletePublicKeyOutput) GoString() string {
return s.String()
}
type DeleteServiceLinkedRoleInput struct {
_ struct{} `type:"structure"`
// RoleName is a required field
RoleName *string `location:"uri" locationName:"RoleName" type:"string" required:"true"`
}
// String returns the string representation
func (s DeleteServiceLinkedRoleInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DeleteServiceLinkedRoleInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteServiceLinkedRoleInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteServiceLinkedRoleInput"}
if s.RoleName == nil {
invalidParams.Add(request.NewErrParamRequired("RoleName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetRoleName sets the RoleName field's value.
func (s *DeleteServiceLinkedRoleInput) SetRoleName(v string) *DeleteServiceLinkedRoleInput {
s.RoleName = &v
return s
}
type DeleteServiceLinkedRoleOutput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s DeleteServiceLinkedRoleOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DeleteServiceLinkedRoleOutput) GoString() string {
return s.String()
}
// The request to delete a streaming distribution.
type DeleteStreamingDistributionInput struct {
_ struct{} `type:"structure"`
@ -7710,7 +7574,7 @@ type Distribution struct {
// The date and time the distribution was last modified.
//
// LastModifiedTime is a required field
LastModifiedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
LastModifiedTime *time.Time `type:"timestamp" required:"true"`
// This response element indicates the current status of the distribution. When
// the status is Deployed, the distribution's information is fully propagated
@ -8432,7 +8296,7 @@ type DistributionSummary struct {
// The date and time the distribution was last modified.
//
// LastModifiedTime is a required field
LastModifiedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
LastModifiedTime *time.Time `type:"timestamp" required:"true"`
// A complex type that contains information about origins for this distribution.
//
@ -8830,7 +8694,7 @@ type FieldLevelEncryption struct {
// The last time the field-level encryption configuration was changed.
//
// LastModifiedTime is a required field
LastModifiedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
LastModifiedTime *time.Time `type:"timestamp" required:"true"`
}
// String returns the string representation
@ -9018,7 +8882,7 @@ type FieldLevelEncryptionProfile struct {
// The last time the field-level encryption profile was updated.
//
// LastModifiedTime is a required field
LastModifiedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
LastModifiedTime *time.Time `type:"timestamp" required:"true"`
}
// String returns the string representation
@ -9212,7 +9076,7 @@ type FieldLevelEncryptionProfileSummary struct {
// The time when the the field-level encryption profile summary was last updated.
//
// LastModifiedTime is a required field
LastModifiedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
LastModifiedTime *time.Time `type:"timestamp" required:"true"`
// Name for the field-level encryption profile summary.
//
@ -9278,7 +9142,7 @@ type FieldLevelEncryptionSummary struct {
// The last time that the summary of field-level encryption items was modified.
//
// LastModifiedTime is a required field
LastModifiedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
LastModifiedTime *time.Time `type:"timestamp" required:"true"`
// A summary of a query argument-profile mapping.
QueryArgProfileConfig *QueryArgProfileConfig `type:"structure"`
@ -10603,7 +10467,7 @@ type Invalidation struct {
// The date and time the invalidation request was first made.
//
// CreateTime is a required field
CreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
CreateTime *time.Time `type:"timestamp" required:"true"`
// The identifier for the invalidation request. For example: IDFDVBD632BHDS5.
//
@ -10822,7 +10686,7 @@ type InvalidationSummary struct {
_ struct{} `type:"structure"`
// CreateTime is a required field
CreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
CreateTime *time.Time `type:"timestamp" required:"true"`
// The unique ID for an invalidation request.
//
@ -12404,7 +12268,7 @@ type PublicKey struct {
// A time you added a public key to CloudFront.
//
// CreatedTime is a required field
CreatedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
CreatedTime *time.Time `type:"timestamp" required:"true"`
// A unique ID assigned to a public key you've added to CloudFront.
//
@ -12595,7 +12459,7 @@ type PublicKeySummary struct {
// Creation time for public key information summary.
//
// CreatedTime is a required field
CreatedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
CreatedTime *time.Time `type:"timestamp" required:"true"`
// Encoded key for public key information summary.
//
@ -13121,7 +12985,7 @@ type StreamingDistribution struct {
Id *string `type:"string" required:"true"`
// The date and time that the distribution was last modified.
LastModifiedTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
LastModifiedTime *time.Time `type:"timestamp"`
// The current status of the RTMP distribution. When the status is Deployed,
// the distribution's information is propagated to all CloudFront edge locations.
@ -13536,7 +13400,7 @@ type StreamingDistributionSummary struct {
// The date and time the distribution was last modified.
//
// LastModifiedTime is a required field
LastModifiedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
LastModifiedTime *time.Time `type:"timestamp" required:"true"`
// PriceClass is a required field
PriceClass *string `type:"string" required:"true" enum:"PriceClass"`

View File

@ -264,17 +264,17 @@ const (
ErrCodeNoSuchStreamingDistribution = "NoSuchStreamingDistribution"
// ErrCodeOriginAccessIdentityAlreadyExists for service response error code
// "OriginAccessIdentityAlreadyExists".
// "CloudFrontOriginAccessIdentityAlreadyExists".
//
// If the CallerReference is a value you already sent in a previous request
// to create an identity but the content of the CloudFrontOriginAccessIdentityConfig
// is different from the original request, CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists
// error.
ErrCodeOriginAccessIdentityAlreadyExists = "OriginAccessIdentityAlreadyExists"
ErrCodeOriginAccessIdentityAlreadyExists = "CloudFrontOriginAccessIdentityAlreadyExists"
// ErrCodeOriginAccessIdentityInUse for service response error code
// "OriginAccessIdentityInUse".
ErrCodeOriginAccessIdentityInUse = "OriginAccessIdentityInUse"
// "CloudFrontOriginAccessIdentityInUse".
ErrCodeOriginAccessIdentityInUse = "CloudFrontOriginAccessIdentityInUse"
// ErrCodePreconditionFailed for service response error code
// "PreconditionFailed".
@ -301,10 +301,6 @@ const (
// No profile specified for the field-level encryption query argument.
ErrCodeQueryArgProfileEmpty = "QueryArgProfileEmpty"
// ErrCodeResourceInUse for service response error code
// "ResourceInUse".
ErrCodeResourceInUse = "ResourceInUse"
// ErrCodeStreamingDistributionAlreadyExists for service response error code
// "StreamingDistributionAlreadyExists".
ErrCodeStreamingDistributionAlreadyExists = "StreamingDistributionAlreadyExists"

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "cloudfront" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "cloudfront" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "CloudFront" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the CloudFront client with a session.
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

View File

@ -73,7 +73,7 @@ func (c *CloudTrail) AddTagsRequest(input *AddTagsInput) (req *request.Request,
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// This exception is thrown when the specified resource is not found.
//
// * ErrCodeARNInvalidException "ARNInvalidException"
// * ErrCodeARNInvalidException "CloudTrailARNInvalidException"
// This exception is thrown when an operation is called with an invalid trail
// ARN. The format of a trail ARN is:
//
@ -842,7 +842,7 @@ func (c *CloudTrail) ListTagsRequest(input *ListTagsInput) (req *request.Request
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// This exception is thrown when the specified resource is not found.
//
// * ErrCodeARNInvalidException "ARNInvalidException"
// * ErrCodeARNInvalidException "CloudTrailARNInvalidException"
// This exception is thrown when an operation is called with an invalid trail
// ARN. The format of a trail ARN is:
//
@ -1271,7 +1271,7 @@ func (c *CloudTrail) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Req
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// This exception is thrown when the specified resource is not found.
//
// * ErrCodeARNInvalidException "ARNInvalidException"
// * ErrCodeARNInvalidException "CloudTrailARNInvalidException"
// This exception is thrown when an operation is called with an invalid trail
// ARN. The format of a trail ARN is:
//
@ -2296,7 +2296,7 @@ type Event struct {
EventSource *string `type:"string"`
// The date and time of the event returned.
EventTime *time.Time `type:"timestamp" timestampFormat:"unix"`
EventTime *time.Time `type:"timestamp"`
// A list of resources referenced by the event returned.
Resources []*Resource `type:"list"`
@ -2564,7 +2564,7 @@ type GetTrailStatusOutput struct {
// Displays the most recent date and time when CloudTrail delivered logs to
// CloudWatch Logs.
LatestCloudWatchLogsDeliveryTime *time.Time `type:"timestamp" timestampFormat:"unix"`
LatestCloudWatchLogsDeliveryTime *time.Time `type:"timestamp"`
// This field is deprecated.
LatestDeliveryAttemptSucceeded *string `type:"string"`
@ -2585,7 +2585,7 @@ type GetTrailStatusOutput struct {
// Specifies the date and time that CloudTrail last delivered log files to an
// account's Amazon S3 bucket.
LatestDeliveryTime *time.Time `type:"timestamp" timestampFormat:"unix"`
LatestDeliveryTime *time.Time `type:"timestamp"`
// Displays any Amazon S3 error that CloudTrail encountered when attempting
// to deliver a digest file to the designated bucket. For more information see
@ -2600,7 +2600,7 @@ type GetTrailStatusOutput struct {
// Specifies the date and time that CloudTrail last delivered a digest file
// to an account's Amazon S3 bucket.
LatestDigestDeliveryTime *time.Time `type:"timestamp" timestampFormat:"unix"`
LatestDigestDeliveryTime *time.Time `type:"timestamp"`
// This field is deprecated.
LatestNotificationAttemptSucceeded *string `type:"string"`
@ -2615,15 +2615,15 @@ type GetTrailStatusOutput struct {
// Specifies the date and time of the most recent Amazon SNS notification that
// CloudTrail has written a new log file to an account's Amazon S3 bucket.
LatestNotificationTime *time.Time `type:"timestamp" timestampFormat:"unix"`
LatestNotificationTime *time.Time `type:"timestamp"`
// Specifies the most recent date and time when CloudTrail started recording
// API calls for an AWS account.
StartLoggingTime *time.Time `type:"timestamp" timestampFormat:"unix"`
StartLoggingTime *time.Time `type:"timestamp"`
// Specifies the most recent date and time when CloudTrail stopped recording
// API calls for an AWS account.
StopLoggingTime *time.Time `type:"timestamp" timestampFormat:"unix"`
StopLoggingTime *time.Time `type:"timestamp"`
// This field is deprecated.
TimeLoggingStarted *string `type:"string"`
@ -2750,7 +2750,7 @@ type ListPublicKeysInput struct {
// Optionally specifies, in UTC, the end of the time range to look up public
// keys for CloudTrail digest files. If not specified, the current time is used.
EndTime *time.Time `type:"timestamp" timestampFormat:"unix"`
EndTime *time.Time `type:"timestamp"`
// Reserved for future use.
NextToken *string `type:"string"`
@ -2758,7 +2758,7 @@ type ListPublicKeysInput struct {
// Optionally specifies, in UTC, the start of the time range to look up public
// keys for CloudTrail digest files. If not specified, the current time is used,
// and the current public key is returned.
StartTime *time.Time `type:"timestamp" timestampFormat:"unix"`
StartTime *time.Time `type:"timestamp"`
}
// String returns the string representation
@ -2970,7 +2970,7 @@ type LookupEventsInput struct {
// Specifies that only events that occur before or at the specified time are
// returned. If the specified end time is before the specified start time, an
// error is returned.
EndTime *time.Time `type:"timestamp" timestampFormat:"unix"`
EndTime *time.Time `type:"timestamp"`
// Contains a list of lookup attributes. Currently the list can contain only
// one item.
@ -2990,7 +2990,7 @@ type LookupEventsInput struct {
// Specifies that only events that occur after or at the specified time are
// returned. If the specified start time is after the specified end time, an
// error is returned.
StartTime *time.Time `type:"timestamp" timestampFormat:"unix"`
StartTime *time.Time `type:"timestamp"`
}
// String returns the string representation
@ -3103,10 +3103,10 @@ type PublicKey struct {
Fingerprint *string `type:"string"`
// The ending time of validity of the public key.
ValidityEndTime *time.Time `type:"timestamp" timestampFormat:"unix"`
ValidityEndTime *time.Time `type:"timestamp"`
// The starting time of validity of the public key.
ValidityStartTime *time.Time `type:"timestamp" timestampFormat:"unix"`
ValidityStartTime *time.Time `type:"timestamp"`
// The DER encoded public key value in PKCS#1 format.
//

View File

@ -5,13 +5,13 @@ package cloudtrail
const (
// ErrCodeARNInvalidException for service response error code
// "ARNInvalidException".
// "CloudTrailARNInvalidException".
//
// This exception is thrown when an operation is called with an invalid trail
// ARN. The format of a trail ARN is:
//
// arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
ErrCodeARNInvalidException = "ARNInvalidException"
ErrCodeARNInvalidException = "CloudTrailARNInvalidException"
// ErrCodeCloudWatchLogsDeliveryUnavailableException for service response error code
// "CloudWatchLogsDeliveryUnavailableException".

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "cloudtrail" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "cloudtrail" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "CloudTrail" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the CloudTrail client with a session.
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

View File

@ -1679,7 +1679,7 @@ type AlarmHistoryItem struct {
HistorySummary *string `min:"1" type:"string"`
// The time stamp for the alarm history item.
Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
Timestamp *time.Time `type:"timestamp"`
}
// String returns the string representation
@ -1735,7 +1735,7 @@ type DashboardEntry struct {
// The time stamp of when the dashboard was last modified, either by an API
// call or through the console. This number is expressed as the number of milliseconds
// since Jan 1, 1970 00:00:00 UTC.
LastModified *time.Time `type:"timestamp" timestampFormat:"iso8601"`
LastModified *time.Time `type:"timestamp"`
// The size of the dashboard, in bytes.
Size *int64 `type:"long"`
@ -1832,7 +1832,7 @@ type Datapoint struct {
Sum *float64 `type:"double"`
// The time stamp used for the data point.
Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
Timestamp *time.Time `type:"timestamp"`
// The standard unit for the data point.
Unit *string `type:"string" enum:"StandardUnit"`
@ -2007,7 +2007,7 @@ type DescribeAlarmHistoryInput struct {
AlarmName *string `min:"1" type:"string"`
// The ending date to retrieve alarm history.
EndDate *time.Time `type:"timestamp" timestampFormat:"iso8601"`
EndDate *time.Time `type:"timestamp"`
// The type of alarm histories to retrieve.
HistoryItemType *string `type:"string" enum:"HistoryItemType"`
@ -2020,7 +2020,7 @@ type DescribeAlarmHistoryInput struct {
NextToken *string `type:"string"`
// The starting date to retrieve alarm history.
StartDate *time.Time `type:"timestamp" timestampFormat:"iso8601"`
StartDate *time.Time `type:"timestamp"`
}
// String returns the string representation
@ -2684,7 +2684,7 @@ type GetMetricDataInput struct {
// The time stamp indicating the latest data to be returned.
//
// EndTime is a required field
EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
EndTime *time.Time `type:"timestamp" required:"true"`
// The maximum number of data points the request should return before paginating.
// If you omit this, the default of 100,800 is used.
@ -2711,7 +2711,7 @@ type GetMetricDataInput struct {
// The time stamp indicating the earliest data to be returned.
//
// StartTime is a required field
StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
StartTime *time.Time `type:"timestamp" required:"true"`
}
// String returns the string representation
@ -2842,7 +2842,7 @@ type GetMetricStatisticsInput struct {
// time stamp. The time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).
//
// EndTime is a required field
EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
EndTime *time.Time `type:"timestamp" required:"true"`
// The percentile statistics. Specify values between p0.0 and p100. When calling
// GetMetricStatistics, you must specify either Statistics or ExtendedStatistics,
@ -2908,7 +2908,7 @@ type GetMetricStatisticsInput struct {
// you receive data timestamped between 15:02:15 and 15:07:15.
//
// StartTime is a required field
StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
StartTime *time.Time `type:"timestamp" required:"true"`
// The metric statistics, other than percentile. For percentile statistics,
// use ExtendedStatistics. When calling GetMetricStatistics, you must specify
@ -3360,7 +3360,7 @@ type MetricAlarm struct {
AlarmArn *string `min:"1" type:"string"`
// The time stamp of the last update to the alarm configuration.
AlarmConfigurationUpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
AlarmConfigurationUpdatedTimestamp *time.Time `type:"timestamp"`
// The description of the alarm.
AlarmDescription *string `type:"string"`
@ -3416,7 +3416,7 @@ type MetricAlarm struct {
StateReasonData *string `type:"string"`
// The time stamp of the last update to the alarm state.
StateUpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
StateUpdatedTimestamp *time.Time `type:"timestamp"`
// The state value for the alarm.
StateValue *string `type:"string" enum:"StateValue"`
@ -3816,7 +3816,7 @@ type MetricDatum struct {
// The time the metric data was received, expressed as the number of milliseconds
// since Jan 1, 1970 00:00:00 UTC.
Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
Timestamp *time.Time `type:"timestamp"`
// The unit of the metric.
Unit *string `type:"string" enum:"StandardUnit"`

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "monitoring" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "monitoring" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "CloudWatch" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the CloudWatch client with a session.
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

View File

@ -2447,7 +2447,7 @@ type PutEventsRequestEntry struct {
// The timestamp of the event, per RFC3339 (https://www.rfc-editor.org/rfc/rfc3339.txt).
// If no timestamp is provided, the timestamp of the PutEvents call is used.
Time *time.Time `type:"timestamp" timestampFormat:"unix"`
Time *time.Time `type:"timestamp"`
}
// String returns the string representation

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "events" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "events" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "CloudWatch Events" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the CloudWatchEvents client with a session.
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

View File

@ -1281,6 +1281,7 @@ func (c *CloudWatchLogs) DescribeDestinationsPages(input *DescribeDestinationsIn
// for more information on using Contexts.
func (c *CloudWatchLogs) DescribeDestinationsPagesWithContext(ctx aws.Context, input *DescribeDestinationsInput, fn func(*DescribeDestinationsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
EndPageOnSameToken: true,
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeDestinationsInput
if input != nil {
@ -1503,6 +1504,7 @@ func (c *CloudWatchLogs) DescribeLogGroupsPages(input *DescribeLogGroupsInput, f
// for more information on using Contexts.
func (c *CloudWatchLogs) DescribeLogGroupsPagesWithContext(ctx aws.Context, input *DescribeLogGroupsInput, fn func(*DescribeLogGroupsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
EndPageOnSameToken: true,
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeLogGroupsInput
if input != nil {
@ -1649,6 +1651,7 @@ func (c *CloudWatchLogs) DescribeLogStreamsPages(input *DescribeLogStreamsInput,
// for more information on using Contexts.
func (c *CloudWatchLogs) DescribeLogStreamsPagesWithContext(ctx aws.Context, input *DescribeLogStreamsInput, fn func(*DescribeLogStreamsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
EndPageOnSameToken: true,
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeLogStreamsInput
if input != nil {
@ -1792,6 +1795,7 @@ func (c *CloudWatchLogs) DescribeMetricFiltersPages(input *DescribeMetricFilters
// for more information on using Contexts.
func (c *CloudWatchLogs) DescribeMetricFiltersPagesWithContext(ctx aws.Context, input *DescribeMetricFiltersInput, fn func(*DescribeMetricFiltersOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
EndPageOnSameToken: true,
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeMetricFiltersInput
if input != nil {
@ -2017,6 +2021,7 @@ func (c *CloudWatchLogs) DescribeSubscriptionFiltersPages(input *DescribeSubscri
// for more information on using Contexts.
func (c *CloudWatchLogs) DescribeSubscriptionFiltersPagesWithContext(ctx aws.Context, input *DescribeSubscriptionFiltersInput, fn func(*DescribeSubscriptionFiltersOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
EndPageOnSameToken: true,
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeSubscriptionFiltersInput
if input != nil {
@ -2264,6 +2269,7 @@ func (c *CloudWatchLogs) FilterLogEventsPages(input *FilterLogEventsInput, fn fu
// for more information on using Contexts.
func (c *CloudWatchLogs) FilterLogEventsPagesWithContext(ctx aws.Context, input *FilterLogEventsInput, fn func(*FilterLogEventsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
EndPageOnSameToken: true,
NewRequest: func() (*request.Request, error) {
var inCpy *FilterLogEventsInput
if input != nil {
@ -2410,6 +2416,7 @@ func (c *CloudWatchLogs) GetLogEventsPages(input *GetLogEventsInput, fn func(*Ge
// for more information on using Contexts.
func (c *CloudWatchLogs) GetLogEventsPagesWithContext(ctx aws.Context, input *GetLogEventsInput, fn func(*GetLogEventsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
EndPageOnSameToken: true,
NewRequest: func() (*request.Request, error) {
var inCpy *GetLogEventsInput
if input != nil {

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "logs" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "logs" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "CloudWatch Logs" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the CloudWatchLogs client with a session.
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

View File

@ -388,7 +388,7 @@ func (c *CodeBuild) CreateWebhookRequest(input *CreateWebhookInput) (req *reques
// AWS CodePipeline. Because billing is on a per-build basis, you will be billed
// for both builds. Therefore, if you are using AWS CodePipeline, we recommend
// that you disable webhooks in CodeBuild. In the AWS CodeBuild console, clear
// the Webhook box. For more information, see step 9 in Change a Build Project's
// the Webhook box. For more information, see step 5 in Change a Build Project's
// Settings (http://docs.aws.amazon.com/codebuild/latest/userguide/change-project.html#change-project-console).
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@ -1586,7 +1586,7 @@ type Build struct {
CurrentPhase *string `locationName:"currentPhase" type:"string"`
// When the build process ended, expressed in Unix time format.
EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"unix"`
EndTime *time.Time `locationName:"endTime" type:"timestamp"`
// Information about the build environment for this build.
Environment *ProjectEnvironment `locationName:"environment" type:"structure"`
@ -1619,6 +1619,9 @@ type Build struct {
// The name of the AWS CodeBuild project.
ProjectName *string `locationName:"projectName" min:"1" type:"string"`
// The name of a service role used for this build.
ServiceRole *string `locationName:"serviceRole" min:"1" type:"string"`
// Information about the source code to be built.
Source *ProjectSource `locationName:"source" type:"structure"`
@ -1626,7 +1629,7 @@ type Build struct {
SourceVersion *string `locationName:"sourceVersion" min:"1" type:"string"`
// When the build process started, expressed in Unix time format.
StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"unix"`
StartTime *time.Time `locationName:"startTime" type:"timestamp"`
// How long, in minutes, for AWS CodeBuild to wait before timing out this build
// if it does not get marked as completed.
@ -1733,6 +1736,12 @@ func (s *Build) SetProjectName(v string) *Build {
return s
}
// SetServiceRole sets the ServiceRole field's value.
func (s *Build) SetServiceRole(v string) *Build {
s.ServiceRole = &v
return s
}
// SetSource sets the Source field's value.
func (s *Build) SetSource(v *ProjectSource) *Build {
s.Source = v
@ -1863,7 +1872,7 @@ type BuildPhase struct {
DurationInSeconds *int64 `locationName:"durationInSeconds" type:"long"`
// When the build phase ended, expressed in Unix time format.
EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"unix"`
EndTime *time.Time `locationName:"endTime" type:"timestamp"`
// The current status of the build phase. Valid values include:
//
@ -1905,7 +1914,7 @@ type BuildPhase struct {
PhaseType *string `locationName:"phaseType" type:"string" enum:"BuildPhaseType"`
// When the build phase started, expressed in Unix time format.
StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"unix"`
StartTime *time.Time `locationName:"startTime" type:"timestamp"`
}
// String returns the string representation
@ -1993,7 +2002,9 @@ type CreateProjectInput struct {
// The ARN of the AWS Identity and Access Management (IAM) role that enables
// AWS CodeBuild to interact with dependent AWS services on behalf of the AWS
// account.
ServiceRole *string `locationName:"serviceRole" min:"1" type:"string"`
//
// ServiceRole is a required field
ServiceRole *string `locationName:"serviceRole" min:"1" type:"string" required:"true"`
// Information about the build input source code for the build project.
//
@ -2043,6 +2054,9 @@ func (s *CreateProjectInput) Validate() error {
if s.Name != nil && len(*s.Name) < 2 {
invalidParams.Add(request.NewErrParamMinLen("Name", 2))
}
if s.ServiceRole == nil {
invalidParams.Add(request.NewErrParamRequired("ServiceRole"))
}
if s.ServiceRole != nil && len(*s.ServiceRole) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ServiceRole", 1))
}
@ -3074,7 +3088,7 @@ type Project struct {
Cache *ProjectCache `locationName:"cache" type:"structure"`
// When the build project was created, expressed in Unix time format.
Created *time.Time `locationName:"created" type:"timestamp" timestampFormat:"unix"`
Created *time.Time `locationName:"created" type:"timestamp"`
// A description that makes the build project easy to identify.
Description *string `locationName:"description" type:"string"`
@ -3091,7 +3105,7 @@ type Project struct {
// When the build project's settings were last modified, expressed in Unix time
// format.
LastModified *time.Time `locationName:"lastModified" type:"timestamp" timestampFormat:"unix"`
LastModified *time.Time `locationName:"lastModified" type:"timestamp"`
// The name of the build project.
Name *string `locationName:"name" min:"2" type:"string"`
@ -3256,10 +3270,21 @@ type ProjectArtifacts struct {
// because no build output will be produced.
//
// * If type is set to S3, this is the name of the output artifact object.
// If you set the name to be a forward slash ("/"), then the artifact is
// stored in the root of the output bucket.
//
// For example, if path is set to MyArtifacts, namespaceType is set to BUILD_ID,
// and name is set to MyArtifact.zip, then the output artifact would be stored
// in MyArtifacts/build-ID/MyArtifact.zip.
// For example:
//
// * If path is set to MyArtifacts, namespaceType is set to BUILD_ID, and
// name is set to MyArtifact.zip, then the output artifact would be stored
// in MyArtifacts/build-ID/MyArtifact.zip.
//
// * If path is empty, namespaceType is set to NONE, and name is set to
// "/", then the output artifact would be stored in the root of the output
// bucket.
//
// * If path is set to MyArtifacts, namespaceType is set to BUILD_ID, and
// name is set to "/", then the output artifact would be stored in MyArtifacts/build-ID.
Name *string `locationName:"name" type:"string"`
// Along with path and name, the pattern that AWS CodeBuild will use to determine
@ -3522,8 +3547,17 @@ type ProjectEnvironment struct {
// build commands. (Do not run the following build commands if the specified
// build environment image is provided by AWS CodeBuild with Docker support.)
//
// If the operating system's base image is Ubuntu Linux:
//
// - nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375
// --storage-driver=overlay& - timeout -t 15 sh -c "until docker info; do echo
// --storage-driver=overlay& - timeout 15 sh -c "until docker info; do echo
// .; sleep 1; done"
//
// If the operating system's base image is Alpine Linux, add the -t argument
// to timeout:
//
// - nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375
// --storage-driver=overlay& - timeout 15 -t sh -c "until docker info; do echo
// .; sleep 1; done"
PrivilegedMode *bool `locationName:"privilegedMode" type:"boolean"`
@ -3677,6 +3711,12 @@ type ProjectSource struct {
// source object, set the auth object's type value to OAUTH.
Location *string `locationName:"location" type:"string"`
// Set to true to report the status of a build's start and finish to your source
// provider. This option is only valid when your source provider is GitHub.
// If this is set and you use a different source provider, an invalidInputException
// is thrown.
ReportBuildStatus *bool `locationName:"reportBuildStatus" type:"boolean"`
// The type of repository that contains the source code to be built. Valid values
// include:
//
@ -3754,6 +3794,12 @@ func (s *ProjectSource) SetLocation(v string) *ProjectSource {
return s
}
// SetReportBuildStatus sets the ReportBuildStatus field's value.
func (s *ProjectSource) SetReportBuildStatus(v bool) *ProjectSource {
s.ReportBuildStatus = &v
return s
}
// SetType sets the Type field's value.
func (s *ProjectSource) SetType(v string) *ProjectSource {
s.Type = &v
@ -3825,6 +3871,22 @@ type StartBuildInput struct {
// one already defined in the build project.
BuildspecOverride *string `locationName:"buildspecOverride" type:"string"`
// A ProjectCache object specified for this build that overrides the one defined
// in the build project.
CacheOverride *ProjectCache `locationName:"cacheOverride" type:"structure"`
// The name of a certificate for this build that overrides the one specified
// in the build project.
CertificateOverride *string `locationName:"certificateOverride" type:"string"`
// The name of a compute type for this build that overrides the one specified
// in the build project.
ComputeTypeOverride *string `locationName:"computeTypeOverride" type:"string" enum:"ComputeType"`
// A container type for this build that overrides the one specified in the build
// project.
EnvironmentTypeOverride *string `locationName:"environmentTypeOverride" type:"string" enum:"EnvironmentType"`
// A set of environment variables that overrides, for this build only, the latest
// ones already defined in the build project.
EnvironmentVariablesOverride []*EnvironmentVariable `locationName:"environmentVariablesOverride" type:"list"`
@ -3833,11 +3895,53 @@ type StartBuildInput struct {
// for this build only, any previous depth of history defined in the build project.
GitCloneDepthOverride *int64 `locationName:"gitCloneDepthOverride" type:"integer"`
// A unique, case sensitive identifier you provide to ensure the idempotency
// of the StartBuild request. The token is included in the StartBuild request
// and is valid for 12 hours. If you repeat the StartBuild request with the
// same token, but change a parameter, AWS CodeBuild returns a parameter mismatch
// error.
IdempotencyToken *string `locationName:"idempotencyToken" type:"string"`
// The name of an image for this build that overrides the one specified in the
// build project.
ImageOverride *string `locationName:"imageOverride" min:"1" type:"string"`
// Enable this flag to override the insecure SSL setting that is specified in
// the build project. The insecure SSL setting determines whether to ignore
// SSL warnings while connecting to the project source code. This override applies
// only if the build's source is GitHub Enterprise.
InsecureSslOverride *bool `locationName:"insecureSslOverride" type:"boolean"`
// Enable this flag to override privileged mode in the build project.
PrivilegedModeOverride *bool `locationName:"privilegedModeOverride" type:"boolean"`
// The name of the AWS CodeBuild build project to start running a build.
//
// ProjectName is a required field
ProjectName *string `locationName:"projectName" min:"1" type:"string" required:"true"`
// Set to true to report to your source provider the status of a build's start
// and completion. If you use this option with a source provider other than
// GitHub, an invalidInputException is thrown.
ReportBuildStatusOverride *bool `locationName:"reportBuildStatusOverride" type:"boolean"`
// The name of a service role for this build that overrides the one specified
// in the build project.
ServiceRoleOverride *string `locationName:"serviceRoleOverride" min:"1" type:"string"`
// An authorization type for this build that overrides the one defined in the
// build project. This override applies only if the build project's source is
// BitBucket or GitHub.
SourceAuthOverride *SourceAuth `locationName:"sourceAuthOverride" type:"structure"`
// A location that overrides for this build the source location for the one
// defined in the build project.
SourceLocationOverride *string `locationName:"sourceLocationOverride" type:"string"`
// A source input type for this build that overrides the source input defined
// in the build project
SourceTypeOverride *string `locationName:"sourceTypeOverride" type:"string" enum:"SourceType"`
// A version of the build input to be built, for this build only. If not specified,
// the latest version will be used. If specified, must be one of:
//
@ -3877,12 +3981,18 @@ func (s StartBuildInput) GoString() string {
// Validate inspects the fields of the type to determine if they are valid.
func (s *StartBuildInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "StartBuildInput"}
if s.ImageOverride != nil && len(*s.ImageOverride) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ImageOverride", 1))
}
if s.ProjectName == nil {
invalidParams.Add(request.NewErrParamRequired("ProjectName"))
}
if s.ProjectName != nil && len(*s.ProjectName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ProjectName", 1))
}
if s.ServiceRoleOverride != nil && len(*s.ServiceRoleOverride) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ServiceRoleOverride", 1))
}
if s.TimeoutInMinutesOverride != nil && *s.TimeoutInMinutesOverride < 5 {
invalidParams.Add(request.NewErrParamMinValue("TimeoutInMinutesOverride", 5))
}
@ -3891,6 +4001,11 @@ func (s *StartBuildInput) Validate() error {
invalidParams.AddNested("ArtifactsOverride", err.(request.ErrInvalidParams))
}
}
if s.CacheOverride != nil {
if err := s.CacheOverride.Validate(); err != nil {
invalidParams.AddNested("CacheOverride", err.(request.ErrInvalidParams))
}
}
if s.EnvironmentVariablesOverride != nil {
for i, v := range s.EnvironmentVariablesOverride {
if v == nil {
@ -3901,6 +4016,11 @@ func (s *StartBuildInput) Validate() error {
}
}
}
if s.SourceAuthOverride != nil {
if err := s.SourceAuthOverride.Validate(); err != nil {
invalidParams.AddNested("SourceAuthOverride", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
@ -3920,6 +4040,30 @@ func (s *StartBuildInput) SetBuildspecOverride(v string) *StartBuildInput {
return s
}
// SetCacheOverride sets the CacheOverride field's value.
func (s *StartBuildInput) SetCacheOverride(v *ProjectCache) *StartBuildInput {
s.CacheOverride = v
return s
}
// SetCertificateOverride sets the CertificateOverride field's value.
func (s *StartBuildInput) SetCertificateOverride(v string) *StartBuildInput {
s.CertificateOverride = &v
return s
}
// SetComputeTypeOverride sets the ComputeTypeOverride field's value.
func (s *StartBuildInput) SetComputeTypeOverride(v string) *StartBuildInput {
s.ComputeTypeOverride = &v
return s
}
// SetEnvironmentTypeOverride sets the EnvironmentTypeOverride field's value.
func (s *StartBuildInput) SetEnvironmentTypeOverride(v string) *StartBuildInput {
s.EnvironmentTypeOverride = &v
return s
}
// SetEnvironmentVariablesOverride sets the EnvironmentVariablesOverride field's value.
func (s *StartBuildInput) SetEnvironmentVariablesOverride(v []*EnvironmentVariable) *StartBuildInput {
s.EnvironmentVariablesOverride = v
@ -3932,12 +4076,66 @@ func (s *StartBuildInput) SetGitCloneDepthOverride(v int64) *StartBuildInput {
return s
}
// SetIdempotencyToken sets the IdempotencyToken field's value.
func (s *StartBuildInput) SetIdempotencyToken(v string) *StartBuildInput {
s.IdempotencyToken = &v
return s
}
// SetImageOverride sets the ImageOverride field's value.
func (s *StartBuildInput) SetImageOverride(v string) *StartBuildInput {
s.ImageOverride = &v
return s
}
// SetInsecureSslOverride sets the InsecureSslOverride field's value.
func (s *StartBuildInput) SetInsecureSslOverride(v bool) *StartBuildInput {
s.InsecureSslOverride = &v
return s
}
// SetPrivilegedModeOverride sets the PrivilegedModeOverride field's value.
func (s *StartBuildInput) SetPrivilegedModeOverride(v bool) *StartBuildInput {
s.PrivilegedModeOverride = &v
return s
}
// SetProjectName sets the ProjectName field's value.
func (s *StartBuildInput) SetProjectName(v string) *StartBuildInput {
s.ProjectName = &v
return s
}
// SetReportBuildStatusOverride sets the ReportBuildStatusOverride field's value.
func (s *StartBuildInput) SetReportBuildStatusOverride(v bool) *StartBuildInput {
s.ReportBuildStatusOverride = &v
return s
}
// SetServiceRoleOverride sets the ServiceRoleOverride field's value.
func (s *StartBuildInput) SetServiceRoleOverride(v string) *StartBuildInput {
s.ServiceRoleOverride = &v
return s
}
// SetSourceAuthOverride sets the SourceAuthOverride field's value.
func (s *StartBuildInput) SetSourceAuthOverride(v *SourceAuth) *StartBuildInput {
s.SourceAuthOverride = v
return s
}
// SetSourceLocationOverride sets the SourceLocationOverride field's value.
func (s *StartBuildInput) SetSourceLocationOverride(v string) *StartBuildInput {
s.SourceLocationOverride = &v
return s
}
// SetSourceTypeOverride sets the SourceTypeOverride field's value.
func (s *StartBuildInput) SetSourceTypeOverride(v string) *StartBuildInput {
s.SourceTypeOverride = &v
return s
}
// SetSourceVersion sets the SourceVersion field's value.
func (s *StartBuildInput) SetSourceVersion(v string) *StartBuildInput {
s.SourceVersion = &v
@ -4465,7 +4663,7 @@ type Webhook struct {
BranchFilter *string `locationName:"branchFilter" type:"string"`
// A timestamp indicating the last time a repository's secret token was modified.
LastModifiedSecret *time.Time `locationName:"lastModifiedSecret" type:"timestamp" timestampFormat:"unix"`
LastModifiedSecret *time.Time `locationName:"lastModifiedSecret" type:"timestamp"`
// The CodeBuild endpoint where webhook events are sent.
PayloadUrl *string `locationName:"payloadUrl" min:"1" type:"string"`
@ -4596,6 +4794,9 @@ const (
)
const (
// EnvironmentTypeWindowsContainer is a EnvironmentType enum value
EnvironmentTypeWindowsContainer = "WINDOWS_CONTAINER"
// EnvironmentTypeLinuxContainer is a EnvironmentType enum value
EnvironmentTypeLinuxContainer = "LINUX_CONTAINER"
)
@ -4646,6 +4847,9 @@ const (
// PlatformTypeUbuntu is a PlatformType enum value
PlatformTypeUbuntu = "UBUNTU"
// PlatformTypeWindowsServer is a PlatformType enum value
PlatformTypeWindowsServer = "WINDOWS_SERVER"
)
const (

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "codebuild" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "codebuild" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "CodeBuild" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the CodeBuild client with a session.
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

View File

@ -4944,7 +4944,7 @@ type Comment struct {
Content *string `locationName:"content" type:"string"`
// The date and time the comment was created, in timestamp format.
CreationDate *time.Time `locationName:"creationDate" type:"timestamp" timestampFormat:"unix"`
CreationDate *time.Time `locationName:"creationDate" type:"timestamp"`
// A Boolean value indicating whether the comment has been deleted.
Deleted *bool `locationName:"deleted" type:"boolean"`
@ -4953,7 +4953,7 @@ type Comment struct {
InReplyTo *string `locationName:"inReplyTo" type:"string"`
// The date and time the comment was most recently modified, in timestamp format.
LastModifiedDate *time.Time `locationName:"lastModifiedDate" type:"timestamp" timestampFormat:"unix"`
LastModifiedDate *time.Time `locationName:"lastModifiedDate" type:"timestamp"`
}
// String returns the string representation
@ -7912,7 +7912,7 @@ type PullRequest struct {
ClientRequestToken *string `locationName:"clientRequestToken" type:"string"`
// The date and time the pull request was originally created, in timestamp format.
CreationDate *time.Time `locationName:"creationDate" type:"timestamp" timestampFormat:"unix"`
CreationDate *time.Time `locationName:"creationDate" type:"timestamp"`
// The user-defined description of the pull request. This description can be
// used to clarify what should be reviewed and other details of the request.
@ -7920,7 +7920,7 @@ type PullRequest struct {
// The day and time of the last user or system activity on the pull request,
// in timestamp format.
LastActivityDate *time.Time `locationName:"lastActivityDate" type:"timestamp" timestampFormat:"unix"`
LastActivityDate *time.Time `locationName:"lastActivityDate" type:"timestamp"`
// The system-generated ID of the pull request.
PullRequestId *string `locationName:"pullRequestId" type:"string"`
@ -8012,7 +8012,7 @@ type PullRequestEvent struct {
ActorArn *string `locationName:"actorArn" type:"string"`
// The day and time of the pull request event, in timestamp format.
EventDate *time.Time `locationName:"eventDate" type:"timestamp" timestampFormat:"unix"`
EventDate *time.Time `locationName:"eventDate" type:"timestamp"`
// The type of the pull request event, for example a status change event (PULL_REQUEST_STATUS_CHANGED)
// or update event (PULL_REQUEST_SOURCE_REFERENCE_UPDATED).
@ -8569,13 +8569,13 @@ type RepositoryMetadata struct {
CloneUrlSsh *string `locationName:"cloneUrlSsh" type:"string"`
// The date and time the repository was created, in timestamp format.
CreationDate *time.Time `locationName:"creationDate" type:"timestamp" timestampFormat:"unix"`
CreationDate *time.Time `locationName:"creationDate" type:"timestamp"`
// The repository's default branch name.
DefaultBranch *string `locationName:"defaultBranch" min:"1" type:"string"`
// The date and time the repository was last modified, in timestamp format.
LastModifiedDate *time.Time `locationName:"lastModifiedDate" type:"timestamp" timestampFormat:"unix"`
LastModifiedDate *time.Time `locationName:"lastModifiedDate" type:"timestamp"`
// A comment or description about the repository.
RepositoryDescription *string `locationName:"repositoryDescription" type:"string"`

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "codecommit" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "codecommit" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "CodeCommit" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the CodeCommit client with a session.
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

View File

@ -986,6 +986,9 @@ func (c *CodeDeploy) CreateDeploymentRequest(input *CreateDeploymentInput) (req
// The IgnoreApplicationStopFailures value is invalid. For AWS Lambda deployments,
// false is expected. For EC2/On-premises deployments, true or false is expected.
//
// * ErrCodeInvalidGitHubAccountTokenException "InvalidGitHubAccountTokenException"
// The GitHub token is not valid.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeployment
func (c *CodeDeploy) CreateDeployment(input *CreateDeploymentInput) (*CreateDeploymentOutput, error) {
req, out := c.CreateDeploymentRequest(input)
@ -4455,7 +4458,7 @@ type ApplicationInfo struct {
ComputePlatform *string `locationName:"computePlatform" type:"string" enum:"ComputePlatform"`
// The time at which the application was created.
CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"unix"`
CreateTime *time.Time `locationName:"createTime" type:"timestamp"`
// The name for a connection to a GitHub account.
GitHubAccountName *string `locationName:"gitHubAccountName" type:"string"`
@ -5102,7 +5105,8 @@ type BlueInstanceTerminationOption struct {
Action *string `locationName:"action" type:"string" enum:"InstanceAction"`
// The number of minutes to wait after a successful blue/green deployment before
// terminating instances from the original environment.
// terminating instances from the original environment. The maximum setting
// is 2880 minutes (2 days).
TerminationWaitTimeInMinutes *int64 `locationName:"terminationWaitTimeInMinutes" type:"integer"`
}
@ -6029,7 +6033,7 @@ type DeploymentConfigInfo struct {
ComputePlatform *string `locationName:"computePlatform" type:"string" enum:"ComputePlatform"`
// The time at which the deployment configuration was created.
CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"unix"`
CreateTime *time.Time `locationName:"createTime" type:"timestamp"`
// The deployment configuration ID.
DeploymentConfigId *string `locationName:"deploymentConfigId" type:"string"`
@ -6316,13 +6320,13 @@ type DeploymentInfo struct {
BlueGreenDeploymentConfiguration *BlueGreenDeploymentConfiguration `locationName:"blueGreenDeploymentConfiguration" type:"structure"`
// A timestamp indicating when the deployment was complete.
CompleteTime *time.Time `locationName:"completeTime" type:"timestamp" timestampFormat:"unix"`
CompleteTime *time.Time `locationName:"completeTime" type:"timestamp"`
// The destination platform type for the deployment (Lambda or Server).
ComputePlatform *string `locationName:"computePlatform" type:"string" enum:"ComputePlatform"`
// A timestamp indicating when the deployment was created.
CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"unix"`
CreateTime *time.Time `locationName:"createTime" type:"timestamp"`
// The means by which the deployment was created:
//
@ -6409,7 +6413,7 @@ type DeploymentInfo struct {
// In some cases, the reported value of the start time may be later than the
// complete time. This is due to differences in the clock settings of back-end
// servers that participate in the deployment process.
StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"unix"`
StartTime *time.Time `locationName:"startTime" type:"timestamp"`
// The current state of the deployment as a whole.
Status *string `locationName:"status" type:"string" enum:"DeploymentStatus"`
@ -6678,10 +6682,10 @@ type DeploymentReadyOption struct {
// after the new application revision is installed on the instances in the
// replacement environment.
//
// * STOP_DEPLOYMENT: Do not register new instances with load balancer unless
// traffic is rerouted manually. If traffic is not rerouted manually before
// the end of the specified wait period, the deployment status is changed
// to Stopped.
// * STOP_DEPLOYMENT: Do not register new instances with a load balancer
// unless traffic rerouting is started using ContinueDeployment. If traffic
// rerouting is not started before the end of the specified wait period,
// the deployment status is changed to Stopped.
ActionOnTimeout *string `locationName:"actionOnTimeout" type:"string" enum:"DeploymentReadyAction"`
// The number of minutes to wait before the status of a blue/green deployment
@ -7055,13 +7059,13 @@ type GenericRevisionInfo struct {
Description *string `locationName:"description" type:"string"`
// When the revision was first used by AWS CodeDeploy.
FirstUsedTime *time.Time `locationName:"firstUsedTime" type:"timestamp" timestampFormat:"unix"`
FirstUsedTime *time.Time `locationName:"firstUsedTime" type:"timestamp"`
// When the revision was last used by AWS CodeDeploy.
LastUsedTime *time.Time `locationName:"lastUsedTime" type:"timestamp" timestampFormat:"unix"`
LastUsedTime *time.Time `locationName:"lastUsedTime" type:"timestamp"`
// When the revision was registered with AWS CodeDeploy.
RegisterTime *time.Time `locationName:"registerTime" type:"timestamp" timestampFormat:"unix"`
RegisterTime *time.Time `locationName:"registerTime" type:"timestamp"`
}
// String returns the string representation
@ -7697,7 +7701,7 @@ type InstanceInfo struct {
// If the on-premises instance was deregistered, the time at which the on-premises
// instance was deregistered.
DeregisterTime *time.Time `locationName:"deregisterTime" type:"timestamp" timestampFormat:"unix"`
DeregisterTime *time.Time `locationName:"deregisterTime" type:"timestamp"`
// The ARN of the IAM session associated with the on-premises instance.
IamSessionArn *string `locationName:"iamSessionArn" type:"string"`
@ -7712,7 +7716,7 @@ type InstanceInfo struct {
InstanceName *string `locationName:"instanceName" type:"string"`
// The time at which the on-premises instance was registered.
RegisterTime *time.Time `locationName:"registerTime" type:"timestamp" timestampFormat:"unix"`
RegisterTime *time.Time `locationName:"registerTime" type:"timestamp"`
// The tags currently associated with the on-premises instance.
Tags []*Tag `locationName:"tags" type:"list"`
@ -7789,7 +7793,7 @@ type InstanceSummary struct {
InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"`
// A timestamp indicating when the instance information was last updated.
LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"unix"`
LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp"`
// A list of lifecycle events for this instance.
LifecycleEvents []*LifecycleEvent `locationName:"lifecycleEvents" type:"list"`
@ -7863,14 +7867,14 @@ type LastDeploymentInfo struct {
// A timestamp indicating when the most recent deployment to the deployment
// group started.
CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"unix"`
CreateTime *time.Time `locationName:"createTime" type:"timestamp"`
// The deployment ID.
DeploymentId *string `locationName:"deploymentId" type:"string"`
// A timestamp indicating when the most recent deployment to the deployment
// group completed.
EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"unix"`
EndTime *time.Time `locationName:"endTime" type:"timestamp"`
// The status of the most recent deployment.
Status *string `locationName:"status" type:"string" enum:"DeploymentStatus"`
@ -7918,14 +7922,14 @@ type LifecycleEvent struct {
Diagnostics *Diagnostics `locationName:"diagnostics" type:"structure"`
// A timestamp indicating when the deployment lifecycle event ended.
EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"unix"`
EndTime *time.Time `locationName:"endTime" type:"timestamp"`
// The deployment lifecycle event name, such as ApplicationStop, BeforeInstall,
// AfterInstall, ApplicationStart, or ValidateService.
LifecycleEventName *string `locationName:"lifecycleEventName" type:"string"`
// A timestamp indicating when the deployment lifecycle event started.
StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"unix"`
StartTime *time.Time `locationName:"startTime" type:"timestamp"`
// The deployment lifecycle event status:
//
@ -8757,11 +8761,15 @@ type LoadBalancerInfo struct {
// An array containing information about the load balancer to use for load balancing
// in a deployment. In Elastic Load Balancing, load balancers are used with
// Classic Load Balancers.
//
// Adding more than one load balancer to the array is not supported.
ElbInfoList []*ELBInfo `locationName:"elbInfoList" type:"list"`
// An array containing information about the target group to use for load balancing
// in a deployment. In Elastic Load Balancing, target groups are used with Application
// Load Balancers.
//
// Adding more than one target group to the array is not supported.
TargetGroupInfoList []*TargetGroupInfo `locationName:"targetGroupInfoList" type:"list"`
}
@ -9775,12 +9783,12 @@ type TimeRange struct {
// The end time of the time range.
//
// Specify null to leave the end time open-ended.
End *time.Time `locationName:"end" type:"timestamp" timestampFormat:"unix"`
End *time.Time `locationName:"end" type:"timestamp"`
// The start time of the time range.
//
// Specify null to leave the start time open-ended.
Start *time.Time `locationName:"start" type:"timestamp" timestampFormat:"unix"`
Start *time.Time `locationName:"start" type:"timestamp"`
}
// String returns the string representation

View File

@ -345,6 +345,12 @@ const (
// "DISALLOW", "OVERWRITE", and "RETAIN".
ErrCodeInvalidFileExistsBehaviorException = "InvalidFileExistsBehaviorException"
// ErrCodeInvalidGitHubAccountTokenException for service response error code
// "InvalidGitHubAccountTokenException".
//
// The GitHub token is not valid.
ErrCodeInvalidGitHubAccountTokenException = "InvalidGitHubAccountTokenException"
// ErrCodeInvalidGitHubAccountTokenNameException for service response error code
// "InvalidGitHubAccountTokenNameException".
//

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "codedeploy" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "codedeploy" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "CodeDeploy" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the CodeDeploy client with a session.
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

File diff suppressed because it is too large Load Diff

View File

@ -11,10 +11,10 @@
// see the AWS CodePipeline User Guide (http://docs.aws.amazon.com/codepipeline/latest/userguide/welcome.html).
//
// You can use the AWS CodePipeline API to work with pipelines, stages, actions,
// gates, and transitions, as described below.
// and transitions, as described below.
//
// Pipelines are models of automated release processes. Each pipeline is uniquely
// named, and consists of actions, gates, and stages.
// named, and consists of stages, actions, and transitions.
//
// You can work with pipelines by calling:
//
@ -43,24 +43,37 @@
// * UpdatePipeline, which updates a pipeline with edits or changes to the
// structure of the pipeline.
//
// Pipelines include stages, which are logical groupings of gates and actions.
// Each stage contains one or more actions that must complete before the next
// stage begins. A stage will result in success or failure. If a stage fails,
// then the pipeline stops at that stage and will remain stopped until either
// a new version of an artifact appears in the source location, or a user takes
// action to re-run the most recent artifact through the pipeline. You can call
// GetPipelineState, which displays the status of a pipeline, including the
// status of stages in the pipeline, or GetPipeline, which returns the entire
// structure of the pipeline, including the stages of that pipeline. For more
// information about the structure of stages and actions, also refer to the
// AWS CodePipeline Pipeline Structure Reference (http://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-structure.html).
// Pipelines include stages. Each stage contains one or more actions that must
// complete before the next stage begins. A stage will result in success or
// failure. If a stage fails, then the pipeline stops at that stage and will
// remain stopped until either a new version of an artifact appears in the source
// location, or a user takes action to re-run the most recent artifact through
// the pipeline. You can call GetPipelineState, which displays the status of
// a pipeline, including the status of stages in the pipeline, or GetPipeline,
// which returns the entire structure of the pipeline, including the stages
// of that pipeline. For more information about the structure of stages and
// actions, also refer to the AWS CodePipeline Pipeline Structure Reference
// (http://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-structure.html).
//
// Pipeline stages include actions, which are categorized into categories such
// as source or build actions performed within a stage of a pipeline. For example,
// you can use a source action to import artifacts into a pipeline from a source
// such as Amazon S3. Like stages, you do not work with actions directly in
// most cases, but you do define and interact with actions when working with
// pipeline operations such as CreatePipeline and GetPipelineState.
// pipeline operations such as CreatePipeline and GetPipelineState. Valid action
// categories are:
//
// * Source
//
// * Build
//
// * Test
//
// * Deploy
//
// * Approval
//
// * Invoke
//
// Pipelines also include transitions, which allow the transition of artifacts
// from one stage to the next in a pipeline after the actions in one stage complete.

View File

@ -83,6 +83,18 @@ const (
// The specified structure was specified in an invalid format.
ErrCodeInvalidStructureException = "InvalidStructureException"
// ErrCodeInvalidWebhookAuthenticationParametersException for service response error code
// "InvalidWebhookAuthenticationParametersException".
//
// The specified authentication type is in an invalid format.
ErrCodeInvalidWebhookAuthenticationParametersException = "InvalidWebhookAuthenticationParametersException"
// ErrCodeInvalidWebhookFilterPatternException for service response error code
// "InvalidWebhookFilterPatternException".
//
// The specified event filter rule is in an invalid format.
ErrCodeInvalidWebhookFilterPatternException = "InvalidWebhookFilterPatternException"
// ErrCodeJobNotFoundException for service response error code
// "JobNotFoundException".
//
@ -149,4 +161,10 @@ const (
//
// The validation was specified in an invalid format.
ErrCodeValidationException = "ValidationException"
// ErrCodeWebhookNotFoundException for service response error code
// "WebhookNotFoundException".
//
// The specified webhook was entered in an invalid format or cannot be found.
ErrCodeWebhookNotFoundException = "WebhookNotFoundException"
)

View File

@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "codepipeline" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "codepipeline" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "CodePipeline" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the CodePipeline client with a session.
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,

View File

@ -1970,7 +1970,7 @@ type Credentials struct {
AccessKeyId *string `type:"string"`
// The date at which these credentials will expire.
Expiration *time.Time `type:"timestamp" timestampFormat:"unix"`
Expiration *time.Time `type:"timestamp"`
// The Secret Access Key portion of the credentials
SecretKey *string `type:"string"`
@ -2728,13 +2728,13 @@ type IdentityDescription struct {
_ struct{} `type:"structure"`
// Date on which the identity was created.
CreationDate *time.Time `type:"timestamp" timestampFormat:"unix"`
CreationDate *time.Time `type:"timestamp"`
// A unique identifier in the format REGION:GUID.
IdentityId *string `min:"1" type:"string"`
// Date on which the identity was last modified.
LastModifiedDate *time.Time `type:"timestamp" timestampFormat:"unix"`
LastModifiedDate *time.Time `type:"timestamp"`
// A set of optional name-value pairs that map provider names to provider tokens.
Logins []*string `type:"list"`

Some files were not shown because too many files have changed in this diff Show More