From 5a6f76d72c345e4bfd2d71156bd7e27dfb132af5 Mon Sep 17 00:00:00 2001 From: Eytan Avisror Date: Tue, 3 Mar 2020 12:44:14 -0800 Subject: [PATCH] Managed node groups (#76) * update sdk * initial impl * allow for role creation * Update go.sum * fix types & tests * fix types * handle label removal * add tests --- Makefile | 2 +- README.md | 1 + api/v1alpha1/instancegroup_types.go | 79 +- api/v1alpha1/zz_generated.deepcopy.go | 96 +- ...stancemgr.keikoproj.io_instancegroups.yaml | 422 +- config/rbac/role.yaml | 36 +- controllers/instancegroup_controller.go | 89 +- controllers/providers/aws/aws.go | 182 + .../ekscloudformation/ekscloudformation.go | 37 +- .../ekscloudformation_test.go | 15 +- .../provisioners/ekscloudformation/helpers.go | 2 +- .../provisioners/ekscloudformation/spot.go | 4 +- .../ekscloudformation/strategy.go | 13 +- .../provisioners/eksmanaged/eksmanaged.go | 283 + .../eksmanaged/eksmanaged_test.go | 344 + controllers/provisioners/eksmanaged/types.go | 97 + docs/04_instance-manager.yaml | 422 +- docs/examples/managed.yaml | 31 + go.mod | 6 +- go.sum | 11 +- main.go | 2 +- .../aws/aws-sdk-go/aws/awserr/types.go | 2 +- .../aws/aws-sdk-go/aws/awsutil/path_value.go | 13 +- .../aws/aws-sdk-go/aws/client/client.go | 3 +- .../aws-sdk-go/aws/client/default_retryer.go | 149 +- .../aws/aws-sdk-go/aws/client/logger.go | 12 +- .../aws/client/metadata/client_info.go | 1 + .../aws-sdk-go/aws/client/no_op_retryer.go | 28 + .../github.com/aws/aws-sdk-go/aws/config.go | 47 +- .../aws/aws-sdk-go/aws/convert_types.go | 531 + .../aws-sdk-go/aws/corehandlers/handlers.go | 60 +- .../aws-sdk-go/aws/credentials/credentials.go | 6 + .../aws/credentials/endpointcreds/provider.go | 4 +- .../aws/credentials/processcreds/provider.go | 3 +- .../stscreds/assume_role_provider.go | 17 +- .../stscreds/web_identity_provider.go | 100 + .../aws/aws-sdk-go/aws/csm/metric_chan.go | 11 +- .../aws/aws-sdk-go/aws/csm/reporter.go | 3 +- .../aws/aws-sdk-go/aws/ec2metadata/api.go | 92 +- .../aws/aws-sdk-go/aws/ec2metadata/service.go | 114 +- .../aws/ec2metadata/token_provider.go | 92 + .../aws/aws-sdk-go/aws/endpoints/decode.go | 28 + .../aws/aws-sdk-go/aws/endpoints/defaults.go | 1766 ++- .../aws/aws-sdk-go/aws/endpoints/endpoints.go | 127 +- .../aws/endpoints/legacy_regions.go | 24 + .../aws/aws-sdk-go/aws/endpoints/v3model.go | 72 +- .../aws/aws-sdk-go/aws/request/handlers.go | 4 +- .../aws-sdk-go/aws/request/offset_reader.go | 15 +- .../aws/aws-sdk-go/aws/request/request.go | 122 +- .../aws/aws-sdk-go/aws/request/request_1_8.go | 5 +- .../aws/request/request_pagination.go | 8 +- .../aws/aws-sdk-go/aws/request/retryer.go | 197 +- .../aws/aws-sdk-go/aws/session/credentials.go | 220 +- .../aws/aws-sdk-go/aws/session/doc.go | 208 +- .../aws/aws-sdk-go/aws/session/env_config.go | 138 +- .../aws/aws-sdk-go/aws/session/session.go | 248 +- .../aws-sdk-go/aws/session/shared_config.go | 434 +- .../aws/aws-sdk-go/aws/signer/v4/v4.go | 20 +- .../github.com/aws/aws-sdk-go/aws/version.go | 2 +- .../aws/aws-sdk-go/internal/ini/ini_parser.go | 11 +- .../aws/aws-sdk-go/internal/ini/skipper.go | 6 +- .../aws/aws-sdk-go/internal/sdkio/byte.go | 12 + .../aws/aws-sdk-go/internal/sdkmath/floor.go | 15 + .../internal/sdkmath/floor_go1.9.go | 56 + .../aws/aws-sdk-go/internal/sdkrand/read.go | 11 + .../aws-sdk-go/internal/sdkrand/read_1_5.go | 24 + .../private/protocol/rest/unmarshal.go | 24 +- .../aws-sdk-go/private/protocol/timestamp.go | 20 +- .../private/protocol/xml/xmlutil/sort.go | 32 + .../protocol/xml/xmlutil/xml_to_struct.go | 13 +- .../aws/aws-sdk-go/service/autoscaling/api.go | 859 +- .../aws/aws-sdk-go/service/autoscaling/doc.go | 6 +- .../aws-sdk-go/service/autoscaling/service.go | 9 +- .../aws-sdk-go/service/cloudformation/api.go | 9493 +++++++++++------ .../cloudformationiface/interface.go | 55 + .../service/cloudformation/errors.go | 26 + .../service/cloudformation/service.go | 9 +- .../service/cloudformation/waiters.go | 134 +- .../aws/aws-sdk-go/service/eks/api.go | 5259 +++++++-- .../service/eks/eksiface/interface.go | 70 + .../aws/aws-sdk-go/service/eks/errors.go | 17 +- .../aws/aws-sdk-go/service/eks/service.go | 9 +- .../aws/aws-sdk-go/service/eks/waiters.go | 102 + .../aws/aws-sdk-go/service/sts/api.go | 785 +- .../aws-sdk-go/service/sts/customizations.go | 11 + .../aws/aws-sdk-go/service/sts/errors.go | 23 +- .../aws/aws-sdk-go/service/sts/service.go | 9 +- .../service/sts/stsiface/interface.go | 96 + vendor/golang.org/x/net/html/atom/gen.go | 712 -- vendor/golang.org/x/sys/unix/mkasm_darwin.go | 61 - vendor/golang.org/x/sys/unix/mkpost.go | 122 - vendor/golang.org/x/sys/unix/mksyscall.go | 407 - .../x/sys/unix/mksyscall_aix_ppc.go | 415 - .../x/sys/unix/mksyscall_aix_ppc64.go | 614 -- .../x/sys/unix/mksyscall_solaris.go | 335 - .../golang.org/x/sys/unix/mksysctl_openbsd.go | 355 - vendor/golang.org/x/sys/unix/mksysnum.go | 190 - vendor/golang.org/x/sys/unix/types_aix.go | 237 - vendor/golang.org/x/sys/unix/types_darwin.go | 283 - .../golang.org/x/sys/unix/types_dragonfly.go | 263 - vendor/golang.org/x/sys/unix/types_freebsd.go | 356 - vendor/golang.org/x/sys/unix/types_netbsd.go | 289 - vendor/golang.org/x/sys/unix/types_openbsd.go | 282 - vendor/golang.org/x/sys/unix/types_solaris.go | 266 - .../x/text/encoding/charmap/maketables.go | 556 - .../x/text/encoding/htmlindex/gen.go | 173 - .../text/encoding/internal/identifier/gen.go | 142 - .../x/text/encoding/japanese/maketables.go | 161 - .../x/text/encoding/korean/maketables.go | 143 - .../encoding/simplifiedchinese/maketables.go | 161 - .../encoding/traditionalchinese/maketables.go | 140 - .../x/text/internal/language/compact/gen.go | 64 - .../internal/language/compact/gen_index.go | 113 - .../internal/language/compact/gen_parents.go | 54 - .../x/text/internal/language/gen.go | 1520 --- .../x/text/internal/language/gen_common.go | 20 - vendor/golang.org/x/text/language/gen.go | 305 - vendor/golang.org/x/text/unicode/bidi/gen.go | 133 - .../x/text/unicode/bidi/gen_ranges.go | 57 - .../x/text/unicode/bidi/gen_trieval.go | 64 - .../x/text/unicode/norm/maketables.go | 986 -- .../golang.org/x/text/unicode/norm/triegen.go | 117 - vendor/modules.txt | 350 +- 123 files changed, 18570 insertions(+), 16172 deletions(-) create mode 100644 controllers/provisioners/eksmanaged/eksmanaged.go create mode 100644 controllers/provisioners/eksmanaged/eksmanaged_test.go create mode 100644 controllers/provisioners/eksmanaged/types.go create mode 100644 docs/examples/managed.yaml create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/endpoints/legacy_regions.go create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/sdkio/byte.go create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor.go create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor_go1.9.go create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read.go create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read_1_5.go create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go delete mode 100644 vendor/golang.org/x/net/html/atom/gen.go delete mode 100644 vendor/golang.org/x/sys/unix/mkasm_darwin.go delete mode 100644 vendor/golang.org/x/sys/unix/mkpost.go delete mode 100644 vendor/golang.org/x/sys/unix/mksyscall.go delete mode 100644 vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go delete mode 100644 vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go delete mode 100644 vendor/golang.org/x/sys/unix/mksyscall_solaris.go delete mode 100644 vendor/golang.org/x/sys/unix/mksysctl_openbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/mksysnum.go delete mode 100644 vendor/golang.org/x/sys/unix/types_aix.go delete mode 100644 vendor/golang.org/x/sys/unix/types_darwin.go delete mode 100644 vendor/golang.org/x/sys/unix/types_dragonfly.go delete mode 100644 vendor/golang.org/x/sys/unix/types_freebsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_netbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_openbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_solaris.go delete mode 100644 vendor/golang.org/x/text/encoding/charmap/maketables.go delete mode 100644 vendor/golang.org/x/text/encoding/htmlindex/gen.go delete mode 100644 vendor/golang.org/x/text/encoding/internal/identifier/gen.go delete mode 100644 vendor/golang.org/x/text/encoding/japanese/maketables.go delete mode 100644 vendor/golang.org/x/text/encoding/korean/maketables.go delete mode 100644 vendor/golang.org/x/text/encoding/simplifiedchinese/maketables.go delete mode 100644 vendor/golang.org/x/text/encoding/traditionalchinese/maketables.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/gen.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/gen_index.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/gen_parents.go delete mode 100644 vendor/golang.org/x/text/internal/language/gen.go delete mode 100644 vendor/golang.org/x/text/internal/language/gen_common.go delete mode 100644 vendor/golang.org/x/text/language/gen.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/gen.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/gen_ranges.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/gen_trieval.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/maketables.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/triegen.go diff --git a/Makefile b/Makefile index b87ecf88..af4f8ddd 100644 --- a/Makefile +++ b/Makefile @@ -110,7 +110,7 @@ docker-push: # download controller-gen if necessary controller-gen: ifeq (, $(shell which controller-gen)) - go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.0-beta.2 + go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.4 CONTROLLER_GEN=$(shell go env GOPATH)/bin/controller-gen else CONTROLLER_GEN=$(shell which controller-gen) diff --git a/README.md b/README.md index f845442a..3c32b71f 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ _For more examples and usage, please refer to the [Installation Reference Walkth | Provisioner | Description | Supported? | :--- | :--- | :---: | | eks-cf | provision nodes on EKS using cloudformation | ✅ | +| eks-managed | provision managed node groups for EKS | ✅ | | eks-tf | provision nodes on EKS using terraform | ⚠️🔜 | | ec2-kops | provision nodes on AWS using Kops | ⚠️🔜 | diff --git a/api/v1alpha1/instancegroup_types.go b/api/v1alpha1/instancegroup_types.go index 8e288b5d..be723e36 100644 --- a/api/v1alpha1/instancegroup_types.go +++ b/api/v1alpha1/instancegroup_types.go @@ -21,6 +21,7 @@ import ( log "github.com/sirupsen/logrus" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" ) type ReconcileState string @@ -42,6 +43,14 @@ const ( ReconcileErr ReconcileState = "Error" ) +var ( + GroupVersionResource = schema.GroupVersionResource{ + Group: "instancemgr.keikoproj.io", + Version: "v1alpha1", + Resource: "instancegroups", + } +) + // InstanceGroup is the Schema for the instancegroups API // +kubebuilder:object:root=true // +kubebuilder:resource:path=instancegroups,scope=Namespaced,shortName=ig @@ -71,9 +80,9 @@ type InstanceGroupList struct { // AwsUpgradeStrategy defines the upgrade strategy of an AWS Instance Group type AwsUpgradeStrategy struct { - Type string `json:"type"` - CRDType CRDUpgradeStrategy `json:"crd,omitempty"` - RollingUpgradeType RollingUpgradeStrategy `json:"rollingUpdate,omitempty"` + Type string `json:"type"` + CRDType *CRDUpgradeStrategy `json:"crd,omitempty"` + RollingUpgradeType *RollingUpgradeStrategy `json:"rollingUpdate,omitempty"` } type RollingUpgradeStrategy struct { @@ -151,23 +160,45 @@ type CRDUpgradeStrategy struct { // InstanceGroupSpec defines the schema of resource Spec type InstanceGroupSpec struct { Provisioner string `json:"provisioner"` - EKSCFSpec EKSCFSpec `json:"eks-cf"` + EKSCFSpec *EKSCFSpec `json:"eks-cf,omitempty"` + EKSManagedSpec *EKSManagedSpec `json:"eks-managed,omitempty"` AwsUpgradeStrategy AwsUpgradeStrategy `json:"strategy"` } +type EKSManagedSpec struct { + MaxSize int64 `json:"maxSize"` + MinSize int64 `json:"minSize"` + EKSManagedConfiguration *EKSManagedConfiguration `json:"configuration"` +} + type EKSCFSpec struct { - MaxSize int32 `json:"maxSize"` - MinSize int32 `json:"minSize"` - EKSCFConfiguration EKSCFConfiguration `json:"configuration"` + MaxSize int32 `json:"maxSize,omitempty"` + MinSize int32 `json:"minSize,omitempty"` + EKSCFConfiguration *EKSCFConfiguration `json:"configuration,omitempty"` +} + +type EKSManagedConfiguration struct { + EksClusterName string `json:"clusterName,omitempty"` + VolSize int64 `json:"volSize,omitempty"` + InstanceType string `json:"instanceType,omitempty"` + NodeLabels map[string]string `json:"nodeLabels,omitempty"` + NodeRole string `json:"nodeRole,omitempty"` + NodeSecurityGroups []string `json:"securityGroups,omitempty"` + KeyPairName string `json:"keyPairName,omitempty"` + Tags []map[string]string `json:"tags,omitempty"` + Subnets []string `json:"subnets,omitempty"` + AmiType string `json:"amiType,omitempty"` + ReleaseVersion string `json:"releaseVersion,omitempty"` + Version string `json:"version,omitempty"` } // EKSCFConfiguration defines the context of an AWS Instance Group using EKSCF type EKSCFConfiguration struct { EksClusterName string `json:"clusterName,omitempty"` - KeyPairName string `json:"keyPairName"` - Image string `json:"image"` - InstanceType string `json:"instanceType"` - NodeSecurityGroups []string `json:"securityGroups"` + KeyPairName string `json:"keyPairName,omitempty"` + Image string `json:"image,omitempty"` + InstanceType string `json:"instanceType,omitempty"` + NodeSecurityGroups []string `json:"securityGroups,omitempty"` VolSize int32 `json:"volSize,omitempty"` Subnets []string `json:"subnets,omitempty"` BootstrapArguments string `json:"bootstrapArguments,omitempty"` @@ -193,15 +224,35 @@ type InstanceGroupStatus struct { Lifecycle string `json:"lifecycle,omitempty"` } -func (s *AwsUpgradeStrategy) GetRollingUpgradeStrategy() RollingUpgradeStrategy { +func (conf *EKSManagedConfiguration) SetSubnets(subnets []string) { conf.Subnets = subnets } +func (conf *EKSManagedConfiguration) SetClusterName(name string) { conf.EksClusterName = name } +func (conf *EKSManagedConfiguration) GetLabels() map[string]string { return conf.NodeLabels } + +func (ig *InstanceGroup) GetEKSManagedConfiguration() *EKSManagedConfiguration { + return ig.Spec.EKSManagedSpec.EKSManagedConfiguration +} + +func (ig *InstanceGroup) GetEKSManagedSpec() *EKSManagedSpec { + return ig.Spec.EKSManagedSpec +} + +func (spec *EKSManagedSpec) GetMaxSize() int64 { + return spec.MaxSize +} + +func (spec *EKSManagedSpec) GetMinSize() int64 { + return spec.MinSize +} + +func (s *AwsUpgradeStrategy) GetRollingUpgradeStrategy() *RollingUpgradeStrategy { return s.RollingUpgradeType } -func (s *AwsUpgradeStrategy) GetCRDType() CRDUpgradeStrategy { +func (s *AwsUpgradeStrategy) GetCRDType() *CRDUpgradeStrategy { return s.CRDType } -func (s *AwsUpgradeStrategy) SetCRDType(crd CRDUpgradeStrategy) { +func (s *AwsUpgradeStrategy) SetCRDType(crd *CRDUpgradeStrategy) { s.CRDType = crd } diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 873c28b3..facc8b03 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// autogenerated by controller-gen object, do not modify manually +// Code generated by controller-gen. DO NOT EDIT. package v1alpha1 @@ -26,8 +26,16 @@ import ( // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AwsUpgradeStrategy) DeepCopyInto(out *AwsUpgradeStrategy) { *out = *in - out.CRDType = in.CRDType - in.RollingUpgradeType.DeepCopyInto(&out.RollingUpgradeType) + if in.CRDType != nil { + in, out := &in.CRDType, &out.CRDType + *out = new(CRDUpgradeStrategy) + **out = **in + } + if in.RollingUpgradeType != nil { + in, out := &in.RollingUpgradeType, &out.RollingUpgradeType + *out = new(RollingUpgradeStrategy) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AwsUpgradeStrategy. @@ -106,7 +114,11 @@ func (in *EKSCFConfiguration) DeepCopy() *EKSCFConfiguration { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EKSCFSpec) DeepCopyInto(out *EKSCFSpec) { *out = *in - in.EKSCFConfiguration.DeepCopyInto(&out.EKSCFConfiguration) + if in.EKSCFConfiguration != nil { + in, out := &in.EKSCFConfiguration, &out.EKSCFConfiguration + *out = new(EKSCFConfiguration) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EKSCFSpec. @@ -119,6 +131,71 @@ func (in *EKSCFSpec) DeepCopy() *EKSCFSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EKSManagedConfiguration) DeepCopyInto(out *EKSManagedConfiguration) { + *out = *in + if in.NodeLabels != nil { + in, out := &in.NodeLabels, &out.NodeLabels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.NodeSecurityGroups != nil { + in, out := &in.NodeSecurityGroups, &out.NodeSecurityGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]map[string]string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + } + } + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EKSManagedConfiguration. +func (in *EKSManagedConfiguration) DeepCopy() *EKSManagedConfiguration { + if in == nil { + return nil + } + out := new(EKSManagedConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EKSManagedSpec) DeepCopyInto(out *EKSManagedSpec) { + *out = *in + if in.EKSManagedConfiguration != nil { + in, out := &in.EKSManagedConfiguration, &out.EKSManagedConfiguration + *out = new(EKSManagedConfiguration) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EKSManagedSpec. +func (in *EKSManagedSpec) DeepCopy() *EKSManagedSpec { + if in == nil { + return nil + } + out := new(EKSManagedSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InstanceGroup) DeepCopyInto(out *InstanceGroup) { *out = *in @@ -181,7 +258,16 @@ func (in *InstanceGroupList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InstanceGroupSpec) DeepCopyInto(out *InstanceGroupSpec) { *out = *in - in.EKSCFSpec.DeepCopyInto(&out.EKSCFSpec) + if in.EKSCFSpec != nil { + in, out := &in.EKSCFSpec, &out.EKSCFSpec + *out = new(EKSCFSpec) + (*in).DeepCopyInto(*out) + } + if in.EKSManagedSpec != nil { + in, out := &in.EKSManagedSpec, &out.EKSManagedSpec + *out = new(EKSManagedSpec) + (*in).DeepCopyInto(*out) + } in.AwsUpgradeStrategy.DeepCopyInto(&out.AwsUpgradeStrategy) } diff --git a/config/crd/bases/instancemgr.keikoproj.io_instancegroups.yaml b/config/crd/bases/instancemgr.keikoproj.io_instancegroups.yaml index ae59794c..b7a5f6d6 100644 --- a/config/crd/bases/instancemgr.keikoproj.io_instancegroups.yaml +++ b/config/crd/bases/instancemgr.keikoproj.io_instancegroups.yaml @@ -3,6 +3,8 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.2.4 creationTimestamp: null name: instancegroups.instancemgr.keikoproj.io spec: @@ -42,9 +44,11 @@ spec: group: instancemgr.keikoproj.io names: kind: InstanceGroup + listKind: InstanceGroupList plural: instancegroups shortNames: - ig + singular: instancegroup scope: Namespaced subresources: {} validation: @@ -62,368 +66,15 @@ spec: submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' type: string metadata: - properties: - annotations: - additionalProperties: - type: string - description: 'Annotations is an unstructured key value map stored with - a resource that may be set by external tools to store and retrieve - arbitrary metadata. They are not queryable and should be preserved - when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' - type: object - clusterName: - description: The name of the cluster which the object belongs to. This - is used to distinguish resources with same name and namespace in different - clusters. This field is not set anywhere right now and apiserver is - going to ignore it if set in create or update request. - type: string - creationTimestamp: - description: "CreationTimestamp is a timestamp representing the server - time when this object was created. It is not guaranteed to be set - in happens-before order across separate operations. Clients may not - set this value. It is represented in RFC3339 form and is in UTC. \n - Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - format: date-time - type: string - deletionGracePeriodSeconds: - description: Number of seconds allowed for this object to gracefully - terminate before it will be removed from the system. Only set when - deletionTimestamp is also set. May only be shortened. Read-only. - format: int64 - type: integer - deletionTimestamp: - description: "DeletionTimestamp is RFC 3339 date and time at which this - resource will be deleted. This field is set by the server when a graceful - deletion is requested by the user, and is not directly settable by - a client. The resource is expected to be deleted (no longer visible - from resource lists, and not reachable by name) after the time in - this field, once the finalizers list is empty. As long as the finalizers - list contains items, deletion is blocked. Once the deletionTimestamp - is set, this value may not be unset or be set further into the future, - although it may be shortened or the resource may be deleted prior - to this time. For example, a user may request that a pod is deleted - in 30 seconds. The Kubelet will react by sending a graceful termination - signal to the containers in the pod. After that 30 seconds, the Kubelet - will send a hard termination signal (SIGKILL) to the container and - after cleanup, remove the pod from the API. In the presence of network - partitions, this object may still exist after this timestamp, until - an administrator or automated process can determine the resource is - fully terminated. If not set, graceful deletion of the object has - not been requested. \n Populated by the system when a graceful deletion - is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - format: date-time - type: string - finalizers: - description: Must be empty before the object is deleted from the registry. - Each entry is an identifier for the responsible component that will - remove the entry from the list. If the deletionTimestamp of the object - is non-nil, entries in this list can only be removed. - items: - type: string - type: array - generateName: - description: "GenerateName is an optional prefix, used by the server, - to generate a unique name ONLY IF the Name field has not been provided. - If this field is used, the name returned to the client will be different - than the name passed. This value will also be combined with a unique - suffix. The provided value has the same validation rules as the Name - field, and may be truncated by the length of the suffix required to - make the value unique on the server. \n If this field is specified - and the generated name exists, the server will NOT return a 409 - - instead, it will either return 201 Created or 500 with Reason ServerTimeout - indicating a unique name could not be found in the time allotted, - and the client should retry (optionally after the time indicated in - the Retry-After header). \n Applied only if Name is not specified. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" - type: string - generation: - description: A sequence number representing a specific generation of - the desired state. Populated by the system. Read-only. - format: int64 - type: integer - initializers: - description: "An initializer is a controller which enforces some system - invariant at object creation time. This field is a list of initializers - that have not yet acted on this object. If nil or empty, this object - has been completely initialized. Otherwise, the object is considered - uninitialized and is hidden (in list/watch and get calls) from clients - that haven't explicitly asked to observe uninitialized objects. \n - When an object is created, the system will populate this list with - the current set of initializers. Only privileged users may set or - modify this list. Once it is empty, it may not be modified further - by any user. \n DEPRECATED - initializers are an alpha field and will - be removed in v1.15." - properties: - pending: - description: Pending is a list of initializers that must execute - in order before this object is visible. When the last pending - initializer is removed, and no failing result is set, the initializers - struct will be set to nil and the object is considered as initialized - and visible to all clients. - items: - properties: - name: - description: name of the process that is responsible for initializing - this object. - type: string - required: - - name - type: object - type: array - result: - description: If result is set with the Failure field, the object - will be persisted to storage and then deleted, ensuring that other - clients can observe the deletion. - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this - representation of an object. Servers should convert recognized - schemas to the latest internal value, and may reject unrecognized - values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - code: - description: Suggested HTTP return code for this status, 0 if - not set. - format: int32 - type: integer - details: - description: Extended data associated with the reason. Each - reason may define its own extended details. This field is - optional and the data returned is not guaranteed to conform - to any schema except that defined by the reason type. - properties: - causes: - description: The Causes array includes more details associated - with the StatusReason failure. Not all StatusReasons may - provide detailed causes. - items: - properties: - field: - description: "The field of the resource that has caused - this error, as named by its JSON serialization. - May include dot and postfix notation for nested - attributes. Arrays are zero-indexed. Fields may - appear more than once in an array of causes due - to fields having multiple errors. Optional. \n Examples: - \ \"name\" - the field \"name\" on the current - resource \"items[0].name\" - the field \"name\" - on the first array entry in \"items\"" - type: string - message: - description: A human-readable description of the cause - of the error. This field may be presented as-is - to a reader. - type: string - reason: - description: A machine-readable description of the - cause of the error. If this value is empty there - is no information available. - type: string - type: object - type: array - group: - description: The group attribute of the resource associated - with the status StatusReason. - type: string - kind: - description: 'The kind attribute of the resource associated - with the status StatusReason. On some operations may differ - from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - name: - description: The name attribute of the resource associated - with the status StatusReason (when there is a single name - which can be described). - type: string - retryAfterSeconds: - description: If specified, the time in seconds before the - operation should be retried. Some errors may indicate - the client must take an alternate action - for those errors - this field may indicate how long to wait before taking - the alternate action. - format: int32 - type: integer - uid: - description: 'UID of the resource. (when there is a single - resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' - type: string - type: object - kind: - description: 'Kind is a string value representing the REST resource - this object represents. Servers may infer this from the endpoint - the client submits requests to. Cannot be updated. In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - message: - description: A human-readable description of the status of this - operation. - type: string - metadata: - description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - properties: - continue: - description: continue may be set if the user set a limit - on the number of items returned, and indicates that the - server has more data available. The value is opaque and - may be used to issue another request to the endpoint that - served this list to retrieve the next set of available - objects. Continuing a consistent list may not be possible - if the server configuration has changed or more than a - few minutes have passed. The resourceVersion field returned - when using this continue value will be identical to the - value in the first response, unless you have received - this token from an error message. - type: string - resourceVersion: - description: 'String that identifies the server''s internal - version of this object that can be used by clients to - determine when objects have changed. Value must be treated - as opaque by clients and passed unmodified back to the - server. Populated by the system. Read-only. More info: - https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' - type: string - selfLink: - description: selfLink is a URL representing this object. - Populated by the system. Read-only. - type: string - type: object - reason: - description: A machine-readable description of why this operation - is in the "Failure" status. If this value is empty there is - no information available. A Reason clarifies an HTTP status - code but does not override it. - type: string - status: - description: 'Status of the operation. One of: "Success" or - "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' - type: string - type: object - required: - - pending - type: object - labels: - additionalProperties: - type: string - description: 'Map of string keys and values that can be used to organize - and categorize (scope and select) objects. May match selectors of - replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' - type: object - managedFields: - description: "ManagedFields maps workflow-id and version to the set - of fields that are managed by that workflow. This is mostly for internal - housekeeping, and users typically shouldn't need to set or understand - this field. A workflow can be the user's name, a controller's name, - or the name of a specific apply path like \"ci-cd\". The set of fields - is always in the version that the workflow used when modifying the - object. \n This field is alpha and can be changed or removed without - notice." - items: - properties: - apiVersion: - description: APIVersion defines the version of this resource that - this field set applies to. The format is "group/version" just - like the top-level APIVersion field. It is necessary to track - the version of a field set because it cannot be automatically - converted. - type: string - fields: - additionalProperties: true - description: Fields identifies a set of fields. - type: object - manager: - description: Manager is an identifier of the workflow managing - these fields. - type: string - operation: - description: Operation is the type of operation which lead to - this ManagedFieldsEntry being created. The only valid values - for this field are 'Apply' and 'Update'. - type: string - time: - description: Time is timestamp of when these fields were set. - It should always be empty if Operation is 'Apply' - format: date-time - type: string - type: object - type: array - name: - description: 'Name must be unique within a namespace. Is required when - creating resources, although some resources may allow a client to - request the generation of an appropriate name automatically. Name - is primarily intended for creation idempotence and configuration definition. - Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - namespace: - description: "Namespace defines the space within each name must be unique. - An empty namespace is equivalent to the \"default\" namespace, but - \"default\" is the canonical representation. Not all objects are required - to be scoped to a namespace - the value of this field for those objects - will be empty. \n Must be a DNS_LABEL. Cannot be updated. More info: - http://kubernetes.io/docs/user-guide/namespaces" - type: string - ownerReferences: - description: List of objects depended by this object. If ALL objects - in the list have been deleted, this object will be garbage collected. - If this object is managed by a controller, then an entry in this list - will point to this controller, with the controller field set to true. - There cannot be more than one managing controller. - items: - properties: - apiVersion: - description: API version of the referent. - type: string - blockOwnerDeletion: - description: If true, AND if the owner has the "foregroundDeletion" - finalizer, then the owner cannot be deleted from the key-value - store until this reference is removed. Defaults to false. To - set this field, a user needs "delete" permission of the owner, - otherwise 422 (Unprocessable Entity) will be returned. - type: boolean - controller: - description: If true, this reference points to the managing controller. - type: boolean - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - uid: - description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' - type: string - required: - - apiVersion - - kind - - name - - uid - type: object - type: array - resourceVersion: - description: "An opaque value that represents the internal version of - this object that can be used by clients to determine when objects - have changed. May be used for optimistic concurrency, change detection, - and the watch operation on a resource or set of resources. Clients - must treat these values as opaque and passed unmodified back to the - server. They may only be valid for a particular resource or set of - resources. \n Populated by the system. Read-only. Value must be treated - as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" - type: string - selfLink: - description: SelfLink is a URL representing this object. Populated by - the system. Read-only. - type: string - uid: - description: "UID is the unique in time and space value for this object. - It is typically generated by the server on successful creation of - a resource and is not allowed to change on PUT operations. \n Populated - by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" - type: string type: object spec: + description: InstanceGroupSpec defines the schema of resource Spec properties: eks-cf: properties: configuration: + description: EKSCFConfiguration defines the context of an AWS Instance + Group using EKSCF properties: bootstrapArguments: type: string @@ -466,11 +117,6 @@ spec: volSize: format: int32 type: integer - required: - - keyPairName - - image - - instanceType - - securityGroups type: object maxSize: format: int32 @@ -478,14 +124,63 @@ spec: minSize: format: int32 type: integer + type: object + eks-managed: + properties: + configuration: + properties: + amiType: + type: string + clusterName: + type: string + instanceType: + type: string + keyPairName: + type: string + nodeLabels: + additionalProperties: + type: string + type: object + nodeRole: + type: string + releaseVersion: + type: string + securityGroups: + items: + type: string + type: array + subnets: + items: + type: string + type: array + tags: + items: + additionalProperties: + type: string + type: object + type: array + version: + type: string + volSize: + format: int64 + type: integer + type: object + maxSize: + format: int64 + type: integer + minSize: + format: int64 + type: integer required: + - configuration - maxSize - minSize - - configuration type: object provisioner: type: string strategy: + description: AwsUpgradeStrategy defines the upgrade strategy of an AWS + Instance Group properties: crd: properties: @@ -526,10 +221,10 @@ spec: type: object required: - provisioner - - eks-cf - strategy type: object status: + description: InstanceGroupStatus defines the schema of resource Status properties: activeLaunchConfigurationName: type: string @@ -556,6 +251,7 @@ spec: - metadata - spec type: object + version: v1alpha1 versions: - name: v1alpha1 served: true diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 448bbc37..dcb2f19f 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -7,55 +7,55 @@ metadata: name: instance-manager rules: - apiGroups: - - "" + - apiextensions.k8s.io resources: - - events + - customresourcedefinitions verbs: + - create + - delete - get - list + - patch + - update - watch - - create - apiGroups: - "" resources: - configmaps verbs: + - create + - delete - get - list - - watch - - create - - update - patch - - delete + - update + - watch - apiGroups: - - apiextensions.k8s.io + - "" resources: - - customresourcedefinitions + - events verbs: + - create - get - list - watch - - create - - update - - patch - - delete - apiGroups: - instancemgr.keikoproj.io resources: - instancegroups verbs: + - create + - delete - get - list - - watch - - create - - update - patch - - delete + - update + - watch - apiGroups: - instancemgr.keikoproj.io resources: - instancegroups/status verbs: - get - - update - patch + - update diff --git a/controllers/instancegroup_controller.go b/controllers/instancegroup_controller.go index 8ed02b68..d1c53de8 100644 --- a/controllers/instancegroup_controller.go +++ b/controllers/instancegroup_controller.go @@ -28,6 +28,7 @@ import ( "github.com/keikoproj/instance-manager/controllers/common" "github.com/keikoproj/instance-manager/controllers/providers/aws" "github.com/keikoproj/instance-manager/controllers/provisioners/ekscloudformation" + "github.com/keikoproj/instance-manager/controllers/provisioners/eksmanaged" log "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -174,9 +175,76 @@ func (r *InstanceGroupReconciler) SetFinalizer(instanceGroup *v1alpha.InstanceGr } } +func (r *InstanceGroupReconciler) ReconcileEKSManaged(instanceGroup *v1alpha.InstanceGroup, finalizerName string) error { + log.Infof("upgrade strategy: %v", strings.ToLower(instanceGroup.Spec.AwsUpgradeStrategy.Type)) + + client, err := common.GetKubernetesClient() + if err != nil { + return err + } + + dynClient, err := common.GetKubernetesDynamicClient() + if err != nil { + return err + } + + awsRegion, err := aws.GetRegion() + if err != nil { + return err + } + + kube := common.KubernetesClientSet{ + Kubernetes: client, + KubeDynamic: dynClient, + } + + if _, err := os.Stat(r.ControllerConfPath); os.IsNotExist(err) { + log.Errorf("controller config file not found: %v", err) + return err + } + + controllerConfig, err := common.ReadFile(r.ControllerConfPath) + if err != nil { + return err + } + + _, err = eksmanaged.LoadControllerConfiguration(instanceGroup, controllerConfig) + if err != nil { + log.Errorf("failed to load controller configuration: %v", err) + return err + } + + awsWorker := aws.AwsWorker{ + AsgClient: aws.GetAwsAsgClient(awsRegion), + EksClient: aws.GetAwsEksClient(awsRegion), + } + + ctx, err := eksmanaged.New(instanceGroup, kube, awsWorker) + if err != nil { + return fmt.Errorf("failed to create a new eksmanaged provisioner: %v", err) + } + ctx.ControllerRegion = awsRegion + + err = HandleReconcileRequest(ctx) + if err != nil { + ctx.SetState(v1alpha.ReconcileErr) + r.Update(context.Background(), ctx.GetInstanceGroup()) + return err + } + // Remove finalizer if deleted + r.Finalize(instanceGroup, finalizerName) + + // Update resource with changes + err = r.Update(context.Background(), ctx.GetInstanceGroup()) + if err != nil { + return err + } + return nil +} + func (r *InstanceGroupReconciler) ReconcileEKSCF(instanceGroup *v1alpha.InstanceGroup, finalizerName string) error { log.Infof("upgrade strategy: %v", strings.ToLower(instanceGroup.Spec.AwsUpgradeStrategy.Type)) - var specConfig = &instanceGroup.Spec.EKSCFSpec.EKSCFConfiguration + var specConfig = instanceGroup.Spec.EKSCFSpec.EKSCFConfiguration client, err := common.GetKubernetesClient() if err != nil { @@ -254,7 +322,7 @@ func (r *InstanceGroupReconciler) ReconcileEKSCF(instanceGroup *v1alpha.Instance // Init State is set when handling reconcile // Reconcile Handler - err = HandleReconcileRequest(&ctx) + err = HandleReconcileRequest(ctx) if err != nil { ctx.SetState(v1alpha.ReconcileErr) r.Update(context.Background(), ctx.GetInstanceGroup()) @@ -314,12 +382,27 @@ func (r *InstanceGroupReconciler) Reconcile(req ctrl.Request) (ctrl.Result, erro switch strings.ToLower(ig.Spec.Provisioner) { // Provisioner EKS-Cloudformation Reconciler + case "eks-managed": + err := r.ReconcileEKSManaged(ig, finalizerName) + if err != nil { + log.Errorln(err) + } + currentState := ig.GetState() + if currentState == v1alpha.ReconcileErr { + log.Errorln("reconcile failed") + return ctrl.Result{}, nil + } else if currentState == v1alpha.ReconcileDeleted || currentState == v1alpha.ReconcileReady { + log.Infoln("reconcile completed") + return ctrl.Result{}, nil + } else { + log.Infoln("reconcile completed with requeue") + return ctrl.Result{RequeueAfter: 10 * time.Second}, nil + } case "eks-cf": err := r.ReconcileEKSCF(ig, finalizerName) if err != nil { log.Errorln(err) } - currentState := ig.GetState() if currentState == v1alpha.ReconcileErr { log.Errorln("reconcile failed") diff --git a/controllers/providers/aws/aws.go b/controllers/providers/aws/aws.go index ce8f8b60..e0652309 100644 --- a/controllers/providers/aws/aws.go +++ b/controllers/providers/aws/aws.go @@ -41,6 +41,150 @@ type AwsWorker struct { StackName string StackTags []*cloudformation.Tag StackParameters []*cloudformation.Parameter + Parameters map[string]interface{} +} + +func (w *AwsWorker) IsNodeGroupExist() bool { + input := &eks.DescribeNodegroupInput{ + ClusterName: aws.String(w.Parameters["ClusterName"].(string)), + NodegroupName: aws.String(w.Parameters["NodegroupName"].(string)), + } + _, err := w.EksClient.DescribeNodegroup(input) + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + if awsErr.Code() == eks.ErrCodeResourceNotFoundException { + return false + } + } + log.Errorln(err) + return false + } + + return true +} + +func (w *AwsWorker) GetSelfNodeGroup() (error, *eks.Nodegroup) { + input := &eks.DescribeNodegroupInput{ + ClusterName: aws.String(w.Parameters["ClusterName"].(string)), + NodegroupName: aws.String(w.Parameters["NodegroupName"].(string)), + } + output, err := w.EksClient.DescribeNodegroup(input) + if err != nil { + return err, &eks.Nodegroup{} + } + return nil, output.Nodegroup +} + +func (w *AwsWorker) DeleteManagedNodeGroup() error { + input := &eks.DeleteNodegroupInput{ + ClusterName: aws.String(w.Parameters["ClusterName"].(string)), + NodegroupName: aws.String(w.Parameters["NodegroupName"].(string)), + } + _, err := w.EksClient.DeleteNodegroup(input) + if err != nil { + return err + } + return nil +} + +func (w *AwsWorker) GetLabelsUpdatePayload(existing, new map[string]string) *eks.UpdateLabelsPayload { + + var ( + removeLabels = make([]string, 0) + addUpdateLabels = make(map[string]string) + ) + + for k, v := range new { + // handle new labels + if _, ok := existing[k]; !ok { + addUpdateLabels[k] = v + } + + // handle label value updates + if val, ok := existing[k]; ok && val != v { + addUpdateLabels[k] = v + } + } + + for k, _ := range existing { + // handle removals + if _, ok := new[k]; !ok { + removeLabels = append(removeLabels, k) + } + } + + return &eks.UpdateLabelsPayload{ + AddOrUpdateLabels: aws.StringMap(addUpdateLabels), + RemoveLabels: aws.StringSlice(removeLabels), + } +} + +func (w *AwsWorker) UpdateManagedNodeGroup(currentDesired int64, labelsPayload *eks.UpdateLabelsPayload) error { + input := &eks.UpdateNodegroupConfigInput{ + ClusterName: aws.String(w.Parameters["ClusterName"].(string)), + NodegroupName: aws.String(w.Parameters["NodegroupName"].(string)), + ScalingConfig: &eks.NodegroupScalingConfig{ + MaxSize: aws.Int64(w.Parameters["MaxSize"].(int64)), + MinSize: aws.Int64(w.Parameters["MinSize"].(int64)), + DesiredSize: aws.Int64(currentDesired), + }, + Labels: labelsPayload, + } + _, err := w.EksClient.UpdateNodegroupConfig(input) + if err != nil { + return err + } + return nil +} + +func (w *AwsWorker) CreateManagedNodeGroup() error { + input := &eks.CreateNodegroupInput{ + AmiType: aws.String(w.Parameters["AmiType"].(string)), + ClusterName: aws.String(w.Parameters["ClusterName"].(string)), + DiskSize: aws.Int64(w.Parameters["DiskSize"].(int64)), + InstanceTypes: aws.StringSlice(w.Parameters["InstanceTypes"].([]string)), + Labels: aws.StringMap(w.Parameters["Labels"].(map[string]string)), + NodeRole: aws.String(w.Parameters["NodeRole"].(string)), + NodegroupName: aws.String(w.Parameters["NodegroupName"].(string)), + ReleaseVersion: aws.String(w.Parameters["ReleaseVersion"].(string)), + RemoteAccess: &eks.RemoteAccessConfig{ + Ec2SshKey: aws.String(w.Parameters["Ec2SshKey"].(string)), + SourceSecurityGroups: aws.StringSlice(w.Parameters["SourceSecurityGroups"].([]string)), + }, + ScalingConfig: &eks.NodegroupScalingConfig{ + MaxSize: aws.Int64(w.Parameters["MaxSize"].(int64)), + MinSize: aws.Int64(w.Parameters["MinSize"].(int64)), + DesiredSize: aws.Int64(w.Parameters["MinSize"].(int64)), + }, + Subnets: aws.StringSlice(w.Parameters["Subnets"].([]string)), + Tags: aws.StringMap(w.compactTags(w.Parameters["Tags"].([]map[string]string))), + Version: aws.String(w.Parameters["Version"].(string)), + } + + _, err := w.EksClient.CreateNodegroup(input) + if err != nil { + return err + } + return nil +} + +func (w *AwsWorker) compactTags(tags []map[string]string) map[string]string { + compacted := make(map[string]string) + for _, tagSet := range tags { + var ( + key string + value string + ) + for t, v := range tagSet { + if t == "key" { + key = v + } else if t == "value" { + value = v + } + } + compacted[key] = value + } + return compacted } func (w *AwsWorker) CreateCloudformationStack() error { @@ -288,6 +432,44 @@ var UpdateRecoverableError = CloudformationReconcileState{UpdateRecoverableError var UnrecoverableError = CloudformationReconcileState{UnrecoverableError: true} var UnrecoverableDeleteError = CloudformationReconcileState{UnrecoverableDeleteError: true} +type ManagedNodeGroupReconcileState struct { + OngoingState bool + FiniteState bool + UnrecoverableError bool + UnrecoverableDeleteError bool +} + +var ManagedNodeGroupOngoingState = ManagedNodeGroupReconcileState{OngoingState: true} +var ManagedNodeGroupFiniteState = ManagedNodeGroupReconcileState{FiniteState: true} +var ManagedNodeGroupUnrecoverableError = ManagedNodeGroupReconcileState{UnrecoverableError: true} +var ManagedNodeGroupUnrecoverableDeleteError = ManagedNodeGroupReconcileState{UnrecoverableDeleteError: true} + +func IsNodeGroupInConditionState(key string, condition string) bool { + conditionStates := map[string]ManagedNodeGroupReconcileState{ + "CREATING": ManagedNodeGroupOngoingState, + "UPDATING": ManagedNodeGroupOngoingState, + "DELETING": ManagedNodeGroupOngoingState, + "ACTIVE": ManagedNodeGroupFiniteState, + "DEGRADED": ManagedNodeGroupFiniteState, + "CREATE_FAILED": ManagedNodeGroupUnrecoverableError, + "DELETE_FAILED": ManagedNodeGroupUnrecoverableDeleteError, + } + state := conditionStates[key] + + switch condition { + case "OngoingState": + return state.OngoingState + case "FiniteState": + return state.FiniteState + case "UnrecoverableError": + return state.UnrecoverableError + case "UnrecoverableDeleteError": + return state.UnrecoverableDeleteError + default: + return false + } +} + func IsStackInConditionState(key string, condition string) bool { conditionStates := map[string]CloudformationReconcileState{ "CREATE_COMPLETE": FiniteState, diff --git a/controllers/provisioners/ekscloudformation/ekscloudformation.go b/controllers/provisioners/ekscloudformation/ekscloudformation.go index c43d19cd..312a8ce3 100644 --- a/controllers/provisioners/ekscloudformation/ekscloudformation.go +++ b/controllers/provisioners/ekscloudformation/ekscloudformation.go @@ -20,7 +20,6 @@ import ( "strings" "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime/schema" "regexp" @@ -40,11 +39,6 @@ var ( outputLaunchConfiguration = "LaunchConfigName" outputScalingGroupName = "AsgName" outputGroupARN = "NodeInstanceRole" - groupVersionResource = schema.GroupVersionResource{ - Group: "instancemgr.keikoproj.io", - Version: "v1alpha1", - Resource: "instancegroups", - } ) const ( @@ -57,18 +51,18 @@ const ( ) // New constructs a new instance group provisioner of EKS Cloudformation type -func New(instanceGroup *v1alpha1.InstanceGroup, k common.KubernetesClientSet, w awsprovider.AwsWorker) (EksCfInstanceGroupContext, error) { +func New(instanceGroup *v1alpha1.InstanceGroup, k common.KubernetesClientSet, w awsprovider.AwsWorker) (*EksCfInstanceGroupContext, error) { log.SetFormatter(&logrus.TextFormatter{ FullTimestamp: true, }) - var specConfig = &instanceGroup.Spec.EKSCFSpec.EKSCFConfiguration + var specConfig = instanceGroup.Spec.EKSCFSpec.EKSCFConfiguration vpcID, err := w.DeriveEksVpcID(specConfig.GetClusterName()) if err != nil { - return EksCfInstanceGroupContext{}, err + return &EksCfInstanceGroupContext{}, err } - ctx := EksCfInstanceGroupContext{ + ctx := &EksCfInstanceGroupContext{ InstanceGroup: instanceGroup, KubernetesClient: k, AwsWorker: w, @@ -80,7 +74,7 @@ func New(instanceGroup *v1alpha1.InstanceGroup, k common.KubernetesClientSet, w err = ctx.processParameters() if err != nil { log.Errorf("failed to parse cloudformation parameters: %v", err) - return EksCfInstanceGroupContext{}, err + return &EksCfInstanceGroupContext{}, err } return ctx, nil @@ -257,8 +251,8 @@ func (ctx *EksCfInstanceGroupContext) discoverInstanceGroups() { } instanceGroup := ctx.GetInstanceGroup() spec := &instanceGroup.Spec - provisionerConfig := &spec.EKSCFSpec - specConfig := &provisionerConfig.EKSCFConfiguration + provisionerConfig := spec.EKSCFSpec + specConfig := provisionerConfig.EKSCFConfiguration state := ctx.GetDiscoveredState() stacks := state.GetCloudformationStacks() @@ -296,7 +290,7 @@ func (ctx *EksCfInstanceGroupContext) discoverInstanceGroups() { if group.Namespace != "" && group.Name != "" { var groupDeleting bool var groupDeleted bool - groupDeleting, err := ctx.isResourceDeleting(groupVersionResource, group.Namespace, group.Name) + groupDeleting, err := ctx.isResourceDeleting(v1alpha1.GroupVersionResource, group.Namespace, group.Name) if err != nil { if errors.IsNotFound(err) { groupDeleted = true @@ -345,8 +339,8 @@ func (ctx *EksCfInstanceGroupContext) parseTags() { instanceGroup := ctx.GetInstanceGroup() spec := &instanceGroup.Spec meta := &instanceGroup.ObjectMeta - provisionerConfig := &spec.EKSCFSpec - specConfig := &provisionerConfig.EKSCFConfiguration + provisionerConfig := spec.EKSCFSpec + specConfig := provisionerConfig.EKSCFConfiguration tags = map[string]string{ TagClusterName: specConfig.GetClusterName(), @@ -447,8 +441,8 @@ func (ctx *EksCfInstanceGroupContext) processParameters() error { instanceGroup := ctx.GetInstanceGroup() spec := &instanceGroup.Spec meta := &instanceGroup.ObjectMeta - provisionerConfig := &spec.EKSCFSpec - specConfig := &provisionerConfig.EKSCFConfiguration + provisionerConfig := spec.EKSCFSpec + specConfig := provisionerConfig.EKSCFConfiguration roleLabel := fmt.Sprintf("node-role.kubernetes.io/%v=\"\"", meta.GetName()) kubeletArgs := fmt.Sprintf("--node-labels=%v", roleLabel) @@ -481,8 +475,11 @@ func (ctx *EksCfInstanceGroupContext) processParameters() error { "VpcId": ctx.VpcID, "ManagedPolicyARNs": getManagedPolicyARNs(specConfig.ManagedPolicies), "NodeAutoScalingGroupMetrics": getNodeAutoScalingGroupMetrics(specConfig.GetMetricsCollection()), - "ExistingRoleName": existingRole, - "ExistingInstanceProfileName": existingProfile, + } + + if existingRole != "" && existingProfile != "" { + rawParameters["ExistingRoleName"] = existingRole + rawParameters["ExistingInstanceProfileName"] = existingProfile } var parameters []*cloudformation.Parameter diff --git a/controllers/provisioners/ekscloudformation/ekscloudformation_test.go b/controllers/provisioners/ekscloudformation/ekscloudformation_test.go index 42b364ea..2027f564 100644 --- a/controllers/provisioners/ekscloudformation/ekscloudformation_test.go +++ b/controllers/provisioners/ekscloudformation/ekscloudformation_test.go @@ -437,10 +437,10 @@ func (f *FakeIG) getInstanceGroup() *v1alpha1.InstanceGroup { }, Spec: v1alpha1.InstanceGroupSpec{ Provisioner: "eks-cf", - EKSCFSpec: v1alpha1.EKSCFSpec{ + EKSCFSpec: &v1alpha1.EKSCFSpec{ MaxSize: 3, MinSize: 1, - EKSCFConfiguration: v1alpha1.EKSCFConfiguration{ + EKSCFConfiguration: &v1alpha1.EKSCFConfiguration{ BootstrapArguments: f.BootstrapArguments, Tags: []map[string]string{ { @@ -452,7 +452,7 @@ func (f *FakeIG) getInstanceGroup() *v1alpha1.InstanceGroup { }, AwsUpgradeStrategy: v1alpha1.AwsUpgradeStrategy{ Type: f.UpgradeStrategyType, - CRDType: v1alpha1.CRDUpgradeStrategy{ + CRDType: &v1alpha1.CRDUpgradeStrategy{ Spec: f.UpgradeStrategyCRDSpec, ConcurrencyPolicy: f.ConcurrencyPolicy, CRDName: f.UpgradeStrategyCRD, @@ -460,6 +460,7 @@ func (f *FakeIG) getInstanceGroup() *v1alpha1.InstanceGroup { StatusSuccessString: f.UpgradeStrategyCRDStatusSuccess, StatusFailureString: f.UpgradeStrategyCRDStatusFail, }, + RollingUpgradeType: &v1alpha1.RollingUpgradeStrategy{}, }, }, Status: v1alpha1.InstanceGroupStatus{ @@ -488,7 +489,7 @@ func getSpotSuggestionEvent(id, scalingGroup, price string, useSpot bool, ts tim return event } -func getBasicContext(t *testing.T, awsMocker awsprovider.AwsWorker) EksCfInstanceGroupContext { +func getBasicContext(t *testing.T, awsMocker awsprovider.AwsWorker) *EksCfInstanceGroupContext { client := fake.NewSimpleClientset() dynScheme := runtime.NewScheme() dynClient := fakedynamic.NewSimpleDynamicClient(dynScheme) @@ -559,13 +560,13 @@ func (u *EksCfUnitTest) Run(t *testing.T) { unstructuredInstanceGroup := &unstructured.Unstructured{ Object: obj, } - kube.KubeDynamic.Resource(groupVersionResource).Namespace(u.InstanceGroup.GetNamespace()).Create(unstructuredInstanceGroup, metav1.CreateOptions{}) + kube.KubeDynamic.Resource(v1alpha1.GroupVersionResource).Namespace(u.InstanceGroup.GetNamespace()).Create(unstructuredInstanceGroup, metav1.CreateOptions{}) provisioner, err := New(u.InstanceGroup, kube, aws) if err != nil { t.Fail() } - u.Provisioner = &provisioner + u.Provisioner = provisioner if len(u.ExistingEvents) != 0 { for _, event := range u.ExistingEvents { @@ -1179,7 +1180,7 @@ defaultArns: - MyARN-1 - MyARN-2`) ig := ctx.GetInstanceGroup() - specConfig := &ig.Spec.EKSCFSpec.EKSCFConfiguration + specConfig := ig.Spec.EKSCFSpec.EKSCFConfiguration config, err := LoadControllerConfiguration(ig, payload) if err != nil { t.Fatal("Test_ControllerConfigLoader expected error not to have occured") diff --git a/controllers/provisioners/ekscloudformation/helpers.go b/controllers/provisioners/ekscloudformation/helpers.go index f3889c9d..c9f59c67 100644 --- a/controllers/provisioners/ekscloudformation/helpers.go +++ b/controllers/provisioners/ekscloudformation/helpers.go @@ -104,7 +104,7 @@ func (ctx *EksCfInstanceGroupContext) reloadCloudformationConfiguration() error func LoadControllerConfiguration(ig *v1alpha1.InstanceGroup, controllerConfig []byte) (EksCfDefaultConfiguration, error) { var defaultConfig EksCfDefaultConfiguration - var specConfig = &ig.Spec.EKSCFSpec.EKSCFConfiguration + var specConfig = ig.Spec.EKSCFSpec.EKSCFConfiguration err := yaml.Unmarshal(controllerConfig, &defaultConfig) if err != nil { diff --git a/controllers/provisioners/ekscloudformation/spot.go b/controllers/provisioners/ekscloudformation/spot.go index c01444f0..99bd2169 100644 --- a/controllers/provisioners/ekscloudformation/spot.go +++ b/controllers/provisioners/ekscloudformation/spot.go @@ -34,8 +34,8 @@ func (ctx *EksCfInstanceGroupContext) discoverSpotPrice() { instanceGroup = ctx.GetInstanceGroup() status = &instanceGroup.Status spec = &instanceGroup.Spec - provisionerConfig = &spec.EKSCFSpec - specConfig = &provisionerConfig.EKSCFConfiguration + provisionerConfig = spec.EKSCFSpec + specConfig = provisionerConfig.EKSCFConfiguration scalingGroupName = status.GetActiveScalingGroupName() ) diff --git a/controllers/provisioners/ekscloudformation/strategy.go b/controllers/provisioners/ekscloudformation/strategy.go index 649c7ce2..f2118195 100644 --- a/controllers/provisioners/ekscloudformation/strategy.go +++ b/controllers/provisioners/ekscloudformation/strategy.go @@ -80,18 +80,19 @@ func (ctx *EksCfInstanceGroupContext) discoverCreatedResources(s schema.GroupVer func (ctx *EksCfInstanceGroupContext) setRollingStrategyConfigurationDefaults() { var ( - instanceGroup = ctx.GetInstanceGroup() - strategyConfiguration = &instanceGroup.Spec.AwsUpgradeStrategy.RollingUpgradeType - maxBatchSize = strategyConfiguration.GetMaxBatchSize() - minInService = strategyConfiguration.GetMinInstancesInService() - minSuccessfulPercent = strategyConfiguration.GetMinSuccessfulInstancesPercent() - pauseTime = strategyConfiguration.GetPauseTime() + instanceGroup = ctx.GetInstanceGroup() ) if strings.ToLower(instanceGroup.Spec.AwsUpgradeStrategy.Type) != "rollingupdate" { return } + strategyConfiguration := instanceGroup.Spec.AwsUpgradeStrategy.RollingUpgradeType + maxBatchSize := strategyConfiguration.GetMaxBatchSize() + minInService := strategyConfiguration.GetMinInstancesInService() + minSuccessfulPercent := strategyConfiguration.GetMinSuccessfulInstancesPercent() + pauseTime := strategyConfiguration.GetPauseTime() + if maxBatchSize == 0 { strategyConfiguration.SetMaxBatchSize(1) } diff --git a/controllers/provisioners/eksmanaged/eksmanaged.go b/controllers/provisioners/eksmanaged/eksmanaged.go new file mode 100644 index 00000000..541caaf8 --- /dev/null +++ b/controllers/provisioners/eksmanaged/eksmanaged.go @@ -0,0 +1,283 @@ +/* + +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. +*/ + +package eksmanaged + +import ( + "reflect" + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/controllers/common" + awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" + "github.com/sirupsen/logrus" + yaml "gopkg.in/yaml.v2" +) + +const ( + OngoingStateString = "OngoingState" + FiniteStateString = "FiniteState" + UnrecoverableErrorString = "UnrecoverableError" + UnrecoverableDeleteErrorString = "UnrecoverableDeleteError" +) + +var ( + log = logrus.New() + TagClusterName = "instancegroups.keikoproj.io/ClusterName" + TagInstanceGroupName = "instancegroups.keikoproj.io/InstanceGroup" + TagClusterNamespace = "instancegroups.keikoproj.io/Namespace" +) + +func (ctx *EksManagedInstanceGroupContext) CloudDiscovery() error { + var ( + provisioned = ctx.AwsWorker.IsNodeGroupExist() + discoveredState = ctx.GetDiscoveredState() + instanceGroup = ctx.GetInstanceGroup() + status = &instanceGroup.Status + groups = []string{} + ) + + if provisioned { + discoveredState.SetProvisioned(true) + err, createdResource := ctx.AwsWorker.GetSelfNodeGroup() + if err != nil { + return err + } + currentStatus := aws.StringValue(createdResource.Status) + discoveredState.SetSelfNodeGroup(createdResource) + discoveredState.SetCurrentState(currentStatus) + status.SetCurrentMax(int(aws.Int64Value(createdResource.ScalingConfig.MaxSize))) + status.SetCurrentMin(int(aws.Int64Value(createdResource.ScalingConfig.MinSize))) + status.SetLifecycle("normal") + + for _, asg := range createdResource.Resources.AutoScalingGroups { + groups = append(groups, aws.StringValue(asg.Name)) + } + status.SetActiveScalingGroupName(strings.Join(groups, ",")) + + } else { + discoveredState.SetProvisioned(false) + } + return nil +} + +func (ctx *EksManagedInstanceGroupContext) StateDiscovery() { + var ( + instanceGroup = ctx.GetInstanceGroup() + discoveredState = ctx.GetDiscoveredState() + provisioned = discoveredState.IsProvisioned() + nodeGroupState = discoveredState.GetCurrentState() + ) + + if instanceGroup.GetState() == v1alpha1.ReconcileInit { + if ctx.InstanceGroup.ObjectMeta.DeletionTimestamp.IsZero() { + // resource is not being deleted + if provisioned { + // nodegroup exists + if awsprovider.IsNodeGroupInConditionState(nodeGroupState, OngoingStateString) { + // nodegroup is in an ongoing state + instanceGroup.SetState(v1alpha1.ReconcileModifying) + } else if awsprovider.IsNodeGroupInConditionState(nodeGroupState, FiniteStateString) { + // nodegroup is in a finite state + instanceGroup.SetState(v1alpha1.ReconcileInitUpdate) + } else if awsprovider.IsNodeGroupInConditionState(nodeGroupState, UnrecoverableErrorString) { + // nodegroup is in unrecoverable error state + instanceGroup.SetState(v1alpha1.ReconcileErr) + } + } else { + // nodegroup does not exist + instanceGroup.SetState(v1alpha1.ReconcileInitCreate) + } + } else { + // resource is being deleted + if provisioned { + if awsprovider.IsNodeGroupInConditionState(nodeGroupState, OngoingStateString) { + // deleting nodegroup is in an ongoing state + instanceGroup.SetState(v1alpha1.ReconcileDeleting) + } else if awsprovider.IsNodeGroupInConditionState(nodeGroupState, UnrecoverableErrorString) { + // deleting nodegroup is in a unrecoverable error state - allow it to delete + instanceGroup.SetState(v1alpha1.ReconcileInitDelete) + } else if awsprovider.IsNodeGroupInConditionState(nodeGroupState, FiniteStateString) { + // deleting nodegroup is in finite state, delete it + instanceGroup.SetState(v1alpha1.ReconcileInitDelete) + } else if awsprovider.IsNodeGroupInConditionState(nodeGroupState, UnrecoverableDeleteErrorString) { + // deleting nodegroup is in a unrecoverable delete error state + instanceGroup.SetState(v1alpha1.ReconcileErr) + } + } else { + // Stack does not exist + instanceGroup.SetState(v1alpha1.ReconcileDeleted) + } + } + } +} + +func (ctx *EksManagedInstanceGroupContext) Create() error { + var ( + instanceGroup = ctx.GetInstanceGroup() + ) + err := ctx.AwsWorker.CreateManagedNodeGroup() + if err != nil { + return err + } + instanceGroup.SetState(v1alpha1.ReconcileModifying) + return nil +} + +func (ctx *EksManagedInstanceGroupContext) isUpdateNeeded() bool { + var ( + instanceGroup = ctx.GetInstanceGroup() + selfNodeGroup = ctx.DiscoveredState.GetSelfNodeGroup() + existingLabels = instanceGroup.Spec.EKSManagedSpec.EKSManagedConfiguration.GetLabels() + condition bool + ) + + if instanceGroup.Spec.EKSManagedSpec.GetMinSize() != aws.Int64Value(selfNodeGroup.ScalingConfig.MinSize) { + condition = true + } + + if instanceGroup.Spec.EKSManagedSpec.GetMaxSize() != aws.Int64Value(selfNodeGroup.ScalingConfig.MaxSize) { + condition = true + } + + if !reflect.DeepEqual(existingLabels, aws.StringValueMap(selfNodeGroup.Labels)) { + condition = true + } + return condition +} + +func (ctx *EksManagedInstanceGroupContext) Update() error { + var ( + instanceGroup = ctx.GetInstanceGroup() + nodeLabels = instanceGroup.Spec.EKSManagedSpec.EKSManagedConfiguration.NodeLabels + selfNodeGroup = ctx.DiscoveredState.GetSelfNodeGroup() + currentDesired = aws.Int64Value(selfNodeGroup.ScalingConfig.DesiredSize) + requestedMin = instanceGroup.Spec.EKSManagedSpec.MinSize + ) + + if currentDesired < requestedMin { + currentDesired = requestedMin + } + + labels := ctx.AwsWorker.GetLabelsUpdatePayload(aws.StringValueMap(selfNodeGroup.Labels), nodeLabels) + + if ctx.isUpdateNeeded() { + err := ctx.AwsWorker.UpdateManagedNodeGroup(currentDesired, labels) + if err != nil { + return err + } + instanceGroup.SetState(v1alpha1.ReconcileModifying) + } else { + instanceGroup.SetState(v1alpha1.ReconcileModified) + } + + return nil +} + +func (ctx *EksManagedInstanceGroupContext) Delete() error { + var ( + instanceGroup = ctx.GetInstanceGroup() + ) + err := ctx.AwsWorker.DeleteManagedNodeGroup() + if err != nil { + return err + } + instanceGroup.SetState(v1alpha1.ReconcileDeleting) + return nil +} + +func (ctx *EksManagedInstanceGroupContext) UpgradeNodes() error { + // upgrade not required + return nil +} + +func (ctx *EksManagedInstanceGroupContext) BootstrapNodes() error { + // bootstrap not required + return nil +} + +func (ctx *EksManagedInstanceGroupContext) IsReady() bool { + instanceGroup := ctx.GetInstanceGroup() + if instanceGroup.GetState() == v1alpha1.ReconcileModified || instanceGroup.GetState() == v1alpha1.ReconcileDeleted { + return true + } + return false +} + +func New(instanceGroup *v1alpha1.InstanceGroup, k common.KubernetesClientSet, w awsprovider.AwsWorker) (*EksManagedInstanceGroupContext, error) { + log.SetFormatter(&logrus.TextFormatter{ + FullTimestamp: true, + }) + + ctx := &EksManagedInstanceGroupContext{ + InstanceGroup: instanceGroup, + KubernetesClient: k, + AwsWorker: w, + DiscoveredState: &DiscoveredState{}, + } + + instanceGroup.SetState(v1alpha1.ReconcileInit) + ctx.processParameters() + + return ctx, nil +} +func (ctx *EksManagedInstanceGroupContext) processParameters() { + var ( + instanceGroup = ctx.GetInstanceGroup() + spec = instanceGroup.GetEKSManagedSpec() + configuration = instanceGroup.GetEKSManagedConfiguration() + params = make(map[string]interface{}, 0) + ) + + params["AmiType"] = configuration.AmiType + params["ClusterName"] = configuration.EksClusterName + params["DiskSize"] = int64(configuration.VolSize) + params["InstanceTypes"] = []string{configuration.InstanceType} + params["Labels"] = configuration.NodeLabels + params["NodeRole"] = configuration.NodeRole + params["NodegroupName"] = instanceGroup.GetName() + params["ReleaseVersion"] = configuration.ReleaseVersion + params["Version"] = configuration.Version + params["Ec2SshKey"] = configuration.KeyPairName + params["SourceSecurityGroups"] = configuration.NodeSecurityGroups + params["Subnets"] = configuration.Subnets + params["Tags"] = configuration.Tags + params["MinSize"] = spec.GetMinSize() + params["MaxSize"] = spec.GetMaxSize() + ctx.AwsWorker.Parameters = params +} + +func LoadControllerConfiguration(ig *v1alpha1.InstanceGroup, controllerConfig []byte) (EksManagedDefaultConfiguration, error) { + var ( + defaultConfig EksManagedDefaultConfiguration + specConfig = ig.Spec.EKSManagedSpec.EKSManagedConfiguration + ) + + err := yaml.Unmarshal(controllerConfig, &defaultConfig) + if err != nil { + return defaultConfig, err + } + + if len(defaultConfig.DefaultSubnets) != 0 { + specConfig.SetSubnets(defaultConfig.DefaultSubnets) + } + + if defaultConfig.EksClusterName != "" { + specConfig.SetClusterName(defaultConfig.EksClusterName) + } + + return defaultConfig, nil +} diff --git a/controllers/provisioners/eksmanaged/eksmanaged_test.go b/controllers/provisioners/eksmanaged/eksmanaged_test.go new file mode 100644 index 00000000..86b14363 --- /dev/null +++ b/controllers/provisioners/eksmanaged/eksmanaged_test.go @@ -0,0 +1,344 @@ +/* + +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. +*/ + +package eksmanaged + +import ( + "flag" + "io/ioutil" + "testing" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/service/eks" + "github.com/aws/aws-sdk-go/service/eks/eksiface" + "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/controllers/common" + awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + fakedynamic "k8s.io/client-go/dynamic/fake" + "k8s.io/client-go/kubernetes/fake" +) + +type EksManagedUnitTest struct { + Description string + Provisioner *EksManagedInstanceGroupContext + InstanceGroup *v1alpha1.InstanceGroup + GroupExist bool + NodeGroup *eks.Nodegroup + UpdateNeeded bool + VpcID string + ExpectedState v1alpha1.ReconcileState +} + +type FakeIG struct { + Name string + Namespace string + ClusterName string + CurrentState string + IsDeleting bool +} + +type stubEKS struct { + eksiface.EKSAPI + NodeGroup *eks.Nodegroup + NodeGroupExists bool +} + +func (s *stubEKS) DescribeNodegroup(input *eks.DescribeNodegroupInput) (*eks.DescribeNodegroupOutput, error) { + output := &eks.DescribeNodegroupOutput{ + Nodegroup: s.NodeGroup, + } + if !s.NodeGroupExists { + return output, awserr.New(eks.ErrCodeResourceNotFoundException, "not found", errors.New("notFound")) + } + return output, nil +} + +func (s *stubEKS) CreateNodegroup(input *eks.CreateNodegroupInput) (*eks.CreateNodegroupOutput, error) { + output := &eks.CreateNodegroupOutput{} + return output, nil +} + +func (s *stubEKS) UpdateNodegroupConfig(input *eks.UpdateNodegroupConfigInput) (*eks.UpdateNodegroupConfigOutput, error) { + output := &eks.UpdateNodegroupConfigOutput{} + return output, nil +} + +func (s *stubEKS) DeleteNodegroup(input *eks.DeleteNodegroupInput) (*eks.DeleteNodegroupOutput, error) { + output := &eks.DeleteNodegroupOutput{} + return output, nil +} + +var loggingEnabled bool + +func init() { + flag.BoolVar(&loggingEnabled, "logging-enabled", false, "Enable Logging") +} + +func getNodeGroup(state string) *eks.Nodegroup { + return &eks.Nodegroup{ + Status: aws.String(state), + Resources: &eks.NodegroupResources{ + AutoScalingGroups: []*eks.AutoScalingGroup{ + &eks.AutoScalingGroup{ + Name: aws.String("some-asg"), + }, + }, + }, + ScalingConfig: &eks.NodegroupScalingConfig{ + MinSize: aws.Int64(3), + MaxSize: aws.Int64(6), + }, + } +} + +func (f *FakeIG) getInstanceGroup() *v1alpha1.InstanceGroup { + var deletionTimestamp metav1.Time + + if f.Name == "" { + f.Name = "instancegroup-1" + } + if f.Namespace == "" { + f.Namespace = "namespace-1" + } + if f.ClusterName == "" { + f.ClusterName = "EKS-Test" + } + if f.CurrentState == "" { + f.CurrentState = "Null" + } + if f.IsDeleting == true { + deletionTimestamp = metav1.Time{Time: time.Now()} + } else { + nilTime := time.Time{} + deletionTimestamp = metav1.Time{Time: nilTime} + } + + instanceGroup := &v1alpha1.InstanceGroup{ + ObjectMeta: metav1.ObjectMeta{ + Name: f.Name, + Namespace: f.Namespace, + DeletionTimestamp: &deletionTimestamp, + }, + Spec: v1alpha1.InstanceGroupSpec{ + Provisioner: "eks-managed", + EKSManagedSpec: &v1alpha1.EKSManagedSpec{ + MaxSize: 3, + MinSize: 1, + EKSManagedConfiguration: &v1alpha1.EKSManagedConfiguration{ + EksClusterName: f.ClusterName, + VolSize: 20, + InstanceType: "m3.medium", + NodeRole: "some-iam-role", + KeyPairName: "my-keypair", + NodeSecurityGroups: []string{"sg-122222", "sg-3333333"}, + NodeLabels: map[string]string{"foo": "bar"}, + AmiType: "AL2_x86_64", + Subnets: []string{"subnet-122222", "subnet-3333333"}, + Tags: []map[string]string{ + { + "key": "a-key", + "value": "a-value", + }, + }, + }, + }, + AwsUpgradeStrategy: v1alpha1.AwsUpgradeStrategy{ + Type: "managed", + }, + }, + Status: v1alpha1.InstanceGroupStatus{ + CurrentState: f.CurrentState, + }, + } + + return instanceGroup +} + +func (u *EksManagedUnitTest) Run(t *testing.T) { + + var ( + client = fake.NewSimpleClientset() + dynScheme = runtime.NewScheme() + dynClient = fakedynamic.NewSimpleDynamicClient(dynScheme) + ) + + if !loggingEnabled { + log.Out = ioutil.Discard + } + + kube := common.KubernetesClientSet{ + Kubernetes: client, + KubeDynamic: dynClient, + } + + u.VpcID = "vpc-123345" + + aws := awsprovider.AwsWorker{ + EksClient: &stubEKS{ + NodeGroupExists: u.GroupExist, + NodeGroup: u.NodeGroup, + }, + } + + obj, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(u.InstanceGroup) + unstructuredInstanceGroup := &unstructured.Unstructured{ + Object: obj, + } + kube.KubeDynamic.Resource(v1alpha1.GroupVersionResource).Namespace(u.InstanceGroup.GetNamespace()).Create(unstructuredInstanceGroup, metav1.CreateOptions{}) + + provisioner, err := New(u.InstanceGroup, kube, aws) + if err != nil { + t.Fatal(err) + } + u.Provisioner = provisioner + + if err := u.Provisioner.CloudDiscovery(); err != nil { + t.Fatal(err) + } + + u.Provisioner.StateDiscovery() + if u.ExpectedState != u.InstanceGroup.GetState() { + t.Fatalf("DiscoveredState, expected:\n %#v, \ngot:\n %#v", u.ExpectedState, u.InstanceGroup.GetState()) + } + + if u.InstanceGroup.GetState() == v1alpha1.ReconcileInitDelete { + if err := u.Provisioner.Delete(); err != nil { + t.Fatal(err) + } + } + + if u.InstanceGroup.GetState() == v1alpha1.ReconcileInitCreate { + if err := u.Provisioner.Create(); err != nil { + t.Fatal(err) + } + } + + if u.InstanceGroup.GetState() == v1alpha1.ReconcileInitUpdate { + if err := u.Provisioner.Update(); err != nil { + t.Fatal(err) + } + } +} + +func TestStateDiscoveryInitUpdate(t *testing.T) { + ig := FakeIG{} + testCase := EksManagedUnitTest{ + Description: "StateDiscovery - when a nodegroup already exist (active), state should be InitUpdate", + InstanceGroup: ig.getInstanceGroup(), + NodeGroup: getNodeGroup("ACTIVE"), + UpdateNeeded: true, + GroupExist: true, + ExpectedState: v1alpha1.ReconcileInitUpdate, + } + testCase.Run(t) +} + +func TestStateDiscoveryModifying(t *testing.T) { + ig := FakeIG{} + testCase := EksManagedUnitTest{ + Description: "StateDiscovery - when a nodegroup already exist (updating), state should be ReconcileModifying", + InstanceGroup: ig.getInstanceGroup(), + NodeGroup: getNodeGroup("UPDATING"), + UpdateNeeded: true, + GroupExist: true, + ExpectedState: v1alpha1.ReconcileModifying, + } + testCase.Run(t) +} + +func TestStateDiscoveryFailed(t *testing.T) { + ig := FakeIG{} + testCase := EksManagedUnitTest{ + Description: "StateDiscovery - when a nodegroup already exist (failed), state should be ReconcileErr", + InstanceGroup: ig.getInstanceGroup(), + NodeGroup: getNodeGroup("CREATE_FAILED"), + UpdateNeeded: true, + GroupExist: true, + ExpectedState: v1alpha1.ReconcileErr, + } + testCase.Run(t) +} + +func TestStateDiscoveryCreate(t *testing.T) { + ig := FakeIG{} + testCase := EksManagedUnitTest{ + Description: "StateDiscovery - when a nodegroup does not exist, state should be InitCreate", + InstanceGroup: ig.getInstanceGroup(), + GroupExist: false, + ExpectedState: v1alpha1.ReconcileInitCreate, + } + testCase.Run(t) +} + +func TestStateDiscoveryDeleting(t *testing.T) { + ig := FakeIG{ + IsDeleting: true, + } + testCase := EksManagedUnitTest{ + Description: "StateDiscovery - when a nodegroup already exists (DELETING), state should be Deleting", + InstanceGroup: ig.getInstanceGroup(), + NodeGroup: getNodeGroup("DELETING"), + GroupExist: true, + ExpectedState: v1alpha1.ReconcileDeleting, + } + testCase.Run(t) +} + +func TestStateDiscoveryInitDelete(t *testing.T) { + ig := FakeIG{ + IsDeleting: true, + } + testCase := EksManagedUnitTest{ + Description: "StateDiscovery - when a nodegroup already exists (ACTIVE), state should be InitDelete", + InstanceGroup: ig.getInstanceGroup(), + NodeGroup: getNodeGroup("ACTIVE"), + GroupExist: true, + ExpectedState: v1alpha1.ReconcileInitDelete, + } + testCase.Run(t) +} + +func TestStateDiscoveryDeleteFail(t *testing.T) { + ig := FakeIG{ + IsDeleting: true, + } + testCase := EksManagedUnitTest{ + Description: "StateDiscovery - when a nodegroup already exists (DELETE_FAILED), state should be ReconcileErr", + InstanceGroup: ig.getInstanceGroup(), + NodeGroup: getNodeGroup("DELETE_FAILED"), + GroupExist: true, + ExpectedState: v1alpha1.ReconcileErr, + } + testCase.Run(t) +} + +func TestStateDiscoveryDeleted(t *testing.T) { + ig := FakeIG{ + IsDeleting: true, + } + testCase := EksManagedUnitTest{ + Description: "StateDiscovery - when a nodegroup does not exist, state should be Deleted", + InstanceGroup: ig.getInstanceGroup(), + GroupExist: false, + ExpectedState: v1alpha1.ReconcileDeleted, + } + testCase.Run(t) +} diff --git a/controllers/provisioners/eksmanaged/types.go b/controllers/provisioners/eksmanaged/types.go new file mode 100644 index 00000000..25c1e21d --- /dev/null +++ b/controllers/provisioners/eksmanaged/types.go @@ -0,0 +1,97 @@ +/* + +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. +*/ + +package eksmanaged + +import ( + "github.com/aws/aws-sdk-go/service/eks" + "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/controllers/common" + "github.com/keikoproj/instance-manager/controllers/providers/aws" +) + +type EksManagedDefaultConfiguration struct { + DefaultSubnets []string `yaml:"defaultSubnets,omitempty"` + EksClusterName string `yaml:"defaultClusterName,omitempty"` +} + +type EksManagedInstanceGroupContext struct { + InstanceGroup *v1alpha1.InstanceGroup + KubernetesClient common.KubernetesClientSet + AwsWorker aws.AwsWorker + DiscoveredState *DiscoveredState + TemplatePath string + StackExists bool + InstanceArn string + ControllerRegion string + VpcID string + DefaultARNList []string +} + +type DiscoveredState struct { + Provisioned bool + SelfNodeGroup *eks.Nodegroup + CurrentState string +} + +func (d *DiscoveredState) SetSelfNodeGroup(ng *eks.Nodegroup) { + d.SelfNodeGroup = ng +} + +func (d *DiscoveredState) GetSelfNodeGroup() *eks.Nodegroup { + return d.SelfNodeGroup +} + +func (d *DiscoveredState) SetProvisioned(provisioned bool) { + d.Provisioned = provisioned +} + +func (d *DiscoveredState) SetCurrentState(state string) { + d.CurrentState = state +} + +func (d *DiscoveredState) GetCurrentState() string { + return d.CurrentState +} + +func (d *DiscoveredState) IsProvisioned() bool { + return d.Provisioned +} + +func (ctx *EksManagedInstanceGroupContext) GetInstanceGroup() *v1alpha1.InstanceGroup { + if ctx != nil { + return ctx.InstanceGroup + } + return &v1alpha1.InstanceGroup{} +} + +func (ctx *EksManagedInstanceGroupContext) GetState() v1alpha1.ReconcileState { + return ctx.InstanceGroup.GetState() +} + +func (ctx *EksManagedInstanceGroupContext) SetState(state v1alpha1.ReconcileState) { + ctx.InstanceGroup.SetState(state) +} + +func (ctx *EksManagedInstanceGroupContext) GetDiscoveredState() *DiscoveredState { + if ctx != nil { + return ctx.DiscoveredState + } + return &DiscoveredState{} +} + +func (ctx *EksManagedInstanceGroupContext) SetDiscoveredState(state *DiscoveredState) { + ctx.DiscoveredState = state +} diff --git a/docs/04_instance-manager.yaml b/docs/04_instance-manager.yaml index 01059390..271a99b6 100644 --- a/docs/04_instance-manager.yaml +++ b/docs/04_instance-manager.yaml @@ -7,6 +7,8 @@ metadata: apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.2.4 creationTimestamp: null name: instancegroups.instancemgr.keikoproj.io spec: @@ -46,9 +48,11 @@ spec: group: instancemgr.keikoproj.io names: kind: InstanceGroup + listKind: InstanceGroupList plural: instancegroups shortNames: - ig + singular: instancegroup scope: Namespaced subresources: {} validation: @@ -66,368 +70,15 @@ spec: submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' type: string metadata: - properties: - annotations: - additionalProperties: - type: string - description: 'Annotations is an unstructured key value map stored with - a resource that may be set by external tools to store and retrieve - arbitrary metadata. They are not queryable and should be preserved - when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' - type: object - clusterName: - description: The name of the cluster which the object belongs to. This - is used to distinguish resources with same name and namespace in different - clusters. This field is not set anywhere right now and apiserver is - going to ignore it if set in create or update request. - type: string - creationTimestamp: - description: "CreationTimestamp is a timestamp representing the server - time when this object was created. It is not guaranteed to be set - in happens-before order across separate operations. Clients may not - set this value. It is represented in RFC3339 form and is in UTC. \n - Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - format: date-time - type: string - deletionGracePeriodSeconds: - description: Number of seconds allowed for this object to gracefully - terminate before it will be removed from the system. Only set when - deletionTimestamp is also set. May only be shortened. Read-only. - format: int64 - type: integer - deletionTimestamp: - description: "DeletionTimestamp is RFC 3339 date and time at which this - resource will be deleted. This field is set by the server when a graceful - deletion is requested by the user, and is not directly settable by - a client. The resource is expected to be deleted (no longer visible - from resource lists, and not reachable by name) after the time in - this field, once the finalizers list is empty. As long as the finalizers - list contains items, deletion is blocked. Once the deletionTimestamp - is set, this value may not be unset or be set further into the future, - although it may be shortened or the resource may be deleted prior - to this time. For example, a user may request that a pod is deleted - in 30 seconds. The Kubelet will react by sending a graceful termination - signal to the containers in the pod. After that 30 seconds, the Kubelet - will send a hard termination signal (SIGKILL) to the container and - after cleanup, remove the pod from the API. In the presence of network - partitions, this object may still exist after this timestamp, until - an administrator or automated process can determine the resource is - fully terminated. If not set, graceful deletion of the object has - not been requested. \n Populated by the system when a graceful deletion - is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - format: date-time - type: string - finalizers: - description: Must be empty before the object is deleted from the registry. - Each entry is an identifier for the responsible component that will - remove the entry from the list. If the deletionTimestamp of the object - is non-nil, entries in this list can only be removed. - items: - type: string - type: array - generateName: - description: "GenerateName is an optional prefix, used by the server, - to generate a unique name ONLY IF the Name field has not been provided. - If this field is used, the name returned to the client will be different - than the name passed. This value will also be combined with a unique - suffix. The provided value has the same validation rules as the Name - field, and may be truncated by the length of the suffix required to - make the value unique on the server. \n If this field is specified - and the generated name exists, the server will NOT return a 409 - - instead, it will either return 201 Created or 500 with Reason ServerTimeout - indicating a unique name could not be found in the time allotted, - and the client should retry (optionally after the time indicated in - the Retry-After header). \n Applied only if Name is not specified. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" - type: string - generation: - description: A sequence number representing a specific generation of - the desired state. Populated by the system. Read-only. - format: int64 - type: integer - initializers: - description: "An initializer is a controller which enforces some system - invariant at object creation time. This field is a list of initializers - that have not yet acted on this object. If nil or empty, this object - has been completely initialized. Otherwise, the object is considered - uninitialized and is hidden (in list/watch and get calls) from clients - that haven't explicitly asked to observe uninitialized objects. \n - When an object is created, the system will populate this list with - the current set of initializers. Only privileged users may set or - modify this list. Once it is empty, it may not be modified further - by any user. \n DEPRECATED - initializers are an alpha field and will - be removed in v1.15." - properties: - pending: - description: Pending is a list of initializers that must execute - in order before this object is visible. When the last pending - initializer is removed, and no failing result is set, the initializers - struct will be set to nil and the object is considered as initialized - and visible to all clients. - items: - properties: - name: - description: name of the process that is responsible for initializing - this object. - type: string - required: - - name - type: object - type: array - result: - description: If result is set with the Failure field, the object - will be persisted to storage and then deleted, ensuring that other - clients can observe the deletion. - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this - representation of an object. Servers should convert recognized - schemas to the latest internal value, and may reject unrecognized - values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - code: - description: Suggested HTTP return code for this status, 0 if - not set. - format: int32 - type: integer - details: - description: Extended data associated with the reason. Each - reason may define its own extended details. This field is - optional and the data returned is not guaranteed to conform - to any schema except that defined by the reason type. - properties: - causes: - description: The Causes array includes more details associated - with the StatusReason failure. Not all StatusReasons may - provide detailed causes. - items: - properties: - field: - description: "The field of the resource that has caused - this error, as named by its JSON serialization. - May include dot and postfix notation for nested - attributes. Arrays are zero-indexed. Fields may - appear more than once in an array of causes due - to fields having multiple errors. Optional. \n Examples: - \ \"name\" - the field \"name\" on the current - resource \"items[0].name\" - the field \"name\" - on the first array entry in \"items\"" - type: string - message: - description: A human-readable description of the cause - of the error. This field may be presented as-is - to a reader. - type: string - reason: - description: A machine-readable description of the - cause of the error. If this value is empty there - is no information available. - type: string - type: object - type: array - group: - description: The group attribute of the resource associated - with the status StatusReason. - type: string - kind: - description: 'The kind attribute of the resource associated - with the status StatusReason. On some operations may differ - from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - name: - description: The name attribute of the resource associated - with the status StatusReason (when there is a single name - which can be described). - type: string - retryAfterSeconds: - description: If specified, the time in seconds before the - operation should be retried. Some errors may indicate - the client must take an alternate action - for those errors - this field may indicate how long to wait before taking - the alternate action. - format: int32 - type: integer - uid: - description: 'UID of the resource. (when there is a single - resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' - type: string - type: object - kind: - description: 'Kind is a string value representing the REST resource - this object represents. Servers may infer this from the endpoint - the client submits requests to. Cannot be updated. In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - message: - description: A human-readable description of the status of this - operation. - type: string - metadata: - description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - properties: - continue: - description: continue may be set if the user set a limit - on the number of items returned, and indicates that the - server has more data available. The value is opaque and - may be used to issue another request to the endpoint that - served this list to retrieve the next set of available - objects. Continuing a consistent list may not be possible - if the server configuration has changed or more than a - few minutes have passed. The resourceVersion field returned - when using this continue value will be identical to the - value in the first response, unless you have received - this token from an error message. - type: string - resourceVersion: - description: 'String that identifies the server''s internal - version of this object that can be used by clients to - determine when objects have changed. Value must be treated - as opaque by clients and passed unmodified back to the - server. Populated by the system. Read-only. More info: - https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' - type: string - selfLink: - description: selfLink is a URL representing this object. - Populated by the system. Read-only. - type: string - type: object - reason: - description: A machine-readable description of why this operation - is in the "Failure" status. If this value is empty there is - no information available. A Reason clarifies an HTTP status - code but does not override it. - type: string - status: - description: 'Status of the operation. One of: "Success" or - "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' - type: string - type: object - required: - - pending - type: object - labels: - additionalProperties: - type: string - description: 'Map of string keys and values that can be used to organize - and categorize (scope and select) objects. May match selectors of - replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' - type: object - managedFields: - description: "ManagedFields maps workflow-id and version to the set - of fields that are managed by that workflow. This is mostly for internal - housekeeping, and users typically shouldn't need to set or understand - this field. A workflow can be the user's name, a controller's name, - or the name of a specific apply path like \"ci-cd\". The set of fields - is always in the version that the workflow used when modifying the - object. \n This field is alpha and can be changed or removed without - notice." - items: - properties: - apiVersion: - description: APIVersion defines the version of this resource that - this field set applies to. The format is "group/version" just - like the top-level APIVersion field. It is necessary to track - the version of a field set because it cannot be automatically - converted. - type: string - fields: - additionalProperties: true - description: Fields identifies a set of fields. - type: object - manager: - description: Manager is an identifier of the workflow managing - these fields. - type: string - operation: - description: Operation is the type of operation which lead to - this ManagedFieldsEntry being created. The only valid values - for this field are 'Apply' and 'Update'. - type: string - time: - description: Time is timestamp of when these fields were set. - It should always be empty if Operation is 'Apply' - format: date-time - type: string - type: object - type: array - name: - description: 'Name must be unique within a namespace. Is required when - creating resources, although some resources may allow a client to - request the generation of an appropriate name automatically. Name - is primarily intended for creation idempotence and configuration definition. - Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - namespace: - description: "Namespace defines the space within each name must be unique. - An empty namespace is equivalent to the \"default\" namespace, but - \"default\" is the canonical representation. Not all objects are required - to be scoped to a namespace - the value of this field for those objects - will be empty. \n Must be a DNS_LABEL. Cannot be updated. More info: - http://kubernetes.io/docs/user-guide/namespaces" - type: string - ownerReferences: - description: List of objects depended by this object. If ALL objects - in the list have been deleted, this object will be garbage collected. - If this object is managed by a controller, then an entry in this list - will point to this controller, with the controller field set to true. - There cannot be more than one managing controller. - items: - properties: - apiVersion: - description: API version of the referent. - type: string - blockOwnerDeletion: - description: If true, AND if the owner has the "foregroundDeletion" - finalizer, then the owner cannot be deleted from the key-value - store until this reference is removed. Defaults to false. To - set this field, a user needs "delete" permission of the owner, - otherwise 422 (Unprocessable Entity) will be returned. - type: boolean - controller: - description: If true, this reference points to the managing controller. - type: boolean - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - uid: - description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' - type: string - required: - - apiVersion - - kind - - name - - uid - type: object - type: array - resourceVersion: - description: "An opaque value that represents the internal version of - this object that can be used by clients to determine when objects - have changed. May be used for optimistic concurrency, change detection, - and the watch operation on a resource or set of resources. Clients - must treat these values as opaque and passed unmodified back to the - server. They may only be valid for a particular resource or set of - resources. \n Populated by the system. Read-only. Value must be treated - as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" - type: string - selfLink: - description: SelfLink is a URL representing this object. Populated by - the system. Read-only. - type: string - uid: - description: "UID is the unique in time and space value for this object. - It is typically generated by the server on successful creation of - a resource and is not allowed to change on PUT operations. \n Populated - by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" - type: string type: object spec: + description: InstanceGroupSpec defines the schema of resource Spec properties: eks-cf: properties: configuration: + description: EKSCFConfiguration defines the context of an AWS Instance + Group using EKSCF properties: bootstrapArguments: type: string @@ -470,11 +121,6 @@ spec: volSize: format: int32 type: integer - required: - - keyPairName - - image - - instanceType - - securityGroups type: object maxSize: format: int32 @@ -482,14 +128,63 @@ spec: minSize: format: int32 type: integer + type: object + eks-managed: + properties: + configuration: + properties: + amiType: + type: string + clusterName: + type: string + instanceType: + type: string + keyPairName: + type: string + nodeLabels: + additionalProperties: + type: string + type: object + nodeRole: + type: string + releaseVersion: + type: string + securityGroups: + items: + type: string + type: array + subnets: + items: + type: string + type: array + tags: + items: + additionalProperties: + type: string + type: object + type: array + version: + type: string + volSize: + format: int64 + type: integer + type: object + maxSize: + format: int64 + type: integer + minSize: + format: int64 + type: integer required: + - configuration - maxSize - minSize - - configuration type: object provisioner: type: string strategy: + description: AwsUpgradeStrategy defines the upgrade strategy of an AWS + Instance Group properties: crd: properties: @@ -530,10 +225,10 @@ spec: type: object required: - provisioner - - eks-cf - strategy type: object status: + description: InstanceGroupStatus defines the schema of resource Status properties: activeLaunchConfigurationName: type: string @@ -560,6 +255,7 @@ spec: - metadata - spec type: object + version: v1alpha1 versions: - name: v1alpha1 served: true diff --git a/docs/examples/managed.yaml b/docs/examples/managed.yaml new file mode 100644 index 00000000..4e68420e --- /dev/null +++ b/docs/examples/managed.yaml @@ -0,0 +1,31 @@ +apiVersion: instancemgr.keikoproj.io/v1alpha1 +kind: InstanceGroup +metadata: + annotations: + name: hello-managed + namespace: instance-manager +spec: + provisioner: eks-managed + strategy: + type: managed + eks-managed: + configuration: + nodeRole: arn:aws:iam::32333344450:role/basic-eks-role + clusterName: my-eks-cluster + amiType: AL2_x86_64 + instanceType: m3.medium + keyPairName: MyKeyPair + securityGroups: + - sg-04adb6343b07c7914 + subnets: + - subnet-12345789 + - subnet-12345555 + - subnet-33322222 + nodeLabels: + foo: bar + tags: + - key: foo + value: bar + volSize: 20 + maxSize: 6 + minSize: 3 diff --git a/go.mod b/go.mod index bfd7e957..058ea502 100644 --- a/go.mod +++ b/go.mod @@ -3,15 +3,15 @@ module github.com/keikoproj/instance-manager go 1.12 require ( - github.com/aws/aws-sdk-go v1.25.0 + github.com/aws/aws-sdk-go v1.29.14 github.com/ghodss/yaml v1.0.0 github.com/go-logr/logr v0.1.0 github.com/keikoproj/aws-auth v0.0.0-20190910182258-c705a9d52f92 github.com/onsi/ginkgo v1.8.0 github.com/onsi/gomega v1.6.0 - github.com/pkg/errors v0.8.1 + github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.4.2 - golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 + golang.org/x/net v0.0.0-20200202094626-16171245cfb2 gopkg.in/yaml.v2 v2.2.2 k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8 diff --git a/go.sum b/go.sum index 57d778d3..5cc60790 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdko github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30 h1:Kn3rqvbUFqSepE2OqVu0Pn1CbDw9IuMlONapol0zuwk= github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30/go.mod h1:4AJxUpXUhv4N+ziTvIcWWXgeorXpxPZOfk9HdEVr96M= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/aws/aws-sdk-go v1.25.0 h1:MyXUdCesJLBvSSKYcaKeeEwxNUwUpG6/uqVYeH/Zzfo= -github.com/aws/aws-sdk-go v1.25.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.29.14 h1:NToqC5ZQ2RaxxSPp9szuQimWQWPG++ITwXbklq/FN7c= +github.com/aws/aws-sdk-go v1.29.14/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -41,6 +41,7 @@ github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+ github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= @@ -121,6 +122,8 @@ github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7ir github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -153,6 +156,8 @@ github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRci github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= @@ -173,6 +178,8 @@ golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 h1:fHDIZ2oxGnUZRN6WgWFCbYBjH9uqVPRCUVUDhs0wnbA= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= diff --git a/main.go b/main.go index 26b82af6..251707cd 100644 --- a/main.go +++ b/main.go @@ -37,7 +37,7 @@ var ( setupLog = ctrl.Log.WithName("setup") ) -const controllerVersion = "instancemgr-0.4.1" +const controllerVersion = "instancemgr-0.4.2" func init() { diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go b/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go index a2c5817c..9cf7eaf4 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go @@ -208,7 +208,7 @@ func (e errorList) Error() string { // How do we want to handle the array size being zero if size := len(e); size > 0 { for i := 0; i < size; i++ { - msg += fmt.Sprintf("%s", e[i].Error()) + msg += e[i].Error() // We check the next index to see if it is within the slice. // If it is, then we append a newline. We do this, because unit tests // could be broken with the additional '\n' diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go index 11c52c38..a4eb6a7f 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go @@ -70,7 +70,7 @@ func rValuesAtPath(v interface{}, path string, createPath, caseSensitive, nilTer value = value.FieldByNameFunc(func(name string) bool { if c == name { return true - } else if !caseSensitive && strings.ToLower(name) == strings.ToLower(c) { + } else if !caseSensitive && strings.EqualFold(name, c) { return true } return false @@ -185,13 +185,12 @@ func ValuesAtPath(i interface{}, path string) ([]interface{}, error) { // SetValueAtPath sets a value at the case insensitive lexical path inside // of a structure. func SetValueAtPath(i interface{}, path string, v interface{}) { - if rvals := rValuesAtPath(i, path, true, false, v == nil); rvals != nil { - for _, rval := range rvals { - if rval.Kind() == reflect.Ptr && rval.IsNil() { - continue - } - setValue(rval, v) + rvals := rValuesAtPath(i, path, true, false, v == nil) + for _, rval := range rvals { + if rval.Kind() == reflect.Ptr && rval.IsNil() { + continue } + setValue(rval, v) } } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/client.go b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go index 70960538..03334d69 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/client.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go @@ -12,6 +12,7 @@ import ( type Config struct { Config *aws.Config Handlers request.Handlers + PartitionID string Endpoint string SigningRegion string SigningName string @@ -64,7 +65,7 @@ func New(cfg aws.Config, info metadata.ClientInfo, handlers request.Handlers, op default: maxRetries := aws.IntValue(cfg.MaxRetries) if cfg.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries { - maxRetries = 3 + maxRetries = DefaultRetryerMaxNumRetries } svc.Retryer = DefaultRetryer{NumMaxRetries: maxRetries} } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go b/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go index a397b0d0..9f6af19d 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go @@ -1,6 +1,7 @@ package client import ( + "math" "strconv" "time" @@ -9,82 +10,142 @@ import ( ) // DefaultRetryer implements basic retry logic using exponential backoff for -// most services. If you want to implement custom retry logic, implement the -// request.Retryer interface or create a structure type that composes this -// struct and override the specific methods. For example, to override only -// the MaxRetries method: +// most services. If you want to implement custom retry logic, you can implement the +// request.Retryer interface. // -// type retryer struct { -// client.DefaultRetryer -// } -// -// // This implementation always has 100 max retries -// func (d retryer) MaxRetries() int { return 100 } type DefaultRetryer struct { + // Num max Retries is the number of max retries that will be performed. + // By default, this is zero. NumMaxRetries int + + // MinRetryDelay is the minimum retry delay after which retry will be performed. + // If not set, the value is 0ns. + MinRetryDelay time.Duration + + // MinThrottleRetryDelay is the minimum retry delay when throttled. + // If not set, the value is 0ns. + MinThrottleDelay time.Duration + + // MaxRetryDelay is the maximum retry delay before which retry must be performed. + // If not set, the value is 0ns. + MaxRetryDelay time.Duration + + // MaxThrottleDelay is the maximum retry delay when throttled. + // If not set, the value is 0ns. + MaxThrottleDelay time.Duration } +const ( + // DefaultRetryerMaxNumRetries sets maximum number of retries + DefaultRetryerMaxNumRetries = 3 + + // DefaultRetryerMinRetryDelay sets minimum retry delay + DefaultRetryerMinRetryDelay = 30 * time.Millisecond + + // DefaultRetryerMinThrottleDelay sets minimum delay when throttled + DefaultRetryerMinThrottleDelay = 500 * time.Millisecond + + // DefaultRetryerMaxRetryDelay sets maximum retry delay + DefaultRetryerMaxRetryDelay = 300 * time.Second + + // DefaultRetryerMaxThrottleDelay sets maximum delay when throttled + DefaultRetryerMaxThrottleDelay = 300 * time.Second +) + // MaxRetries returns the number of maximum returns the service will use to make // an individual API request. func (d DefaultRetryer) MaxRetries() int { return d.NumMaxRetries } +// setRetryerDefaults sets the default values of the retryer if not set +func (d *DefaultRetryer) setRetryerDefaults() { + if d.MinRetryDelay == 0 { + d.MinRetryDelay = DefaultRetryerMinRetryDelay + } + if d.MaxRetryDelay == 0 { + d.MaxRetryDelay = DefaultRetryerMaxRetryDelay + } + if d.MinThrottleDelay == 0 { + d.MinThrottleDelay = DefaultRetryerMinThrottleDelay + } + if d.MaxThrottleDelay == 0 { + d.MaxThrottleDelay = DefaultRetryerMaxThrottleDelay + } +} + // RetryRules returns the delay duration before retrying this request again func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration { - // Set the upper limit of delay in retrying at ~five minutes - minTime := 30 - throttle := d.shouldThrottle(r) - if throttle { - if delay, ok := getRetryDelay(r); ok { - return delay - } - minTime = 500 + // if number of max retries is zero, no retries will be performed. + if d.NumMaxRetries == 0 { + return 0 + } + + // Sets default value for retryer members + d.setRetryerDefaults() + + // minDelay is the minimum retryer delay + minDelay := d.MinRetryDelay + + var initialDelay time.Duration + + isThrottle := r.IsErrorThrottle() + if isThrottle { + if delay, ok := getRetryAfterDelay(r); ok { + initialDelay = delay + } + minDelay = d.MinThrottleDelay } retryCount := r.RetryCount - if throttle && retryCount > 8 { - retryCount = 8 - } else if retryCount > 13 { - retryCount = 13 + + // maxDelay the maximum retryer delay + maxDelay := d.MaxRetryDelay + + if isThrottle { + maxDelay = d.MaxThrottleDelay + } + + var delay time.Duration + + // Logic to cap the retry count based on the minDelay provided + actualRetryCount := int(math.Log2(float64(minDelay))) + 1 + if actualRetryCount < 63-retryCount { + delay = time.Duration(1< maxDelay { + delay = getJitterDelay(maxDelay / 2) + } + } else { + delay = getJitterDelay(maxDelay / 2) } + return delay + initialDelay +} - delay := (1 << uint(retryCount)) * (sdkrand.SeededRand.Intn(minTime) + minTime) - return time.Duration(delay) * time.Millisecond +// getJitterDelay returns a jittered delay for retry +func getJitterDelay(duration time.Duration) time.Duration { + return time.Duration(sdkrand.SeededRand.Int63n(int64(duration)) + int64(duration)) } // ShouldRetry returns true if the request should be retried. func (d DefaultRetryer) ShouldRetry(r *request.Request) bool { + + // ShouldRetry returns false if number of max retries is 0. + if d.NumMaxRetries == 0 { + return false + } + // If one of the other handlers already set the retry state // we don't want to override it based on the service's state if r.Retryable != nil { return *r.Retryable } - - if r.HTTPResponse.StatusCode >= 500 && r.HTTPResponse.StatusCode != 501 { - return true - } - return r.IsErrorRetryable() || d.shouldThrottle(r) -} - -// ShouldThrottle returns true if the request should be throttled. -func (d DefaultRetryer) shouldThrottle(r *request.Request) bool { - switch r.HTTPResponse.StatusCode { - case 429: - case 502: - case 503: - case 504: - default: - return r.IsErrorThrottle() - } - - return true + return r.IsErrorRetryable() || r.IsErrorThrottle() } // This will look in the Retry-After header, RFC 7231, for how long // it will wait before attempting another request -func getRetryDelay(r *request.Request) (time.Duration, bool) { +func getRetryAfterDelay(r *request.Request) (time.Duration, bool) { if !canUseRetryAfterHeader(r) { return 0, false } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go b/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go index 7b5e1276..8958c32d 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go @@ -67,10 +67,14 @@ func logRequest(r *request.Request) { if !bodySeekable { r.SetReaderBody(aws.ReadSeekCloser(r.HTTPRequest.Body)) } - // Reset the request body because dumpRequest will re-wrap the r.HTTPRequest's - // Body as a NoOpCloser and will not be reset after read by the HTTP - // client reader. - r.ResetBody() + // Reset the request body because dumpRequest will re-wrap the + // r.HTTPRequest's Body as a NoOpCloser and will not be reset after + // read by the HTTP client reader. + if err := r.Error; err != nil { + r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, + r.ClientInfo.ServiceName, r.Operation.Name, err)) + return + } } r.Config.Logger.Log(fmt.Sprintf(logReqMsg, diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go b/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go index 920e9fdd..0c48f72e 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go @@ -5,6 +5,7 @@ type ClientInfo struct { ServiceName string ServiceID string APIVersion string + PartitionID string Endpoint string SigningName string SigningRegion string diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer.go b/vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer.go new file mode 100644 index 00000000..881d575f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer.go @@ -0,0 +1,28 @@ +package client + +import ( + "time" + + "github.com/aws/aws-sdk-go/aws/request" +) + +// NoOpRetryer provides a retryer that performs no retries. +// It should be used when we do not want retries to be performed. +type NoOpRetryer struct{} + +// MaxRetries returns the number of maximum returns the service will use to make +// an individual API; For NoOpRetryer the MaxRetries will always be zero. +func (d NoOpRetryer) MaxRetries() int { + return 0 +} + +// ShouldRetry will always return false for NoOpRetryer, as it should never retry. +func (d NoOpRetryer) ShouldRetry(_ *request.Request) bool { + return false +} + +// RetryRules returns the delay duration before retrying this request again; +// since NoOpRetryer does not retry, RetryRules always returns 0. +func (d NoOpRetryer) RetryRules(_ *request.Request) time.Duration { + return 0 +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/config.go b/vendor/github.com/aws/aws-sdk-go/aws/config.go index 10634d17..869db266 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/config.go @@ -20,7 +20,7 @@ type RequestRetryer interface{} // A Config provides service configuration for service clients. By default, // all clients will use the defaults.DefaultConfig structure. // -// // Create Session with MaxRetry configuration to be shared by multiple +// // Create Session with MaxRetries configuration to be shared by multiple // // service clients. // sess := session.Must(session.NewSession(&aws.Config{ // MaxRetries: aws.Int(3), @@ -161,6 +161,10 @@ type Config struct { // on GetObject API calls. S3DisableContentMD5Validation *bool + // Set this to `true` to have the S3 service client to use the region specified + // in the ARN, when an ARN is provided as an argument to a bucket parameter. + S3UseARNRegion *bool + // Set this to `true` to disable the EC2Metadata client from overriding the // default http.Client's Timeout. This is helpful if you do not want the // EC2Metadata client to create a new http.Client. This options is only @@ -246,12 +250,18 @@ type Config struct { // Disabling this feature is useful when you want to use local endpoints // for testing that do not support the modeled host prefix pattern. DisableEndpointHostPrefix *bool + + // STSRegionalEndpoint will enable regional or legacy endpoint resolving + STSRegionalEndpoint endpoints.STSRegionalEndpoint + + // S3UsEast1RegionalEndpoint will enable regional or legacy endpoint resolving + S3UsEast1RegionalEndpoint endpoints.S3UsEast1RegionalEndpoint } // NewConfig returns a new Config pointer that can be chained with builder // methods to set multiple configuration values inline without using pointers. // -// // Create Session with MaxRetry configuration to be shared by multiple +// // Create Session with MaxRetries configuration to be shared by multiple // // service clients. // sess := session.Must(session.NewSession(aws.NewConfig(). // WithMaxRetries(3), @@ -379,6 +389,13 @@ func (c *Config) WithS3DisableContentMD5Validation(enable bool) *Config { } +// WithS3UseARNRegion sets a config S3UseARNRegion value and +// returning a Config pointer for chaining +func (c *Config) WithS3UseARNRegion(enable bool) *Config { + c.S3UseARNRegion = &enable + return c +} + // WithUseDualStack sets a config UseDualStack value returning a Config // pointer for chaining. func (c *Config) WithUseDualStack(enable bool) *Config { @@ -420,6 +437,20 @@ func (c *Config) MergeIn(cfgs ...*Config) { } } +// WithSTSRegionalEndpoint will set whether or not to use regional endpoint flag +// when resolving the endpoint for a service +func (c *Config) WithSTSRegionalEndpoint(sre endpoints.STSRegionalEndpoint) *Config { + c.STSRegionalEndpoint = sre + return c +} + +// WithS3UsEast1RegionalEndpoint will set whether or not to use regional endpoint flag +// when resolving the endpoint for a service +func (c *Config) WithS3UsEast1RegionalEndpoint(sre endpoints.S3UsEast1RegionalEndpoint) *Config { + c.S3UsEast1RegionalEndpoint = sre + return c +} + func mergeInConfig(dst *Config, other *Config) { if other == nil { return @@ -493,6 +524,10 @@ func mergeInConfig(dst *Config, other *Config) { dst.S3DisableContentMD5Validation = other.S3DisableContentMD5Validation } + if other.S3UseARNRegion != nil { + dst.S3UseARNRegion = other.S3UseARNRegion + } + if other.UseDualStack != nil { dst.UseDualStack = other.UseDualStack } @@ -520,6 +555,14 @@ func mergeInConfig(dst *Config, other *Config) { if other.DisableEndpointHostPrefix != nil { dst.DisableEndpointHostPrefix = other.DisableEndpointHostPrefix } + + if other.STSRegionalEndpoint != endpoints.UnsetSTSEndpoint { + dst.STSRegionalEndpoint = other.STSRegionalEndpoint + } + + if other.S3UsEast1RegionalEndpoint != endpoints.UnsetS3UsEast1Endpoint { + dst.S3UsEast1RegionalEndpoint = other.S3UsEast1RegionalEndpoint + } } // Copy will return a shallow copy of the Config object. If any additional diff --git a/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go b/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go index ff5d58e0..4e076c18 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go @@ -179,6 +179,242 @@ func IntValueMap(src map[string]*int) map[string]int { return dst } +// Uint returns a pointer to the uint value passed in. +func Uint(v uint) *uint { + return &v +} + +// UintValue returns the value of the uint pointer passed in or +// 0 if the pointer is nil. +func UintValue(v *uint) uint { + if v != nil { + return *v + } + return 0 +} + +// UintSlice converts a slice of uint values uinto a slice of +// uint pointers +func UintSlice(src []uint) []*uint { + dst := make([]*uint, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// UintValueSlice converts a slice of uint pointers uinto a slice of +// uint values +func UintValueSlice(src []*uint) []uint { + dst := make([]uint, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// UintMap converts a string map of uint values uinto a string +// map of uint pointers +func UintMap(src map[string]uint) map[string]*uint { + dst := make(map[string]*uint) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// UintValueMap converts a string map of uint pointers uinto a string +// map of uint values +func UintValueMap(src map[string]*uint) map[string]uint { + dst := make(map[string]uint) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Int8 returns a pointer to the int8 value passed in. +func Int8(v int8) *int8 { + return &v +} + +// Int8Value returns the value of the int8 pointer passed in or +// 0 if the pointer is nil. +func Int8Value(v *int8) int8 { + if v != nil { + return *v + } + return 0 +} + +// Int8Slice converts a slice of int8 values into a slice of +// int8 pointers +func Int8Slice(src []int8) []*int8 { + dst := make([]*int8, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Int8ValueSlice converts a slice of int8 pointers into a slice of +// int8 values +func Int8ValueSlice(src []*int8) []int8 { + dst := make([]int8, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Int8Map converts a string map of int8 values into a string +// map of int8 pointers +func Int8Map(src map[string]int8) map[string]*int8 { + dst := make(map[string]*int8) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Int8ValueMap converts a string map of int8 pointers into a string +// map of int8 values +func Int8ValueMap(src map[string]*int8) map[string]int8 { + dst := make(map[string]int8) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Int16 returns a pointer to the int16 value passed in. +func Int16(v int16) *int16 { + return &v +} + +// Int16Value returns the value of the int16 pointer passed in or +// 0 if the pointer is nil. +func Int16Value(v *int16) int16 { + if v != nil { + return *v + } + return 0 +} + +// Int16Slice converts a slice of int16 values into a slice of +// int16 pointers +func Int16Slice(src []int16) []*int16 { + dst := make([]*int16, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Int16ValueSlice converts a slice of int16 pointers into a slice of +// int16 values +func Int16ValueSlice(src []*int16) []int16 { + dst := make([]int16, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Int16Map converts a string map of int16 values into a string +// map of int16 pointers +func Int16Map(src map[string]int16) map[string]*int16 { + dst := make(map[string]*int16) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Int16ValueMap converts a string map of int16 pointers into a string +// map of int16 values +func Int16ValueMap(src map[string]*int16) map[string]int16 { + dst := make(map[string]int16) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Int32 returns a pointer to the int32 value passed in. +func Int32(v int32) *int32 { + return &v +} + +// Int32Value returns the value of the int32 pointer passed in or +// 0 if the pointer is nil. +func Int32Value(v *int32) int32 { + if v != nil { + return *v + } + return 0 +} + +// Int32Slice converts a slice of int32 values into a slice of +// int32 pointers +func Int32Slice(src []int32) []*int32 { + dst := make([]*int32, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Int32ValueSlice converts a slice of int32 pointers into a slice of +// int32 values +func Int32ValueSlice(src []*int32) []int32 { + dst := make([]int32, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Int32Map converts a string map of int32 values into a string +// map of int32 pointers +func Int32Map(src map[string]int32) map[string]*int32 { + dst := make(map[string]*int32) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Int32ValueMap converts a string map of int32 pointers into a string +// map of int32 values +func Int32ValueMap(src map[string]*int32) map[string]int32 { + dst := make(map[string]int32) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + // Int64 returns a pointer to the int64 value passed in. func Int64(v int64) *int64 { return &v @@ -238,6 +474,301 @@ func Int64ValueMap(src map[string]*int64) map[string]int64 { return dst } +// Uint8 returns a pointer to the uint8 value passed in. +func Uint8(v uint8) *uint8 { + return &v +} + +// Uint8Value returns the value of the uint8 pointer passed in or +// 0 if the pointer is nil. +func Uint8Value(v *uint8) uint8 { + if v != nil { + return *v + } + return 0 +} + +// Uint8Slice converts a slice of uint8 values into a slice of +// uint8 pointers +func Uint8Slice(src []uint8) []*uint8 { + dst := make([]*uint8, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Uint8ValueSlice converts a slice of uint8 pointers into a slice of +// uint8 values +func Uint8ValueSlice(src []*uint8) []uint8 { + dst := make([]uint8, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Uint8Map converts a string map of uint8 values into a string +// map of uint8 pointers +func Uint8Map(src map[string]uint8) map[string]*uint8 { + dst := make(map[string]*uint8) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Uint8ValueMap converts a string map of uint8 pointers into a string +// map of uint8 values +func Uint8ValueMap(src map[string]*uint8) map[string]uint8 { + dst := make(map[string]uint8) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Uint16 returns a pointer to the uint16 value passed in. +func Uint16(v uint16) *uint16 { + return &v +} + +// Uint16Value returns the value of the uint16 pointer passed in or +// 0 if the pointer is nil. +func Uint16Value(v *uint16) uint16 { + if v != nil { + return *v + } + return 0 +} + +// Uint16Slice converts a slice of uint16 values into a slice of +// uint16 pointers +func Uint16Slice(src []uint16) []*uint16 { + dst := make([]*uint16, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Uint16ValueSlice converts a slice of uint16 pointers into a slice of +// uint16 values +func Uint16ValueSlice(src []*uint16) []uint16 { + dst := make([]uint16, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Uint16Map converts a string map of uint16 values into a string +// map of uint16 pointers +func Uint16Map(src map[string]uint16) map[string]*uint16 { + dst := make(map[string]*uint16) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Uint16ValueMap converts a string map of uint16 pointers into a string +// map of uint16 values +func Uint16ValueMap(src map[string]*uint16) map[string]uint16 { + dst := make(map[string]uint16) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Uint32 returns a pointer to the uint32 value passed in. +func Uint32(v uint32) *uint32 { + return &v +} + +// Uint32Value returns the value of the uint32 pointer passed in or +// 0 if the pointer is nil. +func Uint32Value(v *uint32) uint32 { + if v != nil { + return *v + } + return 0 +} + +// Uint32Slice converts a slice of uint32 values into a slice of +// uint32 pointers +func Uint32Slice(src []uint32) []*uint32 { + dst := make([]*uint32, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Uint32ValueSlice converts a slice of uint32 pointers into a slice of +// uint32 values +func Uint32ValueSlice(src []*uint32) []uint32 { + dst := make([]uint32, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Uint32Map converts a string map of uint32 values into a string +// map of uint32 pointers +func Uint32Map(src map[string]uint32) map[string]*uint32 { + dst := make(map[string]*uint32) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Uint32ValueMap converts a string map of uint32 pointers into a string +// map of uint32 values +func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { + dst := make(map[string]uint32) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Uint64 returns a pointer to the uint64 value passed in. +func Uint64(v uint64) *uint64 { + return &v +} + +// Uint64Value returns the value of the uint64 pointer passed in or +// 0 if the pointer is nil. +func Uint64Value(v *uint64) uint64 { + if v != nil { + return *v + } + return 0 +} + +// Uint64Slice converts a slice of uint64 values into a slice of +// uint64 pointers +func Uint64Slice(src []uint64) []*uint64 { + dst := make([]*uint64, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Uint64ValueSlice converts a slice of uint64 pointers into a slice of +// uint64 values +func Uint64ValueSlice(src []*uint64) []uint64 { + dst := make([]uint64, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Uint64Map converts a string map of uint64 values into a string +// map of uint64 pointers +func Uint64Map(src map[string]uint64) map[string]*uint64 { + dst := make(map[string]*uint64) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Uint64ValueMap converts a string map of uint64 pointers into a string +// map of uint64 values +func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { + dst := make(map[string]uint64) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Float32 returns a pointer to the float32 value passed in. +func Float32(v float32) *float32 { + return &v +} + +// Float32Value returns the value of the float32 pointer passed in or +// 0 if the pointer is nil. +func Float32Value(v *float32) float32 { + if v != nil { + return *v + } + return 0 +} + +// Float32Slice converts a slice of float32 values into a slice of +// float32 pointers +func Float32Slice(src []float32) []*float32 { + dst := make([]*float32, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Float32ValueSlice converts a slice of float32 pointers into a slice of +// float32 values +func Float32ValueSlice(src []*float32) []float32 { + dst := make([]float32, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Float32Map converts a string map of float32 values into a string +// map of float32 pointers +func Float32Map(src map[string]float32) map[string]*float32 { + dst := make(map[string]*float32) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Float32ValueMap converts a string map of float32 pointers into a string +// map of float32 values +func Float32ValueMap(src map[string]*float32) map[string]float32 { + dst := make(map[string]float32) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + // Float64 returns a pointer to the float64 value passed in. func Float64(v float64) *float64 { return &v diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go index f8853d78..0c60e612 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go @@ -159,9 +159,9 @@ func handleSendError(r *request.Request, err error) { Body: ioutil.NopCloser(bytes.NewReader([]byte{})), } } - // Catch all other request errors. + // Catch all request errors, and let the default retrier determine + // if the error is retryable. r.Error = awserr.New("RequestError", "send request failed", err) - r.Retryable = aws.Bool(true) // network errors are retryable // Override the error with a context canceled error, if that was canceled. ctx := r.Context() @@ -184,37 +184,39 @@ var ValidateResponseHandler = request.NamedHandler{Name: "core.ValidateResponseH // AfterRetryHandler performs final checks to determine if the request should // be retried and how long to delay. -var AfterRetryHandler = request.NamedHandler{Name: "core.AfterRetryHandler", Fn: func(r *request.Request) { - // If one of the other handlers already set the retry state - // we don't want to override it based on the service's state - if r.Retryable == nil || aws.BoolValue(r.Config.EnforceShouldRetryCheck) { - r.Retryable = aws.Bool(r.ShouldRetry(r)) - } +var AfterRetryHandler = request.NamedHandler{ + Name: "core.AfterRetryHandler", + Fn: func(r *request.Request) { + // If one of the other handlers already set the retry state + // we don't want to override it based on the service's state + if r.Retryable == nil || aws.BoolValue(r.Config.EnforceShouldRetryCheck) { + r.Retryable = aws.Bool(r.ShouldRetry(r)) + } - if r.WillRetry() { - r.RetryDelay = r.RetryRules(r) + if r.WillRetry() { + r.RetryDelay = r.RetryRules(r) - if sleepFn := r.Config.SleepDelay; sleepFn != nil { - // Support SleepDelay for backwards compatibility and testing - sleepFn(r.RetryDelay) - } else if err := aws.SleepWithContext(r.Context(), r.RetryDelay); err != nil { - r.Error = awserr.New(request.CanceledErrorCode, - "request context canceled", err) - r.Retryable = aws.Bool(false) - return - } + if sleepFn := r.Config.SleepDelay; sleepFn != nil { + // Support SleepDelay for backwards compatibility and testing + sleepFn(r.RetryDelay) + } else if err := aws.SleepWithContext(r.Context(), r.RetryDelay); err != nil { + r.Error = awserr.New(request.CanceledErrorCode, + "request context canceled", err) + r.Retryable = aws.Bool(false) + return + } - // when the expired token exception occurs the credentials - // need to be expired locally so that the next request to - // get credentials will trigger a credentials refresh. - if r.IsErrorExpired() { - r.Config.Credentials.Expire() - } + // when the expired token exception occurs the credentials + // need to be expired locally so that the next request to + // get credentials will trigger a credentials refresh. + if r.IsErrorExpired() { + r.Config.Credentials.Expire() + } - r.RetryCount++ - r.Error = nil - } -}} + r.RetryCount++ + r.Error = nil + } + }} // ValidateEndpointHandler is a request handler to validate a request had the // appropriate Region and Endpoint set. Will set r.Error if the endpoint or diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go index 83bbc311..4af59215 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go @@ -84,6 +84,12 @@ type Value struct { ProviderName string } +// HasKeys returns if the credentials Value has both AccessKeyID and +// SecretAccessKey value set. +func (v Value) HasKeys() bool { + return len(v.AccessKeyID) != 0 && len(v.SecretAccessKey) != 0 +} + // A Provider is the interface for any component which will provide credentials // Value. A provider is required to manage its own Expired state, and what to // be expired means. diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go index c2b2c5d6..1a7af53a 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go @@ -98,8 +98,8 @@ func NewProviderClient(cfg aws.Config, handlers request.Handlers, endpoint strin return p } -// NewCredentialsClient returns a Credentials wrapper for retrieving credentials -// from an arbitrary endpoint concurrently. The client will request the +// NewCredentialsClient returns a pointer to a new Credentials object +// wrapping the endpoint credentials Provider. func NewCredentialsClient(cfg aws.Config, handlers request.Handlers, endpoint string, options ...func(*Provider)) *credentials.Credentials { return credentials.NewCredentials(NewProviderClient(cfg, handlers, endpoint, options...)) } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go index 1980c8c1..e6248360 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go @@ -90,6 +90,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/internal/sdkio" ) const ( @@ -142,7 +143,7 @@ const ( // DefaultBufSize limits buffer size from growing to an enormous // amount due to a faulty process. - DefaultBufSize = 1024 + DefaultBufSize = int(8 * sdkio.KibiByte) // DefaultTimeout default limit on time a process can run. DefaultTimeout = time.Duration(1) * time.Minute diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go index 2e528d13..9f37f44b 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go @@ -144,6 +144,13 @@ type AssumeRoleProvider struct { // Session name, if you wish to reuse the credentials elsewhere. RoleSessionName string + // Optional, you can pass tag key-value pairs to your session. These tags are called session tags. + Tags []*sts.Tag + + // A list of keys for session tags that you want to set as transitive. + // If you set a tag key as transitive, the corresponding key and value passes to subsequent sessions in a role chain. + TransitiveTagKeys []*string + // Expiry duration of the STS credentials. Defaults to 15 minutes if not set. Duration time.Duration @@ -269,10 +276,12 @@ func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) { } jitter := time.Duration(sdkrand.SeededRand.Float64() * p.MaxJitterFrac * float64(p.Duration)) input := &sts.AssumeRoleInput{ - DurationSeconds: aws.Int64(int64((p.Duration - jitter) / time.Second)), - RoleArn: aws.String(p.RoleARN), - RoleSessionName: aws.String(p.RoleSessionName), - ExternalId: p.ExternalID, + DurationSeconds: aws.Int64(int64((p.Duration - jitter) / time.Second)), + RoleArn: aws.String(p.RoleARN), + RoleSessionName: aws.String(p.RoleSessionName), + ExternalId: p.ExternalID, + Tags: p.Tags, + TransitiveTagKeys: p.TransitiveTagKeys, } if p.Policy != nil { input.Policy = p.Policy diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go new file mode 100644 index 00000000..b20b6339 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go @@ -0,0 +1,100 @@ +package stscreds + +import ( + "fmt" + "io/ioutil" + "strconv" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/service/sts" + "github.com/aws/aws-sdk-go/service/sts/stsiface" +) + +const ( + // ErrCodeWebIdentity will be used as an error code when constructing + // a new error to be returned during session creation or retrieval. + ErrCodeWebIdentity = "WebIdentityErr" + + // WebIdentityProviderName is the web identity provider name + WebIdentityProviderName = "WebIdentityCredentials" +) + +// now is used to return a time.Time object representing +// the current time. This can be used to easily test and +// compare test values. +var now = time.Now + +// WebIdentityRoleProvider is used to retrieve credentials using +// an OIDC token. +type WebIdentityRoleProvider struct { + credentials.Expiry + + client stsiface.STSAPI + ExpiryWindow time.Duration + + tokenFilePath string + roleARN string + roleSessionName string +} + +// NewWebIdentityCredentials will return a new set of credentials with a given +// configuration, role arn, and token file path. +func NewWebIdentityCredentials(c client.ConfigProvider, roleARN, roleSessionName, path string) *credentials.Credentials { + svc := sts.New(c) + p := NewWebIdentityRoleProvider(svc, roleARN, roleSessionName, path) + return credentials.NewCredentials(p) +} + +// NewWebIdentityRoleProvider will return a new WebIdentityRoleProvider with the +// provided stsiface.STSAPI +func NewWebIdentityRoleProvider(svc stsiface.STSAPI, roleARN, roleSessionName, path string) *WebIdentityRoleProvider { + return &WebIdentityRoleProvider{ + client: svc, + tokenFilePath: path, + roleARN: roleARN, + roleSessionName: roleSessionName, + } +} + +// Retrieve will attempt to assume a role from a token which is located at +// 'WebIdentityTokenFilePath' specified destination and if that is empty an +// error will be returned. +func (p *WebIdentityRoleProvider) Retrieve() (credentials.Value, error) { + b, err := ioutil.ReadFile(p.tokenFilePath) + if err != nil { + errMsg := fmt.Sprintf("unable to read file at %s", p.tokenFilePath) + return credentials.Value{}, awserr.New(ErrCodeWebIdentity, errMsg, err) + } + + sessionName := p.roleSessionName + if len(sessionName) == 0 { + // session name is used to uniquely identify a session. This simply + // uses unix time in nanoseconds to uniquely identify sessions. + sessionName = strconv.FormatInt(now().UnixNano(), 10) + } + req, resp := p.client.AssumeRoleWithWebIdentityRequest(&sts.AssumeRoleWithWebIdentityInput{ + RoleArn: &p.roleARN, + RoleSessionName: &sessionName, + WebIdentityToken: aws.String(string(b)), + }) + // InvalidIdentityToken error is a temporary error that can occur + // when assuming an Role with a JWT web identity token. + req.RetryErrorCodes = append(req.RetryErrorCodes, sts.ErrCodeInvalidIdentityTokenException) + if err := req.Send(); err != nil { + return credentials.Value{}, awserr.New(ErrCodeWebIdentity, "failed to retrieve credentials", err) + } + + p.SetExpiration(aws.TimeValue(resp.Credentials.Expiration), p.ExpiryWindow) + + value := credentials.Value{ + AccessKeyID: aws.StringValue(resp.Credentials.AccessKeyId), + SecretAccessKey: aws.StringValue(resp.Credentials.SecretAccessKey), + SessionToken: aws.StringValue(resp.Credentials.SessionToken), + ProviderName: WebIdentityProviderName, + } + return value, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go index 514fc373..82a3e345 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go @@ -16,25 +16,26 @@ var ( type metricChan struct { ch chan metric - paused int64 + paused *int64 } func newMetricChan(size int) metricChan { return metricChan{ - ch: make(chan metric, size), + ch: make(chan metric, size), + paused: new(int64), } } func (ch *metricChan) Pause() { - atomic.StoreInt64(&ch.paused, pausedEnum) + atomic.StoreInt64(ch.paused, pausedEnum) } func (ch *metricChan) Continue() { - atomic.StoreInt64(&ch.paused, runningEnum) + atomic.StoreInt64(ch.paused, runningEnum) } func (ch *metricChan) IsPaused() bool { - v := atomic.LoadInt64(&ch.paused) + v := atomic.LoadInt64(ch.paused) return v == pausedEnum } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go index 0d368491..9186587f 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go @@ -66,7 +66,6 @@ func (rep *Reporter) sendAPICallAttemptMetric(r *request.Request) { XAmzRequestID: aws.String(r.RequestID), - AttemptCount: aws.Int(r.RetryCount + 1), AttemptLatency: aws.Int(int(now.Sub(r.AttemptTime).Nanoseconds() / int64(time.Millisecond))), AccessKey: aws.String(creds.AccessKeyID), } @@ -118,7 +117,7 @@ func (rep *Reporter) sendAPICallMetric(r *request.Request) { Type: aws.String("ApiCall"), AttemptCount: aws.Int(r.RetryCount + 1), Region: r.Config.Region, - Latency: aws.Int(int(time.Now().Sub(r.Time) / time.Millisecond)), + Latency: aws.Int(int(time.Since(r.Time) / time.Millisecond)), XAmzRequestID: aws.String(r.RequestID), MaxRetriesExceeded: aws.Int(boolIntValue(r.RetryCount >= r.MaxRetries())), } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go index 2c8d5f56..12897eef 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "net/http" + "strconv" "strings" "time" @@ -12,8 +13,41 @@ import ( "github.com/aws/aws-sdk-go/internal/sdkuri" ) +// getToken uses the duration to return a token for EC2 metadata service, +// or an error if the request failed. +func (c *EC2Metadata) getToken(duration time.Duration) (tokenOutput, error) { + op := &request.Operation{ + Name: "GetToken", + HTTPMethod: "PUT", + HTTPPath: "/api/token", + } + + var output tokenOutput + req := c.NewRequest(op, nil, &output) + + // remove the fetch token handler from the request handlers to avoid infinite recursion + req.Handlers.Sign.RemoveByName(fetchTokenHandlerName) + + // Swap the unmarshalMetadataHandler with unmarshalTokenHandler on this request. + req.Handlers.Unmarshal.Swap(unmarshalMetadataHandlerName, unmarshalTokenHandler) + + ttl := strconv.FormatInt(int64(duration/time.Second), 10) + req.HTTPRequest.Header.Set(ttlHeader, ttl) + + err := req.Send() + + // Errors with bad request status should be returned. + if err != nil { + err = awserr.NewRequestFailure( + awserr.New(req.HTTPResponse.Status, http.StatusText(req.HTTPResponse.StatusCode), err), + req.HTTPResponse.StatusCode, req.RequestID) + } + + return output, err +} + // GetMetadata uses the path provided to request information from the EC2 -// instance metdata service. The content will be returned as a string, or +// instance metadata service. The content will be returned as a string, or // error if the request failed. func (c *EC2Metadata) GetMetadata(p string) (string, error) { op := &request.Operation{ @@ -21,11 +55,11 @@ func (c *EC2Metadata) GetMetadata(p string) (string, error) { HTTPMethod: "GET", HTTPPath: sdkuri.PathJoin("/meta-data", p), } - output := &metadataOutput{} + req := c.NewRequest(op, nil, output) - err := req.Send() + err := req.Send() return output.Content, err } @@ -41,13 +75,8 @@ func (c *EC2Metadata) GetUserData() (string, error) { output := &metadataOutput{} req := c.NewRequest(op, nil, output) - req.Handlers.UnmarshalError.PushBack(func(r *request.Request) { - if r.HTTPResponse.StatusCode == http.StatusNotFound { - r.Error = awserr.New("NotFoundError", "user-data not found", r.Error) - } - }) - err := req.Send() + err := req.Send() return output.Content, err } @@ -63,8 +92,8 @@ func (c *EC2Metadata) GetDynamicData(p string) (string, error) { output := &metadataOutput{} req := c.NewRequest(op, nil, output) - err := req.Send() + err := req.Send() return output.Content, err } @@ -116,17 +145,17 @@ func (c *EC2Metadata) IAMInfo() (EC2IAMInfo, error) { // Region returns the region the instance is running in. func (c *EC2Metadata) Region() (string, error) { - resp, err := c.GetMetadata("placement/availability-zone") + ec2InstanceIdentityDocument, err := c.GetInstanceIdentityDocument() if err != nil { return "", err } - - if len(resp) == 0 { - return "", awserr.New("EC2MetadataError", "invalid Region response", nil) + // extract region from the ec2InstanceIdentityDocument + region := ec2InstanceIdentityDocument.Region + if len(region) == 0 { + return "", awserr.New("EC2MetadataError", "invalid region received for ec2metadata instance", nil) } - - // returns region without the suffix. Eg: us-west-2a becomes us-west-2 - return resp[:len(resp)-1], nil + // returns region + return region, nil } // Available returns if the application has access to the EC2 Metadata service. @@ -152,18 +181,19 @@ type EC2IAMInfo struct { // An EC2InstanceIdentityDocument provides the shape for unmarshaling // an instance identity document type EC2InstanceIdentityDocument struct { - DevpayProductCodes []string `json:"devpayProductCodes"` - AvailabilityZone string `json:"availabilityZone"` - PrivateIP string `json:"privateIp"` - Version string `json:"version"` - Region string `json:"region"` - InstanceID string `json:"instanceId"` - BillingProducts []string `json:"billingProducts"` - InstanceType string `json:"instanceType"` - AccountID string `json:"accountId"` - PendingTime time.Time `json:"pendingTime"` - ImageID string `json:"imageId"` - KernelID string `json:"kernelId"` - RamdiskID string `json:"ramdiskId"` - Architecture string `json:"architecture"` + DevpayProductCodes []string `json:"devpayProductCodes"` + MarketplaceProductCodes []string `json:"marketplaceProductCodes"` + AvailabilityZone string `json:"availabilityZone"` + PrivateIP string `json:"privateIp"` + Version string `json:"version"` + Region string `json:"region"` + InstanceID string `json:"instanceId"` + BillingProducts []string `json:"billingProducts"` + InstanceType string `json:"instanceType"` + AccountID string `json:"accountId"` + PendingTime time.Time `json:"pendingTime"` + ImageID string `json:"imageId"` + KernelID string `json:"kernelId"` + RamdiskID string `json:"ramdiskId"` + Architecture string `json:"architecture"` } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go index f0c1d31e..8eccac05 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go @@ -13,6 +13,7 @@ import ( "io" "net/http" "os" + "strconv" "strings" "time" @@ -24,9 +25,25 @@ import ( "github.com/aws/aws-sdk-go/aws/request" ) -// ServiceName is the name of the service. -const ServiceName = "ec2metadata" -const disableServiceEnvVar = "AWS_EC2_METADATA_DISABLED" +const ( + // ServiceName is the name of the service. + ServiceName = "ec2metadata" + disableServiceEnvVar = "AWS_EC2_METADATA_DISABLED" + + // Headers for Token and TTL + ttlHeader = "x-aws-ec2-metadata-token-ttl-seconds" + tokenHeader = "x-aws-ec2-metadata-token" + + // Named Handler constants + fetchTokenHandlerName = "FetchTokenHandler" + unmarshalMetadataHandlerName = "unmarshalMetadataHandler" + unmarshalTokenHandlerName = "unmarshalTokenHandler" + enableTokenProviderHandlerName = "enableTokenProviderHandler" + + // TTL constants + defaultTTL = 21600 * time.Second + ttlExpirationWindow = 30 * time.Second +) // A EC2Metadata is an EC2 Metadata service Client. type EC2Metadata struct { @@ -80,13 +97,27 @@ func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ), } - svc.Handlers.Unmarshal.PushBack(unmarshalHandler) + // token provider instance + tp := newTokenProvider(svc, defaultTTL) + + // NamedHandler for fetching token + svc.Handlers.Sign.PushBackNamed(request.NamedHandler{ + Name: fetchTokenHandlerName, + Fn: tp.fetchTokenHandler, + }) + // NamedHandler for enabling token provider + svc.Handlers.Complete.PushBackNamed(request.NamedHandler{ + Name: enableTokenProviderHandlerName, + Fn: tp.enableTokenProviderHandler, + }) + + svc.Handlers.Unmarshal.PushBackNamed(unmarshalHandler) svc.Handlers.UnmarshalError.PushBack(unmarshalError) svc.Handlers.Validate.Clear() svc.Handlers.Validate.PushBack(validateEndpointHandler) // Disable the EC2 Metadata service if the environment variable is set. - // This shortcirctes the service's functionality to always fail to send + // This short-circuits the service's functionality to always fail to send // requests. if strings.ToLower(os.Getenv(disableServiceEnvVar)) == "true" { svc.Handlers.Send.SwapNamed(request.NamedHandler{ @@ -107,7 +138,6 @@ func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio for _, option := range opts { option(svc.Client) } - return svc } @@ -119,30 +149,74 @@ type metadataOutput struct { Content string } -func unmarshalHandler(r *request.Request) { - defer r.HTTPResponse.Body.Close() - b := &bytes.Buffer{} - if _, err := io.Copy(b, r.HTTPResponse.Body); err != nil { - r.Error = awserr.New(request.ErrCodeSerialization, "unable to unmarshal EC2 metadata respose", err) - return - } +type tokenOutput struct { + Token string + TTL time.Duration +} - if data, ok := r.Data.(*metadataOutput); ok { - data.Content = b.String() - } +// unmarshal token handler is used to parse the response of a getToken operation +var unmarshalTokenHandler = request.NamedHandler{ + Name: unmarshalTokenHandlerName, + Fn: func(r *request.Request) { + defer r.HTTPResponse.Body.Close() + var b bytes.Buffer + if _, err := io.Copy(&b, r.HTTPResponse.Body); err != nil { + r.Error = awserr.NewRequestFailure(awserr.New(request.ErrCodeSerialization, + "unable to unmarshal EC2 metadata response", err), r.HTTPResponse.StatusCode, r.RequestID) + return + } + + v := r.HTTPResponse.Header.Get(ttlHeader) + data, ok := r.Data.(*tokenOutput) + if !ok { + return + } + + data.Token = b.String() + // TTL is in seconds + i, err := strconv.ParseInt(v, 10, 64) + if err != nil { + r.Error = awserr.NewRequestFailure(awserr.New(request.ParamFormatErrCode, + "unable to parse EC2 token TTL response", err), r.HTTPResponse.StatusCode, r.RequestID) + return + } + t := time.Duration(i) * time.Second + data.TTL = t + }, +} + +var unmarshalHandler = request.NamedHandler{ + Name: unmarshalMetadataHandlerName, + Fn: func(r *request.Request) { + defer r.HTTPResponse.Body.Close() + var b bytes.Buffer + if _, err := io.Copy(&b, r.HTTPResponse.Body); err != nil { + r.Error = awserr.NewRequestFailure(awserr.New(request.ErrCodeSerialization, + "unable to unmarshal EC2 metadata response", err), r.HTTPResponse.StatusCode, r.RequestID) + return + } + + if data, ok := r.Data.(*metadataOutput); ok { + data.Content = b.String() + } + }, } func unmarshalError(r *request.Request) { defer r.HTTPResponse.Body.Close() - b := &bytes.Buffer{} - if _, err := io.Copy(b, r.HTTPResponse.Body); err != nil { - r.Error = awserr.New(request.ErrCodeSerialization, "unable to unmarshal EC2 metadata error respose", err) + var b bytes.Buffer + + if _, err := io.Copy(&b, r.HTTPResponse.Body); err != nil { + r.Error = awserr.NewRequestFailure( + awserr.New(request.ErrCodeSerialization, "unable to unmarshal EC2 metadata error response", err), + r.HTTPResponse.StatusCode, r.RequestID) return } // Response body format is not consistent between metadata endpoints. // Grab the error message as a string and include that as the source error - r.Error = awserr.New("EC2MetadataError", "failed to make EC2Metadata request", errors.New(b.String())) + r.Error = awserr.NewRequestFailure(awserr.New("EC2MetadataError", "failed to make EC2Metadata request", errors.New(b.String())), + r.HTTPResponse.StatusCode, r.RequestID) } func validateEndpointHandler(r *request.Request) { diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go new file mode 100644 index 00000000..06f76055 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go @@ -0,0 +1,92 @@ +package ec2metadata + +import ( + "net/http" + "sync/atomic" + "time" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/request" +) + +// A tokenProvider struct provides access to EC2Metadata client +// and atomic instance of a token, along with configuredTTL for it. +// tokenProvider also provides an atomic flag to disable the +// fetch token operation. +// The disabled member will use 0 as false, and 1 as true. +type tokenProvider struct { + client *EC2Metadata + token atomic.Value + configuredTTL time.Duration + disabled uint32 +} + +// A ec2Token struct helps use of token in EC2 Metadata service ops +type ec2Token struct { + token string + credentials.Expiry +} + +// newTokenProvider provides a pointer to a tokenProvider instance +func newTokenProvider(c *EC2Metadata, duration time.Duration) *tokenProvider { + return &tokenProvider{client: c, configuredTTL: duration} +} + +// fetchTokenHandler fetches token for EC2Metadata service client by default. +func (t *tokenProvider) fetchTokenHandler(r *request.Request) { + + // short-circuits to insecure data flow if tokenProvider is disabled. + if v := atomic.LoadUint32(&t.disabled); v == 1 { + return + } + + if ec2Token, ok := t.token.Load().(ec2Token); ok && !ec2Token.IsExpired() { + r.HTTPRequest.Header.Set(tokenHeader, ec2Token.token) + return + } + + output, err := t.client.getToken(t.configuredTTL) + + if err != nil { + + // change the disabled flag on token provider to true, + // when error is request timeout error. + if requestFailureError, ok := err.(awserr.RequestFailure); ok { + switch requestFailureError.StatusCode() { + case http.StatusForbidden, http.StatusNotFound, http.StatusMethodNotAllowed: + atomic.StoreUint32(&t.disabled, 1) + case http.StatusBadRequest: + r.Error = requestFailureError + } + + // Check if request timed out while waiting for response + if e, ok := requestFailureError.OrigErr().(awserr.Error); ok { + if e.Code() == "RequestError" { + atomic.StoreUint32(&t.disabled, 1) + } + } + } + return + } + + newToken := ec2Token{ + token: output.Token, + } + newToken.SetExpiration(time.Now().Add(output.TTL), ttlExpirationWindow) + t.token.Store(newToken) + + // Inject token header to the request. + if ec2Token, ok := t.token.Load().(ec2Token); ok { + r.HTTPRequest.Header.Set(tokenHeader, ec2Token.token) + } +} + +// enableTokenProviderHandler enables the token provider +func (t *tokenProvider) enableTokenProviderHandler(r *request.Request) { + // If the error code status is 401, we enable the token provider + if e, ok := r.Error.(awserr.RequestFailure); ok && e != nil && + e.StatusCode() == http.StatusUnauthorized { + atomic.StoreUint32(&t.disabled, 0) + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go index 87b9ff3f..343a2106 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go @@ -83,6 +83,7 @@ func decodeV3Endpoints(modelDef modelDefinition, opts DecodeModelOptions) (Resol p := &ps[i] custAddEC2Metadata(p) custAddS3DualStack(p) + custRegionalS3(p) custRmIotDataService(p) custFixAppAutoscalingChina(p) custFixAppAutoscalingUsGov(p) @@ -100,6 +101,33 @@ func custAddS3DualStack(p *partition) { custAddDualstack(p, "s3-control") } +func custRegionalS3(p *partition) { + if p.ID != "aws" { + return + } + + service, ok := p.Services["s3"] + if !ok { + return + } + + // If global endpoint already exists no customization needed. + if _, ok := service.Endpoints["aws-global"]; ok { + return + } + + service.PartitionEndpoint = "aws-global" + service.Endpoints["us-east-1"] = endpoint{} + service.Endpoints["aws-global"] = endpoint{ + Hostname: "s3.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + } + + p.Services["s3"] = service +} + func custAddDualstack(p *partition, svcName string) { s, ok := p.Services[svcName] if !ok { diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index 371dfa6f..f8bfacc2 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -11,6 +11,8 @@ const ( AwsPartitionID = "aws" // AWS Standard partition. AwsCnPartitionID = "aws-cn" // AWS China partition. AwsUsGovPartitionID = "aws-us-gov" // AWS GovCloud (US) partition. + AwsIsoPartitionID = "aws-iso" // AWS ISO (US) partition. + AwsIsoBPartitionID = "aws-iso-b" // AWS ISOB (US) partition. ) // AWS Standard partition's regions. @@ -27,6 +29,7 @@ const ( EuWest1RegionID = "eu-west-1" // EU (Ireland). EuWest2RegionID = "eu-west-2" // EU (London). EuWest3RegionID = "eu-west-3" // EU (Paris). + MeSouth1RegionID = "me-south-1" // Middle East (Bahrain). SaEast1RegionID = "sa-east-1" // South America (Sao Paulo). UsEast1RegionID = "us-east-1" // US East (N. Virginia). UsEast2RegionID = "us-east-2" // US East (Ohio). @@ -46,8 +49,18 @@ const ( UsGovWest1RegionID = "us-gov-west-1" // AWS GovCloud (US). ) +// AWS ISO (US) partition's regions. +const ( + UsIsoEast1RegionID = "us-iso-east-1" // US ISO East. +) + +// AWS ISOB (US) partition's regions. +const ( + UsIsobEast1RegionID = "us-isob-east-1" // US ISOB East (Ohio). +) + // DefaultResolver returns an Endpoint resolver that will be able -// to resolve endpoints for: AWS Standard, AWS China, and AWS GovCloud (US). +// to resolve endpoints for: AWS Standard, AWS China, AWS GovCloud (US), AWS ISO (US), and AWS ISOB (US). // // Use DefaultPartitions() to get the list of the default partitions. func DefaultResolver() Resolver { @@ -55,7 +68,7 @@ func DefaultResolver() Resolver { } // DefaultPartitions returns a list of the partitions the SDK is bundled -// with. The available partitions are: AWS Standard, AWS China, and AWS GovCloud (US). +// with. The available partitions are: AWS Standard, AWS China, AWS GovCloud (US), AWS ISO (US), and AWS ISOB (US). // // partitions := endpoints.DefaultPartitions // for _, p := range partitions { @@ -69,6 +82,8 @@ var defaultPartitions = partitions{ awsPartition, awscnPartition, awsusgovPartition, + awsisoPartition, + awsisobPartition, } // AwsPartition returns the Resolver for AWS Standard. @@ -82,7 +97,7 @@ var awsPartition = partition{ DNSSuffix: "amazonaws.com", RegionRegex: regionRegex{ Regexp: func() *regexp.Regexp { - reg, _ := regexp.Compile("^(us|eu|ap|sa|ca)\\-\\w+\\-\\d+$") + reg, _ := regexp.Compile("^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$") return reg }(), }, @@ -128,6 +143,9 @@ var awsPartition = partition{ "eu-west-3": region{ Description: "EU (Paris)", }, + "me-south-1": region{ + Description: "Middle East (Bahrain)", + }, "sa-east-1": region{ Description: "South America (Sao Paulo)", }, @@ -166,6 +184,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -178,6 +197,7 @@ var awsPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -189,10 +209,42 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-ca-central-1": endpoint{ + Hostname: "acm-pca-fips.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "fips-us-east-1": endpoint{ + Hostname: "acm-pca-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "acm-pca-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "acm-pca-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "acm-pca-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "api.ecr": service{ @@ -270,6 +322,12 @@ var awsPartition = partition{ Region: "eu-west-3", }, }, + "me-south-1": endpoint{ + Hostname: "api.ecr.me-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "me-south-1", + }, + }, "sa-east-1": endpoint{ Hostname: "api.ecr.sa-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -308,6 +366,7 @@ var awsPartition = partition{ "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, @@ -327,6 +386,7 @@ var awsPartition = partition{ "api.sagemaker": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -334,8 +394,12 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "api-fips.sagemaker.us-east-1.amazonaws.com", @@ -381,6 +445,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -390,11 +455,7 @@ var awsPartition = partition{ }, "application-autoscaling": service{ Defaults: endpoint{ - Hostname: "autoscaling.{region}.amazonaws.com", Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Service: "application-autoscaling", - }, }, Endpoints: endpoints{ "ap-east-1": endpoint{}, @@ -409,6 +470,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -428,6 +490,7 @@ var awsPartition = partition{ "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -448,8 +511,14 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "fips": endpoint{ + Hostname: "appstream2-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "appsync": service{ @@ -471,6 +540,7 @@ var awsPartition = partition{ "athena": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -481,8 +551,12 @@ var awsPartition = partition{ "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -503,6 +577,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -512,11 +587,7 @@ var awsPartition = partition{ }, "autoscaling-plans": service{ Defaults: endpoint{ - Hostname: "autoscaling.{region}.amazonaws.com", Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Service: "autoscaling-plans", - }, }, Endpoints: endpoints{ "ap-northeast-1": endpoint{}, @@ -537,14 +608,20 @@ var awsPartition = partition{ "backup": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "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-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -566,6 +643,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -657,6 +735,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -712,6 +791,8 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -748,6 +829,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -758,6 +840,7 @@ var awsPartition = partition{ "codebuild": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -769,6 +852,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ @@ -803,6 +887,7 @@ var awsPartition = partition{ "codecommit": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -810,6 +895,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -819,11 +905,12 @@ var awsPartition = partition{ Region: "ca-central-1", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "codedeploy": service{ @@ -841,6 +928,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ @@ -882,6 +970,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -1002,6 +1091,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1009,6 +1099,16 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "connect": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "cur": service{ Endpoints: endpoints{ @@ -1028,6 +1128,22 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "dataexchange": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "datapipeline": service{ Endpoints: endpoints{ @@ -1041,16 +1157,48 @@ var awsPartition = partition{ "datasync": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "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-north-1": endpoint{}, "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "datasync-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "datasync-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "datasync-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "datasync-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "dax": service{ @@ -1062,6 +1210,8 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1078,6 +1228,7 @@ var awsPartition = partition{ "directconnect": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1089,6 +1240,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1099,7 +1251,8 @@ var awsPartition = partition{ "discovery": service{ Endpoints: endpoints{ - "us-west-2": endpoint{}, + "eu-central-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "dms": service{ @@ -1117,6 +1270,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1139,12 +1293,30 @@ var awsPartition = partition{ Region: "ap-northeast-2", }, }, + "ap-south-1": endpoint{ + Hostname: "rds.ap-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-south-1", + }, + }, + "ap-southeast-1": endpoint{ + Hostname: "rds.ap-southeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-1", + }, + }, "ap-southeast-2": endpoint{ Hostname: "rds.ap-southeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-2", }, }, + "ca-central-1": endpoint{ + Hostname: "rds.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, "eu-central-1": endpoint{ Hostname: "rds.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ @@ -1157,6 +1329,18 @@ var awsPartition = partition{ Region: "eu-west-1", }, }, + "eu-west-2": endpoint{ + Hostname: "rds.eu-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-2", + }, + }, + "eu-west-3": endpoint{ + Hostname: "rds.eu-west-3.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-3", + }, + }, "us-east-1": endpoint{ Hostname: "rds.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -1180,6 +1364,7 @@ var awsPartition = partition{ "ds": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1227,8 +1412,9 @@ var awsPartition = partition{ Region: "us-east-1", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "dynamodb-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -1275,6 +1461,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1308,6 +1495,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1336,11 +1524,12 @@ var awsPartition = partition{ Region: "us-west-1", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "elasticbeanstalk": service{ @@ -1358,6 +1547,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1368,6 +1558,7 @@ var awsPartition = partition{ "elasticfilesystem": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1375,9 +1566,12 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -1401,6 +1595,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1428,6 +1623,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{ SSLCommonName: "{service}.{region}.{dnsSuffix}", @@ -1492,11 +1688,12 @@ var awsPartition = partition{ Region: "us-west-1", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "events": service{ @@ -1514,6 +1711,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1524,6 +1722,7 @@ var awsPartition = partition{ "firehose": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1535,6 +1734,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1549,17 +1749,44 @@ 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-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, + "forecast": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "forecastquery": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "fsx": service{ Endpoints: endpoints{ @@ -1567,9 +1794,12 @@ var awsPartition = partition{ "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-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{}, }, }, @@ -1609,6 +1839,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1631,6 +1862,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1670,6 +1902,7 @@ var awsPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1681,11 +1914,36 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "us-east-1-fips": endpoint{ + Hostname: "guardduty-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "guardduty-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "guardduty-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "guardduty-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, }, }, "health": service{ @@ -1746,6 +2004,7 @@ var awsPartition = partition{ }, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1757,6 +2016,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1775,15 +2035,117 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "iotthingsgraph": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "iotthingsgraph", - }, - }, + "iotevents": service{ + Endpoints: endpoints{ "ap-northeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "ioteventsdata": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{ + Hostname: "data.iotevents.ap-northeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-northeast-1", + }, + }, + "ap-northeast-2": endpoint{ + Hostname: "data.iotevents.ap-northeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-northeast-2", + }, + }, + "ap-southeast-1": endpoint{ + Hostname: "data.iotevents.ap-southeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-1", + }, + }, + "ap-southeast-2": endpoint{ + Hostname: "data.iotevents.ap-southeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-2", + }, + }, + "eu-central-1": endpoint{ + Hostname: "data.iotevents.eu-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-central-1", + }, + }, + "eu-west-1": endpoint{ + Hostname: "data.iotevents.eu-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-1", + }, + }, + "eu-west-2": endpoint{ + Hostname: "data.iotevents.eu-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-2", + }, + }, + "us-east-1": endpoint{ + Hostname: "data.iotevents.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{ + Hostname: "data.iotevents.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-2": endpoint{ + Hostname: "data.iotevents.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + "iotsecuredtunneling": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "iotthingsgraph": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "iotthingsgraph", + }, + }, + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-2": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, @@ -1792,15 +2154,22 @@ var awsPartition = partition{ "kafka": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "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-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -1819,6 +2188,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1831,11 +2201,14 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, @@ -1867,6 +2240,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1874,6 +2248,24 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "lakeformation": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "lambda": service{ Endpoints: endpoints{ @@ -1889,6 +2281,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1911,6 +2304,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1951,6 +2345,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1980,6 +2375,7 @@ var awsPartition = partition{ "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -2021,8 +2417,11 @@ var awsPartition = partition{ "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, + "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -2036,6 +2435,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, @@ -2075,6 +2475,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2085,7 +2486,8 @@ var awsPartition = partition{ "mgh": service{ Endpoints: endpoints{ - "us-west-2": endpoint{}, + "eu-central-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "mobileanalytics": service{ @@ -2101,9 +2503,10 @@ var awsPartition = partition{ }, }, Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "monitoring": service{ @@ -2123,6 +2526,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2143,10 +2547,34 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "mq-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "mq-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "mq-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "mq-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "mturk-requester": service{ @@ -2192,6 +2620,12 @@ var awsPartition = partition{ Region: "ap-southeast-2", }, }, + "ca-central-1": endpoint{ + Hostname: "rds.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, "eu-central-1": endpoint{ Hostname: "rds.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ @@ -2216,6 +2650,12 @@ var awsPartition = partition{ Region: "eu-west-2", }, }, + "me-south-1": endpoint{ + Hostname: "rds.me-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "me-south-1", + }, + }, "us-east-1": endpoint{ Hostname: "rds.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -2236,6 +2676,65 @@ var awsPartition = partition{ }, }, }, + "oidc": service{ + + Endpoints: endpoints{ + "ap-southeast-1": endpoint{ + Hostname: "oidc.ap-southeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-1", + }, + }, + "ap-southeast-2": endpoint{ + Hostname: "oidc.ap-southeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-2", + }, + }, + "ca-central-1": endpoint{ + Hostname: "oidc.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "eu-central-1": endpoint{ + Hostname: "oidc.eu-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-central-1", + }, + }, + "eu-west-1": endpoint{ + Hostname: "oidc.eu-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-1", + }, + }, + "eu-west-2": endpoint{ + Hostname: "oidc.eu-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-2", + }, + }, + "us-east-1": endpoint{ + Hostname: "oidc.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{ + Hostname: "oidc.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-2": endpoint{ + Hostname: "oidc.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, "opsworks": service{ Endpoints: endpoints{ @@ -2294,8 +2793,30 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "pinpoint-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "pinpoint-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "us-east-1": endpoint{ + Hostname: "pinpoint.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-west-2": endpoint{ + Hostname: "pinpoint.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, }, }, "polly": service{ @@ -2319,19 +2840,92 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "projects.iot1click": service{ - - Endpoints: endpoints{ - "ap-northeast-1": 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{}, - }, - }, - "ram": service{ + "portal.sso": service{ + + Endpoints: endpoints{ + "ap-southeast-1": endpoint{ + Hostname: "portal.sso.ap-southeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-1", + }, + }, + "ap-southeast-2": endpoint{ + Hostname: "portal.sso.ap-southeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-2", + }, + }, + "ca-central-1": endpoint{ + Hostname: "portal.sso.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "eu-central-1": endpoint{ + Hostname: "portal.sso.eu-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-central-1", + }, + }, + "eu-west-1": endpoint{ + Hostname: "portal.sso.eu-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-1", + }, + }, + "eu-west-2": endpoint{ + Hostname: "portal.sso.eu-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-2", + }, + }, + "us-east-1": endpoint{ + Hostname: "portal.sso.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{ + Hostname: "portal.sso.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-2": endpoint{ + Hostname: "portal.sso.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + "projects.iot1click": service{ + + Endpoints: endpoints{ + "ap-northeast-1": 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{}, + }, + }, + "qldb": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "ram": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, @@ -2345,6 +2939,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -2366,6 +2961,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{ SSLCommonName: "{service}.{dnsSuffix}", @@ -2390,6 +2986,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2429,19 +3026,47 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "resource-groups-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "resource-groups-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "resource-groups-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "resource-groups-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "robomaker": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, + "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -2492,14 +3117,16 @@ var awsPartition = partition{ }, }, Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "runtime.sagemaker": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2507,8 +3134,12 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "runtime-fips.sagemaker.us-east-1.amazonaws.com", @@ -2540,7 +3171,7 @@ var awsPartition = partition{ }, }, "s3": service{ - PartitionEndpoint: "us-east-1", + PartitionEndpoint: "aws-global", IsRegionalized: boxedTrue, Defaults: endpoint{ Protocols: []string{"http", "https"}, @@ -2565,6 +3196,12 @@ var awsPartition = partition{ Hostname: "s3.ap-southeast-2.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, }, + "aws-global": endpoint{ + Hostname: "s3.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, @@ -2572,8 +3209,9 @@ var awsPartition = partition{ Hostname: "s3.eu-west-1.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, }, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "s3-external-1": endpoint{ Hostname: "s3-external-1.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, @@ -2585,10 +3223,7 @@ var awsPartition = partition{ Hostname: "s3.sa-east-1.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, }, - "us-east-1": endpoint{ - Hostname: "s3.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, + "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{ Hostname: "s3.us-west-1.amazonaws.com", @@ -2751,6 +3386,29 @@ var awsPartition = partition{ }, }, }, + "savingsplans": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "savingsplans.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + }, + }, + "schemas": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "sdb": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, @@ -2772,6 +3430,7 @@ var awsPartition = partition{ "secretsmanager": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2783,6 +3442,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ @@ -2817,6 +3477,7 @@ var awsPartition = partition{ "securityhub": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2828,6 +3489,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2840,6 +3502,9 @@ var awsPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{ + Protocols: []string{"https"}, + }, "ap-northeast-1": endpoint{ Protocols: []string{"https"}, }, @@ -2873,6 +3538,9 @@ var awsPartition = partition{ "eu-west-3": endpoint{ Protocols: []string{"https"}, }, + "me-south-1": endpoint{ + Protocols: []string{"https"}, + }, "sa-east-1": endpoint{ Protocols: []string{"https"}, }, @@ -2938,6 +3606,7 @@ var awsPartition = partition{ "servicediscovery": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2945,9 +3614,11 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2955,6 +3626,20 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "session.qldb": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "shield": service{ IsRegionalized: boxedFalse, Defaults: endpoint{ @@ -2980,6 +3665,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2991,6 +3677,7 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -3023,6 +3710,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -3072,7 +3760,8 @@ var awsPartition = partition{ Region: "us-west-2", }, }, - "sa-east-1": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{ SSLCommonName: "queue.{dnsSuffix}", }, @@ -3096,6 +3785,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -3118,6 +3808,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -3128,6 +3819,7 @@ var awsPartition = partition{ "storagegateway": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -3139,6 +3831,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -3178,8 +3871,9 @@ var awsPartition = partition{ Region: "us-east-1", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "dynamodb-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -3211,38 +3905,29 @@ var awsPartition = partition{ }, "sts": service{ PartitionEndpoint: "aws-global", - Defaults: endpoint{ - Hostname: "sts.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, + Endpoints: endpoints{ - "ap-east-1": endpoint{ - Hostname: "sts.ap-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-east-1", - }, - }, + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{ - Hostname: "sts.ap-northeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-2", - }, - }, + "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, - "aws-global": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, + "aws-global": endpoint{ + Hostname: "sts.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "sts-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -3299,6 +3984,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -3321,6 +4007,31 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "transcribe": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "ap-east-1": endpoint{}, + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -3328,6 +4039,17 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "transcribestreaming": service{ + + Endpoints: endpoints{ + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "transfer": service{ Endpoints: endpoints{ @@ -3338,9 +4060,11 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -3352,13 +4076,18 @@ var awsPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "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-north-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "translate-fips.us-east-1.amazonaws.com", @@ -3373,6 +4102,7 @@ var awsPartition = partition{ Region: "us-east-2", }, }, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "translate-fips.us-west-2.amazonaws.com", @@ -3400,13 +4130,17 @@ 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-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, @@ -3464,6 +4198,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -3529,11 +4264,7 @@ var awscnPartition = partition{ }, "application-autoscaling": service{ Defaults: endpoint{ - Hostname: "autoscaling.{region}.amazonaws.com.cn", Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Service: "application-autoscaling", - }, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, @@ -3549,6 +4280,13 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "batch": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, "cloudformation": service{ Endpoints: endpoints{ @@ -3604,6 +4342,12 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "dax": service{ + + Endpoints: endpoints{ + "cn-northwest-1": endpoint{}, + }, + }, "directconnect": service{ Endpoints: endpoints{ @@ -3729,6 +4473,12 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "glue": service{ + + Endpoints: endpoints{ + "cn-northwest-1": endpoint{}, + }, + }, "greengrass": service{ IsRegionalized: boxedTrue, Defaults: endpoint{ @@ -3758,7 +4508,8 @@ var awscnPartition = partition{ }, }, Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, }, }, "kinesis": service{ @@ -3944,7 +4695,7 @@ var awscnPartition = partition{ Endpoints: endpoints{ "aws-cn-global": endpoint{ - Hostname: "support.cn-north-1.amazonaws.com", + Hostname: "support.cn-north-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-north-1", }, @@ -3965,6 +4716,31 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "transcribe": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{ + Hostname: "cn.transcribe.cn-north-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-north-1", + }, + }, + "cn-northwest-1": endpoint{ + Hostname: "cn.transcribe.cn-northwest-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, + "workspaces": service{ + + Endpoints: endpoints{ + "cn-northwest-1": endpoint{}, + }, + }, }, } @@ -4045,7 +4821,8 @@ var awsusgovPartition = partition{ }, "application-autoscaling": service{ Defaults: endpoint{ - Hostname: "autoscaling.{region}.amazonaws.com", + Hostname: "autoscaling.{region}.amazonaws.com", + Protocols: []string{"http", "https"}, CredentialScope: credentialScope{ Service: "application-autoscaling", }, @@ -4055,6 +4832,23 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "appstream2": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + CredentialScope: credentialScope{ + Service: "appstream", + }, + }, + Endpoints: endpoints{ + "fips": endpoint{ + Hostname: "appstream2-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-west-1": endpoint{}, + }, + }, "athena": service{ Endpoints: endpoints{ @@ -4159,6 +4953,13 @@ var awsusgovPartition = partition{ "datasync": service{ Endpoints: endpoints{ + "fips-us-gov-west-1": endpoint{ + Hostname: "datasync-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, @@ -4332,6 +5133,12 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "health": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "iam": service{ PartitionEndpoint: "aws-us-gov-global", IsRegionalized: boxedFalse, @@ -4416,6 +5223,7 @@ var awsusgovPartition = partition{ }, }, Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, @@ -4426,6 +5234,23 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "neptune": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{ + Hostname: "rds.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-west-1": endpoint{ + Hostname: "rds.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, "organizations": service{ PartitionEndpoint: "aws-us-gov-global", IsRegionalized: boxedFalse, @@ -4448,6 +5273,7 @@ var awsusgovPartition = partition{ "ram": service{ Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, @@ -4471,6 +5297,45 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "resource-groups": service{ + + Endpoints: endpoints{ + "fips-us-gov-east-1": endpoint{ + Hostname: "resource-groups.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "fips-us-gov-west-1": endpoint{ + Hostname: "resource-groups.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "route53": service{ + PartitionEndpoint: "aws-us-gov-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-us-gov-global": endpoint{ + Hostname: "route53.us-gov.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, + "route53resolver": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, "runtime.sagemaker": service{ Endpoints: endpoints{ @@ -4537,6 +5402,13 @@ var awsusgovPartition = partition{ "secretsmanager": service{ Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-east-1-fips": endpoint{ + Hostname: "secretsmanager-fips.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "secretsmanager-fips.us-gov-west-1.amazonaws.com", @@ -4551,11 +5423,26 @@ var awsusgovPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "us-gov-east-1": endpoint{ + Protocols: []string{"https"}, + }, "us-gov-west-1": endpoint{ Protocols: []string{"https"}, }, }, }, + "servicecatalog": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + "us-gov-west-1-fips": endpoint{ + Hostname: "servicecatalog-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, "sms": service{ Endpoints: endpoints{ @@ -4653,6 +5540,14 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "transcribe": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "translate": service{ Defaults: endpoint{ Protocols: []string{"https"}, @@ -4681,3 +5576,624 @@ var awsusgovPartition = partition{ }, }, } + +// AwsIsoPartition returns the Resolver for AWS ISO (US). +func AwsIsoPartition() Partition { + return awsisoPartition.Partition() +} + +var awsisoPartition = partition{ + ID: "aws-iso", + Name: "AWS ISO (US)", + DNSSuffix: "c2s.ic.gov", + RegionRegex: regionRegex{ + Regexp: func() *regexp.Regexp { + reg, _ := regexp.Compile("^us\\-iso\\-\\w+\\-\\d+$") + return reg + }(), + }, + Defaults: endpoint{ + Hostname: "{service}.{region}.{dnsSuffix}", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + Regions: regions{ + "us-iso-east-1": region{ + Description: "US ISO East", + }, + }, + Services: services{ + "api.ecr": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Hostname: "api.ecr.us-iso-east-1.c2s.ic.gov", + CredentialScope: credentialScope{ + Region: "us-iso-east-1", + }, + }, + }, + }, + "api.sagemaker": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "apigateway": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "application-autoscaling": service{ + Defaults: endpoint{ + Hostname: "autoscaling.us-iso-east-1.c2s.ic.gov", + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "autoscaling": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "cloudformation": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "cloudtrail": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "codedeploy": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "config": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "datapipeline": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "directconnect": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "dms": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "ds": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "dynamodb": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "ec2": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "ec2metadata": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "169.254.169.254/latest", + Protocols: []string{"http"}, + }, + }, + }, + "ecs": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "elasticache": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "elasticloadbalancing": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "elasticmapreduce": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"https"}, + }, + }, + }, + "events": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "glacier": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "health": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "iam": service{ + PartitionEndpoint: "aws-iso-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-iso-global": endpoint{ + Hostname: "iam.us-iso-east-1.c2s.ic.gov", + CredentialScope: credentialScope{ + Region: "us-iso-east-1", + }, + }, + }, + }, + "kinesis": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "kms": service{ + + Endpoints: endpoints{ + "ProdFips": endpoint{ + Hostname: "kms-fips.us-iso-east-1.c2s.ic.gov", + CredentialScope: credentialScope{ + Region: "us-iso-east-1", + }, + }, + "us-iso-east-1": endpoint{}, + }, + }, + "lambda": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "logs": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "monitoring": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "rds": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "redshift": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "route53": service{ + PartitionEndpoint: "aws-iso-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-iso-global": endpoint{ + Hostname: "route53.c2s.ic.gov", + CredentialScope: credentialScope{ + Region: "us-iso-east-1", + }, + }, + }, + }, + "runtime.sagemaker": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "s3": service{ + Defaults: endpoint{ + SignatureVersions: []string{"s3v4"}, + }, + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + SignatureVersions: []string{"s3v4"}, + }, + }, + }, + "snowball": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "sns": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "sqs": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "states": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "streams.dynamodb": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + CredentialScope: credentialScope{ + Service: "dynamodb", + }, + }, + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "sts": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "support": service{ + PartitionEndpoint: "aws-iso-global", + + Endpoints: endpoints{ + "aws-iso-global": endpoint{ + Hostname: "support.us-iso-east-1.c2s.ic.gov", + CredentialScope: credentialScope{ + Region: "us-iso-east-1", + }, + }, + }, + }, + "swf": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "workspaces": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + }, +} + +// AwsIsoBPartition returns the Resolver for AWS ISOB (US). +func AwsIsoBPartition() Partition { + return awsisobPartition.Partition() +} + +var awsisobPartition = partition{ + ID: "aws-iso-b", + Name: "AWS ISOB (US)", + DNSSuffix: "sc2s.sgov.gov", + RegionRegex: regionRegex{ + Regexp: func() *regexp.Regexp { + reg, _ := regexp.Compile("^us\\-isob\\-\\w+\\-\\d+$") + return reg + }(), + }, + Defaults: endpoint{ + Hostname: "{service}.{region}.{dnsSuffix}", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + Regions: regions{ + "us-isob-east-1": region{ + Description: "US ISOB East (Ohio)", + }, + }, + Services: services{ + "application-autoscaling": service{ + Defaults: endpoint{ + Hostname: "autoscaling.us-isob-east-1.sc2s.sgov.gov", + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "autoscaling": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "cloudformation": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "cloudtrail": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "config": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "directconnect": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "dms": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "dynamodb": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "ec2": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "ec2metadata": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "169.254.169.254/latest", + Protocols: []string{"http"}, + }, + }, + }, + "elasticache": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "elasticloadbalancing": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{ + Protocols: []string{"https"}, + }, + }, + }, + "elasticmapreduce": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "events": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "glacier": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "health": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "iam": service{ + PartitionEndpoint: "aws-iso-b-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-iso-b-global": endpoint{ + Hostname: "iam.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: credentialScope{ + Region: "us-isob-east-1", + }, + }, + }, + }, + "kinesis": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "kms": service{ + + Endpoints: endpoints{ + "ProdFips": endpoint{ + Hostname: "kms-fips.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: credentialScope{ + Region: "us-isob-east-1", + }, + }, + "us-isob-east-1": endpoint{}, + }, + }, + "logs": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "monitoring": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "rds": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "redshift": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "s3": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + SignatureVersions: []string{"s3v4"}, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "snowball": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "sns": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "sqs": service{ + Defaults: endpoint{ + SSLCommonName: "{region}.queue.{dnsSuffix}", + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "states": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "streams.dynamodb": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + CredentialScope: credentialScope{ + Service: "dynamodb", + }, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "sts": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "support": service{ + PartitionEndpoint: "aws-iso-b-global", + + Endpoints: endpoints{ + "aws-iso-b-global": endpoint{ + Hostname: "support.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: credentialScope{ + Region: "us-isob-east-1", + }, + }, + }, + }, + "swf": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go index f82babf6..ca956e5f 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go @@ -3,6 +3,7 @@ package endpoints import ( "fmt" "regexp" + "strings" "github.com/aws/aws-sdk-go/aws/awserr" ) @@ -46,6 +47,108 @@ type Options struct { // // This option is ignored if StrictMatching is enabled. ResolveUnknownService bool + + // STS Regional Endpoint flag helps with resolving the STS endpoint + STSRegionalEndpoint STSRegionalEndpoint + + // S3 Regional Endpoint flag helps with resolving the S3 endpoint + S3UsEast1RegionalEndpoint S3UsEast1RegionalEndpoint +} + +// STSRegionalEndpoint is an enum for the states of the STS Regional Endpoint +// options. +type STSRegionalEndpoint int + +func (e STSRegionalEndpoint) String() string { + switch e { + case LegacySTSEndpoint: + return "legacy" + case RegionalSTSEndpoint: + return "regional" + case UnsetSTSEndpoint: + return "" + default: + return "unknown" + } +} + +const ( + + // UnsetSTSEndpoint represents that STS Regional Endpoint flag is not specified. + UnsetSTSEndpoint STSRegionalEndpoint = iota + + // LegacySTSEndpoint represents when STS Regional Endpoint flag is specified + // to use legacy endpoints. + LegacySTSEndpoint + + // RegionalSTSEndpoint represents when STS Regional Endpoint flag is specified + // to use regional endpoints. + RegionalSTSEndpoint +) + +// GetSTSRegionalEndpoint function returns the STSRegionalEndpointFlag based +// on the input string provided in env config or shared config by the user. +// +// `legacy`, `regional` are the only case-insensitive valid strings for +// resolving the STS regional Endpoint flag. +func GetSTSRegionalEndpoint(s string) (STSRegionalEndpoint, error) { + switch { + case strings.EqualFold(s, "legacy"): + return LegacySTSEndpoint, nil + case strings.EqualFold(s, "regional"): + return RegionalSTSEndpoint, nil + default: + return UnsetSTSEndpoint, fmt.Errorf("unable to resolve the value of STSRegionalEndpoint for %v", s) + } +} + +// S3UsEast1RegionalEndpoint is an enum for the states of the S3 us-east-1 +// Regional Endpoint options. +type S3UsEast1RegionalEndpoint int + +func (e S3UsEast1RegionalEndpoint) String() string { + switch e { + case LegacyS3UsEast1Endpoint: + return "legacy" + case RegionalS3UsEast1Endpoint: + return "regional" + case UnsetS3UsEast1Endpoint: + return "" + default: + return "unknown" + } +} + +const ( + + // UnsetS3UsEast1Endpoint represents that S3 Regional Endpoint flag is not + // specified. + UnsetS3UsEast1Endpoint S3UsEast1RegionalEndpoint = iota + + // LegacyS3UsEast1Endpoint represents when S3 Regional Endpoint flag is + // specified to use legacy endpoints. + LegacyS3UsEast1Endpoint + + // RegionalS3UsEast1Endpoint represents when S3 Regional Endpoint flag is + // specified to use regional endpoints. + RegionalS3UsEast1Endpoint +) + +// GetS3UsEast1RegionalEndpoint function returns the S3UsEast1RegionalEndpointFlag based +// on the input string provided in env config or shared config by the user. +// +// `legacy`, `regional` are the only case-insensitive valid strings for +// resolving the S3 regional Endpoint flag. +func GetS3UsEast1RegionalEndpoint(s string) (S3UsEast1RegionalEndpoint, error) { + switch { + case strings.EqualFold(s, "legacy"): + return LegacyS3UsEast1Endpoint, nil + case strings.EqualFold(s, "regional"): + return RegionalS3UsEast1Endpoint, nil + default: + return UnsetS3UsEast1Endpoint, + fmt.Errorf("unable to resolve the value of S3UsEast1RegionalEndpoint for %v", s) + } } // Set combines all of the option functions together. @@ -79,6 +182,12 @@ func ResolveUnknownServiceOption(o *Options) { o.ResolveUnknownService = true } +// STSRegionalEndpointOption enables the STS endpoint resolver behavior to resolve +// STS endpoint to their regional endpoint, instead of the global endpoint. +func STSRegionalEndpointOption(o *Options) { + o.STSRegionalEndpoint = RegionalSTSEndpoint +} + // A Resolver provides the interface for functionality to resolve endpoints. // The build in Partition and DefaultResolver return value satisfy this interface. type Resolver interface { @@ -170,10 +279,13 @@ func PartitionForRegion(ps []Partition, regionID string) (Partition, bool) { // A Partition provides the ability to enumerate the partition's regions // and services. type Partition struct { - id string - p *partition + id, dnsSuffix string + p *partition } +// DNSSuffix returns the base domain name of the partition. +func (p Partition) DNSSuffix() string { return p.dnsSuffix } + // ID returns the identifier of the partition. func (p Partition) ID() string { return p.id } @@ -191,7 +303,7 @@ func (p Partition) ID() string { return p.id } // require the provided service and region to be known by the partition. // If the endpoint cannot be strictly resolved an error will be returned. This // mode is useful to ensure the endpoint resolved is valid. Without -// StrictMatching enabled the endpoint returned my look valid but may not work. +// StrictMatching enabled the endpoint returned may look valid but may not work. // StrictMatching requires the SDK to be updated if you want to take advantage // of new regions and services expansions. // @@ -205,7 +317,7 @@ func (p Partition) EndpointFor(service, region string, opts ...func(*Options)) ( // Regions returns a map of Regions indexed by their ID. This is useful for // enumerating over the regions in a partition. func (p Partition) Regions() map[string]Region { - rs := map[string]Region{} + rs := make(map[string]Region, len(p.p.Regions)) for id, r := range p.p.Regions { rs[id] = Region{ id: id, @@ -220,7 +332,7 @@ func (p Partition) Regions() map[string]Region { // Services returns a map of Service indexed by their ID. This is useful for // enumerating over the services in a partition. func (p Partition) Services() map[string]Service { - ss := map[string]Service{} + ss := make(map[string]Service, len(p.p.Services)) for id := range p.p.Services { ss[id] = Service{ id: id, @@ -307,7 +419,7 @@ func (s Service) Regions() map[string]Region { // A region is the AWS region the service exists in. Whereas a Endpoint is // an URL that can be resolved to a instance of a service. func (s Service) Endpoints() map[string]Endpoint { - es := map[string]Endpoint{} + es := make(map[string]Endpoint, len(s.p.Services[s.id].Endpoints)) for id := range s.p.Services[s.id].Endpoints { es[id] = Endpoint{ id: id, @@ -347,6 +459,9 @@ type ResolvedEndpoint struct { // The endpoint URL URL string + // The endpoint partition + PartitionID string + // The region that should be used for signing requests. SigningRegion string diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/legacy_regions.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/legacy_regions.go new file mode 100644 index 00000000..df75e899 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/legacy_regions.go @@ -0,0 +1,24 @@ +package endpoints + +var legacyGlobalRegions = map[string]map[string]struct{}{ + "sts": { + "ap-northeast-1": {}, + "ap-south-1": {}, + "ap-southeast-1": {}, + "ap-southeast-2": {}, + "ca-central-1": {}, + "eu-central-1": {}, + "eu-north-1": {}, + "eu-west-1": {}, + "eu-west-2": {}, + "eu-west-3": {}, + "sa-east-1": {}, + "us-east-1": {}, + "us-east-2": {}, + "us-west-1": {}, + "us-west-2": {}, + }, + "s3": { + "us-east-1": {}, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go index ff6f76db..eb2ac83c 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go @@ -54,8 +54,9 @@ type partition struct { func (p partition) Partition() Partition { return Partition{ - id: p.ID, - p: &p, + dnsSuffix: p.DNSSuffix, + id: p.ID, + p: &p, } } @@ -74,24 +75,56 @@ func (p partition) canResolveEndpoint(service, region string, strictMatch bool) return p.RegionRegex.MatchString(region) } +func allowLegacyEmptyRegion(service string) bool { + legacy := map[string]struct{}{ + "budgets": {}, + "ce": {}, + "chime": {}, + "cloudfront": {}, + "ec2metadata": {}, + "iam": {}, + "importexport": {}, + "organizations": {}, + "route53": {}, + "sts": {}, + "support": {}, + "waf": {}, + } + + _, allowed := legacy[service] + return allowed +} + func (p partition) EndpointFor(service, region string, opts ...func(*Options)) (resolved ResolvedEndpoint, err error) { var opt Options opt.Set(opts...) s, hasService := p.Services[service] - if !(hasService || opt.ResolveUnknownService) { + if len(service) == 0 || !(hasService || opt.ResolveUnknownService) { // Only return error if the resolver will not fallback to creating // endpoint based on service endpoint ID passed in. return resolved, NewUnknownServiceError(p.ID, service, serviceList(p.Services)) } + if len(region) == 0 && allowLegacyEmptyRegion(service) && len(s.PartitionEndpoint) != 0 { + region = s.PartitionEndpoint + } + + if (service == "sts" && opt.STSRegionalEndpoint != RegionalSTSEndpoint) || + (service == "s3" && opt.S3UsEast1RegionalEndpoint != RegionalS3UsEast1Endpoint) { + if _, ok := legacyGlobalRegions[service][region]; ok { + region = "aws-global" + } + } + e, hasEndpoint := s.endpointForRegion(region) - if !hasEndpoint && opt.StrictMatching { + if len(region) == 0 || (!hasEndpoint && opt.StrictMatching) { return resolved, NewUnknownEndpointError(p.ID, service, region, endpointList(s.Endpoints)) } defs := []endpoint{p.Defaults, s.Defaults} - return e.resolve(service, region, p.DNSSuffix, defs, opt), nil + + return e.resolve(service, p.ID, region, p.DNSSuffix, defs, opt), nil } func serviceList(ss services) []string { @@ -200,7 +233,7 @@ func getByPriority(s []string, p []string, def string) string { return s[0] } -func (e endpoint) resolve(service, region, dnsSuffix string, defs []endpoint, opts Options) ResolvedEndpoint { +func (e endpoint) resolve(service, partitionID, region, dnsSuffix string, defs []endpoint, opts Options) ResolvedEndpoint { var merged endpoint for _, def := range defs { merged.mergeIn(def) @@ -208,11 +241,23 @@ func (e endpoint) resolve(service, region, dnsSuffix string, defs []endpoint, op merged.mergeIn(e) e = merged - hostname := e.Hostname + signingRegion := e.CredentialScope.Region + if len(signingRegion) == 0 { + signingRegion = region + } + signingName := e.CredentialScope.Service + var signingNameDerived bool + if len(signingName) == 0 { + signingName = service + signingNameDerived = true + } + + hostname := e.Hostname // Offset the hostname for dualstack if enabled if opts.UseDualStack && e.HasDualStack == boxedTrue { hostname = e.DualStackHostname + region = signingRegion } u := strings.Replace(hostname, "{service}", service, 1) @@ -222,20 +267,9 @@ func (e endpoint) resolve(service, region, dnsSuffix string, defs []endpoint, op scheme := getEndpointScheme(e.Protocols, opts.DisableSSL) u = fmt.Sprintf("%s://%s", scheme, u) - signingRegion := e.CredentialScope.Region - if len(signingRegion) == 0 { - signingRegion = region - } - - signingName := e.CredentialScope.Service - var signingNameDerived bool - if len(signingName) == 0 { - signingName = service - signingNameDerived = true - } - return ResolvedEndpoint{ URL: u, + PartitionID: partitionID, SigningRegion: signingRegion, SigningName: signingName, SigningNameDerived: signingNameDerived, diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go index 627ec722..185b0731 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go @@ -23,7 +23,7 @@ type Handlers struct { Complete HandlerList } -// Copy returns of this handler's lists. +// Copy returns a copy of this handler's lists. func (h *Handlers) Copy() Handlers { return Handlers{ Validate: h.Validate.copy(), @@ -42,7 +42,7 @@ func (h *Handlers) Copy() Handlers { } } -// Clear removes callback functions for all handlers +// Clear removes callback functions for all handlers. func (h *Handlers) Clear() { h.Validate.Clear() h.Build.Clear() diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go b/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go index b0c2ef4f..9370fa50 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go @@ -15,12 +15,15 @@ type offsetReader struct { closed bool } -func newOffsetReader(buf io.ReadSeeker, offset int64) *offsetReader { +func newOffsetReader(buf io.ReadSeeker, offset int64) (*offsetReader, error) { reader := &offsetReader{} - buf.Seek(offset, sdkio.SeekStart) + _, err := buf.Seek(offset, sdkio.SeekStart) + if err != nil { + return nil, err + } reader.buf = buf - return reader + return reader, nil } // Close will close the instance of the offset reader's access to @@ -54,7 +57,9 @@ func (o *offsetReader) Seek(offset int64, whence int) (int64, error) { // CloseAndCopy will return a new offsetReader with a copy of the old buffer // and close the old buffer. -func (o *offsetReader) CloseAndCopy(offset int64) *offsetReader { - o.Close() +func (o *offsetReader) CloseAndCopy(offset int64) (*offsetReader, error) { + if err := o.Close(); err != nil { + return nil, err + } return newOffsetReader(o.buf, offset) } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request.go index 2f0c4a90..52178141 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request.go @@ -4,7 +4,6 @@ import ( "bytes" "fmt" "io" - "net" "net/http" "net/url" "reflect" @@ -65,6 +64,15 @@ type Request struct { LastSignedAt time.Time DisableFollowRedirects bool + // Additional API error codes that should be retried. IsErrorRetryable + // will consider these codes in addition to its built in cases. + RetryErrorCodes []string + + // Additional API error codes that should be retried with throttle backoff + // delay. IsErrorThrottle will consider these codes in addition to its + // built in cases. + ThrottleErrorCodes []string + // A value greater than 0 instructs the request to be signed as Presigned URL // You should not set this field directly. Instead use Request's // Presign or PresignRequest methods. @@ -91,8 +99,12 @@ type Operation struct { BeforePresignFn func(r *Request) error } -// New returns a new Request pointer for the service API -// operation and parameters. +// New returns a new Request pointer for the service API operation and +// parameters. +// +// A Retryer should be provided to direct how the request is retried. If +// Retryer is nil, a default no retry value will be used. You can use +// NoOpRetryer in the Client package to disable retry behavior directly. // // Params is any value of input parameters to be the request payload. // Data is pointer value to an object which the request's response @@ -100,6 +112,10 @@ type Operation struct { func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers, retryer Retryer, operation *Operation, params interface{}, data interface{}) *Request { + if retryer == nil { + retryer = noOpRetryer{} + } + method := operation.HTTPMethod if method == "" { method = "POST" @@ -264,7 +280,18 @@ func (r *Request) SetStringBody(s string) { // SetReaderBody will set the request's body reader. func (r *Request) SetReaderBody(reader io.ReadSeeker) { r.Body = reader - r.BodyStart, _ = reader.Seek(0, sdkio.SeekCurrent) // Get the Bodies current offset. + + if aws.IsReaderSeekable(reader) { + var err error + // Get the Bodies current offset so retries will start from the same + // initial position. + r.BodyStart, err = reader.Seek(0, sdkio.SeekCurrent) + if err != nil { + r.Error = awserr.New(ErrCodeSerialization, + "failed to determine start of request body", err) + return + } + } r.ResetBody() } @@ -336,9 +363,7 @@ func getPresignedURL(r *Request, expire time.Duration) (string, http.Header, err } const ( - willRetry = "will retry" notRetrying = "not retrying" - retryCount = "retry %v/%v" ) func debugLogReqError(r *Request, stage, retryStr string, err error) { @@ -393,12 +418,16 @@ func (r *Request) Sign() error { return r.Error } -func (r *Request) getNextRequestBody() (io.ReadCloser, error) { +func (r *Request) getNextRequestBody() (body io.ReadCloser, err error) { if r.safeBody != nil { r.safeBody.Close() } - r.safeBody = newOffsetReader(r.Body, r.BodyStart) + r.safeBody, err = newOffsetReader(r.Body, r.BodyStart) + if err != nil { + return nil, awserr.New(ErrCodeSerialization, + "failed to get next request body reader", err) + } // Go 1.8 tightened and clarified the rules code needs to use when building // requests with the http package. Go 1.8 removed the automatic detection @@ -415,10 +444,10 @@ func (r *Request) getNextRequestBody() (io.ReadCloser, error) { // Related golang/go#18257 l, err := aws.SeekerLen(r.Body) if err != nil { - return nil, awserr.New(ErrCodeSerialization, "failed to compute request body size", err) + return nil, awserr.New(ErrCodeSerialization, + "failed to compute request body size", err) } - var body io.ReadCloser if l == 0 { body = NoBody } else if l > 0 { @@ -485,23 +514,22 @@ func (r *Request) Send() error { if err := r.sendRequest(); err == nil { return nil - } else if !shouldRetryError(r.Error) { - return err - } else { - r.Handlers.Retry.Run(r) - r.Handlers.AfterRetry.Run(r) + } + r.Handlers.Retry.Run(r) + r.Handlers.AfterRetry.Run(r) - if r.Error != nil || !aws.BoolValue(r.Retryable) { - return r.Error - } + if r.Error != nil || !aws.BoolValue(r.Retryable) { + return r.Error + } - r.prepareRetry() - continue + if err := r.prepareRetry(); err != nil { + r.Error = err + return err } } } -func (r *Request) prepareRetry() { +func (r *Request) prepareRetry() error { if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) { r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d", r.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount)) @@ -512,12 +540,19 @@ func (r *Request) prepareRetry() { // the request's body even though the Client's Do returned. r.HTTPRequest = copyHTTPRequest(r.HTTPRequest, nil) r.ResetBody() + if err := r.Error; err != nil { + return awserr.New(ErrCodeSerialization, + "failed to prepare body for retry", err) + + } // Closing response body to ensure that no response body is leaked // between retry attempts. if r.HTTPResponse != nil && r.HTTPResponse.Body != nil { r.HTTPResponse.Body.Close() } + + return nil } func (r *Request) sendRequest() (sendErr error) { @@ -573,51 +608,6 @@ func AddToUserAgent(r *Request, s string) { r.HTTPRequest.Header.Set("User-Agent", s) } -type temporary interface { - Temporary() bool -} - -func shouldRetryError(origErr error) bool { - switch err := origErr.(type) { - case awserr.Error: - if err.Code() == CanceledErrorCode { - return false - } - return shouldRetryError(err.OrigErr()) - case *url.Error: - if strings.Contains(err.Error(), "connection refused") { - // Refused connections should be retried as the service may not yet - // be running on the port. Go TCP dial considers refused - // connections as not temporary. - return true - } - // *url.Error only implements Temporary after golang 1.6 but since - // url.Error only wraps the error: - return shouldRetryError(err.Err) - case temporary: - if netErr, ok := err.(*net.OpError); ok && netErr.Op == "dial" { - return true - } - // If the error is temporary, we want to allow continuation of the - // retry process - return err.Temporary() || isErrConnectionReset(origErr) - case nil: - // `awserr.Error.OrigErr()` can be nil, meaning there was an error but - // because we don't know the cause, it is marked as retryable. See - // TestRequest4xxUnretryable for an example. - return true - default: - switch err.Error() { - case "net/http: request canceled", - "net/http: request canceled while waiting for connection": - // known 1.5 error case when an http request is cancelled - return false - } - // here we don't know the error; so we allow a retry. - return true - } -} - // SanitizeHostForHeader removes default port from host and updates request.Host func SanitizeHostForHeader(r *http.Request) { host := getHost(r) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go index 7c6a8000..de1292f4 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go @@ -4,6 +4,8 @@ package request import ( "net/http" + + "github.com/aws/aws-sdk-go/aws/awserr" ) // NoBody is a http.NoBody reader instructing Go HTTP client to not include @@ -24,7 +26,8 @@ var NoBody = http.NoBody func (r *Request) ResetBody() { body, err := r.getNextRequestBody() if err != nil { - r.Error = err + r.Error = awserr.New(ErrCodeSerialization, + "failed to reset request body", err) return } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go index a633ed5a..64784e16 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go @@ -17,11 +17,13 @@ import ( // does the pagination between API operations, and Paginator defines the // configuration that will be used per page request. // -// cont := true -// for p.Next() && cont { +// for p.Next() { // data := p.Page().(*s3.ListObjectsOutput) // // process the page's data +// // ... +// // break out of loop to stop fetching additional pages // } +// // return p.Err() // // See service client API operation Pages methods for examples how the SDK will @@ -146,7 +148,7 @@ func (r *Request) nextPageTokens() []interface{} { return nil } case bool: - if v == false { + if !v { return nil } } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go index d0aa54c6..356e5d9d 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go @@ -1,26 +1,75 @@ package request import ( + "net" + "net/url" + "strings" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" ) -// Retryer is an interface to control retry logic for a given service. -// The default implementation used by most services is the client.DefaultRetryer -// structure, which contains basic retry logic using exponential backoff. +// Retryer provides the interface drive the SDK's request retry behavior. The +// Retryer implementation is responsible for implementing exponential backoff, +// and determine if a request API error should be retried. +// +// client.DefaultRetryer is the SDK's default implementation of the Retryer. It +// uses the which uses the Request.IsErrorRetryable and Request.IsErrorThrottle +// methods to determine if the request is retried. type Retryer interface { + // RetryRules return the retry delay that should be used by the SDK before + // making another request attempt for the failed request. RetryRules(*Request) time.Duration + + // ShouldRetry returns if the failed request is retryable. + // + // Implementations may consider request attempt count when determining if a + // request is retryable, but the SDK will use MaxRetries to limit the + // number of attempts a request are made. ShouldRetry(*Request) bool + + // MaxRetries is the number of times a request may be retried before + // failing. MaxRetries() int } -// WithRetryer sets a config Retryer value to the given Config returning it -// for chaining. +// WithRetryer sets a Retryer value to the given Config returning the Config +// value for chaining. The value must not be nil. func WithRetryer(cfg *aws.Config, retryer Retryer) *aws.Config { + if retryer == nil { + if cfg.Logger != nil { + cfg.Logger.Log("ERROR: Request.WithRetryer called with nil retryer. Replacing with retry disabled Retryer.") + } + retryer = noOpRetryer{} + } cfg.Retryer = retryer return cfg + +} + +// noOpRetryer is a internal no op retryer used when a request is created +// without a retryer. +// +// Provides a retryer that performs no retries. +// It should be used when we do not want retries to be performed. +type noOpRetryer struct{} + +// MaxRetries returns the number of maximum returns the service will use to make +// an individual API; For NoOpRetryer the MaxRetries will always be zero. +func (d noOpRetryer) MaxRetries() int { + return 0 +} + +// ShouldRetry will always return false for NoOpRetryer, as it should never retry. +func (d noOpRetryer) ShouldRetry(_ *Request) bool { + return false +} + +// RetryRules returns the delay duration before retrying this request again; +// since NoOpRetryer does not retry, RetryRules always returns 0. +func (d noOpRetryer) RetryRules(_ *Request) time.Duration { + return 0 } // retryableCodes is a collection of service response codes which are retry-able @@ -34,6 +83,7 @@ var retryableCodes = map[string]struct{}{ var throttleCodes = map[string]struct{}{ "ProvisionedThroughputExceededException": {}, + "ThrottledException": {}, // SNS, XRay, ResourceGroupsTagging API "Throttling": {}, "ThrottlingException": {}, "RequestLimitExceeded": {}, @@ -76,10 +126,6 @@ var validParentCodes = map[string]struct{}{ ErrCodeRead: {}, } -type temporaryError interface { - Temporary() bool -} - func isNestedErrorRetryable(parentErr awserr.Error) bool { if parentErr == nil { return false @@ -98,7 +144,7 @@ func isNestedErrorRetryable(parentErr awserr.Error) bool { return isCodeRetryable(aerr.Code()) } - if t, ok := err.(temporaryError); ok { + if t, ok := err.(temporary); ok { return t.Temporary() || isErrConnectionReset(err) } @@ -108,32 +154,90 @@ func isNestedErrorRetryable(parentErr awserr.Error) bool { // IsErrorRetryable returns whether the error is retryable, based on its Code. // Returns false if error is nil. func IsErrorRetryable(err error) bool { - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - return isCodeRetryable(aerr.Code()) || isNestedErrorRetryable(aerr) + if err == nil { + return false + } + return shouldRetryError(err) +} + +type temporary interface { + Temporary() bool +} + +func shouldRetryError(origErr error) bool { + switch err := origErr.(type) { + case awserr.Error: + if err.Code() == CanceledErrorCode { + return false } + if isNestedErrorRetryable(err) { + return true + } + + origErr := err.OrigErr() + var shouldRetry bool + if origErr != nil { + shouldRetry := shouldRetryError(origErr) + if err.Code() == "RequestError" && !shouldRetry { + return false + } + } + if isCodeRetryable(err.Code()) { + return true + } + return shouldRetry + + case *url.Error: + if strings.Contains(err.Error(), "connection refused") { + // Refused connections should be retried as the service may not yet + // be running on the port. Go TCP dial considers refused + // connections as not temporary. + return true + } + // *url.Error only implements Temporary after golang 1.6 but since + // url.Error only wraps the error: + return shouldRetryError(err.Err) + + case temporary: + if netErr, ok := err.(*net.OpError); ok && netErr.Op == "dial" { + return true + } + // If the error is temporary, we want to allow continuation of the + // retry process + return err.Temporary() || isErrConnectionReset(origErr) + + case nil: + // `awserr.Error.OrigErr()` can be nil, meaning there was an error but + // because we don't know the cause, it is marked as retryable. See + // TestRequest4xxUnretryable for an example. + return true + + default: + switch err.Error() { + case "net/http: request canceled", + "net/http: request canceled while waiting for connection": + // known 1.5 error case when an http request is cancelled + return false + } + // here we don't know the error; so we allow a retry. + return true } - return false } // IsErrorThrottle returns whether the error is to be throttled based on its code. // Returns false if error is nil. func IsErrorThrottle(err error) bool { - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - return isCodeThrottle(aerr.Code()) - } + if aerr, ok := err.(awserr.Error); ok && aerr != nil { + return isCodeThrottle(aerr.Code()) } return false } -// IsErrorExpiredCreds returns whether the error code is a credential expiry error. -// Returns false if error is nil. +// IsErrorExpiredCreds returns whether the error code is a credential expiry +// error. Returns false if error is nil. func IsErrorExpiredCreds(err error) bool { - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - return isCodeExpiredCreds(aerr.Code()) - } + if aerr, ok := err.(awserr.Error); ok && aerr != nil { + return isCodeExpiredCreds(aerr.Code()) } return false } @@ -143,17 +247,58 @@ func IsErrorExpiredCreds(err error) bool { // // Alias for the utility function IsErrorRetryable func (r *Request) IsErrorRetryable() bool { + if isErrCode(r.Error, r.RetryErrorCodes) { + return true + } + + // HTTP response status code 501 should not be retried. + // 501 represents Not Implemented which means the request method is not + // supported by the server and cannot be handled. + if r.HTTPResponse != nil { + // HTTP response status code 500 represents internal server error and + // should be retried without any throttle. + if r.HTTPResponse.StatusCode == 500 { + return true + } + } return IsErrorRetryable(r.Error) } -// IsErrorThrottle returns whether the error is to be throttled based on its code. -// Returns false if the request has no Error set +// IsErrorThrottle returns whether the error is to be throttled based on its +// code. Returns false if the request has no Error set. // // Alias for the utility function IsErrorThrottle func (r *Request) IsErrorThrottle() bool { + if isErrCode(r.Error, r.ThrottleErrorCodes) { + return true + } + + if r.HTTPResponse != nil { + switch r.HTTPResponse.StatusCode { + case + 429, // error caused due to too many requests + 502, // Bad Gateway error should be throttled + 503, // caused when service is unavailable + 504: // error occurred due to gateway timeout + return true + } + } + return IsErrorThrottle(r.Error) } +func isErrCode(err error, codes []string) bool { + if aerr, ok := err.(awserr.Error); ok && aerr != nil { + for _, code := range codes { + if code == aerr.Code() { + return true + } + } + } + + return false +} + // IsErrorExpired returns whether the error code is a credential expiry error. // Returns false if the request has no Error set. // diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go b/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go index 9fd66368..cc64e24f 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go @@ -14,123 +14,176 @@ import ( "github.com/aws/aws-sdk-go/internal/shareddefaults" ) -// valid credential source values -const ( - credSourceEc2Metadata = "Ec2InstanceMetadata" - credSourceEnvironment = "Environment" - credSourceECSContainer = "EcsContainer" -) - func resolveCredentials(cfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig, handlers request.Handlers, sessOpts Options, ) (*credentials.Credentials, error) { - // Credentials from Assume Role with specific credentials source. - if envCfg.EnableSharedConfig && len(sharedCfg.AssumeRole.CredentialSource) > 0 { - return resolveCredsFromSource(cfg, envCfg, sharedCfg, handlers, sessOpts) - } - // Credentials from environment variables - if len(envCfg.Creds.AccessKeyID) > 0 { + switch { + case len(sessOpts.Profile) != 0: + // User explicitly provided an Profile in the session's configuration + // so load that profile from shared config first. + // Github(aws/aws-sdk-go#2727) + return resolveCredsFromProfile(cfg, envCfg, sharedCfg, handlers, sessOpts) + + case envCfg.Creds.HasKeys(): + // Environment credentials return credentials.NewStaticCredentialsFromCreds(envCfg.Creds), nil + + case len(envCfg.WebIdentityTokenFilePath) != 0: + // Web identity token from environment, RoleARN required to also be + // set. + return assumeWebIdentity(cfg, handlers, + envCfg.WebIdentityTokenFilePath, + envCfg.RoleARN, + envCfg.RoleSessionName, + ) + + default: + // Fallback to the "default" credential resolution chain. + return resolveCredsFromProfile(cfg, envCfg, sharedCfg, handlers, sessOpts) + } +} + +// WebIdentityEmptyRoleARNErr will occur if 'AWS_WEB_IDENTITY_TOKEN_FILE' was set but +// 'AWS_ROLE_ARN' was not set. +var WebIdentityEmptyRoleARNErr = awserr.New(stscreds.ErrCodeWebIdentity, "role ARN is not set", nil) + +// WebIdentityEmptyTokenFilePathErr will occur if 'AWS_ROLE_ARN' was set but +// 'AWS_WEB_IDENTITY_TOKEN_FILE' was not set. +var WebIdentityEmptyTokenFilePathErr = awserr.New(stscreds.ErrCodeWebIdentity, "token file path is not set", nil) + +func assumeWebIdentity(cfg *aws.Config, handlers request.Handlers, + filepath string, + roleARN, sessionName string, +) (*credentials.Credentials, error) { + + if len(filepath) == 0 { + return nil, WebIdentityEmptyTokenFilePathErr + } + + if len(roleARN) == 0 { + return nil, WebIdentityEmptyRoleARNErr } - // Fallback to the "default" credential resolution chain. - return resolveCredsFromProfile(cfg, envCfg, sharedCfg, handlers, sessOpts) + creds := stscreds.NewWebIdentityCredentials( + &Session{ + Config: cfg, + Handlers: handlers.Copy(), + }, + roleARN, + sessionName, + filepath, + ) + + return creds, nil } func resolveCredsFromProfile(cfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig, handlers request.Handlers, sessOpts Options, -) (*credentials.Credentials, error) { +) (creds *credentials.Credentials, err error) { - if envCfg.EnableSharedConfig && len(sharedCfg.AssumeRole.RoleARN) > 0 && sharedCfg.AssumeRoleSource != nil { + switch { + case sharedCfg.SourceProfile != nil: // Assume IAM role with credentials source from a different profile. - cred, err := resolveCredsFromProfile(cfg, envCfg, *sharedCfg.AssumeRoleSource, handlers, sessOpts) - if err != nil { - return nil, err - } + creds, err = resolveCredsFromProfile(cfg, envCfg, + *sharedCfg.SourceProfile, handlers, sessOpts, + ) - cfgCp := *cfg - cfgCp.Credentials = cred - return credsFromAssumeRole(cfgCp, handlers, sharedCfg, sessOpts) - - } else if len(sharedCfg.Creds.AccessKeyID) > 0 { + case sharedCfg.Creds.HasKeys(): // Static Credentials from Shared Config/Credentials file. - return credentials.NewStaticCredentialsFromCreds( + creds = credentials.NewStaticCredentialsFromCreds( sharedCfg.Creds, - ), nil + ) - } else if len(sharedCfg.CredentialProcess) > 0 { + case len(sharedCfg.CredentialProcess) != 0: // Get credentials from CredentialProcess - cred := processcreds.NewCredentials(sharedCfg.CredentialProcess) - // if RoleARN is provided, so the obtained cred from the Credential Process to assume the role using RoleARN - if len(sharedCfg.AssumeRole.RoleARN) > 0 { - cfgCp := *cfg - cfgCp.Credentials = cred - return credsFromAssumeRole(cfgCp, handlers, sharedCfg, sessOpts) - } - return cred, nil - } else if envCfg.EnableSharedConfig && len(sharedCfg.AssumeRole.CredentialSource) > 0 { - // Assume IAM Role with specific credential source. - return resolveCredsFromSource(cfg, envCfg, sharedCfg, handlers, sessOpts) - } + creds = processcreds.NewCredentials(sharedCfg.CredentialProcess) - // Fallback to default credentials provider, include mock errors - // for the credential chain so user can identify why credentials - // failed to be retrieved. - return credentials.NewCredentials(&credentials.ChainProvider{ - VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors), - Providers: []credentials.Provider{ - &credProviderError{ - Err: awserr.New("EnvAccessKeyNotFound", - "failed to find credentials in the environment.", nil), - }, - &credProviderError{ - Err: awserr.New("SharedCredsLoad", - fmt.Sprintf("failed to load profile, %s.", envCfg.Profile), nil), + case len(sharedCfg.CredentialSource) != 0: + creds, err = resolveCredsFromSource(cfg, envCfg, + sharedCfg, handlers, sessOpts, + ) + + case len(sharedCfg.WebIdentityTokenFile) != 0: + // Credentials from Assume Web Identity token require an IAM Role, and + // that roll will be assumed. May be wrapped with another assume role + // via SourceProfile. + return assumeWebIdentity(cfg, handlers, + sharedCfg.WebIdentityTokenFile, + sharedCfg.RoleARN, + sharedCfg.RoleSessionName, + ) + + default: + // Fallback to default credentials provider, include mock errors for + // the credential chain so user can identify why credentials failed to + // be retrieved. + creds = credentials.NewCredentials(&credentials.ChainProvider{ + VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors), + Providers: []credentials.Provider{ + &credProviderError{ + Err: awserr.New("EnvAccessKeyNotFound", + "failed to find credentials in the environment.", nil), + }, + &credProviderError{ + Err: awserr.New("SharedCredsLoad", + fmt.Sprintf("failed to load profile, %s.", envCfg.Profile), nil), + }, + defaults.RemoteCredProvider(*cfg, handlers), }, - defaults.RemoteCredProvider(*cfg, handlers), - }, - }), nil + }) + } + if err != nil { + return nil, err + } + + if len(sharedCfg.RoleARN) > 0 { + cfgCp := *cfg + cfgCp.Credentials = creds + return credsFromAssumeRole(cfgCp, handlers, sharedCfg, sessOpts) + } + + return creds, nil } +// valid credential source values +const ( + credSourceEc2Metadata = "Ec2InstanceMetadata" + credSourceEnvironment = "Environment" + credSourceECSContainer = "EcsContainer" +) + func resolveCredsFromSource(cfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig, handlers request.Handlers, sessOpts Options, -) (*credentials.Credentials, error) { - // if both credential_source and source_profile have been set, return an - // error as this is undefined behavior. Only one can be used at a time - // within a profile. - if len(sharedCfg.AssumeRole.SourceProfile) > 0 { - return nil, ErrSharedConfigSourceCollision - } +) (creds *credentials.Credentials, err error) { - cfgCp := *cfg - switch sharedCfg.AssumeRole.CredentialSource { + switch sharedCfg.CredentialSource { case credSourceEc2Metadata: - p := defaults.RemoteCredProvider(cfgCp, handlers) - cfgCp.Credentials = credentials.NewCredentials(p) + p := defaults.RemoteCredProvider(*cfg, handlers) + creds = credentials.NewCredentials(p) case credSourceEnvironment: - cfgCp.Credentials = credentials.NewStaticCredentialsFromCreds(envCfg.Creds) + creds = credentials.NewStaticCredentialsFromCreds(envCfg.Creds) case credSourceECSContainer: if len(os.Getenv(shareddefaults.ECSCredsProviderEnvVar)) == 0 { return nil, ErrSharedConfigECSContainerEnvVarEmpty } - p := defaults.RemoteCredProvider(cfgCp, handlers) - cfgCp.Credentials = credentials.NewCredentials(p) + p := defaults.RemoteCredProvider(*cfg, handlers) + creds = credentials.NewCredentials(p) default: return nil, ErrSharedConfigInvalidCredSource } - return credsFromAssumeRole(cfgCp, handlers, sharedCfg, sessOpts) + return creds, nil } func credsFromAssumeRole(cfg aws.Config, @@ -138,7 +191,8 @@ func credsFromAssumeRole(cfg aws.Config, sharedCfg sharedConfig, sessOpts Options, ) (*credentials.Credentials, error) { - if len(sharedCfg.AssumeRole.MFASerial) > 0 && sessOpts.AssumeRoleTokenProvider == nil { + + if len(sharedCfg.MFASerial) != 0 && sessOpts.AssumeRoleTokenProvider == nil { // AssumeRole Token provider is required if doing Assume Role // with MFA. return nil, AssumeRoleTokenProviderNotSetError{} @@ -149,28 +203,28 @@ func credsFromAssumeRole(cfg aws.Config, Config: &cfg, Handlers: handlers.Copy(), }, - sharedCfg.AssumeRole.RoleARN, + sharedCfg.RoleARN, func(opt *stscreds.AssumeRoleProvider) { - opt.RoleSessionName = sharedCfg.AssumeRole.RoleSessionName + opt.RoleSessionName = sharedCfg.RoleSessionName opt.Duration = sessOpts.AssumeRoleDuration // Assume role with external ID - if len(sharedCfg.AssumeRole.ExternalID) > 0 { - opt.ExternalID = aws.String(sharedCfg.AssumeRole.ExternalID) + if len(sharedCfg.ExternalID) > 0 { + opt.ExternalID = aws.String(sharedCfg.ExternalID) } // Assume role with MFA - if len(sharedCfg.AssumeRole.MFASerial) > 0 { - opt.SerialNumber = aws.String(sharedCfg.AssumeRole.MFASerial) + if len(sharedCfg.MFASerial) > 0 { + opt.SerialNumber = aws.String(sharedCfg.MFASerial) opt.TokenProvider = sessOpts.AssumeRoleTokenProvider } }, ), nil } -// AssumeRoleTokenProviderNotSetError is an error returned when creating a session when the -// MFAToken option is not set when shared config is configured load assume a -// role with an MFA token. +// AssumeRoleTokenProviderNotSetError is an error returned when creating a +// session when the MFAToken option is not set when shared config is configured +// load assume a role with an MFA token. type AssumeRoleTokenProviderNotSetError struct{} // Code is the short id of the error. @@ -197,8 +251,6 @@ type credProviderError struct { Err error } -var emptyCreds = credentials.Value{} - func (c credProviderError) Retrieve() (credentials.Value, error) { return credentials.Value{}, c.Err } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go index 38a7b05a..7ec66e7e 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go @@ -1,97 +1,93 @@ /* -Package session provides configuration for the SDK's service clients. - -Sessions can be shared across all service clients that share the same base -configuration. The Session is built from the SDK's default configuration and -request handlers. - -Sessions should be cached when possible, because creating a new Session will -load all configuration values from the environment, and config files each time -the Session is created. Sharing the Session value across all of your service -clients will ensure the configuration is loaded the fewest number of times possible. - -Concurrency +Package session provides configuration for the SDK's service clients. Sessions +can be shared across service clients that share the same base configuration. Sessions are safe to use concurrently as long as the Session is not being -modified. The SDK will not modify the Session once the Session has been created. -Creating service clients concurrently from a shared Session is safe. - -Sessions from Shared Config - -Sessions can be created using the method above that will only load the -additional config if the AWS_SDK_LOAD_CONFIG environment variable is set. -Alternatively you can explicitly create a Session with shared config enabled. -To do this you can use NewSessionWithOptions to configure how the Session will -be created. Using the NewSessionWithOptions with SharedConfigState set to -SharedConfigEnable will create the session as if the AWS_SDK_LOAD_CONFIG -environment variable was set. +modified. Sessions should be cached when possible, because creating a new +Session will load all configuration values from the environment, and config +files each time the Session is created. Sharing the Session value across all of +your service clients will ensure the configuration is loaded the fewest number +of times possible. -Creating Sessions - -When creating Sessions optional aws.Config values can be passed in that will -override the default, or loaded config values the Session is being created -with. This allows you to provide additional, or case based, configuration -as needed. +Sessions options from Shared Config By default NewSession will only load credentials from the shared credentials file (~/.aws/credentials). If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value the Session will be created from the configuration values from the shared config (~/.aws/config) and shared credentials -(~/.aws/credentials) files. See the section Sessions from Shared Config for -more information. +(~/.aws/credentials) files. Using the NewSessionWithOptions with +SharedConfigState set to SharedConfigEnable will create the session as if the +AWS_SDK_LOAD_CONFIG environment variable was set. -Create a Session with the default config and request handlers. With credentials -region, and profile loaded from the environment and shared config automatically. -Requires the AWS_PROFILE to be set, or "default" is used. +Credential and config loading order - // Create Session - sess := session.Must(session.NewSession()) +The Session will attempt to load configuration and credentials from the +environment, configuration files, and other credential sources. The order +configuration is loaded in is: - // Create a Session with a custom region - sess := session.Must(session.NewSession(&aws.Config{ - Region: aws.String("us-east-1"), - })) + * Environment Variables + * Shared Credentials file + * Shared Configuration file (if SharedConfig is enabled) + * EC2 Instance Metadata (credentials only) - // Create a S3 client instance from a session - sess := session.Must(session.NewSession()) +The Environment variables for credentials will have precedence over shared +config even if SharedConfig is enabled. To override this behavior, and use +shared config credentials instead specify the session.Options.Profile, (e.g. +when using credential_source=Environment to assume a role). + + sess, err := session.NewSessionWithOptions(session.Options{ + Profile: "myProfile", + }) - svc := s3.New(sess) +Creating Sessions -Create Session With Option Overrides +Creating a Session without additional options will load credentials region, and +profile loaded from the environment and shared config automatically. See, +"Environment Variables" section for information on environment variables used +by Session. -In addition to NewSession, Sessions can be created using NewSessionWithOptions. -This func allows you to control and override how the Session will be created -through code instead of being driven by environment variables only. + // Create Session + sess, err := session.NewSession() -Use NewSessionWithOptions when you want to provide the config profile, or -override the shared config state (AWS_SDK_LOAD_CONFIG). + +When creating Sessions optional aws.Config values can be passed in that will +override the default, or loaded, config values the Session is being created +with. This allows you to provide additional, or case based, configuration +as needed. + + // Create a Session with a custom region + sess, err := session.NewSession(&aws.Config{ + Region: aws.String("us-west-2"), + }) + +Use NewSessionWithOptions to provide additional configuration driving how the +Session's configuration will be loaded. Such as, specifying shared config +profile, or override the shared config state, (AWS_SDK_LOAD_CONFIG). // Equivalent to session.NewSession() - sess := session.Must(session.NewSessionWithOptions(session.Options{ + sess, err := session.NewSessionWithOptions(session.Options{ // Options - })) + }) - // Specify profile to load for the session's config - sess := session.Must(session.NewSessionWithOptions(session.Options{ - Profile: "profile_name", - })) + sess, err := session.NewSessionWithOptions(session.Options{ + // Specify profile to load for the session's config + Profile: "profile_name", - // Specify profile for config and region for requests - sess := session.Must(session.NewSessionWithOptions(session.Options{ - Config: aws.Config{Region: aws.String("us-east-1")}, - Profile: "profile_name", - })) + // Provide SDK Config options, such as Region. + Config: aws.Config{ + Region: aws.String("us-west-2"), + }, - // Force enable Shared Config support - sess := session.Must(session.NewSessionWithOptions(session.Options{ + // Force enable Shared Config support SharedConfigState: session.SharedConfigEnable, - })) + }) Adding Handlers -You can add handlers to a session for processing HTTP requests. All service -clients that use the session inherit the handlers. For example, the following -handler logs every request and its payload made by a service client: +You can add handlers to a session to decorate API operation, (e.g. adding HTTP +headers). All clients that use the Session receive a copy of the Session's +handlers. For example, the following request handler added to the Session logs +every requests made. // Create a session, and add additional handlers for all service // clients created with the Session to inherit. Adds logging handler. @@ -99,22 +95,15 @@ handler logs every request and its payload made by a service client: sess.Handlers.Send.PushFront(func(r *request.Request) { // Log every request made and its payload - logger.Printf("Request: %s/%s, Payload: %s", + logger.Printf("Request: %s/%s, Params: %s", r.ClientInfo.ServiceName, r.Operation, r.Params) }) -Deprecated "New" function - -The New session function has been deprecated because it does not provide good -way to return errors that occur when loading the configuration files and values. -Because of this, NewSession was created so errors can be retrieved when -creating a session fails. - Shared Config Fields -By default the SDK will only load the shared credentials file's (~/.aws/credentials) -credentials values, and all other config is provided by the environment variables, -SDK defaults, and user provided aws.Config values. +By default the SDK will only load the shared credentials file's +(~/.aws/credentials) credentials values, and all other config is provided by +the environment variables, SDK defaults, and user provided aws.Config values. If the AWS_SDK_LOAD_CONFIG environment variable is set, or SharedConfigEnable option is used to create the Session the full shared config values will be @@ -125,24 +114,31 @@ files have the same format. If both config files are present the configuration from both files will be read. The Session will be created from configuration values from the shared -credentials file (~/.aws/credentials) over those in the shared config file (~/.aws/config). +credentials file (~/.aws/credentials) over those in the shared config file +(~/.aws/config). -Credentials are the values the SDK should use for authenticating requests with -AWS Services. They are from a configuration file will need to include both -aws_access_key_id and aws_secret_access_key must be provided together in the -same file to be considered valid. The values will be ignored if not a complete -group. aws_session_token is an optional field that can be provided if both of -the other two fields are also provided. +Credentials are the values the SDK uses to authenticating requests with AWS +Services. When specified in a file, both aws_access_key_id and +aws_secret_access_key must be provided together in the same file to be +considered valid. They will be ignored if both are not present. +aws_session_token is an optional field that can be provided in addition to the +other two fields. aws_access_key_id = AKID aws_secret_access_key = SECRET aws_session_token = TOKEN -Assume Role values allow you to configure the SDK to assume an IAM role using -a set of credentials provided in a config file via the source_profile field. -Both "role_arn" and "source_profile" are required. The SDK supports assuming -a role with MFA token if the session option AssumeRoleTokenProvider -is set. + ; region only supported if SharedConfigEnabled. + region = us-east-1 + +Assume Role configuration + +The role_arn field allows you to configure the SDK to assume an IAM role using +a set of credentials from another source. Such as when paired with static +credentials, "profile_source", "credential_process", or "credential_source" +fields. If "role_arn" is provided, a source of credentials must also be +specified, such as "source_profile", "credential_source", or +"credential_process". role_arn = arn:aws:iam:::role/ source_profile = profile_with_creds @@ -150,40 +146,16 @@ is set. mfa_serial = role_session_name = session_name -Region is the region the SDK should use for looking up AWS service endpoints -and signing requests. - - region = us-east-1 - -Assume Role with MFA token -To create a session with support for assuming an IAM role with MFA set the -session option AssumeRoleTokenProvider to a function that will prompt for the -MFA token code when the SDK assumes the role and refreshes the role's credentials. -This allows you to configure the SDK via the shared config to assumea role -with MFA tokens. - -In order for the SDK to assume a role with MFA the SharedConfigState -session option must be set to SharedConfigEnable, or AWS_SDK_LOAD_CONFIG -environment variable set. - -The shared configuration instructs the SDK to assume an IAM role with MFA -when the mfa_serial configuration field is set in the shared config -(~/.aws/config) or shared credentials (~/.aws/credentials) file. - -If mfa_serial is set in the configuration, the SDK will assume the role, and -the AssumeRoleTokenProvider session option is not set an an error will -be returned when creating the session. +The SDK supports assuming a role with MFA token. If "mfa_serial" is set, you +must also set the Session Option.AssumeRoleTokenProvider. The Session will fail +to load if the AssumeRoleTokenProvider is not specified. sess := session.Must(session.NewSessionWithOptions(session.Options{ AssumeRoleTokenProvider: stscreds.StdinTokenProvider, })) - // Create service client value configured for credentials - // from assumed role. - svc := s3.New(sess) - -To setup assume role outside of a session see the stscreds.AssumeRoleProvider +To setup Assume Role outside of a session see the stscreds.AssumeRoleProvider documentation. Environment Variables diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go index cdb42497..c1e0e9c9 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go @@ -1,12 +1,15 @@ package session import ( + "fmt" "os" "strconv" + "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/defaults" + "github.com/aws/aws-sdk-go/aws/endpoints" ) // EnvProviderName provides a name of the provider when config is loaded from environment. @@ -99,16 +102,52 @@ type envConfig struct { CustomCABundle string csmEnabled string - CSMEnabled bool + CSMEnabled *bool CSMPort string - CSMClientID string CSMHost string + CSMClientID string - enableEndpointDiscovery string // Enables endpoint discovery via environment variables. // // AWS_ENABLE_ENDPOINT_DISCOVERY=true EnableEndpointDiscovery *bool + enableEndpointDiscovery string + + // Specifies the WebIdentity token the SDK should use to assume a role + // with. + // + // AWS_WEB_IDENTITY_TOKEN_FILE=file_path + WebIdentityTokenFilePath string + + // Specifies the IAM role arn to use when assuming an role. + // + // AWS_ROLE_ARN=role_arn + RoleARN string + + // Specifies the IAM role session name to use when assuming a role. + // + // AWS_ROLE_SESSION_NAME=session_name + RoleSessionName string + + // Specifies the STS Regional Endpoint flag for the SDK to resolve the endpoint + // for a service. + // + // AWS_STS_REGIONAL_ENDPOINTS=regional + // This can take value as `regional` or `legacy` + STSRegionalEndpoint endpoints.STSRegionalEndpoint + + // Specifies the S3 Regional Endpoint flag for the SDK to resolve the + // endpoint for a service. + // + // AWS_S3_US_EAST_1_REGIONAL_ENDPOINT=regional + // This can take value as `regional` or `legacy` + S3UsEast1RegionalEndpoint endpoints.S3UsEast1RegionalEndpoint + + // Specifies if the S3 service should allow ARNs to direct the region + // the client's requests are sent to. + // + // AWS_S3_USE_ARN_REGION=true + S3UseARNRegion bool } var ( @@ -154,6 +193,24 @@ var ( sharedConfigFileEnvKey = []string{ "AWS_CONFIG_FILE", } + webIdentityTokenFilePathEnvKey = []string{ + "AWS_WEB_IDENTITY_TOKEN_FILE", + } + roleARNEnvKey = []string{ + "AWS_ROLE_ARN", + } + roleSessionNameEnvKey = []string{ + "AWS_ROLE_SESSION_NAME", + } + stsRegionalEndpointKey = []string{ + "AWS_STS_REGIONAL_ENDPOINTS", + } + s3UsEast1RegionalEndpoint = []string{ + "AWS_S3_US_EAST_1_REGIONAL_ENDPOINT", + } + s3UseARNRegionEnvKey = []string{ + "AWS_S3_USE_ARN_REGION", + } ) // loadEnvConfig retrieves the SDK's environment configuration. @@ -162,7 +219,7 @@ var ( // If the environment variable `AWS_SDK_LOAD_CONFIG` is set to a truthy value // the shared SDK config will be loaded in addition to the SDK's specific // configuration values. -func loadEnvConfig() envConfig { +func loadEnvConfig() (envConfig, error) { enableSharedConfig, _ := strconv.ParseBool(os.Getenv("AWS_SDK_LOAD_CONFIG")) return envConfigLoad(enableSharedConfig) } @@ -173,31 +230,42 @@ func loadEnvConfig() envConfig { // Loads the shared configuration in addition to the SDK's specific configuration. // This will load the same values as `loadEnvConfig` if the `AWS_SDK_LOAD_CONFIG` // environment variable is set. -func loadSharedEnvConfig() envConfig { +func loadSharedEnvConfig() (envConfig, error) { return envConfigLoad(true) } -func envConfigLoad(enableSharedConfig bool) envConfig { +func envConfigLoad(enableSharedConfig bool) (envConfig, error) { cfg := envConfig{} cfg.EnableSharedConfig = enableSharedConfig - setFromEnvVal(&cfg.Creds.AccessKeyID, credAccessEnvKey) - setFromEnvVal(&cfg.Creds.SecretAccessKey, credSecretEnvKey) - setFromEnvVal(&cfg.Creds.SessionToken, credSessionEnvKey) + // Static environment credentials + var creds credentials.Value + setFromEnvVal(&creds.AccessKeyID, credAccessEnvKey) + setFromEnvVal(&creds.SecretAccessKey, credSecretEnvKey) + setFromEnvVal(&creds.SessionToken, credSessionEnvKey) + if creds.HasKeys() { + // Require logical grouping of credentials + creds.ProviderName = EnvProviderName + cfg.Creds = creds + } + + // Role Metadata + setFromEnvVal(&cfg.RoleARN, roleARNEnvKey) + setFromEnvVal(&cfg.RoleSessionName, roleSessionNameEnvKey) + + // Web identity environment variables + setFromEnvVal(&cfg.WebIdentityTokenFilePath, webIdentityTokenFilePathEnvKey) // CSM environment variables setFromEnvVal(&cfg.csmEnabled, csmEnabledEnvKey) setFromEnvVal(&cfg.CSMHost, csmHostEnvKey) setFromEnvVal(&cfg.CSMPort, csmPortEnvKey) setFromEnvVal(&cfg.CSMClientID, csmClientIDEnvKey) - cfg.CSMEnabled = len(cfg.csmEnabled) > 0 - // Require logical grouping of credentials - if len(cfg.Creds.AccessKeyID) == 0 || len(cfg.Creds.SecretAccessKey) == 0 { - cfg.Creds = credentials.Value{} - } else { - cfg.Creds.ProviderName = EnvProviderName + if len(cfg.csmEnabled) != 0 { + v, _ := strconv.ParseBool(cfg.csmEnabled) + cfg.CSMEnabled = &v } regionKeys := regionEnvKeys @@ -228,12 +296,48 @@ func envConfigLoad(enableSharedConfig bool) envConfig { cfg.CustomCABundle = os.Getenv("AWS_CA_BUNDLE") - return cfg + var err error + // STS Regional Endpoint variable + for _, k := range stsRegionalEndpointKey { + if v := os.Getenv(k); len(v) != 0 { + cfg.STSRegionalEndpoint, err = endpoints.GetSTSRegionalEndpoint(v) + if err != nil { + return cfg, fmt.Errorf("failed to load, %v from env config, %v", k, err) + } + } + } + + // S3 Regional Endpoint variable + for _, k := range s3UsEast1RegionalEndpoint { + if v := os.Getenv(k); len(v) != 0 { + cfg.S3UsEast1RegionalEndpoint, err = endpoints.GetS3UsEast1RegionalEndpoint(v) + if err != nil { + return cfg, fmt.Errorf("failed to load, %v from env config, %v", k, err) + } + } + } + + var s3UseARNRegion string + setFromEnvVal(&s3UseARNRegion, s3UseARNRegionEnvKey) + if len(s3UseARNRegion) != 0 { + switch { + case strings.EqualFold(s3UseARNRegion, "false"): + cfg.S3UseARNRegion = false + case strings.EqualFold(s3UseARNRegion, "true"): + cfg.S3UseARNRegion = true + default: + return envConfig{}, fmt.Errorf( + "invalid value for environment variable, %s=%s, need true or false", + s3UseARNRegionEnvKey[0], s3UseARNRegion) + } + } + + return cfg, nil } func setFromEnvVal(dst *string, keys []string) { for _, k := range keys { - if v := os.Getenv(k); len(v) > 0 { + if v := os.Getenv(k); len(v) != 0 { *dst = v break } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go index 5da98abe..915e62cd 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go @@ -73,7 +73,7 @@ type Session struct { // func is called instead of waiting to receive an error until a request is made. func New(cfgs ...*aws.Config) *Session { // load initial config from environment - envCfg := loadEnvConfig() + envCfg, envErr := loadEnvConfig() if envCfg.EnableSharedConfig { var cfg aws.Config @@ -93,26 +93,27 @@ func New(cfgs ...*aws.Config) *Session { // Session creation failed, need to report the error and prevent // any requests from succeeding. s = &Session{Config: defaults.Config()} - s.Config.MergeIn(cfgs...) - s.Config.Logger.Log("ERROR:", msg, "Error:", err) - s.Handlers.Validate.PushBack(func(r *request.Request) { - r.Error = err - }) + s.logDeprecatedNewSessionError(msg, err, cfgs) } return s } s := deprecatedNewSession(cfgs...) - if envCfg.CSMEnabled { - err := enableCSM(&s.Handlers, envCfg.CSMClientID, - envCfg.CSMHost, envCfg.CSMPort, s.Config.Logger) + if envErr != nil { + msg := "failed to load env config" + s.logDeprecatedNewSessionError(msg, envErr, cfgs) + } + + if csmCfg, err := loadCSMConfig(envCfg, []string{}); err != nil { + if l := s.Config.Logger; l != nil { + l.Log(fmt.Sprintf("ERROR: failed to load CSM configuration, %v", err)) + } + } else if csmCfg.Enabled { + err := enableCSM(&s.Handlers, csmCfg, s.Config.Logger) if err != nil { - err = fmt.Errorf("failed to enable CSM, %v", err) - s.Config.Logger.Log("ERROR:", err.Error()) - s.Handlers.Validate.PushBack(func(r *request.Request) { - r.Error = err - }) + msg := "failed to enable CSM" + s.logDeprecatedNewSessionError(msg, err, cfgs) } } @@ -132,7 +133,7 @@ func New(cfgs ...*aws.Config) *Session { // to be built with retrieving credentials with AssumeRole set in the config. // // See the NewSessionWithOptions func for information on how to override or -// control through code how the Session will be created. Such as specifying the +// control through code how the Session will be created, such as specifying the // config profile, and controlling if shared config is enabled or not. func NewSession(cfgs ...*aws.Config) (*Session, error) { opts := Options{} @@ -275,13 +276,20 @@ type Options struct { // })) func NewSessionWithOptions(opts Options) (*Session, error) { var envCfg envConfig + var err error if opts.SharedConfigState == SharedConfigEnable { - envCfg = loadSharedEnvConfig() + envCfg, err = loadSharedEnvConfig() + if err != nil { + return nil, fmt.Errorf("failed to load shared config, %v", err) + } } else { - envCfg = loadEnvConfig() + envCfg, err = loadEnvConfig() + if err != nil { + return nil, fmt.Errorf("failed to load environment config, %v", err) + } } - if len(opts.Profile) > 0 { + if len(opts.Profile) != 0 { envCfg.Profile = opts.Profile } @@ -347,15 +355,12 @@ func deprecatedNewSession(cfgs ...*aws.Config) *Session { return s } -func enableCSM(handlers *request.Handlers, - clientID, host, port string, - logger aws.Logger, -) error { +func enableCSM(handlers *request.Handlers, cfg csmConfig, logger aws.Logger) error { if logger != nil { logger.Log("Enabling CSM") } - r, err := csm.Start(clientID, csm.AddressWithDefaults(host, port)) + r, err := csm.Start(cfg.ClientID, csm.AddressWithDefaults(cfg.Host, cfg.Port)) if err != nil { return err } @@ -376,6 +381,7 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, // credentials were. userCfg := &aws.Config{} userCfg.MergeIn(cfgs...) + cfg.MergeIn(userCfg) // Ordered config files will be loaded in with later files overwriting // previous config file values. @@ -392,9 +398,17 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, } // Load additional config from file(s) - sharedCfg, err := loadSharedConfig(envCfg.Profile, cfgFiles) + sharedCfg, err := loadSharedConfig(envCfg.Profile, cfgFiles, envCfg.EnableSharedConfig) if err != nil { - return nil, err + if len(envCfg.Profile) == 0 && !envCfg.EnableSharedConfig && (envCfg.Creds.HasKeys() || userCfg.Credentials != nil) { + // Special case where the user has not explicitly specified an AWS_PROFILE, + // or session.Options.profile, shared config is not enabled, and the + // environment has credentials, allow the shared config file to fail to + // load since the user has already provided credentials, and nothing else + // is required to be read file. Github(aws/aws-sdk-go#2455) + } else if _, ok := err.(SharedConfigProfileNotExistsError); !ok { + return nil, err + } } if err := mergeConfigSrcs(cfg, userCfg, envCfg, sharedCfg, handlers, opts); err != nil { @@ -407,9 +421,13 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, } initHandlers(s) - if envCfg.CSMEnabled { - err := enableCSM(&s.Handlers, envCfg.CSMClientID, - envCfg.CSMHost, envCfg.CSMPort, s.Config.Logger) + + if csmCfg, err := loadCSMConfig(envCfg, cfgFiles); err != nil { + if l := s.Config.Logger; l != nil { + l.Log(fmt.Sprintf("ERROR: failed to load CSM configuration, %v", err)) + } + } else if csmCfg.Enabled { + err = enableCSM(&s.Handlers, csmCfg, s.Config.Logger) if err != nil { return nil, err } @@ -425,6 +443,46 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, return s, nil } +type csmConfig struct { + Enabled bool + Host string + Port string + ClientID string +} + +var csmProfileName = "aws_csm" + +func loadCSMConfig(envCfg envConfig, cfgFiles []string) (csmConfig, error) { + if envCfg.CSMEnabled != nil { + if *envCfg.CSMEnabled { + return csmConfig{ + Enabled: true, + ClientID: envCfg.CSMClientID, + Host: envCfg.CSMHost, + Port: envCfg.CSMPort, + }, nil + } + return csmConfig{}, nil + } + + sharedCfg, err := loadSharedConfig(csmProfileName, cfgFiles, false) + if err != nil { + if _, ok := err.(SharedConfigProfileNotExistsError); !ok { + return csmConfig{}, err + } + } + if sharedCfg.CSMEnabled != nil && *sharedCfg.CSMEnabled == true { + return csmConfig{ + Enabled: true, + ClientID: sharedCfg.CSMClientID, + Host: sharedCfg.CSMHost, + Port: sharedCfg.CSMPort, + }, nil + } + + return csmConfig{}, nil +} + func loadCustomCABundle(s *Session, bundle io.Reader) error { var t *http.Transport switch v := s.Config.HTTPClient.Transport.(type) { @@ -478,8 +536,6 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, handlers request.Handlers, sessOpts Options, ) error { - // Merge in user provided configuration - cfg.MergeIn(userCfg) // Region if not already set by user if len(aws.StringValue(cfg.Region)) == 0 { @@ -498,6 +554,22 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, } } + // Regional Endpoint flag for STS endpoint resolving + mergeSTSRegionalEndpointConfig(cfg, []endpoints.STSRegionalEndpoint{ + userCfg.STSRegionalEndpoint, + envCfg.STSRegionalEndpoint, + sharedCfg.STSRegionalEndpoint, + endpoints.LegacySTSEndpoint, + }) + + // Regional Endpoint flag for S3 endpoint resolving + mergeS3UsEast1RegionalEndpointConfig(cfg, []endpoints.S3UsEast1RegionalEndpoint{ + userCfg.S3UsEast1RegionalEndpoint, + envCfg.S3UsEast1RegionalEndpoint, + sharedCfg.S3UsEast1RegionalEndpoint, + endpoints.LegacyS3UsEast1Endpoint, + }) + // Configure credentials if not already set by the user when creating the // Session. if cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil { @@ -508,9 +580,35 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, cfg.Credentials = creds } + cfg.S3UseARNRegion = userCfg.S3UseARNRegion + if cfg.S3UseARNRegion == nil { + cfg.S3UseARNRegion = &envCfg.S3UseARNRegion + } + if cfg.S3UseARNRegion == nil { + cfg.S3UseARNRegion = &sharedCfg.S3UseARNRegion + } + return nil } +func mergeSTSRegionalEndpointConfig(cfg *aws.Config, values []endpoints.STSRegionalEndpoint) { + for _, v := range values { + if v != endpoints.UnsetSTSEndpoint { + cfg.STSRegionalEndpoint = v + break + } + } +} + +func mergeS3UsEast1RegionalEndpointConfig(cfg *aws.Config, values []endpoints.S3UsEast1RegionalEndpoint) { + for _, v := range values { + if v != endpoints.UnsetS3UsEast1Endpoint { + cfg.S3UsEast1RegionalEndpoint = v + break + } + } +} + func initHandlers(s *Session) { // Add the Validate parameter handler if it is not disabled. s.Handlers.Validate.Remove(corehandlers.ValidateParametersHandler) @@ -519,7 +617,7 @@ func initHandlers(s *Session) { } } -// Copy creates and returns a copy of the current Session, coping the config +// Copy creates and returns a copy of the current Session, copying the config // and handlers. If any additional configs are provided they will be merged // on top of the Session's copied config. // @@ -539,47 +637,61 @@ func (s *Session) Copy(cfgs ...*aws.Config) *Session { // ClientConfig satisfies the client.ConfigProvider interface and is used to // configure the service client instances. Passing the Session to the service // client's constructor (New) will use this method to configure the client. -func (s *Session) ClientConfig(serviceName string, cfgs ...*aws.Config) client.Config { - // Backwards compatibility, the error will be eaten if user calls ClientConfig - // directly. All SDK services will use ClientconfigWithError. - cfg, _ := s.clientConfigWithErr(serviceName, cfgs...) - - return cfg -} - -func (s *Session) clientConfigWithErr(serviceName string, cfgs ...*aws.Config) (client.Config, error) { +func (s *Session) ClientConfig(service string, cfgs ...*aws.Config) client.Config { s = s.Copy(cfgs...) - var resolved endpoints.ResolvedEndpoint - var err error - region := aws.StringValue(s.Config.Region) - - if endpoint := aws.StringValue(s.Config.Endpoint); len(endpoint) != 0 { - resolved.URL = endpoints.AddScheme(endpoint, aws.BoolValue(s.Config.DisableSSL)) - resolved.SigningRegion = region - } else { - resolved, err = s.Config.EndpointResolver.EndpointFor( - serviceName, region, - func(opt *endpoints.Options) { - opt.DisableSSL = aws.BoolValue(s.Config.DisableSSL) - opt.UseDualStack = aws.BoolValue(s.Config.UseDualStack) - - // Support the condition where the service is modeled but its - // endpoint metadata is not available. - opt.ResolveUnknownService = true - }, - ) + resolved, err := s.resolveEndpoint(service, region, s.Config) + if err != nil && s.Config.Logger != nil { + s.Config.Logger.Log(fmt.Sprintf( + "ERROR: unable to resolve endpoint for service %q, region %q, err: %v", + service, region, err)) } return client.Config{ Config: s.Config, Handlers: s.Handlers, + PartitionID: resolved.PartitionID, Endpoint: resolved.URL, SigningRegion: resolved.SigningRegion, SigningNameDerived: resolved.SigningNameDerived, SigningName: resolved.SigningName, - }, err + } +} + +func (s *Session) resolveEndpoint(service, region string, cfg *aws.Config) (endpoints.ResolvedEndpoint, error) { + + if ep := aws.StringValue(cfg.Endpoint); len(ep) != 0 { + return endpoints.ResolvedEndpoint{ + URL: endpoints.AddScheme(ep, aws.BoolValue(cfg.DisableSSL)), + SigningRegion: region, + }, nil + } + + resolved, err := cfg.EndpointResolver.EndpointFor(service, region, + func(opt *endpoints.Options) { + opt.DisableSSL = aws.BoolValue(cfg.DisableSSL) + opt.UseDualStack = aws.BoolValue(cfg.UseDualStack) + // Support for STSRegionalEndpoint where the STSRegionalEndpoint is + // provided in envConfig or sharedConfig with envConfig getting + // precedence. + opt.STSRegionalEndpoint = cfg.STSRegionalEndpoint + + // Support for S3UsEast1RegionalEndpoint where the S3UsEast1RegionalEndpoint is + // provided in envConfig or sharedConfig with envConfig getting + // precedence. + opt.S3UsEast1RegionalEndpoint = cfg.S3UsEast1RegionalEndpoint + + // Support the condition where the service is modeled but its + // endpoint metadata is not available. + opt.ResolveUnknownService = true + }, + ) + if err != nil { + return endpoints.ResolvedEndpoint{}, err + } + + return resolved, nil } // ClientConfigNoResolveEndpoint is the same as ClientConfig with the exception @@ -589,12 +701,9 @@ func (s *Session) ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) client.Conf s = s.Copy(cfgs...) var resolved endpoints.ResolvedEndpoint - - region := aws.StringValue(s.Config.Region) - if ep := aws.StringValue(s.Config.Endpoint); len(ep) > 0 { resolved.URL = endpoints.AddScheme(ep, aws.BoolValue(s.Config.DisableSSL)) - resolved.SigningRegion = region + resolved.SigningRegion = aws.StringValue(s.Config.Region) } return client.Config{ @@ -606,3 +715,14 @@ func (s *Session) ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) client.Conf SigningName: resolved.SigningName, } } + +// logDeprecatedNewSessionError function enables error handling for session +func (s *Session) logDeprecatedNewSessionError(msg string, err error, cfgs []*aws.Config) { + // Session creation failed, need to report the error and prevent + // any requests from succeeding. + s.Config.MergeIn(cfgs...) + s.Config.Logger.Log("ERROR:", msg, "Error:", err) + s.Handlers.Validate.PushBack(func(r *request.Request) { + r.Error = err + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go index 324927f5..a8ed8807 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go @@ -5,6 +5,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/internal/ini" ) @@ -22,50 +23,66 @@ const ( mfaSerialKey = `mfa_serial` // optional roleSessionNameKey = `role_session_name` // optional + // CSM options + csmEnabledKey = `csm_enabled` + csmHostKey = `csm_host` + csmPortKey = `csm_port` + csmClientIDKey = `csm_client_id` + // Additional Config fields regionKey = `region` // endpoint discovery group enableEndpointDiscoveryKey = `endpoint_discovery_enabled` // optional + // External Credential Process - credentialProcessKey = `credential_process` + credentialProcessKey = `credential_process` // optional + + // Web Identity Token File + webIdentityTokenFileKey = `web_identity_token_file` // optional + + // Additional config fields for regional or legacy endpoints + stsRegionalEndpointSharedKey = `sts_regional_endpoints` + + // Additional config fields for regional or legacy endpoints + s3UsEast1RegionalSharedKey = `s3_us_east_1_regional_endpoint` // DefaultSharedConfigProfile is the default profile to be used when // loading configuration from the config files if another profile name // is not provided. DefaultSharedConfigProfile = `default` -) -type assumeRoleConfig struct { - RoleARN string - SourceProfile string - CredentialSource string - ExternalID string - MFASerial string - RoleSessionName string -} + // S3 ARN Region Usage + s3UseARNRegionKey = "s3_use_arn_region" +) // sharedConfig represents the configuration fields of the SDK config files. type sharedConfig struct { - // Credentials values from the config file. Both aws_access_key_id - // and aws_secret_access_key must be provided together in the same file - // to be considered valid. The values will be ignored if not a complete group. - // aws_session_token is an optional field that can be provided if both of the - // other two fields are also provided. + // Credentials values from the config file. Both aws_access_key_id and + // aws_secret_access_key must be provided together in the same file to be + // considered valid. The values will be ignored if not a complete group. + // aws_session_token is an optional field that can be provided if both of + // the other two fields are also provided. // // aws_access_key_id // aws_secret_access_key // aws_session_token Creds credentials.Value - AssumeRole assumeRoleConfig - AssumeRoleSource *sharedConfig + CredentialSource string + CredentialProcess string + WebIdentityTokenFile string - // An external process to request credentials - CredentialProcess string + RoleARN string + RoleSessionName string + ExternalID string + MFASerial string - // Region is the region the SDK should use for looking up AWS service endpoints - // and signing requests. + SourceProfileName string + SourceProfile *sharedConfig + + // Region is the region the SDK should use for looking up AWS service + // endpoints and signing requests. // // region Region string @@ -75,6 +92,30 @@ type sharedConfig struct { // // endpoint_discovery_enabled = true EnableEndpointDiscovery *bool + + // CSM Options + CSMEnabled *bool + CSMHost string + CSMPort string + CSMClientID string + + // Specifies the Regional Endpoint flag for the SDK to resolve the endpoint for a service + // + // sts_regional_endpoints = regional + // This can take value as `LegacySTSEndpoint` or `RegionalSTSEndpoint` + STSRegionalEndpoint endpoints.STSRegionalEndpoint + + // Specifies the Regional Endpoint flag for the SDK to resolve the endpoint for a service + // + // s3_us_east_1_regional_endpoint = regional + // This can take value as `LegacyS3UsEast1Endpoint` or `RegionalS3UsEast1Endpoint` + S3UsEast1RegionalEndpoint endpoints.S3UsEast1RegionalEndpoint + + // Specifies if the S3 service should allow ARNs to direct the region + // the client's requests are sent to. + // + // s3_use_arn_region=true + S3UseARNRegion bool } type sharedConfigFile struct { @@ -82,17 +123,18 @@ type sharedConfigFile struct { IniData ini.Sections } -// loadSharedConfig retrieves the configuration from the list of files -// using the profile provided. The order the files are listed will determine +// loadSharedConfig retrieves the configuration from the list of files using +// the profile provided. The order the files are listed will determine // precedence. Values in subsequent files will overwrite values defined in // earlier files. // // For example, given two files A and B. Both define credentials. If the order -// of the files are A then B, B's credential values will be used instead of A's. +// of the files are A then B, B's credential values will be used instead of +// A's. // // See sharedConfig.setFromFile for information how the config files // will be loaded. -func loadSharedConfig(profile string, filenames []string) (sharedConfig, error) { +func loadSharedConfig(profile string, filenames []string, exOpts bool) (sharedConfig, error) { if len(profile) == 0 { profile = DefaultSharedConfigProfile } @@ -103,16 +145,11 @@ func loadSharedConfig(profile string, filenames []string) (sharedConfig, error) } cfg := sharedConfig{} - if err = cfg.setFromIniFiles(profile, files); err != nil { + profiles := map[string]struct{}{} + if err = cfg.setFromIniFiles(profiles, profile, files, exOpts); err != nil { return sharedConfig{}, err } - if len(cfg.AssumeRole.SourceProfile) > 0 { - if err := cfg.setAssumeRoleSource(profile, files); err != nil { - return sharedConfig{}, err - } - } - return cfg, nil } @@ -136,71 +173,88 @@ func loadSharedConfigIniFiles(filenames []string) ([]sharedConfigFile, error) { return files, nil } -func (cfg *sharedConfig) setAssumeRoleSource(origProfile string, files []sharedConfigFile) error { - var assumeRoleSrc sharedConfig - - if len(cfg.AssumeRole.CredentialSource) > 0 { - // setAssumeRoleSource is only called when source_profile is found. - // If both source_profile and credential_source are set, then - // ErrSharedConfigSourceCollision will be returned - return ErrSharedConfigSourceCollision +func (cfg *sharedConfig) setFromIniFiles(profiles map[string]struct{}, profile string, files []sharedConfigFile, exOpts bool) error { + // Trim files from the list that don't exist. + var skippedFiles int + var profileNotFoundErr error + for _, f := range files { + if err := cfg.setFromIniFile(profile, f, exOpts); err != nil { + if _, ok := err.(SharedConfigProfileNotExistsError); ok { + // Ignore profiles not defined in individual files. + profileNotFoundErr = err + skippedFiles++ + continue + } + return err + } + } + if skippedFiles == len(files) { + // If all files were skipped because the profile is not found, return + // the original profile not found error. + return profileNotFoundErr } - // Multiple level assume role chains are not support - if cfg.AssumeRole.SourceProfile == origProfile { - assumeRoleSrc = *cfg - assumeRoleSrc.AssumeRole = assumeRoleConfig{} + if _, ok := profiles[profile]; ok { + // if this is the second instance of the profile the Assume Role + // options must be cleared because they are only valid for the + // first reference of a profile. The self linked instance of the + // profile only have credential provider options. + cfg.clearAssumeRoleOptions() } else { - err := assumeRoleSrc.setFromIniFiles(cfg.AssumeRole.SourceProfile, files) - if err != nil { + // First time a profile has been seen, It must either be a assume role + // or credentials. Assert if the credential type requires a role ARN, + // the ARN is also set. + if err := cfg.validateCredentialsRequireARN(profile); err != nil { return err } - - // Chain if profile depends of other profiles - if len(assumeRoleSrc.AssumeRole.SourceProfile) > 0 { - err := assumeRoleSrc.setAssumeRoleSource(cfg.AssumeRole.SourceProfile, files) - if err != nil { - return err - } - } } + profiles[profile] = struct{}{} - if cfg.AssumeRole.SourceProfile == origProfile || len(assumeRoleSrc.AssumeRole.SourceProfile) == 0 { - //Check if at least either Credential Source, static creds, or credential process is set to retain credentials. - if len(assumeRoleSrc.AssumeRole.CredentialSource) == 0 && len(assumeRoleSrc.Creds.AccessKeyID) == 0 && len(assumeRoleSrc.CredentialProcess) == 0 { - return SharedConfigAssumeRoleError{RoleARN: cfg.AssumeRole.RoleARN} - } + if err := cfg.validateCredentialType(); err != nil { + return err } - cfg.AssumeRoleSource = &assumeRoleSrc - - return nil -} + // Link source profiles for assume roles + if len(cfg.SourceProfileName) != 0 { + // Linked profile via source_profile ignore credential provider + // options, the source profile must provide the credentials. + cfg.clearCredentialOptions() -func (cfg *sharedConfig) setFromIniFiles(profile string, files []sharedConfigFile) error { - // Trim files from the list that don't exist. - for _, f := range files { - if err := cfg.setFromIniFile(profile, f); err != nil { + srcCfg := &sharedConfig{} + err := srcCfg.setFromIniFiles(profiles, cfg.SourceProfileName, files, exOpts) + if err != nil { + // SourceProfile that doesn't exist is an error in configuration. if _, ok := err.(SharedConfigProfileNotExistsError); ok { - // Ignore proviles missings - continue + err = SharedConfigAssumeRoleError{ + RoleARN: cfg.RoleARN, + SourceProfile: cfg.SourceProfileName, + } } return err } + + if !srcCfg.hasCredentials() { + return SharedConfigAssumeRoleError{ + RoleARN: cfg.RoleARN, + SourceProfile: cfg.SourceProfileName, + } + } + + cfg.SourceProfile = srcCfg } return nil } -// setFromFile loads the configuration from the file using -// the profile provided. A sharedConfig pointer type value is used so that -// multiple config file loadings can be chained. +// setFromFile loads the configuration from the file using the profile +// provided. A sharedConfig pointer type value is used so that multiple config +// file loadings can be chained. // // Only loads complete logically grouped values, and will not set fields in cfg -// for incomplete grouped values in the config. Such as credentials. For example -// if a config file only includes aws_access_key_id but no aws_secret_access_key -// the aws_access_key_id will be ignored. -func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile) error { +// for incomplete grouped values in the config. Such as credentials. For +// example if a config file only includes aws_access_key_id but no +// aws_secret_access_key the aws_access_key_id will be ignored. +func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile, exOpts bool) error { section, ok := file.IniData.GetSection(profile) if !ok { // Fallback to to alternate profile name: profile @@ -210,55 +264,171 @@ func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile) e } } - // Shared Credentials - akid := section.String(accessKeyIDKey) - secret := section.String(secretAccessKey) - if len(akid) > 0 && len(secret) > 0 { - cfg.Creds = credentials.Value{ - AccessKeyID: akid, - SecretAccessKey: secret, - SessionToken: section.String(sessionTokenKey), - ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", file.Filename), + if exOpts { + // Assume Role Parameters + updateString(&cfg.RoleARN, section, roleArnKey) + updateString(&cfg.ExternalID, section, externalIDKey) + updateString(&cfg.MFASerial, section, mfaSerialKey) + updateString(&cfg.RoleSessionName, section, roleSessionNameKey) + updateString(&cfg.SourceProfileName, section, sourceProfileKey) + updateString(&cfg.CredentialSource, section, credentialSourceKey) + updateString(&cfg.Region, section, regionKey) + + if v := section.String(stsRegionalEndpointSharedKey); len(v) != 0 { + sre, err := endpoints.GetSTSRegionalEndpoint(v) + if err != nil { + return fmt.Errorf("failed to load %s from shared config, %s, %v", + stsRegionalEndpointSharedKey, file.Filename, err) + } + cfg.STSRegionalEndpoint = sre } - } - // Assume Role - roleArn := section.String(roleArnKey) - srcProfile := section.String(sourceProfileKey) - credentialSource := section.String(credentialSourceKey) - credentialProcess := section.String(credentialProcessKey) - //Has source to make sure the Assume Role has at least either srcProfile, credential Source, or credential Process. - hasSource := len(srcProfile) > 0 || len(credentialSource) > 0 || len(credentialProcess) > 0 - if len(roleArn) > 0 && hasSource { - cfg.AssumeRole = assumeRoleConfig{ - RoleARN: roleArn, - SourceProfile: srcProfile, - CredentialSource: credentialSource, - ExternalID: section.String(externalIDKey), - MFASerial: section.String(mfaSerialKey), - RoleSessionName: section.String(roleSessionNameKey), + if v := section.String(s3UsEast1RegionalSharedKey); len(v) != 0 { + sre, err := endpoints.GetS3UsEast1RegionalEndpoint(v) + if err != nil { + return fmt.Errorf("failed to load %s from shared config, %s, %v", + s3UsEast1RegionalSharedKey, file.Filename, err) + } + cfg.S3UsEast1RegionalEndpoint = sre } } - // `credential_process` - if credProc := section.String(credentialProcessKey); len(credProc) > 0 { - cfg.CredentialProcess = credProc - } + updateString(&cfg.CredentialProcess, section, credentialProcessKey) + updateString(&cfg.WebIdentityTokenFile, section, webIdentityTokenFileKey) - // Region - if v := section.String(regionKey); len(v) > 0 { - cfg.Region = v + // Shared Credentials + creds := credentials.Value{ + AccessKeyID: section.String(accessKeyIDKey), + SecretAccessKey: section.String(secretAccessKey), + SessionToken: section.String(sessionTokenKey), + ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", file.Filename), + } + if creds.HasKeys() { + cfg.Creds = creds } // Endpoint discovery - if section.Has(enableEndpointDiscoveryKey) { - v := section.Bool(enableEndpointDiscoveryKey) - cfg.EnableEndpointDiscovery = &v + updateBoolPtr(&cfg.EnableEndpointDiscovery, section, enableEndpointDiscoveryKey) + + // CSM options + updateBoolPtr(&cfg.CSMEnabled, section, csmEnabledKey) + updateString(&cfg.CSMHost, section, csmHostKey) + updateString(&cfg.CSMPort, section, csmPortKey) + updateString(&cfg.CSMClientID, section, csmClientIDKey) + + updateBool(&cfg.S3UseARNRegion, section, s3UseARNRegionKey) + + return nil +} + +func (cfg *sharedConfig) validateCredentialsRequireARN(profile string) error { + var credSource string + + switch { + case len(cfg.SourceProfileName) != 0: + credSource = sourceProfileKey + case len(cfg.CredentialSource) != 0: + credSource = credentialSourceKey + case len(cfg.WebIdentityTokenFile) != 0: + credSource = webIdentityTokenFileKey + } + + if len(credSource) != 0 && len(cfg.RoleARN) == 0 { + return CredentialRequiresARNError{ + Type: credSource, + Profile: profile, + } + } + + return nil +} + +func (cfg *sharedConfig) validateCredentialType() error { + // Only one or no credential type can be defined. + if !oneOrNone( + len(cfg.SourceProfileName) != 0, + len(cfg.CredentialSource) != 0, + len(cfg.CredentialProcess) != 0, + len(cfg.WebIdentityTokenFile) != 0, + ) { + return ErrSharedConfigSourceCollision } return nil } +func (cfg *sharedConfig) hasCredentials() bool { + switch { + case len(cfg.SourceProfileName) != 0: + case len(cfg.CredentialSource) != 0: + case len(cfg.CredentialProcess) != 0: + case len(cfg.WebIdentityTokenFile) != 0: + case cfg.Creds.HasKeys(): + default: + return false + } + + return true +} + +func (cfg *sharedConfig) clearCredentialOptions() { + cfg.CredentialSource = "" + cfg.CredentialProcess = "" + cfg.WebIdentityTokenFile = "" + cfg.Creds = credentials.Value{} +} + +func (cfg *sharedConfig) clearAssumeRoleOptions() { + cfg.RoleARN = "" + cfg.ExternalID = "" + cfg.MFASerial = "" + cfg.RoleSessionName = "" + cfg.SourceProfileName = "" +} + +func oneOrNone(bs ...bool) bool { + var count int + + for _, b := range bs { + if b { + count++ + if count > 1 { + return false + } + } + } + + return true +} + +// updateString will only update the dst with the value in the section key, key +// is present in the section. +func updateString(dst *string, section ini.Section, key string) { + if !section.Has(key) { + return + } + *dst = section.String(key) +} + +// updateBool will only update the dst with the value in the section key, key +// is present in the section. +func updateBool(dst *bool, section ini.Section, key string) { + if !section.Has(key) { + return + } + *dst = section.Bool(key) +} + +// updateBoolPtr will only update the dst with the value in the section key, +// key is present in the section. +func updateBoolPtr(dst **bool, section ini.Section, key string) { + if !section.Has(key) { + return + } + *dst = new(bool) + **dst = section.Bool(key) +} + // SharedConfigLoadError is an error for the shared config file failed to load. type SharedConfigLoadError struct { Filename string @@ -316,7 +486,8 @@ func (e SharedConfigProfileNotExistsError) Error() string { // profile contains assume role information, but that information is invalid // or not complete. type SharedConfigAssumeRoleError struct { - RoleARN string + RoleARN string + SourceProfile string } // Code is the short id of the error. @@ -326,8 +497,10 @@ func (e SharedConfigAssumeRoleError) Code() string { // Message is the description of the error func (e SharedConfigAssumeRoleError) Message() string { - return fmt.Sprintf("failed to load assume role for %s, source profile has no shared credentials", - e.RoleARN) + return fmt.Sprintf( + "failed to load assume role for %s, source profile %s has no shared credentials", + e.RoleARN, e.SourceProfile, + ) } // OrigErr is the underlying error that caused the failure. @@ -339,3 +512,36 @@ func (e SharedConfigAssumeRoleError) OrigErr() error { func (e SharedConfigAssumeRoleError) Error() string { return awserr.SprintError(e.Code(), e.Message(), "", nil) } + +// CredentialRequiresARNError provides the error for shared config credentials +// that are incorrectly configured in the shared config or credentials file. +type CredentialRequiresARNError struct { + // type of credentials that were configured. + Type string + + // Profile name the credentials were in. + Profile string +} + +// Code is the short id of the error. +func (e CredentialRequiresARNError) Code() string { + return "CredentialRequiresARNError" +} + +// Message is the description of the error +func (e CredentialRequiresARNError) Message() string { + return fmt.Sprintf( + "credential type %s requires role_arn, profile %s", + e.Type, e.Profile, + ) +} + +// OrigErr is the underlying error that caused the failure. +func (e CredentialRequiresARNError) OrigErr() error { + return nil +} + +// Error satisfies the error interface. +func (e CredentialRequiresARNError) Error() string { + return awserr.SprintError(e.Code(), e.Message(), "", nil) +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go index 523db79f..8104793a 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go @@ -687,7 +687,11 @@ func (ctx *signingCtx) buildBodyDigest() error { if !aws.IsReaderSeekable(ctx.Body) { return fmt.Errorf("cannot use unseekable request body %T, for signed request with body", ctx.Body) } - hash = hex.EncodeToString(makeSha256Reader(ctx.Body)) + hashBytes, err := makeSha256Reader(ctx.Body) + if err != nil { + return err + } + hash = hex.EncodeToString(hashBytes) } if includeSHA256Header { @@ -734,10 +738,16 @@ func makeSha256(data []byte) []byte { return hash.Sum(nil) } -func makeSha256Reader(reader io.ReadSeeker) []byte { +func makeSha256Reader(reader io.ReadSeeker) (hashBytes []byte, err error) { hash := sha256.New() - start, _ := reader.Seek(0, sdkio.SeekCurrent) - defer reader.Seek(start, sdkio.SeekStart) + start, err := reader.Seek(0, sdkio.SeekCurrent) + if err != nil { + return nil, err + } + defer func() { + // ensure error is return if unable to seek back to start of payload. + _, err = reader.Seek(start, sdkio.SeekStart) + }() // Use CopyN to avoid allocating the 32KB buffer in io.Copy for bodies // smaller than 32KB. Fall back to io.Copy if we fail to determine the size. @@ -748,7 +758,7 @@ func makeSha256Reader(reader io.ReadSeeker) []byte { io.CopyN(hash, reader, size) } - return hash.Sum(nil) + return hash.Sum(nil), nil } const doubleSpace = " " diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go index e5e93a8b..dfbd442c 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.20.19" +const SDKVersion = "1.26.2" diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go index e56dcee2..cf9fad81 100644 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go @@ -162,7 +162,7 @@ loop: if len(tokens) == 0 { break loop } - + // if should skip is true, we skip the tokens until should skip is set to false. step = SkipTokenState } @@ -218,7 +218,7 @@ loop: // S -> equal_expr' expr_stmt' switch k.Kind { case ASTKindEqualExpr: - // assiging a value to some key + // assigning a value to some key k.AppendChild(newExpression(tok)) stack.Push(newExprStatement(k)) case ASTKindExpr: @@ -250,6 +250,13 @@ loop: if !runeCompare(tok.Raw(), openBrace) { return nil, NewParseError("expected '['") } + // If OpenScopeState is not at the start, we must mark the previous ast as complete + // + // for example: if previous ast was a skip statement; + // we should mark it as complete before we create a new statement + if k.Kind != ASTKindStart { + stack.MarkComplete(k) + } stmt := newStatement() stack.Push(stmt) diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/skipper.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/skipper.go index 6bb69644..da7a4049 100644 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/skipper.go +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/skipper.go @@ -22,24 +22,24 @@ func newSkipper() skipper { } func (s *skipper) ShouldSkip(tok Token) bool { + // should skip state will be modified only if previous token was new line (NL); + // and the current token is not WhiteSpace (WS). if s.shouldSkip && s.prevTok.Type() == TokenNL && tok.Type() != TokenWS { - s.Continue() return false } s.prevTok = tok - return s.shouldSkip } func (s *skipper) Skip() { s.shouldSkip = true - s.prevTok = emptyToken } func (s *skipper) Continue() { s.shouldSkip = false + // empty token is assigned as we return to default state, when should skip is false s.prevTok = emptyToken } diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkio/byte.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkio/byte.go new file mode 100644 index 00000000..6c443988 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkio/byte.go @@ -0,0 +1,12 @@ +package sdkio + +const ( + // Byte is 8 bits + Byte int64 = 1 + // KibiByte (KiB) is 1024 Bytes + KibiByte = Byte * 1024 + // MebiByte (MiB) is 1024 KiB + MebiByte = KibiByte * 1024 + // GibiByte (GiB) is 1024 MiB + GibiByte = MebiByte * 1024 +) diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor.go new file mode 100644 index 00000000..44898eed --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor.go @@ -0,0 +1,15 @@ +// +build go1.10 + +package sdkmath + +import "math" + +// Round returns the nearest integer, rounding half away from zero. +// +// Special cases are: +// Round(±0) = ±0 +// Round(±Inf) = ±Inf +// Round(NaN) = NaN +func Round(x float64) float64 { + return math.Round(x) +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor_go1.9.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor_go1.9.go new file mode 100644 index 00000000..810ec7f0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor_go1.9.go @@ -0,0 +1,56 @@ +// +build !go1.10 + +package sdkmath + +import "math" + +// Copied from the Go standard library's (Go 1.12) math/floor.go for use in +// Go version prior to Go 1.10. +const ( + uvone = 0x3FF0000000000000 + mask = 0x7FF + shift = 64 - 11 - 1 + bias = 1023 + signMask = 1 << 63 + fracMask = 1<= 0.5 { + // return t + Copysign(1, x) + // } + // return t + // } + bits := math.Float64bits(x) + e := uint(bits>>shift) & mask + if e < bias { + // Round abs(x) < 1 including denormals. + bits &= signMask // +-0 + if e == bias-1 { + bits |= uvone // +-1 + } + } else if e < bias+shift { + // Round any abs(x) >= 1 containing a fractional component [0,1). + // + // Numbers with larger exponents are returned unchanged since they + // must be either an integer, infinity, or NaN. + const half = 1 << (shift - 1) + e -= bias + bits += half >> e + bits &^= fracMask >> e + } + return math.Float64frombits(bits) +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read.go new file mode 100644 index 00000000..f4651da2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read.go @@ -0,0 +1,11 @@ +// +build go1.6 + +package sdkrand + +import "math/rand" + +// Read provides the stub for math.Rand.Read method support for go version's +// 1.6 and greater. +func Read(r *rand.Rand, p []byte) (int, error) { + return r.Read(p) +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read_1_5.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read_1_5.go new file mode 100644 index 00000000..b1d93a33 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read_1_5.go @@ -0,0 +1,24 @@ +// +build !go1.6 + +package sdkrand + +import "math/rand" + +// Read backfills Go 1.6's math.Rand.Reader for Go 1.5 +func Read(r *rand.Rand, p []byte) (n int, err error) { + // Copy of Go standard libraries math package's read function not added to + // standard library until Go 1.6. + var pos int8 + var val int64 + for n = 0; n < len(p); n++ { + if pos == 0 { + val = r.Int63() + pos = 7 + } + p[n] = byte(val) + val >>= 8 + pos-- + } + + return n, err +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go index de021367..74e361e0 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go @@ -146,6 +146,9 @@ func unmarshalStatusCode(v reflect.Value, statusCode int) { } func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) error { + if len(headers) == 0 { + return nil + } switch r.Interface().(type) { case map[string]*string: // we only support string map value types out := map[string]*string{} @@ -155,19 +158,28 @@ func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) err out[k[len(prefix):]] = &v[0] } } - r.Set(reflect.ValueOf(out)) + if len(out) != 0 { + r.Set(reflect.ValueOf(out)) + } + } return nil } func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) error { - isJSONValue := tag.Get("type") == "jsonvalue" - if isJSONValue { + switch tag.Get("type") { + case "jsonvalue": if len(header) == 0 { return nil } - } else if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) { - return nil + case "blob": + if len(header) == 0 { + return nil + } + default: + if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) { + return nil + } } switch v.Interface().(type) { @@ -178,7 +190,7 @@ func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) erro if err != nil { return err } - v.Set(reflect.ValueOf(&b)) + v.Set(reflect.ValueOf(b)) case *bool: b, err := strconv.ParseBool(header) if err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go index b7ed6c6f..05d4ff51 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go @@ -1,8 +1,11 @@ package protocol import ( + "math" "strconv" "time" + + "github.com/aws/aws-sdk-go/internal/sdkmath" ) // Names of time formats supported by the SDK @@ -13,12 +16,19 @@ const ( ) // Time formats supported by the SDK +// Output time is intended to not contain decimals const ( // RFC 7231#section-7.1.1.1 timetamp format. e.g Tue, 29 Apr 2014 18:30:38 GMT RFC822TimeFormat = "Mon, 2 Jan 2006 15:04:05 GMT" + // This format is used for output time without seconds precision + RFC822OutputTimeFormat = "Mon, 02 Jan 2006 15:04:05 GMT" + // RFC3339 a subset of the ISO8601 timestamp format. e.g 2014-04-29T18:30:38Z - ISO8601TimeFormat = "2006-01-02T15:04:05Z" + ISO8601TimeFormat = "2006-01-02T15:04:05.999999999Z" + + // This format is used for output time without seconds precision + ISO8601OutputTimeFormat = "2006-01-02T15:04:05Z" ) // IsKnownTimestampFormat returns if the timestamp format name @@ -42,9 +52,9 @@ func FormatTime(name string, t time.Time) string { switch name { case RFC822TimeFormatName: - return t.Format(RFC822TimeFormat) + return t.Format(RFC822OutputTimeFormat) case ISO8601TimeFormatName: - return t.Format(ISO8601TimeFormat) + return t.Format(ISO8601OutputTimeFormat) case UnixTimeFormatName: return strconv.FormatInt(t.Unix(), 10) default: @@ -62,10 +72,12 @@ func ParseTime(formatName, value string) (time.Time, error) { return time.Parse(ISO8601TimeFormat, value) case UnixTimeFormatName: v, err := strconv.ParseFloat(value, 64) + _, dec := math.Modf(v) + dec = sdkmath.Round(dec*1e3) / 1e3 //Rounds 0.1229999 to 0.123 if err != nil { return time.Time{}, err } - return time.Unix(int64(v), 0), nil + return time.Unix(int64(v), int64(dec*(1e9))), nil default: panic("unknown timestamp format name, " + formatName) } diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort.go new file mode 100644 index 00000000..c1a51185 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort.go @@ -0,0 +1,32 @@ +package xmlutil + +import ( + "encoding/xml" + "strings" +) + +type xmlAttrSlice []xml.Attr + +func (x xmlAttrSlice) Len() int { + return len(x) +} + +func (x xmlAttrSlice) Less(i, j int) bool { + spaceI, spaceJ := x[i].Name.Space, x[j].Name.Space + localI, localJ := x[i].Name.Local, x[j].Name.Local + valueI, valueJ := x[i].Value, x[j].Value + + spaceCmp := strings.Compare(spaceI, spaceJ) + localCmp := strings.Compare(localI, localJ) + valueCmp := strings.Compare(valueI, valueJ) + + if spaceCmp == -1 || (spaceCmp == 0 && (localCmp == -1 || (localCmp == 0 && valueCmp == -1))) { + return true + } + + return false +} + +func (x xmlAttrSlice) Swap(i, j int) { + x[i], x[j] = x[j], x[i] +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go index 515ce152..42f71648 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go @@ -119,7 +119,18 @@ func (n *XMLNode) findElem(name string) (string, bool) { // StructToXML writes an XMLNode to a xml.Encoder as tokens. func StructToXML(e *xml.Encoder, node *XMLNode, sorted bool) error { - e.EncodeToken(xml.StartElement{Name: node.Name, Attr: node.Attr}) + // Sort Attributes + attrs := node.Attr + if sorted { + sortedAttrs := make([]xml.Attr, len(attrs)) + for _, k := range node.Attr { + sortedAttrs = append(sortedAttrs, k) + } + sort.Sort(xmlAttrSlice(sortedAttrs)) + attrs = sortedAttrs + } + + e.EncodeToken(xml.StartElement{Name: node.Name, Attr: attrs}) if node.Text != "" { e.EncodeToken(xml.CharData([]byte(node.Text))) diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go index a2f362cd..cfa9204e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go @@ -1274,8 +1274,12 @@ func (c *AutoScaling) DeletePolicyRequest(input *DeletePolicyInput) (req *reques // // Deletes the specified scaling policy. // -// Deleting a policy deletes the underlying alarm action, but does not delete -// the alarm, even if it no longer has an associated action. +// Deleting either a step scaling policy or a simple scaling policy deletes +// the underlying alarm action, but does not delete the alarm, even if it no +// longer has an associated action. +// +// For more information, see Deleting a Scaling Policy (https://docs.aws.amazon.com/autoscaling/ec2/userguide/deleting-scaling-policy.html) +// in the Amazon EC2 Auto Scaling 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 @@ -1776,10 +1780,12 @@ func (c *AutoScaling) DescribeAutoScalingGroupsPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeAutoScalingGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeAutoScalingGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1915,10 +1921,12 @@ func (c *AutoScaling) DescribeAutoScalingInstancesPagesWithContext(ctx aws.Conte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeAutoScalingInstancesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeAutoScalingInstancesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2134,10 +2142,12 @@ func (c *AutoScaling) DescribeLaunchConfigurationsPagesWithContext(ctx aws.Conte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeLaunchConfigurationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeLaunchConfigurationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2687,10 +2697,12 @@ func (c *AutoScaling) DescribeNotificationConfigurationsPagesWithContext(ctx aws }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeNotificationConfigurationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeNotificationConfigurationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2829,10 +2841,12 @@ func (c *AutoScaling) DescribePoliciesPagesWithContext(ctx aws.Context, input *D }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribePoliciesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribePoliciesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2968,10 +2982,12 @@ func (c *AutoScaling) DescribeScalingActivitiesPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeScalingActivitiesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeScalingActivitiesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3106,7 +3122,8 @@ func (c *AutoScaling) DescribeScheduledActionsRequest(input *DescribeScheduledAc // DescribeScheduledActions API operation for Auto Scaling. // // Describes the actions scheduled for your Auto Scaling group that haven't -// run. To describe the actions that have already run, use DescribeScalingActivities. +// run or that have not reached their end time. To describe the actions that +// have already run, use DescribeScalingActivities. // // 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 @@ -3188,10 +3205,12 @@ func (c *AutoScaling) DescribeScheduledActionsPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeScheduledActionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeScheduledActionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3336,10 +3355,12 @@ func (c *AutoScaling) DescribeTagsPagesWithContext(ctx aws.Context, input *Descr }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTagsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeTagsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3904,6 +3925,15 @@ func (c *AutoScaling) EnterStandbyRequest(input *EnterStandbyInput) (req *reques // // Moves the specified instances into the standby state. // +// If you choose to decrement the desired capacity of the Auto Scaling group, +// the instances can enter standby as long as the desired capacity of the Auto +// Scaling group after the instances are placed into standby is equal to or +// greater than the minimum capacity of the group. +// +// If you choose not to decrement the desired capacity of the Auto Scaling group, +// the Auto Scaling group launches new instances to replace the instances on +// standby. +// // For more information, see Temporarily Removing Instances from Your Auto Scaling // Group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html) // in the Amazon EC2 Auto Scaling User Guide. @@ -4073,6 +4103,8 @@ func (c *AutoScaling) ExitStandbyRequest(input *ExitStandbyInput) (req *request. // // Moves the specified instances out of the standby state. // +// After you put the instances back in service, the desired capacity is incremented. +// // For more information, see Temporarily Removing Instances from Your Auto Scaling // Group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html) // in the Amazon EC2 Auto Scaling User Guide. @@ -4177,7 +4209,7 @@ func (c *AutoScaling) PutLifecycleHookRequest(input *PutLifecycleHookInput) (req // launch or terminate. // // If you need more time, record the lifecycle action heartbeat to keep the -// instance in a pending state using using RecordLifecycleActionHeartbeat. +// instance in a pending state using RecordLifecycleActionHeartbeat. // // If you finish before the timeout period ends, complete the lifecycle action // using CompleteLifecycleAction. @@ -4371,10 +4403,14 @@ func (c *AutoScaling) PutScalingPolicyRequest(input *PutScalingPolicyInput) (req // PutScalingPolicy API operation for Auto Scaling. // -// Creates or updates a policy for an Auto Scaling group. To update an existing -// policy, use the existing policy name and set the parameters to change. Any -// existing parameter not changed in an update to an existing policy is not -// changed in this update request. +// Creates or updates a scaling policy for an Auto Scaling group. To update +// an existing scaling policy, use the existing policy name and set the parameters +// to change. Any existing parameter not changed in an update to an existing +// policy is not changed in this update request. +// +// For more information about using scaling policies to scale your Auto Scaling +// group automatically, see Dynamic Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scale-based-on-demand.html) +// in the Amazon EC2 Auto Scaling 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 @@ -5197,27 +5233,42 @@ func (c *AutoScaling) UpdateAutoScalingGroupRequest(input *UpdateAutoScalingGrou // // Updates the configuration for the specified Auto Scaling group. // -// The new settings take effect on any scaling activities after this call returns. -// Scaling activities that are currently in progress aren't affected. -// -// To update an Auto Scaling group with a launch configuration with InstanceMonitoring -// set to false, you must first disable the collection of group metrics. Otherwise, -// you get an error. If you have previously enabled the collection of group -// metrics, you can disable it using DisableMetricsCollection. -// -// Note the following: +// To update an Auto Scaling group, specify the name of the group and the parameter +// that you want to change. Any parameters that you don't specify are not changed +// by this update request. The new settings take effect on any scaling activities +// after this call returns. +// +// If you associate a new launch configuration or template with an Auto Scaling +// group, all new instances will get the updated configuration. Existing instances +// continue to run with the configuration that they were originally launched +// with. When you update a group to specify a mixed instances policy instead +// of a launch configuration or template, existing instances may be replaced +// to match the new purchasing options that you specified in the policy. For +// example, if the group currently has 100% On-Demand capacity and the policy +// specifies 50% Spot capacity, this means that half of your instances will +// be gradually terminated and relaunched as Spot Instances. When replacing +// instances, Amazon EC2 Auto Scaling launches new instances before terminating +// the old ones, so that updating your group does not compromise the performance +// or availability of your application. +// +// Note the following about changing DesiredCapacity, MaxSize, or MinSize: +// +// * If a scale-in event occurs as a result of a new DesiredCapacity value +// that is lower than the current size of the group, the Auto Scaling group +// uses its termination policy to determine which instances to terminate. // // * If you specify a new value for MinSize without specifying a value for // DesiredCapacity, and the new MinSize is larger than the current size of -// the group, we implicitly call SetDesiredCapacity to set the size of the -// group to the new value of MinSize. +// the group, this sets the group's DesiredCapacity to the new MinSize value. // // * If you specify a new value for MaxSize without specifying a value for // DesiredCapacity, and the new MaxSize is smaller than the current size -// of the group, we implicitly call SetDesiredCapacity to set the size of -// the group to the new value of MaxSize. +// of the group, this sets the group's DesiredCapacity to the new MaxSize +// value. // -// * All other optional parameters are left unchanged if not specified. +// To see which parameters have been set, use DescribeAutoScalingGroups. You +// can also view the scaling policies for an Auto Scaling group using DescribePolicies. +// If the group has scaling policies, you can update them using PutScalingPolicy. // // 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 @@ -6006,8 +6057,8 @@ func (s CompleteLifecycleActionOutput) GoString() string { type CreateAutoScalingGroupInput struct { _ struct{} `type:"structure"` - // The name of the Auto Scaling group. This name must be unique within the scope - // of your AWS account. + // The name of the Auto Scaling group. This name must be unique per Region per + // account. // // AutoScalingGroupName is a required field AutoScalingGroupName *string `min:"1" type:"string" required:"true"` @@ -6026,10 +6077,11 @@ type CreateAutoScalingGroupInput struct { // in the Amazon EC2 Auto Scaling User Guide. DefaultCooldown *int64 `type:"integer"` - // The number of EC2 instances that should be running in the group. This number - // must be greater than or equal to the minimum size of the group and less than - // or equal to the maximum size of the group. If you do not specify a desired - // capacity, the default is the minimum size of the group. + // The number of Amazon EC2 instances that the Auto Scaling group attempts to + // maintain. This number must be greater than or equal to the minimum size of + // the group and less than or equal to the maximum size of the group. If you + // do not specify a desired capacity, the default is the minimum size of the + // group. DesiredCapacity *int64 `type:"integer"` // The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before @@ -6037,7 +6089,7 @@ type CreateAutoScalingGroupInput struct { // During this time, any health check failures for the instance are ignored. // The default value is 0. // - // For more information, see Health Checks for Auto Scaling Instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html) + // For more information, see Health Check Grace Period (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html#health-check-grace-period) // in the Amazon EC2 Auto Scaling User Guide. // // Conditional: This parameter is required if you are adding an ELB health check. @@ -6053,8 +6105,6 @@ type CreateAutoScalingGroupInput struct { HealthCheckType *string `min:"1" type:"string"` // The ID of the instance used to create a launch configuration for the group. - // This parameter, a launch configuration, a launch template, or a mixed instances - // policy must be specified. // // When you specify an ID of an instance, Amazon EC2 Auto Scaling creates a // new launch configuration and associates it with the group. This launch configuration @@ -6064,35 +6114,43 @@ type CreateAutoScalingGroupInput struct { // For more information, see Create an Auto Scaling Group Using an EC2 Instance // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-from-instance.html) // in the Amazon EC2 Auto Scaling User Guide. + // + // You must specify one of the following parameters in your request: LaunchConfigurationName, + // LaunchTemplate, InstanceId, or MixedInstancesPolicy. InstanceId *string `min:"1" type:"string"` - // The name of the launch configuration. This parameter, a launch template, - // a mixed instances policy, or an EC2 instance must be specified. + // The name of the launch configuration. // - // For more information, see Creating an Auto Scaling Group Using a Launch Configuration - // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg.html) in - // the Amazon EC2 Auto Scaling User Guide. + // If you do not specify LaunchConfigurationName, you must specify one of the + // following parameters: InstanceId, LaunchTemplate, or MixedInstancesPolicy. LaunchConfigurationName *string `min:"1" type:"string"` - // The launch template to use to launch instances. This parameter, a launch - // configuration, a mixed instances policy, or an EC2 instance must be specified. + // The launch template to use to launch instances. // - // For more information, see Creating an Auto Scaling Group Using a Launch Template - // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-launch-template.html) - // in the Amazon EC2 Auto Scaling User Guide. + // For more information, see LaunchTemplateSpecification (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_LaunchTemplateSpecification.html) + // in the Amazon EC2 Auto Scaling API Reference. + // + // If you do not specify LaunchTemplate, you must specify one of the following + // parameters: InstanceId, LaunchConfigurationName, or MixedInstancesPolicy. LaunchTemplate *LaunchTemplateSpecification `type:"structure"` // One or more lifecycle hooks. LifecycleHookSpecificationList []*LifecycleHookSpecification `type:"list"` - // One or more Classic Load Balancers. To specify an Application Load Balancer - // or a Network Load Balancer, use TargetGroupARNs instead. + // A list of Classic Load Balancers associated with this Auto Scaling group. + // For Application Load Balancers and Network Load Balancers, specify a list + // of target groups using the TargetGroupARNs property instead. // - // For more information, see Using a Load Balancer With an Auto Scaling Group + // For more information, see Using a Load Balancer with an Auto Scaling Group // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html) // in the Amazon EC2 Auto Scaling User Guide. LoadBalancerNames []*string `type:"list"` + // The maximum amount of time, in seconds, that an instance can be in service. + // + // Valid Range: Minimum value of 604800. + MaxInstanceLifetime *int64 `type:"integer"` + // The maximum size of the group. // // MaxSize is a required field @@ -6103,12 +6161,23 @@ type CreateAutoScalingGroupInput struct { // MinSize is a required field MinSize *int64 `type:"integer" required:"true"` - // The mixed instances policy to use to launch instances. This parameter, a - // launch template, a launch configuration, or an EC2 instance must be specified. + // An embedded object that specifies a mixed instances policy. The required + // parameters must be specified. If optional parameters are unspecified, their + // default values are used. + // + // The policy includes parameters that not only define the distribution of On-Demand + // Instances and Spot Instances, the maximum price to pay for Spot Instances, + // and how the Auto Scaling group allocates instance types to fulfill On-Demand + // and Spot capacity, but also the parameters that specify the instance configuration + // information—the launch template and instance types. // - // For more information, see Auto Scaling Groups with Multiple Instance Types - // and Purchase Options (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html) + // For more information, see MixedInstancesPolicy (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_MixedInstancesPolicy.html) + // in the Amazon EC2 Auto Scaling API Reference and Auto Scaling Groups with + // Multiple Instance Types and Purchase Options (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html) // in the Amazon EC2 Auto Scaling User Guide. + // + // You must specify one of the following parameters in your request: LaunchConfigurationName, + // LaunchTemplate, InstanceId, or MixedInstancesPolicy. MixedInstancesPolicy *MixedInstancesPolicy `type:"structure"` // Indicates whether newly launched instances are protected from termination @@ -6140,7 +6209,13 @@ type CreateAutoScalingGroupInput struct { // in the Amazon EC2 Auto Scaling User Guide. Tags []*Tag `type:"list"` - // The Amazon Resource Names (ARN) of the target groups. + // The Amazon Resource Names (ARN) of the target groups to associate with the + // Auto Scaling group. Instances are registered as targets in a target group, + // and traffic is routed to the target group. + // + // For more information, see Using a Load Balancer with an Auto Scaling Group + // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html) + // in the Amazon EC2 Auto Scaling User Guide. TargetGroupARNs []*string `type:"list"` // One or more termination policies used to select the instance to terminate. @@ -6310,6 +6385,12 @@ func (s *CreateAutoScalingGroupInput) SetLoadBalancerNames(v []*string) *CreateA return s } +// SetMaxInstanceLifetime sets the MaxInstanceLifetime field's value. +func (s *CreateAutoScalingGroupInput) SetMaxInstanceLifetime(v int64) *CreateAutoScalingGroupInput { + s.MaxInstanceLifetime = &v + return s +} + // SetMaxSize sets the MaxSize field's value. func (s *CreateAutoScalingGroupInput) SetMaxSize(v int64) *CreateAutoScalingGroupInput { s.MaxSize = &v @@ -6387,30 +6468,36 @@ func (s CreateAutoScalingGroupOutput) GoString() string { type CreateLaunchConfigurationInput struct { _ struct{} `type:"structure"` - // Used for groups that launch instances into a virtual private cloud (VPC). - // Specifies whether to assign a public IP address to each instance. For more - // information, see Launching Auto Scaling Instances in a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html) + // For Auto Scaling groups that are running in a virtual private cloud (VPC), + // specifies whether to assign a public IP address to the group's instances. + // If you specify true, each instance in the Auto Scaling group receives a unique + // public IP address. For more information, see Launching Auto Scaling Instances + // in a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html) // in the Amazon EC2 Auto Scaling User Guide. // - // If you specify this parameter, be sure to specify at least one subnet when - // you create your group. + // If you specify this parameter, you must specify at least one subnet for VPCZoneIdentifier + // when you create your group. // - // Default: If the instance is launched into a default subnet, the default is - // to assign a public IP address. If the instance is launched into a nondefault - // subnet, the default is not to assign a public IP address. + // If the instance is launched into a default subnet, the default is to assign + // a public IP address, unless you disabled the option to assign a public IP + // address on the subnet. If the instance is launched into a nondefault subnet, + // the default is not to assign a public IP address, unless you enabled the + // option to assign a public IP address on the subnet. AssociatePublicIpAddress *bool `type:"boolean"` - // One or more mappings that specify how block devices are exposed to the instance. - // For more information, see Block Device Mapping (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html) + // A block device mapping, which specifies the block devices for the instance. + // You can specify virtual devices and EBS volumes. For more information, see + // Block Device Mapping (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html) // in the Amazon EC2 User Guide for Linux Instances. BlockDeviceMappings []*BlockDeviceMapping `type:"list"` // The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. - // This parameter is supported only if you are launching EC2-Classic instances. // For more information, see ClassicLink (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) // in the Amazon EC2 User Guide for Linux Instances and Linking EC2-Classic // Instances to a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-ClassicLink) // in the Amazon EC2 Auto Scaling User Guide. + // + // This parameter can only be used if you are launching EC2-Classic instances. ClassicLinkVPCId *string `min:"1" type:"string"` // The IDs of one or more security groups for the specified ClassicLink-enabled @@ -6419,63 +6506,70 @@ type CreateLaunchConfigurationInput struct { // Instances to a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-ClassicLink) // in the Amazon EC2 Auto Scaling User Guide. // - // Conditional: This parameter is required if you specify a ClassicLink-enabled - // VPC, and is not supported otherwise. + // If you specify the ClassicLinkVPCId parameter, you must specify this parameter. ClassicLinkVPCSecurityGroups []*string `type:"list"` - // Indicates whether the instance is optimized for Amazon EBS I/O. By default, - // the instance is not optimized for EBS I/O. The optimization provides dedicated - // throughput to Amazon EBS and an optimized configuration stack to provide - // optimal I/O performance. This optimization is not available with all instance - // types. Additional usage charges apply. For more information, see Amazon EBS-Optimized + // Specifies whether the launch configuration is optimized for EBS I/O (true) + // or not (false). The optimization provides dedicated throughput to Amazon + // EBS and an optimized configuration stack to provide optimal I/O performance. + // This optimization is not available with all instance types. Additional fees + // are incurred when you enable EBS optimization for an instance type that is + // not EBS-optimized by default. For more information, see Amazon EBS-Optimized // Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) // in the Amazon EC2 User Guide for Linux Instances. + // + // The default value is false. EbsOptimized *bool `type:"boolean"` // The name or the Amazon Resource Name (ARN) of the instance profile associated - // with the IAM role for the instance. + // with the IAM role for the instance. The instance profile contains the IAM + // role. // - // EC2 instances launched with an IAM role automatically have AWS security credentials - // available. You can use IAM roles with Amazon EC2 Auto Scaling to automatically - // enable applications running on your EC2 instances to securely access other - // AWS resources. For more information, see Use an IAM Role for Applications - // That Run on Amazon EC2 Instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/us-iam-role.html) + // For more information, see IAM Role for Applications That Run on Amazon EC2 + // Instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/us-iam-role.html) // in the Amazon EC2 Auto Scaling User Guide. IamInstanceProfile *string `min:"1" type:"string"` - // The ID of the Amazon Machine Image (AMI) to use to launch your EC2 instances. - // - // If you do not specify InstanceId, you must specify ImageId. - // + // The ID of the Amazon Machine Image (AMI) that was assigned during registration. // For more information, see Finding an AMI (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html) // in the Amazon EC2 User Guide for Linux Instances. + // + // If you do not specify InstanceId, you must specify ImageId. ImageId *string `min:"1" type:"string"` // The ID of the instance to use to create the launch configuration. The new // launch configuration derives attributes from the instance, except for the // block device mapping. // - // If you do not specify InstanceId, you must specify both ImageId and InstanceType. - // // To create a launch configuration with a block device mapping or override // any other instance attributes, specify them as part of the same request. // // For more information, see Create a Launch Configuration Using an EC2 Instance // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-lc-with-instanceID.html) // in the Amazon EC2 Auto Scaling User Guide. + // + // If you do not specify InstanceId, you must specify both ImageId and InstanceType. InstanceId *string `min:"1" type:"string"` - // Enables detailed monitoring (true) or basic monitoring (false) for the Auto - // Scaling instances. The default value is true. + // Controls whether instances in this group are launched with detailed (true) + // or basic (false) monitoring. + // + // The default value is true (enabled). + // + // When detailed monitoring is enabled, Amazon CloudWatch generates metrics + // every minute and your account is charged a fee. When you disable detailed + // monitoring, CloudWatch generates metrics every 5 minutes. For more information, + // see Configure Monitoring for Auto Scaling Instances (https://docs.aws.amazon.com/autoscaling/latest/userguide/as-instance-monitoring.html#enable-as-instance-metrics) + // in the Amazon EC2 Auto Scaling User Guide. InstanceMonitoring *InstanceMonitoring `type:"structure"` - // The instance type of the EC2 instance. - // - // If you do not specify InstanceId, you must specify InstanceType. + // Specifies the instance type of the EC2 instance. // // For information about available instance types, see Available Instance Types // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#AvailableInstanceTypes) // in the Amazon EC2 User Guide for Linux Instances. + // + // If you do not specify InstanceId, you must specify InstanceType. InstanceType *string `min:"1" type:"string"` // The ID of the kernel associated with the AMI. @@ -6486,52 +6580,56 @@ type CreateLaunchConfigurationInput struct { // in the Amazon EC2 User Guide for Linux Instances. KeyName *string `min:"1" type:"string"` - // The name of the launch configuration. This name must be unique within the - // scope of your AWS account. + // The name of the launch configuration. This name must be unique per Region + // per account. // // LaunchConfigurationName is a required field LaunchConfigurationName *string `min:"1" type:"string" required:"true"` - // The tenancy of the instance. An instance with a tenancy of dedicated runs - // on single-tenant hardware and can only be launched into a VPC. + // The tenancy of the instance. An instance with dedicated tenancy runs on isolated, + // single-tenant hardware and can only be launched into a VPC. // - // To launch Dedicated Instances into a shared tenancy VPC (a VPC with the instance + // To launch dedicated instances into a shared tenancy VPC (a VPC with the instance // placement tenancy attribute set to default), you must set the value of this // parameter to dedicated. // - // If you specify this parameter, be sure to specify at least one subnet when - // you create your group. + // If you specify PlacementTenancy, you must specify at least one subnet for + // VPCZoneIdentifier when you create your group. // - // For more information, see Launching Auto Scaling Instances in a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html) + // For more information, see Instance Placement Tenancy (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-vpc-tenancy) // in the Amazon EC2 Auto Scaling User Guide. // - // Valid values: default | dedicated + // Valid Values: default | dedicated PlacementTenancy *string `min:"1" type:"string"` - // The ID of the RAM disk associated with the AMI. + // The ID of the RAM disk to select. RamdiskId *string `min:"1" type:"string"` - // One or more security groups with which to associate the instances. - // - // If your instances are launched in EC2-Classic, you can either specify security - // group names or the security group IDs. For more information, see Amazon EC2 - // Security Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html) - // in the Amazon EC2 User Guide for Linux Instances. + // A list that contains the security groups to assign to the instances in the + // Auto Scaling group. // - // If your instances are launched into a VPC, specify security group IDs. For - // more information, see Security Groups for Your VPC (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) + // [EC2-VPC] Specify the security group IDs. For more information, see Security + // Groups for Your VPC (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) // in the Amazon Virtual Private Cloud User Guide. + // + // [EC2-Classic] Specify either the security group names or the security group + // IDs. For more information, see Amazon EC2 Security Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html) + // in the Amazon EC2 User Guide for Linux Instances. SecurityGroups []*string `type:"list"` // The maximum hourly price to be paid for any Spot Instance launched to fulfill // the request. Spot Instances are launched when the price you specify exceeds - // the current Spot market price. For more information, see Launching Spot Instances + // the current Spot price. For more information, see Launching Spot Instances // in Your Auto Scaling Group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-spot-instances.html) // in the Amazon EC2 Auto Scaling User Guide. + // + // When you change your maximum price by creating a new launch configuration, + // running instances will continue to run as long as the maximum price for those + // running instances is higher than the current Spot price. SpotPrice *string `min:"1" type:"string"` - // The user data to make available to the launched EC2 instances. For more information, - // see Instance Metadata and User Data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) + // The Base64-encoded user data to make available to the launched EC2 instances. + // For more information, see Instance Metadata and User Data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) // in the Amazon EC2 User Guide for Linux Instances. UserData *string `type:"string"` } @@ -7385,11 +7483,11 @@ type DescribeAccountLimitsOutput struct { _ struct{} `type:"structure"` // The maximum number of groups allowed for your AWS account. The default limit - // is 200 per region. + // is 200 per AWS Region. MaxNumberOfAutoScalingGroups *int64 `type:"integer"` // The maximum number of launch configurations allowed for your AWS account. - // The default limit is 200 per region. + // The default limit is 200 per AWS Region. MaxNumberOfLaunchConfigurations *int64 `type:"integer"` // The current number of groups for your AWS account. @@ -8990,37 +9088,56 @@ func (s DisableMetricsCollectionOutput) GoString() string { type Ebs struct { _ struct{} `type:"structure"` - // Indicates whether the volume is deleted on instance termination. The default - // value is true. + // Indicates whether the volume is deleted on instance termination. For Amazon + // EC2 Auto Scaling, the default value is true. DeleteOnTermination *bool `type:"boolean"` - // Specifies whether the volume should be encrypted. Encrypted EBS volumes must - // be attached to instances that support Amazon EBS encryption. Volumes that - // are created from encrypted snapshots are automatically encrypted. There is - // no way to create an encrypted volume from an unencrypted snapshot or an unencrypted - // volume from an encrypted snapshot. If your AMI uses encrypted volumes, you - // can only launch it on supported instance types. For more information, see - // Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) - // in the Amazon EC2 User Guide for Linux Instances. + // Specifies whether the volume should be encrypted. Encrypted EBS volumes can + // only be attached to instances that support Amazon EBS encryption. For more + // information, see Supported Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances). + // If your AMI uses encrypted volumes, you can also only launch it on supported + // instance types. + // + // If you are creating a volume from a snapshot, you cannot specify an encryption + // value. Volumes that are created from encrypted snapshots are automatically + // encrypted, and volumes that are created from unencrypted snapshots are automatically + // unencrypted. By default, encrypted snapshots use the AWS managed CMK that + // is used for EBS encryption, but you can specify a custom CMK when you create + // the snapshot. The ability to encrypt a snapshot during copying also allows + // you to apply a new CMK to an already-encrypted snapshot. Volumes restored + // from the resulting copy are only accessible using the new CMK. + // + // Enabling encryption by default (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-by-default) + // results in all EBS volumes being encrypted with the AWS managed CMK or a + // customer managed CMK, whether or not the snapshot was encrypted. + // + // For more information, see Using Encryption with EBS-Backed AMIs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html) + // in the Amazon EC2 User Guide for Linux Instances and Required CMK Key Policy + // for Use with Encrypted Volumes (https://docs.aws.amazon.com/autoscaling/ec2/userguide/key-policy-requirements-EBS-encryption.html) + // in the Amazon EC2 Auto Scaling User Guide. Encrypted *bool `type:"boolean"` // The number of I/O operations per second (IOPS) to provision for the volume. - // For more information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) + // The maximum ratio of IOPS to volume size (in GiB) is 50:1. For more information, + // see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) // in the Amazon EC2 User Guide for Linux Instances. // // Conditional: This parameter is required when the volume type is io1. (Not // used with standard, gp2, st1, or sc1 volumes.) Iops *int64 `min:"100" type:"integer"` - // The ID of the snapshot. This parameter is optional if you specify a volume - // size. + // The snapshot ID of the volume to use. + // + // Conditional: This parameter is optional if you specify a volume size. If + // you specify both SnapshotId and VolumeSize, VolumeSize must be equal or greater + // than the size of the snapshot. SnapshotId *string `min:"1" type:"string"` - // The volume size, in GiB. + // The volume size, in Gibibytes (GiB). // - // Constraints: 1-1,024 for standard, 4-16,384 for io1, 1-16,384 for gp2, and - // 500-16,384 for st1 and sc1. If you specify a snapshot, the volume size must - // be equal to or larger than the snapshot size. + // This can be a number from 1-1,024 for standard, 4-16,384 for io1, 1-16,384 + // for gp2, and 500-16,384 for st1 and sc1. If you specify a snapshot, the volume + // size must be equal to or larger than the snapshot size. // // Default: If you create a volume from a snapshot and you don't specify a volume // size, the default is the snapshot size. @@ -9033,7 +9150,7 @@ type Ebs struct { // or sc1 for Cold HDD. For more information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) // in the Amazon EC2 User Guide for Linux Instances. // - // Valid values: standard | io1 | gp2 | st1 | sc1 + // Valid Values: standard | io1 | gp2 | st1 | sc1 VolumeType *string `min:"1" type:"string"` } @@ -9356,7 +9473,7 @@ type ExecutePolicyInput struct { // Indicates whether Amazon EC2 Auto Scaling waits for the cooldown period to // complete before executing the policy. // - // This parameter is not supported if the policy type is StepScaling. + // This parameter is not supported if the policy type is StepScaling or TargetTrackingScaling. // // For more information, see Scaling Cooldowns (https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) // in the Amazon EC2 Auto Scaling User Guide. @@ -9665,6 +9782,11 @@ type Group struct { // One or more load balancers associated with the group. LoadBalancerNames []*string `type:"list"` + // The maximum amount of time, in seconds, that an instance can be in service. + // + // Valid Range: Minimum value of 604800. + MaxInstanceLifetime *int64 `type:"integer"` + // The maximum size of the group. // // MaxSize is a required field @@ -9796,6 +9918,12 @@ func (s *Group) SetLoadBalancerNames(v []*string) *Group { return s } +// SetMaxInstanceLifetime sets the MaxInstanceLifetime field's value. +func (s *Group) SetMaxInstanceLifetime(v int64) *Group { + s.MaxInstanceLifetime = &v + return s +} + // SetMaxSize sets the MaxSize field's value. func (s *Group) SetMaxSize(v int64) *Group { s.MaxSize = &v @@ -9890,6 +10018,9 @@ type Instance struct { // InstanceId is a required field InstanceId *string `min:"1" type:"string" required:"true"` + // The instance type of the EC2 instance. + InstanceType *string `min:"1" type:"string"` + // The launch configuration associated with the instance. LaunchConfigurationName *string `min:"1" type:"string"` @@ -9907,6 +10038,12 @@ type Instance struct { // // ProtectedFromScaleIn is a required field ProtectedFromScaleIn *bool `type:"boolean" required:"true"` + + // The number of capacity units contributed by the instance based on its instance + // type. + // + // Valid Range: Minimum value of 1. Maximum value of 999. + WeightedCapacity *string `min:"1" type:"string"` } // String returns the string representation @@ -9937,6 +10074,12 @@ func (s *Instance) SetInstanceId(v string) *Instance { return s } +// SetInstanceType sets the InstanceType field's value. +func (s *Instance) SetInstanceType(v string) *Instance { + s.InstanceType = &v + return s +} + // SetLaunchConfigurationName sets the LaunchConfigurationName field's value. func (s *Instance) SetLaunchConfigurationName(v string) *Instance { s.LaunchConfigurationName = &v @@ -9961,6 +10104,12 @@ func (s *Instance) SetProtectedFromScaleIn(v bool) *Instance { return s } +// SetWeightedCapacity sets the WeightedCapacity field's value. +func (s *Instance) SetWeightedCapacity(v string) *Instance { + s.WeightedCapacity = &v + return s +} + // Describes an EC2 instance associated with an Auto Scaling group. type InstanceDetails struct { _ struct{} `type:"structure"` @@ -9988,6 +10137,9 @@ type InstanceDetails struct { // InstanceId is a required field InstanceId *string `min:"1" type:"string" required:"true"` + // The instance type of the EC2 instance. + InstanceType *string `min:"1" type:"string"` + // The launch configuration used to launch the instance. This value is not available // if you attached the instance to the Auto Scaling group. LaunchConfigurationName *string `min:"1" type:"string"` @@ -10005,6 +10157,12 @@ type InstanceDetails struct { // // ProtectedFromScaleIn is a required field ProtectedFromScaleIn *bool `type:"boolean" required:"true"` + + // The number of capacity units contributed by the instance based on its instance + // type. + // + // Valid Range: Minimum value of 1. Maximum value of 999. + WeightedCapacity *string `min:"1" type:"string"` } // String returns the string representation @@ -10041,6 +10199,12 @@ func (s *InstanceDetails) SetInstanceId(v string) *InstanceDetails { return s } +// SetInstanceType sets the InstanceType field's value. +func (s *InstanceDetails) SetInstanceType(v string) *InstanceDetails { + s.InstanceType = &v + return s +} + // SetLaunchConfigurationName sets the LaunchConfigurationName field's value. func (s *InstanceDetails) SetLaunchConfigurationName(v string) *InstanceDetails { s.LaunchConfigurationName = &v @@ -10065,6 +10229,12 @@ func (s *InstanceDetails) SetProtectedFromScaleIn(v bool) *InstanceDetails { return s } +// SetWeightedCapacity sets the WeightedCapacity field's value. +func (s *InstanceDetails) SetWeightedCapacity(v string) *InstanceDetails { + s.WeightedCapacity = &v + return s +} + // Describes whether detailed monitoring is enabled for the Auto Scaling instances. type InstanceMonitoring struct { _ struct{} `type:"structure"` @@ -10093,7 +10263,16 @@ func (s *InstanceMonitoring) SetEnabled(v bool) *InstanceMonitoring { // // The instances distribution specifies the distribution of On-Demand Instances // and Spot Instances, the maximum price to pay for Spot Instances, and how -// the Auto Scaling group allocates instance types. +// the Auto Scaling group allocates instance types to fulfill On-Demand and +// Spot capacity. +// +// When you update SpotAllocationStrategy, SpotInstancePools, or SpotMaxPrice, +// this update action does not deploy any changes across the running Amazon +// EC2 instances in the group. Your existing Spot Instances continue to run +// as long as the maximum price for those instances is higher than the current +// Spot price. When scale out occurs, Amazon EC2 Auto Scaling launches instances +// based on the new settings. When scale in occurs, Amazon EC2 Auto Scaling +// terminates instances according to the group's termination policies. type InstancesDistribution struct { _ struct{} `type:"structure"` @@ -10112,31 +10291,52 @@ type InstancesDistribution struct { // by On-Demand Instances. This base portion is provisioned first as your group // scales. // - // The default value is 0. If you leave this parameter set to 0, On-Demand Instances - // are launched as a percentage of the Auto Scaling group's desired capacity, - // per the OnDemandPercentageAboveBaseCapacity setting. + // Default if not set is 0. If you leave it set to 0, On-Demand Instances are + // launched as a percentage of the Auto Scaling group's desired capacity, per + // the OnDemandPercentageAboveBaseCapacity setting. + // + // An update to this setting means a gradual replacement of instances to maintain + // the specified number of On-Demand Instances for your base capacity. When + // replacing instances, Amazon EC2 Auto Scaling launches new instances before + // terminating the old ones. OnDemandBaseCapacity *int64 `type:"integer"` // Controls the percentages of On-Demand Instances and Spot Instances for your // additional capacity beyond OnDemandBaseCapacity. // - // The range is 0–100. The default value is 100. If you leave this parameter - // set to 100, the percentages are 100% for On-Demand Instances and 0% for Spot - // Instances. + // Default if not set is 100. If you leave it set to 100, the percentages are + // 100% for On-Demand Instances and 0% for Spot Instances. + // + // An update to this setting means a gradual replacement of instances to maintain + // the percentage of On-Demand Instances for your additional capacity above + // the base capacity. When replacing instances, Amazon EC2 Auto Scaling launches + // new instances before terminating the old ones. + // + // Valid Range: Minimum value of 0. Maximum value of 100. OnDemandPercentageAboveBaseCapacity *int64 `type:"integer"` - // Indicates how to allocate Spot capacity across Spot pools. + // Indicates how to allocate instances across Spot Instance pools. + // + // If the allocation strategy is lowest-price, the Auto Scaling group launches + // instances using the Spot pools with the lowest price, and evenly allocates + // your instances across the number of Spot pools that you specify. If the allocation + // strategy is capacity-optimized, the Auto Scaling group launches instances + // using Spot pools that are optimally chosen based on the available Spot capacity. // - // The only valid value is lowest-price, which is also the default value. The - // Auto Scaling group selects the cheapest Spot pools and evenly allocates your - // Spot capacity across the number of Spot pools that you specify. + // The default Spot allocation strategy for calls that you make through the + // API, the AWS CLI, or the AWS SDKs is lowest-price. The default Spot allocation + // strategy for the AWS Management Console is capacity-optimized. + // + // Valid values: lowest-price | capacity-optimized SpotAllocationStrategy *string `type:"string"` - // The number of Spot pools to use to allocate your Spot capacity. The Spot - // pools are determined from the different instance types in the Overrides array - // of LaunchTemplate. + // The number of Spot Instance pools across which to allocate your Spot Instances. + // The Spot pools are determined from the different instance types in the Overrides + // array of LaunchTemplate. Default if not set is 2. + // + // Used only when the Spot allocation strategy is lowest-price. // - // The range is 1–20 and the default is 2. + // Valid Range: Minimum value of 1. Maximum value of 20. SpotInstancePools *int64 `type:"integer"` // The maximum price per unit hour that you are willing to pay for a Spot Instance. @@ -10198,14 +10398,21 @@ func (s *InstancesDistribution) SetSpotMaxPrice(v string) *InstancesDistribution type LaunchConfiguration struct { _ struct{} `type:"structure"` - // [EC2-VPC] Indicates whether to assign a public IP address to each instance. + // For Auto Scaling groups that are running in a VPC, specifies whether to assign + // a public IP address to the group's instances. + // + // For more information, see Launching Auto Scaling Instances in a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html) + // in the Amazon EC2 Auto Scaling User Guide. AssociatePublicIpAddress *bool `type:"boolean"` // A block device mapping, which specifies the block devices for the instance. + // + // For more information, see Block Device Mapping (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html) + // in the Amazon EC2 User Guide for Linux Instances. BlockDeviceMappings []*BlockDeviceMapping `type:"list"` // The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. - // This parameter can only be used if you are launching EC2-Classic instances. + // // For more information, see ClassicLink (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) // in the Amazon EC2 User Guide for Linux Instances and Linking EC2-Classic // Instances to a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-ClassicLink) @@ -10213,13 +10420,11 @@ type LaunchConfiguration struct { ClassicLinkVPCId *string `min:"1" type:"string"` // The IDs of one or more security groups for the VPC specified in ClassicLinkVPCId. + // // For more information, see ClassicLink (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) // in the Amazon EC2 User Guide for Linux Instances and Linking EC2-Classic // Instances to a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-ClassicLink) // in the Amazon EC2 Auto Scaling User Guide. - // - // Conditional: This parameter is required if you specify a ClassicLink-enabled - // VPC, and cannot be used otherwise. ClassicLinkVPCSecurityGroups []*string `type:"list"` // The creation date and time for the launch configuration. @@ -10227,24 +10432,44 @@ type LaunchConfiguration struct { // CreatedTime is a required field CreatedTime *time.Time `type:"timestamp" required:"true"` - // Controls whether the instance is optimized for EBS I/O (true) or not (false). + // Specifies whether the launch configuration is optimized for EBS I/O (true) + // or not (false). + // + // For more information, see Amazon EBS-Optimized Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) + // in the Amazon EC2 User Guide for Linux Instances. EbsOptimized *bool `type:"boolean"` - // The name or Amazon Resource Name (ARN) of the instance profile associated - // with the IAM role for the instance. + // The name or the Amazon Resource Name (ARN) of the instance profile associated + // with the IAM role for the instance. The instance profile contains the IAM + // role. + // + // For more information, see IAM Role for Applications That Run on Amazon EC2 + // Instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/us-iam-role.html) + // in the Amazon EC2 Auto Scaling User Guide. IamInstanceProfile *string `min:"1" type:"string"` - // The ID of the Amazon Machine Image (AMI). + // The ID of the Amazon Machine Image (AMI) to use to launch your EC2 instances. + // + // For more information, see Finding an AMI (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html) + // in the Amazon EC2 User Guide for Linux Instances. // // ImageId is a required field ImageId *string `min:"1" type:"string" required:"true"` // Controls whether instances in this group are launched with detailed (true) // or basic (false) monitoring. + // + // For more information, see Configure Monitoring for Auto Scaling Instances + // (https://docs.aws.amazon.com/autoscaling/latest/userguide/as-instance-monitoring.html#enable-as-instance-metrics) + // in the Amazon EC2 Auto Scaling User Guide. InstanceMonitoring *InstanceMonitoring `type:"structure"` // The instance type for the instances. // + // For information about available instance types, see Available Instance Types + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#AvailableInstanceTypes) + // in the Amazon EC2 User Guide for Linux Instances. + // // InstanceType is a required field InstanceType *string `min:"1" type:"string" required:"true"` @@ -10252,6 +10477,9 @@ type LaunchConfiguration struct { KernelId *string `min:"1" type:"string"` // The name of the key pair. + // + // For more information, see Amazon EC2 Key Pairs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) + // in the Amazon EC2 User Guide for Linux Instances. KeyName *string `min:"1" type:"string"` // The Amazon Resource Name (ARN) of the launch configuration. @@ -10263,20 +10491,36 @@ type LaunchConfiguration struct { LaunchConfigurationName *string `min:"1" type:"string" required:"true"` // The tenancy of the instance, either default or dedicated. An instance with - // dedicated tenancy runs in an isolated, single-tenant hardware and can only - // be launched into a VPC. + // dedicated tenancy runs on isolated, single-tenant hardware and can only be + // launched into a VPC. + // + // For more information, see Instance Placement Tenancy (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-vpc-tenancy) + // in the Amazon EC2 Auto Scaling User Guide. PlacementTenancy *string `min:"1" type:"string"` // The ID of the RAM disk associated with the AMI. RamdiskId *string `min:"1" type:"string"` - // The security groups to associate with the instances. + // A list that contains the security groups to assign to the instances in the + // Auto Scaling group. + // + // For more information, see Security Groups for Your VPC (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) + // in the Amazon Virtual Private Cloud User Guide. SecurityGroups []*string `type:"list"` - // The price to bid when launching Spot Instances. + // The maximum hourly price to be paid for any Spot Instance launched to fulfill + // the request. Spot Instances are launched when the price you specify exceeds + // the current Spot price. + // + // For more information, see Launching Spot Instances in Your Auto Scaling Group + // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-spot-instances.html) + // in the Amazon EC2 Auto Scaling User Guide. SpotPrice *string `min:"1" type:"string"` - // The user data available to the instances. + // The Base64-encoded user data to make available to the launched EC2 instances. + // + // For more information, see Instance Metadata and User Data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) + // in the Amazon EC2 User Guide for Linux Instances. UserData *string `type:"string"` } @@ -10409,6 +10653,11 @@ func (s *LaunchConfiguration) SetUserData(v string) *LaunchConfiguration { // The overrides are used to override the instance type specified by the launch // template with multiple instance types that can be used to launch On-Demand // Instances and Spot Instances. +// +// When you update the launch template or overrides, existing Amazon EC2 instances +// continue to run. When scale out occurs, Amazon EC2 Auto Scaling launches +// instances to match the new settings. When scale in occurs, Amazon EC2 Auto +// Scaling terminates instances according to the group's termination policies. type LaunchTemplate struct { _ struct{} `type:"structure"` @@ -10416,10 +10665,9 @@ type LaunchTemplate struct { // or launch template name in the request. LaunchTemplateSpecification *LaunchTemplateSpecification `type:"structure"` - // Any parameters that you specify override the same parameters in the launch - // template. Currently, the only supported override is instance type. - // - // You must specify between 2 and 20 overrides. + // An optional setting. Any parameters that you specify override the same parameters + // in the launch template. Currently, the only supported override is instance + // type. You can specify between 1 and 20 instance types. Overrides []*LaunchTemplateOverrides `type:"list"` } @@ -10480,6 +10728,15 @@ type LaunchTemplateOverrides struct { // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#AvailableInstanceTypes) // in the Amazon Elastic Compute Cloud User Guide. InstanceType *string `min:"1" type:"string"` + + // The number of capacity units, which gives the instance type a proportional + // weight to other instance types. For example, larger instance types are generally + // weighted more than smaller instance types. These are the same units that + // you chose to set the desired capacity in terms of instances, or a performance + // attribute such as vCPUs, memory, or I/O. + // + // Valid Range: Minimum value of 1. Maximum value of 999. + WeightedCapacity *string `min:"1" type:"string"` } // String returns the string representation @@ -10498,6 +10755,9 @@ func (s *LaunchTemplateOverrides) Validate() error { if s.InstanceType != nil && len(*s.InstanceType) < 1 { invalidParams.Add(request.NewErrParamMinLen("InstanceType", 1)) } + if s.WeightedCapacity != nil && len(*s.WeightedCapacity) < 1 { + invalidParams.Add(request.NewErrParamMinLen("WeightedCapacity", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -10511,6 +10771,12 @@ func (s *LaunchTemplateOverrides) SetInstanceType(v string) *LaunchTemplateOverr return s } +// SetWeightedCapacity sets the WeightedCapacity field's value. +func (s *LaunchTemplateOverrides) SetWeightedCapacity(v string) *LaunchTemplateOverrides { + s.WeightedCapacity = &v + return s +} + // Describes a launch template and the launch template version. // // The launch template that is specified must be configured for use with an @@ -10584,8 +10850,8 @@ func (s *LaunchTemplateSpecification) SetVersion(v string) *LaunchTemplateSpecif } // Describes a lifecycle hook, which tells Amazon EC2 Auto Scaling that you -// want to perform an action whenever it launches instances or whenever it terminates -// instances. Used in response to DescribeLifecycleHooks. +// want to perform an action whenever it launches instances or terminates instances. +// Used in response to DescribeLifecycleHooks. type LifecycleHook struct { _ struct{} `type:"structure"` @@ -10717,7 +10983,7 @@ func (s *LifecycleHook) SetRoleARN(v string) *LifecycleHook { // launch or terminate. // // If you need more time, record the lifecycle action heartbeat to keep the -// instance in a pending state using using RecordLifecycleActionHeartbeat. +// instance in a pending state using RecordLifecycleActionHeartbeat. // // If you finish before the timeout period ends, complete the lifecycle action // using CompleteLifecycleAction. @@ -11085,27 +11351,27 @@ func (s *MetricGranularityType) SetGranularity(v string) *MetricGranularityType // Describes a mixed instances policy for an Auto Scaling group. With mixed // instances, your Auto Scaling group can provision a combination of On-Demand -// Instances and Spot Instances across multiple instance types. Used in combination -// with CreateAutoScalingGroup. For more information, see Auto Scaling Groups -// with Multiple Instance Types and Purchase Options (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html) +// Instances and Spot Instances across multiple instance types. For more information, +// see Auto Scaling Groups with Multiple Instance Types and Purchase Options +// (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html) // in the Amazon EC2 Auto Scaling User Guide. // -// When you create your Auto Scaling group, you can specify a launch configuration -// or template as a parameter for the top-level object, or you can specify a -// mixed instances policy, but not both at the same time. +// You can create a mixed instances policy for a new Auto Scaling group, or +// you can create it for an existing group by updating the group to specify +// MixedInstancesPolicy as the top-level parameter instead of a launch configuration +// or template. For more information, see CreateAutoScalingGroup and UpdateAutoScalingGroup. type MixedInstancesPolicy struct { _ struct{} `type:"structure"` // The instances distribution to use. // - // If you leave this parameter unspecified when creating the group, the default - // values are used. + // If you leave this parameter unspecified, the value for each parameter in + // InstancesDistribution uses a default value. InstancesDistribution *InstancesDistribution `type:"structure"` - // The launch template and overrides. + // The launch template and instance types (overrides). // - // This parameter is required when creating an Auto Scaling group with a mixed - // instances policy, but is not required when updating the group. + // This parameter must be specified when creating a mixed instances policy. LaunchTemplate *LaunchTemplate `type:"structure"` } @@ -11204,13 +11470,7 @@ func (s *NotificationConfiguration) SetTopicARN(v string) *NotificationConfigura type PredefinedMetricSpecification struct { _ struct{} `type:"structure"` - // The metric type. - // - // PredefinedMetricType is a required field - PredefinedMetricType *string `type:"string" required:"true" enum:"MetricType"` - - // Identifies the resource associated with the metric type. The following predefined - // metrics are available: + // The metric type. The following predefined metrics are available: // // * ASGAverageCPUUtilization - Average CPU utilization of the Auto Scaling // group. @@ -11222,17 +11482,23 @@ type PredefinedMetricSpecification struct { // interfaces by the Auto Scaling group. // // * ALBRequestCountPerTarget - Number of requests completed per target in - // an Application Load Balancer or a Network Load Balancer target group. - // - // For predefined metric types ASGAverageCPUUtilization, ASGAverageNetworkIn, - // and ASGAverageNetworkOut, the parameter must not be specified as the resource - // associated with the metric type is the Auto Scaling group. For predefined - // metric type ALBRequestCountPerTarget, the parameter must be specified in - // the format: app/load-balancer-name/load-balancer-id/targetgroup/target-group-name/target-group-id - // , where app/load-balancer-name/load-balancer-id is the final portion of the - // load balancer ARN, and targetgroup/target-group-name/target-group-id is the - // final portion of the target group ARN. The target group must be attached - // to the Auto Scaling group. + // an Application Load Balancer target group. + // + // PredefinedMetricType is a required field + PredefinedMetricType *string `type:"string" required:"true" enum:"MetricType"` + + // Identifies the resource associated with the metric type. You can't specify + // a resource label unless the metric type is ALBRequestCountPerTarget and there + // is a target group attached to the Auto Scaling group. + // + // The format is app/load-balancer-name/load-balancer-id/targetgroup/target-group-name/target-group-id + // , where + // + // * app/load-balancer-name/load-balancer-id is the final portion of the + // load balancer ARN, and + // + // * targetgroup/target-group-name/target-group-id is the final portion of + // the target group ARN. ResourceLabel *string `min:"1" type:"string"` } @@ -11576,12 +11842,12 @@ func (s PutNotificationConfigurationOutput) GoString() string { type PutScalingPolicyInput struct { _ struct{} `type:"structure"` - // The adjustment type. The valid values are ChangeInCapacity, ExactCapacity, - // and PercentChangeInCapacity. + // Specifies whether the ScalingAdjustment parameter is an absolute number or + // a percentage of the current capacity. The valid values are ChangeInCapacity, + // ExactCapacity, and PercentChangeInCapacity. // - // This parameter is supported if the policy type is SimpleScaling or StepScaling. - // - // For more information, see Dynamic Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scale-based-on-demand.html) + // Valid only if the policy type is StepScaling or SimpleScaling. For more information, + // see Scaling Adjustment Types (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment) // in the Amazon EC2 Auto Scaling User Guide. AdjustmentType *string `min:"1" type:"string"` @@ -11590,13 +11856,12 @@ type PutScalingPolicyInput struct { // AutoScalingGroupName is a required field AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - // The amount of time, in seconds, after a scaling activity completes and before - // the next scaling activity can start. If this parameter is not specified, - // the default cooldown period for the group applies. - // - // This parameter is supported if the policy type is SimpleScaling. + // The amount of time, in seconds, after a scaling activity completes before + // any further dynamic scaling activities can start. If this parameter is not + // specified, the default cooldown period for the group applies. // - // For more information, see Scaling Cooldowns (https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) + // Valid only if the policy type is SimpleScaling. For more information, see + // Scaling Cooldowns (https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) // in the Amazon EC2 Auto Scaling User Guide. Cooldown *int64 `type:"integer"` @@ -11604,14 +11869,14 @@ type PutScalingPolicyInput struct { // to the CloudWatch metrics. The default is to use the value specified for // the default cooldown period for the group. // - // This parameter is supported if the policy type is StepScaling or TargetTrackingScaling. + // Valid only if the policy type is StepScaling or TargetTrackingScaling. EstimatedInstanceWarmup *int64 `type:"integer"` // The aggregation type for the CloudWatch metrics. The valid values are Minimum, // Maximum, and Average. If the aggregation type is null, the value is treated // as Average. // - // This parameter is supported if the policy type is StepScaling. + // Valid only if the policy type is StepScaling. MetricAggregationType *string `min:"1" type:"string"` // The minimum number of instances to scale. If the value of AdjustmentType @@ -11619,7 +11884,14 @@ type PutScalingPolicyInput struct { // of the Auto Scaling group by at least this many instances. Otherwise, the // error is ValidationError. // - // This parameter is supported if the policy type is SimpleScaling or StepScaling. + // This property replaces the MinAdjustmentStep property. For example, suppose + // that you create a step scaling policy to scale out an Auto Scaling group + // by 25 percent and you specify a MinAdjustmentMagnitude of 2. If the group + // has 4 instances and the scaling policy is performed, 25 percent of 4 is 1. + // However, because you specified a MinAdjustmentMagnitude of 2, Amazon EC2 + // Auto Scaling scales out the group by 2 instances. + // + // Valid only if the policy type is SimpleScaling or StepScaling. MinAdjustmentMagnitude *int64 `type:"integer"` // Available for backward compatibility. Use MinAdjustmentMagnitude instead. @@ -11634,26 +11906,32 @@ type PutScalingPolicyInput struct { // If the policy type is null, the value is treated as SimpleScaling. PolicyType *string `min:"1" type:"string"` - // The amount by which to scale, based on the specified adjustment type. A positive - // value adds to the current capacity while a negative number removes from the - // current capacity. + // The amount by which a simple scaling policy scales the Auto Scaling group + // in response to an alarm breach. The adjustment is based on the value that + // you specified in the AdjustmentType parameter (either an absolute number + // or a percentage). A positive value adds to the current capacity and a negative + // value subtracts from the current capacity. For exact capacity, you must specify + // a positive value. // - // Conditional: This parameter is required if the policy type is SimpleScaling - // and not supported otherwise. + // Conditional: If you specify SimpleScaling for the policy type, you must specify + // this parameter. (Not used with any other policy type.) ScalingAdjustment *int64 `type:"integer"` // A set of adjustments that enable you to scale based on the size of the alarm // breach. // - // Conditional: This parameter is required if the policy type is StepScaling - // and not supported otherwise. + // Conditional: If you specify StepScaling for the policy type, you must specify + // this parameter. (Not used with any other policy type.) StepAdjustments []*StepAdjustment `type:"list"` // A target tracking scaling policy. Includes support for predefined or customized // metrics. // - // Conditional: This parameter is required if the policy type is TargetTrackingScaling - // and not supported otherwise. + // For more information, see TargetTrackingConfiguration (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_TargetTrackingConfiguration.html) + // in the Amazon EC2 Auto Scaling API Reference. + // + // Conditional: If you specify TargetTrackingScaling for the policy type, you + // must specify this parameter. (Not used with any other policy type.) TargetTrackingConfiguration *TargetTrackingConfiguration `type:"structure"` } @@ -11826,17 +12104,17 @@ type PutScheduledUpdateGroupActionInput struct { // AutoScalingGroupName is a required field AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - // The number of EC2 instances that should be running in the group. + // The number of EC2 instances that should be running in the Auto Scaling group. DesiredCapacity *int64 `type:"integer"` - // The time for the recurring schedule to end. Amazon EC2 Auto Scaling does - // not perform the action after this time. + // The date and time for the recurring schedule to end. Amazon EC2 Auto Scaling + // does not perform the action after this time. EndTime *time.Time `type:"timestamp"` - // The maximum size for the Auto Scaling group. + // The maximum number of instances in the Auto Scaling group. MaxSize *int64 `type:"integer"` - // The minimum size for the Auto Scaling group. + // The minimum number of instances in the Auto Scaling group. MinSize *int64 `type:"integer"` // The recurring schedule for this action, in Unix cron syntax format. This @@ -11844,6 +12122,9 @@ type PutScheduledUpdateGroupActionInput struct { // [Day_of_Month] [Month_of_Year] [Day_of_Week]. The value must be in quotes // (for example, "30 0 1 1,6,12 *"). For more information about this format, // see Crontab (http://crontab.org). + // + // When StartTime and EndTime are specified with Recurrence, they form the boundaries + // of when the recurring action starts and stops. Recurrence *string `min:"1" type:"string"` // The name of this scaling action. @@ -11851,8 +12132,8 @@ type PutScheduledUpdateGroupActionInput struct { // ScheduledActionName is a required field ScheduledActionName *string `min:"1" type:"string" required:"true"` - // The time for this action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT - // only and in quotes (for example, "2019-06-01T00:00:00Z"). + // The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ format + // in UTC/GMT only and in quotes (for example, "2019-06-01T00:00:00Z"). // // If you specify Recurrence and StartTime, Amazon EC2 Auto Scaling performs // the action at this time, and then performs the action based on the specified @@ -11862,7 +12143,7 @@ type PutScheduledUpdateGroupActionInput struct { // an error message. StartTime *time.Time `type:"timestamp"` - // This parameter is deprecated. + // This parameter is no longer used. Time *time.Time `type:"timestamp"` } @@ -12122,7 +12403,7 @@ type ScalingPolicy struct { // The name of the scaling policy. PolicyName *string `min:"1" type:"string"` - // The policy type. The valid values are SimpleScaling and StepScaling. + // The policy type. The valid values are SimpleScaling, StepScaling, and TargetTrackingScaling. PolicyType *string `min:"1" type:"string"` // The amount by which to scale, based on the specified adjustment type. A positive @@ -12309,16 +12590,20 @@ type ScheduledUpdateGroupAction struct { // The number of instances you prefer to maintain in the group. DesiredCapacity *int64 `type:"integer"` - // The date and time that the action is scheduled to end. + // The date and time in UTC for the recurring schedule to end. For example, + // "2019-06-01T00:00:00Z". EndTime *time.Time `type:"timestamp"` - // The maximum size of the group. + // The maximum number of instances in the Auto Scaling group. MaxSize *int64 `type:"integer"` - // The minimum size of the group. + // The minimum number of instances in the Auto Scaling group. MinSize *int64 `type:"integer"` - // The recurring schedule for the action. + // The recurring schedule for the action, in Unix cron syntax format. + // + // When StartTime and EndTime are specified with Recurrence, they form the boundaries + // of when the recurring action starts and stops. Recurrence *string `min:"1" type:"string"` // The Amazon Resource Name (ARN) of the scheduled action. @@ -12327,13 +12612,10 @@ type ScheduledUpdateGroupAction struct { // The name of the scheduled action. ScheduledActionName *string `min:"1" type:"string"` - // The date and time that the action is scheduled to begin. - // - // When StartTime and EndTime are specified with Recurrence, they form the boundaries - // of when the recurring action starts and stops. + // The date and time in UTC for this action to start. For example, "2019-06-01T00:00:00Z". StartTime *time.Time `type:"timestamp"` - // This parameter is deprecated. + // This parameter is no longer used. Time *time.Time `type:"timestamp"` } @@ -12418,20 +12700,23 @@ type ScheduledUpdateGroupActionRequest struct { // The number of EC2 instances that should be running in the group. DesiredCapacity *int64 `type:"integer"` - // The time for the recurring schedule to end. Amazon EC2 Auto Scaling does - // not perform the action after this time. + // The date and time for the recurring schedule to end. Amazon EC2 Auto Scaling + // does not perform the action after this time. EndTime *time.Time `type:"timestamp"` - // The maximum size of the group. + // The maximum number of instances in the Auto Scaling group. MaxSize *int64 `type:"integer"` - // The minimum size of the group. + // The minimum number of instances in the Auto Scaling group. MinSize *int64 `type:"integer"` // The recurring schedule for the action, in Unix cron syntax format. This format // consists of five fields separated by white spaces: [Minute] [Hour] [Day_of_Month] // [Month_of_Year] [Day_of_Week]. The value must be in quotes (for example, // "30 0 1 1,6,12 *"). For more information about this format, see Crontab (http://crontab.org). + // + // When StartTime and EndTime are specified with Recurrence, they form the boundaries + // of when the recurring action starts and stops. Recurrence *string `min:"1" type:"string"` // The name of the scaling action. @@ -12439,8 +12724,8 @@ type ScheduledUpdateGroupActionRequest struct { // ScheduledActionName is a required field ScheduledActionName *string `min:"1" type:"string" required:"true"` - // The time for the action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT - // only and in quotes (for example, "2019-06-01T00:00:00Z"). + // The date and time for the action to start, in YYYY-MM-DDThh:mm:ssZ format + // in UTC/GMT only and in quotes (for example, "2019-06-01T00:00:00Z"). // // If you specify Recurrence and StartTime, Amazon EC2 Auto Scaling performs // the action at this time, and then performs the action based on the specified @@ -13065,17 +13350,17 @@ func (s *TagDescription) SetValue(v string) *TagDescription { type TargetTrackingConfiguration struct { _ struct{} `type:"structure"` - // A customized metric. You can specify either a predefined metric or a customized + // A customized metric. You must specify either a predefined metric or a customized // metric. CustomizedMetricSpecification *CustomizedMetricSpecification `type:"structure"` // Indicates whether scaling in by the target tracking scaling policy is disabled. // If scaling in is disabled, the target tracking scaling policy doesn't remove // instances from the Auto Scaling group. Otherwise, the target tracking scaling - // policy can remove instances from the Auto Scaling group. The default is disabled. + // policy can remove instances from the Auto Scaling group. The default is false. DisableScaleIn *bool `type:"boolean"` - // A predefined metric. You can specify either a predefined metric or a customized + // A predefined metric. You must specify either a predefined metric or a customized // metric. PredefinedMetricSpecification *PredefinedMetricSpecification `type:"structure"` @@ -13233,9 +13518,12 @@ type UpdateAutoScalingGroupInput struct { AvailabilityZones []*string `min:"1" type:"list"` // The amount of time, in seconds, after a scaling activity completes before - // another scaling activity can start. The default value is 300. + // another scaling activity can start. The default value is 300. This cooldown + // period is not used when a scaling-specific cooldown is specified. // - // For more information, see Scaling Cooldowns (https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) + // Cooldown periods are not supported for target tracking scaling policies, + // step scaling policies, or scheduled scaling. For more information, see Scaling + // Cooldowns (https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) // in the Amazon EC2 Auto Scaling User Guide. DefaultCooldown *int64 `type:"integer"` @@ -13248,7 +13536,7 @@ type UpdateAutoScalingGroupInput struct { // checking the health status of an EC2 instance that has come into service. // The default value is 0. // - // For more information, see Health Checks for Auto Scaling Instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html) + // For more information, see Health Check Grace Period (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html#health-check-grace-period) // in the Amazon EC2 Auto Scaling User Guide. // // Conditional: This parameter is required if you are adding an ELB health check. @@ -13260,26 +13548,37 @@ type UpdateAutoScalingGroupInput struct { // balancer health checks. HealthCheckType *string `min:"1" type:"string"` - // The name of the launch configuration. If you specify this parameter, you - // can't specify a launch template or a mixed instances policy. + // The name of the launch configuration. If you specify LaunchConfigurationName + // in your update request, you can't specify LaunchTemplate or MixedInstancesPolicy. LaunchConfigurationName *string `min:"1" type:"string"` // The launch template and version to use to specify the updates. If you specify - // this parameter, you can't specify a launch configuration or a mixed instances - // policy. + // LaunchTemplate in your update request, you can't specify LaunchConfigurationName + // or MixedInstancesPolicy. + // + // For more information, see LaunchTemplateSpecification (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_LaunchTemplateSpecification.html) + // in the Amazon EC2 Auto Scaling API Reference. LaunchTemplate *LaunchTemplateSpecification `type:"structure"` + // The maximum amount of time, in seconds, that an instance can be in service. + // + // Valid Range: Minimum value of 604800. + MaxInstanceLifetime *int64 `type:"integer"` + // The maximum size of the Auto Scaling group. MaxSize *int64 `type:"integer"` // The minimum size of the Auto Scaling group. MinSize *int64 `type:"integer"` - // The mixed instances policy to use to specify the updates. If you specify - // this parameter, you can't specify a launch configuration or a launch template. + // An embedded object that specifies a mixed instances policy. + // + // In your call to UpdateAutoScalingGroup, you can make changes to the policy + // that is specified. All optional parameters are left unchanged if not specified. // - // For more information, see Auto Scaling Groups with Multiple Instance Types - // and Purchase Options (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html) + // For more information, see MixedInstancesPolicy (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_MixedInstancesPolicy.html) + // in the Amazon EC2 Auto Scaling API Reference and Auto Scaling Groups with + // Multiple Instance Types and Purchase Options (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html) // in the Amazon EC2 Auto Scaling User Guide. MixedInstancesPolicy *MixedInstancesPolicy `type:"structure"` @@ -13313,7 +13612,7 @@ type UpdateAutoScalingGroupInput struct { // in the Amazon EC2 Auto Scaling User Guide. TerminationPolicies []*string `type:"list"` - // A comma-separated list of subnet IDs, if you are launching into a VPC. + // A comma-separated list of subnet IDs for virtual private cloud (VPC). // // If you specify VPCZoneIdentifier with AvailabilityZones, the subnets that // you specify for this parameter must reside in those Availability Zones. @@ -13422,6 +13721,12 @@ func (s *UpdateAutoScalingGroupInput) SetLaunchTemplate(v *LaunchTemplateSpecifi return s } +// SetMaxInstanceLifetime sets the MaxInstanceLifetime field's value. +func (s *UpdateAutoScalingGroupInput) SetMaxInstanceLifetime(v int64) *UpdateAutoScalingGroupInput { + s.MaxInstanceLifetime = &v + return s +} + // SetMaxSize sets the MaxSize field's value. func (s *UpdateAutoScalingGroupInput) SetMaxSize(v int64) *UpdateAutoScalingGroupInput { s.MaxSize = &v diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/doc.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/doc.go index 96cf6308..0a2fe8c3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/doc.go @@ -4,9 +4,9 @@ // requests to Auto Scaling. // // Amazon EC2 Auto Scaling is designed to automatically launch or terminate -// EC2 instances based on user-defined policies, schedules, and health checks. -// Use this service with AWS Auto Scaling, Amazon CloudWatch, and Elastic Load -// Balancing. +// EC2 instances based on user-defined scaling policies, scheduled actions, +// and health checks. Use this service with AWS Auto Scaling, Amazon CloudWatch, +// and Elastic Load Balancing. // // For more information, including information about granting IAM users required // permissions for Amazon EC2 Auto Scaling actions, see the Amazon EC2 Auto diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go index e1da9fd7..644838dd 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "autoscaling" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Auto Scaling" // ServiceID is a unique identifer of a specific service. + ServiceID = "Auto Scaling" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the AutoScaling client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a AutoScaling client from just a session. // svc := autoscaling.New(mySession) // @@ -46,11 +48,11 @@ const ( // svc := autoscaling.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *AutoScaling { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, 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) *AutoScaling { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *AutoScaling { svc := &AutoScaling{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2011-01-01", }, diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go index e0ac414e..4b5eb738 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go @@ -245,10 +245,11 @@ func (c *CloudFormation) CreateChangeSetRequest(input *CreateChangeSetInput) (re // // To create a change set for a stack that doesn't exist, for the ChangeSetType // parameter, specify CREATE. To create a change set for an existing stack, -// specify UPDATE for the ChangeSetType parameter. After the CreateChangeSet -// call successfully completes, AWS CloudFormation starts creating the change -// set. To check the status of the change set or to review it, use the DescribeChangeSet -// action. +// specify UPDATE for the ChangeSetType parameter. To create a change set for +// an import operation, specify IMPORT for the ChangeSetType parameter. After +// the CreateChangeSet call successfully completes, AWS CloudFormation starts +// creating the change set. To check the status of the change set or to review +// it, use the DescribeChangeSet action. // // When you are satisfied with the changes the change set will make, execute // the change set by using the ExecuteChangeSet action. AWS CloudFormation doesn't @@ -930,6 +931,99 @@ func (c *CloudFormation) DeleteStackSetWithContext(ctx aws.Context, input *Delet return out, req.Send() } +const opDeregisterType = "DeregisterType" + +// DeregisterTypeRequest generates a "aws/request.Request" representing the +// client's request for the DeregisterType operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeregisterType for more information on using the DeregisterType +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeregisterTypeRequest method. +// req, resp := client.DeregisterTypeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeregisterType +func (c *CloudFormation) DeregisterTypeRequest(input *DeregisterTypeInput) (req *request.Request, output *DeregisterTypeOutput) { + op := &request.Operation{ + Name: opDeregisterType, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeregisterTypeInput{} + } + + output = &DeregisterTypeOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeregisterType API operation for AWS CloudFormation. +// +// Removes a type or type version from active use in the CloudFormation registry. +// If a type or type version is deregistered, it cannot be used in CloudFormation +// operations. +// +// To deregister a type, you must individually deregister all registered versions +// of that type. If a type has only a single registered version, deregistering +// that version results in the type itself being deregistered. +// +// You cannot deregister the default version of a type, unless it is the only +// registered version of that type, in which case the type itself is deregistered +// as well. +// +// 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 CloudFormation's +// API operation DeregisterType for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCFNRegistryException "CFNRegistryException" +// An error occurred during a CloudFormation registry operation. +// +// * ErrCodeTypeNotFoundException "TypeNotFoundException" +// The specified type does not exist in the CloudFormation registry. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeregisterType +func (c *CloudFormation) DeregisterType(input *DeregisterTypeInput) (*DeregisterTypeOutput, error) { + req, out := c.DeregisterTypeRequest(input) + return out, req.Send() +} + +// DeregisterTypeWithContext is the same as DeregisterType with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterType 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 *CloudFormation) DeregisterTypeWithContext(ctx aws.Context, input *DeregisterTypeInput, opts ...request.Option) (*DeregisterTypeOutput, error) { + req, out := c.DeregisterTypeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeAccountLimits = "DescribeAccountLimits" // DescribeAccountLimitsRequest generates a "aws/request.Request" representing the @@ -1304,10 +1398,12 @@ func (c *CloudFormation) DescribeStackEventsPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeStackEventsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeStackEventsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1608,10 +1704,12 @@ func (c *CloudFormation) DescribeStackResourceDriftsPagesWithContext(ctx aws.Con }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeStackResourceDriftsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeStackResourceDriftsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1993,13 +2091,187 @@ func (c *CloudFormation) DescribeStacksPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeStacksOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeStacksOutput), !p.HasNextPage()) { + break + } } + return p.Err() } +const opDescribeType = "DescribeType" + +// DescribeTypeRequest generates a "aws/request.Request" representing the +// client's request for the DescribeType operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeType for more information on using the DescribeType +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeTypeRequest method. +// req, resp := client.DescribeTypeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeType +func (c *CloudFormation) DescribeTypeRequest(input *DescribeTypeInput) (req *request.Request, output *DescribeTypeOutput) { + op := &request.Operation{ + Name: opDescribeType, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeTypeInput{} + } + + output = &DescribeTypeOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeType API operation for AWS CloudFormation. +// +// Returns detailed information about a type that has been registered. +// +// If you specify a VersionId, DescribeType returns information about that specific +// type version. Otherwise, it returns information about the default type version. +// +// 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 CloudFormation's +// API operation DescribeType for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCFNRegistryException "CFNRegistryException" +// An error occurred during a CloudFormation registry operation. +// +// * ErrCodeTypeNotFoundException "TypeNotFoundException" +// The specified type does not exist in the CloudFormation registry. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeType +func (c *CloudFormation) DescribeType(input *DescribeTypeInput) (*DescribeTypeOutput, error) { + req, out := c.DescribeTypeRequest(input) + return out, req.Send() +} + +// DescribeTypeWithContext is the same as DescribeType with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeType 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 *CloudFormation) DescribeTypeWithContext(ctx aws.Context, input *DescribeTypeInput, opts ...request.Option) (*DescribeTypeOutput, error) { + req, out := c.DescribeTypeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeTypeRegistration = "DescribeTypeRegistration" + +// DescribeTypeRegistrationRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTypeRegistration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeTypeRegistration for more information on using the DescribeTypeRegistration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeTypeRegistrationRequest method. +// req, resp := client.DescribeTypeRegistrationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeTypeRegistration +func (c *CloudFormation) DescribeTypeRegistrationRequest(input *DescribeTypeRegistrationInput) (req *request.Request, output *DescribeTypeRegistrationOutput) { + op := &request.Operation{ + Name: opDescribeTypeRegistration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeTypeRegistrationInput{} + } + + output = &DescribeTypeRegistrationOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeTypeRegistration API operation for AWS CloudFormation. +// +// Returns information about a type's registration, including its current status +// and type and version identifiers. +// +// When you initiate a registration request using RegisterType , you can then +// use DescribeTypeRegistration to monitor the progress of that registration +// request. +// +// Once the registration request has completed, use DescribeType to return detailed +// informaiton about a type. +// +// 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 CloudFormation's +// API operation DescribeTypeRegistration for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCFNRegistryException "CFNRegistryException" +// An error occurred during a CloudFormation registry operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeTypeRegistration +func (c *CloudFormation) DescribeTypeRegistration(input *DescribeTypeRegistrationInput) (*DescribeTypeRegistrationOutput, error) { + req, out := c.DescribeTypeRegistrationRequest(input) + return out, req.Send() +} + +// DescribeTypeRegistrationWithContext is the same as DescribeTypeRegistration with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTypeRegistration 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 *CloudFormation) DescribeTypeRegistrationWithContext(ctx aws.Context, input *DescribeTypeRegistrationInput, opts ...request.Option) (*DescribeTypeRegistrationOutput, error) { + req, out := c.DescribeTypeRegistrationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDetectStackDrift = "DetectStackDrift" // DetectStackDriftRequest generates a "aws/request.Request" representing the @@ -2186,6 +2458,124 @@ func (c *CloudFormation) DetectStackResourceDriftWithContext(ctx aws.Context, in return out, req.Send() } +const opDetectStackSetDrift = "DetectStackSetDrift" + +// DetectStackSetDriftRequest generates a "aws/request.Request" representing the +// client's request for the DetectStackSetDrift operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DetectStackSetDrift for more information on using the DetectStackSetDrift +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DetectStackSetDriftRequest method. +// req, resp := client.DetectStackSetDriftRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DetectStackSetDrift +func (c *CloudFormation) DetectStackSetDriftRequest(input *DetectStackSetDriftInput) (req *request.Request, output *DetectStackSetDriftOutput) { + op := &request.Operation{ + Name: opDetectStackSetDrift, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DetectStackSetDriftInput{} + } + + output = &DetectStackSetDriftOutput{} + req = c.newRequest(op, input, output) + return +} + +// DetectStackSetDrift API operation for AWS CloudFormation. +// +// Detect drift on a stack set. When CloudFormation performs drift detection +// on a stack set, it performs drift detection on the stack associated with +// each stack instance in the stack set. For more information, see How CloudFormation +// Performs Drift Detection on a Stack Set (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html). +// +// DetectStackSetDrift returns the OperationId of the stack set drift detection +// operation. Use this operation id with DescribeStackSetOperation to monitor +// the progress of the drift detection operation. The drift detection operation +// may take some time, depending on the number of stack instances included in +// the stack set, as well as the number of resources included in each stack. +// +// Once the operation has completed, use the following actions to return drift +// information: +// +// * Use DescribeStackSet to return detailed informaiton about the stack +// set, including detailed information about the last completed drift operation +// performed on the stack set. (Information about drift operations that are +// in progress is not included.) +// +// * Use ListStackInstances to return a list of stack instances belonging +// to the stack set, including the drift status and last drift time checked +// of each instance. +// +// * Use DescribeStackInstance to return detailed information about a specific +// stack instance, including its drift status and last drift time checked. +// +// For more information on performing a drift detection operation on a stack +// set, see Detecting Unmanaged Changes in Stack Sets (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html). +// +// You can only run a single drift detection operation on a given stack set +// at one time. +// +// To stop a drift detection stack set operation, use StopStackSetOperation . +// +// 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 CloudFormation's +// API operation DetectStackSetDrift for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidOperationException "InvalidOperationException" +// The specified operation isn't valid. +// +// * ErrCodeOperationInProgressException "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. +// +// * ErrCodeStackSetNotFoundException "StackSetNotFoundException" +// The specified stack set doesn't exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DetectStackSetDrift +func (c *CloudFormation) DetectStackSetDrift(input *DetectStackSetDriftInput) (*DetectStackSetDriftOutput, error) { + req, out := c.DetectStackSetDriftRequest(input) + return out, req.Send() +} + +// DetectStackSetDriftWithContext is the same as DetectStackSetDrift with the addition of +// the ability to pass a context and additional request options. +// +// See DetectStackSetDrift 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 *CloudFormation) DetectStackSetDriftWithContext(ctx aws.Context, input *DetectStackSetDriftInput, opts ...request.Option) (*DetectStackSetDriftOutput, error) { + req, out := c.DetectStackSetDriftRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opEstimateTemplateCost = "EstimateTemplateCost" // EstimateTemplateCostRequest generates a "aws/request.Request" representing the @@ -2821,10 +3211,12 @@ func (c *CloudFormation) ListExportsPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListExportsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListExportsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2957,10 +3349,12 @@ func (c *CloudFormation) ListImportsPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListImportsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListImportsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3171,10 +3565,12 @@ func (c *CloudFormation) ListStackResourcesPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStackResourcesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListStackResourcesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3541,856 +3937,2912 @@ func (c *CloudFormation) ListStacksPagesWithContext(ctx aws.Context, input *List }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStacksOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListStacksOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opSetStackPolicy = "SetStackPolicy" +const opListTypeRegistrations = "ListTypeRegistrations" -// SetStackPolicyRequest generates a "aws/request.Request" representing the -// client's request for the SetStackPolicy operation. The "output" return +// ListTypeRegistrationsRequest generates a "aws/request.Request" representing the +// client's request for the ListTypeRegistrations operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See SetStackPolicy for more information on using the SetStackPolicy +// See ListTypeRegistrations for more information on using the ListTypeRegistrations // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the SetStackPolicyRequest method. -// req, resp := client.SetStackPolicyRequest(params) +// // Example sending a request using the ListTypeRegistrationsRequest method. +// req, resp := client.ListTypeRegistrationsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetStackPolicy -func (c *CloudFormation) SetStackPolicyRequest(input *SetStackPolicyInput) (req *request.Request, output *SetStackPolicyOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListTypeRegistrations +func (c *CloudFormation) ListTypeRegistrationsRequest(input *ListTypeRegistrationsInput) (req *request.Request, output *ListTypeRegistrationsOutput) { op := &request.Operation{ - Name: opSetStackPolicy, + Name: opListTypeRegistrations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &SetStackPolicyInput{} + input = &ListTypeRegistrationsInput{} } - output = &SetStackPolicyOutput{} + output = &ListTypeRegistrationsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// SetStackPolicy API operation for AWS CloudFormation. +// ListTypeRegistrations API operation for AWS CloudFormation. // -// Sets a stack policy for a specified stack. +// Returns a list of registration tokens for the specified type. // // 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 CloudFormation's -// API operation SetStackPolicy for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetStackPolicy -func (c *CloudFormation) SetStackPolicy(input *SetStackPolicyInput) (*SetStackPolicyOutput, error) { - req, out := c.SetStackPolicyRequest(input) +// API operation ListTypeRegistrations for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCFNRegistryException "CFNRegistryException" +// An error occurred during a CloudFormation registry operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListTypeRegistrations +func (c *CloudFormation) ListTypeRegistrations(input *ListTypeRegistrationsInput) (*ListTypeRegistrationsOutput, error) { + req, out := c.ListTypeRegistrationsRequest(input) return out, req.Send() } -// SetStackPolicyWithContext is the same as SetStackPolicy with the addition of +// ListTypeRegistrationsWithContext is the same as ListTypeRegistrations with the addition of // the ability to pass a context and additional request options. // -// See SetStackPolicy for details on how to use this API operation. +// See ListTypeRegistrations 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 *CloudFormation) SetStackPolicyWithContext(ctx aws.Context, input *SetStackPolicyInput, opts ...request.Option) (*SetStackPolicyOutput, error) { - req, out := c.SetStackPolicyRequest(input) +func (c *CloudFormation) ListTypeRegistrationsWithContext(ctx aws.Context, input *ListTypeRegistrationsInput, opts ...request.Option) (*ListTypeRegistrationsOutput, error) { + req, out := c.ListTypeRegistrationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opSignalResource = "SignalResource" +// ListTypeRegistrationsPages iterates over the pages of a ListTypeRegistrations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTypeRegistrations 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 ListTypeRegistrations operation. +// pageNum := 0 +// err := client.ListTypeRegistrationsPages(params, +// func(page *cloudformation.ListTypeRegistrationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CloudFormation) ListTypeRegistrationsPages(input *ListTypeRegistrationsInput, fn func(*ListTypeRegistrationsOutput, bool) bool) error { + return c.ListTypeRegistrationsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// SignalResourceRequest generates a "aws/request.Request" representing the -// client's request for the SignalResource operation. The "output" return +// ListTypeRegistrationsPagesWithContext same as ListTypeRegistrationsPages 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 *CloudFormation) ListTypeRegistrationsPagesWithContext(ctx aws.Context, input *ListTypeRegistrationsInput, fn func(*ListTypeRegistrationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTypeRegistrationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTypeRegistrationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTypeRegistrationsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTypeVersions = "ListTypeVersions" + +// ListTypeVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListTypeVersions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See SignalResource for more information on using the SignalResource +// See ListTypeVersions for more information on using the ListTypeVersions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the SignalResourceRequest method. -// req, resp := client.SignalResourceRequest(params) +// // Example sending a request using the ListTypeVersionsRequest method. +// req, resp := client.ListTypeVersionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SignalResource -func (c *CloudFormation) SignalResourceRequest(input *SignalResourceInput) (req *request.Request, output *SignalResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListTypeVersions +func (c *CloudFormation) ListTypeVersionsRequest(input *ListTypeVersionsInput) (req *request.Request, output *ListTypeVersionsOutput) { op := &request.Operation{ - Name: opSignalResource, + Name: opListTypeVersions, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &SignalResourceInput{} + input = &ListTypeVersionsInput{} } - output = &SignalResourceOutput{} + output = &ListTypeVersionsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// SignalResource API operation for AWS CloudFormation. +// ListTypeVersions API operation for AWS CloudFormation. // -// Sends a signal to the specified resource with a success or failure status. -// You can use the SignalResource API in conjunction with a creation policy -// or update policy. AWS CloudFormation doesn't proceed with a stack creation -// or update until resources receive the required number of signals or the timeout -// period is exceeded. The SignalResource API is useful in cases where you want -// to send signals from anywhere other than an Amazon EC2 instance. +// Returns summary information about the versions of a type. // // 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 CloudFormation's -// API operation SignalResource for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SignalResource -func (c *CloudFormation) SignalResource(input *SignalResourceInput) (*SignalResourceOutput, error) { - req, out := c.SignalResourceRequest(input) +// API operation ListTypeVersions for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCFNRegistryException "CFNRegistryException" +// An error occurred during a CloudFormation registry operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListTypeVersions +func (c *CloudFormation) ListTypeVersions(input *ListTypeVersionsInput) (*ListTypeVersionsOutput, error) { + req, out := c.ListTypeVersionsRequest(input) return out, req.Send() } -// SignalResourceWithContext is the same as SignalResource with the addition of +// ListTypeVersionsWithContext is the same as ListTypeVersions with the addition of // the ability to pass a context and additional request options. // -// See SignalResource for details on how to use this API operation. +// See ListTypeVersions 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 *CloudFormation) SignalResourceWithContext(ctx aws.Context, input *SignalResourceInput, opts ...request.Option) (*SignalResourceOutput, error) { - req, out := c.SignalResourceRequest(input) +func (c *CloudFormation) ListTypeVersionsWithContext(ctx aws.Context, input *ListTypeVersionsInput, opts ...request.Option) (*ListTypeVersionsOutput, error) { + req, out := c.ListTypeVersionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStopStackSetOperation = "StopStackSetOperation" +// ListTypeVersionsPages iterates over the pages of a ListTypeVersions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTypeVersions 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 ListTypeVersions operation. +// pageNum := 0 +// err := client.ListTypeVersionsPages(params, +// func(page *cloudformation.ListTypeVersionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CloudFormation) ListTypeVersionsPages(input *ListTypeVersionsInput, fn func(*ListTypeVersionsOutput, bool) bool) error { + return c.ListTypeVersionsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// StopStackSetOperationRequest generates a "aws/request.Request" representing the -// client's request for the StopStackSetOperation operation. The "output" return +// ListTypeVersionsPagesWithContext same as ListTypeVersionsPages 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 *CloudFormation) ListTypeVersionsPagesWithContext(ctx aws.Context, input *ListTypeVersionsInput, fn func(*ListTypeVersionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTypeVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTypeVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTypeVersionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTypes = "ListTypes" + +// ListTypesRequest generates a "aws/request.Request" representing the +// client's request for the ListTypes operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StopStackSetOperation for more information on using the StopStackSetOperation +// See ListTypes for more information on using the ListTypes // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StopStackSetOperationRequest method. -// req, resp := client.StopStackSetOperationRequest(params) +// // Example sending a request using the ListTypesRequest method. +// req, resp := client.ListTypesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/StopStackSetOperation -func (c *CloudFormation) StopStackSetOperationRequest(input *StopStackSetOperationInput) (req *request.Request, output *StopStackSetOperationOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListTypes +func (c *CloudFormation) ListTypesRequest(input *ListTypesInput) (req *request.Request, output *ListTypesOutput) { op := &request.Operation{ - Name: opStopStackSetOperation, + Name: opListTypes, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &StopStackSetOperationInput{} + input = &ListTypesInput{} } - output = &StopStackSetOperationOutput{} + output = &ListTypesOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// StopStackSetOperation API operation for AWS CloudFormation. +// ListTypes API operation for AWS CloudFormation. // -// Stops an in-progress operation on a stack set and its associated stack instances. +// Returns summary information about types that have been registered with CloudFormation. // // 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 CloudFormation's -// API operation StopStackSetOperation for usage and error information. +// API operation ListTypes for usage and error information. // // Returned Error Codes: -// * ErrCodeStackSetNotFoundException "StackSetNotFoundException" -// The specified stack set doesn't exist. -// -// * ErrCodeOperationNotFoundException "OperationNotFoundException" -// The specified ID refers to an operation that doesn't exist. -// -// * ErrCodeInvalidOperationException "InvalidOperationException" -// The specified operation isn't valid. +// * ErrCodeCFNRegistryException "CFNRegistryException" +// An error occurred during a CloudFormation registry operation. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/StopStackSetOperation -func (c *CloudFormation) StopStackSetOperation(input *StopStackSetOperationInput) (*StopStackSetOperationOutput, error) { - req, out := c.StopStackSetOperationRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListTypes +func (c *CloudFormation) ListTypes(input *ListTypesInput) (*ListTypesOutput, error) { + req, out := c.ListTypesRequest(input) return out, req.Send() } -// StopStackSetOperationWithContext is the same as StopStackSetOperation with the addition of +// ListTypesWithContext is the same as ListTypes with the addition of // the ability to pass a context and additional request options. // -// See StopStackSetOperation for details on how to use this API operation. +// See ListTypes 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 *CloudFormation) StopStackSetOperationWithContext(ctx aws.Context, input *StopStackSetOperationInput, opts ...request.Option) (*StopStackSetOperationOutput, error) { - req, out := c.StopStackSetOperationRequest(input) +func (c *CloudFormation) ListTypesWithContext(ctx aws.Context, input *ListTypesInput, opts ...request.Option) (*ListTypesOutput, error) { + req, out := c.ListTypesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateStack = "UpdateStack" +// ListTypesPages iterates over the pages of a ListTypes operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTypes 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 ListTypes operation. +// pageNum := 0 +// err := client.ListTypesPages(params, +// func(page *cloudformation.ListTypesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CloudFormation) ListTypesPages(input *ListTypesInput, fn func(*ListTypesOutput, bool) bool) error { + return c.ListTypesPagesWithContext(aws.BackgroundContext(), input, fn) +} -// UpdateStackRequest generates a "aws/request.Request" representing the -// client's request for the UpdateStack operation. The "output" return +// ListTypesPagesWithContext same as ListTypesPages 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 *CloudFormation) ListTypesPagesWithContext(ctx aws.Context, input *ListTypesInput, fn func(*ListTypesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTypesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTypesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTypesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opRecordHandlerProgress = "RecordHandlerProgress" + +// RecordHandlerProgressRequest generates a "aws/request.Request" representing the +// client's request for the RecordHandlerProgress operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateStack for more information on using the UpdateStack +// See RecordHandlerProgress for more information on using the RecordHandlerProgress // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateStackRequest method. -// req, resp := client.UpdateStackRequest(params) +// // Example sending a request using the RecordHandlerProgressRequest method. +// req, resp := client.RecordHandlerProgressRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStack -func (c *CloudFormation) UpdateStackRequest(input *UpdateStackInput) (req *request.Request, output *UpdateStackOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/RecordHandlerProgress +func (c *CloudFormation) RecordHandlerProgressRequest(input *RecordHandlerProgressInput) (req *request.Request, output *RecordHandlerProgressOutput) { op := &request.Operation{ - Name: opUpdateStack, + Name: opRecordHandlerProgress, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateStackInput{} + input = &RecordHandlerProgressInput{} } - output = &UpdateStackOutput{} + output = &RecordHandlerProgressOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateStack API operation for AWS CloudFormation. -// -// Updates a stack as specified in the template. After the call completes successfully, -// the stack update starts. You can check the status of the stack via the DescribeStacks -// action. +// RecordHandlerProgress API operation for AWS CloudFormation. // -// To get a copy of the template for an existing stack, you can use the GetTemplate -// action. +// Reports progress of a resource handler to CloudFormation. // -// For more information about creating an update template, updating a stack, -// and monitoring the progress of the update, see Updating a Stack (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks.html). +// Reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). +// Do not use this API in your code. // // 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 CloudFormation's -// API operation UpdateStack for usage and error information. +// API operation RecordHandlerProgress for usage and error information. // // Returned Error Codes: -// * ErrCodeInsufficientCapabilitiesException "InsufficientCapabilitiesException" -// The template contains resources with capabilities that weren't specified -// in the Capabilities parameter. +// * ErrCodeInvalidStateTransitionException "InvalidStateTransition" +// Error reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). +// CloudFormation does not return this error to users. // -// * ErrCodeTokenAlreadyExistsException "TokenAlreadyExistsException" -// A client request token already exists. +// * ErrCodeOperationStatusCheckFailedException "ConditionalCheckFailed" +// Error reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). +// CloudFormation does not return this error to users. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStack -func (c *CloudFormation) UpdateStack(input *UpdateStackInput) (*UpdateStackOutput, error) { - req, out := c.UpdateStackRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/RecordHandlerProgress +func (c *CloudFormation) RecordHandlerProgress(input *RecordHandlerProgressInput) (*RecordHandlerProgressOutput, error) { + req, out := c.RecordHandlerProgressRequest(input) return out, req.Send() } -// UpdateStackWithContext is the same as UpdateStack with the addition of +// RecordHandlerProgressWithContext is the same as RecordHandlerProgress with the addition of // the ability to pass a context and additional request options. // -// See UpdateStack for details on how to use this API operation. +// See RecordHandlerProgress 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 *CloudFormation) UpdateStackWithContext(ctx aws.Context, input *UpdateStackInput, opts ...request.Option) (*UpdateStackOutput, error) { - req, out := c.UpdateStackRequest(input) +func (c *CloudFormation) RecordHandlerProgressWithContext(ctx aws.Context, input *RecordHandlerProgressInput, opts ...request.Option) (*RecordHandlerProgressOutput, error) { + req, out := c.RecordHandlerProgressRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateStackInstances = "UpdateStackInstances" +const opRegisterType = "RegisterType" -// UpdateStackInstancesRequest generates a "aws/request.Request" representing the -// client's request for the UpdateStackInstances operation. The "output" return +// RegisterTypeRequest generates a "aws/request.Request" representing the +// client's request for the RegisterType operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateStackInstances for more information on using the UpdateStackInstances +// See RegisterType for more information on using the RegisterType // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateStackInstancesRequest method. -// req, resp := client.UpdateStackInstancesRequest(params) +// // Example sending a request using the RegisterTypeRequest method. +// req, resp := client.RegisterTypeRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackInstances -func (c *CloudFormation) UpdateStackInstancesRequest(input *UpdateStackInstancesInput) (req *request.Request, output *UpdateStackInstancesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/RegisterType +func (c *CloudFormation) RegisterTypeRequest(input *RegisterTypeInput) (req *request.Request, output *RegisterTypeOutput) { op := &request.Operation{ - Name: opUpdateStackInstances, + Name: opRegisterType, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateStackInstancesInput{} + input = &RegisterTypeInput{} } - output = &UpdateStackInstancesOutput{} + output = &RegisterTypeOutput{} req = c.newRequest(op, input, output) return } -// UpdateStackInstances API operation for AWS CloudFormation. +// RegisterType API operation for AWS CloudFormation. // -// Updates the parameter values for stack instances for the specified accounts, -// within the specified regions. A stack instance refers to a stack in a specific -// account and region. +// Registers a type with the CloudFormation service. Registering a type makes +// it available for use in CloudFormation templates in your AWS account, and +// includes: // -// You can only update stack instances in regions and accounts where they already -// exist; to create additional stack instances, use CreateStackInstances (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStackInstances.html). +// * Validating the resource schema // -// During stack set updates, any parameters overridden for a stack instance -// are not updated, but retain their overridden value. +// * Determining which handlers have been specified for the resource // -// You can only update the parameter values that are specified in the stack -// set; to add or delete a parameter itself, use UpdateStackSet (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html) -// to update the stack set template. If you add a parameter to a template, before -// you can override the parameter value specified in the stack set you must -// first use UpdateStackSet (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html) -// to update all stack instances with the updated template and parameter value -// specified in the stack set. Once a stack instance has been updated with the -// new parameter, you can then override the parameter value using UpdateStackInstances. +// * Making the resource type available for use in your account +// +// For more information on how to develop types and ready them for registeration, +// see Creating Resource Providers (cloudformation-cli/latest/userguide/resource-types.html) +// in the CloudFormation CLI User Guide. +// +// Once you have initiated a registration request using RegisterType , you can +// use DescribeTypeRegistration to monitor the progress of the registration +// 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 CloudFormation's -// API operation UpdateStackInstances for usage and error information. +// API operation RegisterType for usage and error information. // // Returned Error Codes: -// * ErrCodeStackSetNotFoundException "StackSetNotFoundException" -// The specified stack set doesn't exist. -// -// * ErrCodeStackInstanceNotFoundException "StackInstanceNotFoundException" -// The specified stack instance doesn't exist. -// -// * ErrCodeOperationInProgressException "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. -// -// * ErrCodeOperationIdAlreadyExistsException "OperationIdAlreadyExistsException" -// The specified operation ID already exists. -// -// * ErrCodeStaleRequestException "StaleRequestException" -// Another operation has been performed on this stack set since the specified -// operation was performed. -// -// * ErrCodeInvalidOperationException "InvalidOperationException" -// The specified operation isn't valid. +// * ErrCodeCFNRegistryException "CFNRegistryException" +// An error occurred during a CloudFormation registry operation. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackInstances -func (c *CloudFormation) UpdateStackInstances(input *UpdateStackInstancesInput) (*UpdateStackInstancesOutput, error) { - req, out := c.UpdateStackInstancesRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/RegisterType +func (c *CloudFormation) RegisterType(input *RegisterTypeInput) (*RegisterTypeOutput, error) { + req, out := c.RegisterTypeRequest(input) return out, req.Send() } -// UpdateStackInstancesWithContext is the same as UpdateStackInstances with the addition of +// RegisterTypeWithContext is the same as RegisterType with the addition of // the ability to pass a context and additional request options. // -// See UpdateStackInstances for details on how to use this API operation. +// See RegisterType 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 *CloudFormation) UpdateStackInstancesWithContext(ctx aws.Context, input *UpdateStackInstancesInput, opts ...request.Option) (*UpdateStackInstancesOutput, error) { - req, out := c.UpdateStackInstancesRequest(input) +func (c *CloudFormation) RegisterTypeWithContext(ctx aws.Context, input *RegisterTypeInput, opts ...request.Option) (*RegisterTypeOutput, error) { + req, out := c.RegisterTypeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateStackSet = "UpdateStackSet" +const opSetStackPolicy = "SetStackPolicy" -// UpdateStackSetRequest generates a "aws/request.Request" representing the -// client's request for the UpdateStackSet operation. The "output" return +// SetStackPolicyRequest generates a "aws/request.Request" representing the +// client's request for the SetStackPolicy operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateStackSet for more information on using the UpdateStackSet +// See SetStackPolicy for more information on using the SetStackPolicy // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateStackSetRequest method. -// req, resp := client.UpdateStackSetRequest(params) +// // Example sending a request using the SetStackPolicyRequest method. +// req, resp := client.SetStackPolicyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackSet -func (c *CloudFormation) UpdateStackSetRequest(input *UpdateStackSetInput) (req *request.Request, output *UpdateStackSetOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetStackPolicy +func (c *CloudFormation) SetStackPolicyRequest(input *SetStackPolicyInput) (req *request.Request, output *SetStackPolicyOutput) { op := &request.Operation{ - Name: opUpdateStackSet, + Name: opSetStackPolicy, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateStackSetInput{} + input = &SetStackPolicyInput{} } - output = &UpdateStackSetOutput{} + output = &SetStackPolicyOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateStackSet API operation for AWS CloudFormation. -// -// Updates the stack set, and associated stack instances in the specified accounts -// and regions. +// SetStackPolicy API operation for AWS CloudFormation. // -// Even if the stack set operation created by updating the stack set fails (completely -// or partially, below or above a specified failure tolerance), the stack set -// is updated with your changes. Subsequent CreateStackInstances calls on the -// specified stack set use the updated stack set. +// Sets a stack policy for a specified stack. // // 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 CloudFormation's -// API operation UpdateStackSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeStackSetNotFoundException "StackSetNotFoundException" -// The specified stack set doesn't exist. -// -// * ErrCodeOperationInProgressException "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. -// -// * ErrCodeOperationIdAlreadyExistsException "OperationIdAlreadyExistsException" -// The specified operation ID already exists. -// -// * ErrCodeStaleRequestException "StaleRequestException" -// Another operation has been performed on this stack set since the specified -// operation was performed. -// -// * ErrCodeInvalidOperationException "InvalidOperationException" -// The specified operation isn't valid. -// -// * ErrCodeStackInstanceNotFoundException "StackInstanceNotFoundException" -// The specified stack instance doesn't exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackSet -func (c *CloudFormation) UpdateStackSet(input *UpdateStackSetInput) (*UpdateStackSetOutput, error) { - req, out := c.UpdateStackSetRequest(input) +// API operation SetStackPolicy for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetStackPolicy +func (c *CloudFormation) SetStackPolicy(input *SetStackPolicyInput) (*SetStackPolicyOutput, error) { + req, out := c.SetStackPolicyRequest(input) return out, req.Send() } -// UpdateStackSetWithContext is the same as UpdateStackSet with the addition of +// SetStackPolicyWithContext is the same as SetStackPolicy with the addition of // the ability to pass a context and additional request options. // -// See UpdateStackSet for details on how to use this API operation. +// See SetStackPolicy 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 *CloudFormation) UpdateStackSetWithContext(ctx aws.Context, input *UpdateStackSetInput, opts ...request.Option) (*UpdateStackSetOutput, error) { - req, out := c.UpdateStackSetRequest(input) +func (c *CloudFormation) SetStackPolicyWithContext(ctx aws.Context, input *SetStackPolicyInput, opts ...request.Option) (*SetStackPolicyOutput, error) { + req, out := c.SetStackPolicyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateTerminationProtection = "UpdateTerminationProtection" +const opSetTypeDefaultVersion = "SetTypeDefaultVersion" -// UpdateTerminationProtectionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTerminationProtection operation. The "output" return +// SetTypeDefaultVersionRequest generates a "aws/request.Request" representing the +// client's request for the SetTypeDefaultVersion operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateTerminationProtection for more information on using the UpdateTerminationProtection +// See SetTypeDefaultVersion for more information on using the SetTypeDefaultVersion // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateTerminationProtectionRequest method. -// req, resp := client.UpdateTerminationProtectionRequest(params) +// // Example sending a request using the SetTypeDefaultVersionRequest method. +// req, resp := client.SetTypeDefaultVersionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateTerminationProtection -func (c *CloudFormation) UpdateTerminationProtectionRequest(input *UpdateTerminationProtectionInput) (req *request.Request, output *UpdateTerminationProtectionOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetTypeDefaultVersion +func (c *CloudFormation) SetTypeDefaultVersionRequest(input *SetTypeDefaultVersionInput) (req *request.Request, output *SetTypeDefaultVersionOutput) { op := &request.Operation{ - Name: opUpdateTerminationProtection, + Name: opSetTypeDefaultVersion, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateTerminationProtectionInput{} + input = &SetTypeDefaultVersionInput{} } - output = &UpdateTerminationProtectionOutput{} + output = &SetTypeDefaultVersionOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateTerminationProtection API operation for AWS CloudFormation. -// -// Updates termination protection for the specified stack. If a user attempts -// to delete a stack with termination protection enabled, the operation fails -// and the stack remains unchanged. For more information, see Protecting a Stack -// From Being Deleted (AWSCloudFormation/latest/UserGuide/using-cfn-protect-stacks.html) -// in the AWS CloudFormation User Guide. +// SetTypeDefaultVersion API operation for AWS CloudFormation. // -// For nested stacks (AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html), -// termination protection is set on the root stack and cannot be changed directly -// on the nested stack. +// Specify the default version of a type. The default version of a type will +// be used in CloudFormation operations. // // 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 CloudFormation's -// API operation UpdateTerminationProtection for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateTerminationProtection -func (c *CloudFormation) UpdateTerminationProtection(input *UpdateTerminationProtectionInput) (*UpdateTerminationProtectionOutput, error) { - req, out := c.UpdateTerminationProtectionRequest(input) +// API operation SetTypeDefaultVersion for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCFNRegistryException "CFNRegistryException" +// An error occurred during a CloudFormation registry operation. +// +// * ErrCodeTypeNotFoundException "TypeNotFoundException" +// The specified type does not exist in the CloudFormation registry. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetTypeDefaultVersion +func (c *CloudFormation) SetTypeDefaultVersion(input *SetTypeDefaultVersionInput) (*SetTypeDefaultVersionOutput, error) { + req, out := c.SetTypeDefaultVersionRequest(input) return out, req.Send() } -// UpdateTerminationProtectionWithContext is the same as UpdateTerminationProtection with the addition of +// SetTypeDefaultVersionWithContext is the same as SetTypeDefaultVersion with the addition of // the ability to pass a context and additional request options. // -// See UpdateTerminationProtection for details on how to use this API operation. +// See SetTypeDefaultVersion 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 *CloudFormation) UpdateTerminationProtectionWithContext(ctx aws.Context, input *UpdateTerminationProtectionInput, opts ...request.Option) (*UpdateTerminationProtectionOutput, error) { - req, out := c.UpdateTerminationProtectionRequest(input) +func (c *CloudFormation) SetTypeDefaultVersionWithContext(ctx aws.Context, input *SetTypeDefaultVersionInput, opts ...request.Option) (*SetTypeDefaultVersionOutput, error) { + req, out := c.SetTypeDefaultVersionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opValidateTemplate = "ValidateTemplate" +const opSignalResource = "SignalResource" -// ValidateTemplateRequest generates a "aws/request.Request" representing the -// client's request for the ValidateTemplate operation. The "output" return +// SignalResourceRequest generates a "aws/request.Request" representing the +// client's request for the SignalResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ValidateTemplate for more information on using the ValidateTemplate +// See SignalResource for more information on using the SignalResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ValidateTemplateRequest method. -// req, resp := client.ValidateTemplateRequest(params) +// // Example sending a request using the SignalResourceRequest method. +// req, resp := client.SignalResourceRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ValidateTemplate -func (c *CloudFormation) ValidateTemplateRequest(input *ValidateTemplateInput) (req *request.Request, output *ValidateTemplateOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SignalResource +func (c *CloudFormation) SignalResourceRequest(input *SignalResourceInput) (req *request.Request, output *SignalResourceOutput) { op := &request.Operation{ - Name: opValidateTemplate, + Name: opSignalResource, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ValidateTemplateInput{} + input = &SignalResourceInput{} } - output = &ValidateTemplateOutput{} + output = &SignalResourceOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ValidateTemplate API operation for AWS CloudFormation. +// SignalResource API operation for AWS CloudFormation. // -// Validates a specified template. AWS CloudFormation first checks if the template -// is valid JSON. If it isn't, AWS CloudFormation checks if the template is -// valid YAML. If both these checks fail, AWS CloudFormation returns a template -// validation error. +// Sends a signal to the specified resource with a success or failure status. +// You can use the SignalResource API in conjunction with a creation policy +// or update policy. AWS CloudFormation doesn't proceed with a stack creation +// or update until resources receive the required number of signals or the timeout +// period is exceeded. The SignalResource API is useful in cases where you want +// to send signals from anywhere other than an Amazon EC2 instance. // // 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 CloudFormation's -// API operation ValidateTemplate for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ValidateTemplate -func (c *CloudFormation) ValidateTemplate(input *ValidateTemplateInput) (*ValidateTemplateOutput, error) { - req, out := c.ValidateTemplateRequest(input) +// API operation SignalResource for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SignalResource +func (c *CloudFormation) SignalResource(input *SignalResourceInput) (*SignalResourceOutput, error) { + req, out := c.SignalResourceRequest(input) return out, req.Send() } -// ValidateTemplateWithContext is the same as ValidateTemplate with the addition of +// SignalResourceWithContext is the same as SignalResource with the addition of // the ability to pass a context and additional request options. // -// See ValidateTemplate for details on how to use this API operation. +// See SignalResource 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 *CloudFormation) ValidateTemplateWithContext(ctx aws.Context, input *ValidateTemplateInput, opts ...request.Option) (*ValidateTemplateOutput, error) { - req, out := c.ValidateTemplateRequest(input) +func (c *CloudFormation) SignalResourceWithContext(ctx aws.Context, input *SignalResourceInput, opts ...request.Option) (*SignalResourceOutput, error) { + req, out := c.SignalResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// Structure that contains the results of the account gate function which AWS -// CloudFormation invokes, if present, before proceeding with a stack set operation -// in an account and region. +const opStopStackSetOperation = "StopStackSetOperation" + +// StopStackSetOperationRequest generates a "aws/request.Request" representing the +// client's request for the StopStackSetOperation operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. // -// For each account and region, AWS CloudFormation lets you specify a Lamdba -// function that encapsulates any requirements that must be met before CloudFormation -// can proceed with a stack set operation in that account and region. CloudFormation -// invokes the function each time a stack set operation is requested for that -// account and region; if the function returns FAILED, CloudFormation cancels -// the operation in that account and region, and sets the stack set operation -// result status for that account and region to FAILED. +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. // -// For more information, see Configuring a target account gate (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-account-gating.html). -type AccountGateResult struct { - _ struct{} `type:"structure"` +// See StopStackSetOperation for more information on using the StopStackSetOperation +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopStackSetOperationRequest method. +// req, resp := client.StopStackSetOperationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/StopStackSetOperation +func (c *CloudFormation) StopStackSetOperationRequest(input *StopStackSetOperationInput) (req *request.Request, output *StopStackSetOperationOutput) { + op := &request.Operation{ + Name: opStopStackSetOperation, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StopStackSetOperationInput{} + } + + output = &StopStackSetOperationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StopStackSetOperation API operation for AWS CloudFormation. +// +// Stops an in-progress operation on a stack set and its associated stack instances. +// +// 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 CloudFormation's +// API operation StopStackSetOperation for usage and error information. +// +// Returned Error Codes: +// * ErrCodeStackSetNotFoundException "StackSetNotFoundException" +// The specified stack set doesn't exist. +// +// * ErrCodeOperationNotFoundException "OperationNotFoundException" +// The specified ID refers to an operation that doesn't exist. +// +// * ErrCodeInvalidOperationException "InvalidOperationException" +// The specified operation isn't valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/StopStackSetOperation +func (c *CloudFormation) StopStackSetOperation(input *StopStackSetOperationInput) (*StopStackSetOperationOutput, error) { + req, out := c.StopStackSetOperationRequest(input) + return out, req.Send() +} + +// StopStackSetOperationWithContext is the same as StopStackSetOperation with the addition of +// the ability to pass a context and additional request options. +// +// See StopStackSetOperation 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 *CloudFormation) StopStackSetOperationWithContext(ctx aws.Context, input *StopStackSetOperationInput, opts ...request.Option) (*StopStackSetOperationOutput, error) { + req, out := c.StopStackSetOperationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateStack = "UpdateStack" + +// UpdateStackRequest generates a "aws/request.Request" representing the +// client's request for the UpdateStack operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateStack for more information on using the UpdateStack +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateStackRequest method. +// req, resp := client.UpdateStackRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStack +func (c *CloudFormation) UpdateStackRequest(input *UpdateStackInput) (req *request.Request, output *UpdateStackOutput) { + op := &request.Operation{ + Name: opUpdateStack, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateStackInput{} + } + + output = &UpdateStackOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateStack API operation for AWS CloudFormation. +// +// Updates a stack as specified in the template. After the call completes successfully, +// the stack update starts. You can check the status of the stack via the DescribeStacks +// action. +// +// To get a copy of the template for an existing stack, you can use the GetTemplate +// action. +// +// For more information about creating an update template, updating a stack, +// and monitoring the progress of the update, see Updating a Stack (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks.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 +// the error. +// +// See the AWS API reference guide for AWS CloudFormation's +// API operation UpdateStack for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInsufficientCapabilitiesException "InsufficientCapabilitiesException" +// The template contains resources with capabilities that weren't specified +// in the Capabilities parameter. +// +// * ErrCodeTokenAlreadyExistsException "TokenAlreadyExistsException" +// A client request token already exists. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStack +func (c *CloudFormation) UpdateStack(input *UpdateStackInput) (*UpdateStackOutput, error) { + req, out := c.UpdateStackRequest(input) + return out, req.Send() +} + +// UpdateStackWithContext is the same as UpdateStack with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateStack 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 *CloudFormation) UpdateStackWithContext(ctx aws.Context, input *UpdateStackInput, opts ...request.Option) (*UpdateStackOutput, error) { + req, out := c.UpdateStackRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateStackInstances = "UpdateStackInstances" + +// UpdateStackInstancesRequest generates a "aws/request.Request" representing the +// client's request for the UpdateStackInstances operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateStackInstances for more information on using the UpdateStackInstances +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateStackInstancesRequest method. +// req, resp := client.UpdateStackInstancesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackInstances +func (c *CloudFormation) UpdateStackInstancesRequest(input *UpdateStackInstancesInput) (req *request.Request, output *UpdateStackInstancesOutput) { + op := &request.Operation{ + Name: opUpdateStackInstances, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateStackInstancesInput{} + } + + output = &UpdateStackInstancesOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateStackInstances API operation for AWS CloudFormation. +// +// Updates the parameter values for stack instances for the specified accounts, +// within the specified regions. A stack instance refers to a stack in a specific +// account and region. +// +// You can only update stack instances in regions and accounts where they already +// exist; to create additional stack instances, use CreateStackInstances (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStackInstances.html). +// +// During stack set updates, any parameters overridden for a stack instance +// are not updated, but retain their overridden value. +// +// You can only update the parameter values that are specified in the stack +// set; to add or delete a parameter itself, use UpdateStackSet (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html) +// to update the stack set template. If you add a parameter to a template, before +// you can override the parameter value specified in the stack set you must +// first use UpdateStackSet (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html) +// to update all stack instances with the updated template and parameter value +// specified in the stack set. Once a stack instance has been updated with the +// new parameter, you can then override the parameter value using UpdateStackInstances. +// +// 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 CloudFormation's +// API operation UpdateStackInstances for usage and error information. +// +// Returned Error Codes: +// * ErrCodeStackSetNotFoundException "StackSetNotFoundException" +// The specified stack set doesn't exist. +// +// * ErrCodeStackInstanceNotFoundException "StackInstanceNotFoundException" +// The specified stack instance doesn't exist. +// +// * ErrCodeOperationInProgressException "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. +// +// * ErrCodeOperationIdAlreadyExistsException "OperationIdAlreadyExistsException" +// The specified operation ID already exists. +// +// * ErrCodeStaleRequestException "StaleRequestException" +// Another operation has been performed on this stack set since the specified +// operation was performed. +// +// * ErrCodeInvalidOperationException "InvalidOperationException" +// The specified operation isn't valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackInstances +func (c *CloudFormation) UpdateStackInstances(input *UpdateStackInstancesInput) (*UpdateStackInstancesOutput, error) { + req, out := c.UpdateStackInstancesRequest(input) + return out, req.Send() +} + +// UpdateStackInstancesWithContext is the same as UpdateStackInstances with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateStackInstances 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 *CloudFormation) UpdateStackInstancesWithContext(ctx aws.Context, input *UpdateStackInstancesInput, opts ...request.Option) (*UpdateStackInstancesOutput, error) { + req, out := c.UpdateStackInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateStackSet = "UpdateStackSet" + +// UpdateStackSetRequest generates a "aws/request.Request" representing the +// client's request for the UpdateStackSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateStackSet for more information on using the UpdateStackSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateStackSetRequest method. +// req, resp := client.UpdateStackSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackSet +func (c *CloudFormation) UpdateStackSetRequest(input *UpdateStackSetInput) (req *request.Request, output *UpdateStackSetOutput) { + op := &request.Operation{ + Name: opUpdateStackSet, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateStackSetInput{} + } + + output = &UpdateStackSetOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateStackSet API operation for AWS CloudFormation. +// +// Updates the stack set, and associated stack instances in the specified accounts +// and regions. +// +// Even if the stack set operation created by updating the stack set fails (completely +// or partially, below or above a specified failure tolerance), the stack set +// is updated with your changes. Subsequent CreateStackInstances calls on the +// specified stack set use the updated stack set. +// +// 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 CloudFormation's +// API operation UpdateStackSet for usage and error information. +// +// Returned Error Codes: +// * ErrCodeStackSetNotFoundException "StackSetNotFoundException" +// The specified stack set doesn't exist. +// +// * ErrCodeOperationInProgressException "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. +// +// * ErrCodeOperationIdAlreadyExistsException "OperationIdAlreadyExistsException" +// The specified operation ID already exists. +// +// * ErrCodeStaleRequestException "StaleRequestException" +// Another operation has been performed on this stack set since the specified +// operation was performed. +// +// * ErrCodeInvalidOperationException "InvalidOperationException" +// The specified operation isn't valid. +// +// * ErrCodeStackInstanceNotFoundException "StackInstanceNotFoundException" +// The specified stack instance doesn't exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackSet +func (c *CloudFormation) UpdateStackSet(input *UpdateStackSetInput) (*UpdateStackSetOutput, error) { + req, out := c.UpdateStackSetRequest(input) + return out, req.Send() +} + +// UpdateStackSetWithContext is the same as UpdateStackSet with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateStackSet 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 *CloudFormation) UpdateStackSetWithContext(ctx aws.Context, input *UpdateStackSetInput, opts ...request.Option) (*UpdateStackSetOutput, error) { + req, out := c.UpdateStackSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateTerminationProtection = "UpdateTerminationProtection" + +// UpdateTerminationProtectionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateTerminationProtection operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateTerminationProtection for more information on using the UpdateTerminationProtection +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateTerminationProtectionRequest method. +// req, resp := client.UpdateTerminationProtectionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateTerminationProtection +func (c *CloudFormation) UpdateTerminationProtectionRequest(input *UpdateTerminationProtectionInput) (req *request.Request, output *UpdateTerminationProtectionOutput) { + op := &request.Operation{ + Name: opUpdateTerminationProtection, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateTerminationProtectionInput{} + } + + output = &UpdateTerminationProtectionOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateTerminationProtection API operation for AWS CloudFormation. +// +// Updates termination protection for the specified stack. If a user attempts +// to delete a stack with termination protection enabled, the operation fails +// and the stack remains unchanged. For more information, see Protecting a Stack +// From Being Deleted (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-protect-stacks.html) +// in the AWS CloudFormation User Guide. +// +// For nested stacks (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html), +// termination protection is set on the root stack and cannot be changed directly +// on the nested stack. +// +// 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 CloudFormation's +// API operation UpdateTerminationProtection for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateTerminationProtection +func (c *CloudFormation) UpdateTerminationProtection(input *UpdateTerminationProtectionInput) (*UpdateTerminationProtectionOutput, error) { + req, out := c.UpdateTerminationProtectionRequest(input) + return out, req.Send() +} + +// UpdateTerminationProtectionWithContext is the same as UpdateTerminationProtection with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTerminationProtection 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 *CloudFormation) UpdateTerminationProtectionWithContext(ctx aws.Context, input *UpdateTerminationProtectionInput, opts ...request.Option) (*UpdateTerminationProtectionOutput, error) { + req, out := c.UpdateTerminationProtectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opValidateTemplate = "ValidateTemplate" + +// ValidateTemplateRequest generates a "aws/request.Request" representing the +// client's request for the ValidateTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ValidateTemplate for more information on using the ValidateTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ValidateTemplateRequest method. +// req, resp := client.ValidateTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ValidateTemplate +func (c *CloudFormation) ValidateTemplateRequest(input *ValidateTemplateInput) (req *request.Request, output *ValidateTemplateOutput) { + op := &request.Operation{ + Name: opValidateTemplate, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ValidateTemplateInput{} + } + + output = &ValidateTemplateOutput{} + req = c.newRequest(op, input, output) + return +} + +// ValidateTemplate API operation for AWS CloudFormation. +// +// Validates a specified template. AWS CloudFormation first checks if the template +// is valid JSON. If it isn't, AWS CloudFormation checks if the template is +// valid YAML. If both these checks fail, AWS CloudFormation returns a template +// validation error. +// +// 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 CloudFormation's +// API operation ValidateTemplate for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ValidateTemplate +func (c *CloudFormation) ValidateTemplate(input *ValidateTemplateInput) (*ValidateTemplateOutput, error) { + req, out := c.ValidateTemplateRequest(input) + return out, req.Send() +} + +// ValidateTemplateWithContext is the same as ValidateTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See ValidateTemplate 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 *CloudFormation) ValidateTemplateWithContext(ctx aws.Context, input *ValidateTemplateInput, opts ...request.Option) (*ValidateTemplateOutput, error) { + req, out := c.ValidateTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Structure that contains the results of the account gate function which AWS +// CloudFormation invokes, if present, before proceeding with a stack set operation +// in an account and region. +// +// For each account and region, AWS CloudFormation lets you specify a Lamdba +// function that encapsulates any requirements that must be met before CloudFormation +// can proceed with a stack set operation in that account and region. CloudFormation +// invokes the function each time a stack set operation is requested for that +// account and region; if the function returns FAILED, CloudFormation cancels +// the operation in that account and region, and sets the stack set operation +// result status for that account and region to FAILED. +// +// For more information, see Configuring a target account gate (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-account-gating.html). +type AccountGateResult struct { + _ struct{} `type:"structure"` // The status of the account gate function. // - // * SUCCEEDED: The account gate function has determined that the account - // and region passes any requirements for a stack set operation to occur. - // AWS CloudFormation proceeds with the stack operation in that account and - // region. + // * SUCCEEDED: The account gate function has determined that the account + // and region passes any requirements for a stack set operation to occur. + // AWS CloudFormation proceeds with the stack operation in that account and + // region. + // + // * FAILED: The account gate function has determined that the account and + // region does not meet the requirements for a stack set operation to occur. + // AWS CloudFormation cancels the stack set operation in that account and + // region, and sets the stack set operation result status for that account + // and region to FAILED. + // + // * SKIPPED: AWS CloudFormation has skipped calling the account gate function + // for this account and region, for one of the following reasons: An account + // gate function has not been specified for the account and region. AWS CloudFormation + // proceeds with the stack set operation in this account and region. The + // AWSCloudFormationStackSetExecutionRole of the stack set adminstration + // account lacks permissions to invoke the function. AWS CloudFormation proceeds + // with the stack set operation in this account and region. Either no action + // is necessary, or no action is possible, on the stack. AWS CloudFormation + // skips the stack set operation in this account and region. + Status *string `type:"string" enum:"AccountGateStatus"` + + // The reason for the account gate status assigned to this account and region + // for the stack set operation. + StatusReason *string `type:"string"` +} + +// String returns the string representation +func (s AccountGateResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccountGateResult) GoString() string { + return s.String() +} + +// SetStatus sets the Status field's value. +func (s *AccountGateResult) SetStatus(v string) *AccountGateResult { + s.Status = &v + return s +} + +// SetStatusReason sets the StatusReason field's value. +func (s *AccountGateResult) SetStatusReason(v string) *AccountGateResult { + s.StatusReason = &v + return s +} + +// The AccountLimit data type. +// +// CloudFormation has the following limits per account: +// +// * Number of concurrent resources +// +// * Number of stacks +// +// * Number of stack outputs +// +// For more information about these account limits, and other CloudFormation +// limits, see AWS CloudFormation Limits (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) +// in the AWS CloudFormation User Guide. +type AccountLimit struct { + _ struct{} `type:"structure"` + + // The name of the account limit. + // + // Values: ConcurrentResourcesLimit | StackLimit | StackOutputsLimit + Name *string `type:"string"` + + // The value that is associated with the account limit name. + Value *int64 `type:"integer"` +} + +// String returns the string representation +func (s AccountLimit) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccountLimit) GoString() string { + return s.String() +} + +// SetName sets the Name field's value. +func (s *AccountLimit) SetName(v string) *AccountLimit { + s.Name = &v + return s +} + +// SetValue sets the Value field's value. +func (s *AccountLimit) SetValue(v int64) *AccountLimit { + s.Value = &v + return s +} + +// The input for the CancelUpdateStack action. +type CancelUpdateStackInput struct { + _ struct{} `type:"structure"` + + // A unique identifier for this CancelUpdateStack request. Specify this token + // if you plan to retry requests so that AWS CloudFormation knows that you're + // not attempting to cancel an update on a stack with the same name. You might + // retry CancelUpdateStack requests to ensure that AWS CloudFormation successfully + // received them. + ClientRequestToken *string `min:"1" type:"string"` + + // The name or the unique stack ID that is associated with the stack. + // + // StackName is a required field + StackName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CancelUpdateStackInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelUpdateStackInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CancelUpdateStackInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CancelUpdateStackInput"} + if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) + } + if s.StackName == nil { + invalidParams.Add(request.NewErrParamRequired("StackName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *CancelUpdateStackInput) SetClientRequestToken(v string) *CancelUpdateStackInput { + s.ClientRequestToken = &v + return s +} + +// SetStackName sets the StackName field's value. +func (s *CancelUpdateStackInput) SetStackName(v string) *CancelUpdateStackInput { + s.StackName = &v + return s +} + +type CancelUpdateStackOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s CancelUpdateStackOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelUpdateStackOutput) GoString() string { + return s.String() +} + +// The Change structure describes the changes AWS CloudFormation will perform +// if you execute the change set. +type Change struct { + _ struct{} `type:"structure"` + + // A ResourceChange structure that describes the resource and action that AWS + // CloudFormation will perform. + ResourceChange *ResourceChange `type:"structure"` + + // The type of entity that AWS CloudFormation changes. Currently, the only entity + // type is Resource. + Type *string `type:"string" enum:"ChangeType"` +} + +// String returns the string representation +func (s Change) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Change) GoString() string { + return s.String() +} + +// SetResourceChange sets the ResourceChange field's value. +func (s *Change) SetResourceChange(v *ResourceChange) *Change { + s.ResourceChange = v + return s +} + +// SetType sets the Type field's value. +func (s *Change) SetType(v string) *Change { + s.Type = &v + return s +} + +// The ChangeSetSummary structure describes a change set, its status, and the +// stack with which it's associated. +type ChangeSetSummary struct { + _ struct{} `type:"structure"` + + // The ID of the change set. + ChangeSetId *string `min:"1" type:"string"` + + // The name of the change set. + ChangeSetName *string `min:"1" type:"string"` + + // The start time when the change set was created, in UTC. + CreationTime *time.Time `type:"timestamp"` + + // Descriptive information about the change set. + Description *string `min:"1" type:"string"` + + // If the change set execution status is AVAILABLE, you can execute the change + // set. If you can’t execute the change set, the status indicates why. For + // example, a change set might be in an UNAVAILABLE state because AWS CloudFormation + // is still creating it or in an OBSOLETE state because the stack was already + // updated. + ExecutionStatus *string `type:"string" enum:"ExecutionStatus"` + + // The ID of the stack with which the change set is associated. + StackId *string `type:"string"` + + // The name of the stack with which the change set is associated. + StackName *string `type:"string"` + + // The state of the change set, such as CREATE_IN_PROGRESS, CREATE_COMPLETE, + // or FAILED. + Status *string `type:"string" enum:"ChangeSetStatus"` + + // A description of the change set's status. For example, if your change set + // is in the FAILED state, AWS CloudFormation shows the error message. + StatusReason *string `type:"string"` +} + +// String returns the string representation +func (s ChangeSetSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeSetSummary) GoString() string { + return s.String() +} + +// SetChangeSetId sets the ChangeSetId field's value. +func (s *ChangeSetSummary) SetChangeSetId(v string) *ChangeSetSummary { + s.ChangeSetId = &v + return s +} + +// SetChangeSetName sets the ChangeSetName field's value. +func (s *ChangeSetSummary) SetChangeSetName(v string) *ChangeSetSummary { + s.ChangeSetName = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *ChangeSetSummary) SetCreationTime(v time.Time) *ChangeSetSummary { + s.CreationTime = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *ChangeSetSummary) SetDescription(v string) *ChangeSetSummary { + s.Description = &v + return s +} + +// SetExecutionStatus sets the ExecutionStatus field's value. +func (s *ChangeSetSummary) SetExecutionStatus(v string) *ChangeSetSummary { + s.ExecutionStatus = &v + return s +} + +// SetStackId sets the StackId field's value. +func (s *ChangeSetSummary) SetStackId(v string) *ChangeSetSummary { + s.StackId = &v + return s +} + +// SetStackName sets the StackName field's value. +func (s *ChangeSetSummary) SetStackName(v string) *ChangeSetSummary { + s.StackName = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ChangeSetSummary) SetStatus(v string) *ChangeSetSummary { + s.Status = &v + return s +} + +// SetStatusReason sets the StatusReason field's value. +func (s *ChangeSetSummary) SetStatusReason(v string) *ChangeSetSummary { + s.StatusReason = &v + return s +} + +// The input for the ContinueUpdateRollback action. +type ContinueUpdateRollbackInput struct { + _ struct{} `type:"structure"` + + // A unique identifier for this ContinueUpdateRollback request. Specify this + // token if you plan to retry requests so that AWS CloudFormation knows that + // you're not attempting to continue the rollback to a stack with the same name. + // You might retry ContinueUpdateRollback requests to ensure that AWS CloudFormation + // successfully received them. + ClientRequestToken *string `min:"1" type:"string"` + + // A list of the logical IDs of the resources that AWS CloudFormation skips + // during the continue update rollback operation. You can specify only resources + // that are in the UPDATE_FAILED state because a rollback failed. You can't + // specify resources that are in the UPDATE_FAILED state for other reasons, + // for example, because an update was cancelled. To check why a resource update + // failed, use the DescribeStackResources action, and view the resource status + // reason. + // + // Specify this property to skip rolling back resources that AWS CloudFormation + // can't successfully roll back. We recommend that you troubleshoot (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-update-rollback-failed) + // resources before skipping them. AWS CloudFormation sets the status of the + // specified resources to UPDATE_COMPLETE and continues to roll back the stack. + // After the rollback is complete, the state of the skipped resources will be + // inconsistent with the state of the resources in the stack template. Before + // performing another stack update, you must update the stack or resources to + // be consistent with each other. If you don't, subsequent stack updates might + // fail, and the stack will become unrecoverable. + // + // Specify the minimum number of resources required to successfully roll back + // your stack. For example, a failed resource update might cause dependent resources + // to fail. In this case, it might not be necessary to skip the dependent resources. + // + // To skip resources that are part of nested stacks, use the following format: + // NestedStackName.ResourceLogicalID. If you want to specify the logical ID + // of a stack resource (Type: AWS::CloudFormation::Stack) in the ResourcesToSkip + // list, then its corresponding embedded stack must be in one of the following + // states: DELETE_IN_PROGRESS, DELETE_COMPLETE, or DELETE_FAILED. + // + // Don't confuse a child stack's name with its corresponding logical ID defined + // in the parent stack. For an example of a continue update rollback operation + // with nested stacks, see Using ResourcesToSkip to recover a nested stacks + // hierarchy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-continueupdaterollback.html#nested-stacks). + ResourcesToSkip []*string `type:"list"` + + // The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) + // role that AWS CloudFormation assumes to roll back the stack. AWS CloudFormation + // uses the role's credentials to make calls on your behalf. AWS CloudFormation + // always uses this role for all future operations on the stack. As long as + // users have permission to operate on the stack, AWS CloudFormation uses this + // role even if the users don't have permission to pass it. Ensure that the + // role grants least privilege. + // + // If you don't specify a value, AWS CloudFormation uses the role that was previously + // associated with the stack. If no role is available, AWS CloudFormation uses + // a temporary session that is generated from your user credentials. + RoleARN *string `min:"20" type:"string"` + + // The name or the unique ID of the stack that you want to continue rolling + // back. + // + // Don't specify the name of a nested stack (a stack that was created by using + // the AWS::CloudFormation::Stack resource). Instead, use this operation on + // the parent stack (the stack that contains the AWS::CloudFormation::Stack + // resource). + // + // StackName is a required field + StackName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ContinueUpdateRollbackInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ContinueUpdateRollbackInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ContinueUpdateRollbackInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ContinueUpdateRollbackInput"} + if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) + } + if s.RoleARN != nil && len(*s.RoleARN) < 20 { + invalidParams.Add(request.NewErrParamMinLen("RoleARN", 20)) + } + if s.StackName == nil { + invalidParams.Add(request.NewErrParamRequired("StackName")) + } + if s.StackName != nil && len(*s.StackName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *ContinueUpdateRollbackInput) SetClientRequestToken(v string) *ContinueUpdateRollbackInput { + s.ClientRequestToken = &v + return s +} + +// SetResourcesToSkip sets the ResourcesToSkip field's value. +func (s *ContinueUpdateRollbackInput) SetResourcesToSkip(v []*string) *ContinueUpdateRollbackInput { + s.ResourcesToSkip = v + return s +} + +// SetRoleARN sets the RoleARN field's value. +func (s *ContinueUpdateRollbackInput) SetRoleARN(v string) *ContinueUpdateRollbackInput { + s.RoleARN = &v + return s +} + +// SetStackName sets the StackName field's value. +func (s *ContinueUpdateRollbackInput) SetStackName(v string) *ContinueUpdateRollbackInput { + s.StackName = &v + return s +} + +// The output for a ContinueUpdateRollback action. +type ContinueUpdateRollbackOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ContinueUpdateRollbackOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ContinueUpdateRollbackOutput) GoString() string { + return s.String() +} + +// The input for the CreateChangeSet action. +type CreateChangeSetInput struct { + _ struct{} `type:"structure"` + + // In some cases, you must explicitly acknowledge that your stack template contains + // certain capabilities in order for AWS CloudFormation to create the stack. + // + // * CAPABILITY_IAM and CAPABILITY_NAMED_IAM Some stack templates might include + // resources that can affect permissions in your AWS account; for example, + // by creating new AWS Identity and Access Management (IAM) users. For those + // stacks, you must explicitly acknowledge this by specifying one of these + // capabilities. The following IAM resources require you to specify either + // the CAPABILITY_IAM or CAPABILITY_NAMED_IAM capability. If you have IAM + // resources, you can specify either capability. If you have IAM resources + // with custom names, you must specify CAPABILITY_NAMED_IAM. If you don't + // specify either of these capabilities, AWS CloudFormation returns an InsufficientCapabilities + // error. If your stack template contains these resources, we recommend that + // you review all permissions associated with them and edit their permissions + // if necessary. AWS::IAM::AccessKey (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html) + // AWS::IAM::Group (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html) + // AWS::IAM::InstanceProfile (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) + // AWS::IAM::Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html) + // AWS::IAM::Role (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html) + // AWS::IAM::User (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) + // AWS::IAM::UserToGroupAddition (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html) + // For more information, see Acknowledging IAM Resources in AWS CloudFormation + // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). + // + // * CAPABILITY_AUTO_EXPAND Some template contain macros. Macros perform + // custom processing on templates; this can include simple actions like find-and-replace + // operations, all the way to extensive transformations of entire templates. + // Because of this, users typically create a change set from the processed + // template, so that they can review the changes resulting from the macros + // before actually creating the stack. If your stack template contains one + // or more macros, and you choose to create a stack directly from the processed + // template, without first reviewing the resulting changes in a change set, + // you must acknowledge this capability. This includes the AWS::Include (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html) + // and AWS::Serverless (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html) + // transforms, which are macros hosted by AWS CloudFormation. This capacity + // does not apply to creating change sets, and specifying it when creating + // change sets has no effect. Also, change sets do not currently support + // nested stacks. If you want to create a stack from a stack template that + // contains macros and nested stacks, you must create or update the stack + // directly from the template using the CreateStack or UpdateStack action, + // and specifying this capability. For more information on macros, see Using + // AWS CloudFormation Macros to Perform Custom Processing on Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html). + Capabilities []*string `type:"list"` + + // The name of the change set. The name must be unique among all change sets + // that are associated with the specified stack. + // + // A change set name can contain only alphanumeric, case sensitive characters + // and hyphens. It must start with an alphabetic character and cannot exceed + // 128 characters. + // + // ChangeSetName is a required field + ChangeSetName *string `min:"1" type:"string" required:"true"` + + // The type of change set operation. To create a change set for a new stack, + // specify CREATE. To create a change set for an existing stack, specify UPDATE. + // To create a change set for an import operation, specify IMPORT. + // + // If you create a change set for a new stack, AWS Cloudformation creates a + // stack with a unique stack ID, but no template or resources. The stack will + // be in the REVIEW_IN_PROGRESS (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-describing-stacks.html#d0e11995) + // state until you execute the change set. + // + // By default, AWS CloudFormation specifies UPDATE. You can't use the UPDATE + // type to create a change set for a new stack or the CREATE type to create + // a change set for an existing stack. + ChangeSetType *string `type:"string" enum:"ChangeSetType"` + + // A unique identifier for this CreateChangeSet request. Specify this token + // if you plan to retry requests so that AWS CloudFormation knows that you're + // not attempting to create another change set with the same name. You might + // retry CreateChangeSet requests to ensure that AWS CloudFormation successfully + // received them. + ClientToken *string `min:"1" type:"string"` + + // A description to help you identify this change set. + Description *string `min:"1" type:"string"` + + // The Amazon Resource Names (ARNs) of Amazon Simple Notification Service (Amazon + // SNS) topics that AWS CloudFormation associates with the stack. To remove + // all associated notification topics, specify an empty list. + NotificationARNs []*string `type:"list"` + + // A list of Parameter structures that specify input parameters for the change + // set. For more information, see the Parameter data type. + Parameters []*Parameter `type:"list"` + + // The template resource types that you have permissions to work with if you + // execute this change set, such as AWS::EC2::Instance, AWS::EC2::*, or Custom::MyCustomInstance. + // + // If the list of resource types doesn't include a resource type that you're + // updating, the stack update fails. By default, AWS CloudFormation grants permissions + // to all resource types. AWS Identity and Access Management (IAM) uses this + // parameter for condition keys in IAM policies for AWS CloudFormation. For + // more information, see Controlling Access with AWS Identity and Access Management + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html) + // in the AWS CloudFormation User Guide. + ResourceTypes []*string `type:"list"` + + // The resources to import into your stack. + ResourcesToImport []*ResourceToImport `type:"list"` + + // The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) + // role that AWS CloudFormation assumes when executing the change set. AWS CloudFormation + // uses the role's credentials to make calls on your behalf. AWS CloudFormation + // uses this role for all future operations on the stack. As long as users have + // permission to operate on the stack, AWS CloudFormation uses this role even + // if the users don't have permission to pass it. Ensure that the role grants + // least privilege. + // + // If you don't specify a value, AWS CloudFormation uses the role that was previously + // associated with the stack. If no role is available, AWS CloudFormation uses + // a temporary session that is generated from your user credentials. + RoleARN *string `min:"20" type:"string"` + + // The rollback triggers for AWS CloudFormation to monitor during stack creation + // and updating operations, and for the specified monitoring period afterwards. + RollbackConfiguration *RollbackConfiguration `type:"structure"` + + // The name or the unique ID of the stack for which you are creating a change + // set. AWS CloudFormation generates the change set by comparing this stack's + // information with the information that you submit, such as a modified template + // or different parameter input values. + // + // StackName is a required field + StackName *string `min:"1" type:"string" required:"true"` + + // Key-value pairs to associate with this stack. AWS CloudFormation also propagates + // these tags to resources in the stack. You can specify a maximum of 50 tags. + Tags []*Tag `type:"list"` + + // A structure that contains the body of the revised template, with a minimum + // length of 1 byte and a maximum length of 51,200 bytes. AWS CloudFormation + // generates the change set by comparing this template with the template of + // the stack that you specified. + // + // Conditional: You must specify only TemplateBody or TemplateURL. + TemplateBody *string `min:"1" type:"string"` + + // The location of the file that contains the revised template. The URL must + // point to a template (max size: 460,800 bytes) that is located in an S3 bucket. + // AWS CloudFormation generates the change set by comparing this template with + // the stack that you specified. + // + // Conditional: You must specify only TemplateBody or TemplateURL. + TemplateURL *string `min:"1" type:"string"` + + // Whether to reuse the template that is associated with the stack to create + // the change set. + UsePreviousTemplate *bool `type:"boolean"` +} + +// String returns the string representation +func (s CreateChangeSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateChangeSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateChangeSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateChangeSetInput"} + if s.ChangeSetName == nil { + invalidParams.Add(request.NewErrParamRequired("ChangeSetName")) + } + if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1)) + } + if s.ClientToken != nil && len(*s.ClientToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) + } + if s.Description != nil && len(*s.Description) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Description", 1)) + } + if s.RoleARN != nil && len(*s.RoleARN) < 20 { + invalidParams.Add(request.NewErrParamMinLen("RoleARN", 20)) + } + if s.StackName == nil { + invalidParams.Add(request.NewErrParamRequired("StackName")) + } + if s.StackName != nil && len(*s.StackName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) + } + if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) + } + if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) + } + if s.ResourcesToImport != nil { + for i, v := range s.ResourcesToImport { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourcesToImport", i), err.(request.ErrInvalidParams)) + } + } + } + if s.RollbackConfiguration != nil { + if err := s.RollbackConfiguration.Validate(); err != nil { + invalidParams.AddNested("RollbackConfiguration", err.(request.ErrInvalidParams)) + } + } + if s.Tags != nil { + for i, v := range s.Tags { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCapabilities sets the Capabilities field's value. +func (s *CreateChangeSetInput) SetCapabilities(v []*string) *CreateChangeSetInput { + s.Capabilities = v + return s +} + +// SetChangeSetName sets the ChangeSetName field's value. +func (s *CreateChangeSetInput) SetChangeSetName(v string) *CreateChangeSetInput { + s.ChangeSetName = &v + return s +} + +// SetChangeSetType sets the ChangeSetType field's value. +func (s *CreateChangeSetInput) SetChangeSetType(v string) *CreateChangeSetInput { + s.ChangeSetType = &v + return s +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateChangeSetInput) SetClientToken(v string) *CreateChangeSetInput { + s.ClientToken = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateChangeSetInput) SetDescription(v string) *CreateChangeSetInput { + s.Description = &v + return s +} + +// SetNotificationARNs sets the NotificationARNs field's value. +func (s *CreateChangeSetInput) SetNotificationARNs(v []*string) *CreateChangeSetInput { + s.NotificationARNs = v + return s +} + +// SetParameters sets the Parameters field's value. +func (s *CreateChangeSetInput) SetParameters(v []*Parameter) *CreateChangeSetInput { + s.Parameters = v + return s +} + +// SetResourceTypes sets the ResourceTypes field's value. +func (s *CreateChangeSetInput) SetResourceTypes(v []*string) *CreateChangeSetInput { + s.ResourceTypes = v + return s +} + +// SetResourcesToImport sets the ResourcesToImport field's value. +func (s *CreateChangeSetInput) SetResourcesToImport(v []*ResourceToImport) *CreateChangeSetInput { + s.ResourcesToImport = v + return s +} + +// SetRoleARN sets the RoleARN field's value. +func (s *CreateChangeSetInput) SetRoleARN(v string) *CreateChangeSetInput { + s.RoleARN = &v + return s +} + +// SetRollbackConfiguration sets the RollbackConfiguration field's value. +func (s *CreateChangeSetInput) SetRollbackConfiguration(v *RollbackConfiguration) *CreateChangeSetInput { + s.RollbackConfiguration = v + return s +} + +// SetStackName sets the StackName field's value. +func (s *CreateChangeSetInput) SetStackName(v string) *CreateChangeSetInput { + s.StackName = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateChangeSetInput) SetTags(v []*Tag) *CreateChangeSetInput { + s.Tags = v + return s +} + +// SetTemplateBody sets the TemplateBody field's value. +func (s *CreateChangeSetInput) SetTemplateBody(v string) *CreateChangeSetInput { + s.TemplateBody = &v + return s +} + +// SetTemplateURL sets the TemplateURL field's value. +func (s *CreateChangeSetInput) SetTemplateURL(v string) *CreateChangeSetInput { + s.TemplateURL = &v + return s +} + +// SetUsePreviousTemplate sets the UsePreviousTemplate field's value. +func (s *CreateChangeSetInput) SetUsePreviousTemplate(v bool) *CreateChangeSetInput { + s.UsePreviousTemplate = &v + return s +} + +// The output for the CreateChangeSet action. +type CreateChangeSetOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the change set. + Id *string `min:"1" type:"string"` + + // The unique ID of the stack. + StackId *string `type:"string"` +} + +// String returns the string representation +func (s CreateChangeSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateChangeSetOutput) GoString() string { + return s.String() +} + +// SetId sets the Id field's value. +func (s *CreateChangeSetOutput) SetId(v string) *CreateChangeSetOutput { + s.Id = &v + return s +} + +// SetStackId sets the StackId field's value. +func (s *CreateChangeSetOutput) SetStackId(v string) *CreateChangeSetOutput { + s.StackId = &v + return s +} + +// The input for CreateStack action. +type CreateStackInput struct { + _ struct{} `type:"structure"` + + // In some cases, you must explicitly acknowledge that your stack template contains + // certain capabilities in order for AWS CloudFormation to create the stack. + // + // * CAPABILITY_IAM and CAPABILITY_NAMED_IAM Some stack templates might include + // resources that can affect permissions in your AWS account; for example, + // by creating new AWS Identity and Access Management (IAM) users. For those + // stacks, you must explicitly acknowledge this by specifying one of these + // capabilities. The following IAM resources require you to specify either + // the CAPABILITY_IAM or CAPABILITY_NAMED_IAM capability. If you have IAM + // resources, you can specify either capability. If you have IAM resources + // with custom names, you must specify CAPABILITY_NAMED_IAM. If you don't + // specify either of these capabilities, AWS CloudFormation returns an InsufficientCapabilities + // error. If your stack template contains these resources, we recommend that + // you review all permissions associated with them and edit their permissions + // if necessary. AWS::IAM::AccessKey (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html) + // AWS::IAM::Group (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html) + // AWS::IAM::InstanceProfile (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) + // AWS::IAM::Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html) + // AWS::IAM::Role (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html) + // AWS::IAM::User (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) + // AWS::IAM::UserToGroupAddition (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html) + // For more information, see Acknowledging IAM Resources in AWS CloudFormation + // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). + // + // * CAPABILITY_AUTO_EXPAND Some template contain macros. Macros perform + // custom processing on templates; this can include simple actions like find-and-replace + // operations, all the way to extensive transformations of entire templates. + // Because of this, users typically create a change set from the processed + // template, so that they can review the changes resulting from the macros + // before actually creating the stack. If your stack template contains one + // or more macros, and you choose to create a stack directly from the processed + // template, without first reviewing the resulting changes in a change set, + // you must acknowledge this capability. This includes the AWS::Include (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html) + // and AWS::Serverless (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html) + // transforms, which are macros hosted by AWS CloudFormation. Change sets + // do not currently support nested stacks. If you want to create a stack + // from a stack template that contains macros and nested stacks, you must + // create the stack directly from the template using this capability. You + // should only create stacks directly from a stack template that contains + // macros if you know what processing the macro performs. Each macro relies + // on an underlying Lambda service function for processing stack templates. + // Be aware that the Lambda function owner can update the function operation + // without AWS CloudFormation being notified. For more information, see Using + // AWS CloudFormation Macros to Perform Custom Processing on Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html). + Capabilities []*string `type:"list"` + + // A unique identifier for this CreateStack request. Specify this token if you + // plan to retry requests so that AWS CloudFormation knows that you're not attempting + // to create a stack with the same name. You might retry CreateStack requests + // to ensure that AWS CloudFormation successfully received them. + // + // All events triggered by a given stack operation are assigned the same client + // request token, which you can use to track operations. For example, if you + // execute a CreateStack operation with the token token1, then all the StackEvents + // generated by that operation will have ClientRequestToken set as token1. + // + // In the console, stack operations display the client request token on the + // Events tab. Stack operations that are initiated from the console use the + // token format Console-StackOperation-ID, which helps you easily identify the + // stack operation . For example, if you create a stack using the console, each + // stack event would be assigned the same token in the following format: Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002. + ClientRequestToken *string `min:"1" type:"string"` + + // Set to true to disable rollback of the stack if stack creation failed. You + // can specify either DisableRollback or OnFailure, but not both. + // + // Default: false + DisableRollback *bool `type:"boolean"` + + // Whether to enable termination protection on the specified stack. If a user + // attempts to delete a stack with termination protection enabled, the operation + // fails and the stack remains unchanged. For more information, see Protecting + // a Stack From Being Deleted (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-protect-stacks.html) + // in the AWS CloudFormation User Guide. Termination protection is disabled + // on stacks by default. + // + // For nested stacks (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html), + // termination protection is set on the root stack and cannot be changed directly + // on the nested stack. + EnableTerminationProtection *bool `type:"boolean"` + + // The Simple Notification Service (SNS) topic ARNs to publish stack related + // events. You can find your SNS topic ARNs using the SNS console or your Command + // Line Interface (CLI). + NotificationARNs []*string `type:"list"` + + // Determines what action will be taken if stack creation fails. This must be + // one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either OnFailure + // or DisableRollback, but not both. + // + // Default: ROLLBACK + OnFailure *string `type:"string" enum:"OnFailure"` + + // A list of Parameter structures that specify input parameters for the stack. + // For more information, see the Parameter (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html) + // data type. + Parameters []*Parameter `type:"list"` + + // The template resource types that you have permissions to work with for this + // create stack action, such as AWS::EC2::Instance, AWS::EC2::*, or Custom::MyCustomInstance. + // Use the following syntax to describe template resource types: AWS::* (for + // all AWS resource), Custom::* (for all custom resources), Custom::logical_ID + // (for a specific custom resource), AWS::service_name::* (for all resources + // of a particular AWS service), and AWS::service_name::resource_logical_ID + // (for a specific AWS resource). + // + // If the list of resource types doesn't include a resource that you're creating, + // the stack creation fails. By default, AWS CloudFormation grants permissions + // to all resource types. AWS Identity and Access Management (IAM) uses this + // parameter for AWS CloudFormation-specific condition keys in IAM policies. + // For more information, see Controlling Access with AWS Identity and Access + // Management (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html). + ResourceTypes []*string `type:"list"` + + // The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) + // role that AWS CloudFormation assumes to create the stack. AWS CloudFormation + // uses the role's credentials to make calls on your behalf. AWS CloudFormation + // always uses this role for all future operations on the stack. As long as + // users have permission to operate on the stack, AWS CloudFormation uses this + // role even if the users don't have permission to pass it. Ensure that the + // role grants least privilege. + // + // If you don't specify a value, AWS CloudFormation uses the role that was previously + // associated with the stack. If no role is available, AWS CloudFormation uses + // a temporary session that is generated from your user credentials. + RoleARN *string `min:"20" type:"string"` + + // The rollback triggers for AWS CloudFormation to monitor during stack creation + // and updating operations, and for the specified monitoring period afterwards. + RollbackConfiguration *RollbackConfiguration `type:"structure"` + + // The name that is associated with the stack. The name must be unique in the + // region in which you are creating the stack. + // + // A stack name can contain only alphanumeric characters (case sensitive) and + // hyphens. It must start with an alphabetic character and cannot be longer + // than 128 characters. + // + // StackName is a required field + StackName *string `type:"string" required:"true"` + + // Structure containing the stack policy body. For more information, go to Prevent + // Updates to Stack Resources (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html) + // in the AWS CloudFormation User Guide. You can specify either the StackPolicyBody + // or the StackPolicyURL parameter, but not both. + StackPolicyBody *string `min:"1" type:"string"` + + // Location of a file containing the stack policy. The URL must point to a policy + // (maximum size: 16 KB) located in an S3 bucket in the same region as the stack. + // You can specify either the StackPolicyBody or the StackPolicyURL parameter, + // but not both. + StackPolicyURL *string `min:"1" type:"string"` + + // Key-value pairs to associate with this stack. AWS CloudFormation also propagates + // these tags to the resources created in the stack. A maximum number of 50 + // tags can be specified. + Tags []*Tag `type:"list"` + + // Structure containing the template body with a minimum length of 1 byte and + // a maximum length of 51,200 bytes. For more information, go to Template Anatomy + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // in the AWS CloudFormation User Guide. + // + // Conditional: You must specify either the TemplateBody or the TemplateURL + // parameter, but not both. + TemplateBody *string `min:"1" type:"string"` + + // Location of file containing the template body. The URL must point to a template + // (max size: 460,800 bytes) that is located in an Amazon S3 bucket. For more + // information, go to the Template Anatomy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // in the AWS CloudFormation User Guide. // - // * FAILED: The account gate function has determined that the account and - // region does not meet the requirements for a stack set operation to occur. - // AWS CloudFormation cancels the stack set operation in that account and - // region, and sets the stack set operation result status for that account - // and region to FAILED. + // Conditional: You must specify either the TemplateBody or the TemplateURL + // parameter, but not both. + TemplateURL *string `min:"1" type:"string"` + + // The amount of time that can pass before the stack status becomes CREATE_FAILED; + // if DisableRollback is not set or is set to false, the stack will be rolled + // back. + TimeoutInMinutes *int64 `min:"1" type:"integer"` +} + +// String returns the string representation +func (s CreateStackInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateStackInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateStackInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateStackInput"} + if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) + } + if s.RoleARN != nil && len(*s.RoleARN) < 20 { + invalidParams.Add(request.NewErrParamMinLen("RoleARN", 20)) + } + if s.StackName == nil { + invalidParams.Add(request.NewErrParamRequired("StackName")) + } + if s.StackPolicyBody != nil && len(*s.StackPolicyBody) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StackPolicyBody", 1)) + } + if s.StackPolicyURL != nil && len(*s.StackPolicyURL) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StackPolicyURL", 1)) + } + if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) + } + if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) + } + if s.TimeoutInMinutes != nil && *s.TimeoutInMinutes < 1 { + invalidParams.Add(request.NewErrParamMinValue("TimeoutInMinutes", 1)) + } + if s.RollbackConfiguration != nil { + if err := s.RollbackConfiguration.Validate(); err != nil { + invalidParams.AddNested("RollbackConfiguration", err.(request.ErrInvalidParams)) + } + } + if s.Tags != nil { + for i, v := range s.Tags { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCapabilities sets the Capabilities field's value. +func (s *CreateStackInput) SetCapabilities(v []*string) *CreateStackInput { + s.Capabilities = v + return s +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *CreateStackInput) SetClientRequestToken(v string) *CreateStackInput { + s.ClientRequestToken = &v + return s +} + +// SetDisableRollback sets the DisableRollback field's value. +func (s *CreateStackInput) SetDisableRollback(v bool) *CreateStackInput { + s.DisableRollback = &v + return s +} + +// SetEnableTerminationProtection sets the EnableTerminationProtection field's value. +func (s *CreateStackInput) SetEnableTerminationProtection(v bool) *CreateStackInput { + s.EnableTerminationProtection = &v + return s +} + +// SetNotificationARNs sets the NotificationARNs field's value. +func (s *CreateStackInput) SetNotificationARNs(v []*string) *CreateStackInput { + s.NotificationARNs = v + return s +} + +// SetOnFailure sets the OnFailure field's value. +func (s *CreateStackInput) SetOnFailure(v string) *CreateStackInput { + s.OnFailure = &v + return s +} + +// SetParameters sets the Parameters field's value. +func (s *CreateStackInput) SetParameters(v []*Parameter) *CreateStackInput { + s.Parameters = v + return s +} + +// SetResourceTypes sets the ResourceTypes field's value. +func (s *CreateStackInput) SetResourceTypes(v []*string) *CreateStackInput { + s.ResourceTypes = v + return s +} + +// SetRoleARN sets the RoleARN field's value. +func (s *CreateStackInput) SetRoleARN(v string) *CreateStackInput { + s.RoleARN = &v + return s +} + +// SetRollbackConfiguration sets the RollbackConfiguration field's value. +func (s *CreateStackInput) SetRollbackConfiguration(v *RollbackConfiguration) *CreateStackInput { + s.RollbackConfiguration = v + return s +} + +// SetStackName sets the StackName field's value. +func (s *CreateStackInput) SetStackName(v string) *CreateStackInput { + s.StackName = &v + return s +} + +// SetStackPolicyBody sets the StackPolicyBody field's value. +func (s *CreateStackInput) SetStackPolicyBody(v string) *CreateStackInput { + s.StackPolicyBody = &v + return s +} + +// SetStackPolicyURL sets the StackPolicyURL field's value. +func (s *CreateStackInput) SetStackPolicyURL(v string) *CreateStackInput { + s.StackPolicyURL = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateStackInput) SetTags(v []*Tag) *CreateStackInput { + s.Tags = v + return s +} + +// SetTemplateBody sets the TemplateBody field's value. +func (s *CreateStackInput) SetTemplateBody(v string) *CreateStackInput { + s.TemplateBody = &v + return s +} + +// SetTemplateURL sets the TemplateURL field's value. +func (s *CreateStackInput) SetTemplateURL(v string) *CreateStackInput { + s.TemplateURL = &v + return s +} + +// SetTimeoutInMinutes sets the TimeoutInMinutes field's value. +func (s *CreateStackInput) SetTimeoutInMinutes(v int64) *CreateStackInput { + s.TimeoutInMinutes = &v + return s +} + +type CreateStackInstancesInput struct { + _ struct{} `type:"structure"` + + // The names of one or more AWS accounts that you want to create stack instances + // in the specified region(s) for. // - // * SKIPPED: AWS CloudFormation has skipped calling the account gate function - // for this account and region, for one of the following reasons: An account - // gate function has not been specified for the account and region. AWS CloudFormation - // proceeds with the stack set operation in this account and region. The - // AWSCloudFormationStackSetExecutionRole of the stack set adminstration - // account lacks permissions to invoke the function. AWS CloudFormation proceeds - // with the stack set operation in this account and region. Either no action - // is necessary, or no action is possible, on the stack. AWS CloudFormation - // skips the stack set operation in this account and region. - Status *string `type:"string" enum:"AccountGateStatus"` + // Accounts is a required field + Accounts []*string `type:"list" required:"true"` + + // The unique identifier for this stack set operation. + // + // The operation ID also functions as an idempotency token, to ensure that AWS + // CloudFormation performs the stack set operation only once, even if you retry + // the request multiple times. You might retry stack set operation requests + // to ensure that AWS CloudFormation successfully received them. + // + // If you don't specify an operation ID, the SDK generates one automatically. + // + // Repeating this stack set operation with a new operation ID retries all stack + // instances whose status is OUTDATED. + OperationId *string `min:"1" type:"string" idempotencyToken:"true"` + + // Preferences for how AWS CloudFormation performs this stack set operation. + OperationPreferences *StackSetOperationPreferences `type:"structure"` + + // A list of stack set parameters whose values you want to override in the selected + // stack instances. + // + // Any overridden parameter values will be applied to all stack instances in + // the specified accounts and regions. When specifying parameters and their + // values, be aware of how AWS CloudFormation sets parameter values during stack + // instance operations: + // + // * To override the current value for a parameter, include the parameter + // and specify its value. + // + // * To leave a parameter set to its present value, you can do one of the + // following: Do not include the parameter in the list. Include the parameter + // and specify UsePreviousValue as true. (You cannot specify both a value + // and set UsePreviousValue to true.) + // + // * To set all overridden parameter back to the values specified in the + // stack set, specify a parameter list but do not include any parameters. + // + // * To leave all parameters set to their present values, do not specify + // this property at all. + // + // During stack set updates, any parameter values overridden for a stack instance + // are not updated, but retain their overridden value. + // + // You can only override the parameter values that are specified in the stack + // set; to add or delete a parameter itself, use UpdateStackSet (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html) + // to update the stack set template. + ParameterOverrides []*Parameter `type:"list"` - // The reason for the account gate status assigned to this account and region - // for the stack set operation. - StatusReason *string `type:"string"` + // The names of one or more regions where you want to create stack instances + // using the specified AWS account(s). + // + // Regions is a required field + Regions []*string `type:"list" required:"true"` + + // The name or unique ID of the stack set that you want to create stack instances + // from. + // + // StackSetName is a required field + StackSetName *string `type:"string" required:"true"` } // String returns the string representation -func (s AccountGateResult) String() string { +func (s CreateStackInstancesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AccountGateResult) GoString() string { +func (s CreateStackInstancesInput) GoString() string { return s.String() } -// SetStatus sets the Status field's value. -func (s *AccountGateResult) SetStatus(v string) *AccountGateResult { - s.Status = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateStackInstancesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateStackInstancesInput"} + if s.Accounts == nil { + invalidParams.Add(request.NewErrParamRequired("Accounts")) + } + if s.OperationId != nil && len(*s.OperationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) + } + if s.Regions == nil { + invalidParams.Add(request.NewErrParamRequired("Regions")) + } + if s.StackSetName == nil { + invalidParams.Add(request.NewErrParamRequired("StackSetName")) + } + if s.OperationPreferences != nil { + if err := s.OperationPreferences.Validate(); err != nil { + invalidParams.AddNested("OperationPreferences", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccounts sets the Accounts field's value. +func (s *CreateStackInstancesInput) SetAccounts(v []*string) *CreateStackInstancesInput { + s.Accounts = v return s } -// SetStatusReason sets the StatusReason field's value. -func (s *AccountGateResult) SetStatusReason(v string) *AccountGateResult { - s.StatusReason = &v +// SetOperationId sets the OperationId field's value. +func (s *CreateStackInstancesInput) SetOperationId(v string) *CreateStackInstancesInput { + s.OperationId = &v return s } -// The AccountLimit data type. For more information about account limits, see -// AWS CloudFormation Limits (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) -// in the AWS CloudFormation User Guide. -type AccountLimit struct { - _ struct{} `type:"structure"` +// SetOperationPreferences sets the OperationPreferences field's value. +func (s *CreateStackInstancesInput) SetOperationPreferences(v *StackSetOperationPreferences) *CreateStackInstancesInput { + s.OperationPreferences = v + return s +} - // The name of the account limit. - Name *string `type:"string"` +// SetParameterOverrides sets the ParameterOverrides field's value. +func (s *CreateStackInstancesInput) SetParameterOverrides(v []*Parameter) *CreateStackInstancesInput { + s.ParameterOverrides = v + return s +} - // The value that is associated with the account limit name. - Value *int64 `type:"integer"` +// SetRegions sets the Regions field's value. +func (s *CreateStackInstancesInput) SetRegions(v []*string) *CreateStackInstancesInput { + s.Regions = v + return s +} + +// SetStackSetName sets the StackSetName field's value. +func (s *CreateStackInstancesInput) SetStackSetName(v string) *CreateStackInstancesInput { + s.StackSetName = &v + return s +} + +type CreateStackInstancesOutput struct { + _ struct{} `type:"structure"` + + // The unique identifier for this stack set operation. + OperationId *string `min:"1" type:"string"` } // String returns the string representation -func (s AccountLimit) String() string { +func (s CreateStackInstancesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AccountLimit) GoString() string { +func (s CreateStackInstancesOutput) GoString() string { return s.String() } -// SetName sets the Name field's value. -func (s *AccountLimit) SetName(v string) *AccountLimit { - s.Name = &v +// SetOperationId sets the OperationId field's value. +func (s *CreateStackInstancesOutput) SetOperationId(v string) *CreateStackInstancesOutput { + s.OperationId = &v return s } -// SetValue sets the Value field's value. -func (s *AccountLimit) SetValue(v int64) *AccountLimit { - s.Value = &v +// The output for a CreateStack action. +type CreateStackOutput struct { + _ struct{} `type:"structure"` + + // Unique identifier of the stack. + StackId *string `type:"string"` +} + +// String returns the string representation +func (s CreateStackOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateStackOutput) GoString() string { + return s.String() +} + +// SetStackId sets the StackId field's value. +func (s *CreateStackOutput) SetStackId(v string) *CreateStackOutput { + s.StackId = &v return s } -// The input for the CancelUpdateStack action. -type CancelUpdateStackInput struct { +type CreateStackSetInput struct { _ struct{} `type:"structure"` - // A unique identifier for this CancelUpdateStack request. Specify this token - // if you plan to retry requests so that AWS CloudFormation knows that you're - // not attempting to cancel an update on a stack with the same name. You might - // retry CancelUpdateStack requests to ensure that AWS CloudFormation successfully - // received them. - ClientRequestToken *string `min:"1" type:"string"` + // The Amazon Resource Number (ARN) of the IAM role to use to create this stack + // set. + // + // Specify an IAM role only if you are using customized administrator roles + // to control which users or groups can manage specific stack sets within the + // same administrator account. For more information, see Prerequisites: Granting + // Permissions for Stack Set Operations (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html) + // in the AWS CloudFormation User Guide. + AdministrationRoleARN *string `min:"20" type:"string"` - // The name or the unique stack ID that is associated with the stack. + // In some cases, you must explicitly acknowledge that your stack set template + // contains certain capabilities in order for AWS CloudFormation to create the + // stack set and related stack instances. // - // StackName is a required field - StackName *string `type:"string" required:"true"` + // * CAPABILITY_IAM and CAPABILITY_NAMED_IAM Some stack templates might include + // resources that can affect permissions in your AWS account; for example, + // by creating new AWS Identity and Access Management (IAM) users. For those + // stack sets, you must explicitly acknowledge this by specifying one of + // these capabilities. The following IAM resources require you to specify + // either the CAPABILITY_IAM or CAPABILITY_NAMED_IAM capability. If you have + // IAM resources, you can specify either capability. If you have IAM resources + // with custom names, you must specify CAPABILITY_NAMED_IAM. If you don't + // specify either of these capabilities, AWS CloudFormation returns an InsufficientCapabilities + // error. If your stack template contains these resources, we recommend that + // you review all permissions associated with them and edit their permissions + // if necessary. AWS::IAM::AccessKey (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html) + // AWS::IAM::Group (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html) + // AWS::IAM::InstanceProfile (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) + // AWS::IAM::Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html) + // AWS::IAM::Role (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html) + // AWS::IAM::User (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) + // AWS::IAM::UserToGroupAddition (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html) + // For more information, see Acknowledging IAM Resources in AWS CloudFormation + // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). + // + // * CAPABILITY_AUTO_EXPAND Some templates contain macros. If your stack + // template contains one or more macros, and you choose to create a stack + // directly from the processed template, without first reviewing the resulting + // changes in a change set, you must acknowledge this capability. For more + // information, see Using AWS CloudFormation Macros to Perform Custom Processing + // on Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html). + // Stack sets do not currently support macros in stack templates. (This includes + // the AWS::Include (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html) + // and AWS::Serverless (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html) + // transforms, which are macros hosted by AWS CloudFormation.) Even if you + // specify this capability, if you include a macro in your template the stack + // set operation will fail. + Capabilities []*string `type:"list"` + + // A unique identifier for this CreateStackSet request. Specify this token if + // you plan to retry requests so that AWS CloudFormation knows that you're not + // attempting to create another stack set with the same name. You might retry + // CreateStackSet requests to ensure that AWS CloudFormation successfully received + // them. + // + // If you don't specify an operation ID, the SDK generates one automatically. + ClientRequestToken *string `min:"1" type:"string" idempotencyToken:"true"` + + // A description of the stack set. You can use the description to identify the + // stack set's purpose or other important information. + Description *string `min:"1" type:"string"` + + // The name of the IAM execution role to use to create the stack set. If you + // do not specify an execution role, AWS CloudFormation uses the AWSCloudFormationStackSetExecutionRole + // role for the stack set operation. + // + // Specify an IAM role only if you are using customized execution roles to control + // which stack resources users and groups can include in their stack sets. + ExecutionRoleName *string `min:"1" type:"string"` + + // The input parameters for the stack set template. + Parameters []*Parameter `type:"list"` + + // The name to associate with the stack set. The name must be unique in the + // region where you create your stack set. + // + // A stack name can contain only alphanumeric characters (case-sensitive) and + // hyphens. It must start with an alphabetic character and can't be longer than + // 128 characters. + // + // StackSetName is a required field + StackSetName *string `type:"string" required:"true"` + + // The key-value pairs to associate with this stack set and the stacks created + // from it. AWS CloudFormation also propagates these tags to supported resources + // that are created in the stacks. A maximum number of 50 tags can be specified. + // + // If you specify tags as part of a CreateStackSet action, AWS CloudFormation + // checks to see if you have the required IAM permission to tag resources. If + // you don't, the entire CreateStackSet action fails with an access denied error, + // and the stack set is not created. + Tags []*Tag `type:"list"` + + // The structure that contains the template body, with a minimum length of 1 + // byte and a maximum length of 51,200 bytes. For more information, see Template + // Anatomy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // in the AWS CloudFormation User Guide. + // + // Conditional: You must specify either the TemplateBody or the TemplateURL + // parameter, but not both. + TemplateBody *string `min:"1" type:"string"` + + // The location of the file that contains the template body. The URL must point + // to a template (maximum size: 460,800 bytes) that's located in an Amazon S3 + // bucket. For more information, see Template Anatomy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // in the AWS CloudFormation User Guide. + // + // Conditional: You must specify either the TemplateBody or the TemplateURL + // parameter, but not both. + TemplateURL *string `min:"1" type:"string"` } // String returns the string representation -func (s CancelUpdateStackInput) String() string { +func (s CreateStackSetInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CancelUpdateStackInput) GoString() string { +func (s CreateStackSetInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CancelUpdateStackInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelUpdateStackInput"} +func (s *CreateStackSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateStackSetInput"} + if s.AdministrationRoleARN != nil && len(*s.AdministrationRoleARN) < 20 { + invalidParams.Add(request.NewErrParamMinLen("AdministrationRoleARN", 20)) + } if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) } - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) + if s.Description != nil && len(*s.Description) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Description", 1)) + } + if s.ExecutionRoleName != nil && len(*s.ExecutionRoleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ExecutionRoleName", 1)) + } + if s.StackSetName == nil { + invalidParams.Add(request.NewErrParamRequired("StackSetName")) + } + if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) + } + if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) + } + if s.Tags != nil { + for i, v := range s.Tags { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) + } + } } if invalidParams.Len() > 0 { @@ -4399,254 +6851,217 @@ func (s *CancelUpdateStackInput) Validate() error { return nil } -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *CancelUpdateStackInput) SetClientRequestToken(v string) *CancelUpdateStackInput { - s.ClientRequestToken = &v +// SetAdministrationRoleARN sets the AdministrationRoleARN field's value. +func (s *CreateStackSetInput) SetAdministrationRoleARN(v string) *CreateStackSetInput { + s.AdministrationRoleARN = &v return s } -// SetStackName sets the StackName field's value. -func (s *CancelUpdateStackInput) SetStackName(v string) *CancelUpdateStackInput { - s.StackName = &v +// SetCapabilities sets the Capabilities field's value. +func (s *CreateStackSetInput) SetCapabilities(v []*string) *CreateStackSetInput { + s.Capabilities = v return s } -type CancelUpdateStackOutput struct { - _ struct{} `type:"structure"` +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *CreateStackSetInput) SetClientRequestToken(v string) *CreateStackSetInput { + s.ClientRequestToken = &v + return s } -// String returns the string representation -func (s CancelUpdateStackOutput) String() string { - return awsutil.Prettify(s) +// SetDescription sets the Description field's value. +func (s *CreateStackSetInput) SetDescription(v string) *CreateStackSetInput { + s.Description = &v + return s } -// GoString returns the string representation -func (s CancelUpdateStackOutput) GoString() string { - return s.String() +// SetExecutionRoleName sets the ExecutionRoleName field's value. +func (s *CreateStackSetInput) SetExecutionRoleName(v string) *CreateStackSetInput { + s.ExecutionRoleName = &v + return s } -// The Change structure describes the changes AWS CloudFormation will perform -// if you execute the change set. -type Change struct { - _ struct{} `type:"structure"` - - // A ResourceChange structure that describes the resource and action that AWS - // CloudFormation will perform. - ResourceChange *ResourceChange `type:"structure"` - - // The type of entity that AWS CloudFormation changes. Currently, the only entity - // type is Resource. - Type *string `type:"string" enum:"ChangeType"` +// SetParameters sets the Parameters field's value. +func (s *CreateStackSetInput) SetParameters(v []*Parameter) *CreateStackSetInput { + s.Parameters = v + return s } -// String returns the string representation -func (s Change) String() string { - return awsutil.Prettify(s) +// SetStackSetName sets the StackSetName field's value. +func (s *CreateStackSetInput) SetStackSetName(v string) *CreateStackSetInput { + s.StackSetName = &v + return s } -// GoString returns the string representation -func (s Change) GoString() string { - return s.String() +// SetTags sets the Tags field's value. +func (s *CreateStackSetInput) SetTags(v []*Tag) *CreateStackSetInput { + s.Tags = v + return s } -// SetResourceChange sets the ResourceChange field's value. -func (s *Change) SetResourceChange(v *ResourceChange) *Change { - s.ResourceChange = v +// SetTemplateBody sets the TemplateBody field's value. +func (s *CreateStackSetInput) SetTemplateBody(v string) *CreateStackSetInput { + s.TemplateBody = &v return s } -// SetType sets the Type field's value. -func (s *Change) SetType(v string) *Change { - s.Type = &v +// SetTemplateURL sets the TemplateURL field's value. +func (s *CreateStackSetInput) SetTemplateURL(v string) *CreateStackSetInput { + s.TemplateURL = &v return s } -// The ChangeSetSummary structure describes a change set, its status, and the -// stack with which it's associated. -type ChangeSetSummary struct { +type CreateStackSetOutput struct { _ struct{} `type:"structure"` - // The ID of the change set. - ChangeSetId *string `min:"1" type:"string"` - - // The name of the change set. - ChangeSetName *string `min:"1" type:"string"` - - // The start time when the change set was created, in UTC. - CreationTime *time.Time `type:"timestamp"` - - // Descriptive information about the change set. - Description *string `min:"1" type:"string"` - - // If the change set execution status is AVAILABLE, you can execute the change - // set. If you can’t execute the change set, the status indicates why. For - // example, a change set might be in an UNAVAILABLE state because AWS CloudFormation - // is still creating it or in an OBSOLETE state because the stack was already - // updated. - ExecutionStatus *string `type:"string" enum:"ExecutionStatus"` - - // The ID of the stack with which the change set is associated. - StackId *string `type:"string"` - - // The name of the stack with which the change set is associated. - StackName *string `type:"string"` - - // The state of the change set, such as CREATE_IN_PROGRESS, CREATE_COMPLETE, - // or FAILED. - Status *string `type:"string" enum:"ChangeSetStatus"` - - // A description of the change set's status. For example, if your change set - // is in the FAILED state, AWS CloudFormation shows the error message. - StatusReason *string `type:"string"` + // The ID of the stack set that you're creating. + StackSetId *string `type:"string"` } // String returns the string representation -func (s ChangeSetSummary) String() string { +func (s CreateStackSetOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ChangeSetSummary) GoString() string { +func (s CreateStackSetOutput) GoString() string { return s.String() } -// SetChangeSetId sets the ChangeSetId field's value. -func (s *ChangeSetSummary) SetChangeSetId(v string) *ChangeSetSummary { - s.ChangeSetId = &v +// SetStackSetId sets the StackSetId field's value. +func (s *CreateStackSetOutput) SetStackSetId(v string) *CreateStackSetOutput { + s.StackSetId = &v return s } -// SetChangeSetName sets the ChangeSetName field's value. -func (s *ChangeSetSummary) SetChangeSetName(v string) *ChangeSetSummary { - s.ChangeSetName = &v - return s +// The input for the DeleteChangeSet action. +type DeleteChangeSetInput struct { + _ struct{} `type:"structure"` + + // The name or Amazon Resource Name (ARN) of the change set that you want to + // delete. + // + // ChangeSetName is a required field + ChangeSetName *string `min:"1" type:"string" required:"true"` + + // If you specified the name of a change set to delete, specify the stack name + // or ID (ARN) that is associated with it. + StackName *string `min:"1" type:"string"` } -// SetCreationTime sets the CreationTime field's value. -func (s *ChangeSetSummary) SetCreationTime(v time.Time) *ChangeSetSummary { - s.CreationTime = &v - return s +// String returns the string representation +func (s DeleteChangeSetInput) String() string { + return awsutil.Prettify(s) } -// SetDescription sets the Description field's value. -func (s *ChangeSetSummary) SetDescription(v string) *ChangeSetSummary { - s.Description = &v - return s +// GoString returns the string representation +func (s DeleteChangeSetInput) GoString() string { + return s.String() } -// SetExecutionStatus sets the ExecutionStatus field's value. -func (s *ChangeSetSummary) SetExecutionStatus(v string) *ChangeSetSummary { - s.ExecutionStatus = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteChangeSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteChangeSetInput"} + if s.ChangeSetName == nil { + invalidParams.Add(request.NewErrParamRequired("ChangeSetName")) + } + if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1)) + } + if s.StackName != nil && len(*s.StackName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetStackId sets the StackId field's value. -func (s *ChangeSetSummary) SetStackId(v string) *ChangeSetSummary { - s.StackId = &v +// SetChangeSetName sets the ChangeSetName field's value. +func (s *DeleteChangeSetInput) SetChangeSetName(v string) *DeleteChangeSetInput { + s.ChangeSetName = &v return s } // SetStackName sets the StackName field's value. -func (s *ChangeSetSummary) SetStackName(v string) *ChangeSetSummary { +func (s *DeleteChangeSetInput) SetStackName(v string) *DeleteChangeSetInput { s.StackName = &v return s } -// SetStatus sets the Status field's value. -func (s *ChangeSetSummary) SetStatus(v string) *ChangeSetSummary { - s.Status = &v - return s +// The output for the DeleteChangeSet action. +type DeleteChangeSetOutput struct { + _ struct{} `type:"structure"` } -// SetStatusReason sets the StatusReason field's value. -func (s *ChangeSetSummary) SetStatusReason(v string) *ChangeSetSummary { - s.StatusReason = &v - return s +// String returns the string representation +func (s DeleteChangeSetOutput) String() string { + return awsutil.Prettify(s) } -// The input for the ContinueUpdateRollback action. -type ContinueUpdateRollbackInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for this ContinueUpdateRollback request. Specify this - // token if you plan to retry requests so that AWS CloudFormation knows that - // you're not attempting to continue the rollback to a stack with the same name. - // You might retry ContinueUpdateRollback requests to ensure that AWS CloudFormation - // successfully received them. - ClientRequestToken *string `min:"1" type:"string"` +// GoString returns the string representation +func (s DeleteChangeSetOutput) GoString() string { + return s.String() +} - // A list of the logical IDs of the resources that AWS CloudFormation skips - // during the continue update rollback operation. You can specify only resources - // that are in the UPDATE_FAILED state because a rollback failed. You can't - // specify resources that are in the UPDATE_FAILED state for other reasons, - // for example, because an update was cancelled. To check why a resource update - // failed, use the DescribeStackResources action, and view the resource status - // reason. - // - // Specify this property to skip rolling back resources that AWS CloudFormation - // can't successfully roll back. We recommend that you troubleshoot (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-update-rollback-failed) - // resources before skipping them. AWS CloudFormation sets the status of the - // specified resources to UPDATE_COMPLETE and continues to roll back the stack. - // After the rollback is complete, the state of the skipped resources will be - // inconsistent with the state of the resources in the stack template. Before - // performing another stack update, you must update the stack or resources to - // be consistent with each other. If you don't, subsequent stack updates might - // fail, and the stack will become unrecoverable. +// The input for DeleteStack action. +type DeleteStackInput struct { + _ struct{} `type:"structure"` + + // A unique identifier for this DeleteStack request. Specify this token if you + // plan to retry requests so that AWS CloudFormation knows that you're not attempting + // to delete a stack with the same name. You might retry DeleteStack requests + // to ensure that AWS CloudFormation successfully received them. // - // Specify the minimum number of resources required to successfully roll back - // your stack. For example, a failed resource update might cause dependent resources - // to fail. In this case, it might not be necessary to skip the dependent resources. + // All events triggered by a given stack operation are assigned the same client + // request token, which you can use to track operations. For example, if you + // execute a CreateStack operation with the token token1, then all the StackEvents + // generated by that operation will have ClientRequestToken set as token1. // - // To skip resources that are part of nested stacks, use the following format: - // NestedStackName.ResourceLogicalID. If you want to specify the logical ID - // of a stack resource (Type: AWS::CloudFormation::Stack) in the ResourcesToSkip - // list, then its corresponding embedded stack must be in one of the following - // states: DELETE_IN_PROGRESS, DELETE_COMPLETE, or DELETE_FAILED. + // In the console, stack operations display the client request token on the + // Events tab. Stack operations that are initiated from the console use the + // token format Console-StackOperation-ID, which helps you easily identify the + // stack operation . For example, if you create a stack using the console, each + // stack event would be assigned the same token in the following format: Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002. + ClientRequestToken *string `min:"1" type:"string"` + + // For stacks in the DELETE_FAILED state, a list of resource logical IDs that + // are associated with the resources you want to retain. During deletion, AWS + // CloudFormation deletes the stack but does not delete the retained resources. // - // Don't confuse a child stack's name with its corresponding logical ID defined - // in the parent stack. For an example of a continue update rollback operation - // with nested stacks, see Using ResourcesToSkip to recover a nested stacks - // hierarchy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-continueupdaterollback.html#nested-stacks). - ResourcesToSkip []*string `type:"list"` + // Retaining resources is useful when you cannot delete a resource, such as + // a non-empty S3 bucket, but you want to delete the stack. + RetainResources []*string `type:"list"` // The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) - // role that AWS CloudFormation assumes to roll back the stack. AWS CloudFormation - // uses the role's credentials to make calls on your behalf. AWS CloudFormation - // always uses this role for all future operations on the stack. As long as - // users have permission to operate on the stack, AWS CloudFormation uses this - // role even if the users don't have permission to pass it. Ensure that the - // role grants least privilege. + // role that AWS CloudFormation assumes to delete the stack. AWS CloudFormation + // uses the role's credentials to make calls on your behalf. // // If you don't specify a value, AWS CloudFormation uses the role that was previously // associated with the stack. If no role is available, AWS CloudFormation uses // a temporary session that is generated from your user credentials. RoleARN *string `min:"20" type:"string"` - // The name or the unique ID of the stack that you want to continue rolling - // back. - // - // Don't specify the name of a nested stack (a stack that was created by using - // the AWS::CloudFormation::Stack resource). Instead, use this operation on - // the parent stack (the stack that contains the AWS::CloudFormation::Stack - // resource). + // The name or the unique stack ID that is associated with the stack. // // StackName is a required field - StackName *string `min:"1" type:"string" required:"true"` + StackName *string `type:"string" required:"true"` } // String returns the string representation -func (s ContinueUpdateRollbackInput) String() string { +func (s DeleteStackInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ContinueUpdateRollbackInput) GoString() string { +func (s DeleteStackInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ContinueUpdateRollbackInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ContinueUpdateRollbackInput"} +func (s *DeleteStackInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteStackInput"} if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) } @@ -4656,9 +7071,6 @@ func (s *ContinueUpdateRollbackInput) Validate() error { if s.StackName == nil { invalidParams.Add(request.NewErrParamRequired("StackName")) } - if s.StackName != nil && len(*s.StackName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) - } if invalidParams.Len() > 0 { return invalidParams @@ -4667,249 +7079,105 @@ func (s *ContinueUpdateRollbackInput) Validate() error { } // SetClientRequestToken sets the ClientRequestToken field's value. -func (s *ContinueUpdateRollbackInput) SetClientRequestToken(v string) *ContinueUpdateRollbackInput { +func (s *DeleteStackInput) SetClientRequestToken(v string) *DeleteStackInput { s.ClientRequestToken = &v return s } -// SetResourcesToSkip sets the ResourcesToSkip field's value. -func (s *ContinueUpdateRollbackInput) SetResourcesToSkip(v []*string) *ContinueUpdateRollbackInput { - s.ResourcesToSkip = v +// SetRetainResources sets the RetainResources field's value. +func (s *DeleteStackInput) SetRetainResources(v []*string) *DeleteStackInput { + s.RetainResources = v return s } // SetRoleARN sets the RoleARN field's value. -func (s *ContinueUpdateRollbackInput) SetRoleARN(v string) *ContinueUpdateRollbackInput { +func (s *DeleteStackInput) SetRoleARN(v string) *DeleteStackInput { s.RoleARN = &v return s } // SetStackName sets the StackName field's value. -func (s *ContinueUpdateRollbackInput) SetStackName(v string) *ContinueUpdateRollbackInput { +func (s *DeleteStackInput) SetStackName(v string) *DeleteStackInput { s.StackName = &v return s } -// The output for a ContinueUpdateRollback action. -type ContinueUpdateRollbackOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ContinueUpdateRollbackOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ContinueUpdateRollbackOutput) GoString() string { - return s.String() -} - -// The input for the CreateChangeSet action. -type CreateChangeSetInput struct { +type DeleteStackInstancesInput struct { _ struct{} `type:"structure"` - // In some cases, you must explicity acknowledge that your stack template contains - // certain capabilities in order for AWS CloudFormation to create the stack. - // - // * CAPABILITY_IAM and CAPABILITY_NAMED_IAM Some stack templates might include - // resources that can affect permissions in your AWS account; for example, - // by creating new AWS Identity and Access Management (IAM) users. For those - // stacks, you must explicitly acknowledge this by specifying one of these - // capabilities. The following IAM resources require you to specify either - // the CAPABILITY_IAM or CAPABILITY_NAMED_IAM capability. If you have IAM - // resources, you can specify either capability. If you have IAM resources - // with custom names, you must specify CAPABILITY_NAMED_IAM. If you don't - // specify either of these capabilities, AWS CloudFormation returns an InsufficientCapabilities - // error. If your stack template contains these resources, we recommend that - // you review all permissions associated with them and edit their permissions - // if necessary. AWS::IAM::AccessKey (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html) - // AWS::IAM::Group (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html) - // AWS::IAM::InstanceProfile (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) - // AWS::IAM::Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html) - // AWS::IAM::Role (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html) - // AWS::IAM::User (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) - // AWS::IAM::UserToGroupAddition (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html) - // For more information, see Acknowledging IAM Resources in AWS CloudFormation - // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). + // The names of the AWS accounts that you want to delete stack instances for. // - // * CAPABILITY_AUTO_EXPAND Some template contain macros. Macros perform - // custom processing on templates; this can include simple actions like find-and-replace - // operations, all the way to extensive transformations of entire templates. - // Because of this, users typically create a change set from the processed - // template, so that they can review the changes resulting from the macros - // before actually creating the stack. If your stack template contains one - // or more macros, and you choose to create a stack directly from the processed - // template, without first reviewing the resulting changes in a change set, - // you must acknowledge this capability. This includes the AWS::Include (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html) - // and AWS::Serverless (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html) - // transforms, which are macros hosted by AWS CloudFormation. This capacity - // does not apply to creating change sets, and specifying it when creating - // change sets has no effect. Also, change sets do not currently support - // nested stacks. If you want to create a stack from a stack template that - // contains macros and nested stacks, you must create or update the stack - // directly from the template using the CreateStack or UpdateStack action, - // and specifying this capability. For more information on macros, see Using - // AWS CloudFormation Macros to Perform Custom Processing on Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html). - Capabilities []*string `type:"list"` + // Accounts is a required field + Accounts []*string `type:"list" required:"true"` - // The name of the change set. The name must be unique among all change sets - // that are associated with the specified stack. - // - // A change set name can contain only alphanumeric, case sensitive characters - // and hyphens. It must start with an alphabetic character and cannot exceed - // 128 characters. + // The unique identifier for this stack set operation. // - // ChangeSetName is a required field - ChangeSetName *string `min:"1" type:"string" required:"true"` - - // The type of change set operation. To create a change set for a new stack, - // specify CREATE. To create a change set for an existing stack, specify UPDATE. + // If you don't specify an operation ID, the SDK generates one automatically. // - // If you create a change set for a new stack, AWS Cloudformation creates a - // stack with a unique stack ID, but no template or resources. The stack will - // be in the REVIEW_IN_PROGRESS (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-describing-stacks.html#d0e11995) - // state until you execute the change set. + // The operation ID also functions as an idempotency token, to ensure that AWS + // CloudFormation performs the stack set operation only once, even if you retry + // the request multiple times. You can retry stack set operation requests to + // ensure that AWS CloudFormation successfully received them. // - // By default, AWS CloudFormation specifies UPDATE. You can't use the UPDATE - // type to create a change set for a new stack or the CREATE type to create - // a change set for an existing stack. - ChangeSetType *string `type:"string" enum:"ChangeSetType"` - - // A unique identifier for this CreateChangeSet request. Specify this token - // if you plan to retry requests so that AWS CloudFormation knows that you're - // not attempting to create another change set with the same name. You might - // retry CreateChangeSet requests to ensure that AWS CloudFormation successfully - // received them. - ClientToken *string `min:"1" type:"string"` - - // A description to help you identify this change set. - Description *string `min:"1" type:"string"` - - // The Amazon Resource Names (ARNs) of Amazon Simple Notification Service (Amazon - // SNS) topics that AWS CloudFormation associates with the stack. To remove - // all associated notification topics, specify an empty list. - NotificationARNs []*string `type:"list"` - - // A list of Parameter structures that specify input parameters for the change - // set. For more information, see the Parameter data type. - Parameters []*Parameter `type:"list"` + // Repeating this stack set operation with a new operation ID retries all stack + // instances whose status is OUTDATED. + OperationId *string `min:"1" type:"string" idempotencyToken:"true"` - // The template resource types that you have permissions to work with if you - // execute this change set, such as AWS::EC2::Instance, AWS::EC2::*, or Custom::MyCustomInstance. - // - // If the list of resource types doesn't include a resource type that you're - // updating, the stack update fails. By default, AWS CloudFormation grants permissions - // to all resource types. AWS Identity and Access Management (IAM) uses this - // parameter for condition keys in IAM policies for AWS CloudFormation. For - // more information, see Controlling Access with AWS Identity and Access Management - // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html) - // in the AWS CloudFormation User Guide. - ResourceTypes []*string `type:"list"` + // Preferences for how AWS CloudFormation performs this stack set operation. + OperationPreferences *StackSetOperationPreferences `type:"structure"` - // The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) - // role that AWS CloudFormation assumes when executing the change set. AWS CloudFormation - // uses the role's credentials to make calls on your behalf. AWS CloudFormation - // uses this role for all future operations on the stack. As long as users have - // permission to operate on the stack, AWS CloudFormation uses this role even - // if the users don't have permission to pass it. Ensure that the role grants - // least privilege. + // The regions where you want to delete stack set instances. // - // If you don't specify a value, AWS CloudFormation uses the role that was previously - // associated with the stack. If no role is available, AWS CloudFormation uses - // a temporary session that is generated from your user credentials. - RoleARN *string `min:"20" type:"string"` - - // The rollback triggers for AWS CloudFormation to monitor during stack creation - // and updating operations, and for the specified monitoring period afterwards. - RollbackConfiguration *RollbackConfiguration `type:"structure"` + // Regions is a required field + Regions []*string `type:"list" required:"true"` - // The name or the unique ID of the stack for which you are creating a change - // set. AWS CloudFormation generates the change set by comparing this stack's - // information with the information that you submit, such as a modified template - // or different parameter input values. + // Removes the stack instances from the specified stack set, but doesn't delete + // the stacks. You can't reassociate a retained stack or add an existing, saved + // stack to a new stack set. // - // StackName is a required field - StackName *string `min:"1" type:"string" required:"true"` - - // Key-value pairs to associate with this stack. AWS CloudFormation also propagates - // these tags to resources in the stack. You can specify a maximum of 50 tags. - Tags []*Tag `type:"list"` - - // A structure that contains the body of the revised template, with a minimum - // length of 1 byte and a maximum length of 51,200 bytes. AWS CloudFormation - // generates the change set by comparing this template with the template of - // the stack that you specified. + // For more information, see Stack set operation options (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-ops-options). // - // Conditional: You must specify only TemplateBody or TemplateURL. - TemplateBody *string `min:"1" type:"string"` + // RetainStacks is a required field + RetainStacks *bool `type:"boolean" required:"true"` - // The location of the file that contains the revised template. The URL must - // point to a template (max size: 460,800 bytes) that is located in an S3 bucket. - // AWS CloudFormation generates the change set by comparing this template with - // the stack that you specified. + // The name or unique ID of the stack set that you want to delete stack instances + // for. // - // Conditional: You must specify only TemplateBody or TemplateURL. - TemplateURL *string `min:"1" type:"string"` - - // Whether to reuse the template that is associated with the stack to create - // the change set. - UsePreviousTemplate *bool `type:"boolean"` + // StackSetName is a required field + StackSetName *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateChangeSetInput) String() string { +func (s DeleteStackInstancesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateChangeSetInput) GoString() string { +func (s DeleteStackInstancesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateChangeSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateChangeSetInput"} - if s.ChangeSetName == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeSetName")) - } - if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.RoleARN != nil && len(*s.RoleARN) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 20)) - } - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) +func (s *DeleteStackInstancesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteStackInstancesInput"} + if s.Accounts == nil { + invalidParams.Add(request.NewErrParamRequired("Accounts")) } - if s.StackName != nil && len(*s.StackName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) + if s.OperationId != nil && len(*s.OperationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) } - if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) + if s.Regions == nil { + invalidParams.Add(request.NewErrParamRequired("Regions")) } - if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) + if s.RetainStacks == nil { + invalidParams.Add(request.NewErrParamRequired("RetainStacks")) } - if s.RollbackConfiguration != nil { - if err := s.RollbackConfiguration.Validate(); err != nil { - invalidParams.AddNested("RollbackConfiguration", err.(request.ErrInvalidParams)) - } + if s.StackSetName == nil { + invalidParams.Add(request.NewErrParamRequired("StackSetName")) } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } + if s.OperationPreferences != nil { + if err := s.OperationPreferences.Validate(); err != nil { + invalidParams.AddNested("OperationPreferences", err.(request.ErrInvalidParams)) } } @@ -4919,366 +7187,174 @@ func (s *CreateChangeSetInput) Validate() error { return nil } -// SetCapabilities sets the Capabilities field's value. -func (s *CreateChangeSetInput) SetCapabilities(v []*string) *CreateChangeSetInput { - s.Capabilities = v - return s -} - -// SetChangeSetName sets the ChangeSetName field's value. -func (s *CreateChangeSetInput) SetChangeSetName(v string) *CreateChangeSetInput { - s.ChangeSetName = &v - return s -} - -// SetChangeSetType sets the ChangeSetType field's value. -func (s *CreateChangeSetInput) SetChangeSetType(v string) *CreateChangeSetInput { - s.ChangeSetType = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateChangeSetInput) SetClientToken(v string) *CreateChangeSetInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateChangeSetInput) SetDescription(v string) *CreateChangeSetInput { - s.Description = &v +// SetAccounts sets the Accounts field's value. +func (s *DeleteStackInstancesInput) SetAccounts(v []*string) *DeleteStackInstancesInput { + s.Accounts = v return s } -// SetNotificationARNs sets the NotificationARNs field's value. -func (s *CreateChangeSetInput) SetNotificationARNs(v []*string) *CreateChangeSetInput { - s.NotificationARNs = v +// SetOperationId sets the OperationId field's value. +func (s *DeleteStackInstancesInput) SetOperationId(v string) *DeleteStackInstancesInput { + s.OperationId = &v return s } -// SetParameters sets the Parameters field's value. -func (s *CreateChangeSetInput) SetParameters(v []*Parameter) *CreateChangeSetInput { - s.Parameters = v +// SetOperationPreferences sets the OperationPreferences field's value. +func (s *DeleteStackInstancesInput) SetOperationPreferences(v *StackSetOperationPreferences) *DeleteStackInstancesInput { + s.OperationPreferences = v return s } -// SetResourceTypes sets the ResourceTypes field's value. -func (s *CreateChangeSetInput) SetResourceTypes(v []*string) *CreateChangeSetInput { - s.ResourceTypes = v +// SetRegions sets the Regions field's value. +func (s *DeleteStackInstancesInput) SetRegions(v []*string) *DeleteStackInstancesInput { + s.Regions = v return s } -// SetRoleARN sets the RoleARN field's value. -func (s *CreateChangeSetInput) SetRoleARN(v string) *CreateChangeSetInput { - s.RoleARN = &v +// SetRetainStacks sets the RetainStacks field's value. +func (s *DeleteStackInstancesInput) SetRetainStacks(v bool) *DeleteStackInstancesInput { + s.RetainStacks = &v return s } -// SetRollbackConfiguration sets the RollbackConfiguration field's value. -func (s *CreateChangeSetInput) SetRollbackConfiguration(v *RollbackConfiguration) *CreateChangeSetInput { - s.RollbackConfiguration = v +// SetStackSetName sets the StackSetName field's value. +func (s *DeleteStackInstancesInput) SetStackSetName(v string) *DeleteStackInstancesInput { + s.StackSetName = &v return s } -// SetStackName sets the StackName field's value. -func (s *CreateChangeSetInput) SetStackName(v string) *CreateChangeSetInput { - s.StackName = &v - return s -} +type DeleteStackInstancesOutput struct { + _ struct{} `type:"structure"` -// SetTags sets the Tags field's value. -func (s *CreateChangeSetInput) SetTags(v []*Tag) *CreateChangeSetInput { - s.Tags = v - return s + // The unique identifier for this stack set operation. + OperationId *string `min:"1" type:"string"` } -// SetTemplateBody sets the TemplateBody field's value. -func (s *CreateChangeSetInput) SetTemplateBody(v string) *CreateChangeSetInput { - s.TemplateBody = &v - return s +// String returns the string representation +func (s DeleteStackInstancesOutput) String() string { + return awsutil.Prettify(s) } -// SetTemplateURL sets the TemplateURL field's value. -func (s *CreateChangeSetInput) SetTemplateURL(v string) *CreateChangeSetInput { - s.TemplateURL = &v - return s +// GoString returns the string representation +func (s DeleteStackInstancesOutput) GoString() string { + return s.String() } -// SetUsePreviousTemplate sets the UsePreviousTemplate field's value. -func (s *CreateChangeSetInput) SetUsePreviousTemplate(v bool) *CreateChangeSetInput { - s.UsePreviousTemplate = &v +// SetOperationId sets the OperationId field's value. +func (s *DeleteStackInstancesOutput) SetOperationId(v string) *DeleteStackInstancesOutput { + s.OperationId = &v return s } -// The output for the CreateChangeSet action. -type CreateChangeSetOutput struct { +type DeleteStackOutput struct { _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the change set. - Id *string `min:"1" type:"string"` - - // The unique ID of the stack. - StackId *string `type:"string"` } // String returns the string representation -func (s CreateChangeSetOutput) String() string { +func (s DeleteStackOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateChangeSetOutput) GoString() string { +func (s DeleteStackOutput) GoString() string { return s.String() } -// SetId sets the Id field's value. -func (s *CreateChangeSetOutput) SetId(v string) *CreateChangeSetOutput { - s.Id = &v - return s -} - -// SetStackId sets the StackId field's value. -func (s *CreateChangeSetOutput) SetStackId(v string) *CreateChangeSetOutput { - s.StackId = &v - return s -} - -// The input for CreateStack action. -type CreateStackInput struct { - _ struct{} `type:"structure"` - - // In some cases, you must explicity acknowledge that your stack template contains - // certain capabilities in order for AWS CloudFormation to create the stack. - // - // * CAPABILITY_IAM and CAPABILITY_NAMED_IAM Some stack templates might include - // resources that can affect permissions in your AWS account; for example, - // by creating new AWS Identity and Access Management (IAM) users. For those - // stacks, you must explicitly acknowledge this by specifying one of these - // capabilities. The following IAM resources require you to specify either - // the CAPABILITY_IAM or CAPABILITY_NAMED_IAM capability. If you have IAM - // resources, you can specify either capability. If you have IAM resources - // with custom names, you must specify CAPABILITY_NAMED_IAM. If you don't - // specify either of these capabilities, AWS CloudFormation returns an InsufficientCapabilities - // error. If your stack template contains these resources, we recommend that - // you review all permissions associated with them and edit their permissions - // if necessary. AWS::IAM::AccessKey (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html) - // AWS::IAM::Group (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html) - // AWS::IAM::InstanceProfile (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) - // AWS::IAM::Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html) - // AWS::IAM::Role (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html) - // AWS::IAM::User (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) - // AWS::IAM::UserToGroupAddition (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html) - // For more information, see Acknowledging IAM Resources in AWS CloudFormation - // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). - // - // * CAPABILITY_AUTO_EXPAND Some template contain macros. Macros perform - // custom processing on templates; this can include simple actions like find-and-replace - // operations, all the way to extensive transformations of entire templates. - // Because of this, users typically create a change set from the processed - // template, so that they can review the changes resulting from the macros - // before actually creating the stack. If your stack template contains one - // or more macros, and you choose to create a stack directly from the processed - // template, without first reviewing the resulting changes in a change set, - // you must acknowledge this capability. This includes the AWS::Include (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html) - // and AWS::Serverless (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html) - // transforms, which are macros hosted by AWS CloudFormation. Change sets - // do not currently support nested stacks. If you want to create a stack - // from a stack template that contains macros and nested stacks, you must - // create the stack directly from the template using this capability. You - // should only create stacks directly from a stack template that contains - // macros if you know what processing the macro performs. Each macro relies - // on an underlying Lambda service function for processing stack templates. - // Be aware that the Lambda function owner can update the function operation - // without AWS CloudFormation being notified. For more information, see Using - // AWS CloudFormation Macros to Perform Custom Processing on Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html). - Capabilities []*string `type:"list"` - - // A unique identifier for this CreateStack request. Specify this token if you - // plan to retry requests so that AWS CloudFormation knows that you're not attempting - // to create a stack with the same name. You might retry CreateStack requests - // to ensure that AWS CloudFormation successfully received them. - // - // All events triggered by a given stack operation are assigned the same client - // request token, which you can use to track operations. For example, if you - // execute a CreateStack operation with the token token1, then all the StackEvents - // generated by that operation will have ClientRequestToken set as token1. - // - // In the console, stack operations display the client request token on the - // Events tab. Stack operations that are initiated from the console use the - // token format Console-StackOperation-ID, which helps you easily identify the - // stack operation . For example, if you create a stack using the console, each - // stack event would be assigned the same token in the following format: Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002. - ClientRequestToken *string `min:"1" type:"string"` - - // Set to true to disable rollback of the stack if stack creation failed. You - // can specify either DisableRollback or OnFailure, but not both. - // - // Default: false - DisableRollback *bool `type:"boolean"` - - // Whether to enable termination protection on the specified stack. If a user - // attempts to delete a stack with termination protection enabled, the operation - // fails and the stack remains unchanged. For more information, see Protecting - // a Stack From Being Deleted (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-protect-stacks.html) - // in the AWS CloudFormation User Guide. Termination protection is disabled - // on stacks by default. - // - // For nested stacks (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html), - // termination protection is set on the root stack and cannot be changed directly - // on the nested stack. - EnableTerminationProtection *bool `type:"boolean"` - - // The Simple Notification Service (SNS) topic ARNs to publish stack related - // events. You can find your SNS topic ARNs using the SNS console or your Command - // Line Interface (CLI). - NotificationARNs []*string `type:"list"` +type DeleteStackSetInput struct { + _ struct{} `type:"structure"` - // Determines what action will be taken if stack creation fails. This must be - // one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either OnFailure - // or DisableRollback, but not both. + // The name or unique ID of the stack set that you're deleting. You can obtain + // this value by running ListStackSets. // - // Default: ROLLBACK - OnFailure *string `type:"string" enum:"OnFailure"` + // StackSetName is a required field + StackSetName *string `type:"string" required:"true"` +} - // A list of Parameter structures that specify input parameters for the stack. - // For more information, see the Parameter (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html) - // data type. - Parameters []*Parameter `type:"list"` +// String returns the string representation +func (s DeleteStackSetInput) String() string { + return awsutil.Prettify(s) +} - // The template resource types that you have permissions to work with for this - // create stack action, such as AWS::EC2::Instance, AWS::EC2::*, or Custom::MyCustomInstance. - // Use the following syntax to describe template resource types: AWS::* (for - // all AWS resource), Custom::* (for all custom resources), Custom::logical_ID - // (for a specific custom resource), AWS::service_name::* (for all resources - // of a particular AWS service), and AWS::service_name::resource_logical_ID - // (for a specific AWS resource). - // - // If the list of resource types doesn't include a resource that you're creating, - // the stack creation fails. By default, AWS CloudFormation grants permissions - // to all resource types. AWS Identity and Access Management (IAM) uses this - // parameter for AWS CloudFormation-specific condition keys in IAM policies. - // For more information, see Controlling Access with AWS Identity and Access - // Management (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html). - ResourceTypes []*string `type:"list"` +// GoString returns the string representation +func (s DeleteStackSetInput) GoString() string { + return s.String() +} - // The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) - // role that AWS CloudFormation assumes to create the stack. AWS CloudFormation - // uses the role's credentials to make calls on your behalf. AWS CloudFormation - // always uses this role for all future operations on the stack. As long as - // users have permission to operate on the stack, AWS CloudFormation uses this - // role even if the users don't have permission to pass it. Ensure that the - // role grants least privilege. - // - // If you don't specify a value, AWS CloudFormation uses the role that was previously - // associated with the stack. If no role is available, AWS CloudFormation uses - // a temporary session that is generated from your user credentials. - RoleARN *string `min:"20" type:"string"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteStackSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteStackSetInput"} + if s.StackSetName == nil { + invalidParams.Add(request.NewErrParamRequired("StackSetName")) + } - // The rollback triggers for AWS CloudFormation to monitor during stack creation - // and updating operations, and for the specified monitoring period afterwards. - RollbackConfiguration *RollbackConfiguration `type:"structure"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // The name that is associated with the stack. The name must be unique in the - // region in which you are creating the stack. - // - // A stack name can contain only alphanumeric characters (case sensitive) and - // hyphens. It must start with an alphabetic character and cannot be longer - // than 128 characters. - // - // StackName is a required field - StackName *string `type:"string" required:"true"` +// SetStackSetName sets the StackSetName field's value. +func (s *DeleteStackSetInput) SetStackSetName(v string) *DeleteStackSetInput { + s.StackSetName = &v + return s +} - // Structure containing the stack policy body. For more information, go to Prevent - // Updates to Stack Resources (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html) - // in the AWS CloudFormation User Guide. You can specify either the StackPolicyBody - // or the StackPolicyURL parameter, but not both. - StackPolicyBody *string `min:"1" type:"string"` +type DeleteStackSetOutput struct { + _ struct{} `type:"structure"` +} - // Location of a file containing the stack policy. The URL must point to a policy - // (maximum size: 16 KB) located in an S3 bucket in the same region as the stack. - // You can specify either the StackPolicyBody or the StackPolicyURL parameter, - // but not both. - StackPolicyURL *string `min:"1" type:"string"` +// String returns the string representation +func (s DeleteStackSetOutput) String() string { + return awsutil.Prettify(s) +} - // Key-value pairs to associate with this stack. AWS CloudFormation also propagates - // these tags to the resources created in the stack. A maximum number of 50 - // tags can be specified. - Tags []*Tag `type:"list"` +// GoString returns the string representation +func (s DeleteStackSetOutput) GoString() string { + return s.String() +} - // Structure containing the template body with a minimum length of 1 byte and - // a maximum length of 51,200 bytes. For more information, go to Template Anatomy - // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide. +type DeregisterTypeInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the type. // - // Conditional: You must specify either the TemplateBody or the TemplateURL - // parameter, but not both. - TemplateBody *string `min:"1" type:"string"` + // Conditional: You must specify TypeName or Arn. + Arn *string `type:"string"` - // Location of file containing the template body. The URL must point to a template - // (max size: 460,800 bytes) that is located in an Amazon S3 bucket. For more - // information, go to the Template Anatomy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide. + // The kind of type. // - // Conditional: You must specify either the TemplateBody or the TemplateURL - // parameter, but not both. - TemplateURL *string `min:"1" type:"string"` + // Currently the only valid value is RESOURCE. + Type *string `type:"string" enum:"RegistryType"` - // The amount of time that can pass before the stack status becomes CREATE_FAILED; - // if DisableRollback is not set or is set to false, the stack will be rolled - // back. - TimeoutInMinutes *int64 `min:"1" type:"integer"` + // The name of the type. + // + // Conditional: You must specify TypeName or Arn. + TypeName *string `min:"10" type:"string"` + + // The ID of a specific version of the type. The version ID is the value at + // the end of the Amazon Resource Name (ARN) assigned to the type version when + // it is registered. + VersionId *string `min:"1" type:"string"` } // String returns the string representation -func (s CreateStackInput) String() string { +func (s DeregisterTypeInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateStackInput) GoString() string { +func (s DeregisterTypeInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateStackInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateStackInput"} - if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) - } - if s.RoleARN != nil && len(*s.RoleARN) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 20)) - } - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) - } - if s.StackPolicyBody != nil && len(*s.StackPolicyBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackPolicyBody", 1)) - } - if s.StackPolicyURL != nil && len(*s.StackPolicyURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackPolicyURL", 1)) - } - if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) - } - if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) - } - if s.TimeoutInMinutes != nil && *s.TimeoutInMinutes < 1 { - invalidParams.Add(request.NewErrParamMinValue("TimeoutInMinutes", 1)) - } - if s.RollbackConfiguration != nil { - if err := s.RollbackConfiguration.Validate(); err != nil { - invalidParams.AddNested("RollbackConfiguration", err.(request.ErrInvalidParams)) - } +func (s *DeregisterTypeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeregisterTypeInput"} + if s.TypeName != nil && len(*s.TypeName) < 10 { + invalidParams.Add(request.NewErrParamMinLen("TypeName", 10)) } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } + if s.VersionId != nil && len(*s.VersionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VersionId", 1)) } if invalidParams.Len() > 0 { @@ -5287,581 +7363,555 @@ func (s *CreateStackInput) Validate() error { return nil } -// SetCapabilities sets the Capabilities field's value. -func (s *CreateStackInput) SetCapabilities(v []*string) *CreateStackInput { - s.Capabilities = v +// SetArn sets the Arn field's value. +func (s *DeregisterTypeInput) SetArn(v string) *DeregisterTypeInput { + s.Arn = &v return s } -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *CreateStackInput) SetClientRequestToken(v string) *CreateStackInput { - s.ClientRequestToken = &v +// SetType sets the Type field's value. +func (s *DeregisterTypeInput) SetType(v string) *DeregisterTypeInput { + s.Type = &v return s } -// SetDisableRollback sets the DisableRollback field's value. -func (s *CreateStackInput) SetDisableRollback(v bool) *CreateStackInput { - s.DisableRollback = &v +// SetTypeName sets the TypeName field's value. +func (s *DeregisterTypeInput) SetTypeName(v string) *DeregisterTypeInput { + s.TypeName = &v return s } -// SetEnableTerminationProtection sets the EnableTerminationProtection field's value. -func (s *CreateStackInput) SetEnableTerminationProtection(v bool) *CreateStackInput { - s.EnableTerminationProtection = &v +// SetVersionId sets the VersionId field's value. +func (s *DeregisterTypeInput) SetVersionId(v string) *DeregisterTypeInput { + s.VersionId = &v return s } -// SetNotificationARNs sets the NotificationARNs field's value. -func (s *CreateStackInput) SetNotificationARNs(v []*string) *CreateStackInput { - s.NotificationARNs = v - return s +type DeregisterTypeOutput struct { + _ struct{} `type:"structure"` } -// SetOnFailure sets the OnFailure field's value. -func (s *CreateStackInput) SetOnFailure(v string) *CreateStackInput { - s.OnFailure = &v - return s +// String returns the string representation +func (s DeregisterTypeOutput) String() string { + return awsutil.Prettify(s) } -// SetParameters sets the Parameters field's value. -func (s *CreateStackInput) SetParameters(v []*Parameter) *CreateStackInput { - s.Parameters = v +// GoString returns the string representation +func (s DeregisterTypeOutput) GoString() string { + return s.String() +} + +// The input for the DescribeAccountLimits action. +type DescribeAccountLimitsInput struct { + _ struct{} `type:"structure"` + + // A string that identifies the next page of limits that you want to retrieve. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DescribeAccountLimitsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAccountLimitsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeAccountLimitsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeAccountLimitsInput"} + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeAccountLimitsInput) SetNextToken(v string) *DescribeAccountLimitsInput { + s.NextToken = &v return s } -// SetResourceTypes sets the ResourceTypes field's value. -func (s *CreateStackInput) SetResourceTypes(v []*string) *CreateStackInput { - s.ResourceTypes = v - return s +// The output for the DescribeAccountLimits action. +type DescribeAccountLimitsOutput struct { + _ struct{} `type:"structure"` + + // An account limit structure that contain a list of AWS CloudFormation account + // limits and their values. + AccountLimits []*AccountLimit `type:"list"` + + // If the output exceeds 1 MB in size, a string that identifies the next page + // of limits. If no additional page exists, this value is null. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DescribeAccountLimitsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAccountLimitsOutput) GoString() string { + return s.String() } -// SetRoleARN sets the RoleARN field's value. -func (s *CreateStackInput) SetRoleARN(v string) *CreateStackInput { - s.RoleARN = &v +// SetAccountLimits sets the AccountLimits field's value. +func (s *DescribeAccountLimitsOutput) SetAccountLimits(v []*AccountLimit) *DescribeAccountLimitsOutput { + s.AccountLimits = v return s } -// SetRollbackConfiguration sets the RollbackConfiguration field's value. -func (s *CreateStackInput) SetRollbackConfiguration(v *RollbackConfiguration) *CreateStackInput { - s.RollbackConfiguration = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeAccountLimitsOutput) SetNextToken(v string) *DescribeAccountLimitsOutput { + s.NextToken = &v return s } -// SetStackName sets the StackName field's value. -func (s *CreateStackInput) SetStackName(v string) *CreateStackInput { - s.StackName = &v - return s +// The input for the DescribeChangeSet action. +type DescribeChangeSetInput struct { + _ struct{} `type:"structure"` + + // The name or Amazon Resource Name (ARN) of the change set that you want to + // describe. + // + // ChangeSetName is a required field + ChangeSetName *string `min:"1" type:"string" required:"true"` + + // A string (provided by the DescribeChangeSet response output) that identifies + // the next page of information that you want to retrieve. + NextToken *string `min:"1" type:"string"` + + // If you specified the name of a change set, specify the stack name or ID (ARN) + // of the change set you want to describe. + StackName *string `min:"1" type:"string"` } -// SetStackPolicyBody sets the StackPolicyBody field's value. -func (s *CreateStackInput) SetStackPolicyBody(v string) *CreateStackInput { - s.StackPolicyBody = &v - return s +// String returns the string representation +func (s DescribeChangeSetInput) String() string { + return awsutil.Prettify(s) } -// SetStackPolicyURL sets the StackPolicyURL field's value. -func (s *CreateStackInput) SetStackPolicyURL(v string) *CreateStackInput { - s.StackPolicyURL = &v - return s +// GoString returns the string representation +func (s DescribeChangeSetInput) GoString() string { + return s.String() } -// SetTags sets the Tags field's value. -func (s *CreateStackInput) SetTags(v []*Tag) *CreateStackInput { - s.Tags = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeChangeSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeChangeSetInput"} + if s.ChangeSetName == nil { + invalidParams.Add(request.NewErrParamRequired("ChangeSetName")) + } + if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + if s.StackName != nil && len(*s.StackName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetTemplateBody sets the TemplateBody field's value. -func (s *CreateStackInput) SetTemplateBody(v string) *CreateStackInput { - s.TemplateBody = &v +// SetChangeSetName sets the ChangeSetName field's value. +func (s *DescribeChangeSetInput) SetChangeSetName(v string) *DescribeChangeSetInput { + s.ChangeSetName = &v return s } -// SetTemplateURL sets the TemplateURL field's value. -func (s *CreateStackInput) SetTemplateURL(v string) *CreateStackInput { - s.TemplateURL = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeChangeSetInput) SetNextToken(v string) *DescribeChangeSetInput { + s.NextToken = &v return s } -// SetTimeoutInMinutes sets the TimeoutInMinutes field's value. -func (s *CreateStackInput) SetTimeoutInMinutes(v int64) *CreateStackInput { - s.TimeoutInMinutes = &v +// SetStackName sets the StackName field's value. +func (s *DescribeChangeSetInput) SetStackName(v string) *DescribeChangeSetInput { + s.StackName = &v return s } -type CreateStackInstancesInput struct { +// The output for the DescribeChangeSet action. +type DescribeChangeSetOutput struct { _ struct{} `type:"structure"` - // The names of one or more AWS accounts that you want to create stack instances - // in the specified region(s) for. - // - // Accounts is a required field - Accounts []*string `type:"list" required:"true"` + // If you execute the change set, the list of capabilities that were explicitly + // acknowledged when the change set was created. + Capabilities []*string `type:"list"` - // The unique identifier for this stack set operation. - // - // The operation ID also functions as an idempotency token, to ensure that AWS - // CloudFormation performs the stack set operation only once, even if you retry - // the request multiple times. You might retry stack set operation requests - // to ensure that AWS CloudFormation successfully received them. - // - // If you don't specify an operation ID, the SDK generates one automatically. - // - // Repeating this stack set operation with a new operation ID retries all stack - // instances whose status is OUTDATED. - OperationId *string `min:"1" type:"string" idempotencyToken:"true"` + // The ARN of the change set. + ChangeSetId *string `min:"1" type:"string"` - // Preferences for how AWS CloudFormation performs this stack set operation. - OperationPreferences *StackSetOperationPreferences `type:"structure"` + // The name of the change set. + ChangeSetName *string `min:"1" type:"string"` - // A list of stack set parameters whose values you want to override in the selected - // stack instances. - // - // Any overridden parameter values will be applied to all stack instances in - // the specified accounts and regions. When specifying parameters and their - // values, be aware of how AWS CloudFormation sets parameter values during stack - // instance operations: - // - // * To override the current value for a parameter, include the parameter - // and specify its value. - // - // * To leave a parameter set to its present value, you can do one of the - // following: Do not include the parameter in the list. Include the parameter - // and specify UsePreviousValue as true. (You cannot specify both a value - // and set UsePreviousValue to true.) - // - // * To set all overridden parameter back to the values specified in the - // stack set, specify a parameter list but do not include any parameters. - // - // * To leave all parameters set to their present values, do not specify - // this property at all. - // - // During stack set updates, any parameter values overridden for a stack instance - // are not updated, but retain their overridden value. - // - // You can only override the parameter values that are specified in the stack - // set; to add or delete a parameter itself, use UpdateStackSet (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html) - // to update the stack set template. - ParameterOverrides []*Parameter `type:"list"` + // A list of Change structures that describes the resources AWS CloudFormation + // changes if you execute the change set. + Changes []*Change `type:"list"` - // The names of one or more regions where you want to create stack instances - // using the specified AWS account(s). - // - // Regions is a required field - Regions []*string `type:"list" required:"true"` + // The start time when the change set was created, in UTC. + CreationTime *time.Time `type:"timestamp"` - // The name or unique ID of the stack set that you want to create stack instances - // from. - // - // StackSetName is a required field - StackSetName *string `type:"string" required:"true"` + // Information about the change set. + Description *string `min:"1" type:"string"` + + // If the change set execution status is AVAILABLE, you can execute the change + // set. If you can’t execute the change set, the status indicates why. For + // example, a change set might be in an UNAVAILABLE state because AWS CloudFormation + // is still creating it or in an OBSOLETE state because the stack was already + // updated. + ExecutionStatus *string `type:"string" enum:"ExecutionStatus"` + + // If the output exceeds 1 MB, a string that identifies the next page of changes. + // If there is no additional page, this value is null. + NextToken *string `min:"1" type:"string"` + + // The ARNs of the Amazon Simple Notification Service (Amazon SNS) topics that + // will be associated with the stack if you execute the change set. + NotificationARNs []*string `type:"list"` + + // A list of Parameter structures that describes the input parameters and their + // values used to create the change set. For more information, see the Parameter + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html) + // data type. + Parameters []*Parameter `type:"list"` + + // The rollback triggers for AWS CloudFormation to monitor during stack creation + // and updating operations, and for the specified monitoring period afterwards. + RollbackConfiguration *RollbackConfiguration `type:"structure"` + + // The ARN of the stack that is associated with the change set. + StackId *string `type:"string"` + + // The name of the stack that is associated with the change set. + StackName *string `type:"string"` + + // The current status of the change set, such as CREATE_IN_PROGRESS, CREATE_COMPLETE, + // or FAILED. + Status *string `type:"string" enum:"ChangeSetStatus"` + + // A description of the change set's status. For example, if your attempt to + // create a change set failed, AWS CloudFormation shows the error message. + StatusReason *string `type:"string"` + + // If you execute the change set, the tags that will be associated with the + // stack. + Tags []*Tag `type:"list"` } // String returns the string representation -func (s CreateStackInstancesInput) String() string { +func (s DescribeChangeSetOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateStackInstancesInput) GoString() string { +func (s DescribeChangeSetOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateStackInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateStackInstancesInput"} - if s.Accounts == nil { - invalidParams.Add(request.NewErrParamRequired("Accounts")) - } - if s.OperationId != nil && len(*s.OperationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) - } - if s.Regions == nil { - invalidParams.Add(request.NewErrParamRequired("Regions")) - } - if s.StackSetName == nil { - invalidParams.Add(request.NewErrParamRequired("StackSetName")) - } - if s.OperationPreferences != nil { - if err := s.OperationPreferences.Validate(); err != nil { - invalidParams.AddNested("OperationPreferences", err.(request.ErrInvalidParams)) - } - } +// SetCapabilities sets the Capabilities field's value. +func (s *DescribeChangeSetOutput) SetCapabilities(v []*string) *DescribeChangeSetOutput { + s.Capabilities = v + return s +} + +// SetChangeSetId sets the ChangeSetId field's value. +func (s *DescribeChangeSetOutput) SetChangeSetId(v string) *DescribeChangeSetOutput { + s.ChangeSetId = &v + return s +} + +// SetChangeSetName sets the ChangeSetName field's value. +func (s *DescribeChangeSetOutput) SetChangeSetName(v string) *DescribeChangeSetOutput { + s.ChangeSetName = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetChanges sets the Changes field's value. +func (s *DescribeChangeSetOutput) SetChanges(v []*Change) *DescribeChangeSetOutput { + s.Changes = v + return s } -// SetAccounts sets the Accounts field's value. -func (s *CreateStackInstancesInput) SetAccounts(v []*string) *CreateStackInstancesInput { - s.Accounts = v +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeChangeSetOutput) SetCreationTime(v time.Time) *DescribeChangeSetOutput { + s.CreationTime = &v return s } -// SetOperationId sets the OperationId field's value. -func (s *CreateStackInstancesInput) SetOperationId(v string) *CreateStackInstancesInput { - s.OperationId = &v +// SetDescription sets the Description field's value. +func (s *DescribeChangeSetOutput) SetDescription(v string) *DescribeChangeSetOutput { + s.Description = &v return s } -// SetOperationPreferences sets the OperationPreferences field's value. -func (s *CreateStackInstancesInput) SetOperationPreferences(v *StackSetOperationPreferences) *CreateStackInstancesInput { - s.OperationPreferences = v +// SetExecutionStatus sets the ExecutionStatus field's value. +func (s *DescribeChangeSetOutput) SetExecutionStatus(v string) *DescribeChangeSetOutput { + s.ExecutionStatus = &v return s } -// SetParameterOverrides sets the ParameterOverrides field's value. -func (s *CreateStackInstancesInput) SetParameterOverrides(v []*Parameter) *CreateStackInstancesInput { - s.ParameterOverrides = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeChangeSetOutput) SetNextToken(v string) *DescribeChangeSetOutput { + s.NextToken = &v return s } -// SetRegions sets the Regions field's value. -func (s *CreateStackInstancesInput) SetRegions(v []*string) *CreateStackInstancesInput { - s.Regions = v +// SetNotificationARNs sets the NotificationARNs field's value. +func (s *DescribeChangeSetOutput) SetNotificationARNs(v []*string) *DescribeChangeSetOutput { + s.NotificationARNs = v return s } -// SetStackSetName sets the StackSetName field's value. -func (s *CreateStackInstancesInput) SetStackSetName(v string) *CreateStackInstancesInput { - s.StackSetName = &v +// SetParameters sets the Parameters field's value. +func (s *DescribeChangeSetOutput) SetParameters(v []*Parameter) *DescribeChangeSetOutput { + s.Parameters = v return s } -type CreateStackInstancesOutput struct { - _ struct{} `type:"structure"` +// SetRollbackConfiguration sets the RollbackConfiguration field's value. +func (s *DescribeChangeSetOutput) SetRollbackConfiguration(v *RollbackConfiguration) *DescribeChangeSetOutput { + s.RollbackConfiguration = v + return s +} - // The unique identifier for this stack set operation. - OperationId *string `min:"1" type:"string"` +// SetStackId sets the StackId field's value. +func (s *DescribeChangeSetOutput) SetStackId(v string) *DescribeChangeSetOutput { + s.StackId = &v + return s } -// String returns the string representation -func (s CreateStackInstancesOutput) String() string { - return awsutil.Prettify(s) +// SetStackName sets the StackName field's value. +func (s *DescribeChangeSetOutput) SetStackName(v string) *DescribeChangeSetOutput { + s.StackName = &v + return s } -// GoString returns the string representation -func (s CreateStackInstancesOutput) GoString() string { - return s.String() +// SetStatus sets the Status field's value. +func (s *DescribeChangeSetOutput) SetStatus(v string) *DescribeChangeSetOutput { + s.Status = &v + return s } -// SetOperationId sets the OperationId field's value. -func (s *CreateStackInstancesOutput) SetOperationId(v string) *CreateStackInstancesOutput { - s.OperationId = &v +// SetStatusReason sets the StatusReason field's value. +func (s *DescribeChangeSetOutput) SetStatusReason(v string) *DescribeChangeSetOutput { + s.StatusReason = &v return s } -// The output for a CreateStack action. -type CreateStackOutput struct { +// SetTags sets the Tags field's value. +func (s *DescribeChangeSetOutput) SetTags(v []*Tag) *DescribeChangeSetOutput { + s.Tags = v + return s +} + +type DescribeStackDriftDetectionStatusInput struct { _ struct{} `type:"structure"` - // Unique identifier of the stack. - StackId *string `type:"string"` + // The ID of the drift detection results of this operation. + // + // AWS CloudFormation generates new results, with a new drift detection ID, + // each time this operation is run. However, the number of drift results AWS + // CloudFormation retains for any given stack, and for how long, may vary. + // + // StackDriftDetectionId is a required field + StackDriftDetectionId *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s CreateStackOutput) String() string { +func (s DescribeStackDriftDetectionStatusInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateStackOutput) GoString() string { +func (s DescribeStackDriftDetectionStatusInput) GoString() string { return s.String() } -// SetStackId sets the StackId field's value. -func (s *CreateStackOutput) SetStackId(v string) *CreateStackOutput { - s.StackId = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeStackDriftDetectionStatusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeStackDriftDetectionStatusInput"} + if s.StackDriftDetectionId == nil { + invalidParams.Add(request.NewErrParamRequired("StackDriftDetectionId")) + } + if s.StackDriftDetectionId != nil && len(*s.StackDriftDetectionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StackDriftDetectionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetStackDriftDetectionId sets the StackDriftDetectionId field's value. +func (s *DescribeStackDriftDetectionStatusInput) SetStackDriftDetectionId(v string) *DescribeStackDriftDetectionStatusInput { + s.StackDriftDetectionId = &v return s } -type CreateStackSetInput struct { +type DescribeStackDriftDetectionStatusOutput struct { _ struct{} `type:"structure"` - // The Amazon Resource Number (ARN) of the IAM role to use to create this stack - // set. + // The status of the stack drift detection operation. // - // Specify an IAM role only if you are using customized administrator roles - // to control which users or groups can manage specific stack sets within the - // same administrator account. For more information, see Prerequisites: Granting - // Permissions for Stack Set Operations (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html) - // in the AWS CloudFormation User Guide. - AdministrationRoleARN *string `min:"20" type:"string"` - - // In some cases, you must explicity acknowledge that your stack set template - // contains certain capabilities in order for AWS CloudFormation to create the - // stack set and related stack instances. + // * DETECTION_COMPLETE: The stack drift detection operation has successfully + // completed for all resources in the stack that support drift detection. + // (Resources that do not currently support stack detection remain unchecked.) + // If you specified logical resource IDs for AWS CloudFormation to use as + // a filter for the stack drift detection operation, only the resources with + // those logical IDs are checked for drift. // - // * CAPABILITY_IAM and CAPABILITY_NAMED_IAM Some stack templates might include - // resources that can affect permissions in your AWS account; for example, - // by creating new AWS Identity and Access Management (IAM) users. For those - // stack sets, you must explicitly acknowledge this by specifying one of - // these capabilities. The following IAM resources require you to specify - // either the CAPABILITY_IAM or CAPABILITY_NAMED_IAM capability. If you have - // IAM resources, you can specify either capability. If you have IAM resources - // with custom names, you must specify CAPABILITY_NAMED_IAM. If you don't - // specify either of these capabilities, AWS CloudFormation returns an InsufficientCapabilities - // error. If your stack template contains these resources, we recommend that - // you review all permissions associated with them and edit their permissions - // if necessary. AWS::IAM::AccessKey (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html) - // AWS::IAM::Group (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html) - // AWS::IAM::InstanceProfile (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) - // AWS::IAM::Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html) - // AWS::IAM::Role (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html) - // AWS::IAM::User (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) - // AWS::IAM::UserToGroupAddition (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html) - // For more information, see Acknowledging IAM Resources in AWS CloudFormation - // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). + // * DETECTION_FAILED: The stack drift detection operation has failed for + // at least one resource in the stack. Results will be available for resources + // on which AWS CloudFormation successfully completed drift detection. // - // * CAPABILITY_AUTO_EXPAND Some templates contain macros. If your stack - // template contains one or more macros, and you choose to create a stack - // directly from the processed template, without first reviewing the resulting - // changes in a change set, you must acknowledge this capability. For more - // information, see Using AWS CloudFormation Macros to Perform Custom Processing - // on Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html). - // Stack sets do not currently support macros in stack templates. (This includes - // the AWS::Include (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html) - // and AWS::Serverless (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html) - // transforms, which are macros hosted by AWS CloudFormation.) Even if you - // specify this capability, if you include a macro in your template the stack - // set operation will fail. - Capabilities []*string `type:"list"` - - // A unique identifier for this CreateStackSet request. Specify this token if - // you plan to retry requests so that AWS CloudFormation knows that you're not - // attempting to create another stack set with the same name. You might retry - // CreateStackSet requests to ensure that AWS CloudFormation successfully received - // them. + // * DETECTION_IN_PROGRESS: The stack drift detection operation is currently + // in progress. // - // If you don't specify an operation ID, the SDK generates one automatically. - ClientRequestToken *string `min:"1" type:"string" idempotencyToken:"true"` - - // A description of the stack set. You can use the description to identify the - // stack set's purpose or other important information. - Description *string `min:"1" type:"string"` + // DetectionStatus is a required field + DetectionStatus *string `type:"string" required:"true" enum:"StackDriftDetectionStatus"` - // The name of the IAM execution role to use to create the stack set. If you - // do not specify an execution role, AWS CloudFormation uses the AWSCloudFormationStackSetExecutionRole - // role for the stack set operation. - // - // Specify an IAM role only if you are using customized execution roles to control - // which stack resources users and groups can include in their stack sets. - ExecutionRoleName *string `min:"1" type:"string"` + // The reason the stack drift detection operation has its current status. + DetectionStatusReason *string `type:"string"` - // The input parameters for the stack set template. - Parameters []*Parameter `type:"list"` + // Total number of stack resources that have drifted. This is NULL until the + // drift detection operation reaches a status of DETECTION_COMPLETE. This value + // will be 0 for stacks whose drift status is IN_SYNC. + DriftedStackResourceCount *int64 `type:"integer"` - // The name to associate with the stack set. The name must be unique in the - // region where you create your stack set. + // The ID of the drift detection results of this operation. // - // A stack name can contain only alphanumeric characters (case-sensitive) and - // hyphens. It must start with an alphabetic character and can't be longer than - // 128 characters. + // AWS CloudFormation generates new results, with a new drift detection ID, + // each time this operation is run. However, the number of reports AWS CloudFormation + // retains for any given stack, and for how long, may vary. // - // StackSetName is a required field - StackSetName *string `type:"string" required:"true"` + // StackDriftDetectionId is a required field + StackDriftDetectionId *string `min:"1" type:"string" required:"true"` - // The key-value pairs to associate with this stack set and the stacks created - // from it. AWS CloudFormation also propagates these tags to supported resources - // that are created in the stacks. A maximum number of 50 tags can be specified. + // Status of the stack's actual configuration compared to its expected configuration. // - // If you specify tags as part of a CreateStackSet action, AWS CloudFormation - // checks to see if you have the required IAM permission to tag resources. If - // you don't, the entire CreateStackSet action fails with an access denied error, - // and the stack set is not created. - Tags []*Tag `type:"list"` - - // The structure that contains the template body, with a minimum length of 1 - // byte and a maximum length of 51,200 bytes. For more information, see Template - // Anatomy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide. + // * DRIFTED: The stack differs from its expected template configuration. + // A stack is considered to have drifted if one or more of its resources + // have drifted. // - // Conditional: You must specify either the TemplateBody or the TemplateURL - // parameter, but not both. - TemplateBody *string `min:"1" type:"string"` + // * NOT_CHECKED: AWS CloudFormation has not checked if the stack differs + // from its expected template configuration. + // + // * IN_SYNC: The stack's actual configuration matches its expected template + // configuration. + // + // * UNKNOWN: This value is reserved for future use. + StackDriftStatus *string `type:"string" enum:"StackDriftStatus"` - // The location of the file that contains the template body. The URL must point - // to a template (maximum size: 460,800 bytes) that's located in an Amazon S3 - // bucket. For more information, see Template Anatomy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide. + // The ID of the stack. + // + // StackId is a required field + StackId *string `type:"string" required:"true"` + + // Time at which the stack drift detection operation was initiated. // - // Conditional: You must specify either the TemplateBody or the TemplateURL - // parameter, but not both. - TemplateURL *string `min:"1" type:"string"` + // Timestamp is a required field + Timestamp *time.Time `type:"timestamp" required:"true"` } // String returns the string representation -func (s CreateStackSetInput) String() string { +func (s DescribeStackDriftDetectionStatusOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateStackSetInput) GoString() string { +func (s DescribeStackDriftDetectionStatusOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateStackSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateStackSetInput"} - if s.AdministrationRoleARN != nil && len(*s.AdministrationRoleARN) < 20 { - invalidParams.Add(request.NewErrParamMinLen("AdministrationRoleARN", 20)) - } - if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.ExecutionRoleName != nil && len(*s.ExecutionRoleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExecutionRoleName", 1)) - } - if s.StackSetName == nil { - invalidParams.Add(request.NewErrParamRequired("StackSetName")) - } - if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) - } - if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdministrationRoleARN sets the AdministrationRoleARN field's value. -func (s *CreateStackSetInput) SetAdministrationRoleARN(v string) *CreateStackSetInput { - s.AdministrationRoleARN = &v - return s -} - -// SetCapabilities sets the Capabilities field's value. -func (s *CreateStackSetInput) SetCapabilities(v []*string) *CreateStackSetInput { - s.Capabilities = v - return s -} - -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *CreateStackSetInput) SetClientRequestToken(v string) *CreateStackSetInput { - s.ClientRequestToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateStackSetInput) SetDescription(v string) *CreateStackSetInput { - s.Description = &v +// SetDetectionStatus sets the DetectionStatus field's value. +func (s *DescribeStackDriftDetectionStatusOutput) SetDetectionStatus(v string) *DescribeStackDriftDetectionStatusOutput { + s.DetectionStatus = &v return s } -// SetExecutionRoleName sets the ExecutionRoleName field's value. -func (s *CreateStackSetInput) SetExecutionRoleName(v string) *CreateStackSetInput { - s.ExecutionRoleName = &v +// SetDetectionStatusReason sets the DetectionStatusReason field's value. +func (s *DescribeStackDriftDetectionStatusOutput) SetDetectionStatusReason(v string) *DescribeStackDriftDetectionStatusOutput { + s.DetectionStatusReason = &v return s } -// SetParameters sets the Parameters field's value. -func (s *CreateStackSetInput) SetParameters(v []*Parameter) *CreateStackSetInput { - s.Parameters = v +// SetDriftedStackResourceCount sets the DriftedStackResourceCount field's value. +func (s *DescribeStackDriftDetectionStatusOutput) SetDriftedStackResourceCount(v int64) *DescribeStackDriftDetectionStatusOutput { + s.DriftedStackResourceCount = &v return s } -// SetStackSetName sets the StackSetName field's value. -func (s *CreateStackSetInput) SetStackSetName(v string) *CreateStackSetInput { - s.StackSetName = &v +// SetStackDriftDetectionId sets the StackDriftDetectionId field's value. +func (s *DescribeStackDriftDetectionStatusOutput) SetStackDriftDetectionId(v string) *DescribeStackDriftDetectionStatusOutput { + s.StackDriftDetectionId = &v return s } -// SetTags sets the Tags field's value. -func (s *CreateStackSetInput) SetTags(v []*Tag) *CreateStackSetInput { - s.Tags = v +// SetStackDriftStatus sets the StackDriftStatus field's value. +func (s *DescribeStackDriftDetectionStatusOutput) SetStackDriftStatus(v string) *DescribeStackDriftDetectionStatusOutput { + s.StackDriftStatus = &v return s } -// SetTemplateBody sets the TemplateBody field's value. -func (s *CreateStackSetInput) SetTemplateBody(v string) *CreateStackSetInput { - s.TemplateBody = &v +// SetStackId sets the StackId field's value. +func (s *DescribeStackDriftDetectionStatusOutput) SetStackId(v string) *DescribeStackDriftDetectionStatusOutput { + s.StackId = &v return s } -// SetTemplateURL sets the TemplateURL field's value. -func (s *CreateStackSetInput) SetTemplateURL(v string) *CreateStackSetInput { - s.TemplateURL = &v +// SetTimestamp sets the Timestamp field's value. +func (s *DescribeStackDriftDetectionStatusOutput) SetTimestamp(v time.Time) *DescribeStackDriftDetectionStatusOutput { + s.Timestamp = &v return s } -type CreateStackSetOutput struct { +// The input for DescribeStackEvents action. +type DescribeStackEventsInput struct { _ struct{} `type:"structure"` - // The ID of the stack set that you're creating. - StackSetId *string `type:"string"` -} - -// String returns the string representation -func (s CreateStackSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateStackSetOutput) GoString() string { - return s.String() -} - -// SetStackSetId sets the StackSetId field's value. -func (s *CreateStackSetOutput) SetStackSetId(v string) *CreateStackSetOutput { - s.StackSetId = &v - return s -} - -// The input for the DeleteChangeSet action. -type DeleteChangeSetInput struct { - _ struct{} `type:"structure"` + // A string that identifies the next page of events that you want to retrieve. + NextToken *string `min:"1" type:"string"` - // The name or Amazon Resource Name (ARN) of the change set that you want to - // delete. + // The name or the unique stack ID that is associated with the stack, which + // are not always interchangeable: // - // ChangeSetName is a required field - ChangeSetName *string `min:"1" type:"string" required:"true"` - - // If you specified the name of a change set to delete, specify the stack name - // or ID (ARN) that is associated with it. - StackName *string `min:"1" type:"string"` + // * Running stacks: You can specify either the stack's name or its unique + // stack ID. + // + // * Deleted stacks: You must specify the unique stack ID. + // + // Default: There is no default value. + StackName *string `type:"string"` } // String returns the string representation -func (s DeleteChangeSetInput) String() string { +func (s DescribeStackEventsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteChangeSetInput) GoString() string { +func (s DescribeStackEventsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteChangeSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteChangeSetInput"} - if s.ChangeSetName == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeSetName")) - } - if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1)) - } - if s.StackName != nil && len(*s.StackName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) +func (s *DescribeStackEventsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeStackEventsInput"} + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } if invalidParams.Len() > 0 { @@ -5870,98 +7920,93 @@ func (s *DeleteChangeSetInput) Validate() error { return nil } -// SetChangeSetName sets the ChangeSetName field's value. -func (s *DeleteChangeSetInput) SetChangeSetName(v string) *DeleteChangeSetInput { - s.ChangeSetName = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeStackEventsInput) SetNextToken(v string) *DescribeStackEventsInput { + s.NextToken = &v return s } // SetStackName sets the StackName field's value. -func (s *DeleteChangeSetInput) SetStackName(v string) *DeleteChangeSetInput { +func (s *DescribeStackEventsInput) SetStackName(v string) *DescribeStackEventsInput { s.StackName = &v return s } -// The output for the DeleteChangeSet action. -type DeleteChangeSetOutput struct { +// The output for a DescribeStackEvents action. +type DescribeStackEventsOutput struct { _ struct{} `type:"structure"` + + // If the output exceeds 1 MB in size, a string that identifies the next page + // of events. If no additional page exists, this value is null. + NextToken *string `min:"1" type:"string"` + + // A list of StackEvents structures. + StackEvents []*StackEvent `type:"list"` } // String returns the string representation -func (s DeleteChangeSetOutput) String() string { +func (s DescribeStackEventsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteChangeSetOutput) GoString() string { +func (s DescribeStackEventsOutput) GoString() string { return s.String() } -// The input for DeleteStack action. -type DeleteStackInput struct { - _ struct{} `type:"structure"` +// SetNextToken sets the NextToken field's value. +func (s *DescribeStackEventsOutput) SetNextToken(v string) *DescribeStackEventsOutput { + s.NextToken = &v + return s +} - // A unique identifier for this DeleteStack request. Specify this token if you - // plan to retry requests so that AWS CloudFormation knows that you're not attempting - // to delete a stack with the same name. You might retry DeleteStack requests - // to ensure that AWS CloudFormation successfully received them. - // - // All events triggered by a given stack operation are assigned the same client - // request token, which you can use to track operations. For example, if you - // execute a CreateStack operation with the token token1, then all the StackEvents - // generated by that operation will have ClientRequestToken set as token1. - // - // In the console, stack operations display the client request token on the - // Events tab. Stack operations that are initiated from the console use the - // token format Console-StackOperation-ID, which helps you easily identify the - // stack operation . For example, if you create a stack using the console, each - // stack event would be assigned the same token in the following format: Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002. - ClientRequestToken *string `min:"1" type:"string"` +// SetStackEvents sets the StackEvents field's value. +func (s *DescribeStackEventsOutput) SetStackEvents(v []*StackEvent) *DescribeStackEventsOutput { + s.StackEvents = v + return s +} - // For stacks in the DELETE_FAILED state, a list of resource logical IDs that - // are associated with the resources you want to retain. During deletion, AWS - // CloudFormation deletes the stack but does not delete the retained resources. +type DescribeStackInstanceInput struct { + _ struct{} `type:"structure"` + + // The ID of an AWS account that's associated with this stack instance. // - // Retaining resources is useful when you cannot delete a resource, such as - // a non-empty S3 bucket, but you want to delete the stack. - RetainResources []*string `type:"list"` + // StackInstanceAccount is a required field + StackInstanceAccount *string `type:"string" required:"true"` - // The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) - // role that AWS CloudFormation assumes to delete the stack. AWS CloudFormation - // uses the role's credentials to make calls on your behalf. + // The name of a region that's associated with this stack instance. // - // If you don't specify a value, AWS CloudFormation uses the role that was previously - // associated with the stack. If no role is available, AWS CloudFormation uses - // a temporary session that is generated from your user credentials. - RoleARN *string `min:"20" type:"string"` + // StackInstanceRegion is a required field + StackInstanceRegion *string `type:"string" required:"true"` - // The name or the unique stack ID that is associated with the stack. + // The name or the unique stack ID of the stack set that you want to get stack + // instance information for. // - // StackName is a required field - StackName *string `type:"string" required:"true"` + // StackSetName is a required field + StackSetName *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteStackInput) String() string { +func (s DescribeStackInstanceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteStackInput) GoString() string { +func (s DescribeStackInstanceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteStackInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteStackInput"} - if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) +func (s *DescribeStackInstanceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeStackInstanceInput"} + if s.StackInstanceAccount == nil { + invalidParams.Add(request.NewErrParamRequired("StackInstanceAccount")) } - if s.RoleARN != nil && len(*s.RoleARN) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleARN", 20)) + if s.StackInstanceRegion == nil { + invalidParams.Add(request.NewErrParamRequired("StackInstanceRegion")) } - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) + if s.StackSetName == nil { + invalidParams.Add(request.NewErrParamRequired("StackSetName")) } if invalidParams.Len() > 0 { @@ -5970,107 +8015,107 @@ func (s *DeleteStackInput) Validate() error { return nil } -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *DeleteStackInput) SetClientRequestToken(v string) *DeleteStackInput { - s.ClientRequestToken = &v +// SetStackInstanceAccount sets the StackInstanceAccount field's value. +func (s *DescribeStackInstanceInput) SetStackInstanceAccount(v string) *DescribeStackInstanceInput { + s.StackInstanceAccount = &v return s } -// SetRetainResources sets the RetainResources field's value. -func (s *DeleteStackInput) SetRetainResources(v []*string) *DeleteStackInput { - s.RetainResources = v +// SetStackInstanceRegion sets the StackInstanceRegion field's value. +func (s *DescribeStackInstanceInput) SetStackInstanceRegion(v string) *DescribeStackInstanceInput { + s.StackInstanceRegion = &v return s } -// SetRoleARN sets the RoleARN field's value. -func (s *DeleteStackInput) SetRoleARN(v string) *DeleteStackInput { - s.RoleARN = &v +// SetStackSetName sets the StackSetName field's value. +func (s *DescribeStackInstanceInput) SetStackSetName(v string) *DescribeStackInstanceInput { + s.StackSetName = &v return s } -// SetStackName sets the StackName field's value. -func (s *DeleteStackInput) SetStackName(v string) *DeleteStackInput { - s.StackName = &v +type DescribeStackInstanceOutput struct { + _ struct{} `type:"structure"` + + // The stack instance that matches the specified request parameters. + StackInstance *StackInstance `type:"structure"` +} + +// String returns the string representation +func (s DescribeStackInstanceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeStackInstanceOutput) GoString() string { + return s.String() +} + +// SetStackInstance sets the StackInstance field's value. +func (s *DescribeStackInstanceOutput) SetStackInstance(v *StackInstance) *DescribeStackInstanceOutput { + s.StackInstance = v return s } -type DeleteStackInstancesInput struct { +type DescribeStackResourceDriftsInput struct { _ struct{} `type:"structure"` - // The names of the AWS accounts that you want to delete stack instances for. - // - // Accounts is a required field - Accounts []*string `type:"list" required:"true"` - - // The unique identifier for this stack set operation. - // - // If you don't specify an operation ID, the SDK generates one automatically. - // - // The operation ID also functions as an idempotency token, to ensure that AWS - // CloudFormation performs the stack set operation only once, even if you retry - // the request multiple times. You can retry stack set operation requests to - // ensure that AWS CloudFormation successfully received them. - // - // Repeating this stack set operation with a new operation ID retries all stack - // instances whose status is OUTDATED. - OperationId *string `min:"1" type:"string" idempotencyToken:"true"` + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next + // set of results. + MaxResults *int64 `min:"1" type:"integer"` - // Preferences for how AWS CloudFormation performs this stack set operation. - OperationPreferences *StackSetOperationPreferences `type:"structure"` + // A string that identifies the next page of stack resource drift results. + NextToken *string `min:"1" type:"string"` - // The regions where you want to delete stack set instances. + // The name of the stack for which you want drift information. // - // Regions is a required field - Regions []*string `type:"list" required:"true"` + // StackName is a required field + StackName *string `min:"1" type:"string" required:"true"` - // Removes the stack instances from the specified stack set, but doesn't delete - // the stacks. You can't reassociate a retained stack or add an existing, saved - // stack to a new stack set. + // The resource drift status values to use as filters for the resource drift + // results returned. // - // For more information, see Stack set operation options (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-ops-options). + // * DELETED: The resource differs from its expected template configuration + // in that the resource has been deleted. // - // RetainStacks is a required field - RetainStacks *bool `type:"boolean" required:"true"` - - // The name or unique ID of the stack set that you want to delete stack instances - // for. + // * MODIFIED: One or more resource properties differ from their expected + // template values. // - // StackSetName is a required field - StackSetName *string `type:"string" required:"true"` + // * IN_SYNC: The resources's actual configuration matches its expected template + // configuration. + // + // * NOT_CHECKED: AWS CloudFormation does not currently return this value. + StackResourceDriftStatusFilters []*string `min:"1" type:"list"` } // String returns the string representation -func (s DeleteStackInstancesInput) String() string { +func (s DescribeStackResourceDriftsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteStackInstancesInput) GoString() string { +func (s DescribeStackResourceDriftsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteStackInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteStackInstancesInput"} - if s.Accounts == nil { - invalidParams.Add(request.NewErrParamRequired("Accounts")) - } - if s.OperationId != nil && len(*s.OperationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) +func (s *DescribeStackResourceDriftsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeStackResourceDriftsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } - if s.Regions == nil { - invalidParams.Add(request.NewErrParamRequired("Regions")) + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } - if s.RetainStacks == nil { - invalidParams.Add(request.NewErrParamRequired("RetainStacks")) + if s.StackName == nil { + invalidParams.Add(request.NewErrParamRequired("StackName")) } - if s.StackSetName == nil { - invalidParams.Add(request.NewErrParamRequired("StackSetName")) + if s.StackName != nil && len(*s.StackName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) } - if s.OperationPreferences != nil { - if err := s.OperationPreferences.Validate(); err != nil { - invalidParams.AddNested("OperationPreferences", err.(request.ErrInvalidParams)) - } + if s.StackResourceDriftStatusFilters != nil && len(s.StackResourceDriftStatusFilters) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StackResourceDriftStatusFilters", 1)) } if invalidParams.Len() > 0 { @@ -6079,104 +8124,118 @@ func (s *DeleteStackInstancesInput) Validate() error { return nil } -// SetAccounts sets the Accounts field's value. -func (s *DeleteStackInstancesInput) SetAccounts(v []*string) *DeleteStackInstancesInput { - s.Accounts = v - return s -} - -// SetOperationId sets the OperationId field's value. -func (s *DeleteStackInstancesInput) SetOperationId(v string) *DeleteStackInstancesInput { - s.OperationId = &v - return s -} - -// SetOperationPreferences sets the OperationPreferences field's value. -func (s *DeleteStackInstancesInput) SetOperationPreferences(v *StackSetOperationPreferences) *DeleteStackInstancesInput { - s.OperationPreferences = v +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeStackResourceDriftsInput) SetMaxResults(v int64) *DescribeStackResourceDriftsInput { + s.MaxResults = &v return s } -// SetRegions sets the Regions field's value. -func (s *DeleteStackInstancesInput) SetRegions(v []*string) *DeleteStackInstancesInput { - s.Regions = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeStackResourceDriftsInput) SetNextToken(v string) *DescribeStackResourceDriftsInput { + s.NextToken = &v return s } -// SetRetainStacks sets the RetainStacks field's value. -func (s *DeleteStackInstancesInput) SetRetainStacks(v bool) *DeleteStackInstancesInput { - s.RetainStacks = &v +// SetStackName sets the StackName field's value. +func (s *DescribeStackResourceDriftsInput) SetStackName(v string) *DescribeStackResourceDriftsInput { + s.StackName = &v return s } -// SetStackSetName sets the StackSetName field's value. -func (s *DeleteStackInstancesInput) SetStackSetName(v string) *DeleteStackInstancesInput { - s.StackSetName = &v +// SetStackResourceDriftStatusFilters sets the StackResourceDriftStatusFilters field's value. +func (s *DescribeStackResourceDriftsInput) SetStackResourceDriftStatusFilters(v []*string) *DescribeStackResourceDriftsInput { + s.StackResourceDriftStatusFilters = v return s } -type DeleteStackInstancesOutput struct { +type DescribeStackResourceDriftsOutput struct { _ struct{} `type:"structure"` - // The unique identifier for this stack set operation. - OperationId *string `min:"1" type:"string"` + // If the request doesn't return all of the remaining results, NextToken is + // set to a token. To retrieve the next set of results, call DescribeStackResourceDrifts + // again and assign that token to the request object's NextToken parameter. + // If the request returns all results, NextToken is set to null. + NextToken *string `min:"1" type:"string"` + + // Drift information for the resources that have been checked for drift in the + // specified stack. This includes actual and expected configuration values for + // resources where AWS CloudFormation detects drift. + // + // For a given stack, there will be one StackResourceDrift for each stack resource + // that has been checked for drift. Resources that have not yet been checked + // for drift are not included. Resources that do not currently support drift + // detection are not checked, and so not included. For a list of resources that + // support drift detection, see Resources that Support Drift Detection (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html). + // + // StackResourceDrifts is a required field + StackResourceDrifts []*StackResourceDrift `type:"list" required:"true"` } // String returns the string representation -func (s DeleteStackInstancesOutput) String() string { +func (s DescribeStackResourceDriftsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteStackInstancesOutput) GoString() string { +func (s DescribeStackResourceDriftsOutput) GoString() string { return s.String() } -// SetOperationId sets the OperationId field's value. -func (s *DeleteStackInstancesOutput) SetOperationId(v string) *DeleteStackInstancesOutput { - s.OperationId = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeStackResourceDriftsOutput) SetNextToken(v string) *DescribeStackResourceDriftsOutput { + s.NextToken = &v return s } -type DeleteStackOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteStackOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteStackOutput) GoString() string { - return s.String() +// SetStackResourceDrifts sets the StackResourceDrifts field's value. +func (s *DescribeStackResourceDriftsOutput) SetStackResourceDrifts(v []*StackResourceDrift) *DescribeStackResourceDriftsOutput { + s.StackResourceDrifts = v + return s } -type DeleteStackSetInput struct { +// The input for DescribeStackResource action. +type DescribeStackResourceInput struct { _ struct{} `type:"structure"` - // The name or unique ID of the stack set that you're deleting. You can obtain - // this value by running ListStackSets. + // The logical name of the resource as specified in the template. + // + // Default: There is no default value. + // + // LogicalResourceId is a required field + LogicalResourceId *string `type:"string" required:"true"` + + // The name or the unique stack ID that is associated with the stack, which + // are not always interchangeable: + // + // * Running stacks: You can specify either the stack's name or its unique + // stack ID. + // + // * Deleted stacks: You must specify the unique stack ID. + // + // Default: There is no default value. // - // StackSetName is a required field - StackSetName *string `type:"string" required:"true"` + // StackName is a required field + StackName *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteStackSetInput) String() string { +func (s DescribeStackResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteStackSetInput) GoString() string { +func (s DescribeStackResourceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteStackSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteStackSetInput"} - if s.StackSetName == nil { - invalidParams.Add(request.NewErrParamRequired("StackSetName")) +func (s *DescribeStackResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeStackResourceInput"} + if s.LogicalResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("LogicalResourceId")) + } + if s.StackName == nil { + invalidParams.Add(request.NewErrParamRequired("StackName")) } if invalidParams.Len() > 0 { @@ -6185,141 +8244,157 @@ func (s *DeleteStackSetInput) Validate() error { return nil } -// SetStackSetName sets the StackSetName field's value. -func (s *DeleteStackSetInput) SetStackSetName(v string) *DeleteStackSetInput { - s.StackSetName = &v +// SetLogicalResourceId sets the LogicalResourceId field's value. +func (s *DescribeStackResourceInput) SetLogicalResourceId(v string) *DescribeStackResourceInput { + s.LogicalResourceId = &v return s } -type DeleteStackSetOutput struct { +// SetStackName sets the StackName field's value. +func (s *DescribeStackResourceInput) SetStackName(v string) *DescribeStackResourceInput { + s.StackName = &v + return s +} + +// The output for a DescribeStackResource action. +type DescribeStackResourceOutput struct { _ struct{} `type:"structure"` + + // A StackResourceDetail structure containing the description of the specified + // resource in the specified stack. + StackResourceDetail *StackResourceDetail `type:"structure"` } // String returns the string representation -func (s DeleteStackSetOutput) String() string { +func (s DescribeStackResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteStackSetOutput) GoString() string { +func (s DescribeStackResourceOutput) GoString() string { return s.String() } -// The input for the DescribeAccountLimits action. -type DescribeAccountLimitsInput struct { +// SetStackResourceDetail sets the StackResourceDetail field's value. +func (s *DescribeStackResourceOutput) SetStackResourceDetail(v *StackResourceDetail) *DescribeStackResourceOutput { + s.StackResourceDetail = v + return s +} + +// The input for DescribeStackResources action. +type DescribeStackResourcesInput struct { _ struct{} `type:"structure"` - // A string that identifies the next page of limits that you want to retrieve. - NextToken *string `min:"1" type:"string"` + // The logical name of the resource as specified in the template. + // + // Default: There is no default value. + LogicalResourceId *string `type:"string"` + + // The name or unique identifier that corresponds to a physical instance ID + // of a resource supported by AWS CloudFormation. + // + // For example, for an Amazon Elastic Compute Cloud (EC2) instance, PhysicalResourceId + // corresponds to the InstanceId. You can pass the EC2 InstanceId to DescribeStackResources + // to find which stack the instance belongs to and what other resources are + // part of the stack. + // + // Required: Conditional. If you do not specify PhysicalResourceId, you must + // specify StackName. + // + // Default: There is no default value. + PhysicalResourceId *string `type:"string"` + + // The name or the unique stack ID that is associated with the stack, which + // are not always interchangeable: + // + // * Running stacks: You can specify either the stack's name or its unique + // stack ID. + // + // * Deleted stacks: You must specify the unique stack ID. + // + // Default: There is no default value. + // + // Required: Conditional. If you do not specify StackName, you must specify + // PhysicalResourceId. + StackName *string `type:"string"` } // String returns the string representation -func (s DescribeAccountLimitsInput) String() string { +func (s DescribeStackResourcesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAccountLimitsInput) GoString() string { +func (s DescribeStackResourcesInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAccountLimitsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAccountLimitsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } +// SetLogicalResourceId sets the LogicalResourceId field's value. +func (s *DescribeStackResourcesInput) SetLogicalResourceId(v string) *DescribeStackResourcesInput { + s.LogicalResourceId = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetPhysicalResourceId sets the PhysicalResourceId field's value. +func (s *DescribeStackResourcesInput) SetPhysicalResourceId(v string) *DescribeStackResourcesInput { + s.PhysicalResourceId = &v + return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeAccountLimitsInput) SetNextToken(v string) *DescribeAccountLimitsInput { - s.NextToken = &v +// SetStackName sets the StackName field's value. +func (s *DescribeStackResourcesInput) SetStackName(v string) *DescribeStackResourcesInput { + s.StackName = &v return s } -// The output for the DescribeAccountLimits action. -type DescribeAccountLimitsOutput struct { +// The output for a DescribeStackResources action. +type DescribeStackResourcesOutput struct { _ struct{} `type:"structure"` - // An account limit structure that contain a list of AWS CloudFormation account - // limits and their values. - AccountLimits []*AccountLimit `type:"list"` - - // If the output exceeds 1 MB in size, a string that identifies the next page - // of limits. If no additional page exists, this value is null. - NextToken *string `min:"1" type:"string"` + // A list of StackResource structures. + StackResources []*StackResource `type:"list"` } // String returns the string representation -func (s DescribeAccountLimitsOutput) String() string { +func (s DescribeStackResourcesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAccountLimitsOutput) GoString() string { +func (s DescribeStackResourcesOutput) GoString() string { return s.String() } -// SetAccountLimits sets the AccountLimits field's value. -func (s *DescribeAccountLimitsOutput) SetAccountLimits(v []*AccountLimit) *DescribeAccountLimitsOutput { - s.AccountLimits = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeAccountLimitsOutput) SetNextToken(v string) *DescribeAccountLimitsOutput { - s.NextToken = &v +// SetStackResources sets the StackResources field's value. +func (s *DescribeStackResourcesOutput) SetStackResources(v []*StackResource) *DescribeStackResourcesOutput { + s.StackResources = v return s } -// The input for the DescribeChangeSet action. -type DescribeChangeSetInput struct { +type DescribeStackSetInput struct { _ struct{} `type:"structure"` - // The name or Amazon Resource Name (ARN) of the change set that you want to - // describe. + // The name or unique ID of the stack set whose description you want. // - // ChangeSetName is a required field - ChangeSetName *string `min:"1" type:"string" required:"true"` - - // A string (provided by the DescribeChangeSet response output) that identifies - // the next page of information that you want to retrieve. - NextToken *string `min:"1" type:"string"` - - // If you specified the name of a change set, specify the stack name or ID (ARN) - // of the change set you want to describe. - StackName *string `min:"1" type:"string"` + // StackSetName is a required field + StackSetName *string `type:"string" required:"true"` } // String returns the string representation -func (s DescribeChangeSetInput) String() string { +func (s DescribeStackSetInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeChangeSetInput) GoString() string { +func (s DescribeStackSetInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeChangeSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeChangeSetInput"} - if s.ChangeSetName == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeSetName")) - } - if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.StackName != nil && len(*s.StackName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) +func (s *DescribeStackSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeStackSetInput"} + if s.StackSetName == nil { + invalidParams.Add(request.NewErrParamRequired("StackSetName")) } if invalidParams.Len() > 0 { @@ -6328,229 +8403,246 @@ func (s *DescribeChangeSetInput) Validate() error { return nil } -// SetChangeSetName sets the ChangeSetName field's value. -func (s *DescribeChangeSetInput) SetChangeSetName(v string) *DescribeChangeSetInput { - s.ChangeSetName = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeChangeSetInput) SetNextToken(v string) *DescribeChangeSetInput { - s.NextToken = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *DescribeChangeSetInput) SetStackName(v string) *DescribeChangeSetInput { - s.StackName = &v +// SetStackSetName sets the StackSetName field's value. +func (s *DescribeStackSetInput) SetStackSetName(v string) *DescribeStackSetInput { + s.StackSetName = &v return s } -// The output for the DescribeChangeSet action. -type DescribeChangeSetOutput struct { +type DescribeStackSetOperationInput struct { _ struct{} `type:"structure"` - // If you execute the change set, the list of capabilities that were explicitly - // acknowledged when the change set was created. - Capabilities []*string `type:"list"` - - // The ARN of the change set. - ChangeSetId *string `min:"1" type:"string"` + // The unique ID of the stack set operation. + // + // OperationId is a required field + OperationId *string `min:"1" type:"string" required:"true"` - // The name of the change set. - ChangeSetName *string `min:"1" type:"string"` + // The name or the unique stack ID of the stack set for the stack operation. + // + // StackSetName is a required field + StackSetName *string `type:"string" required:"true"` +} - // A list of Change structures that describes the resources AWS CloudFormation - // changes if you execute the change set. - Changes []*Change `type:"list"` +// String returns the string representation +func (s DescribeStackSetOperationInput) String() string { + return awsutil.Prettify(s) +} - // The start time when the change set was created, in UTC. - CreationTime *time.Time `type:"timestamp"` +// GoString returns the string representation +func (s DescribeStackSetOperationInput) GoString() string { + return s.String() +} - // Information about the change set. - Description *string `min:"1" type:"string"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeStackSetOperationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeStackSetOperationInput"} + if s.OperationId == nil { + invalidParams.Add(request.NewErrParamRequired("OperationId")) + } + if s.OperationId != nil && len(*s.OperationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) + } + if s.StackSetName == nil { + invalidParams.Add(request.NewErrParamRequired("StackSetName")) + } - // If the change set execution status is AVAILABLE, you can execute the change - // set. If you can’t execute the change set, the status indicates why. For - // example, a change set might be in an UNAVAILABLE state because AWS CloudFormation - // is still creating it or in an OBSOLETE state because the stack was already - // updated. - ExecutionStatus *string `type:"string" enum:"ExecutionStatus"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // If the output exceeds 1 MB, a string that identifies the next page of changes. - // If there is no additional page, this value is null. - NextToken *string `min:"1" type:"string"` +// SetOperationId sets the OperationId field's value. +func (s *DescribeStackSetOperationInput) SetOperationId(v string) *DescribeStackSetOperationInput { + s.OperationId = &v + return s +} - // The ARNs of the Amazon Simple Notification Service (Amazon SNS) topics that - // will be associated with the stack if you execute the change set. - NotificationARNs []*string `type:"list"` +// SetStackSetName sets the StackSetName field's value. +func (s *DescribeStackSetOperationInput) SetStackSetName(v string) *DescribeStackSetOperationInput { + s.StackSetName = &v + return s +} - // A list of Parameter structures that describes the input parameters and their - // values used to create the change set. For more information, see the Parameter - // (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html) - // data type. - Parameters []*Parameter `type:"list"` +type DescribeStackSetOperationOutput struct { + _ struct{} `type:"structure"` - // The rollback triggers for AWS CloudFormation to monitor during stack creation - // and updating operations, and for the specified monitoring period afterwards. - RollbackConfiguration *RollbackConfiguration `type:"structure"` + // The specified stack set operation. + StackSetOperation *StackSetOperation `type:"structure"` +} - // The ARN of the stack that is associated with the change set. - StackId *string `type:"string"` +// String returns the string representation +func (s DescribeStackSetOperationOutput) String() string { + return awsutil.Prettify(s) +} - // The name of the stack that is associated with the change set. - StackName *string `type:"string"` +// GoString returns the string representation +func (s DescribeStackSetOperationOutput) GoString() string { + return s.String() +} - // The current status of the change set, such as CREATE_IN_PROGRESS, CREATE_COMPLETE, - // or FAILED. - Status *string `type:"string" enum:"ChangeSetStatus"` +// SetStackSetOperation sets the StackSetOperation field's value. +func (s *DescribeStackSetOperationOutput) SetStackSetOperation(v *StackSetOperation) *DescribeStackSetOperationOutput { + s.StackSetOperation = v + return s +} - // A description of the change set's status. For example, if your attempt to - // create a change set failed, AWS CloudFormation shows the error message. - StatusReason *string `type:"string"` +type DescribeStackSetOutput struct { + _ struct{} `type:"structure"` - // If you execute the change set, the tags that will be associated with the - // stack. - Tags []*Tag `type:"list"` + // The specified stack set. + StackSet *StackSet `type:"structure"` } // String returns the string representation -func (s DescribeChangeSetOutput) String() string { +func (s DescribeStackSetOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeChangeSetOutput) GoString() string { +func (s DescribeStackSetOutput) GoString() string { return s.String() } -// SetCapabilities sets the Capabilities field's value. -func (s *DescribeChangeSetOutput) SetCapabilities(v []*string) *DescribeChangeSetOutput { - s.Capabilities = v +// SetStackSet sets the StackSet field's value. +func (s *DescribeStackSetOutput) SetStackSet(v *StackSet) *DescribeStackSetOutput { + s.StackSet = v return s } -// SetChangeSetId sets the ChangeSetId field's value. -func (s *DescribeChangeSetOutput) SetChangeSetId(v string) *DescribeChangeSetOutput { - s.ChangeSetId = &v - return s -} +// The input for DescribeStacks action. +type DescribeStacksInput struct { + _ struct{} `type:"structure"` -// SetChangeSetName sets the ChangeSetName field's value. -func (s *DescribeChangeSetOutput) SetChangeSetName(v string) *DescribeChangeSetOutput { - s.ChangeSetName = &v - return s -} + // A string that identifies the next page of stacks that you want to retrieve. + NextToken *string `min:"1" type:"string"` -// SetChanges sets the Changes field's value. -func (s *DescribeChangeSetOutput) SetChanges(v []*Change) *DescribeChangeSetOutput { - s.Changes = v - return s + // The name or the unique stack ID that is associated with the stack, which + // are not always interchangeable: + // + // * Running stacks: You can specify either the stack's name or its unique + // stack ID. + // + // * Deleted stacks: You must specify the unique stack ID. + // + // Default: There is no default value. + StackName *string `type:"string"` } -// SetCreationTime sets the CreationTime field's value. -func (s *DescribeChangeSetOutput) SetCreationTime(v time.Time) *DescribeChangeSetOutput { - s.CreationTime = &v - return s +// String returns the string representation +func (s DescribeStacksInput) String() string { + return awsutil.Prettify(s) } -// SetDescription sets the Description field's value. -func (s *DescribeChangeSetOutput) SetDescription(v string) *DescribeChangeSetOutput { - s.Description = &v - return s +// GoString returns the string representation +func (s DescribeStacksInput) GoString() string { + return s.String() } -// SetExecutionStatus sets the ExecutionStatus field's value. -func (s *DescribeChangeSetOutput) SetExecutionStatus(v string) *DescribeChangeSetOutput { - s.ExecutionStatus = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeStacksInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeStacksInput"} + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } // SetNextToken sets the NextToken field's value. -func (s *DescribeChangeSetOutput) SetNextToken(v string) *DescribeChangeSetOutput { +func (s *DescribeStacksInput) SetNextToken(v string) *DescribeStacksInput { s.NextToken = &v return s } -// SetNotificationARNs sets the NotificationARNs field's value. -func (s *DescribeChangeSetOutput) SetNotificationARNs(v []*string) *DescribeChangeSetOutput { - s.NotificationARNs = v +// SetStackName sets the StackName field's value. +func (s *DescribeStacksInput) SetStackName(v string) *DescribeStacksInput { + s.StackName = &v return s } -// SetParameters sets the Parameters field's value. -func (s *DescribeChangeSetOutput) SetParameters(v []*Parameter) *DescribeChangeSetOutput { - s.Parameters = v - return s -} +// The output for a DescribeStacks action. +type DescribeStacksOutput struct { + _ struct{} `type:"structure"` -// SetRollbackConfiguration sets the RollbackConfiguration field's value. -func (s *DescribeChangeSetOutput) SetRollbackConfiguration(v *RollbackConfiguration) *DescribeChangeSetOutput { - s.RollbackConfiguration = v - return s -} + // If the output exceeds 1 MB in size, a string that identifies the next page + // of stacks. If no additional page exists, this value is null. + NextToken *string `min:"1" type:"string"` -// SetStackId sets the StackId field's value. -func (s *DescribeChangeSetOutput) SetStackId(v string) *DescribeChangeSetOutput { - s.StackId = &v - return s + // A list of stack structures. + Stacks []*Stack `type:"list"` } -// SetStackName sets the StackName field's value. -func (s *DescribeChangeSetOutput) SetStackName(v string) *DescribeChangeSetOutput { - s.StackName = &v - return s +// String returns the string representation +func (s DescribeStacksOutput) String() string { + return awsutil.Prettify(s) } -// SetStatus sets the Status field's value. -func (s *DescribeChangeSetOutput) SetStatus(v string) *DescribeChangeSetOutput { - s.Status = &v - return s +// GoString returns the string representation +func (s DescribeStacksOutput) GoString() string { + return s.String() } -// SetStatusReason sets the StatusReason field's value. -func (s *DescribeChangeSetOutput) SetStatusReason(v string) *DescribeChangeSetOutput { - s.StatusReason = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeStacksOutput) SetNextToken(v string) *DescribeStacksOutput { + s.NextToken = &v return s } -// SetTags sets the Tags field's value. -func (s *DescribeChangeSetOutput) SetTags(v []*Tag) *DescribeChangeSetOutput { - s.Tags = v +// SetStacks sets the Stacks field's value. +func (s *DescribeStacksOutput) SetStacks(v []*Stack) *DescribeStacksOutput { + s.Stacks = v return s } -type DescribeStackDriftDetectionStatusInput struct { +type DescribeTypeInput struct { _ struct{} `type:"structure"` - // The ID of the drift detection results of this operation. + // The Amazon Resource Name (ARN) of the type. // - // AWS CloudFormation generates new results, with a new drift detection ID, - // each time this operation is run. However, the number of drift results AWS - // CloudFormation retains for any given stack, and for how long, may vary. + // Conditional: You must specify TypeName or Arn. + Arn *string `type:"string"` + + // The kind of type. // - // StackDriftDetectionId is a required field - StackDriftDetectionId *string `min:"1" type:"string" required:"true"` + // Currently the only valid value is RESOURCE. + Type *string `type:"string" enum:"RegistryType"` + + // The name of the type. + // + // Conditional: You must specify TypeName or Arn. + TypeName *string `min:"10" type:"string"` + + // The ID of a specific version of the type. The version ID is the value at + // the end of the Amazon Resource Name (ARN) assigned to the type version when + // it is registered. + // + // If you specify a VersionId, DescribeType returns information about that specific + // type version. Otherwise, it returns information about the default type version. + VersionId *string `min:"1" type:"string"` } // String returns the string representation -func (s DescribeStackDriftDetectionStatusInput) String() string { +func (s DescribeTypeInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStackDriftDetectionStatusInput) GoString() string { +func (s DescribeTypeInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStackDriftDetectionStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStackDriftDetectionStatusInput"} - if s.StackDriftDetectionId == nil { - invalidParams.Add(request.NewErrParamRequired("StackDriftDetectionId")) +func (s *DescribeTypeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTypeInput"} + if s.TypeName != nil && len(*s.TypeName) < 10 { + invalidParams.Add(request.NewErrParamMinLen("TypeName", 10)) } - if s.StackDriftDetectionId != nil && len(*s.StackDriftDetectionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackDriftDetectionId", 1)) + if s.VersionId != nil && len(*s.VersionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VersionId", 1)) } if invalidParams.Len() > 0 { @@ -6559,258 +8651,252 @@ func (s *DescribeStackDriftDetectionStatusInput) Validate() error { return nil } -// SetStackDriftDetectionId sets the StackDriftDetectionId field's value. -func (s *DescribeStackDriftDetectionStatusInput) SetStackDriftDetectionId(v string) *DescribeStackDriftDetectionStatusInput { - s.StackDriftDetectionId = &v +// SetArn sets the Arn field's value. +func (s *DescribeTypeInput) SetArn(v string) *DescribeTypeInput { + s.Arn = &v return s } -type DescribeStackDriftDetectionStatusOutput struct { +// SetType sets the Type field's value. +func (s *DescribeTypeInput) SetType(v string) *DescribeTypeInput { + s.Type = &v + return s +} + +// SetTypeName sets the TypeName field's value. +func (s *DescribeTypeInput) SetTypeName(v string) *DescribeTypeInput { + s.TypeName = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *DescribeTypeInput) SetVersionId(v string) *DescribeTypeInput { + s.VersionId = &v + return s +} + +type DescribeTypeOutput struct { _ struct{} `type:"structure"` - // The status of the stack drift detection operation. + // The Amazon Resource Name (ARN) of the type. + Arn *string `type:"string"` + + // The ID of the default version of the type. The default version is used when + // the type version is not specified. // - // * DETECTION_COMPLETE: The stack drift detection operation has successfully - // completed for all resources in the stack that support drift detection. - // (Resources that do not currently support stack detection remain unchecked.) - // If you specified logical resource IDs for AWS CloudFormation to use as - // a filter for the stack drift detection operation, only the resources with - // those logical IDs are checked for drift. + // To set the default version of a type, use SetTypeDefaultVersion . + DefaultVersionId *string `min:"1" type:"string"` + + // The deprecation status of the type. // - // * DETECTION_FAILED: The stack drift detection operation has failed for - // at least one resource in the stack. Results will be available for resources - // on which AWS CloudFormation successfully completed drift detection. + // Valid values include: // - // * DETECTION_IN_PROGRESS: The stack drift detection operation is currently - // in progress. + // * LIVE: The type is registered and can be used in CloudFormation operations, + // dependent on its provisioning behavior and visibility scope. // - // DetectionStatus is a required field - DetectionStatus *string `type:"string" required:"true" enum:"StackDriftDetectionStatus"` + // * DEPRECATED: The type has been deregistered and can no longer be used + // in CloudFormation operations. + DeprecatedStatus *string `type:"string" enum:"DeprecatedStatus"` - // The reason the stack drift detection operation has its current status. - DetectionStatusReason *string `type:"string"` + // The description of the registered type. + Description *string `min:"1" type:"string"` - // Total number of stack resources that have drifted. This is NULL until the - // drift detection operation reaches a status of DETECTION_COMPLETE. This value - // will be 0 for stacks whose drift status is IN_SYNC. - DriftedStackResourceCount *int64 `type:"integer"` + // The URL of a page providing detailed documentation for this type. + DocumentationUrl *string `type:"string"` - // The ID of the drift detection results of this operation. - // - // AWS CloudFormation generates new results, with a new drift detection ID, - // each time this operation is run. However, the number of reports AWS CloudFormation - // retains for any given stack, and for how long, may vary. - // - // StackDriftDetectionId is a required field - StackDriftDetectionId *string `min:"1" type:"string" required:"true"` + // The Amazon Resource Name (ARN) of the IAM execution role used to register + // the type. If your resource type calls AWS APIs in any of its handlers, you + // must create an IAM execution role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) + // that includes the necessary permissions to call those AWS APIs, and provision + // that execution role in your account. CloudFormation then assumes that execution + // role to provide your resource type with the appropriate credentials. + ExecutionRoleArn *string `min:"1" type:"string"` + + // When the specified type version was registered. + LastUpdated *time.Time `type:"timestamp"` - // Status of the stack's actual configuration compared to its expected configuration. + // Contains logging configuration information for a type. + LoggingConfig *LoggingConfig `type:"structure"` + + // The provisioning behavior of the type. AWS CloudFormation determines the + // provisioning type during registration, based on the types of handlers in + // the schema handler package submitted. // - // * DRIFTED: The stack differs from its expected template configuration. - // A stack is considered to have drifted if one or more of its resources - // have drifted. + // Valid values include: // - // * NOT_CHECKED: AWS CloudFormation has not checked if the stack differs - // from its expected template configuration. + // * FULLY_MUTABLE: The type includes an update handler to process updates + // to the type during stack update operations. // - // * IN_SYNC: The stack's actual configuration matches its expected template - // configuration. + // * IMMUTABLE: The type does not include an update handler, so the type + // cannot be updated and must instead be replaced during stack update operations. // - // * UNKNOWN: This value is reserved for future use. - StackDriftStatus *string `type:"string" enum:"StackDriftStatus"` + // * NON_PROVISIONABLE: The type does not include all of the following handlers, + // and therefore cannot actually be provisioned. create read delete + ProvisioningType *string `type:"string" enum:"ProvisioningType"` - // The ID of the stack. + // The schema that defines the type. // - // StackId is a required field - StackId *string `type:"string" required:"true"` + // For more information on type schemas, see Resource Provider Schema (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html) + // in the CloudFormation CLI User Guide. + Schema *string `min:"1" type:"string"` - // Time at which the stack drift detection operation was initiated. + // The URL of the source code for the type. + SourceUrl *string `type:"string"` + + // When the specified type version was registered. + TimeCreated *time.Time `type:"timestamp"` + + // The kind of type. // - // Timestamp is a required field - Timestamp *time.Time `type:"timestamp" required:"true"` + // Currently the only valid value is RESOURCE. + Type *string `type:"string" enum:"RegistryType"` + + // The name of the registered type. + TypeName *string `min:"10" type:"string"` + + // The scope at which the type is visible and usable in CloudFormation operations. + // + // Valid values include: + // + // * PRIVATE: The type is only visible and usable within the account in which + // it is registered. Currently, AWS CloudFormation marks any types you register + // as PRIVATE. + // + // * PUBLIC: The type is publically visible and usable within any Amazon + // account. + Visibility *string `type:"string" enum:"Visibility"` } // String returns the string representation -func (s DescribeStackDriftDetectionStatusOutput) String() string { +func (s DescribeTypeOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStackDriftDetectionStatusOutput) GoString() string { +func (s DescribeTypeOutput) GoString() string { return s.String() } -// SetDetectionStatus sets the DetectionStatus field's value. -func (s *DescribeStackDriftDetectionStatusOutput) SetDetectionStatus(v string) *DescribeStackDriftDetectionStatusOutput { - s.DetectionStatus = &v +// SetArn sets the Arn field's value. +func (s *DescribeTypeOutput) SetArn(v string) *DescribeTypeOutput { + s.Arn = &v return s } -// SetDetectionStatusReason sets the DetectionStatusReason field's value. -func (s *DescribeStackDriftDetectionStatusOutput) SetDetectionStatusReason(v string) *DescribeStackDriftDetectionStatusOutput { - s.DetectionStatusReason = &v +// SetDefaultVersionId sets the DefaultVersionId field's value. +func (s *DescribeTypeOutput) SetDefaultVersionId(v string) *DescribeTypeOutput { + s.DefaultVersionId = &v return s } -// SetDriftedStackResourceCount sets the DriftedStackResourceCount field's value. -func (s *DescribeStackDriftDetectionStatusOutput) SetDriftedStackResourceCount(v int64) *DescribeStackDriftDetectionStatusOutput { - s.DriftedStackResourceCount = &v +// SetDeprecatedStatus sets the DeprecatedStatus field's value. +func (s *DescribeTypeOutput) SetDeprecatedStatus(v string) *DescribeTypeOutput { + s.DeprecatedStatus = &v return s } -// SetStackDriftDetectionId sets the StackDriftDetectionId field's value. -func (s *DescribeStackDriftDetectionStatusOutput) SetStackDriftDetectionId(v string) *DescribeStackDriftDetectionStatusOutput { - s.StackDriftDetectionId = &v +// SetDescription sets the Description field's value. +func (s *DescribeTypeOutput) SetDescription(v string) *DescribeTypeOutput { + s.Description = &v return s } -// SetStackDriftStatus sets the StackDriftStatus field's value. -func (s *DescribeStackDriftDetectionStatusOutput) SetStackDriftStatus(v string) *DescribeStackDriftDetectionStatusOutput { - s.StackDriftStatus = &v +// SetDocumentationUrl sets the DocumentationUrl field's value. +func (s *DescribeTypeOutput) SetDocumentationUrl(v string) *DescribeTypeOutput { + s.DocumentationUrl = &v return s } -// SetStackId sets the StackId field's value. -func (s *DescribeStackDriftDetectionStatusOutput) SetStackId(v string) *DescribeStackDriftDetectionStatusOutput { - s.StackId = &v +// SetExecutionRoleArn sets the ExecutionRoleArn field's value. +func (s *DescribeTypeOutput) SetExecutionRoleArn(v string) *DescribeTypeOutput { + s.ExecutionRoleArn = &v return s } -// SetTimestamp sets the Timestamp field's value. -func (s *DescribeStackDriftDetectionStatusOutput) SetTimestamp(v time.Time) *DescribeStackDriftDetectionStatusOutput { - s.Timestamp = &v +// SetLastUpdated sets the LastUpdated field's value. +func (s *DescribeTypeOutput) SetLastUpdated(v time.Time) *DescribeTypeOutput { + s.LastUpdated = &v return s } -// The input for DescribeStackEvents action. -type DescribeStackEventsInput struct { - _ struct{} `type:"structure"` - - // A string that identifies the next page of events that you want to retrieve. - NextToken *string `min:"1" type:"string"` - - // The name or the unique stack ID that is associated with the stack, which - // are not always interchangeable: - // - // * Running stacks: You can specify either the stack's name or its unique - // stack ID. - // - // * Deleted stacks: You must specify the unique stack ID. - // - // Default: There is no default value. - StackName *string `type:"string"` -} - -// String returns the string representation -func (s DescribeStackEventsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStackEventsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStackEventsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStackEventsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetLoggingConfig sets the LoggingConfig field's value. +func (s *DescribeTypeOutput) SetLoggingConfig(v *LoggingConfig) *DescribeTypeOutput { + s.LoggingConfig = v + return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeStackEventsInput) SetNextToken(v string) *DescribeStackEventsInput { - s.NextToken = &v +// SetProvisioningType sets the ProvisioningType field's value. +func (s *DescribeTypeOutput) SetProvisioningType(v string) *DescribeTypeOutput { + s.ProvisioningType = &v return s } -// SetStackName sets the StackName field's value. -func (s *DescribeStackEventsInput) SetStackName(v string) *DescribeStackEventsInput { - s.StackName = &v +// SetSchema sets the Schema field's value. +func (s *DescribeTypeOutput) SetSchema(v string) *DescribeTypeOutput { + s.Schema = &v return s } -// The output for a DescribeStackEvents action. -type DescribeStackEventsOutput struct { - _ struct{} `type:"structure"` - - // If the output exceeds 1 MB in size, a string that identifies the next page - // of events. If no additional page exists, this value is null. - NextToken *string `min:"1" type:"string"` - - // A list of StackEvents structures. - StackEvents []*StackEvent `type:"list"` +// SetSourceUrl sets the SourceUrl field's value. +func (s *DescribeTypeOutput) SetSourceUrl(v string) *DescribeTypeOutput { + s.SourceUrl = &v + return s } -// String returns the string representation -func (s DescribeStackEventsOutput) String() string { - return awsutil.Prettify(s) +// SetTimeCreated sets the TimeCreated field's value. +func (s *DescribeTypeOutput) SetTimeCreated(v time.Time) *DescribeTypeOutput { + s.TimeCreated = &v + return s } -// GoString returns the string representation -func (s DescribeStackEventsOutput) GoString() string { - return s.String() +// SetType sets the Type field's value. +func (s *DescribeTypeOutput) SetType(v string) *DescribeTypeOutput { + s.Type = &v + return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeStackEventsOutput) SetNextToken(v string) *DescribeStackEventsOutput { - s.NextToken = &v +// SetTypeName sets the TypeName field's value. +func (s *DescribeTypeOutput) SetTypeName(v string) *DescribeTypeOutput { + s.TypeName = &v return s } -// SetStackEvents sets the StackEvents field's value. -func (s *DescribeStackEventsOutput) SetStackEvents(v []*StackEvent) *DescribeStackEventsOutput { - s.StackEvents = v +// SetVisibility sets the Visibility field's value. +func (s *DescribeTypeOutput) SetVisibility(v string) *DescribeTypeOutput { + s.Visibility = &v return s } -type DescribeStackInstanceInput struct { +type DescribeTypeRegistrationInput struct { _ struct{} `type:"structure"` - // The ID of an AWS account that's associated with this stack instance. - // - // StackInstanceAccount is a required field - StackInstanceAccount *string `type:"string" required:"true"` - - // The name of a region that's associated with this stack instance. + // The identifier for this registration request. // - // StackInstanceRegion is a required field - StackInstanceRegion *string `type:"string" required:"true"` - - // The name or the unique stack ID of the stack set that you want to get stack - // instance information for. + // This registration token is generated by CloudFormation when you initiate + // a registration request using RegisterType . // - // StackSetName is a required field - StackSetName *string `type:"string" required:"true"` + // RegistrationToken is a required field + RegistrationToken *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s DescribeStackInstanceInput) String() string { +func (s DescribeTypeRegistrationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStackInstanceInput) GoString() string { +func (s DescribeTypeRegistrationInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStackInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStackInstanceInput"} - if s.StackInstanceAccount == nil { - invalidParams.Add(request.NewErrParamRequired("StackInstanceAccount")) - } - if s.StackInstanceRegion == nil { - invalidParams.Add(request.NewErrParamRequired("StackInstanceRegion")) +func (s *DescribeTypeRegistrationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTypeRegistrationInput"} + if s.RegistrationToken == nil { + invalidParams.Add(request.NewErrParamRequired("RegistrationToken")) } - if s.StackSetName == nil { - invalidParams.Add(request.NewErrParamRequired("StackSetName")) + if s.RegistrationToken != nil && len(*s.RegistrationToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RegistrationToken", 1)) } if invalidParams.Len() > 0 { @@ -6819,98 +8905,96 @@ func (s *DescribeStackInstanceInput) Validate() error { return nil } -// SetStackInstanceAccount sets the StackInstanceAccount field's value. -func (s *DescribeStackInstanceInput) SetStackInstanceAccount(v string) *DescribeStackInstanceInput { - s.StackInstanceAccount = &v +// SetRegistrationToken sets the RegistrationToken field's value. +func (s *DescribeTypeRegistrationInput) SetRegistrationToken(v string) *DescribeTypeRegistrationInput { + s.RegistrationToken = &v return s } -// SetStackInstanceRegion sets the StackInstanceRegion field's value. -func (s *DescribeStackInstanceInput) SetStackInstanceRegion(v string) *DescribeStackInstanceInput { - s.StackInstanceRegion = &v - return s -} +type DescribeTypeRegistrationOutput struct { + _ struct{} `type:"structure"` -// SetStackSetName sets the StackSetName field's value. -func (s *DescribeStackInstanceInput) SetStackSetName(v string) *DescribeStackInstanceInput { - s.StackSetName = &v - return s -} + // The description of the type registration request. + Description *string `min:"1" type:"string"` -type DescribeStackInstanceOutput struct { - _ struct{} `type:"structure"` + // The current status of the type registration request. + ProgressStatus *string `type:"string" enum:"RegistrationStatus"` - // The stack instance that matches the specified request parameters. - StackInstance *StackInstance `type:"structure"` + // The Amazon Resource Name (ARN) of the type being registered. + // + // For registration requests with a ProgressStatus of other than COMPLETE, this + // will be null. + TypeArn *string `type:"string"` + + // The Amazon Resource Name (ARN) of this specific version of the type being + // registered. + // + // For registration requests with a ProgressStatus of other than COMPLETE, this + // will be null. + TypeVersionArn *string `type:"string"` } // String returns the string representation -func (s DescribeStackInstanceOutput) String() string { +func (s DescribeTypeRegistrationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStackInstanceOutput) GoString() string { +func (s DescribeTypeRegistrationOutput) GoString() string { return s.String() } -// SetStackInstance sets the StackInstance field's value. -func (s *DescribeStackInstanceOutput) SetStackInstance(v *StackInstance) *DescribeStackInstanceOutput { - s.StackInstance = v +// SetDescription sets the Description field's value. +func (s *DescribeTypeRegistrationOutput) SetDescription(v string) *DescribeTypeRegistrationOutput { + s.Description = &v return s } -type DescribeStackResourceDriftsInput struct { - _ struct{} `type:"structure"` +// SetProgressStatus sets the ProgressStatus field's value. +func (s *DescribeTypeRegistrationOutput) SetProgressStatus(v string) *DescribeTypeRegistrationOutput { + s.ProgressStatus = &v + return s +} - // The maximum number of results to be returned with a single call. If the number - // of available results exceeds this maximum, the response includes a NextToken - // value that you can assign to the NextToken request parameter to get the next - // set of results. - MaxResults *int64 `min:"1" type:"integer"` +// SetTypeArn sets the TypeArn field's value. +func (s *DescribeTypeRegistrationOutput) SetTypeArn(v string) *DescribeTypeRegistrationOutput { + s.TypeArn = &v + return s +} - // A string that identifies the next page of stack resource drift results. - NextToken *string `min:"1" type:"string"` +// SetTypeVersionArn sets the TypeVersionArn field's value. +func (s *DescribeTypeRegistrationOutput) SetTypeVersionArn(v string) *DescribeTypeRegistrationOutput { + s.TypeVersionArn = &v + return s +} - // The name of the stack for which you want drift information. +type DetectStackDriftInput struct { + _ struct{} `type:"structure"` + + // The logical names of any resources you want to use as filters. + LogicalResourceIds []*string `min:"1" type:"list"` + + // The name of the stack for which you want to detect drift. // // StackName is a required field StackName *string `min:"1" type:"string" required:"true"` - - // The resource drift status values to use as filters for the resource drift - // results returned. - // - // * DELETED: The resource differs from its expected template configuration - // in that the resource has been deleted. - // - // * MODIFIED: One or more resource properties differ from their expected - // template values. - // - // * IN_SYNC: The resources's actual configuration matches its expected template - // configuration. - // - // * NOT_CHECKED: AWS CloudFormation does not currently return this value. - StackResourceDriftStatusFilters []*string `min:"1" type:"list"` } // String returns the string representation -func (s DescribeStackResourceDriftsInput) String() string { +func (s DetectStackDriftInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStackResourceDriftsInput) GoString() string { +func (s DetectStackDriftInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStackResourceDriftsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStackResourceDriftsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) +func (s *DetectStackDriftInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DetectStackDriftInput"} + if s.LogicalResourceIds != nil && len(s.LogicalResourceIds) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LogicalResourceIds", 1)) } if s.StackName == nil { invalidParams.Add(request.NewErrParamRequired("StackName")) @@ -6918,9 +9002,6 @@ func (s *DescribeStackResourceDriftsInput) Validate() error { if s.StackName != nil && len(*s.StackName) < 1 { invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) } - if s.StackResourceDriftStatusFilters != nil && len(s.StackResourceDriftStatusFilters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackResourceDriftStatusFilters", 1)) - } if invalidParams.Len() > 0 { return invalidParams @@ -6928,119 +9009,83 @@ func (s *DescribeStackResourceDriftsInput) Validate() error { return nil } -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeStackResourceDriftsInput) SetMaxResults(v int64) *DescribeStackResourceDriftsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeStackResourceDriftsInput) SetNextToken(v string) *DescribeStackResourceDriftsInput { - s.NextToken = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *DescribeStackResourceDriftsInput) SetStackName(v string) *DescribeStackResourceDriftsInput { - s.StackName = &v +// SetLogicalResourceIds sets the LogicalResourceIds field's value. +func (s *DetectStackDriftInput) SetLogicalResourceIds(v []*string) *DetectStackDriftInput { + s.LogicalResourceIds = v return s } -// SetStackResourceDriftStatusFilters sets the StackResourceDriftStatusFilters field's value. -func (s *DescribeStackResourceDriftsInput) SetStackResourceDriftStatusFilters(v []*string) *DescribeStackResourceDriftsInput { - s.StackResourceDriftStatusFilters = v +// SetStackName sets the StackName field's value. +func (s *DetectStackDriftInput) SetStackName(v string) *DetectStackDriftInput { + s.StackName = &v return s } -type DescribeStackResourceDriftsOutput struct { +type DetectStackDriftOutput struct { _ struct{} `type:"structure"` - // If the request doesn't return all of the remaining results, NextToken is - // set to a token. To retrieve the next set of results, call DescribeStackResourceDrifts - // again and assign that token to the request object's NextToken parameter. - // If the request returns all results, NextToken is set to null. - NextToken *string `min:"1" type:"string"` - - // Drift information for the resources that have been checked for drift in the - // specified stack. This includes actual and expected configuration values for - // resources where AWS CloudFormation detects drift. + // The ID of the drift detection results of this operation. // - // For a given stack, there will be one StackResourceDrift for each stack resource - // that has been checked for drift. Resources that have not yet been checked - // for drift are not included. Resources that do not currently support drift - // detection are not checked, and so not included. For a list of resources that - // support drift detection, see Resources that Support Drift Detection (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html). + // AWS CloudFormation generates new results, with a new drift detection ID, + // each time this operation is run. However, the number of drift results AWS + // CloudFormation retains for any given stack, and for how long, may vary. // - // StackResourceDrifts is a required field - StackResourceDrifts []*StackResourceDrift `type:"list" required:"true"` + // StackDriftDetectionId is a required field + StackDriftDetectionId *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s DescribeStackResourceDriftsOutput) String() string { +func (s DetectStackDriftOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStackResourceDriftsOutput) GoString() string { +func (s DetectStackDriftOutput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribeStackResourceDriftsOutput) SetNextToken(v string) *DescribeStackResourceDriftsOutput { - s.NextToken = &v - return s -} - -// SetStackResourceDrifts sets the StackResourceDrifts field's value. -func (s *DescribeStackResourceDriftsOutput) SetStackResourceDrifts(v []*StackResourceDrift) *DescribeStackResourceDriftsOutput { - s.StackResourceDrifts = v +// SetStackDriftDetectionId sets the StackDriftDetectionId field's value. +func (s *DetectStackDriftOutput) SetStackDriftDetectionId(v string) *DetectStackDriftOutput { + s.StackDriftDetectionId = &v return s } -// The input for DescribeStackResource action. -type DescribeStackResourceInput struct { +type DetectStackResourceDriftInput struct { _ struct{} `type:"structure"` - // The logical name of the resource as specified in the template. - // - // Default: There is no default value. + // The logical name of the resource for which to return drift information. // // LogicalResourceId is a required field LogicalResourceId *string `type:"string" required:"true"` - // The name or the unique stack ID that is associated with the stack, which - // are not always interchangeable: - // - // * Running stacks: You can specify either the stack's name or its unique - // stack ID. - // - // * Deleted stacks: You must specify the unique stack ID. - // - // Default: There is no default value. + // The name of the stack to which the resource belongs. // // StackName is a required field - StackName *string `type:"string" required:"true"` + StackName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s DescribeStackResourceInput) String() string { +func (s DetectStackResourceDriftInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStackResourceInput) GoString() string { +func (s DetectStackResourceDriftInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStackResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStackResourceInput"} +func (s *DetectStackResourceDriftInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DetectStackResourceDriftInput"} if s.LogicalResourceId == nil { invalidParams.Add(request.NewErrParamRequired("LogicalResourceId")) } if s.StackName == nil { invalidParams.Add(request.NewErrParamRequired("StackName")) } + if s.StackName != nil && len(*s.StackName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -7049,205 +9094,279 @@ func (s *DescribeStackResourceInput) Validate() error { } // SetLogicalResourceId sets the LogicalResourceId field's value. -func (s *DescribeStackResourceInput) SetLogicalResourceId(v string) *DescribeStackResourceInput { +func (s *DetectStackResourceDriftInput) SetLogicalResourceId(v string) *DetectStackResourceDriftInput { s.LogicalResourceId = &v return s } // SetStackName sets the StackName field's value. -func (s *DescribeStackResourceInput) SetStackName(v string) *DescribeStackResourceInput { +func (s *DetectStackResourceDriftInput) SetStackName(v string) *DetectStackResourceDriftInput { s.StackName = &v return s } -// The output for a DescribeStackResource action. -type DescribeStackResourceOutput struct { +type DetectStackResourceDriftOutput struct { _ struct{} `type:"structure"` - // A StackResourceDetail structure containing the description of the specified - // resource in the specified stack. - StackResourceDetail *StackResourceDetail `type:"structure"` + // Information about whether the resource's actual configuration has drifted + // from its expected template configuration, including actual and expected property + // values and any differences detected. + // + // StackResourceDrift is a required field + StackResourceDrift *StackResourceDrift `type:"structure" required:"true"` } // String returns the string representation -func (s DescribeStackResourceOutput) String() string { +func (s DetectStackResourceDriftOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStackResourceOutput) GoString() string { +func (s DetectStackResourceDriftOutput) GoString() string { return s.String() } -// SetStackResourceDetail sets the StackResourceDetail field's value. -func (s *DescribeStackResourceOutput) SetStackResourceDetail(v *StackResourceDetail) *DescribeStackResourceOutput { - s.StackResourceDetail = v +// SetStackResourceDrift sets the StackResourceDrift field's value. +func (s *DetectStackResourceDriftOutput) SetStackResourceDrift(v *StackResourceDrift) *DetectStackResourceDriftOutput { + s.StackResourceDrift = v return s } -// The input for DescribeStackResources action. -type DescribeStackResourcesInput struct { +type DetectStackSetDriftInput struct { _ struct{} `type:"structure"` - // The logical name of the resource as specified in the template. - // - // Default: There is no default value. - LogicalResourceId *string `type:"string"` + // The ID of the stack set operation. + OperationId *string `min:"1" type:"string" idempotencyToken:"true"` - // The name or unique identifier that corresponds to a physical instance ID - // of a resource supported by AWS CloudFormation. - // - // For example, for an Amazon Elastic Compute Cloud (EC2) instance, PhysicalResourceId - // corresponds to the InstanceId. You can pass the EC2 InstanceId to DescribeStackResources - // to find which stack the instance belongs to and what other resources are - // part of the stack. - // - // Required: Conditional. If you do not specify PhysicalResourceId, you must - // specify StackName. + // The user-specified preferences for how AWS CloudFormation performs a stack + // set operation. // - // Default: There is no default value. - PhysicalResourceId *string `type:"string"` + // For more information on maximum concurrent accounts and failure tolerance, + // see Stack set operation options (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-ops-options). + OperationPreferences *StackSetOperationPreferences `type:"structure"` - // The name or the unique stack ID that is associated with the stack, which - // are not always interchangeable: - // - // * Running stacks: You can specify either the stack's name or its unique - // stack ID. - // - // * Deleted stacks: You must specify the unique stack ID. + // The name of the stack set on which to perform the drift detection operation. // - // Default: There is no default value. - // - // Required: Conditional. If you do not specify StackName, you must specify - // PhysicalResourceId. - StackName *string `type:"string"` + // StackSetName is a required field + StackSetName *string `type:"string" required:"true"` } // String returns the string representation -func (s DescribeStackResourcesInput) String() string { +func (s DetectStackSetDriftInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStackResourcesInput) GoString() string { +func (s DetectStackSetDriftInput) GoString() string { return s.String() } -// SetLogicalResourceId sets the LogicalResourceId field's value. -func (s *DescribeStackResourcesInput) SetLogicalResourceId(v string) *DescribeStackResourcesInput { - s.LogicalResourceId = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *DetectStackSetDriftInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DetectStackSetDriftInput"} + if s.OperationId != nil && len(*s.OperationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) + } + if s.StackSetName == nil { + invalidParams.Add(request.NewErrParamRequired("StackSetName")) + } + if s.OperationPreferences != nil { + if err := s.OperationPreferences.Validate(); err != nil { + invalidParams.AddNested("OperationPreferences", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOperationId sets the OperationId field's value. +func (s *DetectStackSetDriftInput) SetOperationId(v string) *DetectStackSetDriftInput { + s.OperationId = &v return s } -// SetPhysicalResourceId sets the PhysicalResourceId field's value. -func (s *DescribeStackResourcesInput) SetPhysicalResourceId(v string) *DescribeStackResourcesInput { - s.PhysicalResourceId = &v +// SetOperationPreferences sets the OperationPreferences field's value. +func (s *DetectStackSetDriftInput) SetOperationPreferences(v *StackSetOperationPreferences) *DetectStackSetDriftInput { + s.OperationPreferences = v return s } -// SetStackName sets the StackName field's value. -func (s *DescribeStackResourcesInput) SetStackName(v string) *DescribeStackResourcesInput { - s.StackName = &v +// SetStackSetName sets the StackSetName field's value. +func (s *DetectStackSetDriftInput) SetStackSetName(v string) *DetectStackSetDriftInput { + s.StackSetName = &v return s } -// The output for a DescribeStackResources action. -type DescribeStackResourcesOutput struct { +type DetectStackSetDriftOutput struct { _ struct{} `type:"structure"` - // A list of StackResource structures. - StackResources []*StackResource `type:"list"` + // The ID of the drift detection stack set operation. + // + // you can use this operation id with DescribeStackSetOperation to monitor the + // progress of the drift detection operation. + OperationId *string `min:"1" type:"string"` } // String returns the string representation -func (s DescribeStackResourcesOutput) String() string { +func (s DetectStackSetDriftOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStackResourcesOutput) GoString() string { +func (s DetectStackSetDriftOutput) GoString() string { return s.String() } -// SetStackResources sets the StackResources field's value. -func (s *DescribeStackResourcesOutput) SetStackResources(v []*StackResource) *DescribeStackResourcesOutput { - s.StackResources = v +// SetOperationId sets the OperationId field's value. +func (s *DetectStackSetDriftOutput) SetOperationId(v string) *DetectStackSetDriftOutput { + s.OperationId = &v return s } -type DescribeStackSetInput struct { +// The input for an EstimateTemplateCost action. +type EstimateTemplateCostInput struct { _ struct{} `type:"structure"` - // The name or unique ID of the stack set whose description you want. + // A list of Parameter structures that specify input parameters. + Parameters []*Parameter `type:"list"` + + // Structure containing the template body with a minimum length of 1 byte and + // a maximum length of 51,200 bytes. (For more information, go to Template Anatomy + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // in the AWS CloudFormation User Guide.) // - // StackSetName is a required field - StackSetName *string `type:"string" required:"true"` + // Conditional: You must pass TemplateBody or TemplateURL. If both are passed, + // only TemplateBody is used. + TemplateBody *string `min:"1" type:"string"` + + // Location of file containing the template body. The URL must point to a template + // that is located in an Amazon S3 bucket. For more information, go to Template + // Anatomy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // in the AWS CloudFormation User Guide. + // + // Conditional: You must pass TemplateURL or TemplateBody. If both are passed, + // only TemplateBody is used. + TemplateURL *string `min:"1" type:"string"` } // String returns the string representation -func (s DescribeStackSetInput) String() string { +func (s EstimateTemplateCostInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStackSetInput) GoString() string { +func (s EstimateTemplateCostInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStackSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStackSetInput"} - if s.StackSetName == nil { - invalidParams.Add(request.NewErrParamRequired("StackSetName")) +func (s *EstimateTemplateCostInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EstimateTemplateCostInput"} + if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) + } + if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) } - if invalidParams.Len() > 0 { - return invalidParams - } - return nil + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetParameters sets the Parameters field's value. +func (s *EstimateTemplateCostInput) SetParameters(v []*Parameter) *EstimateTemplateCostInput { + s.Parameters = v + return s +} + +// SetTemplateBody sets the TemplateBody field's value. +func (s *EstimateTemplateCostInput) SetTemplateBody(v string) *EstimateTemplateCostInput { + s.TemplateBody = &v + return s +} + +// SetTemplateURL sets the TemplateURL field's value. +func (s *EstimateTemplateCostInput) SetTemplateURL(v string) *EstimateTemplateCostInput { + s.TemplateURL = &v + return s +} + +// The output for a EstimateTemplateCost action. +type EstimateTemplateCostOutput struct { + _ struct{} `type:"structure"` + + // An AWS Simple Monthly Calculator URL with a query string that describes the + // resources required to run the template. + Url *string `type:"string"` +} + +// String returns the string representation +func (s EstimateTemplateCostOutput) String() string { + return awsutil.Prettify(s) } -// SetStackSetName sets the StackSetName field's value. -func (s *DescribeStackSetInput) SetStackSetName(v string) *DescribeStackSetInput { - s.StackSetName = &v +// GoString returns the string representation +func (s EstimateTemplateCostOutput) GoString() string { + return s.String() +} + +// SetUrl sets the Url field's value. +func (s *EstimateTemplateCostOutput) SetUrl(v string) *EstimateTemplateCostOutput { + s.Url = &v return s } -type DescribeStackSetOperationInput struct { +// The input for the ExecuteChangeSet action. +type ExecuteChangeSetInput struct { _ struct{} `type:"structure"` - // The unique ID of the stack set operation. + // The name or ARN of the change set that you want use to update the specified + // stack. // - // OperationId is a required field - OperationId *string `min:"1" type:"string" required:"true"` + // ChangeSetName is a required field + ChangeSetName *string `min:"1" type:"string" required:"true"` - // The name or the unique stack ID of the stack set for the stack operation. - // - // StackSetName is a required field - StackSetName *string `type:"string" required:"true"` + // A unique identifier for this ExecuteChangeSet request. Specify this token + // if you plan to retry requests so that AWS CloudFormation knows that you're + // not attempting to execute a change set to update a stack with the same name. + // You might retry ExecuteChangeSet requests to ensure that AWS CloudFormation + // successfully received them. + ClientRequestToken *string `min:"1" type:"string"` + + // If you specified the name of a change set, specify the stack name or ID (ARN) + // that is associated with the change set you want to execute. + StackName *string `min:"1" type:"string"` } // String returns the string representation -func (s DescribeStackSetOperationInput) String() string { +func (s ExecuteChangeSetInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStackSetOperationInput) GoString() string { +func (s ExecuteChangeSetInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStackSetOperationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStackSetOperationInput"} - if s.OperationId == nil { - invalidParams.Add(request.NewErrParamRequired("OperationId")) +func (s *ExecuteChangeSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ExecuteChangeSetInput"} + if s.ChangeSetName == nil { + invalidParams.Add(request.NewErrParamRequired("ChangeSetName")) } - if s.OperationId != nil && len(*s.OperationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) + if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1)) } - if s.StackSetName == nil { - invalidParams.Add(request.NewErrParamRequired("StackSetName")) + if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) + } + if s.StackName != nil && len(*s.StackName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) } if invalidParams.Len() > 0 { @@ -7256,98 +9375,110 @@ func (s *DescribeStackSetOperationInput) Validate() error { return nil } -// SetOperationId sets the OperationId field's value. -func (s *DescribeStackSetOperationInput) SetOperationId(v string) *DescribeStackSetOperationInput { - s.OperationId = &v +// SetChangeSetName sets the ChangeSetName field's value. +func (s *ExecuteChangeSetInput) SetChangeSetName(v string) *ExecuteChangeSetInput { + s.ChangeSetName = &v return s } -// SetStackSetName sets the StackSetName field's value. -func (s *DescribeStackSetOperationInput) SetStackSetName(v string) *DescribeStackSetOperationInput { - s.StackSetName = &v +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *ExecuteChangeSetInput) SetClientRequestToken(v string) *ExecuteChangeSetInput { + s.ClientRequestToken = &v return s } -type DescribeStackSetOperationOutput struct { - _ struct{} `type:"structure"` +// SetStackName sets the StackName field's value. +func (s *ExecuteChangeSetInput) SetStackName(v string) *ExecuteChangeSetInput { + s.StackName = &v + return s +} - // The specified stack set operation. - StackSetOperation *StackSetOperation `type:"structure"` +// The output for the ExecuteChangeSet action. +type ExecuteChangeSetOutput struct { + _ struct{} `type:"structure"` } // String returns the string representation -func (s DescribeStackSetOperationOutput) String() string { +func (s ExecuteChangeSetOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStackSetOperationOutput) GoString() string { +func (s ExecuteChangeSetOutput) GoString() string { return s.String() } -// SetStackSetOperation sets the StackSetOperation field's value. -func (s *DescribeStackSetOperationOutput) SetStackSetOperation(v *StackSetOperation) *DescribeStackSetOperationOutput { - s.StackSetOperation = v - return s -} - -type DescribeStackSetOutput struct { +// The Export structure describes the exported output values for a stack. +type Export struct { _ struct{} `type:"structure"` - // The specified stack set. - StackSet *StackSet `type:"structure"` + // The stack that contains the exported output name and value. + ExportingStackId *string `type:"string"` + + // The name of exported output value. Use this name and the Fn::ImportValue + // function to import the associated value into other stacks. The name is defined + // in the Export field in the associated stack's Outputs section. + Name *string `type:"string"` + + // The value of the exported output, such as a resource physical ID. This value + // is defined in the Export field in the associated stack's Outputs section. + Value *string `type:"string"` } // String returns the string representation -func (s DescribeStackSetOutput) String() string { +func (s Export) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStackSetOutput) GoString() string { +func (s Export) GoString() string { return s.String() } -// SetStackSet sets the StackSet field's value. -func (s *DescribeStackSetOutput) SetStackSet(v *StackSet) *DescribeStackSetOutput { - s.StackSet = v +// SetExportingStackId sets the ExportingStackId field's value. +func (s *Export) SetExportingStackId(v string) *Export { + s.ExportingStackId = &v return s } -// The input for DescribeStacks action. -type DescribeStacksInput struct { - _ struct{} `type:"structure"` +// SetName sets the Name field's value. +func (s *Export) SetName(v string) *Export { + s.Name = &v + return s +} - // A string that identifies the next page of stacks that you want to retrieve. - NextToken *string `min:"1" type:"string"` +// SetValue sets the Value field's value. +func (s *Export) SetValue(v string) *Export { + s.Value = &v + return s +} - // The name or the unique stack ID that is associated with the stack, which - // are not always interchangeable: - // - // * Running stacks: You can specify either the stack's name or its unique - // stack ID. - // - // * Deleted stacks: You must specify the unique stack ID. +// The input for the GetStackPolicy action. +type GetStackPolicyInput struct { + _ struct{} `type:"structure"` + + // The name or unique stack ID that is associated with the stack whose policy + // you want to get. // - // Default: There is no default value. - StackName *string `type:"string"` + // StackName is a required field + StackName *string `type:"string" required:"true"` } // String returns the string representation -func (s DescribeStacksInput) String() string { +func (s GetStackPolicyInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStacksInput) GoString() string { +func (s GetStackPolicyInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStacksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStacksInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) +func (s *GetStackPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetStackPolicyInput"} + if s.StackName == nil { + invalidParams.Add(request.NewErrParamRequired("StackName")) } if invalidParams.Len() > 0 { @@ -7356,85 +9487,83 @@ func (s *DescribeStacksInput) Validate() error { return nil } -// SetNextToken sets the NextToken field's value. -func (s *DescribeStacksInput) SetNextToken(v string) *DescribeStacksInput { - s.NextToken = &v - return s -} - // SetStackName sets the StackName field's value. -func (s *DescribeStacksInput) SetStackName(v string) *DescribeStacksInput { +func (s *GetStackPolicyInput) SetStackName(v string) *GetStackPolicyInput { s.StackName = &v return s } -// The output for a DescribeStacks action. -type DescribeStacksOutput struct { +// The output for the GetStackPolicy action. +type GetStackPolicyOutput struct { _ struct{} `type:"structure"` - // If the output exceeds 1 MB in size, a string that identifies the next page - // of stacks. If no additional page exists, this value is null. - NextToken *string `min:"1" type:"string"` - - // A list of stack structures. - Stacks []*Stack `type:"list"` + // Structure containing the stack policy body. (For more information, go to + // Prevent Updates to Stack Resources (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html) + // in the AWS CloudFormation User Guide.) + StackPolicyBody *string `min:"1" type:"string"` } // String returns the string representation -func (s DescribeStacksOutput) String() string { +func (s GetStackPolicyOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStacksOutput) GoString() string { +func (s GetStackPolicyOutput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribeStacksOutput) SetNextToken(v string) *DescribeStacksOutput { - s.NextToken = &v - return s -} - -// SetStacks sets the Stacks field's value. -func (s *DescribeStacksOutput) SetStacks(v []*Stack) *DescribeStacksOutput { - s.Stacks = v +// SetStackPolicyBody sets the StackPolicyBody field's value. +func (s *GetStackPolicyOutput) SetStackPolicyBody(v string) *GetStackPolicyOutput { + s.StackPolicyBody = &v return s } -type DetectStackDriftInput struct { +// The input for a GetTemplate action. +type GetTemplateInput struct { _ struct{} `type:"structure"` - // The logical names of any resources you want to use as filters. - LogicalResourceIds []*string `min:"1" type:"list"` + // The name or Amazon Resource Name (ARN) of a change set for which AWS CloudFormation + // returns the associated template. If you specify a name, you must also specify + // the StackName. + ChangeSetName *string `min:"1" type:"string"` - // The name of the stack for which you want to detect drift. + // The name or the unique stack ID that is associated with the stack, which + // are not always interchangeable: // - // StackName is a required field - StackName *string `min:"1" type:"string" required:"true"` + // * Running stacks: You can specify either the stack's name or its unique + // stack ID. + // + // * Deleted stacks: You must specify the unique stack ID. + // + // Default: There is no default value. + StackName *string `type:"string"` + + // For templates that include transforms, the stage of the template that AWS + // CloudFormation returns. To get the user-submitted template, specify Original. + // To get the template after AWS CloudFormation has processed all transforms, + // specify Processed. + // + // If the template doesn't include transforms, Original and Processed return + // the same template. By default, AWS CloudFormation specifies Original. + TemplateStage *string `type:"string" enum:"TemplateStage"` } // String returns the string representation -func (s DetectStackDriftInput) String() string { +func (s GetTemplateInput) String() string { return awsutil.Prettify(s) } -// GoString returns the string representation -func (s DetectStackDriftInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetectStackDriftInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetectStackDriftInput"} - if s.LogicalResourceIds != nil && len(s.LogicalResourceIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogicalResourceIds", 1)) - } - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) - } - if s.StackName != nil && len(*s.StackName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) +// GoString returns the string representation +func (s GetTemplateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetTemplateInput"} + if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1)) } if invalidParams.Len() > 0 { @@ -7443,83 +9572,125 @@ func (s *DetectStackDriftInput) Validate() error { return nil } -// SetLogicalResourceIds sets the LogicalResourceIds field's value. -func (s *DetectStackDriftInput) SetLogicalResourceIds(v []*string) *DetectStackDriftInput { - s.LogicalResourceIds = v +// SetChangeSetName sets the ChangeSetName field's value. +func (s *GetTemplateInput) SetChangeSetName(v string) *GetTemplateInput { + s.ChangeSetName = &v return s } // SetStackName sets the StackName field's value. -func (s *DetectStackDriftInput) SetStackName(v string) *DetectStackDriftInput { +func (s *GetTemplateInput) SetStackName(v string) *GetTemplateInput { s.StackName = &v return s } -type DetectStackDriftOutput struct { +// SetTemplateStage sets the TemplateStage field's value. +func (s *GetTemplateInput) SetTemplateStage(v string) *GetTemplateInput { + s.TemplateStage = &v + return s +} + +// The output for GetTemplate action. +type GetTemplateOutput struct { _ struct{} `type:"structure"` - // The ID of the drift detection results of this operation. - // - // AWS CloudFormation generates new results, with a new drift detection ID, - // each time this operation is run. However, the number of drift results AWS - // CloudFormation retains for any given stack, and for how long, may vary. + // The stage of the template that you can retrieve. For stacks, the Original + // and Processed templates are always available. For change sets, the Original + // template is always available. After AWS CloudFormation finishes creating + // the change set, the Processed template becomes available. + StagesAvailable []*string `type:"list"` + + // Structure containing the template body. (For more information, go to Template + // Anatomy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // in the AWS CloudFormation User Guide.) // - // StackDriftDetectionId is a required field - StackDriftDetectionId *string `min:"1" type:"string" required:"true"` + // AWS CloudFormation returns the same template that was used when the stack + // was created. + TemplateBody *string `min:"1" type:"string"` } // String returns the string representation -func (s DetectStackDriftOutput) String() string { +func (s GetTemplateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DetectStackDriftOutput) GoString() string { +func (s GetTemplateOutput) GoString() string { return s.String() } -// SetStackDriftDetectionId sets the StackDriftDetectionId field's value. -func (s *DetectStackDriftOutput) SetStackDriftDetectionId(v string) *DetectStackDriftOutput { - s.StackDriftDetectionId = &v +// SetStagesAvailable sets the StagesAvailable field's value. +func (s *GetTemplateOutput) SetStagesAvailable(v []*string) *GetTemplateOutput { + s.StagesAvailable = v return s } -type DetectStackResourceDriftInput struct { +// SetTemplateBody sets the TemplateBody field's value. +func (s *GetTemplateOutput) SetTemplateBody(v string) *GetTemplateOutput { + s.TemplateBody = &v + return s +} + +// The input for the GetTemplateSummary action. +type GetTemplateSummaryInput struct { _ struct{} `type:"structure"` - // The logical name of the resource for which to return drift information. + // The name or the stack ID that is associated with the stack, which are not + // always interchangeable. For running stacks, you can specify either the stack's + // name or its unique stack ID. For deleted stack, you must specify the unique + // stack ID. // - // LogicalResourceId is a required field - LogicalResourceId *string `type:"string" required:"true"` + // Conditional: You must specify only one of the following parameters: StackName, + // StackSetName, TemplateBody, or TemplateURL. + StackName *string `min:"1" type:"string"` - // The name of the stack to which the resource belongs. + // The name or unique ID of the stack set from which the stack was created. // - // StackName is a required field - StackName *string `min:"1" type:"string" required:"true"` + // Conditional: You must specify only one of the following parameters: StackName, + // StackSetName, TemplateBody, or TemplateURL. + StackSetName *string `type:"string"` + + // Structure containing the template body with a minimum length of 1 byte and + // a maximum length of 51,200 bytes. For more information about templates, see + // Template Anatomy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // in the AWS CloudFormation User Guide. + // + // Conditional: You must specify only one of the following parameters: StackName, + // StackSetName, TemplateBody, or TemplateURL. + TemplateBody *string `min:"1" type:"string"` + + // Location of file containing the template body. The URL must point to a template + // (max size: 460,800 bytes) that is located in an Amazon S3 bucket. For more + // information about templates, see Template Anatomy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // in the AWS CloudFormation User Guide. + // + // Conditional: You must specify only one of the following parameters: StackName, + // StackSetName, TemplateBody, or TemplateURL. + TemplateURL *string `min:"1" type:"string"` } // String returns the string representation -func (s DetectStackResourceDriftInput) String() string { +func (s GetTemplateSummaryInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DetectStackResourceDriftInput) GoString() string { +func (s GetTemplateSummaryInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DetectStackResourceDriftInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetectStackResourceDriftInput"} - if s.LogicalResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("LogicalResourceId")) - } - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) - } +func (s *GetTemplateSummaryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetTemplateSummaryInput"} if s.StackName != nil && len(*s.StackName) < 1 { invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) } + if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) + } + if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -7527,183 +9698,173 @@ func (s *DetectStackResourceDriftInput) Validate() error { return nil } -// SetLogicalResourceId sets the LogicalResourceId field's value. -func (s *DetectStackResourceDriftInput) SetLogicalResourceId(v string) *DetectStackResourceDriftInput { - s.LogicalResourceId = &v +// SetStackName sets the StackName field's value. +func (s *GetTemplateSummaryInput) SetStackName(v string) *GetTemplateSummaryInput { + s.StackName = &v return s } -// SetStackName sets the StackName field's value. -func (s *DetectStackResourceDriftInput) SetStackName(v string) *DetectStackResourceDriftInput { - s.StackName = &v +// SetStackSetName sets the StackSetName field's value. +func (s *GetTemplateSummaryInput) SetStackSetName(v string) *GetTemplateSummaryInput { + s.StackSetName = &v return s } -type DetectStackResourceDriftOutput struct { +// SetTemplateBody sets the TemplateBody field's value. +func (s *GetTemplateSummaryInput) SetTemplateBody(v string) *GetTemplateSummaryInput { + s.TemplateBody = &v + return s +} + +// SetTemplateURL sets the TemplateURL field's value. +func (s *GetTemplateSummaryInput) SetTemplateURL(v string) *GetTemplateSummaryInput { + s.TemplateURL = &v + return s +} + +// The output for the GetTemplateSummary action. +type GetTemplateSummaryOutput struct { _ struct{} `type:"structure"` - // Information about whether the resource's actual configuration has drifted - // from its expected template configuration, including actual and expected property - // values and any differences detected. + // The capabilities found within the template. If your template contains IAM + // resources, you must specify the CAPABILITY_IAM or CAPABILITY_NAMED_IAM value + // for this parameter when you use the CreateStack or UpdateStack actions with + // your template; otherwise, those actions return an InsufficientCapabilities + // error. // - // StackResourceDrift is a required field - StackResourceDrift *StackResourceDrift `type:"structure" required:"true"` + // For more information, see Acknowledging IAM Resources in AWS CloudFormation + // Templates (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). + Capabilities []*string `type:"list"` + + // The list of resources that generated the values in the Capabilities response + // element. + CapabilitiesReason *string `type:"string"` + + // A list of the transforms that are declared in the template. + DeclaredTransforms []*string `type:"list"` + + // The value that is defined in the Description property of the template. + Description *string `min:"1" type:"string"` + + // The value that is defined for the Metadata property of the template. + Metadata *string `type:"string"` + + // A list of parameter declarations that describe various properties for each + // parameter. + Parameters []*ParameterDeclaration `type:"list"` + + // A list of resource identifier summaries that describe the target resources + // of an import operation and the properties you can provide during the import + // to identify the target resources. For example, BucketName is a possible identifier + // property for an AWS::S3::Bucket resource. + ResourceIdentifierSummaries []*ResourceIdentifierSummary `type:"list"` + + // A list of all the template resource types that are defined in the template, + // such as AWS::EC2::Instance, AWS::Dynamo::Table, and Custom::MyCustomInstance. + ResourceTypes []*string `type:"list"` + + // The AWS template format version, which identifies the capabilities of the + // template. + Version *string `type:"string"` } // String returns the string representation -func (s DetectStackResourceDriftOutput) String() string { +func (s GetTemplateSummaryOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DetectStackResourceDriftOutput) GoString() string { +func (s GetTemplateSummaryOutput) GoString() string { return s.String() } -// SetStackResourceDrift sets the StackResourceDrift field's value. -func (s *DetectStackResourceDriftOutput) SetStackResourceDrift(v *StackResourceDrift) *DetectStackResourceDriftOutput { - s.StackResourceDrift = v +// SetCapabilities sets the Capabilities field's value. +func (s *GetTemplateSummaryOutput) SetCapabilities(v []*string) *GetTemplateSummaryOutput { + s.Capabilities = v return s } -// The input for an EstimateTemplateCost action. -type EstimateTemplateCostInput struct { - _ struct{} `type:"structure"` - - // A list of Parameter structures that specify input parameters. - Parameters []*Parameter `type:"list"` - - // Structure containing the template body with a minimum length of 1 byte and - // a maximum length of 51,200 bytes. (For more information, go to Template Anatomy - // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide.) - // - // Conditional: You must pass TemplateBody or TemplateURL. If both are passed, - // only TemplateBody is used. - TemplateBody *string `min:"1" type:"string"` - - // Location of file containing the template body. The URL must point to a template - // that is located in an Amazon S3 bucket. For more information, go to Template - // Anatomy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide. - // - // Conditional: You must pass TemplateURL or TemplateBody. If both are passed, - // only TemplateBody is used. - TemplateURL *string `min:"1" type:"string"` +// SetCapabilitiesReason sets the CapabilitiesReason field's value. +func (s *GetTemplateSummaryOutput) SetCapabilitiesReason(v string) *GetTemplateSummaryOutput { + s.CapabilitiesReason = &v + return s } -// String returns the string representation -func (s EstimateTemplateCostInput) String() string { - return awsutil.Prettify(s) +// SetDeclaredTransforms sets the DeclaredTransforms field's value. +func (s *GetTemplateSummaryOutput) SetDeclaredTransforms(v []*string) *GetTemplateSummaryOutput { + s.DeclaredTransforms = v + return s } -// GoString returns the string representation -func (s EstimateTemplateCostInput) GoString() string { - return s.String() +// SetDescription sets the Description field's value. +func (s *GetTemplateSummaryOutput) SetDescription(v string) *GetTemplateSummaryOutput { + s.Description = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *EstimateTemplateCostInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EstimateTemplateCostInput"} - if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) - } - if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetMetadata sets the Metadata field's value. +func (s *GetTemplateSummaryOutput) SetMetadata(v string) *GetTemplateSummaryOutput { + s.Metadata = &v + return s } // SetParameters sets the Parameters field's value. -func (s *EstimateTemplateCostInput) SetParameters(v []*Parameter) *EstimateTemplateCostInput { +func (s *GetTemplateSummaryOutput) SetParameters(v []*ParameterDeclaration) *GetTemplateSummaryOutput { s.Parameters = v return s } -// SetTemplateBody sets the TemplateBody field's value. -func (s *EstimateTemplateCostInput) SetTemplateBody(v string) *EstimateTemplateCostInput { - s.TemplateBody = &v +// SetResourceIdentifierSummaries sets the ResourceIdentifierSummaries field's value. +func (s *GetTemplateSummaryOutput) SetResourceIdentifierSummaries(v []*ResourceIdentifierSummary) *GetTemplateSummaryOutput { + s.ResourceIdentifierSummaries = v return s } -// SetTemplateURL sets the TemplateURL field's value. -func (s *EstimateTemplateCostInput) SetTemplateURL(v string) *EstimateTemplateCostInput { - s.TemplateURL = &v +// SetResourceTypes sets the ResourceTypes field's value. +func (s *GetTemplateSummaryOutput) SetResourceTypes(v []*string) *GetTemplateSummaryOutput { + s.ResourceTypes = v return s } -// The output for a EstimateTemplateCost action. -type EstimateTemplateCostOutput struct { - _ struct{} `type:"structure"` - - // An AWS Simple Monthly Calculator URL with a query string that describes the - // resources required to run the template. - Url *string `type:"string"` -} - -// String returns the string representation -func (s EstimateTemplateCostOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EstimateTemplateCostOutput) GoString() string { - return s.String() -} - -// SetUrl sets the Url field's value. -func (s *EstimateTemplateCostOutput) SetUrl(v string) *EstimateTemplateCostOutput { - s.Url = &v +// SetVersion sets the Version field's value. +func (s *GetTemplateSummaryOutput) SetVersion(v string) *GetTemplateSummaryOutput { + s.Version = &v return s } -// The input for the ExecuteChangeSet action. -type ExecuteChangeSetInput struct { +// The input for the ListChangeSets action. +type ListChangeSetsInput struct { _ struct{} `type:"structure"` - // The name or ARN of the change set that you want use to update the specified - // stack. - // - // ChangeSetName is a required field - ChangeSetName *string `min:"1" type:"string" required:"true"` - - // A unique identifier for this ExecuteChangeSet request. Specify this token - // if you plan to retry requests so that AWS CloudFormation knows that you're - // not attempting to execute a change set to update a stack with the same name. - // You might retry ExecuteChangeSet requests to ensure that AWS CloudFormation - // successfully received them. - ClientRequestToken *string `min:"1" type:"string"` + // A string (provided by the ListChangeSets response output) that identifies + // the next page of change sets that you want to retrieve. + NextToken *string `min:"1" type:"string"` - // If you specified the name of a change set, specify the stack name or ID (ARN) - // that is associated with the change set you want to execute. - StackName *string `min:"1" type:"string"` + // The name or the Amazon Resource Name (ARN) of the stack for which you want + // to list change sets. + // + // StackName is a required field + StackName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s ExecuteChangeSetInput) String() string { +func (s ListChangeSetsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ExecuteChangeSetInput) GoString() string { +func (s ListChangeSetsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ExecuteChangeSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExecuteChangeSetInput"} - if s.ChangeSetName == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeSetName")) - } - if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1)) +func (s *ListChangeSetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListChangeSetsInput"} + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } - if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) + if s.StackName == nil { + invalidParams.Add(request.NewErrParamRequired("StackName")) } if s.StackName != nil && len(*s.StackName) < 1 { invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) @@ -7715,110 +9876,76 @@ func (s *ExecuteChangeSetInput) Validate() error { return nil } -// SetChangeSetName sets the ChangeSetName field's value. -func (s *ExecuteChangeSetInput) SetChangeSetName(v string) *ExecuteChangeSetInput { - s.ChangeSetName = &v - return s -} - -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *ExecuteChangeSetInput) SetClientRequestToken(v string) *ExecuteChangeSetInput { - s.ClientRequestToken = &v +// SetNextToken sets the NextToken field's value. +func (s *ListChangeSetsInput) SetNextToken(v string) *ListChangeSetsInput { + s.NextToken = &v return s } // SetStackName sets the StackName field's value. -func (s *ExecuteChangeSetInput) SetStackName(v string) *ExecuteChangeSetInput { +func (s *ListChangeSetsInput) SetStackName(v string) *ListChangeSetsInput { s.StackName = &v return s } -// The output for the ExecuteChangeSet action. -type ExecuteChangeSetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ExecuteChangeSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExecuteChangeSetOutput) GoString() string { - return s.String() -} - -// The Export structure describes the exported output values for a stack. -type Export struct { +// The output for the ListChangeSets action. +type ListChangeSetsOutput struct { _ struct{} `type:"structure"` - // The stack that contains the exported output name and value. - ExportingStackId *string `type:"string"` - - // The name of exported output value. Use this name and the Fn::ImportValue - // function to import the associated value into other stacks. The name is defined - // in the Export field in the associated stack's Outputs section. - Name *string `type:"string"` + // If the output exceeds 1 MB, a string that identifies the next page of change + // sets. If there is no additional page, this value is null. + NextToken *string `min:"1" type:"string"` - // The value of the exported output, such as a resource physical ID. This value - // is defined in the Export field in the associated stack's Outputs section. - Value *string `type:"string"` + // A list of ChangeSetSummary structures that provides the ID and status of + // each change set for the specified stack. + Summaries []*ChangeSetSummary `type:"list"` } // String returns the string representation -func (s Export) String() string { +func (s ListChangeSetsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Export) GoString() string { +func (s ListChangeSetsOutput) GoString() string { return s.String() } -// SetExportingStackId sets the ExportingStackId field's value. -func (s *Export) SetExportingStackId(v string) *Export { - s.ExportingStackId = &v - return s -} - -// SetName sets the Name field's value. -func (s *Export) SetName(v string) *Export { - s.Name = &v +// SetNextToken sets the NextToken field's value. +func (s *ListChangeSetsOutput) SetNextToken(v string) *ListChangeSetsOutput { + s.NextToken = &v return s } -// SetValue sets the Value field's value. -func (s *Export) SetValue(v string) *Export { - s.Value = &v +// SetSummaries sets the Summaries field's value. +func (s *ListChangeSetsOutput) SetSummaries(v []*ChangeSetSummary) *ListChangeSetsOutput { + s.Summaries = v return s } -// The input for the GetStackPolicy action. -type GetStackPolicyInput struct { +type ListExportsInput struct { _ struct{} `type:"structure"` - // The name or unique stack ID that is associated with the stack whose policy - // you want to get. - // - // StackName is a required field - StackName *string `type:"string" required:"true"` + // A string (provided by the ListExports response output) that identifies the + // next page of exported output values that you asked to retrieve. + NextToken *string `min:"1" type:"string"` } // String returns the string representation -func (s GetStackPolicyInput) String() string { +func (s ListExportsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetStackPolicyInput) GoString() string { +func (s ListExportsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetStackPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetStackPolicyInput"} - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) +func (s *ListExportsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListExportsInput"} + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } if invalidParams.Len() > 0 { @@ -7827,83 +9954,77 @@ func (s *GetStackPolicyInput) Validate() error { return nil } -// SetStackName sets the StackName field's value. -func (s *GetStackPolicyInput) SetStackName(v string) *GetStackPolicyInput { - s.StackName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListExportsInput) SetNextToken(v string) *ListExportsInput { + s.NextToken = &v return s } -// The output for the GetStackPolicy action. -type GetStackPolicyOutput struct { +type ListExportsOutput struct { _ struct{} `type:"structure"` - // Structure containing the stack policy body. (For more information, go to - // Prevent Updates to Stack Resources (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html) - // in the AWS CloudFormation User Guide.) - StackPolicyBody *string `min:"1" type:"string"` + // The output for the ListExports action. + Exports []*Export `type:"list"` + + // If the output exceeds 100 exported output values, a string that identifies + // the next page of exports. If there is no additional page, this value is null. + NextToken *string `min:"1" type:"string"` } // String returns the string representation -func (s GetStackPolicyOutput) String() string { +func (s ListExportsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetStackPolicyOutput) GoString() string { +func (s ListExportsOutput) GoString() string { return s.String() } -// SetStackPolicyBody sets the StackPolicyBody field's value. -func (s *GetStackPolicyOutput) SetStackPolicyBody(v string) *GetStackPolicyOutput { - s.StackPolicyBody = &v +// SetExports sets the Exports field's value. +func (s *ListExportsOutput) SetExports(v []*Export) *ListExportsOutput { + s.Exports = v return s } -// The input for a GetTemplate action. -type GetTemplateInput struct { - _ struct{} `type:"structure"` +// SetNextToken sets the NextToken field's value. +func (s *ListExportsOutput) SetNextToken(v string) *ListExportsOutput { + s.NextToken = &v + return s +} - // The name or Amazon Resource Name (ARN) of a change set for which AWS CloudFormation - // returns the associated template. If you specify a name, you must also specify - // the StackName. - ChangeSetName *string `min:"1" type:"string"` +type ListImportsInput struct { + _ struct{} `type:"structure"` - // The name or the unique stack ID that is associated with the stack, which - // are not always interchangeable: - // - // * Running stacks: You can specify either the stack's name or its unique - // stack ID. - // - // * Deleted stacks: You must specify the unique stack ID. + // The name of the exported output value. AWS CloudFormation returns the stack + // names that are importing this value. // - // Default: There is no default value. - StackName *string `type:"string"` + // ExportName is a required field + ExportName *string `type:"string" required:"true"` - // For templates that include transforms, the stage of the template that AWS - // CloudFormation returns. To get the user-submitted template, specify Original. - // To get the template after AWS CloudFormation has processed all transforms, - // specify Processed. - // - // If the template doesn't include transforms, Original and Processed return - // the same template. By default, AWS CloudFormation specifies Original. - TemplateStage *string `type:"string" enum:"TemplateStage"` + // A string (provided by the ListImports response output) that identifies the + // next page of stacks that are importing the specified exported output value. + NextToken *string `min:"1" type:"string"` } // String returns the string representation -func (s GetTemplateInput) String() string { +func (s ListImportsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetTemplateInput) GoString() string { +func (s ListImportsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTemplateInput"} - if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1)) +func (s *ListImportsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListImportsInput"} + if s.ExportName == nil { + invalidParams.Add(request.NewErrParamRequired("ExportName")) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } if invalidParams.Len() > 0 { @@ -7912,124 +10033,101 @@ func (s *GetTemplateInput) Validate() error { return nil } -// SetChangeSetName sets the ChangeSetName field's value. -func (s *GetTemplateInput) SetChangeSetName(v string) *GetTemplateInput { - s.ChangeSetName = &v - return s -} - -// SetStackName sets the StackName field's value. -func (s *GetTemplateInput) SetStackName(v string) *GetTemplateInput { - s.StackName = &v +// SetExportName sets the ExportName field's value. +func (s *ListImportsInput) SetExportName(v string) *ListImportsInput { + s.ExportName = &v return s } -// SetTemplateStage sets the TemplateStage field's value. -func (s *GetTemplateInput) SetTemplateStage(v string) *GetTemplateInput { - s.TemplateStage = &v +// SetNextToken sets the NextToken field's value. +func (s *ListImportsInput) SetNextToken(v string) *ListImportsInput { + s.NextToken = &v return s } -// The output for GetTemplate action. -type GetTemplateOutput struct { +type ListImportsOutput struct { _ struct{} `type:"structure"` - // The stage of the template that you can retrieve. For stacks, the Original - // and Processed templates are always available. For change sets, the Original - // template is always available. After AWS CloudFormation finishes creating - // the change set, the Processed template becomes available. - StagesAvailable []*string `type:"list"` + // A list of stack names that are importing the specified exported output value. + Imports []*string `type:"list"` - // Structure containing the template body. (For more information, go to Template - // Anatomy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide.) - // - // AWS CloudFormation returns the same template that was used when the stack - // was created. - TemplateBody *string `min:"1" type:"string"` + // A string that identifies the next page of exports. If there is no additional + // page, this value is null. + NextToken *string `min:"1" type:"string"` } // String returns the string representation -func (s GetTemplateOutput) String() string { +func (s ListImportsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetTemplateOutput) GoString() string { +func (s ListImportsOutput) GoString() string { return s.String() } -// SetStagesAvailable sets the StagesAvailable field's value. -func (s *GetTemplateOutput) SetStagesAvailable(v []*string) *GetTemplateOutput { - s.StagesAvailable = v +// SetImports sets the Imports field's value. +func (s *ListImportsOutput) SetImports(v []*string) *ListImportsOutput { + s.Imports = v return s } -// SetTemplateBody sets the TemplateBody field's value. -func (s *GetTemplateOutput) SetTemplateBody(v string) *GetTemplateOutput { - s.TemplateBody = &v +// SetNextToken sets the NextToken field's value. +func (s *ListImportsOutput) SetNextToken(v string) *ListImportsOutput { + s.NextToken = &v return s } -// The input for the GetTemplateSummary action. -type GetTemplateSummaryInput struct { +type ListStackInstancesInput struct { _ struct{} `type:"structure"` - // The name or the stack ID that is associated with the stack, which are not - // always interchangeable. For running stacks, you can specify either the stack's - // name or its unique stack ID. For deleted stack, you must specify the unique - // stack ID. - // - // Conditional: You must specify only one of the following parameters: StackName, - // StackSetName, TemplateBody, or TemplateURL. - StackName *string `min:"1" type:"string"` + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next + // set of results. + MaxResults *int64 `min:"1" type:"integer"` - // The name or unique ID of the stack set from which the stack was created. - // - // Conditional: You must specify only one of the following parameters: StackName, - // StackSetName, TemplateBody, or TemplateURL. - StackSetName *string `type:"string"` + // If the previous request didn't return all of the remaining results, the response's + // NextToken parameter value is set to a token. To retrieve the next set of + // results, call ListStackInstances again and assign that token to the request + // object's NextToken parameter. If there are no remaining results, the previous + // response object's NextToken parameter is set to null. + NextToken *string `min:"1" type:"string"` - // Structure containing the template body with a minimum length of 1 byte and - // a maximum length of 51,200 bytes. For more information about templates, see - // Template Anatomy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide. - // - // Conditional: You must specify only one of the following parameters: StackName, - // StackSetName, TemplateBody, or TemplateURL. - TemplateBody *string `min:"1" type:"string"` + // The name of the AWS account that you want to list stack instances for. + StackInstanceAccount *string `type:"string"` - // Location of file containing the template body. The URL must point to a template - // (max size: 460,800 bytes) that is located in an Amazon S3 bucket. For more - // information about templates, see Template Anatomy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) - // in the AWS CloudFormation User Guide. + // The name of the region where you want to list stack instances. + StackInstanceRegion *string `type:"string"` + + // The name or unique ID of the stack set that you want to list stack instances + // for. // - // Conditional: You must specify only one of the following parameters: StackName, - // StackSetName, TemplateBody, or TemplateURL. - TemplateURL *string `min:"1" type:"string"` + // StackSetName is a required field + StackSetName *string `type:"string" required:"true"` } // String returns the string representation -func (s GetTemplateSummaryInput) String() string { +func (s ListStackInstancesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetTemplateSummaryInput) GoString() string { +func (s ListStackInstancesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetTemplateSummaryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTemplateSummaryInput"} - if s.StackName != nil && len(*s.StackName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) +func (s *ListStackInstancesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListStackInstancesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } - if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } - if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) + if s.StackSetName == nil { + invalidParams.Add(request.NewErrParamRequired("StackSetName")) } if invalidParams.Len() > 0 { @@ -8038,165 +10136,113 @@ func (s *GetTemplateSummaryInput) Validate() error { return nil } -// SetStackName sets the StackName field's value. -func (s *GetTemplateSummaryInput) SetStackName(v string) *GetTemplateSummaryInput { - s.StackName = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListStackInstancesInput) SetMaxResults(v int64) *ListStackInstancesInput { + s.MaxResults = &v return s } -// SetStackSetName sets the StackSetName field's value. -func (s *GetTemplateSummaryInput) SetStackSetName(v string) *GetTemplateSummaryInput { - s.StackSetName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListStackInstancesInput) SetNextToken(v string) *ListStackInstancesInput { + s.NextToken = &v return s } -// SetTemplateBody sets the TemplateBody field's value. -func (s *GetTemplateSummaryInput) SetTemplateBody(v string) *GetTemplateSummaryInput { - s.TemplateBody = &v +// SetStackInstanceAccount sets the StackInstanceAccount field's value. +func (s *ListStackInstancesInput) SetStackInstanceAccount(v string) *ListStackInstancesInput { + s.StackInstanceAccount = &v return s } -// SetTemplateURL sets the TemplateURL field's value. -func (s *GetTemplateSummaryInput) SetTemplateURL(v string) *GetTemplateSummaryInput { - s.TemplateURL = &v +// SetStackInstanceRegion sets the StackInstanceRegion field's value. +func (s *ListStackInstancesInput) SetStackInstanceRegion(v string) *ListStackInstancesInput { + s.StackInstanceRegion = &v return s } -// The output for the GetTemplateSummary action. -type GetTemplateSummaryOutput struct { - _ struct{} `type:"structure"` - - // The capabilities found within the template. If your template contains IAM - // resources, you must specify the CAPABILITY_IAM or CAPABILITY_NAMED_IAM value - // for this parameter when you use the CreateStack or UpdateStack actions with - // your template; otherwise, those actions return an InsufficientCapabilities - // error. - // - // For more information, see Acknowledging IAM Resources in AWS CloudFormation - // Templates (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). - Capabilities []*string `type:"list"` - - // The list of resources that generated the values in the Capabilities response - // element. - CapabilitiesReason *string `type:"string"` - - // A list of the transforms that are declared in the template. - DeclaredTransforms []*string `type:"list"` - - // The value that is defined in the Description property of the template. - Description *string `min:"1" type:"string"` - - // The value that is defined for the Metadata property of the template. - Metadata *string `type:"string"` +// SetStackSetName sets the StackSetName field's value. +func (s *ListStackInstancesInput) SetStackSetName(v string) *ListStackInstancesInput { + s.StackSetName = &v + return s +} - // A list of parameter declarations that describe various properties for each - // parameter. - Parameters []*ParameterDeclaration `type:"list"` +type ListStackInstancesOutput struct { + _ struct{} `type:"structure"` - // A list of all the template resource types that are defined in the template, - // such as AWS::EC2::Instance, AWS::Dynamo::Table, and Custom::MyCustomInstance. - ResourceTypes []*string `type:"list"` + // If the request doesn't return all of the remaining results, NextToken is + // set to a token. To retrieve the next set of results, call ListStackInstances + // again and assign that token to the request object's NextToken parameter. + // If the request returns all results, NextToken is set to null. + NextToken *string `min:"1" type:"string"` - // The AWS template format version, which identifies the capabilities of the - // template. - Version *string `type:"string"` + // A list of StackInstanceSummary structures that contain information about + // the specified stack instances. + Summaries []*StackInstanceSummary `type:"list"` } // String returns the string representation -func (s GetTemplateSummaryOutput) String() string { +func (s ListStackInstancesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetTemplateSummaryOutput) GoString() string { +func (s ListStackInstancesOutput) GoString() string { return s.String() } -// SetCapabilities sets the Capabilities field's value. -func (s *GetTemplateSummaryOutput) SetCapabilities(v []*string) *GetTemplateSummaryOutput { - s.Capabilities = v - return s -} - -// SetCapabilitiesReason sets the CapabilitiesReason field's value. -func (s *GetTemplateSummaryOutput) SetCapabilitiesReason(v string) *GetTemplateSummaryOutput { - s.CapabilitiesReason = &v - return s -} - -// SetDeclaredTransforms sets the DeclaredTransforms field's value. -func (s *GetTemplateSummaryOutput) SetDeclaredTransforms(v []*string) *GetTemplateSummaryOutput { - s.DeclaredTransforms = v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetTemplateSummaryOutput) SetDescription(v string) *GetTemplateSummaryOutput { - s.Description = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *GetTemplateSummaryOutput) SetMetadata(v string) *GetTemplateSummaryOutput { - s.Metadata = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *GetTemplateSummaryOutput) SetParameters(v []*ParameterDeclaration) *GetTemplateSummaryOutput { - s.Parameters = v - return s -} - -// SetResourceTypes sets the ResourceTypes field's value. -func (s *GetTemplateSummaryOutput) SetResourceTypes(v []*string) *GetTemplateSummaryOutput { - s.ResourceTypes = v +// SetNextToken sets the NextToken field's value. +func (s *ListStackInstancesOutput) SetNextToken(v string) *ListStackInstancesOutput { + s.NextToken = &v return s } -// SetVersion sets the Version field's value. -func (s *GetTemplateSummaryOutput) SetVersion(v string) *GetTemplateSummaryOutput { - s.Version = &v +// SetSummaries sets the Summaries field's value. +func (s *ListStackInstancesOutput) SetSummaries(v []*StackInstanceSummary) *ListStackInstancesOutput { + s.Summaries = v return s } -// The input for the ListChangeSets action. -type ListChangeSetsInput struct { +// The input for the ListStackResource action. +type ListStackResourcesInput struct { _ struct{} `type:"structure"` - // A string (provided by the ListChangeSets response output) that identifies - // the next page of change sets that you want to retrieve. + // A string that identifies the next page of stack resources that you want to + // retrieve. NextToken *string `min:"1" type:"string"` - // The name or the Amazon Resource Name (ARN) of the stack for which you want - // to list change sets. + // The name or the unique stack ID that is associated with the stack, which + // are not always interchangeable: + // + // * Running stacks: You can specify either the stack's name or its unique + // stack ID. + // + // * Deleted stacks: You must specify the unique stack ID. + // + // Default: There is no default value. // // StackName is a required field - StackName *string `min:"1" type:"string" required:"true"` + StackName *string `type:"string" required:"true"` } // String returns the string representation -func (s ListChangeSetsInput) String() string { +func (s ListStackResourcesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListChangeSetsInput) GoString() string { +func (s ListStackResourcesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListChangeSetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListChangeSetsInput"} +func (s *ListStackResourcesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListStackResourcesInput"} if s.NextToken != nil && len(*s.NextToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } if s.StackName == nil { invalidParams.Add(request.NewErrParamRequired("StackName")) } - if s.StackName != nil && len(*s.StackName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) - } if invalidParams.Len() > 0 { return invalidParams @@ -8205,76 +10251,107 @@ func (s *ListChangeSetsInput) Validate() error { } // SetNextToken sets the NextToken field's value. -func (s *ListChangeSetsInput) SetNextToken(v string) *ListChangeSetsInput { +func (s *ListStackResourcesInput) SetNextToken(v string) *ListStackResourcesInput { s.NextToken = &v return s } // SetStackName sets the StackName field's value. -func (s *ListChangeSetsInput) SetStackName(v string) *ListChangeSetsInput { +func (s *ListStackResourcesInput) SetStackName(v string) *ListStackResourcesInput { s.StackName = &v return s } -// The output for the ListChangeSets action. -type ListChangeSetsOutput struct { +// The output for a ListStackResources action. +type ListStackResourcesOutput struct { _ struct{} `type:"structure"` - // If the output exceeds 1 MB, a string that identifies the next page of change - // sets. If there is no additional page, this value is null. + // If the output exceeds 1 MB, a string that identifies the next page of stack + // resources. If no additional page exists, this value is null. NextToken *string `min:"1" type:"string"` - // A list of ChangeSetSummary structures that provides the ID and status of - // each change set for the specified stack. - Summaries []*ChangeSetSummary `type:"list"` + // A list of StackResourceSummary structures. + StackResourceSummaries []*StackResourceSummary `type:"list"` } // String returns the string representation -func (s ListChangeSetsOutput) String() string { +func (s ListStackResourcesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListChangeSetsOutput) GoString() string { +func (s ListStackResourcesOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListChangeSetsOutput) SetNextToken(v string) *ListChangeSetsOutput { +func (s *ListStackResourcesOutput) SetNextToken(v string) *ListStackResourcesOutput { s.NextToken = &v return s } -// SetSummaries sets the Summaries field's value. -func (s *ListChangeSetsOutput) SetSummaries(v []*ChangeSetSummary) *ListChangeSetsOutput { - s.Summaries = v +// SetStackResourceSummaries sets the StackResourceSummaries field's value. +func (s *ListStackResourcesOutput) SetStackResourceSummaries(v []*StackResourceSummary) *ListStackResourcesOutput { + s.StackResourceSummaries = v return s } -type ListExportsInput struct { +type ListStackSetOperationResultsInput struct { _ struct{} `type:"structure"` - // A string (provided by the ListExports response output) that identifies the - // next page of exported output values that you asked to retrieve. + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next + // set of results. + MaxResults *int64 `min:"1" type:"integer"` + + // If the previous request didn't return all of the remaining results, the response + // object's NextToken parameter value is set to a token. To retrieve the next + // set of results, call ListStackSetOperationResults again and assign that token + // to the request object's NextToken parameter. If there are no remaining results, + // the previous response object's NextToken parameter is set to null. NextToken *string `min:"1" type:"string"` + + // The ID of the stack set operation. + // + // OperationId is a required field + OperationId *string `min:"1" type:"string" required:"true"` + + // The name or unique ID of the stack set that you want to get operation results + // for. + // + // StackSetName is a required field + StackSetName *string `type:"string" required:"true"` } // String returns the string representation -func (s ListExportsInput) String() string { +func (s ListStackSetOperationResultsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListExportsInput) GoString() string { +func (s ListStackSetOperationResultsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListExportsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListExportsInput"} +func (s *ListStackSetOperationResultsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListStackSetOperationResultsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } if s.NextToken != nil && len(*s.NextToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } + if s.OperationId == nil { + invalidParams.Add(request.NewErrParamRequired("OperationId")) + } + if s.OperationId != nil && len(*s.OperationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) + } + if s.StackSetName == nil { + invalidParams.Add(request.NewErrParamRequired("StackSetName")) + } if invalidParams.Len() > 0 { return invalidParams @@ -8282,78 +10359,112 @@ func (s *ListExportsInput) Validate() error { return nil } +// SetMaxResults sets the MaxResults field's value. +func (s *ListStackSetOperationResultsInput) SetMaxResults(v int64) *ListStackSetOperationResultsInput { + s.MaxResults = &v + return s +} + // SetNextToken sets the NextToken field's value. -func (s *ListExportsInput) SetNextToken(v string) *ListExportsInput { +func (s *ListStackSetOperationResultsInput) SetNextToken(v string) *ListStackSetOperationResultsInput { s.NextToken = &v return s } -type ListExportsOutput struct { - _ struct{} `type:"structure"` +// SetOperationId sets the OperationId field's value. +func (s *ListStackSetOperationResultsInput) SetOperationId(v string) *ListStackSetOperationResultsInput { + s.OperationId = &v + return s +} - // The output for the ListExports action. - Exports []*Export `type:"list"` +// SetStackSetName sets the StackSetName field's value. +func (s *ListStackSetOperationResultsInput) SetStackSetName(v string) *ListStackSetOperationResultsInput { + s.StackSetName = &v + return s +} - // If the output exceeds 100 exported output values, a string that identifies - // the next page of exports. If there is no additional page, this value is null. +type ListStackSetOperationResultsOutput struct { + _ struct{} `type:"structure"` + + // If the request doesn't return all results, NextToken is set to a token. To + // retrieve the next set of results, call ListOperationResults again and assign + // that token to the request object's NextToken parameter. If there are no remaining + // results, NextToken is set to null. NextToken *string `min:"1" type:"string"` + + // A list of StackSetOperationResultSummary structures that contain information + // about the specified operation results, for accounts and regions that are + // included in the operation. + Summaries []*StackSetOperationResultSummary `type:"list"` } // String returns the string representation -func (s ListExportsOutput) String() string { +func (s ListStackSetOperationResultsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListExportsOutput) GoString() string { +func (s ListStackSetOperationResultsOutput) GoString() string { return s.String() } -// SetExports sets the Exports field's value. -func (s *ListExportsOutput) SetExports(v []*Export) *ListExportsOutput { - s.Exports = v +// SetNextToken sets the NextToken field's value. +func (s *ListStackSetOperationResultsOutput) SetNextToken(v string) *ListStackSetOperationResultsOutput { + s.NextToken = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListExportsOutput) SetNextToken(v string) *ListExportsOutput { - s.NextToken = &v +// SetSummaries sets the Summaries field's value. +func (s *ListStackSetOperationResultsOutput) SetSummaries(v []*StackSetOperationResultSummary) *ListStackSetOperationResultsOutput { + s.Summaries = v return s } -type ListImportsInput struct { +type ListStackSetOperationsInput struct { _ struct{} `type:"structure"` - // The name of the exported output value. AWS CloudFormation returns the stack - // names that are importing this value. - // - // ExportName is a required field - ExportName *string `type:"string" required:"true"` + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next + // set of results. + MaxResults *int64 `min:"1" type:"integer"` - // A string (provided by the ListImports response output) that identifies the - // next page of stacks that are importing the specified exported output value. + // If the previous paginated request didn't return all of the remaining results, + // the response object's NextToken parameter value is set to a token. To retrieve + // the next set of results, call ListStackSetOperations again and assign that + // token to the request object's NextToken parameter. If there are no remaining + // results, the previous response object's NextToken parameter is set to null. NextToken *string `min:"1" type:"string"` + + // The name or unique ID of the stack set that you want to get operation summaries + // for. + // + // StackSetName is a required field + StackSetName *string `type:"string" required:"true"` } // String returns the string representation -func (s ListImportsInput) String() string { +func (s ListStackSetOperationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListImportsInput) GoString() string { +func (s ListStackSetOperationsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListImportsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListImportsInput"} - if s.ExportName == nil { - invalidParams.Add(request.NewErrParamRequired("ExportName")) +func (s *ListStackSetOperationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListStackSetOperationsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if s.NextToken != nil && len(*s.NextToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } + if s.StackSetName == nil { + invalidParams.Add(request.NewErrParamRequired("StackSetName")) + } if invalidParams.Len() > 0 { return invalidParams @@ -8361,102 +10472,99 @@ func (s *ListImportsInput) Validate() error { return nil } -// SetExportName sets the ExportName field's value. -func (s *ListImportsInput) SetExportName(v string) *ListImportsInput { - s.ExportName = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListStackSetOperationsInput) SetMaxResults(v int64) *ListStackSetOperationsInput { + s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *ListImportsInput) SetNextToken(v string) *ListImportsInput { +func (s *ListStackSetOperationsInput) SetNextToken(v string) *ListStackSetOperationsInput { s.NextToken = &v return s } -type ListImportsOutput struct { - _ struct{} `type:"structure"` +// SetStackSetName sets the StackSetName field's value. +func (s *ListStackSetOperationsInput) SetStackSetName(v string) *ListStackSetOperationsInput { + s.StackSetName = &v + return s +} - // A list of stack names that are importing the specified exported output value. - Imports []*string `type:"list"` +type ListStackSetOperationsOutput struct { + _ struct{} `type:"structure"` - // A string that identifies the next page of exports. If there is no additional - // page, this value is null. + // If the request doesn't return all results, NextToken is set to a token. To + // retrieve the next set of results, call ListOperationResults again and assign + // that token to the request object's NextToken parameter. If there are no remaining + // results, NextToken is set to null. NextToken *string `min:"1" type:"string"` + + // A list of StackSetOperationSummary structures that contain summary information + // about operations for the specified stack set. + Summaries []*StackSetOperationSummary `type:"list"` } // String returns the string representation -func (s ListImportsOutput) String() string { +func (s ListStackSetOperationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListImportsOutput) GoString() string { +func (s ListStackSetOperationsOutput) GoString() string { return s.String() } -// SetImports sets the Imports field's value. -func (s *ListImportsOutput) SetImports(v []*string) *ListImportsOutput { - s.Imports = v +// SetNextToken sets the NextToken field's value. +func (s *ListStackSetOperationsOutput) SetNextToken(v string) *ListStackSetOperationsOutput { + s.NextToken = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListImportsOutput) SetNextToken(v string) *ListImportsOutput { - s.NextToken = &v +// SetSummaries sets the Summaries field's value. +func (s *ListStackSetOperationsOutput) SetSummaries(v []*StackSetOperationSummary) *ListStackSetOperationsOutput { + s.Summaries = v return s } -type ListStackInstancesInput struct { +type ListStackSetsInput struct { _ struct{} `type:"structure"` // The maximum number of results to be returned with a single call. If the number // of available results exceeds this maximum, the response includes a NextToken - // value that you can assign to the NextToken request parameter to get the next - // set of results. - MaxResults *int64 `min:"1" type:"integer"` - - // If the previous request didn't return all of the remaining results, the response's - // NextToken parameter value is set to a token. To retrieve the next set of - // results, call ListStackInstances again and assign that token to the request - // object's NextToken parameter. If there are no remaining results, the previous - // response object's NextToken parameter is set to null. - NextToken *string `min:"1" type:"string"` - - // The name of the AWS account that you want to list stack instances for. - StackInstanceAccount *string `type:"string"` + // value that you can assign to the NextToken request parameter to get the next + // set of results. + MaxResults *int64 `min:"1" type:"integer"` - // The name of the region where you want to list stack instances. - StackInstanceRegion *string `type:"string"` + // If the previous paginated request didn't return all of the remaining results, + // the response object's NextToken parameter value is set to a token. To retrieve + // the next set of results, call ListStackSets again and assign that token to + // the request object's NextToken parameter. If there are no remaining results, + // the previous response object's NextToken parameter is set to null. + NextToken *string `min:"1" type:"string"` - // The name or unique ID of the stack set that you want to list stack instances - // for. - // - // StackSetName is a required field - StackSetName *string `type:"string" required:"true"` + // The status of the stack sets that you want to get summary information about. + Status *string `type:"string" enum:"StackSetStatus"` } // String returns the string representation -func (s ListStackInstancesInput) String() string { +func (s ListStackSetsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackInstancesInput) GoString() string { +func (s ListStackSetsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListStackInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStackInstancesInput"} +func (s *ListStackSetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListStackSetsInput"} if s.MaxResults != nil && *s.MaxResults < 1 { invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if s.NextToken != nil && len(*s.NextToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } - if s.StackSetName == nil { - invalidParams.Add(request.NewErrParamRequired("StackSetName")) - } if invalidParams.Len() > 0 { return invalidParams @@ -8465,36 +10573,24 @@ func (s *ListStackInstancesInput) Validate() error { } // SetMaxResults sets the MaxResults field's value. -func (s *ListStackInstancesInput) SetMaxResults(v int64) *ListStackInstancesInput { +func (s *ListStackSetsInput) SetMaxResults(v int64) *ListStackSetsInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *ListStackInstancesInput) SetNextToken(v string) *ListStackInstancesInput { +func (s *ListStackSetsInput) SetNextToken(v string) *ListStackSetsInput { s.NextToken = &v return s } -// SetStackInstanceAccount sets the StackInstanceAccount field's value. -func (s *ListStackInstancesInput) SetStackInstanceAccount(v string) *ListStackInstancesInput { - s.StackInstanceAccount = &v - return s -} - -// SetStackInstanceRegion sets the StackInstanceRegion field's value. -func (s *ListStackInstancesInput) SetStackInstanceRegion(v string) *ListStackInstancesInput { - s.StackInstanceRegion = &v - return s -} - -// SetStackSetName sets the StackSetName field's value. -func (s *ListStackInstancesInput) SetStackSetName(v string) *ListStackInstancesInput { - s.StackSetName = &v +// SetStatus sets the Status field's value. +func (s *ListStackSetsInput) SetStatus(v string) *ListStackSetsInput { + s.Status = &v return s } -type ListStackInstancesOutput struct { +type ListStackSetsOutput struct { _ struct{} `type:"structure"` // If the request doesn't return all of the remaining results, NextToken is @@ -8503,74 +10599,62 @@ type ListStackInstancesOutput struct { // If the request returns all results, NextToken is set to null. NextToken *string `min:"1" type:"string"` - // A list of StackInstanceSummary structures that contain information about - // the specified stack instances. - Summaries []*StackInstanceSummary `type:"list"` + // A list of StackSetSummary structures that contain information about the user's + // stack sets. + Summaries []*StackSetSummary `type:"list"` } // String returns the string representation -func (s ListStackInstancesOutput) String() string { +func (s ListStackSetsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackInstancesOutput) GoString() string { +func (s ListStackSetsOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListStackInstancesOutput) SetNextToken(v string) *ListStackInstancesOutput { +func (s *ListStackSetsOutput) SetNextToken(v string) *ListStackSetsOutput { s.NextToken = &v return s } // SetSummaries sets the Summaries field's value. -func (s *ListStackInstancesOutput) SetSummaries(v []*StackInstanceSummary) *ListStackInstancesOutput { +func (s *ListStackSetsOutput) SetSummaries(v []*StackSetSummary) *ListStackSetsOutput { s.Summaries = v return s } -// The input for the ListStackResource action. -type ListStackResourcesInput struct { +// The input for ListStacks action. +type ListStacksInput struct { _ struct{} `type:"structure"` - // A string that identifies the next page of stack resources that you want to - // retrieve. + // A string that identifies the next page of stacks that you want to retrieve. NextToken *string `min:"1" type:"string"` - // The name or the unique stack ID that is associated with the stack, which - // are not always interchangeable: - // - // * Running stacks: You can specify either the stack's name or its unique - // stack ID. - // - // * Deleted stacks: You must specify the unique stack ID. - // - // Default: There is no default value. - // - // StackName is a required field - StackName *string `type:"string" required:"true"` + // Stack status to use as a filter. Specify one or more stack status codes to + // list only stacks with the specified status codes. For a complete list of + // stack status codes, see the StackStatus parameter of the Stack data type. + StackStatusFilter []*string `type:"list"` } // String returns the string representation -func (s ListStackResourcesInput) String() string { +func (s ListStacksInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackResourcesInput) GoString() string { +func (s ListStacksInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListStackResourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStackResourcesInput"} +func (s *ListStacksInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListStacksInput"} if s.NextToken != nil && len(*s.NextToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } - if s.StackName == nil { - invalidParams.Add(request.NewErrParamRequired("StackName")) - } if invalidParams.Len() > 0 { return invalidParams @@ -8579,52 +10663,53 @@ func (s *ListStackResourcesInput) Validate() error { } // SetNextToken sets the NextToken field's value. -func (s *ListStackResourcesInput) SetNextToken(v string) *ListStackResourcesInput { +func (s *ListStacksInput) SetNextToken(v string) *ListStacksInput { s.NextToken = &v return s } -// SetStackName sets the StackName field's value. -func (s *ListStackResourcesInput) SetStackName(v string) *ListStackResourcesInput { - s.StackName = &v +// SetStackStatusFilter sets the StackStatusFilter field's value. +func (s *ListStacksInput) SetStackStatusFilter(v []*string) *ListStacksInput { + s.StackStatusFilter = v return s } -// The output for a ListStackResources action. -type ListStackResourcesOutput struct { +// The output for ListStacks action. +type ListStacksOutput struct { _ struct{} `type:"structure"` - // If the output exceeds 1 MB, a string that identifies the next page of stack - // resources. If no additional page exists, this value is null. + // If the output exceeds 1 MB in size, a string that identifies the next page + // of stacks. If no additional page exists, this value is null. NextToken *string `min:"1" type:"string"` - // A list of StackResourceSummary structures. - StackResourceSummaries []*StackResourceSummary `type:"list"` + // A list of StackSummary structures containing information about the specified + // stacks. + StackSummaries []*StackSummary `type:"list"` } // String returns the string representation -func (s ListStackResourcesOutput) String() string { +func (s ListStacksOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackResourcesOutput) GoString() string { +func (s ListStacksOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListStackResourcesOutput) SetNextToken(v string) *ListStackResourcesOutput { +func (s *ListStacksOutput) SetNextToken(v string) *ListStacksOutput { s.NextToken = &v return s } -// SetStackResourceSummaries sets the StackResourceSummaries field's value. -func (s *ListStackResourcesOutput) SetStackResourceSummaries(v []*StackResourceSummary) *ListStackResourcesOutput { - s.StackResourceSummaries = v +// SetStackSummaries sets the StackSummaries field's value. +func (s *ListStacksOutput) SetStackSummaries(v []*StackSummary) *ListStacksOutput { + s.StackSummaries = v return s } -type ListStackSetOperationResultsInput struct { +type ListTypeRegistrationsInput struct { _ struct{} `type:"structure"` // The maximum number of results to be returned with a single call. If the number @@ -8633,52 +10718,53 @@ type ListStackSetOperationResultsInput struct { // set of results. MaxResults *int64 `min:"1" type:"integer"` - // If the previous request didn't return all of the remaining results, the response - // object's NextToken parameter value is set to a token. To retrieve the next - // set of results, call ListStackSetOperationResults again and assign that token - // to the request object's NextToken parameter. If there are no remaining results, + // If the previous paginated request didn't return all of the remaining results, + // the response object's NextToken parameter value is set to a token. To retrieve + // the next set of results, call this action again and assign that token to + // the request object's NextToken parameter. If there are no remaining results, // the previous response object's NextToken parameter is set to null. NextToken *string `min:"1" type:"string"` - // The ID of the stack set operation. + // The current status of the type registration request. + RegistrationStatusFilter *string `type:"string" enum:"RegistrationStatus"` + + // The kind of type. // - // OperationId is a required field - OperationId *string `min:"1" type:"string" required:"true"` + // Currently the only valid value is RESOURCE. + Type *string `type:"string" enum:"RegistryType"` - // The name or unique ID of the stack set that you want to get operation results - // for. + // The Amazon Resource Name (ARN) of the type. // - // StackSetName is a required field - StackSetName *string `type:"string" required:"true"` + // Conditional: You must specify TypeName or Arn. + TypeArn *string `type:"string"` + + // The name of the type. + // + // Conditional: You must specify TypeName or Arn. + TypeName *string `min:"10" type:"string"` } // String returns the string representation -func (s ListStackSetOperationResultsInput) String() string { +func (s ListTypeRegistrationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackSetOperationResultsInput) GoString() string { +func (s ListTypeRegistrationsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListStackSetOperationResultsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStackSetOperationResultsInput"} +func (s *ListTypeRegistrationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTypeRegistrationsInput"} if s.MaxResults != nil && *s.MaxResults < 1 { invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if s.NextToken != nil && len(*s.NextToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } - if s.OperationId == nil { - invalidParams.Add(request.NewErrParamRequired("OperationId")) - } - if s.OperationId != nil && len(*s.OperationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) - } - if s.StackSetName == nil { - invalidParams.Add(request.NewErrParamRequired("StackSetName")) + if s.TypeName != nil && len(*s.TypeName) < 10 { + invalidParams.Add(request.NewErrParamMinLen("TypeName", 10)) } if invalidParams.Len() > 0 { @@ -8688,69 +10774,100 @@ func (s *ListStackSetOperationResultsInput) Validate() error { } // SetMaxResults sets the MaxResults field's value. -func (s *ListStackSetOperationResultsInput) SetMaxResults(v int64) *ListStackSetOperationResultsInput { +func (s *ListTypeRegistrationsInput) SetMaxResults(v int64) *ListTypeRegistrationsInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *ListStackSetOperationResultsInput) SetNextToken(v string) *ListStackSetOperationResultsInput { +func (s *ListTypeRegistrationsInput) SetNextToken(v string) *ListTypeRegistrationsInput { s.NextToken = &v return s } -// SetOperationId sets the OperationId field's value. -func (s *ListStackSetOperationResultsInput) SetOperationId(v string) *ListStackSetOperationResultsInput { - s.OperationId = &v +// SetRegistrationStatusFilter sets the RegistrationStatusFilter field's value. +func (s *ListTypeRegistrationsInput) SetRegistrationStatusFilter(v string) *ListTypeRegistrationsInput { + s.RegistrationStatusFilter = &v return s } -// SetStackSetName sets the StackSetName field's value. -func (s *ListStackSetOperationResultsInput) SetStackSetName(v string) *ListStackSetOperationResultsInput { - s.StackSetName = &v +// SetType sets the Type field's value. +func (s *ListTypeRegistrationsInput) SetType(v string) *ListTypeRegistrationsInput { + s.Type = &v return s } -type ListStackSetOperationResultsOutput struct { +// SetTypeArn sets the TypeArn field's value. +func (s *ListTypeRegistrationsInput) SetTypeArn(v string) *ListTypeRegistrationsInput { + s.TypeArn = &v + return s +} + +// SetTypeName sets the TypeName field's value. +func (s *ListTypeRegistrationsInput) SetTypeName(v string) *ListTypeRegistrationsInput { + s.TypeName = &v + return s +} + +type ListTypeRegistrationsOutput struct { _ struct{} `type:"structure"` - // If the request doesn't return all results, NextToken is set to a token. To - // retrieve the next set of results, call ListOperationResults again and assign - // that token to the request object's NextToken parameter. If there are no remaining - // results, NextToken is set to null. + // If the request doesn't return all of the remaining results, NextToken is + // set to a token. To retrieve the next set of results, call this action again + // and assign that token to the request object's NextToken parameter. If the + // request returns all results, NextToken is set to null. NextToken *string `min:"1" type:"string"` - // A list of StackSetOperationResultSummary structures that contain information - // about the specified operation results, for accounts and regions that are - // included in the operation. - Summaries []*StackSetOperationResultSummary `type:"list"` + // A list of type registration tokens. + // + // Use DescribeTypeRegistration to return detailed information about a type + // registration request. + RegistrationTokenList []*string `type:"list"` } // String returns the string representation -func (s ListStackSetOperationResultsOutput) String() string { +func (s ListTypeRegistrationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackSetOperationResultsOutput) GoString() string { +func (s ListTypeRegistrationsOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListStackSetOperationResultsOutput) SetNextToken(v string) *ListStackSetOperationResultsOutput { +func (s *ListTypeRegistrationsOutput) SetNextToken(v string) *ListTypeRegistrationsOutput { s.NextToken = &v return s } -// SetSummaries sets the Summaries field's value. -func (s *ListStackSetOperationResultsOutput) SetSummaries(v []*StackSetOperationResultSummary) *ListStackSetOperationResultsOutput { - s.Summaries = v +// SetRegistrationTokenList sets the RegistrationTokenList field's value. +func (s *ListTypeRegistrationsOutput) SetRegistrationTokenList(v []*string) *ListTypeRegistrationsOutput { + s.RegistrationTokenList = v return s } -type ListStackSetOperationsInput struct { +type ListTypeVersionsInput struct { _ struct{} `type:"structure"` + // The Amazon Resource Name (ARN) of the type for which you want version summary + // information. + // + // Conditional: You must specify TypeName or Arn. + Arn *string `type:"string"` + + // The deprecation status of the type versions that you want to get summary + // information about. + // + // Valid values include: + // + // * LIVE: The type version is registered and can be used in CloudFormation + // operations, dependent on its provisioning behavior and visibility scope. + // + // * DEPRECATED: The type version has been deregistered and can no longer + // be used in CloudFormation operations. + DeprecatedStatus *string `type:"string" enum:"DeprecatedStatus"` + // The maximum number of results to be returned with a single call. If the number // of available results exceeds this maximum, the response includes a NextToken // value that you can assign to the NextToken request parameter to get the next @@ -8759,39 +10876,43 @@ type ListStackSetOperationsInput struct { // If the previous paginated request didn't return all of the remaining results, // the response object's NextToken parameter value is set to a token. To retrieve - // the next set of results, call ListStackSetOperations again and assign that - // token to the request object's NextToken parameter. If there are no remaining - // results, the previous response object's NextToken parameter is set to null. + // the next set of results, call this action again and assign that token to + // the request object's NextToken parameter. If there are no remaining results, + // the previous response object's NextToken parameter is set to null. NextToken *string `min:"1" type:"string"` - // The name or unique ID of the stack set that you want to get operation summaries - // for. + // The kind of the type. // - // StackSetName is a required field - StackSetName *string `type:"string" required:"true"` + // Currently the only valid value is RESOURCE. + Type *string `type:"string" enum:"RegistryType"` + + // The name of the type for which you want version summary information. + // + // Conditional: You must specify TypeName or Arn. + TypeName *string `min:"10" type:"string"` } // String returns the string representation -func (s ListStackSetOperationsInput) String() string { +func (s ListTypeVersionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackSetOperationsInput) GoString() string { +func (s ListTypeVersionsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListStackSetOperationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStackSetOperationsInput"} +func (s *ListTypeVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTypeVersionsInput"} if s.MaxResults != nil && *s.MaxResults < 1 { invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if s.NextToken != nil && len(*s.NextToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } - if s.StackSetName == nil { - invalidParams.Add(request.NewErrParamRequired("StackSetName")) + if s.TypeName != nil && len(*s.TypeName) < 10 { + invalidParams.Add(request.NewErrParamMinLen("TypeName", 10)) } if invalidParams.Len() > 0 { @@ -8800,63 +10921,92 @@ func (s *ListStackSetOperationsInput) Validate() error { return nil } +// SetArn sets the Arn field's value. +func (s *ListTypeVersionsInput) SetArn(v string) *ListTypeVersionsInput { + s.Arn = &v + return s +} + +// SetDeprecatedStatus sets the DeprecatedStatus field's value. +func (s *ListTypeVersionsInput) SetDeprecatedStatus(v string) *ListTypeVersionsInput { + s.DeprecatedStatus = &v + return s +} + // SetMaxResults sets the MaxResults field's value. -func (s *ListStackSetOperationsInput) SetMaxResults(v int64) *ListStackSetOperationsInput { +func (s *ListTypeVersionsInput) SetMaxResults(v int64) *ListTypeVersionsInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *ListStackSetOperationsInput) SetNextToken(v string) *ListStackSetOperationsInput { +func (s *ListTypeVersionsInput) SetNextToken(v string) *ListTypeVersionsInput { s.NextToken = &v return s } -// SetStackSetName sets the StackSetName field's value. -func (s *ListStackSetOperationsInput) SetStackSetName(v string) *ListStackSetOperationsInput { - s.StackSetName = &v +// SetType sets the Type field's value. +func (s *ListTypeVersionsInput) SetType(v string) *ListTypeVersionsInput { + s.Type = &v return s } -type ListStackSetOperationsOutput struct { +// SetTypeName sets the TypeName field's value. +func (s *ListTypeVersionsInput) SetTypeName(v string) *ListTypeVersionsInput { + s.TypeName = &v + return s +} + +type ListTypeVersionsOutput struct { _ struct{} `type:"structure"` - // If the request doesn't return all results, NextToken is set to a token. To - // retrieve the next set of results, call ListOperationResults again and assign - // that token to the request object's NextToken parameter. If there are no remaining - // results, NextToken is set to null. + // If the request doesn't return all of the remaining results, NextToken is + // set to a token. To retrieve the next set of results, call this action again + // and assign that token to the request object's NextToken parameter. If the + // request returns all results, NextToken is set to null. NextToken *string `min:"1" type:"string"` - // A list of StackSetOperationSummary structures that contain summary information - // about operations for the specified stack set. - Summaries []*StackSetOperationSummary `type:"list"` + // A list of TypeVersionSummary structures that contain information about the + // specified type's versions. + TypeVersionSummaries []*TypeVersionSummary `type:"list"` } // String returns the string representation -func (s ListStackSetOperationsOutput) String() string { +func (s ListTypeVersionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackSetOperationsOutput) GoString() string { +func (s ListTypeVersionsOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListStackSetOperationsOutput) SetNextToken(v string) *ListStackSetOperationsOutput { +func (s *ListTypeVersionsOutput) SetNextToken(v string) *ListTypeVersionsOutput { s.NextToken = &v return s } -// SetSummaries sets the Summaries field's value. -func (s *ListStackSetOperationsOutput) SetSummaries(v []*StackSetOperationSummary) *ListStackSetOperationsOutput { - s.Summaries = v +// SetTypeVersionSummaries sets the TypeVersionSummaries field's value. +func (s *ListTypeVersionsOutput) SetTypeVersionSummaries(v []*TypeVersionSummary) *ListTypeVersionsOutput { + s.TypeVersionSummaries = v return s } -type ListStackSetsInput struct { +type ListTypesInput struct { _ struct{} `type:"structure"` + // The deprecation status of the types that you want to get summary information + // about. + // + // Valid values include: + // + // * LIVE: The type is registered for use in CloudFormation operations. + // + // * DEPRECATED: The type has been deregistered and can no longer be used + // in CloudFormation operations. + DeprecatedStatus *string `type:"string" enum:"DeprecatedStatus"` + // The maximum number of results to be returned with a single call. If the number // of available results exceeds this maximum, the response includes a NextToken // value that you can assign to the NextToken request parameter to get the next @@ -8865,28 +11015,53 @@ type ListStackSetsInput struct { // If the previous paginated request didn't return all of the remaining results, // the response object's NextToken parameter value is set to a token. To retrieve - // the next set of results, call ListStackSets again and assign that token to + // the next set of results, call this action again and assign that token to // the request object's NextToken parameter. If there are no remaining results, // the previous response object's NextToken parameter is set to null. NextToken *string `min:"1" type:"string"` - // The status of the stack sets that you want to get summary information about. - Status *string `type:"string" enum:"StackSetStatus"` + // The provisioning behavior of the type. AWS CloudFormation determines the + // provisioning type during registration, based on the types of handlers in + // the schema handler package submitted. + // + // Valid values include: + // + // * FULLY_MUTABLE: The type includes an update handler to process updates + // to the type during stack update operations. + // + // * IMMUTABLE: The type does not include an update handler, so the type + // cannot be updated and must instead be replaced during stack update operations. + // + // * NON_PROVISIONABLE: The type does not include create, read, and delete + // handlers, and therefore cannot actually be provisioned. + ProvisioningType *string `type:"string" enum:"ProvisioningType"` + + // The scope at which the type is visible and usable in CloudFormation operations. + // + // Valid values include: + // + // * PRIVATE: The type is only visible and usable within the account in which + // it is registered. Currently, AWS CloudFormation marks any types you create + // as PRIVATE. + // + // * PUBLIC: The type is publically visible and usable within any Amazon + // account. + Visibility *string `type:"string" enum:"Visibility"` } // String returns the string representation -func (s ListStackSetsInput) String() string { +func (s ListTypesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackSetsInput) GoString() string { +func (s ListTypesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListStackSetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStackSetsInput"} +func (s *ListTypesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTypesInput"} if s.MaxResults != nil && *s.MaxResults < 1 { invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } @@ -8900,88 +11075,113 @@ func (s *ListStackSetsInput) Validate() error { return nil } +// SetDeprecatedStatus sets the DeprecatedStatus field's value. +func (s *ListTypesInput) SetDeprecatedStatus(v string) *ListTypesInput { + s.DeprecatedStatus = &v + return s +} + // SetMaxResults sets the MaxResults field's value. -func (s *ListStackSetsInput) SetMaxResults(v int64) *ListStackSetsInput { +func (s *ListTypesInput) SetMaxResults(v int64) *ListTypesInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *ListStackSetsInput) SetNextToken(v string) *ListStackSetsInput { +func (s *ListTypesInput) SetNextToken(v string) *ListTypesInput { s.NextToken = &v return s } -// SetStatus sets the Status field's value. -func (s *ListStackSetsInput) SetStatus(v string) *ListStackSetsInput { - s.Status = &v +// SetProvisioningType sets the ProvisioningType field's value. +func (s *ListTypesInput) SetProvisioningType(v string) *ListTypesInput { + s.ProvisioningType = &v return s } -type ListStackSetsOutput struct { +// SetVisibility sets the Visibility field's value. +func (s *ListTypesInput) SetVisibility(v string) *ListTypesInput { + s.Visibility = &v + return s +} + +type ListTypesOutput struct { _ struct{} `type:"structure"` // If the request doesn't return all of the remaining results, NextToken is - // set to a token. To retrieve the next set of results, call ListStackInstances - // again and assign that token to the request object's NextToken parameter. - // If the request returns all results, NextToken is set to null. + // set to a token. To retrieve the next set of results, call this action again + // and assign that token to the request object's NextToken parameter. If the + // request returns all results, NextToken is set to null. NextToken *string `min:"1" type:"string"` - // A list of StackSetSummary structures that contain information about the user's - // stack sets. - Summaries []*StackSetSummary `type:"list"` + // A list of TypeSummary structures that contain information about the specified + // types. + TypeSummaries []*TypeSummary `type:"list"` } // String returns the string representation -func (s ListStackSetsOutput) String() string { +func (s ListTypesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackSetsOutput) GoString() string { +func (s ListTypesOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListStackSetsOutput) SetNextToken(v string) *ListStackSetsOutput { +func (s *ListTypesOutput) SetNextToken(v string) *ListTypesOutput { s.NextToken = &v return s } -// SetSummaries sets the Summaries field's value. -func (s *ListStackSetsOutput) SetSummaries(v []*StackSetSummary) *ListStackSetsOutput { - s.Summaries = v +// SetTypeSummaries sets the TypeSummaries field's value. +func (s *ListTypesOutput) SetTypeSummaries(v []*TypeSummary) *ListTypesOutput { + s.TypeSummaries = v return s } -// The input for ListStacks action. -type ListStacksInput struct { +// Contains logging configuration information for a type. +type LoggingConfig struct { _ struct{} `type:"structure"` - // A string that identifies the next page of stacks that you want to retrieve. - NextToken *string `min:"1" type:"string"` + // The Amazon CloudWatch log group to which CloudFormation sends error logging + // information when invoking the type's handlers. + // + // LogGroupName is a required field + LogGroupName *string `min:"1" type:"string" required:"true"` - // Stack status to use as a filter. Specify one or more stack status codes to - // list only stacks with the specified status codes. For a complete list of - // stack status codes, see the StackStatus parameter of the Stack data type. - StackStatusFilter []*string `type:"list"` + // The ARN of the role that CloudFormation should assume when sending log entries + // to CloudWatch logs. + // + // LogRoleArn is a required field + LogRoleArn *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s ListStacksInput) String() string { +func (s LoggingConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStacksInput) GoString() string { +func (s LoggingConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListStacksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStacksInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) +func (s *LoggingConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LoggingConfig"} + if s.LogGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("LogGroupName")) + } + if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) + } + if s.LogRoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("LogRoleArn")) + } + if s.LogRoleArn != nil && len(*s.LogRoleArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LogRoleArn", 1)) } if invalidParams.Len() > 0 { @@ -8990,50 +11190,15 @@ func (s *ListStacksInput) Validate() error { return nil } -// SetNextToken sets the NextToken field's value. -func (s *ListStacksInput) SetNextToken(v string) *ListStacksInput { - s.NextToken = &v - return s -} - -// SetStackStatusFilter sets the StackStatusFilter field's value. -func (s *ListStacksInput) SetStackStatusFilter(v []*string) *ListStacksInput { - s.StackStatusFilter = v - return s -} - -// The output for ListStacks action. -type ListStacksOutput struct { - _ struct{} `type:"structure"` - - // If the output exceeds 1 MB in size, a string that identifies the next page - // of stacks. If no additional page exists, this value is null. - NextToken *string `min:"1" type:"string"` - - // A list of StackSummary structures containing information about the specified - // stacks. - StackSummaries []*StackSummary `type:"list"` -} - -// String returns the string representation -func (s ListStacksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListStacksOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListStacksOutput) SetNextToken(v string) *ListStacksOutput { - s.NextToken = &v +// SetLogGroupName sets the LogGroupName field's value. +func (s *LoggingConfig) SetLogGroupName(v string) *LoggingConfig { + s.LogGroupName = &v return s } -// SetStackSummaries sets the StackSummaries field's value. -func (s *ListStacksOutput) SetStackSummaries(v []*StackSummary) *ListStacksOutput { - s.StackSummaries = v +// SetLogRoleArn sets the LogRoleArn field's value. +func (s *LoggingConfig) SetLogRoleArn(v string) *LoggingConfig { + s.LogRoleArn = &v return s } @@ -9261,97 +11426,381 @@ type PhysicalResourceIdContextKeyValuePair struct { } // String returns the string representation -func (s PhysicalResourceIdContextKeyValuePair) String() string { +func (s PhysicalResourceIdContextKeyValuePair) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PhysicalResourceIdContextKeyValuePair) GoString() string { + return s.String() +} + +// SetKey sets the Key field's value. +func (s *PhysicalResourceIdContextKeyValuePair) SetKey(v string) *PhysicalResourceIdContextKeyValuePair { + s.Key = &v + return s +} + +// SetValue sets the Value field's value. +func (s *PhysicalResourceIdContextKeyValuePair) SetValue(v string) *PhysicalResourceIdContextKeyValuePair { + s.Value = &v + return s +} + +// Information about a resource property whose actual value differs from its +// expected value, as defined in the stack template and any values specified +// as template parameters. These will be present only for resources whose StackResourceDriftStatus +// is MODIFIED. For more information, see Detecting Unregulated Configuration +// Changes to Stacks and Resources (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html). +type PropertyDifference struct { + _ struct{} `type:"structure"` + + // The actual property value of the resource property. + // + // ActualValue is a required field + ActualValue *string `type:"string" required:"true"` + + // The type of property difference. + // + // * ADD: A value has been added to a resource property that is an array + // or list data type. + // + // * REMOVE: The property has been removed from the current resource configuration. + // + // * NOT_EQUAL: The current property value differs from its expected value + // (as defined in the stack template and any values specified as template + // parameters). + // + // DifferenceType is a required field + DifferenceType *string `type:"string" required:"true" enum:"DifferenceType"` + + // The expected property value of the resource property, as defined in the stack + // template and any values specified as template parameters. + // + // ExpectedValue is a required field + ExpectedValue *string `type:"string" required:"true"` + + // The fully-qualified path to the resource property. + // + // PropertyPath is a required field + PropertyPath *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s PropertyDifference) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PropertyDifference) GoString() string { + return s.String() +} + +// SetActualValue sets the ActualValue field's value. +func (s *PropertyDifference) SetActualValue(v string) *PropertyDifference { + s.ActualValue = &v + return s +} + +// SetDifferenceType sets the DifferenceType field's value. +func (s *PropertyDifference) SetDifferenceType(v string) *PropertyDifference { + s.DifferenceType = &v + return s +} + +// SetExpectedValue sets the ExpectedValue field's value. +func (s *PropertyDifference) SetExpectedValue(v string) *PropertyDifference { + s.ExpectedValue = &v + return s +} + +// SetPropertyPath sets the PropertyPath field's value. +func (s *PropertyDifference) SetPropertyPath(v string) *PropertyDifference { + s.PropertyPath = &v + return s +} + +type RecordHandlerProgressInput struct { + _ struct{} `type:"structure"` + + // Reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + // + // BearerToken is a required field + BearerToken *string `min:"1" type:"string" required:"true"` + + // Reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + ClientRequestToken *string `min:"1" type:"string"` + + // Reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + CurrentOperationStatus *string `type:"string" enum:"OperationStatus"` + + // Reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + ErrorCode *string `type:"string" enum:"HandlerErrorCode"` + + // Reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + // + // OperationStatus is a required field + OperationStatus *string `type:"string" required:"true" enum:"OperationStatus"` + + // Reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + ResourceModel *string `min:"1" type:"string"` + + // Reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + StatusMessage *string `type:"string"` +} + +// String returns the string representation +func (s RecordHandlerProgressInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RecordHandlerProgressInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RecordHandlerProgressInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RecordHandlerProgressInput"} + if s.BearerToken == nil { + invalidParams.Add(request.NewErrParamRequired("BearerToken")) + } + if s.BearerToken != nil && len(*s.BearerToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("BearerToken", 1)) + } + if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) + } + if s.OperationStatus == nil { + invalidParams.Add(request.NewErrParamRequired("OperationStatus")) + } + if s.ResourceModel != nil && len(*s.ResourceModel) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceModel", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBearerToken sets the BearerToken field's value. +func (s *RecordHandlerProgressInput) SetBearerToken(v string) *RecordHandlerProgressInput { + s.BearerToken = &v + return s +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *RecordHandlerProgressInput) SetClientRequestToken(v string) *RecordHandlerProgressInput { + s.ClientRequestToken = &v + return s +} + +// SetCurrentOperationStatus sets the CurrentOperationStatus field's value. +func (s *RecordHandlerProgressInput) SetCurrentOperationStatus(v string) *RecordHandlerProgressInput { + s.CurrentOperationStatus = &v + return s +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *RecordHandlerProgressInput) SetErrorCode(v string) *RecordHandlerProgressInput { + s.ErrorCode = &v + return s +} + +// SetOperationStatus sets the OperationStatus field's value. +func (s *RecordHandlerProgressInput) SetOperationStatus(v string) *RecordHandlerProgressInput { + s.OperationStatus = &v + return s +} + +// SetResourceModel sets the ResourceModel field's value. +func (s *RecordHandlerProgressInput) SetResourceModel(v string) *RecordHandlerProgressInput { + s.ResourceModel = &v + return s +} + +// SetStatusMessage sets the StatusMessage field's value. +func (s *RecordHandlerProgressInput) SetStatusMessage(v string) *RecordHandlerProgressInput { + s.StatusMessage = &v + return s +} + +type RecordHandlerProgressOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s RecordHandlerProgressOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PhysicalResourceIdContextKeyValuePair) GoString() string { +func (s RecordHandlerProgressOutput) GoString() string { return s.String() } -// SetKey sets the Key field's value. -func (s *PhysicalResourceIdContextKeyValuePair) SetKey(v string) *PhysicalResourceIdContextKeyValuePair { - s.Key = &v - return s -} +type RegisterTypeInput struct { + _ struct{} `type:"structure"` -// SetValue sets the Value field's value. -func (s *PhysicalResourceIdContextKeyValuePair) SetValue(v string) *PhysicalResourceIdContextKeyValuePair { - s.Value = &v - return s -} + // A unique identifier that acts as an idempotency key for this registration + // request. Specifying a client request token prevents CloudFormation from generating + // more than one version of a type from the same registeration request, even + // if the request is submitted multiple times. + ClientRequestToken *string `min:"1" type:"string"` -// Information about a resource property whose actual value differs from its -// expected value, as defined in the stack template and any values specified -// as template parameters. These will be present only for resources whose StackResourceDriftStatus -// is MODIFIED. For more information, see Detecting Unregulated Configuration -// Changes to Stacks and Resources (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html). -type PropertyDifference struct { - _ struct{} `type:"structure"` + // The Amazon Resource Name (ARN) of the IAM execution role to use to register + // the type. If your resource type calls AWS APIs in any of its handlers, you + // must create an IAM execution role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) + // that includes the necessary permissions to call those AWS APIs, and provision + // that execution role in your account. CloudFormation then assumes that execution + // role to provide your resource type with the appropriate credentials. + ExecutionRoleArn *string `min:"1" type:"string"` - // The actual property value of the resource property. + // Specifies logging configuration information for a type. + LoggingConfig *LoggingConfig `type:"structure"` + + // A url to the S3 bucket containing the schema handler package that contains + // the schema, event handlers, and associated files for the type you want to + // register. // - // ActualValue is a required field - ActualValue *string `type:"string" required:"true"` + // For information on generating a schema handler package for the type you want + // to register, see submit (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-cli-submit.html) + // in the CloudFormation CLI User Guide. + // + // SchemaHandlerPackage is a required field + SchemaHandlerPackage *string `min:"1" type:"string" required:"true"` - // The type of property difference. + // The kind of type. // - // * ADD: A value has been added to a resource property that is an array - // or list data type. + // Currently, the only valid value is RESOURCE. + Type *string `type:"string" enum:"RegistryType"` + + // The name of the type being registered. // - // * REMOVE: The property has been removed from the current resource configuration. + // We recommend that type names adhere to the following pattern: company_or_organization::service::type. // - // * NOT_EQUAL: The current property value differs from its expected value - // (as defined in the stack template and any values specified as template - // parameters). + // The following organization namespaces are reserved and cannot be used in + // your resource type names: // - // DifferenceType is a required field - DifferenceType *string `type:"string" required:"true" enum:"DifferenceType"` - - // The expected property value of the resource property, as defined in the stack - // template and any values specified as template parameters. + // * Alexa // - // ExpectedValue is a required field - ExpectedValue *string `type:"string" required:"true"` - - // The fully-qualified path to the resource property. + // * AMZN // - // PropertyPath is a required field - PropertyPath *string `type:"string" required:"true"` + // * Amazon + // + // * AWS + // + // * Custom + // + // * Dev + // + // TypeName is a required field + TypeName *string `min:"10" type:"string" required:"true"` } // String returns the string representation -func (s PropertyDifference) String() string { +func (s RegisterTypeInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PropertyDifference) GoString() string { +func (s RegisterTypeInput) GoString() string { return s.String() } -// SetActualValue sets the ActualValue field's value. -func (s *PropertyDifference) SetActualValue(v string) *PropertyDifference { - s.ActualValue = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *RegisterTypeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RegisterTypeInput"} + if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) + } + if s.ExecutionRoleArn != nil && len(*s.ExecutionRoleArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ExecutionRoleArn", 1)) + } + if s.SchemaHandlerPackage == nil { + invalidParams.Add(request.NewErrParamRequired("SchemaHandlerPackage")) + } + if s.SchemaHandlerPackage != nil && len(*s.SchemaHandlerPackage) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SchemaHandlerPackage", 1)) + } + if s.TypeName == nil { + invalidParams.Add(request.NewErrParamRequired("TypeName")) + } + if s.TypeName != nil && len(*s.TypeName) < 10 { + invalidParams.Add(request.NewErrParamMinLen("TypeName", 10)) + } + if s.LoggingConfig != nil { + if err := s.LoggingConfig.Validate(); err != nil { + invalidParams.AddNested("LoggingConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *RegisterTypeInput) SetClientRequestToken(v string) *RegisterTypeInput { + s.ClientRequestToken = &v return s } -// SetDifferenceType sets the DifferenceType field's value. -func (s *PropertyDifference) SetDifferenceType(v string) *PropertyDifference { - s.DifferenceType = &v +// SetExecutionRoleArn sets the ExecutionRoleArn field's value. +func (s *RegisterTypeInput) SetExecutionRoleArn(v string) *RegisterTypeInput { + s.ExecutionRoleArn = &v return s } -// SetExpectedValue sets the ExpectedValue field's value. -func (s *PropertyDifference) SetExpectedValue(v string) *PropertyDifference { - s.ExpectedValue = &v +// SetLoggingConfig sets the LoggingConfig field's value. +func (s *RegisterTypeInput) SetLoggingConfig(v *LoggingConfig) *RegisterTypeInput { + s.LoggingConfig = v return s } -// SetPropertyPath sets the PropertyPath field's value. -func (s *PropertyDifference) SetPropertyPath(v string) *PropertyDifference { - s.PropertyPath = &v +// SetSchemaHandlerPackage sets the SchemaHandlerPackage field's value. +func (s *RegisterTypeInput) SetSchemaHandlerPackage(v string) *RegisterTypeInput { + s.SchemaHandlerPackage = &v + return s +} + +// SetType sets the Type field's value. +func (s *RegisterTypeInput) SetType(v string) *RegisterTypeInput { + s.Type = &v + return s +} + +// SetTypeName sets the TypeName field's value. +func (s *RegisterTypeInput) SetTypeName(v string) *RegisterTypeInput { + s.TypeName = &v + return s +} + +type RegisterTypeOutput struct { + _ struct{} `type:"structure"` + + // The identifier for this registration request. + // + // Use this registration token when calling DescribeTypeRegistration , which + // returns information about the status and IDs of the type registration. + RegistrationToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s RegisterTypeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterTypeOutput) GoString() string { + return s.String() +} + +// SetRegistrationToken sets the RegistrationToken field's value. +func (s *RegisterTypeOutput) SetRegistrationToken(v string) *RegisterTypeOutput { + s.RegistrationToken = &v return s } @@ -9542,6 +11991,53 @@ func (s *ResourceChangeDetail) SetTarget(v *ResourceTargetDefinition) *ResourceC return s } +// Describes the target resources of a specific type in your import template +// (for example, all AWS::S3::Bucket resources) and the properties you can provide +// during the import to identify resources of that type. +type ResourceIdentifierSummary struct { + _ struct{} `type:"structure"` + + // The logical IDs of the target resources of the specified ResourceType, as + // defined in the import template. + LogicalResourceIds []*string `min:"1" type:"list"` + + // The resource properties you can provide during the import to identify your + // target resources. For example, BucketName is a possible identifier property + // for AWS::S3::Bucket resources. + ResourceIdentifiers []*string `type:"list"` + + // The template resource type of the target resources, such as AWS::S3::Bucket. + ResourceType *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ResourceIdentifierSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceIdentifierSummary) GoString() string { + return s.String() +} + +// SetLogicalResourceIds sets the LogicalResourceIds field's value. +func (s *ResourceIdentifierSummary) SetLogicalResourceIds(v []*string) *ResourceIdentifierSummary { + s.LogicalResourceIds = v + return s +} + +// SetResourceIdentifiers sets the ResourceIdentifiers field's value. +func (s *ResourceIdentifierSummary) SetResourceIdentifiers(v []*string) *ResourceIdentifierSummary { + s.ResourceIdentifiers = v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *ResourceIdentifierSummary) SetResourceType(v string) *ResourceIdentifierSummary { + s.ResourceType = &v + return s +} + // The field that AWS CloudFormation will change, such as the name of a resource's // property, and whether the resource will be recreated. type ResourceTargetDefinition struct { @@ -9591,6 +12087,81 @@ func (s *ResourceTargetDefinition) SetRequiresRecreation(v string) *ResourceTarg return s } +// Describes the target resource of an import operation. +type ResourceToImport struct { + _ struct{} `type:"structure"` + + // The logical ID of the target resource as specified in the template. + // + // LogicalResourceId is a required field + LogicalResourceId *string `type:"string" required:"true"` + + // A key-value pair that identifies the target resource. The key is an identifier + // property (for example, BucketName for AWS::S3::Bucket resources) and the + // value is the actual property value (for example, MyS3Bucket). + // + // ResourceIdentifier is a required field + ResourceIdentifier map[string]*string `min:"1" type:"map" required:"true"` + + // The type of resource to import into your stack, such as AWS::S3::Bucket. + // + // ResourceType is a required field + ResourceType *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ResourceToImport) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceToImport) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResourceToImport) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResourceToImport"} + if s.LogicalResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("LogicalResourceId")) + } + if s.ResourceIdentifier == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceIdentifier")) + } + if s.ResourceIdentifier != nil && len(s.ResourceIdentifier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceIdentifier", 1)) + } + if s.ResourceType == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceType")) + } + if s.ResourceType != nil && len(*s.ResourceType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceType", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLogicalResourceId sets the LogicalResourceId field's value. +func (s *ResourceToImport) SetLogicalResourceId(v string) *ResourceToImport { + s.LogicalResourceId = &v + return s +} + +// SetResourceIdentifier sets the ResourceIdentifier field's value. +func (s *ResourceToImport) SetResourceIdentifier(v map[string]*string) *ResourceToImport { + s.ResourceIdentifier = v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *ResourceToImport) SetResourceType(v string) *ResourceToImport { + s.ResourceType = &v + return s +} + // Structure containing the rollback triggers for AWS CloudFormation to monitor // during stack creation and updating operations, and for the specified monitoring // period afterwards. @@ -9833,6 +12404,93 @@ func (s SetStackPolicyOutput) GoString() string { return s.String() } +type SetTypeDefaultVersionInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the type for which you want version summary + // information. + // + // Conditional: You must specify TypeName or Arn. + Arn *string `type:"string"` + + // The kind of type. + Type *string `type:"string" enum:"RegistryType"` + + // The name of the type. + // + // Conditional: You must specify TypeName or Arn. + TypeName *string `min:"10" type:"string"` + + // The ID of a specific version of the type. The version ID is the value at + // the end of the Amazon Resource Name (ARN) assigned to the type version when + // it is registered. + VersionId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s SetTypeDefaultVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetTypeDefaultVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetTypeDefaultVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SetTypeDefaultVersionInput"} + if s.TypeName != nil && len(*s.TypeName) < 10 { + invalidParams.Add(request.NewErrParamMinLen("TypeName", 10)) + } + if s.VersionId != nil && len(*s.VersionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VersionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *SetTypeDefaultVersionInput) SetArn(v string) *SetTypeDefaultVersionInput { + s.Arn = &v + return s +} + +// SetType sets the Type field's value. +func (s *SetTypeDefaultVersionInput) SetType(v string) *SetTypeDefaultVersionInput { + s.Type = &v + return s +} + +// SetTypeName sets the TypeName field's value. +func (s *SetTypeDefaultVersionInput) SetTypeName(v string) *SetTypeDefaultVersionInput { + s.TypeName = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *SetTypeDefaultVersionInput) SetVersionId(v string) *SetTypeDefaultVersionInput { + s.VersionId = &v + return s +} + +type SetTypeDefaultVersionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s SetTypeDefaultVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetTypeDefaultVersionOutput) GoString() string { + return s.String() +} + // The input for the SignalResource action. type SignalResourceInput struct { _ struct{} `type:"structure"` @@ -10014,7 +12672,7 @@ type Stack struct { RollbackConfiguration *RollbackConfiguration `type:"structure"` // For nested stacks--stacks created as resources for another stack--the stack - // ID of the the top-level stack to which the nested stack ultimately belongs. + // ID of the top-level stack to which the nested stack ultimately belongs. // // For more information, see Working with Nested Stacks (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html) // in the AWS CloudFormation User Guide. @@ -10438,6 +13096,28 @@ type StackInstance struct { // The name of the AWS account that the stack instance is associated with. Account *string `type:"string"` + // Status of the stack instance's actual configuration compared to the expected + // template and parameter configuration of the stack set to which it belongs. + // + // * DRIFTED: The stack differs from the expected template and parameter + // configuration of the stack set to which it belongs. A stack instance is + // considered to have drifted if one or more of the resources in the associated + // stack have drifted. + // + // * NOT_CHECKED: AWS CloudFormation has not checked if the stack instance + // differs from its expected stack set configuration. + // + // * IN_SYNC: The stack instance's actual configuration matches its expected + // stack set configuration. + // + // * UNKNOWN: This value is reserved for future use. + DriftStatus *string `type:"string" enum:"StackDriftStatus"` + + // Most recent time when CloudFormation performed a drift detection operation + // on the stack instance. This value will be NULL for any stack instance on + // which drift detection has not yet been performed. + LastDriftCheckTimestamp *time.Time `type:"timestamp"` + // A list of parameters from the stack set template whose values have been overridden // in this stack instance. ParameterOverrides []*Parameter `type:"list"` @@ -10484,9 +13164,21 @@ func (s StackInstance) GoString() string { return s.String() } -// SetAccount sets the Account field's value. -func (s *StackInstance) SetAccount(v string) *StackInstance { - s.Account = &v +// SetAccount sets the Account field's value. +func (s *StackInstance) SetAccount(v string) *StackInstance { + s.Account = &v + return s +} + +// SetDriftStatus sets the DriftStatus field's value. +func (s *StackInstance) SetDriftStatus(v string) *StackInstance { + s.DriftStatus = &v + return s +} + +// SetLastDriftCheckTimestamp sets the LastDriftCheckTimestamp field's value. +func (s *StackInstance) SetLastDriftCheckTimestamp(v time.Time) *StackInstance { + s.LastDriftCheckTimestamp = &v return s } @@ -10533,6 +13225,28 @@ type StackInstanceSummary struct { // The name of the AWS account that the stack instance is associated with. Account *string `type:"string"` + // Status of the stack instance's actual configuration compared to the expected + // template and parameter configuration of the stack set to which it belongs. + // + // * DRIFTED: The stack differs from the expected template and parameter + // configuration of the stack set to which it belongs. A stack instance is + // considered to have drifted if one or more of the resources in the associated + // stack have drifted. + // + // * NOT_CHECKED: AWS CloudFormation has not checked if the stack instance + // differs from its expected stack set configuration. + // + // * IN_SYNC: The stack instance's actual configuration matches its expected + // stack set configuration. + // + // * UNKNOWN: This value is reserved for future use. + DriftStatus *string `type:"string" enum:"StackDriftStatus"` + + // Most recent time when CloudFormation performed a drift detection operation + // on the stack instance. This value will be NULL for any stack instance on + // which drift detection has not yet been performed. + LastDriftCheckTimestamp *time.Time `type:"timestamp"` + // The name of the AWS region that the stack instance is associated with. Region *string `type:"string"` @@ -10580,6 +13294,18 @@ func (s *StackInstanceSummary) SetAccount(v string) *StackInstanceSummary { return s } +// SetDriftStatus sets the DriftStatus field's value. +func (s *StackInstanceSummary) SetDriftStatus(v string) *StackInstanceSummary { + s.DriftStatus = &v + return s +} + +// SetLastDriftCheckTimestamp sets the LastDriftCheckTimestamp field's value. +func (s *StackInstanceSummary) SetLastDriftCheckTimestamp(v time.Time) *StackInstanceSummary { + s.LastDriftCheckTimestamp = &v + return s +} + // SetRegion sets the Region field's value. func (s *StackInstanceSummary) SetRegion(v string) *StackInstanceSummary { s.Region = &v @@ -11246,6 +13972,13 @@ type StackSet struct { // The Amazon Resource Number (ARN) of the stack set. StackSetARN *string `type:"string"` + // Detailed information about the drift status of the stack set. + // + // For stack sets, contains information about the last completed drift operation + // performed on the stack set. Information about drift operations currently + // in progress is not included. + StackSetDriftDetectionDetails *StackSetDriftDetectionDetails `type:"structure"` + // The ID of the stack set. StackSetId *string `type:"string"` @@ -11310,6 +14043,12 @@ func (s *StackSet) SetStackSetARN(v string) *StackSet { return s } +// SetStackSetDriftDetectionDetails sets the StackSetDriftDetectionDetails field's value. +func (s *StackSet) SetStackSetDriftDetectionDetails(v *StackSetDriftDetectionDetails) *StackSet { + s.StackSetDriftDetectionDetails = v + return s +} + // SetStackSetId sets the StackSetId field's value. func (s *StackSet) SetStackSetId(v string) *StackSet { s.StackSetId = &v @@ -11340,6 +14079,145 @@ func (s *StackSet) SetTemplateBody(v string) *StackSet { return s } +// Detailed information about the drift status of the stack set. +// +// For stack sets, contains information about the last completed drift operation +// performed on the stack set. Information about drift operations in-progress +// is not included. +// +// For stack set operations, includes information about drift operations currently +// being performed on the stack set. +// +// For more information, see Detecting Unmanaged Changes in Stack Sets (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html) +// in the AWS CloudFormation User Guide. +type StackSetDriftDetectionDetails struct { + _ struct{} `type:"structure"` + + // The status of the stack set drift detection operation. + // + // * COMPLETED: The drift detection operation completed without failing on + // any stack instances. + // + // * FAILED: The drift detection operation exceeded the specified failure + // tolerance. + // + // * PARTIAL_SUCCESS: The drift detection operation completed without exceeding + // the failure tolerance for the operation. + // + // * IN_PROGRESS: The drift detection operation is currently being performed. + // + // * STOPPED: The user has cancelled the drift detection operation. + DriftDetectionStatus *string `type:"string" enum:"StackSetDriftDetectionStatus"` + + // Status of the stack set's actual configuration compared to its expected template + // and parameter configuration. A stack set is considered to have drifted if + // one or more of its stack instances have drifted from their expected template + // and parameter configuration. + // + // * DRIFTED: One or more of the stack instances belonging to the stack set + // stack differs from the expected template and parameter configuration. + // A stack instance is considered to have drifted if one or more of the resources + // in the associated stack have drifted. + // + // * NOT_CHECKED: AWS CloudFormation has not checked the stack set for drift. + // + // * IN_SYNC: All of the stack instances belonging to the stack set stack + // match from the expected template and parameter configuration. + DriftStatus *string `type:"string" enum:"StackSetDriftStatus"` + + // The number of stack instances that have drifted from the expected template + // and parameter configuration of the stack set. A stack instance is considered + // to have drifted if one or more of the resources in the associated stack do + // not match their expected configuration. + DriftedStackInstancesCount *int64 `type:"integer"` + + // The number of stack instances for which the drift detection operation failed. + FailedStackInstancesCount *int64 `type:"integer"` + + // The number of stack instances that are currently being checked for drift. + InProgressStackInstancesCount *int64 `type:"integer"` + + // The number of stack instances which match the expected template and parameter + // configuration of the stack set. + InSyncStackInstancesCount *int64 `type:"integer"` + + // Most recent time when CloudFormation performed a drift detection operation + // on the stack set. This value will be NULL for any stack set on which drift + // detection has not yet been performed. + LastDriftCheckTimestamp *time.Time `type:"timestamp"` + + // The total number of stack instances belonging to this stack set. + // + // The total number of stack instances is equal to the total of: + // + // * Stack instances that match the stack set configuration. + // + // * Stack instances that have drifted from the stack set configuration. + // + // * Stack instances where the drift detection operation has failed. + // + // * Stack instances currently being checked for drift. + TotalStackInstancesCount *int64 `type:"integer"` +} + +// String returns the string representation +func (s StackSetDriftDetectionDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StackSetDriftDetectionDetails) GoString() string { + return s.String() +} + +// SetDriftDetectionStatus sets the DriftDetectionStatus field's value. +func (s *StackSetDriftDetectionDetails) SetDriftDetectionStatus(v string) *StackSetDriftDetectionDetails { + s.DriftDetectionStatus = &v + return s +} + +// SetDriftStatus sets the DriftStatus field's value. +func (s *StackSetDriftDetectionDetails) SetDriftStatus(v string) *StackSetDriftDetectionDetails { + s.DriftStatus = &v + return s +} + +// SetDriftedStackInstancesCount sets the DriftedStackInstancesCount field's value. +func (s *StackSetDriftDetectionDetails) SetDriftedStackInstancesCount(v int64) *StackSetDriftDetectionDetails { + s.DriftedStackInstancesCount = &v + return s +} + +// SetFailedStackInstancesCount sets the FailedStackInstancesCount field's value. +func (s *StackSetDriftDetectionDetails) SetFailedStackInstancesCount(v int64) *StackSetDriftDetectionDetails { + s.FailedStackInstancesCount = &v + return s +} + +// SetInProgressStackInstancesCount sets the InProgressStackInstancesCount field's value. +func (s *StackSetDriftDetectionDetails) SetInProgressStackInstancesCount(v int64) *StackSetDriftDetectionDetails { + s.InProgressStackInstancesCount = &v + return s +} + +// SetInSyncStackInstancesCount sets the InSyncStackInstancesCount field's value. +func (s *StackSetDriftDetectionDetails) SetInSyncStackInstancesCount(v int64) *StackSetDriftDetectionDetails { + s.InSyncStackInstancesCount = &v + return s +} + +// SetLastDriftCheckTimestamp sets the LastDriftCheckTimestamp field's value. +func (s *StackSetDriftDetectionDetails) SetLastDriftCheckTimestamp(v time.Time) *StackSetDriftDetectionDetails { + s.LastDriftCheckTimestamp = &v + return s +} + +// SetTotalStackInstancesCount sets the TotalStackInstancesCount field's value. +func (s *StackSetDriftDetectionDetails) SetTotalStackInstancesCount(v int64) *StackSetDriftDetectionDetails { + s.TotalStackInstancesCount = &v + return s +} + // The structure that contains information about a stack set operation. type StackSetOperation struct { _ struct{} `type:"structure"` @@ -11389,6 +14267,17 @@ type StackSetOperation struct { // stack to a new stack set. RetainStacks *bool `type:"boolean"` + // Detailed information about the drift status of the stack set. This includes + // information about drift operations currently being performed on the stack + // set. + // + // this information will only be present for stack set operations whose Action + // type is DETECT_DRIFT. + // + // For more information, see Detecting Unmanaged Changes in Stack Sets (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html) + // in the AWS CloudFormation User Guide. + StackSetDriftDetectionDetails *StackSetDriftDetectionDetails `type:"structure"` + // The ID of the stack set. StackSetId *string `type:"string"` @@ -11471,6 +14360,12 @@ func (s *StackSetOperation) SetRetainStacks(v bool) *StackSetOperation { return s } +// SetStackSetDriftDetectionDetails sets the StackSetDriftDetectionDetails field's value. +func (s *StackSetOperation) SetStackSetDriftDetectionDetails(v *StackSetDriftDetectionDetails) *StackSetOperation { + s.StackSetDriftDetectionDetails = v + return s +} + // SetStackSetId sets the StackSetId field's value. func (s *StackSetOperation) SetStackSetId(v string) *StackSetOperation { s.StackSetId = &v @@ -11775,6 +14670,29 @@ type StackSetSummary struct { // or updated. Description *string `min:"1" type:"string"` + // Status of the stack set's actual configuration compared to its expected template + // and parameter configuration. A stack set is considered to have drifted if + // one or more of its stack instances have drifted from their expected template + // and parameter configuration. + // + // * DRIFTED: One or more of the stack instances belonging to the stack set + // stack differs from the expected template and parameter configuration. + // A stack instance is considered to have drifted if one or more of the resources + // in the associated stack have drifted. + // + // * NOT_CHECKED: AWS CloudFormation has not checked the stack set for drift. + // + // * IN_SYNC: All of the stack instances belonging to the stack set stack + // match from the expected template and parameter configuration. + // + // * UNKNOWN: This value is reserved for future use. + DriftStatus *string `type:"string" enum:"StackDriftStatus"` + + // Most recent time when CloudFormation performed a drift detection operation + // on the stack set. This value will be NULL for any stack set on which drift + // detection has not yet been performed. + LastDriftCheckTimestamp *time.Time `type:"timestamp"` + // The ID of the stack set. StackSetId *string `type:"string"` @@ -11801,6 +14719,18 @@ func (s *StackSetSummary) SetDescription(v string) *StackSetSummary { return s } +// SetDriftStatus sets the DriftStatus field's value. +func (s *StackSetSummary) SetDriftStatus(v string) *StackSetSummary { + s.DriftStatus = &v + return s +} + +// SetLastDriftCheckTimestamp sets the LastDriftCheckTimestamp field's value. +func (s *StackSetSummary) SetLastDriftCheckTimestamp(v time.Time) *StackSetSummary { + s.LastDriftCheckTimestamp = &v + return s +} + // SetStackSetId sets the StackSetId field's value. func (s *StackSetSummary) SetStackSetId(v string) *StackSetSummary { s.StackSetId = &v @@ -11850,7 +14780,7 @@ type StackSummary struct { ParentId *string `type:"string"` // For nested stacks--stacks created as resources for another stack--the stack - // ID of the the top-level stack to which the nested stack ultimately belongs. + // ID of the top-level stack to which the nested stack ultimately belongs. // // For more information, see Working with Nested Stacks (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html) // in the AWS CloudFormation User Guide. @@ -12137,11 +15067,155 @@ func (s *TemplateParameter) SetParameterKey(v string) *TemplateParameter { return s } +// Contains summary information about the specified CloudFormation type. +type TypeSummary struct { + _ struct{} `type:"structure"` + + // The ID of the default version of the type. The default version is used when + // the type version is not specified. + // + // To set the default version of a type, use SetTypeDefaultVersion . + DefaultVersionId *string `min:"1" type:"string"` + + // The description of the type. + Description *string `min:"1" type:"string"` + + // When the current default version of the type was registered. + LastUpdated *time.Time `type:"timestamp"` + + // The kind of type. + Type *string `type:"string" enum:"RegistryType"` + + // The Amazon Resource Name (ARN) of the type. + TypeArn *string `type:"string"` + + // The name of the type. + TypeName *string `min:"10" type:"string"` +} + +// String returns the string representation +func (s TypeSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TypeSummary) GoString() string { + return s.String() +} + +// SetDefaultVersionId sets the DefaultVersionId field's value. +func (s *TypeSummary) SetDefaultVersionId(v string) *TypeSummary { + s.DefaultVersionId = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *TypeSummary) SetDescription(v string) *TypeSummary { + s.Description = &v + return s +} + +// SetLastUpdated sets the LastUpdated field's value. +func (s *TypeSummary) SetLastUpdated(v time.Time) *TypeSummary { + s.LastUpdated = &v + return s +} + +// SetType sets the Type field's value. +func (s *TypeSummary) SetType(v string) *TypeSummary { + s.Type = &v + return s +} + +// SetTypeArn sets the TypeArn field's value. +func (s *TypeSummary) SetTypeArn(v string) *TypeSummary { + s.TypeArn = &v + return s +} + +// SetTypeName sets the TypeName field's value. +func (s *TypeSummary) SetTypeName(v string) *TypeSummary { + s.TypeName = &v + return s +} + +// Contains summary information about a specific version of a CloudFormation +// type. +type TypeVersionSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the type version. + Arn *string `type:"string"` + + // The description of the type version. + Description *string `min:"1" type:"string"` + + // When the version was registered. + TimeCreated *time.Time `type:"timestamp"` + + // The kind of type. + Type *string `type:"string" enum:"RegistryType"` + + // The name of the type. + TypeName *string `min:"10" type:"string"` + + // The ID of a specific version of the type. The version ID is the value at + // the end of the Amazon Resource Name (ARN) assigned to the type version when + // it is registered. + VersionId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s TypeVersionSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TypeVersionSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *TypeVersionSummary) SetArn(v string) *TypeVersionSummary { + s.Arn = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *TypeVersionSummary) SetDescription(v string) *TypeVersionSummary { + s.Description = &v + return s +} + +// SetTimeCreated sets the TimeCreated field's value. +func (s *TypeVersionSummary) SetTimeCreated(v time.Time) *TypeVersionSummary { + s.TimeCreated = &v + return s +} + +// SetType sets the Type field's value. +func (s *TypeVersionSummary) SetType(v string) *TypeVersionSummary { + s.Type = &v + return s +} + +// SetTypeName sets the TypeName field's value. +func (s *TypeVersionSummary) SetTypeName(v string) *TypeVersionSummary { + s.TypeName = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *TypeVersionSummary) SetVersionId(v string) *TypeVersionSummary { + s.VersionId = &v + return s +} + // The input for an UpdateStack action. type UpdateStackInput struct { _ struct{} `type:"structure"` - // In some cases, you must explicity acknowledge that your stack template contains + // In some cases, you must explicitly acknowledge that your stack template contains // certain capabilities in order for AWS CloudFormation to update the stack. // // * CAPABILITY_IAM and CAPABILITY_NAMED_IAM Some stack templates might include @@ -12702,7 +15776,7 @@ type UpdateStackSetInput struct { // same customized administrator role used with this stack set previously. AdministrationRoleARN *string `min:"20" type:"string"` - // In some cases, you must explicity acknowledge that your stack template contains + // In some cases, you must explicitly acknowledge that your stack template contains // certain capabilities in order for AWS CloudFormation to update the stack // set and its associated stack instances. // @@ -13255,6 +16329,9 @@ const ( // ChangeActionRemove is a ChangeAction enum value ChangeActionRemove = "Remove" + + // ChangeActionImport is a ChangeAction enum value + ChangeActionImport = "Import" ) const ( @@ -13280,6 +16357,9 @@ const ( // ChangeSetTypeUpdate is a ChangeSetType enum value ChangeSetTypeUpdate = "UPDATE" + + // ChangeSetTypeImport is a ChangeSetType enum value + ChangeSetTypeImport = "IMPORT" ) const ( @@ -13304,6 +16384,14 @@ const ( ChangeTypeResource = "Resource" ) +const ( + // DeprecatedStatusLive is a DeprecatedStatus enum value + DeprecatedStatusLive = "LIVE" + + // DeprecatedStatusDeprecated is a DeprecatedStatus enum value + DeprecatedStatusDeprecated = "DEPRECATED" +) + const ( // DifferenceTypeAdd is a DifferenceType enum value DifferenceTypeAdd = "ADD" @@ -13343,6 +16431,50 @@ const ( ExecutionStatusObsolete = "OBSOLETE" ) +const ( + // HandlerErrorCodeNotUpdatable is a HandlerErrorCode enum value + HandlerErrorCodeNotUpdatable = "NotUpdatable" + + // HandlerErrorCodeInvalidRequest is a HandlerErrorCode enum value + HandlerErrorCodeInvalidRequest = "InvalidRequest" + + // HandlerErrorCodeAccessDenied is a HandlerErrorCode enum value + HandlerErrorCodeAccessDenied = "AccessDenied" + + // HandlerErrorCodeInvalidCredentials is a HandlerErrorCode enum value + HandlerErrorCodeInvalidCredentials = "InvalidCredentials" + + // HandlerErrorCodeAlreadyExists is a HandlerErrorCode enum value + HandlerErrorCodeAlreadyExists = "AlreadyExists" + + // HandlerErrorCodeNotFound is a HandlerErrorCode enum value + HandlerErrorCodeNotFound = "NotFound" + + // HandlerErrorCodeResourceConflict is a HandlerErrorCode enum value + HandlerErrorCodeResourceConflict = "ResourceConflict" + + // HandlerErrorCodeThrottling is a HandlerErrorCode enum value + HandlerErrorCodeThrottling = "Throttling" + + // HandlerErrorCodeServiceLimitExceeded is a HandlerErrorCode enum value + HandlerErrorCodeServiceLimitExceeded = "ServiceLimitExceeded" + + // HandlerErrorCodeNotStabilized is a HandlerErrorCode enum value + HandlerErrorCodeNotStabilized = "NotStabilized" + + // HandlerErrorCodeGeneralServiceException is a HandlerErrorCode enum value + HandlerErrorCodeGeneralServiceException = "GeneralServiceException" + + // HandlerErrorCodeServiceInternalError is a HandlerErrorCode enum value + HandlerErrorCodeServiceInternalError = "ServiceInternalError" + + // HandlerErrorCodeNetworkFailure is a HandlerErrorCode enum value + HandlerErrorCodeNetworkFailure = "NetworkFailure" + + // HandlerErrorCodeInternalFailure is a HandlerErrorCode enum value + HandlerErrorCodeInternalFailure = "InternalFailure" +) + const ( // OnFailureDoNothing is a OnFailure enum value OnFailureDoNothing = "DO_NOTHING" @@ -13354,6 +16486,47 @@ const ( OnFailureDelete = "DELETE" ) +const ( + // OperationStatusPending is a OperationStatus enum value + OperationStatusPending = "PENDING" + + // OperationStatusInProgress is a OperationStatus enum value + OperationStatusInProgress = "IN_PROGRESS" + + // OperationStatusSuccess is a OperationStatus enum value + OperationStatusSuccess = "SUCCESS" + + // OperationStatusFailed is a OperationStatus enum value + OperationStatusFailed = "FAILED" +) + +const ( + // ProvisioningTypeNonProvisionable is a ProvisioningType enum value + ProvisioningTypeNonProvisionable = "NON_PROVISIONABLE" + + // ProvisioningTypeImmutable is a ProvisioningType enum value + ProvisioningTypeImmutable = "IMMUTABLE" + + // ProvisioningTypeFullyMutable is a ProvisioningType enum value + ProvisioningTypeFullyMutable = "FULLY_MUTABLE" +) + +const ( + // RegistrationStatusComplete is a RegistrationStatus enum value + RegistrationStatusComplete = "COMPLETE" + + // RegistrationStatusInProgress is a RegistrationStatus enum value + RegistrationStatusInProgress = "IN_PROGRESS" + + // RegistrationStatusFailed is a RegistrationStatus enum value + RegistrationStatusFailed = "FAILED" +) + +const ( + // RegistryTypeResource is a RegistryType enum value + RegistryTypeResource = "RESOURCE" +) + const ( // ReplacementTrue is a Replacement enum value ReplacementTrue = "True" @@ -13434,6 +16607,24 @@ const ( // ResourceStatusUpdateComplete is a ResourceStatus enum value ResourceStatusUpdateComplete = "UPDATE_COMPLETE" + + // ResourceStatusImportFailed is a ResourceStatus enum value + ResourceStatusImportFailed = "IMPORT_FAILED" + + // ResourceStatusImportComplete is a ResourceStatus enum value + ResourceStatusImportComplete = "IMPORT_COMPLETE" + + // ResourceStatusImportInProgress is a ResourceStatus enum value + ResourceStatusImportInProgress = "IMPORT_IN_PROGRESS" + + // ResourceStatusImportRollbackInProgress is a ResourceStatus enum value + ResourceStatusImportRollbackInProgress = "IMPORT_ROLLBACK_IN_PROGRESS" + + // ResourceStatusImportRollbackFailed is a ResourceStatus enum value + ResourceStatusImportRollbackFailed = "IMPORT_ROLLBACK_FAILED" + + // ResourceStatusImportRollbackComplete is a ResourceStatus enum value + ResourceStatusImportRollbackComplete = "IMPORT_ROLLBACK_COMPLETE" ) const ( @@ -13486,6 +16677,34 @@ const ( StackResourceDriftStatusNotChecked = "NOT_CHECKED" ) +const ( + // StackSetDriftDetectionStatusCompleted is a StackSetDriftDetectionStatus enum value + StackSetDriftDetectionStatusCompleted = "COMPLETED" + + // StackSetDriftDetectionStatusFailed is a StackSetDriftDetectionStatus enum value + StackSetDriftDetectionStatusFailed = "FAILED" + + // StackSetDriftDetectionStatusPartialSuccess is a StackSetDriftDetectionStatus enum value + StackSetDriftDetectionStatusPartialSuccess = "PARTIAL_SUCCESS" + + // StackSetDriftDetectionStatusInProgress is a StackSetDriftDetectionStatus enum value + StackSetDriftDetectionStatusInProgress = "IN_PROGRESS" + + // StackSetDriftDetectionStatusStopped is a StackSetDriftDetectionStatus enum value + StackSetDriftDetectionStatusStopped = "STOPPED" +) + +const ( + // StackSetDriftStatusDrifted is a StackSetDriftStatus enum value + StackSetDriftStatusDrifted = "DRIFTED" + + // StackSetDriftStatusInSync is a StackSetDriftStatus enum value + StackSetDriftStatusInSync = "IN_SYNC" + + // StackSetDriftStatusNotChecked is a StackSetDriftStatus enum value + StackSetDriftStatusNotChecked = "NOT_CHECKED" +) + const ( // StackSetOperationActionCreate is a StackSetOperationAction enum value StackSetOperationActionCreate = "CREATE" @@ -13495,6 +16714,9 @@ const ( // StackSetOperationActionDelete is a StackSetOperationAction enum value StackSetOperationActionDelete = "DELETE" + + // StackSetOperationActionDetectDrift is a StackSetOperationAction enum value + StackSetOperationActionDetectDrift = "DETECT_DRIFT" ) const ( @@ -13590,6 +16812,21 @@ const ( // StackStatusReviewInProgress is a StackStatus enum value StackStatusReviewInProgress = "REVIEW_IN_PROGRESS" + + // StackStatusImportInProgress is a StackStatus enum value + StackStatusImportInProgress = "IMPORT_IN_PROGRESS" + + // StackStatusImportComplete is a StackStatus enum value + StackStatusImportComplete = "IMPORT_COMPLETE" + + // StackStatusImportRollbackInProgress is a StackStatus enum value + StackStatusImportRollbackInProgress = "IMPORT_ROLLBACK_IN_PROGRESS" + + // StackStatusImportRollbackFailed is a StackStatus enum value + StackStatusImportRollbackFailed = "IMPORT_ROLLBACK_FAILED" + + // StackStatusImportRollbackComplete is a StackStatus enum value + StackStatusImportRollbackComplete = "IMPORT_ROLLBACK_COMPLETE" ) const ( @@ -13599,3 +16836,11 @@ const ( // TemplateStageProcessed is a TemplateStage enum value TemplateStageProcessed = "Processed" ) + +const ( + // VisibilityPublic is a Visibility enum value + VisibilityPublic = "PUBLIC" + + // VisibilityPrivate is a Visibility enum value + VisibilityPrivate = "PRIVATE" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/cloudformationiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/cloudformationiface/interface.go index 55c72e50..f2953c38 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/cloudformationiface/interface.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/cloudformationiface/interface.go @@ -100,6 +100,10 @@ type CloudFormationAPI interface { DeleteStackSetWithContext(aws.Context, *cloudformation.DeleteStackSetInput, ...request.Option) (*cloudformation.DeleteStackSetOutput, error) DeleteStackSetRequest(*cloudformation.DeleteStackSetInput) (*request.Request, *cloudformation.DeleteStackSetOutput) + DeregisterType(*cloudformation.DeregisterTypeInput) (*cloudformation.DeregisterTypeOutput, error) + DeregisterTypeWithContext(aws.Context, *cloudformation.DeregisterTypeInput, ...request.Option) (*cloudformation.DeregisterTypeOutput, error) + DeregisterTypeRequest(*cloudformation.DeregisterTypeInput) (*request.Request, *cloudformation.DeregisterTypeOutput) + DescribeAccountLimits(*cloudformation.DescribeAccountLimitsInput) (*cloudformation.DescribeAccountLimitsOutput, error) DescribeAccountLimitsWithContext(aws.Context, *cloudformation.DescribeAccountLimitsInput, ...request.Option) (*cloudformation.DescribeAccountLimitsOutput, error) DescribeAccountLimitsRequest(*cloudformation.DescribeAccountLimitsInput) (*request.Request, *cloudformation.DescribeAccountLimitsOutput) @@ -153,6 +157,14 @@ type CloudFormationAPI interface { DescribeStacksPages(*cloudformation.DescribeStacksInput, func(*cloudformation.DescribeStacksOutput, bool) bool) error DescribeStacksPagesWithContext(aws.Context, *cloudformation.DescribeStacksInput, func(*cloudformation.DescribeStacksOutput, bool) bool, ...request.Option) error + DescribeType(*cloudformation.DescribeTypeInput) (*cloudformation.DescribeTypeOutput, error) + DescribeTypeWithContext(aws.Context, *cloudformation.DescribeTypeInput, ...request.Option) (*cloudformation.DescribeTypeOutput, error) + DescribeTypeRequest(*cloudformation.DescribeTypeInput) (*request.Request, *cloudformation.DescribeTypeOutput) + + DescribeTypeRegistration(*cloudformation.DescribeTypeRegistrationInput) (*cloudformation.DescribeTypeRegistrationOutput, error) + DescribeTypeRegistrationWithContext(aws.Context, *cloudformation.DescribeTypeRegistrationInput, ...request.Option) (*cloudformation.DescribeTypeRegistrationOutput, error) + DescribeTypeRegistrationRequest(*cloudformation.DescribeTypeRegistrationInput) (*request.Request, *cloudformation.DescribeTypeRegistrationOutput) + DetectStackDrift(*cloudformation.DetectStackDriftInput) (*cloudformation.DetectStackDriftOutput, error) DetectStackDriftWithContext(aws.Context, *cloudformation.DetectStackDriftInput, ...request.Option) (*cloudformation.DetectStackDriftOutput, error) DetectStackDriftRequest(*cloudformation.DetectStackDriftInput) (*request.Request, *cloudformation.DetectStackDriftOutput) @@ -161,6 +173,10 @@ type CloudFormationAPI interface { DetectStackResourceDriftWithContext(aws.Context, *cloudformation.DetectStackResourceDriftInput, ...request.Option) (*cloudformation.DetectStackResourceDriftOutput, error) DetectStackResourceDriftRequest(*cloudformation.DetectStackResourceDriftInput) (*request.Request, *cloudformation.DetectStackResourceDriftOutput) + DetectStackSetDrift(*cloudformation.DetectStackSetDriftInput) (*cloudformation.DetectStackSetDriftOutput, error) + DetectStackSetDriftWithContext(aws.Context, *cloudformation.DetectStackSetDriftInput, ...request.Option) (*cloudformation.DetectStackSetDriftOutput, error) + DetectStackSetDriftRequest(*cloudformation.DetectStackSetDriftInput) (*request.Request, *cloudformation.DetectStackSetDriftOutput) + EstimateTemplateCost(*cloudformation.EstimateTemplateCostInput) (*cloudformation.EstimateTemplateCostOutput, error) EstimateTemplateCostWithContext(aws.Context, *cloudformation.EstimateTemplateCostInput, ...request.Option) (*cloudformation.EstimateTemplateCostOutput, error) EstimateTemplateCostRequest(*cloudformation.EstimateTemplateCostInput) (*request.Request, *cloudformation.EstimateTemplateCostOutput) @@ -229,10 +245,43 @@ type CloudFormationAPI interface { ListStacksPages(*cloudformation.ListStacksInput, func(*cloudformation.ListStacksOutput, bool) bool) error ListStacksPagesWithContext(aws.Context, *cloudformation.ListStacksInput, func(*cloudformation.ListStacksOutput, bool) bool, ...request.Option) error + ListTypeRegistrations(*cloudformation.ListTypeRegistrationsInput) (*cloudformation.ListTypeRegistrationsOutput, error) + ListTypeRegistrationsWithContext(aws.Context, *cloudformation.ListTypeRegistrationsInput, ...request.Option) (*cloudformation.ListTypeRegistrationsOutput, error) + ListTypeRegistrationsRequest(*cloudformation.ListTypeRegistrationsInput) (*request.Request, *cloudformation.ListTypeRegistrationsOutput) + + ListTypeRegistrationsPages(*cloudformation.ListTypeRegistrationsInput, func(*cloudformation.ListTypeRegistrationsOutput, bool) bool) error + ListTypeRegistrationsPagesWithContext(aws.Context, *cloudformation.ListTypeRegistrationsInput, func(*cloudformation.ListTypeRegistrationsOutput, bool) bool, ...request.Option) error + + ListTypeVersions(*cloudformation.ListTypeVersionsInput) (*cloudformation.ListTypeVersionsOutput, error) + ListTypeVersionsWithContext(aws.Context, *cloudformation.ListTypeVersionsInput, ...request.Option) (*cloudformation.ListTypeVersionsOutput, error) + ListTypeVersionsRequest(*cloudformation.ListTypeVersionsInput) (*request.Request, *cloudformation.ListTypeVersionsOutput) + + ListTypeVersionsPages(*cloudformation.ListTypeVersionsInput, func(*cloudformation.ListTypeVersionsOutput, bool) bool) error + ListTypeVersionsPagesWithContext(aws.Context, *cloudformation.ListTypeVersionsInput, func(*cloudformation.ListTypeVersionsOutput, bool) bool, ...request.Option) error + + ListTypes(*cloudformation.ListTypesInput) (*cloudformation.ListTypesOutput, error) + ListTypesWithContext(aws.Context, *cloudformation.ListTypesInput, ...request.Option) (*cloudformation.ListTypesOutput, error) + ListTypesRequest(*cloudformation.ListTypesInput) (*request.Request, *cloudformation.ListTypesOutput) + + ListTypesPages(*cloudformation.ListTypesInput, func(*cloudformation.ListTypesOutput, bool) bool) error + ListTypesPagesWithContext(aws.Context, *cloudformation.ListTypesInput, func(*cloudformation.ListTypesOutput, bool) bool, ...request.Option) error + + RecordHandlerProgress(*cloudformation.RecordHandlerProgressInput) (*cloudformation.RecordHandlerProgressOutput, error) + RecordHandlerProgressWithContext(aws.Context, *cloudformation.RecordHandlerProgressInput, ...request.Option) (*cloudformation.RecordHandlerProgressOutput, error) + RecordHandlerProgressRequest(*cloudformation.RecordHandlerProgressInput) (*request.Request, *cloudformation.RecordHandlerProgressOutput) + + RegisterType(*cloudformation.RegisterTypeInput) (*cloudformation.RegisterTypeOutput, error) + RegisterTypeWithContext(aws.Context, *cloudformation.RegisterTypeInput, ...request.Option) (*cloudformation.RegisterTypeOutput, error) + RegisterTypeRequest(*cloudformation.RegisterTypeInput) (*request.Request, *cloudformation.RegisterTypeOutput) + SetStackPolicy(*cloudformation.SetStackPolicyInput) (*cloudformation.SetStackPolicyOutput, error) SetStackPolicyWithContext(aws.Context, *cloudformation.SetStackPolicyInput, ...request.Option) (*cloudformation.SetStackPolicyOutput, error) SetStackPolicyRequest(*cloudformation.SetStackPolicyInput) (*request.Request, *cloudformation.SetStackPolicyOutput) + SetTypeDefaultVersion(*cloudformation.SetTypeDefaultVersionInput) (*cloudformation.SetTypeDefaultVersionOutput, error) + SetTypeDefaultVersionWithContext(aws.Context, *cloudformation.SetTypeDefaultVersionInput, ...request.Option) (*cloudformation.SetTypeDefaultVersionOutput, error) + SetTypeDefaultVersionRequest(*cloudformation.SetTypeDefaultVersionInput) (*request.Request, *cloudformation.SetTypeDefaultVersionOutput) + SignalResource(*cloudformation.SignalResourceInput) (*cloudformation.SignalResourceOutput, error) SignalResourceWithContext(aws.Context, *cloudformation.SignalResourceInput, ...request.Option) (*cloudformation.SignalResourceOutput, error) SignalResourceRequest(*cloudformation.SignalResourceInput) (*request.Request, *cloudformation.SignalResourceOutput) @@ -273,8 +322,14 @@ type CloudFormationAPI interface { WaitUntilStackExists(*cloudformation.DescribeStacksInput) error WaitUntilStackExistsWithContext(aws.Context, *cloudformation.DescribeStacksInput, ...request.WaiterOption) error + WaitUntilStackImportComplete(*cloudformation.DescribeStacksInput) error + WaitUntilStackImportCompleteWithContext(aws.Context, *cloudformation.DescribeStacksInput, ...request.WaiterOption) error + WaitUntilStackUpdateComplete(*cloudformation.DescribeStacksInput) error WaitUntilStackUpdateCompleteWithContext(aws.Context, *cloudformation.DescribeStacksInput, ...request.WaiterOption) error + + WaitUntilTypeRegistrationComplete(*cloudformation.DescribeTypeRegistrationInput) error + WaitUntilTypeRegistrationCompleteWithContext(aws.Context, *cloudformation.DescribeTypeRegistrationInput, ...request.WaiterOption) error } var _ CloudFormationAPI = (*cloudformation.CloudFormation)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/errors.go index 9ced8d7b..f2312e9f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/errors.go @@ -10,6 +10,12 @@ const ( // The resource with the name requested already exists. ErrCodeAlreadyExistsException = "AlreadyExistsException" + // ErrCodeCFNRegistryException for service response error code + // "CFNRegistryException". + // + // An error occurred during a CloudFormation registry operation. + ErrCodeCFNRegistryException = "CFNRegistryException" + // ErrCodeChangeSetNotFoundException for service response error code // "ChangeSetNotFound". // @@ -44,6 +50,13 @@ const ( // The specified operation isn't valid. ErrCodeInvalidOperationException = "InvalidOperationException" + // ErrCodeInvalidStateTransitionException for service response error code + // "InvalidStateTransition". + // + // Error reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + // CloudFormation does not return this error to users. + ErrCodeInvalidStateTransitionException = "InvalidStateTransition" + // ErrCodeLimitExceededException for service response error code // "LimitExceededException". // @@ -78,6 +91,13 @@ const ( // The specified ID refers to an operation that doesn't exist. ErrCodeOperationNotFoundException = "OperationNotFoundException" + // ErrCodeOperationStatusCheckFailedException for service response error code + // "ConditionalCheckFailed". + // + // Error reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + // CloudFormation does not return this error to users. + ErrCodeOperationStatusCheckFailedException = "ConditionalCheckFailed" + // ErrCodeStackInstanceNotFoundException for service response error code // "StackInstanceNotFoundException". // @@ -110,4 +130,10 @@ const ( // // A client request token already exists. ErrCodeTokenAlreadyExistsException = "TokenAlreadyExistsException" + + // ErrCodeTypeNotFoundException for service response error code + // "TypeNotFoundException". + // + // The specified type does not exist in the CloudFormation registry. + ErrCodeTypeNotFoundException = "TypeNotFoundException" ) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/service.go index 65df49a0..33748e5d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "cloudformation" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "CloudFormation" // ServiceID is a unique identifer of a specific service. + ServiceID = "CloudFormation" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the CloudFormation client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a CloudFormation client from just a session. // svc := cloudformation.New(mySession) // @@ -46,11 +48,11 @@ const ( // svc := cloudformation.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudFormation { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, 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) *CloudFormation { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CloudFormation { svc := &CloudFormation{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2010-05-15", }, diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/waiters.go index afe8a1b2..0dbdc6c2 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/waiters.go @@ -188,6 +188,11 @@ func (c *CloudFormation) WaitUntilStackDeleteCompleteWithContext(ctx aws.Context Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "ROLLBACK_FAILED", }, + { + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", + Expected: "UPDATE_ROLLBACK_IN_PROGRESS", + }, { State: request.FailureWaiterState, Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", @@ -196,7 +201,7 @@ func (c *CloudFormation) WaitUntilStackDeleteCompleteWithContext(ctx aws.Context { State: request.FailureWaiterState, Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", - Expected: "UPDATE_ROLLBACK_IN_PROGRESS", + Expected: "UPDATE_ROLLBACK_COMPLETE", }, }, Logger: c.Config.Logger, @@ -268,6 +273,82 @@ func (c *CloudFormation) WaitUntilStackExistsWithContext(ctx aws.Context, input return w.WaitWithContext(ctx) } +// WaitUntilStackImportComplete uses the AWS CloudFormation API operation +// DescribeStacks to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *CloudFormation) WaitUntilStackImportComplete(input *DescribeStacksInput) error { + return c.WaitUntilStackImportCompleteWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilStackImportCompleteWithContext is an extended version of WaitUntilStackImportComplete. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudFormation) WaitUntilStackImportCompleteWithContext(ctx aws.Context, input *DescribeStacksInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilStackImportComplete", + MaxAttempts: 120, + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Stacks[].StackStatus", + Expected: "IMPORT_COMPLETE", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", + Expected: "ROLLBACK_COMPLETE", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", + Expected: "ROLLBACK_FAILED", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", + Expected: "IMPORT_ROLLBACK_IN_PROGRESS", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", + Expected: "IMPORT_ROLLBACK_FAILED", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", + Expected: "IMPORT_ROLLBACK_COMPLETE", + }, + { + State: request.FailureWaiterState, + Matcher: request.ErrorWaiterMatch, + Expected: "ValidationError", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeStacksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeStacksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + // WaitUntilStackUpdateComplete uses the AWS CloudFormation API operation // DescribeStacks to wait for a condition to be met before returning. // If the condition is not met within the max attempt window, an error will @@ -333,3 +414,54 @@ func (c *CloudFormation) WaitUntilStackUpdateCompleteWithContext(ctx aws.Context return w.WaitWithContext(ctx) } + +// WaitUntilTypeRegistrationComplete uses the AWS CloudFormation API operation +// DescribeTypeRegistration to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *CloudFormation) WaitUntilTypeRegistrationComplete(input *DescribeTypeRegistrationInput) error { + return c.WaitUntilTypeRegistrationCompleteWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilTypeRegistrationCompleteWithContext is an extended version of WaitUntilTypeRegistrationComplete. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudFormation) WaitUntilTypeRegistrationCompleteWithContext(ctx aws.Context, input *DescribeTypeRegistrationInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilTypeRegistrationComplete", + MaxAttempts: 120, + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "ProgressStatus", + Expected: "COMPLETE", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "ProgressStatus", + Expected: "FAILED", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeTypeRegistrationInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTypeRegistrationRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/eks/api.go b/vendor/github.com/aws/aws-sdk-go/service/eks/api.go index f6a1c136..3ebb723b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/eks/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/eks/api.go @@ -8,6 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/restjson" ) const opCreateCluster = "CreateCluster" @@ -153,57 +155,83 @@ func (c *EKS) CreateClusterWithContext(ctx aws.Context, input *CreateClusterInpu return out, req.Send() } -const opDeleteCluster = "DeleteCluster" +const opCreateFargateProfile = "CreateFargateProfile" -// DeleteClusterRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCluster operation. The "output" return +// CreateFargateProfileRequest generates a "aws/request.Request" representing the +// client's request for the CreateFargateProfile operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteCluster for more information on using the DeleteCluster +// See CreateFargateProfile for more information on using the CreateFargateProfile // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteClusterRequest method. -// req, resp := client.DeleteClusterRequest(params) +// // Example sending a request using the CreateFargateProfileRequest method. +// req, resp := client.CreateFargateProfileRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteCluster -func (c *EKS) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Request, output *DeleteClusterOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/CreateFargateProfile +func (c *EKS) CreateFargateProfileRequest(input *CreateFargateProfileInput) (req *request.Request, output *CreateFargateProfileOutput) { op := &request.Operation{ - Name: opDeleteCluster, - HTTPMethod: "DELETE", - HTTPPath: "/clusters/{name}", + Name: opCreateFargateProfile, + HTTPMethod: "POST", + HTTPPath: "/clusters/{name}/fargate-profiles", } if input == nil { - input = &DeleteClusterInput{} + input = &CreateFargateProfileInput{} } - output = &DeleteClusterOutput{} + output = &CreateFargateProfileOutput{} req = c.newRequest(op, input, output) return } -// DeleteCluster API operation for Amazon Elastic Kubernetes Service. +// CreateFargateProfile API operation for Amazon Elastic Kubernetes Service. +// +// Creates an AWS Fargate profile for your Amazon EKS cluster. You must have +// at least one Fargate profile in a cluster to be able to schedule pods on +// Fargate infrastructure. +// +// The Fargate profile allows an administrator to declare which pods run on +// Fargate infrastructure and specify which pods run on which Fargate profile. +// This declaration is done through the profile’s selectors. Each profile +// can have up to five selectors that contain a namespace and labels. A namespace +// is required for every selector. The label field consists of multiple optional +// key-value pairs. Pods that match the selectors are scheduled on Fargate infrastructure. +// If a to-be-scheduled pod matches any of the selectors in the Fargate profile, +// then that pod is scheduled on Fargate infrastructure. +// +// When you create a Fargate profile, you must specify a pod execution role +// to use with the pods that are scheduled with the profile. This role is added +// to the cluster's Kubernetes Role Based Access Control (https://kubernetes.io/docs/admin/authorization/rbac/) +// (RBAC) for authorization so that the kubelet that is running on the Fargate +// infrastructure can register with your Amazon EKS cluster. This role is what +// allows Fargate infrastructure to appear in your cluster as nodes. The pod +// execution role also provides IAM permissions to the Fargate infrastructure +// to allow read access to Amazon ECR image repositories. For more information, +// see Pod Execution Role (https://docs.aws.amazon.com/eks/latest/userguide/pod-execution-role.html) +// in the Amazon EKS User Guide. // -// Deletes the Amazon EKS cluster control plane. +// Fargate profiles are immutable. However, you can create a new updated profile +// to replace an existing profile and then delete the original after the updated +// profile has finished creating. // -// If you have active services in your cluster that are associated with a load -// balancer, you must delete those services before deleting the cluster so that -// the load balancers are deleted properly. Otherwise, you can have orphaned -// resources in your VPC that prevent you from being able to delete the VPC. -// For more information, see Deleting a Cluster (https://docs.aws.amazon.com/eks/latest/userguide/delete-cluster.html) +// If any Fargate profiles in a cluster are in the DELETING status, you must +// wait for that Fargate profile to finish deleting before you can create any +// other profiles in that cluster. +// +// For more information, see AWS Fargate Profile (https://docs.aws.amazon.com/eks/latest/userguide/fargate-profile.html) // in the Amazon EKS User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -211,15 +239,16 @@ func (c *EKS) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Requ // the error. // // See the AWS API reference guide for Amazon Elastic Kubernetes Service's -// API operation DeleteCluster for usage and error information. +// API operation CreateFargateProfile for usage and error information. // // Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" -// The specified resource is in use. +// * ErrCodeInvalidParameterException "InvalidParameterException" +// The specified parameter is invalid. Review the available parameters for the +// API request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource could not be found. You can view your available clusters -// with ListClusters. Amazon EKS clusters are Region-specific. +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is invalid given the state of the cluster. Check the state of +// the cluster and the associated operations. // // * ErrCodeClientException "ClientException" // These errors are usually caused by a client action. Actions can include using @@ -229,96 +258,113 @@ func (c *EKS) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Requ // * ErrCodeServerException "ServerException" // These errors are usually caused by a server-side issue. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service is unavailable. Back off and retry the operation. +// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" +// You have encountered a service limit on the specified resource. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteCluster -func (c *EKS) DeleteCluster(input *DeleteClusterInput) (*DeleteClusterOutput, error) { - req, out := c.DeleteClusterRequest(input) +// * ErrCodeUnsupportedAvailabilityZoneException "UnsupportedAvailabilityZoneException" +// At least one of your specified cluster subnets is in an Availability Zone +// that does not support Amazon EKS. The exception output specifies the supported +// Availability Zones for your account, from which you can choose subnets for +// your cluster. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/CreateFargateProfile +func (c *EKS) CreateFargateProfile(input *CreateFargateProfileInput) (*CreateFargateProfileOutput, error) { + req, out := c.CreateFargateProfileRequest(input) return out, req.Send() } -// DeleteClusterWithContext is the same as DeleteCluster with the addition of +// CreateFargateProfileWithContext is the same as CreateFargateProfile with the addition of // the ability to pass a context and additional request options. // -// See DeleteCluster for details on how to use this API operation. +// See CreateFargateProfile 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 *EKS) DeleteClusterWithContext(ctx aws.Context, input *DeleteClusterInput, opts ...request.Option) (*DeleteClusterOutput, error) { - req, out := c.DeleteClusterRequest(input) +func (c *EKS) CreateFargateProfileWithContext(ctx aws.Context, input *CreateFargateProfileInput, opts ...request.Option) (*CreateFargateProfileOutput, error) { + req, out := c.CreateFargateProfileRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeCluster = "DescribeCluster" +const opCreateNodegroup = "CreateNodegroup" -// DescribeClusterRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCluster operation. The "output" return +// CreateNodegroupRequest generates a "aws/request.Request" representing the +// client's request for the CreateNodegroup operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeCluster for more information on using the DescribeCluster +// See CreateNodegroup for more information on using the CreateNodegroup // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeClusterRequest method. -// req, resp := client.DescribeClusterRequest(params) +// // Example sending a request using the CreateNodegroupRequest method. +// req, resp := client.CreateNodegroupRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeCluster -func (c *EKS) DescribeClusterRequest(input *DescribeClusterInput) (req *request.Request, output *DescribeClusterOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/CreateNodegroup +func (c *EKS) CreateNodegroupRequest(input *CreateNodegroupInput) (req *request.Request, output *CreateNodegroupOutput) { op := &request.Operation{ - Name: opDescribeCluster, - HTTPMethod: "GET", - HTTPPath: "/clusters/{name}", + Name: opCreateNodegroup, + HTTPMethod: "POST", + HTTPPath: "/clusters/{name}/node-groups", } if input == nil { - input = &DescribeClusterInput{} + input = &CreateNodegroupInput{} } - output = &DescribeClusterOutput{} + output = &CreateNodegroupOutput{} req = c.newRequest(op, input, output) return } -// DescribeCluster API operation for Amazon Elastic Kubernetes Service. -// -// Returns descriptive information about an Amazon EKS cluster. +// CreateNodegroup API operation for Amazon Elastic Kubernetes Service. // -// The API server endpoint and certificate authority data returned by this operation -// are required for kubelet and kubectl to communicate with your Kubernetes -// API server. For more information, see Create a kubeconfig for Amazon EKS -// (https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html). +// Creates a managed worker node group for an Amazon EKS cluster. You can only +// create a node group for your cluster that is equal to the current Kubernetes +// version for the cluster. All node groups are created with the latest AMI +// release version for the respective minor Kubernetes version of the cluster. // -// The API server endpoint and certificate authority data aren't available until -// the cluster reaches the ACTIVE state. +// An Amazon EKS managed node group is an Amazon EC2 Auto Scaling group and +// associated Amazon EC2 instances that are managed by AWS for an Amazon EKS +// cluster. Each node group uses a version of the Amazon EKS-optimized Amazon +// Linux 2 AMI. For more information, see Managed Node Groups (https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html) +// in the Amazon EKS 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 Amazon Elastic Kubernetes Service's -// API operation DescribeCluster for usage and error information. +// API operation CreateNodegroup for usage and error information. // // Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource could not be found. You can view your available clusters -// with ListClusters. Amazon EKS clusters are Region-specific. +// * ErrCodeResourceInUseException "ResourceInUseException" +// The specified resource is in use. +// +// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" +// You have encountered a service limit on the specified resource. +// +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is invalid given the state of the cluster. Check the state of +// the cluster and the associated operations. +// +// * ErrCodeInvalidParameterException "InvalidParameterException" +// The specified parameter is invalid. Review the available parameters for the +// API request. // // * ErrCodeClientException "ClientException" // These errors are usually caused by a client action. Actions can include using @@ -331,89 +377,99 @@ func (c *EKS) DescribeClusterRequest(input *DescribeClusterInput) (req *request. // * ErrCodeServiceUnavailableException "ServiceUnavailableException" // The service is unavailable. Back off and retry the operation. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeCluster -func (c *EKS) DescribeCluster(input *DescribeClusterInput) (*DescribeClusterOutput, error) { - req, out := c.DescribeClusterRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/CreateNodegroup +func (c *EKS) CreateNodegroup(input *CreateNodegroupInput) (*CreateNodegroupOutput, error) { + req, out := c.CreateNodegroupRequest(input) return out, req.Send() } -// DescribeClusterWithContext is the same as DescribeCluster with the addition of +// CreateNodegroupWithContext is the same as CreateNodegroup with the addition of // the ability to pass a context and additional request options. // -// See DescribeCluster for details on how to use this API operation. +// See CreateNodegroup 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 *EKS) DescribeClusterWithContext(ctx aws.Context, input *DescribeClusterInput, opts ...request.Option) (*DescribeClusterOutput, error) { - req, out := c.DescribeClusterRequest(input) +func (c *EKS) CreateNodegroupWithContext(ctx aws.Context, input *CreateNodegroupInput, opts ...request.Option) (*CreateNodegroupOutput, error) { + req, out := c.CreateNodegroupRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeUpdate = "DescribeUpdate" +const opDeleteCluster = "DeleteCluster" -// DescribeUpdateRequest generates a "aws/request.Request" representing the -// client's request for the DescribeUpdate operation. The "output" return +// DeleteClusterRequest generates a "aws/request.Request" representing the +// client's request for the DeleteCluster operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeUpdate for more information on using the DescribeUpdate +// See DeleteCluster for more information on using the DeleteCluster // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeUpdateRequest method. -// req, resp := client.DescribeUpdateRequest(params) +// // Example sending a request using the DeleteClusterRequest method. +// req, resp := client.DeleteClusterRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeUpdate -func (c *EKS) DescribeUpdateRequest(input *DescribeUpdateInput) (req *request.Request, output *DescribeUpdateOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteCluster +func (c *EKS) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Request, output *DeleteClusterOutput) { op := &request.Operation{ - Name: opDescribeUpdate, - HTTPMethod: "GET", - HTTPPath: "/clusters/{name}/updates/{updateId}", + Name: opDeleteCluster, + HTTPMethod: "DELETE", + HTTPPath: "/clusters/{name}", } if input == nil { - input = &DescribeUpdateInput{} + input = &DeleteClusterInput{} } - output = &DescribeUpdateOutput{} + output = &DeleteClusterOutput{} req = c.newRequest(op, input, output) return } -// DescribeUpdate API operation for Amazon Elastic Kubernetes Service. +// DeleteCluster API operation for Amazon Elastic Kubernetes Service. // -// Returns descriptive information about an update against your Amazon EKS cluster. +// Deletes the Amazon EKS cluster control plane. // -// When the status of the update is Succeeded, the update is complete. If an -// update fails, the status is Failed, and an error detail explains the reason -// for the failure. +// If you have active services in your cluster that are associated with a load +// balancer, you must delete those services before deleting the cluster so that +// the load balancers are deleted properly. Otherwise, you can have orphaned +// resources in your VPC that prevent you from being able to delete the VPC. +// For more information, see Deleting a Cluster (https://docs.aws.amazon.com/eks/latest/userguide/delete-cluster.html) +// in the Amazon EKS User Guide. +// +// If you have managed node groups or Fargate profiles attached to the cluster, +// you must delete them first. For more information, see DeleteNodegroup andDeleteFargateProfile. // // 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 Elastic Kubernetes Service's -// API operation DescribeUpdate for usage and error information. +// API operation DeleteCluster for usage and error information. // // Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. +// * ErrCodeResourceInUseException "ResourceInUseException" +// The specified resource is in use. +// +// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. // // * ErrCodeClientException "ClientException" // These errors are usually caused by a client action. Actions can include using @@ -423,84 +479,93 @@ func (c *EKS) DescribeUpdateRequest(input *DescribeUpdateInput) (req *request.Re // * ErrCodeServerException "ServerException" // These errors are usually caused by a server-side issue. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource could not be found. You can view your available clusters -// with ListClusters. Amazon EKS clusters are Region-specific. +// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// The service is unavailable. Back off and retry the operation. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeUpdate -func (c *EKS) DescribeUpdate(input *DescribeUpdateInput) (*DescribeUpdateOutput, error) { - req, out := c.DescribeUpdateRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteCluster +func (c *EKS) DeleteCluster(input *DeleteClusterInput) (*DeleteClusterOutput, error) { + req, out := c.DeleteClusterRequest(input) return out, req.Send() } -// DescribeUpdateWithContext is the same as DescribeUpdate with the addition of +// DeleteClusterWithContext is the same as DeleteCluster with the addition of // the ability to pass a context and additional request options. // -// See DescribeUpdate for details on how to use this API operation. +// See DeleteCluster 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 *EKS) DescribeUpdateWithContext(ctx aws.Context, input *DescribeUpdateInput, opts ...request.Option) (*DescribeUpdateOutput, error) { - req, out := c.DescribeUpdateRequest(input) +func (c *EKS) DeleteClusterWithContext(ctx aws.Context, input *DeleteClusterInput, opts ...request.Option) (*DeleteClusterOutput, error) { + req, out := c.DeleteClusterRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListClusters = "ListClusters" +const opDeleteFargateProfile = "DeleteFargateProfile" -// ListClustersRequest generates a "aws/request.Request" representing the -// client's request for the ListClusters operation. The "output" return +// DeleteFargateProfileRequest generates a "aws/request.Request" representing the +// client's request for the DeleteFargateProfile operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListClusters for more information on using the ListClusters +// See DeleteFargateProfile for more information on using the DeleteFargateProfile // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListClustersRequest method. -// req, resp := client.ListClustersRequest(params) +// // Example sending a request using the DeleteFargateProfileRequest method. +// req, resp := client.DeleteFargateProfileRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListClusters -func (c *EKS) ListClustersRequest(input *ListClustersInput) (req *request.Request, output *ListClustersOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteFargateProfile +func (c *EKS) DeleteFargateProfileRequest(input *DeleteFargateProfileInput) (req *request.Request, output *DeleteFargateProfileOutput) { op := &request.Operation{ - Name: opListClusters, - HTTPMethod: "GET", - HTTPPath: "/clusters", + Name: opDeleteFargateProfile, + HTTPMethod: "DELETE", + HTTPPath: "/clusters/{name}/fargate-profiles/{fargateProfileName}", } if input == nil { - input = &ListClustersInput{} + input = &DeleteFargateProfileInput{} } - output = &ListClustersOutput{} + output = &DeleteFargateProfileOutput{} req = c.newRequest(op, input, output) return } -// ListClusters API operation for Amazon Elastic Kubernetes Service. +// DeleteFargateProfile API operation for Amazon Elastic Kubernetes Service. // -// Lists the Amazon EKS clusters in your AWS account in the specified Region. +// Deletes an AWS Fargate profile. +// +// When you delete a Fargate profile, any pods that were scheduled onto Fargate +// infrastructure with the profile are deleted. If those pods match another +// Fargate profile, then they are scheduled on Fargate infrastructure with that +// profile. If they no longer match any Fargate profiles, then they are not +// scheduled on Fargate infrastructure. +// +// Only one Fargate profile in a cluster can be in the DELETING status at a +// time. You must wait for a Fargate profile to finish deleting before you can +// delete any other profiles in that cluster. // // 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 Elastic Kubernetes Service's -// API operation ListClusters for usage and error information. +// API operation DeleteFargateProfile for usage and error information. // // Returned Error Codes: // * ErrCodeInvalidParameterException "InvalidParameterException" @@ -515,86 +580,95 @@ func (c *EKS) ListClustersRequest(input *ListClustersInput) (req *request.Reques // * ErrCodeServerException "ServerException" // These errors are usually caused by a server-side issue. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service is unavailable. Back off and retry the operation. +// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListClusters -func (c *EKS) ListClusters(input *ListClustersInput) (*ListClustersOutput, error) { - req, out := c.ListClustersRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteFargateProfile +func (c *EKS) DeleteFargateProfile(input *DeleteFargateProfileInput) (*DeleteFargateProfileOutput, error) { + req, out := c.DeleteFargateProfileRequest(input) return out, req.Send() } -// ListClustersWithContext is the same as ListClusters with the addition of +// DeleteFargateProfileWithContext is the same as DeleteFargateProfile with the addition of // the ability to pass a context and additional request options. // -// See ListClusters for details on how to use this API operation. +// See DeleteFargateProfile 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 *EKS) ListClustersWithContext(ctx aws.Context, input *ListClustersInput, opts ...request.Option) (*ListClustersOutput, error) { - req, out := c.ListClustersRequest(input) +func (c *EKS) DeleteFargateProfileWithContext(ctx aws.Context, input *DeleteFargateProfileInput, opts ...request.Option) (*DeleteFargateProfileOutput, error) { + req, out := c.DeleteFargateProfileRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListUpdates = "ListUpdates" +const opDeleteNodegroup = "DeleteNodegroup" -// ListUpdatesRequest generates a "aws/request.Request" representing the -// client's request for the ListUpdates operation. The "output" return +// DeleteNodegroupRequest generates a "aws/request.Request" representing the +// client's request for the DeleteNodegroup operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListUpdates for more information on using the ListUpdates +// See DeleteNodegroup for more information on using the DeleteNodegroup // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListUpdatesRequest method. -// req, resp := client.ListUpdatesRequest(params) +// // Example sending a request using the DeleteNodegroupRequest method. +// req, resp := client.DeleteNodegroupRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListUpdates -func (c *EKS) ListUpdatesRequest(input *ListUpdatesInput) (req *request.Request, output *ListUpdatesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteNodegroup +func (c *EKS) DeleteNodegroupRequest(input *DeleteNodegroupInput) (req *request.Request, output *DeleteNodegroupOutput) { op := &request.Operation{ - Name: opListUpdates, - HTTPMethod: "GET", - HTTPPath: "/clusters/{name}/updates", + Name: opDeleteNodegroup, + HTTPMethod: "DELETE", + HTTPPath: "/clusters/{name}/node-groups/{nodegroupName}", } if input == nil { - input = &ListUpdatesInput{} + input = &DeleteNodegroupInput{} } - output = &ListUpdatesOutput{} + output = &DeleteNodegroupOutput{} req = c.newRequest(op, input, output) return } -// ListUpdates API operation for Amazon Elastic Kubernetes Service. +// DeleteNodegroup API operation for Amazon Elastic Kubernetes Service. // -// Lists the updates associated with an Amazon EKS cluster in your AWS account, -// in the specified Region. +// Deletes an Amazon EKS node group for a cluster. // // 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 Elastic Kubernetes Service's -// API operation ListUpdates for usage and error information. +// API operation DeleteNodegroup for usage and error information. // // Returned Error Codes: +// * ErrCodeResourceInUseException "ResourceInUseException" +// The specified resource is in use. +// +// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// // * ErrCodeInvalidParameterException "InvalidParameterException" // The specified parameter is invalid. Review the available parameters for the // API request. @@ -607,111 +681,183 @@ func (c *EKS) ListUpdatesRequest(input *ListUpdatesInput) (req *request.Request, // * ErrCodeServerException "ServerException" // These errors are usually caused by a server-side issue. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource could not be found. You can view your available clusters -// with ListClusters. Amazon EKS clusters are Region-specific. +// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// The service is unavailable. Back off and retry the operation. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListUpdates -func (c *EKS) ListUpdates(input *ListUpdatesInput) (*ListUpdatesOutput, error) { - req, out := c.ListUpdatesRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteNodegroup +func (c *EKS) DeleteNodegroup(input *DeleteNodegroupInput) (*DeleteNodegroupOutput, error) { + req, out := c.DeleteNodegroupRequest(input) return out, req.Send() } -// ListUpdatesWithContext is the same as ListUpdates with the addition of +// DeleteNodegroupWithContext is the same as DeleteNodegroup with the addition of // the ability to pass a context and additional request options. // -// See ListUpdates for details on how to use this API operation. +// See DeleteNodegroup 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 *EKS) ListUpdatesWithContext(ctx aws.Context, input *ListUpdatesInput, opts ...request.Option) (*ListUpdatesOutput, error) { - req, out := c.ListUpdatesRequest(input) +func (c *EKS) DeleteNodegroupWithContext(ctx aws.Context, input *DeleteNodegroupInput, opts ...request.Option) (*DeleteNodegroupOutput, error) { + req, out := c.DeleteNodegroupRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateClusterConfig = "UpdateClusterConfig" +const opDescribeCluster = "DescribeCluster" -// UpdateClusterConfigRequest generates a "aws/request.Request" representing the -// client's request for the UpdateClusterConfig operation. The "output" return +// DescribeClusterRequest generates a "aws/request.Request" representing the +// client's request for the DescribeCluster operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateClusterConfig for more information on using the UpdateClusterConfig +// See DescribeCluster for more information on using the DescribeCluster // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateClusterConfigRequest method. -// req, resp := client.UpdateClusterConfigRequest(params) +// // Example sending a request using the DescribeClusterRequest method. +// req, resp := client.DescribeClusterRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateClusterConfig -func (c *EKS) UpdateClusterConfigRequest(input *UpdateClusterConfigInput) (req *request.Request, output *UpdateClusterConfigOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeCluster +func (c *EKS) DescribeClusterRequest(input *DescribeClusterInput) (req *request.Request, output *DescribeClusterOutput) { op := &request.Operation{ - Name: opUpdateClusterConfig, - HTTPMethod: "POST", - HTTPPath: "/clusters/{name}/update-config", + Name: opDescribeCluster, + HTTPMethod: "GET", + HTTPPath: "/clusters/{name}", } if input == nil { - input = &UpdateClusterConfigInput{} + input = &DescribeClusterInput{} } - output = &UpdateClusterConfigOutput{} + output = &DescribeClusterOutput{} req = c.newRequest(op, input, output) return } -// UpdateClusterConfig API operation for Amazon Elastic Kubernetes Service. +// DescribeCluster API operation for Amazon Elastic Kubernetes Service. // -// Updates an Amazon EKS cluster configuration. Your cluster continues to function -// during the update. The response output includes an update ID that you can -// use to track the status of your cluster update with the DescribeUpdate API -// operation. +// Returns descriptive information about an Amazon EKS cluster. // -// You can use this API operation to enable or disable exporting the Kubernetes -// control plane logs for your cluster to CloudWatch Logs. By default, cluster -// control plane logs aren't exported to CloudWatch Logs. For more information, -// see Amazon EKS Cluster Control Plane Logs (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) -// in the Amazon EKS User Guide . +// The API server endpoint and certificate authority data returned by this operation +// are required for kubelet and kubectl to communicate with your Kubernetes +// API server. For more information, see Create a kubeconfig for Amazon EKS +// (https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html). // -// CloudWatch Logs ingestion, archive storage, and data scanning rates apply -// to exported control plane logs. For more information, see Amazon CloudWatch -// Pricing (http://aws.amazon.com/cloudwatch/pricing/). +// The API server endpoint and certificate authority data aren't available until +// the cluster reaches the ACTIVE state. // -// You can also use this API operation to enable or disable public and private -// access to your cluster's Kubernetes API server endpoint. By default, public -// access is enabled, and private access is disabled. For more information, -// see Amazon EKS Cluster Endpoint Access Control (https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html) -// in the Amazon EKS 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. // -// At this time, you can not update the subnets or security group IDs for an -// existing cluster. +// See the AWS API reference guide for Amazon Elastic Kubernetes Service's +// API operation DescribeCluster for usage and error information. // -// Cluster updates are asynchronous, and they should finish within a few minutes. -// During an update, the cluster status moves to UPDATING (this status transition -// is eventually consistent). When the update is complete (either Failed or -// Successful), the cluster status moves to Active. +// Returned Error Codes: +// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// * ErrCodeClientException "ClientException" +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ErrCodeServerException "ServerException" +// These errors are usually caused by a server-side issue. +// +// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// The service is unavailable. Back off and retry the operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeCluster +func (c *EKS) DescribeCluster(input *DescribeClusterInput) (*DescribeClusterOutput, error) { + req, out := c.DescribeClusterRequest(input) + return out, req.Send() +} + +// DescribeClusterWithContext is the same as DescribeCluster with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCluster 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 *EKS) DescribeClusterWithContext(ctx aws.Context, input *DescribeClusterInput, opts ...request.Option) (*DescribeClusterOutput, error) { + req, out := c.DescribeClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeFargateProfile = "DescribeFargateProfile" + +// DescribeFargateProfileRequest generates a "aws/request.Request" representing the +// client's request for the DescribeFargateProfile operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeFargateProfile for more information on using the DescribeFargateProfile +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeFargateProfileRequest method. +// req, resp := client.DescribeFargateProfileRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeFargateProfile +func (c *EKS) DescribeFargateProfileRequest(input *DescribeFargateProfileInput) (req *request.Request, output *DescribeFargateProfileOutput) { + op := &request.Operation{ + Name: opDescribeFargateProfile, + HTTPMethod: "GET", + HTTPPath: "/clusters/{name}/fargate-profiles/{fargateProfileName}", + } + + if input == nil { + input = &DescribeFargateProfileInput{} + } + + output = &DescribeFargateProfileOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeFargateProfile API operation for Amazon Elastic Kubernetes Service. +// +// Returns descriptive information about an AWS Fargate profile. // // 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 Elastic Kubernetes Service's -// API operation UpdateClusterConfig for usage and error information. +// API operation DescribeFargateProfile for usage and error information. // // Returned Error Codes: // * ErrCodeInvalidParameterException "InvalidParameterException" @@ -726,105 +872,96 @@ func (c *EKS) UpdateClusterConfigRequest(input *UpdateClusterConfigInput) (req * // * ErrCodeServerException "ServerException" // These errors are usually caused by a server-side issue. // -// * ErrCodeResourceInUseException "ResourceInUseException" -// The specified resource is in use. -// // * ErrCodeResourceNotFoundException "ResourceNotFoundException" // The specified resource could not be found. You can view your available clusters -// with ListClusters. Amazon EKS clusters are Region-specific. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is invalid given the state of the cluster. Check the state of -// the cluster and the associated operations. +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateClusterConfig -func (c *EKS) UpdateClusterConfig(input *UpdateClusterConfigInput) (*UpdateClusterConfigOutput, error) { - req, out := c.UpdateClusterConfigRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeFargateProfile +func (c *EKS) DescribeFargateProfile(input *DescribeFargateProfileInput) (*DescribeFargateProfileOutput, error) { + req, out := c.DescribeFargateProfileRequest(input) return out, req.Send() } -// UpdateClusterConfigWithContext is the same as UpdateClusterConfig with the addition of +// DescribeFargateProfileWithContext is the same as DescribeFargateProfile with the addition of // the ability to pass a context and additional request options. // -// See UpdateClusterConfig for details on how to use this API operation. +// See DescribeFargateProfile 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 *EKS) UpdateClusterConfigWithContext(ctx aws.Context, input *UpdateClusterConfigInput, opts ...request.Option) (*UpdateClusterConfigOutput, error) { - req, out := c.UpdateClusterConfigRequest(input) +func (c *EKS) DescribeFargateProfileWithContext(ctx aws.Context, input *DescribeFargateProfileInput, opts ...request.Option) (*DescribeFargateProfileOutput, error) { + req, out := c.DescribeFargateProfileRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateClusterVersion = "UpdateClusterVersion" +const opDescribeNodegroup = "DescribeNodegroup" -// UpdateClusterVersionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateClusterVersion operation. The "output" return +// DescribeNodegroupRequest generates a "aws/request.Request" representing the +// client's request for the DescribeNodegroup operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateClusterVersion for more information on using the UpdateClusterVersion +// See DescribeNodegroup for more information on using the DescribeNodegroup // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateClusterVersionRequest method. -// req, resp := client.UpdateClusterVersionRequest(params) +// // Example sending a request using the DescribeNodegroupRequest method. +// req, resp := client.DescribeNodegroupRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateClusterVersion -func (c *EKS) UpdateClusterVersionRequest(input *UpdateClusterVersionInput) (req *request.Request, output *UpdateClusterVersionOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeNodegroup +func (c *EKS) DescribeNodegroupRequest(input *DescribeNodegroupInput) (req *request.Request, output *DescribeNodegroupOutput) { op := &request.Operation{ - Name: opUpdateClusterVersion, - HTTPMethod: "POST", - HTTPPath: "/clusters/{name}/updates", + Name: opDescribeNodegroup, + HTTPMethod: "GET", + HTTPPath: "/clusters/{name}/node-groups/{nodegroupName}", } if input == nil { - input = &UpdateClusterVersionInput{} + input = &DescribeNodegroupInput{} } - output = &UpdateClusterVersionOutput{} + output = &DescribeNodegroupOutput{} req = c.newRequest(op, input, output) return } -// UpdateClusterVersion API operation for Amazon Elastic Kubernetes Service. -// -// Updates an Amazon EKS cluster to the specified Kubernetes version. Your cluster -// continues to function during the update. The response output includes an -// update ID that you can use to track the status of your cluster update with -// the DescribeUpdate API operation. +// DescribeNodegroup API operation for Amazon Elastic Kubernetes Service. // -// Cluster updates are asynchronous, and they should finish within a few minutes. -// During an update, the cluster status moves to UPDATING (this status transition -// is eventually consistent). When the update is complete (either Failed or -// Successful), the cluster status moves to Active. +// Returns descriptive information about an Amazon EKS node group. // // 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 Elastic Kubernetes Service's -// API operation UpdateClusterVersion for usage and error information. +// API operation DescribeNodegroup for usage and error information. // // Returned Error Codes: // * ErrCodeInvalidParameterException "InvalidParameterException" // The specified parameter is invalid. Review the available parameters for the // API request. // +// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// // * ErrCodeClientException "ClientException" // These errors are usually caused by a client action. Actions can include using // an action or resource on behalf of a user that doesn't have permissions to @@ -833,269 +970,3469 @@ func (c *EKS) UpdateClusterVersionRequest(input *UpdateClusterVersionInput) (req // * ErrCodeServerException "ServerException" // These errors are usually caused by a server-side issue. // -// * ErrCodeResourceInUseException "ResourceInUseException" -// The specified resource is in use. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource could not be found. You can view your available clusters -// with ListClusters. Amazon EKS clusters are Region-specific. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is invalid given the state of the cluster. Check the state of -// the cluster and the associated operations. +// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// The service is unavailable. Back off and retry the operation. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateClusterVersion -func (c *EKS) UpdateClusterVersion(input *UpdateClusterVersionInput) (*UpdateClusterVersionOutput, error) { - req, out := c.UpdateClusterVersionRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeNodegroup +func (c *EKS) DescribeNodegroup(input *DescribeNodegroupInput) (*DescribeNodegroupOutput, error) { + req, out := c.DescribeNodegroupRequest(input) return out, req.Send() } -// UpdateClusterVersionWithContext is the same as UpdateClusterVersion with the addition of +// DescribeNodegroupWithContext is the same as DescribeNodegroup with the addition of // the ability to pass a context and additional request options. // -// See UpdateClusterVersion for details on how to use this API operation. +// See DescribeNodegroup 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 *EKS) UpdateClusterVersionWithContext(ctx aws.Context, input *UpdateClusterVersionInput, opts ...request.Option) (*UpdateClusterVersionOutput, error) { - req, out := c.UpdateClusterVersionRequest(input) +func (c *EKS) DescribeNodegroupWithContext(ctx aws.Context, input *DescribeNodegroupInput, opts ...request.Option) (*DescribeNodegroupOutput, error) { + req, out := c.DescribeNodegroupRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// An object representing the certificate-authority-data for your cluster. -type Certificate struct { - _ struct{} `type:"structure"` +const opDescribeUpdate = "DescribeUpdate" - // The Base64-encoded certificate data required to communicate with your cluster. - // Add this to the certificate-authority-data section of the kubeconfig file - // for your cluster. - Data *string `locationName:"data" type:"string"` -} +// DescribeUpdateRequest generates a "aws/request.Request" representing the +// client's request for the DescribeUpdate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeUpdate for more information on using the DescribeUpdate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeUpdateRequest method. +// req, resp := client.DescribeUpdateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeUpdate +func (c *EKS) DescribeUpdateRequest(input *DescribeUpdateInput) (req *request.Request, output *DescribeUpdateOutput) { + op := &request.Operation{ + Name: opDescribeUpdate, + HTTPMethod: "GET", + HTTPPath: "/clusters/{name}/updates/{updateId}", + } -// String returns the string representation -func (s Certificate) String() string { - return awsutil.Prettify(s) -} + if input == nil { + input = &DescribeUpdateInput{} + } -// GoString returns the string representation -func (s Certificate) GoString() string { - return s.String() + output = &DescribeUpdateOutput{} + req = c.newRequest(op, input, output) + return } -// SetData sets the Data field's value. -func (s *Certificate) SetData(v string) *Certificate { - s.Data = &v - return s +// DescribeUpdate API operation for Amazon Elastic Kubernetes Service. +// +// Returns descriptive information about an update against your Amazon EKS cluster +// or associated managed node group. +// +// When the status of the update is Succeeded, the update is complete. If an +// update fails, the status is Failed, and an error detail explains the reason +// for the failure. +// +// 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 Elastic Kubernetes Service's +// API operation DescribeUpdate for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidParameterException "InvalidParameterException" +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ErrCodeClientException "ClientException" +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ErrCodeServerException "ServerException" +// These errors are usually caused by a server-side issue. +// +// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeUpdate +func (c *EKS) DescribeUpdate(input *DescribeUpdateInput) (*DescribeUpdateOutput, error) { + req, out := c.DescribeUpdateRequest(input) + return out, req.Send() } -// An object representing an Amazon EKS cluster. -type Cluster struct { +// DescribeUpdateWithContext is the same as DescribeUpdate with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeUpdate 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 *EKS) DescribeUpdateWithContext(ctx aws.Context, input *DescribeUpdateInput, opts ...request.Option) (*DescribeUpdateOutput, error) { + req, out := c.DescribeUpdateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListClusters = "ListClusters" + +// ListClustersRequest generates a "aws/request.Request" representing the +// client's request for the ListClusters operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListClusters for more information on using the ListClusters +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListClustersRequest method. +// req, resp := client.ListClustersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListClusters +func (c *EKS) ListClustersRequest(input *ListClustersInput) (req *request.Request, output *ListClustersOutput) { + op := &request.Operation{ + Name: opListClusters, + HTTPMethod: "GET", + HTTPPath: "/clusters", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListClustersInput{} + } + + output = &ListClustersOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListClusters API operation for Amazon Elastic Kubernetes Service. +// +// Lists the Amazon EKS clusters in your AWS account in the specified Region. +// +// 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 Elastic Kubernetes Service's +// API operation ListClusters for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidParameterException "InvalidParameterException" +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ErrCodeClientException "ClientException" +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ErrCodeServerException "ServerException" +// These errors are usually caused by a server-side issue. +// +// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// The service is unavailable. Back off and retry the operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListClusters +func (c *EKS) ListClusters(input *ListClustersInput) (*ListClustersOutput, error) { + req, out := c.ListClustersRequest(input) + return out, req.Send() +} + +// ListClustersWithContext is the same as ListClusters with the addition of +// the ability to pass a context and additional request options. +// +// See ListClusters 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 *EKS) ListClustersWithContext(ctx aws.Context, input *ListClustersInput, opts ...request.Option) (*ListClustersOutput, error) { + req, out := c.ListClustersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListClustersPages iterates over the pages of a ListClusters operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListClusters 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 ListClusters operation. +// pageNum := 0 +// err := client.ListClustersPages(params, +// func(page *eks.ListClustersOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EKS) ListClustersPages(input *ListClustersInput, fn func(*ListClustersOutput, bool) bool) error { + return c.ListClustersPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListClustersPagesWithContext same as ListClustersPages 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 *EKS) ListClustersPagesWithContext(ctx aws.Context, input *ListClustersInput, fn func(*ListClustersOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListClustersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListClustersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListClustersOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListFargateProfiles = "ListFargateProfiles" + +// ListFargateProfilesRequest generates a "aws/request.Request" representing the +// client's request for the ListFargateProfiles operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListFargateProfiles for more information on using the ListFargateProfiles +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListFargateProfilesRequest method. +// req, resp := client.ListFargateProfilesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListFargateProfiles +func (c *EKS) ListFargateProfilesRequest(input *ListFargateProfilesInput) (req *request.Request, output *ListFargateProfilesOutput) { + op := &request.Operation{ + Name: opListFargateProfiles, + HTTPMethod: "GET", + HTTPPath: "/clusters/{name}/fargate-profiles", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListFargateProfilesInput{} + } + + output = &ListFargateProfilesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListFargateProfiles API operation for Amazon Elastic Kubernetes Service. +// +// Lists the AWS Fargate profiles associated with the specified cluster in your +// AWS account in the specified Region. +// +// 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 Elastic Kubernetes Service's +// API operation ListFargateProfiles for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidParameterException "InvalidParameterException" +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// * ErrCodeClientException "ClientException" +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ErrCodeServerException "ServerException" +// These errors are usually caused by a server-side issue. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListFargateProfiles +func (c *EKS) ListFargateProfiles(input *ListFargateProfilesInput) (*ListFargateProfilesOutput, error) { + req, out := c.ListFargateProfilesRequest(input) + return out, req.Send() +} + +// ListFargateProfilesWithContext is the same as ListFargateProfiles with the addition of +// the ability to pass a context and additional request options. +// +// See ListFargateProfiles 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 *EKS) ListFargateProfilesWithContext(ctx aws.Context, input *ListFargateProfilesInput, opts ...request.Option) (*ListFargateProfilesOutput, error) { + req, out := c.ListFargateProfilesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListFargateProfilesPages iterates over the pages of a ListFargateProfiles operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListFargateProfiles 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 ListFargateProfiles operation. +// pageNum := 0 +// err := client.ListFargateProfilesPages(params, +// func(page *eks.ListFargateProfilesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EKS) ListFargateProfilesPages(input *ListFargateProfilesInput, fn func(*ListFargateProfilesOutput, bool) bool) error { + return c.ListFargateProfilesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListFargateProfilesPagesWithContext same as ListFargateProfilesPages 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 *EKS) ListFargateProfilesPagesWithContext(ctx aws.Context, input *ListFargateProfilesInput, fn func(*ListFargateProfilesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListFargateProfilesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListFargateProfilesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListFargateProfilesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListNodegroups = "ListNodegroups" + +// ListNodegroupsRequest generates a "aws/request.Request" representing the +// client's request for the ListNodegroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListNodegroups for more information on using the ListNodegroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListNodegroupsRequest method. +// req, resp := client.ListNodegroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListNodegroups +func (c *EKS) ListNodegroupsRequest(input *ListNodegroupsInput) (req *request.Request, output *ListNodegroupsOutput) { + op := &request.Operation{ + Name: opListNodegroups, + HTTPMethod: "GET", + HTTPPath: "/clusters/{name}/node-groups", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListNodegroupsInput{} + } + + output = &ListNodegroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListNodegroups API operation for Amazon Elastic Kubernetes Service. +// +// Lists the Amazon EKS node groups associated with the specified cluster in +// your AWS account in the specified Region. +// +// 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 Elastic Kubernetes Service's +// API operation ListNodegroups for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidParameterException "InvalidParameterException" +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ErrCodeClientException "ClientException" +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ErrCodeServerException "ServerException" +// These errors are usually caused by a server-side issue. +// +// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// The service is unavailable. Back off and retry the operation. +// +// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListNodegroups +func (c *EKS) ListNodegroups(input *ListNodegroupsInput) (*ListNodegroupsOutput, error) { + req, out := c.ListNodegroupsRequest(input) + return out, req.Send() +} + +// ListNodegroupsWithContext is the same as ListNodegroups with the addition of +// the ability to pass a context and additional request options. +// +// See ListNodegroups 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 *EKS) ListNodegroupsWithContext(ctx aws.Context, input *ListNodegroupsInput, opts ...request.Option) (*ListNodegroupsOutput, error) { + req, out := c.ListNodegroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListNodegroupsPages iterates over the pages of a ListNodegroups operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListNodegroups 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 ListNodegroups operation. +// pageNum := 0 +// err := client.ListNodegroupsPages(params, +// func(page *eks.ListNodegroupsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EKS) ListNodegroupsPages(input *ListNodegroupsInput, fn func(*ListNodegroupsOutput, bool) bool) error { + return c.ListNodegroupsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListNodegroupsPagesWithContext same as ListNodegroupsPages 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 *EKS) ListNodegroupsPagesWithContext(ctx aws.Context, input *ListNodegroupsInput, fn func(*ListNodegroupsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListNodegroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListNodegroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListNodegroupsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListTagsForResource +func (c *EKS) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { + op := &request.Operation{ + Name: opListTagsForResource, + HTTPMethod: "GET", + HTTPPath: "/tags/{resourceArn}", + } + + if input == nil { + input = &ListTagsForResourceInput{} + } + + output = &ListTagsForResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTagsForResource API operation for Amazon Elastic Kubernetes Service. +// +// List the tags for an Amazon EKS resource. +// +// 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 Elastic Kubernetes Service's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Codes: +// * ErrCodeBadRequestException "BadRequestException" +// This exception is thrown if the request contains a semantic error. The precise +// meaning will depend on the API, and will be documented in the error message. +// +// * ErrCodeNotFoundException "NotFoundException" +// A service resource associated with the request could not be found. Clients +// should not retry such requests. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListTagsForResource +func (c *EKS) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource 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 *EKS) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListUpdates = "ListUpdates" + +// ListUpdatesRequest generates a "aws/request.Request" representing the +// client's request for the ListUpdates operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListUpdates for more information on using the ListUpdates +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListUpdatesRequest method. +// req, resp := client.ListUpdatesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListUpdates +func (c *EKS) ListUpdatesRequest(input *ListUpdatesInput) (req *request.Request, output *ListUpdatesOutput) { + op := &request.Operation{ + Name: opListUpdates, + HTTPMethod: "GET", + HTTPPath: "/clusters/{name}/updates", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListUpdatesInput{} + } + + output = &ListUpdatesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListUpdates API operation for Amazon Elastic Kubernetes Service. +// +// Lists the updates associated with an Amazon EKS cluster or managed node group +// in your AWS account, in the specified Region. +// +// 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 Elastic Kubernetes Service's +// API operation ListUpdates for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidParameterException "InvalidParameterException" +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ErrCodeClientException "ClientException" +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ErrCodeServerException "ServerException" +// These errors are usually caused by a server-side issue. +// +// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListUpdates +func (c *EKS) ListUpdates(input *ListUpdatesInput) (*ListUpdatesOutput, error) { + req, out := c.ListUpdatesRequest(input) + return out, req.Send() +} + +// ListUpdatesWithContext is the same as ListUpdates with the addition of +// the ability to pass a context and additional request options. +// +// See ListUpdates 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 *EKS) ListUpdatesWithContext(ctx aws.Context, input *ListUpdatesInput, opts ...request.Option) (*ListUpdatesOutput, error) { + req, out := c.ListUpdatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListUpdatesPages iterates over the pages of a ListUpdates operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListUpdates 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 ListUpdates operation. +// pageNum := 0 +// err := client.ListUpdatesPages(params, +// func(page *eks.ListUpdatesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EKS) ListUpdatesPages(input *ListUpdatesInput, fn func(*ListUpdatesOutput, bool) bool) error { + return c.ListUpdatesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListUpdatesPagesWithContext same as ListUpdatesPages 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 *EKS) ListUpdatesPagesWithContext(ctx aws.Context, input *ListUpdatesInput, fn func(*ListUpdatesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListUpdatesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListUpdatesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListUpdatesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/TagResource +func (c *EKS) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { + op := &request.Operation{ + Name: opTagResource, + HTTPMethod: "POST", + HTTPPath: "/tags/{resourceArn}", + } + + if input == nil { + input = &TagResourceInput{} + } + + output = &TagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagResource API operation for Amazon Elastic Kubernetes Service. +// +// Associates the specified tags to a resource with the specified resourceArn. +// If existing tags on a resource are not specified in the request parameters, +// they are not changed. When a resource is deleted, the tags associated with +// that resource are deleted as well. Tags that you create for Amazon EKS resources +// do not propagate to any other resources associated with the cluster. For +// example, if you tag a cluster with this operation, that tag does not automatically +// propagate to the subnets and worker nodes associated with the cluster. +// +// 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 Elastic Kubernetes Service's +// API operation TagResource for usage and error information. +// +// Returned Error Codes: +// * ErrCodeBadRequestException "BadRequestException" +// This exception is thrown if the request contains a semantic error. The precise +// meaning will depend on the API, and will be documented in the error message. +// +// * ErrCodeNotFoundException "NotFoundException" +// A service resource associated with the request could not be found. Clients +// should not retry such requests. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/TagResource +func (c *EKS) 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 *EKS) 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 opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UntagResource +func (c *EKS) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { + op := &request.Operation{ + Name: opUntagResource, + HTTPMethod: "DELETE", + HTTPPath: "/tags/{resourceArn}", + } + + if input == nil { + input = &UntagResourceInput{} + } + + output = &UntagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for Amazon Elastic Kubernetes Service. +// +// Deletes specified tags from a resource. +// +// 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 Elastic Kubernetes Service's +// API operation UntagResource for usage and error information. +// +// Returned Error Codes: +// * ErrCodeBadRequestException "BadRequestException" +// This exception is thrown if the request contains a semantic error. The precise +// meaning will depend on the API, and will be documented in the error message. +// +// * ErrCodeNotFoundException "NotFoundException" +// A service resource associated with the request could not be found. Clients +// should not retry such requests. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UntagResource +func (c *EKS) 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 *EKS) 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 opUpdateClusterConfig = "UpdateClusterConfig" + +// UpdateClusterConfigRequest generates a "aws/request.Request" representing the +// client's request for the UpdateClusterConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateClusterConfig for more information on using the UpdateClusterConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateClusterConfigRequest method. +// req, resp := client.UpdateClusterConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateClusterConfig +func (c *EKS) UpdateClusterConfigRequest(input *UpdateClusterConfigInput) (req *request.Request, output *UpdateClusterConfigOutput) { + op := &request.Operation{ + Name: opUpdateClusterConfig, + HTTPMethod: "POST", + HTTPPath: "/clusters/{name}/update-config", + } + + if input == nil { + input = &UpdateClusterConfigInput{} + } + + output = &UpdateClusterConfigOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateClusterConfig API operation for Amazon Elastic Kubernetes Service. +// +// Updates an Amazon EKS cluster configuration. Your cluster continues to function +// during the update. The response output includes an update ID that you can +// use to track the status of your cluster update with the DescribeUpdate API +// operation. +// +// You can use this API operation to enable or disable exporting the Kubernetes +// control plane logs for your cluster to CloudWatch Logs. By default, cluster +// control plane logs aren't exported to CloudWatch Logs. For more information, +// see Amazon EKS Cluster Control Plane Logs (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) +// in the Amazon EKS User Guide . +// +// CloudWatch Logs ingestion, archive storage, and data scanning rates apply +// to exported control plane logs. For more information, see Amazon CloudWatch +// Pricing (http://aws.amazon.com/cloudwatch/pricing/). +// +// You can also use this API operation to enable or disable public and private +// access to your cluster's Kubernetes API server endpoint. By default, public +// access is enabled, and private access is disabled. For more information, +// see Amazon EKS Cluster Endpoint Access Control (https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html) +// in the Amazon EKS User Guide . +// +// At this time, you can not update the subnets or security group IDs for an +// existing cluster. +// +// Cluster updates are asynchronous, and they should finish within a few minutes. +// During an update, the cluster status moves to UPDATING (this status transition +// is eventually consistent). When the update is complete (either Failed or +// Successful), the cluster status moves to Active. +// +// 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 Elastic Kubernetes Service's +// API operation UpdateClusterConfig for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidParameterException "InvalidParameterException" +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ErrCodeClientException "ClientException" +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ErrCodeServerException "ServerException" +// These errors are usually caused by a server-side issue. +// +// * ErrCodeResourceInUseException "ResourceInUseException" +// The specified resource is in use. +// +// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is invalid given the state of the cluster. Check the state of +// the cluster and the associated operations. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateClusterConfig +func (c *EKS) UpdateClusterConfig(input *UpdateClusterConfigInput) (*UpdateClusterConfigOutput, error) { + req, out := c.UpdateClusterConfigRequest(input) + return out, req.Send() +} + +// UpdateClusterConfigWithContext is the same as UpdateClusterConfig with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateClusterConfig 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 *EKS) UpdateClusterConfigWithContext(ctx aws.Context, input *UpdateClusterConfigInput, opts ...request.Option) (*UpdateClusterConfigOutput, error) { + req, out := c.UpdateClusterConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateClusterVersion = "UpdateClusterVersion" + +// UpdateClusterVersionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateClusterVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateClusterVersion for more information on using the UpdateClusterVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateClusterVersionRequest method. +// req, resp := client.UpdateClusterVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateClusterVersion +func (c *EKS) UpdateClusterVersionRequest(input *UpdateClusterVersionInput) (req *request.Request, output *UpdateClusterVersionOutput) { + op := &request.Operation{ + Name: opUpdateClusterVersion, + HTTPMethod: "POST", + HTTPPath: "/clusters/{name}/updates", + } + + if input == nil { + input = &UpdateClusterVersionInput{} + } + + output = &UpdateClusterVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateClusterVersion API operation for Amazon Elastic Kubernetes Service. +// +// Updates an Amazon EKS cluster to the specified Kubernetes version. Your cluster +// continues to function during the update. The response output includes an +// update ID that you can use to track the status of your cluster update with +// the DescribeUpdate API operation. +// +// Cluster updates are asynchronous, and they should finish within a few minutes. +// During an update, the cluster status moves to UPDATING (this status transition +// is eventually consistent). When the update is complete (either Failed or +// Successful), the cluster status moves to Active. +// +// If your cluster has managed node groups attached to it, all of your node +// groups’ Kubernetes versions must match the cluster’s Kubernetes version +// in order to update the cluster to a new Kubernetes version. +// +// 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 Elastic Kubernetes Service's +// API operation UpdateClusterVersion for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidParameterException "InvalidParameterException" +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ErrCodeClientException "ClientException" +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ErrCodeServerException "ServerException" +// These errors are usually caused by a server-side issue. +// +// * ErrCodeResourceInUseException "ResourceInUseException" +// The specified resource is in use. +// +// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is invalid given the state of the cluster. Check the state of +// the cluster and the associated operations. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateClusterVersion +func (c *EKS) UpdateClusterVersion(input *UpdateClusterVersionInput) (*UpdateClusterVersionOutput, error) { + req, out := c.UpdateClusterVersionRequest(input) + return out, req.Send() +} + +// UpdateClusterVersionWithContext is the same as UpdateClusterVersion with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateClusterVersion 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 *EKS) UpdateClusterVersionWithContext(ctx aws.Context, input *UpdateClusterVersionInput, opts ...request.Option) (*UpdateClusterVersionOutput, error) { + req, out := c.UpdateClusterVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateNodegroupConfig = "UpdateNodegroupConfig" + +// UpdateNodegroupConfigRequest generates a "aws/request.Request" representing the +// client's request for the UpdateNodegroupConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateNodegroupConfig for more information on using the UpdateNodegroupConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateNodegroupConfigRequest method. +// req, resp := client.UpdateNodegroupConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateNodegroupConfig +func (c *EKS) UpdateNodegroupConfigRequest(input *UpdateNodegroupConfigInput) (req *request.Request, output *UpdateNodegroupConfigOutput) { + op := &request.Operation{ + Name: opUpdateNodegroupConfig, + HTTPMethod: "POST", + HTTPPath: "/clusters/{name}/node-groups/{nodegroupName}/update-config", + } + + if input == nil { + input = &UpdateNodegroupConfigInput{} + } + + output = &UpdateNodegroupConfigOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateNodegroupConfig API operation for Amazon Elastic Kubernetes Service. +// +// Updates an Amazon EKS managed node group configuration. Your node group continues +// to function during the update. The response output includes an update ID +// that you can use to track the status of your node group update with the DescribeUpdate +// API operation. Currently you can update the Kubernetes labels for a node +// group or the scaling configuration. +// +// 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 Elastic Kubernetes Service's +// API operation UpdateNodegroupConfig for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidParameterException "InvalidParameterException" +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ErrCodeClientException "ClientException" +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ErrCodeServerException "ServerException" +// These errors are usually caused by a server-side issue. +// +// * ErrCodeResourceInUseException "ResourceInUseException" +// The specified resource is in use. +// +// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is invalid given the state of the cluster. Check the state of +// the cluster and the associated operations. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateNodegroupConfig +func (c *EKS) UpdateNodegroupConfig(input *UpdateNodegroupConfigInput) (*UpdateNodegroupConfigOutput, error) { + req, out := c.UpdateNodegroupConfigRequest(input) + return out, req.Send() +} + +// UpdateNodegroupConfigWithContext is the same as UpdateNodegroupConfig with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateNodegroupConfig 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 *EKS) UpdateNodegroupConfigWithContext(ctx aws.Context, input *UpdateNodegroupConfigInput, opts ...request.Option) (*UpdateNodegroupConfigOutput, error) { + req, out := c.UpdateNodegroupConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateNodegroupVersion = "UpdateNodegroupVersion" + +// UpdateNodegroupVersionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateNodegroupVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateNodegroupVersion for more information on using the UpdateNodegroupVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateNodegroupVersionRequest method. +// req, resp := client.UpdateNodegroupVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateNodegroupVersion +func (c *EKS) UpdateNodegroupVersionRequest(input *UpdateNodegroupVersionInput) (req *request.Request, output *UpdateNodegroupVersionOutput) { + op := &request.Operation{ + Name: opUpdateNodegroupVersion, + HTTPMethod: "POST", + HTTPPath: "/clusters/{name}/node-groups/{nodegroupName}/update-version", + } + + if input == nil { + input = &UpdateNodegroupVersionInput{} + } + + output = &UpdateNodegroupVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateNodegroupVersion API operation for Amazon Elastic Kubernetes Service. +// +// Updates the Kubernetes version or AMI version of an Amazon EKS managed node +// group. +// +// You can update to the latest available AMI version of a node group's current +// Kubernetes version by not specifying a Kubernetes version in the request. +// You can update to the latest AMI version of your cluster's current Kubernetes +// version by specifying your cluster's Kubernetes version in the request. For +// more information, see Amazon EKS-Optimized Linux AMI Versions (https://docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html) +// in the Amazon EKS User Guide. +// +// You cannot roll back a node group to an earlier Kubernetes version or AMI +// version. +// +// When a node in a managed node group is terminated due to a scaling action +// or update, the pods in that node are drained first. Amazon EKS attempts to +// drain the nodes gracefully and will fail if it is unable to do so. You can +// force the update if Amazon EKS is unable to drain the nodes as a result of +// a pod disruption budget issue. +// +// 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 Elastic Kubernetes Service's +// API operation UpdateNodegroupVersion for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidParameterException "InvalidParameterException" +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ErrCodeClientException "ClientException" +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ErrCodeServerException "ServerException" +// These errors are usually caused by a server-side issue. +// +// * ErrCodeResourceInUseException "ResourceInUseException" +// The specified resource is in use. +// +// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// * ErrCodeInvalidRequestException "InvalidRequestException" +// The request is invalid given the state of the cluster. Check the state of +// the cluster and the associated operations. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateNodegroupVersion +func (c *EKS) UpdateNodegroupVersion(input *UpdateNodegroupVersionInput) (*UpdateNodegroupVersionOutput, error) { + req, out := c.UpdateNodegroupVersionRequest(input) + return out, req.Send() +} + +// UpdateNodegroupVersionWithContext is the same as UpdateNodegroupVersion with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateNodegroupVersion 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 *EKS) UpdateNodegroupVersionWithContext(ctx aws.Context, input *UpdateNodegroupVersionInput, opts ...request.Option) (*UpdateNodegroupVersionOutput, error) { + req, out := c.UpdateNodegroupVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// An Auto Scaling group that is associated with an Amazon EKS managed node +// group. +type AutoScalingGroup struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group associated with an Amazon EKS managed + // node group. + Name *string `locationName:"name" type:"string"` +} + +// String returns the string representation +func (s AutoScalingGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutoScalingGroup) GoString() string { + return s.String() +} + +// SetName sets the Name field's value. +func (s *AutoScalingGroup) SetName(v string) *AutoScalingGroup { + s.Name = &v + return s +} + +// An object representing the certificate-authority-data for your cluster. +type Certificate struct { + _ struct{} `type:"structure"` + + // The Base64-encoded certificate data required to communicate with your cluster. + // Add this to the certificate-authority-data section of the kubeconfig file + // for your cluster. + Data *string `locationName:"data" type:"string"` +} + +// String returns the string representation +func (s Certificate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Certificate) GoString() string { + return s.String() +} + +// SetData sets the Data field's value. +func (s *Certificate) SetData(v string) *Certificate { + s.Data = &v + return s +} + +// An object representing an Amazon EKS cluster. +type Cluster struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the cluster. + Arn *string `locationName:"arn" type:"string"` + + // The certificate-authority-data for your cluster. + CertificateAuthority *Certificate `locationName:"certificateAuthority" type:"structure"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string"` + + // The Unix epoch timestamp in seconds for when the cluster was created. + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` + + // The endpoint for your Kubernetes API server. + Endpoint *string `locationName:"endpoint" type:"string"` + + // The identity provider information for the cluster. + Identity *Identity `locationName:"identity" type:"structure"` + + // The logging configuration for your cluster. + Logging *Logging `locationName:"logging" type:"structure"` + + // The name of the cluster. + Name *string `locationName:"name" type:"string"` + + // The platform version of your Amazon EKS cluster. For more information, see + // Platform Versions (https://docs.aws.amazon.com/eks/latest/userguide/platform-versions.html) + // in the Amazon EKS User Guide . + PlatformVersion *string `locationName:"platformVersion" type:"string"` + + // The VPC configuration used by the cluster control plane. Amazon EKS VPC resources + // have specific requirements to work properly with Kubernetes. For more information, + // see Cluster VPC Considerations (https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html) + // and Cluster Security Group Considerations (https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html) + // in the Amazon EKS User Guide. + ResourcesVpcConfig *VpcConfigResponse `locationName:"resourcesVpcConfig" type:"structure"` + + // The Amazon Resource Name (ARN) of the IAM role that provides permissions + // for the Kubernetes control plane to make calls to AWS API operations on your + // behalf. + RoleArn *string `locationName:"roleArn" type:"string"` + + // The current status of the cluster. + Status *string `locationName:"status" type:"string" enum:"ClusterStatus"` + + // The metadata that you apply to the cluster to assist with categorization + // and organization. Each tag consists of a key and an optional value, both + // of which you define. Cluster tags do not propagate to any other resources + // associated with the cluster. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The Kubernetes server version for the cluster. + Version *string `locationName:"version" type:"string"` +} + +// String returns the string representation +func (s Cluster) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Cluster) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *Cluster) SetArn(v string) *Cluster { + s.Arn = &v + return s +} + +// SetCertificateAuthority sets the CertificateAuthority field's value. +func (s *Cluster) SetCertificateAuthority(v *Certificate) *Cluster { + s.CertificateAuthority = v + return s +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *Cluster) SetClientRequestToken(v string) *Cluster { + s.ClientRequestToken = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *Cluster) SetCreatedAt(v time.Time) *Cluster { + s.CreatedAt = &v + return s +} + +// SetEndpoint sets the Endpoint field's value. +func (s *Cluster) SetEndpoint(v string) *Cluster { + s.Endpoint = &v + return s +} + +// SetIdentity sets the Identity field's value. +func (s *Cluster) SetIdentity(v *Identity) *Cluster { + s.Identity = v + return s +} + +// SetLogging sets the Logging field's value. +func (s *Cluster) SetLogging(v *Logging) *Cluster { + s.Logging = v + return s +} + +// SetName sets the Name field's value. +func (s *Cluster) SetName(v string) *Cluster { + s.Name = &v + return s +} + +// SetPlatformVersion sets the PlatformVersion field's value. +func (s *Cluster) SetPlatformVersion(v string) *Cluster { + s.PlatformVersion = &v + return s +} + +// SetResourcesVpcConfig sets the ResourcesVpcConfig field's value. +func (s *Cluster) SetResourcesVpcConfig(v *VpcConfigResponse) *Cluster { + s.ResourcesVpcConfig = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *Cluster) SetRoleArn(v string) *Cluster { + s.RoleArn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *Cluster) SetStatus(v string) *Cluster { + s.Status = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *Cluster) SetTags(v map[string]*string) *Cluster { + s.Tags = v + return s +} + +// SetVersion sets the Version field's value. +func (s *Cluster) SetVersion(v string) *Cluster { + s.Version = &v + return s +} + +type CreateClusterInput struct { + _ struct{} `type:"structure"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` + + // Enable or disable exporting the Kubernetes control plane logs for your cluster + // to CloudWatch Logs. By default, cluster control plane logs aren't exported + // to CloudWatch Logs. For more information, see Amazon EKS Cluster Control + // Plane Logs (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) + // in the Amazon EKS User Guide . + // + // CloudWatch Logs ingestion, archive storage, and data scanning rates apply + // to exported control plane logs. For more information, see Amazon CloudWatch + // Pricing (http://aws.amazon.com/cloudwatch/pricing/). + Logging *Logging `locationName:"logging" type:"structure"` + + // The unique name to give to your cluster. + // + // Name is a required field + Name *string `locationName:"name" min:"1" type:"string" required:"true"` + + // The VPC configuration used by the cluster control plane. Amazon EKS VPC resources + // have specific requirements to work properly with Kubernetes. For more information, + // see Cluster VPC Considerations (https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html) + // and Cluster Security Group Considerations (https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html) + // in the Amazon EKS User Guide. You must specify at least two subnets. You + // can specify up to five security groups, but we recommend that you use a dedicated + // security group for your cluster control plane. + // + // ResourcesVpcConfig is a required field + ResourcesVpcConfig *VpcConfigRequest `locationName:"resourcesVpcConfig" type:"structure" required:"true"` + + // The Amazon Resource Name (ARN) of the IAM role that provides permissions + // for Amazon EKS to make calls to other AWS API operations on your behalf. + // For more information, see Amazon EKS Service IAM Role (https://docs.aws.amazon.com/eks/latest/userguide/service_IAM_role.html) + // in the Amazon EKS User Guide . + // + // RoleArn is a required field + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` + + // The metadata to apply to the cluster to assist with categorization and organization. + // Each tag consists of a key and an optional value, both of which you define. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The desired Kubernetes version for your cluster. If you don't specify a value + // here, the latest version available in Amazon EKS is used. + Version *string `locationName:"version" type:"string"` +} + +// String returns the string representation +func (s CreateClusterInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateClusterInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateClusterInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateClusterInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.ResourcesVpcConfig == nil { + invalidParams.Add(request.NewErrParamRequired("ResourcesVpcConfig")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *CreateClusterInput) SetClientRequestToken(v string) *CreateClusterInput { + s.ClientRequestToken = &v + return s +} + +// SetLogging sets the Logging field's value. +func (s *CreateClusterInput) SetLogging(v *Logging) *CreateClusterInput { + s.Logging = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateClusterInput) SetName(v string) *CreateClusterInput { + s.Name = &v + return s +} + +// SetResourcesVpcConfig sets the ResourcesVpcConfig field's value. +func (s *CreateClusterInput) SetResourcesVpcConfig(v *VpcConfigRequest) *CreateClusterInput { + s.ResourcesVpcConfig = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *CreateClusterInput) SetRoleArn(v string) *CreateClusterInput { + s.RoleArn = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateClusterInput) SetTags(v map[string]*string) *CreateClusterInput { + s.Tags = v + return s +} + +// SetVersion sets the Version field's value. +func (s *CreateClusterInput) SetVersion(v string) *CreateClusterInput { + s.Version = &v + return s +} + +type CreateClusterOutput struct { + _ struct{} `type:"structure"` + + // The full description of your new cluster. + Cluster *Cluster `locationName:"cluster" type:"structure"` +} + +// String returns the string representation +func (s CreateClusterOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateClusterOutput) GoString() string { + return s.String() +} + +// SetCluster sets the Cluster field's value. +func (s *CreateClusterOutput) SetCluster(v *Cluster) *CreateClusterOutput { + s.Cluster = v + return s +} + +type CreateFargateProfileInput struct { + _ struct{} `type:"structure"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` + + // The name of the Amazon EKS cluster to apply the Fargate profile to. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The name of the Fargate profile. + // + // FargateProfileName is a required field + FargateProfileName *string `locationName:"fargateProfileName" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the pod execution role to use for pods + // that match the selectors in the Fargate profile. The pod execution role allows + // Fargate infrastructure to register with your cluster as a node, and it provides + // read access to Amazon ECR image repositories. For more information, see Pod + // Execution Role (https://docs.aws.amazon.com/eks/latest/userguide/pod-execution-role.html) + // in the Amazon EKS User Guide. + // + // PodExecutionRoleArn is a required field + PodExecutionRoleArn *string `locationName:"podExecutionRoleArn" type:"string" required:"true"` + + // The selectors to match for pods to use this Fargate profile. Each selector + // must have an associated namespace. Optionally, you can also specify labels + // for a namespace. You may specify up to five selectors in a Fargate profile. + Selectors []*FargateProfileSelector `locationName:"selectors" type:"list"` + + // The IDs of subnets to launch Fargate pods into. At this time, Fargate pods + // are not assigned public IP addresses, so only private subnets (with no direct + // route to an Internet Gateway) are accepted for this parameter. + Subnets []*string `locationName:"subnets" type:"list"` + + // The metadata to apply to the Fargate profile to assist with categorization + // and organization. Each tag consists of a key and an optional value, both + // of which you define. Fargate profile tags do not propagate to any other resources + // associated with the Fargate profile, such as the pods that are scheduled + // with it. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` +} + +// String returns the string representation +func (s CreateFargateProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateFargateProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateFargateProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateFargateProfileInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.FargateProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("FargateProfileName")) + } + if s.PodExecutionRoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("PodExecutionRoleArn")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *CreateFargateProfileInput) SetClientRequestToken(v string) *CreateFargateProfileInput { + s.ClientRequestToken = &v + return s +} + +// SetClusterName sets the ClusterName field's value. +func (s *CreateFargateProfileInput) SetClusterName(v string) *CreateFargateProfileInput { + s.ClusterName = &v + return s +} + +// SetFargateProfileName sets the FargateProfileName field's value. +func (s *CreateFargateProfileInput) SetFargateProfileName(v string) *CreateFargateProfileInput { + s.FargateProfileName = &v + return s +} + +// SetPodExecutionRoleArn sets the PodExecutionRoleArn field's value. +func (s *CreateFargateProfileInput) SetPodExecutionRoleArn(v string) *CreateFargateProfileInput { + s.PodExecutionRoleArn = &v + return s +} + +// SetSelectors sets the Selectors field's value. +func (s *CreateFargateProfileInput) SetSelectors(v []*FargateProfileSelector) *CreateFargateProfileInput { + s.Selectors = v + return s +} + +// SetSubnets sets the Subnets field's value. +func (s *CreateFargateProfileInput) SetSubnets(v []*string) *CreateFargateProfileInput { + s.Subnets = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateFargateProfileInput) SetTags(v map[string]*string) *CreateFargateProfileInput { + s.Tags = v + return s +} + +type CreateFargateProfileOutput struct { + _ struct{} `type:"structure"` + + // The full description of your new Fargate profile. + FargateProfile *FargateProfile `locationName:"fargateProfile" type:"structure"` +} + +// String returns the string representation +func (s CreateFargateProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateFargateProfileOutput) GoString() string { + return s.String() +} + +// SetFargateProfile sets the FargateProfile field's value. +func (s *CreateFargateProfileOutput) SetFargateProfile(v *FargateProfile) *CreateFargateProfileOutput { + s.FargateProfile = v + return s +} + +type CreateNodegroupInput struct { + _ struct{} `type:"structure"` + + // The AMI type for your node group. GPU instance types should use the AL2_x86_64_GPU + // AMI type, which uses the Amazon EKS-optimized Linux AMI with GPU support. + // Non-GPU instances should use the AL2_x86_64 AMI type, which uses the Amazon + // EKS-optimized Linux AMI. + AmiType *string `locationName:"amiType" type:"string" enum:"AMITypes"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` + + // The name of the cluster to create the node group in. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The root device disk size (in GiB) for your node group instances. The default + // disk size is 20 GiB. + DiskSize *int64 `locationName:"diskSize" type:"integer"` + + // The instance type to use for your node group. Currently, you can specify + // a single instance type for a node group. The default value for this parameter + // is t3.medium. If you choose a GPU instance type, be sure to specify the AL2_x86_64_GPU + // with the amiType parameter. + InstanceTypes []*string `locationName:"instanceTypes" type:"list"` + + // The Kubernetes labels to be applied to the nodes in the node group when they + // are created. + Labels map[string]*string `locationName:"labels" type:"map"` + + // The IAM role associated with your node group. The Amazon EKS worker node + // kubelet daemon makes calls to AWS APIs on your behalf. Worker nodes receive + // permissions for these API calls through an IAM instance profile and associated + // policies. Before you can launch worker nodes and register them into a cluster, + // you must create an IAM role for those worker nodes to use when they are launched. + // For more information, see Amazon EKS Worker Node IAM Role (https://docs.aws.amazon.com/eks/latest/userguide/worker_node_IAM_role.html) + // in the Amazon EKS User Guide . + // + // NodeRole is a required field + NodeRole *string `locationName:"nodeRole" type:"string" required:"true"` + + // The unique name to give your node group. + // + // NodegroupName is a required field + NodegroupName *string `locationName:"nodegroupName" type:"string" required:"true"` + + // The AMI version of the Amazon EKS-optimized AMI to use with your node group. + // By default, the latest available AMI version for the node group's current + // Kubernetes version is used. For more information, see Amazon EKS-Optimized + // Linux AMI Versions (https://docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html) + // in the Amazon EKS User Guide. + ReleaseVersion *string `locationName:"releaseVersion" type:"string"` + + // The remote access (SSH) configuration to use with your node group. + RemoteAccess *RemoteAccessConfig `locationName:"remoteAccess" type:"structure"` + + // The scaling configuration details for the Auto Scaling group that is created + // for your node group. + ScalingConfig *NodegroupScalingConfig `locationName:"scalingConfig" type:"structure"` + + // The subnets to use for the Auto Scaling group that is created for your node + // group. These subnets must have the tag key kubernetes.io/cluster/CLUSTER_NAME + // with a value of shared, where CLUSTER_NAME is replaced with the name of your + // cluster. + // + // Subnets is a required field + Subnets []*string `locationName:"subnets" type:"list" required:"true"` + + // The metadata to apply to the node group to assist with categorization and + // organization. Each tag consists of a key and an optional value, both of which + // you define. Node group tags do not propagate to any other resources associated + // with the node group, such as the Amazon EC2 instances or subnets. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The Kubernetes version to use for your managed nodes. By default, the Kubernetes + // version of the cluster is used, and this is the only accepted specified value. + Version *string `locationName:"version" type:"string"` +} + +// String returns the string representation +func (s CreateNodegroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNodegroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateNodegroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateNodegroupInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.NodeRole == nil { + invalidParams.Add(request.NewErrParamRequired("NodeRole")) + } + if s.NodegroupName == nil { + invalidParams.Add(request.NewErrParamRequired("NodegroupName")) + } + if s.Subnets == nil { + invalidParams.Add(request.NewErrParamRequired("Subnets")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + if s.ScalingConfig != nil { + if err := s.ScalingConfig.Validate(); err != nil { + invalidParams.AddNested("ScalingConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmiType sets the AmiType field's value. +func (s *CreateNodegroupInput) SetAmiType(v string) *CreateNodegroupInput { + s.AmiType = &v + return s +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *CreateNodegroupInput) SetClientRequestToken(v string) *CreateNodegroupInput { + s.ClientRequestToken = &v + return s +} + +// SetClusterName sets the ClusterName field's value. +func (s *CreateNodegroupInput) SetClusterName(v string) *CreateNodegroupInput { + s.ClusterName = &v + return s +} + +// SetDiskSize sets the DiskSize field's value. +func (s *CreateNodegroupInput) SetDiskSize(v int64) *CreateNodegroupInput { + s.DiskSize = &v + return s +} + +// SetInstanceTypes sets the InstanceTypes field's value. +func (s *CreateNodegroupInput) SetInstanceTypes(v []*string) *CreateNodegroupInput { + s.InstanceTypes = v + return s +} + +// SetLabels sets the Labels field's value. +func (s *CreateNodegroupInput) SetLabels(v map[string]*string) *CreateNodegroupInput { + s.Labels = v + return s +} + +// SetNodeRole sets the NodeRole field's value. +func (s *CreateNodegroupInput) SetNodeRole(v string) *CreateNodegroupInput { + s.NodeRole = &v + return s +} + +// SetNodegroupName sets the NodegroupName field's value. +func (s *CreateNodegroupInput) SetNodegroupName(v string) *CreateNodegroupInput { + s.NodegroupName = &v + return s +} + +// SetReleaseVersion sets the ReleaseVersion field's value. +func (s *CreateNodegroupInput) SetReleaseVersion(v string) *CreateNodegroupInput { + s.ReleaseVersion = &v + return s +} + +// SetRemoteAccess sets the RemoteAccess field's value. +func (s *CreateNodegroupInput) SetRemoteAccess(v *RemoteAccessConfig) *CreateNodegroupInput { + s.RemoteAccess = v + return s +} + +// SetScalingConfig sets the ScalingConfig field's value. +func (s *CreateNodegroupInput) SetScalingConfig(v *NodegroupScalingConfig) *CreateNodegroupInput { + s.ScalingConfig = v + return s +} + +// SetSubnets sets the Subnets field's value. +func (s *CreateNodegroupInput) SetSubnets(v []*string) *CreateNodegroupInput { + s.Subnets = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateNodegroupInput) SetTags(v map[string]*string) *CreateNodegroupInput { + s.Tags = v + return s +} + +// SetVersion sets the Version field's value. +func (s *CreateNodegroupInput) SetVersion(v string) *CreateNodegroupInput { + s.Version = &v + return s +} + +type CreateNodegroupOutput struct { + _ struct{} `type:"structure"` + + // The full description of your new node group. + Nodegroup *Nodegroup `locationName:"nodegroup" type:"structure"` +} + +// String returns the string representation +func (s CreateNodegroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNodegroupOutput) GoString() string { + return s.String() +} + +// SetNodegroup sets the Nodegroup field's value. +func (s *CreateNodegroupOutput) SetNodegroup(v *Nodegroup) *CreateNodegroupOutput { + s.Nodegroup = v + return s +} + +type DeleteClusterInput struct { + _ struct{} `type:"structure"` + + // The name of the cluster to delete. + // + // Name is a required field + Name *string `location:"uri" locationName:"name" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteClusterInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteClusterInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteClusterInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteClusterInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DeleteClusterInput) SetName(v string) *DeleteClusterInput { + s.Name = &v + return s +} + +type DeleteClusterOutput struct { + _ struct{} `type:"structure"` + + // The full description of the cluster to delete. + Cluster *Cluster `locationName:"cluster" type:"structure"` +} + +// String returns the string representation +func (s DeleteClusterOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteClusterOutput) GoString() string { + return s.String() +} + +// SetCluster sets the Cluster field's value. +func (s *DeleteClusterOutput) SetCluster(v *Cluster) *DeleteClusterOutput { + s.Cluster = v + return s +} + +type DeleteFargateProfileInput struct { + _ struct{} `type:"structure"` + + // The name of the Amazon EKS cluster associated with the Fargate profile to + // delete. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The name of the Fargate profile to delete. + // + // FargateProfileName is a required field + FargateProfileName *string `location:"uri" locationName:"fargateProfileName" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteFargateProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFargateProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteFargateProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteFargateProfileInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.FargateProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("FargateProfileName")) + } + if s.FargateProfileName != nil && len(*s.FargateProfileName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FargateProfileName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterName sets the ClusterName field's value. +func (s *DeleteFargateProfileInput) SetClusterName(v string) *DeleteFargateProfileInput { + s.ClusterName = &v + return s +} + +// SetFargateProfileName sets the FargateProfileName field's value. +func (s *DeleteFargateProfileInput) SetFargateProfileName(v string) *DeleteFargateProfileInput { + s.FargateProfileName = &v + return s +} + +type DeleteFargateProfileOutput struct { + _ struct{} `type:"structure"` + + // The deleted Fargate profile. + FargateProfile *FargateProfile `locationName:"fargateProfile" type:"structure"` +} + +// String returns the string representation +func (s DeleteFargateProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFargateProfileOutput) GoString() string { + return s.String() +} + +// SetFargateProfile sets the FargateProfile field's value. +func (s *DeleteFargateProfileOutput) SetFargateProfile(v *FargateProfile) *DeleteFargateProfileOutput { + s.FargateProfile = v + return s +} + +type DeleteNodegroupInput struct { + _ struct{} `type:"structure"` + + // The name of the Amazon EKS cluster that is associated with your node group. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The name of the node group to delete. + // + // NodegroupName is a required field + NodegroupName *string `location:"uri" locationName:"nodegroupName" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteNodegroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNodegroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteNodegroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteNodegroupInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.NodegroupName == nil { + invalidParams.Add(request.NewErrParamRequired("NodegroupName")) + } + if s.NodegroupName != nil && len(*s.NodegroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NodegroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterName sets the ClusterName field's value. +func (s *DeleteNodegroupInput) SetClusterName(v string) *DeleteNodegroupInput { + s.ClusterName = &v + return s +} + +// SetNodegroupName sets the NodegroupName field's value. +func (s *DeleteNodegroupInput) SetNodegroupName(v string) *DeleteNodegroupInput { + s.NodegroupName = &v + return s +} + +type DeleteNodegroupOutput struct { + _ struct{} `type:"structure"` + + // The full description of your deleted node group. + Nodegroup *Nodegroup `locationName:"nodegroup" type:"structure"` +} + +// String returns the string representation +func (s DeleteNodegroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNodegroupOutput) GoString() string { + return s.String() +} + +// SetNodegroup sets the Nodegroup field's value. +func (s *DeleteNodegroupOutput) SetNodegroup(v *Nodegroup) *DeleteNodegroupOutput { + s.Nodegroup = v + return s +} + +type DescribeClusterInput struct { + _ struct{} `type:"structure"` + + // The name of the cluster to describe. + // + // Name is a required field + Name *string `location:"uri" locationName:"name" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeClusterInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeClusterInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeClusterInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeClusterInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DescribeClusterInput) SetName(v string) *DescribeClusterInput { + s.Name = &v + return s +} + +type DescribeClusterOutput struct { + _ struct{} `type:"structure"` + + // The full description of your specified cluster. + Cluster *Cluster `locationName:"cluster" type:"structure"` +} + +// String returns the string representation +func (s DescribeClusterOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeClusterOutput) GoString() string { + return s.String() +} + +// SetCluster sets the Cluster field's value. +func (s *DescribeClusterOutput) SetCluster(v *Cluster) *DescribeClusterOutput { + s.Cluster = v + return s +} + +type DescribeFargateProfileInput struct { + _ struct{} `type:"structure"` + + // The name of the Amazon EKS cluster associated with the Fargate profile. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The name of the Fargate profile to describe. + // + // FargateProfileName is a required field + FargateProfileName *string `location:"uri" locationName:"fargateProfileName" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeFargateProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeFargateProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeFargateProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeFargateProfileInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.FargateProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("FargateProfileName")) + } + if s.FargateProfileName != nil && len(*s.FargateProfileName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FargateProfileName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterName sets the ClusterName field's value. +func (s *DescribeFargateProfileInput) SetClusterName(v string) *DescribeFargateProfileInput { + s.ClusterName = &v + return s +} + +// SetFargateProfileName sets the FargateProfileName field's value. +func (s *DescribeFargateProfileInput) SetFargateProfileName(v string) *DescribeFargateProfileInput { + s.FargateProfileName = &v + return s +} + +type DescribeFargateProfileOutput struct { + _ struct{} `type:"structure"` + + // The full description of your Fargate profile. + FargateProfile *FargateProfile `locationName:"fargateProfile" type:"structure"` +} + +// String returns the string representation +func (s DescribeFargateProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeFargateProfileOutput) GoString() string { + return s.String() +} + +// SetFargateProfile sets the FargateProfile field's value. +func (s *DescribeFargateProfileOutput) SetFargateProfile(v *FargateProfile) *DescribeFargateProfileOutput { + s.FargateProfile = v + return s +} + +type DescribeNodegroupInput struct { + _ struct{} `type:"structure"` + + // The name of the Amazon EKS cluster associated with the node group. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The name of the node group to describe. + // + // NodegroupName is a required field + NodegroupName *string `location:"uri" locationName:"nodegroupName" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeNodegroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNodegroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeNodegroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeNodegroupInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.NodegroupName == nil { + invalidParams.Add(request.NewErrParamRequired("NodegroupName")) + } + if s.NodegroupName != nil && len(*s.NodegroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NodegroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterName sets the ClusterName field's value. +func (s *DescribeNodegroupInput) SetClusterName(v string) *DescribeNodegroupInput { + s.ClusterName = &v + return s +} + +// SetNodegroupName sets the NodegroupName field's value. +func (s *DescribeNodegroupInput) SetNodegroupName(v string) *DescribeNodegroupInput { + s.NodegroupName = &v + return s +} + +type DescribeNodegroupOutput struct { + _ struct{} `type:"structure"` + + // The full description of your node group. + Nodegroup *Nodegroup `locationName:"nodegroup" type:"structure"` +} + +// String returns the string representation +func (s DescribeNodegroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNodegroupOutput) GoString() string { + return s.String() +} + +// SetNodegroup sets the Nodegroup field's value. +func (s *DescribeNodegroupOutput) SetNodegroup(v *Nodegroup) *DescribeNodegroupOutput { + s.Nodegroup = v + return s +} + +type DescribeUpdateInput struct { + _ struct{} `type:"structure"` + + // The name of the Amazon EKS cluster associated with the update. + // + // Name is a required field + Name *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The name of the Amazon EKS node group associated with the update. + NodegroupName *string `location:"querystring" locationName:"nodegroupName" type:"string"` + + // The ID of the update to describe. + // + // UpdateId is a required field + UpdateId *string `location:"uri" locationName:"updateId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeUpdateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeUpdateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeUpdateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeUpdateInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.UpdateId == nil { + invalidParams.Add(request.NewErrParamRequired("UpdateId")) + } + if s.UpdateId != nil && len(*s.UpdateId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UpdateId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DescribeUpdateInput) SetName(v string) *DescribeUpdateInput { + s.Name = &v + return s +} + +// SetNodegroupName sets the NodegroupName field's value. +func (s *DescribeUpdateInput) SetNodegroupName(v string) *DescribeUpdateInput { + s.NodegroupName = &v + return s +} + +// SetUpdateId sets the UpdateId field's value. +func (s *DescribeUpdateInput) SetUpdateId(v string) *DescribeUpdateInput { + s.UpdateId = &v + return s +} + +type DescribeUpdateOutput struct { + _ struct{} `type:"structure"` + + // The full description of the specified update. + Update *Update `locationName:"update" type:"structure"` +} + +// String returns the string representation +func (s DescribeUpdateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeUpdateOutput) GoString() string { + return s.String() +} + +// SetUpdate sets the Update field's value. +func (s *DescribeUpdateOutput) SetUpdate(v *Update) *DescribeUpdateOutput { + s.Update = v + return s +} + +// An object representing an error when an asynchronous operation fails. +type ErrorDetail struct { + _ struct{} `type:"structure"` + + // A brief description of the error. + // + // * SubnetNotFound: We couldn't find one of the subnets associated with + // the cluster. + // + // * SecurityGroupNotFound: We couldn't find one of the security groups associated + // with the cluster. + // + // * EniLimitReached: You have reached the elastic network interface limit + // for your account. + // + // * IpNotAvailable: A subnet associated with the cluster doesn't have any + // free IP addresses. + // + // * AccessDenied: You don't have permissions to perform the specified operation. + // + // * OperationNotPermitted: The service role associated with the cluster + // doesn't have the required access permissions for Amazon EKS. + // + // * VpcIdNotFound: We couldn't find the VPC associated with the cluster. + ErrorCode *string `locationName:"errorCode" type:"string" enum:"ErrorCode"` + + // A more complete description of the error. + ErrorMessage *string `locationName:"errorMessage" type:"string"` + + // An optional field that contains the resource IDs associated with the error. + ResourceIds []*string `locationName:"resourceIds" type:"list"` +} + +// String returns the string representation +func (s ErrorDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ErrorDetail) GoString() string { + return s.String() +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *ErrorDetail) SetErrorCode(v string) *ErrorDetail { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *ErrorDetail) SetErrorMessage(v string) *ErrorDetail { + s.ErrorMessage = &v + return s +} + +// SetResourceIds sets the ResourceIds field's value. +func (s *ErrorDetail) SetResourceIds(v []*string) *ErrorDetail { + s.ResourceIds = v + return s +} + +// An object representing an AWS Fargate profile. +type FargateProfile struct { + _ struct{} `type:"structure"` + + // The name of the Amazon EKS cluster that the Fargate profile belongs to. + ClusterName *string `locationName:"clusterName" type:"string"` + + // The Unix epoch timestamp in seconds for when the Fargate profile was created. + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` + + // The full Amazon Resource Name (ARN) of the Fargate profile. + FargateProfileArn *string `locationName:"fargateProfileArn" type:"string"` + + // The name of the Fargate profile. + FargateProfileName *string `locationName:"fargateProfileName" type:"string"` + + // The Amazon Resource Name (ARN) of the pod execution role to use for pods + // that match the selectors in the Fargate profile. For more information, see + // Pod Execution Role (eks/latest/userguide/pod-execution-role.html) in the + // Amazon EKS User Guide. + PodExecutionRoleArn *string `locationName:"podExecutionRoleArn" type:"string"` + + // The selectors to match for pods to use this Fargate profile. + Selectors []*FargateProfileSelector `locationName:"selectors" type:"list"` + + // The current status of the Fargate profile. + Status *string `locationName:"status" type:"string" enum:"FargateProfileStatus"` + + // The IDs of subnets to launch Fargate pods into. + Subnets []*string `locationName:"subnets" type:"list"` + + // The metadata applied to the Fargate profile to assist with categorization + // and organization. Each tag consists of a key and an optional value, both + // of which you define. Fargate profile tags do not propagate to any other resources + // associated with the Fargate profile, such as the pods that are scheduled + // with it. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` +} + +// String returns the string representation +func (s FargateProfile) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FargateProfile) GoString() string { + return s.String() +} + +// SetClusterName sets the ClusterName field's value. +func (s *FargateProfile) SetClusterName(v string) *FargateProfile { + s.ClusterName = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *FargateProfile) SetCreatedAt(v time.Time) *FargateProfile { + s.CreatedAt = &v + return s +} + +// SetFargateProfileArn sets the FargateProfileArn field's value. +func (s *FargateProfile) SetFargateProfileArn(v string) *FargateProfile { + s.FargateProfileArn = &v + return s +} + +// SetFargateProfileName sets the FargateProfileName field's value. +func (s *FargateProfile) SetFargateProfileName(v string) *FargateProfile { + s.FargateProfileName = &v + return s +} + +// SetPodExecutionRoleArn sets the PodExecutionRoleArn field's value. +func (s *FargateProfile) SetPodExecutionRoleArn(v string) *FargateProfile { + s.PodExecutionRoleArn = &v + return s +} + +// SetSelectors sets the Selectors field's value. +func (s *FargateProfile) SetSelectors(v []*FargateProfileSelector) *FargateProfile { + s.Selectors = v + return s +} + +// SetStatus sets the Status field's value. +func (s *FargateProfile) SetStatus(v string) *FargateProfile { + s.Status = &v + return s +} + +// SetSubnets sets the Subnets field's value. +func (s *FargateProfile) SetSubnets(v []*string) *FargateProfile { + s.Subnets = v + return s +} + +// SetTags sets the Tags field's value. +func (s *FargateProfile) SetTags(v map[string]*string) *FargateProfile { + s.Tags = v + return s +} + +// An object representing an AWS Fargate profile selector. +type FargateProfileSelector struct { + _ struct{} `type:"structure"` + + // The Kubernetes labels that the selector should match. A pod must contain + // all of the labels that are specified in the selector for it to be considered + // a match. + Labels map[string]*string `locationName:"labels" type:"map"` + + // The Kubernetes namespace that the selector should match. + Namespace *string `locationName:"namespace" type:"string"` +} + +// String returns the string representation +func (s FargateProfileSelector) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FargateProfileSelector) GoString() string { + return s.String() +} + +// SetLabels sets the Labels field's value. +func (s *FargateProfileSelector) SetLabels(v map[string]*string) *FargateProfileSelector { + s.Labels = v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *FargateProfileSelector) SetNamespace(v string) *FargateProfileSelector { + s.Namespace = &v + return s +} + +// An object representing an identity provider for authentication credentials. +type Identity struct { + _ struct{} `type:"structure"` + + // The OpenID Connect (https://openid.net/connect/) identity provider information + // for the cluster. + Oidc *OIDC `locationName:"oidc" type:"structure"` +} + +// String returns the string representation +func (s Identity) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Identity) GoString() string { + return s.String() +} + +// SetOidc sets the Oidc field's value. +func (s *Identity) SetOidc(v *OIDC) *Identity { + s.Oidc = v + return s +} + +// An object representing an issue with an Amazon EKS resource. +type Issue struct { + _ struct{} `type:"structure"` + + // A brief description of the error. + // + // * AutoScalingGroupNotFound: We couldn't find the Auto Scaling group associated + // with the managed node group. You may be able to recreate an Auto Scaling + // group with the same settings to recover. + // + // * Ec2SecurityGroupNotFound: We couldn't find the cluster security group + // for the cluster. You must recreate your cluster. + // + // * Ec2SecurityGroupDeletionFailure: We could not delete the remote access + // security group for your managed node group. Remove any dependencies from + // the security group. + // + // * Ec2LaunchTemplateNotFound: We couldn't find the Amazon EC2 launch template + // for your managed node group. You may be able to recreate a launch template + // with the same settings to recover. + // + // * Ec2LaunchTemplateVersionMismatch: The Amazon EC2 launch template version + // for your managed node group does not match the version that Amazon EKS + // created. You may be able to revert to the version that Amazon EKS created + // to recover. + // + // * IamInstanceProfileNotFound: We couldn't find the IAM instance profile + // for your managed node group. You may be able to recreate an instance profile + // with the same settings to recover. + // + // * IamNodeRoleNotFound: We couldn't find the IAM role for your managed + // node group. You may be able to recreate an IAM role with the same settings + // to recover. + // + // * AsgInstanceLaunchFailures: Your Auto Scaling group is experiencing failures + // while attempting to launch instances. + // + // * NodeCreationFailure: Your launched instances are unable to register + // with your Amazon EKS cluster. Common causes of this failure are insufficient + // worker node IAM role (https://docs.aws.amazon.com/eks/latest/userguide/worker_node_IAM_role.html) + // permissions or lack of outbound internet access for the nodes. + // + // * InstanceLimitExceeded: Your AWS account is unable to launch any more + // instances of the specified instance type. You may be able to request an + // Amazon EC2 instance limit increase to recover. + // + // * InsufficientFreeAddresses: One or more of the subnets associated with + // your managed node group does not have enough available IP addresses for + // new nodes. + // + // * AccessDenied: Amazon EKS or one or more of your managed nodes is unable + // to communicate with your cluster API server. + // + // * InternalFailure: These errors are usually caused by an Amazon EKS server-side + // issue. + Code *string `locationName:"code" type:"string" enum:"NodegroupIssueCode"` + + // The error message associated with the issue. + Message *string `locationName:"message" type:"string"` + + // The AWS resources that are afflicted by this issue. + ResourceIds []*string `locationName:"resourceIds" type:"list"` +} + +// String returns the string representation +func (s Issue) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Issue) GoString() string { + return s.String() +} + +// SetCode sets the Code field's value. +func (s *Issue) SetCode(v string) *Issue { + s.Code = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *Issue) SetMessage(v string) *Issue { + s.Message = &v + return s +} + +// SetResourceIds sets the ResourceIds field's value. +func (s *Issue) SetResourceIds(v []*string) *Issue { + s.ResourceIds = v + return s +} + +type ListClustersInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the cluster. - Arn *string `locationName:"arn" type:"string"` + // The maximum number of cluster results returned by ListClusters in paginated + // output. When you use this parameter, ListClusters returns only maxResults + // results in a single page along with a nextToken response element. You can + // see the remaining results of the initial request by sending another ListClusters + // request with the returned nextToken value. This value can be between 1 and + // 100. If you don't use this parameter, ListClusters returns up to 100 results + // and a nextToken value if applicable. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // The nextToken value returned from a previous paginated ListClusters request + // where maxResults was used and the results exceeded the value of that parameter. + // Pagination continues from the end of the previous results that returned the + // nextToken value. + // + // This token should be treated as an opaque identifier that is used only to + // retrieve the next items in a list and not for other programmatic purposes. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListClustersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListClustersInput) GoString() string { + return s.String() +} - // The certificate-authority-data for your cluster. - CertificateAuthority *Certificate `locationName:"certificateAuthority" type:"structure"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListClustersInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListClustersInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string `locationName:"clientRequestToken" type:"string"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // The Unix epoch timestamp in seconds for when the cluster was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` +// SetMaxResults sets the MaxResults field's value. +func (s *ListClustersInput) SetMaxResults(v int64) *ListClustersInput { + s.MaxResults = &v + return s +} - // The endpoint for your Kubernetes API server. - Endpoint *string `locationName:"endpoint" type:"string"` +// SetNextToken sets the NextToken field's value. +func (s *ListClustersInput) SetNextToken(v string) *ListClustersInput { + s.NextToken = &v + return s +} - // The logging configuration for your cluster. - Logging *Logging `locationName:"logging" type:"structure"` +type ListClustersOutput struct { + _ struct{} `type:"structure"` - // The name of the cluster. - Name *string `locationName:"name" type:"string"` + // A list of all of the clusters for your account in the specified Region. + Clusters []*string `locationName:"clusters" type:"list"` - // The platform version of your Amazon EKS cluster. For more information, see - // Platform Versions (https://docs.aws.amazon.com/eks/latest/userguide/platform-versions.html) - // in the Amazon EKS User Guide . - PlatformVersion *string `locationName:"platformVersion" type:"string"` + // The nextToken value to include in a future ListClusters request. When the + // results of a ListClusters request exceed maxResults, you can use this value + // to retrieve the next page of results. This value is null when there are no + // more results to return. + NextToken *string `locationName:"nextToken" type:"string"` +} - // The VPC configuration used by the cluster control plane. Amazon EKS VPC resources - // have specific requirements to work properly with Kubernetes. For more information, - // see Cluster VPC Considerations (https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html) - // and Cluster Security Group Considerations (https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html) - // in the Amazon EKS User Guide. - ResourcesVpcConfig *VpcConfigResponse `locationName:"resourcesVpcConfig" type:"structure"` +// String returns the string representation +func (s ListClustersOutput) String() string { + return awsutil.Prettify(s) +} - // The Amazon Resource Name (ARN) of the IAM role that provides permissions - // for the Kubernetes control plane to make calls to AWS API operations on your - // behalf. - RoleArn *string `locationName:"roleArn" type:"string"` +// GoString returns the string representation +func (s ListClustersOutput) GoString() string { + return s.String() +} - // The current status of the cluster. - Status *string `locationName:"status" type:"string" enum:"ClusterStatus"` +// SetClusters sets the Clusters field's value. +func (s *ListClustersOutput) SetClusters(v []*string) *ListClustersOutput { + s.Clusters = v + return s +} - // The Kubernetes server version for the cluster. - Version *string `locationName:"version" type:"string"` +// SetNextToken sets the NextToken field's value. +func (s *ListClustersOutput) SetNextToken(v string) *ListClustersOutput { + s.NextToken = &v + return s +} + +type ListFargateProfilesInput struct { + _ struct{} `type:"structure"` + + // The name of the Amazon EKS cluster that you would like to listFargate profiles + // in. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The maximum number of Fargate profile results returned by ListFargateProfiles + // in paginated output. When you use this parameter, ListFargateProfiles returns + // only maxResults results in a single page along with a nextToken response + // element. You can see the remaining results of the initial request by sending + // another ListFargateProfiles request with the returned nextToken value. This + // value can be between 1 and 100. If you don't use this parameter, ListFargateProfiles + // returns up to 100 results and a nextToken value if applicable. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // The nextToken value returned from a previous paginated ListFargateProfiles + // request where maxResults was used and the results exceeded the value of that + // parameter. Pagination continues from the end of the previous results that + // returned the nextToken value. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` } // String returns the string representation -func (s Cluster) String() string { +func (s ListFargateProfilesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Cluster) GoString() string { +func (s ListFargateProfilesInput) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *Cluster) SetArn(v string) *Cluster { - s.Arn = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListFargateProfilesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListFargateProfilesInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterName sets the ClusterName field's value. +func (s *ListFargateProfilesInput) SetClusterName(v string) *ListFargateProfilesInput { + s.ClusterName = &v return s } -// SetCertificateAuthority sets the CertificateAuthority field's value. -func (s *Cluster) SetCertificateAuthority(v *Certificate) *Cluster { - s.CertificateAuthority = v +// SetMaxResults sets the MaxResults field's value. +func (s *ListFargateProfilesInput) SetMaxResults(v int64) *ListFargateProfilesInput { + s.MaxResults = &v return s } -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *Cluster) SetClientRequestToken(v string) *Cluster { - s.ClientRequestToken = &v +// SetNextToken sets the NextToken field's value. +func (s *ListFargateProfilesInput) SetNextToken(v string) *ListFargateProfilesInput { + s.NextToken = &v return s } -// SetCreatedAt sets the CreatedAt field's value. -func (s *Cluster) SetCreatedAt(v time.Time) *Cluster { - s.CreatedAt = &v +type ListFargateProfilesOutput struct { + _ struct{} `type:"structure"` + + // A list of all of the Fargate profiles associated with the specified cluster. + FargateProfileNames []*string `locationName:"fargateProfileNames" type:"list"` + + // The nextToken value to include in a future ListFargateProfiles request. When + // the results of a ListFargateProfiles request exceed maxResults, you can use + // this value to retrieve the next page of results. This value is null when + // there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListFargateProfilesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListFargateProfilesOutput) GoString() string { + return s.String() +} + +// SetFargateProfileNames sets the FargateProfileNames field's value. +func (s *ListFargateProfilesOutput) SetFargateProfileNames(v []*string) *ListFargateProfilesOutput { + s.FargateProfileNames = v return s } -// SetEndpoint sets the Endpoint field's value. -func (s *Cluster) SetEndpoint(v string) *Cluster { - s.Endpoint = &v +// SetNextToken sets the NextToken field's value. +func (s *ListFargateProfilesOutput) SetNextToken(v string) *ListFargateProfilesOutput { + s.NextToken = &v return s } -// SetLogging sets the Logging field's value. -func (s *Cluster) SetLogging(v *Logging) *Cluster { - s.Logging = v +type ListNodegroupsInput struct { + _ struct{} `type:"structure"` + + // The name of the Amazon EKS cluster that you would like to list node groups + // in. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The maximum number of node group results returned by ListNodegroups in paginated + // output. When you use this parameter, ListNodegroups returns only maxResults + // results in a single page along with a nextToken response element. You can + // see the remaining results of the initial request by sending another ListNodegroups + // request with the returned nextToken value. This value can be between 1 and + // 100. If you don't use this parameter, ListNodegroups returns up to 100 results + // and a nextToken value if applicable. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // The nextToken value returned from a previous paginated ListNodegroups request + // where maxResults was used and the results exceeded the value of that parameter. + // Pagination continues from the end of the previous results that returned the + // nextToken value. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListNodegroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListNodegroupsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListNodegroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListNodegroupsInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterName sets the ClusterName field's value. +func (s *ListNodegroupsInput) SetClusterName(v string) *ListNodegroupsInput { + s.ClusterName = &v return s } -// SetName sets the Name field's value. -func (s *Cluster) SetName(v string) *Cluster { - s.Name = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListNodegroupsInput) SetMaxResults(v int64) *ListNodegroupsInput { + s.MaxResults = &v return s } -// SetPlatformVersion sets the PlatformVersion field's value. -func (s *Cluster) SetPlatformVersion(v string) *Cluster { - s.PlatformVersion = &v +// SetNextToken sets the NextToken field's value. +func (s *ListNodegroupsInput) SetNextToken(v string) *ListNodegroupsInput { + s.NextToken = &v return s } -// SetResourcesVpcConfig sets the ResourcesVpcConfig field's value. -func (s *Cluster) SetResourcesVpcConfig(v *VpcConfigResponse) *Cluster { - s.ResourcesVpcConfig = v +type ListNodegroupsOutput struct { + _ struct{} `type:"structure"` + + // The nextToken value to include in a future ListNodegroups request. When the + // results of a ListNodegroups request exceed maxResults, you can use this value + // to retrieve the next page of results. This value is null when there are no + // more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + // A list of all of the node groups associated with the specified cluster. + Nodegroups []*string `locationName:"nodegroups" type:"list"` +} + +// String returns the string representation +func (s ListNodegroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListNodegroupsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListNodegroupsOutput) SetNextToken(v string) *ListNodegroupsOutput { + s.NextToken = &v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *Cluster) SetRoleArn(v string) *Cluster { - s.RoleArn = &v +// SetNodegroups sets the Nodegroups field's value. +func (s *ListNodegroupsOutput) SetNodegroups(v []*string) *ListNodegroupsOutput { + s.Nodegroups = v return s } -// SetStatus sets the Status field's value. -func (s *Cluster) SetStatus(v string) *Cluster { - s.Status = &v +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) that identifies the resource for which to + // list the tags. Currently, the supported resources are Amazon EKS clusters + // and managed node groups. + // + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListTagsForResourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTagsForResourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTagsForResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) + } + if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { + s.ResourceArn = &v return s } -// SetVersion sets the Version field's value. -func (s *Cluster) SetVersion(v string) *Cluster { - s.Version = &v +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // The tags for the resource. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` +} + +// String returns the string representation +func (s ListTagsForResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTagsForResourceOutput) GoString() string { + return s.String() +} + +// SetTags sets the Tags field's value. +func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { + s.Tags = v return s } -type CreateClusterInput struct { +type ListUpdatesInput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` - - // Enable or disable exporting the Kubernetes control plane logs for your cluster - // to CloudWatch Logs. By default, cluster control plane logs aren't exported - // to CloudWatch Logs. For more information, see Amazon EKS Cluster Control - // Plane Logs (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) - // in the Amazon EKS User Guide . - // - // CloudWatch Logs ingestion, archive storage, and data scanning rates apply - // to exported control plane logs. For more information, see Amazon CloudWatch - // Pricing (http://aws.amazon.com/cloudwatch/pricing/). - Logging *Logging `locationName:"logging" type:"structure"` + // The maximum number of update results returned by ListUpdates in paginated + // output. When you use this parameter, ListUpdates returns only maxResults + // results in a single page along with a nextToken response element. You can + // see the remaining results of the initial request by sending another ListUpdates + // request with the returned nextToken value. This value can be between 1 and + // 100. If you don't use this parameter, ListUpdates returns up to 100 results + // and a nextToken value if applicable. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - // The unique name to give to your cluster. + // The name of the Amazon EKS cluster to list updates for. // // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The VPC configuration used by the cluster control plane. Amazon EKS VPC resources - // have specific requirements to work properly with Kubernetes. For more information, - // see Cluster VPC Considerations (https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html) - // and Cluster Security Group Considerations (https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html) - // in the Amazon EKS User Guide. You must specify at least two subnets. You - // can specify up to five security groups, but we recommend that you use a dedicated - // security group for your cluster control plane. - // - // ResourcesVpcConfig is a required field - ResourcesVpcConfig *VpcConfigRequest `locationName:"resourcesVpcConfig" type:"structure" required:"true"` + Name *string `location:"uri" locationName:"name" type:"string" required:"true"` - // The Amazon Resource Name (ARN) of the IAM role that provides permissions - // for Amazon EKS to make calls to other AWS API operations on your behalf. - // For more information, see Amazon EKS Service IAM Role (https://docs.aws.amazon.com/eks/latest/userguide/service_IAM_role.html) - // in the Amazon EKS User Guide . - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` + // The nextToken value returned from a previous paginated ListUpdates request + // where maxResults was used and the results exceeded the value of that parameter. + // Pagination continues from the end of the previous results that returned the + // nextToken value. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - // The desired Kubernetes version for your cluster. If you don't specify a value - // here, the latest version available in Amazon EKS is used. - Version *string `locationName:"version" type:"string"` + // The name of the Amazon EKS managed node group to list updates for. + NodegroupName *string `location:"querystring" locationName:"nodegroupName" type:"string"` } // String returns the string representation -func (s CreateClusterInput) String() string { +func (s ListUpdatesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateClusterInput) GoString() string { +func (s ListUpdatesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateClusterInput"} +func (s *ListUpdatesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListUpdatesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } if s.Name == nil { invalidParams.Add(request.NewErrParamRequired("Name")) } if s.Name != nil && len(*s.Name) < 1 { invalidParams.Add(request.NewErrParamMinLen("Name", 1)) } - if s.ResourcesVpcConfig == nil { - invalidParams.Add(request.NewErrParamRequired("ResourcesVpcConfig")) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } if invalidParams.Len() > 0 { return invalidParams @@ -1103,372 +4440,433 @@ func (s *CreateClusterInput) Validate() error { return nil } -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *CreateClusterInput) SetClientRequestToken(v string) *CreateClusterInput { - s.ClientRequestToken = &v - return s -} - -// SetLogging sets the Logging field's value. -func (s *CreateClusterInput) SetLogging(v *Logging) *CreateClusterInput { - s.Logging = v +// SetMaxResults sets the MaxResults field's value. +func (s *ListUpdatesInput) SetMaxResults(v int64) *ListUpdatesInput { + s.MaxResults = &v return s } // SetName sets the Name field's value. -func (s *CreateClusterInput) SetName(v string) *CreateClusterInput { +func (s *ListUpdatesInput) SetName(v string) *ListUpdatesInput { s.Name = &v return s } -// SetResourcesVpcConfig sets the ResourcesVpcConfig field's value. -func (s *CreateClusterInput) SetResourcesVpcConfig(v *VpcConfigRequest) *CreateClusterInput { - s.ResourcesVpcConfig = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CreateClusterInput) SetRoleArn(v string) *CreateClusterInput { - s.RoleArn = &v +// SetNextToken sets the NextToken field's value. +func (s *ListUpdatesInput) SetNextToken(v string) *ListUpdatesInput { + s.NextToken = &v return s } -// SetVersion sets the Version field's value. -func (s *CreateClusterInput) SetVersion(v string) *CreateClusterInput { - s.Version = &v +// SetNodegroupName sets the NodegroupName field's value. +func (s *ListUpdatesInput) SetNodegroupName(v string) *ListUpdatesInput { + s.NodegroupName = &v return s } -type CreateClusterOutput struct { +type ListUpdatesOutput struct { _ struct{} `type:"structure"` - // The full description of your new cluster. - Cluster *Cluster `locationName:"cluster" type:"structure"` + // The nextToken value to include in a future ListUpdates request. When the + // results of a ListUpdates request exceed maxResults, you can use this value + // to retrieve the next page of results. This value is null when there are no + // more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + // A list of all the updates for the specified cluster and Region. + UpdateIds []*string `locationName:"updateIds" type:"list"` } // String returns the string representation -func (s CreateClusterOutput) String() string { +func (s ListUpdatesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateClusterOutput) GoString() string { +func (s ListUpdatesOutput) GoString() string { return s.String() } -// SetCluster sets the Cluster field's value. -func (s *CreateClusterOutput) SetCluster(v *Cluster) *CreateClusterOutput { - s.Cluster = v +// SetNextToken sets the NextToken field's value. +func (s *ListUpdatesOutput) SetNextToken(v string) *ListUpdatesOutput { + s.NextToken = &v return s } -type DeleteClusterInput struct { +// SetUpdateIds sets the UpdateIds field's value. +func (s *ListUpdatesOutput) SetUpdateIds(v []*string) *ListUpdatesOutput { + s.UpdateIds = v + return s +} + +// An object representing the enabled or disabled Kubernetes control plane logs +// for your cluster. +type LogSetup struct { _ struct{} `type:"structure"` - // The name of the cluster to delete. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" type:"string" required:"true"` + // If a log type is enabled, that log type exports its control plane logs to + // CloudWatch Logs. If a log type isn't enabled, that log type doesn't export + // its control plane logs. Each individual log type can be enabled or disabled + // independently. + Enabled *bool `locationName:"enabled" type:"boolean"` + + // The available cluster control plane log types. + Types []*string `locationName:"types" type:"list"` } // String returns the string representation -func (s DeleteClusterInput) String() string { +func (s LogSetup) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteClusterInput) GoString() string { +func (s LogSetup) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteClusterInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetEnabled sets the Enabled field's value. +func (s *LogSetup) SetEnabled(v bool) *LogSetup { + s.Enabled = &v + return s } -// SetName sets the Name field's value. -func (s *DeleteClusterInput) SetName(v string) *DeleteClusterInput { - s.Name = &v +// SetTypes sets the Types field's value. +func (s *LogSetup) SetTypes(v []*string) *LogSetup { + s.Types = v return s } -type DeleteClusterOutput struct { +// An object representing the logging configuration for resources in your cluster. +type Logging struct { _ struct{} `type:"structure"` - // The full description of the cluster to delete. - Cluster *Cluster `locationName:"cluster" type:"structure"` + // The cluster control plane logging configuration for your cluster. + ClusterLogging []*LogSetup `locationName:"clusterLogging" type:"list"` } // String returns the string representation -func (s DeleteClusterOutput) String() string { +func (s Logging) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteClusterOutput) GoString() string { +func (s Logging) GoString() string { return s.String() } -// SetCluster sets the Cluster field's value. -func (s *DeleteClusterOutput) SetCluster(v *Cluster) *DeleteClusterOutput { - s.Cluster = v +// SetClusterLogging sets the ClusterLogging field's value. +func (s *Logging) SetClusterLogging(v []*LogSetup) *Logging { + s.ClusterLogging = v return s } -type DescribeClusterInput struct { +// An object representing an Amazon EKS managed node group. +type Nodegroup struct { _ struct{} `type:"structure"` - // The name of the cluster to describe. + // The AMI type associated with your node group. GPU instance types should use + // the AL2_x86_64_GPU AMI type, which uses the Amazon EKS-optimized Linux AMI + // with GPU support. Non-GPU instances should use the AL2_x86_64 AMI type, which + // uses the Amazon EKS-optimized Linux AMI. + AmiType *string `locationName:"amiType" type:"string" enum:"AMITypes"` + + // The name of the cluster that the managed node group resides in. + ClusterName *string `locationName:"clusterName" type:"string"` + + // The Unix epoch timestamp in seconds for when the managed node group was created. + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` + + // The root device disk size (in GiB) for your node group instances. The default + // disk size is 20 GiB. + DiskSize *int64 `locationName:"diskSize" type:"integer"` + + // The health status of the node group. If there are issues with your node group's + // health, they are listed here. + Health *NodegroupHealth `locationName:"health" type:"structure"` + + // The instance types associated with your node group. + InstanceTypes []*string `locationName:"instanceTypes" type:"list"` + + // The Kubernetes labels applied to the nodes in the node group. // - // Name is a required field - Name *string `location:"uri" locationName:"name" type:"string" required:"true"` + // Only labels that are applied with the Amazon EKS API are shown here. There + // may be other Kubernetes labels applied to the nodes in this group. + Labels map[string]*string `locationName:"labels" type:"map"` + + // The Unix epoch timestamp in seconds for when the managed node group was last + // modified. + ModifiedAt *time.Time `locationName:"modifiedAt" type:"timestamp"` + + // The IAM role associated with your node group. The Amazon EKS worker node + // kubelet daemon makes calls to AWS APIs on your behalf. Worker nodes receive + // permissions for these API calls through an IAM instance profile and associated + // policies. Before you can launch worker nodes and register them into a cluster, + // you must create an IAM role for those worker nodes to use when they are launched. + // For more information, see Amazon EKS Worker Node IAM Role (https://docs.aws.amazon.com/eks/latest/userguide/worker_node_IAM_role.html) + // in the Amazon EKS User Guide . + NodeRole *string `locationName:"nodeRole" type:"string"` + + // The Amazon Resource Name (ARN) associated with the managed node group. + NodegroupArn *string `locationName:"nodegroupArn" type:"string"` + + // The name associated with an Amazon EKS managed node group. + NodegroupName *string `locationName:"nodegroupName" type:"string"` + + // The AMI version of the managed node group. For more information, see Amazon + // EKS-Optimized Linux AMI Versions (https://docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html) + // in the Amazon EKS User Guide. + ReleaseVersion *string `locationName:"releaseVersion" type:"string"` + + // The remote access (SSH) configuration that is associated with the node group. + RemoteAccess *RemoteAccessConfig `locationName:"remoteAccess" type:"structure"` + + // The resources associated with the node group, such as Auto Scaling groups + // and security groups for remote access. + Resources *NodegroupResources `locationName:"resources" type:"structure"` + + // The scaling configuration details for the Auto Scaling group that is associated + // with your node group. + ScalingConfig *NodegroupScalingConfig `locationName:"scalingConfig" type:"structure"` + + // The current status of the managed node group. + Status *string `locationName:"status" type:"string" enum:"NodegroupStatus"` + + // The subnets allowed for the Auto Scaling group that is associated with your + // node group. These subnets must have the following tag: kubernetes.io/cluster/CLUSTER_NAME, + // where CLUSTER_NAME is replaced with the name of your cluster. + Subnets []*string `locationName:"subnets" type:"list"` + + // The metadata applied to the node group to assist with categorization and + // organization. Each tag consists of a key and an optional value, both of which + // you define. Node group tags do not propagate to any other resources associated + // with the node group, such as the Amazon EC2 instances or subnets. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The Kubernetes version of the managed node group. + Version *string `locationName:"version" type:"string"` } // String returns the string representation -func (s DescribeClusterInput) String() string { +func (s Nodegroup) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeClusterInput) GoString() string { +func (s Nodegroup) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeClusterInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } +// SetAmiType sets the AmiType field's value. +func (s *Nodegroup) SetAmiType(v string) *Nodegroup { + s.AmiType = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetClusterName sets the ClusterName field's value. +func (s *Nodegroup) SetClusterName(v string) *Nodegroup { + s.ClusterName = &v + return s } -// SetName sets the Name field's value. -func (s *DescribeClusterInput) SetName(v string) *DescribeClusterInput { - s.Name = &v +// SetCreatedAt sets the CreatedAt field's value. +func (s *Nodegroup) SetCreatedAt(v time.Time) *Nodegroup { + s.CreatedAt = &v return s } -type DescribeClusterOutput struct { - _ struct{} `type:"structure"` +// SetDiskSize sets the DiskSize field's value. +func (s *Nodegroup) SetDiskSize(v int64) *Nodegroup { + s.DiskSize = &v + return s +} - // The full description of your specified cluster. - Cluster *Cluster `locationName:"cluster" type:"structure"` +// SetHealth sets the Health field's value. +func (s *Nodegroup) SetHealth(v *NodegroupHealth) *Nodegroup { + s.Health = v + return s } -// String returns the string representation -func (s DescribeClusterOutput) String() string { - return awsutil.Prettify(s) +// SetInstanceTypes sets the InstanceTypes field's value. +func (s *Nodegroup) SetInstanceTypes(v []*string) *Nodegroup { + s.InstanceTypes = v + return s +} + +// SetLabels sets the Labels field's value. +func (s *Nodegroup) SetLabels(v map[string]*string) *Nodegroup { + s.Labels = v + return s +} + +// SetModifiedAt sets the ModifiedAt field's value. +func (s *Nodegroup) SetModifiedAt(v time.Time) *Nodegroup { + s.ModifiedAt = &v + return s } -// GoString returns the string representation -func (s DescribeClusterOutput) GoString() string { - return s.String() +// SetNodeRole sets the NodeRole field's value. +func (s *Nodegroup) SetNodeRole(v string) *Nodegroup { + s.NodeRole = &v + return s } -// SetCluster sets the Cluster field's value. -func (s *DescribeClusterOutput) SetCluster(v *Cluster) *DescribeClusterOutput { - s.Cluster = v +// SetNodegroupArn sets the NodegroupArn field's value. +func (s *Nodegroup) SetNodegroupArn(v string) *Nodegroup { + s.NodegroupArn = &v return s } -type DescribeUpdateInput struct { - _ struct{} `type:"structure"` +// SetNodegroupName sets the NodegroupName field's value. +func (s *Nodegroup) SetNodegroupName(v string) *Nodegroup { + s.NodegroupName = &v + return s +} - // The name of the Amazon EKS cluster to update. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" type:"string" required:"true"` +// SetReleaseVersion sets the ReleaseVersion field's value. +func (s *Nodegroup) SetReleaseVersion(v string) *Nodegroup { + s.ReleaseVersion = &v + return s +} - // The ID of the update to describe. - // - // UpdateId is a required field - UpdateId *string `location:"uri" locationName:"updateId" type:"string" required:"true"` +// SetRemoteAccess sets the RemoteAccess field's value. +func (s *Nodegroup) SetRemoteAccess(v *RemoteAccessConfig) *Nodegroup { + s.RemoteAccess = v + return s } -// String returns the string representation -func (s DescribeUpdateInput) String() string { - return awsutil.Prettify(s) +// SetResources sets the Resources field's value. +func (s *Nodegroup) SetResources(v *NodegroupResources) *Nodegroup { + s.Resources = v + return s } -// GoString returns the string representation -func (s DescribeUpdateInput) GoString() string { - return s.String() +// SetScalingConfig sets the ScalingConfig field's value. +func (s *Nodegroup) SetScalingConfig(v *NodegroupScalingConfig) *Nodegroup { + s.ScalingConfig = v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeUpdateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeUpdateInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.UpdateId == nil { - invalidParams.Add(request.NewErrParamRequired("UpdateId")) - } - if s.UpdateId != nil && len(*s.UpdateId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UpdateId", 1)) - } +// SetStatus sets the Status field's value. +func (s *Nodegroup) SetStatus(v string) *Nodegroup { + s.Status = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetSubnets sets the Subnets field's value. +func (s *Nodegroup) SetSubnets(v []*string) *Nodegroup { + s.Subnets = v + return s } -// SetName sets the Name field's value. -func (s *DescribeUpdateInput) SetName(v string) *DescribeUpdateInput { - s.Name = &v +// SetTags sets the Tags field's value. +func (s *Nodegroup) SetTags(v map[string]*string) *Nodegroup { + s.Tags = v return s } -// SetUpdateId sets the UpdateId field's value. -func (s *DescribeUpdateInput) SetUpdateId(v string) *DescribeUpdateInput { - s.UpdateId = &v +// SetVersion sets the Version field's value. +func (s *Nodegroup) SetVersion(v string) *Nodegroup { + s.Version = &v return s } -type DescribeUpdateOutput struct { +// An object representing the health status of the node group. +type NodegroupHealth struct { _ struct{} `type:"structure"` - // The full description of the specified update. - Update *Update `locationName:"update" type:"structure"` + // Any issues that are associated with the node group. + Issues []*Issue `locationName:"issues" type:"list"` } // String returns the string representation -func (s DescribeUpdateOutput) String() string { +func (s NodegroupHealth) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeUpdateOutput) GoString() string { +func (s NodegroupHealth) GoString() string { return s.String() } -// SetUpdate sets the Update field's value. -func (s *DescribeUpdateOutput) SetUpdate(v *Update) *DescribeUpdateOutput { - s.Update = v +// SetIssues sets the Issues field's value. +func (s *NodegroupHealth) SetIssues(v []*Issue) *NodegroupHealth { + s.Issues = v return s } -// An object representing an error when an asynchronous operation fails. -type ErrorDetail struct { +// An object representing the resources associated with the node group, such +// as Auto Scaling groups and security groups for remote access. +type NodegroupResources struct { _ struct{} `type:"structure"` - // A brief description of the error. - // - // * SubnetNotFound: We couldn't find one of the subnets associated with - // the cluster. - // - // * SecurityGroupNotFound: We couldn't find one of the security groups associated - // with the cluster. - // - // * EniLimitReached: You have reached the elastic network interface limit - // for your account. - // - // * IpNotAvailable: A subnet associated with the cluster doesn't have any - // free IP addresses. - // - // * AccessDenied: You don't have permissions to perform the specified operation. - // - // * OperationNotPermitted: The service role associated with the cluster - // doesn't have the required access permissions for Amazon EKS. - // - // * VpcIdNotFound: We couldn't find the VPC associated with the cluster. - ErrorCode *string `locationName:"errorCode" type:"string" enum:"ErrorCode"` - - // A more complete description of the error. - ErrorMessage *string `locationName:"errorMessage" type:"string"` + // The Auto Scaling groups associated with the node group. + AutoScalingGroups []*AutoScalingGroup `locationName:"autoScalingGroups" type:"list"` - // An optional field that contains the resource IDs associated with the error. - ResourceIds []*string `locationName:"resourceIds" type:"list"` + // The remote access security group associated with the node group. This security + // group controls SSH access to the worker nodes. + RemoteAccessSecurityGroup *string `locationName:"remoteAccessSecurityGroup" type:"string"` } // String returns the string representation -func (s ErrorDetail) String() string { +func (s NodegroupResources) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ErrorDetail) GoString() string { +func (s NodegroupResources) GoString() string { return s.String() } -// SetErrorCode sets the ErrorCode field's value. -func (s *ErrorDetail) SetErrorCode(v string) *ErrorDetail { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *ErrorDetail) SetErrorMessage(v string) *ErrorDetail { - s.ErrorMessage = &v +// SetAutoScalingGroups sets the AutoScalingGroups field's value. +func (s *NodegroupResources) SetAutoScalingGroups(v []*AutoScalingGroup) *NodegroupResources { + s.AutoScalingGroups = v return s } -// SetResourceIds sets the ResourceIds field's value. -func (s *ErrorDetail) SetResourceIds(v []*string) *ErrorDetail { - s.ResourceIds = v +// SetRemoteAccessSecurityGroup sets the RemoteAccessSecurityGroup field's value. +func (s *NodegroupResources) SetRemoteAccessSecurityGroup(v string) *NodegroupResources { + s.RemoteAccessSecurityGroup = &v return s } -type ListClustersInput struct { +// An object representing the scaling configuration details for the Auto Scaling +// group that is associated with your node group. +type NodegroupScalingConfig struct { _ struct{} `type:"structure"` - // The maximum number of cluster results returned by ListClusters in paginated - // output. When you use this parameter, ListClusters returns only maxResults - // results in a single page along with a nextToken response element. You can - // see the remaining results of the initial request by sending another ListClusters - // request with the returned nextToken value. This value can be between 1 and - // 100. If you don't use this parameter, ListClusters returns up to 100 results - // and a nextToken value if applicable. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + // The current number of worker nodes that the managed node group should maintain. + DesiredSize *int64 `locationName:"desiredSize" min:"1" type:"integer"` - // The nextToken value returned from a previous paginated ListClusters request - // where maxResults was used and the results exceeded the value of that parameter. - // Pagination continues from the end of the previous results that returned the - // nextToken value. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + // The maximum number of worker nodes that the managed node group can scale + // out to. Managed node groups can support up to 100 nodes by default. + MaxSize *int64 `locationName:"maxSize" min:"1" type:"integer"` + + // The minimum number of worker nodes that the managed node group can scale + // in to. This number must be greater than zero. + MinSize *int64 `locationName:"minSize" min:"1" type:"integer"` } // String returns the string representation -func (s ListClustersInput) String() string { +func (s NodegroupScalingConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListClustersInput) GoString() string { +func (s NodegroupScalingConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListClustersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListClustersInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *NodegroupScalingConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "NodegroupScalingConfig"} + if s.DesiredSize != nil && *s.DesiredSize < 1 { + invalidParams.Add(request.NewErrParamMinValue("DesiredSize", 1)) + } + if s.MaxSize != nil && *s.MaxSize < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxSize", 1)) + } + if s.MinSize != nil && *s.MinSize < 1 { + invalidParams.Add(request.NewErrParamMinValue("MinSize", 1)) } if invalidParams.Len() > 0 { @@ -1477,98 +4875,130 @@ func (s *ListClustersInput) Validate() error { return nil } -// SetMaxResults sets the MaxResults field's value. -func (s *ListClustersInput) SetMaxResults(v int64) *ListClustersInput { - s.MaxResults = &v +// SetDesiredSize sets the DesiredSize field's value. +func (s *NodegroupScalingConfig) SetDesiredSize(v int64) *NodegroupScalingConfig { + s.DesiredSize = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListClustersInput) SetNextToken(v string) *ListClustersInput { - s.NextToken = &v +// SetMaxSize sets the MaxSize field's value. +func (s *NodegroupScalingConfig) SetMaxSize(v int64) *NodegroupScalingConfig { + s.MaxSize = &v return s } -type ListClustersOutput struct { +// SetMinSize sets the MinSize field's value. +func (s *NodegroupScalingConfig) SetMinSize(v int64) *NodegroupScalingConfig { + s.MinSize = &v + return s +} + +// An object representing the OpenID Connect (https://openid.net/connect/) identity +// provider information for the cluster. +type OIDC struct { _ struct{} `type:"structure"` - // A list of all of the clusters for your account in the specified Region. - Clusters []*string `locationName:"clusters" type:"list"` + // The issuer URL for the OpenID Connect identity provider. + Issuer *string `locationName:"issuer" type:"string"` +} - // The nextToken value to include in a future ListClusters request. When the - // results of a ListClusters request exceed maxResults, you can use this value - // to retrieve the next page of results. This value is null when there are no - // more results to return. - NextToken *string `locationName:"nextToken" type:"string"` +// String returns the string representation +func (s OIDC) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OIDC) GoString() string { + return s.String() +} + +// SetIssuer sets the Issuer field's value. +func (s *OIDC) SetIssuer(v string) *OIDC { + s.Issuer = &v + return s +} + +// An object representing the remote access configuration for the managed node +// group. +type RemoteAccessConfig struct { + _ struct{} `type:"structure"` + + // The Amazon EC2 SSH key that provides access for SSH communication with the + // worker nodes in the managed node group. For more information, see Amazon + // EC2 Key Pairs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) + // in the Amazon Elastic Compute Cloud User Guide for Linux Instances. + Ec2SshKey *string `locationName:"ec2SshKey" type:"string"` + + // The security groups that are allowed SSH access (port 22) to the worker nodes. + // If you specify an Amazon EC2 SSH key but do not specify a source security + // group when you create a managed node group, then port 22 on the worker nodes + // is opened to the internet (0.0.0.0/0). For more information, see Security + // Groups for Your VPC (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) + // in the Amazon Virtual Private Cloud User Guide. + SourceSecurityGroups []*string `locationName:"sourceSecurityGroups" type:"list"` } // String returns the string representation -func (s ListClustersOutput) String() string { +func (s RemoteAccessConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListClustersOutput) GoString() string { +func (s RemoteAccessConfig) GoString() string { return s.String() } -// SetClusters sets the Clusters field's value. -func (s *ListClustersOutput) SetClusters(v []*string) *ListClustersOutput { - s.Clusters = v +// SetEc2SshKey sets the Ec2SshKey field's value. +func (s *RemoteAccessConfig) SetEc2SshKey(v string) *RemoteAccessConfig { + s.Ec2SshKey = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListClustersOutput) SetNextToken(v string) *ListClustersOutput { - s.NextToken = &v +// SetSourceSecurityGroups sets the SourceSecurityGroups field's value. +func (s *RemoteAccessConfig) SetSourceSecurityGroups(v []*string) *RemoteAccessConfig { + s.SourceSecurityGroups = v return s } -type ListUpdatesInput struct { +type TagResourceInput struct { _ struct{} `type:"structure"` - // The maximum number of update results returned by ListUpdates in paginated - // output. When you use this parameter, ListUpdates returns only maxResults - // results in a single page along with a nextToken response element. You can - // see the remaining results of the initial request by sending another ListUpdates - // request with the returned nextToken value. This value can be between 1 and - // 100. If you don't use this parameter, ListUpdates returns up to 100 results - // and a nextToken value if applicable. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The name of the Amazon EKS cluster to list updates for. + // The Amazon Resource Name (ARN) of the resource to which to add tags. Currently, + // the supported resources are Amazon EKS clusters and managed node groups. // - // Name is a required field - Name *string `location:"uri" locationName:"name" type:"string" required:"true"` + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - // The nextToken value returned from a previous paginated ListUpdates request - // where maxResults was used and the results exceeded the value of that parameter. - // Pagination continues from the end of the previous results that returned the - // nextToken value. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + // The tags to add to the resource. A tag is an array of key-value pairs. + // + // Tags is a required field + Tags map[string]*string `locationName:"tags" min:"1" type:"map" required:"true"` } // String returns the string representation -func (s ListUpdatesInput) String() string { +func (s TagResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListUpdatesInput) GoString() string { +func (s TagResourceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListUpdatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListUpdatesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *TagResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) + if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + if s.Tags == nil { + invalidParams.Add(request.NewErrParamRequired("Tags")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) } if invalidParams.Len() > 0 { @@ -1577,120 +5007,106 @@ func (s *ListUpdatesInput) Validate() error { return nil } -// SetMaxResults sets the MaxResults field's value. -func (s *ListUpdatesInput) SetMaxResults(v int64) *ListUpdatesInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListUpdatesInput) SetName(v string) *ListUpdatesInput { - s.Name = &v +// SetResourceArn sets the ResourceArn field's value. +func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { + s.ResourceArn = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListUpdatesInput) SetNextToken(v string) *ListUpdatesInput { - s.NextToken = &v +// SetTags sets the Tags field's value. +func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { + s.Tags = v return s } -type ListUpdatesOutput struct { +type TagResourceOutput struct { _ struct{} `type:"structure"` - - // The nextToken value to include in a future ListUpdates request. When the - // results of a ListUpdates request exceed maxResults, you can use this value - // to retrieve the next page of results. This value is null when there are no - // more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of all the updates for the specified cluster and Region. - UpdateIds []*string `locationName:"updateIds" type:"list"` } // String returns the string representation -func (s ListUpdatesOutput) String() string { +func (s TagResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListUpdatesOutput) GoString() string { +func (s TagResourceOutput) GoString() string { return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListUpdatesOutput) SetNextToken(v string) *ListUpdatesOutput { - s.NextToken = &v - return s -} - -// SetUpdateIds sets the UpdateIds field's value. -func (s *ListUpdatesOutput) SetUpdateIds(v []*string) *ListUpdatesOutput { - s.UpdateIds = v - return s -} - -// An object representing the enabled or disabled Kubernetes control plane logs -// for your cluster. -type LogSetup struct { - _ struct{} `type:"structure"` - - // If a log type is enabled, that log type exports its control plane logs to - // CloudWatch Logs. If a log type isn't enabled, that log type doesn't export - // its control plane logs. Each individual log type can be enabled or disabled - // independently. - Enabled *bool `locationName:"enabled" type:"boolean"` +} - // The available cluster control plane log types. - Types []*string `locationName:"types" type:"list"` +type UntagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource from which to delete tags. + // Currently, the supported resources are Amazon EKS clusters and managed node + // groups. + // + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` + + // The keys of the tags to be removed. + // + // TagKeys is a required field + TagKeys []*string `location:"querystring" locationName:"tagKeys" min:"1" type:"list" required:"true"` } // String returns the string representation -func (s LogSetup) String() string { +func (s UntagResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LogSetup) GoString() string { +func (s UntagResourceInput) GoString() string { return s.String() } -// SetEnabled sets the Enabled field's value. -func (s *LogSetup) SetEnabled(v bool) *LogSetup { - s.Enabled = &v +// 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.ResourceArn != nil && len(*s.ResourceArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) + } + if s.TagKeys == nil { + invalidParams.Add(request.NewErrParamRequired("TagKeys")) + } + if s.TagKeys != nil && len(s.TagKeys) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TagKeys", 1)) + } + + 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 } -// SetTypes sets the Types field's value. -func (s *LogSetup) SetTypes(v []*string) *LogSetup { - s.Types = v +// SetTagKeys sets the TagKeys field's value. +func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { + s.TagKeys = v return s } -// An object representing the logging configuration for resources in your cluster. -type Logging struct { +type UntagResourceOutput struct { _ struct{} `type:"structure"` - - // The cluster control plane logging configuration for your cluster. - ClusterLogging []*LogSetup `locationName:"clusterLogging" type:"list"` } // String returns the string representation -func (s Logging) String() string { +func (s UntagResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Logging) GoString() string { +func (s UntagResourceOutput) GoString() string { return s.String() } -// SetClusterLogging sets the ClusterLogging field's value. -func (s *Logging) SetClusterLogging(v []*LogSetup) *Logging { - s.ClusterLogging = v - return s -} - // An object representing an asynchronous update. type Update struct { _ struct{} `type:"structure"` @@ -1948,6 +5364,283 @@ func (s *UpdateClusterVersionOutput) SetUpdate(v *Update) *UpdateClusterVersionO return s } +// An object representing a Kubernetes label change for a managed node group. +type UpdateLabelsPayload struct { + _ struct{} `type:"structure"` + + // Kubernetes labels to be added or updated. + AddOrUpdateLabels map[string]*string `locationName:"addOrUpdateLabels" type:"map"` + + // Kubernetes labels to be removed. + RemoveLabels []*string `locationName:"removeLabels" type:"list"` +} + +// String returns the string representation +func (s UpdateLabelsPayload) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateLabelsPayload) GoString() string { + return s.String() +} + +// SetAddOrUpdateLabels sets the AddOrUpdateLabels field's value. +func (s *UpdateLabelsPayload) SetAddOrUpdateLabels(v map[string]*string) *UpdateLabelsPayload { + s.AddOrUpdateLabels = v + return s +} + +// SetRemoveLabels sets the RemoveLabels field's value. +func (s *UpdateLabelsPayload) SetRemoveLabels(v []*string) *UpdateLabelsPayload { + s.RemoveLabels = v + return s +} + +type UpdateNodegroupConfigInput struct { + _ struct{} `type:"structure"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` + + // The name of the Amazon EKS cluster that the managed node group resides in. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The Kubernetes labels to be applied to the nodes in the node group after + // the update. + Labels *UpdateLabelsPayload `locationName:"labels" type:"structure"` + + // The name of the managed node group to update. + // + // NodegroupName is a required field + NodegroupName *string `location:"uri" locationName:"nodegroupName" type:"string" required:"true"` + + // The scaling configuration details for the Auto Scaling group after the update. + ScalingConfig *NodegroupScalingConfig `locationName:"scalingConfig" type:"structure"` +} + +// String returns the string representation +func (s UpdateNodegroupConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateNodegroupConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateNodegroupConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateNodegroupConfigInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.NodegroupName == nil { + invalidParams.Add(request.NewErrParamRequired("NodegroupName")) + } + if s.NodegroupName != nil && len(*s.NodegroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NodegroupName", 1)) + } + if s.ScalingConfig != nil { + if err := s.ScalingConfig.Validate(); err != nil { + invalidParams.AddNested("ScalingConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *UpdateNodegroupConfigInput) SetClientRequestToken(v string) *UpdateNodegroupConfigInput { + s.ClientRequestToken = &v + return s +} + +// SetClusterName sets the ClusterName field's value. +func (s *UpdateNodegroupConfigInput) SetClusterName(v string) *UpdateNodegroupConfigInput { + s.ClusterName = &v + return s +} + +// SetLabels sets the Labels field's value. +func (s *UpdateNodegroupConfigInput) SetLabels(v *UpdateLabelsPayload) *UpdateNodegroupConfigInput { + s.Labels = v + return s +} + +// SetNodegroupName sets the NodegroupName field's value. +func (s *UpdateNodegroupConfigInput) SetNodegroupName(v string) *UpdateNodegroupConfigInput { + s.NodegroupName = &v + return s +} + +// SetScalingConfig sets the ScalingConfig field's value. +func (s *UpdateNodegroupConfigInput) SetScalingConfig(v *NodegroupScalingConfig) *UpdateNodegroupConfigInput { + s.ScalingConfig = v + return s +} + +type UpdateNodegroupConfigOutput struct { + _ struct{} `type:"structure"` + + // An object representing an asynchronous update. + Update *Update `locationName:"update" type:"structure"` +} + +// String returns the string representation +func (s UpdateNodegroupConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateNodegroupConfigOutput) GoString() string { + return s.String() +} + +// SetUpdate sets the Update field's value. +func (s *UpdateNodegroupConfigOutput) SetUpdate(v *Update) *UpdateNodegroupConfigOutput { + s.Update = v + return s +} + +type UpdateNodegroupVersionInput struct { + _ struct{} `type:"structure"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` + + // The name of the Amazon EKS cluster that is associated with the managed node + // group to update. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // Force the update if the existing node group's pods are unable to be drained + // due to a pod disruption budget issue. If an update fails because pods could + // not be drained, you can force the update after it fails to terminate the + // old node whether or not any pods are running on the node. + Force *bool `locationName:"force" type:"boolean"` + + // The name of the managed node group to update. + // + // NodegroupName is a required field + NodegroupName *string `location:"uri" locationName:"nodegroupName" type:"string" required:"true"` + + // The AMI version of the Amazon EKS-optimized AMI to use for the update. By + // default, the latest available AMI version for the node group's Kubernetes + // version is used. For more information, see Amazon EKS-Optimized Linux AMI + // Versions (https://docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html) + // in the Amazon EKS User Guide. + ReleaseVersion *string `locationName:"releaseVersion" type:"string"` + + // The Kubernetes version to update to. If no version is specified, then the + // Kubernetes version of the node group does not change. You can specify the + // Kubernetes version of the cluster to update the node group to the latest + // AMI version of the cluster's Kubernetes version. + Version *string `locationName:"version" type:"string"` +} + +// String returns the string representation +func (s UpdateNodegroupVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateNodegroupVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateNodegroupVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateNodegroupVersionInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.NodegroupName == nil { + invalidParams.Add(request.NewErrParamRequired("NodegroupName")) + } + if s.NodegroupName != nil && len(*s.NodegroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NodegroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *UpdateNodegroupVersionInput) SetClientRequestToken(v string) *UpdateNodegroupVersionInput { + s.ClientRequestToken = &v + return s +} + +// SetClusterName sets the ClusterName field's value. +func (s *UpdateNodegroupVersionInput) SetClusterName(v string) *UpdateNodegroupVersionInput { + s.ClusterName = &v + return s +} + +// SetForce sets the Force field's value. +func (s *UpdateNodegroupVersionInput) SetForce(v bool) *UpdateNodegroupVersionInput { + s.Force = &v + return s +} + +// SetNodegroupName sets the NodegroupName field's value. +func (s *UpdateNodegroupVersionInput) SetNodegroupName(v string) *UpdateNodegroupVersionInput { + s.NodegroupName = &v + return s +} + +// SetReleaseVersion sets the ReleaseVersion field's value. +func (s *UpdateNodegroupVersionInput) SetReleaseVersion(v string) *UpdateNodegroupVersionInput { + s.ReleaseVersion = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *UpdateNodegroupVersionInput) SetVersion(v string) *UpdateNodegroupVersionInput { + s.Version = &v + return s +} + +type UpdateNodegroupVersionOutput struct { + _ struct{} `type:"structure"` + + // An object representing an asynchronous update. + Update *Update `locationName:"update" type:"structure"` +} + +// String returns the string representation +func (s UpdateNodegroupVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateNodegroupVersionOutput) GoString() string { + return s.String() +} + +// SetUpdate sets the Update field's value. +func (s *UpdateNodegroupVersionOutput) SetUpdate(v *Update) *UpdateNodegroupVersionOutput { + s.Update = v + return s +} + // An object representing the details of an update request. type UpdateParam struct { _ struct{} `type:"structure"` @@ -2053,6 +5746,11 @@ func (s *VpcConfigRequest) SetSubnetIds(v []*string) *VpcConfigRequest { type VpcConfigResponse struct { _ struct{} `type:"structure"` + // The cluster security group that was created by Amazon EKS for the cluster. + // Managed node groups use this security group for control-plane-to-data-plane + // communication. + ClusterSecurityGroupId *string `locationName:"clusterSecurityGroupId" type:"string"` + // This parameter indicates whether the Amazon EKS private API server endpoint // is enabled. If the Amazon EKS private API server endpoint is enabled, Kubernetes // API requests that originate from within your cluster's VPC use the private @@ -2087,6 +5785,12 @@ func (s VpcConfigResponse) GoString() string { return s.String() } +// SetClusterSecurityGroupId sets the ClusterSecurityGroupId field's value. +func (s *VpcConfigResponse) SetClusterSecurityGroupId(v string) *VpcConfigResponse { + s.ClusterSecurityGroupId = &v + return s +} + // SetEndpointPrivateAccess sets the EndpointPrivateAccess field's value. func (s *VpcConfigResponse) SetEndpointPrivateAccess(v bool) *VpcConfigResponse { s.EndpointPrivateAccess = &v @@ -2117,6 +5821,14 @@ func (s *VpcConfigResponse) SetVpcId(v string) *VpcConfigResponse { return s } +const ( + // AMITypesAl2X8664 is a AMITypes enum value + AMITypesAl2X8664 = "AL2_x86_64" + + // AMITypesAl2X8664Gpu is a AMITypes enum value + AMITypesAl2X8664Gpu = "AL2_x86_64_GPU" +) + const ( // ClusterStatusCreating is a ClusterStatus enum value ClusterStatusCreating = "CREATING" @@ -2129,6 +5841,9 @@ const ( // ClusterStatusFailed is a ClusterStatus enum value ClusterStatusFailed = "FAILED" + + // ClusterStatusUpdating is a ClusterStatus enum value + ClusterStatusUpdating = "UPDATING" ) const ( @@ -2155,6 +5870,32 @@ const ( // ErrorCodeUnknown is a ErrorCode enum value ErrorCodeUnknown = "Unknown" + + // ErrorCodeNodeCreationFailure is a ErrorCode enum value + ErrorCodeNodeCreationFailure = "NodeCreationFailure" + + // ErrorCodePodEvictionFailure is a ErrorCode enum value + ErrorCodePodEvictionFailure = "PodEvictionFailure" + + // ErrorCodeInsufficientFreeAddresses is a ErrorCode enum value + ErrorCodeInsufficientFreeAddresses = "InsufficientFreeAddresses" +) + +const ( + // FargateProfileStatusCreating is a FargateProfileStatus enum value + FargateProfileStatusCreating = "CREATING" + + // FargateProfileStatusActive is a FargateProfileStatus enum value + FargateProfileStatusActive = "ACTIVE" + + // FargateProfileStatusDeleting is a FargateProfileStatus enum value + FargateProfileStatusDeleting = "DELETING" + + // FargateProfileStatusCreateFailed is a FargateProfileStatus enum value + FargateProfileStatusCreateFailed = "CREATE_FAILED" + + // FargateProfileStatusDeleteFailed is a FargateProfileStatus enum value + FargateProfileStatusDeleteFailed = "DELETE_FAILED" ) const ( @@ -2174,6 +5915,67 @@ const ( LogTypeScheduler = "scheduler" ) +const ( + // NodegroupIssueCodeAutoScalingGroupNotFound is a NodegroupIssueCode enum value + NodegroupIssueCodeAutoScalingGroupNotFound = "AutoScalingGroupNotFound" + + // NodegroupIssueCodeEc2securityGroupNotFound is a NodegroupIssueCode enum value + NodegroupIssueCodeEc2securityGroupNotFound = "Ec2SecurityGroupNotFound" + + // NodegroupIssueCodeEc2securityGroupDeletionFailure is a NodegroupIssueCode enum value + NodegroupIssueCodeEc2securityGroupDeletionFailure = "Ec2SecurityGroupDeletionFailure" + + // NodegroupIssueCodeEc2launchTemplateNotFound is a NodegroupIssueCode enum value + NodegroupIssueCodeEc2launchTemplateNotFound = "Ec2LaunchTemplateNotFound" + + // NodegroupIssueCodeEc2launchTemplateVersionMismatch is a NodegroupIssueCode enum value + NodegroupIssueCodeEc2launchTemplateVersionMismatch = "Ec2LaunchTemplateVersionMismatch" + + // NodegroupIssueCodeIamInstanceProfileNotFound is a NodegroupIssueCode enum value + NodegroupIssueCodeIamInstanceProfileNotFound = "IamInstanceProfileNotFound" + + // NodegroupIssueCodeIamNodeRoleNotFound is a NodegroupIssueCode enum value + NodegroupIssueCodeIamNodeRoleNotFound = "IamNodeRoleNotFound" + + // NodegroupIssueCodeAsgInstanceLaunchFailures is a NodegroupIssueCode enum value + NodegroupIssueCodeAsgInstanceLaunchFailures = "AsgInstanceLaunchFailures" + + // NodegroupIssueCodeInstanceLimitExceeded is a NodegroupIssueCode enum value + NodegroupIssueCodeInstanceLimitExceeded = "InstanceLimitExceeded" + + // NodegroupIssueCodeInsufficientFreeAddresses is a NodegroupIssueCode enum value + NodegroupIssueCodeInsufficientFreeAddresses = "InsufficientFreeAddresses" + + // NodegroupIssueCodeAccessDenied is a NodegroupIssueCode enum value + NodegroupIssueCodeAccessDenied = "AccessDenied" + + // NodegroupIssueCodeInternalFailure is a NodegroupIssueCode enum value + NodegroupIssueCodeInternalFailure = "InternalFailure" +) + +const ( + // NodegroupStatusCreating is a NodegroupStatus enum value + NodegroupStatusCreating = "CREATING" + + // NodegroupStatusActive is a NodegroupStatus enum value + NodegroupStatusActive = "ACTIVE" + + // NodegroupStatusUpdating is a NodegroupStatus enum value + NodegroupStatusUpdating = "UPDATING" + + // NodegroupStatusDeleting is a NodegroupStatus enum value + NodegroupStatusDeleting = "DELETING" + + // NodegroupStatusCreateFailed is a NodegroupStatus enum value + NodegroupStatusCreateFailed = "CREATE_FAILED" + + // NodegroupStatusDeleteFailed is a NodegroupStatus enum value + NodegroupStatusDeleteFailed = "DELETE_FAILED" + + // NodegroupStatusDegraded is a NodegroupStatus enum value + NodegroupStatusDegraded = "DEGRADED" +) + const ( // UpdateParamTypeVersion is a UpdateParamType enum value UpdateParamTypeVersion = "Version" @@ -2189,6 +5991,24 @@ const ( // UpdateParamTypeClusterLogging is a UpdateParamType enum value UpdateParamTypeClusterLogging = "ClusterLogging" + + // UpdateParamTypeDesiredSize is a UpdateParamType enum value + UpdateParamTypeDesiredSize = "DesiredSize" + + // UpdateParamTypeLabelsToAdd is a UpdateParamType enum value + UpdateParamTypeLabelsToAdd = "LabelsToAdd" + + // UpdateParamTypeLabelsToRemove is a UpdateParamType enum value + UpdateParamTypeLabelsToRemove = "LabelsToRemove" + + // UpdateParamTypeMaxSize is a UpdateParamType enum value + UpdateParamTypeMaxSize = "MaxSize" + + // UpdateParamTypeMinSize is a UpdateParamType enum value + UpdateParamTypeMinSize = "MinSize" + + // UpdateParamTypeReleaseVersion is a UpdateParamType enum value + UpdateParamTypeReleaseVersion = "ReleaseVersion" ) const ( @@ -2214,4 +6034,7 @@ const ( // UpdateTypeLoggingUpdate is a UpdateType enum value UpdateTypeLoggingUpdate = "LoggingUpdate" + + // UpdateTypeConfigUpdate is a UpdateType enum value + UpdateTypeConfigUpdate = "ConfigUpdate" ) diff --git a/vendor/github.com/aws/aws-sdk-go/service/eks/eksiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/eks/eksiface/interface.go index a5dc9333..ece993ac 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/eks/eksiface/interface.go +++ b/vendor/github.com/aws/aws-sdk-go/service/eks/eksiface/interface.go @@ -64,14 +64,38 @@ type EKSAPI interface { CreateClusterWithContext(aws.Context, *eks.CreateClusterInput, ...request.Option) (*eks.CreateClusterOutput, error) CreateClusterRequest(*eks.CreateClusterInput) (*request.Request, *eks.CreateClusterOutput) + CreateFargateProfile(*eks.CreateFargateProfileInput) (*eks.CreateFargateProfileOutput, error) + CreateFargateProfileWithContext(aws.Context, *eks.CreateFargateProfileInput, ...request.Option) (*eks.CreateFargateProfileOutput, error) + CreateFargateProfileRequest(*eks.CreateFargateProfileInput) (*request.Request, *eks.CreateFargateProfileOutput) + + CreateNodegroup(*eks.CreateNodegroupInput) (*eks.CreateNodegroupOutput, error) + CreateNodegroupWithContext(aws.Context, *eks.CreateNodegroupInput, ...request.Option) (*eks.CreateNodegroupOutput, error) + CreateNodegroupRequest(*eks.CreateNodegroupInput) (*request.Request, *eks.CreateNodegroupOutput) + DeleteCluster(*eks.DeleteClusterInput) (*eks.DeleteClusterOutput, error) DeleteClusterWithContext(aws.Context, *eks.DeleteClusterInput, ...request.Option) (*eks.DeleteClusterOutput, error) DeleteClusterRequest(*eks.DeleteClusterInput) (*request.Request, *eks.DeleteClusterOutput) + DeleteFargateProfile(*eks.DeleteFargateProfileInput) (*eks.DeleteFargateProfileOutput, error) + DeleteFargateProfileWithContext(aws.Context, *eks.DeleteFargateProfileInput, ...request.Option) (*eks.DeleteFargateProfileOutput, error) + DeleteFargateProfileRequest(*eks.DeleteFargateProfileInput) (*request.Request, *eks.DeleteFargateProfileOutput) + + DeleteNodegroup(*eks.DeleteNodegroupInput) (*eks.DeleteNodegroupOutput, error) + DeleteNodegroupWithContext(aws.Context, *eks.DeleteNodegroupInput, ...request.Option) (*eks.DeleteNodegroupOutput, error) + DeleteNodegroupRequest(*eks.DeleteNodegroupInput) (*request.Request, *eks.DeleteNodegroupOutput) + DescribeCluster(*eks.DescribeClusterInput) (*eks.DescribeClusterOutput, error) DescribeClusterWithContext(aws.Context, *eks.DescribeClusterInput, ...request.Option) (*eks.DescribeClusterOutput, error) DescribeClusterRequest(*eks.DescribeClusterInput) (*request.Request, *eks.DescribeClusterOutput) + DescribeFargateProfile(*eks.DescribeFargateProfileInput) (*eks.DescribeFargateProfileOutput, error) + DescribeFargateProfileWithContext(aws.Context, *eks.DescribeFargateProfileInput, ...request.Option) (*eks.DescribeFargateProfileOutput, error) + DescribeFargateProfileRequest(*eks.DescribeFargateProfileInput) (*request.Request, *eks.DescribeFargateProfileOutput) + + DescribeNodegroup(*eks.DescribeNodegroupInput) (*eks.DescribeNodegroupOutput, error) + DescribeNodegroupWithContext(aws.Context, *eks.DescribeNodegroupInput, ...request.Option) (*eks.DescribeNodegroupOutput, error) + DescribeNodegroupRequest(*eks.DescribeNodegroupInput) (*request.Request, *eks.DescribeNodegroupOutput) + DescribeUpdate(*eks.DescribeUpdateInput) (*eks.DescribeUpdateOutput, error) DescribeUpdateWithContext(aws.Context, *eks.DescribeUpdateInput, ...request.Option) (*eks.DescribeUpdateOutput, error) DescribeUpdateRequest(*eks.DescribeUpdateInput) (*request.Request, *eks.DescribeUpdateOutput) @@ -80,10 +104,42 @@ type EKSAPI interface { ListClustersWithContext(aws.Context, *eks.ListClustersInput, ...request.Option) (*eks.ListClustersOutput, error) ListClustersRequest(*eks.ListClustersInput) (*request.Request, *eks.ListClustersOutput) + ListClustersPages(*eks.ListClustersInput, func(*eks.ListClustersOutput, bool) bool) error + ListClustersPagesWithContext(aws.Context, *eks.ListClustersInput, func(*eks.ListClustersOutput, bool) bool, ...request.Option) error + + ListFargateProfiles(*eks.ListFargateProfilesInput) (*eks.ListFargateProfilesOutput, error) + ListFargateProfilesWithContext(aws.Context, *eks.ListFargateProfilesInput, ...request.Option) (*eks.ListFargateProfilesOutput, error) + ListFargateProfilesRequest(*eks.ListFargateProfilesInput) (*request.Request, *eks.ListFargateProfilesOutput) + + ListFargateProfilesPages(*eks.ListFargateProfilesInput, func(*eks.ListFargateProfilesOutput, bool) bool) error + ListFargateProfilesPagesWithContext(aws.Context, *eks.ListFargateProfilesInput, func(*eks.ListFargateProfilesOutput, bool) bool, ...request.Option) error + + ListNodegroups(*eks.ListNodegroupsInput) (*eks.ListNodegroupsOutput, error) + ListNodegroupsWithContext(aws.Context, *eks.ListNodegroupsInput, ...request.Option) (*eks.ListNodegroupsOutput, error) + ListNodegroupsRequest(*eks.ListNodegroupsInput) (*request.Request, *eks.ListNodegroupsOutput) + + ListNodegroupsPages(*eks.ListNodegroupsInput, func(*eks.ListNodegroupsOutput, bool) bool) error + ListNodegroupsPagesWithContext(aws.Context, *eks.ListNodegroupsInput, func(*eks.ListNodegroupsOutput, bool) bool, ...request.Option) error + + ListTagsForResource(*eks.ListTagsForResourceInput) (*eks.ListTagsForResourceOutput, error) + ListTagsForResourceWithContext(aws.Context, *eks.ListTagsForResourceInput, ...request.Option) (*eks.ListTagsForResourceOutput, error) + ListTagsForResourceRequest(*eks.ListTagsForResourceInput) (*request.Request, *eks.ListTagsForResourceOutput) + ListUpdates(*eks.ListUpdatesInput) (*eks.ListUpdatesOutput, error) ListUpdatesWithContext(aws.Context, *eks.ListUpdatesInput, ...request.Option) (*eks.ListUpdatesOutput, error) ListUpdatesRequest(*eks.ListUpdatesInput) (*request.Request, *eks.ListUpdatesOutput) + ListUpdatesPages(*eks.ListUpdatesInput, func(*eks.ListUpdatesOutput, bool) bool) error + ListUpdatesPagesWithContext(aws.Context, *eks.ListUpdatesInput, func(*eks.ListUpdatesOutput, bool) bool, ...request.Option) error + + TagResource(*eks.TagResourceInput) (*eks.TagResourceOutput, error) + TagResourceWithContext(aws.Context, *eks.TagResourceInput, ...request.Option) (*eks.TagResourceOutput, error) + TagResourceRequest(*eks.TagResourceInput) (*request.Request, *eks.TagResourceOutput) + + UntagResource(*eks.UntagResourceInput) (*eks.UntagResourceOutput, error) + UntagResourceWithContext(aws.Context, *eks.UntagResourceInput, ...request.Option) (*eks.UntagResourceOutput, error) + UntagResourceRequest(*eks.UntagResourceInput) (*request.Request, *eks.UntagResourceOutput) + UpdateClusterConfig(*eks.UpdateClusterConfigInput) (*eks.UpdateClusterConfigOutput, error) UpdateClusterConfigWithContext(aws.Context, *eks.UpdateClusterConfigInput, ...request.Option) (*eks.UpdateClusterConfigOutput, error) UpdateClusterConfigRequest(*eks.UpdateClusterConfigInput) (*request.Request, *eks.UpdateClusterConfigOutput) @@ -92,11 +148,25 @@ type EKSAPI interface { UpdateClusterVersionWithContext(aws.Context, *eks.UpdateClusterVersionInput, ...request.Option) (*eks.UpdateClusterVersionOutput, error) UpdateClusterVersionRequest(*eks.UpdateClusterVersionInput) (*request.Request, *eks.UpdateClusterVersionOutput) + UpdateNodegroupConfig(*eks.UpdateNodegroupConfigInput) (*eks.UpdateNodegroupConfigOutput, error) + UpdateNodegroupConfigWithContext(aws.Context, *eks.UpdateNodegroupConfigInput, ...request.Option) (*eks.UpdateNodegroupConfigOutput, error) + UpdateNodegroupConfigRequest(*eks.UpdateNodegroupConfigInput) (*request.Request, *eks.UpdateNodegroupConfigOutput) + + UpdateNodegroupVersion(*eks.UpdateNodegroupVersionInput) (*eks.UpdateNodegroupVersionOutput, error) + UpdateNodegroupVersionWithContext(aws.Context, *eks.UpdateNodegroupVersionInput, ...request.Option) (*eks.UpdateNodegroupVersionOutput, error) + UpdateNodegroupVersionRequest(*eks.UpdateNodegroupVersionInput) (*request.Request, *eks.UpdateNodegroupVersionOutput) + WaitUntilClusterActive(*eks.DescribeClusterInput) error WaitUntilClusterActiveWithContext(aws.Context, *eks.DescribeClusterInput, ...request.WaiterOption) error WaitUntilClusterDeleted(*eks.DescribeClusterInput) error WaitUntilClusterDeletedWithContext(aws.Context, *eks.DescribeClusterInput, ...request.WaiterOption) error + + WaitUntilNodegroupActive(*eks.DescribeNodegroupInput) error + WaitUntilNodegroupActiveWithContext(aws.Context, *eks.DescribeNodegroupInput, ...request.WaiterOption) error + + WaitUntilNodegroupDeleted(*eks.DescribeNodegroupInput) error + WaitUntilNodegroupDeletedWithContext(aws.Context, *eks.DescribeNodegroupInput, ...request.WaiterOption) error } var _ EKSAPI = (*eks.EKS)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/eks/errors.go b/vendor/github.com/aws/aws-sdk-go/service/eks/errors.go index b343c7e0..49418bae 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/eks/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/eks/errors.go @@ -4,6 +4,13 @@ package eks const ( + // ErrCodeBadRequestException for service response error code + // "BadRequestException". + // + // This exception is thrown if the request contains a semantic error. The precise + // meaning will depend on the API, and will be documented in the error message. + ErrCodeBadRequestException = "BadRequestException" + // ErrCodeClientException for service response error code // "ClientException". // @@ -26,6 +33,13 @@ const ( // the cluster and the associated operations. ErrCodeInvalidRequestException = "InvalidRequestException" + // ErrCodeNotFoundException for service response error code + // "NotFoundException". + // + // A service resource associated with the request could not be found. Clients + // should not retry such requests. + ErrCodeNotFoundException = "NotFoundException" + // ErrCodeResourceInUseException for service response error code // "ResourceInUseException". // @@ -42,7 +56,8 @@ const ( // "ResourceNotFoundException". // // The specified resource could not be found. You can view your available clusters - // with ListClusters. Amazon EKS clusters are Region-specific. + // with ListClusters. You can view your available managed node groups with ListNodegroups. + // Amazon EKS clusters and node groups are Region-specific. ErrCodeResourceNotFoundException = "ResourceNotFoundException" // ErrCodeServerException for service response error code diff --git a/vendor/github.com/aws/aws-sdk-go/service/eks/service.go b/vendor/github.com/aws/aws-sdk-go/service/eks/service.go index a51bf545..d380ba25 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/eks/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/eks/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "eks" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "EKS" // ServiceID is a unique identifer of a specific service. + ServiceID = "EKS" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the EKS client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a EKS client from just a session. // svc := eks.New(mySession) // @@ -49,11 +51,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *EKS { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "eks" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, 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) *EKS { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *EKS { svc := &EKS{ Client: client.New( cfg, @@ -62,6 +64,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-11-01", }, diff --git a/vendor/github.com/aws/aws-sdk-go/service/eks/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/eks/waiters.go index 022255cf..31d2071b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/eks/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/eks/waiters.go @@ -120,3 +120,105 @@ func (c *EKS) WaitUntilClusterDeletedWithContext(ctx aws.Context, input *Describ return w.WaitWithContext(ctx) } + +// WaitUntilNodegroupActive uses the Amazon EKS API operation +// DescribeNodegroup to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *EKS) WaitUntilNodegroupActive(input *DescribeNodegroupInput) error { + return c.WaitUntilNodegroupActiveWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilNodegroupActiveWithContext is an extended version of WaitUntilNodegroupActive. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EKS) WaitUntilNodegroupActiveWithContext(ctx aws.Context, input *DescribeNodegroupInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilNodegroupActive", + MaxAttempts: 80, + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "nodegroup.status", + Expected: "CREATE_FAILED", + }, + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "nodegroup.status", + Expected: "ACTIVE", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeNodegroupInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeNodegroupRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + +// WaitUntilNodegroupDeleted uses the Amazon EKS API operation +// DescribeNodegroup to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *EKS) WaitUntilNodegroupDeleted(input *DescribeNodegroupInput) error { + return c.WaitUntilNodegroupDeletedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilNodegroupDeletedWithContext is an extended version of WaitUntilNodegroupDeleted. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EKS) WaitUntilNodegroupDeletedWithContext(ctx aws.Context, input *DescribeNodegroupInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilNodegroupDeleted", + MaxAttempts: 40, + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "nodegroup.status", + Expected: "DELETE_FAILED", + }, + { + State: request.SuccessWaiterState, + Matcher: request.ErrorWaiterMatch, + Expected: "ResourceNotFoundException", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeNodegroupInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeNodegroupRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go index 9e610591..7f60d4aa 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go @@ -78,6 +78,8 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o // IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) // in the IAM User Guide. // +// Session Duration +// // By default, the temporary security credentials created by AssumeRole last // for one hour. However, you can use the optional DurationSeconds parameter // to specify the duration of your session. You can provide a value from 900 @@ -91,6 +93,8 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o // URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) // in the IAM User Guide. // +// Permissions +// // The temporary security credentials created by AssumeRole can be used to make // API calls to any AWS service with the following exception: You cannot call // the AWS STS GetFederationToken or GetSessionToken API operations. @@ -99,7 +103,7 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o // to this operation. You can pass a single JSON policy document to use as an // inline session policy. You can also specify up to 10 managed policies to // use as managed session policies. The plain text that you use for both inline -// and managed session policies shouldn't exceed 2048 characters. Passing policies +// and managed session policies can't exceed 2,048 characters. Passing policies // to this operation returns new temporary credentials. The resulting session's // permissions are the intersection of the role's identity-based policy and // the session policies. You can use the role's temporary credentials in subsequent @@ -131,6 +135,24 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o // see IAM Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) // in the IAM User Guide. // +// Tags +// +// (Optional) You can pass tag key-value pairs to your session. These tags are +// called session tags. For more information about session tags, see Passing +// Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// An administrator must grant you the permissions necessary to pass session +// tags. The administrator can also create granular permissions to allow you +// to pass only specific session tags. For more information, see Tutorial: Using +// Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// in the IAM User Guide. +// +// You can set the session tags as transitive. Transitive tags persist during +// role chaining. For more information, see Chaining Roles with Session Tags +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) +// in the IAM User Guide. +// // Using MFA with AssumeRole // // (Optional) You can include multi-factor authentication (MFA) information @@ -165,9 +187,18 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o // message describes the specific error. // // * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" -// The request was rejected because the policy document was too large. The error -// message describes how big the policy document is, in packed form, as a percentage -// of what the API allows. +// The request was rejected because the total packed size of the session policies +// and session tags combined was too large. An AWS conversion compresses the +// session policy document, session policy ARNs, and session tags into a packed +// binary format that has a separate limit. The error message indicates by percentage +// how close the policies and tags are to the upper size limit. For more information, +// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You could receive this error even though you meet other defined session policy +// and session tag limits. For more information, see IAM and STS Entity Character +// Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// in the IAM User Guide. // // * ErrCodeRegionDisabledException "RegionDisabledException" // STS is not activated in the requested region for the account that is being @@ -256,6 +287,8 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // an access key ID, a secret access key, and a security token. Applications // can use these temporary security credentials to sign calls to AWS services. // +// Session Duration +// // By default, the temporary security credentials created by AssumeRoleWithSAML // last for one hour. However, you can use the optional DurationSeconds parameter // to specify the duration of your session. Your role session lasts for the @@ -271,6 +304,8 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) // in the IAM User Guide. // +// Permissions +// // The temporary security credentials created by AssumeRoleWithSAML can be used // to make API calls to any AWS service with the following exception: you cannot // call the STS GetFederationToken or GetSessionToken API operations. @@ -279,7 +314,7 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // to this operation. You can pass a single JSON policy document to use as an // inline session policy. You can also specify up to 10 managed policies to // use as managed session policies. The plain text that you use for both inline -// and managed session policies shouldn't exceed 2048 characters. Passing policies +// and managed session policies can't exceed 2,048 characters. Passing policies // to this operation returns new temporary credentials. The resulting session's // permissions are the intersection of the role's identity-based policy and // the session policies. You can use the role's temporary credentials in subsequent @@ -289,12 +324,6 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. // -// Before your application can call AssumeRoleWithSAML, you must configure your -// SAML identity provider (IdP) to issue the claims required by AWS. Additionally, -// you must use AWS Identity and Access Management (IAM) to create a SAML provider -// entity in your AWS account that represents your identity provider. You must -// also create an IAM role that specifies this SAML provider in its trust policy. -// // Calling AssumeRoleWithSAML does not require the use of AWS security credentials. // The identity of the caller is validated by using keys in the metadata document // that is uploaded for the SAML provider entity for your identity provider. @@ -302,8 +331,50 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // Calling AssumeRoleWithSAML can result in an entry in your AWS CloudTrail // logs. The entry includes the value in the NameID element of the SAML assertion. // We recommend that you use a NameIDType that is not associated with any personally -// identifiable information (PII). For example, you could instead use the Persistent -// Identifier (urn:oasis:names:tc:SAML:2.0:nameid-format:persistent). +// identifiable information (PII). For example, you could instead use the persistent +// identifier (urn:oasis:names:tc:SAML:2.0:nameid-format:persistent). +// +// Tags +// +// (Optional) You can configure your IdP to pass attributes into your SAML assertion +// as session tags. Each session tag consists of a key name and an associated +// value. For more information about session tags, see Passing Session Tags +// in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You can pass up to 50 session tags. The plain text session tag keys can’t +// exceed 128 characters and the values can’t exceed 256 characters. For these +// and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) +// in the IAM User Guide. +// +// An AWS conversion compresses the passed session policies and session tags +// into a packed binary format that has a separate limit. Your request can fail +// for this limit even if your plain text meets the other requirements. The +// PackedPolicySize response element indicates by percentage how close the policies +// and tags for your request are to the upper size limit. +// +// You can pass a session tag with the same key as a tag that is attached to +// the role. When you do, session tags override the role's tags with the same +// key. +// +// An administrator must grant you the permissions necessary to pass session +// tags. The administrator can also create granular permissions to allow you +// to pass only specific session tags. For more information, see Tutorial: Using +// Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// in the IAM User Guide. +// +// You can set the session tags as transitive. Transitive tags persist during +// role chaining. For more information, see Chaining Roles with Session Tags +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) +// in the IAM User Guide. +// +// SAML Configuration +// +// Before your application can call AssumeRoleWithSAML, you must configure your +// SAML identity provider (IdP) to issue the claims required by AWS. Additionally, +// you must use AWS Identity and Access Management (IAM) to create a SAML provider +// entity in your AWS account that represents your identity provider. You must +// also create an IAM role that specifies this SAML provider in its trust policy. // // For more information, see the following resources: // @@ -332,9 +403,18 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // message describes the specific error. // // * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" -// The request was rejected because the policy document was too large. The error -// message describes how big the policy document is, in packed form, as a percentage -// of what the API allows. +// The request was rejected because the total packed size of the session policies +// and session tags combined was too large. An AWS conversion compresses the +// session policy document, session policy ARNs, and session tags into a packed +// binary format that has a separate limit. The error message indicates by percentage +// how close the policies and tags are to the upper size limit. For more information, +// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You could receive this error even though you meet other defined session policy +// and session tag limits. For more information, see IAM and STS Entity Character +// Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// in the IAM User Guide. // // * ErrCodeIDPRejectedClaimException "IDPRejectedClaim" // The identity provider (IdP) reported that authentication failed. This might @@ -456,6 +536,8 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // key ID, a secret access key, and a security token. Applications can use these // temporary security credentials to sign calls to AWS service API operations. // +// Session Duration +// // By default, the temporary security credentials created by AssumeRoleWithWebIdentity // last for one hour. However, you can use the optional DurationSeconds parameter // to specify the duration of your session. You can provide a value from 900 @@ -469,6 +551,8 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) // in the IAM User Guide. // +// Permissions +// // The temporary security credentials created by AssumeRoleWithWebIdentity can // be used to make API calls to any AWS service with the following exception: // you cannot call the STS GetFederationToken or GetSessionToken API operations. @@ -477,7 +561,7 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // to this operation. You can pass a single JSON policy document to use as an // inline session policy. You can also specify up to 10 managed policies to // use as managed session policies. The plain text that you use for both inline -// and managed session policies shouldn't exceed 2048 characters. Passing policies +// and managed session policies can't exceed 2,048 characters. Passing policies // to this operation returns new temporary credentials. The resulting session's // permissions are the intersection of the role's identity-based policy and // the session policies. You can use the role's temporary credentials in subsequent @@ -487,6 +571,42 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. // +// Tags +// +// (Optional) You can configure your IdP to pass attributes into your web identity +// token as session tags. Each session tag consists of a key name and an associated +// value. For more information about session tags, see Passing Session Tags +// in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You can pass up to 50 session tags. The plain text session tag keys can’t +// exceed 128 characters and the values can’t exceed 256 characters. For these +// and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) +// in the IAM User Guide. +// +// An AWS conversion compresses the passed session policies and session tags +// into a packed binary format that has a separate limit. Your request can fail +// for this limit even if your plain text meets the other requirements. The +// PackedPolicySize response element indicates by percentage how close the policies +// and tags for your request are to the upper size limit. +// +// You can pass a session tag with the same key as a tag that is attached to +// the role. When you do, the session tag overrides the role tag with the same +// key. +// +// An administrator must grant you the permissions necessary to pass session +// tags. The administrator can also create granular permissions to allow you +// to pass only specific session tags. For more information, see Tutorial: Using +// Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// in the IAM User Guide. +// +// You can set the session tags as transitive. Transitive tags persist during +// role chaining. For more information, see Chaining Roles with Session Tags +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) +// in the IAM User Guide. +// +// Identities +// // Before your application can call AssumeRoleWithWebIdentity, you must have // an identity token from a supported identity provider and create a role that // the application can assume. The role that your application assumes must trust @@ -514,8 +634,8 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // * AWS SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/) and // AWS SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/). // These toolkits contain sample apps that show how to invoke the identity -// providers, and then how to use the information from these providers to -// get and use temporary security credentials. +// providers. The toolkits then show how to use the information from these +// providers to get and use temporary security credentials. // // * Web Identity Federation with Mobile Applications (http://aws.amazon.com/articles/web-identity-federation-with-mobile-applications). // This article discusses web identity federation and shows an example of @@ -535,9 +655,18 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // message describes the specific error. // // * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" -// The request was rejected because the policy document was too large. The error -// message describes how big the policy document is, in packed form, as a percentage -// of what the API allows. +// The request was rejected because the total packed size of the session policies +// and session tags combined was too large. An AWS conversion compresses the +// session policy document, session policy ARNs, and session tags into a packed +// binary format that has a separate limit. The error message indicates by percentage +// how close the policies and tags are to the upper size limit. For more information, +// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You could receive this error even though you meet other defined session policy +// and session tag limits. For more information, see IAM and STS Entity Character +// Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// in the IAM User Guide. // // * ErrCodeIDPRejectedClaimException "IDPRejectedClaim" // The identity provider (IdP) reported that authentication failed. This might @@ -547,11 +676,11 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // can also mean that the claim has expired or has been explicitly revoked. // // * ErrCodeIDPCommunicationErrorException "IDPCommunicationError" -// The request could not be fulfilled because the non-AWS identity provider -// (IDP) that was asked to verify the incoming identity token could not be reached. -// This is often a transient error caused by network conditions. Retry the request +// The request could not be fulfilled because the identity provider (IDP) that +// was asked to verify the incoming identity token could not be reached. This +// is often a transient error caused by network conditions. Retry the request // a limited number of times so that you don't exceed the request rate. If the -// error persists, the non-AWS identity provider might be down or not responding. +// error persists, the identity provider might be down or not responding. // // * ErrCodeInvalidIdentityTokenException "InvalidIdentityToken" // The web identity token that was passed could not be validated by AWS. Get @@ -702,6 +831,103 @@ func (c *STS) DecodeAuthorizationMessageWithContext(ctx aws.Context, input *Deco return out, req.Send() } +const opGetAccessKeyInfo = "GetAccessKeyInfo" + +// GetAccessKeyInfoRequest generates a "aws/request.Request" representing the +// client's request for the GetAccessKeyInfo operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetAccessKeyInfo for more information on using the GetAccessKeyInfo +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetAccessKeyInfoRequest method. +// req, resp := client.GetAccessKeyInfoRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetAccessKeyInfo +func (c *STS) GetAccessKeyInfoRequest(input *GetAccessKeyInfoInput) (req *request.Request, output *GetAccessKeyInfoOutput) { + op := &request.Operation{ + Name: opGetAccessKeyInfo, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetAccessKeyInfoInput{} + } + + output = &GetAccessKeyInfoOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetAccessKeyInfo API operation for AWS Security Token Service. +// +// Returns the account identifier for the specified access key ID. +// +// Access keys consist of two parts: an access key ID (for example, AKIAIOSFODNN7EXAMPLE) +// and a secret access key (for example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY). +// For more information about access keys, see Managing Access Keys for IAM +// Users (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) +// in the IAM User Guide. +// +// When you pass an access key ID to this operation, it returns the ID of the +// AWS account to which the keys belong. Access key IDs beginning with AKIA +// are long-term credentials for an IAM user or the AWS account root user. Access +// key IDs beginning with ASIA are temporary credentials that are created using +// STS operations. If the account in the response belongs to you, you can sign +// in as the root user and review your root user access keys. Then, you can +// pull a credentials report (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html) +// to learn which IAM user owns the keys. To learn who requested the temporary +// credentials for an ASIA access key, view the STS events in your CloudTrail +// logs (https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html) +// in the IAM User Guide. +// +// This operation does not indicate the state of the access key. The key might +// be active, inactive, or deleted. Active keys might not have permissions to +// perform an operation. Providing a deleted access key might return an error +// that the key doesn't exist. +// +// 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 Security Token Service's +// API operation GetAccessKeyInfo for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetAccessKeyInfo +func (c *STS) GetAccessKeyInfo(input *GetAccessKeyInfoInput) (*GetAccessKeyInfoOutput, error) { + req, out := c.GetAccessKeyInfoRequest(input) + return out, req.Send() +} + +// GetAccessKeyInfoWithContext is the same as GetAccessKeyInfo with the addition of +// the ability to pass a context and additional request options. +// +// See GetAccessKeyInfo 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 *STS) GetAccessKeyInfoWithContext(ctx aws.Context, input *GetAccessKeyInfoInput, opts ...request.Option) (*GetAccessKeyInfoOutput, error) { + req, out := c.GetAccessKeyInfoRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetCallerIdentity = "GetCallerIdentity" // GetCallerIdentityRequest generates a "aws/request.Request" representing the @@ -746,8 +972,16 @@ func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *requ // GetCallerIdentity API operation for AWS Security Token Service. // -// Returns details about the IAM identity whose credentials are used to call -// the API. +// Returns details about the IAM user or role whose credentials are used to +// call the operation. +// +// No permissions are required to perform this operation. If an administrator +// adds a policy to your IAM user or role that explicitly denies access to the +// sts:GetCallerIdentity action, you can still perform this operation. Permissions +// are not required because the same information is returned when an IAM user +// or role is denied access. To view an example response, see I Am Not Authorized +// to Perform: iam:DeleteVirtualMFADevice (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa) +// in the IAM 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 @@ -839,7 +1073,8 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re // or an OpenID Connect-compatible identity provider. In this case, we recommend // that you use Amazon Cognito (http://aws.amazon.com/cognito/) or AssumeRoleWithWebIdentity. // For more information, see Federation Through a Web-based Identity Provider -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity). +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity) +// in the IAM User Guide. // // You can also call GetFederationToken using the security credentials of an // AWS account root user, but we do not recommend it. Instead, we recommend @@ -849,41 +1084,67 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re // Practices (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) // in the IAM User Guide. // +// Session duration +// // The temporary credentials are valid for the specified duration, from 900 // seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours). The default -// is 43,200 seconds (12 hours). Temporary credentials that are obtained by -// using AWS account root user credentials have a maximum duration of 3,600 -// seconds (1 hour). +// session duration is 43,200 seconds (12 hours). Temporary credentials that +// are obtained by using AWS account root user credentials have a maximum duration +// of 3,600 seconds (1 hour). // -// The temporary security credentials created by GetFederationToken can be used -// to make API calls to any AWS service with the following exceptions: +// Permissions // -// * You cannot use these credentials to call any IAM API operations. +// You can use the temporary credentials created by GetFederationToken in any +// AWS service except the following: // -// * You cannot call any STS API operations except GetCallerIdentity. +// * You cannot call any IAM operations using the AWS CLI or the AWS API. // -// Permissions +// * You cannot call any STS operations except GetCallerIdentity. // // You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // to this operation. You can pass a single JSON policy document to use as an // inline session policy. You can also specify up to 10 managed policies to // use as managed session policies. The plain text that you use for both inline -// and managed session policies shouldn't exceed 2048 characters. +// and managed session policies can't exceed 2,048 characters. // // Though the session policy parameters are optional, if you do not pass a policy, -// then the resulting federated user session has no permissions. The only exception -// is when the credentials are used to access a resource that has a resource-based -// policy that specifically references the federated user session in the Principal -// element of the policy. When you pass session policies, the session permissions -// are the intersection of the IAM user policies and the session policies that -// you pass. This gives you a way to further restrict the permissions for a -// federated user. You cannot use session policies to grant more permissions -// than those that are defined in the permissions policy of the IAM user. For -// more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// then the resulting federated user session has no permissions. When you pass +// session policies, the session permissions are the intersection of the IAM +// user policies and the session policies that you pass. This gives you a way +// to further restrict the permissions for a federated user. You cannot use +// session policies to grant more permissions than those that are defined in +// the permissions policy of the IAM user. For more information, see Session +// Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. For information about using GetFederationToken to // create temporary security credentials, see GetFederationToken—Federation // Through a Custom Identity Broker (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken). // +// You can use the credentials to access a resource that has a resource-based +// policy. If that policy specifically references the federated user session +// in the Principal element of the policy, the session has the permissions allowed +// by the policy. These permissions are granted in addition to the permissions +// granted by the session policies. +// +// Tags +// +// (Optional) You can pass tag key-value pairs to your session. These are called +// session tags. For more information about session tags, see Passing Session +// Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// An administrator must grant you the permissions necessary to pass session +// tags. The administrator can also create granular permissions to allow you +// to pass only specific session tags. For more information, see Tutorial: Using +// Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// in the IAM User Guide. +// +// Tag key–value pairs are not case sensitive, but case is preserved. This +// means that you cannot have separate Department and department tag keys. Assume +// that the user that you are federating has the Department=Marketing tag and +// you pass the department=engineering session tag. Department and department +// are not saved as separate tags, and the session tag passed in the request +// takes precedence over the user tag. +// // 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. @@ -897,9 +1158,18 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re // message describes the specific error. // // * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" -// The request was rejected because the policy document was too large. The error -// message describes how big the policy document is, in packed form, as a percentage -// of what the API allows. +// The request was rejected because the total packed size of the session policies +// and session tags combined was too large. An AWS conversion compresses the +// session policy document, session policy ARNs, and session tags into a packed +// binary format that has a separate limit. The error message indicates by percentage +// how close the policies and tags are to the upper size limit. For more information, +// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You could receive this error even though you meet other defined session policy +// and session tag limits. For more information, see IAM and STS Entity Character +// Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// in the IAM User Guide. // // * ErrCodeRegionDisabledException "RegionDisabledException" // STS is not activated in the requested region for the account that is being @@ -988,6 +1258,8 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request. // and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) // in the IAM User Guide. // +// Session Duration +// // The GetSessionToken operation must be called by using the long-term AWS security // credentials of the AWS account root user or an IAM user. Credentials that // are created by IAM users are valid for the duration that you specify. This @@ -996,6 +1268,8 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request. // based on account credentials can range from 900 seconds (15 minutes) up to // 3,600 seconds (1 hour), with a default of 1 hour. // +// Permissions +// // The temporary security credentials created by GetSessionToken can be used // to make API calls to any AWS service with the following exceptions: // @@ -1110,16 +1384,16 @@ type AssumeRoleInput struct { // in the IAM User Guide. // // The plain text that you use for both inline and managed session policies - // shouldn't exceed 2048 characters. The JSON policy characters can be any ASCII + // can't exceed 2,048 characters. The JSON policy characters can be any ASCII // character from the space character to the end of the valid character list // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), // and carriage return (\u000D) characters. // - // The characters in this parameter count towards the 2048 character session - // policy guideline. However, an AWS conversion compresses the session policies - // into a packed binary format that has a separate limit. This is the enforced - // limit. The PackedPolicySize response element indicates by percentage how - // close the policy is to the upper size limit. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Policy *string `min:"1" type:"string"` // The Amazon Resource Names (ARNs) of the IAM managed policies that you want @@ -1128,15 +1402,15 @@ type AssumeRoleInput struct { // // This parameter is optional. You can provide up to 10 managed policy ARNs. // However, the plain text that you use for both inline and managed session - // policies shouldn't exceed 2048 characters. For more information about ARNs, - // see Amazon Resource Names (ARNs) and AWS Service Namespaces (general/latest/gr/aws-arns-and-namespaces.html) + // policies can't exceed 2,048 characters. For more information about ARNs, + // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. // - // The characters in this parameter count towards the 2048 character session - // policy guideline. However, an AWS conversion compresses the session policies - // into a packed binary format that has a separate limit. This is the enforced - // limit. The PackedPolicySize response element indicates by percentage how - // close the policy is to the upper size limit. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. // // Passing policies to this operation returns new temporary credentials. The // resulting session's permissions are the intersection of the role's identity-based @@ -1181,6 +1455,41 @@ type AssumeRoleInput struct { // also include underscores or any of the following characters: =,.@- SerialNumber *string `min:"9" type:"string"` + // A list of session tags that you want to pass. Each session tag consists of + // a key name and an associated value. For more information about session tags, + // see Tagging AWS STS Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + // in the IAM User Guide. + // + // This parameter is optional. You can pass up to 50 session tags. The plain + // text session tag keys can’t exceed 128 characters, and the values can’t + // exceed 256 characters. For these and additional limits, see IAM and STS Character + // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. + // + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. + // + // You can pass a session tag with the same key as a tag that is already attached + // to the role. When you do, session tags override a role tag with the same + // key. + // + // Tag key–value pairs are not case sensitive, but case is preserved. This + // means that you cannot have separate Department and department tag keys. Assume + // that the role has the Department=Marketing tag and you pass the department=engineering + // session tag. Department and department are not saved as separate tags, and + // the session tag passed in the request takes precedence over the role tag. + // + // Additionally, if you used temporary credentials to perform this operation, + // the new session inherits any transitive session tags from the calling session. + // If you pass a session tag with the same key as an inherited tag, the operation + // fails. To view the inherited tags for a session, see the AWS CloudTrail logs. + // For more information, see Viewing Session Tags in CloudTrail (https://docs.aws.amazon.com/IAM/latest/UserGuide/session-tags.html#id_session-tags_ctlogs) + // in the IAM User Guide. + Tags []*Tag `type:"list"` + // The value provided by the MFA device, if the trust policy of the role being // assumed requires MFA (that is, if the policy includes a condition that tests // for MFA). If the role being assumed requires MFA and if the TokenCode value @@ -1189,6 +1498,19 @@ type AssumeRoleInput struct { // The format for this parameter, as described by its regex pattern, is a sequence // of six numeric digits. TokenCode *string `min:"6" type:"string"` + + // A list of keys for session tags that you want to set as transitive. If you + // set a tag key as transitive, the corresponding key and value passes to subsequent + // sessions in a role chain. For more information, see Chaining Roles with Session + // Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) + // in the IAM User Guide. + // + // This parameter is optional. When you set session tags as transitive, the + // session policy and session tags packed binary limit is not affected. + // + // If you choose not to specify a transitive tag key, then no tags are passed + // from this session to any subsequent sessions. + TransitiveTagKeys []*string `type:"list"` } // String returns the string representation @@ -1241,6 +1563,16 @@ func (s *AssumeRoleInput) Validate() error { } } } + if s.Tags != nil { + for i, v := range s.Tags { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -1290,12 +1622,24 @@ func (s *AssumeRoleInput) SetSerialNumber(v string) *AssumeRoleInput { return s } +// SetTags sets the Tags field's value. +func (s *AssumeRoleInput) SetTags(v []*Tag) *AssumeRoleInput { + s.Tags = v + return s +} + // SetTokenCode sets the TokenCode field's value. func (s *AssumeRoleInput) SetTokenCode(v string) *AssumeRoleInput { s.TokenCode = &v return s } +// SetTransitiveTagKeys sets the TransitiveTagKeys field's value. +func (s *AssumeRoleInput) SetTransitiveTagKeys(v []*string) *AssumeRoleInput { + s.TransitiveTagKeys = v + return s +} + // Contains the response to a successful AssumeRole request, including temporary // AWS credentials that can be used to make AWS requests. type AssumeRoleOutput struct { @@ -1315,9 +1659,10 @@ type AssumeRoleOutput struct { // We strongly recommend that you make no assumptions about the maximum size. Credentials *Credentials `type:"structure"` - // A percentage value that indicates the size of the policy in packed form. - // The service rejects any policy with a packed size greater than 100 percent, - // which means the policy exceeded the allowed space. + // A percentage value that indicates the packed size of the session policies + // and session tags combined passed in the request. The request fails if the + // packed size is greater than 100 percent, which means the policies and tags + // exceeded the allowed space. PackedPolicySize *int64 `type:"integer"` } @@ -1388,16 +1733,16 @@ type AssumeRoleWithSAMLInput struct { // in the IAM User Guide. // // The plain text that you use for both inline and managed session policies - // shouldn't exceed 2048 characters. The JSON policy characters can be any ASCII + // can't exceed 2,048 characters. The JSON policy characters can be any ASCII // character from the space character to the end of the valid character list // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), // and carriage return (\u000D) characters. // - // The characters in this parameter count towards the 2048 character session - // policy guideline. However, an AWS conversion compresses the session policies - // into a packed binary format that has a separate limit. This is the enforced - // limit. The PackedPolicySize response element indicates by percentage how - // close the policy is to the upper size limit. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Policy *string `min:"1" type:"string"` // The Amazon Resource Names (ARNs) of the IAM managed policies that you want @@ -1406,15 +1751,15 @@ type AssumeRoleWithSAMLInput struct { // // This parameter is optional. You can provide up to 10 managed policy ARNs. // However, the plain text that you use for both inline and managed session - // policies shouldn't exceed 2048 characters. For more information about ARNs, - // see Amazon Resource Names (ARNs) and AWS Service Namespaces (general/latest/gr/aws-arns-and-namespaces.html) + // policies can't exceed 2,048 characters. For more information about ARNs, + // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. // - // The characters in this parameter count towards the 2048 character session - // policy guideline. However, an AWS conversion compresses the session policies - // into a packed binary format that has a separate limit. This is the enforced - // limit. The PackedPolicySize response element indicates by percentage how - // close the policy is to the upper size limit. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. // // Passing policies to this operation returns new temporary credentials. The // resulting session's permissions are the intersection of the role's identity-based @@ -1570,9 +1915,10 @@ type AssumeRoleWithSAMLOutput struct { // ) ) NameQualifier *string `type:"string"` - // A percentage value that indicates the size of the policy in packed form. - // The service rejects any policy with a packed size greater than 100 percent, - // which means the policy exceeded the allowed space. + // A percentage value that indicates the packed size of the session policies + // and session tags combined passed in the request. The request fails if the + // packed size is greater than 100 percent, which means the policies and tags + // exceeded the allowed space. PackedPolicySize *int64 `type:"integer"` // The value of the NameID element in the Subject element of the SAML assertion. @@ -1683,16 +2029,16 @@ type AssumeRoleWithWebIdentityInput struct { // in the IAM User Guide. // // The plain text that you use for both inline and managed session policies - // shouldn't exceed 2048 characters. The JSON policy characters can be any ASCII + // can't exceed 2,048 characters. The JSON policy characters can be any ASCII // character from the space character to the end of the valid character list // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), // and carriage return (\u000D) characters. // - // The characters in this parameter count towards the 2048 character session - // policy guideline. However, an AWS conversion compresses the session policies - // into a packed binary format that has a separate limit. This is the enforced - // limit. The PackedPolicySize response element indicates by percentage how - // close the policy is to the upper size limit. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Policy *string `min:"1" type:"string"` // The Amazon Resource Names (ARNs) of the IAM managed policies that you want @@ -1701,15 +2047,15 @@ type AssumeRoleWithWebIdentityInput struct { // // This parameter is optional. You can provide up to 10 managed policy ARNs. // However, the plain text that you use for both inline and managed session - // policies shouldn't exceed 2048 characters. For more information about ARNs, - // see Amazon Resource Names (ARNs) and AWS Service Namespaces (general/latest/gr/aws-arns-and-namespaces.html) + // policies can't exceed 2,048 characters. For more information about ARNs, + // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. // - // The characters in this parameter count towards the 2048 character session - // policy guideline. However, an AWS conversion compresses the session policies - // into a packed binary format that has a separate limit. This is the enforced - // limit. The PackedPolicySize response element indicates by percentage how - // close the policy is to the upper size limit. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. // // Passing policies to this operation returns new temporary credentials. The // resulting session's permissions are the intersection of the role's identity-based @@ -1880,9 +2226,10 @@ type AssumeRoleWithWebIdentityOutput struct { // We strongly recommend that you make no assumptions about the maximum size. Credentials *Credentials `type:"structure"` - // A percentage value that indicates the size of the policy in packed form. - // The service rejects any policy with a packed size greater than 100 percent, - // which means the policy exceeded the allowed space. + // A percentage value that indicates the packed size of the session policies + // and session tags combined passed in the request. The request fails if the + // packed size is greater than 100 percent, which means the policies and tags + // exceeded the allowed space. PackedPolicySize *int64 `type:"integer"` // The issuing authority of the web identity token presented. For OpenID Connect @@ -1954,7 +2301,7 @@ type AssumedRoleUser struct { // The ARN of the temporary security credentials that are returned from the // AssumeRole action. For more information about ARNs and how to use them in // policies, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) - // in Using IAM. + // in the IAM User Guide. // // Arn is a required field Arn *string `min:"20" type:"string" required:"true"` @@ -2122,7 +2469,7 @@ type FederatedUser struct { // The ARN that specifies the federated user that is associated with the credentials. // For more information about ARNs and how to use them in policies, see IAM // Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) - // in Using IAM. + // in the IAM User Guide. // // Arn is a required field Arn *string `min:"20" type:"string" required:"true"` @@ -2156,6 +2503,73 @@ func (s *FederatedUser) SetFederatedUserId(v string) *FederatedUser { return s } +type GetAccessKeyInfoInput struct { + _ struct{} `type:"structure"` + + // The identifier of an access key. + // + // This parameter allows (through its regex pattern) a string of characters + // that can consist of any upper- or lowercase letter or digit. + // + // AccessKeyId is a required field + AccessKeyId *string `min:"16" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetAccessKeyInfoInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccessKeyInfoInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAccessKeyInfoInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAccessKeyInfoInput"} + if s.AccessKeyId == nil { + invalidParams.Add(request.NewErrParamRequired("AccessKeyId")) + } + if s.AccessKeyId != nil && len(*s.AccessKeyId) < 16 { + invalidParams.Add(request.NewErrParamMinLen("AccessKeyId", 16)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccessKeyId sets the AccessKeyId field's value. +func (s *GetAccessKeyInfoInput) SetAccessKeyId(v string) *GetAccessKeyInfoInput { + s.AccessKeyId = &v + return s +} + +type GetAccessKeyInfoOutput struct { + _ struct{} `type:"structure"` + + // The number used to identify the AWS account. + Account *string `type:"string"` +} + +// String returns the string representation +func (s GetAccessKeyInfoOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccessKeyInfoOutput) GoString() string { + return s.String() +} + +// SetAccount sets the Account field's value. +func (s *GetAccessKeyInfoOutput) SetAccount(v string) *GetAccessKeyInfoOutput { + s.Account = &v + return s +} + type GetCallerIdentityInput struct { _ struct{} `type:"structure"` } @@ -2248,10 +2662,7 @@ type GetFederationTokenInput struct { // use as managed session policies. // // This parameter is optional. However, if you do not pass any session policies, - // then the resulting federated user session has no permissions. The only exception - // is when the credentials are used to access a resource that has a resource-based - // policy that specifically references the federated user session in the Principal - // element of the policy. + // then the resulting federated user session has no permissions. // // When you pass session policies, the session permissions are the intersection // of the IAM user policies and the session policies that you pass. This gives @@ -2261,17 +2672,23 @@ type GetFederationTokenInput struct { // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. // + // The resulting credentials can be used to access a resource that has a resource-based + // policy. If that policy specifically references the federated user session + // in the Principal element of the policy, the session has the permissions allowed + // by the policy. These permissions are granted in addition to the permissions + // that are granted by the session policies. + // // The plain text that you use for both inline and managed session policies - // shouldn't exceed 2048 characters. The JSON policy characters can be any ASCII + // can't exceed 2,048 characters. The JSON policy characters can be any ASCII // character from the space character to the end of the valid character list // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), // and carriage return (\u000D) characters. // - // The characters in this parameter count towards the 2048 character session - // policy guideline. However, an AWS conversion compresses the session policies - // into a packed binary format that has a separate limit. This is the enforced - // limit. The PackedPolicySize response element indicates by percentage how - // close the policy is to the upper size limit. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Policy *string `min:"1" type:"string"` // The Amazon Resource Names (ARNs) of the IAM managed policies that you want @@ -2282,16 +2699,13 @@ type GetFederationTokenInput struct { // to this operation. You can pass a single JSON policy document to use as an // inline session policy. You can also specify up to 10 managed policies to // use as managed session policies. The plain text that you use for both inline - // and managed session policies shouldn't exceed 2048 characters. You can provide + // and managed session policies can't exceed 2,048 characters. You can provide // up to 10 managed policy ARNs. For more information about ARNs, see Amazon - // Resource Names (ARNs) and AWS Service Namespaces (general/latest/gr/aws-arns-and-namespaces.html) + // Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. // // This parameter is optional. However, if you do not pass any session policies, - // then the resulting federated user session has no permissions. The only exception - // is when the credentials are used to access a resource that has a resource-based - // policy that specifically references the federated user session in the Principal - // element of the policy. + // then the resulting federated user session has no permissions. // // When you pass session policies, the session permissions are the intersection // of the IAM user policies and the session policies that you pass. This gives @@ -2301,12 +2715,46 @@ type GetFederationTokenInput struct { // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. // - // The characters in this parameter count towards the 2048 character session - // policy guideline. However, an AWS conversion compresses the session policies - // into a packed binary format that has a separate limit. This is the enforced - // limit. The PackedPolicySize response element indicates by percentage how - // close the policy is to the upper size limit. + // The resulting credentials can be used to access a resource that has a resource-based + // policy. If that policy specifically references the federated user session + // in the Principal element of the policy, the session has the permissions allowed + // by the policy. These permissions are granted in addition to the permissions + // that are granted by the session policies. + // + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. PolicyArns []*PolicyDescriptorType `type:"list"` + + // A list of session tags. Each session tag consists of a key name and an associated + // value. For more information about session tags, see Passing Session Tags + // in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + // in the IAM User Guide. + // + // This parameter is optional. You can pass up to 50 session tags. The plain + // text session tag keys can’t exceed 128 characters and the values can’t + // exceed 256 characters. For these and additional limits, see IAM and STS Character + // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. + // + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. + // + // You can pass a session tag with the same key as a tag that is already attached + // to the user you are federating. When you do, session tags override a user + // tag with the same key. + // + // Tag key–value pairs are not case sensitive, but case is preserved. This + // means that you cannot have separate Department and department tag keys. Assume + // that the role has the Department=Marketing tag and you pass the department=engineering + // session tag. Department and department are not saved as separate tags, and + // the session tag passed in the request takes precedence over the role tag. + Tags []*Tag `type:"list"` } // String returns the string representation @@ -2344,6 +2792,16 @@ func (s *GetFederationTokenInput) Validate() error { } } } + if s.Tags != nil { + for i, v := range s.Tags { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -2375,6 +2833,12 @@ func (s *GetFederationTokenInput) SetPolicyArns(v []*PolicyDescriptorType) *GetF return s } +// SetTags sets the Tags field's value. +func (s *GetFederationTokenInput) SetTags(v []*Tag) *GetFederationTokenInput { + s.Tags = v + return s +} + // Contains the response to a successful GetFederationToken request, including // temporary AWS credentials that can be used to make AWS requests. type GetFederationTokenOutput struct { @@ -2393,9 +2857,10 @@ type GetFederationTokenOutput struct { // an Amazon S3 bucket policy. FederatedUser *FederatedUser `type:"structure"` - // A percentage value indicating the size of the policy in packed form. The - // service rejects policies for which the packed size is greater than 100 percent - // of the allowed value. + // A percentage value that indicates the packed size of the session policies + // and session tags combined passed in the request. The request fails if the + // packed size is greater than 100 percent, which means the policies and tags + // exceeded the allowed space. PackedPolicySize *int64 `type:"integer"` } @@ -2545,7 +3010,7 @@ type PolicyDescriptorType struct { // The Amazon Resource Name (ARN) of the IAM managed policy to use as a session // policy for the role. For more information about ARNs, see Amazon Resource - // Names (ARNs) and AWS Service Namespaces (general/latest/gr/aws-arns-and-namespaces.html) + // Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. Arn *string `locationName:"arn" min:"20" type:"string"` } @@ -2578,3 +3043,73 @@ func (s *PolicyDescriptorType) SetArn(v string) *PolicyDescriptorType { s.Arn = &v return s } + +// You can pass custom key-value pair attributes when you assume a role or federate +// a user. These are called session tags. You can then use the session tags +// to control access to resources. For more information, see Tagging AWS STS +// Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +type Tag struct { + _ struct{} `type:"structure"` + + // The key for a session tag. + // + // You can pass up to 50 session tags. The plain text session tag keys can’t + // exceed 128 characters. For these and additional limits, see IAM and STS Character + // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // The value for a session tag. + // + // You can pass up to 50 session tags. The plain text session tag values can’t + // exceed 256 characters. For these and additional limits, see IAM and STS Character + // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. + // + // Value is a required field + Value *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s Tag) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Tag) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Tag) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Tag"} + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + if s.Value == nil { + invalidParams.Add(request.NewErrParamRequired("Value")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKey sets the Key field's value. +func (s *Tag) SetKey(v string) *Tag { + s.Key = &v + return s +} + +// SetValue sets the Value field's value. +func (s *Tag) SetValue(v string) *Tag { + s.Value = &v + return s +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go new file mode 100644 index 00000000..d5307fca --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go @@ -0,0 +1,11 @@ +package sts + +import "github.com/aws/aws-sdk-go/aws/request" + +func init() { + initRequest = customizeRequest +} + +func customizeRequest(r *request.Request) { + r.RetryErrorCodes = append(r.RetryErrorCodes, ErrCodeIDPCommunicationErrorException) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go b/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go index 41ea09c3..a233f542 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go @@ -14,11 +14,11 @@ const ( // ErrCodeIDPCommunicationErrorException for service response error code // "IDPCommunicationError". // - // The request could not be fulfilled because the non-AWS identity provider - // (IDP) that was asked to verify the incoming identity token could not be reached. - // This is often a transient error caused by network conditions. Retry the request + // The request could not be fulfilled because the identity provider (IDP) that + // was asked to verify the incoming identity token could not be reached. This + // is often a transient error caused by network conditions. Retry the request // a limited number of times so that you don't exceed the request rate. If the - // error persists, the non-AWS identity provider might be down or not responding. + // error persists, the identity provider might be down or not responding. ErrCodeIDPCommunicationErrorException = "IDPCommunicationError" // ErrCodeIDPRejectedClaimException for service response error code @@ -56,9 +56,18 @@ const ( // ErrCodePackedPolicyTooLargeException for service response error code // "PackedPolicyTooLarge". // - // The request was rejected because the policy document was too large. The error - // message describes how big the policy document is, in packed form, as a percentage - // of what the API allows. + // The request was rejected because the total packed size of the session policies + // and session tags combined was too large. An AWS conversion compresses the + // session policy document, session policy ARNs, and session tags into a packed + // binary format that has a separate limit. The error message indicates by percentage + // how close the policies and tags are to the upper size limit. For more information, + // see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + // in the IAM User Guide. + // + // You could receive this error even though you meet other defined session policy + // and session tag limits. For more information, see IAM and STS Entity Character + // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) + // in the IAM User Guide. ErrCodePackedPolicyTooLargeException = "PackedPolicyTooLarge" // ErrCodeRegionDisabledException for service response error code diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/service.go b/vendor/github.com/aws/aws-sdk-go/service/sts/service.go index 185c914d..d34a6855 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "sts" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "STS" // ServiceID is a unique identifer of a specific service. + ServiceID = "STS" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the STS client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a STS client from just a session. // svc := sts.New(mySession) // @@ -46,11 +48,11 @@ const ( // svc := sts.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *STS { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, 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) *STS { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *STS { svc := &STS{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2011-06-15", }, diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go new file mode 100644 index 00000000..e2e1d6ef --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go @@ -0,0 +1,96 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package stsiface provides an interface to enable mocking the AWS Security Token Service service client +// for testing your code. +// +// It is important to note that this interface will have breaking changes +// when the service model is updated and adds new API operations, paginators, +// and waiters. +package stsiface + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/sts" +) + +// STSAPI provides an interface to enable mocking the +// sts.STS service client's API operation, +// paginators, and waiters. This make unit testing your code that calls out +// to the SDK's service client's calls easier. +// +// The best way to use this interface is so the SDK's service client's calls +// can be stubbed out for unit testing your code with the SDK without needing +// to inject custom request handlers into the SDK's request pipeline. +// +// // myFunc uses an SDK service client to make a request to +// // AWS Security Token Service. +// func myFunc(svc stsiface.STSAPI) bool { +// // Make svc.AssumeRole request +// } +// +// func main() { +// sess := session.New() +// svc := sts.New(sess) +// +// myFunc(svc) +// } +// +// In your _test.go file: +// +// // Define a mock struct to be used in your unit tests of myFunc. +// type mockSTSClient struct { +// stsiface.STSAPI +// } +// func (m *mockSTSClient) AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) { +// // mock response/functionality +// } +// +// func TestMyFunc(t *testing.T) { +// // Setup Test +// mockSvc := &mockSTSClient{} +// +// myfunc(mockSvc) +// +// // Verify myFunc's functionality +// } +// +// It is important to note that this interface will have breaking changes +// when the service model is updated and adds new API operations, paginators, +// and waiters. Its suggested to use the pattern above for testing, or using +// tooling to generate mocks to satisfy the interfaces. +type STSAPI interface { + AssumeRole(*sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) + AssumeRoleWithContext(aws.Context, *sts.AssumeRoleInput, ...request.Option) (*sts.AssumeRoleOutput, error) + AssumeRoleRequest(*sts.AssumeRoleInput) (*request.Request, *sts.AssumeRoleOutput) + + AssumeRoleWithSAML(*sts.AssumeRoleWithSAMLInput) (*sts.AssumeRoleWithSAMLOutput, error) + AssumeRoleWithSAMLWithContext(aws.Context, *sts.AssumeRoleWithSAMLInput, ...request.Option) (*sts.AssumeRoleWithSAMLOutput, error) + AssumeRoleWithSAMLRequest(*sts.AssumeRoleWithSAMLInput) (*request.Request, *sts.AssumeRoleWithSAMLOutput) + + AssumeRoleWithWebIdentity(*sts.AssumeRoleWithWebIdentityInput) (*sts.AssumeRoleWithWebIdentityOutput, error) + AssumeRoleWithWebIdentityWithContext(aws.Context, *sts.AssumeRoleWithWebIdentityInput, ...request.Option) (*sts.AssumeRoleWithWebIdentityOutput, error) + AssumeRoleWithWebIdentityRequest(*sts.AssumeRoleWithWebIdentityInput) (*request.Request, *sts.AssumeRoleWithWebIdentityOutput) + + DecodeAuthorizationMessage(*sts.DecodeAuthorizationMessageInput) (*sts.DecodeAuthorizationMessageOutput, error) + DecodeAuthorizationMessageWithContext(aws.Context, *sts.DecodeAuthorizationMessageInput, ...request.Option) (*sts.DecodeAuthorizationMessageOutput, error) + DecodeAuthorizationMessageRequest(*sts.DecodeAuthorizationMessageInput) (*request.Request, *sts.DecodeAuthorizationMessageOutput) + + GetAccessKeyInfo(*sts.GetAccessKeyInfoInput) (*sts.GetAccessKeyInfoOutput, error) + GetAccessKeyInfoWithContext(aws.Context, *sts.GetAccessKeyInfoInput, ...request.Option) (*sts.GetAccessKeyInfoOutput, error) + GetAccessKeyInfoRequest(*sts.GetAccessKeyInfoInput) (*request.Request, *sts.GetAccessKeyInfoOutput) + + GetCallerIdentity(*sts.GetCallerIdentityInput) (*sts.GetCallerIdentityOutput, error) + GetCallerIdentityWithContext(aws.Context, *sts.GetCallerIdentityInput, ...request.Option) (*sts.GetCallerIdentityOutput, error) + GetCallerIdentityRequest(*sts.GetCallerIdentityInput) (*request.Request, *sts.GetCallerIdentityOutput) + + GetFederationToken(*sts.GetFederationTokenInput) (*sts.GetFederationTokenOutput, error) + GetFederationTokenWithContext(aws.Context, *sts.GetFederationTokenInput, ...request.Option) (*sts.GetFederationTokenOutput, error) + GetFederationTokenRequest(*sts.GetFederationTokenInput) (*request.Request, *sts.GetFederationTokenOutput) + + GetSessionToken(*sts.GetSessionTokenInput) (*sts.GetSessionTokenOutput, error) + GetSessionTokenWithContext(aws.Context, *sts.GetSessionTokenInput, ...request.Option) (*sts.GetSessionTokenOutput, error) + GetSessionTokenRequest(*sts.GetSessionTokenInput) (*request.Request, *sts.GetSessionTokenOutput) +} + +var _ STSAPI = (*sts.STS)(nil) diff --git a/vendor/golang.org/x/net/html/atom/gen.go b/vendor/golang.org/x/net/html/atom/gen.go deleted file mode 100644 index 5d052781..00000000 --- a/vendor/golang.org/x/net/html/atom/gen.go +++ /dev/null @@ -1,712 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -//go:generate go run gen.go -//go:generate go run gen.go -test - -package main - -import ( - "bytes" - "flag" - "fmt" - "go/format" - "io/ioutil" - "math/rand" - "os" - "sort" - "strings" -) - -// identifier converts s to a Go exported identifier. -// It converts "div" to "Div" and "accept-charset" to "AcceptCharset". -func identifier(s string) string { - b := make([]byte, 0, len(s)) - cap := true - for _, c := range s { - if c == '-' { - cap = true - continue - } - if cap && 'a' <= c && c <= 'z' { - c -= 'a' - 'A' - } - cap = false - b = append(b, byte(c)) - } - return string(b) -} - -var test = flag.Bool("test", false, "generate table_test.go") - -func genFile(name string, buf *bytes.Buffer) { - b, err := format.Source(buf.Bytes()) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - if err := ioutil.WriteFile(name, b, 0644); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } -} - -func main() { - flag.Parse() - - var all []string - all = append(all, elements...) - all = append(all, attributes...) - all = append(all, eventHandlers...) - all = append(all, extra...) - sort.Strings(all) - - // uniq - lists have dups - w := 0 - for _, s := range all { - if w == 0 || all[w-1] != s { - all[w] = s - w++ - } - } - all = all[:w] - - if *test { - var buf bytes.Buffer - fmt.Fprintln(&buf, "// Code generated by go generate gen.go; DO NOT EDIT.\n") - fmt.Fprintln(&buf, "//go:generate go run gen.go -test\n") - fmt.Fprintln(&buf, "package atom\n") - fmt.Fprintln(&buf, "var testAtomList = []string{") - for _, s := range all { - fmt.Fprintf(&buf, "\t%q,\n", s) - } - fmt.Fprintln(&buf, "}") - - genFile("table_test.go", &buf) - return - } - - // Find hash that minimizes table size. - var best *table - for i := 0; i < 1000000; i++ { - if best != nil && 1<<(best.k-1) < len(all) { - break - } - h := rand.Uint32() - for k := uint(0); k <= 16; k++ { - if best != nil && k >= best.k { - break - } - var t table - if t.init(h, k, all) { - best = &t - break - } - } - } - if best == nil { - fmt.Fprintf(os.Stderr, "failed to construct string table\n") - os.Exit(1) - } - - // Lay out strings, using overlaps when possible. - layout := append([]string{}, all...) - - // Remove strings that are substrings of other strings - for changed := true; changed; { - changed = false - for i, s := range layout { - if s == "" { - continue - } - for j, t := range layout { - if i != j && t != "" && strings.Contains(s, t) { - changed = true - layout[j] = "" - } - } - } - } - - // Join strings where one suffix matches another prefix. - for { - // Find best i, j, k such that layout[i][len-k:] == layout[j][:k], - // maximizing overlap length k. - besti := -1 - bestj := -1 - bestk := 0 - for i, s := range layout { - if s == "" { - continue - } - for j, t := range layout { - if i == j { - continue - } - for k := bestk + 1; k <= len(s) && k <= len(t); k++ { - if s[len(s)-k:] == t[:k] { - besti = i - bestj = j - bestk = k - } - } - } - } - if bestk > 0 { - layout[besti] += layout[bestj][bestk:] - layout[bestj] = "" - continue - } - break - } - - text := strings.Join(layout, "") - - atom := map[string]uint32{} - for _, s := range all { - off := strings.Index(text, s) - if off < 0 { - panic("lost string " + s) - } - atom[s] = uint32(off<<8 | len(s)) - } - - var buf bytes.Buffer - // Generate the Go code. - fmt.Fprintln(&buf, "// Code generated by go generate gen.go; DO NOT EDIT.\n") - fmt.Fprintln(&buf, "//go:generate go run gen.go\n") - fmt.Fprintln(&buf, "package atom\n\nconst (") - - // compute max len - maxLen := 0 - for _, s := range all { - if maxLen < len(s) { - maxLen = len(s) - } - fmt.Fprintf(&buf, "\t%s Atom = %#x\n", identifier(s), atom[s]) - } - fmt.Fprintln(&buf, ")\n") - - fmt.Fprintf(&buf, "const hash0 = %#x\n\n", best.h0) - fmt.Fprintf(&buf, "const maxAtomLen = %d\n\n", maxLen) - - fmt.Fprintf(&buf, "var table = [1<<%d]Atom{\n", best.k) - for i, s := range best.tab { - if s == "" { - continue - } - fmt.Fprintf(&buf, "\t%#x: %#x, // %s\n", i, atom[s], s) - } - fmt.Fprintf(&buf, "}\n") - datasize := (1 << best.k) * 4 - - fmt.Fprintln(&buf, "const atomText =") - textsize := len(text) - for len(text) > 60 { - fmt.Fprintf(&buf, "\t%q +\n", text[:60]) - text = text[60:] - } - fmt.Fprintf(&buf, "\t%q\n\n", text) - - genFile("table.go", &buf) - - fmt.Fprintf(os.Stdout, "%d atoms; %d string bytes + %d tables = %d total data\n", len(all), textsize, datasize, textsize+datasize) -} - -type byLen []string - -func (x byLen) Less(i, j int) bool { return len(x[i]) > len(x[j]) } -func (x byLen) Swap(i, j int) { x[i], x[j] = x[j], x[i] } -func (x byLen) Len() int { return len(x) } - -// fnv computes the FNV hash with an arbitrary starting value h. -func fnv(h uint32, s string) uint32 { - for i := 0; i < len(s); i++ { - h ^= uint32(s[i]) - h *= 16777619 - } - return h -} - -// A table represents an attempt at constructing the lookup table. -// The lookup table uses cuckoo hashing, meaning that each string -// can be found in one of two positions. -type table struct { - h0 uint32 - k uint - mask uint32 - tab []string -} - -// hash returns the two hashes for s. -func (t *table) hash(s string) (h1, h2 uint32) { - h := fnv(t.h0, s) - h1 = h & t.mask - h2 = (h >> 16) & t.mask - return -} - -// init initializes the table with the given parameters. -// h0 is the initial hash value, -// k is the number of bits of hash value to use, and -// x is the list of strings to store in the table. -// init returns false if the table cannot be constructed. -func (t *table) init(h0 uint32, k uint, x []string) bool { - t.h0 = h0 - t.k = k - t.tab = make([]string, 1< len(t.tab) { - return false - } - s := t.tab[i] - h1, h2 := t.hash(s) - j := h1 + h2 - i - if t.tab[j] != "" && !t.push(j, depth+1) { - return false - } - t.tab[j] = s - return true -} - -// The lists of element names and attribute keys were taken from -// https://html.spec.whatwg.org/multipage/indices.html#index -// as of the "HTML Living Standard - Last Updated 16 April 2018" version. - -// "command", "keygen" and "menuitem" have been removed from the spec, -// but are kept here for backwards compatibility. -var elements = []string{ - "a", - "abbr", - "address", - "area", - "article", - "aside", - "audio", - "b", - "base", - "bdi", - "bdo", - "blockquote", - "body", - "br", - "button", - "canvas", - "caption", - "cite", - "code", - "col", - "colgroup", - "command", - "data", - "datalist", - "dd", - "del", - "details", - "dfn", - "dialog", - "div", - "dl", - "dt", - "em", - "embed", - "fieldset", - "figcaption", - "figure", - "footer", - "form", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "head", - "header", - "hgroup", - "hr", - "html", - "i", - "iframe", - "img", - "input", - "ins", - "kbd", - "keygen", - "label", - "legend", - "li", - "link", - "main", - "map", - "mark", - "menu", - "menuitem", - "meta", - "meter", - "nav", - "noscript", - "object", - "ol", - "optgroup", - "option", - "output", - "p", - "param", - "picture", - "pre", - "progress", - "q", - "rp", - "rt", - "ruby", - "s", - "samp", - "script", - "section", - "select", - "slot", - "small", - "source", - "span", - "strong", - "style", - "sub", - "summary", - "sup", - "table", - "tbody", - "td", - "template", - "textarea", - "tfoot", - "th", - "thead", - "time", - "title", - "tr", - "track", - "u", - "ul", - "var", - "video", - "wbr", -} - -// https://html.spec.whatwg.org/multipage/indices.html#attributes-3 -// -// "challenge", "command", "contextmenu", "dropzone", "icon", "keytype", "mediagroup", -// "radiogroup", "spellcheck", "scoped", "seamless", "sortable" and "sorted" have been removed from the spec, -// but are kept here for backwards compatibility. -var attributes = []string{ - "abbr", - "accept", - "accept-charset", - "accesskey", - "action", - "allowfullscreen", - "allowpaymentrequest", - "allowusermedia", - "alt", - "as", - "async", - "autocomplete", - "autofocus", - "autoplay", - "challenge", - "charset", - "checked", - "cite", - "class", - "color", - "cols", - "colspan", - "command", - "content", - "contenteditable", - "contextmenu", - "controls", - "coords", - "crossorigin", - "data", - "datetime", - "default", - "defer", - "dir", - "dirname", - "disabled", - "download", - "draggable", - "dropzone", - "enctype", - "for", - "form", - "formaction", - "formenctype", - "formmethod", - "formnovalidate", - "formtarget", - "headers", - "height", - "hidden", - "high", - "href", - "hreflang", - "http-equiv", - "icon", - "id", - "inputmode", - "integrity", - "is", - "ismap", - "itemid", - "itemprop", - "itemref", - "itemscope", - "itemtype", - "keytype", - "kind", - "label", - "lang", - "list", - "loop", - "low", - "manifest", - "max", - "maxlength", - "media", - "mediagroup", - "method", - "min", - "minlength", - "multiple", - "muted", - "name", - "nomodule", - "nonce", - "novalidate", - "open", - "optimum", - "pattern", - "ping", - "placeholder", - "playsinline", - "poster", - "preload", - "radiogroup", - "readonly", - "referrerpolicy", - "rel", - "required", - "reversed", - "rows", - "rowspan", - "sandbox", - "spellcheck", - "scope", - "scoped", - "seamless", - "selected", - "shape", - "size", - "sizes", - "sortable", - "sorted", - "slot", - "span", - "spellcheck", - "src", - "srcdoc", - "srclang", - "srcset", - "start", - "step", - "style", - "tabindex", - "target", - "title", - "translate", - "type", - "typemustmatch", - "updateviacache", - "usemap", - "value", - "width", - "workertype", - "wrap", -} - -// "onautocomplete", "onautocompleteerror", "onmousewheel", -// "onshow" and "onsort" have been removed from the spec, -// but are kept here for backwards compatibility. -var eventHandlers = []string{ - "onabort", - "onautocomplete", - "onautocompleteerror", - "onauxclick", - "onafterprint", - "onbeforeprint", - "onbeforeunload", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncopy", - "oncuechange", - "oncut", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragexit", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "onhashchange", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onlanguagechange", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadend", - "onloadstart", - "onmessage", - "onmessageerror", - "onmousedown", - "onmouseenter", - "onmouseleave", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onwheel", - "onoffline", - "ononline", - "onpagehide", - "onpageshow", - "onpaste", - "onpause", - "onplay", - "onplaying", - "onpopstate", - "onprogress", - "onratechange", - "onreset", - "onresize", - "onrejectionhandled", - "onscroll", - "onsecuritypolicyviolation", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onsort", - "onstalled", - "onstorage", - "onsubmit", - "onsuspend", - "ontimeupdate", - "ontoggle", - "onunhandledrejection", - "onunload", - "onvolumechange", - "onwaiting", -} - -// extra are ad-hoc values not covered by any of the lists above. -var extra = []string{ - "acronym", - "align", - "annotation", - "annotation-xml", - "applet", - "basefont", - "bgsound", - "big", - "blink", - "center", - "color", - "desc", - "face", - "font", - "foreignObject", // HTML is case-insensitive, but SVG-embedded-in-HTML is case-sensitive. - "foreignobject", - "frame", - "frameset", - "image", - "isindex", - "listing", - "malignmark", - "marquee", - "math", - "mglyph", - "mi", - "mn", - "mo", - "ms", - "mtext", - "nobr", - "noembed", - "noframes", - "plaintext", - "prompt", - "public", - "rb", - "rtc", - "spacer", - "strike", - "svg", - "system", - "tt", - "xmp", -} diff --git a/vendor/golang.org/x/sys/unix/mkasm_darwin.go b/vendor/golang.org/x/sys/unix/mkasm_darwin.go deleted file mode 100644 index 4548b993..00000000 --- a/vendor/golang.org/x/sys/unix/mkasm_darwin.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// mkasm_darwin.go generates assembly trampolines to call libSystem routines from Go. -//This program must be run after mksyscall.go. -package main - -import ( - "bytes" - "fmt" - "io/ioutil" - "log" - "os" - "strings" -) - -func main() { - in1, err := ioutil.ReadFile("syscall_darwin.go") - if err != nil { - log.Fatalf("can't open syscall_darwin.go: %s", err) - } - arch := os.Args[1] - in2, err := ioutil.ReadFile(fmt.Sprintf("syscall_darwin_%s.go", arch)) - if err != nil { - log.Fatalf("can't open syscall_darwin_%s.go: %s", arch, err) - } - in3, err := ioutil.ReadFile(fmt.Sprintf("zsyscall_darwin_%s.go", arch)) - if err != nil { - log.Fatalf("can't open zsyscall_darwin_%s.go: %s", arch, err) - } - in := string(in1) + string(in2) + string(in3) - - trampolines := map[string]bool{} - - var out bytes.Buffer - - fmt.Fprintf(&out, "// go run mkasm_darwin.go %s\n", strings.Join(os.Args[1:], " ")) - fmt.Fprintf(&out, "// Code generated by the command above; DO NOT EDIT.\n") - fmt.Fprintf(&out, "\n") - fmt.Fprintf(&out, "// +build go1.12\n") - fmt.Fprintf(&out, "\n") - fmt.Fprintf(&out, "#include \"textflag.h\"\n") - for _, line := range strings.Split(in, "\n") { - if !strings.HasPrefix(line, "func ") || !strings.HasSuffix(line, "_trampoline()") { - continue - } - fn := line[5 : len(line)-13] - if !trampolines[fn] { - trampolines[fn] = true - fmt.Fprintf(&out, "TEXT ·%s_trampoline(SB),NOSPLIT,$0-0\n", fn) - fmt.Fprintf(&out, "\tJMP\t%s(SB)\n", fn) - } - } - err = ioutil.WriteFile(fmt.Sprintf("zsyscall_darwin_%s.s", arch), out.Bytes(), 0644) - if err != nil { - log.Fatalf("can't write zsyscall_darwin_%s.s: %s", arch, err) - } -} diff --git a/vendor/golang.org/x/sys/unix/mkpost.go b/vendor/golang.org/x/sys/unix/mkpost.go deleted file mode 100644 index 4d5b531b..00000000 --- a/vendor/golang.org/x/sys/unix/mkpost.go +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// mkpost processes the output of cgo -godefs to -// modify the generated types. It is used to clean up -// the sys API in an architecture specific manner. -// -// mkpost is run after cgo -godefs; see README.md. -package main - -import ( - "bytes" - "fmt" - "go/format" - "io/ioutil" - "log" - "os" - "regexp" -) - -func main() { - // Get the OS and architecture (using GOARCH_TARGET if it exists) - goos := os.Getenv("GOOS") - goarch := os.Getenv("GOARCH_TARGET") - if goarch == "" { - goarch = os.Getenv("GOARCH") - } - // Check that we are using the Docker-based build system if we should be. - if goos == "linux" { - if os.Getenv("GOLANG_SYS_BUILD") != "docker" { - os.Stderr.WriteString("In the Docker-based build system, mkpost should not be called directly.\n") - os.Stderr.WriteString("See README.md\n") - os.Exit(1) - } - } - - b, err := ioutil.ReadAll(os.Stdin) - if err != nil { - log.Fatal(err) - } - - if goos == "aix" { - // Replace type of Atim, Mtim and Ctim by Timespec in Stat_t - // to avoid having both StTimespec and Timespec. - sttimespec := regexp.MustCompile(`_Ctype_struct_st_timespec`) - b = sttimespec.ReplaceAll(b, []byte("Timespec")) - } - - // Intentionally export __val fields in Fsid and Sigset_t - valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__val(\s+\S+\s+)}`) - b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$3}")) - - // Intentionally export __fds_bits field in FdSet - fdSetRegex := regexp.MustCompile(`type (FdSet) struct {(\s+)X__fds_bits(\s+\S+\s+)}`) - b = fdSetRegex.ReplaceAll(b, []byte("type $1 struct {${2}Bits$3}")) - - // If we have empty Ptrace structs, we should delete them. Only s390x emits - // nonempty Ptrace structs. - ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`) - b = ptraceRexexp.ReplaceAll(b, nil) - - // Replace the control_regs union with a blank identifier for now. - controlRegsRegex := regexp.MustCompile(`(Control_regs)\s+\[0\]uint64`) - b = controlRegsRegex.ReplaceAll(b, []byte("_ [0]uint64")) - - // Remove fields that are added by glibc - // Note that this is unstable as the identifers are private. - removeFieldsRegex := regexp.MustCompile(`X__glibc\S*`) - b = removeFieldsRegex.ReplaceAll(b, []byte("_")) - - // Convert [65]int8 to [65]byte in Utsname members to simplify - // conversion to string; see golang.org/issue/20753 - convertUtsnameRegex := regexp.MustCompile(`((Sys|Node|Domain)name|Release|Version|Machine)(\s+)\[(\d+)\]u?int8`) - b = convertUtsnameRegex.ReplaceAll(b, []byte("$1$3[$4]byte")) - - // Convert [1024]int8 to [1024]byte in Ptmget members - convertPtmget := regexp.MustCompile(`([SC]n)(\s+)\[(\d+)\]u?int8`) - b = convertPtmget.ReplaceAll(b, []byte("$1[$3]byte")) - - // Remove spare fields (e.g. in Statx_t) - spareFieldsRegex := regexp.MustCompile(`X__spare\S*`) - b = spareFieldsRegex.ReplaceAll(b, []byte("_")) - - // Remove cgo padding fields - removePaddingFieldsRegex := regexp.MustCompile(`Pad_cgo_\d+`) - b = removePaddingFieldsRegex.ReplaceAll(b, []byte("_")) - - // Remove padding, hidden, or unused fields - removeFieldsRegex = regexp.MustCompile(`\b(X_\S+|Padding)`) - b = removeFieldsRegex.ReplaceAll(b, []byte("_")) - - // Remove the first line of warning from cgo - b = b[bytes.IndexByte(b, '\n')+1:] - // Modify the command in the header to include: - // mkpost, our own warning, and a build tag. - replacement := fmt.Sprintf(`$1 | go run mkpost.go -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s,%s`, goarch, goos) - cgoCommandRegex := regexp.MustCompile(`(cgo -godefs .*)`) - b = cgoCommandRegex.ReplaceAll(b, []byte(replacement)) - - // Rename Stat_t time fields - if goos == "freebsd" && goarch == "386" { - // Hide Stat_t.[AMCB]tim_ext fields - renameStatTimeExtFieldsRegex := regexp.MustCompile(`[AMCB]tim_ext`) - b = renameStatTimeExtFieldsRegex.ReplaceAll(b, []byte("_")) - } - renameStatTimeFieldsRegex := regexp.MustCompile(`([AMCB])(?:irth)?time?(?:spec)?\s+(Timespec|StTimespec)`) - b = renameStatTimeFieldsRegex.ReplaceAll(b, []byte("${1}tim ${2}")) - - // gofmt - b, err = format.Source(b) - if err != nil { - log.Fatal(err) - } - - os.Stdout.Write(b) -} diff --git a/vendor/golang.org/x/sys/unix/mksyscall.go b/vendor/golang.org/x/sys/unix/mksyscall.go deleted file mode 100644 index e4af9424..00000000 --- a/vendor/golang.org/x/sys/unix/mksyscall.go +++ /dev/null @@ -1,407 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -This program reads a file containing function prototypes -(like syscall_darwin.go) and generates system call bodies. -The prototypes are marked by lines beginning with "//sys" -and read like func declarations if //sys is replaced by func, but: - * The parameter lists must give a name for each argument. - This includes return parameters. - * The parameter lists must give a type for each argument: - the (x, y, z int) shorthand is not allowed. - * If the return parameter is an error number, it must be named errno. - -A line beginning with //sysnb is like //sys, except that the -goroutine will not be suspended during the execution of the system -call. This must only be used for system calls which can never -block, as otherwise the system call could cause all goroutines to -hang. -*/ -package main - -import ( - "bufio" - "flag" - "fmt" - "os" - "regexp" - "strings" -) - -var ( - b32 = flag.Bool("b32", false, "32bit big-endian") - l32 = flag.Bool("l32", false, "32bit little-endian") - plan9 = flag.Bool("plan9", false, "plan9") - openbsd = flag.Bool("openbsd", false, "openbsd") - netbsd = flag.Bool("netbsd", false, "netbsd") - dragonfly = flag.Bool("dragonfly", false, "dragonfly") - arm = flag.Bool("arm", false, "arm") // 64-bit value should use (even, odd)-pair - tags = flag.String("tags", "", "build tags") - filename = flag.String("output", "", "output file name (standard output if omitted)") -) - -// cmdLine returns this programs's commandline arguments -func cmdLine() string { - return "go run mksyscall.go " + strings.Join(os.Args[1:], " ") -} - -// buildTags returns build tags -func buildTags() string { - return *tags -} - -// Param is function parameter -type Param struct { - Name string - Type string -} - -// usage prints the program usage -func usage() { - fmt.Fprintf(os.Stderr, "usage: go run mksyscall.go [-b32 | -l32] [-tags x,y] [file ...]\n") - os.Exit(1) -} - -// parseParamList parses parameter list and returns a slice of parameters -func parseParamList(list string) []string { - list = strings.TrimSpace(list) - if list == "" { - return []string{} - } - return regexp.MustCompile(`\s*,\s*`).Split(list, -1) -} - -// parseParam splits a parameter into name and type -func parseParam(p string) Param { - ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p) - if ps == nil { - fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p) - os.Exit(1) - } - return Param{ps[1], ps[2]} -} - -func main() { - // Get the OS and architecture (using GOARCH_TARGET if it exists) - goos := os.Getenv("GOOS") - if goos == "" { - fmt.Fprintln(os.Stderr, "GOOS not defined in environment") - os.Exit(1) - } - goarch := os.Getenv("GOARCH_TARGET") - if goarch == "" { - goarch = os.Getenv("GOARCH") - } - - // Check that we are using the Docker-based build system if we should - if goos == "linux" { - if os.Getenv("GOLANG_SYS_BUILD") != "docker" { - fmt.Fprintf(os.Stderr, "In the Docker-based build system, mksyscall should not be called directly.\n") - fmt.Fprintf(os.Stderr, "See README.md\n") - os.Exit(1) - } - } - - flag.Usage = usage - flag.Parse() - if len(flag.Args()) <= 0 { - fmt.Fprintf(os.Stderr, "no files to parse provided\n") - usage() - } - - endianness := "" - if *b32 { - endianness = "big-endian" - } else if *l32 { - endianness = "little-endian" - } - - libc := false - if goos == "darwin" && strings.Contains(buildTags(), ",go1.12") { - libc = true - } - trampolines := map[string]bool{} - - text := "" - for _, path := range flag.Args() { - file, err := os.Open(path) - if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - s := bufio.NewScanner(file) - for s.Scan() { - t := s.Text() - t = strings.TrimSpace(t) - t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `) - nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t) - if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil { - continue - } - - // Line must be of the form - // func Open(path string, mode int, perm int) (fd int, errno error) - // Split into name, in params, out params. - f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*((?i)SYS_[A-Z0-9_]+))?$`).FindStringSubmatch(t) - if f == nil { - fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t) - os.Exit(1) - } - funct, inps, outps, sysname := f[2], f[3], f[4], f[5] - - // ClockGettime doesn't have a syscall number on Darwin, only generate libc wrappers. - if goos == "darwin" && !libc && funct == "ClockGettime" { - continue - } - - // Split argument lists on comma. - in := parseParamList(inps) - out := parseParamList(outps) - - // Try in vain to keep people from editing this file. - // The theory is that they jump into the middle of the file - // without reading the header. - text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" - - // Go function header. - outDecl := "" - if len(out) > 0 { - outDecl = fmt.Sprintf(" (%s)", strings.Join(out, ", ")) - } - text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outDecl) - - // Check if err return available - errvar := "" - for _, param := range out { - p := parseParam(param) - if p.Type == "error" { - errvar = p.Name - break - } - } - - // Prepare arguments to Syscall. - var args []string - n := 0 - for _, param := range in { - p := parseParam(param) - if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { - args = append(args, "uintptr(unsafe.Pointer("+p.Name+"))") - } else if p.Type == "string" && errvar != "" { - text += fmt.Sprintf("\tvar _p%d *byte\n", n) - text += fmt.Sprintf("\t_p%d, %s = BytePtrFromString(%s)\n", n, errvar, p.Name) - text += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar) - args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) - n++ - } else if p.Type == "string" { - fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n") - text += fmt.Sprintf("\tvar _p%d *byte\n", n) - text += fmt.Sprintf("\t_p%d, _ = BytePtrFromString(%s)\n", n, p.Name) - args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) - n++ - } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil { - // Convert slice into pointer, length. - // Have to be careful not to take address of &a[0] if len == 0: - // pass dummy pointer in that case. - // Used to pass nil, but some OSes or simulators reject write(fd, nil, 0). - text += fmt.Sprintf("\tvar _p%d unsafe.Pointer\n", n) - text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = unsafe.Pointer(&%s[0])\n\t}", p.Name, n, p.Name) - text += fmt.Sprintf(" else {\n\t\t_p%d = unsafe.Pointer(&_zero)\n\t}\n", n) - args = append(args, fmt.Sprintf("uintptr(_p%d)", n), fmt.Sprintf("uintptr(len(%s))", p.Name)) - n++ - } else if p.Type == "int64" && (*openbsd || *netbsd) { - args = append(args, "0") - if endianness == "big-endian" { - args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) - } else if endianness == "little-endian" { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) - } else { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name)) - } - } else if p.Type == "int64" && *dragonfly { - if regexp.MustCompile(`^(?i)extp(read|write)`).FindStringSubmatch(funct) == nil { - args = append(args, "0") - } - if endianness == "big-endian" { - args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) - } else if endianness == "little-endian" { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) - } else { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name)) - } - } else if (p.Type == "int64" || p.Type == "uint64") && endianness != "" { - if len(args)%2 == 1 && *arm { - // arm abi specifies 64-bit argument uses - // (even, odd) pair - args = append(args, "0") - } - if endianness == "big-endian" { - args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) - } else { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) - } - } else { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name)) - } - } - - // Determine which form to use; pad args with zeros. - asm := "Syscall" - if nonblock != nil { - if errvar == "" && goos == "linux" { - asm = "RawSyscallNoError" - } else { - asm = "RawSyscall" - } - } else { - if errvar == "" && goos == "linux" { - asm = "SyscallNoError" - } - } - if len(args) <= 3 { - for len(args) < 3 { - args = append(args, "0") - } - } else if len(args) <= 6 { - asm += "6" - for len(args) < 6 { - args = append(args, "0") - } - } else if len(args) <= 9 { - asm += "9" - for len(args) < 9 { - args = append(args, "0") - } - } else { - fmt.Fprintf(os.Stderr, "%s:%s too many arguments to system call\n", path, funct) - } - - // System call number. - if sysname == "" { - sysname = "SYS_" + funct - sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`) - sysname = strings.ToUpper(sysname) - } - - var libcFn string - if libc { - asm = "syscall_" + strings.ToLower(asm[:1]) + asm[1:] // internal syscall call - sysname = strings.TrimPrefix(sysname, "SYS_") // remove SYS_ - sysname = strings.ToLower(sysname) // lowercase - if sysname == "getdirentries64" { - // Special case - libSystem name and - // raw syscall name don't match. - sysname = "__getdirentries64" - } - libcFn = sysname - sysname = "funcPC(libc_" + sysname + "_trampoline)" - } - - // Actual call. - arglist := strings.Join(args, ", ") - call := fmt.Sprintf("%s(%s, %s)", asm, sysname, arglist) - - // Assign return values. - body := "" - ret := []string{"_", "_", "_"} - doErrno := false - for i := 0; i < len(out); i++ { - p := parseParam(out[i]) - reg := "" - if p.Name == "err" && !*plan9 { - reg = "e1" - ret[2] = reg - doErrno = true - } else if p.Name == "err" && *plan9 { - ret[0] = "r0" - ret[2] = "e1" - break - } else { - reg = fmt.Sprintf("r%d", i) - ret[i] = reg - } - if p.Type == "bool" { - reg = fmt.Sprintf("%s != 0", reg) - } - if p.Type == "int64" && endianness != "" { - // 64-bit number in r1:r0 or r0:r1. - if i+2 > len(out) { - fmt.Fprintf(os.Stderr, "%s:%s not enough registers for int64 return\n", path, funct) - } - if endianness == "big-endian" { - reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i, i+1) - } else { - reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i+1, i) - } - ret[i] = fmt.Sprintf("r%d", i) - ret[i+1] = fmt.Sprintf("r%d", i+1) - } - if reg != "e1" || *plan9 { - body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg) - } - } - if ret[0] == "_" && ret[1] == "_" && ret[2] == "_" { - text += fmt.Sprintf("\t%s\n", call) - } else { - if errvar == "" && goos == "linux" { - // raw syscall without error on Linux, see golang.org/issue/22924 - text += fmt.Sprintf("\t%s, %s := %s\n", ret[0], ret[1], call) - } else { - text += fmt.Sprintf("\t%s, %s, %s := %s\n", ret[0], ret[1], ret[2], call) - } - } - text += body - - if *plan9 && ret[2] == "e1" { - text += "\tif int32(r0) == -1 {\n" - text += "\t\terr = e1\n" - text += "\t}\n" - } else if doErrno { - text += "\tif e1 != 0 {\n" - text += "\t\terr = errnoErr(e1)\n" - text += "\t}\n" - } - text += "\treturn\n" - text += "}\n\n" - - if libc && !trampolines[libcFn] { - // some system calls share a trampoline, like read and readlen. - trampolines[libcFn] = true - // Declare assembly trampoline. - text += fmt.Sprintf("func libc_%s_trampoline()\n", libcFn) - // Assembly trampoline calls the libc_* function, which this magic - // redirects to use the function from libSystem. - text += fmt.Sprintf("//go:linkname libc_%s libc_%s\n", libcFn, libcFn) - text += fmt.Sprintf("//go:cgo_import_dynamic libc_%s %s \"/usr/lib/libSystem.B.dylib\"\n", libcFn, libcFn) - text += "\n" - } - } - if err := s.Err(); err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - file.Close() - } - fmt.Printf(srcTemplate, cmdLine(), buildTags(), text) -} - -const srcTemplate = `// %s -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s - -package unix - -import ( - "syscall" - "unsafe" -) - -var _ syscall.Errno - -%s -` diff --git a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go b/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go deleted file mode 100644 index 3be3cdfc..00000000 --- a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go +++ /dev/null @@ -1,415 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -This program reads a file containing function prototypes -(like syscall_aix.go) and generates system call bodies. -The prototypes are marked by lines beginning with "//sys" -and read like func declarations if //sys is replaced by func, but: - * The parameter lists must give a name for each argument. - This includes return parameters. - * The parameter lists must give a type for each argument: - the (x, y, z int) shorthand is not allowed. - * If the return parameter is an error number, it must be named err. - * If go func name needs to be different than its libc name, - * or the function is not in libc, name could be specified - * at the end, after "=" sign, like - //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt -*/ -package main - -import ( - "bufio" - "flag" - "fmt" - "os" - "regexp" - "strings" -) - -var ( - b32 = flag.Bool("b32", false, "32bit big-endian") - l32 = flag.Bool("l32", false, "32bit little-endian") - aix = flag.Bool("aix", false, "aix") - tags = flag.String("tags", "", "build tags") -) - -// cmdLine returns this programs's commandline arguments -func cmdLine() string { - return "go run mksyscall_aix_ppc.go " + strings.Join(os.Args[1:], " ") -} - -// buildTags returns build tags -func buildTags() string { - return *tags -} - -// Param is function parameter -type Param struct { - Name string - Type string -} - -// usage prints the program usage -func usage() { - fmt.Fprintf(os.Stderr, "usage: go run mksyscall_aix_ppc.go [-b32 | -l32] [-tags x,y] [file ...]\n") - os.Exit(1) -} - -// parseParamList parses parameter list and returns a slice of parameters -func parseParamList(list string) []string { - list = strings.TrimSpace(list) - if list == "" { - return []string{} - } - return regexp.MustCompile(`\s*,\s*`).Split(list, -1) -} - -// parseParam splits a parameter into name and type -func parseParam(p string) Param { - ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p) - if ps == nil { - fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p) - os.Exit(1) - } - return Param{ps[1], ps[2]} -} - -func main() { - flag.Usage = usage - flag.Parse() - if len(flag.Args()) <= 0 { - fmt.Fprintf(os.Stderr, "no files to parse provided\n") - usage() - } - - endianness := "" - if *b32 { - endianness = "big-endian" - } else if *l32 { - endianness = "little-endian" - } - - pack := "" - text := "" - cExtern := "/*\n#include \n#include \n" - for _, path := range flag.Args() { - file, err := os.Open(path) - if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - s := bufio.NewScanner(file) - for s.Scan() { - t := s.Text() - t = strings.TrimSpace(t) - t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `) - if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" { - pack = p[1] - } - nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t) - if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil { - continue - } - - // Line must be of the form - // func Open(path string, mode int, perm int) (fd int, err error) - // Split into name, in params, out params. - f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t) - if f == nil { - fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t) - os.Exit(1) - } - funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6] - - // Split argument lists on comma. - in := parseParamList(inps) - out := parseParamList(outps) - - inps = strings.Join(in, ", ") - outps = strings.Join(out, ", ") - - // Try in vain to keep people from editing this file. - // The theory is that they jump into the middle of the file - // without reading the header. - text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" - - // Check if value return, err return available - errvar := "" - retvar := "" - rettype := "" - for _, param := range out { - p := parseParam(param) - if p.Type == "error" { - errvar = p.Name - } else { - retvar = p.Name - rettype = p.Type - } - } - - // System call name. - if sysname == "" { - sysname = funct - } - sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`) - sysname = strings.ToLower(sysname) // All libc functions are lowercase. - - cRettype := "" - if rettype == "unsafe.Pointer" { - cRettype = "uintptr_t" - } else if rettype == "uintptr" { - cRettype = "uintptr_t" - } else if regexp.MustCompile(`^_`).FindStringSubmatch(rettype) != nil { - cRettype = "uintptr_t" - } else if rettype == "int" { - cRettype = "int" - } else if rettype == "int32" { - cRettype = "int" - } else if rettype == "int64" { - cRettype = "long long" - } else if rettype == "uint32" { - cRettype = "unsigned int" - } else if rettype == "uint64" { - cRettype = "unsigned long long" - } else { - cRettype = "int" - } - if sysname == "exit" { - cRettype = "void" - } - - // Change p.Types to c - var cIn []string - for _, param := range in { - p := parseParam(param) - if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { - cIn = append(cIn, "uintptr_t") - } else if p.Type == "string" { - cIn = append(cIn, "uintptr_t") - } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil { - cIn = append(cIn, "uintptr_t", "size_t") - } else if p.Type == "unsafe.Pointer" { - cIn = append(cIn, "uintptr_t") - } else if p.Type == "uintptr" { - cIn = append(cIn, "uintptr_t") - } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil { - cIn = append(cIn, "uintptr_t") - } else if p.Type == "int" { - cIn = append(cIn, "int") - } else if p.Type == "int32" { - cIn = append(cIn, "int") - } else if p.Type == "int64" { - cIn = append(cIn, "long long") - } else if p.Type == "uint32" { - cIn = append(cIn, "unsigned int") - } else if p.Type == "uint64" { - cIn = append(cIn, "unsigned long long") - } else { - cIn = append(cIn, "int") - } - } - - if funct != "fcntl" && funct != "FcntlInt" && funct != "readlen" && funct != "writelen" { - if sysname == "select" { - // select is a keyword of Go. Its name is - // changed to c_select. - cExtern += "#define c_select select\n" - } - // Imports of system calls from libc - cExtern += fmt.Sprintf("%s %s", cRettype, sysname) - cIn := strings.Join(cIn, ", ") - cExtern += fmt.Sprintf("(%s);\n", cIn) - } - - // So file name. - if *aix { - if modname == "" { - modname = "libc.a/shr_64.o" - } else { - fmt.Fprintf(os.Stderr, "%s: only syscall using libc are available\n", funct) - os.Exit(1) - } - } - - strconvfunc := "C.CString" - - // Go function header. - if outps != "" { - outps = fmt.Sprintf(" (%s)", outps) - } - if text != "" { - text += "\n" - } - - text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outps) - - // Prepare arguments to Syscall. - var args []string - n := 0 - argN := 0 - for _, param := range in { - p := parseParam(param) - if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { - args = append(args, "C.uintptr_t(uintptr(unsafe.Pointer("+p.Name+")))") - } else if p.Type == "string" && errvar != "" { - text += fmt.Sprintf("\t_p%d := uintptr(unsafe.Pointer(%s(%s)))\n", n, strconvfunc, p.Name) - args = append(args, fmt.Sprintf("C.uintptr_t(_p%d)", n)) - n++ - } else if p.Type == "string" { - fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n") - text += fmt.Sprintf("\t_p%d := uintptr(unsafe.Pointer(%s(%s)))\n", n, strconvfunc, p.Name) - args = append(args, fmt.Sprintf("C.uintptr_t(_p%d)", n)) - n++ - } else if m := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); m != nil { - // Convert slice into pointer, length. - // Have to be careful not to take address of &a[0] if len == 0: - // pass nil in that case. - text += fmt.Sprintf("\tvar _p%d *%s\n", n, m[1]) - text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name) - args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(unsafe.Pointer(_p%d)))", n)) - n++ - text += fmt.Sprintf("\tvar _p%d int\n", n) - text += fmt.Sprintf("\t_p%d = len(%s)\n", n, p.Name) - args = append(args, fmt.Sprintf("C.size_t(_p%d)", n)) - n++ - } else if p.Type == "int64" && endianness != "" { - if endianness == "big-endian" { - args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) - } else { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) - } - n++ - } else if p.Type == "bool" { - text += fmt.Sprintf("\tvar _p%d uint32\n", n) - text += fmt.Sprintf("\tif %s {\n\t\t_p%d = 1\n\t} else {\n\t\t_p%d = 0\n\t}\n", p.Name, n, n) - args = append(args, fmt.Sprintf("_p%d", n)) - } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil { - args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(%s))", p.Name)) - } else if p.Type == "unsafe.Pointer" { - args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(%s))", p.Name)) - } else if p.Type == "int" { - if (argN == 2) && ((funct == "readlen") || (funct == "writelen")) { - args = append(args, fmt.Sprintf("C.size_t(%s)", p.Name)) - } else if argN == 0 && funct == "fcntl" { - args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) - } else if (argN == 2) && ((funct == "fcntl") || (funct == "FcntlInt")) { - args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) - } else { - args = append(args, fmt.Sprintf("C.int(%s)", p.Name)) - } - } else if p.Type == "int32" { - args = append(args, fmt.Sprintf("C.int(%s)", p.Name)) - } else if p.Type == "int64" { - args = append(args, fmt.Sprintf("C.longlong(%s)", p.Name)) - } else if p.Type == "uint32" { - args = append(args, fmt.Sprintf("C.uint(%s)", p.Name)) - } else if p.Type == "uint64" { - args = append(args, fmt.Sprintf("C.ulonglong(%s)", p.Name)) - } else if p.Type == "uintptr" { - args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) - } else { - args = append(args, fmt.Sprintf("C.int(%s)", p.Name)) - } - argN++ - } - - // Actual call. - arglist := strings.Join(args, ", ") - call := "" - if sysname == "exit" { - if errvar != "" { - call += "er :=" - } else { - call += "" - } - } else if errvar != "" { - call += "r0,er :=" - } else if retvar != "" { - call += "r0,_ :=" - } else { - call += "" - } - if sysname == "select" { - // select is a keyword of Go. Its name is - // changed to c_select. - call += fmt.Sprintf("C.c_%s(%s)", sysname, arglist) - } else { - call += fmt.Sprintf("C.%s(%s)", sysname, arglist) - } - - // Assign return values. - body := "" - for i := 0; i < len(out); i++ { - p := parseParam(out[i]) - reg := "" - if p.Name == "err" { - reg = "e1" - } else { - reg = "r0" - } - if reg != "e1" { - body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg) - } - } - - // verify return - if sysname != "exit" && errvar != "" { - if regexp.MustCompile(`^uintptr`).FindStringSubmatch(cRettype) != nil { - body += "\tif (uintptr(r0) ==^uintptr(0) && er != nil) {\n" - body += fmt.Sprintf("\t\t%s = er\n", errvar) - body += "\t}\n" - } else { - body += "\tif (r0 ==-1 && er != nil) {\n" - body += fmt.Sprintf("\t\t%s = er\n", errvar) - body += "\t}\n" - } - } else if errvar != "" { - body += "\tif (er != nil) {\n" - body += fmt.Sprintf("\t\t%s = er\n", errvar) - body += "\t}\n" - } - - text += fmt.Sprintf("\t%s\n", call) - text += body - - text += "\treturn\n" - text += "}\n" - } - if err := s.Err(); err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - file.Close() - } - imp := "" - if pack != "unix" { - imp = "import \"golang.org/x/sys/unix\"\n" - - } - fmt.Printf(srcTemplate, cmdLine(), buildTags(), pack, cExtern, imp, text) -} - -const srcTemplate = `// %s -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s - -package %s - - -%s -*/ -import "C" -import ( - "unsafe" -) - - -%s - -%s -` diff --git a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go b/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go deleted file mode 100644 index c9600995..00000000 --- a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go +++ /dev/null @@ -1,614 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -This program reads a file containing function prototypes -(like syscall_aix.go) and generates system call bodies. -The prototypes are marked by lines beginning with "//sys" -and read like func declarations if //sys is replaced by func, but: - * The parameter lists must give a name for each argument. - This includes return parameters. - * The parameter lists must give a type for each argument: - the (x, y, z int) shorthand is not allowed. - * If the return parameter is an error number, it must be named err. - * If go func name needs to be different than its libc name, - * or the function is not in libc, name could be specified - * at the end, after "=" sign, like - //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt - - -This program will generate three files and handle both gc and gccgo implementation: - - zsyscall_aix_ppc64.go: the common part of each implementation (error handler, pointer creation) - - zsyscall_aix_ppc64_gc.go: gc part with //go_cgo_import_dynamic and a call to syscall6 - - zsyscall_aix_ppc64_gccgo.go: gccgo part with C function and conversion to C type. - - The generated code looks like this - -zsyscall_aix_ppc64.go -func asyscall(...) (n int, err error) { - // Pointer Creation - r1, e1 := callasyscall(...) - // Type Conversion - // Error Handler - return -} - -zsyscall_aix_ppc64_gc.go -//go:cgo_import_dynamic libc_asyscall asyscall "libc.a/shr_64.o" -//go:linkname libc_asyscall libc_asyscall -var asyscall syscallFunc - -func callasyscall(...) (r1 uintptr, e1 Errno) { - r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_asyscall)), "nb_args", ... ) - return -} - -zsyscall_aix_ppc64_ggcgo.go - -// int asyscall(...) - -import "C" - -func callasyscall(...) (r1 uintptr, e1 Errno) { - r1 = uintptr(C.asyscall(...)) - e1 = syscall.GetErrno() - return -} -*/ - -package main - -import ( - "bufio" - "flag" - "fmt" - "io/ioutil" - "os" - "regexp" - "strings" -) - -var ( - b32 = flag.Bool("b32", false, "32bit big-endian") - l32 = flag.Bool("l32", false, "32bit little-endian") - aix = flag.Bool("aix", false, "aix") - tags = flag.String("tags", "", "build tags") -) - -// cmdLine returns this programs's commandline arguments -func cmdLine() string { - return "go run mksyscall_aix_ppc64.go " + strings.Join(os.Args[1:], " ") -} - -// buildTags returns build tags -func buildTags() string { - return *tags -} - -// Param is function parameter -type Param struct { - Name string - Type string -} - -// usage prints the program usage -func usage() { - fmt.Fprintf(os.Stderr, "usage: go run mksyscall_aix_ppc64.go [-b32 | -l32] [-tags x,y] [file ...]\n") - os.Exit(1) -} - -// parseParamList parses parameter list and returns a slice of parameters -func parseParamList(list string) []string { - list = strings.TrimSpace(list) - if list == "" { - return []string{} - } - return regexp.MustCompile(`\s*,\s*`).Split(list, -1) -} - -// parseParam splits a parameter into name and type -func parseParam(p string) Param { - ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p) - if ps == nil { - fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p) - os.Exit(1) - } - return Param{ps[1], ps[2]} -} - -func main() { - flag.Usage = usage - flag.Parse() - if len(flag.Args()) <= 0 { - fmt.Fprintf(os.Stderr, "no files to parse provided\n") - usage() - } - - endianness := "" - if *b32 { - endianness = "big-endian" - } else if *l32 { - endianness = "little-endian" - } - - pack := "" - // GCCGO - textgccgo := "" - cExtern := "/*\n#include \n" - // GC - textgc := "" - dynimports := "" - linknames := "" - var vars []string - // COMMON - textcommon := "" - for _, path := range flag.Args() { - file, err := os.Open(path) - if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - s := bufio.NewScanner(file) - for s.Scan() { - t := s.Text() - t = strings.TrimSpace(t) - t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `) - if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" { - pack = p[1] - } - nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t) - if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil { - continue - } - - // Line must be of the form - // func Open(path string, mode int, perm int) (fd int, err error) - // Split into name, in params, out params. - f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t) - if f == nil { - fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t) - os.Exit(1) - } - funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6] - - // Split argument lists on comma. - in := parseParamList(inps) - out := parseParamList(outps) - - inps = strings.Join(in, ", ") - outps = strings.Join(out, ", ") - - if sysname == "" { - sysname = funct - } - - onlyCommon := false - if funct == "readlen" || funct == "writelen" || funct == "FcntlInt" || funct == "FcntlFlock" { - // This function call another syscall which is already implemented. - // Therefore, the gc and gccgo part must not be generated. - onlyCommon = true - } - - // Try in vain to keep people from editing this file. - // The theory is that they jump into the middle of the file - // without reading the header. - - textcommon += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" - if !onlyCommon { - textgccgo += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" - textgc += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" - } - - // Check if value return, err return available - errvar := "" - rettype := "" - for _, param := range out { - p := parseParam(param) - if p.Type == "error" { - errvar = p.Name - } else { - rettype = p.Type - } - } - - sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`) - sysname = strings.ToLower(sysname) // All libc functions are lowercase. - - // GCCGO Prototype return type - cRettype := "" - if rettype == "unsafe.Pointer" { - cRettype = "uintptr_t" - } else if rettype == "uintptr" { - cRettype = "uintptr_t" - } else if regexp.MustCompile(`^_`).FindStringSubmatch(rettype) != nil { - cRettype = "uintptr_t" - } else if rettype == "int" { - cRettype = "int" - } else if rettype == "int32" { - cRettype = "int" - } else if rettype == "int64" { - cRettype = "long long" - } else if rettype == "uint32" { - cRettype = "unsigned int" - } else if rettype == "uint64" { - cRettype = "unsigned long long" - } else { - cRettype = "int" - } - if sysname == "exit" { - cRettype = "void" - } - - // GCCGO Prototype arguments type - var cIn []string - for i, param := range in { - p := parseParam(param) - if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { - cIn = append(cIn, "uintptr_t") - } else if p.Type == "string" { - cIn = append(cIn, "uintptr_t") - } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil { - cIn = append(cIn, "uintptr_t", "size_t") - } else if p.Type == "unsafe.Pointer" { - cIn = append(cIn, "uintptr_t") - } else if p.Type == "uintptr" { - cIn = append(cIn, "uintptr_t") - } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil { - cIn = append(cIn, "uintptr_t") - } else if p.Type == "int" { - if (i == 0 || i == 2) && funct == "fcntl" { - // These fcntl arguments needs to be uintptr to be able to call FcntlInt and FcntlFlock - cIn = append(cIn, "uintptr_t") - } else { - cIn = append(cIn, "int") - } - - } else if p.Type == "int32" { - cIn = append(cIn, "int") - } else if p.Type == "int64" { - cIn = append(cIn, "long long") - } else if p.Type == "uint32" { - cIn = append(cIn, "unsigned int") - } else if p.Type == "uint64" { - cIn = append(cIn, "unsigned long long") - } else { - cIn = append(cIn, "int") - } - } - - if !onlyCommon { - // GCCGO Prototype Generation - // Imports of system calls from libc - if sysname == "select" { - // select is a keyword of Go. Its name is - // changed to c_select. - cExtern += "#define c_select select\n" - } - cExtern += fmt.Sprintf("%s %s", cRettype, sysname) - cIn := strings.Join(cIn, ", ") - cExtern += fmt.Sprintf("(%s);\n", cIn) - } - // GC Library name - if modname == "" { - modname = "libc.a/shr_64.o" - } else { - fmt.Fprintf(os.Stderr, "%s: only syscall using libc are available\n", funct) - os.Exit(1) - } - sysvarname := fmt.Sprintf("libc_%s", sysname) - - if !onlyCommon { - // GC Runtime import of function to allow cross-platform builds. - dynimports += fmt.Sprintf("//go:cgo_import_dynamic %s %s \"%s\"\n", sysvarname, sysname, modname) - // GC Link symbol to proc address variable. - linknames += fmt.Sprintf("//go:linkname %s %s\n", sysvarname, sysvarname) - // GC Library proc address variable. - vars = append(vars, sysvarname) - } - - strconvfunc := "BytePtrFromString" - strconvtype := "*byte" - - // Go function header. - if outps != "" { - outps = fmt.Sprintf(" (%s)", outps) - } - if textcommon != "" { - textcommon += "\n" - } - - textcommon += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outps) - - // Prepare arguments tocall. - var argscommon []string // Arguments in the common part - var argscall []string // Arguments for call prototype - var argsgc []string // Arguments for gc call (with syscall6) - var argsgccgo []string // Arguments for gccgo call (with C.name_of_syscall) - n := 0 - argN := 0 - for _, param := range in { - p := parseParam(param) - if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { - argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(%s))", p.Name)) - argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name)) - argsgc = append(argsgc, p.Name) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) - } else if p.Type == "string" && errvar != "" { - textcommon += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype) - textcommon += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name) - textcommon += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar) - - argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) - argscall = append(argscall, fmt.Sprintf("_p%d uintptr ", n)) - argsgc = append(argsgc, fmt.Sprintf("_p%d", n)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n)) - n++ - } else if p.Type == "string" { - fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n") - textcommon += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype) - textcommon += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name) - textcommon += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar) - - argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) - argscall = append(argscall, fmt.Sprintf("_p%d uintptr", n)) - argsgc = append(argsgc, fmt.Sprintf("_p%d", n)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n)) - n++ - } else if m := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); m != nil { - // Convert slice into pointer, length. - // Have to be careful not to take address of &a[0] if len == 0: - // pass nil in that case. - textcommon += fmt.Sprintf("\tvar _p%d *%s\n", n, m[1]) - textcommon += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name) - argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n), fmt.Sprintf("len(%s)", p.Name)) - argscall = append(argscall, fmt.Sprintf("_p%d uintptr", n), fmt.Sprintf("_lenp%d int", n)) - argsgc = append(argsgc, fmt.Sprintf("_p%d", n), fmt.Sprintf("uintptr(_lenp%d)", n)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n), fmt.Sprintf("C.size_t(_lenp%d)", n)) - n++ - } else if p.Type == "int64" && endianness != "" { - fmt.Fprintf(os.Stderr, path+":"+funct+" uses int64 with 32 bits mode. Case not yet implemented\n") - } else if p.Type == "bool" { - fmt.Fprintf(os.Stderr, path+":"+funct+" uses bool. Case not yet implemented\n") - } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil || p.Type == "unsafe.Pointer" { - argscommon = append(argscommon, fmt.Sprintf("uintptr(%s)", p.Name)) - argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name)) - argsgc = append(argsgc, p.Name) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) - } else if p.Type == "int" { - if (argN == 0 || argN == 2) && ((funct == "fcntl") || (funct == "FcntlInt") || (funct == "FcntlFlock")) { - // These fcntl arguments need to be uintptr to be able to call FcntlInt and FcntlFlock - argscommon = append(argscommon, fmt.Sprintf("uintptr(%s)", p.Name)) - argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name)) - argsgc = append(argsgc, p.Name) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) - - } else { - argscommon = append(argscommon, p.Name) - argscall = append(argscall, fmt.Sprintf("%s int", p.Name)) - argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name)) - } - } else if p.Type == "int32" { - argscommon = append(argscommon, p.Name) - argscall = append(argscall, fmt.Sprintf("%s int32", p.Name)) - argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name)) - } else if p.Type == "int64" { - argscommon = append(argscommon, p.Name) - argscall = append(argscall, fmt.Sprintf("%s int64", p.Name)) - argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.longlong(%s)", p.Name)) - } else if p.Type == "uint32" { - argscommon = append(argscommon, p.Name) - argscall = append(argscall, fmt.Sprintf("%s uint32", p.Name)) - argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.uint(%s)", p.Name)) - } else if p.Type == "uint64" { - argscommon = append(argscommon, p.Name) - argscall = append(argscall, fmt.Sprintf("%s uint64", p.Name)) - argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.ulonglong(%s)", p.Name)) - } else if p.Type == "uintptr" { - argscommon = append(argscommon, p.Name) - argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name)) - argsgc = append(argsgc, p.Name) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) - } else { - argscommon = append(argscommon, fmt.Sprintf("int(%s)", p.Name)) - argscall = append(argscall, fmt.Sprintf("%s int", p.Name)) - argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name)) - } - argN++ - } - nargs := len(argsgc) - - // COMMON function generation - argscommonlist := strings.Join(argscommon, ", ") - callcommon := fmt.Sprintf("call%s(%s)", sysname, argscommonlist) - ret := []string{"_", "_"} - body := "" - doErrno := false - for i := 0; i < len(out); i++ { - p := parseParam(out[i]) - reg := "" - if p.Name == "err" { - reg = "e1" - ret[1] = reg - doErrno = true - } else { - reg = "r0" - ret[0] = reg - } - if p.Type == "bool" { - reg = fmt.Sprintf("%s != 0", reg) - } - if reg != "e1" { - body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg) - } - } - if ret[0] == "_" && ret[1] == "_" { - textcommon += fmt.Sprintf("\t%s\n", callcommon) - } else { - textcommon += fmt.Sprintf("\t%s, %s := %s\n", ret[0], ret[1], callcommon) - } - textcommon += body - - if doErrno { - textcommon += "\tif e1 != 0 {\n" - textcommon += "\t\terr = errnoErr(e1)\n" - textcommon += "\t}\n" - } - textcommon += "\treturn\n" - textcommon += "}\n" - - if onlyCommon { - continue - } - - // CALL Prototype - callProto := fmt.Sprintf("func call%s(%s) (r1 uintptr, e1 Errno) {\n", sysname, strings.Join(argscall, ", ")) - - // GC function generation - asm := "syscall6" - if nonblock != nil { - asm = "rawSyscall6" - } - - if len(argsgc) <= 6 { - for len(argsgc) < 6 { - argsgc = append(argsgc, "0") - } - } else { - fmt.Fprintf(os.Stderr, "%s: too many arguments to system call", funct) - os.Exit(1) - } - argsgclist := strings.Join(argsgc, ", ") - callgc := fmt.Sprintf("%s(uintptr(unsafe.Pointer(&%s)), %d, %s)", asm, sysvarname, nargs, argsgclist) - - textgc += callProto - textgc += fmt.Sprintf("\tr1, _, e1 = %s\n", callgc) - textgc += "\treturn\n}\n" - - // GCCGO function generation - argsgccgolist := strings.Join(argsgccgo, ", ") - var callgccgo string - if sysname == "select" { - // select is a keyword of Go. Its name is - // changed to c_select. - callgccgo = fmt.Sprintf("C.c_%s(%s)", sysname, argsgccgolist) - } else { - callgccgo = fmt.Sprintf("C.%s(%s)", sysname, argsgccgolist) - } - textgccgo += callProto - textgccgo += fmt.Sprintf("\tr1 = uintptr(%s)\n", callgccgo) - textgccgo += "\te1 = syscall.GetErrno()\n" - textgccgo += "\treturn\n}\n" - } - if err := s.Err(); err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - file.Close() - } - imp := "" - if pack != "unix" { - imp = "import \"golang.org/x/sys/unix\"\n" - - } - - // Print zsyscall_aix_ppc64.go - err := ioutil.WriteFile("zsyscall_aix_ppc64.go", - []byte(fmt.Sprintf(srcTemplate1, cmdLine(), buildTags(), pack, imp, textcommon)), - 0644) - if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - - // Print zsyscall_aix_ppc64_gc.go - vardecls := "\t" + strings.Join(vars, ",\n\t") - vardecls += " syscallFunc" - err = ioutil.WriteFile("zsyscall_aix_ppc64_gc.go", - []byte(fmt.Sprintf(srcTemplate2, cmdLine(), buildTags(), pack, imp, dynimports, linknames, vardecls, textgc)), - 0644) - if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - - // Print zsyscall_aix_ppc64_gccgo.go - err = ioutil.WriteFile("zsyscall_aix_ppc64_gccgo.go", - []byte(fmt.Sprintf(srcTemplate3, cmdLine(), buildTags(), pack, cExtern, imp, textgccgo)), - 0644) - if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } -} - -const srcTemplate1 = `// %s -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s - -package %s - -import ( - "unsafe" -) - - -%s - -%s -` -const srcTemplate2 = `// %s -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s -// +build !gccgo - -package %s - -import ( - "unsafe" -) -%s -%s -%s -type syscallFunc uintptr - -var ( -%s -) - -// Implemented in runtime/syscall_aix.go. -func rawSyscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) -func syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) - -%s -` -const srcTemplate3 = `// %s -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s -// +build gccgo - -package %s - -%s -*/ -import "C" -import ( - "syscall" -) - - -%s - -%s -` diff --git a/vendor/golang.org/x/sys/unix/mksyscall_solaris.go b/vendor/golang.org/x/sys/unix/mksyscall_solaris.go deleted file mode 100644 index 3d864738..00000000 --- a/vendor/golang.org/x/sys/unix/mksyscall_solaris.go +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* - This program reads a file containing function prototypes - (like syscall_solaris.go) and generates system call bodies. - The prototypes are marked by lines beginning with "//sys" - and read like func declarations if //sys is replaced by func, but: - * The parameter lists must give a name for each argument. - This includes return parameters. - * The parameter lists must give a type for each argument: - the (x, y, z int) shorthand is not allowed. - * If the return parameter is an error number, it must be named err. - * If go func name needs to be different than its libc name, - * or the function is not in libc, name could be specified - * at the end, after "=" sign, like - //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt -*/ - -package main - -import ( - "bufio" - "flag" - "fmt" - "os" - "regexp" - "strings" -) - -var ( - b32 = flag.Bool("b32", false, "32bit big-endian") - l32 = flag.Bool("l32", false, "32bit little-endian") - tags = flag.String("tags", "", "build tags") -) - -// cmdLine returns this programs's commandline arguments -func cmdLine() string { - return "go run mksyscall_solaris.go " + strings.Join(os.Args[1:], " ") -} - -// buildTags returns build tags -func buildTags() string { - return *tags -} - -// Param is function parameter -type Param struct { - Name string - Type string -} - -// usage prints the program usage -func usage() { - fmt.Fprintf(os.Stderr, "usage: go run mksyscall_solaris.go [-b32 | -l32] [-tags x,y] [file ...]\n") - os.Exit(1) -} - -// parseParamList parses parameter list and returns a slice of parameters -func parseParamList(list string) []string { - list = strings.TrimSpace(list) - if list == "" { - return []string{} - } - return regexp.MustCompile(`\s*,\s*`).Split(list, -1) -} - -// parseParam splits a parameter into name and type -func parseParam(p string) Param { - ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p) - if ps == nil { - fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p) - os.Exit(1) - } - return Param{ps[1], ps[2]} -} - -func main() { - flag.Usage = usage - flag.Parse() - if len(flag.Args()) <= 0 { - fmt.Fprintf(os.Stderr, "no files to parse provided\n") - usage() - } - - endianness := "" - if *b32 { - endianness = "big-endian" - } else if *l32 { - endianness = "little-endian" - } - - pack := "" - text := "" - dynimports := "" - linknames := "" - var vars []string - for _, path := range flag.Args() { - file, err := os.Open(path) - if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - s := bufio.NewScanner(file) - for s.Scan() { - t := s.Text() - t = strings.TrimSpace(t) - t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `) - if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" { - pack = p[1] - } - nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t) - if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil { - continue - } - - // Line must be of the form - // func Open(path string, mode int, perm int) (fd int, err error) - // Split into name, in params, out params. - f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t) - if f == nil { - fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t) - os.Exit(1) - } - funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6] - - // Split argument lists on comma. - in := parseParamList(inps) - out := parseParamList(outps) - - inps = strings.Join(in, ", ") - outps = strings.Join(out, ", ") - - // Try in vain to keep people from editing this file. - // The theory is that they jump into the middle of the file - // without reading the header. - text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" - - // So file name. - if modname == "" { - modname = "libc" - } - - // System call name. - if sysname == "" { - sysname = funct - } - - // System call pointer variable name. - sysvarname := fmt.Sprintf("proc%s", sysname) - - strconvfunc := "BytePtrFromString" - strconvtype := "*byte" - - sysname = strings.ToLower(sysname) // All libc functions are lowercase. - - // Runtime import of function to allow cross-platform builds. - dynimports += fmt.Sprintf("//go:cgo_import_dynamic libc_%s %s \"%s.so\"\n", sysname, sysname, modname) - // Link symbol to proc address variable. - linknames += fmt.Sprintf("//go:linkname %s libc_%s\n", sysvarname, sysname) - // Library proc address variable. - vars = append(vars, sysvarname) - - // Go function header. - outlist := strings.Join(out, ", ") - if outlist != "" { - outlist = fmt.Sprintf(" (%s)", outlist) - } - if text != "" { - text += "\n" - } - text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outlist) - - // Check if err return available - errvar := "" - for _, param := range out { - p := parseParam(param) - if p.Type == "error" { - errvar = p.Name - continue - } - } - - // Prepare arguments to Syscall. - var args []string - n := 0 - for _, param := range in { - p := parseParam(param) - if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { - args = append(args, "uintptr(unsafe.Pointer("+p.Name+"))") - } else if p.Type == "string" && errvar != "" { - text += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype) - text += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name) - text += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar) - args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) - n++ - } else if p.Type == "string" { - fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n") - text += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype) - text += fmt.Sprintf("\t_p%d, _ = %s(%s)\n", n, strconvfunc, p.Name) - args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) - n++ - } else if s := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); s != nil { - // Convert slice into pointer, length. - // Have to be careful not to take address of &a[0] if len == 0: - // pass nil in that case. - text += fmt.Sprintf("\tvar _p%d *%s\n", n, s[1]) - text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name) - args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n), fmt.Sprintf("uintptr(len(%s))", p.Name)) - n++ - } else if p.Type == "int64" && endianness != "" { - if endianness == "big-endian" { - args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) - } else { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) - } - } else if p.Type == "bool" { - text += fmt.Sprintf("\tvar _p%d uint32\n", n) - text += fmt.Sprintf("\tif %s {\n\t\t_p%d = 1\n\t} else {\n\t\t_p%d = 0\n\t}\n", p.Name, n, n) - args = append(args, fmt.Sprintf("uintptr(_p%d)", n)) - n++ - } else { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name)) - } - } - nargs := len(args) - - // Determine which form to use; pad args with zeros. - asm := "sysvicall6" - if nonblock != nil { - asm = "rawSysvicall6" - } - if len(args) <= 6 { - for len(args) < 6 { - args = append(args, "0") - } - } else { - fmt.Fprintf(os.Stderr, "%s: too many arguments to system call\n", path) - os.Exit(1) - } - - // Actual call. - arglist := strings.Join(args, ", ") - call := fmt.Sprintf("%s(uintptr(unsafe.Pointer(&%s)), %d, %s)", asm, sysvarname, nargs, arglist) - - // Assign return values. - body := "" - ret := []string{"_", "_", "_"} - doErrno := false - for i := 0; i < len(out); i++ { - p := parseParam(out[i]) - reg := "" - if p.Name == "err" { - reg = "e1" - ret[2] = reg - doErrno = true - } else { - reg = fmt.Sprintf("r%d", i) - ret[i] = reg - } - if p.Type == "bool" { - reg = fmt.Sprintf("%d != 0", reg) - } - if p.Type == "int64" && endianness != "" { - // 64-bit number in r1:r0 or r0:r1. - if i+2 > len(out) { - fmt.Fprintf(os.Stderr, "%s: not enough registers for int64 return\n", path) - os.Exit(1) - } - if endianness == "big-endian" { - reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i, i+1) - } else { - reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i+1, i) - } - ret[i] = fmt.Sprintf("r%d", i) - ret[i+1] = fmt.Sprintf("r%d", i+1) - } - if reg != "e1" { - body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg) - } - } - if ret[0] == "_" && ret[1] == "_" && ret[2] == "_" { - text += fmt.Sprintf("\t%s\n", call) - } else { - text += fmt.Sprintf("\t%s, %s, %s := %s\n", ret[0], ret[1], ret[2], call) - } - text += body - - if doErrno { - text += "\tif e1 != 0 {\n" - text += "\t\terr = e1\n" - text += "\t}\n" - } - text += "\treturn\n" - text += "}\n" - } - if err := s.Err(); err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - file.Close() - } - imp := "" - if pack != "unix" { - imp = "import \"golang.org/x/sys/unix\"\n" - - } - vardecls := "\t" + strings.Join(vars, ",\n\t") - vardecls += " syscallFunc" - fmt.Printf(srcTemplate, cmdLine(), buildTags(), pack, imp, dynimports, linknames, vardecls, text) -} - -const srcTemplate = `// %s -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s - -package %s - -import ( - "syscall" - "unsafe" -) -%s -%s -%s -var ( -%s -) - -%s -` diff --git a/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go b/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go deleted file mode 100644 index b6b40990..00000000 --- a/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Parse the header files for OpenBSD and generate a Go usable sysctl MIB. -// -// Build a MIB with each entry being an array containing the level, type and -// a hash that will contain additional entries if the current entry is a node. -// We then walk this MIB and create a flattened sysctl name to OID hash. - -package main - -import ( - "bufio" - "fmt" - "os" - "path/filepath" - "regexp" - "sort" - "strings" -) - -var ( - goos, goarch string -) - -// cmdLine returns this programs's commandline arguments. -func cmdLine() string { - return "go run mksysctl_openbsd.go " + strings.Join(os.Args[1:], " ") -} - -// buildTags returns build tags. -func buildTags() string { - return fmt.Sprintf("%s,%s", goarch, goos) -} - -// reMatch performs regular expression match and stores the substring slice to value pointed by m. -func reMatch(re *regexp.Regexp, str string, m *[]string) bool { - *m = re.FindStringSubmatch(str) - if *m != nil { - return true - } - return false -} - -type nodeElement struct { - n int - t string - pE *map[string]nodeElement -} - -var ( - debugEnabled bool - mib map[string]nodeElement - node *map[string]nodeElement - nodeMap map[string]string - sysCtl []string -) - -var ( - ctlNames1RE = regexp.MustCompile(`^#define\s+(CTL_NAMES)\s+{`) - ctlNames2RE = regexp.MustCompile(`^#define\s+(CTL_(.*)_NAMES)\s+{`) - ctlNames3RE = regexp.MustCompile(`^#define\s+((.*)CTL_NAMES)\s+{`) - netInetRE = regexp.MustCompile(`^netinet/`) - netInet6RE = regexp.MustCompile(`^netinet6/`) - netRE = regexp.MustCompile(`^net/`) - bracesRE = regexp.MustCompile(`{.*}`) - ctlTypeRE = regexp.MustCompile(`{\s+"(\w+)",\s+(CTLTYPE_[A-Z]+)\s+}`) - fsNetKernRE = regexp.MustCompile(`^(fs|net|kern)_`) -) - -func debug(s string) { - if debugEnabled { - fmt.Fprintln(os.Stderr, s) - } -} - -// Walk the MIB and build a sysctl name to OID mapping. -func buildSysctl(pNode *map[string]nodeElement, name string, oid []int) { - lNode := pNode // local copy of pointer to node - var keys []string - for k := range *lNode { - keys = append(keys, k) - } - sort.Strings(keys) - - for _, key := range keys { - nodename := name - if name != "" { - nodename += "." - } - nodename += key - - nodeoid := append(oid, (*pNode)[key].n) - - if (*pNode)[key].t == `CTLTYPE_NODE` { - if _, ok := nodeMap[nodename]; ok { - lNode = &mib - ctlName := nodeMap[nodename] - for _, part := range strings.Split(ctlName, ".") { - lNode = ((*lNode)[part]).pE - } - } else { - lNode = (*pNode)[key].pE - } - buildSysctl(lNode, nodename, nodeoid) - } else if (*pNode)[key].t != "" { - oidStr := []string{} - for j := range nodeoid { - oidStr = append(oidStr, fmt.Sprintf("%d", nodeoid[j])) - } - text := "\t{ \"" + nodename + "\", []_C_int{ " + strings.Join(oidStr, ", ") + " } }, \n" - sysCtl = append(sysCtl, text) - } - } -} - -func main() { - // Get the OS (using GOOS_TARGET if it exist) - goos = os.Getenv("GOOS_TARGET") - if goos == "" { - goos = os.Getenv("GOOS") - } - // Get the architecture (using GOARCH_TARGET if it exists) - goarch = os.Getenv("GOARCH_TARGET") - if goarch == "" { - goarch = os.Getenv("GOARCH") - } - // Check if GOOS and GOARCH environment variables are defined - if goarch == "" || goos == "" { - fmt.Fprintf(os.Stderr, "GOARCH or GOOS not defined in environment\n") - os.Exit(1) - } - - mib = make(map[string]nodeElement) - headers := [...]string{ - `sys/sysctl.h`, - `sys/socket.h`, - `sys/tty.h`, - `sys/malloc.h`, - `sys/mount.h`, - `sys/namei.h`, - `sys/sem.h`, - `sys/shm.h`, - `sys/vmmeter.h`, - `uvm/uvmexp.h`, - `uvm/uvm_param.h`, - `uvm/uvm_swap_encrypt.h`, - `ddb/db_var.h`, - `net/if.h`, - `net/if_pfsync.h`, - `net/pipex.h`, - `netinet/in.h`, - `netinet/icmp_var.h`, - `netinet/igmp_var.h`, - `netinet/ip_ah.h`, - `netinet/ip_carp.h`, - `netinet/ip_divert.h`, - `netinet/ip_esp.h`, - `netinet/ip_ether.h`, - `netinet/ip_gre.h`, - `netinet/ip_ipcomp.h`, - `netinet/ip_ipip.h`, - `netinet/pim_var.h`, - `netinet/tcp_var.h`, - `netinet/udp_var.h`, - `netinet6/in6.h`, - `netinet6/ip6_divert.h`, - `netinet6/pim6_var.h`, - `netinet/icmp6.h`, - `netmpls/mpls.h`, - } - - ctls := [...]string{ - `kern`, - `vm`, - `fs`, - `net`, - //debug /* Special handling required */ - `hw`, - //machdep /* Arch specific */ - `user`, - `ddb`, - //vfs /* Special handling required */ - `fs.posix`, - `kern.forkstat`, - `kern.intrcnt`, - `kern.malloc`, - `kern.nchstats`, - `kern.seminfo`, - `kern.shminfo`, - `kern.timecounter`, - `kern.tty`, - `kern.watchdog`, - `net.bpf`, - `net.ifq`, - `net.inet`, - `net.inet.ah`, - `net.inet.carp`, - `net.inet.divert`, - `net.inet.esp`, - `net.inet.etherip`, - `net.inet.gre`, - `net.inet.icmp`, - `net.inet.igmp`, - `net.inet.ip`, - `net.inet.ip.ifq`, - `net.inet.ipcomp`, - `net.inet.ipip`, - `net.inet.mobileip`, - `net.inet.pfsync`, - `net.inet.pim`, - `net.inet.tcp`, - `net.inet.udp`, - `net.inet6`, - `net.inet6.divert`, - `net.inet6.ip6`, - `net.inet6.icmp6`, - `net.inet6.pim6`, - `net.inet6.tcp6`, - `net.inet6.udp6`, - `net.mpls`, - `net.mpls.ifq`, - `net.key`, - `net.pflow`, - `net.pfsync`, - `net.pipex`, - `net.rt`, - `vm.swapencrypt`, - //vfsgenctl /* Special handling required */ - } - - // Node name "fixups" - ctlMap := map[string]string{ - "ipproto": "net.inet", - "net.inet.ipproto": "net.inet", - "net.inet6.ipv6proto": "net.inet6", - "net.inet6.ipv6": "net.inet6.ip6", - "net.inet.icmpv6": "net.inet6.icmp6", - "net.inet6.divert6": "net.inet6.divert", - "net.inet6.tcp6": "net.inet.tcp", - "net.inet6.udp6": "net.inet.udp", - "mpls": "net.mpls", - "swpenc": "vm.swapencrypt", - } - - // Node mappings - nodeMap = map[string]string{ - "net.inet.ip.ifq": "net.ifq", - "net.inet.pfsync": "net.pfsync", - "net.mpls.ifq": "net.ifq", - } - - mCtls := make(map[string]bool) - for _, ctl := range ctls { - mCtls[ctl] = true - } - - for _, header := range headers { - debug("Processing " + header) - file, err := os.Open(filepath.Join("/usr/include", header)) - if err != nil { - fmt.Fprintf(os.Stderr, "%v\n", err) - os.Exit(1) - } - s := bufio.NewScanner(file) - for s.Scan() { - var sub []string - if reMatch(ctlNames1RE, s.Text(), &sub) || - reMatch(ctlNames2RE, s.Text(), &sub) || - reMatch(ctlNames3RE, s.Text(), &sub) { - if sub[1] == `CTL_NAMES` { - // Top level. - node = &mib - } else { - // Node. - nodename := strings.ToLower(sub[2]) - ctlName := "" - if reMatch(netInetRE, header, &sub) { - ctlName = "net.inet." + nodename - } else if reMatch(netInet6RE, header, &sub) { - ctlName = "net.inet6." + nodename - } else if reMatch(netRE, header, &sub) { - ctlName = "net." + nodename - } else { - ctlName = nodename - ctlName = fsNetKernRE.ReplaceAllString(ctlName, `$1.`) - } - - if val, ok := ctlMap[ctlName]; ok { - ctlName = val - } - if _, ok := mCtls[ctlName]; !ok { - debug("Ignoring " + ctlName + "...") - continue - } - - // Walk down from the top of the MIB. - node = &mib - for _, part := range strings.Split(ctlName, ".") { - if _, ok := (*node)[part]; !ok { - debug("Missing node " + part) - (*node)[part] = nodeElement{n: 0, t: "", pE: &map[string]nodeElement{}} - } - node = (*node)[part].pE - } - } - - // Populate current node with entries. - i := -1 - for !strings.HasPrefix(s.Text(), "}") { - s.Scan() - if reMatch(bracesRE, s.Text(), &sub) { - i++ - } - if !reMatch(ctlTypeRE, s.Text(), &sub) { - continue - } - (*node)[sub[1]] = nodeElement{n: i, t: sub[2], pE: &map[string]nodeElement{}} - } - } - } - err = s.Err() - if err != nil { - fmt.Fprintf(os.Stderr, "%v\n", err) - os.Exit(1) - } - file.Close() - } - buildSysctl(&mib, "", []int{}) - - sort.Strings(sysCtl) - text := strings.Join(sysCtl, "") - - fmt.Printf(srcTemplate, cmdLine(), buildTags(), text) -} - -const srcTemplate = `// %s -// Code generated by the command above; DO NOT EDIT. - -// +build %s - -package unix - -type mibentry struct { - ctlname string - ctloid []_C_int -} - -var sysctlMib = []mibentry { -%s -} -` diff --git a/vendor/golang.org/x/sys/unix/mksysnum.go b/vendor/golang.org/x/sys/unix/mksysnum.go deleted file mode 100644 index baa6ecd8..00000000 --- a/vendor/golang.org/x/sys/unix/mksysnum.go +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Generate system call table for DragonFly, NetBSD, -// FreeBSD, OpenBSD or Darwin from master list -// (for example, /usr/src/sys/kern/syscalls.master or -// sys/syscall.h). -package main - -import ( - "bufio" - "fmt" - "io" - "io/ioutil" - "net/http" - "os" - "regexp" - "strings" -) - -var ( - goos, goarch string -) - -// cmdLine returns this programs's commandline arguments -func cmdLine() string { - return "go run mksysnum.go " + strings.Join(os.Args[1:], " ") -} - -// buildTags returns build tags -func buildTags() string { - return fmt.Sprintf("%s,%s", goarch, goos) -} - -func checkErr(err error) { - if err != nil { - fmt.Fprintf(os.Stderr, "%v\n", err) - os.Exit(1) - } -} - -// source string and substring slice for regexp -type re struct { - str string // source string - sub []string // matched sub-string -} - -// Match performs regular expression match -func (r *re) Match(exp string) bool { - r.sub = regexp.MustCompile(exp).FindStringSubmatch(r.str) - if r.sub != nil { - return true - } - return false -} - -// fetchFile fetches a text file from URL -func fetchFile(URL string) io.Reader { - resp, err := http.Get(URL) - checkErr(err) - defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) - checkErr(err) - return strings.NewReader(string(body)) -} - -// readFile reads a text file from path -func readFile(path string) io.Reader { - file, err := os.Open(os.Args[1]) - checkErr(err) - return file -} - -func format(name, num, proto string) string { - name = strings.ToUpper(name) - // There are multiple entries for enosys and nosys, so comment them out. - nm := re{str: name} - if nm.Match(`^SYS_E?NOSYS$`) { - name = fmt.Sprintf("// %s", name) - } - if name == `SYS_SYS_EXIT` { - name = `SYS_EXIT` - } - return fmt.Sprintf(" %s = %s; // %s\n", name, num, proto) -} - -func main() { - // Get the OS (using GOOS_TARGET if it exist) - goos = os.Getenv("GOOS_TARGET") - if goos == "" { - goos = os.Getenv("GOOS") - } - // Get the architecture (using GOARCH_TARGET if it exists) - goarch = os.Getenv("GOARCH_TARGET") - if goarch == "" { - goarch = os.Getenv("GOARCH") - } - // Check if GOOS and GOARCH environment variables are defined - if goarch == "" || goos == "" { - fmt.Fprintf(os.Stderr, "GOARCH or GOOS not defined in environment\n") - os.Exit(1) - } - - file := strings.TrimSpace(os.Args[1]) - var syscalls io.Reader - if strings.HasPrefix(file, "https://") || strings.HasPrefix(file, "http://") { - // Download syscalls.master file - syscalls = fetchFile(file) - } else { - syscalls = readFile(file) - } - - var text, line string - s := bufio.NewScanner(syscalls) - for s.Scan() { - t := re{str: line} - if t.Match(`^(.*)\\$`) { - // Handle continuation - line = t.sub[1] - line += strings.TrimLeft(s.Text(), " \t") - } else { - // New line - line = s.Text() - } - t = re{str: line} - if t.Match(`\\$`) { - continue - } - t = re{str: line} - - switch goos { - case "dragonfly": - if t.Match(`^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$`) { - num, proto := t.sub[1], t.sub[2] - name := fmt.Sprintf("SYS_%s", t.sub[3]) - text += format(name, num, proto) - } - case "freebsd": - if t.Match(`^([0-9]+)\s+\S+\s+(?:(?:NO)?STD|COMPAT10)\s+({ \S+\s+(\w+).*)$`) { - num, proto := t.sub[1], t.sub[2] - name := fmt.Sprintf("SYS_%s", t.sub[3]) - text += format(name, num, proto) - } - case "openbsd": - if t.Match(`^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$`) { - num, proto, name := t.sub[1], t.sub[3], t.sub[4] - text += format(name, num, proto) - } - case "netbsd": - if t.Match(`^([0-9]+)\s+((STD)|(NOERR))\s+(RUMP\s+)?({\s+\S+\s*\*?\s*\|(\S+)\|(\S*)\|(\w+).*\s+})(\s+(\S+))?$`) { - num, proto, compat := t.sub[1], t.sub[6], t.sub[8] - name := t.sub[7] + "_" + t.sub[9] - if t.sub[11] != "" { - name = t.sub[7] + "_" + t.sub[11] - } - name = strings.ToUpper(name) - if compat == "" || compat == "13" || compat == "30" || compat == "50" { - text += fmt.Sprintf(" %s = %s; // %s\n", name, num, proto) - } - } - case "darwin": - if t.Match(`^#define\s+SYS_(\w+)\s+([0-9]+)`) { - name, num := t.sub[1], t.sub[2] - name = strings.ToUpper(name) - text += fmt.Sprintf(" SYS_%s = %s;\n", name, num) - } - default: - fmt.Fprintf(os.Stderr, "unrecognized GOOS=%s\n", goos) - os.Exit(1) - - } - } - err := s.Err() - checkErr(err) - - fmt.Printf(template, cmdLine(), buildTags(), text) -} - -const template = `// %s -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s - -package unix - -const( -%s)` diff --git a/vendor/golang.org/x/sys/unix/types_aix.go b/vendor/golang.org/x/sys/unix/types_aix.go deleted file mode 100644 index 40d2beed..00000000 --- a/vendor/golang.org/x/sys/unix/types_aix.go +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore -// +build aix - -/* -Input to cgo -godefs. See also mkerrors.sh and mkall.sh -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - - -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics - -const ( - SizeofPtr = C.sizeofPtr - SizeofShort = C.sizeof_short - SizeofInt = C.sizeof_int - SizeofLong = C.sizeof_long - SizeofLongLong = C.sizeof_longlong - PathMax = C.PATH_MAX -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -type off64 C.off64_t -type off C.off_t -type Mode_t C.mode_t - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -type Timeval32 C.struct_timeval32 - -type Timex C.struct_timex - -type Time_t C.time_t - -type Tms C.struct_tms - -type Utimbuf C.struct_utimbuf - -type Timezone C.struct_timezone - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit64 - -type Pid_t C.pid_t - -type _Gid_t C.gid_t - -type dev_t C.dev_t - -// Files - -type Stat_t C.struct_stat - -type StatxTimestamp C.struct_statx_timestamp - -type Statx_t C.struct_statx - -type Dirent C.struct_dirent - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Cmsghdr C.struct_cmsghdr - -type ICMPv6Filter C.struct_icmp6_filter - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type Linger C.struct_linger - -type Msghdr C.struct_msghdr - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr -) - -type IfMsgHdr C.struct_if_msghdr - -// Misc - -type FdSet C.fd_set - -type Utsname C.struct_utsname - -type Ustat_t C.struct_ustat - -type Sigset_t C.sigset_t - -const ( - AT_FDCWD = C.AT_FDCWD - AT_REMOVEDIR = C.AT_REMOVEDIR - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// Terminal handling - -type Termios C.struct_termios - -type Termio C.struct_termio - -type Winsize C.struct_winsize - -//poll - -type PollFd struct { - Fd int32 - Events uint16 - Revents uint16 -} - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -//flock_t - -type Flock_t C.struct_flock64 - -// Statfs - -type Fsid_t C.struct_fsid_t -type Fsid64_t C.struct_fsid64_t - -type Statfs_t C.struct_statfs - -const RNDGETENTCNT = 0x80045200 diff --git a/vendor/golang.org/x/sys/unix/types_darwin.go b/vendor/golang.org/x/sys/unix/types_darwin.go deleted file mode 100644 index 155c2e69..00000000 --- a/vendor/golang.org/x/sys/unix/types_darwin.go +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define __DARWIN_UNIX03 0 -#define KERNEL -#define _DARWIN_USE_64_BIT_INODE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics - -const ( - SizeofPtr = C.sizeofPtr - SizeofShort = C.sizeof_short - SizeofInt = C.sizeof_int - SizeofLong = C.sizeof_long - SizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -type Timeval32 C.struct_timeval32 - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat64 - -type Statfs_t C.struct_statfs64 - -type Flock_t C.struct_flock - -type Fstore_t C.struct_fstore - -type Radvisory_t C.struct_radvisory - -type Fbootstraptransfer_t C.struct_fbootstraptransfer - -type Log2phys_t C.struct_log2phys - -type Fsid C.struct_fsid - -type Dirent C.struct_dirent - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet4Pktinfo C.struct_in_pktinfo - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet4Pktinfo = C.sizeof_struct_in_pktinfo - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr - SizeofIfmaMsghdr2 = C.sizeof_struct_ifma_msghdr2 - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfmaMsghdr C.struct_ifma_msghdr - -type IfmaMsghdr2 C.struct_ifma_msghdr2 - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_REMOVEDIR = C.AT_REMOVEDIR - AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -// uname - -type Utsname C.struct_utsname - -// Clockinfo - -const SizeofClockinfo = C.sizeof_struct_clockinfo - -type Clockinfo C.struct_clockinfo diff --git a/vendor/golang.org/x/sys/unix/types_dragonfly.go b/vendor/golang.org/x/sys/unix/types_dragonfly.go deleted file mode 100644 index 3365dd79..00000000 --- a/vendor/golang.org/x/sys/unix/types_dragonfly.go +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics - -const ( - SizeofPtr = C.sizeofPtr - SizeofShort = C.sizeof_short - SizeofInt = C.sizeof_int - SizeofLong = C.sizeof_long - SizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.struct_fsid - -// File system limits - -const ( - PathMax = C.PATH_MAX -) - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfmaMsghdr C.struct_ifma_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -// Uname - -type Utsname C.struct_utsname diff --git a/vendor/golang.org/x/sys/unix/types_freebsd.go b/vendor/golang.org/x/sys/unix/types_freebsd.go deleted file mode 100644 index 74707989..00000000 --- a/vendor/golang.org/x/sys/unix/types_freebsd.go +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define _WANT_FREEBSD11_STAT 1 -#define _WANT_FREEBSD11_STATFS 1 -#define _WANT_FREEBSD11_DIRENT 1 -#define _WANT_FREEBSD11_KEVENT 1 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -// This structure is a duplicate of if_data on FreeBSD 8-STABLE. -// See /usr/include/net/if.h. -struct if_data8 { - u_char ifi_type; - u_char ifi_physical; - u_char ifi_addrlen; - u_char ifi_hdrlen; - u_char ifi_link_state; - u_char ifi_spare_char1; - u_char ifi_spare_char2; - u_char ifi_datalen; - u_long ifi_mtu; - u_long ifi_metric; - u_long ifi_baudrate; - u_long ifi_ipackets; - u_long ifi_ierrors; - u_long ifi_opackets; - u_long ifi_oerrors; - u_long ifi_collisions; - u_long ifi_ibytes; - u_long ifi_obytes; - u_long ifi_imcasts; - u_long ifi_omcasts; - u_long ifi_iqdrops; - u_long ifi_noproto; - u_long ifi_hwassist; -// FIXME: these are now unions, so maybe need to change definitions? -#undef ifi_epoch - time_t ifi_epoch; -#undef ifi_lastchange - struct timeval ifi_lastchange; -}; - -// This structure is a duplicate of if_msghdr on FreeBSD 8-STABLE. -// See /usr/include/net/if.h. -struct if_msghdr8 { - u_short ifm_msglen; - u_char ifm_version; - u_char ifm_type; - int ifm_addrs; - int ifm_flags; - u_short ifm_index; - struct if_data8 ifm_data; -}; -*/ -import "C" - -// Machine characteristics - -const ( - SizeofPtr = C.sizeofPtr - SizeofShort = C.sizeof_short - SizeofInt = C.sizeof_int - SizeofLong = C.sizeof_long - SizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -const ( - _statfsVersion = C.STATFS_VERSION - _dirblksiz = C.DIRBLKSIZ -) - -type Stat_t C.struct_stat - -type stat_freebsd11_t C.struct_freebsd11_stat - -type Statfs_t C.struct_statfs - -type statfs_freebsd11_t C.struct_freebsd11_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type dirent_freebsd11 C.struct_freebsd11_dirent - -type Fsid C.struct_fsid - -// File system limits - -const ( - PathMax = C.PATH_MAX -) - -// Advice to Fadvise - -const ( - FADV_NORMAL = C.POSIX_FADV_NORMAL - FADV_RANDOM = C.POSIX_FADV_RANDOM - FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL - FADV_WILLNEED = C.POSIX_FADV_WILLNEED - FADV_DONTNEED = C.POSIX_FADV_DONTNEED - FADV_NOREUSE = C.POSIX_FADV_NOREUSE -) - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPMreqn C.struct_ip_mreqn - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPMreqn = C.sizeof_struct_ip_mreqn - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent_freebsd11 - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - sizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfMsghdr = C.sizeof_struct_if_msghdr8 - sizeofIfData = C.sizeof_struct_if_data - SizeofIfData = C.sizeof_struct_if_data8 - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type ifMsghdr C.struct_if_msghdr - -type IfMsghdr C.struct_if_msghdr8 - -type ifData C.struct_if_data - -type IfData C.struct_if_data8 - -type IfaMsghdr C.struct_ifa_msghdr - -type IfmaMsghdr C.struct_ifma_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfZbuf = C.sizeof_struct_bpf_zbuf - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr - SizeofBpfZbufHeader = C.sizeof_struct_bpf_zbuf_header -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfZbuf C.struct_bpf_zbuf - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -type BpfZbufHeader C.struct_bpf_zbuf_header - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_REMOVEDIR = C.AT_REMOVEDIR - AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLINIGNEOF = C.POLLINIGNEOF - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -// Capabilities - -type CapRights C.struct_cap_rights - -// Uname - -type Utsname C.struct_utsname diff --git a/vendor/golang.org/x/sys/unix/types_netbsd.go b/vendor/golang.org/x/sys/unix/types_netbsd.go deleted file mode 100644 index 2dd4f954..00000000 --- a/vendor/golang.org/x/sys/unix/types_netbsd.go +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics - -const ( - SizeofPtr = C.sizeofPtr - SizeofShort = C.sizeof_short - SizeofInt = C.sizeof_int - SizeofLong = C.sizeof_long - SizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.fsid_t - -// File system limits - -const ( - PathMax = C.PATH_MAX -) - -// Advice to Fadvise - -const ( - FADV_NORMAL = C.POSIX_FADV_NORMAL - FADV_RANDOM = C.POSIX_FADV_RANDOM - FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL - FADV_WILLNEED = C.POSIX_FADV_WILLNEED - FADV_DONTNEED = C.POSIX_FADV_DONTNEED - FADV_NOREUSE = C.POSIX_FADV_NOREUSE -) - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -type Mclpool C.struct_mclpool - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -type BpfTimeval C.struct_bpf_timeval - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -type Ptmget C.struct_ptmget - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -// Sysctl - -type Sysctlnode C.struct_sysctlnode - -// Uname - -type Utsname C.struct_utsname - -// Clockinfo - -const SizeofClockinfo = C.sizeof_struct_clockinfo - -type Clockinfo C.struct_clockinfo diff --git a/vendor/golang.org/x/sys/unix/types_openbsd.go b/vendor/golang.org/x/sys/unix/types_openbsd.go deleted file mode 100644 index 8aafbe44..00000000 --- a/vendor/golang.org/x/sys/unix/types_openbsd.go +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics - -const ( - SizeofPtr = C.sizeofPtr - SizeofShort = C.sizeof_short - SizeofInt = C.sizeof_int - SizeofLong = C.sizeof_long - SizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.fsid_t - -// File system limits - -const ( - PathMax = C.PATH_MAX -) - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -type Mclpool C.struct_mclpool - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -type BpfTimeval C.struct_bpf_timeval - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -// Signal Sets - -type Sigset_t C.sigset_t - -// Uname - -type Utsname C.struct_utsname - -// Uvmexp - -const SizeofUvmexp = C.sizeof_struct_uvmexp - -type Uvmexp C.struct_uvmexp - -// Clockinfo - -const SizeofClockinfo = C.sizeof_struct_clockinfo - -type Clockinfo C.struct_clockinfo diff --git a/vendor/golang.org/x/sys/unix/types_solaris.go b/vendor/golang.org/x/sys/unix/types_solaris.go deleted file mode 100644 index 2b716f93..00000000 --- a/vendor/golang.org/x/sys/unix/types_solaris.go +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -// These defines ensure that builds done on newer versions of Solaris are -// backwards-compatible with older versions of Solaris and -// OpenSolaris-based derivatives. -#define __USE_SUNOS_SOCKETS__ // msghdr -#define __USE_LEGACY_PROTOTYPES__ // iovec -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics - -const ( - SizeofPtr = C.sizeofPtr - SizeofShort = C.sizeof_short - SizeofInt = C.sizeof_int - SizeofLong = C.sizeof_long - SizeofLongLong = C.sizeof_longlong - PathMax = C.PATH_MAX - MaxHostNameLen = C.MAXHOSTNAMELEN -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -type Timeval32 C.struct_timeval32 - -type Tms C.struct_tms - -type Utimbuf C.struct_utimbuf - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -// Filesystems - -type _Fsblkcnt_t C.fsblkcnt_t - -type Statvfs_t C.struct_statvfs - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Select - -type FdSet C.fd_set - -// Misc - -type Utsname C.struct_utsname - -type Ustat_t C.struct_ustat - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW - AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW - AT_REMOVEDIR = C.AT_REMOVEDIR - AT_EACCESS = C.AT_EACCESS -) - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfTimeval C.struct_bpf_timeval - -type BpfHdr C.struct_bpf_hdr - -// Terminal handling - -type Termios C.struct_termios - -type Termio C.struct_termio - -type Winsize C.struct_winsize - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) diff --git a/vendor/golang.org/x/text/encoding/charmap/maketables.go b/vendor/golang.org/x/text/encoding/charmap/maketables.go deleted file mode 100644 index f7941701..00000000 --- a/vendor/golang.org/x/text/encoding/charmap/maketables.go +++ /dev/null @@ -1,556 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "bufio" - "fmt" - "log" - "net/http" - "sort" - "strings" - "unicode/utf8" - - "golang.org/x/text/encoding" - "golang.org/x/text/internal/gen" -) - -const ascii = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" + - "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" + - ` !"#$%&'()*+,-./0123456789:;<=>?` + - `@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` + - "`abcdefghijklmnopqrstuvwxyz{|}~\u007f" - -var encodings = []struct { - name string - mib string - comment string - varName string - replacement byte - mapping string -}{ - { - "IBM Code Page 037", - "IBM037", - "", - "CodePage037", - 0x3f, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM037-2.1.2.ucm", - }, - { - "IBM Code Page 437", - "PC8CodePage437", - "", - "CodePage437", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM437-2.1.2.ucm", - }, - { - "IBM Code Page 850", - "PC850Multilingual", - "", - "CodePage850", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM850-2.1.2.ucm", - }, - { - "IBM Code Page 852", - "PCp852", - "", - "CodePage852", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM852-2.1.2.ucm", - }, - { - "IBM Code Page 855", - "IBM855", - "", - "CodePage855", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM855-2.1.2.ucm", - }, - { - "Windows Code Page 858", // PC latin1 with Euro - "IBM00858", - "", - "CodePage858", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/windows-858-2000.ucm", - }, - { - "IBM Code Page 860", - "IBM860", - "", - "CodePage860", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM860-2.1.2.ucm", - }, - { - "IBM Code Page 862", - "PC862LatinHebrew", - "", - "CodePage862", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM862-2.1.2.ucm", - }, - { - "IBM Code Page 863", - "IBM863", - "", - "CodePage863", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM863-2.1.2.ucm", - }, - { - "IBM Code Page 865", - "IBM865", - "", - "CodePage865", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM865-2.1.2.ucm", - }, - { - "IBM Code Page 866", - "IBM866", - "", - "CodePage866", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-ibm866.txt", - }, - { - "IBM Code Page 1047", - "IBM1047", - "", - "CodePage1047", - 0x3f, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM1047-2.1.2.ucm", - }, - { - "IBM Code Page 1140", - "IBM01140", - "", - "CodePage1140", - 0x3f, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/ibm-1140_P100-1997.ucm", - }, - { - "ISO 8859-1", - "ISOLatin1", - "", - "ISO8859_1", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/iso-8859_1-1998.ucm", - }, - { - "ISO 8859-2", - "ISOLatin2", - "", - "ISO8859_2", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-2.txt", - }, - { - "ISO 8859-3", - "ISOLatin3", - "", - "ISO8859_3", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-3.txt", - }, - { - "ISO 8859-4", - "ISOLatin4", - "", - "ISO8859_4", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-4.txt", - }, - { - "ISO 8859-5", - "ISOLatinCyrillic", - "", - "ISO8859_5", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-5.txt", - }, - { - "ISO 8859-6", - "ISOLatinArabic", - "", - "ISO8859_6,ISO8859_6E,ISO8859_6I", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-6.txt", - }, - { - "ISO 8859-7", - "ISOLatinGreek", - "", - "ISO8859_7", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-7.txt", - }, - { - "ISO 8859-8", - "ISOLatinHebrew", - "", - "ISO8859_8,ISO8859_8E,ISO8859_8I", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-8.txt", - }, - { - "ISO 8859-9", - "ISOLatin5", - "", - "ISO8859_9", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/iso-8859_9-1999.ucm", - }, - { - "ISO 8859-10", - "ISOLatin6", - "", - "ISO8859_10", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-10.txt", - }, - { - "ISO 8859-13", - "ISO885913", - "", - "ISO8859_13", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-13.txt", - }, - { - "ISO 8859-14", - "ISO885914", - "", - "ISO8859_14", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-14.txt", - }, - { - "ISO 8859-15", - "ISO885915", - "", - "ISO8859_15", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-15.txt", - }, - { - "ISO 8859-16", - "ISO885916", - "", - "ISO8859_16", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-16.txt", - }, - { - "KOI8-R", - "KOI8R", - "", - "KOI8R", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-koi8-r.txt", - }, - { - "KOI8-U", - "KOI8U", - "", - "KOI8U", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-koi8-u.txt", - }, - { - "Macintosh", - "Macintosh", - "", - "Macintosh", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-macintosh.txt", - }, - { - "Macintosh Cyrillic", - "MacintoshCyrillic", - "", - "MacintoshCyrillic", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-x-mac-cyrillic.txt", - }, - { - "Windows 874", - "Windows874", - "", - "Windows874", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-874.txt", - }, - { - "Windows 1250", - "Windows1250", - "", - "Windows1250", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1250.txt", - }, - { - "Windows 1251", - "Windows1251", - "", - "Windows1251", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1251.txt", - }, - { - "Windows 1252", - "Windows1252", - "", - "Windows1252", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1252.txt", - }, - { - "Windows 1253", - "Windows1253", - "", - "Windows1253", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1253.txt", - }, - { - "Windows 1254", - "Windows1254", - "", - "Windows1254", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1254.txt", - }, - { - "Windows 1255", - "Windows1255", - "", - "Windows1255", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1255.txt", - }, - { - "Windows 1256", - "Windows1256", - "", - "Windows1256", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1256.txt", - }, - { - "Windows 1257", - "Windows1257", - "", - "Windows1257", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1257.txt", - }, - { - "Windows 1258", - "Windows1258", - "", - "Windows1258", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1258.txt", - }, - { - "X-User-Defined", - "XUserDefined", - "It is defined at http://encoding.spec.whatwg.org/#x-user-defined", - "XUserDefined", - encoding.ASCIISub, - ascii + - "\uf780\uf781\uf782\uf783\uf784\uf785\uf786\uf787" + - "\uf788\uf789\uf78a\uf78b\uf78c\uf78d\uf78e\uf78f" + - "\uf790\uf791\uf792\uf793\uf794\uf795\uf796\uf797" + - "\uf798\uf799\uf79a\uf79b\uf79c\uf79d\uf79e\uf79f" + - "\uf7a0\uf7a1\uf7a2\uf7a3\uf7a4\uf7a5\uf7a6\uf7a7" + - "\uf7a8\uf7a9\uf7aa\uf7ab\uf7ac\uf7ad\uf7ae\uf7af" + - "\uf7b0\uf7b1\uf7b2\uf7b3\uf7b4\uf7b5\uf7b6\uf7b7" + - "\uf7b8\uf7b9\uf7ba\uf7bb\uf7bc\uf7bd\uf7be\uf7bf" + - "\uf7c0\uf7c1\uf7c2\uf7c3\uf7c4\uf7c5\uf7c6\uf7c7" + - "\uf7c8\uf7c9\uf7ca\uf7cb\uf7cc\uf7cd\uf7ce\uf7cf" + - "\uf7d0\uf7d1\uf7d2\uf7d3\uf7d4\uf7d5\uf7d6\uf7d7" + - "\uf7d8\uf7d9\uf7da\uf7db\uf7dc\uf7dd\uf7de\uf7df" + - "\uf7e0\uf7e1\uf7e2\uf7e3\uf7e4\uf7e5\uf7e6\uf7e7" + - "\uf7e8\uf7e9\uf7ea\uf7eb\uf7ec\uf7ed\uf7ee\uf7ef" + - "\uf7f0\uf7f1\uf7f2\uf7f3\uf7f4\uf7f5\uf7f6\uf7f7" + - "\uf7f8\uf7f9\uf7fa\uf7fb\uf7fc\uf7fd\uf7fe\uf7ff", - }, -} - -func getWHATWG(url string) string { - res, err := http.Get(url) - if err != nil { - log.Fatalf("%q: Get: %v", url, err) - } - defer res.Body.Close() - - mapping := make([]rune, 128) - for i := range mapping { - mapping[i] = '\ufffd' - } - - scanner := bufio.NewScanner(res.Body) - for scanner.Scan() { - s := strings.TrimSpace(scanner.Text()) - if s == "" || s[0] == '#' { - continue - } - x, y := 0, 0 - if _, err := fmt.Sscanf(s, "%d\t0x%x", &x, &y); err != nil { - log.Fatalf("could not parse %q", s) - } - if x < 0 || 128 <= x { - log.Fatalf("code %d is out of range", x) - } - if 0x80 <= y && y < 0xa0 { - // We diverge from the WHATWG spec by mapping control characters - // in the range [0x80, 0xa0) to U+FFFD. - continue - } - mapping[x] = rune(y) - } - return ascii + string(mapping) -} - -func getUCM(url string) string { - res, err := http.Get(url) - if err != nil { - log.Fatalf("%q: Get: %v", url, err) - } - defer res.Body.Close() - - mapping := make([]rune, 256) - for i := range mapping { - mapping[i] = '\ufffd' - } - - charsFound := 0 - scanner := bufio.NewScanner(res.Body) - for scanner.Scan() { - s := strings.TrimSpace(scanner.Text()) - if s == "" || s[0] == '#' { - continue - } - var c byte - var r rune - if _, err := fmt.Sscanf(s, ` \x%x |0`, &r, &c); err != nil { - continue - } - mapping[c] = r - charsFound++ - } - - if charsFound < 200 { - log.Fatalf("%q: only %d characters found (wrong page format?)", url, charsFound) - } - - return string(mapping) -} - -func main() { - mibs := map[string]bool{} - all := []string{} - - w := gen.NewCodeWriter() - defer w.WriteGoFile("tables.go", "charmap") - - printf := func(s string, a ...interface{}) { fmt.Fprintf(w, s, a...) } - - printf("import (\n") - printf("\t\"golang.org/x/text/encoding\"\n") - printf("\t\"golang.org/x/text/encoding/internal/identifier\"\n") - printf(")\n\n") - for _, e := range encodings { - varNames := strings.Split(e.varName, ",") - all = append(all, varNames...) - varName := varNames[0] - switch { - case strings.HasPrefix(e.mapping, "http://encoding.spec.whatwg.org/"): - e.mapping = getWHATWG(e.mapping) - case strings.HasPrefix(e.mapping, "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/"): - e.mapping = getUCM(e.mapping) - } - - asciiSuperset, low := strings.HasPrefix(e.mapping, ascii), 0x00 - if asciiSuperset { - low = 0x80 - } - lvn := 1 - if strings.HasPrefix(varName, "ISO") || strings.HasPrefix(varName, "KOI") { - lvn = 3 - } - lowerVarName := strings.ToLower(varName[:lvn]) + varName[lvn:] - printf("// %s is the %s encoding.\n", varName, e.name) - if e.comment != "" { - printf("//\n// %s\n", e.comment) - } - printf("var %s *Charmap = &%s\n\nvar %s = Charmap{\nname: %q,\n", - varName, lowerVarName, lowerVarName, e.name) - if mibs[e.mib] { - log.Fatalf("MIB type %q declared multiple times.", e.mib) - } - printf("mib: identifier.%s,\n", e.mib) - printf("asciiSuperset: %t,\n", asciiSuperset) - printf("low: 0x%02x,\n", low) - printf("replacement: 0x%02x,\n", e.replacement) - - printf("decode: [256]utf8Enc{\n") - i, backMapping := 0, map[rune]byte{} - for _, c := range e.mapping { - if _, ok := backMapping[c]; !ok && c != utf8.RuneError { - backMapping[c] = byte(i) - } - var buf [8]byte - n := utf8.EncodeRune(buf[:], c) - if n > 3 { - panic(fmt.Sprintf("rune %q (%U) is too long", c, c)) - } - printf("{%d,[3]byte{0x%02x,0x%02x,0x%02x}},", n, buf[0], buf[1], buf[2]) - if i%2 == 1 { - printf("\n") - } - i++ - } - printf("},\n") - - printf("encode: [256]uint32{\n") - encode := make([]uint32, 0, 256) - for c, i := range backMapping { - encode = append(encode, uint32(i)<<24|uint32(c)) - } - sort.Sort(byRune(encode)) - for len(encode) < cap(encode) { - encode = append(encode, encode[len(encode)-1]) - } - for i, enc := range encode { - printf("0x%08x,", enc) - if i%8 == 7 { - printf("\n") - } - } - printf("},\n}\n") - - // Add an estimate of the size of a single Charmap{} struct value, which - // includes two 256 elem arrays of 4 bytes and some extra fields, which - // align to 3 uint64s on 64-bit architectures. - w.Size += 2*4*256 + 3*8 - } - // TODO: add proper line breaking. - printf("var listAll = []encoding.Encoding{\n%s,\n}\n\n", strings.Join(all, ",\n")) -} - -type byRune []uint32 - -func (b byRune) Len() int { return len(b) } -func (b byRune) Less(i, j int) bool { return b[i]&0xffffff < b[j]&0xffffff } -func (b byRune) Swap(i, j int) { b[i], b[j] = b[j], b[i] } diff --git a/vendor/golang.org/x/text/encoding/htmlindex/gen.go b/vendor/golang.org/x/text/encoding/htmlindex/gen.go deleted file mode 100644 index ac6b4a77..00000000 --- a/vendor/golang.org/x/text/encoding/htmlindex/gen.go +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "bytes" - "encoding/json" - "fmt" - "log" - "strings" - - "golang.org/x/text/internal/gen" -) - -type group struct { - Encodings []struct { - Labels []string - Name string - } -} - -func main() { - gen.Init() - - r := gen.Open("https://encoding.spec.whatwg.org", "whatwg", "encodings.json") - var groups []group - if err := json.NewDecoder(r).Decode(&groups); err != nil { - log.Fatalf("Error reading encodings.json: %v", err) - } - - w := &bytes.Buffer{} - fmt.Fprintln(w, "type htmlEncoding byte") - fmt.Fprintln(w, "const (") - for i, g := range groups { - for _, e := range g.Encodings { - key := strings.ToLower(e.Name) - name := consts[key] - if name == "" { - log.Fatalf("No const defined for %s.", key) - } - if i == 0 { - fmt.Fprintf(w, "%s htmlEncoding = iota\n", name) - } else { - fmt.Fprintf(w, "%s\n", name) - } - } - } - fmt.Fprintln(w, "numEncodings") - fmt.Fprint(w, ")\n\n") - - fmt.Fprintln(w, "var canonical = [numEncodings]string{") - for _, g := range groups { - for _, e := range g.Encodings { - fmt.Fprintf(w, "%q,\n", strings.ToLower(e.Name)) - } - } - fmt.Fprint(w, "}\n\n") - - fmt.Fprintln(w, "var nameMap = map[string]htmlEncoding{") - for _, g := range groups { - for _, e := range g.Encodings { - for _, l := range e.Labels { - key := strings.ToLower(e.Name) - name := consts[key] - fmt.Fprintf(w, "%q: %s,\n", l, name) - } - } - } - fmt.Fprint(w, "}\n\n") - - var tags []string - fmt.Fprintln(w, "var localeMap = []htmlEncoding{") - for _, loc := range locales { - tags = append(tags, loc.tag) - fmt.Fprintf(w, "%s, // %s \n", consts[loc.name], loc.tag) - } - fmt.Fprint(w, "}\n\n") - - fmt.Fprintf(w, "const locales = %q\n", strings.Join(tags, " ")) - - gen.WriteGoFile("tables.go", "htmlindex", w.Bytes()) -} - -// consts maps canonical encoding name to internal constant. -var consts = map[string]string{ - "utf-8": "utf8", - "ibm866": "ibm866", - "iso-8859-2": "iso8859_2", - "iso-8859-3": "iso8859_3", - "iso-8859-4": "iso8859_4", - "iso-8859-5": "iso8859_5", - "iso-8859-6": "iso8859_6", - "iso-8859-7": "iso8859_7", - "iso-8859-8": "iso8859_8", - "iso-8859-8-i": "iso8859_8I", - "iso-8859-10": "iso8859_10", - "iso-8859-13": "iso8859_13", - "iso-8859-14": "iso8859_14", - "iso-8859-15": "iso8859_15", - "iso-8859-16": "iso8859_16", - "koi8-r": "koi8r", - "koi8-u": "koi8u", - "macintosh": "macintosh", - "windows-874": "windows874", - "windows-1250": "windows1250", - "windows-1251": "windows1251", - "windows-1252": "windows1252", - "windows-1253": "windows1253", - "windows-1254": "windows1254", - "windows-1255": "windows1255", - "windows-1256": "windows1256", - "windows-1257": "windows1257", - "windows-1258": "windows1258", - "x-mac-cyrillic": "macintoshCyrillic", - "gbk": "gbk", - "gb18030": "gb18030", - // "hz-gb-2312": "hzgb2312", // Was removed from WhatWG - "big5": "big5", - "euc-jp": "eucjp", - "iso-2022-jp": "iso2022jp", - "shift_jis": "shiftJIS", - "euc-kr": "euckr", - "replacement": "replacement", - "utf-16be": "utf16be", - "utf-16le": "utf16le", - "x-user-defined": "xUserDefined", -} - -// locales is taken from -// https://html.spec.whatwg.org/multipage/syntax.html#encoding-sniffing-algorithm. -var locales = []struct{ tag, name string }{ - // The default value. Explicitly state latin to benefit from the exact - // script option, while still making 1252 the default encoding for languages - // written in Latin script. - {"und_Latn", "windows-1252"}, - {"ar", "windows-1256"}, - {"ba", "windows-1251"}, - {"be", "windows-1251"}, - {"bg", "windows-1251"}, - {"cs", "windows-1250"}, - {"el", "iso-8859-7"}, - {"et", "windows-1257"}, - {"fa", "windows-1256"}, - {"he", "windows-1255"}, - {"hr", "windows-1250"}, - {"hu", "iso-8859-2"}, - {"ja", "shift_jis"}, - {"kk", "windows-1251"}, - {"ko", "euc-kr"}, - {"ku", "windows-1254"}, - {"ky", "windows-1251"}, - {"lt", "windows-1257"}, - {"lv", "windows-1257"}, - {"mk", "windows-1251"}, - {"pl", "iso-8859-2"}, - {"ru", "windows-1251"}, - {"sah", "windows-1251"}, - {"sk", "windows-1250"}, - {"sl", "iso-8859-2"}, - {"sr", "windows-1251"}, - {"tg", "windows-1251"}, - {"th", "windows-874"}, - {"tr", "windows-1254"}, - {"tt", "windows-1251"}, - {"uk", "windows-1251"}, - {"vi", "windows-1258"}, - {"zh-hans", "gb18030"}, - {"zh-hant", "big5"}, -} diff --git a/vendor/golang.org/x/text/encoding/internal/identifier/gen.go b/vendor/golang.org/x/text/encoding/internal/identifier/gen.go deleted file mode 100644 index 26cfef9c..00000000 --- a/vendor/golang.org/x/text/encoding/internal/identifier/gen.go +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "bytes" - "encoding/xml" - "fmt" - "io" - "log" - "strings" - - "golang.org/x/text/internal/gen" -) - -type registry struct { - XMLName xml.Name `xml:"registry"` - Updated string `xml:"updated"` - Registry []struct { - ID string `xml:"id,attr"` - Record []struct { - Name string `xml:"name"` - Xref []struct { - Type string `xml:"type,attr"` - Data string `xml:"data,attr"` - } `xml:"xref"` - Desc struct { - Data string `xml:",innerxml"` - // Any []struct { - // Data string `xml:",chardata"` - // } `xml:",any"` - // Data string `xml:",chardata"` - } `xml:"description,"` - MIB string `xml:"value"` - Alias []string `xml:"alias"` - MIME string `xml:"preferred_alias"` - } `xml:"record"` - } `xml:"registry"` -} - -func main() { - r := gen.OpenIANAFile("assignments/character-sets/character-sets.xml") - reg := ®istry{} - if err := xml.NewDecoder(r).Decode(®); err != nil && err != io.EOF { - log.Fatalf("Error decoding charset registry: %v", err) - } - if len(reg.Registry) == 0 || reg.Registry[0].ID != "character-sets-1" { - log.Fatalf("Unexpected ID %s", reg.Registry[0].ID) - } - - w := &bytes.Buffer{} - fmt.Fprintf(w, "const (\n") - for _, rec := range reg.Registry[0].Record { - constName := "" - for _, a := range rec.Alias { - if strings.HasPrefix(a, "cs") && strings.IndexByte(a, '-') == -1 { - // Some of the constant definitions have comments in them. Strip those. - constName = strings.Title(strings.SplitN(a[2:], "\n", 2)[0]) - } - } - if constName == "" { - switch rec.MIB { - case "2085": - constName = "HZGB2312" // Not listed as alias for some reason. - default: - log.Fatalf("No cs alias defined for %s.", rec.MIB) - } - } - if rec.MIME != "" { - rec.MIME = fmt.Sprintf(" (MIME: %s)", rec.MIME) - } - fmt.Fprintf(w, "// %s is the MIB identifier with IANA name %s%s.\n//\n", constName, rec.Name, rec.MIME) - if len(rec.Desc.Data) > 0 { - fmt.Fprint(w, "// ") - d := xml.NewDecoder(strings.NewReader(rec.Desc.Data)) - inElem := true - attr := "" - for { - t, err := d.Token() - if err != nil { - if err != io.EOF { - log.Fatal(err) - } - break - } - switch x := t.(type) { - case xml.CharData: - attr = "" // Don't need attribute info. - a := bytes.Split([]byte(x), []byte("\n")) - for i, b := range a { - if b = bytes.TrimSpace(b); len(b) != 0 { - if !inElem && i > 0 { - fmt.Fprint(w, "\n// ") - } - inElem = false - fmt.Fprintf(w, "%s ", string(b)) - } - } - case xml.StartElement: - if x.Name.Local == "xref" { - inElem = true - use := false - for _, a := range x.Attr { - if a.Name.Local == "type" { - use = use || a.Value != "person" - } - if a.Name.Local == "data" && use { - // Patch up URLs to use https. From some links, the - // https version is different from the http one. - s := a.Value - s = strings.Replace(s, "http://", "https://", -1) - s = strings.Replace(s, "/unicode/", "/", -1) - attr = s + " " - } - } - } - case xml.EndElement: - inElem = false - fmt.Fprint(w, attr) - } - } - fmt.Fprint(w, "\n") - } - for _, x := range rec.Xref { - switch x.Type { - case "rfc": - fmt.Fprintf(w, "// Reference: %s\n", strings.ToUpper(x.Data)) - case "uri": - fmt.Fprintf(w, "// Reference: %s\n", x.Data) - } - } - fmt.Fprintf(w, "%s MIB = %s\n", constName, rec.MIB) - fmt.Fprintln(w) - } - fmt.Fprintln(w, ")") - - gen.WriteGoFile("mib.go", "identifier", w.Bytes()) -} diff --git a/vendor/golang.org/x/text/encoding/japanese/maketables.go b/vendor/golang.org/x/text/encoding/japanese/maketables.go deleted file mode 100644 index 023957a6..00000000 --- a/vendor/golang.org/x/text/encoding/japanese/maketables.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// This program generates tables.go: -// go run maketables.go | gofmt > tables.go - -// TODO: Emoji extensions? -// https://www.unicode.org/faq/emoji_dingbats.html -// https://www.unicode.org/Public/UNIDATA/EmojiSources.txt - -import ( - "bufio" - "fmt" - "log" - "net/http" - "sort" - "strings" -) - -type entry struct { - jisCode, table int -} - -func main() { - fmt.Printf("// generated by go run maketables.go; DO NOT EDIT\n\n") - fmt.Printf("// Package japanese provides Japanese encodings such as EUC-JP and Shift JIS.\n") - fmt.Printf(`package japanese // import "golang.org/x/text/encoding/japanese"` + "\n\n") - - reverse := [65536]entry{} - for i := range reverse { - reverse[i].table = -1 - } - - tables := []struct { - url string - name string - }{ - {"http://encoding.spec.whatwg.org/index-jis0208.txt", "0208"}, - {"http://encoding.spec.whatwg.org/index-jis0212.txt", "0212"}, - } - for i, table := range tables { - res, err := http.Get(table.url) - if err != nil { - log.Fatalf("%q: Get: %v", table.url, err) - } - defer res.Body.Close() - - mapping := [65536]uint16{} - - scanner := bufio.NewScanner(res.Body) - for scanner.Scan() { - s := strings.TrimSpace(scanner.Text()) - if s == "" || s[0] == '#' { - continue - } - x, y := 0, uint16(0) - if _, err := fmt.Sscanf(s, "%d 0x%x", &x, &y); err != nil { - log.Fatalf("%q: could not parse %q", table.url, s) - } - if x < 0 || 120*94 <= x { - log.Fatalf("%q: JIS code %d is out of range", table.url, x) - } - mapping[x] = y - if reverse[y].table == -1 { - reverse[y] = entry{jisCode: x, table: i} - } - } - if err := scanner.Err(); err != nil { - log.Fatalf("%q: scanner error: %v", table.url, err) - } - - fmt.Printf("// jis%sDecode is the decoding table from JIS %s code to Unicode.\n// It is defined at %s\n", - table.name, table.name, table.url) - fmt.Printf("var jis%sDecode = [...]uint16{\n", table.name) - for i, m := range mapping { - if m != 0 { - fmt.Printf("\t%d: 0x%04X,\n", i, m) - } - } - fmt.Printf("}\n\n") - } - - // Any run of at least separation continuous zero entries in the reverse map will - // be a separate encode table. - const separation = 1024 - - intervals := []interval(nil) - low, high := -1, -1 - for i, v := range reverse { - if v.table == -1 { - continue - } - if low < 0 { - low = i - } else if i-high >= separation { - if high >= 0 { - intervals = append(intervals, interval{low, high}) - } - low = i - } - high = i + 1 - } - if high >= 0 { - intervals = append(intervals, interval{low, high}) - } - sort.Sort(byDecreasingLength(intervals)) - - fmt.Printf("const (\n") - fmt.Printf("\tjis0208 = 1\n") - fmt.Printf("\tjis0212 = 2\n") - fmt.Printf("\tcodeMask = 0x7f\n") - fmt.Printf("\tcodeShift = 7\n") - fmt.Printf("\ttableShift = 14\n") - fmt.Printf(")\n\n") - - fmt.Printf("const numEncodeTables = %d\n\n", len(intervals)) - fmt.Printf("// encodeX are the encoding tables from Unicode to JIS code,\n") - fmt.Printf("// sorted by decreasing length.\n") - for i, v := range intervals { - fmt.Printf("// encode%d: %5d entries for runes in [%5d, %5d).\n", i, v.len(), v.low, v.high) - } - fmt.Printf("//\n") - fmt.Printf("// The high two bits of the value record whether the JIS code comes from the\n") - fmt.Printf("// JIS0208 table (high bits == 1) or the JIS0212 table (high bits == 2).\n") - fmt.Printf("// The low 14 bits are two 7-bit unsigned integers j1 and j2 that form the\n") - fmt.Printf("// JIS code (94*j1 + j2) within that table.\n") - fmt.Printf("\n") - - for i, v := range intervals { - fmt.Printf("const encode%dLow, encode%dHigh = %d, %d\n\n", i, i, v.low, v.high) - fmt.Printf("var encode%d = [...]uint16{\n", i) - for j := v.low; j < v.high; j++ { - x := reverse[j] - if x.table == -1 { - continue - } - fmt.Printf("\t%d - %d: jis%s<<14 | 0x%02X<<7 | 0x%02X,\n", - j, v.low, tables[x.table].name, x.jisCode/94, x.jisCode%94) - } - fmt.Printf("}\n\n") - } -} - -// interval is a half-open interval [low, high). -type interval struct { - low, high int -} - -func (i interval) len() int { return i.high - i.low } - -// byDecreasingLength sorts intervals by decreasing length. -type byDecreasingLength []interval - -func (b byDecreasingLength) Len() int { return len(b) } -func (b byDecreasingLength) Less(i, j int) bool { return b[i].len() > b[j].len() } -func (b byDecreasingLength) Swap(i, j int) { b[i], b[j] = b[j], b[i] } diff --git a/vendor/golang.org/x/text/encoding/korean/maketables.go b/vendor/golang.org/x/text/encoding/korean/maketables.go deleted file mode 100644 index c84034fb..00000000 --- a/vendor/golang.org/x/text/encoding/korean/maketables.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// This program generates tables.go: -// go run maketables.go | gofmt > tables.go - -import ( - "bufio" - "fmt" - "log" - "net/http" - "sort" - "strings" -) - -func main() { - fmt.Printf("// generated by go run maketables.go; DO NOT EDIT\n\n") - fmt.Printf("// Package korean provides Korean encodings such as EUC-KR.\n") - fmt.Printf(`package korean // import "golang.org/x/text/encoding/korean"` + "\n\n") - - res, err := http.Get("http://encoding.spec.whatwg.org/index-euc-kr.txt") - if err != nil { - log.Fatalf("Get: %v", err) - } - defer res.Body.Close() - - mapping := [65536]uint16{} - reverse := [65536]uint16{} - - scanner := bufio.NewScanner(res.Body) - for scanner.Scan() { - s := strings.TrimSpace(scanner.Text()) - if s == "" || s[0] == '#' { - continue - } - x, y := uint16(0), uint16(0) - if _, err := fmt.Sscanf(s, "%d 0x%x", &x, &y); err != nil { - log.Fatalf("could not parse %q", s) - } - if x < 0 || 178*(0xc7-0x81)+(0xfe-0xc7)*94+(0xff-0xa1) <= x { - log.Fatalf("EUC-KR code %d is out of range", x) - } - mapping[x] = y - if reverse[y] == 0 { - c0, c1 := uint16(0), uint16(0) - if x < 178*(0xc7-0x81) { - c0 = uint16(x/178) + 0x81 - c1 = uint16(x % 178) - switch { - case c1 < 1*26: - c1 += 0x41 - case c1 < 2*26: - c1 += 0x47 - default: - c1 += 0x4d - } - } else { - x -= 178 * (0xc7 - 0x81) - c0 = uint16(x/94) + 0xc7 - c1 = uint16(x%94) + 0xa1 - } - reverse[y] = c0<<8 | c1 - } - } - if err := scanner.Err(); err != nil { - log.Fatalf("scanner error: %v", err) - } - - fmt.Printf("// decode is the decoding table from EUC-KR code to Unicode.\n") - fmt.Printf("// It is defined at http://encoding.spec.whatwg.org/index-euc-kr.txt\n") - fmt.Printf("var decode = [...]uint16{\n") - for i, v := range mapping { - if v != 0 { - fmt.Printf("\t%d: 0x%04X,\n", i, v) - } - } - fmt.Printf("}\n\n") - - // Any run of at least separation continuous zero entries in the reverse map will - // be a separate encode table. - const separation = 1024 - - intervals := []interval(nil) - low, high := -1, -1 - for i, v := range reverse { - if v == 0 { - continue - } - if low < 0 { - low = i - } else if i-high >= separation { - if high >= 0 { - intervals = append(intervals, interval{low, high}) - } - low = i - } - high = i + 1 - } - if high >= 0 { - intervals = append(intervals, interval{low, high}) - } - sort.Sort(byDecreasingLength(intervals)) - - fmt.Printf("const numEncodeTables = %d\n\n", len(intervals)) - fmt.Printf("// encodeX are the encoding tables from Unicode to EUC-KR code,\n") - fmt.Printf("// sorted by decreasing length.\n") - for i, v := range intervals { - fmt.Printf("// encode%d: %5d entries for runes in [%5d, %5d).\n", i, v.len(), v.low, v.high) - } - fmt.Printf("\n") - - for i, v := range intervals { - fmt.Printf("const encode%dLow, encode%dHigh = %d, %d\n\n", i, i, v.low, v.high) - fmt.Printf("var encode%d = [...]uint16{\n", i) - for j := v.low; j < v.high; j++ { - x := reverse[j] - if x == 0 { - continue - } - fmt.Printf("\t%d-%d: 0x%04X,\n", j, v.low, x) - } - fmt.Printf("}\n\n") - } -} - -// interval is a half-open interval [low, high). -type interval struct { - low, high int -} - -func (i interval) len() int { return i.high - i.low } - -// byDecreasingLength sorts intervals by decreasing length. -type byDecreasingLength []interval - -func (b byDecreasingLength) Len() int { return len(b) } -func (b byDecreasingLength) Less(i, j int) bool { return b[i].len() > b[j].len() } -func (b byDecreasingLength) Swap(i, j int) { b[i], b[j] = b[j], b[i] } diff --git a/vendor/golang.org/x/text/encoding/simplifiedchinese/maketables.go b/vendor/golang.org/x/text/encoding/simplifiedchinese/maketables.go deleted file mode 100644 index 55016c78..00000000 --- a/vendor/golang.org/x/text/encoding/simplifiedchinese/maketables.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// This program generates tables.go: -// go run maketables.go | gofmt > tables.go - -import ( - "bufio" - "fmt" - "log" - "net/http" - "sort" - "strings" -) - -func main() { - fmt.Printf("// generated by go run maketables.go; DO NOT EDIT\n\n") - fmt.Printf("// Package simplifiedchinese provides Simplified Chinese encodings such as GBK.\n") - fmt.Printf(`package simplifiedchinese // import "golang.org/x/text/encoding/simplifiedchinese"` + "\n\n") - - printGB18030() - printGBK() -} - -func printGB18030() { - res, err := http.Get("http://encoding.spec.whatwg.org/index-gb18030.txt") - if err != nil { - log.Fatalf("Get: %v", err) - } - defer res.Body.Close() - - fmt.Printf("// gb18030 is the table from http://encoding.spec.whatwg.org/index-gb18030.txt\n") - fmt.Printf("var gb18030 = [...][2]uint16{\n") - scanner := bufio.NewScanner(res.Body) - for scanner.Scan() { - s := strings.TrimSpace(scanner.Text()) - if s == "" || s[0] == '#' { - continue - } - x, y := uint32(0), uint32(0) - if _, err := fmt.Sscanf(s, "%d 0x%x", &x, &y); err != nil { - log.Fatalf("could not parse %q", s) - } - if x < 0x10000 && y < 0x10000 { - fmt.Printf("\t{0x%04x, 0x%04x},\n", x, y) - } - } - fmt.Printf("}\n\n") -} - -func printGBK() { - res, err := http.Get("http://encoding.spec.whatwg.org/index-gbk.txt") - if err != nil { - log.Fatalf("Get: %v", err) - } - defer res.Body.Close() - - mapping := [65536]uint16{} - reverse := [65536]uint16{} - - scanner := bufio.NewScanner(res.Body) - for scanner.Scan() { - s := strings.TrimSpace(scanner.Text()) - if s == "" || s[0] == '#' { - continue - } - x, y := uint16(0), uint16(0) - if _, err := fmt.Sscanf(s, "%d 0x%x", &x, &y); err != nil { - log.Fatalf("could not parse %q", s) - } - if x < 0 || 126*190 <= x { - log.Fatalf("GBK code %d is out of range", x) - } - mapping[x] = y - if reverse[y] == 0 { - c0, c1 := x/190, x%190 - if c1 >= 0x3f { - c1++ - } - reverse[y] = (0x81+c0)<<8 | (0x40 + c1) - } - } - if err := scanner.Err(); err != nil { - log.Fatalf("scanner error: %v", err) - } - - fmt.Printf("// decode is the decoding table from GBK code to Unicode.\n") - fmt.Printf("// It is defined at http://encoding.spec.whatwg.org/index-gbk.txt\n") - fmt.Printf("var decode = [...]uint16{\n") - for i, v := range mapping { - if v != 0 { - fmt.Printf("\t%d: 0x%04X,\n", i, v) - } - } - fmt.Printf("}\n\n") - - // Any run of at least separation continuous zero entries in the reverse map will - // be a separate encode table. - const separation = 1024 - - intervals := []interval(nil) - low, high := -1, -1 - for i, v := range reverse { - if v == 0 { - continue - } - if low < 0 { - low = i - } else if i-high >= separation { - if high >= 0 { - intervals = append(intervals, interval{low, high}) - } - low = i - } - high = i + 1 - } - if high >= 0 { - intervals = append(intervals, interval{low, high}) - } - sort.Sort(byDecreasingLength(intervals)) - - fmt.Printf("const numEncodeTables = %d\n\n", len(intervals)) - fmt.Printf("// encodeX are the encoding tables from Unicode to GBK code,\n") - fmt.Printf("// sorted by decreasing length.\n") - for i, v := range intervals { - fmt.Printf("// encode%d: %5d entries for runes in [%5d, %5d).\n", i, v.len(), v.low, v.high) - } - fmt.Printf("\n") - - for i, v := range intervals { - fmt.Printf("const encode%dLow, encode%dHigh = %d, %d\n\n", i, i, v.low, v.high) - fmt.Printf("var encode%d = [...]uint16{\n", i) - for j := v.low; j < v.high; j++ { - x := reverse[j] - if x == 0 { - continue - } - fmt.Printf("\t%d-%d: 0x%04X,\n", j, v.low, x) - } - fmt.Printf("}\n\n") - } -} - -// interval is a half-open interval [low, high). -type interval struct { - low, high int -} - -func (i interval) len() int { return i.high - i.low } - -// byDecreasingLength sorts intervals by decreasing length. -type byDecreasingLength []interval - -func (b byDecreasingLength) Len() int { return len(b) } -func (b byDecreasingLength) Less(i, j int) bool { return b[i].len() > b[j].len() } -func (b byDecreasingLength) Swap(i, j int) { b[i], b[j] = b[j], b[i] } diff --git a/vendor/golang.org/x/text/encoding/traditionalchinese/maketables.go b/vendor/golang.org/x/text/encoding/traditionalchinese/maketables.go deleted file mode 100644 index cf7fdb31..00000000 --- a/vendor/golang.org/x/text/encoding/traditionalchinese/maketables.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// This program generates tables.go: -// go run maketables.go | gofmt > tables.go - -import ( - "bufio" - "fmt" - "log" - "net/http" - "sort" - "strings" -) - -func main() { - fmt.Printf("// generated by go run maketables.go; DO NOT EDIT\n\n") - fmt.Printf("// Package traditionalchinese provides Traditional Chinese encodings such as Big5.\n") - fmt.Printf(`package traditionalchinese // import "golang.org/x/text/encoding/traditionalchinese"` + "\n\n") - - res, err := http.Get("http://encoding.spec.whatwg.org/index-big5.txt") - if err != nil { - log.Fatalf("Get: %v", err) - } - defer res.Body.Close() - - mapping := [65536]uint32{} - reverse := [65536 * 4]uint16{} - - scanner := bufio.NewScanner(res.Body) - for scanner.Scan() { - s := strings.TrimSpace(scanner.Text()) - if s == "" || s[0] == '#' { - continue - } - x, y := uint16(0), uint32(0) - if _, err := fmt.Sscanf(s, "%d 0x%x", &x, &y); err != nil { - log.Fatalf("could not parse %q", s) - } - if x < 0 || 126*157 <= x { - log.Fatalf("Big5 code %d is out of range", x) - } - mapping[x] = y - - // The WHATWG spec http://encoding.spec.whatwg.org/#indexes says that - // "The index pointer for code point in index is the first pointer - // corresponding to code point in index", which would normally mean - // that the code below should be guarded by "if reverse[y] == 0", but - // last instead of first seems to match the behavior of - // "iconv -f UTF-8 -t BIG5". For example, U+8005 者 occurs twice in - // http://encoding.spec.whatwg.org/index-big5.txt, as index 2148 - // (encoded as "\x8e\xcd") and index 6543 (encoded as "\xaa\xcc") - // and "echo 者 | iconv -f UTF-8 -t BIG5 | xxd" gives "\xaa\xcc". - c0, c1 := x/157, x%157 - if c1 < 0x3f { - c1 += 0x40 - } else { - c1 += 0x62 - } - reverse[y] = (0x81+c0)<<8 | c1 - } - if err := scanner.Err(); err != nil { - log.Fatalf("scanner error: %v", err) - } - - fmt.Printf("// decode is the decoding table from Big5 code to Unicode.\n") - fmt.Printf("// It is defined at http://encoding.spec.whatwg.org/index-big5.txt\n") - fmt.Printf("var decode = [...]uint32{\n") - for i, v := range mapping { - if v != 0 { - fmt.Printf("\t%d: 0x%08X,\n", i, v) - } - } - fmt.Printf("}\n\n") - - // Any run of at least separation continuous zero entries in the reverse map will - // be a separate encode table. - const separation = 1024 - - intervals := []interval(nil) - low, high := -1, -1 - for i, v := range reverse { - if v == 0 { - continue - } - if low < 0 { - low = i - } else if i-high >= separation { - if high >= 0 { - intervals = append(intervals, interval{low, high}) - } - low = i - } - high = i + 1 - } - if high >= 0 { - intervals = append(intervals, interval{low, high}) - } - sort.Sort(byDecreasingLength(intervals)) - - fmt.Printf("const numEncodeTables = %d\n\n", len(intervals)) - fmt.Printf("// encodeX are the encoding tables from Unicode to Big5 code,\n") - fmt.Printf("// sorted by decreasing length.\n") - for i, v := range intervals { - fmt.Printf("// encode%d: %5d entries for runes in [%6d, %6d).\n", i, v.len(), v.low, v.high) - } - fmt.Printf("\n") - - for i, v := range intervals { - fmt.Printf("const encode%dLow, encode%dHigh = %d, %d\n\n", i, i, v.low, v.high) - fmt.Printf("var encode%d = [...]uint16{\n", i) - for j := v.low; j < v.high; j++ { - x := reverse[j] - if x == 0 { - continue - } - fmt.Printf("\t%d-%d: 0x%04X,\n", j, v.low, x) - } - fmt.Printf("}\n\n") - } -} - -// interval is a half-open interval [low, high). -type interval struct { - low, high int -} - -func (i interval) len() int { return i.high - i.low } - -// byDecreasingLength sorts intervals by decreasing length. -type byDecreasingLength []interval - -func (b byDecreasingLength) Len() int { return len(b) } -func (b byDecreasingLength) Less(i, j int) bool { return b[i].len() > b[j].len() } -func (b byDecreasingLength) Swap(i, j int) { b[i], b[j] = b[j], b[i] } diff --git a/vendor/golang.org/x/text/internal/language/compact/gen.go b/vendor/golang.org/x/text/internal/language/compact/gen.go deleted file mode 100644 index 0c36a052..00000000 --- a/vendor/golang.org/x/text/internal/language/compact/gen.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Language tag table generator. -// Data read from the web. - -package main - -import ( - "flag" - "fmt" - "log" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/unicode/cldr" -) - -var ( - test = flag.Bool("test", - false, - "test existing tables; can be used to compare web data with package data.") - outputFile = flag.String("output", - "tables.go", - "output file for generated tables") -) - -func main() { - gen.Init() - - w := gen.NewCodeWriter() - defer w.WriteGoFile("tables.go", "compact") - - fmt.Fprintln(w, `import "golang.org/x/text/internal/language"`) - - b := newBuilder(w) - gen.WriteCLDRVersion(w) - - b.writeCompactIndex() -} - -type builder struct { - w *gen.CodeWriter - data *cldr.CLDR - supp *cldr.SupplementalData -} - -func newBuilder(w *gen.CodeWriter) *builder { - r := gen.OpenCLDRCoreZip() - defer r.Close() - d := &cldr.Decoder{} - data, err := d.DecodeZip(r) - if err != nil { - log.Fatal(err) - } - b := builder{ - w: w, - data: data, - supp: data.Supplemental(), - } - return &b -} diff --git a/vendor/golang.org/x/text/internal/language/compact/gen_index.go b/vendor/golang.org/x/text/internal/language/compact/gen_index.go deleted file mode 100644 index 136cefaf..00000000 --- a/vendor/golang.org/x/text/internal/language/compact/gen_index.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// This file generates derivative tables based on the language package itself. - -import ( - "fmt" - "log" - "sort" - "strings" - - "golang.org/x/text/internal/language" -) - -// Compact indices: -// Note -va-X variants only apply to localization variants. -// BCP variants only ever apply to language. -// The only ambiguity between tags is with regions. - -func (b *builder) writeCompactIndex() { - // Collect all language tags for which we have any data in CLDR. - m := map[language.Tag]bool{} - for _, lang := range b.data.Locales() { - // We include all locales unconditionally to be consistent with en_US. - // We want en_US, even though it has no data associated with it. - - // TODO: put any of the languages for which no data exists at the end - // of the index. This allows all components based on ICU to use that - // as the cutoff point. - // if x := data.RawLDML(lang); false || - // x.LocaleDisplayNames != nil || - // x.Characters != nil || - // x.Delimiters != nil || - // x.Measurement != nil || - // x.Dates != nil || - // x.Numbers != nil || - // x.Units != nil || - // x.ListPatterns != nil || - // x.Collations != nil || - // x.Segmentations != nil || - // x.Rbnf != nil || - // x.Annotations != nil || - // x.Metadata != nil { - - // TODO: support POSIX natively, albeit non-standard. - tag := language.Make(strings.Replace(lang, "_POSIX", "-u-va-posix", 1)) - m[tag] = true - // } - } - - // TODO: plural rules are also defined for the deprecated tags: - // iw mo sh tl - // Consider removing these as compact tags. - - // Include locales for plural rules, which uses a different structure. - for _, plurals := range b.supp.Plurals { - for _, rules := range plurals.PluralRules { - for _, lang := range strings.Split(rules.Locales, " ") { - m[language.Make(lang)] = true - } - } - } - - var coreTags []language.CompactCoreInfo - var special []string - - for t := range m { - if x := t.Extensions(); len(x) != 0 && fmt.Sprint(x) != "[u-va-posix]" { - log.Fatalf("Unexpected extension %v in %v", x, t) - } - if len(t.Variants()) == 0 && len(t.Extensions()) == 0 { - cci, ok := language.GetCompactCore(t) - if !ok { - log.Fatalf("Locale for non-basic language %q", t) - } - coreTags = append(coreTags, cci) - } else { - special = append(special, t.String()) - } - } - - w := b.w - - sort.Slice(coreTags, func(i, j int) bool { return coreTags[i] < coreTags[j] }) - sort.Strings(special) - - w.WriteComment(` - NumCompactTags is the number of common tags. The maximum tag is - NumCompactTags-1.`) - w.WriteConst("NumCompactTags", len(m)) - - fmt.Fprintln(w, "const (") - for i, t := range coreTags { - fmt.Fprintf(w, "%s ID = %d\n", ident(t.Tag().String()), i) - } - for i, t := range special { - fmt.Fprintf(w, "%s ID = %d\n", ident(t), i+len(coreTags)) - } - fmt.Fprintln(w, ")") - - w.WriteVar("coreTags", coreTags) - - w.WriteConst("specialTagsStr", strings.Join(special, " ")) -} - -func ident(s string) string { - return strings.Replace(s, "-", "", -1) + "Index" -} diff --git a/vendor/golang.org/x/text/internal/language/compact/gen_parents.go b/vendor/golang.org/x/text/internal/language/compact/gen_parents.go deleted file mode 100644 index 9543d583..00000000 --- a/vendor/golang.org/x/text/internal/language/compact/gen_parents.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "log" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/language" - "golang.org/x/text/internal/language/compact" - "golang.org/x/text/unicode/cldr" -) - -func main() { - r := gen.OpenCLDRCoreZip() - defer r.Close() - - d := &cldr.Decoder{} - data, err := d.DecodeZip(r) - if err != nil { - log.Fatalf("DecodeZip: %v", err) - } - - w := gen.NewCodeWriter() - defer w.WriteGoFile("parents.go", "compact") - - // Create parents table. - type ID uint16 - parents := make([]ID, compact.NumCompactTags) - for _, loc := range data.Locales() { - tag := language.MustParse(loc) - index, ok := compact.FromTag(tag) - if !ok { - continue - } - parentIndex := compact.ID(0) // und - for p := tag.Parent(); p != language.Und; p = p.Parent() { - if x, ok := compact.FromTag(p); ok { - parentIndex = x - break - } - } - parents[index] = ID(parentIndex) - } - - w.WriteComment(` - parents maps a compact index of a tag to the compact index of the parent of - this tag.`) - w.WriteVar("parents", parents) -} diff --git a/vendor/golang.org/x/text/internal/language/gen.go b/vendor/golang.org/x/text/internal/language/gen.go deleted file mode 100644 index cdcc7feb..00000000 --- a/vendor/golang.org/x/text/internal/language/gen.go +++ /dev/null @@ -1,1520 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Language tag table generator. -// Data read from the web. - -package main - -import ( - "bufio" - "flag" - "fmt" - "io" - "io/ioutil" - "log" - "math" - "reflect" - "regexp" - "sort" - "strconv" - "strings" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/tag" - "golang.org/x/text/unicode/cldr" -) - -var ( - test = flag.Bool("test", - false, - "test existing tables; can be used to compare web data with package data.") - outputFile = flag.String("output", - "tables.go", - "output file for generated tables") -) - -var comment = []string{ - ` -lang holds an alphabetically sorted list of ISO-639 language identifiers. -All entries are 4 bytes. The index of the identifier (divided by 4) is the language tag. -For 2-byte language identifiers, the two successive bytes have the following meaning: - - if the first letter of the 2- and 3-letter ISO codes are the same: - the second and third letter of the 3-letter ISO code. - - otherwise: a 0 and a by 2 bits right-shifted index into altLangISO3. -For 3-byte language identifiers the 4th byte is 0.`, - ` -langNoIndex is a bit vector of all 3-letter language codes that are not used as an index -in lookup tables. The language ids for these language codes are derived directly -from the letters and are not consecutive.`, - ` -altLangISO3 holds an alphabetically sorted list of 3-letter language code alternatives -to 2-letter language codes that cannot be derived using the method described above. -Each 3-letter code is followed by its 1-byte langID.`, - ` -altLangIndex is used to convert indexes in altLangISO3 to langIDs.`, - ` -AliasMap maps langIDs to their suggested replacements.`, - ` -script is an alphabetically sorted list of ISO 15924 codes. The index -of the script in the string, divided by 4, is the internal scriptID.`, - ` -isoRegionOffset needs to be added to the index of regionISO to obtain the regionID -for 2-letter ISO codes. (The first isoRegionOffset regionIDs are reserved for -the UN.M49 codes used for groups.)`, - ` -regionISO holds a list of alphabetically sorted 2-letter ISO region codes. -Each 2-letter codes is followed by two bytes with the following meaning: - - [A-Z}{2}: the first letter of the 2-letter code plus these two - letters form the 3-letter ISO code. - - 0, n: index into altRegionISO3.`, - ` -regionTypes defines the status of a region for various standards.`, - ` -m49 maps regionIDs to UN.M49 codes. The first isoRegionOffset entries are -codes indicating collections of regions.`, - ` -m49Index gives indexes into fromM49 based on the three most significant bits -of a 10-bit UN.M49 code. To search an UN.M49 code in fromM49, search in - fromM49[m49Index[msb39(code)]:m49Index[msb3(code)+1]] -for an entry where the first 7 bits match the 7 lsb of the UN.M49 code. -The region code is stored in the 9 lsb of the indexed value.`, - ` -fromM49 contains entries to map UN.M49 codes to regions. See m49Index for details.`, - ` -altRegionISO3 holds a list of 3-letter region codes that cannot be -mapped to 2-letter codes using the default algorithm. This is a short list.`, - ` -altRegionIDs holds a list of regionIDs the positions of which match those -of the 3-letter ISO codes in altRegionISO3.`, - ` -variantNumSpecialized is the number of specialized variants in variants.`, - ` -suppressScript is an index from langID to the dominant script for that language, -if it exists. If a script is given, it should be suppressed from the language tag.`, - ` -likelyLang is a lookup table, indexed by langID, for the most likely -scripts and regions given incomplete information. If more entries exist for a -given language, region and script are the index and size respectively -of the list in likelyLangList.`, - ` -likelyLangList holds lists info associated with likelyLang.`, - ` -likelyRegion is a lookup table, indexed by regionID, for the most likely -languages and scripts given incomplete information. If more entries exist -for a given regionID, lang and script are the index and size respectively -of the list in likelyRegionList. -TODO: exclude containers and user-definable regions from the list.`, - ` -likelyRegionList holds lists info associated with likelyRegion.`, - ` -likelyScript is a lookup table, indexed by scriptID, for the most likely -languages and regions given a script.`, - ` -nRegionGroups is the number of region groups.`, - ` -regionInclusion maps region identifiers to sets of regions in regionInclusionBits, -where each set holds all groupings that are directly connected in a region -containment graph.`, - ` -regionInclusionBits is an array of bit vectors where every vector represents -a set of region groupings. These sets are used to compute the distance -between two regions for the purpose of language matching.`, - ` -regionInclusionNext marks, for each entry in regionInclusionBits, the set of -all groups that are reachable from the groups set in the respective entry.`, -} - -// TODO: consider changing some of these structures to tries. This can reduce -// memory, but may increase the need for memory allocations. This could be -// mitigated if we can piggyback on language tags for common cases. - -func failOnError(e error) { - if e != nil { - log.Panic(e) - } -} - -type setType int - -const ( - Indexed setType = 1 + iota // all elements must be of same size - Linear -) - -type stringSet struct { - s []string - sorted, frozen bool - - // We often need to update values after the creation of an index is completed. - // We include a convenience map for keeping track of this. - update map[string]string - typ setType // used for checking. -} - -func (ss *stringSet) clone() stringSet { - c := *ss - c.s = append([]string(nil), c.s...) - return c -} - -func (ss *stringSet) setType(t setType) { - if ss.typ != t && ss.typ != 0 { - log.Panicf("type %d cannot be assigned as it was already %d", t, ss.typ) - } -} - -// parse parses a whitespace-separated string and initializes ss with its -// components. -func (ss *stringSet) parse(s string) { - scan := bufio.NewScanner(strings.NewReader(s)) - scan.Split(bufio.ScanWords) - for scan.Scan() { - ss.add(scan.Text()) - } -} - -func (ss *stringSet) assertChangeable() { - if ss.frozen { - log.Panic("attempt to modify a frozen stringSet") - } -} - -func (ss *stringSet) add(s string) { - ss.assertChangeable() - ss.s = append(ss.s, s) - ss.sorted = ss.frozen -} - -func (ss *stringSet) freeze() { - ss.compact() - ss.frozen = true -} - -func (ss *stringSet) compact() { - if ss.sorted { - return - } - a := ss.s - sort.Strings(a) - k := 0 - for i := 1; i < len(a); i++ { - if a[k] != a[i] { - a[k+1] = a[i] - k++ - } - } - ss.s = a[:k+1] - ss.sorted = ss.frozen -} - -type funcSorter struct { - fn func(a, b string) bool - sort.StringSlice -} - -func (s funcSorter) Less(i, j int) bool { - return s.fn(s.StringSlice[i], s.StringSlice[j]) -} - -func (ss *stringSet) sortFunc(f func(a, b string) bool) { - ss.compact() - sort.Sort(funcSorter{f, sort.StringSlice(ss.s)}) -} - -func (ss *stringSet) remove(s string) { - ss.assertChangeable() - if i, ok := ss.find(s); ok { - copy(ss.s[i:], ss.s[i+1:]) - ss.s = ss.s[:len(ss.s)-1] - } -} - -func (ss *stringSet) replace(ol, nu string) { - ss.s[ss.index(ol)] = nu - ss.sorted = ss.frozen -} - -func (ss *stringSet) index(s string) int { - ss.setType(Indexed) - i, ok := ss.find(s) - if !ok { - if i < len(ss.s) { - log.Panicf("find: item %q is not in list. Closest match is %q.", s, ss.s[i]) - } - log.Panicf("find: item %q is not in list", s) - - } - return i -} - -func (ss *stringSet) find(s string) (int, bool) { - ss.compact() - i := sort.SearchStrings(ss.s, s) - return i, i != len(ss.s) && ss.s[i] == s -} - -func (ss *stringSet) slice() []string { - ss.compact() - return ss.s -} - -func (ss *stringSet) updateLater(v, key string) { - if ss.update == nil { - ss.update = map[string]string{} - } - ss.update[v] = key -} - -// join joins the string and ensures that all entries are of the same length. -func (ss *stringSet) join() string { - ss.setType(Indexed) - n := len(ss.s[0]) - for _, s := range ss.s { - if len(s) != n { - log.Panicf("join: not all entries are of the same length: %q", s) - } - } - ss.s = append(ss.s, strings.Repeat("\xff", n)) - return strings.Join(ss.s, "") -} - -// ianaEntry holds information for an entry in the IANA Language Subtag Repository. -// All types use the same entry. -// See http://tools.ietf.org/html/bcp47#section-5.1 for a description of the various -// fields. -type ianaEntry struct { - typ string - description []string - scope string - added string - preferred string - deprecated string - suppressScript string - macro string - prefix []string -} - -type builder struct { - w *gen.CodeWriter - hw io.Writer // MultiWriter for w and w.Hash - data *cldr.CLDR - supp *cldr.SupplementalData - - // indices - locale stringSet // common locales - lang stringSet // canonical language ids (2 or 3 letter ISO codes) with data - langNoIndex stringSet // 3-letter ISO codes with no associated data - script stringSet // 4-letter ISO codes - region stringSet // 2-letter ISO or 3-digit UN M49 codes - variant stringSet // 4-8-alphanumeric variant code. - - // Region codes that are groups with their corresponding group IDs. - groups map[int]index - - // langInfo - registry map[string]*ianaEntry -} - -type index uint - -func newBuilder(w *gen.CodeWriter) *builder { - r := gen.OpenCLDRCoreZip() - defer r.Close() - d := &cldr.Decoder{} - data, err := d.DecodeZip(r) - failOnError(err) - b := builder{ - w: w, - hw: io.MultiWriter(w, w.Hash), - data: data, - supp: data.Supplemental(), - } - b.parseRegistry() - return &b -} - -func (b *builder) parseRegistry() { - r := gen.OpenIANAFile("assignments/language-subtag-registry") - defer r.Close() - b.registry = make(map[string]*ianaEntry) - - scan := bufio.NewScanner(r) - scan.Split(bufio.ScanWords) - var record *ianaEntry - for more := scan.Scan(); more; { - key := scan.Text() - more = scan.Scan() - value := scan.Text() - switch key { - case "Type:": - record = &ianaEntry{typ: value} - case "Subtag:", "Tag:": - if s := strings.SplitN(value, "..", 2); len(s) > 1 { - for a := s[0]; a <= s[1]; a = inc(a) { - b.addToRegistry(a, record) - } - } else { - b.addToRegistry(value, record) - } - case "Suppress-Script:": - record.suppressScript = value - case "Added:": - record.added = value - case "Deprecated:": - record.deprecated = value - case "Macrolanguage:": - record.macro = value - case "Preferred-Value:": - record.preferred = value - case "Prefix:": - record.prefix = append(record.prefix, value) - case "Scope:": - record.scope = value - case "Description:": - buf := []byte(value) - for more = scan.Scan(); more; more = scan.Scan() { - b := scan.Bytes() - if b[0] == '%' || b[len(b)-1] == ':' { - break - } - buf = append(buf, ' ') - buf = append(buf, b...) - } - record.description = append(record.description, string(buf)) - continue - default: - continue - } - more = scan.Scan() - } - if scan.Err() != nil { - log.Panic(scan.Err()) - } -} - -func (b *builder) addToRegistry(key string, entry *ianaEntry) { - if info, ok := b.registry[key]; ok { - if info.typ != "language" || entry.typ != "extlang" { - log.Fatalf("parseRegistry: tag %q already exists", key) - } - } else { - b.registry[key] = entry - } -} - -var commentIndex = make(map[string]string) - -func init() { - for _, s := range comment { - key := strings.TrimSpace(strings.SplitN(s, " ", 2)[0]) - commentIndex[key] = s - } -} - -func (b *builder) comment(name string) { - if s := commentIndex[name]; len(s) > 0 { - b.w.WriteComment(s) - } else { - fmt.Fprintln(b.w) - } -} - -func (b *builder) pf(f string, x ...interface{}) { - fmt.Fprintf(b.hw, f, x...) - fmt.Fprint(b.hw, "\n") -} - -func (b *builder) p(x ...interface{}) { - fmt.Fprintln(b.hw, x...) -} - -func (b *builder) addSize(s int) { - b.w.Size += s - b.pf("// Size: %d bytes", s) -} - -func (b *builder) writeConst(name string, x interface{}) { - b.comment(name) - b.w.WriteConst(name, x) -} - -// writeConsts computes f(v) for all v in values and writes the results -// as constants named _v to a single constant block. -func (b *builder) writeConsts(f func(string) int, values ...string) { - b.pf("const (") - for _, v := range values { - b.pf("\t_%s = %v", v, f(v)) - } - b.pf(")") -} - -// writeType writes the type of the given value, which must be a struct. -func (b *builder) writeType(value interface{}) { - b.comment(reflect.TypeOf(value).Name()) - b.w.WriteType(value) -} - -func (b *builder) writeSlice(name string, ss interface{}) { - b.writeSliceAddSize(name, 0, ss) -} - -func (b *builder) writeSliceAddSize(name string, extraSize int, ss interface{}) { - b.comment(name) - b.w.Size += extraSize - v := reflect.ValueOf(ss) - t := v.Type().Elem() - b.pf("// Size: %d bytes, %d elements", v.Len()*int(t.Size())+extraSize, v.Len()) - - fmt.Fprintf(b.w, "var %s = ", name) - b.w.WriteArray(ss) - b.p() -} - -type FromTo struct { - From, To uint16 -} - -func (b *builder) writeSortedMap(name string, ss *stringSet, index func(s string) uint16) { - ss.sortFunc(func(a, b string) bool { - return index(a) < index(b) - }) - m := []FromTo{} - for _, s := range ss.s { - m = append(m, FromTo{index(s), index(ss.update[s])}) - } - b.writeSlice(name, m) -} - -const base = 'z' - 'a' + 1 - -func strToInt(s string) uint { - v := uint(0) - for i := 0; i < len(s); i++ { - v *= base - v += uint(s[i] - 'a') - } - return v -} - -// converts the given integer to the original ASCII string passed to strToInt. -// len(s) must match the number of characters obtained. -func intToStr(v uint, s []byte) { - for i := len(s) - 1; i >= 0; i-- { - s[i] = byte(v%base) + 'a' - v /= base - } -} - -func (b *builder) writeBitVector(name string, ss []string) { - vec := make([]uint8, int(math.Ceil(math.Pow(base, float64(len(ss[0])))/8))) - for _, s := range ss { - v := strToInt(s) - vec[v/8] |= 1 << (v % 8) - } - b.writeSlice(name, vec) -} - -// TODO: convert this type into a list or two-stage trie. -func (b *builder) writeMapFunc(name string, m map[string]string, f func(string) uint16) { - b.comment(name) - v := reflect.ValueOf(m) - sz := v.Len() * (2 + int(v.Type().Key().Size())) - for _, k := range m { - sz += len(k) - } - b.addSize(sz) - keys := []string{} - b.pf(`var %s = map[string]uint16{`, name) - for k := range m { - keys = append(keys, k) - } - sort.Strings(keys) - for _, k := range keys { - b.pf("\t%q: %v,", k, f(m[k])) - } - b.p("}") -} - -func (b *builder) writeMap(name string, m interface{}) { - b.comment(name) - v := reflect.ValueOf(m) - sz := v.Len() * (2 + int(v.Type().Key().Size()) + int(v.Type().Elem().Size())) - b.addSize(sz) - f := strings.FieldsFunc(fmt.Sprintf("%#v", m), func(r rune) bool { - return strings.IndexRune("{}, ", r) != -1 - }) - sort.Strings(f[1:]) - b.pf(`var %s = %s{`, name, f[0]) - for _, kv := range f[1:] { - b.pf("\t%s,", kv) - } - b.p("}") -} - -func (b *builder) langIndex(s string) uint16 { - if s == "und" { - return 0 - } - if i, ok := b.lang.find(s); ok { - return uint16(i) - } - return uint16(strToInt(s)) + uint16(len(b.lang.s)) -} - -// inc advances the string to its lexicographical successor. -func inc(s string) string { - const maxTagLength = 4 - var buf [maxTagLength]byte - intToStr(strToInt(strings.ToLower(s))+1, buf[:len(s)]) - for i := 0; i < len(s); i++ { - if s[i] <= 'Z' { - buf[i] -= 'a' - 'A' - } - } - return string(buf[:len(s)]) -} - -func (b *builder) parseIndices() { - meta := b.supp.Metadata - - for k, v := range b.registry { - var ss *stringSet - switch v.typ { - case "language": - if len(k) == 2 || v.suppressScript != "" || v.scope == "special" { - b.lang.add(k) - continue - } else { - ss = &b.langNoIndex - } - case "region": - ss = &b.region - case "script": - ss = &b.script - case "variant": - ss = &b.variant - default: - continue - } - ss.add(k) - } - // Include any language for which there is data. - for _, lang := range b.data.Locales() { - if x := b.data.RawLDML(lang); false || - x.LocaleDisplayNames != nil || - x.Characters != nil || - x.Delimiters != nil || - x.Measurement != nil || - x.Dates != nil || - x.Numbers != nil || - x.Units != nil || - x.ListPatterns != nil || - x.Collations != nil || - x.Segmentations != nil || - x.Rbnf != nil || - x.Annotations != nil || - x.Metadata != nil { - - from := strings.Split(lang, "_") - if lang := from[0]; lang != "root" { - b.lang.add(lang) - } - } - } - // Include locales for plural rules, which uses a different structure. - for _, plurals := range b.data.Supplemental().Plurals { - for _, rules := range plurals.PluralRules { - for _, lang := range strings.Split(rules.Locales, " ") { - if lang = strings.Split(lang, "_")[0]; lang != "root" { - b.lang.add(lang) - } - } - } - } - // Include languages in likely subtags. - for _, m := range b.supp.LikelySubtags.LikelySubtag { - from := strings.Split(m.From, "_") - b.lang.add(from[0]) - } - // Include ISO-639 alpha-3 bibliographic entries. - for _, a := range meta.Alias.LanguageAlias { - if a.Reason == "bibliographic" { - b.langNoIndex.add(a.Type) - } - } - // Include regions in territoryAlias (not all are in the IANA registry!) - for _, reg := range b.supp.Metadata.Alias.TerritoryAlias { - if len(reg.Type) == 2 { - b.region.add(reg.Type) - } - } - - for _, s := range b.lang.s { - if len(s) == 3 { - b.langNoIndex.remove(s) - } - } - b.writeConst("NumLanguages", len(b.lang.slice())+len(b.langNoIndex.slice())) - b.writeConst("NumScripts", len(b.script.slice())) - b.writeConst("NumRegions", len(b.region.slice())) - - // Add dummy codes at the start of each list to represent "unspecified". - b.lang.add("---") - b.script.add("----") - b.region.add("---") - - // common locales - b.locale.parse(meta.DefaultContent.Locales) -} - -// TODO: region inclusion data will probably not be use used in future matchers. - -func (b *builder) computeRegionGroups() { - b.groups = make(map[int]index) - - // Create group indices. - for i := 1; b.region.s[i][0] < 'A'; i++ { // Base M49 indices on regionID. - b.groups[i] = index(len(b.groups)) - } - for _, g := range b.supp.TerritoryContainment.Group { - // Skip UN and EURO zone as they are flattening the containment - // relationship. - if g.Type == "EZ" || g.Type == "UN" { - continue - } - group := b.region.index(g.Type) - if _, ok := b.groups[group]; !ok { - b.groups[group] = index(len(b.groups)) - } - } - if len(b.groups) > 64 { - log.Fatalf("only 64 groups supported, found %d", len(b.groups)) - } - b.writeConst("nRegionGroups", len(b.groups)) -} - -var langConsts = []string{ - "af", "am", "ar", "az", "bg", "bn", "ca", "cs", "da", "de", "el", "en", "es", - "et", "fa", "fi", "fil", "fr", "gu", "he", "hi", "hr", "hu", "hy", "id", "is", - "it", "ja", "ka", "kk", "km", "kn", "ko", "ky", "lo", "lt", "lv", "mk", "ml", - "mn", "mo", "mr", "ms", "mul", "my", "nb", "ne", "nl", "no", "pa", "pl", "pt", - "ro", "ru", "sh", "si", "sk", "sl", "sq", "sr", "sv", "sw", "ta", "te", "th", - "tl", "tn", "tr", "uk", "ur", "uz", "vi", "zh", "zu", - - // constants for grandfathered tags (if not already defined) - "jbo", "ami", "bnn", "hak", "tlh", "lb", "nv", "pwn", "tao", "tay", "tsu", - "nn", "sfb", "vgt", "sgg", "cmn", "nan", "hsn", -} - -// writeLanguage generates all tables needed for language canonicalization. -func (b *builder) writeLanguage() { - meta := b.supp.Metadata - - b.writeConst("nonCanonicalUnd", b.lang.index("und")) - b.writeConsts(func(s string) int { return int(b.langIndex(s)) }, langConsts...) - b.writeConst("langPrivateStart", b.langIndex("qaa")) - b.writeConst("langPrivateEnd", b.langIndex("qtz")) - - // Get language codes that need to be mapped (overlong 3-letter codes, - // deprecated 2-letter codes, legacy and grandfathered tags.) - langAliasMap := stringSet{} - aliasTypeMap := map[string]AliasType{} - - // altLangISO3 get the alternative ISO3 names that need to be mapped. - altLangISO3 := stringSet{} - // Add dummy start to avoid the use of index 0. - altLangISO3.add("---") - altLangISO3.updateLater("---", "aa") - - lang := b.lang.clone() - for _, a := range meta.Alias.LanguageAlias { - if a.Replacement == "" { - a.Replacement = "und" - } - // TODO: support mapping to tags - repl := strings.SplitN(a.Replacement, "_", 2)[0] - if a.Reason == "overlong" { - if len(a.Replacement) == 2 && len(a.Type) == 3 { - lang.updateLater(a.Replacement, a.Type) - } - } else if len(a.Type) <= 3 { - switch a.Reason { - case "macrolanguage": - aliasTypeMap[a.Type] = Macro - case "deprecated": - // handled elsewhere - continue - case "bibliographic", "legacy": - if a.Type == "no" { - continue - } - aliasTypeMap[a.Type] = Legacy - default: - log.Fatalf("new %s alias: %s", a.Reason, a.Type) - } - langAliasMap.add(a.Type) - langAliasMap.updateLater(a.Type, repl) - } - } - // Manually add the mapping of "nb" (Norwegian) to its macro language. - // This can be removed if CLDR adopts this change. - langAliasMap.add("nb") - langAliasMap.updateLater("nb", "no") - aliasTypeMap["nb"] = Macro - - for k, v := range b.registry { - // Also add deprecated values for 3-letter ISO codes, which CLDR omits. - if v.typ == "language" && v.deprecated != "" && v.preferred != "" { - langAliasMap.add(k) - langAliasMap.updateLater(k, v.preferred) - aliasTypeMap[k] = Deprecated - } - } - // Fix CLDR mappings. - lang.updateLater("tl", "tgl") - lang.updateLater("sh", "hbs") - lang.updateLater("mo", "mol") - lang.updateLater("no", "nor") - lang.updateLater("tw", "twi") - lang.updateLater("nb", "nob") - lang.updateLater("ak", "aka") - lang.updateLater("bh", "bih") - - // Ensure that each 2-letter code is matched with a 3-letter code. - for _, v := range lang.s[1:] { - s, ok := lang.update[v] - if !ok { - if s, ok = lang.update[langAliasMap.update[v]]; !ok { - continue - } - lang.update[v] = s - } - if v[0] != s[0] { - altLangISO3.add(s) - altLangISO3.updateLater(s, v) - } - } - - // Complete canonicalized language tags. - lang.freeze() - for i, v := range lang.s { - // We can avoid these manual entries by using the IANA registry directly. - // Seems easier to update the list manually, as changes are rare. - // The panic in this loop will trigger if we miss an entry. - add := "" - if s, ok := lang.update[v]; ok { - if s[0] == v[0] { - add = s[1:] - } else { - add = string([]byte{0, byte(altLangISO3.index(s))}) - } - } else if len(v) == 3 { - add = "\x00" - } else { - log.Panicf("no data for long form of %q", v) - } - lang.s[i] += add - } - b.writeConst("lang", tag.Index(lang.join())) - - b.writeConst("langNoIndexOffset", len(b.lang.s)) - - // space of all valid 3-letter language identifiers. - b.writeBitVector("langNoIndex", b.langNoIndex.slice()) - - altLangIndex := []uint16{} - for i, s := range altLangISO3.slice() { - altLangISO3.s[i] += string([]byte{byte(len(altLangIndex))}) - if i > 0 { - idx := b.lang.index(altLangISO3.update[s]) - altLangIndex = append(altLangIndex, uint16(idx)) - } - } - b.writeConst("altLangISO3", tag.Index(altLangISO3.join())) - b.writeSlice("altLangIndex", altLangIndex) - - b.writeSortedMap("AliasMap", &langAliasMap, b.langIndex) - types := make([]AliasType, len(langAliasMap.s)) - for i, s := range langAliasMap.s { - types[i] = aliasTypeMap[s] - } - b.writeSlice("AliasTypes", types) -} - -var scriptConsts = []string{ - "Latn", "Hani", "Hans", "Hant", "Qaaa", "Qaai", "Qabx", "Zinh", "Zyyy", - "Zzzz", -} - -func (b *builder) writeScript() { - b.writeConsts(b.script.index, scriptConsts...) - b.writeConst("script", tag.Index(b.script.join())) - - supp := make([]uint8, len(b.lang.slice())) - for i, v := range b.lang.slice()[1:] { - if sc := b.registry[v].suppressScript; sc != "" { - supp[i+1] = uint8(b.script.index(sc)) - } - } - b.writeSlice("suppressScript", supp) - - // There is only one deprecated script in CLDR. This value is hard-coded. - // We check here if the code must be updated. - for _, a := range b.supp.Metadata.Alias.ScriptAlias { - if a.Type != "Qaai" { - log.Panicf("unexpected deprecated stript %q", a.Type) - } - } -} - -func parseM49(s string) int16 { - if len(s) == 0 { - return 0 - } - v, err := strconv.ParseUint(s, 10, 10) - failOnError(err) - return int16(v) -} - -var regionConsts = []string{ - "001", "419", "BR", "CA", "ES", "GB", "MD", "PT", "UK", "US", - "ZZ", "XA", "XC", "XK", // Unofficial tag for Kosovo. -} - -func (b *builder) writeRegion() { - b.writeConsts(b.region.index, regionConsts...) - - isoOffset := b.region.index("AA") - m49map := make([]int16, len(b.region.slice())) - fromM49map := make(map[int16]int) - altRegionISO3 := "" - altRegionIDs := []uint16{} - - b.writeConst("isoRegionOffset", isoOffset) - - // 2-letter region lookup and mapping to numeric codes. - regionISO := b.region.clone() - regionISO.s = regionISO.s[isoOffset:] - regionISO.sorted = false - - regionTypes := make([]byte, len(b.region.s)) - - // Is the region valid BCP 47? - for s, e := range b.registry { - if len(s) == 2 && s == strings.ToUpper(s) { - i := b.region.index(s) - for _, d := range e.description { - if strings.Contains(d, "Private use") { - regionTypes[i] = iso3166UserAssigned - } - } - regionTypes[i] |= bcp47Region - } - } - - // Is the region a valid ccTLD? - r := gen.OpenIANAFile("domains/root/db") - defer r.Close() - - buf, err := ioutil.ReadAll(r) - failOnError(err) - re := regexp.MustCompile(`"/domains/root/db/([a-z]{2}).html"`) - for _, m := range re.FindAllSubmatch(buf, -1) { - i := b.region.index(strings.ToUpper(string(m[1]))) - regionTypes[i] |= ccTLD - } - - b.writeSlice("regionTypes", regionTypes) - - iso3Set := make(map[string]int) - update := func(iso2, iso3 string) { - i := regionISO.index(iso2) - if j, ok := iso3Set[iso3]; !ok && iso3[0] == iso2[0] { - regionISO.s[i] += iso3[1:] - iso3Set[iso3] = -1 - } else { - if ok && j >= 0 { - regionISO.s[i] += string([]byte{0, byte(j)}) - } else { - iso3Set[iso3] = len(altRegionISO3) - regionISO.s[i] += string([]byte{0, byte(len(altRegionISO3))}) - altRegionISO3 += iso3 - altRegionIDs = append(altRegionIDs, uint16(isoOffset+i)) - } - } - } - for _, tc := range b.supp.CodeMappings.TerritoryCodes { - i := regionISO.index(tc.Type) + isoOffset - if d := m49map[i]; d != 0 { - log.Panicf("%s found as a duplicate UN.M49 code of %03d", tc.Numeric, d) - } - m49 := parseM49(tc.Numeric) - m49map[i] = m49 - if r := fromM49map[m49]; r == 0 { - fromM49map[m49] = i - } else if r != i { - dep := b.registry[regionISO.s[r-isoOffset]].deprecated - if t := b.registry[tc.Type]; t != nil && dep != "" && (t.deprecated == "" || t.deprecated > dep) { - fromM49map[m49] = i - } - } - } - for _, ta := range b.supp.Metadata.Alias.TerritoryAlias { - if len(ta.Type) == 3 && ta.Type[0] <= '9' && len(ta.Replacement) == 2 { - from := parseM49(ta.Type) - if r := fromM49map[from]; r == 0 { - fromM49map[from] = regionISO.index(ta.Replacement) + isoOffset - } - } - } - for _, tc := range b.supp.CodeMappings.TerritoryCodes { - if len(tc.Alpha3) == 3 { - update(tc.Type, tc.Alpha3) - } - } - // This entries are not included in territoryCodes. Mostly 3-letter variants - // of deleted codes and an entry for QU. - for _, m := range []struct{ iso2, iso3 string }{ - {"CT", "CTE"}, - {"DY", "DHY"}, - {"HV", "HVO"}, - {"JT", "JTN"}, - {"MI", "MID"}, - {"NH", "NHB"}, - {"NQ", "ATN"}, - {"PC", "PCI"}, - {"PU", "PUS"}, - {"PZ", "PCZ"}, - {"RH", "RHO"}, - {"VD", "VDR"}, - {"WK", "WAK"}, - // These three-letter codes are used for others as well. - {"FQ", "ATF"}, - } { - update(m.iso2, m.iso3) - } - for i, s := range regionISO.s { - if len(s) != 4 { - regionISO.s[i] = s + " " - } - } - b.writeConst("regionISO", tag.Index(regionISO.join())) - b.writeConst("altRegionISO3", altRegionISO3) - b.writeSlice("altRegionIDs", altRegionIDs) - - // Create list of deprecated regions. - // TODO: consider inserting SF -> FI. Not included by CLDR, but is the only - // Transitionally-reserved mapping not included. - regionOldMap := stringSet{} - // Include regions in territoryAlias (not all are in the IANA registry!) - for _, reg := range b.supp.Metadata.Alias.TerritoryAlias { - if len(reg.Type) == 2 && reg.Reason == "deprecated" && len(reg.Replacement) == 2 { - regionOldMap.add(reg.Type) - regionOldMap.updateLater(reg.Type, reg.Replacement) - i, _ := regionISO.find(reg.Type) - j, _ := regionISO.find(reg.Replacement) - if k := m49map[i+isoOffset]; k == 0 { - m49map[i+isoOffset] = m49map[j+isoOffset] - } - } - } - b.writeSortedMap("regionOldMap", ®ionOldMap, func(s string) uint16 { - return uint16(b.region.index(s)) - }) - // 3-digit region lookup, groupings. - for i := 1; i < isoOffset; i++ { - m := parseM49(b.region.s[i]) - m49map[i] = m - fromM49map[m] = i - } - b.writeSlice("m49", m49map) - - const ( - searchBits = 7 - regionBits = 9 - ) - if len(m49map) >= 1< %d", len(m49map), 1<>searchBits] = int16(len(fromM49)) - } - b.writeSlice("m49Index", m49Index) - b.writeSlice("fromM49", fromM49) -} - -const ( - // TODO: put these lists in regionTypes as user data? Could be used for - // various optimizations and refinements and could be exposed in the API. - iso3166Except = "AC CP DG EA EU FX IC SU TA UK" - iso3166Trans = "AN BU CS NT TP YU ZR" // SF is not in our set of Regions. - // DY and RH are actually not deleted, but indeterminately reserved. - iso3166DelCLDR = "CT DD DY FQ HV JT MI NH NQ PC PU PZ RH VD WK YD" -) - -const ( - iso3166UserAssigned = 1 << iota - ccTLD - bcp47Region -) - -func find(list []string, s string) int { - for i, t := range list { - if t == s { - return i - } - } - return -1 -} - -// writeVariants generates per-variant information and creates a map from variant -// name to index value. We assign index values such that sorting multiple -// variants by index value will result in the correct order. -// There are two types of variants: specialized and general. Specialized variants -// are only applicable to certain language or language-script pairs. Generalized -// variants apply to any language. Generalized variants always sort after -// specialized variants. We will therefore always assign a higher index value -// to a generalized variant than any other variant. Generalized variants are -// sorted alphabetically among themselves. -// Specialized variants may also sort after other specialized variants. Such -// variants will be ordered after any of the variants they may follow. -// We assume that if a variant x is followed by a variant y, then for any prefix -// p of x, p-x is a prefix of y. This allows us to order tags based on the -// maximum of the length of any of its prefixes. -// TODO: it is possible to define a set of Prefix values on variants such that -// a total order cannot be defined to the point that this algorithm breaks. -// In other words, we cannot guarantee the same order of variants for the -// future using the same algorithm or for non-compliant combinations of -// variants. For this reason, consider using simple alphabetic sorting -// of variants and ignore Prefix restrictions altogether. -func (b *builder) writeVariant() { - generalized := stringSet{} - specialized := stringSet{} - specializedExtend := stringSet{} - // Collate the variants by type and check assumptions. - for _, v := range b.variant.slice() { - e := b.registry[v] - if len(e.prefix) == 0 { - generalized.add(v) - continue - } - c := strings.Split(e.prefix[0], "-") - hasScriptOrRegion := false - if len(c) > 1 { - _, hasScriptOrRegion = b.script.find(c[1]) - if !hasScriptOrRegion { - _, hasScriptOrRegion = b.region.find(c[1]) - - } - } - if len(c) == 1 || len(c) == 2 && hasScriptOrRegion { - // Variant is preceded by a language. - specialized.add(v) - continue - } - // Variant is preceded by another variant. - specializedExtend.add(v) - prefix := c[0] + "-" - if hasScriptOrRegion { - prefix += c[1] - } - for _, p := range e.prefix { - // Verify that the prefix minus the last element is a prefix of the - // predecessor element. - i := strings.LastIndex(p, "-") - pred := b.registry[p[i+1:]] - if find(pred.prefix, p[:i]) < 0 { - log.Fatalf("prefix %q for variant %q not consistent with predecessor spec", p, v) - } - // The sorting used below does not work in the general case. It works - // if we assume that variants that may be followed by others only have - // prefixes of the same length. Verify this. - count := strings.Count(p[:i], "-") - for _, q := range pred.prefix { - if c := strings.Count(q, "-"); c != count { - log.Fatalf("variant %q preceding %q has a prefix %q of size %d; want %d", p[i+1:], v, q, c, count) - } - } - if !strings.HasPrefix(p, prefix) { - log.Fatalf("prefix %q of variant %q should start with %q", p, v, prefix) - } - } - } - - // Sort extended variants. - a := specializedExtend.s - less := func(v, w string) bool { - // Sort by the maximum number of elements. - maxCount := func(s string) (max int) { - for _, p := range b.registry[s].prefix { - if c := strings.Count(p, "-"); c > max { - max = c - } - } - return - } - if cv, cw := maxCount(v), maxCount(w); cv != cw { - return cv < cw - } - // Sort by name as tie breaker. - return v < w - } - sort.Sort(funcSorter{less, sort.StringSlice(a)}) - specializedExtend.frozen = true - - // Create index from variant name to index. - variantIndex := make(map[string]uint8) - add := func(s []string) { - for _, v := range s { - variantIndex[v] = uint8(len(variantIndex)) - } - } - add(specialized.slice()) - add(specializedExtend.s) - numSpecialized := len(variantIndex) - add(generalized.slice()) - if n := len(variantIndex); n > 255 { - log.Fatalf("maximum number of variants exceeded: was %d; want <= 255", n) - } - b.writeMap("variantIndex", variantIndex) - b.writeConst("variantNumSpecialized", numSpecialized) -} - -func (b *builder) writeLanguageInfo() { -} - -// writeLikelyData writes tables that are used both for finding parent relations and for -// language matching. Each entry contains additional bits to indicate the status of the -// data to know when it cannot be used for parent relations. -func (b *builder) writeLikelyData() { - const ( - isList = 1 << iota - scriptInFrom - regionInFrom - ) - type ( // generated types - likelyScriptRegion struct { - region uint16 - script uint8 - flags uint8 - } - likelyLangScript struct { - lang uint16 - script uint8 - flags uint8 - } - likelyLangRegion struct { - lang uint16 - region uint16 - } - // likelyTag is used for getting likely tags for group regions, where - // the likely region might be a region contained in the group. - likelyTag struct { - lang uint16 - region uint16 - script uint8 - } - ) - var ( // generated variables - likelyRegionGroup = make([]likelyTag, len(b.groups)) - likelyLang = make([]likelyScriptRegion, len(b.lang.s)) - likelyRegion = make([]likelyLangScript, len(b.region.s)) - likelyScript = make([]likelyLangRegion, len(b.script.s)) - likelyLangList = []likelyScriptRegion{} - likelyRegionList = []likelyLangScript{} - ) - type fromTo struct { - from, to []string - } - langToOther := map[int][]fromTo{} - regionToOther := map[int][]fromTo{} - for _, m := range b.supp.LikelySubtags.LikelySubtag { - from := strings.Split(m.From, "_") - to := strings.Split(m.To, "_") - if len(to) != 3 { - log.Fatalf("invalid number of subtags in %q: found %d, want 3", m.To, len(to)) - } - if len(from) > 3 { - log.Fatalf("invalid number of subtags: found %d, want 1-3", len(from)) - } - if from[0] != to[0] && from[0] != "und" { - log.Fatalf("unexpected language change in expansion: %s -> %s", from, to) - } - if len(from) == 3 { - if from[2] != to[2] { - log.Fatalf("unexpected region change in expansion: %s -> %s", from, to) - } - if from[0] != "und" { - log.Fatalf("unexpected fully specified from tag: %s -> %s", from, to) - } - } - if len(from) == 1 || from[0] != "und" { - id := 0 - if from[0] != "und" { - id = b.lang.index(from[0]) - } - langToOther[id] = append(langToOther[id], fromTo{from, to}) - } else if len(from) == 2 && len(from[1]) == 4 { - sid := b.script.index(from[1]) - likelyScript[sid].lang = uint16(b.langIndex(to[0])) - likelyScript[sid].region = uint16(b.region.index(to[2])) - } else { - r := b.region.index(from[len(from)-1]) - if id, ok := b.groups[r]; ok { - if from[0] != "und" { - log.Fatalf("region changed unexpectedly: %s -> %s", from, to) - } - likelyRegionGroup[id].lang = uint16(b.langIndex(to[0])) - likelyRegionGroup[id].script = uint8(b.script.index(to[1])) - likelyRegionGroup[id].region = uint16(b.region.index(to[2])) - } else { - regionToOther[r] = append(regionToOther[r], fromTo{from, to}) - } - } - } - b.writeType(likelyLangRegion{}) - b.writeSlice("likelyScript", likelyScript) - - for id := range b.lang.s { - list := langToOther[id] - if len(list) == 1 { - likelyLang[id].region = uint16(b.region.index(list[0].to[2])) - likelyLang[id].script = uint8(b.script.index(list[0].to[1])) - } else if len(list) > 1 { - likelyLang[id].flags = isList - likelyLang[id].region = uint16(len(likelyLangList)) - likelyLang[id].script = uint8(len(list)) - for _, x := range list { - flags := uint8(0) - if len(x.from) > 1 { - if x.from[1] == x.to[2] { - flags = regionInFrom - } else { - flags = scriptInFrom - } - } - likelyLangList = append(likelyLangList, likelyScriptRegion{ - region: uint16(b.region.index(x.to[2])), - script: uint8(b.script.index(x.to[1])), - flags: flags, - }) - } - } - } - // TODO: merge suppressScript data with this table. - b.writeType(likelyScriptRegion{}) - b.writeSlice("likelyLang", likelyLang) - b.writeSlice("likelyLangList", likelyLangList) - - for id := range b.region.s { - list := regionToOther[id] - if len(list) == 1 { - likelyRegion[id].lang = uint16(b.langIndex(list[0].to[0])) - likelyRegion[id].script = uint8(b.script.index(list[0].to[1])) - if len(list[0].from) > 2 { - likelyRegion[id].flags = scriptInFrom - } - } else if len(list) > 1 { - likelyRegion[id].flags = isList - likelyRegion[id].lang = uint16(len(likelyRegionList)) - likelyRegion[id].script = uint8(len(list)) - for i, x := range list { - if len(x.from) == 2 && i != 0 || i > 0 && len(x.from) != 3 { - log.Fatalf("unspecified script must be first in list: %v at %d", x.from, i) - } - x := likelyLangScript{ - lang: uint16(b.langIndex(x.to[0])), - script: uint8(b.script.index(x.to[1])), - } - if len(list[0].from) > 2 { - x.flags = scriptInFrom - } - likelyRegionList = append(likelyRegionList, x) - } - } - } - b.writeType(likelyLangScript{}) - b.writeSlice("likelyRegion", likelyRegion) - b.writeSlice("likelyRegionList", likelyRegionList) - - b.writeType(likelyTag{}) - b.writeSlice("likelyRegionGroup", likelyRegionGroup) -} - -func (b *builder) writeRegionInclusionData() { - var ( - // mm holds for each group the set of groups with a distance of 1. - mm = make(map[int][]index) - - // containment holds for each group the transitive closure of - // containment of other groups. - containment = make(map[index][]index) - ) - for _, g := range b.supp.TerritoryContainment.Group { - // Skip UN and EURO zone as they are flattening the containment - // relationship. - if g.Type == "EZ" || g.Type == "UN" { - continue - } - group := b.region.index(g.Type) - groupIdx := b.groups[group] - for _, mem := range strings.Split(g.Contains, " ") { - r := b.region.index(mem) - mm[r] = append(mm[r], groupIdx) - if g, ok := b.groups[r]; ok { - mm[group] = append(mm[group], g) - containment[groupIdx] = append(containment[groupIdx], g) - } - } - } - - regionContainment := make([]uint64, len(b.groups)) - for _, g := range b.groups { - l := containment[g] - - // Compute the transitive closure of containment. - for i := 0; i < len(l); i++ { - l = append(l, containment[l[i]]...) - } - - // Compute the bitmask. - regionContainment[g] = 1 << g - for _, v := range l { - regionContainment[g] |= 1 << v - } - } - b.writeSlice("regionContainment", regionContainment) - - regionInclusion := make([]uint8, len(b.region.s)) - bvs := make(map[uint64]index) - // Make the first bitvector positions correspond with the groups. - for r, i := range b.groups { - bv := uint64(1 << i) - for _, g := range mm[r] { - bv |= 1 << g - } - bvs[bv] = i - regionInclusion[r] = uint8(bvs[bv]) - } - for r := 1; r < len(b.region.s); r++ { - if _, ok := b.groups[r]; !ok { - bv := uint64(0) - for _, g := range mm[r] { - bv |= 1 << g - } - if bv == 0 { - // Pick the world for unspecified regions. - bv = 1 << b.groups[b.region.index("001")] - } - if _, ok := bvs[bv]; !ok { - bvs[bv] = index(len(bvs)) - } - regionInclusion[r] = uint8(bvs[bv]) - } - } - b.writeSlice("regionInclusion", regionInclusion) - regionInclusionBits := make([]uint64, len(bvs)) - for k, v := range bvs { - regionInclusionBits[v] = uint64(k) - } - // Add bit vectors for increasingly large distances until a fixed point is reached. - regionInclusionNext := []uint8{} - for i := 0; i < len(regionInclusionBits); i++ { - bits := regionInclusionBits[i] - next := bits - for i := uint(0); i < uint(len(b.groups)); i++ { - if bits&(1< 6 { - log.Fatalf("Too many groups: %d", i) - } - idToIndex[mv.Id] = uint8(i + 1) - // TODO: also handle '-' - for _, r := range strings.Split(mv.Value, "+") { - todo := []string{r} - for k := 0; k < len(todo); k++ { - r := todo[k] - regionToGroups[b.regionIndex(r)] |= 1 << uint8(i) - todo = append(todo, regionHierarchy[r]...) - } - } - } - b.w.WriteVar("regionToGroups", regionToGroups) - - // maps language id to in- and out-of-group region. - paradigmLocales := [][3]uint16{} - locales := strings.Split(lm[0].ParadigmLocales[0].Locales, " ") - for i := 0; i < len(locales); i += 2 { - x := [3]uint16{} - for j := 0; j < 2; j++ { - pc := strings.SplitN(locales[i+j], "-", 2) - x[0] = b.langIndex(pc[0]) - if len(pc) == 2 { - x[1+j] = uint16(b.regionIndex(pc[1])) - } - } - paradigmLocales = append(paradigmLocales, x) - } - b.w.WriteVar("paradigmLocales", paradigmLocales) - - b.w.WriteType(mutualIntelligibility{}) - b.w.WriteType(scriptIntelligibility{}) - b.w.WriteType(regionIntelligibility{}) - - matchLang := []mutualIntelligibility{} - matchScript := []scriptIntelligibility{} - matchRegion := []regionIntelligibility{} - // Convert the languageMatch entries in lists keyed by desired language. - for _, m := range lm[0].LanguageMatch { - // Different versions of CLDR use different separators. - desired := strings.Replace(m.Desired, "-", "_", -1) - supported := strings.Replace(m.Supported, "-", "_", -1) - d := strings.Split(desired, "_") - s := strings.Split(supported, "_") - if len(d) != len(s) { - log.Fatalf("not supported: desired=%q; supported=%q", desired, supported) - continue - } - distance, _ := strconv.ParseInt(m.Distance, 10, 8) - switch len(d) { - case 2: - if desired == supported && desired == "*_*" { - continue - } - // language-script pair. - matchScript = append(matchScript, scriptIntelligibility{ - wantLang: uint16(b.langIndex(d[0])), - haveLang: uint16(b.langIndex(s[0])), - wantScript: uint8(b.scriptIndex(d[1])), - haveScript: uint8(b.scriptIndex(s[1])), - distance: uint8(distance), - }) - if m.Oneway != "true" { - matchScript = append(matchScript, scriptIntelligibility{ - wantLang: uint16(b.langIndex(s[0])), - haveLang: uint16(b.langIndex(d[0])), - wantScript: uint8(b.scriptIndex(s[1])), - haveScript: uint8(b.scriptIndex(d[1])), - distance: uint8(distance), - }) - } - case 1: - if desired == supported && desired == "*" { - continue - } - if distance == 1 { - // nb == no is already handled by macro mapping. Check there - // really is only this case. - if d[0] != "no" || s[0] != "nb" { - log.Fatalf("unhandled equivalence %s == %s", s[0], d[0]) - } - continue - } - // TODO: consider dropping oneway field and just doubling the entry. - matchLang = append(matchLang, mutualIntelligibility{ - want: uint16(b.langIndex(d[0])), - have: uint16(b.langIndex(s[0])), - distance: uint8(distance), - oneway: m.Oneway == "true", - }) - case 3: - if desired == supported && desired == "*_*_*" { - continue - } - if desired != supported { - // This is now supported by CLDR, but only one case, which - // should already be covered by paradigm locales. For instance, - // test case "und, en, en-GU, en-IN, en-GB ; en-ZA ; en-GB" in - // testdata/CLDRLocaleMatcherTest.txt tests this. - if supported != "en_*_GB" { - log.Fatalf("not supported: desired=%q; supported=%q", desired, supported) - } - continue - } - ri := regionIntelligibility{ - lang: b.langIndex(d[0]), - distance: uint8(distance), - } - if d[1] != "*" { - ri.script = uint8(b.scriptIndex(d[1])) - } - switch { - case d[2] == "*": - ri.group = 0x80 // not contained in anything - case strings.HasPrefix(d[2], "$!"): - ri.group = 0x80 - d[2] = "$" + d[2][len("$!"):] - fallthrough - case strings.HasPrefix(d[2], "$"): - ri.group |= idToIndex[d[2]] - } - matchRegion = append(matchRegion, ri) - default: - log.Fatalf("not supported: desired=%q; supported=%q", desired, supported) - } - } - sort.SliceStable(matchLang, func(i, j int) bool { - return matchLang[i].distance < matchLang[j].distance - }) - b.w.WriteComment(` - matchLang holds pairs of langIDs of base languages that are typically - mutually intelligible. Each pair is associated with a confidence and - whether the intelligibility goes one or both ways.`) - b.w.WriteVar("matchLang", matchLang) - - b.w.WriteComment(` - matchScript holds pairs of scriptIDs where readers of one script - can typically also read the other. Each is associated with a confidence.`) - sort.SliceStable(matchScript, func(i, j int) bool { - return matchScript[i].distance < matchScript[j].distance - }) - b.w.WriteVar("matchScript", matchScript) - - sort.SliceStable(matchRegion, func(i, j int) bool { - return matchRegion[i].distance < matchRegion[j].distance - }) - b.w.WriteVar("matchRegion", matchRegion) -} diff --git a/vendor/golang.org/x/text/unicode/bidi/gen.go b/vendor/golang.org/x/text/unicode/bidi/gen.go deleted file mode 100644 index 987fc169..00000000 --- a/vendor/golang.org/x/text/unicode/bidi/gen.go +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "flag" - "log" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/triegen" - "golang.org/x/text/internal/ucd" -) - -var outputFile = flag.String("out", "tables.go", "output file") - -func main() { - gen.Init() - gen.Repackage("gen_trieval.go", "trieval.go", "bidi") - gen.Repackage("gen_ranges.go", "ranges_test.go", "bidi") - - genTables() -} - -// bidiClass names and codes taken from class "bc" in -// https://www.unicode.org/Public/8.0.0/ucd/PropertyValueAliases.txt -var bidiClass = map[string]Class{ - "AL": AL, // ArabicLetter - "AN": AN, // ArabicNumber - "B": B, // ParagraphSeparator - "BN": BN, // BoundaryNeutral - "CS": CS, // CommonSeparator - "EN": EN, // EuropeanNumber - "ES": ES, // EuropeanSeparator - "ET": ET, // EuropeanTerminator - "L": L, // LeftToRight - "NSM": NSM, // NonspacingMark - "ON": ON, // OtherNeutral - "R": R, // RightToLeft - "S": S, // SegmentSeparator - "WS": WS, // WhiteSpace - - "FSI": Control, - "PDF": Control, - "PDI": Control, - "LRE": Control, - "LRI": Control, - "LRO": Control, - "RLE": Control, - "RLI": Control, - "RLO": Control, -} - -func genTables() { - if numClass > 0x0F { - log.Fatalf("Too many Class constants (%#x > 0x0F).", numClass) - } - w := gen.NewCodeWriter() - defer w.WriteVersionedGoFile(*outputFile, "bidi") - - gen.WriteUnicodeVersion(w) - - t := triegen.NewTrie("bidi") - - // Build data about bracket mapping. These bits need to be or-ed with - // any other bits. - orMask := map[rune]uint64{} - - xorMap := map[rune]int{} - xorMasks := []rune{0} // First value is no-op. - - ucd.Parse(gen.OpenUCDFile("BidiBrackets.txt"), func(p *ucd.Parser) { - r1 := p.Rune(0) - r2 := p.Rune(1) - xor := r1 ^ r2 - if _, ok := xorMap[xor]; !ok { - xorMap[xor] = len(xorMasks) - xorMasks = append(xorMasks, xor) - } - entry := uint64(xorMap[xor]) << xorMaskShift - switch p.String(2) { - case "o": - entry |= openMask - case "c", "n": - default: - log.Fatalf("Unknown bracket class %q.", p.String(2)) - } - orMask[r1] = entry - }) - - w.WriteComment(` - xorMasks contains masks to be xor-ed with brackets to get the reverse - version.`) - w.WriteVar("xorMasks", xorMasks) - - done := map[rune]bool{} - - insert := func(r rune, c Class) { - if !done[r] { - t.Insert(r, orMask[r]|uint64(c)) - done[r] = true - } - } - - // Insert the derived BiDi properties. - ucd.Parse(gen.OpenUCDFile("extracted/DerivedBidiClass.txt"), func(p *ucd.Parser) { - r := p.Rune(0) - class, ok := bidiClass[p.String(1)] - if !ok { - log.Fatalf("%U: Unknown BiDi class %q", r, p.String(1)) - } - insert(r, class) - }) - visitDefaults(insert) - - // TODO: use sparse blocks. This would reduce table size considerably - // from the looks of it. - - sz, err := t.Gen(w) - if err != nil { - log.Fatal(err) - } - w.Size += sz -} - -// dummy values to make methods in gen_common compile. The real versions -// will be generated by this file to tables.go. -var ( - xorMasks []rune -) diff --git a/vendor/golang.org/x/text/unicode/bidi/gen_ranges.go b/vendor/golang.org/x/text/unicode/bidi/gen_ranges.go deleted file mode 100644 index 02c3b505..00000000 --- a/vendor/golang.org/x/text/unicode/bidi/gen_ranges.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "unicode" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/ucd" - "golang.org/x/text/unicode/rangetable" -) - -// These tables are hand-extracted from: -// https://www.unicode.org/Public/8.0.0/ucd/extracted/DerivedBidiClass.txt -func visitDefaults(fn func(r rune, c Class)) { - // first write default values for ranges listed above. - visitRunes(fn, AL, []rune{ - 0x0600, 0x07BF, // Arabic - 0x08A0, 0x08FF, // Arabic Extended-A - 0xFB50, 0xFDCF, // Arabic Presentation Forms - 0xFDF0, 0xFDFF, - 0xFE70, 0xFEFF, - 0x0001EE00, 0x0001EEFF, // Arabic Mathematical Alpha Symbols - }) - visitRunes(fn, R, []rune{ - 0x0590, 0x05FF, // Hebrew - 0x07C0, 0x089F, // Nko et al. - 0xFB1D, 0xFB4F, - 0x00010800, 0x00010FFF, // Cypriot Syllabary et. al. - 0x0001E800, 0x0001EDFF, - 0x0001EF00, 0x0001EFFF, - }) - visitRunes(fn, ET, []rune{ // European Terminator - 0x20A0, 0x20Cf, // Currency symbols - }) - rangetable.Visit(unicode.Noncharacter_Code_Point, func(r rune) { - fn(r, BN) // Boundary Neutral - }) - ucd.Parse(gen.OpenUCDFile("DerivedCoreProperties.txt"), func(p *ucd.Parser) { - if p.String(1) == "Default_Ignorable_Code_Point" { - fn(p.Rune(0), BN) // Boundary Neutral - } - }) -} - -func visitRunes(fn func(r rune, c Class), c Class, runes []rune) { - for i := 0; i < len(runes); i += 2 { - lo, hi := runes[i], runes[i+1] - for j := lo; j <= hi; j++ { - fn(j, c) - } - } -} diff --git a/vendor/golang.org/x/text/unicode/bidi/gen_trieval.go b/vendor/golang.org/x/text/unicode/bidi/gen_trieval.go deleted file mode 100644 index 9cb99428..00000000 --- a/vendor/golang.org/x/text/unicode/bidi/gen_trieval.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// Class is the Unicode BiDi class. Each rune has a single class. -type Class uint - -const ( - L Class = iota // LeftToRight - R // RightToLeft - EN // EuropeanNumber - ES // EuropeanSeparator - ET // EuropeanTerminator - AN // ArabicNumber - CS // CommonSeparator - B // ParagraphSeparator - S // SegmentSeparator - WS // WhiteSpace - ON // OtherNeutral - BN // BoundaryNeutral - NSM // NonspacingMark - AL // ArabicLetter - Control // Control LRO - PDI - - numClass - - LRO // LeftToRightOverride - RLO // RightToLeftOverride - LRE // LeftToRightEmbedding - RLE // RightToLeftEmbedding - PDF // PopDirectionalFormat - LRI // LeftToRightIsolate - RLI // RightToLeftIsolate - FSI // FirstStrongIsolate - PDI // PopDirectionalIsolate - - unknownClass = ^Class(0) -) - -var controlToClass = map[rune]Class{ - 0x202D: LRO, // LeftToRightOverride, - 0x202E: RLO, // RightToLeftOverride, - 0x202A: LRE, // LeftToRightEmbedding, - 0x202B: RLE, // RightToLeftEmbedding, - 0x202C: PDF, // PopDirectionalFormat, - 0x2066: LRI, // LeftToRightIsolate, - 0x2067: RLI, // RightToLeftIsolate, - 0x2068: FSI, // FirstStrongIsolate, - 0x2069: PDI, // PopDirectionalIsolate, -} - -// A trie entry has the following bits: -// 7..5 XOR mask for brackets -// 4 1: Bracket open, 0: Bracket close -// 3..0 Class type - -const ( - openMask = 0x10 - xorMaskShift = 5 -) diff --git a/vendor/golang.org/x/text/unicode/norm/maketables.go b/vendor/golang.org/x/text/unicode/norm/maketables.go deleted file mode 100644 index 30a3aa93..00000000 --- a/vendor/golang.org/x/text/unicode/norm/maketables.go +++ /dev/null @@ -1,986 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Normalization table generator. -// Data read from the web. -// See forminfo.go for a description of the trie values associated with each rune. - -package main - -import ( - "bytes" - "encoding/binary" - "flag" - "fmt" - "io" - "log" - "sort" - "strconv" - "strings" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/triegen" - "golang.org/x/text/internal/ucd" -) - -func main() { - gen.Init() - loadUnicodeData() - compactCCC() - loadCompositionExclusions() - completeCharFields(FCanonical) - completeCharFields(FCompatibility) - computeNonStarterCounts() - verifyComputed() - printChars() - testDerived() - printTestdata() - makeTables() -} - -var ( - tablelist = flag.String("tables", - "all", - "comma-separated list of which tables to generate; "+ - "can be 'decomp', 'recomp', 'info' and 'all'") - test = flag.Bool("test", - false, - "test existing tables against DerivedNormalizationProps and generate test data for regression testing") - verbose = flag.Bool("verbose", - false, - "write data to stdout as it is parsed") -) - -const MaxChar = 0x10FFFF // anything above this shouldn't exist - -// Quick Check properties of runes allow us to quickly -// determine whether a rune may occur in a normal form. -// For a given normal form, a rune may be guaranteed to occur -// verbatim (QC=Yes), may or may not combine with another -// rune (QC=Maybe), or may not occur (QC=No). -type QCResult int - -const ( - QCUnknown QCResult = iota - QCYes - QCNo - QCMaybe -) - -func (r QCResult) String() string { - switch r { - case QCYes: - return "Yes" - case QCNo: - return "No" - case QCMaybe: - return "Maybe" - } - return "***UNKNOWN***" -} - -const ( - FCanonical = iota // NFC or NFD - FCompatibility // NFKC or NFKD - FNumberOfFormTypes -) - -const ( - MComposed = iota // NFC or NFKC - MDecomposed // NFD or NFKD - MNumberOfModes -) - -// This contains only the properties we're interested in. -type Char struct { - name string - codePoint rune // if zero, this index is not a valid code point. - ccc uint8 // canonical combining class - origCCC uint8 - excludeInComp bool // from CompositionExclusions.txt - compatDecomp bool // it has a compatibility expansion - - nTrailingNonStarters uint8 - nLeadingNonStarters uint8 // must be equal to trailing if non-zero - - forms [FNumberOfFormTypes]FormInfo // For FCanonical and FCompatibility - - state State -} - -var chars = make([]Char, MaxChar+1) -var cccMap = make(map[uint8]uint8) - -func (c Char) String() string { - buf := new(bytes.Buffer) - - fmt.Fprintf(buf, "%U [%s]:\n", c.codePoint, c.name) - fmt.Fprintf(buf, " ccc: %v\n", c.ccc) - fmt.Fprintf(buf, " excludeInComp: %v\n", c.excludeInComp) - fmt.Fprintf(buf, " compatDecomp: %v\n", c.compatDecomp) - fmt.Fprintf(buf, " state: %v\n", c.state) - fmt.Fprintf(buf, " NFC:\n") - fmt.Fprint(buf, c.forms[FCanonical]) - fmt.Fprintf(buf, " NFKC:\n") - fmt.Fprint(buf, c.forms[FCompatibility]) - - return buf.String() -} - -// In UnicodeData.txt, some ranges are marked like this: -// 3400;;Lo;0;L;;;;;N;;;;; -// 4DB5;;Lo;0;L;;;;;N;;;;; -// parseCharacter keeps a state variable indicating the weirdness. -type State int - -const ( - SNormal State = iota // known to be zero for the type - SFirst - SLast - SMissing -) - -var lastChar = rune('\u0000') - -func (c Char) isValid() bool { - return c.codePoint != 0 && c.state != SMissing -} - -type FormInfo struct { - quickCheck [MNumberOfModes]QCResult // index: MComposed or MDecomposed - verified [MNumberOfModes]bool // index: MComposed or MDecomposed - - combinesForward bool // May combine with rune on the right - combinesBackward bool // May combine with rune on the left - isOneWay bool // Never appears in result - inDecomp bool // Some decompositions result in this char. - decomp Decomposition - expandedDecomp Decomposition -} - -func (f FormInfo) String() string { - buf := bytes.NewBuffer(make([]byte, 0)) - - fmt.Fprintf(buf, " quickCheck[C]: %v\n", f.quickCheck[MComposed]) - fmt.Fprintf(buf, " quickCheck[D]: %v\n", f.quickCheck[MDecomposed]) - fmt.Fprintf(buf, " cmbForward: %v\n", f.combinesForward) - fmt.Fprintf(buf, " cmbBackward: %v\n", f.combinesBackward) - fmt.Fprintf(buf, " isOneWay: %v\n", f.isOneWay) - fmt.Fprintf(buf, " inDecomp: %v\n", f.inDecomp) - fmt.Fprintf(buf, " decomposition: %X\n", f.decomp) - fmt.Fprintf(buf, " expandedDecomp: %X\n", f.expandedDecomp) - - return buf.String() -} - -type Decomposition []rune - -func parseDecomposition(s string, skipfirst bool) (a []rune, err error) { - decomp := strings.Split(s, " ") - if len(decomp) > 0 && skipfirst { - decomp = decomp[1:] - } - for _, d := range decomp { - point, err := strconv.ParseUint(d, 16, 64) - if err != nil { - return a, err - } - a = append(a, rune(point)) - } - return a, nil -} - -func loadUnicodeData() { - f := gen.OpenUCDFile("UnicodeData.txt") - defer f.Close() - p := ucd.New(f) - for p.Next() { - r := p.Rune(ucd.CodePoint) - char := &chars[r] - - char.ccc = uint8(p.Uint(ucd.CanonicalCombiningClass)) - decmap := p.String(ucd.DecompMapping) - - exp, err := parseDecomposition(decmap, false) - isCompat := false - if err != nil { - if len(decmap) > 0 { - exp, err = parseDecomposition(decmap, true) - if err != nil { - log.Fatalf(`%U: bad decomp |%v|: "%s"`, r, decmap, err) - } - isCompat = true - } - } - - char.name = p.String(ucd.Name) - char.codePoint = r - char.forms[FCompatibility].decomp = exp - if !isCompat { - char.forms[FCanonical].decomp = exp - } else { - char.compatDecomp = true - } - if len(decmap) > 0 { - char.forms[FCompatibility].decomp = exp - } - } - if err := p.Err(); err != nil { - log.Fatal(err) - } -} - -// compactCCC converts the sparse set of CCC values to a continguous one, -// reducing the number of bits needed from 8 to 6. -func compactCCC() { - m := make(map[uint8]uint8) - for i := range chars { - c := &chars[i] - m[c.ccc] = 0 - } - cccs := []int{} - for v, _ := range m { - cccs = append(cccs, int(v)) - } - sort.Ints(cccs) - for i, c := range cccs { - cccMap[uint8(i)] = uint8(c) - m[uint8(c)] = uint8(i) - } - for i := range chars { - c := &chars[i] - c.origCCC = c.ccc - c.ccc = m[c.ccc] - } - if len(m) >= 1<<6 { - log.Fatalf("too many difference CCC values: %d >= 64", len(m)) - } -} - -// CompositionExclusions.txt has form: -// 0958 # ... -// See https://unicode.org/reports/tr44/ for full explanation -func loadCompositionExclusions() { - f := gen.OpenUCDFile("CompositionExclusions.txt") - defer f.Close() - p := ucd.New(f) - for p.Next() { - c := &chars[p.Rune(0)] - if c.excludeInComp { - log.Fatalf("%U: Duplicate entry in exclusions.", c.codePoint) - } - c.excludeInComp = true - } - if e := p.Err(); e != nil { - log.Fatal(e) - } -} - -// hasCompatDecomp returns true if any of the recursive -// decompositions contains a compatibility expansion. -// In this case, the character may not occur in NFK*. -func hasCompatDecomp(r rune) bool { - c := &chars[r] - if c.compatDecomp { - return true - } - for _, d := range c.forms[FCompatibility].decomp { - if hasCompatDecomp(d) { - return true - } - } - return false -} - -// Hangul related constants. -const ( - HangulBase = 0xAC00 - HangulEnd = 0xD7A4 // hangulBase + Jamo combinations (19 * 21 * 28) - - JamoLBase = 0x1100 - JamoLEnd = 0x1113 - JamoVBase = 0x1161 - JamoVEnd = 0x1176 - JamoTBase = 0x11A8 - JamoTEnd = 0x11C3 - - JamoLVTCount = 19 * 21 * 28 - JamoTCount = 28 -) - -func isHangul(r rune) bool { - return HangulBase <= r && r < HangulEnd -} - -func isHangulWithoutJamoT(r rune) bool { - if !isHangul(r) { - return false - } - r -= HangulBase - return r < JamoLVTCount && r%JamoTCount == 0 -} - -func ccc(r rune) uint8 { - return chars[r].ccc -} - -// Insert a rune in a buffer, ordered by Canonical Combining Class. -func insertOrdered(b Decomposition, r rune) Decomposition { - n := len(b) - b = append(b, 0) - cc := ccc(r) - if cc > 0 { - // Use bubble sort. - for ; n > 0; n-- { - if ccc(b[n-1]) <= cc { - break - } - b[n] = b[n-1] - } - } - b[n] = r - return b -} - -// Recursively decompose. -func decomposeRecursive(form int, r rune, d Decomposition) Decomposition { - dcomp := chars[r].forms[form].decomp - if len(dcomp) == 0 { - return insertOrdered(d, r) - } - for _, c := range dcomp { - d = decomposeRecursive(form, c, d) - } - return d -} - -func completeCharFields(form int) { - // Phase 0: pre-expand decomposition. - for i := range chars { - f := &chars[i].forms[form] - if len(f.decomp) == 0 { - continue - } - exp := make(Decomposition, 0) - for _, c := range f.decomp { - exp = decomposeRecursive(form, c, exp) - } - f.expandedDecomp = exp - } - - // Phase 1: composition exclusion, mark decomposition. - for i := range chars { - c := &chars[i] - f := &c.forms[form] - - // Marks script-specific exclusions and version restricted. - f.isOneWay = c.excludeInComp - - // Singletons - f.isOneWay = f.isOneWay || len(f.decomp) == 1 - - // Non-starter decompositions - if len(f.decomp) > 1 { - chk := c.ccc != 0 || chars[f.decomp[0]].ccc != 0 - f.isOneWay = f.isOneWay || chk - } - - // Runes that decompose into more than two runes. - f.isOneWay = f.isOneWay || len(f.decomp) > 2 - - if form == FCompatibility { - f.isOneWay = f.isOneWay || hasCompatDecomp(c.codePoint) - } - - for _, r := range f.decomp { - chars[r].forms[form].inDecomp = true - } - } - - // Phase 2: forward and backward combining. - for i := range chars { - c := &chars[i] - f := &c.forms[form] - - if !f.isOneWay && len(f.decomp) == 2 { - f0 := &chars[f.decomp[0]].forms[form] - f1 := &chars[f.decomp[1]].forms[form] - if !f0.isOneWay { - f0.combinesForward = true - } - if !f1.isOneWay { - f1.combinesBackward = true - } - } - if isHangulWithoutJamoT(rune(i)) { - f.combinesForward = true - } - } - - // Phase 3: quick check values. - for i := range chars { - c := &chars[i] - f := &c.forms[form] - - switch { - case len(f.decomp) > 0: - f.quickCheck[MDecomposed] = QCNo - case isHangul(rune(i)): - f.quickCheck[MDecomposed] = QCNo - default: - f.quickCheck[MDecomposed] = QCYes - } - switch { - case f.isOneWay: - f.quickCheck[MComposed] = QCNo - case (i & 0xffff00) == JamoLBase: - f.quickCheck[MComposed] = QCYes - if JamoLBase <= i && i < JamoLEnd { - f.combinesForward = true - } - if JamoVBase <= i && i < JamoVEnd { - f.quickCheck[MComposed] = QCMaybe - f.combinesBackward = true - f.combinesForward = true - } - if JamoTBase <= i && i < JamoTEnd { - f.quickCheck[MComposed] = QCMaybe - f.combinesBackward = true - } - case !f.combinesBackward: - f.quickCheck[MComposed] = QCYes - default: - f.quickCheck[MComposed] = QCMaybe - } - } -} - -func computeNonStarterCounts() { - // Phase 4: leading and trailing non-starter count - for i := range chars { - c := &chars[i] - - runes := []rune{rune(i)} - // We always use FCompatibility so that the CGJ insertion points do not - // change for repeated normalizations with different forms. - if exp := c.forms[FCompatibility].expandedDecomp; len(exp) > 0 { - runes = exp - } - // We consider runes that combine backwards to be non-starters for the - // purpose of Stream-Safe Text Processing. - for _, r := range runes { - if cr := &chars[r]; cr.ccc == 0 && !cr.forms[FCompatibility].combinesBackward { - break - } - c.nLeadingNonStarters++ - } - for i := len(runes) - 1; i >= 0; i-- { - if cr := &chars[runes[i]]; cr.ccc == 0 && !cr.forms[FCompatibility].combinesBackward { - break - } - c.nTrailingNonStarters++ - } - if c.nTrailingNonStarters > 3 { - log.Fatalf("%U: Decomposition with more than 3 (%d) trailing modifiers (%U)", i, c.nTrailingNonStarters, runes) - } - - if isHangul(rune(i)) { - c.nTrailingNonStarters = 2 - if isHangulWithoutJamoT(rune(i)) { - c.nTrailingNonStarters = 1 - } - } - - if l, t := c.nLeadingNonStarters, c.nTrailingNonStarters; l > 0 && l != t { - log.Fatalf("%U: number of leading and trailing non-starters should be equal (%d vs %d)", i, l, t) - } - if t := c.nTrailingNonStarters; t > 3 { - log.Fatalf("%U: number of trailing non-starters is %d > 3", t) - } - } -} - -func printBytes(w io.Writer, b []byte, name string) { - fmt.Fprintf(w, "// %s: %d bytes\n", name, len(b)) - fmt.Fprintf(w, "var %s = [...]byte {", name) - for i, c := range b { - switch { - case i%64 == 0: - fmt.Fprintf(w, "\n// Bytes %x - %x\n", i, i+63) - case i%8 == 0: - fmt.Fprintf(w, "\n") - } - fmt.Fprintf(w, "0x%.2X, ", c) - } - fmt.Fprint(w, "\n}\n\n") -} - -// See forminfo.go for format. -func makeEntry(f *FormInfo, c *Char) uint16 { - e := uint16(0) - if r := c.codePoint; HangulBase <= r && r < HangulEnd { - e |= 0x40 - } - if f.combinesForward { - e |= 0x20 - } - if f.quickCheck[MDecomposed] == QCNo { - e |= 0x4 - } - switch f.quickCheck[MComposed] { - case QCYes: - case QCNo: - e |= 0x10 - case QCMaybe: - e |= 0x18 - default: - log.Fatalf("Illegal quickcheck value %v.", f.quickCheck[MComposed]) - } - e |= uint16(c.nTrailingNonStarters) - return e -} - -// decompSet keeps track of unique decompositions, grouped by whether -// the decomposition is followed by a trailing and/or leading CCC. -type decompSet [7]map[string]bool - -const ( - normalDecomp = iota - firstMulti - firstCCC - endMulti - firstLeadingCCC - firstCCCZeroExcept - firstStarterWithNLead - lastDecomp -) - -var cname = []string{"firstMulti", "firstCCC", "endMulti", "firstLeadingCCC", "firstCCCZeroExcept", "firstStarterWithNLead", "lastDecomp"} - -func makeDecompSet() decompSet { - m := decompSet{} - for i := range m { - m[i] = make(map[string]bool) - } - return m -} -func (m *decompSet) insert(key int, s string) { - m[key][s] = true -} - -func printCharInfoTables(w io.Writer) int { - mkstr := func(r rune, f *FormInfo) (int, string) { - d := f.expandedDecomp - s := string([]rune(d)) - if max := 1 << 6; len(s) >= max { - const msg = "%U: too many bytes in decomposition: %d >= %d" - log.Fatalf(msg, r, len(s), max) - } - head := uint8(len(s)) - if f.quickCheck[MComposed] != QCYes { - head |= 0x40 - } - if f.combinesForward { - head |= 0x80 - } - s = string([]byte{head}) + s - - lccc := ccc(d[0]) - tccc := ccc(d[len(d)-1]) - cc := ccc(r) - if cc != 0 && lccc == 0 && tccc == 0 { - log.Fatalf("%U: trailing and leading ccc are 0 for non-zero ccc %d", r, cc) - } - if tccc < lccc && lccc != 0 { - const msg = "%U: lccc (%d) must be <= tcc (%d)" - log.Fatalf(msg, r, lccc, tccc) - } - index := normalDecomp - nTrail := chars[r].nTrailingNonStarters - nLead := chars[r].nLeadingNonStarters - if tccc > 0 || lccc > 0 || nTrail > 0 { - tccc <<= 2 - tccc |= nTrail - s += string([]byte{tccc}) - index = endMulti - for _, r := range d[1:] { - if ccc(r) == 0 { - index = firstCCC - } - } - if lccc > 0 || nLead > 0 { - s += string([]byte{lccc}) - if index == firstCCC { - log.Fatalf("%U: multi-segment decomposition not supported for decompositions with leading CCC != 0", r) - } - index = firstLeadingCCC - } - if cc != lccc { - if cc != 0 { - log.Fatalf("%U: for lccc != ccc, expected ccc to be 0; was %d", r, cc) - } - index = firstCCCZeroExcept - } - } else if len(d) > 1 { - index = firstMulti - } - return index, s - } - - decompSet := makeDecompSet() - const nLeadStr = "\x00\x01" // 0-byte length and tccc with nTrail. - decompSet.insert(firstStarterWithNLead, nLeadStr) - - // Store the uniqued decompositions in a byte buffer, - // preceded by their byte length. - for _, c := range chars { - for _, f := range c.forms { - if len(f.expandedDecomp) == 0 { - continue - } - if f.combinesBackward { - log.Fatalf("%U: combinesBackward and decompose", c.codePoint) - } - index, s := mkstr(c.codePoint, &f) - decompSet.insert(index, s) - } - } - - decompositions := bytes.NewBuffer(make([]byte, 0, 10000)) - size := 0 - positionMap := make(map[string]uint16) - decompositions.WriteString("\000") - fmt.Fprintln(w, "const (") - for i, m := range decompSet { - sa := []string{} - for s := range m { - sa = append(sa, s) - } - sort.Strings(sa) - for _, s := range sa { - p := decompositions.Len() - decompositions.WriteString(s) - positionMap[s] = uint16(p) - } - if cname[i] != "" { - fmt.Fprintf(w, "%s = 0x%X\n", cname[i], decompositions.Len()) - } - } - fmt.Fprintln(w, "maxDecomp = 0x8000") - fmt.Fprintln(w, ")") - b := decompositions.Bytes() - printBytes(w, b, "decomps") - size += len(b) - - varnames := []string{"nfc", "nfkc"} - for i := 0; i < FNumberOfFormTypes; i++ { - trie := triegen.NewTrie(varnames[i]) - - for r, c := range chars { - f := c.forms[i] - d := f.expandedDecomp - if len(d) != 0 { - _, key := mkstr(c.codePoint, &f) - trie.Insert(rune(r), uint64(positionMap[key])) - if c.ccc != ccc(d[0]) { - // We assume the lead ccc of a decomposition !=0 in this case. - if ccc(d[0]) == 0 { - log.Fatalf("Expected leading CCC to be non-zero; ccc is %d", c.ccc) - } - } - } else if c.nLeadingNonStarters > 0 && len(f.expandedDecomp) == 0 && c.ccc == 0 && !f.combinesBackward { - // Handle cases where it can't be detected that the nLead should be equal - // to nTrail. - trie.Insert(c.codePoint, uint64(positionMap[nLeadStr])) - } else if v := makeEntry(&f, &c)<<8 | uint16(c.ccc); v != 0 { - trie.Insert(c.codePoint, uint64(0x8000|v)) - } - } - sz, err := trie.Gen(w, triegen.Compact(&normCompacter{name: varnames[i]})) - if err != nil { - log.Fatal(err) - } - size += sz - } - return size -} - -func contains(sa []string, s string) bool { - for _, a := range sa { - if a == s { - return true - } - } - return false -} - -func makeTables() { - w := &bytes.Buffer{} - - size := 0 - if *tablelist == "" { - return - } - list := strings.Split(*tablelist, ",") - if *tablelist == "all" { - list = []string{"recomp", "info"} - } - - // Compute maximum decomposition size. - max := 0 - for _, c := range chars { - if n := len(string(c.forms[FCompatibility].expandedDecomp)); n > max { - max = n - } - } - fmt.Fprintln(w, `import "sync"`) - fmt.Fprintln(w) - - fmt.Fprintln(w, "const (") - fmt.Fprintln(w, "\t// Version is the Unicode edition from which the tables are derived.") - fmt.Fprintf(w, "\tVersion = %q\n", gen.UnicodeVersion()) - fmt.Fprintln(w) - fmt.Fprintln(w, "\t// MaxTransformChunkSize indicates the maximum number of bytes that Transform") - fmt.Fprintln(w, "\t// may need to write atomically for any Form. Making a destination buffer at") - fmt.Fprintln(w, "\t// least this size ensures that Transform can always make progress and that") - fmt.Fprintln(w, "\t// the user does not need to grow the buffer on an ErrShortDst.") - fmt.Fprintf(w, "\tMaxTransformChunkSize = %d+maxNonStarters*4\n", len(string(0x034F))+max) - fmt.Fprintln(w, ")\n") - - // Print the CCC remap table. - size += len(cccMap) - fmt.Fprintf(w, "var ccc = [%d]uint8{", len(cccMap)) - for i := 0; i < len(cccMap); i++ { - if i%8 == 0 { - fmt.Fprintln(w) - } - fmt.Fprintf(w, "%3d, ", cccMap[uint8(i)]) - } - fmt.Fprintln(w, "\n}\n") - - if contains(list, "info") { - size += printCharInfoTables(w) - } - - if contains(list, "recomp") { - // Note that we use 32 bit keys, instead of 64 bit. - // This clips the bits of three entries, but we know - // this won't cause a collision. The compiler will catch - // any changes made to UnicodeData.txt that introduces - // a collision. - // Note that the recomposition map for NFC and NFKC - // are identical. - - // Recomposition map - nrentries := 0 - for _, c := range chars { - f := c.forms[FCanonical] - if !f.isOneWay && len(f.decomp) > 0 { - nrentries++ - } - } - sz := nrentries * 8 - size += sz - fmt.Fprintf(w, "// recompMap: %d bytes (entries only)\n", sz) - fmt.Fprintln(w, "var recompMap map[uint32]rune") - fmt.Fprintln(w, "var recompMapOnce sync.Once\n") - fmt.Fprintln(w, `const recompMapPacked = "" +`) - var buf [8]byte - for i, c := range chars { - f := c.forms[FCanonical] - d := f.decomp - if !f.isOneWay && len(d) > 0 { - key := uint32(uint16(d[0]))<<16 + uint32(uint16(d[1])) - binary.BigEndian.PutUint32(buf[:4], key) - binary.BigEndian.PutUint32(buf[4:], uint32(i)) - fmt.Fprintf(w, "\t\t%q + // 0x%.8X: 0x%.8X\n", string(buf[:]), key, uint32(i)) - } - } - // hack so we don't have to special case the trailing plus sign - fmt.Fprintf(w, ` ""`) - fmt.Fprintln(w) - } - - fmt.Fprintf(w, "// Total size of tables: %dKB (%d bytes)\n", (size+512)/1024, size) - gen.WriteVersionedGoFile("tables.go", "norm", w.Bytes()) -} - -func printChars() { - if *verbose { - for _, c := range chars { - if !c.isValid() || c.state == SMissing { - continue - } - fmt.Println(c) - } - } -} - -// verifyComputed does various consistency tests. -func verifyComputed() { - for i, c := range chars { - for _, f := range c.forms { - isNo := (f.quickCheck[MDecomposed] == QCNo) - if (len(f.decomp) > 0) != isNo && !isHangul(rune(i)) { - log.Fatalf("%U: NF*D QC must be No if rune decomposes", i) - } - - isMaybe := f.quickCheck[MComposed] == QCMaybe - if f.combinesBackward != isMaybe { - log.Fatalf("%U: NF*C QC must be Maybe if combinesBackward", i) - } - if len(f.decomp) > 0 && f.combinesForward && isMaybe { - log.Fatalf("%U: NF*C QC must be Yes or No if combinesForward and decomposes", i) - } - - if len(f.expandedDecomp) != 0 { - continue - } - if a, b := c.nLeadingNonStarters > 0, (c.ccc > 0 || f.combinesBackward); a != b { - // We accept these runes to be treated differently (it only affects - // segment breaking in iteration, most likely on improper use), but - // reconsider if more characters are added. - // U+FF9E HALFWIDTH KATAKANA VOICED SOUND MARK;Lm;0;L; 3099;;;;N;;;;; - // U+FF9F HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK;Lm;0;L; 309A;;;;N;;;;; - // U+3133 HANGUL LETTER KIYEOK-SIOS;Lo;0;L; 11AA;;;;N;HANGUL LETTER GIYEOG SIOS;;;; - // U+318E HANGUL LETTER ARAEAE;Lo;0;L; 11A1;;;;N;HANGUL LETTER ALAE AE;;;; - // U+FFA3 HALFWIDTH HANGUL LETTER KIYEOK-SIOS;Lo;0;L; 3133;;;;N;HALFWIDTH HANGUL LETTER GIYEOG SIOS;;;; - // U+FFDC HALFWIDTH HANGUL LETTER I;Lo;0;L; 3163;;;;N;;;;; - if i != 0xFF9E && i != 0xFF9F && !(0x3133 <= i && i <= 0x318E) && !(0xFFA3 <= i && i <= 0xFFDC) { - log.Fatalf("%U: nLead was %v; want %v", i, a, b) - } - } - } - nfc := c.forms[FCanonical] - nfkc := c.forms[FCompatibility] - if nfc.combinesBackward != nfkc.combinesBackward { - log.Fatalf("%U: Cannot combine combinesBackward\n", c.codePoint) - } - } -} - -// Use values in DerivedNormalizationProps.txt to compare against the -// values we computed. -// DerivedNormalizationProps.txt has form: -// 00C0..00C5 ; NFD_QC; N # ... -// 0374 ; NFD_QC; N # ... -// See https://unicode.org/reports/tr44/ for full explanation -func testDerived() { - f := gen.OpenUCDFile("DerivedNormalizationProps.txt") - defer f.Close() - p := ucd.New(f) - for p.Next() { - r := p.Rune(0) - c := &chars[r] - - var ftype, mode int - qt := p.String(1) - switch qt { - case "NFC_QC": - ftype, mode = FCanonical, MComposed - case "NFD_QC": - ftype, mode = FCanonical, MDecomposed - case "NFKC_QC": - ftype, mode = FCompatibility, MComposed - case "NFKD_QC": - ftype, mode = FCompatibility, MDecomposed - default: - continue - } - var qr QCResult - switch p.String(2) { - case "Y": - qr = QCYes - case "N": - qr = QCNo - case "M": - qr = QCMaybe - default: - log.Fatalf(`Unexpected quick check value "%s"`, p.String(2)) - } - if got := c.forms[ftype].quickCheck[mode]; got != qr { - log.Printf("%U: FAILED %s (was %v need %v)\n", r, qt, got, qr) - } - c.forms[ftype].verified[mode] = true - } - if err := p.Err(); err != nil { - log.Fatal(err) - } - // Any unspecified value must be QCYes. Verify this. - for i, c := range chars { - for j, fd := range c.forms { - for k, qr := range fd.quickCheck { - if !fd.verified[k] && qr != QCYes { - m := "%U: FAIL F:%d M:%d (was %v need Yes) %s\n" - log.Printf(m, i, j, k, qr, c.name) - } - } - } - } -} - -var testHeader = `const ( - Yes = iota - No - Maybe -) - -type formData struct { - qc uint8 - combinesForward bool - decomposition string -} - -type runeData struct { - r rune - ccc uint8 - nLead uint8 - nTrail uint8 - f [2]formData // 0: canonical; 1: compatibility -} - -func f(qc uint8, cf bool, dec string) [2]formData { - return [2]formData{{qc, cf, dec}, {qc, cf, dec}} -} - -func g(qc, qck uint8, cf, cfk bool, d, dk string) [2]formData { - return [2]formData{{qc, cf, d}, {qck, cfk, dk}} -} - -var testData = []runeData{ -` - -func printTestdata() { - type lastInfo struct { - ccc uint8 - nLead uint8 - nTrail uint8 - f string - } - - last := lastInfo{} - w := &bytes.Buffer{} - fmt.Fprintf(w, testHeader) - for r, c := range chars { - f := c.forms[FCanonical] - qc, cf, d := f.quickCheck[MComposed], f.combinesForward, string(f.expandedDecomp) - f = c.forms[FCompatibility] - qck, cfk, dk := f.quickCheck[MComposed], f.combinesForward, string(f.expandedDecomp) - s := "" - if d == dk && qc == qck && cf == cfk { - s = fmt.Sprintf("f(%s, %v, %q)", qc, cf, d) - } else { - s = fmt.Sprintf("g(%s, %s, %v, %v, %q, %q)", qc, qck, cf, cfk, d, dk) - } - current := lastInfo{c.ccc, c.nLeadingNonStarters, c.nTrailingNonStarters, s} - if last != current { - fmt.Fprintf(w, "\t{0x%x, %d, %d, %d, %s},\n", r, c.origCCC, c.nLeadingNonStarters, c.nTrailingNonStarters, s) - last = current - } - } - fmt.Fprintln(w, "}") - gen.WriteVersionedGoFile("data_test.go", "norm", w.Bytes()) -} diff --git a/vendor/golang.org/x/text/unicode/norm/triegen.go b/vendor/golang.org/x/text/unicode/norm/triegen.go deleted file mode 100644 index 45d71190..00000000 --- a/vendor/golang.org/x/text/unicode/norm/triegen.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Trie table generator. -// Used by make*tables tools to generate a go file with trie data structures -// for mapping UTF-8 to a 16-bit value. All but the last byte in a UTF-8 byte -// sequence are used to lookup offsets in the index table to be used for the -// next byte. The last byte is used to index into a table with 16-bit values. - -package main - -import ( - "fmt" - "io" -) - -const maxSparseEntries = 16 - -type normCompacter struct { - sparseBlocks [][]uint64 - sparseOffset []uint16 - sparseCount int - name string -} - -func mostFrequentStride(a []uint64) int { - counts := make(map[int]int) - var v int - for _, x := range a { - if stride := int(x) - v; v != 0 && stride >= 0 { - counts[stride]++ - } - v = int(x) - } - var maxs, maxc int - for stride, cnt := range counts { - if cnt > maxc || (cnt == maxc && stride < maxs) { - maxs, maxc = stride, cnt - } - } - return maxs -} - -func countSparseEntries(a []uint64) int { - stride := mostFrequentStride(a) - var v, count int - for _, tv := range a { - if int(tv)-v != stride { - if tv != 0 { - count++ - } - } - v = int(tv) - } - return count -} - -func (c *normCompacter) Size(v []uint64) (sz int, ok bool) { - if n := countSparseEntries(v); n <= maxSparseEntries { - return (n+1)*4 + 2, true - } - return 0, false -} - -func (c *normCompacter) Store(v []uint64) uint32 { - h := uint32(len(c.sparseOffset)) - c.sparseBlocks = append(c.sparseBlocks, v) - c.sparseOffset = append(c.sparseOffset, uint16(c.sparseCount)) - c.sparseCount += countSparseEntries(v) + 1 - return h -} - -func (c *normCompacter) Handler() string { - return c.name + "Sparse.lookup" -} - -func (c *normCompacter) Print(w io.Writer) (retErr error) { - p := func(f string, x ...interface{}) { - if _, err := fmt.Fprintf(w, f, x...); retErr == nil && err != nil { - retErr = err - } - } - - ls := len(c.sparseBlocks) - p("// %sSparseOffset: %d entries, %d bytes\n", c.name, ls, ls*2) - p("var %sSparseOffset = %#v\n\n", c.name, c.sparseOffset) - - ns := c.sparseCount - p("// %sSparseValues: %d entries, %d bytes\n", c.name, ns, ns*4) - p("var %sSparseValues = [%d]valueRange {", c.name, ns) - for i, b := range c.sparseBlocks { - p("\n// Block %#x, offset %#x", i, c.sparseOffset[i]) - var v int - stride := mostFrequentStride(b) - n := countSparseEntries(b) - p("\n{value:%#04x,lo:%#02x},", stride, uint8(n)) - for i, nv := range b { - if int(nv)-v != stride { - if v != 0 { - p(",hi:%#02x},", 0x80+i-1) - } - if nv != 0 { - p("\n{value:%#04x,lo:%#02x", nv, 0x80+i) - } - } - v = int(nv) - } - if v != 0 { - p(",hi:%#02x},", 0x80+len(b)-1) - } - } - p("\n}\n\n") - return -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 4db62310..8e11b540 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -2,45 +2,47 @@ cloud.google.com/go/compute/metadata # github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30 github.com/appscode/jsonpatch -# github.com/aws/aws-sdk-go v1.20.19 -github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface +# github.com/aws/aws-sdk-go v1.26.2 github.com/aws/aws-sdk-go/aws github.com/aws/aws-sdk-go/aws/awserr -github.com/aws/aws-sdk-go/aws/ec2metadata -github.com/aws/aws-sdk-go/aws/session -github.com/aws/aws-sdk-go/service/autoscaling -github.com/aws/aws-sdk-go/service/cloudformation -github.com/aws/aws-sdk-go/service/cloudformation/cloudformationiface -github.com/aws/aws-sdk-go/service/eks -github.com/aws/aws-sdk-go/service/eks/eksiface -github.com/aws/aws-sdk-go/aws/request -github.com/aws/aws-sdk-go/aws/credentials -github.com/aws/aws-sdk-go/aws/endpoints -github.com/aws/aws-sdk-go/internal/sdkio +github.com/aws/aws-sdk-go/aws/awsutil github.com/aws/aws-sdk-go/aws/client github.com/aws/aws-sdk-go/aws/client/metadata github.com/aws/aws-sdk-go/aws/corehandlers -github.com/aws/aws-sdk-go/internal/sdkuri +github.com/aws/aws-sdk-go/aws/credentials +github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds +github.com/aws/aws-sdk-go/aws/credentials/endpointcreds github.com/aws/aws-sdk-go/aws/credentials/processcreds github.com/aws/aws-sdk-go/aws/credentials/stscreds github.com/aws/aws-sdk-go/aws/csm github.com/aws/aws-sdk-go/aws/defaults +github.com/aws/aws-sdk-go/aws/ec2metadata +github.com/aws/aws-sdk-go/aws/endpoints +github.com/aws/aws-sdk-go/aws/request +github.com/aws/aws-sdk-go/aws/session +github.com/aws/aws-sdk-go/aws/signer/v4 github.com/aws/aws-sdk-go/internal/ini +github.com/aws/aws-sdk-go/internal/sdkio +github.com/aws/aws-sdk-go/internal/sdkmath +github.com/aws/aws-sdk-go/internal/sdkrand +github.com/aws/aws-sdk-go/internal/sdkuri github.com/aws/aws-sdk-go/internal/shareddefaults -github.com/aws/aws-sdk-go/aws/awsutil -github.com/aws/aws-sdk-go/aws/signer/v4 github.com/aws/aws-sdk-go/private/protocol +github.com/aws/aws-sdk-go/private/protocol/json/jsonutil +github.com/aws/aws-sdk-go/private/protocol/jsonrpc github.com/aws/aws-sdk-go/private/protocol/query -github.com/aws/aws-sdk-go/private/protocol/restjson -github.com/aws/aws-sdk-go/internal/sdkrand -github.com/aws/aws-sdk-go/service/sts -github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds -github.com/aws/aws-sdk-go/aws/credentials/endpointcreds -github.com/aws/aws-sdk-go/private/protocol/rest github.com/aws/aws-sdk-go/private/protocol/query/queryutil +github.com/aws/aws-sdk-go/private/protocol/rest +github.com/aws/aws-sdk-go/private/protocol/restjson github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil -github.com/aws/aws-sdk-go/private/protocol/json/jsonutil -github.com/aws/aws-sdk-go/private/protocol/jsonrpc +github.com/aws/aws-sdk-go/service/autoscaling +github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface +github.com/aws/aws-sdk-go/service/cloudformation +github.com/aws/aws-sdk-go/service/cloudformation/cloudformationiface +github.com/aws/aws-sdk-go/service/eks +github.com/aws/aws-sdk-go/service/eks/eksiface +github.com/aws/aws-sdk-go/service/sts +github.com/aws/aws-sdk-go/service/sts/stsiface # github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 github.com/beorn7/perks/quantile # github.com/davecgh/go-spew v1.1.1 @@ -60,8 +62,8 @@ github.com/gogo/protobuf/sortkeys github.com/golang/groupcache/lru # github.com/golang/protobuf v1.3.2 github.com/golang/protobuf/proto -github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes +github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp # github.com/google/gofuzz v1.0.0 @@ -97,57 +99,57 @@ github.com/modern-go/concurrent github.com/modern-go/reflect2 # github.com/onsi/ginkgo v1.8.0 github.com/onsi/ginkgo -github.com/onsi/ginkgo/reporters github.com/onsi/ginkgo/config github.com/onsi/ginkgo/internal/codelocation +github.com/onsi/ginkgo/internal/containernode github.com/onsi/ginkgo/internal/failer +github.com/onsi/ginkgo/internal/leafnodes github.com/onsi/ginkgo/internal/remote +github.com/onsi/ginkgo/internal/spec +github.com/onsi/ginkgo/internal/spec_iterator +github.com/onsi/ginkgo/internal/specrunner github.com/onsi/ginkgo/internal/suite github.com/onsi/ginkgo/internal/testingtproxy github.com/onsi/ginkgo/internal/writer +github.com/onsi/ginkgo/reporters github.com/onsi/ginkgo/reporters/stenographer github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable -github.com/onsi/ginkgo/types -github.com/onsi/ginkgo/internal/spec_iterator -github.com/onsi/ginkgo/internal/containernode -github.com/onsi/ginkgo/internal/leafnodes -github.com/onsi/ginkgo/internal/spec -github.com/onsi/ginkgo/internal/specrunner github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty +github.com/onsi/ginkgo/types # github.com/onsi/gomega v1.6.0 github.com/onsi/gomega +github.com/onsi/gomega/format +github.com/onsi/gomega/gbytes +github.com/onsi/gomega/gexec github.com/onsi/gomega/internal/assertion github.com/onsi/gomega/internal/asyncassertion +github.com/onsi/gomega/internal/oraclematcher github.com/onsi/gomega/internal/testingtsupport github.com/onsi/gomega/matchers -github.com/onsi/gomega/types -github.com/onsi/gomega/internal/oraclematcher -github.com/onsi/gomega/format github.com/onsi/gomega/matchers/support/goraph/bipartitegraph github.com/onsi/gomega/matchers/support/goraph/edge github.com/onsi/gomega/matchers/support/goraph/node github.com/onsi/gomega/matchers/support/goraph/util -github.com/onsi/gomega/gbytes -github.com/onsi/gomega/gexec +github.com/onsi/gomega/types # github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c github.com/pborman/uuid # github.com/pkg/errors v0.8.1 github.com/pkg/errors # github.com/prometheus/client_golang v0.9.0 -github.com/prometheus/client_golang/prometheus/promhttp github.com/prometheus/client_golang/prometheus github.com/prometheus/client_golang/prometheus/internal +github.com/prometheus/client_golang/prometheus/promhttp # github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 github.com/prometheus/client_model/go # github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e github.com/prometheus/common/expfmt -github.com/prometheus/common/model github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg +github.com/prometheus/common/model # github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273 github.com/prometheus/procfs +github.com/prometheus/procfs/internal/util github.com/prometheus/procfs/nfs github.com/prometheus/procfs/xfs -github.com/prometheus/procfs/internal/util # github.com/sirupsen/logrus v1.4.2 github.com/sirupsen/logrus # github.com/spf13/pflag v1.0.3 @@ -159,22 +161,22 @@ go.uber.org/multierr # go.uber.org/zap v1.9.1 go.uber.org/zap go.uber.org/zap/buffer -go.uber.org/zap/zapcore go.uber.org/zap/internal/bufferpool go.uber.org/zap/internal/color go.uber.org/zap/internal/exit +go.uber.org/zap/zapcore # golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 golang.org/x/crypto/ssh/terminal # golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 golang.org/x/net/context -golang.org/x/net/http2 -golang.org/x/net/http/httpguts -golang.org/x/net/http2/hpack -golang.org/x/net/idna golang.org/x/net/context/ctxhttp -golang.org/x/net/html/charset golang.org/x/net/html golang.org/x/net/html/atom +golang.org/x/net/html/charset +golang.org/x/net/http/httpguts +golang.org/x/net/http2 +golang.org/x/net/http2/hpack +golang.org/x/net/idna # golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 golang.org/x/oauth2 golang.org/x/oauth2/google @@ -185,39 +187,39 @@ golang.org/x/oauth2/jwt golang.org/x/sys/unix golang.org/x/sys/windows # golang.org/x/text v0.3.2 -golang.org/x/text/secure/bidirule -golang.org/x/text/unicode/bidi -golang.org/x/text/unicode/norm golang.org/x/text/encoding golang.org/x/text/encoding/charmap golang.org/x/text/encoding/htmlindex -golang.org/x/text/transform -golang.org/x/text/encoding/internal/identifier golang.org/x/text/encoding/internal +golang.org/x/text/encoding/internal/identifier golang.org/x/text/encoding/japanese golang.org/x/text/encoding/korean golang.org/x/text/encoding/simplifiedchinese golang.org/x/text/encoding/traditionalchinese golang.org/x/text/encoding/unicode -golang.org/x/text/language -golang.org/x/text/internal/utf8internal -golang.org/x/text/runes golang.org/x/text/internal/language golang.org/x/text/internal/language/compact golang.org/x/text/internal/tag +golang.org/x/text/internal/utf8internal +golang.org/x/text/language +golang.org/x/text/runes +golang.org/x/text/secure/bidirule +golang.org/x/text/transform +golang.org/x/text/unicode/bidi +golang.org/x/text/unicode/norm # golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 golang.org/x/time/rate # google.golang.org/appengine v1.5.0 google.golang.org/appengine -google.golang.org/appengine/urlfetch google.golang.org/appengine/internal google.golang.org/appengine/internal/app_identity -google.golang.org/appengine/internal/modules -google.golang.org/appengine/internal/urlfetch google.golang.org/appengine/internal/base google.golang.org/appengine/internal/datastore google.golang.org/appengine/internal/log +google.golang.org/appengine/internal/modules google.golang.org/appengine/internal/remote_api +google.golang.org/appengine/internal/urlfetch +google.golang.org/appengine/urlfetch # gopkg.in/fsnotify.v1 v1.4.7 gopkg.in/fsnotify.v1 # gopkg.in/inf.v0 v0.9.1 @@ -227,7 +229,7 @@ gopkg.in/tomb.v1 # gopkg.in/yaml.v2 v2.2.2 gopkg.in/yaml.v2 # k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b -k8s.io/api/core/v1 +k8s.io/api/admission/v1beta1 k8s.io/api/admissionregistration/v1beta1 k8s.io/api/apps/v1 k8s.io/api/apps/v1beta1 @@ -246,6 +248,7 @@ k8s.io/api/batch/v2alpha1 k8s.io/api/certificates/v1beta1 k8s.io/api/coordination/v1 k8s.io/api/coordination/v1beta1 +k8s.io/api/core/v1 k8s.io/api/events/v1beta1 k8s.io/api/extensions/v1beta1 k8s.io/api/networking/v1 @@ -263,216 +266,215 @@ k8s.io/api/settings/v1alpha1 k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 -k8s.io/api/admission/v1beta1 # k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8 +k8s.io/apiextensions-apiserver/pkg/apis/apiextensions k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1 k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset -k8s.io/apiextensions-apiserver/pkg/apis/apiextensions -k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1 k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme +k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1 # k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d -k8s.io/apimachinery/pkg/runtime -k8s.io/apimachinery/pkg/apis/meta/v1 -k8s.io/apimachinery/pkg/runtime/schema k8s.io/apimachinery/pkg/api/errors -k8s.io/apimachinery/pkg/apis/meta/v1/unstructured -k8s.io/apimachinery/pkg/types -k8s.io/apimachinery/pkg/util/json -k8s.io/apimachinery/pkg/util/yaml +k8s.io/apimachinery/pkg/api/meta k8s.io/apimachinery/pkg/api/resource -k8s.io/apimachinery/pkg/util/intstr +k8s.io/apimachinery/pkg/apis/meta/internalversion +k8s.io/apimachinery/pkg/apis/meta/v1 +k8s.io/apimachinery/pkg/apis/meta/v1/unstructured +k8s.io/apimachinery/pkg/apis/meta/v1beta1 k8s.io/apimachinery/pkg/conversion k8s.io/apimachinery/pkg/conversion/queryparams -k8s.io/apimachinery/pkg/util/errors -k8s.io/apimachinery/pkg/util/naming -k8s.io/apimachinery/pkg/util/runtime -k8s.io/apimachinery/pkg/util/sets -k8s.io/apimachinery/pkg/util/net -k8s.io/apimachinery/pkg/api/meta k8s.io/apimachinery/pkg/fields k8s.io/apimachinery/pkg/labels -k8s.io/apimachinery/pkg/selection -k8s.io/apimachinery/pkg/watch -k8s.io/apimachinery/pkg/util/validation/field +k8s.io/apimachinery/pkg/runtime +k8s.io/apimachinery/pkg/runtime/schema k8s.io/apimachinery/pkg/runtime/serializer k8s.io/apimachinery/pkg/runtime/serializer/json -k8s.io/apimachinery/pkg/runtime/serializer/streaming -k8s.io/apimachinery/pkg/runtime/serializer/versioning -k8s.io/apimachinery/pkg/util/validation -k8s.io/apimachinery/third_party/forked/golang/reflect -k8s.io/apimachinery/pkg/apis/meta/v1beta1 -k8s.io/apimachinery/pkg/util/wait k8s.io/apimachinery/pkg/runtime/serializer/protobuf k8s.io/apimachinery/pkg/runtime/serializer/recognizer +k8s.io/apimachinery/pkg/runtime/serializer/streaming +k8s.io/apimachinery/pkg/runtime/serializer/versioning +k8s.io/apimachinery/pkg/selection +k8s.io/apimachinery/pkg/types +k8s.io/apimachinery/pkg/util/cache k8s.io/apimachinery/pkg/util/clock +k8s.io/apimachinery/pkg/util/diff +k8s.io/apimachinery/pkg/util/errors k8s.io/apimachinery/pkg/util/framer -k8s.io/apimachinery/pkg/version +k8s.io/apimachinery/pkg/util/intstr +k8s.io/apimachinery/pkg/util/json +k8s.io/apimachinery/pkg/util/mergepatch +k8s.io/apimachinery/pkg/util/naming +k8s.io/apimachinery/pkg/util/net +k8s.io/apimachinery/pkg/util/runtime +k8s.io/apimachinery/pkg/util/sets k8s.io/apimachinery/pkg/util/strategicpatch k8s.io/apimachinery/pkg/util/uuid -k8s.io/apimachinery/pkg/util/cache -k8s.io/apimachinery/pkg/util/diff -k8s.io/apimachinery/pkg/util/mergepatch +k8s.io/apimachinery/pkg/util/validation +k8s.io/apimachinery/pkg/util/validation/field +k8s.io/apimachinery/pkg/util/wait +k8s.io/apimachinery/pkg/util/yaml +k8s.io/apimachinery/pkg/version +k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json -k8s.io/apimachinery/pkg/apis/meta/internalversion +k8s.io/apimachinery/third_party/forked/golang/reflect # k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible -k8s.io/client-go/plugin/pkg/client/auth/gcp +k8s.io/client-go/discovery +k8s.io/client-go/discovery/fake k8s.io/client-go/dynamic +k8s.io/client-go/dynamic/fake k8s.io/client-go/kubernetes -k8s.io/client-go/rest -k8s.io/client-go/tools/clientcmd -k8s.io/client-go/util/jsonpath +k8s.io/client-go/kubernetes/fake k8s.io/client-go/kubernetes/scheme -k8s.io/client-go/util/workqueue -k8s.io/client-go/discovery k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1 +k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake k8s.io/client-go/kubernetes/typed/apps/v1 +k8s.io/client-go/kubernetes/typed/apps/v1/fake k8s.io/client-go/kubernetes/typed/apps/v1beta1 +k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake k8s.io/client-go/kubernetes/typed/apps/v1beta2 +k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1 +k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake k8s.io/client-go/kubernetes/typed/authentication/v1 +k8s.io/client-go/kubernetes/typed/authentication/v1/fake k8s.io/client-go/kubernetes/typed/authentication/v1beta1 +k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake k8s.io/client-go/kubernetes/typed/authorization/v1 +k8s.io/client-go/kubernetes/typed/authorization/v1/fake k8s.io/client-go/kubernetes/typed/authorization/v1beta1 +k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake k8s.io/client-go/kubernetes/typed/autoscaling/v1 +k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1 +k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2 +k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake k8s.io/client-go/kubernetes/typed/batch/v1 +k8s.io/client-go/kubernetes/typed/batch/v1/fake k8s.io/client-go/kubernetes/typed/batch/v1beta1 +k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake k8s.io/client-go/kubernetes/typed/batch/v2alpha1 +k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake k8s.io/client-go/kubernetes/typed/certificates/v1beta1 +k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake k8s.io/client-go/kubernetes/typed/coordination/v1 +k8s.io/client-go/kubernetes/typed/coordination/v1/fake k8s.io/client-go/kubernetes/typed/coordination/v1beta1 +k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake k8s.io/client-go/kubernetes/typed/core/v1 +k8s.io/client-go/kubernetes/typed/core/v1/fake k8s.io/client-go/kubernetes/typed/events/v1beta1 +k8s.io/client-go/kubernetes/typed/events/v1beta1/fake k8s.io/client-go/kubernetes/typed/extensions/v1beta1 +k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake k8s.io/client-go/kubernetes/typed/networking/v1 +k8s.io/client-go/kubernetes/typed/networking/v1/fake k8s.io/client-go/kubernetes/typed/networking/v1beta1 +k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake k8s.io/client-go/kubernetes/typed/node/v1alpha1 +k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake k8s.io/client-go/kubernetes/typed/node/v1beta1 +k8s.io/client-go/kubernetes/typed/node/v1beta1/fake k8s.io/client-go/kubernetes/typed/policy/v1beta1 +k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake k8s.io/client-go/kubernetes/typed/rbac/v1 +k8s.io/client-go/kubernetes/typed/rbac/v1/fake k8s.io/client-go/kubernetes/typed/rbac/v1alpha1 +k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake k8s.io/client-go/kubernetes/typed/rbac/v1beta1 +k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake k8s.io/client-go/kubernetes/typed/scheduling/v1 +k8s.io/client-go/kubernetes/typed/scheduling/v1/fake k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1 +k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake k8s.io/client-go/kubernetes/typed/scheduling/v1beta1 +k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake k8s.io/client-go/kubernetes/typed/settings/v1alpha1 +k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake k8s.io/client-go/kubernetes/typed/storage/v1 +k8s.io/client-go/kubernetes/typed/storage/v1/fake k8s.io/client-go/kubernetes/typed/storage/v1alpha1 +k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake k8s.io/client-go/kubernetes/typed/storage/v1beta1 -k8s.io/client-go/util/flowcontrol +k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake +k8s.io/client-go/pkg/apis/clientauthentication +k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1 +k8s.io/client-go/pkg/apis/clientauthentication/v1beta1 k8s.io/client-go/pkg/version k8s.io/client-go/plugin/pkg/client/auth/exec +k8s.io/client-go/plugin/pkg/client/auth/gcp +k8s.io/client-go/rest k8s.io/client-go/rest/watch -k8s.io/client-go/tools/clientcmd/api -k8s.io/client-go/tools/metrics -k8s.io/client-go/transport -k8s.io/client-go/util/cert +k8s.io/client-go/restmapper +k8s.io/client-go/testing +k8s.io/client-go/third_party/forked/golang/template k8s.io/client-go/tools/auth +k8s.io/client-go/tools/cache +k8s.io/client-go/tools/clientcmd +k8s.io/client-go/tools/clientcmd/api k8s.io/client-go/tools/clientcmd/api/latest -k8s.io/client-go/util/homedir -k8s.io/client-go/dynamic/fake -k8s.io/client-go/kubernetes/fake -k8s.io/client-go/third_party/forked/golang/template +k8s.io/client-go/tools/clientcmd/api/v1 k8s.io/client-go/tools/leaderelection k8s.io/client-go/tools/leaderelection/resourcelock +k8s.io/client-go/tools/metrics +k8s.io/client-go/tools/pager k8s.io/client-go/tools/record -k8s.io/client-go/restmapper -k8s.io/client-go/tools/cache +k8s.io/client-go/tools/record/util k8s.io/client-go/tools/reference -k8s.io/client-go/pkg/apis/clientauthentication -k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1 -k8s.io/client-go/pkg/apis/clientauthentication/v1beta1 +k8s.io/client-go/transport +k8s.io/client-go/util/cert k8s.io/client-go/util/connrotation +k8s.io/client-go/util/flowcontrol +k8s.io/client-go/util/homedir +k8s.io/client-go/util/jsonpath k8s.io/client-go/util/keyutil -k8s.io/client-go/tools/clientcmd/api/v1 -k8s.io/client-go/testing -k8s.io/client-go/discovery/fake -k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake -k8s.io/client-go/kubernetes/typed/apps/v1/fake -k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake -k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake -k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake -k8s.io/client-go/kubernetes/typed/authentication/v1/fake -k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake -k8s.io/client-go/kubernetes/typed/authorization/v1/fake -k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake -k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake -k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake -k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake -k8s.io/client-go/kubernetes/typed/batch/v1/fake -k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake -k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake -k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake -k8s.io/client-go/kubernetes/typed/coordination/v1/fake -k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake -k8s.io/client-go/kubernetes/typed/core/v1/fake -k8s.io/client-go/kubernetes/typed/events/v1beta1/fake -k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake -k8s.io/client-go/kubernetes/typed/networking/v1/fake -k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake -k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake -k8s.io/client-go/kubernetes/typed/node/v1beta1/fake -k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake -k8s.io/client-go/kubernetes/typed/rbac/v1/fake -k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake -k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake -k8s.io/client-go/kubernetes/typed/scheduling/v1/fake -k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake -k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake -k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake -k8s.io/client-go/kubernetes/typed/storage/v1/fake -k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake -k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake -k8s.io/client-go/tools/record/util -k8s.io/client-go/tools/pager k8s.io/client-go/util/retry +k8s.io/client-go/util/workqueue # k8s.io/klog v0.4.0 k8s.io/klog # k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf k8s.io/kube-openapi/pkg/util/proto # k8s.io/utils v0.0.0-20190809000727-6c36bc71fc4a -k8s.io/utils/integer k8s.io/utils/buffer +k8s.io/utils/integer k8s.io/utils/trace # sigs.k8s.io/controller-runtime v0.2.0-beta.2 sigs.k8s.io/controller-runtime -sigs.k8s.io/controller-runtime/pkg/log/zap -sigs.k8s.io/controller-runtime/pkg/scheme -sigs.k8s.io/controller-runtime/pkg/client -sigs.k8s.io/controller-runtime/pkg/handler -sigs.k8s.io/controller-runtime/pkg/source sigs.k8s.io/controller-runtime/pkg/builder +sigs.k8s.io/controller-runtime/pkg/cache +sigs.k8s.io/controller-runtime/pkg/cache/internal +sigs.k8s.io/controller-runtime/pkg/client +sigs.k8s.io/controller-runtime/pkg/client/apiutil sigs.k8s.io/controller-runtime/pkg/client/config +sigs.k8s.io/controller-runtime/pkg/controller sigs.k8s.io/controller-runtime/pkg/controller/controllerutil -sigs.k8s.io/controller-runtime/pkg/log -sigs.k8s.io/controller-runtime/pkg/manager -sigs.k8s.io/controller-runtime/pkg/manager/signals -sigs.k8s.io/controller-runtime/pkg/reconcile +sigs.k8s.io/controller-runtime/pkg/conversion sigs.k8s.io/controller-runtime/pkg/envtest -sigs.k8s.io/controller-runtime/pkg/client/apiutil +sigs.k8s.io/controller-runtime/pkg/envtest/printer sigs.k8s.io/controller-runtime/pkg/event +sigs.k8s.io/controller-runtime/pkg/handler +sigs.k8s.io/controller-runtime/pkg/internal/controller +sigs.k8s.io/controller-runtime/pkg/internal/controller/metrics sigs.k8s.io/controller-runtime/pkg/internal/log -sigs.k8s.io/controller-runtime/pkg/runtime/inject -sigs.k8s.io/controller-runtime/pkg/cache -sigs.k8s.io/controller-runtime/pkg/predicate -sigs.k8s.io/controller-runtime/pkg/source/internal -sigs.k8s.io/controller-runtime/pkg/controller -sigs.k8s.io/controller-runtime/pkg/webhook/admission -sigs.k8s.io/controller-runtime/pkg/webhook/conversion +sigs.k8s.io/controller-runtime/pkg/internal/objectutil sigs.k8s.io/controller-runtime/pkg/internal/recorder sigs.k8s.io/controller-runtime/pkg/leaderelection +sigs.k8s.io/controller-runtime/pkg/log +sigs.k8s.io/controller-runtime/pkg/log/zap +sigs.k8s.io/controller-runtime/pkg/manager +sigs.k8s.io/controller-runtime/pkg/manager/signals sigs.k8s.io/controller-runtime/pkg/metrics +sigs.k8s.io/controller-runtime/pkg/predicate +sigs.k8s.io/controller-runtime/pkg/reconcile sigs.k8s.io/controller-runtime/pkg/recorder +sigs.k8s.io/controller-runtime/pkg/runtime/inject +sigs.k8s.io/controller-runtime/pkg/scheme +sigs.k8s.io/controller-runtime/pkg/source +sigs.k8s.io/controller-runtime/pkg/source/internal sigs.k8s.io/controller-runtime/pkg/webhook -sigs.k8s.io/controller-runtime/pkg/envtest/printer -sigs.k8s.io/controller-runtime/pkg/cache/internal -sigs.k8s.io/controller-runtime/pkg/internal/controller -sigs.k8s.io/controller-runtime/pkg/conversion +sigs.k8s.io/controller-runtime/pkg/webhook/admission +sigs.k8s.io/controller-runtime/pkg/webhook/conversion sigs.k8s.io/controller-runtime/pkg/webhook/internal/certwatcher sigs.k8s.io/controller-runtime/pkg/webhook/internal/metrics -sigs.k8s.io/controller-runtime/pkg/internal/objectutil -sigs.k8s.io/controller-runtime/pkg/internal/controller/metrics # sigs.k8s.io/testing_frameworks v0.1.1 sigs.k8s.io/testing_frameworks/integration sigs.k8s.io/testing_frameworks/integration/addr