Merge pull request #6 from terraform-providers/vendor-tf-0.10

vendor: github.com/hashicorp/terraform/...@v0.10.0
This commit is contained in:
Radek Simko 2017-08-14 16:15:23 +02:00 committed by GitHub
commit 3845dd25ac
606 changed files with 57129 additions and 4543 deletions

202
vendor/github.com/aws/aws-sdk-go/LICENSE.txt generated vendored Normal file
View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

3
vendor/github.com/aws/aws-sdk-go/NOTICE.txt generated vendored Normal file
View File

@ -0,0 +1,3 @@
AWS SDK for Go
Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copyright 2014-2015 Stripe, Inc.

View File

@ -15,11 +15,11 @@ import (
// the MaxRetries method:
//
// type retryer struct {
// service.DefaultRetryer
// client.DefaultRetryer
// }
//
// // This implementation always has 100 max retries
// func (d retryer) MaxRetries() uint { return 100 }
// func (d retryer) MaxRetries() int { return 100 }
type DefaultRetryer struct {
NumMaxRetries int
}

View File

@ -95,7 +95,7 @@ type Config struct {
// recoverable failures.
//
// When nil or the value does not implement the request.Retryer interface,
// the request.DefaultRetryer will be used.
// the client.DefaultRetryer will be used.
//
// When both Retryer and MaxRetries are non-nil, the former is used and
// the latter ignored.

View File

@ -91,6 +91,7 @@ const (
FirehoseServiceID = "firehose" // Firehose.
GameliftServiceID = "gamelift" // Gamelift.
GlacierServiceID = "glacier" // Glacier.
GreengrassServiceID = "greengrass" // Greengrass.
HealthServiceID = "health" // Health.
IamServiceID = "iam" // Iam.
ImportexportServiceID = "importexport" // Importexport.
@ -260,9 +261,11 @@ var awsPartition = partition{
"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{},
@ -311,9 +314,12 @@ var awsPartition = partition{
"athena": service{
Endpoints: endpoints{
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
"ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"autoscaling": service{
@ -340,9 +346,14 @@ var awsPartition = partition{
"batch": service{
Endpoints: endpoints{
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
"ap-northeast-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{},
},
},
"budgets": service{
@ -458,10 +469,13 @@ var awsPartition = partition{
"ap-northeast-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{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
@ -469,12 +483,18 @@ 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{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
@ -503,11 +523,14 @@ var awsPartition = partition{
"ap-northeast-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{},
},
},
@ -963,6 +986,18 @@ var awsPartition = partition{
"us-west-2": endpoint{},
},
},
"greengrass": service{
IsRegionalized: boxedTrue,
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"health": service{
Endpoints: endpoints{
@ -1006,6 +1041,7 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
@ -1082,9 +1118,11 @@ var awsPartition = partition{
"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{},
@ -1447,9 +1485,16 @@ var awsPartition = partition{
"sms": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-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{},
},
},
"snowball": service{
@ -1534,6 +1579,7 @@ var awsPartition = partition{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
@ -1848,6 +1894,18 @@ var awscnPartition = partition{
},
},
},
"ecr": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
},
},
"ecs": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
},
},
"elasticache": service{
Endpoints: endpoints{
@ -1961,6 +2019,12 @@ var awscnPartition = partition{
"cn-north-1": endpoint{},
},
},
"ssm": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
},
},
"storagegateway": service{
Endpoints: endpoints{
@ -2183,6 +2247,12 @@ var awsusgovPartition = partition{
"us-gov-west-1": endpoint{},
},
},
"rekognition": service{
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
},
"s3": service{
Defaults: endpoint{
SignatureVersions: []string{"s3", "s3v4"},
@ -2200,6 +2270,12 @@ var awsusgovPartition = partition{
},
},
},
"sms": service{
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
},
"snowball": service{
Endpoints: endpoints{
@ -2223,6 +2299,12 @@ var awsusgovPartition = partition{
},
},
},
"ssm": service{
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
},
"streams.dynamodb": service{
Defaults: endpoint{
CredentialScope: credentialScope{

View File

@ -21,12 +21,12 @@
// partitions := resolver.(endpoints.EnumPartitions).Partitions()
//
// for _, p := range partitions {
// fmt.Println("Regions for", p.Name)
// fmt.Println("Regions for", p.ID())
// for id, _ := range p.Regions() {
// fmt.Println("*", id)
// }
//
// fmt.Println("Services for", p.Name)
// fmt.Println("Services for", p.ID())
// for id, _ := range p.Services() {
// fmt.Println("*", id)
// }

View File

@ -26,14 +26,14 @@ func (l *LogLevelType) Value() LogLevelType {
// Matches returns true if the v LogLevel is enabled by this LogLevel. Should be
// used with logging sub levels. Is safe to use on nil value LogLevelTypes. If
// LogLevel is nill, will default to LogOff comparison.
// LogLevel is nil, will default to LogOff comparison.
func (l *LogLevelType) Matches(v LogLevelType) bool {
c := l.Value()
return c&v == v
}
// AtLeast returns true if this LogLevel is at least high enough to satisfies v.
// Is safe to use on nil value LogLevelTypes. If LogLevel is nill, will default
// Is safe to use on nil value LogLevelTypes. If LogLevel is nil, will default
// to LogOff comparison.
func (l *LogLevelType) AtLeast(v LogLevelType) bool {
c := l.Value()

View File

@ -8,7 +8,7 @@ import (
)
// Retryer is an interface to control retry logic for a given service.
// The default implementation used by most services is the service.DefaultRetryer
// The default implementation used by most services is the client.DefaultRetryer
// structure, which contains basic retry logic using exponential backoff.
type Retryer interface {
RetryRules(*Request) time.Duration

View File

@ -220,7 +220,7 @@ type ErrParamMinLen struct {
func NewErrParamMinLen(field string, min int) *ErrParamMinLen {
return &ErrParamMinLen{
errInvalidParam: errInvalidParam{
code: ParamMinValueErrCode,
code: ParamMinLenErrCode,
field: field,
msg: fmt.Sprintf("minimum field size of %v", min),
},

View File

@ -79,8 +79,9 @@ type Waiter struct {
MaxAttempts int
Delay WaiterDelay
RequestOptions []Option
NewRequest func([]Option) (*Request, error)
RequestOptions []Option
NewRequest func([]Option) (*Request, error)
SleepWithContext func(aws.Context, time.Duration) error
}
// ApplyOptions updates the waiter with the list of waiter options provided.
@ -195,8 +196,15 @@ func (w Waiter) WaitWithContext(ctx aws.Context) error {
if sleepFn := req.Config.SleepDelay; sleepFn != nil {
// Support SleepDelay for backwards compatibility and testing
sleepFn(delay)
} else if err := aws.SleepWithContext(ctx, delay); err != nil {
return awserr.New(CanceledErrorCode, "waiter context canceled", err)
} else {
sleepCtxFn := w.SleepWithContext
if sleepCtxFn == nil {
sleepCtxFn = aws.SleepWithContext
}
if err := sleepCtxFn(ctx, delay); err != nil {
return awserr.New(CanceledErrorCode, "waiter context canceled", err)
}
}
}

View File

@ -45,7 +45,7 @@
// If signing a request intended for HTTP2 server, and you're using Go 1.6.2
// through 1.7.4 you should use the URL.RawPath as the pre-escaped form of the
// request URL. https://github.com/golang/go/issues/16847 points to a bug in
// Go pre 1.8 that failes to make HTTP2 requests using absolute URL in the HTTP
// Go pre 1.8 that fails to make HTTP2 requests using absolute URL in the HTTP
// message. URL.Opaque generally will force Go to make requests with absolute URL.
// URL.RawPath does not do this, but RawPath must be a valid escaping of Path
// or url.EscapedPath will ignore the RawPath escaping.
@ -55,7 +55,6 @@
package v4
import (
"bytes"
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
@ -402,7 +401,7 @@ var SignRequestHandler = request.NamedHandler{
}
// SignSDKRequest signs an AWS request with the V4 signature. This
// request handler is bested used only with the SDK's built in service client's
// request handler should only be used with the SDK's built in service client's
// API operation requests.
//
// This function should not be used on its on its own, but in conjunction with
@ -604,14 +603,18 @@ func (ctx *signingCtx) buildCanonicalHeaders(r rule, header http.Header) {
headerValues := make([]string, len(headers))
for i, k := range headers {
if k == "host" {
headerValues[i] = "host:" + ctx.Request.URL.Host
if ctx.Request.Host != "" {
headerValues[i] = "host:" + ctx.Request.Host
} else {
headerValues[i] = "host:" + ctx.Request.URL.Host
}
} else {
headerValues[i] = k + ":" +
strings.Join(ctx.SignedHeaderVals[k], ",")
}
}
ctx.canonicalHeaders = strings.Join(stripExcessSpaces(headerValues), "\n")
stripExcessSpaces(headerValues)
ctx.canonicalHeaders = strings.Join(headerValues, "\n")
}
func (ctx *signingCtx) buildCanonicalString() {
@ -713,49 +716,46 @@ func makeSha256Reader(reader io.ReadSeeker) []byte {
return hash.Sum(nil)
}
const doubleSpaces = " "
const doubleSpace = " "
var doubleSpaceBytes = []byte(doubleSpaces)
// stripExcessSpaces will rewrite the passed in slice's string values to not
// contain muliple side-by-side spaces.
func stripExcessSpaces(vals []string) {
var j, k, l, m, spaces int
for i, str := range vals {
// Trim trailing spaces
for j = len(str) - 1; j >= 0 && str[j] == ' '; j-- {
}
func stripExcessSpaces(headerVals []string) []string {
vals := make([]string, len(headerVals))
for i, str := range headerVals {
// Trim leading and trailing spaces
trimmed := strings.TrimSpace(str)
// Trim leading spaces
for k = 0; k < j && str[k] == ' '; k++ {
}
str = str[k : j+1]
idx := strings.Index(trimmed, doubleSpaces)
var buf []byte
for idx > -1 {
// Multiple adjacent spaces found
if buf == nil {
// first time create the buffer
buf = []byte(trimmed)
}
// Strip multiple spaces.
j = strings.Index(str, doubleSpace)
if j < 0 {
vals[i] = str
continue
}
stripToIdx := -1
for j := idx + 1; j < len(buf); j++ {
if buf[j] != ' ' {
buf = append(buf[:idx+1], buf[j:]...)
stripToIdx = j
break
}
}
if stripToIdx >= 0 {
idx = bytes.Index(buf[stripToIdx:], doubleSpaceBytes)
if idx >= 0 {
idx += stripToIdx
buf := []byte(str)
for k, m, l = j, j, len(buf); k < l; k++ {
if buf[k] == ' ' {
if spaces == 0 {
// First space.
buf[m] = buf[k]
m++
}
spaces++
} else {
idx = -1
// End of multiple spaces.
spaces = 0
buf[m] = buf[k]
m++
}
}
if buf != nil {
vals[i] = string(buf)
} else {
vals[i] = trimmed
}
vals[i] = string(buf[:m])
}
return vals
}

View File

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

View File

@ -979,6 +979,8 @@ func (c *ACM) ResendValidationEmailRequest(input *ResendValidationEmailInput) (r
// the mail be resent within 72 hours of requesting the ACM Certificate. If
// 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/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
@ -2181,6 +2183,20 @@ type RequestCertificateInput struct {
// 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 maximum length of a DNS name is 253 octets. The name is made up of multiple
// labels separated by periods. No label can be longer than 63 octets. Consider
// the following examples:
//
// (63 octets).(63 octets).(63 octets).(61 octets) is legal because the total
// length is 253 octets (63+1+63+1+63+1+61) and no label exceeds 63 octets.
//
// (64 octets).(63 octets).(63 octets).(61 octets) is not legal because the
// total length exceeds 253 octets (64+1+63+1+63+1+61) and the first label exceeds
// 63 octets.
//
// (63 octets).(63 octets).(63 octets).(62 octets) is not legal because the
// total length of the DNS name (63+1+63+1+63+1+62) exceeds 253 octets.
//
// DomainName is a required field
DomainName *string `min:"1" type:"string" required:"true"`
@ -2199,7 +2215,10 @@ type RequestCertificateInput struct {
// Additional FQDNs to be included in the Subject Alternative Name extension
// of the ACM Certificate. For example, add the name www.example.net to a certificate
// for which the DomainName field is www.example.com if users can reach your
// site by using either name.
// 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/acm/latest/userguide/acm-limits.html).
SubjectAlternativeNames []*string `min:"1" type:"list"`
}

File diff suppressed because it is too large Load Diff

View File

@ -596,12 +596,11 @@ func (c *ApplicationAutoScaling) DescribeScalingPoliciesRequest(input *DescribeS
// for the API request.
//
// * ErrCodeFailedResourceAccessException "FailedResourceAccessException"
// Failed access to resources caused an exception. This exception currently
// only applies to DescribeScalingPolicies. It is thrown when Application Auto
// Scaling is unable to retrieve the alarms associated with a scaling policy
// due to a client error, for example, if the role ARN specified for a scalable
// target does not have the proper permissions to call the CloudWatch DescribeAlarms
// (http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html)
// Failed access to resources caused an exception. This exception is thrown
// when Application Auto Scaling is unable to retrieve the alarms associated
// with a scaling policy due to a client error, for example, if the role ARN
// specified for a scalable target does not have permission to call the CloudWatch
// DescribeAlarms (http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html)
// API operation on behalf of your account.
//
// * ErrCodeInvalidNextTokenException "InvalidNextTokenException"
@ -774,6 +773,14 @@ func (c *ApplicationAutoScaling) PutScalingPolicyRequest(input *PutScalingPolicy
// Concurrent updates caused an exception, for example, if you request an update
// to an Application Auto Scaling resource that already has a pending update.
//
// * ErrCodeFailedResourceAccessException "FailedResourceAccessException"
// Failed access to resources caused an exception. This exception is thrown
// when Application Auto Scaling is unable to retrieve the alarms associated
// with a scaling policy due to a client error, for example, if the role ARN
// specified for a scalable target does not have permission to call the CloudWatch
// DescribeAlarms (http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html)
// API operation on behalf of your account.
//
// * ErrCodeInternalServiceException "InternalServiceException"
// The service encountered an internal error.
//
@ -938,6 +945,102 @@ func (s *Alarm) SetAlarmName(v string) *Alarm {
return s
}
// Configures a customized metric for a target tracking policy.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/CustomizedMetricSpecification
type CustomizedMetricSpecification struct {
_ struct{} `type:"structure"`
// The dimensions of the metric.
Dimensions []*MetricDimension `type:"list"`
// The name of the metric.
//
// MetricName is a required field
MetricName *string `type:"string" required:"true"`
// The namespace of the metric.
//
// Namespace is a required field
Namespace *string `type:"string" required:"true"`
// The statistic of the metric.
//
// Statistic is a required field
Statistic *string `type:"string" required:"true" enum:"MetricStatistic"`
// The unit of the metric.
Unit *string `type:"string"`
}
// String returns the string representation
func (s CustomizedMetricSpecification) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s CustomizedMetricSpecification) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CustomizedMetricSpecification) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CustomizedMetricSpecification"}
if s.MetricName == nil {
invalidParams.Add(request.NewErrParamRequired("MetricName"))
}
if s.Namespace == nil {
invalidParams.Add(request.NewErrParamRequired("Namespace"))
}
if s.Statistic == nil {
invalidParams.Add(request.NewErrParamRequired("Statistic"))
}
if s.Dimensions != nil {
for i, v := range s.Dimensions {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetDimensions sets the Dimensions field's value.
func (s *CustomizedMetricSpecification) SetDimensions(v []*MetricDimension) *CustomizedMetricSpecification {
s.Dimensions = v
return s
}
// SetMetricName sets the MetricName field's value.
func (s *CustomizedMetricSpecification) SetMetricName(v string) *CustomizedMetricSpecification {
s.MetricName = &v
return s
}
// SetNamespace sets the Namespace field's value.
func (s *CustomizedMetricSpecification) SetNamespace(v string) *CustomizedMetricSpecification {
s.Namespace = &v
return s
}
// SetStatistic sets the Statistic field's value.
func (s *CustomizedMetricSpecification) SetStatistic(v string) *CustomizedMetricSpecification {
s.Statistic = &v
return s
}
// SetUnit sets the Unit field's value.
func (s *CustomizedMetricSpecification) SetUnit(v string) *CustomizedMetricSpecification {
s.Unit = &v
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeleteScalingPolicyRequest
type DeleteScalingPolicyInput struct {
_ struct{} `type:"structure"`
@ -962,6 +1065,12 @@ type DeleteScalingPolicyInput struct {
// * AppStream 2.0 fleet - The resource type is fleet and the unique identifier
// is the fleet name. Example: fleet/sample-fleet.
//
// * DynamoDB table - The resource type is table and the unique identifier
// is the resource ID. Example: table/my-table.
//
// * DynamoDB global secondary index - The resource type is index and the
// unique identifier is the resource ID. Example: table/my-table/index/my-table-index.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
@ -979,6 +1088,18 @@ type DeleteScalingPolicyInput struct {
// * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream
// 2.0 fleet.
//
// * dynamodb:table:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB table.
//
// * dynamodb:table:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB table.
//
// * dynamodb:index:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB global secondary index.
//
// * dynamodb:index:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB global secondary index.
//
// ScalableDimension is a required field
ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
@ -1086,6 +1207,12 @@ type DeregisterScalableTargetInput struct {
// * AppStream 2.0 fleet - The resource type is fleet and the unique identifier
// is the fleet name. Example: fleet/sample-fleet.
//
// * DynamoDB table - The resource type is table and the unique identifier
// is the resource ID. Example: table/my-table.
//
// * DynamoDB global secondary index - The resource type is index and the
// unique identifier is the resource ID. Example: table/my-table/index/my-table-index.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
@ -1103,6 +1230,18 @@ type DeregisterScalableTargetInput struct {
// * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream
// 2.0 fleet.
//
// * dynamodb:table:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB table.
//
// * dynamodb:table:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB table.
//
// * dynamodb:index:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB global secondary index.
//
// * dynamodb:index:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB global secondary index.
//
// ScalableDimension is a required field
ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
@ -1210,6 +1349,12 @@ type DescribeScalableTargetsInput struct {
//
// * AppStream 2.0 fleet - The resource type is fleet and the unique identifier
// is the fleet name. Example: fleet/sample-fleet.
//
// * DynamoDB table - The resource type is table and the unique identifier
// is the resource ID. Example: table/my-table.
//
// * DynamoDB global secondary index - The resource type is index and the
// unique identifier is the resource ID. Example: table/my-table/index/my-table-index.
ResourceIds []*string `type:"list"`
// The scalable dimension associated with the scalable target. This string consists
@ -1226,6 +1371,18 @@ type DescribeScalableTargetsInput struct {
//
// * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream
// 2.0 fleet.
//
// * dynamodb:table:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB table.
//
// * dynamodb:table:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB table.
//
// * dynamodb:index:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB global secondary index.
//
// * dynamodb:index:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB global secondary index.
ScalableDimension *string `type:"string" enum:"ScalableDimension"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
@ -1354,6 +1511,12 @@ type DescribeScalingActivitiesInput struct {
//
// * AppStream 2.0 fleet - The resource type is fleet and the unique identifier
// is the fleet name. Example: fleet/sample-fleet.
//
// * DynamoDB table - The resource type is table and the unique identifier
// is the resource ID. Example: table/my-table.
//
// * DynamoDB global secondary index - The resource type is index and the
// unique identifier is the resource ID. Example: table/my-table/index/my-table-index.
ResourceId *string `min:"1" type:"string"`
// The scalable dimension. This string consists of the service namespace, resource
@ -1370,6 +1533,18 @@ type DescribeScalingActivitiesInput struct {
//
// * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream
// 2.0 fleet.
//
// * dynamodb:table:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB table.
//
// * dynamodb:table:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB table.
//
// * dynamodb:index:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB global secondary index.
//
// * dynamodb:index:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB global secondary index.
ScalableDimension *string `type:"string" enum:"ScalableDimension"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
@ -1504,6 +1679,12 @@ type DescribeScalingPoliciesInput struct {
//
// * AppStream 2.0 fleet - The resource type is fleet and the unique identifier
// is the fleet name. Example: fleet/sample-fleet.
//
// * DynamoDB table - The resource type is table and the unique identifier
// is the resource ID. Example: table/my-table.
//
// * DynamoDB global secondary index - The resource type is index and the
// unique identifier is the resource ID. Example: table/my-table/index/my-table-index.
ResourceId *string `min:"1" type:"string"`
// The scalable dimension. This string consists of the service namespace, resource
@ -1520,6 +1701,18 @@ type DescribeScalingPoliciesInput struct {
//
// * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream
// 2.0 fleet.
//
// * dynamodb:table:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB table.
//
// * dynamodb:table:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB table.
//
// * dynamodb:index:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB global secondary index.
//
// * dynamodb:index:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB global secondary index.
ScalableDimension *string `type:"string" enum:"ScalableDimension"`
// The namespace of the AWS service. For more information, see AWS Service Namespaces
@ -1626,6 +1819,112 @@ func (s *DescribeScalingPoliciesOutput) SetScalingPolicies(v []*ScalingPolicy) *
return s
}
// Describes the dimension of a metric.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/MetricDimension
type MetricDimension struct {
_ struct{} `type:"structure"`
// The name of the dimension.
//
// Name is a required field
Name *string `type:"string" required:"true"`
// The value of the dimension.
//
// Value is a required field
Value *string `type:"string" required:"true"`
}
// String returns the string representation
func (s MetricDimension) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s MetricDimension) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *MetricDimension) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "MetricDimension"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Value == nil {
invalidParams.Add(request.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetName sets the Name field's value.
func (s *MetricDimension) SetName(v string) *MetricDimension {
s.Name = &v
return s
}
// SetValue sets the Value field's value.
func (s *MetricDimension) SetValue(v string) *MetricDimension {
s.Value = &v
return s
}
// Configures a predefined metric for a target tracking policy.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/PredefinedMetricSpecification
type PredefinedMetricSpecification struct {
_ struct{} `type:"structure"`
// The metric type.
//
// PredefinedMetricType is a required field
PredefinedMetricType *string `type:"string" required:"true" enum:"MetricType"`
// Reserved for future use.
ResourceLabel *string `min:"1" type:"string"`
}
// String returns the string representation
func (s PredefinedMetricSpecification) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s PredefinedMetricSpecification) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PredefinedMetricSpecification) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PredefinedMetricSpecification"}
if s.PredefinedMetricType == nil {
invalidParams.Add(request.NewErrParamRequired("PredefinedMetricType"))
}
if s.ResourceLabel != nil && len(*s.ResourceLabel) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ResourceLabel", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetPredefinedMetricType sets the PredefinedMetricType field's value.
func (s *PredefinedMetricSpecification) SetPredefinedMetricType(v string) *PredefinedMetricSpecification {
s.PredefinedMetricType = &v
return s
}
// SetResourceLabel sets the ResourceLabel field's value.
func (s *PredefinedMetricSpecification) SetResourceLabel(v string) *PredefinedMetricSpecification {
s.ResourceLabel = &v
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/PutScalingPolicyRequest
type PutScalingPolicyInput struct {
_ struct{} `type:"structure"`
@ -1637,6 +1936,9 @@ type PutScalingPolicyInput struct {
// The policy type. If you are creating a new policy, this parameter is required.
// If you are updating a policy, this parameter is not required.
//
// For DynamoDB, only TargetTrackingScaling is supported. For any other service,
// only StepScaling is supported.
PolicyType *string `type:"string" enum:"PolicyType"`
// The identifier of the resource associated with the scaling policy. This string
@ -1654,6 +1956,12 @@ type PutScalingPolicyInput struct {
// * AppStream 2.0 fleet - The resource type is fleet and the unique identifier
// is the fleet name. Example: fleet/sample-fleet.
//
// * DynamoDB table - The resource type is table and the unique identifier
// is the resource ID. Example: table/my-table.
//
// * DynamoDB global secondary index - The resource type is index and the
// unique identifier is the resource ID. Example: table/my-table/index/my-table-index.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
@ -1671,6 +1979,18 @@ type PutScalingPolicyInput struct {
// * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream
// 2.0 fleet.
//
// * dynamodb:table:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB table.
//
// * dynamodb:table:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB table.
//
// * dynamodb:index:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB global secondary index.
//
// * dynamodb:index:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB global secondary index.
//
// ScalableDimension is a required field
ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
@ -1681,11 +2001,17 @@ type PutScalingPolicyInput struct {
// ServiceNamespace is a required field
ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"`
// The configuration for the step scaling policy. If you are creating a new
// policy, this parameter is required. If you are updating a policy, this parameter
// is not required. For more information, see StepScalingPolicyConfiguration
// and StepAdjustment.
// A step scaling policy.
//
// This parameter is required if you are creating a policy and the policy type
// is StepScaling.
StepScalingPolicyConfiguration *StepScalingPolicyConfiguration `type:"structure"`
// A target tracking policy.
//
// This parameter is required if you are creating a new policy and the policy
// type is TargetTrackingScaling.
TargetTrackingScalingPolicyConfiguration *TargetTrackingScalingPolicyConfiguration `type:"structure"`
}
// String returns the string representation
@ -1724,6 +2050,11 @@ func (s *PutScalingPolicyInput) Validate() error {
invalidParams.AddNested("StepScalingPolicyConfiguration", err.(request.ErrInvalidParams))
}
}
if s.TargetTrackingScalingPolicyConfiguration != nil {
if err := s.TargetTrackingScalingPolicyConfiguration.Validate(); err != nil {
invalidParams.AddNested("TargetTrackingScalingPolicyConfiguration", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
@ -1767,10 +2098,19 @@ func (s *PutScalingPolicyInput) SetStepScalingPolicyConfiguration(v *StepScaling
return s
}
// SetTargetTrackingScalingPolicyConfiguration sets the TargetTrackingScalingPolicyConfiguration field's value.
func (s *PutScalingPolicyInput) SetTargetTrackingScalingPolicyConfiguration(v *TargetTrackingScalingPolicyConfiguration) *PutScalingPolicyInput {
s.TargetTrackingScalingPolicyConfiguration = v
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/PutScalingPolicyResponse
type PutScalingPolicyOutput struct {
_ struct{} `type:"structure"`
// The CloudWatch alarms created for the target tracking policy.
Alarms []*Alarm `type:"list"`
// The Amazon Resource Name (ARN) of the resulting scaling policy.
//
// PolicyARN is a required field
@ -1787,6 +2127,12 @@ func (s PutScalingPolicyOutput) GoString() string {
return s.String()
}
// SetAlarms sets the Alarms field's value.
func (s *PutScalingPolicyOutput) SetAlarms(v []*Alarm) *PutScalingPolicyOutput {
s.Alarms = v
return s
}
// SetPolicyARN sets the PolicyARN field's value.
func (s *PutScalingPolicyOutput) SetPolicyARN(v string) *PutScalingPolicyOutput {
s.PolicyARN = &v
@ -1822,6 +2168,12 @@ type RegisterScalableTargetInput struct {
// * AppStream 2.0 fleet - The resource type is fleet and the unique identifier
// is the fleet name. Example: fleet/sample-fleet.
//
// * DynamoDB table - The resource type is table and the unique identifier
// is the resource ID. Example: table/my-table.
//
// * DynamoDB global secondary index - The resource type is index and the
// unique identifier is the resource ID. Example: table/my-table/index/my-table-index.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
@ -1844,6 +2196,18 @@ type RegisterScalableTargetInput struct {
// * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream
// 2.0 fleet.
//
// * dynamodb:table:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB table.
//
// * dynamodb:table:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB table.
//
// * dynamodb:index:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB global secondary index.
//
// * dynamodb:index:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB global secondary index.
//
// ScalableDimension is a required field
ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
@ -1976,6 +2340,12 @@ type ScalableTarget struct {
// * AppStream 2.0 fleet - The resource type is fleet and the unique identifier
// is the fleet name. Example: fleet/sample-fleet.
//
// * DynamoDB table - The resource type is table and the unique identifier
// is the resource ID. Example: table/my-table.
//
// * DynamoDB global secondary index - The resource type is index and the
// unique identifier is the resource ID. Example: table/my-table/index/my-table-index.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
@ -1999,6 +2369,18 @@ type ScalableTarget struct {
// * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream
// 2.0 fleet.
//
// * dynamodb:table:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB table.
//
// * dynamodb:table:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB table.
//
// * dynamodb:index:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB global secondary index.
//
// * dynamodb:index:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB global secondary index.
//
// ScalableDimension is a required field
ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
@ -2103,6 +2485,12 @@ type ScalingActivity struct {
// * AppStream 2.0 fleet - The resource type is fleet and the unique identifier
// is the fleet name. Example: fleet/sample-fleet.
//
// * DynamoDB table - The resource type is table and the unique identifier
// is the resource ID. Example: table/my-table.
//
// * DynamoDB global secondary index - The resource type is index and the
// unique identifier is the resource ID. Example: table/my-table/index/my-table-index.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
@ -2120,6 +2508,18 @@ type ScalingActivity struct {
// * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream
// 2.0 fleet.
//
// * dynamodb:table:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB table.
//
// * dynamodb:table:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB table.
//
// * dynamodb:index:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB global secondary index.
//
// * dynamodb:index:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB global secondary index.
//
// ScalableDimension is a required field
ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
@ -2263,6 +2663,12 @@ type ScalingPolicy struct {
// * AppStream 2.0 fleet - The resource type is fleet and the unique identifier
// is the fleet name. Example: fleet/sample-fleet.
//
// * DynamoDB table - The resource type is table and the unique identifier
// is the resource ID. Example: table/my-table.
//
// * DynamoDB global secondary index - The resource type is index and the
// unique identifier is the resource ID. Example: table/my-table/index/my-table-index.
//
// ResourceId is a required field
ResourceId *string `min:"1" type:"string" required:"true"`
@ -2280,6 +2686,18 @@ type ScalingPolicy struct {
// * appstream:fleet:DesiredCapacity - The desired capacity of an AppStream
// 2.0 fleet.
//
// * dynamodb:table:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB table.
//
// * dynamodb:table:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB table.
//
// * dynamodb:index:ReadCapacityUnits - The provisioned read capacity for
// a DynamoDB global secondary index.
//
// * dynamodb:index:WriteCapacityUnits - The provisioned write capacity for
// a DynamoDB global secondary index.
//
// ScalableDimension is a required field
ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
@ -2290,8 +2708,11 @@ type ScalingPolicy struct {
// ServiceNamespace is a required field
ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"`
// The configuration for the step scaling policy.
// A step scaling policy.
StepScalingPolicyConfiguration *StepScalingPolicyConfiguration `type:"structure"`
// A target tracking policy.
TargetTrackingScalingPolicyConfiguration *TargetTrackingScalingPolicyConfiguration `type:"structure"`
}
// String returns the string representation
@ -2358,6 +2779,12 @@ func (s *ScalingPolicy) SetStepScalingPolicyConfiguration(v *StepScalingPolicyCo
return s
}
// SetTargetTrackingScalingPolicyConfiguration sets the TargetTrackingScalingPolicyConfiguration field's value.
func (s *ScalingPolicy) SetTargetTrackingScalingPolicyConfiguration(v *TargetTrackingScalingPolicyConfiguration) *ScalingPolicy {
s.TargetTrackingScalingPolicyConfiguration = v
return s
}
// Represents a step adjustment for a StepScalingPolicyConfiguration. Describes
// an adjustment based on the difference between the value of the aggregated
// CloudWatch metric and the breach threshold that you've defined for the alarm.
@ -2469,22 +2896,22 @@ type StepScalingPolicyConfiguration struct {
// previous trigger-related scaling activities can influence future scaling
// events.
//
// For scale out policies, while Cooldown is in effect, the capacity that has
// been added by the previous scale out event that initiated the Cooldown is
// calculated as part of the desired capacity for the next scale out. The intention
// is to continuously (but not excessively) scale out. For example, an alarm
// triggers a step scaling policy to scale out an Amazon ECS service by 2 tasks,
// the scaling activity completes successfully, and a Cooldown period of 5 minutes
// starts. During the Cooldown period, if the alarm triggers the same policy
// again but at a more aggressive step adjustment to scale out the service by
// 3 tasks, the 2 tasks that were added in the previous scale out event are
// considered part of that capacity and only 1 additional task is added to the
// desired count.
// For scale out policies, while the cooldown period is in effect, the capacity
// that has been added by the previous scale out event that initiated the cooldown
// is calculated as part of the desired capacity for the next scale out. The
// intention is to continuously (but not excessively) scale out. For example,
// an alarm triggers a step scaling policy to scale out an Amazon ECS service
// by 2 tasks, the scaling activity completes successfully, and a cooldown period
// of 5 minutes starts. During the Cooldown period, if the alarm triggers the
// same policy again but at a more aggressive step adjustment to scale out the
// service by 3 tasks, the 2 tasks that were added in the previous scale out
// event are considered part of that capacity and only 1 additional task is
// added to the desired count.
//
// For scale in policies, the Cooldown period is used to block subsequent scale
// For scale in policies, the cooldown period is used to block subsequent scale
// in requests until it has expired. The intention is to scale in conservatively
// to protect your application's availability. However, if another alarm triggers
// a scale out policy during the Cooldown period after a scale-in, Application
// a scale out policy during the cooldown period after a scale-in, Application
// Auto Scaling scales out your scalable target immediately.
Cooldown *int64 `type:"integer"`
@ -2562,6 +2989,106 @@ func (s *StepScalingPolicyConfiguration) SetStepAdjustments(v []*StepAdjustment)
return s
}
// Represents a target tracking scaling policy configuration.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/TargetTrackingScalingPolicyConfiguration
type TargetTrackingScalingPolicyConfiguration struct {
_ struct{} `type:"structure"`
// Reserved for future use.
CustomizedMetricSpecification *CustomizedMetricSpecification `type:"structure"`
// A predefined metric.
PredefinedMetricSpecification *PredefinedMetricSpecification `type:"structure"`
// The amount of time, in seconds, after a scale in activity completes before
// another scale in activity can start.
//
// The cooldown period is used to block subsequent scale in requests until it
// has expired. The intention is to scale in conservatively to protect your
// application's availability. However, if another alarm triggers a scale out
// policy during the cooldown period after a scale-in, Application Auto Scaling
// scales out your scalable target immediately.
ScaleInCooldown *int64 `type:"integer"`
// The amount of time, in seconds, after a scale out activity completes before
// another scale out activity can start.
//
// While the cooldown period is in effect, the capacity that has been added
// by the previous scale out event that initiated the cooldown is calculated
// as part of the desired capacity for the next scale out. The intention is
// to continuously (but not excessively) scale out.
ScaleOutCooldown *int64 `type:"integer"`
// The target value for the metric. The range is 8.515920e-109 to 1.174271e+108
// (Base 10) or 2e-360 to 2e360 (Base 2).
//
// TargetValue is a required field
TargetValue *float64 `type:"double" required:"true"`
}
// String returns the string representation
func (s TargetTrackingScalingPolicyConfiguration) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s TargetTrackingScalingPolicyConfiguration) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *TargetTrackingScalingPolicyConfiguration) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "TargetTrackingScalingPolicyConfiguration"}
if s.TargetValue == nil {
invalidParams.Add(request.NewErrParamRequired("TargetValue"))
}
if s.CustomizedMetricSpecification != nil {
if err := s.CustomizedMetricSpecification.Validate(); err != nil {
invalidParams.AddNested("CustomizedMetricSpecification", err.(request.ErrInvalidParams))
}
}
if s.PredefinedMetricSpecification != nil {
if err := s.PredefinedMetricSpecification.Validate(); err != nil {
invalidParams.AddNested("PredefinedMetricSpecification", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetCustomizedMetricSpecification sets the CustomizedMetricSpecification field's value.
func (s *TargetTrackingScalingPolicyConfiguration) SetCustomizedMetricSpecification(v *CustomizedMetricSpecification) *TargetTrackingScalingPolicyConfiguration {
s.CustomizedMetricSpecification = v
return s
}
// SetPredefinedMetricSpecification sets the PredefinedMetricSpecification field's value.
func (s *TargetTrackingScalingPolicyConfiguration) SetPredefinedMetricSpecification(v *PredefinedMetricSpecification) *TargetTrackingScalingPolicyConfiguration {
s.PredefinedMetricSpecification = v
return s
}
// SetScaleInCooldown sets the ScaleInCooldown field's value.
func (s *TargetTrackingScalingPolicyConfiguration) SetScaleInCooldown(v int64) *TargetTrackingScalingPolicyConfiguration {
s.ScaleInCooldown = &v
return s
}
// SetScaleOutCooldown sets the ScaleOutCooldown field's value.
func (s *TargetTrackingScalingPolicyConfiguration) SetScaleOutCooldown(v int64) *TargetTrackingScalingPolicyConfiguration {
s.ScaleOutCooldown = &v
return s
}
// SetTargetValue sets the TargetValue field's value.
func (s *TargetTrackingScalingPolicyConfiguration) SetTargetValue(v float64) *TargetTrackingScalingPolicyConfiguration {
s.TargetValue = &v
return s
}
const (
// AdjustmentTypeChangeInCapacity is a AdjustmentType enum value
AdjustmentTypeChangeInCapacity = "ChangeInCapacity"
@ -2584,9 +3111,37 @@ const (
MetricAggregationTypeMaximum = "Maximum"
)
const (
// MetricStatisticAverage is a MetricStatistic enum value
MetricStatisticAverage = "Average"
// MetricStatisticMinimum is a MetricStatistic enum value
MetricStatisticMinimum = "Minimum"
// MetricStatisticMaximum is a MetricStatistic enum value
MetricStatisticMaximum = "Maximum"
// MetricStatisticSampleCount is a MetricStatistic enum value
MetricStatisticSampleCount = "SampleCount"
// MetricStatisticSum is a MetricStatistic enum value
MetricStatisticSum = "Sum"
)
const (
// MetricTypeDynamoDbreadCapacityUtilization is a MetricType enum value
MetricTypeDynamoDbreadCapacityUtilization = "DynamoDBReadCapacityUtilization"
// MetricTypeDynamoDbwriteCapacityUtilization is a MetricType enum value
MetricTypeDynamoDbwriteCapacityUtilization = "DynamoDBWriteCapacityUtilization"
)
const (
// PolicyTypeStepScaling is a PolicyType enum value
PolicyTypeStepScaling = "StepScaling"
// PolicyTypeTargetTrackingScaling is a PolicyType enum value
PolicyTypeTargetTrackingScaling = "TargetTrackingScaling"
)
const (
@ -2601,6 +3156,18 @@ const (
// ScalableDimensionAppstreamFleetDesiredCapacity is a ScalableDimension enum value
ScalableDimensionAppstreamFleetDesiredCapacity = "appstream:fleet:DesiredCapacity"
// ScalableDimensionDynamodbTableReadCapacityUnits is a ScalableDimension enum value
ScalableDimensionDynamodbTableReadCapacityUnits = "dynamodb:table:ReadCapacityUnits"
// ScalableDimensionDynamodbTableWriteCapacityUnits is a ScalableDimension enum value
ScalableDimensionDynamodbTableWriteCapacityUnits = "dynamodb:table:WriteCapacityUnits"
// ScalableDimensionDynamodbIndexReadCapacityUnits is a ScalableDimension enum value
ScalableDimensionDynamodbIndexReadCapacityUnits = "dynamodb:index:ReadCapacityUnits"
// ScalableDimensionDynamodbIndexWriteCapacityUnits is a ScalableDimension enum value
ScalableDimensionDynamodbIndexWriteCapacityUnits = "dynamodb:index:WriteCapacityUnits"
)
const (
@ -2635,4 +3202,7 @@ const (
// ServiceNamespaceAppstream is a ServiceNamespace enum value
ServiceNamespaceAppstream = "appstream"
// ServiceNamespaceDynamodb is a ServiceNamespace enum value
ServiceNamespaceDynamodb = "dynamodb"
)

View File

@ -27,10 +27,15 @@
// in Amazon EMR (http://docs.aws.amazon.com/ElasticMapReduce/latest/ManagementGuide/emr-automatic-scaling.html)
// in the Amazon EMR Management Guide.
//
// * AppStream 2.0 fleets. For more information, see Autoscaling Amazon AppStream
// 2.0 Resources (http://docs.aws.amazon.com/appstream2/latest/developerguide/autoscaling.html)
// * AppStream 2.0 fleets. For more information, see Fleet Auto Scaling for
// Amazon AppStream 2.0 (http://docs.aws.amazon.com/appstream2/latest/developerguide/autoscaling.html)
// in the Amazon AppStream 2.0 Developer Guide.
//
// * Provisioned read and write capacity for Amazon DynamoDB tables and global
// secondary indexes. For more information, see Auto Scaling for DynamoDB
// (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TargetTracking.html)
// in the Amazon DynamoDB Developer Guide.
//
// 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.

View File

@ -14,12 +14,11 @@ const (
// ErrCodeFailedResourceAccessException for service response error code
// "FailedResourceAccessException".
//
// Failed access to resources caused an exception. This exception currently
// only applies to DescribeScalingPolicies. It is thrown when Application Auto
// Scaling is unable to retrieve the alarms associated with a scaling policy
// due to a client error, for example, if the role ARN specified for a scalable
// target does not have the proper permissions to call the CloudWatch DescribeAlarms
// (http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html)
// Failed access to resources caused an exception. This exception is thrown
// when Application Auto Scaling is unable to retrieve the alarms associated
// with a scaling policy due to a client error, for example, if the role ARN
// specified for a scalable target does not have permission to call the CloudWatch
// DescribeAlarms (http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html)
// API operation on behalf of your account.
ErrCodeFailedResourceAccessException = "FailedResourceAccessException"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,172 @@
// technical information about a specific AWS product, you can find the product's
// technical documentation at docs.aws.amazon.com (http://docs.aws.amazon.com/).
//
// APIs for stacks
//
// When you use AWS CloudFormation, you manage related resources as a single
// unit called a stack. You create, update, and delete a collection of resources
// by creating, updating, and deleting stacks. All the resources in a stack
// are defined by the stack's AWS CloudFormation template.
//
// Actions
//
// * CancelUpdateStack (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CancelUpdateStack.html)
//
// * ContinueUpdateRollback (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ContinueUpdateRollback.html)
//
// * CreateStack (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html)
//
// * DeleteStack (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeleteStack.html)
//
// * DescribeStackEvents (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackEvents.html)
//
// * DescribeStackResource (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackResource.html)
//
// * DescribeStackResources (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackResources.html)
//
// * DescribeStacks (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStacks.html)
//
// * EstimateTemplateCost (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_EstimateTemplateCost.html)
//
// * GetStackPolicy (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_GetStackPolicy.html)
//
// * GetTemplate (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_GetTemplate.html)
//
// * GetTemplateSummary (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_GetTemplateSummary.html)
//
// * ListExports (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListExports.html)
//
// * ListImports (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListImports.html)
//
// * ListStackResources (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStackResources.html)
//
// * ListStacks (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStacks.html)
//
// * SetStackPolicy (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_SetStackPolicy.html)
//
// * UpdateStack (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStack.html)
//
// * ValidateTemplate (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ValidateTemplate.html)
//
// Data Types
//
// * Export (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Export.html)
//
// * Parameter (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html)
//
// * ParameterConstraints (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ParameterConstraints.html)
//
// * ParameterDeclaration (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ParameterDeclaration.html)
//
// * Stack (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Stack.html)
//
// * StackEvent (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StackEvent.html)
//
// * StackResource (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StackResource.html)
//
// * StackResourceDetail (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StackResourceDetail.html)
//
// * StackResourceSummary (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StackResourceSummary.html)
//
// * StackSummary (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StackSummary.html)
//
// * Tag (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Tag.html)
//
// * TemplateParameter (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_TemplateParameter.html)
//
// APIs for change sets
//
// If you need to make changes to the running resources in a stack, you update
// the stack. Before making changes to your resources, you can generate a change
// set, which is summary of your proposed changes. Change sets allow you to
// see how your changes might impact your running resources, especially for
// critical resources, before implementing them.
//
// Actions
//
// * CreateChangeSet (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html)
//
// * DeleteChangeSet (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeleteChangeSet.html)
//
// * DescribeChangeSet (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeChangeSet.html)
//
// * ExecuteChangeSet (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ExecuteChangeSet.html)
//
// * ListChangeSets (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListChangeSets.html)
//
// Data Types
//
// * Change (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Change.html)
//
// * ChangeSetSummary (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ChangeSetSummary.html)
//
// * ResourceChange (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ResourceChange.html)
//
// * ResourceChangeDetail (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ResourceChangeDetail.html)
//
// * ResourceTargetDefinition (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ResourceTargetDefinition.html)
//
// APIs for stack sets
//
// AWS CloudFormation StackSets lets you create a collection, or stack set,
// of stacks that can automatically and safely provision a common set of AWS
// resources across multiple AWS accounts and multiple AWS regions from a single
// AWS CloudFormation template. When you create a stack set, AWS CloudFormation
// provisions a stack in each of the specified accounts and regions by using
// the supplied AWS CloudFormation template and parameters. Stack sets let you
// manage a common set of AWS resources in a selection of accounts and regions
// in a single operation.
//
// Actions
//
// * CreateStackInstances (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStackInstances.html)
//
// * CreateStackSet (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStackSet.html)
//
// * DeleteStackInstances (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeleteStackInstances.html)
//
// * DeleteStackSet (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeleteStackSet.html)
//
// * DescribeStackInstance (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackInstance.html)
//
// * DescribeStackSet (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackSet.html)
//
// * DescribeStackSetOperation (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackSetOperation.html)
//
// * ListStackInstances (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStackInstances.html)
//
// * ListStackSetOperationResults (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStackSetOperationResults)
//
// * ListStackSetOperations (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStackSetOperations)
//
// * ListStackSets (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStackSets)
//
// * StopStackSetOperation (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StopStackSetOperation.html)
//
// * UpdateStackSet (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html)
//
// Data Types
//
// * Parameter (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html)
//
// * StackInstance (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StackInstance.html.html)
//
// * StackInstanceSummary (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StackInstanceSummary.html.html)
//
// * StackSet (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StackSet.html)
//
// * StackSetOperation (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StackSetOperation.html.html)
//
// * StackSetOperationPreferences (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StackSetOperationPreferences.html.html)
//
// * StackSetOperationResultSummary (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StackSetOperationResultSummary.html.html)
//
// * StackSetOperationSummary (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StackSetOperationSummary.html.html)
//
// * StackSetSummary (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StackSetSummary.html)
//
// * Tag (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Tag.html)
//
// See https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15 for more information on this service.
//
// See cloudformation package documentation for more information.

View File

@ -7,7 +7,7 @@ const (
// ErrCodeAlreadyExistsException for service response error code
// "AlreadyExistsException".
//
// Resource with the name requested already exists.
// The resource with the name requested already exists.
ErrCodeAlreadyExistsException = "AlreadyExistsException"
// ErrCodeChangeSetNotFoundException for service response error code
@ -17,27 +17,91 @@ const (
// for a stack, use the ListChangeSets action.
ErrCodeChangeSetNotFoundException = "ChangeSetNotFound"
// ErrCodeCreatedButModifiedException for service response error code
// "CreatedButModifiedException".
//
// The specified resource exists, but has been changed.
ErrCodeCreatedButModifiedException = "CreatedButModifiedException"
// ErrCodeInsufficientCapabilitiesException for service response error code
// "InsufficientCapabilitiesException".
//
// The template contains resources with capabilities that were not specified
// The template contains resources with capabilities that weren't specified
// in the Capabilities parameter.
ErrCodeInsufficientCapabilitiesException = "InsufficientCapabilitiesException"
// ErrCodeInvalidChangeSetStatusException for service response error code
// "InvalidChangeSetStatus".
//
// The specified change set cannot be used to update the stack. For example,
// the change set status might be CREATE_IN_PROGRESS or the stack status might
// The specified change set can't be used to update the stack. For example,
// the change set status might be CREATE_IN_PROGRESS, or the stack status might
// be UPDATE_IN_PROGRESS.
ErrCodeInvalidChangeSetStatusException = "InvalidChangeSetStatus"
// ErrCodeInvalidOperationException for service response error code
// "InvalidOperationException".
//
// The specified operation isn't valid.
ErrCodeInvalidOperationException = "InvalidOperationException"
// ErrCodeLimitExceededException for service response error code
// "LimitExceededException".
//
// Quota for the resource has already been reached.
// The quota for the resource has already been reached.
ErrCodeLimitExceededException = "LimitExceededException"
// ErrCodeNameAlreadyExistsException for service response error code
// "NameAlreadyExistsException".
//
// The specified name is already in use.
ErrCodeNameAlreadyExistsException = "NameAlreadyExistsException"
// ErrCodeOperationIdAlreadyExistsException for service response error code
// "OperationIdAlreadyExistsException".
//
// The specified operation ID already exists.
ErrCodeOperationIdAlreadyExistsException = "OperationIdAlreadyExistsException"
// ErrCodeOperationInProgressException for service response error code
// "OperationInProgressException".
//
// Another operation is currently in progress for this stack set. Only one operation
// can be performed for a stack set at a given time.
ErrCodeOperationInProgressException = "OperationInProgressException"
// ErrCodeOperationNotFoundException for service response error code
// "OperationNotFoundException".
//
// The specified ID refers to an operation that doesn't exist.
ErrCodeOperationNotFoundException = "OperationNotFoundException"
// ErrCodeStackInstanceNotFoundException for service response error code
// "StackInstanceNotFoundException".
//
// The specified stack instance doesn't exist.
ErrCodeStackInstanceNotFoundException = "StackInstanceNotFoundException"
// ErrCodeStackSetNotEmptyException for service response error code
// "StackSetNotEmptyException".
//
// You can't yet delete this stack set, because it still contains one or more
// stack instances. Delete all stack instances from the stack set before deleting
// the stack set.
ErrCodeStackSetNotEmptyException = "StackSetNotEmptyException"
// ErrCodeStackSetNotFoundException for service response error code
// "StackSetNotFoundException".
//
// The specified stack set doesn't exist.
ErrCodeStackSetNotFoundException = "StackSetNotFoundException"
// ErrCodeStaleRequestException for service response error code
// "StaleRequestException".
//
// Another operation has been performed on this stack set since the specified
// operation was performed.
ErrCodeStaleRequestException = "StaleRequestException"
// ErrCodeTokenAlreadyExistsException for service response error code
// "TokenAlreadyExistsException".
//

View File

@ -2809,7 +2809,56 @@ func (c *CloudFront) UpdateDistributionRequest(input *UpdateDistributionInput) (
// UpdateDistribution API operation for Amazon CloudFront.
//
// Update a distribution.
// Updates the configuration for a web distribution. Perform the following steps.
//
// For information about updating a distribution using the CloudFront console,
// see Creating or Updating a Web Distribution Using the CloudFront Console
// (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-creating-console.html)
// in the Amazon CloudFront Developer Guide.
//
// To update a web distribution using the CloudFront API
//
// Submit a GetDistributionConfig request to get the current configuration and
// an Etag header for the distribution.
//
// If you update the distribution again, you need to get a new Etag header.
//
// Update the XML document that was returned in the response to your GetDistributionConfig
// request to include the desired changes. You can't change the value of CallerReference.
// If you try to change this value, CloudFront returns an IllegalUpdate error.
//
// The new configuration replaces the existing configuration; the values that
// you specify in an UpdateDistribution request are not merged into the existing
// configuration. When you add, delete, or replace values in an element that
// allows multiple values (for example, CNAME), you must specify all of the
// values that you want to appear in the updated distribution. In addition,
// you must update the corresponding Quantity element.
//
// Submit an UpdateDistribution request to update the configuration for your
// distribution:
//
// In the request body, include the XML document that you updated in Step 2.
// The request body must include an XML document with a DistributionConfig element.
//
// Set the value of the HTTP If-Match header to the value of the ETag header
// that CloudFront returned when you submitted the GetDistributionConfig request
// in Step 1.
//
// Review the response to the UpdateDistribution request to confirm that the
// configuration was successfully updated.
//
// Optional: Submit a GetDistribution request to confirm that your changes have
// propagated. When propagation is complete, the value of Status is Deployed.
//
// Beginning with the 2012-05-05 version of the CloudFront API, we made substantial
// changes to the format of the XML document that you include in the request
// body when you create or update a distribution. With previous versions of
// the API, we discovered that it was too easy to accidentally delete one or
// more values for an element that accepts multiple values, for example, CNAMEs
// and trusted signers. Our changes for the 2012-05-05 release are intended
// to prevent these accidental deletions and to notify you when there's a mismatch
// between the number of values you say you're specifying in the Quantity element
// and the number of values you're actually specifying.
//
// 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
@ -3857,7 +3906,7 @@ type CreateCloudFrontOriginAccessIdentityInput struct {
// The current configuration information for the identity.
//
// CloudFrontOriginAccessIdentityConfig is a required field
CloudFrontOriginAccessIdentityConfig *OriginAccessIdentityConfig `locationName:"CloudFrontOriginAccessIdentityConfig" type:"structure" required:"true"`
CloudFrontOriginAccessIdentityConfig *OriginAccessIdentityConfig `locationName:"CloudFrontOriginAccessIdentityConfig" type:"structure" required:"true" xmlURI:"http://cloudfront.amazonaws.com/doc/2017-03-25/"`
}
// String returns the string representation
@ -3946,7 +3995,7 @@ type CreateDistributionInput struct {
// The distribution's configuration information.
//
// DistributionConfig is a required field
DistributionConfig *DistributionConfig `locationName:"DistributionConfig" type:"structure" required:"true"`
DistributionConfig *DistributionConfig `locationName:"DistributionConfig" type:"structure" required:"true" xmlURI:"http://cloudfront.amazonaws.com/doc/2017-03-25/"`
}
// String returns the string representation
@ -4035,7 +4084,7 @@ type CreateDistributionWithTagsInput struct {
// The distribution's configuration information.
//
// DistributionConfigWithTags is a required field
DistributionConfigWithTags *DistributionConfigWithTags `locationName:"DistributionConfigWithTags" type:"structure" required:"true"`
DistributionConfigWithTags *DistributionConfigWithTags `locationName:"DistributionConfigWithTags" type:"structure" required:"true" xmlURI:"http://cloudfront.amazonaws.com/doc/2017-03-25/"`
}
// String returns the string representation
@ -4129,7 +4178,7 @@ type CreateInvalidationInput struct {
// The batch information for the invalidation.
//
// InvalidationBatch is a required field
InvalidationBatch *InvalidationBatch `locationName:"InvalidationBatch" type:"structure" required:"true"`
InvalidationBatch *InvalidationBatch `locationName:"InvalidationBatch" type:"structure" required:"true" xmlURI:"http://cloudfront.amazonaws.com/doc/2017-03-25/"`
}
// String returns the string representation
@ -4218,7 +4267,7 @@ type CreateStreamingDistributionInput struct {
// The streaming distribution's configuration information.
//
// StreamingDistributionConfig is a required field
StreamingDistributionConfig *StreamingDistributionConfig `locationName:"StreamingDistributionConfig" type:"structure" required:"true"`
StreamingDistributionConfig *StreamingDistributionConfig `locationName:"StreamingDistributionConfig" type:"structure" required:"true" xmlURI:"http://cloudfront.amazonaws.com/doc/2017-03-25/"`
}
// String returns the string representation
@ -4307,7 +4356,7 @@ type CreateStreamingDistributionWithTagsInput struct {
// The streaming distribution's configuration information.
//
// StreamingDistributionConfigWithTags is a required field
StreamingDistributionConfigWithTags *StreamingDistributionConfigWithTags `locationName:"StreamingDistributionConfigWithTags" type:"structure" required:"true"`
StreamingDistributionConfigWithTags *StreamingDistributionConfigWithTags `locationName:"StreamingDistributionConfigWithTags" type:"structure" required:"true" xmlURI:"http://cloudfront.amazonaws.com/doc/2017-03-25/"`
}
// String returns the string representation
@ -8696,7 +8745,7 @@ type S3OriginConfig struct {
// objects in an Amazon S3 bucket through CloudFront. The format of the value
// is:
//
// origin-access-identity/CloudFront/ID-of-origin-access-identity
// origin-access-identity/cloudfront/ID-of-origin-access-identity
//
// where ID-of-origin-access-identity is the value that CloudFront returned
// in the ID element when you created the origin access identity.
@ -9526,7 +9575,7 @@ type TagResourceInput struct {
// A complex type that contains zero or more Tag elements.
//
// Tags is a required field
Tags *Tags `locationName:"Tags" type:"structure" required:"true"`
Tags *Tags `locationName:"Tags" type:"structure" required:"true" xmlURI:"http://cloudfront.amazonaws.com/doc/2017-03-25/"`
}
// String returns the string representation
@ -9727,7 +9776,7 @@ type UntagResourceInput struct {
// A complex type that contains zero or more Tag key elements.
//
// TagKeys is a required field
TagKeys *TagKeys `locationName:"TagKeys" type:"structure" required:"true"`
TagKeys *TagKeys `locationName:"TagKeys" type:"structure" required:"true" xmlURI:"http://cloudfront.amazonaws.com/doc/2017-03-25/"`
}
// String returns the string representation
@ -9791,7 +9840,7 @@ type UpdateCloudFrontOriginAccessIdentityInput struct {
// The identity's configuration information.
//
// CloudFrontOriginAccessIdentityConfig is a required field
CloudFrontOriginAccessIdentityConfig *OriginAccessIdentityConfig `locationName:"CloudFrontOriginAccessIdentityConfig" type:"structure" required:"true"`
CloudFrontOriginAccessIdentityConfig *OriginAccessIdentityConfig `locationName:"CloudFrontOriginAccessIdentityConfig" type:"structure" required:"true" xmlURI:"http://cloudfront.amazonaws.com/doc/2017-03-25/"`
// The identity's id.
//
@ -9894,7 +9943,7 @@ type UpdateDistributionInput struct {
// The distribution's configuration information.
//
// DistributionConfig is a required field
DistributionConfig *DistributionConfig `locationName:"DistributionConfig" type:"structure" required:"true"`
DistributionConfig *DistributionConfig `locationName:"DistributionConfig" type:"structure" required:"true" xmlURI:"http://cloudfront.amazonaws.com/doc/2017-03-25/"`
// The distribution's id.
//
@ -10006,7 +10055,7 @@ type UpdateStreamingDistributionInput struct {
// The streaming distribution's configuration information.
//
// StreamingDistributionConfig is a required field
StreamingDistributionConfig *StreamingDistributionConfig `locationName:"StreamingDistributionConfig" type:"structure" required:"true"`
StreamingDistributionConfig *StreamingDistributionConfig `locationName:"StreamingDistributionConfig" type:"structure" required:"true" xmlURI:"http://cloudfront.amazonaws.com/doc/2017-03-25/"`
}
// String returns the string representation

File diff suppressed because it is too large Load Diff

View File

@ -4,16 +4,16 @@
// requests to Amazon CloudWatch.
//
// Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the
// applications you run on AWS in real-time. You can use CloudWatch to collect
// applications you run on AWS in real time. You can use CloudWatch to collect
// and track metrics, which are the variables you want to measure for your resources
// and applications.
//
// CloudWatch alarms send notifications or automatically make changes to the
// resources you are monitoring based on rules that you define. For example,
// you can monitor the CPU usage and disk reads and writes of your Amazon Elastic
// Compute Cloud (Amazon EC2) instances and then use this data to determine
// whether you should launch additional instances to handle increased load.
// You can also use this data to stop under-used instances to save money.
// CloudWatch alarms send notifications or automatically change the resources
// you are monitoring based on rules that you define. For example, you can monitor
// the CPU usage and disk reads and writes of your Amazon EC2 instances. Then,
// use this data to determine whether you should launch additional instances
// to handle increased load. You can also use this data to stop under-used instances
// to save money.
//
// In addition to monitoring the built-in metrics that come with AWS, you can
// monitor your own custom metrics. With CloudWatch, you gain system-wide visibility

View File

@ -4,6 +4,18 @@ package cloudwatch
const (
// ErrCodeDashboardInvalidInputError for service response error code
// "InvalidParameterInput".
//
// Some part of the dashboard data is invalid.
ErrCodeDashboardInvalidInputError = "InvalidParameterInput"
// ErrCodeDashboardNotFoundError for service response error code
// "ResourceNotFound".
//
// The specified dashboard does not exist.
ErrCodeDashboardNotFoundError = "ResourceNotFound"
// ErrCodeInternalServiceFault for service response error code
// "InternalServiceError".
//
@ -25,7 +37,7 @@ const (
// ErrCodeInvalidParameterCombinationException for service response error code
// "InvalidParameterCombination".
//
// Parameters that cannot be used together were used together.
// Parameters were used together that cannot be used together.
ErrCodeInvalidParameterCombinationException = "InvalidParameterCombination"
// ErrCodeInvalidParameterValueException for service response error code

View File

@ -104,6 +104,91 @@ func (c *CloudWatchEvents) DeleteRuleWithContext(ctx aws.Context, input *DeleteR
return out, req.Send()
}
const opDescribeEventBus = "DescribeEventBus"
// DescribeEventBusRequest generates a "aws/request.Request" representing the
// client's request for the DescribeEventBus operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See DescribeEventBus for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the DescribeEventBus method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the DescribeEventBusRequest method.
// req, resp := client.DescribeEventBusRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeEventBus
func (c *CloudWatchEvents) DescribeEventBusRequest(input *DescribeEventBusInput) (req *request.Request, output *DescribeEventBusOutput) {
op := &request.Operation{
Name: opDescribeEventBus,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeEventBusInput{}
}
output = &DescribeEventBusOutput{}
req = c.newRequest(op, input, output)
return
}
// DescribeEventBus API operation for Amazon CloudWatch Events.
//
// Displays the external AWS accounts that are permitted to write events to
// your account using your account's event bus, and the associated policy. To
// enable your account to receive events from other accounts, use PutPermission.
//
// 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 CloudWatch Events's
// API operation DescribeEventBus for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// An entity that you specified does not exist.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeEventBus
func (c *CloudWatchEvents) DescribeEventBus(input *DescribeEventBusInput) (*DescribeEventBusOutput, error) {
req, out := c.DescribeEventBusRequest(input)
return out, req.Send()
}
// DescribeEventBusWithContext is the same as DescribeEventBus with the addition of
// the ability to pass a context and additional request options.
//
// See DescribeEventBus 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 *CloudWatchEvents) DescribeEventBusWithContext(ctx aws.Context, input *DescribeEventBusInput, opts ...request.Option) (*DescribeEventBusOutput, error) {
req, out := c.DescribeEventBusRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDescribeRule = "DescribeRule"
// DescribeRuleRequest generates a "aws/request.Request" representing the
@ -160,7 +245,7 @@ func (c *CloudWatchEvents) DescribeRuleRequest(input *DescribeRuleInput) (req *r
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The rule does not exist.
// An entity that you specified does not exist.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
@ -249,7 +334,7 @@ func (c *CloudWatchEvents) DisableRuleRequest(input *DisableRuleInput) (req *req
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The rule does not exist.
// An entity that you specified does not exist.
//
// * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target.
@ -341,7 +426,7 @@ func (c *CloudWatchEvents) EnableRuleRequest(input *EnableRuleInput) (req *reque
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The rule does not exist.
// An entity that you specified does not exist.
//
// * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target.
@ -589,7 +674,7 @@ func (c *CloudWatchEvents) ListTargetsByRuleRequest(input *ListTargetsByRuleInpu
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The rule does not exist.
// An entity that you specified does not exist.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
@ -697,6 +782,103 @@ func (c *CloudWatchEvents) PutEventsWithContext(ctx aws.Context, input *PutEvent
return out, req.Send()
}
const opPutPermission = "PutPermission"
// PutPermissionRequest generates a "aws/request.Request" representing the
// client's request for the PutPermission operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See PutPermission for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the PutPermission method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the PutPermissionRequest method.
// req, resp := client.PutPermissionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutPermission
func (c *CloudWatchEvents) PutPermissionRequest(input *PutPermissionInput) (req *request.Request, output *PutPermissionOutput) {
op := &request.Operation{
Name: opPutPermission,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutPermissionInput{}
}
output = &PutPermissionOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// PutPermission API operation for Amazon CloudWatch Events.
//
// Running PutPermission permits the specified AWS account to put events to
// your account's default event bus. CloudWatch Events rules in your account
// are triggered by these events arriving to your default event bus.
//
// For another account to send events to your account, that external account
// must have a CloudWatch Events rule with your account's default event bus
// as a target.
//
// To enable multiple AWS accounts to put events to your default event bus,
// run PutPermission once for each of these accounts.
//
// 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 CloudWatch Events's
// API operation PutPermission for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// An entity that you specified does not exist.
//
// * ErrCodePolicyLengthExceededException "PolicyLengthExceededException"
// The event bus policy is too long. For more information, see the limits.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutPermission
func (c *CloudWatchEvents) PutPermission(input *PutPermissionInput) (*PutPermissionOutput, error) {
req, out := c.PutPermissionRequest(input)
return out, req.Send()
}
// PutPermissionWithContext is the same as PutPermission with the addition of
// the ability to pass a context and additional request options.
//
// See PutPermission 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 *CloudWatchEvents) PutPermissionWithContext(ctx aws.Context, input *PutPermissionInput, opts ...request.Option) (*PutPermissionOutput, error) {
req, out := c.PutPermissionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opPutRule = "PutRule"
// PutRuleRequest generates a "aws/request.Request" representing the
@ -850,9 +1032,26 @@ func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) (req *reque
// Adds the specified targets to the specified rule, or updates the targets
// if they are already associated with the rule.
//
// Targets are the resources that are invoked when a rule is triggered. Example
// targets include EC2 instances, AWS Lambda functions, Amazon Kinesis streams,
// Amazon ECS tasks, AWS Step Functions state machines, and built-in targets.
// Targets are the resources that are invoked when a rule is triggered.
//
// You can configure the following as targets for CloudWatch Events:
//
// * EC2 instances
//
// * AWS Lambda functions
//
// * Streams in Amazon Kinesis Streams
//
// * Delivery streams in Amazon Kinesis Firehose
//
// * Amazon ECS tasks
//
// * AWS Step Functions state machines
//
// * Amazon SNS topics
//
// * Amazon SQS queues
//
// Note that creating rules with built-in targets is supported only in the AWS
// Management Console.
//
@ -866,10 +1065,16 @@ func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) (req *reque
// Events needs the appropriate permissions. For AWS Lambda and Amazon SNS resources,
// CloudWatch Events relies on resource-based policies. For EC2 instances, Amazon
// Kinesis streams, and AWS Step Functions state machines, CloudWatch Events
// relies on IAM roles that you specify in the RoleARN argument in PutTarget.
// relies on IAM roles that you specify in the RoleARN argument in PutTargets.
// For more information, see Authentication and Access Control (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/auth-and-access-control-cwe.html)
// in the Amazon CloudWatch Events User Guide.
//
// If another AWS account is in the same region and has granted you permission
// (using PutPermission), you can set that account's event bus as a target of
// the rules in your account. To send the matched events to the other account,
// specify that account's event bus as the Arn when you run PutTargets. For
// more information about enabling cross-account events, see PutPermission.
//
// Input, InputPath and InputTransformer are mutually exclusive and optional
// parameters of a target. When a rule is triggered due to a matched event:
//
@ -910,7 +1115,7 @@ func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) (req *reque
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The rule does not exist.
// An entity that you specified does not exist.
//
// * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target.
@ -943,6 +1148,94 @@ func (c *CloudWatchEvents) PutTargetsWithContext(ctx aws.Context, input *PutTarg
return out, req.Send()
}
const opRemovePermission = "RemovePermission"
// RemovePermissionRequest generates a "aws/request.Request" representing the
// client's request for the RemovePermission operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See RemovePermission for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the RemovePermission method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the RemovePermissionRequest method.
// req, resp := client.RemovePermissionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemovePermission
func (c *CloudWatchEvents) RemovePermissionRequest(input *RemovePermissionInput) (req *request.Request, output *RemovePermissionOutput) {
op := &request.Operation{
Name: opRemovePermission,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &RemovePermissionInput{}
}
output = &RemovePermissionOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// RemovePermission API operation for Amazon CloudWatch Events.
//
// Revokes the permission of another AWS account to be able to put events to
// your default event bus. Specify the account to revoke by the StatementId
// value that you associated with the account when you granted it permission
// with PutPermission. You can find the StatementId by using DescribeEventBus.
//
// 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 CloudWatch Events's
// API operation RemovePermission for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// An entity that you specified does not exist.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemovePermission
func (c *CloudWatchEvents) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) {
req, out := c.RemovePermissionRequest(input)
return out, req.Send()
}
// RemovePermissionWithContext is the same as RemovePermission with the addition of
// the ability to pass a context and additional request options.
//
// See RemovePermission 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 *CloudWatchEvents) RemovePermissionWithContext(ctx aws.Context, input *RemovePermissionInput, opts ...request.Option) (*RemovePermissionOutput, error) {
req, out := c.RemovePermissionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opRemoveTargets = "RemoveTargets"
// RemoveTargetsRequest generates a "aws/request.Request" representing the
@ -1009,7 +1302,7 @@ func (c *CloudWatchEvents) RemoveTargetsRequest(input *RemoveTargetsInput) (req
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The rule does not exist.
// An entity that you specified does not exist.
//
// * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target.
@ -1184,6 +1477,64 @@ func (s DeleteRuleOutput) GoString() string {
return s.String()
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeEventBusRequest
type DescribeEventBusInput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s DescribeEventBusInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DescribeEventBusInput) GoString() string {
return s.String()
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeEventBusResponse
type DescribeEventBusOutput struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of the account permitted to write events to
// the current account.
Arn *string `type:"string"`
// The name of the event bus. Currently, this is always default.
Name *string `type:"string"`
// The policy that enables the external account to send events to your account.
Policy *string `type:"string"`
}
// String returns the string representation
func (s DescribeEventBusOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DescribeEventBusOutput) GoString() string {
return s.String()
}
// SetArn sets the Arn field's value.
func (s *DescribeEventBusOutput) SetArn(v string) *DescribeEventBusOutput {
s.Arn = &v
return s
}
// SetName sets the Name field's value.
func (s *DescribeEventBusOutput) SetName(v string) *DescribeEventBusOutput {
s.Name = &v
return s
}
// SetPolicy sets the Policy field's value.
func (s *DescribeEventBusOutput) SetPolicy(v string) *DescribeEventBusOutput {
s.Policy = &v
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeRuleRequest
type DescribeRuleInput struct {
_ struct{} `type:"structure"`
@ -2058,6 +2409,108 @@ func (s *PutEventsResultEntry) SetEventId(v string) *PutEventsResultEntry {
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutPermissionRequest
type PutPermissionInput struct {
_ struct{} `type:"structure"`
// The action that you are enabling the other account to perform. Currently,
// this must be events:PutEvents.
//
// Action is a required field
Action *string `min:"1" type:"string" required:"true"`
// The 12-digit AWS account ID that you are permitting to put events to your
// default event bus. Specify "*" to permit any account to put events to your
// default event bus.
//
// If you specify "*", avoid creating rules that may match undesirable events.
// To create more secure rules, make sure that the event pattern for each rule
// contains an account field with a specific account ID from which to receive
// events. Rules with an account field do not match any events sent from other
// accounts.
//
// Principal is a required field
Principal *string `min:"1" type:"string" required:"true"`
// An identifier string for the external account that you are granting permissions
// to. If you later want to revoke the permission for this external account,
// specify this StatementId when you run RemovePermission.
//
// StatementId is a required field
StatementId *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s PutPermissionInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s PutPermissionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutPermissionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutPermissionInput"}
if s.Action == nil {
invalidParams.Add(request.NewErrParamRequired("Action"))
}
if s.Action != nil && len(*s.Action) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Action", 1))
}
if s.Principal == nil {
invalidParams.Add(request.NewErrParamRequired("Principal"))
}
if s.Principal != nil && len(*s.Principal) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Principal", 1))
}
if s.StatementId == nil {
invalidParams.Add(request.NewErrParamRequired("StatementId"))
}
if s.StatementId != nil && len(*s.StatementId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StatementId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetAction sets the Action field's value.
func (s *PutPermissionInput) SetAction(v string) *PutPermissionInput {
s.Action = &v
return s
}
// SetPrincipal sets the Principal field's value.
func (s *PutPermissionInput) SetPrincipal(v string) *PutPermissionInput {
s.Principal = &v
return s
}
// SetStatementId sets the StatementId field's value.
func (s *PutPermissionInput) SetStatementId(v string) *PutPermissionInput {
s.StatementId = &v
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutPermissionOutput
type PutPermissionOutput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s PutPermissionOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s PutPermissionOutput) GoString() string {
return s.String()
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutRuleRequest
type PutRuleInput struct {
_ struct{} `type:"structure"`
@ -2077,7 +2530,7 @@ type PutRuleInput struct {
// The Amazon Resource Name (ARN) of the IAM role associated with the rule.
RoleArn *string `min:"1" type:"string"`
// The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".
// The scheduling expression. For example, "cron(0 20 * * ? *)" or "rate(5 minutes)".
ScheduleExpression *string `type:"string"`
// Indicates whether the rule is enabled or disabled.
@ -2320,6 +2773,64 @@ func (s *PutTargetsResultEntry) SetTargetId(v string) *PutTargetsResultEntry {
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemovePermissionRequest
type RemovePermissionInput struct {
_ struct{} `type:"structure"`
// The statement ID corresponding to the account that is no longer allowed to
// put events to the default event bus.
//
// StatementId is a required field
StatementId *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s RemovePermissionInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s RemovePermissionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RemovePermissionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RemovePermissionInput"}
if s.StatementId == nil {
invalidParams.Add(request.NewErrParamRequired("StatementId"))
}
if s.StatementId != nil && len(*s.StatementId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StatementId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetStatementId sets the StatementId field's value.
func (s *RemovePermissionInput) SetStatementId(v string) *RemovePermissionInput {
s.StatementId = &v
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemovePermissionOutput
type RemovePermissionOutput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s RemovePermissionOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s RemovePermissionOutput) GoString() string {
return s.String()
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemoveTargetsRequest
type RemoveTargetsInput struct {
_ struct{} `type:"structure"`

View File

@ -28,9 +28,15 @@ const (
// You tried to create more rules or add more targets to a rule than is allowed.
ErrCodeLimitExceededException = "LimitExceededException"
// ErrCodePolicyLengthExceededException for service response error code
// "PolicyLengthExceededException".
//
// The event bus policy is too long. For more information, see the limits.
ErrCodePolicyLengthExceededException = "PolicyLengthExceededException"
// ErrCodeResourceNotFoundException for service response error code
// "ResourceNotFoundException".
//
// The rule does not exist.
// An entity that you specified does not exist.
ErrCodeResourceNotFoundException = "ResourceNotFoundException"
)

View File

@ -1451,7 +1451,7 @@ type CreateProjectInput struct {
// How long, in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait
// until timing out any build that has not been marked as completed. The default
// is 60 minutes.
TimeoutInMinutes *int64 `locationName:"timeoutInMinutes" min:"1" type:"integer"`
TimeoutInMinutes *int64 `locationName:"timeoutInMinutes" min:"5" type:"integer"`
}
// String returns the string representation
@ -1488,8 +1488,8 @@ func (s *CreateProjectInput) Validate() error {
if s.Source == nil {
invalidParams.Add(request.NewErrParamRequired("Source"))
}
if s.TimeoutInMinutes != nil && *s.TimeoutInMinutes < 1 {
invalidParams.Add(request.NewErrParamMinValue("TimeoutInMinutes", 1))
if s.TimeoutInMinutes != nil && *s.TimeoutInMinutes < 5 {
invalidParams.Add(request.NewErrParamMinValue("TimeoutInMinutes", 5))
}
if s.Artifacts != nil {
if err := s.Artifacts.Validate(); err != nil {
@ -1774,6 +1774,11 @@ type EnvironmentVariable struct {
// The value of the environment variable.
//
// We strongly discourage using environment variables to store sensitive values,
// especially AWS secret key IDs and secret access keys. Environment variables
// can be displayed in plain text using tools such as the AWS CodeBuild console
// and the AWS Command Line Interface (AWS CLI).
//
// Value is a required field
Value *string `locationName:"value" type:"string" required:"true"`
}
@ -2287,7 +2292,7 @@ type Project struct {
// How long, in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait
// before timing out any related build that did not get marked as completed.
// The default is 60 minutes.
TimeoutInMinutes *int64 `locationName:"timeoutInMinutes" min:"1" type:"integer"`
TimeoutInMinutes *int64 `locationName:"timeoutInMinutes" min:"5" type:"integer"`
}
// String returns the string representation
@ -2563,6 +2568,23 @@ type ProjectEnvironment struct {
// Image is a required field
Image *string `locationName:"image" min:"1" type:"string" required:"true"`
// If set to true, enables running the Docker daemon inside a Docker container;
// otherwise, false or not specified (the default). This value must be set to
// true only if this build project will be used to build Docker images, and
// the specified build environment image is not one provided by AWS CodeBuild
// with Docker support. Otherwise, all associated builds that attempt to interact
// with the Docker daemon will fail. Note that you must also start the Docker
// daemon so that your builds can interact with it as needed. One way to do
// this is to initialize the Docker daemon in the install phase of your build
// spec by running the following build commands. (Do not run the following build
// commands if the specified build environment image is provided by AWS CodeBuild
// with Docker support.)
//
// - nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375
// --storage-driver=vfs& - timeout -t 15 sh -c "until docker info; do echo .;
// sleep 1; done"
PrivilegedMode *bool `locationName:"privilegedMode" type:"boolean"`
// The type of build environment to use for related builds.
//
// Type is a required field
@ -2629,6 +2651,12 @@ func (s *ProjectEnvironment) SetImage(v string) *ProjectEnvironment {
return s
}
// SetPrivilegedMode sets the PrivilegedMode field's value.
func (s *ProjectEnvironment) SetPrivilegedMode(v bool) *ProjectEnvironment {
s.PrivilegedMode = &v
return s
}
// SetType sets the Type field's value.
func (s *ProjectEnvironment) SetType(v string) *ProjectEnvironment {
s.Type = &v
@ -2673,12 +2701,15 @@ type ProjectSource struct {
// * For source code in a GitHub repository, the HTTPS clone URL to the repository
// that contains the source and the build spec. Also, you must connect your
// AWS account to your GitHub account. To do this, use the AWS CodeBuild
// console to begin creating a build project, and follow the on-screen instructions
// to complete the connection. (After you have connected to your GitHub account,
// you do not need to finish creating the build project, and you may then
// leave the AWS CodeBuild console.) To instruct AWS CodeBuild to then use
// this connection, in the source object, set the auth object's type value
// to OAUTH.
// console to begin creating a build project. When you use the console to
// connect (or reconnect) with GitHub, on the GitHub Authorize application
// page that displays, for Organization access, choose Request access next
// to each repository you want to allow AWS CodeBuild to have access to.
// Then choose Authorize application. (After you have connected to your GitHub
// account, you do not need to finish creating the build project, and you
// may then leave the AWS CodeBuild console.) To instruct AWS CodeBuild to
// then use this connection, in the source object, set the auth object's
// type value to OAUTH.
Location *string `locationName:"location" type:"string"`
// The type of repository that contains the source code to be built. Valid values
@ -2837,7 +2868,7 @@ type StartBuildInput struct {
// The number of build timeout minutes, from 5 to 480 (8 hours), that overrides,
// for this build only, the latest setting already defined in the build project.
TimeoutInMinutesOverride *int64 `locationName:"timeoutInMinutesOverride" min:"1" type:"integer"`
TimeoutInMinutesOverride *int64 `locationName:"timeoutInMinutesOverride" min:"5" type:"integer"`
}
// String returns the string representation
@ -2859,8 +2890,8 @@ func (s *StartBuildInput) Validate() error {
if s.ProjectName != nil && len(*s.ProjectName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ProjectName", 1))
}
if s.TimeoutInMinutesOverride != nil && *s.TimeoutInMinutesOverride < 1 {
invalidParams.Add(request.NewErrParamMinValue("TimeoutInMinutesOverride", 1))
if s.TimeoutInMinutesOverride != nil && *s.TimeoutInMinutesOverride < 5 {
invalidParams.Add(request.NewErrParamMinValue("TimeoutInMinutesOverride", 5))
}
if s.ArtifactsOverride != nil {
if err := s.ArtifactsOverride.Validate(); err != nil {
@ -3107,7 +3138,7 @@ type UpdateProjectInput struct {
// The replacement value in minutes, from 5 to 480 (8 hours), for AWS CodeBuild
// to wait before timing out any related build that did not get marked as completed.
TimeoutInMinutes *int64 `locationName:"timeoutInMinutes" min:"1" type:"integer"`
TimeoutInMinutes *int64 `locationName:"timeoutInMinutes" min:"5" type:"integer"`
}
// String returns the string representation
@ -3135,8 +3166,8 @@ func (s *UpdateProjectInput) Validate() error {
if s.ServiceRole != nil && len(*s.ServiceRole) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ServiceRole", 1))
}
if s.TimeoutInMinutes != nil && *s.TimeoutInMinutes < 1 {
invalidParams.Add(request.NewErrParamMinValue("TimeoutInMinutes", 1))
if s.TimeoutInMinutes != nil && *s.TimeoutInMinutes < 5 {
invalidParams.Add(request.NewErrParamMinValue("TimeoutInMinutes", 5))
}
if s.Artifacts != nil {
if err := s.Artifacts.Validate(); err != nil {

View File

@ -1249,6 +1249,93 @@ func (c *CodePipeline) ListActionTypesWithContext(ctx aws.Context, input *ListAc
return out, req.Send()
}
const opListPipelineExecutions = "ListPipelineExecutions"
// ListPipelineExecutionsRequest generates a "aws/request.Request" representing the
// client's request for the ListPipelineExecutions operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See ListPipelineExecutions for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the ListPipelineExecutions method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the ListPipelineExecutionsRequest method.
// req, resp := client.ListPipelineExecutionsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListPipelineExecutions
func (c *CodePipeline) ListPipelineExecutionsRequest(input *ListPipelineExecutionsInput) (req *request.Request, output *ListPipelineExecutionsOutput) {
op := &request.Operation{
Name: opListPipelineExecutions,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &ListPipelineExecutionsInput{}
}
output = &ListPipelineExecutionsOutput{}
req = c.newRequest(op, input, output)
return
}
// ListPipelineExecutions API operation for AWS CodePipeline.
//
// Gets a summary of the most recent executions for a pipeline.
//
// 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 AWS CodePipeline's
// API operation ListPipelineExecutions for usage and error information.
//
// Returned Error Codes:
// * ErrCodeValidationException "ValidationException"
// The validation was specified in an invalid format.
//
// * ErrCodePipelineNotFoundException "PipelineNotFoundException"
// The specified pipeline was specified in an invalid format or cannot be found.
//
// * ErrCodeInvalidNextTokenException "InvalidNextTokenException"
// The next token was specified in an invalid format. Make sure that the next
// token you provided is the token returned by a previous call.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListPipelineExecutions
func (c *CodePipeline) ListPipelineExecutions(input *ListPipelineExecutionsInput) (*ListPipelineExecutionsOutput, error) {
req, out := c.ListPipelineExecutionsRequest(input)
return out, req.Send()
}
// ListPipelineExecutionsWithContext is the same as ListPipelineExecutions with the addition of
// the ability to pass a context and additional request options.
//
// See ListPipelineExecutions 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 *CodePipeline) ListPipelineExecutionsWithContext(ctx aws.Context, input *ListPipelineExecutionsInput, opts ...request.Option) (*ListPipelineExecutionsOutput, error) {
req, out := c.ListPipelineExecutionsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opListPipelines = "ListPipelines"
// ListPipelinesRequest generates a "aws/request.Request" representing the
@ -3624,9 +3711,7 @@ func (s *ArtifactRevision) SetRevisionUrl(v string) *ArtifactRevision {
return s
}
// The Amazon S3 location where artifacts are stored for the pipeline. If this
// Amazon S3 bucket is created manually, it must meet the requirements for AWS
// CodePipeline. For more information, see the Concepts (http://docs.aws.amazon.com/codepipeline/latest/userguide/concepts.html#CPS3Bucket).
// The Amazon S3 bucket where artifacts are stored for the pipeline.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ArtifactStore
type ArtifactStore struct {
_ struct{} `type:"structure"`
@ -3636,8 +3721,11 @@ type ArtifactStore struct {
// key for Amazon S3 is used.
EncryptionKey *EncryptionKey `locationName:"encryptionKey" type:"structure"`
// The location for storing the artifacts for a pipeline, such as an S3 bucket
// or folder.
// The Amazon S3 bucket used for storing the artifacts for a pipeline. You can
// specify the name of an S3 bucket but not a folder within the bucket. A folder
// to contain the pipeline artifacts is created for you based on the name of
// the pipeline. You can use any Amazon S3 bucket in the same AWS Region as
// the pipeline to store your pipeline artifacts.
//
// Location is a required field
Location *string `locationName:"location" min:"3" type:"string" required:"true"`
@ -3778,12 +3866,12 @@ type CreateCustomActionTypeInput struct {
// see Create a Custom Action for a Pipeline (http://docs.aws.amazon.com/codepipeline/latest/userguide/how-to-create-custom-action.html).
ConfigurationProperties []*ActionConfigurationProperty `locationName:"configurationProperties" type:"list"`
// Returns information about the details of an artifact.
// The details of the input artifact for the action, such as its commit ID.
//
// InputArtifactDetails is a required field
InputArtifactDetails *ArtifactDetails `locationName:"inputArtifactDetails" type:"structure" required:"true"`
// Returns information about the details of an artifact.
// The details of the output artifact of the action, such as its commit ID.
//
// OutputArtifactDetails is a required field
OutputArtifactDetails *ArtifactDetails `locationName:"outputArtifactDetails" type:"structure" required:"true"`
@ -5400,6 +5488,111 @@ func (s *ListActionTypesOutput) SetNextToken(v string) *ListActionTypesOutput {
return s
}
// Represents the input of a list pipeline executions action.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListPipelineExecutionsInput
type ListPipelineExecutionsInput struct {
_ struct{} `type:"structure"`
// The maximum number of results to return in a single call. To retrieve the
// remaining results, make another call with the returned nextToken value. The
// available pipeline execution history is limited to the most recent 12 months,
// based on pipeline execution start times. Default value is 100.
MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"`
// The token that was returned from the previous list pipeline executions call,
// which can be used to return the next set of pipeline executions in the list.
NextToken *string `locationName:"nextToken" type:"string"`
// The name of the pipeline for which you want to get execution summary information.
//
// PipelineName is a required field
PipelineName *string `locationName:"pipelineName" min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s ListPipelineExecutionsInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ListPipelineExecutionsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListPipelineExecutionsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListPipelineExecutionsInput"}
if s.MaxResults != nil && *s.MaxResults < 1 {
invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
}
if s.PipelineName == nil {
invalidParams.Add(request.NewErrParamRequired("PipelineName"))
}
if s.PipelineName != nil && len(*s.PipelineName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("PipelineName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetMaxResults sets the MaxResults field's value.
func (s *ListPipelineExecutionsInput) SetMaxResults(v int64) *ListPipelineExecutionsInput {
s.MaxResults = &v
return s
}
// SetNextToken sets the NextToken field's value.
func (s *ListPipelineExecutionsInput) SetNextToken(v string) *ListPipelineExecutionsInput {
s.NextToken = &v
return s
}
// SetPipelineName sets the PipelineName field's value.
func (s *ListPipelineExecutionsInput) SetPipelineName(v string) *ListPipelineExecutionsInput {
s.PipelineName = &v
return s
}
// Represents the output of a list pipeline executions action.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListPipelineExecutionsOutput
type ListPipelineExecutionsOutput struct {
_ struct{} `type:"structure"`
// A token that can be used in the next list pipeline executions call to return
// the next set of pipeline executions. To view all items in the list, continue
// to call this operation with each subsequent token until no more nextToken
// values are returned.
NextToken *string `locationName:"nextToken" type:"string"`
// A list of executions in the history of a pipeline.
PipelineExecutionSummaries []*PipelineExecutionSummary `locationName:"pipelineExecutionSummaries" type:"list"`
}
// String returns the string representation
func (s ListPipelineExecutionsOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ListPipelineExecutionsOutput) GoString() string {
return s.String()
}
// SetNextToken sets the NextToken field's value.
func (s *ListPipelineExecutionsOutput) SetNextToken(v string) *ListPipelineExecutionsOutput {
s.NextToken = &v
return s
}
// SetPipelineExecutionSummaries sets the PipelineExecutionSummaries field's value.
func (s *ListPipelineExecutionsOutput) SetPipelineExecutionSummaries(v []*PipelineExecutionSummary) *ListPipelineExecutionsOutput {
s.PipelineExecutionSummaries = v
return s
}
// Represents the input of a list pipelines action.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListPipelinesInput
type ListPipelinesInput struct {
@ -5563,9 +5756,8 @@ func (s *PipelineContext) SetStage(v *StageContext) *PipelineContext {
type PipelineDeclaration struct {
_ struct{} `type:"structure"`
// The Amazon S3 location where artifacts are stored for the pipeline. If this
// Amazon S3 bucket is created manually, it must meet the requirements for AWS
// CodePipeline. For more information, see the Concepts (http://docs.aws.amazon.com/codepipeline/latest/userguide/concepts.html#CPS3Bucket).
// Represents the context of an action within the stage of a pipeline to a job
// worker.
//
// ArtifactStore is a required field
ArtifactStore *ArtifactStore `locationName:"artifactStore" type:"structure" required:"true"`
@ -5702,7 +5894,7 @@ type PipelineExecution struct {
// to be completed, a newer pipeline execution caught up and continued through
// the pipeline instead.
//
// * Failed: The pipeline did not complete successfully.
// * Failed: The pipeline execution did not complete successfully.
Status *string `locationName:"status" type:"string" enum:"PipelineExecutionStatus"`
}
@ -5746,6 +5938,69 @@ func (s *PipelineExecution) SetStatus(v string) *PipelineExecution {
return s
}
// Summary information about a pipeline execution.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PipelineExecutionSummary
type PipelineExecutionSummary struct {
_ struct{} `type:"structure"`
// The date and time of the last change to the pipeline execution, in timestamp
// format.
LastUpdateTime *time.Time `locationName:"lastUpdateTime" type:"timestamp" timestampFormat:"unix"`
// The ID of the pipeline execution.
PipelineExecutionId *string `locationName:"pipelineExecutionId" type:"string"`
// The date and time when the pipeline execution began, in timestamp format.
StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"unix"`
// The status of the pipeline execution.
//
// * InProgress: The pipeline execution is currently running.
//
// * Succeeded: The pipeline execution completed successfully.
//
// * Superseded: While this pipeline execution was waiting for the next stage
// to be completed, a newer pipeline execution caught up and continued through
// the pipeline instead.
//
// * Failed: The pipeline execution did not complete successfully.
Status *string `locationName:"status" type:"string" enum:"PipelineExecutionStatus"`
}
// String returns the string representation
func (s PipelineExecutionSummary) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s PipelineExecutionSummary) GoString() string {
return s.String()
}
// SetLastUpdateTime sets the LastUpdateTime field's value.
func (s *PipelineExecutionSummary) SetLastUpdateTime(v time.Time) *PipelineExecutionSummary {
s.LastUpdateTime = &v
return s
}
// SetPipelineExecutionId sets the PipelineExecutionId field's value.
func (s *PipelineExecutionSummary) SetPipelineExecutionId(v string) *PipelineExecutionSummary {
s.PipelineExecutionId = &v
return s
}
// SetStartTime sets the StartTime field's value.
func (s *PipelineExecutionSummary) SetStartTime(v time.Time) *PipelineExecutionSummary {
s.StartTime = &v
return s
}
// SetStatus sets the Status field's value.
func (s *PipelineExecutionSummary) SetStatus(v string) *PipelineExecutionSummary {
s.Status = &v
return s
}
// Returns a summary of a pipeline.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PipelineSummary
type PipelineSummary struct {

View File

@ -6605,4 +6605,7 @@ const (
// ResourceTypeAwsRedshiftEventSubscription is a ResourceType enum value
ResourceTypeAwsRedshiftEventSubscription = "AWS::Redshift::EventSubscription"
// ResourceTypeAwsCloudWatchAlarm is a ResourceType enum value
ResourceTypeAwsCloudWatchAlarm = "AWS::CloudWatch::Alarm"
)

View File

@ -558,6 +558,9 @@ func (c *DatabaseMigrationService) CreateReplicationTaskRequest(input *CreateRep
// API operation CreateReplicationTask for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedFault "AccessDeniedFault"
// AWS DMS was denied access to the endpoint.
//
// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault"
// The resource is in a state that prevents it from being used for database
// migration.
@ -7689,6 +7692,9 @@ type ImportCertificateInput struct {
//
// CertificateWallet is automatically base64 encoded/decoded by the SDK.
CertificateWallet []byte `type:"blob"`
// The tags associated with the certificate.
Tags []*Tag `locationNameList:"Tag" type:"list"`
}
// String returns the string representation
@ -7732,6 +7738,12 @@ func (s *ImportCertificateInput) SetCertificateWallet(v []byte) *ImportCertifica
return s
}
// SetTags sets the Tags field's value.
func (s *ImportCertificateInput) SetTags(v []*Tag) *ImportCertificateInput {
s.Tags = v
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ImportCertificateResponse
type ImportCertificateOutput struct {
_ struct{} `type:"structure"`
@ -9926,6 +9938,14 @@ type TableStatistics struct {
// The number of delete actions performed on a table.
Deletes *int64 `type:"long"`
// The number of rows that failed conditional checks during the Full Load operation
// (valid only for DynamoDB as a target migrations).
FullLoadCondtnlChkFailedRows *int64 `type:"long"`
// The number of rows that failed to load during the Full Load operation (valid
// only for DynamoDB as a target migrations).
FullLoadErrorRows *int64 `type:"long"`
// The number of rows added during the Full Load operation.
FullLoadRows *int64 `type:"long"`
@ -9970,6 +9990,18 @@ func (s *TableStatistics) SetDeletes(v int64) *TableStatistics {
return s
}
// SetFullLoadCondtnlChkFailedRows sets the FullLoadCondtnlChkFailedRows field's value.
func (s *TableStatistics) SetFullLoadCondtnlChkFailedRows(v int64) *TableStatistics {
s.FullLoadCondtnlChkFailedRows = &v
return s
}
// SetFullLoadErrorRows sets the FullLoadErrorRows field's value.
func (s *TableStatistics) SetFullLoadErrorRows(v int64) *TableStatistics {
s.FullLoadErrorRows = &v
return s
}
// SetFullLoadRows sets the FullLoadRows field's value.
func (s *TableStatistics) SetFullLoadRows(v int64) *TableStatistics {
s.FullLoadRows = &v

View File

@ -1748,6 +1748,157 @@ func (c *DirectoryService) DescribeDirectoriesWithContext(ctx aws.Context, input
return out, req.Send()
}
const opDescribeDomainControllers = "DescribeDomainControllers"
// DescribeDomainControllersRequest generates a "aws/request.Request" representing the
// client's request for the DescribeDomainControllers operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See DescribeDomainControllers for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the DescribeDomainControllers method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the DescribeDomainControllersRequest method.
// req, resp := client.DescribeDomainControllersRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeDomainControllers
func (c *DirectoryService) DescribeDomainControllersRequest(input *DescribeDomainControllersInput) (req *request.Request, output *DescribeDomainControllersOutput) {
op := &request.Operation{
Name: opDescribeDomainControllers,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "Limit",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeDomainControllersInput{}
}
output = &DescribeDomainControllersOutput{}
req = c.newRequest(op, input, output)
return
}
// DescribeDomainControllers API operation for AWS Directory Service.
//
// Provides information about any domain controllers in your directory.
//
// 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 AWS Directory Service's
// API operation DescribeDomainControllers for usage and error information.
//
// Returned Error Codes:
// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException"
// The specified entity could not be found.
//
// * ErrCodeInvalidNextTokenException "InvalidNextTokenException"
// The NextToken value is not valid.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// One or more parameters are not valid.
//
// * ErrCodeClientException "ClientException"
// A client exception has occurred.
//
// * ErrCodeServiceException "ServiceException"
// An exception has occurred in AWS Directory Service.
//
// * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
// The operation is not supported.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeDomainControllers
func (c *DirectoryService) DescribeDomainControllers(input *DescribeDomainControllersInput) (*DescribeDomainControllersOutput, error) {
req, out := c.DescribeDomainControllersRequest(input)
return out, req.Send()
}
// DescribeDomainControllersWithContext is the same as DescribeDomainControllers with the addition of
// the ability to pass a context and additional request options.
//
// See DescribeDomainControllers 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 *DirectoryService) DescribeDomainControllersWithContext(ctx aws.Context, input *DescribeDomainControllersInput, opts ...request.Option) (*DescribeDomainControllersOutput, error) {
req, out := c.DescribeDomainControllersRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// DescribeDomainControllersPages iterates over the pages of a DescribeDomainControllers operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
//
// See DescribeDomainControllers method for more information on how to use this operation.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a DescribeDomainControllers operation.
// pageNum := 0
// err := client.DescribeDomainControllersPages(params,
// func(page *DescribeDomainControllersOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
// })
//
func (c *DirectoryService) DescribeDomainControllersPages(input *DescribeDomainControllersInput, fn func(*DescribeDomainControllersOutput, bool) bool) error {
return c.DescribeDomainControllersPagesWithContext(aws.BackgroundContext(), input, fn)
}
// DescribeDomainControllersPagesWithContext same as DescribeDomainControllersPages except
// it takes a Context and allows setting request options on the pages.
//
// 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 *DirectoryService) DescribeDomainControllersPagesWithContext(ctx aws.Context, input *DescribeDomainControllersInput, fn func(*DescribeDomainControllersOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeDomainControllersInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeDomainControllersRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
cont := true
for p.Next() && cont {
cont = fn(p.Page().(*DescribeDomainControllersOutput), !p.HasNextPage())
}
return p.Err()
}
const opDescribeEventTopics = "DescribeEventTopics"
// DescribeEventTopicsRequest generates a "aws/request.Request" representing the
@ -3411,6 +3562,110 @@ func (c *DirectoryService) UpdateConditionalForwarderWithContext(ctx aws.Context
return out, req.Send()
}
const opUpdateNumberOfDomainControllers = "UpdateNumberOfDomainControllers"
// UpdateNumberOfDomainControllersRequest generates a "aws/request.Request" representing the
// client's request for the UpdateNumberOfDomainControllers operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See UpdateNumberOfDomainControllers for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the UpdateNumberOfDomainControllers method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the UpdateNumberOfDomainControllersRequest method.
// req, resp := client.UpdateNumberOfDomainControllersRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateNumberOfDomainControllers
func (c *DirectoryService) UpdateNumberOfDomainControllersRequest(input *UpdateNumberOfDomainControllersInput) (req *request.Request, output *UpdateNumberOfDomainControllersOutput) {
op := &request.Operation{
Name: opUpdateNumberOfDomainControllers,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &UpdateNumberOfDomainControllersInput{}
}
output = &UpdateNumberOfDomainControllersOutput{}
req = c.newRequest(op, input, output)
return
}
// UpdateNumberOfDomainControllers API operation for AWS Directory Service.
//
// Adds or removes domain controllers to or from the directory. Based on the
// difference between current value and new value (provided through this API
// call), domain controllers will be added or removed. It may take up to 45
// minutes for any new domain controllers to become fully active once the requested
// number of domain controllers is updated. During this time, you cannot make
// another update request.
//
// 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 AWS Directory Service's
// API operation UpdateNumberOfDomainControllers for usage and error information.
//
// Returned Error Codes:
// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException"
// The specified entity could not be found.
//
// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException"
// The specified directory is unavailable or could not be found.
//
// * ErrCodeDomainControllerLimitExceededException "DomainControllerLimitExceededException"
// The maximum allowed number of domain controllers per directory was exceeded.
// The default limit per directory is 20 domain controllers.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// One or more parameters are not valid.
//
// * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
// The operation is not supported.
//
// * ErrCodeClientException "ClientException"
// A client exception has occurred.
//
// * ErrCodeServiceException "ServiceException"
// An exception has occurred in AWS Directory Service.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateNumberOfDomainControllers
func (c *DirectoryService) UpdateNumberOfDomainControllers(input *UpdateNumberOfDomainControllersInput) (*UpdateNumberOfDomainControllersOutput, error) {
req, out := c.UpdateNumberOfDomainControllersRequest(input)
return out, req.Send()
}
// UpdateNumberOfDomainControllersWithContext is the same as UpdateNumberOfDomainControllers with the addition of
// the ability to pass a context and additional request options.
//
// See UpdateNumberOfDomainControllers 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 *DirectoryService) UpdateNumberOfDomainControllersWithContext(ctx aws.Context, input *UpdateNumberOfDomainControllersInput, opts ...request.Option) (*UpdateNumberOfDomainControllersOutput, error) {
req, out := c.UpdateNumberOfDomainControllersRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opUpdateRadius = "UpdateRadius"
// UpdateRadiusRequest generates a "aws/request.Request" representing the
@ -5430,6 +5685,109 @@ func (s *DescribeDirectoriesOutput) SetNextToken(v string) *DescribeDirectoriesO
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeDomainControllersRequest
type DescribeDomainControllersInput struct {
_ struct{} `type:"structure"`
// Identifier of the directory for which to retrieve the domain controller information.
//
// DirectoryId is a required field
DirectoryId *string `type:"string" required:"true"`
// A list of identifiers for the domain controllers whose information will be
// provided.
DomainControllerIds []*string `type:"list"`
// The maximum number of items to return.
Limit *int64 `type:"integer"`
// The DescribeDomainControllers.NextToken value from a previous call to DescribeDomainControllers.
// Pass null if this is the first call.
NextToken *string `type:"string"`
}
// String returns the string representation
func (s DescribeDomainControllersInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DescribeDomainControllersInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeDomainControllersInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeDomainControllersInput"}
if s.DirectoryId == nil {
invalidParams.Add(request.NewErrParamRequired("DirectoryId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetDirectoryId sets the DirectoryId field's value.
func (s *DescribeDomainControllersInput) SetDirectoryId(v string) *DescribeDomainControllersInput {
s.DirectoryId = &v
return s
}
// SetDomainControllerIds sets the DomainControllerIds field's value.
func (s *DescribeDomainControllersInput) SetDomainControllerIds(v []*string) *DescribeDomainControllersInput {
s.DomainControllerIds = v
return s
}
// SetLimit sets the Limit field's value.
func (s *DescribeDomainControllersInput) SetLimit(v int64) *DescribeDomainControllersInput {
s.Limit = &v
return s
}
// SetNextToken sets the NextToken field's value.
func (s *DescribeDomainControllersInput) SetNextToken(v string) *DescribeDomainControllersInput {
s.NextToken = &v
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeDomainControllersResult
type DescribeDomainControllersOutput struct {
_ struct{} `type:"structure"`
// List of the DomainController objects that were retrieved.
DomainControllers []*DomainController `type:"list"`
// If not null, more results are available. Pass this value for the NextToken
// parameter in a subsequent call to DescribeDomainControllers retrieve the
// next set of items.
NextToken *string `type:"string"`
}
// String returns the string representation
func (s DescribeDomainControllersOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DescribeDomainControllersOutput) GoString() string {
return s.String()
}
// SetDomainControllers sets the DomainControllers field's value.
func (s *DescribeDomainControllersOutput) SetDomainControllers(v []*DomainController) *DescribeDomainControllersOutput {
s.DomainControllers = v
return s
}
// SetNextToken sets the NextToken field's value.
func (s *DescribeDomainControllersOutput) SetNextToken(v string) *DescribeDomainControllersOutput {
s.NextToken = &v
return s
}
// Describes event topics.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeEventTopicsRequest
type DescribeEventTopicsInput struct {
@ -5876,6 +6234,10 @@ type DirectoryDescription struct {
// The textual description for the directory.
Description *string `type:"string"`
// The desired number of domain controllers in the directory if the directory
// is Microsoft AD.
DesiredNumberOfDomainControllers *int64 `min:"2" type:"integer"`
// The directory identifier.
DirectoryId *string `type:"string"`
@ -5961,6 +6323,12 @@ func (s *DirectoryDescription) SetDescription(v string) *DirectoryDescription {
return s
}
// SetDesiredNumberOfDomainControllers sets the DesiredNumberOfDomainControllers field's value.
func (s *DirectoryDescription) SetDesiredNumberOfDomainControllers(v int64) *DirectoryDescription {
s.DesiredNumberOfDomainControllers = &v
return s
}
// SetDirectoryId sets the DirectoryId field's value.
func (s *DirectoryDescription) SetDirectoryId(v string) *DirectoryDescription {
s.DirectoryId = &v
@ -6399,6 +6767,112 @@ func (s DisableSsoOutput) GoString() string {
return s.String()
}
// Contains information about the domain controllers for a specified directory.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DomainController
type DomainController struct {
_ struct{} `type:"structure"`
// The Availability Zone where the domain controller is located.
AvailabilityZone *string `type:"string"`
// Identifier of the directory where the domain controller resides.
DirectoryId *string `type:"string"`
// The IP address of the domain controller.
DnsIpAddr *string `type:"string"`
// Identifies a specific domain controller in the directory.
DomainControllerId *string `type:"string"`
// Specifies when the domain controller was created.
LaunchTime *time.Time `type:"timestamp" timestampFormat:"unix"`
// The status of the domain controller.
Status *string `type:"string" enum:"DomainControllerStatus"`
// The date and time that the status was last updated.
StatusLastUpdatedDateTime *time.Time `type:"timestamp" timestampFormat:"unix"`
// A description of the domain controller state.
StatusReason *string `type:"string"`
// Identifier of the subnet in the VPC that contains the domain controller.
SubnetId *string `type:"string"`
// The identifier of the VPC that contains the domain controller.
VpcId *string `type:"string"`
}
// String returns the string representation
func (s DomainController) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DomainController) GoString() string {
return s.String()
}
// SetAvailabilityZone sets the AvailabilityZone field's value.
func (s *DomainController) SetAvailabilityZone(v string) *DomainController {
s.AvailabilityZone = &v
return s
}
// SetDirectoryId sets the DirectoryId field's value.
func (s *DomainController) SetDirectoryId(v string) *DomainController {
s.DirectoryId = &v
return s
}
// SetDnsIpAddr sets the DnsIpAddr field's value.
func (s *DomainController) SetDnsIpAddr(v string) *DomainController {
s.DnsIpAddr = &v
return s
}
// SetDomainControllerId sets the DomainControllerId field's value.
func (s *DomainController) SetDomainControllerId(v string) *DomainController {
s.DomainControllerId = &v
return s
}
// SetLaunchTime sets the LaunchTime field's value.
func (s *DomainController) SetLaunchTime(v time.Time) *DomainController {
s.LaunchTime = &v
return s
}
// SetStatus sets the Status field's value.
func (s *DomainController) SetStatus(v string) *DomainController {
s.Status = &v
return s
}
// SetStatusLastUpdatedDateTime sets the StatusLastUpdatedDateTime field's value.
func (s *DomainController) SetStatusLastUpdatedDateTime(v time.Time) *DomainController {
s.StatusLastUpdatedDateTime = &v
return s
}
// SetStatusReason sets the StatusReason field's value.
func (s *DomainController) SetStatusReason(v string) *DomainController {
s.StatusReason = &v
return s
}
// SetSubnetId sets the SubnetId field's value.
func (s *DomainController) SetSubnetId(v string) *DomainController {
s.SubnetId = &v
return s
}
// SetVpcId sets the VpcId field's value.
func (s *DomainController) SetVpcId(v string) *DomainController {
s.VpcId = &v
return s
}
// Contains the inputs for the EnableRadius operation.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/EnableRadiusRequest
type EnableRadiusInput struct {
@ -8061,6 +8535,78 @@ func (s UpdateConditionalForwarderOutput) GoString() string {
return s.String()
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateNumberOfDomainControllersRequest
type UpdateNumberOfDomainControllersInput struct {
_ struct{} `type:"structure"`
// The number of domain controllers desired in the directory.
//
// DesiredNumber is a required field
DesiredNumber *int64 `min:"2" type:"integer" required:"true"`
// Identifier of the directory to which the domain controllers will be added
// or removed.
//
// DirectoryId is a required field
DirectoryId *string `type:"string" required:"true"`
}
// String returns the string representation
func (s UpdateNumberOfDomainControllersInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s UpdateNumberOfDomainControllersInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateNumberOfDomainControllersInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateNumberOfDomainControllersInput"}
if s.DesiredNumber == nil {
invalidParams.Add(request.NewErrParamRequired("DesiredNumber"))
}
if s.DesiredNumber != nil && *s.DesiredNumber < 2 {
invalidParams.Add(request.NewErrParamMinValue("DesiredNumber", 2))
}
if s.DirectoryId == nil {
invalidParams.Add(request.NewErrParamRequired("DirectoryId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetDesiredNumber sets the DesiredNumber field's value.
func (s *UpdateNumberOfDomainControllersInput) SetDesiredNumber(v int64) *UpdateNumberOfDomainControllersInput {
s.DesiredNumber = &v
return s
}
// SetDirectoryId sets the DirectoryId field's value.
func (s *UpdateNumberOfDomainControllersInput) SetDirectoryId(v string) *UpdateNumberOfDomainControllersInput {
s.DirectoryId = &v
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateNumberOfDomainControllersResult
type UpdateNumberOfDomainControllersOutput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s UpdateNumberOfDomainControllersOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s UpdateNumberOfDomainControllersOutput) GoString() string {
return s.String()
}
// Contains the inputs for the UpdateRadius operation.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateRadiusRequest
type UpdateRadiusInput struct {
@ -8256,6 +8802,29 @@ const (
DirectoryTypeMicrosoftAd = "MicrosoftAD"
)
const (
// DomainControllerStatusCreating is a DomainControllerStatus enum value
DomainControllerStatusCreating = "Creating"
// DomainControllerStatusActive is a DomainControllerStatus enum value
DomainControllerStatusActive = "Active"
// DomainControllerStatusImpaired is a DomainControllerStatus enum value
DomainControllerStatusImpaired = "Impaired"
// DomainControllerStatusRestoring is a DomainControllerStatus enum value
DomainControllerStatusRestoring = "Restoring"
// DomainControllerStatusDeleting is a DomainControllerStatus enum value
DomainControllerStatusDeleting = "Deleting"
// DomainControllerStatusDeleted is a DomainControllerStatus enum value
DomainControllerStatusDeleted = "Deleted"
// DomainControllerStatusFailed is a DomainControllerStatus enum value
DomainControllerStatusFailed = "Failed"
)
const (
// IpRouteStatusMsgAdding is a IpRouteStatusMsg enum value
IpRouteStatusMsgAdding = "Adding"

View File

@ -30,6 +30,13 @@ const (
// The specified directory is unavailable or could not be found.
ErrCodeDirectoryUnavailableException = "DirectoryUnavailableException"
// ErrCodeDomainControllerLimitExceededException for service response error code
// "DomainControllerLimitExceededException".
//
// The maximum allowed number of domain controllers per directory was exceeded.
// The default limit per directory is 20 domain controllers.
ErrCodeDomainControllerLimitExceededException = "DomainControllerLimitExceededException"
// ErrCodeEntityAlreadyExistsException for service response error code
// "EntityAlreadyExistsException".
//

View File

@ -1397,10 +1397,31 @@ func (c *DynamoDB) PutItemRequest(input *PutItemInput) (req *request.Request, ou
// table, the new item completely replaces the existing item. You can perform
// a conditional put operation (add a new item if one with the specified primary
// key doesn't exist), or replace an existing item if it has certain attribute
// values.
// values. You can return the item's attribute values in the same operation,
// using the ReturnValues parameter.
//
// In addition to putting an item, you can also return the item's attribute
// values in the same operation, using the ReturnValues parameter.
// This topic provides general information about the PutItem API.
//
// For information on how to call the PutItem API using the AWS SDK in specific
// languages, see the following:
//
// PutItem in the AWS Command Line Interface (http://docs.aws.amazon.com/goto/aws-cli/dynamodb-2012-08-10/PutItem)
//
// PutItem in the AWS SDK for .NET (http://docs.aws.amazon.com/goto/DotNetSDKV3/dynamodb-2012-08-10/PutItem)
//
// PutItem in the AWS SDK for C++ (http://docs.aws.amazon.com/goto/SdkForCpp/dynamodb-2012-08-10/PutItem)
//
// PutItem in the AWS SDK for Go (http://docs.aws.amazon.com/goto/SdkForGoV1/dynamodb-2012-08-10/PutItem)
//
// PutItem in the AWS SDK for Java (http://docs.aws.amazon.com/goto/SdkForJava/dynamodb-2012-08-10/PutItem)
//
// PutItem in the AWS SDK for JavaScript (http://docs.aws.amazon.com/goto/AWSJavaScriptSDK/dynamodb-2012-08-10/PutItem)
//
// PutItem in the AWS SDK for PHP V3 (http://docs.aws.amazon.com/goto/SdkForPHPV3/dynamodb-2012-08-10/PutItem)
//
// PutItem in the AWS SDK for Python (http://docs.aws.amazon.com/goto/boto3/dynamodb-2012-08-10/PutItem)
//
// PutItem in the AWS SDK for Ruby V2 (http://docs.aws.amazon.com/goto/SdkForRubyV2/dynamodb-2012-08-10/PutItem)
//
// When you add an item, the primary key attribute(s) are the only required
// attributes. Attribute values cannot be null. String and Binary type attributes
@ -1519,26 +1540,48 @@ func (c *DynamoDB) QueryRequest(input *QueryInput) (req *request.Request, output
// Query API operation for Amazon DynamoDB.
//
// A Query operation uses the primary key of a table or a secondary index to
// directly access items from that table or index.
// The Query operation finds items based on primary key values. You can query
// any table or secondary index that has a composite primary key (a partition
// key and a sort key).
//
// Use the KeyConditionExpression parameter to provide a specific value for
// the partition key. The Query operation will return all of the items from
// the table or index with that partition key value. You can optionally narrow
// the scope of the Query operation by specifying a sort key value and a comparison
// operator in KeyConditionExpression. You can use the ScanIndexForward parameter
// to get results in forward or reverse order, by sort key.
// operator in KeyConditionExpression. To further refine the Query results,
// you can optionally provide a FilterExpression. A FilterExpression determines
// which items within the results should be returned to you. All of the other
// results are discarded.
//
// Queries that do not return results consume the minimum number of read capacity
// units for that type of read operation.
// A Query operation always returns a result set. If no matching items are found,
// the result set will be empty. Queries that do not return results consume
// the minimum number of read capacity units for that type of read operation.
//
// If the total number of items meeting the query criteria exceeds the result
// set size limit of 1 MB, the query stops and results are returned to the user
// with the LastEvaluatedKey element to continue the query in a subsequent operation.
// Unlike a Scan operation, a Query operation never returns both an empty result
// set and a LastEvaluatedKey value. LastEvaluatedKey is only provided if you
// have used the Limit parameter, or if the result set exceeds 1 MB (prior to
// applying a filter).
// DynamoDB calculates the number of read capacity units consumed based on item
// size, not on the amount of data that is returned to an application. The number
// of capacity units consumed will be the same whether you request all of the
// attributes (the default behavior) or just some of them (using a projection
// expression). The number will also be the same whether or not you use a FilterExpression.
//
// Query results are always sorted by the sort key value. If the data type of
// the sort key is Number, the results are returned in numeric order; otherwise,
// the results are returned in order of UTF-8 bytes. By default, the sort order
// is ascending. To reverse the order, set the ScanIndexForward parameter to
// false.
//
// A single Query operation will read up to the maximum number of items set
// (if using the Limit parameter) or a maximum of 1 MB of data and then apply
// any filtering to the results using FilterExpression. If LastEvaluatedKey
// is present in the response, you will need to paginate the result set. For
// more information, see Paginating the Results (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html#Query.Pagination)
// in the Amazon DynamoDB Developer Guide.
//
// FilterExpression is applied after a Query finishes, but before the results
// are returned. A FilterExpression cannot contain partition key or sort key
// attributes. You need to specify those attributes in the KeyConditionExpression.
//
// A Query operation can return an empty result set and a LastEvaluatedKey if
// all the items read for the page of results are filtered out.
//
// You can query a table, a local secondary index, or a global secondary index.
// For a query on a table or on a local secondary index, you can set the ConsistentRead
@ -1702,16 +1745,23 @@ func (c *DynamoDB) ScanRequest(input *ScanInput) (req *request.Request, output *
// the number of items exceeding the limit. A scan can result in no table data
// meeting the filter criteria.
//
// By default, Scan operations proceed sequentially; however, for faster performance
// on a large table or secondary index, applications can request a parallel
// Scan operation by providing the Segment and TotalSegments parameters. For
// more information, see Parallel Scan (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#QueryAndScanParallelScan)
// A single Scan operation will read up to the maximum number of items set (if
// using the Limit parameter) or a maximum of 1 MB of data and then apply any
// filtering to the results using FilterExpression. If LastEvaluatedKey is present
// in the response, you will need to paginate the result set. For more information,
// see Paginating the Results (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.Pagination)
// in the Amazon DynamoDB Developer Guide.
//
// By default, Scan uses eventually consistent reads when accessing the data
// in a table; therefore, the result set might not include the changes to data
// in the table immediately before the operation began. If you need a consistent
// copy of the data, as of the time that the Scan begins, you can set the ConsistentRead
// Scan operations proceed sequentially; however, for faster performance on
// a large table or secondary index, applications can request a parallel Scan
// operation by providing the Segment and TotalSegments parameters. For more
// information, see Parallel Scan (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.ParallelScan)
// in the Amazon DynamoDB Developer Guide.
//
// Scan uses eventually consistent reads when accessing the data in a table;
// therefore, the result set might not include the changes to data in the table
// immediately before the operation began. If you need a consistent copy of
// the data, as of the time that the Scan begins, you can set the ConsistentRead
// parameter to true.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@ -2288,11 +2338,11 @@ func (c *DynamoDB) UpdateTimeToLiveRequest(input *UpdateTimeToLiveInput) (req *r
// UpdateTimeToLive API operation for Amazon DynamoDB.
//
// Specify the lifetime of individual table items. The database automatically
// removes the item at the expiration of the item. The UpdateTimeToLive method
// will enable or disable TTL for the specified table. A successful UpdateTimeToLive
// call returns the current TimeToLiveSpecification; it may take up to one hour
// for the change to fully process.
// The UpdateTimeToLive method will enable or disable TTL for the specified
// table. A successful UpdateTimeToLive call returns the current TimeToLiveSpecification;
// it may take up to one hour for the change to fully process. Any additional
// UpdateTimeToLive calls for the same table during this one hour duration result
// in a ValidationException.
//
// TTL compares the current time in epoch time format to the time stored in
// the TTL attribute of an item. If the epoch time value stored in the attribute
@ -2908,8 +2958,8 @@ type BatchWriteItemInput struct {
// * DeleteRequest - Perform a DeleteItem operation on the specified item.
// The item to be deleted is identified by a Key subelement:
//
// Key - A map of primary key attribute values that uniquely identify the !
// item. Each entry in this map consists of an attribute name and an attribute
// Key - A map of primary key attribute values that uniquely identify the item.
// Each entry in this map consists of an attribute name and an attribute
// value. For each primary key, you must provide all of the key attributes.
// For example, with a simple primary key, you only need to provide a value
// for the partition key. For a composite primary key, you must provide values
@ -3786,7 +3836,7 @@ type DeleteItemInput struct {
// in the Amazon DynamoDB Developer Guide.
ConditionalOperator *string `type:"string" enum:"ConditionalOperator"`
// This is a legacy parameter. Use ConditionExpresssion instead. For more information,
// This is a legacy parameter. Use ConditionExpression instead. For more information,
// see Expected (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html)
// in the Amazon DynamoDB Developer Guide.
Expected map[string]*ExpectedAttributeValue `type:"map"`
@ -5953,7 +6003,7 @@ type PutItemInput struct {
// in the Amazon DynamoDB Developer Guide.
ConditionalOperator *string `type:"string" enum:"ConditionalOperator"`
// This is a legacy parameter. Use ConditionExpresssion instead. For more information,
// This is a legacy parameter. Use ConditionExpression instead. For more information,
// see Expected (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html)
// in the Amazon DynamoDB Developer Guide.
Expected map[string]*ExpectedAttributeValue `type:"map"`
@ -8050,7 +8100,7 @@ type UpdateItemInput struct {
// in the Amazon DynamoDB Developer Guide.
ConditionalOperator *string `type:"string" enum:"ConditionalOperator"`
// This is a legacy parameter. Use ConditionExpresssion instead. For more information,
// This is a legacy parameter. Use ConditionExpression instead. For more information,
// see Expected (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html)
// in the Amazon DynamoDB Developer Guide.
Expected map[string]*ExpectedAttributeValue `type:"map"`
@ -8148,9 +8198,8 @@ type UpdateItemInput struct {
// (the default), no statistics are returned.
ReturnItemCollectionMetrics *string `type:"string" enum:"ReturnItemCollectionMetrics"`
// Use ReturnValues if you want to get the item attributes as they appeared
// either before or after they were updated. For UpdateItem, the valid values
// are:
// Use ReturnValues if you want to get the item attributes as they appear before
// or after they are updated. For UpdateItem, the valid values are:
//
// * NONE - If ReturnValues is not specified, or if its value is NONE, then
// nothing is returned. (This setting is the default for ReturnValues.)
@ -8169,9 +8218,9 @@ type UpdateItemInput struct {
//
// There is no additional cost associated with requesting a return value aside
// from the small network and processing overhead of receiving a larger response.
// No Read Capacity Units are consumed.
// No read capacity units are consumed.
//
// Values returned are strongly consistent
// The values returned are strongly consistent.
ReturnValues *string `type:"string" enum:"ReturnValue"`
// The name of the table containing the item to update.
@ -8361,9 +8410,11 @@ func (s *UpdateItemInput) SetUpdateExpression(v string) *UpdateItemInput {
type UpdateItemOutput struct {
_ struct{} `type:"structure"`
// A map of attribute values as they appeared before the UpdateItem operation.
// This map only appears if ReturnValues was specified as something other than
// NONE in the request. Each element represents one attribute.
// A map of attribute values as they appear before or after the UpdateItem operation,
// as determined by the ReturnValues parameter.
//
// The Attributes map is only present if ReturnValues was specified as something
// other than NONE in the request. Each element represents one attribute.
Attributes map[string]*AttributeValue `type:"map"`
// The capacity units consumed by the UpdateItem operation. The data returned

File diff suppressed because it is too large Load Diff

View File

@ -3908,9 +3908,6 @@ type ContainerDefinition struct {
// section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/)
// and the IMAGE parameter of docker run (https://docs.docker.com/engine/reference/run/).
//
// Amazon ECS task definitions currently only support tags as image identifiers
// within a specified repository (and not sha256 digests).
//
// * Images in Amazon ECR repositories use the full registry and repository
// URI (for example, 012345678910.dkr.ecr.<region-name>.amazonaws.com/<repository-name>).
//
@ -4460,14 +4457,29 @@ type ContainerOverride struct {
// name.
Command []*string `locationName:"command" type:"list"`
// The number of cpu units reserved for the container, instead of the default
// value from the task definition. You must also specify a container name.
Cpu *int64 `locationName:"cpu" type:"integer"`
// The environment variables to send to the container. You can add new environment
// variables, which are added to the container at launch, or you can override
// the existing environment variables from the Docker image or the task definition.
// You must also specify a container name.
Environment []*KeyValuePair `locationName:"environment" type:"list"`
// The hard limit (in MiB) of memory to present to the container, instead of
// the default value from the task definition. If your container attempts to
// exceed the memory specified here, the container is killed. You must also
// specify a container name.
Memory *int64 `locationName:"memory" type:"integer"`
// The soft limit (in MiB) of memory to reserve for the container, instead of
// the default value from the task definition. You must also specify a container
// name.
MemoryReservation *int64 `locationName:"memoryReservation" type:"integer"`
// The name of the container that receives the override. This parameter is required
// if a command or environment variable is specified.
// if any override is specified.
Name *string `locationName:"name" type:"string"`
}
@ -4487,12 +4499,30 @@ func (s *ContainerOverride) SetCommand(v []*string) *ContainerOverride {
return s
}
// SetCpu sets the Cpu field's value.
func (s *ContainerOverride) SetCpu(v int64) *ContainerOverride {
s.Cpu = &v
return s
}
// SetEnvironment sets the Environment field's value.
func (s *ContainerOverride) SetEnvironment(v []*KeyValuePair) *ContainerOverride {
s.Environment = v
return s
}
// SetMemory sets the Memory field's value.
func (s *ContainerOverride) SetMemory(v int64) *ContainerOverride {
s.Memory = &v
return s
}
// SetMemoryReservation sets the MemoryReservation field's value.
func (s *ContainerOverride) SetMemoryReservation(v int64) *ContainerOverride {
s.MemoryReservation = &v
return s
}
// SetName sets the Name field's value.
func (s *ContainerOverride) SetName(v string) *ContainerOverride {
s.Name = &v
@ -7010,13 +7040,15 @@ type PortMapping struct {
// and your container automatically receives a port in the ephemeral port range
// for your container instance operating system and Docker version.
//
// The default ephemeral port range is 49153 to 65535, and this range is used
// for Docker versions prior to 1.6.0. For Docker version 1.6.0 and later, the
// Docker daemon tries to read the ephemeral port range from /proc/sys/net/ipv4/ip_local_port_range;
// if this kernel parameter is unavailable, the default ephemeral port range
// The default ephemeral port range for Docker version 1.6.0 and later is listed
// on the instance under /proc/sys/net/ipv4/ip_local_port_range; if this kernel
// parameter is unavailable, the default ephemeral port range of 49153 to 65535
// is used. You should not attempt to specify a host port in the ephemeral port
// range, because these are reserved for automatic assignment. In general, ports
// below 32768 are outside of the ephemeral port range.
// range as these are reserved for automatic assignment. In general, ports below
// 32768 are outside of the ephemeral port range.
//
// The default ephemeral port range of 49153 to 65535 will always be used for
// Docker versions prior to 1.6.0.
//
// The default reserved ports are 22 for SSH, the Docker ports 2375 and 2376,
// and the Amazon ECS container agent ports 51678 and 51679. Any host port that

View File

@ -133,6 +133,11 @@ func (c *ELB) WaitUntilInstanceInServiceWithContext(ctx aws.Context, input *Desc
Matcher: request.PathAllWaiterMatch, Argument: "InstanceStates[].State",
Expected: "InService",
},
{
State: request.RetryWaiterState,
Matcher: request.ErrorWaiterMatch,
Expected: "InvalidInstance",
},
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {

View File

@ -1592,11 +1592,10 @@ func (c *EMR) ListInstancesRequest(input *ListInstancesInput) (req *request.Requ
// ListInstances API operation for Amazon Elastic MapReduce.
//
// Provides information about the cluster instances that Amazon EMR provisions
// on behalf of a user when it creates the cluster. For example, this operation
// indicates when the EC2 instances reach the Ready state, when instances become
// available to Amazon EMR to use for jobs, and the IP addresses for cluster
// instances, etc.
// Provides information for all active EC2 instances and EC2 instances terminated
// in the last 30 days, up to a maximum of 2,000. EC2 instances in any of the
// following states are considered active: AWAITING_FULFILLMENT, PROVISIONING,
// BOOTSTRAPPING, RUNNING.
//
// 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
@ -3082,7 +3081,7 @@ func (s AddTagsOutput) GoString() string {
// * "mapr" with the user arguments specifying "--edition,m3" or "--edition,m5"
// - launch the cluster using MapR M3 or M5 Edition, respectively.
//
// In Amazon EMR releases 4.0 and greater, the only accepted parameter is the
// In Amazon EMR releases 4.x and later, the only accepted parameter is the
// application name. To pass arguments to applications, you supply a configuration
// for each application.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/Application
@ -3674,11 +3673,18 @@ type Cluster struct {
// Specifies whether the cluster should terminate after completing all steps.
AutoTerminate *bool `type:"boolean"`
// Amazon EMR releases 4.x or later.
//
// The list of Configurations supplied to the EMR cluster.
// Applies only to Amazon EMR releases 4.x and later. The list of Configurations
// supplied to the EMR cluster.
Configurations []*Configuration `type:"list"`
// Available only in Amazon EMR version 5.7.0 and later. The ID of a custom
// Amazon EBS-backed Linux AMI if the cluster uses a custom AMI.
CustomAmiId *string `type:"string"`
// The size, in GiB, of the EBS root device volume of the Linux AMI that is
// used for each EC2 instance. Available in Amazon EMR version 4.x and later.
EbsRootVolumeSize *int64 `type:"integer"`
// Provides information about the EC2 instances in a cluster grouped by category.
// For example, key name, subnet ID, IAM instance profile, and so on.
Ec2InstanceAttributes *Ec2InstanceAttributes `type:"structure"`
@ -3711,10 +3717,14 @@ type Cluster struct {
// the actual billing rate.
NormalizedInstanceHours *int64 `type:"integer"`
// The release label for the Amazon EMR release. For Amazon EMR 3.x and 2.x
// AMIs, use amiVersion instead instead of ReleaseLabel.
// The release label for the Amazon EMR release.
ReleaseLabel *string `type:"string"`
// Applies only when CustomAmiID is used. Specifies the type of updates that
// are applied from the Amazon Linux AMI package repositories when an instance
// boots using the AMI.
RepoUpgradeOnBoot *string `type:"string" enum:"RepoUpgradeOnBoot"`
// The AMI version requested for this cluster.
RequestedAmiVersion *string `type:"string"`
@ -3796,6 +3806,18 @@ func (s *Cluster) SetConfigurations(v []*Configuration) *Cluster {
return s
}
// SetCustomAmiId sets the CustomAmiId field's value.
func (s *Cluster) SetCustomAmiId(v string) *Cluster {
s.CustomAmiId = &v
return s
}
// SetEbsRootVolumeSize sets the EbsRootVolumeSize field's value.
func (s *Cluster) SetEbsRootVolumeSize(v int64) *Cluster {
s.EbsRootVolumeSize = &v
return s
}
// SetEc2InstanceAttributes sets the Ec2InstanceAttributes field's value.
func (s *Cluster) SetEc2InstanceAttributes(v *Ec2InstanceAttributes) *Cluster {
s.Ec2InstanceAttributes = v
@ -3844,6 +3866,12 @@ func (s *Cluster) SetReleaseLabel(v string) *Cluster {
return s
}
// SetRepoUpgradeOnBoot sets the RepoUpgradeOnBoot field's value.
func (s *Cluster) SetRepoUpgradeOnBoot(v string) *Cluster {
s.RepoUpgradeOnBoot = &v
return s
}
// SetRequestedAmiVersion sets the RequestedAmiVersion field's value.
func (s *Cluster) SetRequestedAmiVersion(v string) *Cluster {
s.RequestedAmiVersion = &v
@ -4835,20 +4863,26 @@ type Ec2InstanceAttributes struct {
// of the cluster assume this role.
IamInstanceProfile *string `type:"string"`
// Applies to clusters configured with the The list of availability zones to
// choose from. The service will choose the availability zone with the best
// mix of available capacity and lowest cost to launch the cluster. If you do
// not specify this value, the cluster is launched in any availability zone
// that the customer account has access to.
// Applies to clusters configured with the instance fleets option. Specifies
// one or more Availability Zones in which to launch EC2 cluster instances when
// the EC2-Classic network configuration is supported. Amazon EMR chooses the
// Availability Zone with the best fit from among the list of RequestedEc2AvailabilityZones,
// and then launches all cluster instances within that Availability Zone. If
// you do not specify this value, Amazon EMR chooses the Availability Zone for
// you. RequestedEc2SubnetIDs and RequestedEc2AvailabilityZones cannot be specified
// together.
RequestedEc2AvailabilityZones []*string `type:"list"`
// Applies to clusters configured with the instance fleets option. Specifies
// the unique identifier of one or more Amazon EC2 subnets in which to launch
// EC2 cluster instances. Amazon EMR chooses the EC2 subnet with the best performance
// and cost characteristics from among the list of RequestedEc2SubnetIds and
// launches all cluster instances within that subnet. If this value is not specified,
// and the account supports EC2-Classic networks, the cluster launches instances
// in the EC2-Classic network and uses Requested
// EC2 cluster instances. Subnets must exist within the same VPC. Amazon EMR
// chooses the EC2 subnet with the best fit from among the list of RequestedEc2SubnetIds,
// and then launches all cluster instances within that Subnet. If this value
// is not specified, and the account and region support EC2-Classic networks,
// the cluster launches instances in the EC2-Classic network and uses RequestedEc2AvailabilityZones
// instead of this setting. If EC2-Classic is not supported, and no Subnet is
// specified, Amazon EMR chooses the subnet for you. RequestedEc2SubnetIDs and
// RequestedEc2AvailabilityZones cannot be specified together.
RequestedEc2SubnetIds []*string `type:"list"`
// The identifier of the Amazon EC2 security group for the Amazon EMR service
@ -6590,9 +6624,9 @@ type InstanceTypeConfig struct {
BidPrice *string `type:"string"`
// The bid price, as a percentage of On-Demand price, for each EC2 Spot instance
// as defined by InstanceType. Expressed as a number between 0 and 1000 (for
// example, 20 specifies 20%). If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice
// is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.
// as defined by InstanceType. Expressed as a number (for example, 20 specifies
// 20%). If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided,
// BidPriceAsPercentageOfOnDemandPrice defaults to 100%.
BidPriceAsPercentageOfOnDemandPrice *float64 `type:"double"`
// A configuration classification that applies when provisioning cluster instances,
@ -6611,8 +6645,8 @@ type InstanceTypeConfig struct {
// The number of units that a provisioned instance of this type provides toward
// fulfilling the target capacities defined in InstanceFleetConfig. This value
// is 1 for a master instance fleet, and must be greater than 0 for core and
// task instance fleets.
// is 1 for a master instance fleet, and must be 1 or greater for core and task
// instance fleets. Defaults to 1 if not specified.
WeightedCapacity *int64 `type:"integer"`
}
@ -6779,9 +6813,9 @@ func (s *InstanceTypeSpecification) SetWeightedCapacity(v int64) *InstanceTypeSp
type JobFlowDetail struct {
_ struct{} `type:"structure"`
// The version of the AMI used to initialize Amazon EC2 instances in the job
// flow. For a list of AMI versions currently supported by Amazon EMR, see AMI
// Versions Supported in EMR (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/EnvironmentConfig_AMIVersion.html#ami-versions-supported)
// Used only for version 2.x and 3.x of Amazon EMR. The version of the AMI used
// to initialize Amazon EC2 instances in the job flow. For a list of AMI versions
// supported by Amazon EMR, see AMI Versions Supported in EMR (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/EnvironmentConfig_AMIVersion.html#ami-versions-supported)
// in the Amazon EMR Developer Guide.
AmiVersion *string `type:"string"`
@ -8560,22 +8594,17 @@ type RunJobFlowInput struct {
// A JSON string for selecting additional features.
AdditionalInfo *string `type:"string"`
// For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and greater,
// use ReleaseLabel.
//
// For Amazon EMR AMI versions 3.x and 2.x. For Amazon EMR releases 4.0 and
// later, the Linux AMI is determined by the ReleaseLabel specified or by CustomAmiID.
// The version of the Amazon Machine Image (AMI) to use when launching Amazon
// EC2 instances in the job flow. The following values are valid:
//
// * The version number of the AMI to use, for example, "2.0."
// EC2 instances in the job flow. For details about the AMI versions currently
// supported in EMR version 3.x and 2.x, see AMI Versions Supported in EMR (ElasticMapReduce/latest/DeveloperGuide/emr-dg.pdf#nameddest=ami-versions-supported)
// in the Amazon EMR Developer Guide.
//
// If the AMI supports multiple versions of Hadoop (for example, AMI 1.0 supports
// both Hadoop 0.18 and 0.20) you can use the JobFlowInstancesConfigHadoopVersion
// both Hadoop 0.18 and 0.20), you can use the JobFlowInstancesConfigHadoopVersion
// parameter to modify the version of Hadoop from the defaults shown above.
//
// For details about the AMI versions currently supported by Amazon Elastic
// MapReduce, see AMI Versions Supported in Elastic MapReduce (http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/EnvironmentConfig_AMIVersion.html#ami-versions-supported)
// in the Amazon Elastic MapReduce Developer Guide.
//
// Previously, the EMR AMI version API parameter options allowed you to use
// latest for the latest AMI version rather than specify a numerical value.
// Some regions no longer support this deprecated option as they only have a
@ -8583,10 +8612,9 @@ type RunJobFlowInput struct {
// release label release (EMR 4.x or later).
AmiVersion *string `type:"string"`
// Amazon EMR releases 4.x or later.
//
// A list of applications for the cluster. Valid values are: "Hadoop", "Hive",
// "Mahout", "Pig", and "Spark." They are case insensitive.
// For Amazon EMR releases 4.0 and later. A list of applications for the cluster.
// Valid values are: "Hadoop", "Hive", "Mahout", "Pig", and "Spark." They are
// case insensitive.
Applications []*Application `type:"list"`
// An IAM role for automatic scaling policies. The default role is EMR_AutoScaling_DefaultRole.
@ -8597,11 +8625,28 @@ type RunJobFlowInput struct {
// A list of bootstrap actions to run before Hadoop starts on the cluster nodes.
BootstrapActions []*BootstrapActionConfig `type:"list"`
// Amazon EMR releases 4.x or later.
//
// The list of configurations supplied for the EMR cluster you are creating.
// For Amazon EMR releases 4.0 and later. The list of configurations supplied
// for the EMR cluster you are creating.
Configurations []*Configuration `type:"list"`
// Available only in Amazon EMR version 5.7.0 and later. The ID of a custom
// Amazon EBS-backed Linux AMI. If specified, Amazon EMR uses this AMI when
// it launches cluster EC2 instances. For more information about custom AMIs
// in Amazon EMR, see Using a Custom AMI (http://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-custom-ami.html)
// in the Amazon EMR Management Guide. If omitted, the cluster uses the base
// Linux AMI for the ReleaseLabel specified. For Amazon EMR versions 2.x and
// 3.x, use AmiVersion instead.
//
// For information about creating a custom AMI, see Creating an Amazon EBS-Backed
// Linux AMI (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html)
// in the Amazon Elastic Compute Cloud User Guide for Linux Instances. For information
// about finding an AMI ID, see Finding a Linux AMI (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html).
CustomAmiId *string `type:"string"`
// The size, in GiB, of the EBS root device volume of the Linux AMI that is
// used for each EC2 instance. Available in Amazon EMR version 4.x and later.
EbsRootVolumeSize *int64 `type:"integer"`
// A specification of the number and type of Amazon EC2 instances.
//
// Instances is a required field
@ -8622,7 +8667,7 @@ type RunJobFlowInput struct {
// Name is a required field
Name *string `type:"string" required:"true"`
// For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and greater,
// For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and later,
// use Applications.
//
// A list of strings that indicates third-party software to use with the job
@ -8650,12 +8695,17 @@ type RunJobFlowInput struct {
// * "ganglia" - launch the cluster with the Ganglia Monitoring System installed.
NewSupportedProducts []*SupportedProductConfig `type:"list"`
// Amazon EMR releases 4.x or later.
//
// The release label for the Amazon EMR release. For Amazon EMR 3.x and 2.x
// AMIs, use amiVersion instead instead of ReleaseLabel.
// AMIs, use AmiVersion instead.
ReleaseLabel *string `type:"string"`
// Applies only when CustomAmiID is used. Specifies which updates from the Amazon
// Linux AMI package repositories to apply automatically when the instance boots
// using the AMI. If omitted, the default is SECURITY, which indicates that
// only security updates are applied. If NONE is specified, no updates are applied,
// and all updates must be applied manually.
RepoUpgradeOnBoot *string `type:"string" enum:"RepoUpgradeOnBoot"`
// Specifies the way that individual Amazon EC2 instances terminate when an
// automatic scale-in activity occurs or an instance group is resized. TERMINATE_AT_INSTANCE_HOUR
// indicates that Amazon EMR terminates nodes at the instance-hour boundary,
@ -8680,7 +8730,7 @@ type RunJobFlowInput struct {
// A list of steps to run.
Steps []*StepConfig `type:"list"`
// For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and greater,
// For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and later,
// use Applications.
//
// A list of strings that indicates third-party software to use. For more information,
@ -8790,6 +8840,18 @@ func (s *RunJobFlowInput) SetConfigurations(v []*Configuration) *RunJobFlowInput
return s
}
// SetCustomAmiId sets the CustomAmiId field's value.
func (s *RunJobFlowInput) SetCustomAmiId(v string) *RunJobFlowInput {
s.CustomAmiId = &v
return s
}
// SetEbsRootVolumeSize sets the EbsRootVolumeSize field's value.
func (s *RunJobFlowInput) SetEbsRootVolumeSize(v int64) *RunJobFlowInput {
s.EbsRootVolumeSize = &v
return s
}
// SetInstances sets the Instances field's value.
func (s *RunJobFlowInput) SetInstances(v *JobFlowInstancesConfig) *RunJobFlowInput {
s.Instances = v
@ -8826,6 +8888,12 @@ func (s *RunJobFlowInput) SetReleaseLabel(v string) *RunJobFlowInput {
return s
}
// SetRepoUpgradeOnBoot sets the RepoUpgradeOnBoot field's value.
func (s *RunJobFlowInput) SetRepoUpgradeOnBoot(v string) *RunJobFlowInput {
s.RepoUpgradeOnBoot = &v
return s
}
// SetScaleDownBehavior sets the ScaleDownBehavior field's value.
func (s *RunJobFlowInput) SetScaleDownBehavior(v string) *RunJobFlowInput {
s.ScaleDownBehavior = &v
@ -9514,8 +9582,9 @@ type SpotProvisioningSpecification struct {
// The action to take when TargetSpotCapacity has not been fulfilled when the
// TimeoutDurationMinutes has expired. Spot instances are not uprovisioned within
// the Spot provisioining timeout. Valid values are TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND
// to fulfill the remaining capacity.
// the Spot provisioining timeout. Valid values are TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND.
// SWITCH_TO_ON_DEMAND specifies that if no Spot instances are available, On-Demand
// Instances should be provisioned to fulfill any remaining Spot capacity.
//
// TimeoutAction is a required field
TimeoutAction *string `type:"string" required:"true" enum:"SpotProvisioningTimeoutAction"`
@ -10292,6 +10361,9 @@ const (
// ClusterStateChangeReasonCodeInstanceFailure is a ClusterStateChangeReasonCode enum value
ClusterStateChangeReasonCodeInstanceFailure = "INSTANCE_FAILURE"
// ClusterStateChangeReasonCodeInstanceFleetTimeout is a ClusterStateChangeReasonCode enum value
ClusterStateChangeReasonCodeInstanceFleetTimeout = "INSTANCE_FLEET_TIMEOUT"
// ClusterStateChangeReasonCodeBootstrapFailure is a ClusterStateChangeReasonCode enum value
ClusterStateChangeReasonCodeBootstrapFailure = "BOOTSTRAP_FAILURE"
@ -10512,6 +10584,14 @@ const (
MarketTypeSpot = "SPOT"
)
const (
// RepoUpgradeOnBootSecurity is a RepoUpgradeOnBoot enum value
RepoUpgradeOnBootSecurity = "SECURITY"
// RepoUpgradeOnBootNone is a RepoUpgradeOnBoot enum value
RepoUpgradeOnBootNone = "NONE"
)
const (
// ScaleDownBehaviorTerminateAtInstanceHour is a ScaleDownBehavior enum value
ScaleDownBehaviorTerminateAtInstanceHour = "TERMINATE_AT_INSTANCE_HOUR"

12223
vendor/github.com/aws/aws-sdk-go/service/iot/api.go generated vendored Normal file

File diff suppressed because it is too large Load Diff

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

@ -0,0 +1,85 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package iot provides the client and types for making API
// requests to AWS IoT.
//
// AWS IoT provides secure, bi-directional communication between Internet-connected
// things (such as sensors, actuators, embedded devices, or smart appliances)
// and the AWS cloud. You can discover your custom IoT-Data endpoint to communicate
// with, configure rules for data processing and integration with other services,
// organize resources associated with each thing (Thing Registry), configure
// logging, and create and manage policies and credentials to authenticate things.
//
// For more information about how AWS IoT works, see the Developer Guide (http://docs.aws.amazon.com/iot/latest/developerguide/aws-iot-how-it-works.html).
//
// See iot package documentation for more information.
// https://docs.aws.amazon.com/sdk-for-go/api/service/iot/
//
// Using the Client
//
// To use the client for AWS IoT you will first need
// to create a new instance of it.
//
// When creating a client for an AWS service you'll first need to have a Session
// already created. The Session provides configuration that can be shared
// between multiple service clients. Additional configuration can be applied to
// the Session and service's client when they are constructed. The aws package's
// Config type contains several fields such as Region for the AWS Region the
// client should make API requests too. The optional Config value can be provided
// as the variadic argument for Sessions and client creation.
//
// Once the service's client is created you can use it to make API requests the
// AWS service. These clients are safe to use concurrently.
//
// // Create a session to share configuration, and load external configuration.
// sess := session.Must(session.NewSession())
//
// // Create the service's client with the session.
// svc := iot.New(sess)
//
// See the SDK's documentation for more information on how to use service clients.
// https://docs.aws.amazon.com/sdk-for-go/api/
//
// See aws package's Config type for more information on configuration options.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
//
// See the AWS IoT client IoT for more
// information on creating the service's client.
// https://docs.aws.amazon.com/sdk-for-go/api/service/iot/#New
//
// Once the client is created you can make an API request to the service.
// Each API method takes a input parameter, and returns the service response
// and an error.
//
// The API method will document which error codes the service can be returned
// by the operation if the service models the API operation's errors. These
// errors will also be available as const strings prefixed with "ErrCode".
//
// result, err := svc.AcceptCertificateTransfer(params)
// if err != nil {
// // Cast err to awserr.Error to handle specific error codes.
// aerr, ok := err.(awserr.Error)
// if ok && aerr.Code() == <error code to check for> {
// // Specific error code handling
// }
// return err
// }
//
// fmt.Println("AcceptCertificateTransfer result:")
// fmt.Println(result)
//
// Using the Client with Context
//
// The service's client also provides methods to make API requests with a Context
// value. This allows you to control the timeout, and cancellation of pending
// requests. These methods also take request Option as variadic parameter to apply
// additional configuration to the API request.
//
// ctx := context.Background()
//
// result, err := svc.AcceptCertificateTransferWithContext(ctx, params)
//
// See the request package documentation for more information on using Context pattern
// with the SDK.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/request/
package iot

131
vendor/github.com/aws/aws-sdk-go/service/iot/errors.go generated vendored Normal file
View File

@ -0,0 +1,131 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package iot
const (
// ErrCodeCertificateConflictException for service response error code
// "CertificateConflictException".
//
// Unable to verify the CA certificate used to sign the device certificate you
// are attempting to register. This is happens when you have registered more
// than one CA certificate that has the same subject field and public key.
ErrCodeCertificateConflictException = "CertificateConflictException"
// ErrCodeCertificateStateException for service response error code
// "CertificateStateException".
//
// The certificate operation is not allowed.
ErrCodeCertificateStateException = "CertificateStateException"
// ErrCodeCertificateValidationException for service response error code
// "CertificateValidationException".
//
// The certificate is invalid.
ErrCodeCertificateValidationException = "CertificateValidationException"
// ErrCodeDeleteConflictException for service response error code
// "DeleteConflictException".
//
// You can't delete the resource because it is attached to one or more resources.
ErrCodeDeleteConflictException = "DeleteConflictException"
// ErrCodeInternalException for service response error code
// "InternalException".
//
// An unexpected error has occurred.
ErrCodeInternalException = "InternalException"
// ErrCodeInternalFailureException for service response error code
// "InternalFailureException".
//
// An unexpected error has occurred.
ErrCodeInternalFailureException = "InternalFailureException"
// ErrCodeInvalidRequestException for service response error code
// "InvalidRequestException".
//
// The request is not valid.
ErrCodeInvalidRequestException = "InvalidRequestException"
// ErrCodeLimitExceededException for service response error code
// "LimitExceededException".
//
// The number of attached entities exceeds the limit.
ErrCodeLimitExceededException = "LimitExceededException"
// ErrCodeMalformedPolicyException for service response error code
// "MalformedPolicyException".
//
// The policy documentation is not valid.
ErrCodeMalformedPolicyException = "MalformedPolicyException"
// ErrCodeRegistrationCodeValidationException for service response error code
// "RegistrationCodeValidationException".
//
// The registration code is invalid.
ErrCodeRegistrationCodeValidationException = "RegistrationCodeValidationException"
// ErrCodeResourceAlreadyExistsException for service response error code
// "ResourceAlreadyExistsException".
//
// The resource already exists.
ErrCodeResourceAlreadyExistsException = "ResourceAlreadyExistsException"
// ErrCodeResourceNotFoundException for service response error code
// "ResourceNotFoundException".
//
// The specified resource does not exist.
ErrCodeResourceNotFoundException = "ResourceNotFoundException"
// ErrCodeServiceUnavailableException for service response error code
// "ServiceUnavailableException".
//
// The service is temporarily unavailable.
ErrCodeServiceUnavailableException = "ServiceUnavailableException"
// ErrCodeSqlParseException for service response error code
// "SqlParseException".
//
// The Rule-SQL expression can't be parsed correctly.
ErrCodeSqlParseException = "SqlParseException"
// ErrCodeThrottlingException for service response error code
// "ThrottlingException".
//
// The rate exceeds the limit.
ErrCodeThrottlingException = "ThrottlingException"
// ErrCodeTransferAlreadyCompletedException for service response error code
// "TransferAlreadyCompletedException".
//
// You can't revert the certificate transfer because the transfer is already
// complete.
ErrCodeTransferAlreadyCompletedException = "TransferAlreadyCompletedException"
// ErrCodeTransferConflictException for service response error code
// "TransferConflictException".
//
// You can't transfer the certificate because authorization policies are still
// attached.
ErrCodeTransferConflictException = "TransferConflictException"
// ErrCodeUnauthorizedException for service response error code
// "UnauthorizedException".
//
// You are not authorized to perform this operation.
ErrCodeUnauthorizedException = "UnauthorizedException"
// ErrCodeVersionConflictException for service response error code
// "VersionConflictException".
//
// An exception thrown when the version of a thing passed to a command is different
// than the version specified with the --version parameter.
ErrCodeVersionConflictException = "VersionConflictException"
// ErrCodeVersionsLimitExceededException for service response error code
// "VersionsLimitExceededException".
//
// The number of policy versions exceeds the limit.
ErrCodeVersionsLimitExceededException = "VersionsLimitExceededException"
)

View File

@ -0,0 +1,96 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package iot
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/restjson"
)
// IoT provides the API operation methods for making requests to
// AWS IoT. See this package's package overview docs
// for details on the service.
//
// IoT methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type IoT 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 = "iot" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
)
// New creates a new instance of the IoT 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 IoT client from just a session.
// svc := iot.New(mySession)
//
// // Create a IoT client with additional configuration
// svc := iot.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func New(p client.ConfigProvider, cfgs ...*aws.Config) *IoT {
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) *IoT {
if len(signingName) == 0 {
signingName = "execute-api"
}
svc := &IoT{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2015-05-28",
},
handlers,
),
}
// Handlers
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
svc.Handlers.Build.PushBackNamed(restjson.BuildHandler)
svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler)
svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler)
svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler)
// Run custom client initialization if present
if initClient != nil {
initClient(svc.Client)
}
return svc
}
// newRequest creates a new request for a IoT operation and runs any
// custom request initialization.
func (c *IoT) 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

@ -1000,6 +1000,31 @@ func (c *Kinesis) GetRecordsRequest(input *GetRecordsInput) (req *request.Reques
// * ErrCodeExpiredIteratorException "ExpiredIteratorException"
// The provided iterator exceeds the maximum age allowed.
//
// * ErrCodeKMSDisabledException "KMSDisabledException"
// The request was rejected because the specified CMK isn't enabled.
//
// * ErrCodeKMSInvalidStateException "KMSInvalidStateException"
// The request was rejected because the state of the specified resource isn't
// valid for this request. For more information, see How Key State Affects Use
// of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
// in the AWS Key Management Service Developer Guide.
//
// * ErrCodeKMSAccessDeniedException "KMSAccessDeniedException"
// The ciphertext references a key that doesn't exist or that you don't have
// access to.
//
// * ErrCodeKMSNotFoundException "KMSNotFoundException"
// The request was rejected because the specified entity or resource couldn't
// be found.
//
// * ErrCodeKMSOptInRequired "KMSOptInRequired"
// The AWS access key ID needs a subscription for the service.
//
// * ErrCodeKMSThrottlingException "KMSThrottlingException"
// The request was denied due to request throttling. For more information about
// throttling, see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html#requests-per-second)
// in the AWS Key Management Service Developer Guide.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/GetRecords
func (c *Kinesis) GetRecords(input *GetRecordsInput) (*GetRecordsOutput, error) {
req, out := c.GetRecordsRequest(input)
@ -1705,8 +1730,9 @@ func (c *Kinesis) PutRecordRequest(input *PutRecordInput) (req *request.Request,
// If a PutRecord request cannot be processed because of insufficient provisioned
// throughput on the shard involved in the request, PutRecord throws ProvisionedThroughputExceededException.
//
// Data records are accessible for only 24 hours from the time that they are
// added to a stream.
// By default, data records are accessible for 24 hours from the time that they
// are added to a stream. You can use IncreaseStreamRetentionPeriod or DecreaseStreamRetentionPeriod
// to modify this retention period.
//
// 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
@ -1732,6 +1758,31 @@ func (c *Kinesis) PutRecordRequest(input *PutRecordInput) (req *request.Request,
// Backoff in AWS (http://docs.aws.amazon.com/general/latest/gr/api-retries.html)
// in the AWS General Reference.
//
// * ErrCodeKMSDisabledException "KMSDisabledException"
// The request was rejected because the specified CMK isn't enabled.
//
// * ErrCodeKMSInvalidStateException "KMSInvalidStateException"
// The request was rejected because the state of the specified resource isn't
// valid for this request. For more information, see How Key State Affects Use
// of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
// in the AWS Key Management Service Developer Guide.
//
// * ErrCodeKMSAccessDeniedException "KMSAccessDeniedException"
// The ciphertext references a key that doesn't exist or that you don't have
// access to.
//
// * ErrCodeKMSNotFoundException "KMSNotFoundException"
// The request was rejected because the specified entity or resource couldn't
// be found.
//
// * ErrCodeKMSOptInRequired "KMSOptInRequired"
// The AWS access key ID needs a subscription for the service.
//
// * ErrCodeKMSThrottlingException "KMSThrottlingException"
// The request was denied due to request throttling. For more information about
// throttling, see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html#requests-per-second)
// in the AWS Key Management Service Developer Guide.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/PutRecord
func (c *Kinesis) PutRecord(input *PutRecordInput) (*PutRecordOutput, error) {
req, out := c.PutRecordRequest(input)
@ -1855,10 +1906,9 @@ func (c *Kinesis) PutRecordsRequest(input *PutRecordsInput) (req *request.Reques
// see Adding Multiple Records with PutRecords (http://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-add-data-to-stream.html#kinesis-using-sdk-java-putrecords)
// in the Amazon Kinesis Streams Developer Guide.
//
// By default, data records are accessible for only 24 hours from the time that
// they are added to an Amazon Kinesis stream. This retention period can be
// modified using the DecreaseStreamRetentionPeriod and IncreaseStreamRetentionPeriod
// operations.
// By default, data records are accessible for 24 hours from the time that they
// are added to a stream. You can use IncreaseStreamRetentionPeriod or DecreaseStreamRetentionPeriod
// to modify this retention period.
//
// 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
@ -1884,6 +1934,31 @@ func (c *Kinesis) PutRecordsRequest(input *PutRecordsInput) (req *request.Reques
// Backoff in AWS (http://docs.aws.amazon.com/general/latest/gr/api-retries.html)
// in the AWS General Reference.
//
// * ErrCodeKMSDisabledException "KMSDisabledException"
// The request was rejected because the specified CMK isn't enabled.
//
// * ErrCodeKMSInvalidStateException "KMSInvalidStateException"
// The request was rejected because the state of the specified resource isn't
// valid for this request. For more information, see How Key State Affects Use
// of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
// in the AWS Key Management Service Developer Guide.
//
// * ErrCodeKMSAccessDeniedException "KMSAccessDeniedException"
// The ciphertext references a key that doesn't exist or that you don't have
// access to.
//
// * ErrCodeKMSNotFoundException "KMSNotFoundException"
// The request was rejected because the specified entity or resource couldn't
// be found.
//
// * ErrCodeKMSOptInRequired "KMSOptInRequired"
// The AWS access key ID needs a subscription for the service.
//
// * ErrCodeKMSThrottlingException "KMSThrottlingException"
// The request was denied due to request throttling. For more information about
// throttling, see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html#requests-per-second)
// in the AWS Key Management Service Developer Guide.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/PutRecords
func (c *Kinesis) PutRecords(input *PutRecordsInput) (*PutRecordsOutput, error) {
req, out := c.PutRecordsRequest(input)
@ -2143,6 +2218,255 @@ func (c *Kinesis) SplitShardWithContext(ctx aws.Context, input *SplitShardInput,
return out, req.Send()
}
const opStartStreamEncryption = "StartStreamEncryption"
// StartStreamEncryptionRequest generates a "aws/request.Request" representing the
// client's request for the StartStreamEncryption operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See StartStreamEncryption for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the StartStreamEncryption method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the StartStreamEncryptionRequest method.
// req, resp := client.StartStreamEncryptionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/StartStreamEncryption
func (c *Kinesis) StartStreamEncryptionRequest(input *StartStreamEncryptionInput) (req *request.Request, output *StartStreamEncryptionOutput) {
op := &request.Operation{
Name: opStartStreamEncryption,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &StartStreamEncryptionInput{}
}
output = &StartStreamEncryptionOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// StartStreamEncryption API operation for Amazon Kinesis.
//
// Enables or updates server-side encryption using an AWS KMS key for a specified
// stream.
//
// Starting encryption is an asynchronous operation. Upon receiving the request,
// Amazon Kinesis returns immediately and sets the status of the stream to UPDATING.
// After the update is complete, Amazon Kinesis sets the status of the stream
// back to ACTIVE. Updating or applying encryption normally takes a few seconds
// to complete but it can take minutes. You can continue to read and write data
// to your stream while its status is UPDATING. Once the status of the stream
// is ACTIVE, records written to the stream will begin to be encrypted.
//
// API Limits: You can successfully apply a new AWS KMS key for server-side
// encryption 25 times in a rolling 24 hour period.
//
// Note: It can take up to 5 seconds after the stream is in an ACTIVE status
// before all records written to the stream are encrypted. After youve enabled
// encryption, you can verify encryption was applied by inspecting the API response
// from PutRecord or PutRecords.
//
// 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 Kinesis's
// API operation StartStreamEncryption for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidArgumentException "InvalidArgumentException"
// A specified parameter exceeds its restrictions, is not supported, or can't
// be used. For more information, see the returned message.
//
// * ErrCodeLimitExceededException "LimitExceededException"
// The requested resource exceeds the maximum number allowed, or the number
// of concurrent stream requests exceeds the maximum number allowed (5).
//
// * ErrCodeResourceInUseException "ResourceInUseException"
// The resource is not available for this operation. For successful operation,
// the resource needs to be in the ACTIVE state.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The requested resource could not be found. The stream might not be specified
// correctly.
//
// * ErrCodeKMSDisabledException "KMSDisabledException"
// The request was rejected because the specified CMK isn't enabled.
//
// * ErrCodeKMSInvalidStateException "KMSInvalidStateException"
// The request was rejected because the state of the specified resource isn't
// valid for this request. For more information, see How Key State Affects Use
// of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
// in the AWS Key Management Service Developer Guide.
//
// * ErrCodeKMSAccessDeniedException "KMSAccessDeniedException"
// The ciphertext references a key that doesn't exist or that you don't have
// access to.
//
// * ErrCodeKMSNotFoundException "KMSNotFoundException"
// The request was rejected because the specified entity or resource couldn't
// be found.
//
// * ErrCodeKMSOptInRequired "KMSOptInRequired"
// The AWS access key ID needs a subscription for the service.
//
// * ErrCodeKMSThrottlingException "KMSThrottlingException"
// The request was denied due to request throttling. For more information about
// throttling, see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html#requests-per-second)
// in the AWS Key Management Service Developer Guide.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/StartStreamEncryption
func (c *Kinesis) StartStreamEncryption(input *StartStreamEncryptionInput) (*StartStreamEncryptionOutput, error) {
req, out := c.StartStreamEncryptionRequest(input)
return out, req.Send()
}
// StartStreamEncryptionWithContext is the same as StartStreamEncryption with the addition of
// the ability to pass a context and additional request options.
//
// See StartStreamEncryption 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 *Kinesis) StartStreamEncryptionWithContext(ctx aws.Context, input *StartStreamEncryptionInput, opts ...request.Option) (*StartStreamEncryptionOutput, error) {
req, out := c.StartStreamEncryptionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opStopStreamEncryption = "StopStreamEncryption"
// StopStreamEncryptionRequest generates a "aws/request.Request" representing the
// client's request for the StopStreamEncryption operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See StopStreamEncryption for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the StopStreamEncryption method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the StopStreamEncryptionRequest method.
// req, resp := client.StopStreamEncryptionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/StopStreamEncryption
func (c *Kinesis) StopStreamEncryptionRequest(input *StopStreamEncryptionInput) (req *request.Request, output *StopStreamEncryptionOutput) {
op := &request.Operation{
Name: opStopStreamEncryption,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &StopStreamEncryptionInput{}
}
output = &StopStreamEncryptionOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// StopStreamEncryption API operation for Amazon Kinesis.
//
// Disables server-side encryption for a specified stream.
//
// Stopping encryption is an asynchronous operation. Upon receiving the request,
// Amazon Kinesis returns immediately and sets the status of the stream to UPDATING.
// After the update is complete, Amazon Kinesis sets the status of the stream
// back to ACTIVE. Stopping encryption normally takes a few seconds to complete
// but it can take minutes. You can continue to read and write data to your
// stream while its status is UPDATING. Once the status of the stream is ACTIVE
// records written to the stream will no longer be encrypted by the Amazon Kinesis
// Streams service.
//
// API Limits: You can successfully disable server-side encryption 25 times
// in a rolling 24 hour period.
//
// Note: It can take up to 5 seconds after the stream is in an ACTIVE status
// before all records written to the stream are no longer subject to encryption.
// After youve disabled encryption, you can verify encryption was not applied
// by inspecting the API response from PutRecord or PutRecords.
//
// 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 Kinesis's
// API operation StopStreamEncryption for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidArgumentException "InvalidArgumentException"
// A specified parameter exceeds its restrictions, is not supported, or can't
// be used. For more information, see the returned message.
//
// * ErrCodeLimitExceededException "LimitExceededException"
// The requested resource exceeds the maximum number allowed, or the number
// of concurrent stream requests exceeds the maximum number allowed (5).
//
// * ErrCodeResourceInUseException "ResourceInUseException"
// The resource is not available for this operation. For successful operation,
// the resource needs to be in the ACTIVE state.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The requested resource could not be found. The stream might not be specified
// correctly.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/StopStreamEncryption
func (c *Kinesis) StopStreamEncryption(input *StopStreamEncryptionInput) (*StopStreamEncryptionOutput, error) {
req, out := c.StopStreamEncryptionRequest(input)
return out, req.Send()
}
// StopStreamEncryptionWithContext is the same as StopStreamEncryption with the addition of
// the ability to pass a context and additional request options.
//
// See StopStreamEncryption 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 *Kinesis) StopStreamEncryptionWithContext(ctx aws.Context, input *StopStreamEncryptionInput, opts ...request.Option) (*StopStreamEncryptionOutput, error) {
req, out := c.StopStreamEncryptionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opUpdateShardCount = "UpdateShardCount"
// UpdateShardCountRequest generates a "aws/request.Request" representing the
@ -2198,18 +2522,30 @@ func (c *Kinesis) UpdateShardCountRequest(input *UpdateShardCountInput) (req *re
// action could take a few minutes to complete. You can continue to read and
// write data to your stream while its status is UPDATING.
//
// To update the shard count, Amazon Kinesis performs splits and merges and
// individual shards. This can cause short-lived shards to be created, in addition
// to the final shards. We recommend that you double or halve the shard count,
// as this results in the fewest number of splits or merges.
// To update the shard count, Amazon Kinesis performs splits or merges on individual
// shards. This can cause short-lived shards to be created, in addition to the
// final shards. We recommend that you double or halve the shard count, as this
// results in the fewest number of splits or merges.
//
// This operation has a rate limit of twice per rolling 24 hour period. You
// cannot scale above double your current shard count, scale below half your
// current shard count, or exceed the shard limits for your account.
// This operation has the following limits, which are per region per account
// unless otherwise noted:
//
// For the default limits for an AWS account, see Streams Limits (http://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html)
// in the Amazon Kinesis Streams Developer Guide. If you need to increase a
// limit, contact AWS Support (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html).
// * scale more than twice per rolling 24 hour period
//
// * scale up above double your current shard count
//
// * scale down below half your current shard count
//
// * scale up above 200 shards in a stream
//
// * scale a stream with more than 200 shards down unless the result is less
// than 200 shards
//
// * scale up above the shard limits for your account
//
// *
//
// For the default limits for an AWS account, see Streams Limits (http://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html)in the Amazon Kinesis Streams Developer Guide. If you need to increase a limit, contact AWS Support (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.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
@ -3728,6 +4064,15 @@ func (s *PutRecordInput) SetStreamName(v string) *PutRecordInput {
type PutRecordOutput struct {
_ struct{} `type:"structure"`
// The encryption type to use on the record. This parameter can be one of the
// following values:
//
// * NONE: Do not encrypt the records in the stream.
//
// * KMS: Use server-side encryption on the records in the stream using a
// customer-managed KMS key.
EncryptionType *string `type:"string" enum:"EncryptionType"`
// The sequence number identifier that was assigned to the put data record.
// The sequence number for the record is unique across all records in the stream.
// A sequence number is the identifier associated with every record put into
@ -3752,6 +4097,12 @@ func (s PutRecordOutput) GoString() string {
return s.String()
}
// SetEncryptionType sets the EncryptionType field's value.
func (s *PutRecordOutput) SetEncryptionType(v string) *PutRecordOutput {
s.EncryptionType = &v
return s
}
// SetSequenceNumber sets the SequenceNumber field's value.
func (s *PutRecordOutput) SetSequenceNumber(v string) *PutRecordOutput {
s.SequenceNumber = &v
@ -3839,6 +4190,15 @@ func (s *PutRecordsInput) SetStreamName(v string) *PutRecordsInput {
type PutRecordsOutput struct {
_ struct{} `type:"structure"`
// The encryption type used on the records. This parameter can be one of the
// following values:
//
// * NONE: Do not encrypt the records.
//
// * KMS: Use server-side encryption on the records using a customer-managed
// KMS key.
EncryptionType *string `type:"string" enum:"EncryptionType"`
// The number of unsuccessfully processed records in a PutRecords request.
FailedRecordCount *int64 `min:"1" type:"integer"`
@ -3862,6 +4222,12 @@ func (s PutRecordsOutput) GoString() string {
return s.String()
}
// SetEncryptionType sets the EncryptionType field's value.
func (s *PutRecordsOutput) SetEncryptionType(v string) *PutRecordsOutput {
s.EncryptionType = &v
return s
}
// SetFailedRecordCount sets the FailedRecordCount field's value.
func (s *PutRecordsOutput) SetFailedRecordCount(v int64) *PutRecordsOutput {
s.FailedRecordCount = &v
@ -4032,12 +4398,21 @@ type Record struct {
// Data is a required field
Data []byte `type:"blob" required:"true"`
// The encryption type used on the record. This parameter can be one of the
// following values:
//
// * NONE: Do not encrypt the records in the stream.
//
// * KMS: Use server-side encryption on the records in the stream using a
// customer-managed KMS key.
EncryptionType *string `type:"string" enum:"EncryptionType"`
// Identifies which shard in the stream the data record is assigned to.
//
// PartitionKey is a required field
PartitionKey *string `min:"1" type:"string" required:"true"`
// The unique identifier of the record in the stream.
// The unique identifier of the record within its shard.
//
// SequenceNumber is a required field
SequenceNumber *string `type:"string" required:"true"`
@ -4065,6 +4440,12 @@ func (s *Record) SetData(v []byte) *Record {
return s
}
// SetEncryptionType sets the EncryptionType field's value.
func (s *Record) SetEncryptionType(v string) *Record {
s.EncryptionType = &v
return s
}
// SetPartitionKey sets the PartitionKey field's value.
func (s *Record) SetPartitionKey(v string) *Record {
s.PartitionKey = &v
@ -4352,11 +4733,209 @@ func (s SplitShardOutput) GoString() string {
return s.String()
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/StartStreamEncryptionInput
type StartStreamEncryptionInput struct {
_ struct{} `type:"structure"`
// The encryption type to use. This parameter can be one of the following values:
//
// * NONE: Not valid for this operation. An InvalidOperationException will
// be thrown.
//
// * KMS: Use server-side encryption on the records in the stream using a
// customer-managed KMS key.
//
// EncryptionType is a required field
EncryptionType *string `type:"string" required:"true" enum:"EncryptionType"`
// The GUID for the customer-managed KMS key to use for encryption. You can
// also use a Kinesis-owned master key by specifying the alias aws/kinesis.
//
// KeyId is a required field
KeyId *string `min:"1" type:"string" required:"true"`
// The name of the stream for which to start encrypting records.
//
// StreamName is a required field
StreamName *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s StartStreamEncryptionInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s StartStreamEncryptionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *StartStreamEncryptionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "StartStreamEncryptionInput"}
if s.EncryptionType == nil {
invalidParams.Add(request.NewErrParamRequired("EncryptionType"))
}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if s.StreamName == nil {
invalidParams.Add(request.NewErrParamRequired("StreamName"))
}
if s.StreamName != nil && len(*s.StreamName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StreamName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetEncryptionType sets the EncryptionType field's value.
func (s *StartStreamEncryptionInput) SetEncryptionType(v string) *StartStreamEncryptionInput {
s.EncryptionType = &v
return s
}
// SetKeyId sets the KeyId field's value.
func (s *StartStreamEncryptionInput) SetKeyId(v string) *StartStreamEncryptionInput {
s.KeyId = &v
return s
}
// SetStreamName sets the StreamName field's value.
func (s *StartStreamEncryptionInput) SetStreamName(v string) *StartStreamEncryptionInput {
s.StreamName = &v
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/StartStreamEncryptionOutput
type StartStreamEncryptionOutput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s StartStreamEncryptionOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s StartStreamEncryptionOutput) GoString() string {
return s.String()
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/StopStreamEncryptionInput
type StopStreamEncryptionInput struct {
_ struct{} `type:"structure"`
// The encryption type. This parameter can be one of the following values:
//
// * NONE: Not valid for this operation. An InvalidOperationException will
// be thrown.
//
// * KMS: Use server-side encryption on the records in the stream using a
// customer-managed KMS key.
//
// EncryptionType is a required field
EncryptionType *string `type:"string" required:"true" enum:"EncryptionType"`
// The GUID for the customer-managed key that was used for encryption.
//
// KeyId is a required field
KeyId *string `min:"1" type:"string" required:"true"`
// The name of the stream on which to stop encrypting records.
//
// StreamName is a required field
StreamName *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s StopStreamEncryptionInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s StopStreamEncryptionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *StopStreamEncryptionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "StopStreamEncryptionInput"}
if s.EncryptionType == nil {
invalidParams.Add(request.NewErrParamRequired("EncryptionType"))
}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if s.StreamName == nil {
invalidParams.Add(request.NewErrParamRequired("StreamName"))
}
if s.StreamName != nil && len(*s.StreamName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StreamName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetEncryptionType sets the EncryptionType field's value.
func (s *StopStreamEncryptionInput) SetEncryptionType(v string) *StopStreamEncryptionInput {
s.EncryptionType = &v
return s
}
// SetKeyId sets the KeyId field's value.
func (s *StopStreamEncryptionInput) SetKeyId(v string) *StopStreamEncryptionInput {
s.KeyId = &v
return s
}
// SetStreamName sets the StreamName field's value.
func (s *StopStreamEncryptionInput) SetStreamName(v string) *StopStreamEncryptionInput {
s.StreamName = &v
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/StopStreamEncryptionOutput
type StopStreamEncryptionOutput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s StopStreamEncryptionOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s StopStreamEncryptionOutput) GoString() string {
return s.String()
}
// Represents the output for DescribeStream.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/StreamDescription
type StreamDescription struct {
_ struct{} `type:"structure"`
// The server-side encryption type used on the stream. This parameter can be
// one of the following values:
//
// * NONE: Do not encrypt the records in the stream.
//
// * KMS: Use server-side encryption on the records in the stream using a
// customer-managed KMS key.
EncryptionType *string `type:"string" enum:"EncryptionType"`
// Represents the current enhanced monitoring settings of the stream.
//
// EnhancedMonitoring is a required field
@ -4367,6 +4946,9 @@ type StreamDescription struct {
// HasMoreShards is a required field
HasMoreShards *bool `type:"boolean" required:"true"`
// The GUID for the customer-managed KMS key used for encryption on the stream.
KeyId *string `min:"1" type:"string"`
// The current retention period, in hours.
//
// RetentionPeriodHours is a required field
@ -4423,6 +5005,12 @@ func (s StreamDescription) GoString() string {
return s.String()
}
// SetEncryptionType sets the EncryptionType field's value.
func (s *StreamDescription) SetEncryptionType(v string) *StreamDescription {
s.EncryptionType = &v
return s
}
// SetEnhancedMonitoring sets the EnhancedMonitoring field's value.
func (s *StreamDescription) SetEnhancedMonitoring(v []*EnhancedMetrics) *StreamDescription {
s.EnhancedMonitoring = v
@ -4435,6 +5023,12 @@ func (s *StreamDescription) SetHasMoreShards(v bool) *StreamDescription {
return s
}
// SetKeyId sets the KeyId field's value.
func (s *StreamDescription) SetKeyId(v string) *StreamDescription {
s.KeyId = &v
return s
}
// SetRetentionPeriodHours sets the RetentionPeriodHours field's value.
func (s *StreamDescription) SetRetentionPeriodHours(v int64) *StreamDescription {
s.RetentionPeriodHours = &v
@ -4625,6 +5219,14 @@ func (s *UpdateShardCountOutput) SetTargetShardCount(v int64) *UpdateShardCountO
return s
}
const (
// EncryptionTypeNone is a EncryptionType enum value
EncryptionTypeNone = "NONE"
// EncryptionTypeKms is a EncryptionType enum value
EncryptionTypeKms = "KMS"
)
const (
// MetricsNameIncomingBytes is a MetricsName enum value
MetricsNameIncomingBytes = "IncomingBytes"

View File

@ -17,6 +17,49 @@ const (
// be used. For more information, see the returned message.
ErrCodeInvalidArgumentException = "InvalidArgumentException"
// ErrCodeKMSAccessDeniedException for service response error code
// "KMSAccessDeniedException".
//
// The ciphertext references a key that doesn't exist or that you don't have
// access to.
ErrCodeKMSAccessDeniedException = "KMSAccessDeniedException"
// ErrCodeKMSDisabledException for service response error code
// "KMSDisabledException".
//
// The request was rejected because the specified CMK isn't enabled.
ErrCodeKMSDisabledException = "KMSDisabledException"
// ErrCodeKMSInvalidStateException for service response error code
// "KMSInvalidStateException".
//
// The request was rejected because the state of the specified resource isn't
// valid for this request. For more information, see How Key State Affects Use
// of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
// in the AWS Key Management Service Developer Guide.
ErrCodeKMSInvalidStateException = "KMSInvalidStateException"
// ErrCodeKMSNotFoundException for service response error code
// "KMSNotFoundException".
//
// The request was rejected because the specified entity or resource couldn't
// be found.
ErrCodeKMSNotFoundException = "KMSNotFoundException"
// ErrCodeKMSOptInRequired for service response error code
// "KMSOptInRequired".
//
// The AWS access key ID needs a subscription for the service.
ErrCodeKMSOptInRequired = "KMSOptInRequired"
// ErrCodeKMSThrottlingException for service response error code
// "KMSThrottlingException".
//
// The request was denied due to request throttling. For more information about
// throttling, see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html#requests-per-second)
// in the AWS Key Management Service Developer Guide.
ErrCodeKMSThrottlingException = "KMSThrottlingException"
// ErrCodeLimitExceededException for service response error code
// "LimitExceededException".
//

View File

@ -6380,6 +6380,11 @@ type KeyMetadata struct {
// KeyId is a required field
KeyId *string `min:"1" type:"string" required:"true"`
// The CMK's manager. CMKs are either customer-managed or AWS-managed. For more
// information about the difference, see Customer Master Keys (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys)
// in the AWS Key Management Service Developer Guide.
KeyManager *string `type:"string" enum:"KeyManagerType"`
// The state of the CMK.
//
// For more information about how key state affects the use of a CMK, see How
@ -6463,6 +6468,12 @@ func (s *KeyMetadata) SetKeyId(v string) *KeyMetadata {
return s
}
// SetKeyManager sets the KeyManager field's value.
func (s *KeyMetadata) SetKeyManager(v string) *KeyMetadata {
s.KeyManager = &v
return s
}
// SetKeyState sets the KeyState field's value.
func (s *KeyMetadata) SetKeyState(v string) *KeyMetadata {
s.KeyState = &v
@ -8135,6 +8146,14 @@ const (
GrantOperationDescribeKey = "DescribeKey"
)
const (
// KeyManagerTypeAws is a KeyManagerType enum value
KeyManagerTypeAws = "AWS"
// KeyManagerTypeCustomer is a KeyManagerType enum value
KeyManagerTypeCustomer = "CUSTOMER"
)
const (
// KeyStateEnabled is a KeyState enum value
KeyStateEnabled = "Enabled"

View File

@ -93,7 +93,9 @@ func (c *Lambda) AddPermissionRequest(input *AddPermissionInput) (req *request.R
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodePolicyLengthExceededException "PolicyLengthExceededException"
// Lambda function access policy is limited to 20 KB.
@ -191,7 +193,9 @@ func (c *Lambda) CreateAliasRequest(input *CreateAliasInput) (req *request.Reque
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
@ -299,7 +303,9 @@ func (c *Lambda) CreateEventSourceMappingRequest(input *CreateEventSourceMapping
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeResourceConflictException "ResourceConflictException"
// The resource already exists.
@ -399,7 +405,9 @@ func (c *Lambda) CreateFunctionRequest(input *CreateFunctionInput) (req *request
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The resource (for example, a Lambda function or access policy statement)
@ -498,7 +506,9 @@ func (c *Lambda) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Reque
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
@ -590,7 +600,9 @@ func (c *Lambda) DeleteEventSourceMappingRequest(input *DeleteEventSourceMapping
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
@ -694,7 +706,9 @@ func (c *Lambda) DeleteFunctionRequest(input *DeleteFunctionInput) (req *request
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeResourceConflictException "ResourceConflictException"
// The resource already exists.
@ -872,7 +886,9 @@ func (c *Lambda) GetAliasRequest(input *GetAliasInput) (req *request.Request, ou
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
@ -963,7 +979,9 @@ func (c *Lambda) GetEventSourceMappingRequest(input *GetEventSourceMappingInput)
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
@ -1065,7 +1083,9 @@ func (c *Lambda) GetFunctionRequest(input *GetFunctionInput) (req *request.Reque
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
func (c *Lambda) GetFunction(input *GetFunctionInput) (*GetFunctionOutput, error) {
req, out := c.GetFunctionRequest(input)
@ -1165,7 +1185,9 @@ func (c *Lambda) GetFunctionConfigurationRequest(input *GetFunctionConfiguration
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
func (c *Lambda) GetFunctionConfiguration(input *GetFunctionConfigurationInput) (*FunctionConfiguration, error) {
req, out := c.GetFunctionConfigurationRequest(input)
@ -1260,7 +1282,9 @@ func (c *Lambda) GetPolicyRequest(input *GetPolicyInput) (req *request.Request,
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
func (c *Lambda) GetPolicy(input *GetPolicyInput) (*GetPolicyOutput, error) {
req, out := c.GetPolicyRequest(input)
@ -1369,7 +1393,9 @@ func (c *Lambda) InvokeRequest(input *InvokeInput) (req *request.Request, output
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeEC2UnexpectedException "EC2UnexpectedException"
// AWS Lambda received an unexpected EC2 client exception while setting up for
@ -1416,6 +1442,9 @@ func (c *Lambda) InvokeRequest(input *InvokeInput) (req *request.Request, output
// Lambda was unable to decrypt the environment variables because the KMS key
// was not found. Check the function's KMS key settings.
//
// * ErrCodeInvalidRuntimeException "InvalidRuntimeException"
// The runtime or runtime version specified is not supported.
//
func (c *Lambda) Invoke(input *InvokeInput) (*InvokeOutput, error) {
req, out := c.InvokeRequest(input)
return out, req.Send()
@ -1509,6 +1538,9 @@ func (c *Lambda) InvokeAsyncRequest(input *InvokeAsyncInput) (req *request.Reque
// * ErrCodeInvalidRequestContentException "InvalidRequestContentException"
// The request body could not be parsed as JSON.
//
// * ErrCodeInvalidRuntimeException "InvalidRuntimeException"
// The runtime or runtime version specified is not supported.
//
func (c *Lambda) InvokeAsync(input *InvokeAsyncInput) (*InvokeAsyncOutput, error) {
req, out := c.InvokeAsyncRequest(input)
return out, req.Send()
@ -1598,7 +1630,9 @@ func (c *Lambda) ListAliasesRequest(input *ListAliasesInput) (req *request.Reque
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
@ -1704,7 +1738,9 @@ func (c *Lambda) ListEventSourceMappingsRequest(input *ListEventSourceMappingsIn
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
@ -1834,9 +1870,9 @@ func (c *Lambda) ListFunctionsRequest(input *ListFunctionsInput) (req *request.R
//
// This operation requires permission for the lambda:ListFunctions action.
//
// If you are using versioning feature, the response returns list of $LATEST
// versions of your functions. For information about the versioning feature,
// see AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
// If you are using the versioning feature, you can list all of your functions
// or only $LATEST versions. For information about the versioning feature, see
// AWS Lambda Function Versioning and Aliases (http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.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
@ -1851,6 +1887,13 @@ func (c *Lambda) ListFunctionsRequest(input *ListFunctionsInput) (req *request.R
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
func (c *Lambda) ListFunctions(input *ListFunctionsInput) (*ListFunctionsOutput, error) {
req, out := c.ListFunctionsRequest(input)
return out, req.Send()
@ -1986,7 +2029,9 @@ func (c *Lambda) ListTagsRequest(input *ListTagsInput) (req *request.Request, ou
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
@ -2075,7 +2120,9 @@ func (c *Lambda) ListVersionsByFunctionRequest(input *ListVersionsByFunctionInpu
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
@ -2167,7 +2214,9 @@ func (c *Lambda) PublishVersionRequest(input *PublishVersionInput) (req *request
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
@ -2272,7 +2321,9 @@ func (c *Lambda) RemovePermissionRequest(input *RemovePermissionInput) (req *req
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
@ -2364,7 +2415,9 @@ func (c *Lambda) TagResourceRequest(input *TagResourceInput) (req *request.Reque
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
@ -2455,7 +2508,9 @@ func (c *Lambda) UntagResourceRequest(input *UntagResourceInput) (req *request.R
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
@ -2547,7 +2602,9 @@ func (c *Lambda) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Reque
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
@ -2651,7 +2708,9 @@ func (c *Lambda) UpdateEventSourceMappingRequest(input *UpdateEventSourceMapping
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
@ -2750,7 +2809,9 @@ func (c *Lambda) UpdateFunctionCodeRequest(input *UpdateFunctionCodeInput) (req
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
@ -2851,10 +2912,15 @@ func (c *Lambda) UpdateFunctionConfigurationRequest(input *UpdateFunctionConfigu
// * ErrCodeInvalidParameterValueException "InvalidParameterValueException"
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
// * ErrCodeResourceConflictException "ResourceConflictException"
// The resource already exists.
//
func (c *Lambda) UpdateFunctionConfiguration(input *UpdateFunctionConfigurationInput) (*FunctionConfiguration, error) {
req, out := c.UpdateFunctionConfigurationRequest(input)
return out, req.Send()
@ -3497,10 +3563,13 @@ type CreateFunctionInput struct {
// v6.10, set the value to "nodejs6.10". To use the Node.js runtime v4.3, set
// the value to "nodejs4.3".
//
// You can no longer create functions using the v0.10.42 runtime version as
// of November, 2016. Existing functions will be supported until early 2017,
// but we recommend you migrate them to either nodejs6.10 or nodejs4.3 runtime
// version as soon as possible.
// Node v0.10.42 is currently marked as deprecated. You must migrate existing
// functions to the newer Node.js runtime versions available on AWS Lambda (nodejs4.3
// or nodejs6.10) as soon as possible. You can request a one-time extension
// until June 30, 2017 by going to the Lambda console and following the instructions
// provided. Failure to do so will result in an invalid parmaeter error being
// returned. Note that you will have to follow this procedure for each region
// that contains functions written in the Node v0.10.42 runtime.
//
// Runtime is a required field
Runtime *string `type:"string" required:"true" enum:"Runtime"`
@ -4224,9 +4293,15 @@ type FunctionConfiguration struct {
// service key.
KMSKeyArn *string `type:"string"`
// The time stamp of the last time you updated the function.
// The time stamp of the last time you updated the function. The time stamp
// is conveyed as a string complying with ISO-8601 in this way YYYY-MM-DDThh:mm:ssTZD
// (e.g., 1997-07-16T19:20:30+01:00). For more information, see Date and Time
// Formats (https://www.w3.org/TR/NOTE-datetime).
LastModified *string `type:"string"`
// Returns the ARN (Amazon Resource Name) of the master function.
MasterArn *string `type:"string"`
// The memory size, in MB, you configured for the function. Must be a multiple
// of 64 MB.
MemorySize *int64 `min:"128" type:"integer"`
@ -4323,6 +4398,12 @@ func (s *FunctionConfiguration) SetLastModified(v string) *FunctionConfiguration
return s
}
// SetMasterArn sets the MasterArn field's value.
func (s *FunctionConfiguration) SetMasterArn(v string) *FunctionConfiguration {
s.MasterArn = &v
return s
}
// SetMemorySize sets the MemorySize field's value.
func (s *FunctionConfiguration) SetMemorySize(v int64) *FunctionConfiguration {
s.MemorySize = &v
@ -5001,7 +5082,7 @@ type InvokeOutput struct {
Payload []byte `type:"blob"`
// The HTTP status code will be in the 200 range for successful request. For
// the RequestResonse invocation type this status code will be 200. For the
// the RequestResponse invocation type this status code will be 200. For the
// Event invocation type this status code will be 202. For the DryRun invocation
// type the status code will be 204.
StatusCode *int64 `location:"statusCode" type:"integer"`
@ -5268,10 +5349,31 @@ func (s *ListEventSourceMappingsOutput) SetNextMarker(v string) *ListEventSource
type ListFunctionsInput struct {
_ struct{} `type:"structure"`
// Optional string. If not specified, only the unqualified functions ARNs (Amazon
// Resource Names) will be returned.
//
// Valid value:
//
// ALL _ Will return all versions, including $LATEST which will have fully qualified
// ARNs (Amazon Resource Names).
FunctionVersion *string `location:"querystring" locationName:"FunctionVersion" type:"string" enum:"FunctionVersion"`
// Optional string. An opaque pagination token returned from a previous ListFunctions
// operation. If present, indicates where to continue the listing.
Marker *string `location:"querystring" locationName:"Marker" type:"string"`
// Optional string. If not specified, will return only regular function versions
// (i.e., non-replicated versions).
//
// Valid values are:
//
// The region from which the functions are replicated. For example, if you specify
// us-east-1, only functions replicated from that region will be returned.
//
// ALL _ Will return all functions from any region. If specified, you also must
// specify a valid FunctionVersion parameter.
MasterRegion *string `location:"querystring" locationName:"MasterRegion" type:"string"`
// Optional integer. Specifies the maximum number of AWS Lambda functions to
// return in response. This parameter value must be greater than 0.
MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"`
@ -5300,12 +5402,24 @@ func (s *ListFunctionsInput) Validate() error {
return nil
}
// SetFunctionVersion sets the FunctionVersion field's value.
func (s *ListFunctionsInput) SetFunctionVersion(v string) *ListFunctionsInput {
s.FunctionVersion = &v
return s
}
// SetMarker sets the Marker field's value.
func (s *ListFunctionsInput) SetMarker(v string) *ListFunctionsInput {
s.Marker = &v
return s
}
// SetMasterRegion sets the MasterRegion field's value.
func (s *ListFunctionsInput) SetMasterRegion(v string) *ListFunctionsInput {
s.MasterRegion = &v
return s
}
// SetMaxItems sets the MaxItems field's value.
func (s *ListFunctionsInput) SetMaxItems(v int64) *ListFunctionsInput {
s.MaxItems = &v
@ -6198,10 +6312,15 @@ type UpdateFunctionConfigurationInput struct {
// Python runtime v2.7, set the value to "python2.7". To use the Node.js runtime
// v6.10, set the value to "nodejs6.10". To use the Node.js runtime v4.3, set
// the value to "nodejs4.3". To use the Python runtime v3.6, set the value to
// "python3.6". To use the Python runtime v2.7, set the value to "python2.7".
// "python3.6".
//
// You can no longer downgrade to the v0.10.42 runtime version. This version
// will no longer be supported as of early 2017.
// Node v0.10.42 is currently marked as deprecated. You must migrate existing
// functions to the newer Node.js runtime versions available on AWS Lambda (nodejs4.3
// or nodejs6.10) as soon as possible. You can request a one-time extension
// until June 30, 2017 by going to the Lambda console and following the instructions
// provided. Failure to do so will result in an invalid parameter error being
// returned. Note that you will have to follow this procedure for each region
// that contains functions written in the Node v0.10.42 runtime.
Runtime *string `type:"string" enum:"Runtime"`
// The function execution time at which AWS Lambda should terminate the function.
@ -6412,6 +6531,11 @@ const (
EventSourcePositionAtTimestamp = "AT_TIMESTAMP"
)
const (
// FunctionVersionAll is a FunctionVersion enum value
FunctionVersionAll = "ALL"
)
const (
// InvocationTypeEvent is a InvocationType enum value
InvocationTypeEvent = "Event"

View File

@ -41,7 +41,9 @@ const (
//
// One of the parameters in the request is invalid. For example, if you provided
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
// API, that AWS Lambda is unable to assume you will get this exception.
// API, that AWS Lambda is unable to assume you will get this exception. You
// will also get this exception if you have selected a deprecated runtime, such
// as Node v0.10.42.
ErrCodeInvalidParameterValueException = "InvalidParameterValueException"
// ErrCodeInvalidRequestContentException for service response error code
@ -50,6 +52,12 @@ const (
// The request body could not be parsed as JSON.
ErrCodeInvalidRequestContentException = "InvalidRequestContentException"
// ErrCodeInvalidRuntimeException for service response error code
// "InvalidRuntimeException".
//
// The runtime or runtime version specified is not supported.
ErrCodeInvalidRuntimeException = "InvalidRuntimeException"
// ErrCodeInvalidSecurityGroupIDException for service response error code
// "InvalidSecurityGroupIDException".
//

View File

@ -5940,8 +5940,11 @@ type CreateInstancesInput struct {
// BundleId is a required field
BundleId *string `locationName:"bundleId" type:"string" required:"true"`
// The name for your custom image.
CustomImageName *string `locationName:"customImageName" type:"string"`
// (Deprecated) The name for your custom image.
//
// In releases prior to June 12, 2017, this parameter was ignored by the API.
// It is now deprecated.
CustomImageName *string `locationName:"customImageName" deprecated:"true" type:"string"`
// The names to use for your new Lightsail instances. Separate multiple values
// using quotation marks and commas, for example: ["MyFirstInstance","MySecondInstance"]
@ -8051,8 +8054,15 @@ func (s *GetOperationsForResourceInput) SetResourceName(v string) *GetOperations
type GetOperationsForResourceOutput struct {
_ struct{} `type:"structure"`
// Returns the number of pages of results that remain.
NextPageCount *string `locationName:"nextPageCount" type:"string"`
// (Deprecated) Returns the number of pages of results that remain.
//
// In releases prior to June 12, 2017, this parameter returned null by the API.
// It is now deprecated, and the API returns the nextPageToken parameter instead.
NextPageCount *string `locationName:"nextPageCount" deprecated:"true" type:"string"`
// An identifier that was returned from the previous call to this operation,
// which can be used to return the next set of items in the list.
NextPageToken *string `locationName:"nextPageToken" type:"string"`
// An array of key-value pairs containing information about the results of your
// get operations for resource request.
@ -8075,6 +8085,12 @@ func (s *GetOperationsForResourceOutput) SetNextPageCount(v string) *GetOperatio
return s
}
// SetNextPageToken sets the NextPageToken field's value.
func (s *GetOperationsForResourceOutput) SetNextPageToken(v string) *GetOperationsForResourceOutput {
s.NextPageToken = &v
return s
}
// SetOperations sets the Operations field's value.
func (s *GetOperationsForResourceOutput) SetOperations(v []*Operation) *GetOperationsForResourceOutput {
s.Operations = v
@ -10489,6 +10505,9 @@ const (
// RegionNameUsEast1 is a RegionName enum value
RegionNameUsEast1 = "us-east-1"
// RegionNameUsEast2 is a RegionName enum value
RegionNameUsEast2 = "us-east-2"
// RegionNameUsWest1 is a RegionName enum value
RegionNameUsWest1 = "us-west-1"

View File

@ -342,8 +342,10 @@ func (c *OpsWorks) AttachElasticLoadBalancerRequest(input *AttachElasticLoadBala
// AttachElasticLoadBalancer API operation for AWS OpsWorks.
//
// Attaches an Elastic Load Balancing load balancer to a specified layer. For
// more information, see Elastic Load Balancing (http://docs.aws.amazon.com/opsworks/latest/userguide/load-balancer-elb.html).
// Attaches an Elastic Load Balancing load balancer to a specified layer. AWS
// OpsWorks Stacks does not support Application Load Balancer. You can only
// use Classic Load Balancer with AWS OpsWorks Stacks. For more information,
// see Elastic Load Balancing (http://docs.aws.amazon.com/opsworks/latest/userguide/layers-elb.html).
//
// You must create the Elastic Load Balancing instance separately, by using
// the Elastic Load Balancing console, API, or CLI. For more information, see
@ -4197,6 +4199,89 @@ func (c *OpsWorks) GrantAccessWithContext(ctx aws.Context, input *GrantAccessInp
return out, req.Send()
}
const opListTags = "ListTags"
// ListTagsRequest generates a "aws/request.Request" representing the
// client's request for the ListTags operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See ListTags for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the ListTags method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the ListTagsRequest method.
// req, resp := client.ListTagsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/ListTags
func (c *OpsWorks) ListTagsRequest(input *ListTagsInput) (req *request.Request, output *ListTagsOutput) {
op := &request.Operation{
Name: opListTags,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &ListTagsInput{}
}
output = &ListTagsOutput{}
req = c.newRequest(op, input, output)
return
}
// ListTags API operation for AWS OpsWorks.
//
// Returns a list of tags that are applied to the specified stack or layer.
//
// 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 AWS OpsWorks's
// API operation ListTags for usage and error information.
//
// Returned Error Codes:
// * ErrCodeValidationException "ValidationException"
// Indicates that a request was not valid.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// Indicates that a resource was not found.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/ListTags
func (c *OpsWorks) ListTags(input *ListTagsInput) (*ListTagsOutput, error) {
req, out := c.ListTagsRequest(input)
return out, req.Send()
}
// ListTagsWithContext is the same as ListTags with the addition of
// the ability to pass a context and additional request options.
//
// See ListTags 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 *OpsWorks) ListTagsWithContext(ctx aws.Context, input *ListTagsInput, opts ...request.Option) (*ListTagsOutput, error) {
req, out := c.ListTagsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opRebootInstance = "RebootInstance"
// RebootInstanceRequest generates a "aws/request.Request" representing the
@ -5396,6 +5481,93 @@ func (c *OpsWorks) StopStackWithContext(ctx aws.Context, input *StopStackInput,
return out, req.Send()
}
const opTagResource = "TagResource"
// TagResourceRequest generates a "aws/request.Request" representing the
// client's request for the TagResource operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See TagResource for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the TagResource method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the TagResourceRequest method.
// req, resp := client.TagResourceRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/TagResource
func (c *OpsWorks) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) {
op := &request.Operation{
Name: opTagResource,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &TagResourceInput{}
}
output = &TagResourceOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// TagResource API operation for AWS OpsWorks.
//
// Apply cost-allocation tags to a specified stack or layer in AWS OpsWorks
// Stacks. For more information about how tagging works, see Tags (http://docs.aws.amazon.com/opsworks/latest/userguide/tagging.html)
// in the AWS OpsWorks User Guide.
//
// 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 AWS OpsWorks's
// API operation TagResource for usage and error information.
//
// Returned Error Codes:
// * ErrCodeValidationException "ValidationException"
// Indicates that a request was not valid.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// Indicates that a resource was not found.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/TagResource
func (c *OpsWorks) TagResource(input *TagResourceInput) (*TagResourceOutput, error) {
req, out := c.TagResourceRequest(input)
return out, req.Send()
}
// TagResourceWithContext is the same as TagResource with the addition of
// the ability to pass a context and additional request options.
//
// See TagResource 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 *OpsWorks) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {
req, out := c.TagResourceRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opUnassignInstance = "UnassignInstance"
// UnassignInstanceRequest generates a "aws/request.Request" representing the
@ -5580,6 +5752,91 @@ func (c *OpsWorks) UnassignVolumeWithContext(ctx aws.Context, input *UnassignVol
return out, req.Send()
}
const opUntagResource = "UntagResource"
// UntagResourceRequest generates a "aws/request.Request" representing the
// client's request for the UntagResource operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See UntagResource for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the UntagResource method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the UntagResourceRequest method.
// req, resp := client.UntagResourceRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UntagResource
func (c *OpsWorks) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) {
op := &request.Operation{
Name: opUntagResource,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &UntagResourceInput{}
}
output = &UntagResourceOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// UntagResource API operation for AWS OpsWorks.
//
// Removes tags from a specified stack or layer.
//
// 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 AWS OpsWorks's
// API operation UntagResource for usage and error information.
//
// Returned Error Codes:
// * ErrCodeValidationException "ValidationException"
// Indicates that a request was not valid.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// Indicates that a resource was not found.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UntagResource
func (c *OpsWorks) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) {
req, out := c.UntagResourceRequest(input)
return out, req.Send()
}
// UntagResourceWithContext is the same as UntagResource with the addition of
// the ability to pass a context and additional request options.
//
// See UntagResource 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 *OpsWorks) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {
req, out := c.UntagResourceRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opUpdateApp = "UpdateApp"
// UpdateAppRequest generates a "aws/request.Request" representing the
@ -7117,8 +7374,8 @@ type CloneStackInput struct {
// The stack's operating system, which must be set to one of the following.
//
// * A supported Linux operating system: An Amazon Linux version, such as
// Amazon Linux 2016.09, Amazon Linux 2016.03, Amazon Linux 2015.09, or Amazon
// Linux 2015.03.
// Amazon Linux 2017.03, Amazon Linux 2016.09, Amazon Linux 2016.03, Amazon
// Linux 2015.09, or Amazon Linux 2015.03.
//
// * A supported Ubuntu operating system, such as Ubuntu 16.04 LTS, Ubuntu
// 14.04 LTS, or Ubuntu 12.04 LTS.
@ -7682,25 +7939,29 @@ type Command struct {
// The command type:
//
// * configure
//
// * deploy
//
// * execute_recipes
//
// * install_dependencies
//
// * restart
//
// * rollback
//
// * setup
//
// * start
//
// * stop
//
// * restart
//
// * undeploy
//
// * update_dependencies
//
// * install_dependencies
//
// * update_custom_cookbooks
//
// * execute_recipes
// * update_dependencies
Type *string `type:"string"`
}
@ -8197,8 +8458,8 @@ type CreateInstanceInput struct {
// The instance's operating system, which must be set to one of the following.
//
// * A supported Linux operating system: An Amazon Linux version, such as
// Amazon Linux 2016.09, Amazon Linux 2016.03, Amazon Linux 2015.09, or Amazon
// Linux 2015.03.
// Amazon Linux 2017.03, Amazon Linux 2016.09, Amazon Linux 2016.03, Amazon
// Linux 2015.09, or Amazon Linux 2015.03.
//
// * A supported Ubuntu operating system, such as Ubuntu 16.04 LTS, Ubuntu
// 14.04 LTS, or Ubuntu 12.04 LTS.
@ -8763,8 +9024,8 @@ type CreateStackInput struct {
// You can specify one of the following.
//
// * A supported Linux operating system: An Amazon Linux version, such as
// Amazon Linux 2016.09, Amazon Linux 2016.03, Amazon Linux 2015.09, or Amazon
// Linux 2015.03.
// Amazon Linux 2017.03, Amazon Linux 2016.09, Amazon Linux 2016.03, Amazon
// Linux 2015.09, or Amazon Linux 2015.03.
//
// * A supported Ubuntu operating system, such as Ubuntu 16.04 LTS, Ubuntu
// 14.04 LTS, or Ubuntu 12.04 LTS.
@ -9665,17 +9926,17 @@ type DeploymentCommand struct {
// The update_dependencies command takes two arguments:
//
// * upgrade_os_to - Specifies the desired Amazon Linux version for instances
// whose OS you want to upgrade, such as Amazon Linux 2014.09. You must also
// whose OS you want to upgrade, such as Amazon Linux 2016.09. You must also
// set the allow_reboot argument to true.
//
// * allow_reboot - Specifies whether to allow AWS OpsWorks Stacks to reboot
// the instances if necessary, after installing the updates. This argument
// can be set to either true or false. The default value is false.
//
// For example, to upgrade an instance to Amazon Linux 2014.09, set Args to
// For example, to upgrade an instance to Amazon Linux 2016.09, set Args to
// the following.
//
// { "upgrade_os_to":["Amazon Linux 2014.09"], "allow_reboot":["true"] }
// { "upgrade_os_to":["Amazon Linux 2016.09"], "allow_reboot":["true"] }
Args map[string][]*string `type:"map"`
// Specifies the operation. You can specify only one command.
@ -12057,6 +12318,8 @@ type Instance struct {
// The instance architecture: "i386" or "x86_64".
Architecture *string `type:"string" enum:"Architecture"`
Arn *string `type:"string"`
// For load-based or time-based instances, the type.
AutoScalingType *string `type:"string" enum:"AutoScalingType"`
@ -12124,7 +12387,7 @@ type Instance struct {
// The instance's platform.
Platform *string `type:"string"`
// The The instance's private DNS name.
// The instance's private DNS name.
PrivateDns *string `type:"string"`
// The instance's private IP address.
@ -12238,6 +12501,12 @@ func (s *Instance) SetArchitecture(v string) *Instance {
return s
}
// SetArn sets the Arn field's value.
func (s *Instance) SetArn(v string) *Instance {
s.Arn = &v
return s
}
// SetAutoScalingType sets the AutoScalingType field's value.
func (s *Instance) SetAutoScalingType(v string) *Instance {
s.AutoScalingType = &v
@ -12687,6 +12956,8 @@ func (s *InstancesCount) SetUnassigning(v int64) *InstancesCount {
type Layer struct {
_ struct{} `type:"structure"`
Arn *string `type:"string"`
// The layer attributes.
//
// For the HaproxyStatsPassword, MysqlRootPassword, and GangliaPassword attributes,
@ -12793,6 +13064,12 @@ func (s Layer) GoString() string {
return s.String()
}
// SetArn sets the Arn field's value.
func (s *Layer) SetArn(v string) *Layer {
s.Arn = &v
return s
}
// SetAttributes sets the Attributes field's value.
func (s *Layer) SetAttributes(v map[string]*string) *Layer {
s.Attributes = v
@ -12950,6 +13227,103 @@ func (s *LifecycleEventConfiguration) SetShutdown(v *ShutdownEventConfiguration)
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/ListTagsRequest
type ListTagsInput struct {
_ struct{} `type:"structure"`
// Do not use. A validation exception occurs if you add a MaxResults parameter
// to a ListTagsRequest call.
MaxResults *int64 `type:"integer"`
// Do not use. A validation exception occurs if you add a NextToken parameter
// to a ListTagsRequest call.
NextToken *string `type:"string"`
// The stack or layer's Amazon Resource Number (ARN).
//
// ResourceArn is a required field
ResourceArn *string `type:"string" required:"true"`
}
// String returns the string representation
func (s ListTagsInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ListTagsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListTagsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListTagsInput"}
if s.ResourceArn == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetMaxResults sets the MaxResults field's value.
func (s *ListTagsInput) SetMaxResults(v int64) *ListTagsInput {
s.MaxResults = &v
return s
}
// SetNextToken sets the NextToken field's value.
func (s *ListTagsInput) SetNextToken(v string) *ListTagsInput {
s.NextToken = &v
return s
}
// SetResourceArn sets the ResourceArn field's value.
func (s *ListTagsInput) SetResourceArn(v string) *ListTagsInput {
s.ResourceArn = &v
return s
}
// Contains the response to a ListTags request.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/ListTagsResult
type ListTagsOutput struct {
_ struct{} `type:"structure"`
// If a paginated request does not return all of the remaining results, this
// parameter is set to a token that you can assign to the request object's NextToken
// parameter to get the next set of results. If the previous paginated request
// returned all of the remaining results, this parameter is set to null.
NextToken *string `type:"string"`
// A set of key-value pairs that contain tag keys and tag values that are attached
// to a stack or layer.
Tags map[string]*string `type:"map"`
}
// String returns the string representation
func (s ListTagsOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ListTagsOutput) GoString() string {
return s.String()
}
// SetNextToken sets the NextToken field's value.
func (s *ListTagsOutput) SetNextToken(v string) *ListTagsOutput {
s.NextToken = &v
return s
}
// SetTags sets the Tags field's value.
func (s *ListTagsOutput) SetTags(v map[string]*string) *ListTagsOutput {
s.Tags = v
return s
}
// Describes a layer's load-based auto scaling configuration.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/LoadBasedAutoScalingConfiguration
type LoadBasedAutoScalingConfiguration struct {
@ -14387,7 +14761,7 @@ type Source struct {
// The repository type.
Type *string `type:"string" enum:"SourceType"`
// The source URL.
// The source URL. The following is an example of an Amazon S3 source URL: https://s3.amazonaws.com/opsworks-demo-bucket/opsworks_cookbook_demo.tar.gz.
Url *string `type:"string"`
// This parameter depends on the repository type.
@ -15066,6 +15440,90 @@ func (s StopStackOutput) GoString() string {
return s.String()
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/TagResourceRequest
type TagResourceInput struct {
_ struct{} `type:"structure"`
// The stack or layer's Amazon Resource Number (ARN).
//
// ResourceArn is a required field
ResourceArn *string `type:"string" required:"true"`
// A map that contains tag keys and tag values that are attached to a stack
// or layer.
//
// * The key cannot be empty.
//
// * The key can be a maximum of 127 characters, and can contain only Unicode
// letters, numbers, or separators, or the following special characters:
// + - = . _ : /
//
// * The value can be a maximum 255 characters, and contain only Unicode
// letters, numbers, or separators, or the following special characters:
// + - = . _ : /
//
// * Leading and trailing white spaces are trimmed from both the key and
// value.
//
// * A maximum of 40 tags is allowed for any resource.
//
// Tags is a required field
Tags map[string]*string `type:"map" required:"true"`
}
// String returns the string representation
func (s TagResourceInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s TagResourceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *TagResourceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"}
if s.ResourceArn == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceArn"))
}
if s.Tags == nil {
invalidParams.Add(request.NewErrParamRequired("Tags"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetResourceArn sets the ResourceArn field's value.
func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput {
s.ResourceArn = &v
return s
}
// SetTags sets the Tags field's value.
func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput {
s.Tags = v
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/TagResourceOutput
type TagResourceOutput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s TagResourceOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s TagResourceOutput) GoString() string {
return s.String()
}
// Contains the data needed by RDP clients such as the Microsoft Remote Desktop
// Connection to log in to the instance.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/TemporaryCredential
@ -15264,6 +15722,74 @@ func (s UnassignVolumeOutput) GoString() string {
return s.String()
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UntagResourceRequest
type UntagResourceInput struct {
_ struct{} `type:"structure"`
// The stack or layer's Amazon Resource Number (ARN).
//
// ResourceArn is a required field
ResourceArn *string `type:"string" required:"true"`
// A list of the keys of tags to be removed from a stack or layer.
//
// TagKeys is a required field
TagKeys []*string `type:"list" required:"true"`
}
// String returns the string representation
func (s UntagResourceInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s UntagResourceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UntagResourceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"}
if s.ResourceArn == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceArn"))
}
if s.TagKeys == nil {
invalidParams.Add(request.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetResourceArn sets the ResourceArn field's value.
func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput {
s.ResourceArn = &v
return s
}
// SetTagKeys sets the TagKeys field's value.
func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput {
s.TagKeys = v
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UntagResourceOutput
type UntagResourceOutput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s UntagResourceOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s UntagResourceOutput) GoString() string {
return s.String()
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateAppRequest
type UpdateAppInput struct {
_ struct{} `type:"structure"`
@ -15571,8 +16097,8 @@ type UpdateInstanceInput struct {
// You cannot update an instance that is using a custom AMI.
//
// * A supported Linux operating system: An Amazon Linux version, such as
// Amazon Linux 2016.09, Amazon Linux 2016.03, Amazon Linux 2015.09, or Amazon
// Linux 2015.03.
// Amazon Linux 2017.03, Amazon Linux 2016.09, Amazon Linux 2016.03, Amazon
// Linux 2015.09, or Amazon Linux 2015.03.
//
// * A supported Ubuntu operating system, such as Ubuntu 16.04 LTS, Ubuntu
// 14.04 LTS, or Ubuntu 12.04 LTS.
@ -16121,8 +16647,8 @@ type UpdateStackInput struct {
// The stack's operating system, which must be set to one of the following:
//
// * A supported Linux operating system: An Amazon Linux version, such as
// Amazon Linux 2016.09, Amazon Linux 2016.03, Amazon Linux 2015.09, or Amazon
// Linux 2015.03.
// Amazon Linux 2017.03, Amazon Linux 2016.09, Amazon Linux 2016.03, Amazon
// Linux 2015.09, or Amazon Linux 2015.03.
//
// * A supported Ubuntu operating system, such as Ubuntu 16.04 LTS, Ubuntu
// 14.04 LTS, or Ubuntu 12.04 LTS.

View File

@ -845,61 +845,13 @@ func (c *RDS) CopyDBSnapshotRequest(input *CopyDBSnapshotInput) (req *request.Re
// Copies the specified DB snapshot. The source DB snapshot must be in the "available"
// state.
//
// To copy a DB snapshot from a shared manual DB snapshot, SourceDBSnapshotIdentifier
// must be the Amazon Resource Name (ARN) of the shared DB snapshot.
// You can copy a snapshot from one AWS region to another. In that case, the
// region where you call the CopyDBSnapshot action is the destination region
// for the DB snapshot copy.
//
// You can copy an encrypted DB snapshot from another AWS region. In that case,
// the region where you call the CopyDBSnapshot action is the destination region
// for the encrypted DB snapshot to be copied to. To copy an encrypted DB snapshot
// from another region, you must provide the following values:
// You cannot copy an encrypted, shared DB snapshot from one AWS region to another.
//
// * KmsKeyId - The AWS Key Management System (KMS) key identifier for the
// key to use to encrypt the copy of the DB snapshot in the destination region.
//
// * PreSignedUrl - A URL that contains a Signature Version 4 signed request
// for the CopyDBSnapshot action to be called in the source region where
// the DB snapshot will be copied from. The presigned URL must be a valid
// request for the CopyDBSnapshot API action that can be executed in the
// source region that contains the encrypted DB snapshot to be copied.
//
// The presigned URL request must contain the following parameter values:
//
// DestinationRegion - The AWS Region that the encrypted DB snapshot will be
// copied to. This region is the same one where the CopyDBSnapshot action
// is called that contains this presigned URL.
//
// For example, if you copy an encrypted DB snapshot from the us-west-2 region
// to the us-east-1 region, then you will call the CopyDBSnapshot action
// in the us-east-1 region and provide a presigned URL that contains a call
// to the CopyDBSnapshot action in the us-west-2 region. For this example,
// the DestinationRegion in the presigned URL must be set to the us-east-1
// region.
//
// KmsKeyId - The KMS key identifier for the key to use to encrypt the copy
// of the DB snapshot in the destination region. This identifier is the same
// for both the CopyDBSnapshot action that is called in the destination region,
// and the action contained in the presigned URL.
//
// SourceDBSnapshotIdentifier - The DB snapshot identifier for the encrypted
// snapshot to be copied. This identifier must be in the Amazon Resource
// Name (ARN) format for the source region. For example, if you copy an encrypted
// DB snapshot from the us-west-2 region, then your SourceDBSnapshotIdentifier
// looks like this example: arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20161115.
//
// To learn how to generate a Signature Version 4 signed request, see Authenticating
// Requests: Using Query Parameters (AWS Signature Version 4) (http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html)
// and Signature Version 4 Signing Process (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).
//
// * TargetDBSnapshotIdentifier - The identifier for the new copy of the
// DB snapshot in the destination region.
//
// * SourceDBSnapshotIdentifier - The DB snapshot identifier for the encrypted
// snapshot to be copied. This identifier must be in the ARN format for the
// source region and is the same value as the SourceDBSnapshotIdentifier
// in the presigned URL.
//
// For more information on copying encrypted snapshots from one region to another,
// see Copying a DB Snapshot (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html#USER_CopyDBSnapshot)
// For more information about copying snapshots, see Copying a DB Snapshot (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopyDBSnapshot.html)
// in the Amazon RDS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@ -10695,31 +10647,40 @@ type CopyDBSnapshotInput struct {
// Resource Name (ARN), KMS key identifier, or the KMS key alias for the KMS
// encryption key.
//
// If you copy an unencrypted DB snapshot and specify a value for the KmsKeyId
// parameter, Amazon RDS encrypts the target DB snapshot using the specified
// KMS encryption key.
//
// If you copy an encrypted DB snapshot from your AWS account, you can specify
// a value for KmsKeyId to encrypt the copy with a new KMS encryption key. If
// you don't specify a value for KmsKeyId, then the copy of the DB snapshot
// is encrypted with the same KMS key as the source DB snapshot.
//
// If you copy an encrypted snapshot to a different AWS region, then you must
// specify a KMS key for the destination AWS region.
// a value for this parameter to encrypt the copy with a new KMS encryption
// key. If you don't specify a value for this parameter, then the copy of the
// DB snapshot is encrypted with the same KMS key as the source DB snapshot.
//
// If you copy an encrypted DB snapshot that is shared from another AWS account,
// then you must specify a value for KmsKeyId.
// then you must specify a value for this parameter.
//
// To copy an encrypted DB snapshot to another region, you must set KmsKeyId
// to the KMS key ID used to encrypt the copy of the DB snapshot in the destination
// region. KMS encryption keys are specific to the region that they are created
// in, and you cannot use encryption keys from one region in another region.
// If you specify this parameter when you copy an unencrypted snapshot, the
// copy is encrypted.
//
// If you copy an encrypted snapshot to a different AWS region, then you must
// specify a KMS key for the destination AWS region. KMS encryption keys are
// specific to the region that they are created in, and you cannot use encryption
// keys from one region in another region.
KmsKeyId *string `type:"string"`
// The name of an option group to associate with the copy.
//
// Specify this option if you are copying a snapshot from one AWS region to
// another, and your DB instance uses a non-default option group. If your source
// DB instance uses Transparent Data Encryption for Oracle or Microsoft SQL
// Server, you must specify this option when copying across regions. For more
// information, see Option Group Considerations (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html#USER_CopySnapshot.Options).
OptionGroupName *string `type:"string"`
// The URL that contains a Signature Version 4 signed request for the CopyDBSnapshot
// API action in the AWS region that contains the source DB snapshot to copy.
// The PreSignedUrl parameter must be used when copying an encrypted DB snapshot
// from another AWS region.
// API action in the source AWS region that contains the source DB snapshot
// to copy.
//
// You must specify this parameter when you copy an encrypted DB snapshot from
// another AWS region by using the Amazon RDS API. You can specify the source
// region option instead of this parameter when you copy an encrypted DB snapshot
// from another AWS region by using the AWS CLI.
//
// The presigned URL must be a valid request for the CopyDBSnapshot API action
// that can be executed in the source region that contains the encrypted DB
@ -10748,29 +10709,31 @@ type CopyDBSnapshotInput struct {
// an encrypted DB snapshot from the us-west-2 region, then your SourceDBSnapshotIdentifier
// looks like the following example: arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20161115.
//
// To learn how to generate a Signature Version 4 signed request, see Authenticating
//
// To learn how to generate a Signature Version 4 signed request, see Authenticating
// Requests: Using Query Parameters (AWS Signature Version 4) (http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html)
// and Signature Version 4 Signing Process (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).
// and Signature Version 4 Signing Process (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).
PreSignedUrl *string `type:"string"`
// The identifier for the source DB snapshot.
//
// If you are copying from a shared manual DB snapshot, this must be the ARN
// of the shared DB snapshot.
// If the source snapshot is in the same region as the copy, specify a valid
// DB snapshot identifier. For example, rds:mysql-instance1-snapshot-20130805.
//
// You cannot copy an encrypted, shared DB snapshot from one AWS region to another.
// If the source snapshot is in a different region than the copy, specify a
// valid DB snapshot ARN. For example, arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20130805.
//
// If you are copying from a shared manual DB snapshot, this parameter must
// be the Amazon Resource Name (ARN) of the shared DB snapshot.
//
// If you are copying an encrypted snapshot this parameter must be in the ARN
// format for the source region, and must match the SourceDBSnapshotIdentifier
// in the PreSignedUrl parameter.
//
// Constraints:
//
// * Must specify a valid system snapshot in the "available" state.
//
// * If the source snapshot is in the same region as the copy, specify a
// valid DB snapshot identifier.
//
// * If the source snapshot is in a different region than the copy, specify
// a valid DB snapshot ARN. For more information, go to Copying a DB Snapshot
// or DB Cluster Snapshot (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html).
//
// Example: rds:mydb-2012-04-02-00-01
//
// Example: arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20130805
@ -10786,7 +10749,7 @@ type CopyDBSnapshotInput struct {
// A list of tags.
Tags []*Tag `locationNameList:"Tag" type:"list"`
// The identifier for the copied snapshot.
// The identifier for the copy of the snapshot.
//
// Constraints:
//
@ -10848,6 +10811,12 @@ func (s *CopyDBSnapshotInput) SetKmsKeyId(v string) *CopyDBSnapshotInput {
return s
}
// SetOptionGroupName sets the OptionGroupName field's value.
func (s *CopyDBSnapshotInput) SetOptionGroupName(v string) *CopyDBSnapshotInput {
s.OptionGroupName = &v
return s
}
// SetPreSignedUrl sets the PreSignedUrl field's value.
func (s *CopyDBSnapshotInput) SetPreSignedUrl(v string) *CopyDBSnapshotInput {
s.PreSignedUrl = &v
@ -11904,7 +11873,7 @@ type CreateDBInstanceInput struct {
// True to enable mapping of AWS Identity and Access Management (IAM) accounts
// to database accounts; otherwise false.
//
// You can enable IAM database authentication for the following database engines
// You can enable IAM database authentication for the following database engines:
//
// * For MySQL 5.6, minor version 5.6.34 or higher
//
@ -11915,12 +11884,34 @@ type CreateDBInstanceInput struct {
// The name of the database engine to be used for this instance.
//
// Valid Values: mysql | mariadb | oracle-se1 | oracle-se2 | oracle-se | oracle-ee
// | sqlserver-ee | sqlserver-se | sqlserver-ex | sqlserver-web | postgres |
// aurora
//
// Not every database engine is available for every AWS region.
//
// Valid Values:
//
// * aurora
//
// * mariadb
//
// * mysql
//
// * oracle-ee
//
// * oracle-se2
//
// * oracle-se1
//
// * oracle-se
//
// * postgres
//
// * sqlserver-ee
//
// * sqlserver-se
//
// * sqlserver-ex
//
// * sqlserver-web
//
// Engine is a required field
Engine *string `type:"string" required:"true"`
@ -11934,142 +11925,151 @@ type CreateDBInstanceInput struct {
//
// * Version 5.6 (available in these AWS regions: ap-northeast-1, ap-northeast-2,
// ap-south-1, ap-southeast-2, eu-west-1, us-east-1, us-east-2, us-west-2):
// 5.6.10a
// 5.6.10a
//
// MariaDB
//
// * Version 10.1 (available in these AWS regions: us-east-2): 10.1.16
// * 10.1.19 (supported in all AWS regions)
//
// * Version 10.1 (available in these AWS regions: ap-northeast-1, ap-northeast-2,
// ap-south-1, ap-southeast-1, ap-southeast-2, eu-central-1, eu-west-1, sa-east-1,
// us-east-1, us-west-1, us-west-2): 10.1.14
// * 10.1.14 (supported in all regions except us-east-2)
//
// * Version 10.0 (available in all AWS regions): 10.0.24
// 10.0.28 (supported in all AWS regions)
//
// * Version 10.0 (available in these AWS regions: ap-northeast-1, ap-northeast-2,
// ap-south-1, ap-southeast-1, ap-southeast-2, eu-central-1, eu-west-1, sa-east-1,
// us-east-1, us-gov-west-1, us-west-1, us-west-2): 10.0.17
// * 10.0.24 (supported in all AWS regions)
//
// * 10.0.17 (supported in all regions except us-east-2, ca-central-1, eu-west-2)
//
// Microsoft SQL Server 2016
//
// * 13.00.2164.0.v1 (supported for all editions, and all AWS regions except
// sa-east-1)
// 13.00.4422.0.v1 (supported for all editions, and all AWS regions)
//
// * 13.00.2164.0.v1 (supported for all editions, and all AWS regions)
//
// Microsoft SQL Server 2014
//
// 12.00.5546.0.v1 (supported for all editions, and all AWS regions)
//
// * 12.00.5000.0.v1 (supported for all editions, and all AWS regions)
//
// * 12.00.4422.0.v1 (supported for all editions except Enterprise Edition,
// and all AWS regions except us-east-2)
// and all AWS regions except ca-central-1 and eu-west-2)
//
// Microsoft SQL Server 2012
//
// 11.00.6594.0.v1 (supported for all editions, and all AWS regions)
//
// * 11.00.6020.0.v1 (supported for all editions, and all AWS regions)
//
// * 11.00.5058.0.v1 (supported for all editions, and all AWS regions except
// us-east-2)
// us-east-2, ca-central-1, and eu-west-2)
//
// * 11.00.2100.60.v1 (supported for all editions, and all AWS regions except
// us-east-2)
// us-east-2, ca-central-1, and eu-west-2)
//
// Microsoft SQL Server 2008 R2
//
// * 10.50.6529.0.v1 (supported for all editions, and all AWS regions except
// us-east-2)
// 10.50.6529.0.v1 (supported for all editions, and all AWS regions except us-east-2,
// ca-central-1, and eu-west-2)
//
// * 10.50.6000.34.v1 (supported for all editions, and all AWS regions except
// us-east-2)
// us-east-2, ca-central-1, and eu-west-2)
//
// * 10.50.2789.0.v1 (supported for all editions, and all AWS regions except
// us-east-2)
// us-east-2, ca-central-1, and eu-west-2)
//
// MySQL
//
// * Version 5.7 (available in all AWS regions): 5.7.11
// 5.7.17 (supported in all AWS regions)
//
// * Version 5.7 (available in these AWS regions: ap-northeast-1, ap-northeast-2,
// ap-south-1, ap-southeast-1, ap-southeast-2, eu-central-1, eu-west-1, sa-east-1,
// us-east-1, us-gov-west-1, us-west-1, us-west-2): 5.7.10
// * 5.7.16 (supported in all AWS regions)
//
// * Version 5.6 (available in all AWS regions): 5.6.29
// * 5.7.11 (supported in all AWS regions)
//
// * Version 5.6 (available in these AWS regions: ap-northeast-1, ap-northeast-2,
// ap-south-1, ap-southeast-1, ap-southeast-2, eu-central-1, eu-west-1, sa-east-1,
// us-east-1, us-gov-west-1, us-west-1, us-west-2): 5.6.27
// * 5.7.10 (supported in all regions except us-east-2, ca-central-1, eu-west-2)
//
// * Version 5.6 (available in these AWS regions: ap-northeast-1, ap-northeast-2,
// ap-southeast-1, ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, us-east-1,
// us-gov-west-1, us-west-1, us-west-2): 5.6.23
// * 5.6.35 (supported in all AWS regions)
//
// * Version 5.6 (available in these AWS regions: ap-northeast-1, ap-southeast-1,
// ap-southeast-2, eu-central-1, eu-west-1, sa-east-1, us-east-1, us-gov-west-1,
// us-west-1, us-west-2): 5.6.19a | 5.6.19b | 5.6.21 | 5.6.21b | 5.6.22
// * 5.6.34 (supported in all AWS regions)
//
// * Version 5.5 (available in all AWS regions): 5.5.46
// * 5.6.29 (supported in all AWS regions)
//
// * Version 5.1 (only available in AWS regions ap-northeast-1, ap-southeast-1,
// ap-southeast-2, eu-west-1, sa-east-1, us-east-1, us-gov-west-1, us-west-1,
// us-west-2): 5.1.73a | 5.1.73b
// * 5.6.27 (supported in all regions except us-east-2, ca-central-1, eu-west-2)
//
// * 5.6.23 (supported in all regions except us-east-2, ap-south-1, ca-central-1,
// eu-west-2)
//
// * 5.6.22 (supported in all regions except us-east-2, ap-south-1, ap-northeast-2,
// ca-central-1, eu-west-2)
//
// * 5.6.21b (supported in all regions except us-east-2, ap-south-1, ap-northeast-2,
// ca-central-1, eu-west-2)
//
// * 5.6.21 (supported in all regions except us-east-2, ap-south-1, ap-northeast-2,
// ca-central-1, eu-west-2)
//
// * 5.6.19b (supported in all regions except us-east-2, ap-south-1, ap-northeast-2,
// ca-central-1, eu-west-2)
//
// * 5.6.19a (supported in all regions except us-east-2, ap-south-1, ap-northeast-2,
// ca-central-1, eu-west-2)
//
// 5.5.54(supported in all AWS regions)
//
// 5.5.53(supported in all AWS regions)
//
// 5.5.46(supported in all AWS regions)
//
// Oracle 12c
//
// * 12.1.0.2.v8 (supported for EE in all AWS regions, and SE2 in all AWS
// regions except us-gov-west-1)
// 12.1.0.2.v8(supported for EE in all AWS regions, and SE2 in all AWS regions except us-gov-west-1)
//
// * 12.1.0.2.v7 (supported for EE in all AWS regions, and SE2 in all AWS
// regions except us-gov-west-1)
// 12.1.0.2.v7(supported for EE in all AWS regions, and SE2 in all AWS regions except us-gov-west-1)
//
// * 12.1.0.2.v6 (supported for EE in all AWS regions, and SE2 in all AWS
// regions except us-gov-west-1)
// 12.1.0.2.v6(supported for EE in all AWS regions, and SE2 in all AWS regions except us-gov-west-1)
//
// * 12.1.0.2.v5 (supported for EE in all AWS regions, and SE2 in all AWS
// regions except us-gov-west-1)
// 12.1.0.2.v5(supported for EE in all AWS regions, and SE2 in all AWS regions except us-gov-west-1)
//
// * 12.1.0.2.v4 (supported for EE in all AWS regions, and SE2 in all AWS
// regions except us-gov-west-1)
// 12.1.0.2.v4(supported for EE in all AWS regions, and SE2 in all AWS regions except us-gov-west-1)
//
// * 12.1.0.2.v3 (supported for EE in all AWS regions, and SE2 in all AWS
// regions except us-gov-west-1)
// 12.1.0.2.v3(supported for EE in all AWS regions, and SE2 in all AWS regions except us-gov-west-1)
//
// * 12.1.0.2.v2 (supported for EE in all AWS regions, and SE2 in all AWS
// regions except us-gov-west-1)
// 12.1.0.2.v2(supported for EE in all AWS regions, and SE2 in all AWS regions except us-gov-west-1)
//
// * 12.1.0.2.v1 (supported for EE in all AWS regions, and SE2 in all AWS
// regions except us-gov-west-1)
// 12.1.0.2.v1(supported for EE in all AWS regions, and SE2 in all AWS regions except us-gov-west-1)
//
// Oracle 11g
//
// * 11.2.0.4.v12 (supported for EE, SE1, and SE, in all AWS regions)
// 11.2.0.4.v12(supported for EE, SE1, and SE, in all AWS regions)
//
// * 11.2.0.4.v11 (supported for EE, SE1, and SE, in all AWS regions)
// 11.2.0.4.v11(supported for EE, SE1, and SE, in all AWS regions)
//
// * 11.2.0.4.v10 (supported for EE, SE1, and SE, in all AWS regions)
// 11.2.0.4.v10(supported for EE, SE1, and SE, in all AWS regions)
//
// * 11.2.0.4.v9 (supported for EE, SE1, and SE, in all AWS regions)
// 11.2.0.4.v9(supported for EE, SE1, and SE, in all AWS regions)
//
// * 11.2.0.4.v8 (supported for EE, SE1, and SE, in all AWS regions)
// 11.2.0.4.v8(supported for EE, SE1, and SE, in all AWS regions)
//
// * 11.2.0.4.v7 (supported for EE, SE1, and SE, in all AWS regions)
// 11.2.0.4.v7(supported for EE, SE1, and SE, in all AWS regions)
//
// * 11.2.0.4.v6 (supported for EE, SE1, and SE, in all AWS regions)
// 11.2.0.4.v6(supported for EE, SE1, and SE, in all AWS regions)
//
// * 11.2.0.4.v5 (supported for EE, SE1, and SE, in all AWS regions)
// 11.2.0.4.v5(supported for EE, SE1, and SE, in all AWS regions)
//
// * 11.2.0.4.v4 (supported for EE, SE1, and SE, in all AWS regions)
// 11.2.0.4.v4(supported for EE, SE1, and SE, in all AWS regions)
//
// * 11.2.0.4.v3 (supported for EE, SE1, and SE, in all AWS regions)
// 11.2.0.4.v3(supported for EE, SE1, and SE, in all AWS regions)
//
// * 11.2.0.4.v1 (supported for EE, SE1, and SE, in all AWS regions)
// 11.2.0.4.v1(supported for EE, SE1, and SE, in all AWS regions)
//
// PostgreSQL
//
// * Version 9.6.x: 9.6.1 | 9.6.2
// Version 9.6.x: 9.6.1 | 9.6.2
//
// * Version 9.5.x:9.5.6 | 9.5.4 | 9.5.2
// Version 9.5.x:9.5.6 | 9.5.4 | 9.5.2
//
// * Version 9.4.x:9.4.11 | 9.4.9 | 9.4.7
// Version 9.4.x:9.4.11 | 9.4.9 | 9.4.7
//
// * Version 9.3.x:9.3.16 | 9.3.14 | 9.3.12
// Version 9.3.x:9.3.16 | 9.3.14 | 9.3.12
EngineVersion *string `type:"string"`
// The amount of Provisioned IOPS (input/output operations per second) to be
@ -12634,6 +12634,10 @@ type CreateDBInstanceOutput struct {
//
// * ModifyDBInstance
//
// * StopDBInstance
//
// * StartDBInstance
//
// This data type is used as a response element in the DescribeDBInstances action.
DBInstance *DBInstance `type:"structure"`
}
@ -13048,6 +13052,10 @@ type CreateDBInstanceReadReplicaOutput struct {
//
// * ModifyDBInstance
//
// * StopDBInstance
//
// * StartDBInstance
//
// This data type is used as a response element in the DescribeDBInstances action.
DBInstance *DBInstance `type:"structure"`
}
@ -13846,6 +13854,9 @@ type DBCluster struct {
// associated with.
CharacterSetName *string `type:"string"`
// Identifies the clone group to which the DB cluster is associated.
CloneGroupId *string `type:"string"`
// Specifies the time when the DB cluster was created, in Universal Coordinated
// Time (UTC).
ClusterCreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
@ -13999,6 +14010,12 @@ func (s *DBCluster) SetCharacterSetName(v string) *DBCluster {
return s
}
// SetCloneGroupId sets the CloneGroupId field's value.
func (s *DBCluster) SetCloneGroupId(v string) *DBCluster {
s.CloneGroupId = &v
return s
}
// SetClusterCreateTime sets the ClusterCreateTime field's value.
func (s *DBCluster) SetClusterCreateTime(v time.Time) *DBCluster {
s.ClusterCreateTime = &v
@ -14811,6 +14828,10 @@ func (s *DBEngineVersion) SetValidUpgradeTarget(v []*UpgradeTarget) *DBEngineVer
//
// * ModifyDBInstance
//
// * StopDBInstance
//
// * StartDBInstance
//
// This data type is used as a response element in the DescribeDBInstances action.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DBInstance
type DBInstance struct {
@ -16451,6 +16472,10 @@ type DeleteDBInstanceOutput struct {
//
// * ModifyDBInstance
//
// * StopDBInstance
//
// * StartDBInstance
//
// This data type is used as a response element in the DescribeDBInstances action.
DBInstance *DBInstance `type:"structure"`
}
@ -22601,6 +22626,10 @@ type ModifyDBInstanceOutput struct {
//
// * ModifyDBInstance
//
// * StopDBInstance
//
// * StartDBInstance
//
// This data type is used as a response element in the DescribeDBInstances action.
DBInstance *DBInstance `type:"structure"`
}
@ -24527,6 +24556,10 @@ type PromoteReadReplicaOutput struct {
//
// * ModifyDBInstance
//
// * StopDBInstance
//
// * StartDBInstance
//
// This data type is used as a response element in the DescribeDBInstances action.
DBInstance *DBInstance `type:"structure"`
}
@ -24715,6 +24748,10 @@ type RebootDBInstanceOutput struct {
//
// * ModifyDBInstance
//
// * StopDBInstance
//
// * StartDBInstance
//
// This data type is used as a response element in the DescribeDBInstances action.
DBInstance *DBInstance `type:"structure"`
}
@ -26175,7 +26212,7 @@ type RestoreDBClusterToPointInTimeInput struct {
// * If the DB cluster is not encrypted, then the restored DB cluster is
// not encrypted.
//
// If DBClusterIdentifier refers to a DB cluster that is note encrypted, then
// If DBClusterIdentifier refers to a DB cluster that is not encrypted, then
// the restore request is rejected.
KmsKeyId *string `type:"string"`
@ -26197,11 +26234,31 @@ type RestoreDBClusterToPointInTimeInput struct {
//
// * Must be before the latest restorable time for the DB instance
//
// * Must be specified if UseLatestRestorableTime parameter is not provided
//
// * Cannot be specified if UseLatestRestorableTime parameter is true
//
// * Cannot be specified if RestoreType parameter is copy-on-write
//
// Example: 2015-03-07T23:45:00Z
RestoreToTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
// The type of restore to be performed. You can specify one of the following
// values:
//
// * full-copy - The new DB cluster is restored as a full copy of the source
// DB cluster.
//
// * copy-on-write - The new DB cluster is restored as a clone of the source
// DB cluster.
//
// Constraints: You cannot specify copy-on-write if the engine version of the
// source DB cluster is earlier than 1.11.
//
// If you don't specify a RestoreType value, then the new DB cluster is restored
// as a full copy of the source DB cluster.
RestoreType *string `type:"string"`
// The identifier of the source DB cluster from which to restore.
//
// Constraints:
@ -26228,7 +26285,7 @@ type RestoreDBClusterToPointInTimeInput struct {
// Constraints: Cannot be specified if RestoreToTime parameter is provided.
UseLatestRestorableTime *bool `type:"boolean"`
// A lst of VPC security groups that the new DB cluster belongs to.
// A list of VPC security groups that the new DB cluster belongs to.
VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"`
}
@ -26300,6 +26357,12 @@ func (s *RestoreDBClusterToPointInTimeInput) SetRestoreToTime(v time.Time) *Rest
return s
}
// SetRestoreType sets the RestoreType field's value.
func (s *RestoreDBClusterToPointInTimeInput) SetRestoreType(v string) *RestoreDBClusterToPointInTimeInput {
s.RestoreType = &v
return s
}
// SetSourceDBClusterIdentifier sets the SourceDBClusterIdentifier field's value.
func (s *RestoreDBClusterToPointInTimeInput) SetSourceDBClusterIdentifier(v string) *RestoreDBClusterToPointInTimeInput {
s.SourceDBClusterIdentifier = &v
@ -26720,6 +26783,10 @@ type RestoreDBInstanceFromDBSnapshotOutput struct {
//
// * ModifyDBInstance
//
// * StopDBInstance
//
// * StartDBInstance
//
// This data type is used as a response element in the DescribeDBInstances action.
DBInstance *DBInstance `type:"structure"`
}
@ -27123,6 +27190,10 @@ type RestoreDBInstanceToPointInTimeOutput struct {
//
// * ModifyDBInstance
//
// * StopDBInstance
//
// * StartDBInstance
//
// This data type is used as a response element in the DescribeDBInstances action.
DBInstance *DBInstance `type:"structure"`
}
@ -27358,6 +27429,10 @@ type StartDBInstanceOutput struct {
//
// * ModifyDBInstance
//
// * StopDBInstance
//
// * StartDBInstance
//
// This data type is used as a response element in the DescribeDBInstances action.
DBInstance *DBInstance `type:"structure"`
}
@ -27439,6 +27514,10 @@ type StopDBInstanceOutput struct {
//
// * ModifyDBInstance
//
// * StopDBInstance
//
// * StartDBInstance
//
// This data type is used as a response element in the DescribeDBInstances action.
DBInstance *DBInstance `type:"structure"`
}

View File

@ -94,11 +94,21 @@ func (c *Route53) AssociateVPCWithHostedZoneRequest(input *AssociateVPCWithHoste
// 53 doesn't support associating a VPC with a public hosted zone.
//
// * ErrCodeConflictingDomainExists "ConflictingDomainExists"
// You specified an Amazon VPC that you're already using for another hosted
// zone, and the domain that you specified for one of the hosted zones is a
// subdomain of the domain that you specified for the other hosted zone. For
// example, you can't use the same Amazon VPC for the hosted zones for example.com
// and test.example.com.
// The cause of this error depends on whether you're trying to create a public
// or a private hosted zone:
//
// * Public hosted zone: Two hosted zones that have the same name or that
// have a parent/child relationship (example.com and test.example.com) can't
// have any common name servers. You tried to create a hosted zone that has
// the same name as an existing hosted zone or that's the parent or child
// of an existing hosted zone, and you specified a delegation set that shares
// one or more name servers with the existing hosted zone.
//
// * Private hosted zone: You specified an Amazon VPC that you're already
// using for another hosted zone, and the domain that you specified for one
// of the hosted zones is a subdomain of the domain that you specified for
// the other hosted zone. For example, you can't use the same Amazon VPC
// for the hosted zones for example.com and test.example.com.
//
// * ErrCodeLimitsExceeded "LimitsExceeded"
// The limits specified for a resource have been exceeded.
@ -241,8 +251,8 @@ func (c *Route53) ChangeResourceRecordSetsRequest(input *ChangeResourceRecordSet
// your changes to all of the Amazon Route 53 authoritative DNS servers. While
// your changes are propagating, GetChange returns a status of PENDING. When
// propagation is complete, GetChange returns a status of INSYNC. Changes generally
// propagate to all Amazon Route 53 name servers in a few minutes. In rare circumstances,
// propagation can take up to 30 minutes. For more information, see GetChange.
// propagate to all Amazon Route 53 name servers within 60 seconds. For more
// information, see GetChange.
//
// Limits on ChangeResourceRecordSets Requests
//
@ -646,11 +656,21 @@ func (c *Route53) CreateHostedZoneRequest(input *CreateHostedZoneInput) (req *re
// this error, contact Customer Support.
//
// * ErrCodeConflictingDomainExists "ConflictingDomainExists"
// You specified an Amazon VPC that you're already using for another hosted
// zone, and the domain that you specified for one of the hosted zones is a
// subdomain of the domain that you specified for the other hosted zone. For
// example, you can't use the same Amazon VPC for the hosted zones for example.com
// and test.example.com.
// The cause of this error depends on whether you're trying to create a public
// or a private hosted zone:
//
// * Public hosted zone: Two hosted zones that have the same name or that
// have a parent/child relationship (example.com and test.example.com) can't
// have any common name servers. You tried to create a hosted zone that has
// the same name as an existing hosted zone or that's the parent or child
// of an existing hosted zone, and you specified a delegation set that shares
// one or more name servers with the existing hosted zone.
//
// * Private hosted zone: You specified an Amazon VPC that you're already
// using for another hosted zone, and the domain that you specified for one
// of the hosted zones is a subdomain of the domain that you specified for
// the other hosted zone. For example, you can't use the same Amazon VPC
// for the hosted zones for example.com and test.example.com.
//
// * ErrCodeNoSuchDelegationSet "NoSuchDelegationSet"
// A reusable delegation set with the specified ID does not exist.
@ -1256,9 +1276,7 @@ func (c *Route53) DeleteHealthCheckRequest(input *DeleteHealthCheckInput) (req *
// request.
//
// * ErrCodeHealthCheckInUse "HealthCheckInUse"
// The health check ID for this health check is referenced in the HealthCheckId
// element in one of the resource record sets in one of the hosted zones that
// are owned by the current AWS account.
// This error code is not in use.
//
// * ErrCodeInvalidInput "InvalidInput"
// The input is not valid.
@ -8673,7 +8691,7 @@ type HealthCheckConfig struct {
// health checks, Amazon Route 53 will briefly continue to perform checks from
// that region to ensure that some health checkers are always checking the endpoint
// (for example, if you replace three regions with four different regions).
Regions []*string `locationNameList:"Region" min:"1" type:"list"`
Regions []*string `locationNameList:"Region" min:"3" type:"list"`
// The number of seconds between the time that Amazon Route 53 gets a response
// from your endpoint and the time that it sends the next health check request.
@ -8769,8 +8787,8 @@ func (s *HealthCheckConfig) Validate() error {
if s.Port != nil && *s.Port < 1 {
invalidParams.Add(request.NewErrParamMinValue("Port", 1))
}
if s.Regions != nil && len(s.Regions) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Regions", 1))
if s.Regions != nil && len(s.Regions) < 3 {
invalidParams.Add(request.NewErrParamMinLen("Regions", 3))
}
if s.RequestInterval != nil && *s.RequestInterval < 10 {
invalidParams.Add(request.NewErrParamMinValue("RequestInterval", 10))
@ -11313,6 +11331,34 @@ type ResourceRecordSet struct {
// * Configuring Failover in a Private Hosted Zone (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html)
HealthCheckId *string `type:"string"`
// Multivalue answer resource record sets only: To route traffic approximately
// randomly to multiple resources, such as web servers, create one multivalue
// answer record for each resource and specify true for MultiValueAnswer. Note
// the following:
//
// * If you associate a health check with a multivalue answer resource record
// set, Amazon Route 53 responds to DNS queries with the corresponding IP
// address only when the health check is healthy.
//
// * If you don't associate a health check with a multivalue answer record,
// Amazon Route 53 always considers the record to be healthy.
//
// * Amazon Route 53 responds to DNS queries with up to eight healthy records;
// if you have eight or fewer healthy records, Amazon Route 53 responds to
// all DNS queries with all the healthy records.
//
// * If you have more than eight healthy records, Amazon Route 53 responds
// to different DNS resolvers with different combinations of healthy records.
//
// * When all records are unhealthy, Amazon Route 53 responds to DNS queries
// with up to eight unhealthy records.
//
// * If a resource becomes unavailable after a resolver caches a response,
// client software typically tries another of the IP addresses in the response.
//
// You can't create multivalue answer alias records.
MultiValueAnswer *bool `type:"boolean"`
// The name of the domain you want to perform the action on.
//
// Enter a fully qualified domain name, for example, www.example.com. You can
@ -11393,8 +11439,8 @@ type ResourceRecordSet struct {
// The resource record cache time to live (TTL), in seconds. Note the following:
//
// * If you're creating an alias resource record set, omit TTL. Amazon Route
// 53 uses the value of TTL for the alias target.
// * If you're creating or updating an alias resource record set, omit TTL.
// Amazon Route 53 uses the value of TTL for the alias target.
//
// * If you're associating this resource record set with a health check (if
// you're adding a HealthCheckId element), we recommend that you specify
@ -11436,6 +11482,9 @@ type ResourceRecordSet struct {
// of weighted, latency, geolocation, or failover resource record sets, specify
// the same value for all of the resource record sets in the group.
//
// Valid values for multivalue answer resource record sets: A | AAAA | MX |
// NAPTR | PTR | SPF | SRV | TXT
//
// SPF records were formerly used to verify the identity of the sender of email
// messages. However, we no longer recommend that you create resource record
// sets for which the value of Type is SPF. RFC 7208, Sender Policy Framework
@ -11461,8 +11510,8 @@ type ResourceRecordSet struct {
// * Amazon S3 buckets:A
//
// * Another resource record set in this hosted zone: Specify the type of
// the resource record set for which you're creating the alias. Specify any
// value except NS or SOA.
// the resource record set that you're creating the alias for. All values
// are supported except NS and SOA.
//
// Type is a required field
Type *string `type:"string" required:"true" enum:"RRType"`
@ -11585,6 +11634,12 @@ func (s *ResourceRecordSet) SetHealthCheckId(v string) *ResourceRecordSet {
return s
}
// SetMultiValueAnswer sets the MultiValueAnswer field's value.
func (s *ResourceRecordSet) SetMultiValueAnswer(v bool) *ResourceRecordSet {
s.MultiValueAnswer = &v
return s
}
// SetName sets the Name field's value.
func (s *ResourceRecordSet) SetName(v string) *ResourceRecordSet {
s.Name = &v
@ -12480,7 +12535,7 @@ type UpdateHealthCheckInput struct {
// A complex type that contains one Region element for each region that you
// want Amazon Route 53 health checkers to check the specified endpoint from.
Regions []*string `locationNameList:"Region" min:"1" type:"list"`
Regions []*string `locationNameList:"Region" min:"3" type:"list"`
// The path that you want Amazon Route 53 to request when performing health
// checks. The path can be any value for which your endpoint will return an
@ -12523,8 +12578,8 @@ func (s *UpdateHealthCheckInput) Validate() error {
if s.Port != nil && *s.Port < 1 {
invalidParams.Add(request.NewErrParamMinValue("Port", 1))
}
if s.Regions != nil && len(s.Regions) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Regions", 1))
if s.Regions != nil && len(s.Regions) < 3 {
invalidParams.Add(request.NewErrParamMinLen("Regions", 3))
}
if s.AlarmIdentifier != nil {
if err := s.AlarmIdentifier.Validate(); err != nil {

View File

@ -14,11 +14,21 @@ const (
// ErrCodeConflictingDomainExists for service response error code
// "ConflictingDomainExists".
//
// You specified an Amazon VPC that you're already using for another hosted
// zone, and the domain that you specified for one of the hosted zones is a
// subdomain of the domain that you specified for the other hosted zone. For
// example, you can't use the same Amazon VPC for the hosted zones for example.com
// and test.example.com.
// The cause of this error depends on whether you're trying to create a public
// or a private hosted zone:
//
// * Public hosted zone: Two hosted zones that have the same name or that
// have a parent/child relationship (example.com and test.example.com) can't
// have any common name servers. You tried to create a hosted zone that has
// the same name as an existing hosted zone or that's the parent or child
// of an existing hosted zone, and you specified a delegation set that shares
// one or more name servers with the existing hosted zone.
//
// * Private hosted zone: You specified an Amazon VPC that you're already
// using for another hosted zone, and the domain that you specified for one
// of the hosted zones is a subdomain of the domain that you specified for
// the other hosted zone. For example, you can't use the same Amazon VPC
// for the hosted zones for example.com and test.example.com.
ErrCodeConflictingDomainExists = "ConflictingDomainExists"
// ErrCodeConflictingTypes for service response error code
@ -82,9 +92,7 @@ const (
// ErrCodeHealthCheckInUse for service response error code
// "HealthCheckInUse".
//
// The health check ID for this health check is referenced in the HealthCheckId
// element in one of the resource record sets in one of the hosted zones that
// are owned by the current AWS account.
// This error code is not in use.
ErrCodeHealthCheckInUse = "HealthCheckInUse"
// ErrCodeHealthCheckVersionMismatch for service response error code

File diff suppressed because it is too large Load Diff

View File

@ -44,3 +44,21 @@ func defaultInitRequestFn(r *request.Request) {
r.Handlers.Unmarshal.PushFront(copyMultipartStatusOKUnmarhsalError)
}
}
// bucketGetter is an accessor interface to grab the "Bucket" field from
// an S3 type.
type bucketGetter interface {
getBucket() string
}
// sseCustomerKeyGetter is an accessor interface to grab the "SSECustomerKey"
// field from an S3 type.
type sseCustomerKeyGetter interface {
getSSECustomerKey() string
}
// copySourceSSECustomerKeyGetter is an accessor interface to grab the
// "CopySourceSSECustomerKey" field from an S3 type.
type copySourceSSECustomerKeyGetter interface {
getCopySourceSSECustomerKey() string
}

View File

@ -8,7 +8,6 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
)
@ -113,15 +112,9 @@ func updateEndpointForAccelerate(r *request.Request) {
// Attempts to retrieve the bucket name from the request input parameters.
// If no bucket is found, or the field is empty "", false will be returned.
func bucketNameFromReqParams(params interface{}) (string, bool) {
b, _ := awsutil.ValuesAtPath(params, "Bucket")
if len(b) == 0 {
return "", false
}
if bucket, ok := b[0].(*string); ok {
if bucketStr := aws.StringValue(bucket); bucketStr != "" {
return bucketStr, true
}
if iface, ok := params.(bucketGetter); ok {
b := iface.getBucket()
return b, len(b) > 0
}
return "", false

View File

@ -5,17 +5,27 @@ import (
"encoding/base64"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
)
var errSSERequiresSSL = awserr.New("ConfigError", "cannot send SSE keys over HTTP.", nil)
func validateSSERequiresSSL(r *request.Request) {
if r.HTTPRequest.URL.Scheme != "https" {
p, _ := awsutil.ValuesAtPath(r.Params, "SSECustomerKey||CopySourceSSECustomerKey")
if len(p) > 0 {
if r.HTTPRequest.URL.Scheme == "https" {
return
}
if iface, ok := r.Params.(sseCustomerKeyGetter); ok {
if len(iface.getSSECustomerKey()) > 0 {
r.Error = errSSERequiresSSL
return
}
}
if iface, ok := r.Params.(copySourceSSECustomerKeyGetter); ok {
if len(iface.getCopySourceSSECustomerKey()) > 0 {
r.Error = errSSERequiresSSL
return
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,7 @@
// User Guide (http://docs.aws.amazon.com/systems-manager/latest/userguide/).
//
// To get started, verify prerequisites and configure managed instances. For
// more information, see Systems Manager Prerequisites (http://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-prereqs.html).
// more information, see Systems Manager Prerequisites (http://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-setting-up.html).
//
// See https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06 for more information on this service.
//

View File

@ -116,6 +116,24 @@ const (
// You cannot specify an instance ID in more than one association.
ErrCodeDuplicateInstanceId = "DuplicateInstanceId"
// ErrCodeHierarchyLevelLimitExceededException for service response error code
// "HierarchyLevelLimitExceededException".
//
// A hierarchy can have a maximum of five levels. For example:
//
// /Finance/Prod/IAD/OS/WinServ2016/license15
//
// For more information, see Working with Systems Manager Parameters (http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-working.html).
ErrCodeHierarchyLevelLimitExceededException = "HierarchyLevelLimitExceededException"
// ErrCodeHierarchyTypeMismatchException for service response error code
// "HierarchyTypeMismatchException".
//
// Parameter Store does not support changing a parameter type in a hierarchy.
// For example, you can't change a parameter from a String type to a SecureString
// type. You must create a new, unique parameter.
ErrCodeHierarchyTypeMismatchException = "HierarchyTypeMismatchException"
// ErrCodeIdempotentParameterMismatch for service response error code
// "IdempotentParameterMismatch".
//
@ -143,6 +161,12 @@ const (
// or ActivationCode and try again.
ErrCodeInvalidActivationId = "InvalidActivationId"
// ErrCodeInvalidAllowedPatternException for service response error code
// "InvalidAllowedPatternException".
//
// The request does not meet the regular expression requirement.
ErrCodeInvalidAllowedPatternException = "InvalidAllowedPatternException"
// ErrCodeInvalidAutomationExecutionParametersException for service response error code
// "InvalidAutomationExecutionParametersException".
//
@ -199,6 +223,13 @@ const (
// The specified key is not valid.
ErrCodeInvalidFilterKey = "InvalidFilterKey"
// ErrCodeInvalidFilterOption for service response error code
// "InvalidFilterOption".
//
// The specified filter option is not valid. Valid options are Equals and BeginsWith.
// For Path filter, valid options are Recursive and OneLevel.
ErrCodeInvalidFilterOption = "InvalidFilterOption"
// ErrCodeInvalidFilterValue for service response error code
// "InvalidFilterValue".
//
@ -385,6 +416,36 @@ const (
// The parameter could not be found. Verify the name and try again.
ErrCodeParameterNotFound = "ParameterNotFound"
// ErrCodeParameterPatternMismatchException for service response error code
// "ParameterPatternMismatchException".
//
// The parameter name is not valid.
ErrCodeParameterPatternMismatchException = "ParameterPatternMismatchException"
// ErrCodeResourceDataSyncAlreadyExistsException for service response error code
// "ResourceDataSyncAlreadyExistsException".
//
// A sync configuration with the same name already exists.
ErrCodeResourceDataSyncAlreadyExistsException = "ResourceDataSyncAlreadyExistsException"
// ErrCodeResourceDataSyncCountExceededException for service response error code
// "ResourceDataSyncCountExceededException".
//
// You have exceeded the allowed maximum sync configurations.
ErrCodeResourceDataSyncCountExceededException = "ResourceDataSyncCountExceededException"
// ErrCodeResourceDataSyncInvalidConfigurationException for service response error code
// "ResourceDataSyncInvalidConfigurationException".
//
// The specified sync configuration is invalid.
ErrCodeResourceDataSyncInvalidConfigurationException = "ResourceDataSyncInvalidConfigurationException"
// ErrCodeResourceDataSyncNotFoundException for service response error code
// "ResourceDataSyncNotFoundException".
//
// The specified sync name was not found.
ErrCodeResourceDataSyncNotFoundException = "ResourceDataSyncNotFoundException"
// ErrCodeResourceInUseException for service response error code
// "ResourceInUseException".
//
@ -433,6 +494,14 @@ const (
// for each type.
ErrCodeUnsupportedInventorySchemaVersionException = "UnsupportedInventorySchemaVersionException"
// ErrCodeUnsupportedOperatingSystem for service response error code
// "UnsupportedOperatingSystem".
//
// The operating systems you specified is not supported, or the operation is
// not supported for the operating system. Valid operating systems include:
// Windows, AmazonLinux, RedhatEnterpriseLinux, and Ubuntu.
ErrCodeUnsupportedOperatingSystem = "UnsupportedOperatingSystem"
// ErrCodeUnsupportedParameterType for service response error code
// "UnsupportedParameterType".
//

File diff suppressed because it is too large Load Diff

View File

@ -64,6 +64,9 @@ const (
// * You tried to create a WebACL with a DefaultActionType other than ALLOW,
// BLOCK, or COUNT.
//
// * You tried to create a RateBasedRule with a RateKey value other than
// IP.
//
// * You tried to update a WebACL with a WafActionType other than ALLOW,
// BLOCK, or COUNT.
//

File diff suppressed because it is too large Load Diff

View File

@ -64,6 +64,9 @@ const (
// * You tried to create a WebACL with a DefaultActionType other than ALLOW,
// BLOCK, or COUNT.
//
// * You tried to create a RateBasedRule with a RateKey value other than
// IP.
//
// * You tried to update a WebACL with a WafActionType other than ALLOW,
// BLOCK, or COUNT.
//

22
vendor/github.com/blang/semver/LICENSE generated vendored Normal file
View File

@ -0,0 +1,22 @@
The MIT License
Copyright (c) 2014 Benedikt Lang <github at benediktlang.de>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

194
vendor/github.com/blang/semver/README.md generated vendored Normal file
View File

@ -0,0 +1,194 @@
semver for golang [![Build Status](https://travis-ci.org/blang/semver.svg?branch=master)](https://travis-ci.org/blang/semver) [![GoDoc](https://godoc.org/github.com/blang/semver?status.png)](https://godoc.org/github.com/blang/semver) [![Coverage Status](https://img.shields.io/coveralls/blang/semver.svg)](https://coveralls.io/r/blang/semver?branch=master)
======
semver is a [Semantic Versioning](http://semver.org/) library written in golang. It fully covers spec version `2.0.0`.
Usage
-----
```bash
$ go get github.com/blang/semver
```
Note: Always vendor your dependencies or fix on a specific version tag.
```go
import github.com/blang/semver
v1, err := semver.Make("1.0.0-beta")
v2, err := semver.Make("2.0.0-beta")
v1.Compare(v2)
```
Also check the [GoDocs](http://godoc.org/github.com/blang/semver).
Why should I use this lib?
-----
- Fully spec compatible
- No reflection
- No regex
- Fully tested (Coverage >99%)
- Readable parsing/validation errors
- Fast (See [Benchmarks](#benchmarks))
- Only Stdlib
- Uses values instead of pointers
- Many features, see below
Features
-----
- Parsing and validation at all levels
- Comparator-like comparisons
- Compare Helper Methods
- InPlace manipulation
- Ranges `>=1.0.0 <2.0.0 || >=3.0.0 !3.0.1-beta.1`
- Wildcards `>=1.x`, `<=2.5.x`
- Sortable (implements sort.Interface)
- database/sql compatible (sql.Scanner/Valuer)
- encoding/json compatible (json.Marshaler/Unmarshaler)
Ranges
------
A `Range` is a set of conditions which specify which versions satisfy the range.
A condition is composed of an operator and a version. The supported operators are:
- `<1.0.0` Less than `1.0.0`
- `<=1.0.0` Less than or equal to `1.0.0`
- `>1.0.0` Greater than `1.0.0`
- `>=1.0.0` Greater than or equal to `1.0.0`
- `1.0.0`, `=1.0.0`, `==1.0.0` Equal to `1.0.0`
- `!1.0.0`, `!=1.0.0` Not equal to `1.0.0`. Excludes version `1.0.0`.
Note that spaces between the operator and the version will be gracefully tolerated.
A `Range` can link multiple `Ranges` separated by space:
Ranges can be linked by logical AND:
- `>1.0.0 <2.0.0` would match between both ranges, so `1.1.1` and `1.8.7` but not `1.0.0` or `2.0.0`
- `>1.0.0 <3.0.0 !2.0.3-beta.2` would match every version between `1.0.0` and `3.0.0` except `2.0.3-beta.2`
Ranges can also be linked by logical OR:
- `<2.0.0 || >=3.0.0` would match `1.x.x` and `3.x.x` but not `2.x.x`
AND has a higher precedence than OR. It's not possible to use brackets.
Ranges can be combined by both AND and OR
- `>1.0.0 <2.0.0 || >3.0.0 !4.2.1` would match `1.2.3`, `1.9.9`, `3.1.1`, but not `4.2.1`, `2.1.1`
Range usage:
```
v, err := semver.Parse("1.2.3")
range, err := semver.ParseRange(">1.0.0 <2.0.0 || >=3.0.0")
if range(v) {
//valid
}
```
Example
-----
Have a look at full examples in [examples/main.go](examples/main.go)
```go
import github.com/blang/semver
v, err := semver.Make("0.0.1-alpha.preview+123.github")
fmt.Printf("Major: %d\n", v.Major)
fmt.Printf("Minor: %d\n", v.Minor)
fmt.Printf("Patch: %d\n", v.Patch)
fmt.Printf("Pre: %s\n", v.Pre)
fmt.Printf("Build: %s\n", v.Build)
// Prerelease versions array
if len(v.Pre) > 0 {
fmt.Println("Prerelease versions:")
for i, pre := range v.Pre {
fmt.Printf("%d: %q\n", i, pre)
}
}
// Build meta data array
if len(v.Build) > 0 {
fmt.Println("Build meta data:")
for i, build := range v.Build {
fmt.Printf("%d: %q\n", i, build)
}
}
v001, err := semver.Make("0.0.1")
// Compare using helpers: v.GT(v2), v.LT, v.GTE, v.LTE
v001.GT(v) == true
v.LT(v001) == true
v.GTE(v) == true
v.LTE(v) == true
// Or use v.Compare(v2) for comparisons (-1, 0, 1):
v001.Compare(v) == 1
v.Compare(v001) == -1
v.Compare(v) == 0
// Manipulate Version in place:
v.Pre[0], err = semver.NewPRVersion("beta")
if err != nil {
fmt.Printf("Error parsing pre release version: %q", err)
}
fmt.Println("\nValidate versions:")
v.Build[0] = "?"
err = v.Validate()
if err != nil {
fmt.Printf("Validation failed: %s\n", err)
}
```
Benchmarks
-----
BenchmarkParseSimple-4 5000000 390 ns/op 48 B/op 1 allocs/op
BenchmarkParseComplex-4 1000000 1813 ns/op 256 B/op 7 allocs/op
BenchmarkParseAverage-4 1000000 1171 ns/op 163 B/op 4 allocs/op
BenchmarkStringSimple-4 20000000 119 ns/op 16 B/op 1 allocs/op
BenchmarkStringLarger-4 10000000 206 ns/op 32 B/op 2 allocs/op
BenchmarkStringComplex-4 5000000 324 ns/op 80 B/op 3 allocs/op
BenchmarkStringAverage-4 5000000 273 ns/op 53 B/op 2 allocs/op
BenchmarkValidateSimple-4 200000000 9.33 ns/op 0 B/op 0 allocs/op
BenchmarkValidateComplex-4 3000000 469 ns/op 0 B/op 0 allocs/op
BenchmarkValidateAverage-4 5000000 256 ns/op 0 B/op 0 allocs/op
BenchmarkCompareSimple-4 100000000 11.8 ns/op 0 B/op 0 allocs/op
BenchmarkCompareComplex-4 50000000 30.8 ns/op 0 B/op 0 allocs/op
BenchmarkCompareAverage-4 30000000 41.5 ns/op 0 B/op 0 allocs/op
BenchmarkSort-4 3000000 419 ns/op 256 B/op 2 allocs/op
BenchmarkRangeParseSimple-4 2000000 850 ns/op 192 B/op 5 allocs/op
BenchmarkRangeParseAverage-4 1000000 1677 ns/op 400 B/op 10 allocs/op
BenchmarkRangeParseComplex-4 300000 5214 ns/op 1440 B/op 30 allocs/op
BenchmarkRangeMatchSimple-4 50000000 25.6 ns/op 0 B/op 0 allocs/op
BenchmarkRangeMatchAverage-4 30000000 56.4 ns/op 0 B/op 0 allocs/op
BenchmarkRangeMatchComplex-4 10000000 153 ns/op 0 B/op 0 allocs/op
See benchmark cases at [semver_test.go](semver_test.go)
Motivation
-----
I simply couldn't find any lib supporting the full spec. Others were just wrong or used reflection and regex which i don't like.
Contribution
-----
Feel free to make a pull request. For bigger changes create a issue first to discuss about it.
License
-----
See [LICENSE](LICENSE) file.

23
vendor/github.com/blang/semver/json.go generated vendored Normal file
View File

@ -0,0 +1,23 @@
package semver
import (
"encoding/json"
)
// MarshalJSON implements the encoding/json.Marshaler interface.
func (v Version) MarshalJSON() ([]byte, error) {
return json.Marshal(v.String())
}
// UnmarshalJSON implements the encoding/json.Unmarshaler interface.
func (v *Version) UnmarshalJSON(data []byte) (err error) {
var versionString string
if err = json.Unmarshal(data, &versionString); err != nil {
return
}
*v, err = Parse(versionString)
return
}

17
vendor/github.com/blang/semver/package.json generated vendored Normal file
View File

@ -0,0 +1,17 @@
{
"author": "blang",
"bugs": {
"URL": "https://github.com/blang/semver/issues",
"url": "https://github.com/blang/semver/issues"
},
"gx": {
"dvcsimport": "github.com/blang/semver"
},
"gxVersion": "0.10.0",
"language": "go",
"license": "MIT",
"name": "semver",
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
"version": "3.5.1"
}

416
vendor/github.com/blang/semver/range.go generated vendored Normal file
View File

@ -0,0 +1,416 @@
package semver
import (
"fmt"
"strconv"
"strings"
"unicode"
)
type wildcardType int
const (
noneWildcard wildcardType = iota
majorWildcard wildcardType = 1
minorWildcard wildcardType = 2
patchWildcard wildcardType = 3
)
func wildcardTypefromInt(i int) wildcardType {
switch i {
case 1:
return majorWildcard
case 2:
return minorWildcard
case 3:
return patchWildcard
default:
return noneWildcard
}
}
type comparator func(Version, Version) bool
var (
compEQ comparator = func(v1 Version, v2 Version) bool {
return v1.Compare(v2) == 0
}
compNE = func(v1 Version, v2 Version) bool {
return v1.Compare(v2) != 0
}
compGT = func(v1 Version, v2 Version) bool {
return v1.Compare(v2) == 1
}
compGE = func(v1 Version, v2 Version) bool {
return v1.Compare(v2) >= 0
}
compLT = func(v1 Version, v2 Version) bool {
return v1.Compare(v2) == -1
}
compLE = func(v1 Version, v2 Version) bool {
return v1.Compare(v2) <= 0
}
)
type versionRange struct {
v Version
c comparator
}
// rangeFunc creates a Range from the given versionRange.
func (vr *versionRange) rangeFunc() Range {
return Range(func(v Version) bool {
return vr.c(v, vr.v)
})
}
// Range represents a range of versions.
// A Range can be used to check if a Version satisfies it:
//
// range, err := semver.ParseRange(">1.0.0 <2.0.0")
// range(semver.MustParse("1.1.1") // returns true
type Range func(Version) bool
// OR combines the existing Range with another Range using logical OR.
func (rf Range) OR(f Range) Range {
return Range(func(v Version) bool {
return rf(v) || f(v)
})
}
// AND combines the existing Range with another Range using logical AND.
func (rf Range) AND(f Range) Range {
return Range(func(v Version) bool {
return rf(v) && f(v)
})
}
// ParseRange parses a range and returns a Range.
// If the range could not be parsed an error is returned.
//
// Valid ranges are:
// - "<1.0.0"
// - "<=1.0.0"
// - ">1.0.0"
// - ">=1.0.0"
// - "1.0.0", "=1.0.0", "==1.0.0"
// - "!1.0.0", "!=1.0.0"
//
// A Range can consist of multiple ranges separated by space:
// Ranges can be linked by logical AND:
// - ">1.0.0 <2.0.0" would match between both ranges, so "1.1.1" and "1.8.7" but not "1.0.0" or "2.0.0"
// - ">1.0.0 <3.0.0 !2.0.3-beta.2" would match every version between 1.0.0 and 3.0.0 except 2.0.3-beta.2
//
// Ranges can also be linked by logical OR:
// - "<2.0.0 || >=3.0.0" would match "1.x.x" and "3.x.x" but not "2.x.x"
//
// AND has a higher precedence than OR. It's not possible to use brackets.
//
// Ranges can be combined by both AND and OR
//
// - `>1.0.0 <2.0.0 || >3.0.0 !4.2.1` would match `1.2.3`, `1.9.9`, `3.1.1`, but not `4.2.1`, `2.1.1`
func ParseRange(s string) (Range, error) {
parts := splitAndTrim(s)
orParts, err := splitORParts(parts)
if err != nil {
return nil, err
}
expandedParts, err := expandWildcardVersion(orParts)
if err != nil {
return nil, err
}
var orFn Range
for _, p := range expandedParts {
var andFn Range
for _, ap := range p {
opStr, vStr, err := splitComparatorVersion(ap)
if err != nil {
return nil, err
}
vr, err := buildVersionRange(opStr, vStr)
if err != nil {
return nil, fmt.Errorf("Could not parse Range %q: %s", ap, err)
}
rf := vr.rangeFunc()
// Set function
if andFn == nil {
andFn = rf
} else { // Combine with existing function
andFn = andFn.AND(rf)
}
}
if orFn == nil {
orFn = andFn
} else {
orFn = orFn.OR(andFn)
}
}
return orFn, nil
}
// splitORParts splits the already cleaned parts by '||'.
// Checks for invalid positions of the operator and returns an
// error if found.
func splitORParts(parts []string) ([][]string, error) {
var ORparts [][]string
last := 0
for i, p := range parts {
if p == "||" {
if i == 0 {
return nil, fmt.Errorf("First element in range is '||'")
}
ORparts = append(ORparts, parts[last:i])
last = i + 1
}
}
if last == len(parts) {
return nil, fmt.Errorf("Last element in range is '||'")
}
ORparts = append(ORparts, parts[last:])
return ORparts, nil
}
// buildVersionRange takes a slice of 2: operator and version
// and builds a versionRange, otherwise an error.
func buildVersionRange(opStr, vStr string) (*versionRange, error) {
c := parseComparator(opStr)
if c == nil {
return nil, fmt.Errorf("Could not parse comparator %q in %q", opStr, strings.Join([]string{opStr, vStr}, ""))
}
v, err := Parse(vStr)
if err != nil {
return nil, fmt.Errorf("Could not parse version %q in %q: %s", vStr, strings.Join([]string{opStr, vStr}, ""), err)
}
return &versionRange{
v: v,
c: c,
}, nil
}
// inArray checks if a byte is contained in an array of bytes
func inArray(s byte, list []byte) bool {
for _, el := range list {
if el == s {
return true
}
}
return false
}
// splitAndTrim splits a range string by spaces and cleans whitespaces
func splitAndTrim(s string) (result []string) {
last := 0
var lastChar byte
excludeFromSplit := []byte{'>', '<', '='}
for i := 0; i < len(s); i++ {
if s[i] == ' ' && !inArray(lastChar, excludeFromSplit) {
if last < i-1 {
result = append(result, s[last:i])
}
last = i + 1
} else if s[i] != ' ' {
lastChar = s[i]
}
}
if last < len(s)-1 {
result = append(result, s[last:])
}
for i, v := range result {
result[i] = strings.Replace(v, " ", "", -1)
}
// parts := strings.Split(s, " ")
// for _, x := range parts {
// if s := strings.TrimSpace(x); len(s) != 0 {
// result = append(result, s)
// }
// }
return
}
// splitComparatorVersion splits the comparator from the version.
// Input must be free of leading or trailing spaces.
func splitComparatorVersion(s string) (string, string, error) {
i := strings.IndexFunc(s, unicode.IsDigit)
if i == -1 {
return "", "", fmt.Errorf("Could not get version from string: %q", s)
}
return strings.TrimSpace(s[0:i]), s[i:], nil
}
// getWildcardType will return the type of wildcard that the
// passed version contains
func getWildcardType(vStr string) wildcardType {
parts := strings.Split(vStr, ".")
nparts := len(parts)
wildcard := parts[nparts-1]
possibleWildcardType := wildcardTypefromInt(nparts)
if wildcard == "x" {
return possibleWildcardType
}
return noneWildcard
}
// createVersionFromWildcard will convert a wildcard version
// into a regular version, replacing 'x's with '0's, handling
// special cases like '1.x.x' and '1.x'
func createVersionFromWildcard(vStr string) string {
// handle 1.x.x
vStr2 := strings.Replace(vStr, ".x.x", ".x", 1)
vStr2 = strings.Replace(vStr2, ".x", ".0", 1)
parts := strings.Split(vStr2, ".")
// handle 1.x
if len(parts) == 2 {
return vStr2 + ".0"
}
return vStr2
}
// incrementMajorVersion will increment the major version
// of the passed version
func incrementMajorVersion(vStr string) (string, error) {
parts := strings.Split(vStr, ".")
i, err := strconv.Atoi(parts[0])
if err != nil {
return "", err
}
parts[0] = strconv.Itoa(i + 1)
return strings.Join(parts, "."), nil
}
// incrementMajorVersion will increment the minor version
// of the passed version
func incrementMinorVersion(vStr string) (string, error) {
parts := strings.Split(vStr, ".")
i, err := strconv.Atoi(parts[1])
if err != nil {
return "", err
}
parts[1] = strconv.Itoa(i + 1)
return strings.Join(parts, "."), nil
}
// expandWildcardVersion will expand wildcards inside versions
// following these rules:
//
// * when dealing with patch wildcards:
// >= 1.2.x will become >= 1.2.0
// <= 1.2.x will become < 1.3.0
// > 1.2.x will become >= 1.3.0
// < 1.2.x will become < 1.2.0
// != 1.2.x will become < 1.2.0 >= 1.3.0
//
// * when dealing with minor wildcards:
// >= 1.x will become >= 1.0.0
// <= 1.x will become < 2.0.0
// > 1.x will become >= 2.0.0
// < 1.0 will become < 1.0.0
// != 1.x will become < 1.0.0 >= 2.0.0
//
// * when dealing with wildcards without
// version operator:
// 1.2.x will become >= 1.2.0 < 1.3.0
// 1.x will become >= 1.0.0 < 2.0.0
func expandWildcardVersion(parts [][]string) ([][]string, error) {
var expandedParts [][]string
for _, p := range parts {
var newParts []string
for _, ap := range p {
if strings.Index(ap, "x") != -1 {
opStr, vStr, err := splitComparatorVersion(ap)
if err != nil {
return nil, err
}
versionWildcardType := getWildcardType(vStr)
flatVersion := createVersionFromWildcard(vStr)
var resultOperator string
var shouldIncrementVersion bool
switch opStr {
case ">":
resultOperator = ">="
shouldIncrementVersion = true
case ">=":
resultOperator = ">="
case "<":
resultOperator = "<"
case "<=":
resultOperator = "<"
shouldIncrementVersion = true
case "", "=", "==":
newParts = append(newParts, ">="+flatVersion)
resultOperator = "<"
shouldIncrementVersion = true
case "!=", "!":
newParts = append(newParts, "<"+flatVersion)
resultOperator = ">="
shouldIncrementVersion = true
}
var resultVersion string
if shouldIncrementVersion {
switch versionWildcardType {
case patchWildcard:
resultVersion, _ = incrementMinorVersion(flatVersion)
case minorWildcard:
resultVersion, _ = incrementMajorVersion(flatVersion)
}
} else {
resultVersion = flatVersion
}
ap = resultOperator + resultVersion
}
newParts = append(newParts, ap)
}
expandedParts = append(expandedParts, newParts)
}
return expandedParts, nil
}
func parseComparator(s string) comparator {
switch s {
case "==":
fallthrough
case "":
fallthrough
case "=":
return compEQ
case ">":
return compGT
case ">=":
return compGE
case "<":
return compLT
case "<=":
return compLE
case "!":
fallthrough
case "!=":
return compNE
}
return nil
}
// MustParseRange is like ParseRange but panics if the range cannot be parsed.
func MustParseRange(s string) Range {
r, err := ParseRange(s)
if err != nil {
panic(`semver: ParseRange(` + s + `): ` + err.Error())
}
return r
}

418
vendor/github.com/blang/semver/semver.go generated vendored Normal file
View File

@ -0,0 +1,418 @@
package semver
import (
"errors"
"fmt"
"strconv"
"strings"
)
const (
numbers string = "0123456789"
alphas = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"
alphanum = alphas + numbers
)
// SpecVersion is the latest fully supported spec version of semver
var SpecVersion = Version{
Major: 2,
Minor: 0,
Patch: 0,
}
// Version represents a semver compatible version
type Version struct {
Major uint64
Minor uint64
Patch uint64
Pre []PRVersion
Build []string //No Precendence
}
// Version to string
func (v Version) String() string {
b := make([]byte, 0, 5)
b = strconv.AppendUint(b, v.Major, 10)
b = append(b, '.')
b = strconv.AppendUint(b, v.Minor, 10)
b = append(b, '.')
b = strconv.AppendUint(b, v.Patch, 10)
if len(v.Pre) > 0 {
b = append(b, '-')
b = append(b, v.Pre[0].String()...)
for _, pre := range v.Pre[1:] {
b = append(b, '.')
b = append(b, pre.String()...)
}
}
if len(v.Build) > 0 {
b = append(b, '+')
b = append(b, v.Build[0]...)
for _, build := range v.Build[1:] {
b = append(b, '.')
b = append(b, build...)
}
}
return string(b)
}
// Equals checks if v is equal to o.
func (v Version) Equals(o Version) bool {
return (v.Compare(o) == 0)
}
// EQ checks if v is equal to o.
func (v Version) EQ(o Version) bool {
return (v.Compare(o) == 0)
}
// NE checks if v is not equal to o.
func (v Version) NE(o Version) bool {
return (v.Compare(o) != 0)
}
// GT checks if v is greater than o.
func (v Version) GT(o Version) bool {
return (v.Compare(o) == 1)
}
// GTE checks if v is greater than or equal to o.
func (v Version) GTE(o Version) bool {
return (v.Compare(o) >= 0)
}
// GE checks if v is greater than or equal to o.
func (v Version) GE(o Version) bool {
return (v.Compare(o) >= 0)
}
// LT checks if v is less than o.
func (v Version) LT(o Version) bool {
return (v.Compare(o) == -1)
}
// LTE checks if v is less than or equal to o.
func (v Version) LTE(o Version) bool {
return (v.Compare(o) <= 0)
}
// LE checks if v is less than or equal to o.
func (v Version) LE(o Version) bool {
return (v.Compare(o) <= 0)
}
// Compare compares Versions v to o:
// -1 == v is less than o
// 0 == v is equal to o
// 1 == v is greater than o
func (v Version) Compare(o Version) int {
if v.Major != o.Major {
if v.Major > o.Major {
return 1
}
return -1
}
if v.Minor != o.Minor {
if v.Minor > o.Minor {
return 1
}
return -1
}
if v.Patch != o.Patch {
if v.Patch > o.Patch {
return 1
}
return -1
}
// Quick comparison if a version has no prerelease versions
if len(v.Pre) == 0 && len(o.Pre) == 0 {
return 0
} else if len(v.Pre) == 0 && len(o.Pre) > 0 {
return 1
} else if len(v.Pre) > 0 && len(o.Pre) == 0 {
return -1
}
i := 0
for ; i < len(v.Pre) && i < len(o.Pre); i++ {
if comp := v.Pre[i].Compare(o.Pre[i]); comp == 0 {
continue
} else if comp == 1 {
return 1
} else {
return -1
}
}
// If all pr versions are the equal but one has further prversion, this one greater
if i == len(v.Pre) && i == len(o.Pre) {
return 0
} else if i == len(v.Pre) && i < len(o.Pre) {
return -1
} else {
return 1
}
}
// Validate validates v and returns error in case
func (v Version) Validate() error {
// Major, Minor, Patch already validated using uint64
for _, pre := range v.Pre {
if !pre.IsNum { //Numeric prerelease versions already uint64
if len(pre.VersionStr) == 0 {
return fmt.Errorf("Prerelease can not be empty %q", pre.VersionStr)
}
if !containsOnly(pre.VersionStr, alphanum) {
return fmt.Errorf("Invalid character(s) found in prerelease %q", pre.VersionStr)
}
}
}
for _, build := range v.Build {
if len(build) == 0 {
return fmt.Errorf("Build meta data can not be empty %q", build)
}
if !containsOnly(build, alphanum) {
return fmt.Errorf("Invalid character(s) found in build meta data %q", build)
}
}
return nil
}
// New is an alias for Parse and returns a pointer, parses version string and returns a validated Version or error
func New(s string) (vp *Version, err error) {
v, err := Parse(s)
vp = &v
return
}
// Make is an alias for Parse, parses version string and returns a validated Version or error
func Make(s string) (Version, error) {
return Parse(s)
}
// ParseTolerant allows for certain version specifications that do not strictly adhere to semver
// specs to be parsed by this library. It does so by normalizing versions before passing them to
// Parse(). It currently trims spaces, removes a "v" prefix, and adds a 0 patch number to versions
// with only major and minor components specified
func ParseTolerant(s string) (Version, error) {
s = strings.TrimSpace(s)
s = strings.TrimPrefix(s, "v")
// Split into major.minor.(patch+pr+meta)
parts := strings.SplitN(s, ".", 3)
if len(parts) < 3 {
if strings.ContainsAny(parts[len(parts)-1], "+-") {
return Version{}, errors.New("Short version cannot contain PreRelease/Build meta data")
}
for len(parts) < 3 {
parts = append(parts, "0")
}
s = strings.Join(parts, ".")
}
return Parse(s)
}
// Parse parses version string and returns a validated Version or error
func Parse(s string) (Version, error) {
if len(s) == 0 {
return Version{}, errors.New("Version string empty")
}
// Split into major.minor.(patch+pr+meta)
parts := strings.SplitN(s, ".", 3)
if len(parts) != 3 {
return Version{}, errors.New("No Major.Minor.Patch elements found")
}
// Major
if !containsOnly(parts[0], numbers) {
return Version{}, fmt.Errorf("Invalid character(s) found in major number %q", parts[0])
}
if hasLeadingZeroes(parts[0]) {
return Version{}, fmt.Errorf("Major number must not contain leading zeroes %q", parts[0])
}
major, err := strconv.ParseUint(parts[0], 10, 64)
if err != nil {
return Version{}, err
}
// Minor
if !containsOnly(parts[1], numbers) {
return Version{}, fmt.Errorf("Invalid character(s) found in minor number %q", parts[1])
}
if hasLeadingZeroes(parts[1]) {
return Version{}, fmt.Errorf("Minor number must not contain leading zeroes %q", parts[1])
}
minor, err := strconv.ParseUint(parts[1], 10, 64)
if err != nil {
return Version{}, err
}
v := Version{}
v.Major = major
v.Minor = minor
var build, prerelease []string
patchStr := parts[2]
if buildIndex := strings.IndexRune(patchStr, '+'); buildIndex != -1 {
build = strings.Split(patchStr[buildIndex+1:], ".")
patchStr = patchStr[:buildIndex]
}
if preIndex := strings.IndexRune(patchStr, '-'); preIndex != -1 {
prerelease = strings.Split(patchStr[preIndex+1:], ".")
patchStr = patchStr[:preIndex]
}
if !containsOnly(patchStr, numbers) {
return Version{}, fmt.Errorf("Invalid character(s) found in patch number %q", patchStr)
}
if hasLeadingZeroes(patchStr) {
return Version{}, fmt.Errorf("Patch number must not contain leading zeroes %q", patchStr)
}
patch, err := strconv.ParseUint(patchStr, 10, 64)
if err != nil {
return Version{}, err
}
v.Patch = patch
// Prerelease
for _, prstr := range prerelease {
parsedPR, err := NewPRVersion(prstr)
if err != nil {
return Version{}, err
}
v.Pre = append(v.Pre, parsedPR)
}
// Build meta data
for _, str := range build {
if len(str) == 0 {
return Version{}, errors.New("Build meta data is empty")
}
if !containsOnly(str, alphanum) {
return Version{}, fmt.Errorf("Invalid character(s) found in build meta data %q", str)
}
v.Build = append(v.Build, str)
}
return v, nil
}
// MustParse is like Parse but panics if the version cannot be parsed.
func MustParse(s string) Version {
v, err := Parse(s)
if err != nil {
panic(`semver: Parse(` + s + `): ` + err.Error())
}
return v
}
// PRVersion represents a PreRelease Version
type PRVersion struct {
VersionStr string
VersionNum uint64
IsNum bool
}
// NewPRVersion creates a new valid prerelease version
func NewPRVersion(s string) (PRVersion, error) {
if len(s) == 0 {
return PRVersion{}, errors.New("Prerelease is empty")
}
v := PRVersion{}
if containsOnly(s, numbers) {
if hasLeadingZeroes(s) {
return PRVersion{}, fmt.Errorf("Numeric PreRelease version must not contain leading zeroes %q", s)
}
num, err := strconv.ParseUint(s, 10, 64)
// Might never be hit, but just in case
if err != nil {
return PRVersion{}, err
}
v.VersionNum = num
v.IsNum = true
} else if containsOnly(s, alphanum) {
v.VersionStr = s
v.IsNum = false
} else {
return PRVersion{}, fmt.Errorf("Invalid character(s) found in prerelease %q", s)
}
return v, nil
}
// IsNumeric checks if prerelease-version is numeric
func (v PRVersion) IsNumeric() bool {
return v.IsNum
}
// Compare compares two PreRelease Versions v and o:
// -1 == v is less than o
// 0 == v is equal to o
// 1 == v is greater than o
func (v PRVersion) Compare(o PRVersion) int {
if v.IsNum && !o.IsNum {
return -1
} else if !v.IsNum && o.IsNum {
return 1
} else if v.IsNum && o.IsNum {
if v.VersionNum == o.VersionNum {
return 0
} else if v.VersionNum > o.VersionNum {
return 1
} else {
return -1
}
} else { // both are Alphas
if v.VersionStr == o.VersionStr {
return 0
} else if v.VersionStr > o.VersionStr {
return 1
} else {
return -1
}
}
}
// PreRelease version to string
func (v PRVersion) String() string {
if v.IsNum {
return strconv.FormatUint(v.VersionNum, 10)
}
return v.VersionStr
}
func containsOnly(s string, set string) bool {
return strings.IndexFunc(s, func(r rune) bool {
return !strings.ContainsRune(set, r)
}) == -1
}
func hasLeadingZeroes(s string) bool {
return len(s) > 1 && s[0] == '0'
}
// NewBuildVersion creates a new valid build version
func NewBuildVersion(s string) (string, error) {
if len(s) == 0 {
return "", errors.New("Buildversion is empty")
}
if !containsOnly(s, alphanum) {
return "", fmt.Errorf("Invalid character(s) found in build meta data %q", s)
}
return s, nil
}

28
vendor/github.com/blang/semver/sort.go generated vendored Normal file
View File

@ -0,0 +1,28 @@
package semver
import (
"sort"
)
// Versions represents multiple versions.
type Versions []Version
// Len returns length of version collection
func (s Versions) Len() int {
return len(s)
}
// Swap swaps two versions inside the collection by its indices
func (s Versions) Swap(i, j int) {
s[i], s[j] = s[j], s[i]
}
// Less checks if version at index i is less than version at index j
func (s Versions) Less(i, j int) bool {
return s[i].LT(s[j])
}
// Sort sorts a slice of versions
func Sort(versions []Version) {
sort.Sort(Versions(versions))
}

30
vendor/github.com/blang/semver/sql.go generated vendored Normal file
View File

@ -0,0 +1,30 @@
package semver
import (
"database/sql/driver"
"fmt"
)
// Scan implements the database/sql.Scanner interface.
func (v *Version) Scan(src interface{}) (err error) {
var str string
switch src := src.(type) {
case string:
str = src
case []byte:
str = string(src)
default:
return fmt.Errorf("Version.Scan: cannot convert %T to string.", src)
}
if t, err := Parse(str); err == nil {
*v = t
}
return
}
// Value implements the database/sql/driver.Valuer interface.
func (v Version) Value() (driver.Value, error) {
return v.String(), nil
}

View File

@ -121,9 +121,11 @@ type Operation struct {
// The options below are more self-explanatory and affect the runtime
// behavior of the operation.
Destroy bool
Targets []string
Variables map[string]interface{}
Destroy bool
Targets []string
Variables map[string]interface{}
AutoApprove bool
DestroyForce bool
// Input/output/control options.
UIIn terraform.UIInput
@ -136,8 +138,9 @@ type Operation struct {
// The duration to retry obtaining a State lock.
StateLockTimeout time.Duration
// Environment is the named state that should be loaded from the Backend.
Environment string
// Workspace is the name of the workspace that this operation should run
// in, which controls which named state is used.
Workspace string
}
// RunningOperation is the result of starting an operation.

View File

@ -13,6 +13,7 @@ import (
backendconsul "github.com/hashicorp/terraform/backend/remote-state/consul"
backendinmem "github.com/hashicorp/terraform/backend/remote-state/inmem"
backendS3 "github.com/hashicorp/terraform/backend/remote-state/s3"
backendSwift "github.com/hashicorp/terraform/backend/remote-state/swift"
)
// backends is the list of available backends. This is a global variable
@ -37,6 +38,7 @@ func init() {
"local": func() backend.Backend { return &backendlocal.Local{} },
"consul": func() backend.Backend { return backendconsul.New() },
"inmem": func() backend.Backend { return backendinmem.New() },
"swift": func() backend.Backend { return backendSwift.New() },
"s3": func() backend.Backend { return backendS3.New() },
}

View File

@ -20,8 +20,8 @@ import (
)
const (
DefaultEnvDir = "terraform.tfstate.d"
DefaultEnvFile = "environment"
DefaultWorkspaceDir = "terraform.tfstate.d"
DefaultWorkspaceFile = "environment"
DefaultStateFilename = "terraform.tfstate"
DefaultDataDir = ".terraform"
DefaultBackupExtension = ".backup"
@ -36,8 +36,8 @@ type Local struct {
CLI cli.Ui
CLIColor *colorstring.Colorize
// The State* paths are set from the CLI options, and may be left blank to
// use the defaults. If the actual paths for the local backend state are
// The State* paths are set from the backend config, and may be left blank
// to use the defaults. If the actual paths for the local backend state are
// needed, use the StatePaths method.
//
// StatePath is the local path where state is read from.
@ -48,12 +48,12 @@ type Local struct {
// StateBackupPath is the local path where a backup file will be written.
// Set this to "-" to disable state backup.
//
// StateEnvPath is the path to the folder containing environments. This
// defaults to DefaultEnvDir if not set.
StatePath string
StateOutPath string
StateBackupPath string
StateEnvDir string
// StateWorkspaceDir is the path to the folder containing data for
// non-default workspaces. This defaults to DefaultWorkspaceDir if not set.
StatePath string
StateOutPath string
StateBackupPath string
StateWorkspaceDir string
// We only want to create a single instance of a local state, so store them
// here as they're loaded.
@ -127,7 +127,7 @@ func (b *Local) States() ([]string, error) {
// the listing always start with "default"
envs := []string{backend.DefaultStateName}
entries, err := ioutil.ReadDir(b.stateEnvDir())
entries, err := ioutil.ReadDir(b.stateWorkspaceDir())
// no error if there's no envs configured
if os.IsNotExist(err) {
return envs, nil
@ -166,7 +166,7 @@ func (b *Local) DeleteState(name string) error {
}
delete(b.states, name)
return os.RemoveAll(filepath.Join(b.stateEnvDir(), name))
return os.RemoveAll(filepath.Join(b.stateWorkspaceDir(), name))
}
func (b *Local) State(name string) (state.State, error) {
@ -292,11 +292,20 @@ func (b *Local) init() {
Default: "",
},
"environment_dir": &schema.Schema{
"workspace_dir": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Default: "",
},
"environment_dir": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Default: "",
ConflictsWith: []string{"workspace_dir"},
Deprecated: "workspace_dir should be used instead, with the same meaning",
},
},
ConfigureFunc: b.schemaConfigure,
@ -318,10 +327,18 @@ func (b *Local) schemaConfigure(ctx context.Context) error {
b.StateOutPath = path
}
if raw, ok := d.GetOk("workspace_dir"); ok {
path := raw.(string)
if path != "" {
b.StateWorkspaceDir = path
}
}
// Legacy name, which ConflictsWith workspace_dir
if raw, ok := d.GetOk("environment_dir"); ok {
path := raw.(string)
if path != "" {
b.StateEnvDir = path
b.StateWorkspaceDir = path
}
}
@ -344,7 +361,7 @@ func (b *Local) StatePaths(name string) (string, string, string) {
statePath = DefaultStateFilename
}
} else {
statePath = filepath.Join(b.stateEnvDir(), name, DefaultStateFilename)
statePath = filepath.Join(b.stateWorkspaceDir(), name, DefaultStateFilename)
}
if stateOutPath == "" {
@ -367,7 +384,7 @@ func (b *Local) createState(name string) error {
return nil
}
stateDir := filepath.Join(b.stateEnvDir(), name)
stateDir := filepath.Join(b.stateWorkspaceDir(), name)
s, err := os.Stat(stateDir)
if err == nil && s.IsDir() {
// no need to check for os.IsNotExist, since that is covered by os.MkdirAll
@ -383,30 +400,33 @@ func (b *Local) createState(name string) error {
return nil
}
// stateEnvDir returns the directory where state environments are stored.
func (b *Local) stateEnvDir() string {
if b.StateEnvDir != "" {
return b.StateEnvDir
// stateWorkspaceDir returns the directory where state environments are stored.
func (b *Local) stateWorkspaceDir() string {
if b.StateWorkspaceDir != "" {
return b.StateWorkspaceDir
}
return DefaultEnvDir
return DefaultWorkspaceDir
}
// currentStateName returns the name of the current named state as set in the
// configuration files.
// If there are no configured environments, currentStateName returns "default"
func (b *Local) currentStateName() (string, error) {
contents, err := ioutil.ReadFile(filepath.Join(DefaultDataDir, DefaultEnvFile))
if os.IsNotExist(err) {
return backend.DefaultStateName, nil
}
if err != nil {
return "", err
}
if fromFile := strings.TrimSpace(string(contents)); fromFile != "" {
return fromFile, nil
}
return backend.DefaultStateName, nil
func (b *Local) pluginInitRequired(providerErr *terraform.ResourceProviderError) {
b.CLI.Output(b.Colorize().Color(fmt.Sprintf(
strings.TrimSpace(errPluginInit)+"\n",
providerErr)))
}
// this relies on multierror to format the plugin errors below the copy
const errPluginInit = `
[reset][bold][yellow]Plugin reinitialization required. Please run "terraform init".[reset]
[yellow]Reason: Could not satisfy plugin requirements.
Plugins are external binaries that Terraform uses to access and manipulate
resources. The configuration provided requires plugins which can't be located,
don't satisfy the version constraints, or are otherwise incompatible.
[reset][red]%s
[reset][yellow]Terraform automatically discovers provider requirements from your
configuration, including providers used in child modules. To see the
requirements and constraints from each module, run "terraform providers".
`

View File

@ -12,6 +12,7 @@ import (
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/terraform/backend"
"github.com/hashicorp/terraform/command/clistate"
"github.com/hashicorp/terraform/command/format"
"github.com/hashicorp/terraform/config/module"
"github.com/hashicorp/terraform/state"
"github.com/hashicorp/terraform/terraform"
@ -89,10 +90,73 @@ func (b *Local) opApply(
// Perform the plan
log.Printf("[INFO] backend/local: apply calling Plan")
if _, err := tfCtx.Plan(); err != nil {
plan, err := tfCtx.Plan()
if err != nil {
runningOp.Err = errwrap.Wrapf("Error running plan: {{err}}", err)
return
}
trivialPlan := plan.Diff == nil || plan.Diff.Empty()
hasUI := op.UIOut != nil && op.UIIn != nil
if hasUI && ((op.Destroy && !op.DestroyForce) ||
(!op.Destroy && !op.AutoApprove && !trivialPlan)) {
var desc, query string
if op.Destroy {
// Default destroy message
desc = "Terraform will delete all your managed infrastructure, as shown above.\n" +
"There is no undo. Only 'yes' will be accepted to confirm."
// If targets are specified, list those to user
if op.Targets != nil {
var descBuffer bytes.Buffer
descBuffer.WriteString("Terraform will delete the following infrastructure:\n")
for _, target := range op.Targets {
descBuffer.WriteString("\t")
descBuffer.WriteString(target)
descBuffer.WriteString("\n")
}
descBuffer.WriteString("There is no undo. Only 'yes' will be accepted to confirm")
desc = descBuffer.String()
}
query = "Do you really want to destroy?"
} else {
desc = "Terraform will apply the changes described above.\n" +
"Only 'yes' will be accepted to approve."
query = "Do you want to apply these changes?"
}
if !trivialPlan {
// Display the plan of what we are going to apply/destroy.
if op.Destroy {
op.UIOut.Output("\n" + strings.TrimSpace(approveDestroyPlanHeader) + "\n")
} else {
op.UIOut.Output("\n" + strings.TrimSpace(approvePlanHeader) + "\n")
}
op.UIOut.Output(format.Plan(&format.PlanOpts{
Plan: plan,
Color: b.Colorize(),
ModuleDepth: -1,
}))
}
v, err := op.UIIn.Input(&terraform.InputOpts{
Id: "approve",
Query: query,
Description: desc,
})
if err != nil {
runningOp.Err = errwrap.Wrapf("Error asking for approval: {{err}}", err)
return
}
if v != "yes" {
if op.Destroy {
runningOp.Err = errors.New("Destroy cancelled.")
} else {
runningOp.Err = errors.New("Apply cancelled.")
}
return
}
}
}
// Setup our hook for continuous state updates
@ -186,7 +250,8 @@ func (b *Local) opApply(
countHook.Removed)))
}
if countHook.Added > 0 || countHook.Changed > 0 {
// only show the state file help message if the state is local.
if (countHook.Added > 0 || countHook.Changed > 0) && b.StateOutPath != "" {
b.CLI.Output(b.Colorize().Color(fmt.Sprintf(
"[reset]\n"+
"The state of your infrastructure has been saved to the path\n"+
@ -288,3 +353,17 @@ Terraform encountered an error attempting to save the state before canceling
the current operation. Once the operation is complete another attempt will be
made to save the final state.
`
const approvePlanHeader = `
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed. Cyan entries are data sources to be read.
`
const approveDestroyPlanHeader = `
The Terraform destroy plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning.
Resources shown in red will be destroyed.
`

View File

@ -1,6 +1,7 @@
package local
import (
"errors"
"fmt"
"log"
"strings"
@ -23,7 +24,7 @@ func (b *Local) Context(op *backend.Operation) (*terraform.Context, state.State,
func (b *Local) context(op *backend.Operation) (*terraform.Context, state.State, error) {
// Get the state.
s, err := b.State(op.Environment)
s, err := b.State(op.Workspace)
if err != nil {
return nil, nil, errwrap.Wrapf("Error loading state: {{err}}", err)
}
@ -48,6 +49,10 @@ func (b *Local) context(op *backend.Operation) (*terraform.Context, state.State,
}
// Load our state
// By the time we get here, the backend creation code in "command" took
// care of making s.State() return a state compatible with our plan,
// if any, so we can safely pass this value in both the plan context
// and new context cases below.
opts.State = s.State()
// Build the context
@ -57,6 +62,15 @@ func (b *Local) context(op *backend.Operation) (*terraform.Context, state.State,
} else {
tfCtx, err = terraform.NewContext(&opts)
}
// any errors resolving plugins returns this
if rpe, ok := err.(*terraform.ResourceProviderError); ok {
b.pluginInitRequired(rpe)
// we wrote the full UI error here, so return a generic error for flow
// control in the command.
return nil, nil, errors.New("error satisfying plugin requirements")
}
if err != nil {
return nil, nil, err
}

View File

@ -18,11 +18,11 @@ import (
func TestLocal(t *testing.T) *Local {
tempDir := testTempDir(t)
return &Local{
StatePath: filepath.Join(tempDir, "state.tfstate"),
StateOutPath: filepath.Join(tempDir, "state.tfstate"),
StateBackupPath: filepath.Join(tempDir, "state.tfstate.bak"),
StateEnvDir: filepath.Join(tempDir, "state.tfstate.d"),
ContextOpts: &terraform.ContextOpts{},
StatePath: filepath.Join(tempDir, "state.tfstate"),
StateOutPath: filepath.Join(tempDir, "state.tfstate"),
StateBackupPath: filepath.Join(tempDir, "state.tfstate.bak"),
StateWorkspaceDir: filepath.Join(tempDir, "state.tfstate.d"),
ContextOpts: &terraform.ContextOpts{},
}
}
@ -47,14 +47,13 @@ func TestLocalProvider(t *testing.T, b *Local, name string) *terraform.MockResou
if b.ContextOpts == nil {
b.ContextOpts = &terraform.ContextOpts{}
}
if b.ContextOpts.Providers == nil {
b.ContextOpts.Providers = make(map[string]terraform.ResourceProviderFactory)
}
// Setup our provider
b.ContextOpts.Providers[name] = func() (terraform.ResourceProvider, error) {
return p, nil
}
b.ContextOpts.ProviderResolver = terraform.ResourceProviderResolverFixed(
map[string]terraform.ResourceProviderFactory{
name: terraform.ResourceProviderFactoryFixed(p),
},
)
return p
}

View File

@ -3,6 +3,7 @@ package consul
import (
"bytes"
"compress/gzip"
"context"
"crypto/md5"
"encoding/json"
"errors"
@ -20,6 +21,15 @@ import (
const (
lockSuffix = "/.lock"
lockInfoSuffix = "/.lockinfo"
// The Session TTL associated with this lock.
lockSessionTTL = "15s"
// the delay time from when a session is lost to when the
// lock is released by the server
lockDelay = 5 * time.Second
// interval between attempts to reacquire a lost lock
lockReacquireInterval = 2 * time.Second
)
// RemoteClient is a remote client that stores data in Consul.
@ -44,9 +54,15 @@ type RemoteClient struct {
info *state.LockInfo
// cancel the goroutine which is monitoring the lock.
monitorCancel chan struct{}
monitorDone chan struct{}
// cancel our goroutine which is monitoring the lock to automatically
// reacquire it when possible.
monitorCancel context.CancelFunc
monitorWG sync.WaitGroup
// sessionCancel cancels the Context use for session.RenewPeriodic, and is
// called when unlocking, or before creating a new lock if the lock is
// lost.
sessionCancel context.CancelFunc
}
func (c *RemoteClient) Get() (*remote.Payload, error) {
@ -202,25 +218,41 @@ func (c *RemoteClient) Lock(info *state.LockInfo) (string, error) {
return c.lock()
}
// called after a lock is acquired
var testLockHook func()
// the lock implementation.
// Only to be called while holding Client.mu
func (c *RemoteClient) lock() (string, error) {
if c.consulLock == nil {
opts := &consulapi.LockOptions{
Key: c.Path + lockSuffix,
// only wait briefly, so terraform has the choice to fail fast or
// retry as needed.
LockWaitTime: time.Second,
LockTryOnce: true,
}
// We create a new session here, so it can be canceled when the lock is
// lost or unlocked.
lockSession, err := c.createSession()
if err != nil {
return "", err
}
lock, err := c.Client.LockOpts(opts)
if err != nil {
return "", err
}
opts := &consulapi.LockOptions{
Key: c.Path + lockSuffix,
Session: lockSession,
c.consulLock = lock
// only wait briefly, so terraform has the choice to fail fast or
// retry as needed.
LockWaitTime: time.Second,
LockTryOnce: true,
// Don't let the lock monitor give up right away, as it's possible the
// session is still OK. While the session is refreshed at a rate of
// TTL/2, the lock monitor is an idle blocking request and is more
// susceptible to being closed by a lower network layer.
MonitorRetries: 5,
//
// The delay between lock monitor retries.
// While the session has a 15s TTL plus a 5s wait period on a lost
// lock, if we can't get our lock back in 10+ seconds something is
// wrong so we're going to drop the session and start over.
MonitorRetryTime: 2 * time.Second,
}
c.consulLock, err = c.Client.LockOpts(opts)
if err != nil {
return "", err
}
lockErr := &state.LockError{}
@ -239,6 +271,7 @@ func (c *RemoteClient) lock() (string, error) {
}
lockErr.Info = lockInfo
return "", lockErr
}
@ -257,16 +290,22 @@ func (c *RemoteClient) lock() (string, error) {
// If we lose the lock to due communication issues with the consul agent,
// attempt to immediately reacquire the lock. Put will verify the integrity
// of the state by using a CAS operation.
c.monitorCancel = make(chan struct{})
c.monitorDone = make(chan struct{})
go func(cancel, done chan struct{}) {
defer func() {
close(done)
}()
ctx, cancel := context.WithCancel(context.Background())
c.monitorCancel = cancel
c.monitorWG.Add(1)
go func() {
defer c.monitorWG.Done()
select {
case <-c.lockCh:
log.Println("[ERROR] lost consul lock")
for {
c.mu.Lock()
// We lost our lock, so we need to cancel the session too.
// The CancelFunc is only replaced while holding Client.mu, so
// this is safe to call here. This will be replaced by the
// lock() call below.
c.sessionCancel()
c.consulLock = nil
_, err := c.lock()
c.mu.Unlock()
@ -276,11 +315,11 @@ func (c *RemoteClient) lock() (string, error) {
// terraform is running. There may be changes in progress,
// so there's no use in aborting. Either we eventually
// reacquire the lock, or a Put will fail on a CAS.
log.Printf("[ERROR] attempting to reacquire lock: %s", err)
time.Sleep(time.Second)
log.Printf("[ERROR] could not reacquire lock: %s", err)
time.Sleep(lockReacquireInterval)
select {
case <-cancel:
case <-ctx.Done():
return
default:
}
@ -292,10 +331,10 @@ func (c *RemoteClient) lock() (string, error) {
return
}
case <-cancel:
case <-ctx.Done():
return
}
}(c.monitorCancel, c.monitorDone)
}()
if testLockHook != nil {
testLockHook()
@ -304,6 +343,42 @@ func (c *RemoteClient) lock() (string, error) {
return c.info.ID, nil
}
// called after a lock is acquired
var testLockHook func()
func (c *RemoteClient) createSession() (string, error) {
// create the context first. Even if the session creation fails, we assume
// that the CancelFunc is always callable.
ctx, cancel := context.WithCancel(context.Background())
c.sessionCancel = cancel
session := c.Client.Session()
se := &consulapi.SessionEntry{
Name: consulapi.DefaultLockSessionName,
TTL: lockSessionTTL,
LockDelay: lockDelay,
}
id, _, err := session.Create(se, nil)
if err != nil {
return "", err
}
log.Println("[INFO] created consul lock session", id)
// keep the session renewed
// we need an adapter to convert the session Done() channel to a
// non-directional channel to satisfy the RenewPeriodic signature.
done := make(chan struct{})
go func() {
<-ctx.Done()
close(done)
}()
go session.RenewPeriodic(lockSessionTTL, id, nil, done)
return id, nil
}
func (c *RemoteClient) Unlock(id string) error {
c.mu.Lock()
defer c.mu.Unlock()
@ -315,17 +390,27 @@ func (c *RemoteClient) Unlock(id string) error {
return c.unlock(id)
}
// the unlock implementation.
// Only to be called while holding Client.mu
func (c *RemoteClient) unlock(id string) error {
// cancel our monitoring goroutine
if c.monitorCancel != nil {
close(c.monitorCancel)
}
// this doesn't use the lock id, because the lock is tied to the consul client.
if c.consulLock == nil || c.lockCh == nil {
return nil
}
// cancel our monitoring goroutine
c.monitorCancel()
defer func() {
c.consulLock = nil
// The consul session is only used for this single lock, so cancel it
// after we unlock.
// The session is only created and replaced holding Client.mu, so the
// CancelFunc must be non-nil.
c.sessionCancel()
}()
select {
case <-c.lockCh:
return errors.New("consul lock was lost")
@ -344,9 +429,9 @@ func (c *RemoteClient) unlock(id string) error {
errs = multierror.Append(errs, err)
}
// the monitoring goroutine may be in a select on this chan, so we need to
// the monitoring goroutine may be in a select on the lockCh, so we need to
// wait for it to return before changing the value.
<-c.monitorDone
c.monitorWG.Wait()
c.lockCh = nil
// This is only cleanup, and will fail if the lock was immediately taken by

View File

@ -8,7 +8,7 @@ import (
"github.com/hashicorp/terraform/backend"
"github.com/hashicorp/terraform/helper/schema"
terraformAWS "github.com/hashicorp/terraform/builtin/providers/aws"
terraformAWS "github.com/terraform-providers/terraform-provider-aws/aws"
)
// New creates a new backend for S3 remote state.
@ -139,6 +139,13 @@ func New() backend.Backend {
Description: "The permissions applied when assuming a role.",
Default: "",
},
"workspace_key_prefix": {
Type: schema.TypeString,
Optional: true,
Description: "The prefix applied to the non-default state path inside the bucket",
Default: "env:",
},
},
}
@ -160,6 +167,7 @@ type Backend struct {
acl string
kmsKeyID string
ddbTable string
workspaceKeyPrefix string
}
func (b *Backend) configure(ctx context.Context) error {
@ -175,6 +183,7 @@ func (b *Backend) configure(ctx context.Context) error {
b.serverSideEncryption = data.Get("encrypt").(bool)
b.acl = data.Get("acl").(string)
b.kmsKeyID = data.Get("kms_key_id").(string)
b.workspaceKeyPrefix = data.Get("workspace_key_prefix").(string)
b.ddbTable = data.Get("dynamodb_table").(string)
if b.ddbTable == "" {

View File

@ -14,16 +14,10 @@ import (
"github.com/hashicorp/terraform/terraform"
)
const (
// This will be used as directory name, the odd looking colon is simply to
// reduce the chance of name conflicts with existing objects.
keyEnvPrefix = "env:"
)
func (b *Backend) States() ([]string, error) {
params := &s3.ListObjectsInput{
Bucket: &b.bucketName,
Prefix: aws.String(keyEnvPrefix + "/"),
Prefix: aws.String(b.workspaceKeyPrefix + "/"),
}
resp, err := b.s3Client.ListObjects(params)
@ -53,7 +47,7 @@ func (b *Backend) keyEnv(key string) string {
}
// shouldn't happen since we listed by prefix
if parts[0] != keyEnvPrefix {
if parts[0] != b.workspaceKeyPrefix {
return ""
}
@ -70,20 +64,16 @@ func (b *Backend) DeleteState(name string) error {
return fmt.Errorf("can't delete default state")
}
params := &s3.DeleteObjectInput{
Bucket: &b.bucketName,
Key: aws.String(b.path(name)),
}
_, err := b.s3Client.DeleteObject(params)
client, err := b.remoteClient(name)
if err != nil {
return err
}
return nil
return client.Delete()
}
func (b *Backend) State(name string) (state.State, error) {
// get a remote client configured for this state
func (b *Backend) remoteClient(name string) (*RemoteClient, error) {
if name == "" {
return nil, errors.New("missing state name")
}
@ -99,8 +89,16 @@ func (b *Backend) State(name string) (state.State, error) {
ddbTable: b.ddbTable,
}
stateMgr := &remote.State{Client: client}
return client, nil
}
func (b *Backend) State(name string) (state.State, error) {
client, err := b.remoteClient(name)
if err != nil {
return nil, err
}
stateMgr := &remote.State{Client: client}
// Check to see if this state already exists.
// If we're trying to force-unlock a state, we can't take the lock before
// fetching the state. If the state doesn't exist, we have to assume this
@ -179,7 +177,7 @@ func (b *Backend) path(name string) string {
return b.keyName
}
return strings.Join([]string{keyEnvPrefix, name, b.keyName}, "/")
return strings.Join([]string{b.workspaceKeyPrefix, name, b.keyName}, "/")
}
const errStateUnlock = `

View File

@ -0,0 +1,325 @@
package swift
import (
"context"
"fmt"
"log"
"strconv"
"strings"
"time"
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/openstack"
"github.com/hashicorp/terraform/backend"
"github.com/hashicorp/terraform/helper/schema"
tf_openstack "github.com/terraform-providers/terraform-provider-openstack/openstack"
)
// New creates a new backend for Swift remote state.
func New() backend.Backend {
s := &schema.Backend{
Schema: map[string]*schema.Schema{
"auth_url": &schema.Schema{
Type: schema.TypeString,
Required: true,
DefaultFunc: schema.EnvDefaultFunc("OS_AUTH_URL", nil),
Description: descriptions["auth_url"],
},
"user_id": &schema.Schema{
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("OS_USER_ID", ""),
Description: descriptions["user_name"],
},
"user_name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("OS_USERNAME", ""),
Description: descriptions["user_name"],
},
"tenant_id": &schema.Schema{
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"OS_TENANT_ID",
"OS_PROJECT_ID",
}, ""),
Description: descriptions["tenant_id"],
},
"tenant_name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"OS_TENANT_NAME",
"OS_PROJECT_NAME",
}, ""),
Description: descriptions["tenant_name"],
},
"password": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Sensitive: true,
DefaultFunc: schema.EnvDefaultFunc("OS_PASSWORD", ""),
Description: descriptions["password"],
},
"token": &schema.Schema{
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("OS_AUTH_TOKEN", ""),
Description: descriptions["token"],
},
"domain_id": &schema.Schema{
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"OS_USER_DOMAIN_ID",
"OS_PROJECT_DOMAIN_ID",
"OS_DOMAIN_ID",
}, ""),
Description: descriptions["domain_id"],
},
"domain_name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"OS_USER_DOMAIN_NAME",
"OS_PROJECT_DOMAIN_NAME",
"OS_DOMAIN_NAME",
"OS_DEFAULT_DOMAIN",
}, ""),
Description: descriptions["domain_name"],
},
"region_name": &schema.Schema{
Type: schema.TypeString,
Required: true,
DefaultFunc: schema.EnvDefaultFunc("OS_REGION_NAME", ""),
Description: descriptions["region_name"],
},
"insecure": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("OS_INSECURE", ""),
Description: descriptions["insecure"],
},
"endpoint_type": &schema.Schema{
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("OS_ENDPOINT_TYPE", ""),
},
"cacert_file": &schema.Schema{
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("OS_CACERT", ""),
Description: descriptions["cacert_file"],
},
"cert": &schema.Schema{
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("OS_CERT", ""),
Description: descriptions["cert"],
},
"key": &schema.Schema{
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("OS_KEY", ""),
Description: descriptions["key"],
},
"path": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: descriptions["path"],
Deprecated: "Use container instead",
ConflictsWith: []string{"container"},
},
"container": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: descriptions["container"],
},
"archive_path": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: descriptions["archive_path"],
Deprecated: "Use archive_container instead",
ConflictsWith: []string{"archive_container"},
},
"archive_container": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: descriptions["archive_container"],
},
"expire_after": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: descriptions["expire_after"],
},
},
}
result := &Backend{Backend: s}
result.Backend.ConfigureFunc = result.configure
return result
}
var descriptions map[string]string
func init() {
descriptions = map[string]string{
"auth_url": "The Identity authentication URL.",
"user_name": "Username to login with.",
"user_id": "User ID to login with.",
"tenant_id": "The ID of the Tenant (Identity v2) or Project (Identity v3)\n" +
"to login with.",
"tenant_name": "The name of the Tenant (Identity v2) or Project (Identity v3)\n" +
"to login with.",
"password": "Password to login with.",
"token": "Authentication token to use as an alternative to username/password.",
"domain_id": "The ID of the Domain to scope to (Identity v3).",
"domain_name": "The name of the Domain to scope to (Identity v3).",
"region_name": "The name of the Region to use.",
"insecure": "Trust self-signed certificates.",
"cacert_file": "A Custom CA certificate.",
"endpoint_type": "The catalog endpoint type to use.",
"cert": "A client certificate to authenticate with.",
"key": "A client private key to authenticate with.",
"path": "Swift container path to use.",
"container": "Swift container to create",
"archive_path": "Swift container path to archive state to.",
"archive_container": "Swift container to archive state to.",
"expire_after": "Archive object expiry duration.",
}
}
type Backend struct {
*schema.Backend
// Fields below are set from configure
client *gophercloud.ServiceClient
archive bool
archiveContainer string
expireSecs int
container string
}
func (b *Backend) configure(ctx context.Context) error {
if b.client != nil {
return nil
}
// Grab the resource data
data := schema.FromContextBackendConfig(ctx)
config := &tf_openstack.Config{
CACertFile: data.Get("cacert_file").(string),
ClientCertFile: data.Get("cert").(string),
ClientKeyFile: data.Get("key").(string),
DomainID: data.Get("domain_id").(string),
DomainName: data.Get("domain_name").(string),
EndpointType: data.Get("endpoint_type").(string),
IdentityEndpoint: data.Get("auth_url").(string),
Insecure: data.Get("insecure").(bool),
Password: data.Get("password").(string),
Token: data.Get("token").(string),
TenantID: data.Get("tenant_id").(string),
TenantName: data.Get("tenant_name").(string),
Username: data.Get("user_name").(string),
UserID: data.Get("user_id").(string),
}
if err := config.LoadAndValidate(); err != nil {
return err
}
// Assign Container
b.container = data.Get("container").(string)
if b.container == "" {
// Check deprecated field
b.container = data.Get("path").(string)
}
// Enable object archiving?
if archiveContainer, ok := data.GetOk("archive_container"); ok {
log.Printf("[DEBUG] Archive_container set, enabling object versioning")
b.archive = true
b.archiveContainer = archiveContainer.(string)
} else if archivePath, ok := data.GetOk("archive_path"); ok {
log.Printf("[DEBUG] Archive_path set, enabling object versioning")
b.archive = true
b.archiveContainer = archivePath.(string)
}
// Enable object expiry?
if expireRaw, ok := data.GetOk("expire_after"); ok {
expire := expireRaw.(string)
log.Printf("[DEBUG] Requested that remote state expires after %s", expire)
if strings.HasSuffix(expire, "d") {
log.Printf("[DEBUG] Got a days expire after duration. Converting to hours")
days, err := strconv.Atoi(expire[:len(expire)-1])
if err != nil {
return fmt.Errorf("Error converting expire_after value %s to int: %s", expire, err)
}
expire = fmt.Sprintf("%dh", days*24)
log.Printf("[DEBUG] Expire after %s hours", expire)
}
expireDur, err := time.ParseDuration(expire)
if err != nil {
log.Printf("[DEBUG] Error parsing duration %s: %s", expire, err)
return fmt.Errorf("Error parsing expire_after duration '%s': %s", expire, err)
}
log.Printf("[DEBUG] Seconds duration = %d", int(expireDur.Seconds()))
b.expireSecs = int(expireDur.Seconds())
}
objClient, err := openstack.NewObjectStorageV1(config.OsClient, gophercloud.EndpointOpts{
Region: data.Get("region_name").(string),
})
if err != nil {
return err
}
b.client = objClient
return nil
}

View File

@ -0,0 +1,31 @@
package swift
import (
"github.com/hashicorp/terraform/backend"
"github.com/hashicorp/terraform/state"
"github.com/hashicorp/terraform/state/remote"
)
func (b *Backend) States() ([]string, error) {
return nil, backend.ErrNamedStatesNotSupported
}
func (b *Backend) DeleteState(name string) error {
return backend.ErrNamedStatesNotSupported
}
func (b *Backend) State(name string) (state.State, error) {
if name != backend.DefaultStateName {
return nil, backend.ErrNamedStatesNotSupported
}
client := &RemoteClient{
client: b.client,
container: b.container,
archive: b.archive,
archiveContainer: b.archiveContainer,
expireSecs: b.expireSecs,
}
return &remote.State{Client: client}, nil
}

View File

@ -0,0 +1,115 @@
package swift
import (
"bytes"
"crypto/md5"
"log"
"os"
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/openstack/objectstorage/v1/containers"
"github.com/gophercloud/gophercloud/openstack/objectstorage/v1/objects"
"github.com/hashicorp/terraform/state/remote"
)
const (
TFSTATE_NAME = "tfstate.tf"
TFSTATE_LOCK_NAME = "tfstate.lock"
)
// RemoteClient implements the Client interface for an Openstack Swift server.
type RemoteClient struct {
client *gophercloud.ServiceClient
container string
archive bool
archiveContainer string
expireSecs int
}
func (c *RemoteClient) Get() (*remote.Payload, error) {
log.Printf("[DEBUG] Getting object %s in container %s", TFSTATE_NAME, c.container)
result := objects.Download(c.client, c.container, TFSTATE_NAME, nil)
// Extract any errors from result
_, err := result.Extract()
// 404 response is to be expected if the object doesn't already exist!
if _, ok := err.(gophercloud.ErrDefault404); ok {
log.Println("[DEBUG] Object doesn't exist to download.")
return nil, nil
}
bytes, err := result.ExtractContent()
if err != nil {
return nil, err
}
hash := md5.Sum(bytes)
payload := &remote.Payload{
Data: bytes,
MD5: hash[:md5.Size],
}
return payload, nil
}
func (c *RemoteClient) Put(data []byte) error {
if err := c.ensureContainerExists(); err != nil {
return err
}
log.Printf("[DEBUG] Putting object %s in container %s", TFSTATE_NAME, c.container)
reader := bytes.NewReader(data)
createOpts := objects.CreateOpts{
Content: reader,
}
if c.expireSecs != 0 {
log.Printf("[DEBUG] ExpireSecs = %d", c.expireSecs)
createOpts.DeleteAfter = c.expireSecs
}
result := objects.Create(c.client, c.container, TFSTATE_NAME, createOpts)
return result.Err
}
func (c *RemoteClient) Delete() error {
log.Printf("[DEBUG] Deleting object %s in container %s", TFSTATE_NAME, c.container)
result := objects.Delete(c.client, c.container, TFSTATE_NAME, nil)
return result.Err
}
func (c *RemoteClient) ensureContainerExists() error {
containerOpts := &containers.CreateOpts{}
if c.archive {
log.Printf("[DEBUG] Creating archive container %s", c.archiveContainer)
result := containers.Create(c.client, c.archiveContainer, nil)
if result.Err != nil {
log.Printf("[DEBUG] Error creating archive container %s: %s", c.archiveContainer, result.Err)
return result.Err
}
log.Printf("[DEBUG] Enabling Versioning on container %s", c.container)
containerOpts.VersionsLocation = c.archiveContainer
}
log.Printf("[DEBUG] Creating container %s", c.container)
result := containers.Create(c.client, c.container, containerOpts)
if result.Err != nil {
return result.Err
}
return nil
}
func multiEnv(ks []string) string {
for _, k := range ks {
if v := os.Getenv(k); v != "" {
return v
}
}
return ""
}

View File

@ -92,11 +92,20 @@ func testBackendStates(t *testing.T, b Backend) {
// start with a fresh state, and record the lineage being
// written to "bar"
barState := terraform.NewState()
// creating the named state may have created a lineage, so use that if it exists.
if s := bar.State(); s != nil && s.Lineage != "" {
barState.Lineage = s.Lineage
}
barLineage := barState.Lineage
// the foo lineage should be distinct from bar, and unchanged after
// modifying bar
fooState := terraform.NewState()
// creating the named state may have created a lineage, so use that if it exists.
if s := foo.State(); s != nil && s.Lineage != "" {
fooState.Lineage = s.Lineage
}
fooLineage := fooState.Lineage
// write a known state to foo
@ -187,6 +196,24 @@ func testBackendStates(t *testing.T, b Backend) {
t.Fatal("expected error")
}
// Create and delete the foo state again.
// Make sure that there are no leftover artifacts from a deleted state
// preventing re-creation.
foo, err = b.State("foo")
if err != nil {
t.Fatalf("error: %s", err)
}
if err := foo.RefreshState(); err != nil {
t.Fatalf("bad: %s", err)
}
if v := foo.State(); v.HasResources() {
t.Fatalf("should be empty: %s", v)
}
// and delete it again
if err := b.DeleteState("foo"); err != nil {
t.Fatalf("err: %s", err)
}
// Verify deletion
{
states, err := b.States()

View File

@ -1,14 +0,0 @@
package aws
import (
"strings"
"github.com/aws/aws-sdk-go/aws/awserr"
)
func isAWSErr(err error, code string, message string) bool {
if err, ok := err.(awserr.Error); ok {
return err.Code() == code && strings.Contains(err.Message(), message)
}
return false
}

View File

@ -1,67 +0,0 @@
package aws
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/iam"
"github.com/hashicorp/errwrap"
"github.com/hashicorp/terraform/helper/schema"
)
func dataSourceAwsIAMRole() *schema.Resource {
return &schema.Resource{
Read: dataSourceAwsIAMRoleRead,
Schema: map[string]*schema.Schema{
"arn": {
Type: schema.TypeString,
Computed: true,
},
"assume_role_policy_document": {
Type: schema.TypeString,
Computed: true,
},
"path": {
Type: schema.TypeString,
Computed: true,
},
"role_id": {
Type: schema.TypeString,
Computed: true,
},
"role_name": {
Type: schema.TypeString,
Required: true,
},
},
}
}
func dataSourceAwsIAMRoleRead(d *schema.ResourceData, meta interface{}) error {
iamconn := meta.(*AWSClient).iamconn
roleName := d.Get("role_name").(string)
req := &iam.GetRoleInput{
RoleName: aws.String(roleName),
}
resp, err := iamconn.GetRole(req)
if err != nil {
return errwrap.Wrapf("Error getting roles: {{err}}", err)
}
if resp == nil {
return fmt.Errorf("no IAM role found")
}
role := resp.Role
d.SetId(*role.RoleId)
d.Set("arn", role.Arn)
d.Set("assume_role_policy_document", role.AssumeRolePolicyDocument)
d.Set("path", role.Path)
d.Set("role_id", role.RoleId)
return nil
}

View File

@ -6,6 +6,7 @@ import (
"sort"
"strings"
"github.com/hashicorp/terraform/config"
"github.com/hashicorp/terraform/terraform"
"github.com/mitchellh/colorstring"
)
@ -58,18 +59,27 @@ func formatPlanModuleExpand(
return
}
var moduleName string
var modulePath []string
if !m.IsRoot() {
moduleName = fmt.Sprintf("module.%s", strings.Join(m.Path[1:], "."))
modulePath = m.Path[1:]
}
// We want to output the resources in sorted order to make things
// easier to scan through, so get all the resource names and sort them.
names := make([]string, 0, len(m.Resources))
for name, _ := range m.Resources {
addrs := map[string]*terraform.ResourceAddress{}
for name := range m.Resources {
names = append(names, name)
var err error
addrs[name], err = terraform.ParseResourceAddressForInstanceDiff(modulePath, name)
if err != nil {
// should never happen; indicates invalid diff
panic("invalid resource address in diff")
}
}
sort.Strings(names)
sort.Slice(names, func(i, j int) bool {
return addrs[names[i]].Less(addrs[names[j]])
})
// Go through each sorted name and start building the output
for _, name := range names {
@ -78,25 +88,23 @@ func formatPlanModuleExpand(
continue
}
dataSource := strings.HasPrefix(name, "data.")
if moduleName != "" {
name = moduleName + "." + name
}
addr := addrs[name]
addrStr := addr.String()
dataSource := addr.Mode == config.DataResourceMode
// Determine the color for the text (green for adding, yellow
// for change, red for delete), and symbol, and output the
// resource header.
color := "yellow"
symbol := "~"
symbol := " ~"
oldValues := true
switch rdiff.ChangeType() {
case terraform.DiffDestroyCreate:
color = "green"
symbol = "-/+"
color = "yellow"
symbol = "[red]-[reset]/[green]+[reset][yellow]"
case terraform.DiffCreate:
color = "green"
symbol = "+"
symbol = " +"
oldValues = false
// If we're "creating" a data resource then we'll present it
@ -106,12 +114,12 @@ func formatPlanModuleExpand(
// to work with, so we need to cheat and exploit knowledge of the
// naming scheme for data resources.
if dataSource {
symbol = "<="
symbol = " <="
color = "cyan"
}
case terraform.DiffDestroy:
color = "red"
symbol = "-"
symbol = " -"
}
var extraAttr []string
@ -125,10 +133,13 @@ func formatPlanModuleExpand(
if len(extraAttr) > 0 {
extraStr = fmt.Sprintf(" (%s)", strings.Join(extraAttr, ", "))
}
if rdiff.ChangeType() == terraform.DiffDestroyCreate {
extraStr = extraStr + opts.Color.Color(" [red][bold](new resource required)")
}
buf.WriteString(opts.Color.Color(fmt.Sprintf(
"[%s]%s %s%s\n",
color, symbol, name, extraStr)))
color, symbol, addrStr, extraStr)))
// Get all the attributes that are changing, and sort them. Also
// determine the longest key so that we can align them all.
@ -175,7 +186,7 @@ func formatPlanModuleExpand(
u = attrDiff.Old
}
buf.WriteString(fmt.Sprintf(
" %s:%s %#v => %#v%s\n",
" %s:%s %#v => %#v%s\n",
attrK,
strings.Repeat(" ", keyLen-len(attrK)),
u,
@ -183,7 +194,7 @@ func formatPlanModuleExpand(
updateMsg))
} else {
buf.WriteString(fmt.Sprintf(
" %s:%s %#v%s\n",
" %s:%s %#v%s\n",
attrK,
strings.Repeat(" ", keyLen-len(attrK)),
v,

View File

@ -12,6 +12,7 @@ import (
"github.com/hashicorp/hil"
"github.com/hashicorp/hil/ast"
"github.com/hashicorp/terraform/helper/hilmapstructure"
"github.com/hashicorp/terraform/plugin/discovery"
"github.com/mitchellh/reflectwalk"
)
@ -64,6 +65,7 @@ type Module struct {
type ProviderConfig struct {
Name string
Alias string
Version string
RawConfig *RawConfig
}
@ -238,6 +240,33 @@ func (r *Resource) Id() string {
}
}
// ProviderFullName returns the full name of the provider for this resource,
// which may either be specified explicitly using the "provider" meta-argument
// or implied by the prefix on the resource type name.
func (r *Resource) ProviderFullName() string {
return ResourceProviderFullName(r.Type, r.Provider)
}
// ResourceProviderFullName returns the full (dependable) name of the
// provider for a hypothetical resource with the given resource type and
// explicit provider string. If the explicit provider string is empty then
// the provider name is inferred from the resource type name.
func ResourceProviderFullName(resourceType, explicitProvider string) string {
if explicitProvider != "" {
return explicitProvider
}
idx := strings.IndexRune(resourceType, '_')
if idx == -1 {
// If no underscores, the resource name is assumed to be
// also the provider name, e.g. if the provider exposes
// only a single resource of each type.
return resourceType
}
return resourceType[:idx]
}
// Validate does some basic semantic checking of the configuration.
func (c *Config) Validate() error {
if c == nil {
@ -349,7 +378,8 @@ func (c *Config) Validate() error {
}
}
// Check that providers aren't declared multiple times.
// Check that providers aren't declared multiple times and that their
// version constraints, where present, are syntactically valid.
providerSet := make(map[string]struct{})
for _, p := range c.ProviderConfigs {
name := p.FullName()
@ -360,6 +390,16 @@ func (c *Config) Validate() error {
continue
}
if p.Version != "" {
_, err := discovery.ConstraintStr(p.Version).Parse()
if err != nil {
errs = append(errs, fmt.Errorf(
"provider.%s: invalid version constraint %q: %s",
name, p.Version, err,
))
}
}
providerSet[name] = struct{}{}
}

View File

@ -70,6 +70,7 @@ func Funcs() map[string]ast.Function {
"coalescelist": interpolationFuncCoalesceList(),
"compact": interpolationFuncCompact(),
"concat": interpolationFuncConcat(),
"contains": interpolationFuncContains(),
"dirname": interpolationFuncDirname(),
"distinct": interpolationFuncDistinct(),
"element": interpolationFuncElement(),
@ -356,6 +357,22 @@ func interpolationFuncCoalesceList() ast.Function {
}
}
// interpolationFuncContains returns true if an element is in the list
// and return false otherwise
func interpolationFuncContains() ast.Function {
return ast.Function{
ArgTypes: []ast.Type{ast.TypeList, ast.TypeString},
ReturnType: ast.TypeBool,
Callback: func(args []interface{}) (interface{}, error) {
_, err := interpolationFuncIndex().Callback(args)
if err != nil {
return false, nil
}
return true, nil
},
}
}
// interpolationFuncConcat implements the "concat" function that concatenates
// multiple lists.
func interpolationFuncConcat() ast.Function {

View File

@ -194,7 +194,7 @@ func dirFiles(dir string) ([]string, []string, error) {
// Only care about files that are valid to load
name := fi.Name()
extValue := ext(name)
if extValue == "" || isIgnoredFile(name) {
if extValue == "" || IsIgnoredFile(name) {
continue
}
@ -215,9 +215,9 @@ func dirFiles(dir string) ([]string, []string, error) {
return files, overrides, nil
}
// isIgnoredFile returns true or false depending on whether the
// IsIgnoredFile returns true or false depending on whether the
// provided file name is a file that should be ignored.
func isIgnoredFile(name string) bool {
func IsIgnoredFile(name string) bool {
return strings.HasPrefix(name, ".") || // Unix-like hidden files
strings.HasSuffix(name, "~") || // vim
strings.HasPrefix(name, "#") && strings.HasSuffix(name, "#") // emacs

View File

@ -17,6 +17,20 @@ type hclConfigurable struct {
Root *ast.File
}
var ReservedResourceFields = []string{
"connection",
"count",
"depends_on",
"lifecycle",
"provider",
"provisioner",
}
var ReservedProviderFields = []string{
"alias",
"version",
}
func (t *hclConfigurable) Config() (*Config, error) {
validKeys := map[string]struct{}{
"atlas": struct{}{},
@ -562,6 +576,7 @@ func loadProvidersHcl(list *ast.ObjectList) ([]*ProviderConfig, error) {
}
delete(config, "alias")
delete(config, "version")
rawConfig, err := NewRawConfig(config)
if err != nil {
@ -583,9 +598,22 @@ func loadProvidersHcl(list *ast.ObjectList) ([]*ProviderConfig, error) {
}
}
// If we have a version field then extract it
var version string
if a := listVal.Filter("version"); len(a.Items) > 0 {
err := hcl.DecodeObject(&version, a.Items[0].Val)
if err != nil {
return nil, fmt.Errorf(
"Error reading version for provider[%s]: %s",
n,
err)
}
}
result = append(result, &ProviderConfig{
Name: n,
Alias: alias,
Version: version,
RawConfig: rawConfig,
})
}

View File

@ -92,6 +92,25 @@ func (t *Tree) Children() map[string]*Tree {
return t.children
}
// DeepEach calls the provided callback for the receiver and then all of
// its descendents in the tree, allowing an operation to be performed on
// all modules in the tree.
//
// Parents will be visited before their children but otherwise the order is
// not defined.
func (t *Tree) DeepEach(cb func(*Tree)) {
t.lock.RLock()
defer t.lock.RUnlock()
t.deepEach(cb)
}
func (t *Tree) deepEach(cb func(*Tree)) {
cb(t)
for _, c := range t.children {
c.deepEach(cb)
}
}
// Loaded says whether or not this tree has been loaded or not yet.
func (t *Tree) Loaded() bool {
t.lock.RLock()

View File

@ -0,0 +1,103 @@
package config
import "github.com/blang/semver"
// ProviderVersionConstraint presents a constraint for a particular
// provider, identified by its full name.
type ProviderVersionConstraint struct {
Constraint string
ProviderType string
}
// ProviderVersionConstraints is a map from provider full name to its associated
// ProviderVersionConstraint, as produced by Config.RequiredProviders.
type ProviderVersionConstraints map[string]ProviderVersionConstraint
// RequiredProviders returns the ProviderVersionConstraints for this
// module.
//
// This includes both providers that are explicitly requested by provider
// blocks and those that are used implicitly by instantiating one of their
// resource types. In the latter case, the returned semver Range will
// accept any version of the provider.
func (c *Config) RequiredProviders() ProviderVersionConstraints {
ret := make(ProviderVersionConstraints, len(c.ProviderConfigs))
configs := c.ProviderConfigsByFullName()
// In order to find the *implied* dependencies (those without explicit
// "provider" blocks) we need to walk over all of the resources and
// cross-reference with the provider configs.
for _, rc := range c.Resources {
providerName := rc.ProviderFullName()
var providerType string
// Default to (effectively) no constraint whatsoever, but we might
// override if there's an explicit constraint in config.
constraint := ">=0.0.0"
config, ok := configs[providerName]
if ok {
if config.Version != "" {
constraint = config.Version
}
providerType = config.Name
} else {
providerType = providerName
}
ret[providerName] = ProviderVersionConstraint{
ProviderType: providerType,
Constraint: constraint,
}
}
return ret
}
// RequiredRanges returns a semver.Range for each distinct provider type in
// the constraint map. If the same provider type appears more than once
// (e.g. because aliases are in use) then their respective constraints are
// combined such that they must *all* apply.
//
// The result of this method can be passed to the
// PluginMetaSet.ConstrainVersions method within the plugin/discovery
// package in order to filter down the available plugins to those which
// satisfy the given constraints.
//
// This function will panic if any of the constraints within cannot be
// parsed as semver ranges. This is guaranteed to never happen for a
// constraint set that was built from a configuration that passed validation.
func (cons ProviderVersionConstraints) RequiredRanges() map[string]semver.Range {
ret := make(map[string]semver.Range, len(cons))
for _, con := range cons {
spec := semver.MustParseRange(con.Constraint)
if existing, exists := ret[con.ProviderType]; exists {
ret[con.ProviderType] = existing.AND(spec)
} else {
ret[con.ProviderType] = spec
}
}
return ret
}
// ProviderConfigsByFullName returns a map from provider full names (as
// returned by ProviderConfig.FullName()) to the corresponding provider
// configs.
//
// This function returns no new information than what's already in
// c.ProviderConfigs, but returns it in a more convenient shape. If there
// is more than one provider config with the same full name then the result
// is undefined, but that is guaranteed not to happen for any config that
// has passed validation.
func (c *Config) ProviderConfigsByFullName() map[string]*ProviderConfig {
ret := make(map[string]*ProviderConfig, len(c.ProviderConfigs))
for _, pc := range c.ProviderConfigs {
ret[pc.FullName()] = pc
}
return ret
}

View File

@ -60,6 +60,11 @@ func expandArray(m map[string]string, prefix string) []interface{} {
return []interface{}{}
}
// NOTE: "num" is not necessarily accurate, e.g. if a user tampers
// with state, so the following code should not crash when given a
// number of items more or less than what's given in num. The
// num key is mainly just a hint that this is a list or set.
// The Schema "Set" type stores its values in an array format, but
// using numeric hash values instead of ordinal keys. Take the set
// of keys regardless of value, and expand them in numeric order.
@ -101,7 +106,7 @@ func expandArray(m map[string]string, prefix string) []interface{} {
}
sort.Ints(keysList)
result := make([]interface{}, num)
result := make([]interface{}, len(keysList))
for i, key := range keysList {
keyString := strconv.Itoa(key)
if computed[keyString] {

View File

@ -1,21 +1,17 @@
package resource
import (
"crypto/rand"
"fmt"
"math/big"
"strings"
"sync"
"time"
)
const UniqueIdPrefix = `terraform-`
// idCounter is a randomly seeded monotonic counter for generating ordered
// unique ids. It uses a big.Int so we can easily increment a long numeric
// string. The max possible hex value here with 12 random bytes is
// "01000000000000000000000000", so there's no chance of rollover during
// operation.
// idCounter is a monotonic counter for generating ordered unique ids.
var idMutex sync.Mutex
var idCounter = big.NewInt(0).SetBytes(randomBytes(12))
var idCounter uint32
// Helper for a resource to generate a unique identifier w/ default prefix
func UniqueId() string {
@ -25,15 +21,20 @@ func UniqueId() string {
// Helper for a resource to generate a unique identifier w/ given prefix
//
// After the prefix, the ID consists of an incrementing 26 digit value (to match
// previous timestamp output).
// previous timestamp output). After the prefix, the ID consists of a timestamp
// and an incrementing 8 hex digit value The timestamp means that multiple IDs
// created with the same prefix will sort in the order of their creation, even
// across multiple terraform executions, as long as the clock is not turned back
// between calls, and as long as any given terraform execution generates fewer
// than 4 billion IDs.
func PrefixedUniqueId(prefix string) string {
// Be precise to 4 digits of fractional seconds, but remove the dot before the
// fractional seconds.
timestamp := strings.Replace(
time.Now().UTC().Format("20060102150405.0000"), ".", "", 1)
idMutex.Lock()
defer idMutex.Unlock()
return fmt.Sprintf("%s%026x", prefix, idCounter.Add(idCounter, big.NewInt(1)))
}
func randomBytes(n int) []byte {
b := make([]byte, n)
rand.Read(b)
return b
idCounter++
return fmt.Sprintf("%s%s%08x", prefix, timestamp, idCounter)
}

View File

@ -383,11 +383,11 @@ func Test(t TestT, c TestCase) {
c.PreCheck()
}
ctxProviders, err := testProviderFactories(c)
providerResolver, err := testProviderResolver(c)
if err != nil {
t.Fatal(err)
}
opts := terraform.ContextOpts{Providers: ctxProviders}
opts := terraform.ContextOpts{ProviderResolver: providerResolver}
// A single state variable to track the lifecycle, starting with no state
var state *terraform.State
@ -400,15 +400,22 @@ func Test(t TestT, c TestCase) {
var err error
log.Printf("[WARN] Test: Executing step %d", i)
// Determine the test mode to execute
if step.Config != "" {
state, err = testStepConfig(opts, state, step)
} else if step.ImportState {
state, err = testStepImportState(opts, state, step)
} else {
if step.Config == "" && !step.ImportState {
err = fmt.Errorf(
"unknown test mode for step. Please see TestStep docs\n\n%#v",
step)
} else {
if step.ImportState {
if step.Config == "" {
step.Config = testProviderConfig(c)
}
// Can optionally set step.Config in addition to
// step.ImportState, to provide config for the import.
state, err = testStepImportState(opts, state, step)
} else {
state, err = testStepConfig(opts, state, step)
}
}
// If there was an error, exit
@ -496,16 +503,29 @@ func Test(t TestT, c TestCase) {
}
}
// testProviderFactories is a helper to build the ResourceProviderFactory map
// testProviderConfig takes the list of Providers in a TestCase and returns a
// config with only empty provider blocks. This is useful for Import, where no
// config is provided, but the providers must be defined.
func testProviderConfig(c TestCase) string {
var lines []string
for p := range c.Providers {
lines = append(lines, fmt.Sprintf("provider %q {}\n", p))
}
return strings.Join(lines, "")
}
// testProviderResolver is a helper to build a ResourceProviderResolver
// with pre instantiated ResourceProviders, so that we can reset them for the
// test, while only calling the factory function once.
// Any errors are stored so that they can be returned by the factory in
// terraform to match non-test behavior.
func testProviderFactories(c TestCase) (map[string]terraform.ResourceProviderFactory, error) {
ctxProviders := c.ProviderFactories // make(map[string]terraform.ResourceProviderFactory)
func testProviderResolver(c TestCase) (terraform.ResourceProviderResolver, error) {
ctxProviders := c.ProviderFactories
if ctxProviders == nil {
ctxProviders = make(map[string]terraform.ResourceProviderFactory)
}
// add any fixed providers
for k, p := range c.Providers {
ctxProviders[k] = terraform.ResourceProviderFactoryFixed(p)
@ -527,7 +547,7 @@ func testProviderFactories(c TestCase) (map[string]terraform.ResourceProviderFac
}
}
return ctxProviders, nil
return terraform.ResourceProviderResolverFixed(ctxProviders), nil
}
// UnitTest is a helper to force the acceptance testing harness to run in the

View File

@ -8,6 +8,7 @@ import (
"sync"
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/terraform/config"
"github.com/hashicorp/terraform/terraform"
)
@ -89,6 +90,13 @@ func (p *Provider) InternalValidate() error {
validationErrors = multierror.Append(validationErrors, err)
}
// Provider-specific checks
for k, _ := range sm {
if isReservedProviderFieldName(k) {
return fmt.Errorf("%s is a reserved field name for a provider", k)
}
}
for k, r := range p.ResourcesMap {
if err := r.InternalValidate(nil, true); err != nil {
validationErrors = multierror.Append(validationErrors, fmt.Errorf("resource %s: %s", k, err))
@ -104,6 +112,15 @@ func (p *Provider) InternalValidate() error {
return validationErrors
}
func isReservedProviderFieldName(name string) bool {
for _, reservedName := range config.ReservedProviderFields {
if name == reservedName {
return true
}
}
return false
}
// Meta returns the metadata associated with this provider that was
// returned by the Configure call. It will be nil until Configure is called.
func (p *Provider) Meta() interface{} {

View File

@ -43,7 +43,7 @@ type Provisioner struct {
// ValidateFunc is a function for extended validation. This is optional
// and should be used when individual field validation is not enough.
ValidateFunc func(*ResourceData) ([]string, []error)
ValidateFunc func(*terraform.ResourceConfig) ([]string, []error)
stopCtx context.Context
stopCtxCancel context.CancelFunc
@ -121,32 +121,6 @@ func (p *Provisioner) Stop() error {
return nil
}
func (p *Provisioner) Validate(config *terraform.ResourceConfig) ([]string, []error) {
if err := p.InternalValidate(); err != nil {
return nil, []error{fmt.Errorf(
"Internal validation of the provisioner failed! This is always a bug\n"+
"with the provisioner itself, and not a user issue. Please report\n"+
"this bug:\n\n%s", err)}
}
w := []string{}
e := []error{}
if p.Schema != nil {
w2, e2 := schemaMap(p.Schema).Validate(config)
w = append(w, w2...)
e = append(e, e2...)
}
if p.ValidateFunc != nil {
data := &ResourceData{
schema: p.Schema,
config: config,
}
w2, e2 := p.ValidateFunc(data)
w = append(w, w2...)
e = append(e, e2...)
}
return w, e
}
// Apply implementation of terraform.ResourceProvisioner interface.
func (p *Provisioner) Apply(
o terraform.UIOutput,
@ -204,3 +178,27 @@ func (p *Provisioner) Apply(
ctx = context.WithValue(ctx, ProvRawStateKey, s)
return p.ApplyFunc(ctx)
}
// Validate implements the terraform.ResourceProvisioner interface.
func (p *Provisioner) Validate(c *terraform.ResourceConfig) (ws []string, es []error) {
if err := p.InternalValidate(); err != nil {
return nil, []error{fmt.Errorf(
"Internal validation of the provisioner failed! This is always a bug\n"+
"with the provisioner itself, and not a user issue. Please report\n"+
"this bug:\n\n%s", err)}
}
if p.Schema != nil {
w, e := schemaMap(p.Schema).Validate(c)
ws = append(ws, w...)
es = append(es, e...)
}
if p.ValidateFunc != nil {
w, e := p.ValidateFunc(c)
ws = append(ws, w...)
es = append(es, e...)
}
return ws, es
}

View File

@ -6,6 +6,7 @@ import (
"log"
"strconv"
"github.com/hashicorp/terraform/config"
"github.com/hashicorp/terraform/terraform"
)
@ -142,6 +143,12 @@ func (r *Resource) Apply(
if err := rt.DiffDecode(d); err != nil {
log.Printf("[ERR] Error decoding ResourceTimeout: %s", err)
}
} else if s != nil {
if _, ok := s.Meta[TimeoutKey]; ok {
if err := rt.StateDecode(s); err != nil {
log.Printf("[ERR] Error decoding ResourceTimeout: %s", err)
}
}
} else {
log.Printf("[DEBUG] No meta timeoutkey found in Apply()")
}
@ -388,9 +395,25 @@ func (r *Resource) InternalValidate(topSchemaMap schemaMap, writable bool) error
}
}
// Resource-specific checks
for k, _ := range tsm {
if isReservedResourceFieldName(k) {
return fmt.Errorf("%s is a reserved field name for a resource", k)
}
}
return schemaMap(r.Schema).InternalValidate(tsm)
}
func isReservedResourceFieldName(name string) bool {
for _, reservedName := range config.ReservedResourceFields {
if name == reservedName {
return true
}
}
return false
}
// Data returns a ResourceData struct for this Resource. Each return value
// is a separate copy and can be safely modified differently.
//

View File

@ -15,6 +15,7 @@ import (
"fmt"
"os"
"reflect"
"regexp"
"sort"
"strconv"
"strings"
@ -661,7 +662,13 @@ func (m schemaMap) InternalValidate(topSchemaMap schemaMap) error {
if v.ValidateFunc != nil {
switch v.Type {
case TypeList, TypeSet:
return fmt.Errorf("ValidateFunc is not yet supported on lists or sets.")
return fmt.Errorf("%s: ValidateFunc is not yet supported on lists or sets.", k)
}
}
if v.Deprecated == "" && v.Removed == "" {
if !isValidFieldName(k) {
return fmt.Errorf("%s: Field name may only contain lowercase alphanumeric characters & underscores.", k)
}
}
}
@ -669,6 +676,11 @@ func (m schemaMap) InternalValidate(topSchemaMap schemaMap) error {
return nil
}
func isValidFieldName(name string) bool {
re := regexp.MustCompile("^[a-z0-9_]+$")
return re.MatchString(name)
}
func (m schemaMap) diff(
k string,
schema *Schema,

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