diff --git a/Gopkg.lock b/Gopkg.lock index df0e6dd62b..953d094602 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -41,7 +41,7 @@ version = "1.0.0" [[projects]] - digest = "1:f18ddcba65e65313913ac0443a7c82e9a309fb65c52dea63f12a6976d909466f" + digest = "1:1fe4e00b5f0ca95c699c92d097ccc2e96d6c2061cfa7ecc4c9248f1cfb8e217e" name = "github.com/aws/aws-sdk-go" packages = [ "aws", @@ -83,8 +83,8 @@ "service/sts/stsiface", ] pruneopts = "UT" - revision = "b4d97e9cf75f3815bd694b8e0d6f9d81492c3586" - version = "v1.17.5" + revision = "2024b98be3d7bca1d26036f16ef34b0275ebb562" + version = "v1.19.18" [[projects]] digest = "1:745bc6300190908c71ec4c641b83e903da724bae0c91b9dc539650b833e22fb4" @@ -1074,6 +1074,14 @@ pruneopts = "UT" revision = "1ee79a9ecd464778e01acf39100bbb3acbaa86d4" +[[projects]] + branch = "master" + digest = "1:dc54d24e166e75a89145883b6080306f5684db2e8ab7a068625f010dee604c6e" + name = "k8s.io/component-base" + packages = ["cli/flag"] + pruneopts = "UT" + revision = "9fe063da3132df1f14a39226ca80374b9fc22ec9" + [[projects]] branch = "master" digest = "1:28514fabca4356625720ffb012408790a9d00d31963a9bd9daf7b5ccd894c301" @@ -1091,9 +1099,12 @@ revision = "0689ccc1d7d65d9dd1bedcc3b0b1ed7df91ba266" [[projects]] - digest = "1:72fd56341405f53c745377e0ebc4abeff87f1a048e0eea6568a20212650f5a82" + digest = "1:ed455ccc8731bfd9299cbdaebd7a96da8097f5399f15ee4ec5d3ea3bcdff9f91" name = "k8s.io/klog" - packages = ["."] + packages = [ + ".", + "klogr", + ] pruneopts = "UT" revision = "71442cd4037d612096940ceb0f3fec3f7fff66e0" version = "v0.2.0" @@ -1134,7 +1145,8 @@ revision = "c2654d5206da6b7b6ace12841e8f359bb89b443c" [[projects]] - digest = "1:bc04752ec8a48d212a0db41c2085bb468ae7c8c34bcb317f552b68f4fe34865b" + branch = "release-0.1" + digest = "1:544e478bb32f15bbaeef4a44c3db17863552b3afd6e33f25ad8771ea62881afc" name = "sigs.k8s.io/cluster-api" packages = [ "cmd/clusterctl/clientcmd", @@ -1162,8 +1174,7 @@ "pkg/util", ] pruneopts = "T" - revision = "29fee0a9ef590af33bbaa167ed17a8be50825679" - version = "0.1.0" + revision = "2186e24916f7dd57deb490c19bd453ac4ebfa711" [[projects]] digest = "1:4e97dc637c467531240326f56e253c6d42b519424b6a89d80664ef0f3ed4f721" @@ -1269,6 +1280,7 @@ "github.com/aws/aws-sdk-go/service/sts/stsiface", "github.com/awslabs/goformation/cloudformation", "github.com/emicklei/go-restful", + "github.com/go-logr/logr", "github.com/golang/mock/gomock", "github.com/onsi/ginkgo", "github.com/onsi/ginkgo/config", @@ -1300,6 +1312,7 @@ "k8s.io/cluster-bootstrap/token/util", "k8s.io/code-generator/cmd/deepcopy-gen", "k8s.io/klog", + "k8s.io/klog/klogr", "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta1", "k8s.io/kubernetes/cmd/kubeadm/app/util", "sigs.k8s.io/cluster-api/cmd/clusterctl/cmd", @@ -1318,6 +1331,7 @@ "sigs.k8s.io/controller-runtime/pkg/envtest", "sigs.k8s.io/controller-runtime/pkg/handler", "sigs.k8s.io/controller-runtime/pkg/manager", + "sigs.k8s.io/controller-runtime/pkg/patch", "sigs.k8s.io/controller-runtime/pkg/runtime/scheme", "sigs.k8s.io/controller-runtime/pkg/runtime/signals", "sigs.k8s.io/controller-runtime/pkg/source", diff --git a/Gopkg.toml b/Gopkg.toml index 91b9d6a5f3..10b6bf58e7 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -50,7 +50,7 @@ required = [ [[constraint]] name = "sigs.k8s.io/cluster-api" - version = "0.1.0" + branch = "release-0.1" # For dependency below: Refer to issue https://github.com/golang/dep/issues/1799 [[override]] diff --git a/Makefile b/Makefile index 18dea50d1c..4926a06722 100644 --- a/Makefile +++ b/Makefile @@ -120,7 +120,7 @@ verify: ## Runs verification scripts to ensure correct execution ## -------------------------------------- .PHONY: manifests -manifests: cmd/clusterctl/examples/aws/provider-components-base.yaml ## Build example set of manifests from the current source +manifests: clusterawsadm cmd/clusterctl/examples/aws/provider-components-base.yaml ## Build example set of manifests from the current source ./cmd/clusterctl/examples/aws/generate-yaml.sh .PHONY: cmd/clusterctl/examples/aws/provider-components-base.yaml @@ -145,10 +145,10 @@ gazelle: ## Run Bazel Gazelle generate: ## Generate mocks, CRDs and runs `go generate` through Bazel GOPATH=$(shell go env GOPATH) bazel run //:generate $(BAZEL_ARGS) $(MAKE) dep-ensure - bazel build $(BAZEL_ARGS) //pkg/cloud/aws/services/mocks:go_mock_interfaces \ - //pkg/cloud/aws/services/ec2/mock_ec2iface:go_default_library \ - //pkg/cloud/aws/services/elb/mock_elbiface:go_default_library - cp -Rf bazel-genfiles/pkg/* pkg/ + bazel build $(BAZEL_ARGS) //pkg/cloud/aws/services/mocks:mocks \ + //pkg/cloud/aws/services/ec2/mock_ec2iface:mocks \ + //pkg/cloud/aws/services/elb/mock_elbiface:mocks + ./hack/copy-bazel-mocks.sh $(MAKE) generate-crds .PHONY: generate-crds @@ -211,8 +211,7 @@ release-artifacts: ## Build release artifacts ## -------------------------------------- .PHONY: binaries-dev -binaries-dev: ## Builds and installs all development binaries using go get - go get -v ./... +binaries-dev: generate manager clusterawsadm clusterctl .PHONY: create-cluster create-cluster: binaries-dev ## Create a development Kubernetes cluster on AWS using examples @@ -224,6 +223,16 @@ create-cluster: binaries-dev ## Create a development Kubernetes cluster on AWS u -p ./cmd/clusterctl/examples/aws/out/provider-components.yaml \ -a ./cmd/clusterctl/examples/aws/out/addons.yaml +.PHONY: create-cluster-ha +create-cluster-ha: binaries-dev ## Create a development Kubernetes cluster on AWS using HA examples + clusterctl create cluster -v 4 \ + --provider aws \ + --bootstrap-type kind \ + -m ./cmd/clusterctl/examples/aws/out/machines-ha.yaml \ + -c ./cmd/clusterctl/examples/aws/out/cluster.yaml \ + -p ./cmd/clusterctl/examples/aws/out/provider-components.yaml \ + -a ./cmd/clusterctl/examples/aws/out/addons.yaml + .PHONY: delete-cluster delete-cluster: binaries-dev ## Deletes the development Kubernetes Cluster "test1" clusterctl delete cluster -v 4 \ diff --git a/OWNERS_ALIASES b/OWNERS_ALIASES index dd7308138a..1c0c249473 100644 --- a/OWNERS_ALIASES +++ b/OWNERS_ALIASES @@ -2,39 +2,28 @@ aliases: sig-cluster-lifecycle-leads: - - lukemarsden + - justinsb - luxas - - roberthbailey - timothysc cluster-api-admins: + - davidewatson + - detiber - justinsb - - krousey - - luxas - - roberthbailey - - kris-nova cluster-api-maintainers: - - jessicaochen - - k4leung4 - - karan - - kris-nova - - krousey - - medinatiger - - mkjelland - - roberthbailey - - rsdcastro - - spew + - detiber + - justinsb + - vincepri sig-aws-leads: + - d-nishi - justinsb - kris-nova - - countspongebob cluster-api-aws-maintainers: - - detiber - chuckha - davidewatson - - d-nishi + - detiber - enxebre - ingvagabund - - vincepri - randomvariable + - vincepri cluster-api-aws-reviewers: - - ashish-amarnath + - ashish-amarnath \ No newline at end of file diff --git a/README.md b/README.md index c76831d47f..f300059aa2 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,19 @@ policy may be made to more closely align with other providers in the Cluster API ------ +## Kubernetes versions with published AMIs + +Note: These AMIs are not updated for security fixes and it is recommended to always use the latest patch version for the Kubernetes version you wish to run. For production-like environments, it is highly recommended to build and use your own custom images. + +| Kubernetes minor version | Kubernetes full version | +|-|-| +| v1.13 | v1.13.3 | +| | v1.13.5 | +| v1.14 | v1.14.0 | +| | v1.14.1 | + +------ + ## Documentation Documentation is in the `/docs` directory, and the [index is here](docs/README.md). diff --git a/SECURITY_CONTACTS b/SECURITY_CONTACTS index 641db5c1bf..7da23c405f 100644 --- a/SECURITY_CONTACTS +++ b/SECURITY_CONTACTS @@ -10,7 +10,7 @@ # DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE # INSTRUCTIONS AT https://kubernetes.io/security/ +detiber +justinsb luxas -roberthbailey timothysc -detiber diff --git a/WORKSPACE b/WORKSPACE index 4e8d6aa80e..d591085e04 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -13,12 +13,11 @@ # limitations under the License. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") http_archive( name = "io_bazel_rules_go", - sha256 = "301c8b39b0808c49f98895faa6aa8c92cbd605ab5ad4b6a3a652da33a1a2ba2e", - url = "https://github.com/bazelbuild/rules_go/releases/download/0.18.0/rules_go-0.18.0.tar.gz", + sha256 = "86ae934bd4c43b99893fc64be9d9fc684b81461581df7ea8fc291c816f5ee8c5", + url = "https://github.com/bazelbuild/rules_go/releases/download/0.18.3/rules_go-0.18.3.tar.gz", ) http_archive( @@ -30,8 +29,8 @@ http_archive( http_archive( name = "bazel_gazelle", - sha256 = "7949fc6cc17b5b191103e97481cf8889217263acf52e00b560683413af204fcb", - urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/0.16.0/bazel-gazelle-0.16.0.tar.gz"], + sha256 = "3c681998538231a2d24d0c07ed5a7658cb72bfb5fd4bf9911157c0e9ac6a2687", + urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/0.17.0/bazel-gazelle-0.17.0.tar.gz"], ) http_archive( @@ -41,22 +40,32 @@ http_archive( urls = ["https://github.com/kubernetes/repo-infra/archive/df02ded38f9506e5bbcbf21702034b4fef815f2f.tar.gz"], ) +http_archive( + name = "bazel_skylib", + sha256 = "2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e", + type = "tar.gz", + url = "https://github.com/bazelbuild/bazel-skylib/releases/download/0.8.0/bazel-skylib.0.8.0.tar.gz", +) + +load("@bazel_skylib//:lib.bzl", "versions") + +versions.check( + minimum_bazel_version = "0.21.0", + maximum_bazel_version = "1.0.0", +) # fails if not within range + load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() go_register_toolchains( - go_version = "1.11.5", + go_version = "1.12.3", ) load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") gazelle_dependencies() -load( - "@io_bazel_rules_docker//toolchains/docker:toolchain.bzl", - docker_toolchain_configure = "toolchain_configure", -) load( "@io_bazel_rules_docker//repositories:repositories.bzl", container_repositories = "repositories", @@ -64,10 +73,6 @@ load( container_repositories() -load( - "@io_bazel_rules_docker//container:container.bzl", - "container_pull", -) load( "@io_bazel_rules_docker//go:image.bzl", _go_image_repos = "repositories", @@ -86,7 +91,7 @@ go_repository( name = "com_github_golangci_golangci-lint", build_file_generation = "on", importpath = "github.com/golangci/golangci-lint", - tag = "v1.15.0", + tag = "v1.16.0", ) go_repository( @@ -99,7 +104,7 @@ go_repository( go_repository( name = "io_k8s_sigs_kind", importpath = "sigs.k8s.io/kind", - tag = "0.1.0", + tag = "0.2.1", ) go_repository( @@ -111,7 +116,7 @@ go_repository( go_repository( name = "io_k8s_kubernetes", importpath = "k8s.io/kubernetes", - tag = "v1.13.4", + tag = "v1.13.5", ) go_repository( @@ -119,3 +124,9 @@ go_repository( importpath = "github.com/a8m/envsubst", tag = "v1.1.0", ) + +go_repository( + name = "bazel_gomock", + commit = "08cc809a2f68f6d810c2013987970a9a5c1181b4", + importpath = "github.com/jmhodges/bazel_gomock", +) diff --git a/build/asmshim/BUILD b/build/asmshim/BUILD deleted file mode 100644 index ae4c17f70b..0000000000 --- a/build/asmshim/BUILD +++ /dev/null @@ -1,14 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "c.go", - "textflag.h", - ], - cgo = True, - importpath = "sigs.k8s.io/cluster-api-provider-aws/build/asmshim", - visibility = ["//visibility:public"], -) diff --git a/build/asmshim/textflag.h b/build/asmshim/textflag.h deleted file mode 100644 index 929e9b36a9..0000000000 --- a/build/asmshim/textflag.h +++ /dev/null @@ -1,34 +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. - -// This file defines flags attached to various functions -// and data objects. The compilers, assemblers, and linker must -// all agree on these values. -// -// Keep in sync with src/cmd/internal/obj/textflag.go. - -// Don't profile the marked routine. This flag is deprecated. -#define NOPROF 1 -// It is ok for the linker to get multiple of these symbols. It will -// pick one of the duplicates to use. -#define DUPOK 2 -// Don't insert stack check preamble. -#define NOSPLIT 4 -// Put this data in a read-only section. -#define RODATA 8 -// This data contains no pointers. -#define NOPTR 16 -// This is a wrapper function and should not count as disabling 'recover'. -#define WRAPPER 32 -// This function uses its incoming context register. -#define NEEDCTXT 64 -// Allocate a word of thread local storage and store the offset from the -// thread local base to the thread local storage in this variable. -#define TLSBSS 256 -// Do not insert instructions to allocate a stack frame for this function. -// Only valid on functions that declare a frame size of 0. -// TODO(mwhudson): only implemented for ppc64x at present. -#define NOFRAME 512 -// Function can call reflect.Type.Method or reflect.Type.MethodByName. -#define REFLECTMETHOD = 1024 diff --git a/build/go_mock.bzl b/build/go_mock.bzl deleted file mode 100644 index 4ce166326d..0000000000 --- a/build/go_mock.bzl +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright 2018 The Kubernetes Authors. -# -# 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. - -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("@io_kubernetes_build//defs:go.bzl", "go_genrule") - -MOCKGEN = "@com_github_golang_mock//mockgen" -MOCKGEN_LIBS = [ - "@com_github_golang_mock//mockgen/model:go_default_library", - "//vendor/github.com/golang/mock/gomock:go_default_library", -] -ASM_SHIM = "//build/asmshim" -ASM_SHIM_LIB = "%s:go_default_library" % ASM_SHIM -TEXTFLAG_SHIM = "%s:textflag.h" % ASM_SHIM -SDK_INCLUDE_DIR = "$$GOROOT/pkg/include" -BOILERPLATE = "//hack:boilerplate/boilerplate.go.txt" -GO_FLAGS = "CGO_ENABLED=0" - -def _qualified_genfile(label): - return "$$GO_GENRULE_EXECROOT/$(location %s)" % label - -def go_mock(name, importpath, visibility, mocks, deps): - targets = [name + ".go"] - srcs = [m["interface"].lower() + ".go" for m in mocks] - - go_library( - name = name, - srcs = srcs, - importpath = importpath, - deps = deps + MOCKGEN_LIBS , - visibility = visibility, - ) - - for m in mocks: - package = m["package"] - interface = m["interface"] - prefix = m["prefix"] - - out_basename = m["interface"].lower() - out = "%s.go" % out_basename - - if m["vendored"]: - extra_dep = ["//vendor/%s/%s:go_default_library" % (prefix, package)] - else: - extra_dep = [ "//%s:go_default_library" % package ] - - full_deps = [ASM_SHIM_LIB] + MOCKGEN_LIBS + deps + extra_dep - - cmd = """mkdir -p {source_package} && \\ -mkdir -p {generated_package} && \\ -mkdir -p {sdk_include_dir} && \\ -cp {textflag_shim} {sdk_include_dir} && \\ -cd {source_package} && \\ -cat {boilerplate} | sed "s/YEAR/$$(date +%Y)/g" > {qualified_out} && \\ -echo "\n\n" >> {qualified_out} && \\ -{go_flags} {mockgen} -package={code_package} {qualified_package} {interface} \\ - >> {qualified_out} -""".format( - qualified_package = prefix + "/" + package, - code_package = importpath.split("/")[-1], - importpath = importpath, - textflag_shim = "$(location %s)" % TEXTFLAG_SHIM, - generated_package = "$$GO_GENRULE_EXECROOT/%s" % importpath, - source_package = "$$GOPATH/src/%s" % importpath, - qualified_out = _qualified_genfile(":" + out), - mockgen = _qualified_genfile(MOCKGEN), - sdk_include_dir = SDK_INCLUDE_DIR, - go_flags = GO_FLAGS, - interface = interface, - boilerplate = _qualified_genfile(BOILERPLATE), - ) - - go_genrule( - name = out_basename, - srcs = [BOILERPLATE, TEXTFLAG_SHIM], - outs = [ out ], - cmd = cmd, - go_deps = full_deps, - tools = [MOCKGEN], - ) diff --git a/cmd/clusterawsadm/BUILD b/cmd/clusterawsadm/BUILD.bazel similarity index 100% rename from cmd/clusterawsadm/BUILD rename to cmd/clusterawsadm/BUILD.bazel diff --git a/cmd/clusterawsadm/client/BUILD b/cmd/clusterawsadm/client/BUILD.bazel similarity index 100% rename from cmd/clusterawsadm/client/BUILD rename to cmd/clusterawsadm/client/BUILD.bazel diff --git a/cmd/clusterawsadm/cmd/BUILD b/cmd/clusterawsadm/cmd/BUILD.bazel similarity index 100% rename from cmd/clusterawsadm/cmd/BUILD rename to cmd/clusterawsadm/cmd/BUILD.bazel diff --git a/cmd/clusterawsadm/cmd/alpha/BUILD b/cmd/clusterawsadm/cmd/alpha/BUILD.bazel similarity index 100% rename from cmd/clusterawsadm/cmd/alpha/BUILD rename to cmd/clusterawsadm/cmd/alpha/BUILD.bazel diff --git a/cmd/clusterawsadm/cmd/alpha/bootstrap/BUILD b/cmd/clusterawsadm/cmd/alpha/bootstrap/BUILD.bazel similarity index 100% rename from cmd/clusterawsadm/cmd/alpha/bootstrap/BUILD rename to cmd/clusterawsadm/cmd/alpha/bootstrap/BUILD.bazel diff --git a/cmd/clusterawsadm/cmd/alpha/ec2/BUILD b/cmd/clusterawsadm/cmd/alpha/ec2/BUILD.bazel similarity index 100% rename from cmd/clusterawsadm/cmd/alpha/ec2/BUILD rename to cmd/clusterawsadm/cmd/alpha/ec2/BUILD.bazel diff --git a/cmd/clusterctl/BUILD b/cmd/clusterctl/BUILD.bazel similarity index 100% rename from cmd/clusterctl/BUILD rename to cmd/clusterctl/BUILD.bazel diff --git a/cmd/clusterctl/examples/aws/BUILD.bazel b/cmd/clusterctl/examples/aws/BUILD.bazel index 4688f06045..aced9bb257 100644 --- a/cmd/clusterctl/examples/aws/BUILD.bazel +++ b/cmd/clusterctl/examples/aws/BUILD.bazel @@ -42,6 +42,7 @@ exports_files([ "cluster-network-spec.yaml.template", "generate-yaml.sh", "machines.yaml.template", + "machines-ha.yaml.template", ]) pkg_tar( @@ -51,6 +52,7 @@ pkg_tar( "cluster.yaml.template", "cluster-network-spec.yaml.template", "generate-yaml.sh", + "machines-ha.yaml.template", "machines.yaml.template", "provider-components-base.yaml", "//docs:getting-started.md", @@ -60,6 +62,7 @@ pkg_tar( "cluster.yaml.template": "0644", "cluster-network-spec.yaml.template": "0644", "generate-yaml.sh": "0755", + "machines-ha.yaml.template": "0644", "machines.yaml.template": "0644", "provider-components-base.yaml": "0644", "//docs:getting-started.md": "0644", diff --git a/cmd/clusterctl/examples/aws/generate-yaml.sh b/cmd/clusterctl/examples/aws/generate-yaml.sh index 6c2a7b5898..8b1f4b10bd 100755 --- a/cmd/clusterctl/examples/aws/generate-yaml.sh +++ b/cmd/clusterctl/examples/aws/generate-yaml.sh @@ -38,6 +38,10 @@ CLUSTER_NETWORKSPEC_TEMPLATE_FILE=${DIR}/cluster-network-spec.yaml.template CLUSTER_GENERATED_FILE=${OUTPUT_DIR}/cluster.yaml MACHINES_TEMPLATE_FILE=${DIR}/machines.yaml.template MACHINES_GENERATED_FILE=${OUTPUT_DIR}/machines.yaml +HA_MACHINES_TEMPLATE_FILE=${DIR}/machines-ha.yaml.template +HA_MACHINES_GENERATED_FILE=${OUTPUT_DIR}/machines-ha.yaml +DEPLOYMENT_MACHINES_TEMPLATE_FILE=${DIR}/machine-deployment.yaml.template +DEPLOYMENT_MACHINES_GENERATED_FILE=${OUTPUT_DIR}/machine-deployment.yaml ADDONS_FILE=${OUTPUT_DIR}/addons.yaml PROVIDER_COMPONENTS_SRC=${DIR}/provider-components-base.yaml PROVIDER_COMPONENTS_FILE=${OUTPUT_DIR}/provider-components.yaml @@ -78,6 +82,11 @@ if [ $OVERWRITE -ne 1 ] && [ -f $MACHINES_GENERATED_FILE ]; then exit 1 fi +if [ $OVERWRITE -ne 1 ] && [ -f $HA_MACHINES_GENERATED_FILE ]; then + echo File $HA_MACHINES_GENERATED_FILE already exists. Delete it manually before running this script. + exit 1 +fi + if [ $OVERWRITE -ne 1 ] && [ -f $CLUSTER_GENERATED_FILE ]; then echo File $CLUSTER_GENERATED_FILE already exists. Delete it manually before running this script. exit 1 @@ -96,6 +105,12 @@ fi $ENVSUBST < $MACHINES_TEMPLATE_FILE > "${MACHINES_GENERATED_FILE}" echo "Done generating ${MACHINES_GENERATED_FILE}" +$ENVSUBST < $HA_MACHINES_TEMPLATE_FILE > "${HA_MACHINES_GENERATED_FILE}" +echo "Done generating ${HA_MACHINES_GENERATED_FILE}" + +$ENVSUBST < $DEPLOYMENT_MACHINES_TEMPLATE_FILE > "${DEPLOYMENT_MACHINES_GENERATED_FILE}" +echo "Done generating ${DEPLOYMENT_MACHINES_GENERATED_FILE}" + cp ${DIR}/addons.yaml ${ADDONS_FILE} echo "Done copying ${ADDONS_FILE}" diff --git a/cmd/clusterctl/examples/aws/machine-deployment.yaml.template b/cmd/clusterctl/examples/aws/machine-deployment.yaml.template new file mode 100644 index 0000000000..1a10a15509 --- /dev/null +++ b/cmd/clusterctl/examples/aws/machine-deployment.yaml.template @@ -0,0 +1,27 @@ +apiVersion: "cluster.k8s.io/v1alpha1" +kind: MachineDeployment +metadata: + name: sample-machinedeployment + labels: + cluster.k8s.io/cluster-name: ${CLUSTER_NAME} +spec: + replicas: 1 + selector: + matchLabels: + cluster.k8s.io/cluster-name: ${CLUSTER_NAME} + set: node + template: + metadata: + labels: + cluster.k8s.io/cluster-name: ${CLUSTER_NAME} + set: node + spec: + versions: + kubelet: v1.13.5 + providerSpec: + value: + apiVersion: awsprovider/v1alpha1 + kind: AWSMachineProviderSpec + instanceType: "${NODE_MACHINE_TYPE}" + iamInstanceProfile: "nodes.cluster-api-provider-aws.sigs.k8s.io" + keyName: "${SSH_KEY_NAME}" diff --git a/cmd/clusterctl/examples/aws/machines-ha.yaml.template b/cmd/clusterctl/examples/aws/machines-ha.yaml.template new file mode 100644 index 0000000000..e7bb2fad99 --- /dev/null +++ b/cmd/clusterctl/examples/aws/machines-ha.yaml.template @@ -0,0 +1,57 @@ +apiVersion: "cluster.k8s.io/v1alpha1" +kind: MachineList +items: + - apiVersion: "cluster.k8s.io/v1alpha1" + kind: Machine + metadata: + name: controlplane-0 + labels: + cluster.k8s.io/cluster-name: ${CLUSTER_NAME} + set: controlplane + spec: + versions: + kubelet: v1.13.5 + controlPlane: v1.13.5 + providerSpec: + value: + apiVersion: awsprovider/v1alpha1 + kind: AWSMachineProviderSpec + instanceType: "${CONTROL_PLANE_MACHINE_TYPE}" + iamInstanceProfile: "control-plane.cluster-api-provider-aws.sigs.k8s.io" + keyName: "${SSH_KEY_NAME}" + - apiVersion: "cluster.k8s.io/v1alpha1" + kind: Machine + metadata: + name: controlplane-1 + labels: + cluster.k8s.io/cluster-name: ${CLUSTER_NAME} + set: controlplane + spec: + versions: + kubelet: v1.13.5 + controlPlane: v1.13.5 + providerSpec: + value: + apiVersion: awsprovider/v1alpha1 + kind: AWSMachineProviderSpec + instanceType: "${CONTROL_PLANE_MACHINE_TYPE}" + iamInstanceProfile: "control-plane.cluster-api-provider-aws.sigs.k8s.io" + keyName: "${SSH_KEY_NAME}" + - apiVersion: "cluster.k8s.io/v1alpha1" + kind: Machine + metadata: + name: controlplane-2 + labels: + cluster.k8s.io/cluster-name: ${CLUSTER_NAME} + set: controlplane + spec: + versions: + kubelet: v1.13.5 + controlPlane: v1.13.5 + providerSpec: + value: + apiVersion: awsprovider/v1alpha1 + kind: AWSMachineProviderSpec + instanceType: "${CONTROL_PLANE_MACHINE_TYPE}" + iamInstanceProfile: "control-plane.cluster-api-provider-aws.sigs.k8s.io" + keyName: "${SSH_KEY_NAME}" diff --git a/cmd/manager/BUILD.bazel b/cmd/manager/BUILD.bazel index 25d555b469..8071eba68b 100644 --- a/cmd/manager/BUILD.bazel +++ b/cmd/manager/BUILD.bazel @@ -28,6 +28,7 @@ go_library( "//pkg/cloud/aws/actuators/cluster:go_default_library", "//pkg/cloud/aws/actuators/machine:go_default_library", "//pkg/record:go_default_library", + "//vendor/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library", "//vendor/k8s.io/klog:go_default_library", "//vendor/sigs.k8s.io/cluster-api/pkg/apis:go_default_library", "//vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common:go_default_library", diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 2e8137abad..9cda4e2e85 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -20,6 +20,7 @@ import ( "flag" "time" + corev1 "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/klog" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/actuators/cluster" @@ -65,17 +66,25 @@ func main() { klog.Fatalf("Failed to create client from configuration: %v", err) } + coreClient, err := corev1.NewForConfig(cfg) + if err != nil { + klog.Fatalf("Failed to create corev1 client from configuration: %v", err) + } + // Initialize event recorder. record.InitFromRecorder(mgr.GetRecorder("aws-controller")) // Initialize cluster actuator. clusterActuator := cluster.NewActuator(cluster.ActuatorParams{ - Client: cs.ClusterV1alpha1(), + Client: cs.ClusterV1alpha1(), + LoggingContext: "[cluster-actuator]", }) // Initialize machine actuator. machineActuator := machine.NewActuator(machine.ActuatorParams{ - Client: cs.ClusterV1alpha1(), + CoreClient: coreClient, + ClusterClient: cs.ClusterV1alpha1(), + LoggingContext: "[machine-actuator]", }) // Register our cluster deployer (the interface is in clusterctl and we define the Deployer interface on the actuator) diff --git a/cmd/release/main.go b/cmd/release/main.go index 2cbe4a64be..31c3981803 100644 --- a/cmd/release/main.go +++ b/cmd/release/main.go @@ -83,22 +83,27 @@ func main() { gitRemote: remote, } + logger := &stdoutlogger{} run := &runner{ builder: makebuilder{ registry: cfg.registry, imageTag: cfg.version, pullPolicy: cfg.pullPolicy, + logger: logger, }, releaser: gothubReleaser{ artifactsDir: cfg.artifactDir, user: cfg.githubUser, repository: cfg.githubRepository, + logger: logger, }, tagger: git{ repository: cfg.githubRepository, remote: cfg.gitRemote, + logger: logger, }, config: cfg, + logger: logger, } if err := run.run(); err != nil { @@ -216,48 +221,47 @@ type runner struct { releaser releaser tagger tagger config config + logger logger } // TODO sha512 the artifacts! -// TODO move fmt.Println into a logr interface - func (r runner) run() error { - fmt.Printf("tagging repository %q ", r.config.version) + r.logger.Infof("tagging repository %q ", r.config.version) if err := r.tagger.tag(r.config.version); err != nil { return err } - fmt.Println("🐲") - fmt.Printf("checking out tag %q ", r.config.version) + r.logger.Info("🐲") + r.logger.Infof("checking out tag %q ", r.config.version) if err := r.tagger.checkout(r.config.version); err != nil { return err } - fmt.Println("🐲") - fmt.Printf("building artifacts %v ", r.config.artifacts) + r.logger.Info("🐲") + r.logger.Infof("building artifacts %v ", r.config.artifacts) if err := r.builder.build(); err != nil { return err } - fmt.Println("🐲") - fmt.Printf("building container image: %s/%s:%s ", r.config.registry, r.config.imageName, r.config.version) + r.logger.Info("🐲") + r.logger.Infof("building container image: %s/%s:%s ", r.config.registry, r.config.imageName, r.config.version) if err := r.builder.images(); err != nil { return err } - fmt.Println("🐲") - fmt.Printf("pushing tag %q ", r.config.version) + r.logger.Info("🐲") + r.logger.Infof("pushing tag %q ", r.config.version) if err := r.tagger.pushTag(r.config.version); err != nil { return err } - fmt.Println("🐲") - fmt.Printf("drafting a release for tag %q ", r.config.version) + r.logger.Info("🐲") + r.logger.Infof("drafting a release for tag %q ", r.config.version) if err := r.releaser.draft(r.config.version); err != nil { return err } - fmt.Println("🐲") + r.logger.Info("🐲") for _, artifact := range r.config.artifacts { - fmt.Printf("uploading %q ", artifact) + r.logger.Infof("uploading %q ", artifact) if err := r.releaser.upload(r.config.version, artifact); err != nil { return err } - fmt.Println("🐲") + r.logger.Info("🐲") } return nil } @@ -274,13 +278,14 @@ type gothubReleaser struct { repository string artifactsDir string + logger logger } func (g gothubReleaser) draft(version string) error { cmd := exec.Command("gothub", "release", "--tag", version, "--user", g.user, "--repo", g.repository, "--draft") out, err := cmd.CombinedOutput() if err != nil { - fmt.Println(string(out)) + g.logger.Info(string(out)) } return err } @@ -288,7 +293,7 @@ func (g gothubReleaser) upload(version, file string) error { cmd := exec.Command("gothub", "upload", "--tag", version, "--user", g.user, "--repo", g.repository, "--file", path.Join(g.artifactsDir, file), "--name", file) out, err := cmd.CombinedOutput() if err != nil { - fmt.Println(string(out)) + g.logger.Info(string(out)) } return err } @@ -305,6 +310,7 @@ type git struct { // remote is the local name of the remote remote string + logger logger } func (g git) tag(version string) error { @@ -317,7 +323,7 @@ func (g git) tag(version string) error { cmd = exec.Command("git", "tag", "-s", "-m", fmt.Sprintf("A release of %q for version %q", g.repository, version), version) out, err2 := cmd.CombinedOutput() if err2 != nil { - fmt.Println(string(out)) + g.logger.Info(string(out)) } return err2 } @@ -329,7 +335,7 @@ func (g git) pushTag(version string) error { cmd := exec.Command("git", "push", g.remote, version) out, err := cmd.CombinedOutput() if err != nil { - fmt.Println(string(out)) + g.logger.Info(string(out)) } return err } @@ -338,7 +344,7 @@ func (g git) checkout(version string) error { cmd := exec.Command("git", "checkout", version) out, err := cmd.CombinedOutput() if err != nil { - fmt.Println(string(out)) + g.logger.Info(string(out)) } return err } @@ -352,6 +358,7 @@ type makebuilder struct { registry string imageTag string pullPolicy string + logger logger } func (m makebuilder) cmdWithEnv(command string, args ...string) error { @@ -363,7 +370,7 @@ func (m makebuilder) cmdWithEnv(command string, args ...string) error { out, err := cmd.CombinedOutput() if err != nil { - fmt.Println(string(out)) + m.logger.Info(string(out)) } return err } @@ -375,3 +382,17 @@ func (m makebuilder) build() error { func (m makebuilder) images() error { return m.cmdWithEnv("make", "docker-build") } + +type logger interface { + Infof(string, ...interface{}) + Info(...interface{}) +} + +type stdoutlogger struct{} + +func (s *stdoutlogger) Infof(msg string, args ...interface{}) { + fmt.Printf(msg, args...) +} +func (s *stdoutlogger) Info(msgs ...interface{}) { + fmt.Println(msgs...) +} diff --git a/cmd/versioninfo/BUILD b/cmd/versioninfo/BUILD.bazel similarity index 100% rename from cmd/versioninfo/BUILD rename to cmd/versioninfo/BUILD.bazel diff --git a/config/crds/awsprovider_v1alpha1_awsclusterproviderstatus.yaml b/config/crds/awsprovider_v1alpha1_awsclusterproviderstatus.yaml index 5b6cf3230f..31763bf6c0 100644 --- a/config/crds/awsprovider_v1alpha1_awsclusterproviderstatus.yaml +++ b/config/crds/awsprovider_v1alpha1_awsclusterproviderstatus.yaml @@ -49,6 +49,10 @@ spec: publicIp: description: The public IPv4 address assigned to the instance, if applicable. type: string + rootDeviceSize: + description: Specifies size (in Gi) of the root storage device + format: int64 + type: integer securityGroupIds: description: SecurityGroupIDs are one or more security group IDs this instance belongs to. diff --git a/config/crds/awsprovider_v1alpha1_awsmachineproviderspec.yaml b/config/crds/awsprovider_v1alpha1_awsmachineproviderspec.yaml index 9b8d2d5ae5..05a40b964a 100644 --- a/config/crds/awsprovider_v1alpha1_awsmachineproviderspec.yaml +++ b/config/crds/awsprovider_v1alpha1_awsmachineproviderspec.yaml @@ -95,6 +95,10 @@ spec: description: IAMInstanceProfile is a name of an IAM instance profile to assign to the instance type: string + imageLookupOrg: + description: ImageLookupOrg is the AWS Organization ID to use for image + lookup if AMI is not set. + type: string instanceType: description: 'InstanceType is the type of instance to create. Example: m4.xlarge' type: string @@ -392,6 +396,10 @@ spec: IP. Precedence for this setting is as follows: 1. This field if set 2. Cluster/flavor setting 3. Subnet default' type: boolean + rootDeviceSize: + description: RootDeviceSize is the size of the root volume. + format: int64 + type: integer subnet: description: Subnet is a reference to the subnet to use for this instance. If not specified, the cluster subnet will be used. diff --git a/docs/amis.md b/docs/amis.md index 04d5718378..e8f9a7ae16 100644 --- a/docs/amis.md +++ b/docs/amis.md @@ -8,7 +8,7 @@ - [Amazon Linux 2](#amazon-linux-2) - [CentOS 7](#centos-7) - [Ubuntu 18.04 (Bionic)](#ubuntu-1804-bionic) -- [Kubernetes Version v1.14.0](#kubernetes-version-v1140) +- [Kubernetes Version v1.14.1](#kubernetes-version-v1141) - [Amazon Linux 2](#amazon-linux-2-1) - [CentOS 7](#centos-7-1) - [Ubuntu 18.04 (Bionic)](#ubuntu-1804-bionic-1) @@ -77,64 +77,64 @@ | us-west-1 | ami-08966c37e0140c3d1 | | us-west-2 | ami-00a33ed2a8fc8c3e8 | -## Kubernetes Version v1.14.0 +## Kubernetes Version v1.14.1 ### Amazon Linux 2 | Region | AMI | | -------------- | --------------------- | -| ap-northeast-1 | ami-0f45a5bd2bfb04741 | -| ap-northeast-2 | ami-049834ba9566e62bc | -| ap-south-1 | ami-0a9d15d50a0d1051f | -| ap-southeast-1 | ami-0fb4b55e75eec74ac | -| ap-southeast-2 | ami-0330f679d365cea8c | -| ca-central-1 | ami-057948ce6362cf5d0 | -| eu-central-1 | ami-0d39727798a8d990f | -| eu-west-1 | ami-077e900c1d635539a | -| eu-west-2 | ami-027742c4ff63fa8bf | -| eu-west-3 | ami-09d7337bf48531d16 | -| sa-east-1 | ami-05e76d1313b041bd2 | -| us-east-1 | ami-06e9efa49080a34f3 | -| us-east-2 | ami-072175305658a8cc1 | -| us-west-1 | ami-03a927b71dd62900c | -| us-west-2 | ami-0f7f3df9b085ad831 | +| ap-northeast-1 | ami-0afead2609c2546ac | +| ap-northeast-2 | ami-0db37b263cca19fae | +| ap-south-1 | ami-0a96424ef63c7acd0 | +| ap-southeast-1 | ami-0879046f6c5738a99 | +| ap-southeast-2 | ami-01778f4e2f456fcad | +| ca-central-1 | ami-0ec0741daf95809da | +| eu-central-1 | ami-06833f92a510f0431 | +| eu-west-1 | ami-05a6740572819c0ed | +| eu-west-2 | ami-09613ba808b5fc476 | +| eu-west-3 | ami-0c1f8302f8e8a5b6a | +| sa-east-1 | ami-0e4fa09f5489f729a | +| us-east-1 | ami-06dbae52dfa6435b8 | +| us-east-2 | ami-0679c8cd62b8c5eb7 | +| us-west-1 | ami-0f8812c10f3307e81 | +| us-west-2 | ami-04427a81dfcd9d3e0 | ### CentOS 7 | Region | AMI | | -------------- | --------------------- | -| ap-northeast-1 | ami-0c301d38a6585e2b8 | -| ap-northeast-2 | ami-06f2c6503e566d38f | -| ap-south-1 | ami-000ec39b83793a663 | -| ap-southeast-1 | ami-02efaa3cd4ec9acb7 | -| ap-southeast-2 | ami-0e718f9b87eb47ea6 | -| ca-central-1 | ami-00b2eb5934cf51417 | -| eu-central-1 | ami-0d4a90494fcbba30e | -| eu-west-1 | ami-0b23330aa5c2cc2c4 | -| eu-west-2 | ami-06d24b1c07007f3db | -| eu-west-3 | ami-0ed31ac0422d7d975 | -| sa-east-1 | ami-05bdd15b132a4b9e9 | -| us-east-1 | ami-04aa2bcdba99af0ab | -| us-east-2 | ami-078b14e31784da13f | -| us-west-1 | ami-0bc32fe0cc52f2d22 | -| us-west-2 | ami-054de5bbf5c94b85d | +| ap-northeast-1 | ami-0b22e75b38c9604e6 | +| ap-northeast-2 | ami-01dfbf2e31f38e9ba | +| ap-south-1 | ami-0fe6284cc828526ec | +| ap-southeast-1 | ami-069c01c6d1c0d3d46 | +| ap-southeast-2 | ami-0c411bb57343f91b4 | +| ca-central-1 | ami-0192bb040c7ea65d9 | +| eu-central-1 | ami-0c13bed8e64f6ed2c | +| eu-west-1 | ami-0c50ce63ecdc43572 | +| eu-west-2 | ami-04152e2c2b184fe1c | +| eu-west-3 | ami-03f1d4ed8f6a9eb37 | +| sa-east-1 | ami-08f16743ed8074612 | +| us-east-1 | ami-042b29cd8fbbba30e | +| us-east-2 | ami-049eb46cd6287a31d | +| us-west-1 | ami-0e7d34cbf9942fad2 | +| us-west-2 | ami-067fe2baac37fc4db | ### Ubuntu 18.04 (Bionic) | Region | AMI | | -------------- | --------------------- | -| ap-northeast-1 | ami-0c8b2fc237d06dda1 | -| ap-northeast-2 | ami-0fd9f77c799a71e97 | -| ap1-south-1 | ami-0d28e86e536520feb | -| ap-southeast-1 | ami-0df231612a45f0125 | -| ap-southeast-2 | ami-0ff1378435ce11f47 | -| ca-central-1 | ami-0c316257d2335aa39 | -| eu-central-1 | ami-0841bc13831462a00 | -| eu-west-1 | ami-019ea6e9e776a90a5 | -| eu-west-2 | ami-06c3d9ec4466cdbe5 | -| eu-west-3 | ami-0ddf3bda070c56daf | -| sa-east-1 | ami-0dafc3fe84b493382 | -| us-east-1 | ami-08020bd3fb04c17b1 | -| us-east-2 | ami-0db12114992cdf710 | -| us-west-1 | ami-0fcf44efb977f9fe8 | -| us-west-2 | ami-021f138cd7f314398 | \ No newline at end of file +| ap-northeast-1 | ami-0cc6e338eb609dec4 | +| ap-northeast-2 | ami-0392b3b570e680c75 | +| ap-south-1 | ami-027d2b29a38379d75 | +| ap-southeast-1 | ami-0c122cd9b1395a99b | +| ap-southeast-2 | ami-02606b95f41851218 | +| ca-central-1 | ami-03ff99002637792dc | +| eu-central-1 | ami-00d1c75dadfa7c6c3 | +| eu-west-1 | ami-0d08f87271ba6fc33 | +| eu-west-2 | ami-0e635e9ee96a207ec | +| eu-west-3 | ami-069034358b5707a76 | +| sa-east-1 | ami-04a8548d093d9e091 | +| us-east-1 | ami-085d62a673ccb1308 | +| us-east-2 | ami-0091303a7094a38b5 | +| us-west-1 | ami-020d887f85fa6758c | +| us-west-2 | ami-00c07cb7da8d91b7a | \ No newline at end of file diff --git a/docs/creating-multinode-controlplane-clusters.md b/docs/creating-multinode-controlplane-clusters.md index 4a3033ac2f..a108b91ed1 100644 --- a/docs/creating-multinode-controlplane-clusters.md +++ b/docs/creating-multinode-controlplane-clusters.md @@ -1,4 +1,5 @@ # Creating clusters with a multi-node control plane + `clusterctl` only supports creating clusters with a single instance control plane. However, cluster-api-provider-aws has the capability to create clusters with multiple control plane nodes. This document outlines the steps for standing @@ -45,27 +46,27 @@ control plane you want to add to your existing cluster. Copy the following YAML into a file named `control-plane-machine.yaml`. - ```bash - apiVersion: "cluster.k8s.io/v1alpha1" - kind: Machine - metadata: - name: - namespace: default # Edit this if necessary - labels: - cluster.k8s.io/cluster-name: - set: controlplane - spec: - versions: - kubelet: v1.13.3 - controlPlane: v1.13.3 - providerSpec: - value: - apiVersion: awsprovider/v1alpha1 - kind: AWSMachineProviderSpec - instanceType: "t2.medium" - iamInstanceProfile: "control-plane.cluster-api-provider-aws.sigs.k8s.io" - keyName: "cluster-api-provider-aws.sigs.k8s.io" - ``` +```yaml +apiVersion: "cluster.k8s.io/v1alpha1" +kind: Machine +metadata: + name: + namespace: default # Edit this if necessary + labels: + cluster.k8s.io/cluster-name: + set: controlplane +spec: + versions: + kubelet: v1.13.3 + controlPlane: v1.13.3 + providerSpec: + value: + apiVersion: awsprovider/v1alpha1 + kind: AWSMachineProviderSpec + instanceType: "t2.medium" + iamInstanceProfile: "control-plane.cluster-api-provider-aws.sigs.k8s.io" + keyName: "cluster-api-provider-aws.sigs.k8s.io" +``` *Pro tip* 💡: You may refer to the machine's YAML in the release to create the above YAML for yourself. @@ -76,9 +77,9 @@ control plane you want to add to your existing cluster. For each copy, edit the file with a unique machine name and create the machine object: - ```bash - kubectl apply -f control-plane-machine.yaml - ``` +```bash +kubectl apply -f control-plane-machine.yaml +``` Note: If you did not specify namespace in the `control-plane-machine.yaml` file(s) and your cluster is not in the `default` namespace, you will have to @@ -89,9 +90,9 @@ control plane you want to add to your existing cluster. Watch the newly created machine objects being reconciled by following the logs from the `aws-provider-controller-manager-0` pod using this command: - ```bash - kubectl -n aws-provider-system logs -f aws-provider-controller-manager-0 - ``` +```bash +kubectl -n aws-provider-system logs -f aws-provider-controller-manager-0 +``` Additionally you can view the new instances initializing in the AWS console. diff --git a/docs/releasing.md b/docs/releasing.md index 02466023b6..52c4c495da 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -3,7 +3,7 @@ ## Semi-automatic 1. Make sure your repo is clean by git's standards -2. If the controller has changed, it would be good to bump the version of the controller image. Look in `cmd/release/main.go`. +2. If this is a new minor release, create a new release branch and push to github, for example `release-0.2` 3. run `go run cmd/release/main.go -version v0.1.2` but replace the version with the version you'd like. 4. push the docker images that were generated with this release tool 5. Edit the release notes and make sure the binaries uploaded return the correct version @@ -12,19 +12,21 @@ ## Manual -1. Tag the repository and push the tag `git tag -s $VERSION` -1. Create a draft release in github and associate it with the tag that was just created -2. Checkout the tag you've just created and make sure git is in a clean state -3. Run `make release-artifacts` -4. Attach the tarball to the drafted release -5. Attach `clusterawsadm` and `clusterctl` to the drafted release (for darwin +1. Make sure your repo is clean by git's standards +2. If this is a new minor release, create a new release branch and push to github, for example `release-0.2` +3. Tag the repository and push the tag `git tag -s $VERSION` +4. Create a draft release in github and associate it with the tag that was just created +5. Checkout the tag you've just created and make sure git is in a clean state +6. Run `make release-artifacts` +7. Attach the tarball to the drafted release +8. Attach `clusterawsadm` and `clusterctl` to the drafted release (for darwin and linux architectures) -6. Write the release notes (see note below on release notes) -7. Get someone with permission (any ex heptio) to copy the container image from your own +9. Write the release notes (see note below on release notes) +10. Get someone with permission (any ex heptio) to copy the container image from your own personal gcr registry to the production one, or have them build and push the container image themselves. -8. Publish release -9. Email `kubernetes-dev@googlegroups.com` to announce the release +11. Publish release +12. Email `kubernetes-dev@googlegroups.com` to announce the release ## Expected artifacts diff --git a/docs/roleassumption.md b/docs/roleassumption.md new file mode 100644 index 0000000000..3d42242c3b --- /dev/null +++ b/docs/roleassumption.md @@ -0,0 +1,418 @@ +# Creating clusters using cross account role assumption using KIAM + +This document outlines the list of steps to create the target cluster via cross account role assumption using [KIAM](https://github.com/uswitch/kiam). +KIAM lets the controller pod(s) to assume an AWS role that enables them create AWS resources necessary to create an +operational cluster. This way we wouldn't have to mount any AWS credentials or load environment variables to +supply AWS credentials to the CAPA controller. This is automatically taken care by the KIAM components. +Note: If you dont want to use KIAM and rather want to mount the credentials as secrets, you may still achieve cross +account role assumption by using multiple profiles. + +### Glossary + +* Management cluster - The cluster that runs in AWS and is used to create target clusters in different AWS accounts +* Target account - The account where the target cluster is created +* Source account - The AWS account where the CAPA controllers for management cluster runs. + +## Goals +1. The CAPA controllers are running in an AWS account and you want to create the target cluster in another AWS account. +2. This assumes that you start with no existing clusters. + +## High level steps + +1. Creating a management cluster in AWS - This can be done by running the phases in clusterctl + * Uses the existing provider components yaml +2. Setting up cross account IAM roles +3. Deploying the KIAM server/agent +4. Create the target cluster (through KIAM) + * Uses different provider components with no secrets and annotation to indicate the IAM Role to assume. + +## 1. Creating the management cluster in AWS +Using clusterctl command we can create a new cluster in AWS which in turn will act as the +management cluster to create the target cluster(in a different AWS account. This can be achieved by using the phases in +clusterctl to perform all the steps except the pivoting. This will provide us with a bare-bones functioning cluster that +we can use as a management cluster. +To begin with follow the steps in this [getting started guide](https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/master/docs/getting-started.md) to setup the environment +except for creating the actual cluster. Instead follow the steps below to create the cluster. + +create a new cluster using kind for bootstrapping purpose by running: + +```$sh +kind create cluster --name +``` + +and get its kube config path by running + +```$sh +export KIND_KUBECONFIG=`kind get kubeconfig-path` +``` + +Use the following commands to create new management cluster in AWS. +```$sh +clusterctl alpha phases apply-cluster-api-components --provider-components cmd/clusterctl/examples/aws/out/provider-components.yaml \ +--kubeconfig $KIND_KUBECONFIG + +clusterctl alpha phases apply-cluster --cluster cmd/clusterctl/examples/aws/out/cluster.yaml --kubeconfig $KIND_KUBECONFIG +``` + +We only need to create the control plane on the cluster running in AWS source account. Since the example includes definition for a worker node, you may delete it. + +```$sh +clusterctl alpha phases apply-machines --machines cmd/clusterctl/examples/aws/out/machines.yaml --kubeconfig $KIND_KUBECONFIG + +clusterctl alpha phases get-kubeconfig --provider aws --cluster-name --kubeconfig $KIND_KUBECONFIG + +export AWS_KUBECONFIG=$PWD/kubeconfig + +kubectl apply -f cmd/clusterctl/examples/aws/out/addons.yaml --kubeconfig $AWS_KUBECONFIG +``` + +Verify that all the pods in the kube-system namespace are running smoothly. Also you may remove the additional node in +the machines example yaml since we are only interested in running the controllers that runs in control plane node +(although its not required to make any changes there). You can destroy your local kind cluster by running + +```$sh +kind delete cluster --name +``` + +## 2. Setting up cross account roles + +In this step we will create new roles/policy in across 2 different AWS accounts. +Let us start by creating the roles in the account where the AWS controller runs. Following the directions +posted in [KIAM repo](https://github.com/uswitch/kiam/blob/master/docs/IAM.md) create a "kiam_server" role +in AWS that only has a single managed policy with a single permission "sts:AssumeRole". Also add a trust policy on the + "kiam_server" role to include the role attached to the Control plane instance as a trusted entity. This looks something + like this: + + In "kiam_server" role (Source AWS account): + + ```$json +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "AWS": "arn:aws:iam:::role/control-plane.cluster-api-provider-aws.sigs.k8s.io" + }, + "Action": "sts:AssumeRole" + } + ] +} +``` + +Next we must establish a link between this "kiam_server" role on source AWS account and the role on target AWS account that has the permissions to create new cluster. +Begin by running the clusterawsadm cli to create a new stack on the target account where the target cluster is created. Make sure you use the credentials for target AWS account before creating the stack. + +```clusterawsadm alpha bootstrap create-stack``` + +Then sign-in to the target AWS account to establish the link as mentioned above. Create a new Role with the permission policy set to "controllers.cluster-api-provider-aws.sigs.k8s.io". Lets name this role "cluster-api" for future reference. Add a new trust relationship to include the "kiam_server" role from the source account as trusted entity. This is shown below: + +In "controllers.cluster-api-provider-aws.sigs.k8s.io" role(target AWS account) + +```$json +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "AWS": "arn:aws:iam:::role/kserver" + }, + "Action": "sts:AssumeRole" + } + ] +} +``` + +## 3. Deploying the KIAM server & agent +By now, your target cluster must be up & running. Make sure your KUBECONFIG pointing to the cluster in the target account. + +Create new secrets using the steps outlined [here](https://github.com/uswitch/kiam/blob/master/docs/TLS.md) +Apply the manifest shown below: +Make sure you update the argument to include your source AWS account "--assume-role-arn=arn:aws:iam:::role/kiam_server" +server.yaml + +``` +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + namespace: kube-system + name: kiam-server +spec: + template: + metadata: + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9620" + labels: + app: kiam + role: server + spec: + serviceAccountName: kiam-server + nodeSelector: + node-role.kubernetes.io/master: "" + tolerations: + - operator: "Exists" + volumes: + - name: ssl-certs + hostPath: + # for AWS linux or RHEL distros + # path: /etc/pki/ca-trust/extracted/pem/ + path: /etc/ssl/certs/ + - name: tls + secret: + secretName: kiam-server-tls + hostNetwork: true + containers: + - name: kiam + image: quay.io/uswitch/kiam:v3.2 + imagePullPolicy: Always + command: + - /kiam + args: + - server + - --json-log + - --level=warn + - --bind=0.0.0.0:443 + - --cert=/etc/kiam/tls/server.pem + - --key=/etc/kiam/tls/server-key.pem + - --ca=/etc/kiam/tls/ca.pem + - --role-base-arn-autodetect + - --assume-role-arn=arn:aws:iam:::role/kiam_server + - --sync=1m + - --prometheus-listen-addr=0.0.0.0:9620 + - --prometheus-sync-interval=5s + volumeMounts: + - mountPath: /etc/ssl/certs + name: ssl-certs + - mountPath: /etc/kiam/tls + name: tls + livenessProbe: + exec: + command: + - /kiam + - health + - --cert=/etc/kiam/tls/server.pem + - --key=/etc/kiam/tls/server-key.pem + - --ca=/etc/kiam/tls/ca.pem + - --server-address=127.0.0.1:443 + - --gateway-timeout-creation=1s + - --timeout=5s + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 10 + readinessProbe: + exec: + command: + - /kiam + - health + - --cert=/etc/kiam/tls/server.pem + - --key=/etc/kiam/tls/server-key.pem + - --ca=/etc/kiam/tls/ca.pem + - --server-address=127.0.0.1:443 + - --gateway-timeout-creation=1s + - --timeout=5s + initialDelaySeconds: 3 + periodSeconds: 10 + timeoutSeconds: 10 +--- +apiVersion: v1 +kind: Service +metadata: + name: kiam-server + namespace: kube-system +spec: + clusterIP: None + selector: + app: kiam + role: server + ports: + - name: grpclb + port: 443 + targetPort: 443 + protocol: TCP +``` + +agent.yaml + +``` +apiVersion: apps/v1 +kind: DaemonSet +metadata: + namespace: kube-system + name: kiam-agent +spec: + template: + metadata: + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9620" + labels: + app: kiam + role: agent + spec: + hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet + tolerations: + - operator: "Exists" + volumes: + - name: ssl-certs + hostPath: + # for AWS linux or RHEL distros + #path: /etc/pki/ca-trust/extracted/pem/ + path: /etc/ssl/certs/ + - name: tls + secret: + secretName: kiam-agent-tls + - name: xtables + hostPath: + path: /run/xtables.lock + type: FileOrCreate + containers: + - name: kiam + securityContext: + capabilities: + add: ["NET_ADMIN"] + image: quay.io/uswitch/kiam:v3.2 + imagePullPolicy: Always + command: + - /kiam + args: + - agent + - --iptables + - --host-interface=cali+ + - --json-log + - --port=8181 + - --cert=/etc/kiam/tls/agent.pem + - --key=/etc/kiam/tls/agent-key.pem + - --ca=/etc/kiam/tls/ca.pem + - --server-address=kiam-server:443 + - --prometheus-listen-addr=0.0.0.0:9620 + - --prometheus-sync-interval=5s + - --gateway-timeout-creation=1s + env: + - name: HOST_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + volumeMounts: + - mountPath: /etc/ssl/certs + name: ssl-certs + - mountPath: /etc/kiam/tls + name: tls + - mountPath: /var/run/xtables.lock + name: xtables + livenessProbe: + httpGet: + path: /ping + port: 8181 + initialDelaySeconds: 3 + periodSeconds: 3 +``` + +server-rbac.yaml + +``` +--- +kind: ServiceAccount +apiVersion: v1 +metadata: + name: kiam-server + namespace: kube-system +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: kiam-read +rules: +- apiGroups: + - "" + resources: + - namespaces + - pods + verbs: + - watch + - get + - list +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: kiam-read +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: kiam-read +subjects: +- kind: ServiceAccount + name: kiam-server + namespace: kube-system +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: kiam-write +rules: +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: kiam-write +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: kiam-write +subjects: +- kind: ServiceAccount + name: kiam-server + namespace: kube-system +``` + +After deploying the above components make sure that the kiam_server and kiam_agent pods are up and running. + +## 4. Create the target cluster +Make sure you create copy of the "aws/out" directory called "out2". To create the target cluster we must update the provider_components.yaml generated in the out2 directory as shown below (to be run from the repository root directory): + +``` +cp cmd/clusterctl/examples/aws/out cmd/clusterctl/examples/aws/out2 +vi cmd/clusterctl/examples/aws/out2/provider-components.yaml +``` + +1. Remove the credentials secret added at the bottom of the provider_components.yaml and do not mount the secret +2. Add the following annotation to the template of aws-provider-controller-manager stateful set to specify the new role that was created in target account. +``` + annotations: + iam.amazonaws.com/role: arn:aws:iam:::role/cluster-api +``` +3. Also add this below annotation to the "aws-provider-system" namespace +``` + annotations: + iam.amazonaws.com/permitted: ".*" +``` + +Create a new cluster using the steps similar to the one used to create the source cluster. They are as follows: +```$sh +export SOURCE_KUBECONFIG= + +clusterctl alpha phases apply-cluster-api-components --provider-components cmd/clusterctl/examples/aws/out2/provider-components.yaml \ +--kubeconfig $SOURCE_KUBECONFIG + +kubectl -f apply cmd/clusterctl/examples/aws/out2/cluster.yaml --kubeconfig $SOURCE_KUBECONFIG + +kubectl apply -f cmd/clusterctl/examples/aws/out2/machines.yaml --kubeconfig $SOURCE_KUBECONFIG + +clusterctl alpha phases get-kubeconfig --provider aws --cluster-name --kubeconfig $SOURCE_KUBECONFIG +export KUBECONFIG=$PWD/kubeconfig + +kubectl apply -f cmd/clusterctl/examples/aws/out2/addons.yaml + +``` +This creates the new cluster in the target AWS account. diff --git a/hack/BUILD b/hack/BUILD.bazel similarity index 100% rename from hack/BUILD rename to hack/BUILD.bazel diff --git a/hack/checkin_account.py b/hack/checkin_account.py old mode 100644 new mode 100755 diff --git a/hack/checkout_account.py b/hack/checkout_account.py index 44e92a8b12..8b755c5c81 100755 --- a/hack/checkout_account.py +++ b/hack/checkout_account.py @@ -27,24 +27,36 @@ RESOURCE_TYPE = "aws-account" USER = "cluster-api-provider-aws" -if __name__ == "__main__": - conn = httplib.HTTPConnection(BOSKOS_HOST) - +def post_request(host, input_state = "clean"): + conn = httplib.HTTPConnection(host) conn.request("POST", "/acquire?%s" % urllib.urlencode({ 'type': RESOURCE_TYPE, 'owner': USER, - 'state': 'free', + 'state': input_state, 'dest': 'busy', }) ) resp = conn.getresponse() - if resp.status != 200: - sys.exit("Got invalid response %d" % resp.status) - - body = json.load(resp) + status = resp.status + reason = resp.reason + body = resp.read() conn.close() + return status, reason, body + +if __name__ == "__main__": + status, reason, result = post_request(BOSKOS_HOST) + # we're working around an issue with the data in boskos. + # We'll remove the code that tries both free and clean once all the data is good. + # Afterwards we should just check for free + if status == 404: + status, reason, result = post_request(BOSKOS_HOST, "free") + + if status != 200: + sys.exit("Got invalid response %d: %s" % (status, reason)) + + body = json.loads(result) print 'export BOSKOS_RESOURCE_NAME="%s";' % body['name'] print 'export AWS_ACCESS_KEY_ID="%s";' % body['userdata']['access-key-id'] print 'export AWS_SECRET_ACCESS_KEY="%s";' % body['userdata']['secret-access-key'] - + \ No newline at end of file diff --git a/hack/copy-bazel-mocks.sh b/hack/copy-bazel-mocks.sh new file mode 100755 index 0000000000..655a149081 --- /dev/null +++ b/hack/copy-bazel-mocks.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# Copyright 2019 The Kubernetes Authors. +# +# 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. + +set -o errexit +set -o nounset +set -o pipefail + +REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. +cd "${REPO_ROOT}" || exit 1 + +BOILERPLATE=$(sed "s/YEAR/$(date +%Y)/g" < hack/boilerplate/boilerplate.go.txt) + +while IFS= read -r -d '' file +do + out=$(echo "${file}" | sed "s#bazel-bin/##g") + echo -e "${BOILERPLATE}\n" > "${out}" + cat "${file}" >> "${out}" +done < <(find bazel-bin/pkg -name '*_mock.go' -type f -print0) diff --git a/hack/print-workspace-status.sh b/hack/print-workspace-status.sh index 150bfc6471..ccdd3fc1ed 100755 --- a/hack/print-workspace-status.sh +++ b/hack/print-workspace-status.sh @@ -81,7 +81,7 @@ GIT_RELEASE_TAG ${GIT_RELEASE_TAG-} GIT_RELEASE_COMMIT ${GIT_RELEASE_COMMIT-} STABLE_AWS_ACCESS_KEY_ID ${AWS_ACCESS_KEY_ID-} STABLE_AWS_SECRET_ACCESS_KEY ${AWS_SECRET_ACCESS_KEY-} -STABLE_AWS_DEFAULT_REGION ${AWS_DEFAULT_REGION-} -STABLE_AWS_REGION ${AWS_REGION:-${AWS_DEFAULT_REGION-}} +STABLE_AWS_DEFAULT_REGION ${AWS_DEFAULT_REGION:-${AWS_REGION-}} +STABLE_AWS_REGION ${AWS_DEFAULT_REGION:-${AWS_REGION-}} STABLE_AWS_SESSION_TOKEN ${AWS_SESSION_TOKEN-} EOF diff --git a/pkg/apis/BUILD b/pkg/apis/BUILD.bazel similarity index 100% rename from pkg/apis/BUILD rename to pkg/apis/BUILD.bazel diff --git a/pkg/apis/awsprovider/BUILD b/pkg/apis/awsprovider/BUILD.bazel similarity index 100% rename from pkg/apis/awsprovider/BUILD rename to pkg/apis/awsprovider/BUILD.bazel diff --git a/pkg/apis/awsprovider/v1alpha1/BUILD b/pkg/apis/awsprovider/v1alpha1/BUILD.bazel similarity index 100% rename from pkg/apis/awsprovider/v1alpha1/BUILD rename to pkg/apis/awsprovider/v1alpha1/BUILD.bazel diff --git a/pkg/apis/awsprovider/v1alpha1/awsmachineproviderconfig_types.go b/pkg/apis/awsprovider/v1alpha1/awsmachineproviderconfig_types.go index e4d22ea985..a0fbc3b919 100644 --- a/pkg/apis/awsprovider/v1alpha1/awsmachineproviderconfig_types.go +++ b/pkg/apis/awsprovider/v1alpha1/awsmachineproviderconfig_types.go @@ -37,6 +37,9 @@ type AWSMachineProviderSpec struct { // AMI is the reference to the AMI from which to create the machine instance. AMI AWSResourceReference `json:"ami,omitempty"` + // ImageLookupOrg is the AWS Organization ID to use for image lookup if AMI is not set. + ImageLookupOrg string `json:"imageLookupOrg,omitempty"` + // InstanceType is the type of instance to create. Example: m4.xlarge InstanceType string `json:"instanceType,omitempty"` @@ -74,6 +77,10 @@ type AWSMachineProviderSpec struct { // +optional KeyName string `json:"keyName,omitempty"` + // RootDeviceSize is the size of the root volume. + // +optional + RootDeviceSize int64 `json:"rootDeviceSize,omitempty"` + // KubeadmConfiguration holds the kubeadm configuration options // +optional KubeadmConfiguration KubeadmConfiguration `json:"kubeadmConfiguration,omitempty"` diff --git a/pkg/apis/awsprovider/v1alpha1/types.go b/pkg/apis/awsprovider/v1alpha1/types.go index cfd2eb20e2..c7f4dfc10f 100644 --- a/pkg/apis/awsprovider/v1alpha1/types.go +++ b/pkg/apis/awsprovider/v1alpha1/types.go @@ -266,6 +266,9 @@ var ( // SecurityGroupProtocolAll is a wildcard for all IP protocols SecurityGroupProtocolAll = SecurityGroupProtocol("-1") + // SecurityGroupProtocolIPinIP represents the IP in IP protocol in ingress rules + SecurityGroupProtocolIPinIP = SecurityGroupProtocol("4") + // SecurityGroupProtocolTCP represents the TCP protocol in ingress rules SecurityGroupProtocolTCP = SecurityGroupProtocol("tcp") @@ -274,6 +277,9 @@ var ( // SecurityGroupProtocolICMP represents the ICMP protocol in ingress rules SecurityGroupProtocolICMP = SecurityGroupProtocol("icmp") + + // SecurityGroupProtocolICMPv6 represents the ICMPv6 protocol in ingress rules + SecurityGroupProtocolICMPv6 = SecurityGroupProtocol("58") ) // IngressRule defines an AWS ingress rule for security groups. @@ -417,6 +423,9 @@ type Instance struct { // Indicates whether the instance is optimized for Amazon EBS I/O. EBSOptimized *bool `json:"ebsOptimized,omitempty"` + // Specifies size (in Gi) of the root storage device + RootDeviceSize int64 `json:"rootDeviceSize,omitempty"` + // The tags associated with the instance. Tags map[string]string `json:"tags,omitempty"` } diff --git a/pkg/cloud/aws/actuators/BUILD.bazel b/pkg/cloud/aws/actuators/BUILD.bazel index 270aecaa24..8f82976c92 100644 --- a/pkg/cloud/aws/actuators/BUILD.bazel +++ b/pkg/cloud/aws/actuators/BUILD.bazel @@ -18,12 +18,15 @@ go_library( "//vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/elb:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/elb/elbiface:go_default_library", + "//vendor/github.com/go-logr/logr:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/klog:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", + "//vendor/k8s.io/klog/klogr:go_default_library", "//vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1:go_default_library", "//vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1:go_default_library", + "//vendor/sigs.k8s.io/controller-runtime/pkg/patch:go_default_library", "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/pkg/cloud/aws/actuators/cluster/BUILD.bazel b/pkg/cloud/aws/actuators/cluster/BUILD.bazel index 16ea6c04e7..413d01d7a4 100644 --- a/pkg/cloud/aws/actuators/cluster/BUILD.bazel +++ b/pkg/cloud/aws/actuators/cluster/BUILD.bazel @@ -11,8 +11,9 @@ go_library( "//pkg/cloud/aws/services/ec2:go_default_library", "//pkg/cloud/aws/services/elb:go_default_library", "//pkg/deployer:go_default_library", + "//vendor/github.com/go-logr/logr:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", - "//vendor/k8s.io/klog:go_default_library", + "//vendor/k8s.io/klog/klogr:go_default_library", "//vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1:go_default_library", "//vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1:go_default_library", "//vendor/sigs.k8s.io/cluster-api/pkg/controller/error:go_default_library", diff --git a/pkg/cloud/aws/actuators/cluster/actuator.go b/pkg/cloud/aws/actuators/cluster/actuator.go index 7c7813cd5f..dde799b8c6 100644 --- a/pkg/cloud/aws/actuators/cluster/actuator.go +++ b/pkg/cloud/aws/actuators/cluster/actuator.go @@ -17,8 +17,9 @@ limitations under the License. package cluster import ( + "github.com/go-logr/logr" "github.com/pkg/errors" - "k8s.io/klog" + "k8s.io/klog/klogr" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/actuators" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/certificates" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/ec2" @@ -37,11 +38,13 @@ type Actuator struct { *deployer.Deployer client client.ClusterV1alpha1Interface + log logr.Logger } // ActuatorParams holds parameter information for Actuator type ActuatorParams struct { - Client client.ClusterV1alpha1Interface + Client client.ClusterV1alpha1Interface + LoggingContext string } // NewActuator creates a new Actuator @@ -49,14 +52,15 @@ func NewActuator(params ActuatorParams) *Actuator { return &Actuator{ Deployer: deployer.New(deployer.Params{ScopeGetter: actuators.DefaultScopeGetter}), client: params.Client, + log: klogr.New().WithName(params.LoggingContext), } } // Reconcile reconciles a cluster and is invoked by the Cluster Controller func (a *Actuator) Reconcile(cluster *clusterv1.Cluster) error { - klog.Infof("Reconciling cluster %v", cluster.Name) + a.log.Info("Reconciling Cluster", "cluster-name", cluster.Name, "cluster-namespace", cluster.Namespace) - scope, err := actuators.NewScope(actuators.ScopeParams{Cluster: cluster, Client: a.client}) + scope, err := actuators.NewScope(actuators.ScopeParams{Cluster: cluster, Client: a.client, Logger: a.log}) if err != nil { return errors.Errorf("failed to create scope: %+v", err) } @@ -89,9 +93,13 @@ func (a *Actuator) Reconcile(cluster *clusterv1.Cluster) error { // Delete deletes a cluster and is invoked by the Cluster Controller func (a *Actuator) Delete(cluster *clusterv1.Cluster) error { - klog.Infof("Deleting cluster %v.", cluster.Name) + a.log.Info("Deleting cluster", "cluster-name", cluster.Name, "cluster-namespace", cluster.Namespace) - scope, err := actuators.NewScope(actuators.ScopeParams{Cluster: cluster, Client: a.client}) + scope, err := actuators.NewScope(actuators.ScopeParams{ + Cluster: cluster, + Client: a.client, + Logger: a.log, + }) if err != nil { return errors.Errorf("failed to create scope: %+v", err) } @@ -110,7 +118,7 @@ func (a *Actuator) Delete(cluster *clusterv1.Cluster) error { } if err := ec2svc.DeleteNetwork(); err != nil { - klog.Errorf("Error deleting cluster %v: %v.", cluster.Name, err) + a.log.Error(err, "Error deleting cluster", "cluster-name", cluster.Name, "cluster-namespace", cluster.Namespace) return &controllerError.RequeueAfterError{ RequeueAfter: 5 * 1000 * 1000 * 1000, } diff --git a/pkg/cloud/aws/actuators/machine/BUILD.bazel b/pkg/cloud/aws/actuators/machine/BUILD.bazel index ca0f0b4fa2..a6ba74dea1 100644 --- a/pkg/cloud/aws/actuators/machine/BUILD.bazel +++ b/pkg/cloud/aws/actuators/machine/BUILD.bazel @@ -20,13 +20,14 @@ go_library( "//pkg/deployer:go_default_library", "//pkg/tokens:go_default_library", "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", + "//vendor/github.com/go-logr/logr:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd/api:go_default_library", - "//vendor/k8s.io/klog:go_default_library", + "//vendor/k8s.io/klog/klogr:go_default_library", "//vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1:go_default_library", "//vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1:go_default_library", "//vendor/sigs.k8s.io/cluster-api/pkg/controller/error:go_default_library", diff --git a/pkg/cloud/aws/actuators/machine/actuator.go b/pkg/cloud/aws/actuators/machine/actuator.go index 8d634304e0..9f67fb19b7 100644 --- a/pkg/cloud/aws/actuators/machine/actuator.go +++ b/pkg/cloud/aws/actuators/machine/actuator.go @@ -24,6 +24,7 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" + "github.com/go-logr/logr" "github.com/pkg/errors" apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -31,7 +32,7 @@ import ( corev1 "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/tools/clientcmd" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - "k8s.io/klog" + "k8s.io/klog/klogr" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1alpha1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/actuators" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/awserrors" @@ -57,19 +58,25 @@ const ( type Actuator struct { *deployer.Deployer - client client.ClusterV1alpha1Interface + coreClient corev1.CoreV1Interface + clusterClient client.ClusterV1alpha1Interface + log logr.Logger } // ActuatorParams holds parameter information for Actuator. type ActuatorParams struct { - Client client.ClusterV1alpha1Interface + CoreClient corev1.CoreV1Interface + ClusterClient client.ClusterV1alpha1Interface + LoggingContext string } // NewActuator returns an actuator. func NewActuator(params ActuatorParams) *Actuator { return &Actuator{ - Deployer: deployer.New(deployer.Params{ScopeGetter: actuators.DefaultScopeGetter}), - client: params.Client, + Deployer: deployer.New(deployer.Params{ScopeGetter: actuators.DefaultScopeGetter}), + coreClient: params.CoreClient, + clusterClient: params.ClusterClient, + log: klogr.New().WithName(params.LoggingContext), } } @@ -98,7 +105,8 @@ func (a *Actuator) isNodeJoin(scope *actuators.MachineScope, controlPlaneMachine m, err := actuators.NewMachineScope(actuators.MachineScopeParams{ Machine: cm, Cluster: scope.Cluster, - Client: a.client, + Client: a.clusterClient, + Logger: a.log, }) if err != nil { @@ -112,7 +120,7 @@ func (a *Actuator) isNodeJoin(scope *actuators.MachineScope, controlPlaneMachine return false, errors.Wrapf(err, "failed to verify existence of machine %q", m.Name()) } - klog.V(2).Infof("Machine %q should join the controlplane: %t", scope.Machine.Name, ok) + a.log.V(2).Info("Machine joining control plane", "machine-name", scope.Machine.Name, "machine-namespace", scope.Machine.Name, "should-join-control-plane", ok) return ok, nil } @@ -127,9 +135,9 @@ func (a *Actuator) Create(ctx context.Context, cluster *clusterv1.Cluster, machi if cluster == nil { return errors.Errorf("missing cluster for machine %s/%s", machine.Namespace, machine.Name) } - klog.Infof("Creating machine %v for cluster %v", machine.Name, cluster.Name) + a.log.Info("Creating machine in cluster", "machine-name", machine.Name, "machine-namespace", machine.Namespace, "cluster-name", cluster.Name) - scope, err := actuators.NewMachineScope(actuators.MachineScopeParams{Machine: machine, Cluster: cluster, Client: a.client}) + scope, err := actuators.NewMachineScope(actuators.MachineScopeParams{Machine: machine, Cluster: cluster, Client: a.clusterClient, Logger: a.log}) if err != nil { return errors.Errorf("failed to create scope: %+v", err) } @@ -171,7 +179,7 @@ func (a *Actuator) Create(ctx context.Context, cluster *clusterv1.Cluster, machi i, err := ec2svc.CreateOrGetMachine(scope, bootstrapToken, kubeConfig) if err != nil { if awserrors.IsFailedDependency(errors.Cause(err)) { - klog.Errorf("network not ready to launch instances yet: %+v", err) + a.log.Error(err, "network not ready to launch instances yet") return &controllerError.RequeueAfterError{ RequeueAfter: time.Minute, } @@ -192,7 +200,7 @@ func (a *Actuator) Create(ctx context.Context, cluster *clusterv1.Cluster, machi if err := a.reconcileLBAttachment(scope, machine, i); err != nil { return errors.Errorf("failed to reconcile LB attachment: %+v", err) } - + a.log.Info("Create completed", "machine-name", machine.Name) return nil } @@ -236,9 +244,9 @@ func (a *Actuator) Delete(ctx context.Context, cluster *clusterv1.Cluster, machi if cluster == nil { return errors.Errorf("missing cluster for machine %s/%s", machine.Namespace, machine.Name) } - klog.Infof("Deleting machine %v for cluster %v.", machine.Name, cluster.Name) + a.log.Info("Deleting machine in cluster", "machine-name", machine.Name, "machine-namespace", machine.Namespace, "cluster-name", cluster.Name) - scope, err := actuators.NewMachineScope(actuators.MachineScopeParams{Machine: machine, Cluster: cluster, Client: a.client}) + scope, err := actuators.NewMachineScope(actuators.MachineScopeParams{Machine: machine, Cluster: cluster, Client: a.clusterClient, Logger: a.log}) if err != nil { return errors.Errorf("failed to create scope: %+v", err) } @@ -258,7 +266,7 @@ func (a *Actuator) Delete(ctx context.Context, cluster *clusterv1.Cluster, machi return errors.Errorf("failed to query instance by tags: %+v", err) } else if instance == nil { // The machine hasn't been created yet - klog.V(3).Info("Instance is nil and therefore does not exist") + a.log.V(3).Info("Instance is nil and therefore does not exist") return nil } } @@ -269,15 +277,15 @@ func (a *Actuator) Delete(ctx context.Context, cluster *clusterv1.Cluster, machi // https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html switch instance.State { case v1alpha1.InstanceStateShuttingDown, v1alpha1.InstanceStateTerminated: - klog.Infof("instance %q is shutting down or already terminated", machine.Name) + a.log.Info("Machine instance is shutting down or already terminated") return nil default: + a.log.Info("Terminating machine") if err := ec2svc.TerminateInstance(instance.ID); err != nil { return errors.Errorf("failed to terminate instance: %+v", err) } } - klog.Info("shutdown signal was sent. Shutting down machine.") return nil } @@ -300,6 +308,11 @@ func (a *Actuator) isMachineOutdated(machineSpec *v1alpha1.AWSMachineProviderSpe errs = append(errs, errors.Errorf("SSH key name cannot be mutated from %q to %q", aws.StringValue(instance.KeyName), machineSpec.KeyName)) } + // Root Device Size + if machineSpec.RootDeviceSize > 0 && machineSpec.RootDeviceSize != instance.RootDeviceSize { + errs = append(errs, errors.Errorf("Root volume size cannot be mutated from %v to %v", instance.RootDeviceSize, machineSpec.RootDeviceSize)) + } + // Subnet ID // machineSpec.Subnet is a *AWSResourceReference and could technically be // a *string, ARN or Filter. However, elsewhere in the code it is only used @@ -337,9 +350,9 @@ func (a *Actuator) Update(ctx context.Context, cluster *clusterv1.Cluster, machi return errors.Errorf("missing cluster for machine %s/%s", machine.Namespace, machine.Name) } - klog.Infof("Updating machine %v for cluster %v.", machine.Name, cluster.Name) + a.log.Info("Updating machine in cluster", "machine-name", machine.Name, "machine-namespace", machine.Namespace, "cluster-name", cluster.Name) - scope, err := actuators.NewMachineScope(actuators.MachineScopeParams{Machine: machine, Cluster: cluster, Client: a.client}) + scope, err := actuators.NewMachineScope(actuators.MachineScopeParams{Machine: machine, Cluster: cluster, Client: a.clusterClient, Logger: a.log}) if err != nil { return errors.Errorf("failed to create scope: %+v", err) } @@ -388,9 +401,9 @@ func (a *Actuator) Exists(ctx context.Context, cluster *clusterv1.Cluster, machi return false, errors.Errorf("missing cluster for machine %s/%s", machine.Namespace, machine.Name) } - klog.Infof("Checking if machine %v for cluster %v exists", machine.Name, cluster.Name) + a.log.Info("Checking if machine exists in cluster", "machine-name", machine.Name, "machine-namespace", machine.Namespace, "cluster-name", cluster.Name) - scope, err := actuators.NewMachineScope(actuators.MachineScopeParams{Machine: machine, Cluster: cluster, Client: a.client}) + scope, err := actuators.NewMachineScope(actuators.MachineScopeParams{Machine: machine, Cluster: cluster, Client: a.clusterClient, Logger: a.log}) if err != nil { return false, errors.Errorf("failed to create scope: %+v", err) } @@ -413,13 +426,13 @@ func (a *Actuator) Exists(ctx context.Context, cluster *clusterv1.Cluster, machi return false, nil } - klog.Infof("Found instance for machine %q: %v", machine.Name, instance) + a.log.Info("Found instance for machine", "machine-name", machine.Name, "machine-namespace", machine.Namespace, "instance", instance) switch instance.State { case v1alpha1.InstanceStateRunning: - klog.Infof("Machine %v is running", *scope.MachineStatus.InstanceID) + a.log.Info("Machine instance is running", "instance-id", *scope.MachineStatus.InstanceID) case v1alpha1.InstanceStatePending: - klog.Infof("Machine %v is pending", *scope.MachineStatus.InstanceID) + a.log.Info("Machine instance is pending", "instance-id", *scope.MachineStatus.InstanceID) default: return false, nil } @@ -441,13 +454,12 @@ func (a *Actuator) Exists(ctx context.Context, cluster *clusterv1.Cluster, machi // Set the Machine NodeRef. if machine.Status.NodeRef == nil { nodeRef, err := a.getNodeReference(scope) - if err != nil { - klog.Warningf("Failed to set nodeRef: %v", err) - return true, nil + if err == nil { + scope.Machine.Status.NodeRef = nodeRef + a.log.V(2).Info("Setting machine's nodeRef", "machine-name", scope.Name(), "machine-namespace", scope.Namespace(), "nodeRef", nodeRef.Name) + } else { + a.log.Info("Cannot set nodeRef", "error", err) } - - scope.Machine.Status.NodeRef = nodeRef - klog.Infof("Setting machine %q nodeRef to %q", scope.Name(), nodeRef.Name) } return true, nil @@ -456,15 +468,10 @@ func (a *Actuator) Exists(ctx context.Context, cluster *clusterv1.Cluster, machi func (a *Actuator) getNodeReference(scope *actuators.MachineScope) (*apicorev1.ObjectReference, error) { instanceID := *scope.MachineStatus.InstanceID - coreClient, err := a.coreV1Client(scope.Cluster) - if err != nil { - return nil, errors.Wrapf(err, "failed to retrieve corev1 client for cluster %q", scope.Cluster.Name) - } - listOpt := metav1.ListOptions{} for { - nodeList, err := coreClient.Nodes().List(listOpt) + nodeList, err := a.coreClient.Nodes().List(listOpt) if err != nil { return nil, errors.Wrap(err, "failed to query cluster nodes") } diff --git a/pkg/cloud/aws/actuators/machine/actuator_test.go b/pkg/cloud/aws/actuators/machine/actuator_test.go index 2a6c7f91aa..14aee4427b 100644 --- a/pkg/cloud/aws/actuators/machine/actuator_test.go +++ b/pkg/cloud/aws/actuators/machine/actuator_test.go @@ -443,6 +443,35 @@ func TestImmutableStateChange(t *testing.T) { }, expected: 1, }, + { + name: "root device size is omitted", + machineSpec: v1alpha1.AWSMachineProviderSpec{}, + instance: v1alpha1.Instance{ + // All instances have a root device size, even when we don't set one + RootDeviceSize: 12, + }, + expected: 0, + }, + { + name: "root device size is unchanged", + machineSpec: v1alpha1.AWSMachineProviderSpec{ + RootDeviceSize: 12, + }, + instance: v1alpha1.Instance{ + RootDeviceSize: 12, + }, + expected: 0, + }, + { + name: "root device size is changed", + machineSpec: v1alpha1.AWSMachineProviderSpec{ + RootDeviceSize: 12, + }, + instance: v1alpha1.Instance{ + RootDeviceSize: 16, + }, + expected: 1, + }, { name: "multiple immutable changes", machineSpec: v1alpha1.AWSMachineProviderSpec{ diff --git a/pkg/cloud/aws/actuators/machine_scope.go b/pkg/cloud/aws/actuators/machine_scope.go index 061a9cdea8..faa3e51666 100644 --- a/pkg/cloud/aws/actuators/machine_scope.go +++ b/pkg/cloud/aws/actuators/machine_scope.go @@ -17,13 +17,19 @@ limitations under the License. package actuators import ( + "encoding/json" + "fmt" + "reflect" + + "github.com/go-logr/logr" "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/klog" + "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1alpha1" clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" client "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" + "sigs.k8s.io/controller-runtime/pkg/patch" "sigs.k8s.io/yaml" ) @@ -33,17 +39,22 @@ type MachineScopeParams struct { Cluster *clusterv1.Cluster Machine *clusterv1.Machine Client client.ClusterV1alpha1Interface + Logger logr.Logger } // NewMachineScope creates a new MachineScope from the supplied parameters. // This is meant to be called for each machine actuator operation. func NewMachineScope(params MachineScopeParams) (*MachineScope, error) { - scope, err := NewScope(ScopeParams{AWSClients: params.AWSClients, Client: params.Client, Cluster: params.Cluster}) + scope, err := NewScope(ScopeParams{ + AWSClients: params.AWSClients, + Client: params.Client, Cluster: params.Cluster, + Logger: params.Logger, + }) if err != nil { return nil, err } - machineConfig, err := MachineConfigFromProviderSpec(params.Client, params.Machine.Spec.ProviderSpec) + machineConfig, err := MachineConfigFromProviderSpec(params.Client, params.Machine.Spec.ProviderSpec, scope.Logger) if err != nil { return nil, errors.Wrap(err, "failed to get machine config") } @@ -57,10 +68,11 @@ func NewMachineScope(params MachineScopeParams) (*MachineScope, error) { if params.Client != nil { machineClient = params.Client.Machines(params.Machine.Namespace) } - + scope.Logger = scope.Logger.WithName(params.Machine.Name) return &MachineScope{ Scope: scope, Machine: params.Machine, + MachineCopy: params.Machine.DeepCopy(), MachineClient: machineClient, MachineConfig: machineConfig, MachineStatus: machineStatus, @@ -71,7 +83,9 @@ func NewMachineScope(params MachineScopeParams) (*MachineScope, error) { type MachineScope struct { *Scope - Machine *clusterv1.Machine + Machine *clusterv1.Machine + // MachineCopy is used to generate a patch diff at the end of the scope's lifecycle. + MachineCopy *clusterv1.Machine MachineClient client.MachineInterface MachineConfig *v1alpha1.AWSMachineProviderSpec MachineStatus *v1alpha1.AWSMachineProviderStatus @@ -97,25 +111,14 @@ func (m *MachineScope) Region() string { return m.Scope.Region() } -func (m *MachineScope) storeMachineSpec(machine *clusterv1.Machine) (*clusterv1.Machine, error) { - ext, err := v1alpha1.EncodeMachineSpec(m.MachineConfig) - if err != nil { - return nil, err - } - - machine.Spec.ProviderSpec.Value = ext - return m.MachineClient.Update(machine) +// GetMachine returns the machine wrapped in the scope. +func (m *MachineScope) GetMachine() *clusterv1.Machine { + return m.Machine } -func (m *MachineScope) storeMachineStatus(machine *clusterv1.Machine) (*clusterv1.Machine, error) { - ext, err := v1alpha1.EncodeMachineStatus(m.MachineStatus) - if err != nil { - return nil, err - } - - m.Machine.Status.DeepCopyInto(&machine.Status) - machine.Status.ProviderStatus = ext - return m.MachineClient.UpdateStatus(machine) +// GetScope returns the scope that is wrapping the machine. +func (m *MachineScope) GetScope() *Scope { + return m.Scope } // Close the MachineScope by updating the machine spec, machine status. @@ -124,56 +127,98 @@ func (m *MachineScope) Close() { return } - latestMachine, err := m.storeMachineSpec(m.Machine) + ext, err := v1alpha1.EncodeMachineSpec(m.MachineConfig) + if err != nil { + m.Error(err, "failed to encode machine spec") + return + } + newStatus, err := v1alpha1.EncodeMachineStatus(m.MachineStatus) if err != nil { - klog.Errorf("[machinescope] failed to update machine %q in namespace %q: %v", m.Machine.Name, m.Machine.Namespace, err) + m.Error(err, "failed to encode machine status") return } + oldStatus, err := v1alpha1.MachineStatusFromProviderStatus(m.MachineCopy.Status.ProviderStatus) + if err != nil { + m.Error(err, "failed to get machine status from provider status") + return + } + + m.Machine.Spec.ProviderSpec.Value = ext - _, err = m.storeMachineStatus(latestMachine) + p, err := patch.NewJSONPatch(m.MachineCopy, m.Machine) if err != nil { - klog.Errorf("[machinescope] failed to store provider status for machine %q in namespace %q: %v", m.Machine.Name, m.Machine.Namespace, err) + m.Error(err, "failed to create new JSONPatch for machine") + return + } + + if len(p) != 0 { + pb, err := json.MarshalIndent(p, "", " ") + if err != nil { + m.Error(err, "failed to json marshal patch for machine") + return + } + + m.Logger.V(1).Info("Patching machine") + result, err := m.MachineClient.Patch(m.Machine.Name, types.JSONPatchType, pb) + if err != nil { + m.Error(err, "failed to patch machine") + return + } + // Keep the resource version updated so the status update can succeed + m.Machine.ResourceVersion = result.ResourceVersion + } + + // Do not update status if the statuses are the same + if reflect.DeepEqual(m.MachineStatus, oldStatus) { + return + } + + m.Logger.V(1).Info("Updating machine status") + m.Machine.Status.ProviderStatus = newStatus + if _, err := m.MachineClient.UpdateStatus(m.Machine); err != nil { + m.Error(err, "failed to update machine status") + return } } // MachineConfigFromProviderSpec tries to decode the JSON-encoded spec, falling back on getting a MachineClass if the value is absent. -func MachineConfigFromProviderSpec(clusterClient client.MachineClassesGetter, providerConfig clusterv1.ProviderSpec) (*v1alpha1.AWSMachineProviderSpec, error) { +func MachineConfigFromProviderSpec(clusterClient client.MachineClassesGetter, providerConfig clusterv1.ProviderSpec, log logr.Logger) (*v1alpha1.AWSMachineProviderSpec, error) { var config v1alpha1.AWSMachineProviderSpec if providerConfig.Value != nil { - klog.V(4).Info("Decoding ProviderConfig from Value") - return unmarshalProviderSpec(providerConfig.Value) + log.V(4).Info("Decoding ProviderConfig from Value") + return unmarshalProviderSpec(providerConfig.Value, log) } if providerConfig.ValueFrom != nil && providerConfig.ValueFrom.MachineClass != nil { ref := providerConfig.ValueFrom.MachineClass - klog.V(4).Info("Decoding ProviderConfig from MachineClass") - klog.V(6).Infof("ref: %v", ref) + log.V(4).Info("Decoding ProviderConfig from MachineClass") + log.V(6).Info("Machine class reference", "ref", fmt.Sprintf("%+v", ref)) if ref.Provider != "" && ref.Provider != "aws" { return nil, errors.Errorf("Unsupported provider: %q", ref.Provider) } if len(ref.Namespace) > 0 && len(ref.Name) > 0 { - klog.V(4).Infof("Getting MachineClass: %s/%s", ref.Namespace, ref.Name) + log.V(4).Info("Getting MachineClass", "reference-namespace", ref.Namespace, "reference-name", ref.Name) mc, err := clusterClient.MachineClasses(ref.Namespace).Get(ref.Name, metav1.GetOptions{}) - klog.V(6).Infof("Retrieved MachineClass: %+v", mc) + log.V(6).Info("Retrieved MachineClass", "machine-class", fmt.Sprintf("%+v", mc)) if err != nil { return nil, err } providerConfig.Value = &mc.ProviderSpec - return unmarshalProviderSpec(&mc.ProviderSpec) + return unmarshalProviderSpec(&mc.ProviderSpec, log) } } return &config, nil } -func unmarshalProviderSpec(spec *runtime.RawExtension) (*v1alpha1.AWSMachineProviderSpec, error) { +func unmarshalProviderSpec(spec *runtime.RawExtension, log logr.Logger) (*v1alpha1.AWSMachineProviderSpec, error) { var config v1alpha1.AWSMachineProviderSpec if spec != nil { if err := yaml.Unmarshal(spec.Raw, &config); err != nil { return nil, err } } - klog.V(6).Infof("Found ProviderSpec: %+v", config) + log.V(6).Info("Found ProviderSpec", "provider-spec", fmt.Sprintf("%+v", config)) return &config, nil } diff --git a/pkg/cloud/aws/actuators/scope.go b/pkg/cloud/aws/actuators/scope.go index 2447962117..1db30c2921 100644 --- a/pkg/cloud/aws/actuators/scope.go +++ b/pkg/cloud/aws/actuators/scope.go @@ -17,15 +17,21 @@ limitations under the License. package actuators import ( + "encoding/json" + "reflect" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/elb" + "github.com/go-logr/logr" "github.com/pkg/errors" - "k8s.io/klog" + "k8s.io/apimachinery/pkg/types" + "k8s.io/klog/klogr" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1alpha1" clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" client "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" + "sigs.k8s.io/controller-runtime/pkg/patch" ) // ScopeParams defines the input parameters used to create a new Scope. @@ -33,6 +39,7 @@ type ScopeParams struct { AWSClients Cluster *clusterv1.Cluster Client client.ClusterV1alpha1Interface + Logger logr.Logger } // NewScope creates a new Scope from the supplied parameters. @@ -70,22 +77,31 @@ func NewScope(params ScopeParams) (*Scope, error) { clusterClient = params.Client.Clusters(params.Cluster.Namespace) } + if params.Logger == nil { + params.Logger = klogr.New().WithName("default-logger") + } + return &Scope{ AWSClients: params.AWSClients, Cluster: params.Cluster, + ClusterCopy: params.Cluster.DeepCopy(), ClusterClient: clusterClient, ClusterConfig: clusterConfig, ClusterStatus: clusterStatus, + Logger: params.Logger.WithName(params.Cluster.APIVersion).WithName(params.Cluster.Namespace).WithName(params.Cluster.Name), }, nil } // Scope defines the basic context for an actuator to operate upon. type Scope struct { AWSClients - Cluster *clusterv1.Cluster + Cluster *clusterv1.Cluster + // ClusterCopy is used for patch generation at the end of the scope's lifecycle. + ClusterCopy *clusterv1.Cluster ClusterClient client.ClusterInterface ClusterConfig *v1alpha1.AWSClusterProviderSpec ClusterStatus *v1alpha1.AWSClusterProviderStatus + logr.Logger } // Network returns the cluster network object. @@ -123,40 +139,63 @@ func (s *Scope) Region() string { return s.ClusterConfig.Region } -func (s *Scope) storeClusterConfig(cluster *clusterv1.Cluster) (*clusterv1.Cluster, error) { +// Close closes the current scope persisting the cluster configuration and status. +func (s *Scope) Close() { + if s.ClusterClient == nil { + return + } + ext, err := v1alpha1.EncodeClusterSpec(s.ClusterConfig) if err != nil { - return nil, err + s.Error(err, "failed encoding cluster spec") + return } - - cluster.Spec.ProviderSpec.Value = ext - return s.ClusterClient.Update(cluster) -} - -func (s *Scope) storeClusterStatus(cluster *clusterv1.Cluster) (*clusterv1.Cluster, error) { - ext, err := v1alpha1.EncodeClusterStatus(s.ClusterStatus) + newStatus, err := v1alpha1.EncodeClusterStatus(s.ClusterStatus) if err != nil { - return nil, err + s.Error(err, "failed encoding cluster status") + return + } + oldStatus, err := v1alpha1.ClusterStatusFromProviderStatus(s.ClusterCopy.Status.ProviderStatus) + if err != nil { + s.Error(err, "failed to get provider status from status") + return } - cluster.Status.ProviderStatus = ext - return s.ClusterClient.UpdateStatus(cluster) -} + s.Cluster.Spec.ProviderSpec.Value = ext -// Close closes the current scope persisting the cluster configuration and status. -func (s *Scope) Close() { - if s.ClusterClient == nil { + // Build a patch and marshal that patch to something the client will understand. + p, err := patch.NewJSONPatch(s.ClusterCopy, s.Cluster) + if err != nil { + s.Error(err, "failed to create new JSONPatch") return } - latestCluster, err := s.storeClusterConfig(s.Cluster) - if err != nil { - klog.Errorf("[scope] failed to store provider config for cluster %q in namespace %q: %v", s.Cluster.Name, s.Cluster.Namespace, err) + // Do not update Machine if nothing has changed + if len(p) != 0 { + pb, err := json.MarshalIndent(p, "", " ") + if err != nil { + s.Error(err, "failed to json marshal patch") + return + } + s.Logger.V(1).Info("Patching cluster") + result, err := s.ClusterClient.Patch(s.Cluster.Name, types.JSONPatchType, pb) + if err != nil { + s.Error(err, "failed to patch cluster") + return + } + // Keep the resource version updated so the status update can succeed + s.Cluster.ResourceVersion = result.ResourceVersion + } + + // Do not update status if the statuses are the same + if reflect.DeepEqual(s.ClusterStatus, oldStatus) { return } - _, err = s.storeClusterStatus(latestCluster) - if err != nil { - klog.Errorf("[scope] failed to store provider status for cluster %q in namespace %q: %v", s.Cluster.Name, s.Cluster.Namespace, err) + s.Logger.V(1).Info("Updating cluster status") + s.Cluster.Status.ProviderStatus = newStatus + if _, err := s.ClusterClient.UpdateStatus(s.Cluster); err != nil { + s.Error(err, "failed to update cluster status") + return } } diff --git a/pkg/cloud/aws/converters/instance.go b/pkg/cloud/aws/converters/instance.go index 105e5507ac..aed6ff41fe 100644 --- a/pkg/cloud/aws/converters/instance.go +++ b/pkg/cloud/aws/converters/instance.go @@ -24,6 +24,10 @@ import ( "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1alpha1" ) +// SDKToInstance converts an EC2 instance type to the CAPA +// instance type. +// Note: This does not return a complete instance, as rootVolumeSize +// can not be determined via the output of EC2.DescribeInstances. func SDKToInstance(v *ec2.Instance) *v1alpha1.Instance { i := &v1alpha1.Instance{ ID: aws.StringValue(v.InstanceId), diff --git a/pkg/cloud/aws/services/awserrors/BUILD b/pkg/cloud/aws/services/awserrors/BUILD.bazel similarity index 100% rename from pkg/cloud/aws/services/awserrors/BUILD rename to pkg/cloud/aws/services/awserrors/BUILD.bazel diff --git a/pkg/cloud/aws/services/certificates/BUILD b/pkg/cloud/aws/services/certificates/BUILD.bazel similarity index 94% rename from pkg/cloud/aws/services/certificates/BUILD rename to pkg/cloud/aws/services/certificates/BUILD.bazel index 964be62dd9..6dc36a93a2 100644 --- a/pkg/cloud/aws/services/certificates/BUILD +++ b/pkg/cloud/aws/services/certificates/BUILD.bazel @@ -13,7 +13,6 @@ go_library( "//pkg/cloud/aws/actuators:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd/api:go_default_library", - "//vendor/k8s.io/klog:go_default_library", ], ) diff --git a/pkg/cloud/aws/services/certificates/certificates.go b/pkg/cloud/aws/services/certificates/certificates.go index f78918515e..d238270c8b 100644 --- a/pkg/cloud/aws/services/certificates/certificates.go +++ b/pkg/cloud/aws/services/certificates/certificates.go @@ -33,7 +33,6 @@ import ( "github.com/pkg/errors" "k8s.io/client-go/tools/clientcmd/api" - "k8s.io/klog" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1alpha1" ) @@ -69,73 +68,78 @@ type Config struct { // ReconcileCertificates generate certificates if none exists. func (s *Service) ReconcileCertificates() error { - klog.V(2).Infof("Reconciling certificates for cluster %q", s.scope.Cluster.Name) - clusterCAKeyPair, err := getOrGenerateCACert(&s.scope.ClusterConfig.CAKeyPair, clusterCA) - if err != nil { - return errors.Wrapf(err, "Failed to generate certs for %q", clusterCA) - } - s.scope.ClusterConfig.CAKeyPair = clusterCAKeyPair + s.scope.V(2).Info("Reconciling certificates", "cluster-name", s.scope.Cluster.Name, "cluster-namespace", s.scope.Cluster.Namespace) - etcdCAKeyPair, err := getOrGenerateCACert(&s.scope.ClusterConfig.EtcdCAKeyPair, etcdCA) - if err != nil { - return errors.Wrapf(err, "Failed to generate certs for %q", etcdCA) + if !s.scope.ClusterConfig.CAKeyPair.HasCertAndKey() { + s.scope.V(2).Info("Generating keypair for", "user", clusterCA) + clusterCAKeyPair, err := generateCACert(&s.scope.ClusterConfig.CAKeyPair, clusterCA) + if err != nil { + return errors.Wrapf(err, "Failed to generate certs for %q", clusterCA) + } + s.scope.ClusterConfig.CAKeyPair = clusterCAKeyPair } - s.scope.ClusterConfig.EtcdCAKeyPair = etcdCAKeyPair - fpCAKeyPair, err := getOrGenerateCACert(&s.scope.ClusterConfig.FrontProxyCAKeyPair, frontProxyCA) - if err != nil { - return errors.Wrapf(err, "Failed to generate certs for %q", frontProxyCA) + if !s.scope.ClusterConfig.EtcdCAKeyPair.HasCertAndKey() { + s.scope.V(2).Info("Generating keypair", "user", etcdCA) + etcdCAKeyPair, err := generateCACert(&s.scope.ClusterConfig.EtcdCAKeyPair, etcdCA) + if err != nil { + return errors.Wrapf(err, "Failed to generate certs for %q", etcdCA) + } + s.scope.ClusterConfig.EtcdCAKeyPair = etcdCAKeyPair } - s.scope.ClusterConfig.FrontProxyCAKeyPair = fpCAKeyPair - - saKeyPair, err := getOrGenerateServiceAccountKeys(&s.scope.ClusterConfig.SAKeyPair, serviceAccount) - if err != nil { - return errors.Wrapf(err, "Failed to generate keyPair for %q", serviceAccount) + if !s.scope.ClusterConfig.FrontProxyCAKeyPair.HasCertAndKey() { + s.scope.V(2).Info("Generating keypair", "user", frontProxyCA) + fpCAKeyPair, err := generateCACert(&s.scope.ClusterConfig.FrontProxyCAKeyPair, frontProxyCA) + if err != nil { + return errors.Wrapf(err, "Failed to generate certs for %q", frontProxyCA) + } + s.scope.ClusterConfig.FrontProxyCAKeyPair = fpCAKeyPair } - s.scope.ClusterConfig.SAKeyPair = saKeyPair + if !s.scope.ClusterConfig.SAKeyPair.HasCertAndKey() { + s.scope.V(2).Info("Generating service account keys", "user", serviceAccount) + saKeyPair, err := generateServiceAccountKeys(&s.scope.ClusterConfig.SAKeyPair, serviceAccount) + if err != nil { + return errors.Wrapf(err, "Failed to generate keyPair for %q", serviceAccount) + } + s.scope.ClusterConfig.SAKeyPair = saKeyPair + } return nil } -func getOrGenerateCACert(kp *v1alpha1.KeyPair, user string) (v1alpha1.KeyPair, error) { - if kp == nil || !kp.HasCertAndKey() { - klog.V(2).Infof("Generating keypair for %q", user) - x509Cert, privKey, err := NewCertificateAuthority() - if err != nil { - return v1alpha1.KeyPair{}, errors.Wrapf(err, "failed to generate CA cert for %q", user) - } - if kp == nil { - return v1alpha1.KeyPair{ - Cert: EncodeCertPEM(x509Cert), - Key: EncodePrivateKeyPEM(privKey), - }, nil - } - kp.Cert = EncodeCertPEM(x509Cert) - kp.Key = EncodePrivateKeyPEM(privKey) +func generateCACert(kp *v1alpha1.KeyPair, user string) (v1alpha1.KeyPair, error) { + x509Cert, privKey, err := NewCertificateAuthority() + if err != nil { + return v1alpha1.KeyPair{}, errors.Wrapf(err, "failed to generate CA cert for %q", user) } + if kp == nil { + return v1alpha1.KeyPair{ + Cert: EncodeCertPEM(x509Cert), + Key: EncodePrivateKeyPEM(privKey), + }, nil + } + kp.Cert = EncodeCertPEM(x509Cert) + kp.Key = EncodePrivateKeyPEM(privKey) return *kp, nil } -func getOrGenerateServiceAccountKeys(kp *v1alpha1.KeyPair, user string) (v1alpha1.KeyPair, error) { - if kp == nil || !kp.HasCertAndKey() { - klog.V(2).Infof("Generating service account keys for %q", user) - saCreds, err := NewPrivateKey() - if err != nil { - return v1alpha1.KeyPair{}, errors.Wrapf(err, "failed to create service account public and private keys") - } - saPub, err := EncodePublicKeyPEM(&saCreds.PublicKey) - if err != nil { - return v1alpha1.KeyPair{}, errors.Wrapf(err, "failed to encode service account public key to PEM") - } - if kp == nil { - return v1alpha1.KeyPair{ - Cert: saPub, - Key: EncodePrivateKeyPEM(saCreds), - }, nil - } - kp.Cert = saPub - kp.Key = EncodePrivateKeyPEM(saCreds) +func generateServiceAccountKeys(kp *v1alpha1.KeyPair, user string) (v1alpha1.KeyPair, error) { + saCreds, err := NewPrivateKey() + if err != nil { + return v1alpha1.KeyPair{}, errors.Wrapf(err, "failed to create service account public and private keys") + } + saPub, err := EncodePublicKeyPEM(&saCreds.PublicKey) + if err != nil { + return v1alpha1.KeyPair{}, errors.Wrapf(err, "failed to encode service account public key to PEM") + } + if kp == nil { + return v1alpha1.KeyPair{ + Cert: saPub, + Key: EncodePrivateKeyPEM(saCreds), + }, nil } + kp.Cert = saPub + kp.Key = EncodePrivateKeyPEM(saCreds) return *kp, nil } diff --git a/pkg/cloud/aws/services/certificates/certificates_test.go b/pkg/cloud/aws/services/certificates/certificates_test.go index c5ecde3951..b1d2279fe7 100644 --- a/pkg/cloud/aws/services/certificates/certificates_test.go +++ b/pkg/cloud/aws/services/certificates/certificates_test.go @@ -24,7 +24,7 @@ import ( "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1alpha1" ) -func TestGetOrGenerateCACert(t *testing.T) { +func TestGenerateCACert(t *testing.T) { testCases := []struct { name string inputKeyPair *v1alpha1.KeyPair @@ -69,7 +69,7 @@ func TestGetOrGenerateCACert(t *testing.T) { }, } for _, tc := range testCases { - actualKeyPair, actualError := getOrGenerateCACert(tc.inputKeyPair, tc.inputUser) + actualKeyPair, actualError := generateCACert(tc.inputKeyPair, tc.inputUser) if tc.expectedError != nil { if tc.expectedError.Error() != actualError.Error() { t.Fatalf("[%s], Unexpected error, Want [%v], Got: [%v]", tc.name, tc.expectedError, actualError) @@ -96,7 +96,7 @@ func TestGetOrGenerateCACert(t *testing.T) { } } -func TestGetOrGenerateServiceAccountKeys(t *testing.T) { +func TestGenerateServiceAccountKeys(t *testing.T) { testCases := []struct { name string inputKeyPair *v1alpha1.KeyPair @@ -141,7 +141,7 @@ func TestGetOrGenerateServiceAccountKeys(t *testing.T) { }, } for _, tc := range testCases { - actualKeyPair, actualError := getOrGenerateServiceAccountKeys(tc.inputKeyPair, tc.inputUser) + actualKeyPair, actualError := generateServiceAccountKeys(tc.inputKeyPair, tc.inputUser) if tc.expectedError != nil { if tc.expectedError.Error() != actualError.Error() { t.Fatalf("[%s], Unexpected error, Want [%v], Got: [%v]", tc.name, tc.expectedError, actualError) diff --git a/pkg/cloud/aws/services/cloudformation/BUILD b/pkg/cloud/aws/services/cloudformation/BUILD.bazel similarity index 100% rename from pkg/cloud/aws/services/cloudformation/BUILD rename to pkg/cloud/aws/services/cloudformation/BUILD.bazel diff --git a/pkg/cloud/aws/services/ec2/BUILD b/pkg/cloud/aws/services/ec2/BUILD.bazel similarity index 94% rename from pkg/cloud/aws/services/ec2/BUILD rename to pkg/cloud/aws/services/ec2/BUILD.bazel index 46bde94634..57d46c2d4a 100644 --- a/pkg/cloud/aws/services/ec2/BUILD +++ b/pkg/cloud/aws/services/ec2/BUILD.bazel @@ -33,9 +33,10 @@ go_library( "//pkg/cloud/aws/tags:go_default_library", "//pkg/record:go_default_library", "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/ec2:go_default_library", + "//vendor/github.com/go-logr/logr:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", - "//vendor/k8s.io/klog:go_default_library", ], ) diff --git a/pkg/cloud/aws/services/ec2/ami.go b/pkg/cloud/aws/services/ec2/ami.go index 28f604f2ba..aa3ba7f395 100644 --- a/pkg/cloud/aws/services/ec2/ami.go +++ b/pkg/cloud/aws/services/ec2/ami.go @@ -22,17 +22,15 @@ import ( "strings" "time" - "k8s.io/klog" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" ) const ( - // machineAMIOwnerID is a heptio/VMware owned account. Please see: + // defaultMachineAMIOwnerID is a heptio/VMware owned account. Please see: // https://github.com/kubernetes-sigs/cluster-api-provider-aws/issues/487 - machineAMIOwnerID = "258751437250" + defaultMachineAMIOwnerID = "258751437250" // amiNameFormat is defined in the build/ directory of this project. // The pattern is: @@ -52,12 +50,15 @@ func amiName(baseOS, baseOSVersion, kubernetesVersion string) string { } // defaultAMILookup returns the default AMI based on region -func (s *Service) defaultAMILookup(baseOS, baseOSVersion, kubernetesVersion string) (string, error) { +func (s *Service) defaultAMILookup(ownerID, baseOS, baseOSVersion, kubernetesVersion string) (string, error) { + if ownerID == "" { + ownerID = defaultMachineAMIOwnerID + } describeImageInput := &ec2.DescribeImagesInput{ Filters: []*ec2.Filter{ { Name: aws.String("owner-id"), - Values: []*string{aws.String(machineAMIOwnerID)}, + Values: []*string{aws.String(ownerID)}, }, { Name: aws.String("name"), @@ -86,7 +87,7 @@ func (s *Service) defaultAMILookup(baseOS, baseOSVersion, kubernetesVersion stri return "", errors.Errorf("found no AMIs with the name: %q", amiName(baseOS, baseOSVersion, kubernetesVersion)) } latestImage := getLatestImage(out.Images) - klog.V(2).Infof("Using AMI: %q", aws.StringValue(latestImage.ImageId)) + s.scope.V(2).Info("Found and using an existing AMI", "ami-id", aws.StringValue(latestImage.ImageId)) return aws.StringValue(latestImage.ImageId), nil } @@ -99,15 +100,14 @@ func (i images) Len() int { // Less reports whether the element with // index i should sort before the element with index j. +// TODO(chuckha) Ignoring errors until this causes a problem func (i images) Less(k, j int) bool { firstTime, err := time.Parse(createDateTimestampFormat, aws.StringValue(i[k].CreationDate)) if err != nil { - klog.Infof("unable to parse an AMI creation timestamp: %q", aws.StringValue(i[k].CreationDate)) return false } secondTime, err := time.Parse(createDateTimestampFormat, aws.StringValue(i[j].CreationDate)) if err != nil { - klog.Infof("unable to parse an AMI creation timestamp: %q", aws.StringValue(i[j].CreationDate)) return false } return firstTime.Before(secondTime) diff --git a/pkg/cloud/aws/services/ec2/ami_test.go b/pkg/cloud/aws/services/ec2/ami_test.go index 55b7a744ac..1ad5074754 100644 --- a/pkg/cloud/aws/services/ec2/ami_test.go +++ b/pkg/cloud/aws/services/ec2/ami_test.go @@ -76,7 +76,7 @@ func TestAMIs(t *testing.T) { tc.expect(ec2Mock.EXPECT()) s := NewService(scope) - id, err := s.defaultAMILookup("base os", "baseos version", "1.11.1") + id, err := s.defaultAMILookup("", "base os", "baseos version", "1.11.1") if err != nil { t.Fatalf("did not expect error calling a mock: %v", err) } diff --git a/pkg/cloud/aws/services/ec2/bastion.go b/pkg/cloud/aws/services/ec2/bastion.go index 613ba6a472..b788f98bb7 100644 --- a/pkg/cloud/aws/services/ec2/bastion.go +++ b/pkg/cloud/aws/services/ec2/bastion.go @@ -23,7 +23,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" - "k8s.io/klog" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1alpha1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/filter" @@ -39,15 +38,15 @@ const ( // ReconcileBastion ensures a bastion is created for the cluster func (s *Service) ReconcileBastion() error { if s.scope.VPC().IsProvided() { - klog.V(4).Info("Skipping bastion reconcile in unmanaged mode") + s.scope.V(4).Info("Skipping bastion reconcile in unmanaged mode") return nil } - klog.V(2).Info("Reconciling bastion host") + s.scope.V(2).Info("Reconciling bastion host") subnets := s.scope.Subnets() if len(subnets.FilterPrivate()) == 0 { - klog.V(2).Info("No private subnets available, skipping bastion host") + s.scope.V(2).Info("No private subnets available, skipping bastion host") return nil } else if len(subnets.FilterPublic()) == 0 { return errors.New("failed to reconcile bastion host, no public subnets are available") @@ -63,7 +62,7 @@ func (s *Service) ReconcileBastion() error { return err } - klog.V(2).Infof("Created new bastion host: %+v", instance) + s.scope.V(2).Info("Created new bastion host", "instance", instance) } else if err != nil { return err @@ -72,21 +71,21 @@ func (s *Service) ReconcileBastion() error { // TODO(vincepri): check for possible changes between the default spec and the instance. instance.DeepCopyInto(&s.scope.ClusterStatus.Bastion) - klog.V(2).Info("Reconcile bastion completed successfully") + s.scope.V(2).Info("Reconcile bastion completed successfully") return nil } // DeleteBastion deletes the Bastion instance func (s *Service) DeleteBastion() error { if s.scope.VPC().IsProvided() { - klog.V(4).Info("Skipping bastion deletion in unmanaged mode") + s.scope.V(4).Info("Skipping bastion deletion in unmanaged mode") return nil } instance, err := s.describeBastionInstance() if err != nil { if awserrors.IsNotFound(err) { - klog.V(2).Info("bastion instance does not exist") + s.scope.V(2).Info("bastion instance does not exist") return nil } return errors.Wrap(err, "unable to describe bastion instance") diff --git a/pkg/cloud/aws/services/ec2/eips.go b/pkg/cloud/aws/services/ec2/eips.go index 99925b31a4..b1dea1fd9c 100644 --- a/pkg/cloud/aws/services/ec2/eips.go +++ b/pkg/cloud/aws/services/ec2/eips.go @@ -25,7 +25,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" - "k8s.io/klog" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/wait" ) @@ -123,7 +122,7 @@ func (s *Service) releaseAddresses() error { return errors.Wrapf(err, "failed to release ElasticIP %q", *ip.AllocationId) } - klog.Infof("released ElasticIP %q with allocation ID %q", *ip.PublicIp, *ip.AllocationId) + s.scope.Info("released ElasticIP", "eip", *ip.PublicIp, "allocation-id", *ip.AllocationId) } return nil } diff --git a/pkg/cloud/aws/services/ec2/gateways.go b/pkg/cloud/aws/services/ec2/gateways.go index d2e0b770de..a6bdae62c0 100644 --- a/pkg/cloud/aws/services/ec2/gateways.go +++ b/pkg/cloud/aws/services/ec2/gateways.go @@ -22,7 +22,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" - "k8s.io/klog" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/filter" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/awserrors" @@ -32,11 +31,11 @@ import ( func (s *Service) reconcileInternetGateways() error { if s.scope.VPC().IsProvided() { - klog.V(4).Info("Skipping internet gateways reconcile in unmanaged mode") + s.scope.V(4).Info("Skipping internet gateways reconcile in unmanaged mode") return nil } - klog.V(2).Infof("Reconciling internet gateways") + s.scope.V(2).Info("Reconciling internet gateways") igs, err := s.describeVpcInternetGateways() if awserrors.IsNotFound(err) { @@ -71,7 +70,7 @@ func (s *Service) reconcileInternetGateways() error { func (s *Service) deleteInternetGateways() error { if s.scope.VPC().IsProvided() { - klog.V(4).Info("Skipping internet gateway deletion in unmanaged mode") + s.scope.V(4).Info("Skipping internet gateway deletion in unmanaged mode") return nil } @@ -92,7 +91,7 @@ func (s *Service) deleteInternetGateways() error { return errors.Wrapf(err, "failed to detach internet gateway %q", *ig.InternetGatewayId) } - klog.Infof("Detached internet gateway %q from VPC %q", *ig.InternetGatewayId, s.scope.VPC().ID) + s.scope.Info("Detached internet gateway from VPC", "internet-gateway-id", *ig.InternetGatewayId, "vpc-id", s.scope.VPC().ID) deleteReq := &ec2.DeleteInternetGatewayInput{ InternetGatewayId: ig.InternetGatewayId, @@ -102,7 +101,7 @@ func (s *Service) deleteInternetGateways() error { return errors.Wrapf(err, "failed to delete internet gateway %q", *ig.InternetGatewayId) } - klog.Infof("Deleted internet gateway %q in VPC %q", *ig.InternetGatewayId, s.scope.VPC().ID) + s.scope.Info("Deleted internet gateway in VPC", "internet-gateway-id", *ig.InternetGatewayId, "vpc-id", s.scope.VPC().ID) record.Eventf(s.scope.Cluster, "DeletedInternetGateway", "Deleted Internet Gateway %q previously attached to VPC %q", *ig.InternetGatewayId, s.scope.VPC().ID) } @@ -115,7 +114,7 @@ func (s *Service) createInternetGateway() (*ec2.InternetGateway, error) { return nil, errors.Wrap(err, "failed to create internet gateway") } - klog.Infof("Created internet gateway %q", s.scope.VPC().ID) + s.scope.Info("Created internet gateway for VPC", "vpc-id", s.scope.VPC().ID) _, err = s.scope.EC2.AttachInternetGateway(&ec2.AttachInternetGatewayInput{ InternetGatewayId: ig.InternetGateway.InternetGatewayId, VpcId: aws.String(s.scope.VPC().ID), @@ -125,7 +124,7 @@ func (s *Service) createInternetGateway() (*ec2.InternetGateway, error) { return nil, errors.Wrapf(err, "failed to attach internet gateway %q to vpc %q", *ig.InternetGateway.InternetGatewayId, s.scope.VPC().ID) } - klog.Infof("attached internet gateway %q to VPC %q", *ig.InternetGateway.InternetGatewayId, s.scope.VPC().ID) + s.scope.Info("attached internet gateway to VPC", "internet-gateway-id", *ig.InternetGateway.InternetGatewayId, "vpc-id", s.scope.VPC().ID) record.Eventf(s.scope.Cluster, "CreatedInternetGateway", "Created new Internet Gateway %q attached to VPC %q", *ig.InternetGateway.InternetGatewayId, s.scope.VPC().ID) return ig.InternetGateway, nil } diff --git a/pkg/cloud/aws/services/ec2/instances.go b/pkg/cloud/aws/services/ec2/instances.go index 19e55d7d1a..6c816010da 100644 --- a/pkg/cloud/aws/services/ec2/instances.go +++ b/pkg/cloud/aws/services/ec2/instances.go @@ -17,12 +17,18 @@ limitations under the License. package ec2 import ( + "bytes" + "compress/gzip" + "context" "encoding/base64" + "strings" + "time" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/go-logr/logr" "github.com/pkg/errors" - "k8s.io/klog" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1alpha1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/actuators" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/converters" @@ -37,7 +43,7 @@ import ( // InstanceByTags returns the existing instance or nothing if it doesn't exist. func (s *Service) InstanceByTags(machine *actuators.MachineScope) (*v1alpha1.Instance, error) { - klog.V(2).Infof("Looking for existing instance for machine %q in cluster %q", machine.Name(), s.scope.Name()) + s.scope.V(2).Info("Looking for existing machine instance by tags") input := &ec2.DescribeInstancesInput{ Filters: []*ec2.Filter{ @@ -61,7 +67,7 @@ func (s *Service) InstanceByTags(machine *actuators.MachineScope) (*v1alpha1.Ins // match for _, res := range out.Reservations { for _, inst := range res.Instances { - return converters.SDKToInstance(inst), nil + return s.SDKToInstance(inst) } } @@ -71,11 +77,11 @@ func (s *Service) InstanceByTags(machine *actuators.MachineScope) (*v1alpha1.Ins // InstanceIfExists returns the existing instance or nothing if it doesn't exist. func (s *Service) InstanceIfExists(id *string) (*v1alpha1.Instance, error) { if id == nil { - klog.Error("Instance does not have an instance id") + s.scope.Info("Instance does not have an instance id") return nil, nil } - klog.V(2).Infof("Looking for instance %q", *id) + s.scope.V(2).Info("Looking for instance by id", "instance-id", *id) input := &ec2.DescribeInstancesInput{ InstanceIds: []*string{id}, @@ -94,7 +100,7 @@ func (s *Service) InstanceIfExists(id *string) (*v1alpha1.Instance, error) { } if len(out.Reservations) > 0 && len(out.Reservations[0].Instances) > 0 { - return converters.SDKToInstance(out.Reservations[0].Instances[0]), nil + return s.SDKToInstance(out.Reservations[0].Instances[0]) } return nil, nil @@ -102,11 +108,12 @@ func (s *Service) InstanceIfExists(id *string) (*v1alpha1.Instance, error) { // createInstance runs an ec2 instance. func (s *Service) createInstance(machine *actuators.MachineScope, bootstrapToken, kubeConfig string) (*v1alpha1.Instance, error) { - klog.V(2).Infof("Creating a new instance for machine %q", machine.Name()) + s.scope.V(2).Info("Creating an instance for a machine") input := &v1alpha1.Instance{ - Type: machine.MachineConfig.InstanceType, - IAMProfile: machine.MachineConfig.IAMInstanceProfile, + Type: machine.MachineConfig.InstanceType, + IAMProfile: machine.MachineConfig.IAMInstanceProfile, + RootDeviceSize: machine.MachineConfig.RootDeviceSize, } input.Tags = tags.Build(tags.BuildParams{ @@ -121,7 +128,7 @@ func (s *Service) createInstance(machine *actuators.MachineScope, bootstrapToken if machine.MachineConfig.AMI.ID != nil { input.ImageID = *machine.MachineConfig.AMI.ID } else { - input.ImageID, err = s.defaultAMILookup("ubuntu", "18.04", machine.Machine.Spec.Versions.Kubelet) + input.ImageID, err = s.defaultAMILookup(machine.MachineConfig.ImageLookupOrg, "ubuntu", "18.04", machine.Machine.Spec.Versions.Kubelet) if err != nil { return nil, err } @@ -152,6 +159,7 @@ func (s *Service) createInstance(machine *actuators.MachineScope, bootstrapToken ) } + s.scope.V(3).Info("Generating CA key pair") caCertHash, err := certificates.GenerateCertificateHash(s.scope.ClusterConfig.CAKeyPair.Cert) if err != nil { return input, err @@ -169,11 +177,11 @@ func (s *Service) createInstance(machine *actuators.MachineScope, bootstrapToken var userData string if bootstrapToken != "" { - klog.V(2).Infof("Allowing machine %q to join control plane for cluster %q", machine.Name(), s.scope.Name()) + s.scope.V(2).Info("Allowing a machine to join the control plane") - kubeadm.SetJoinNodeConfigurationOverrides(caCertHash, bootstrapToken, machine, &machine.MachineConfig.KubeadmConfiguration.Join) - kubeadm.SetControlPlaneJoinConfigurationOverrides(&machine.MachineConfig.KubeadmConfiguration.Join) - joinConfigurationYAML, err := kubeadm.ConfigurationToYAML(&machine.MachineConfig.KubeadmConfiguration.Join) + updatedJoinConfiguration := kubeadm.SetJoinNodeConfigurationOverrides(caCertHash, bootstrapToken, machine, &machine.MachineConfig.KubeadmConfiguration.Join) + updatedJoinConfiguration = kubeadm.SetControlPlaneJoinConfigurationOverrides(updatedJoinConfiguration) + joinConfigurationYAML, err := kubeadm.ConfigurationToYAML(updatedJoinConfiguration) if err != nil { return nil, err } @@ -193,21 +201,21 @@ func (s *Service) createInstance(machine *actuators.MachineScope, bootstrapToken return input, err } } else { - klog.V(2).Infof("Machine %q is the first controlplane machine for cluster %q", machine.Name(), s.scope.Name()) + s.scope.V(2).Info("Machine is the first control plane machine for the cluster") if !s.scope.ClusterConfig.CAKeyPair.HasCertAndKey() { return nil, awserrors.NewFailedDependency( errors.New("failed to run controlplane, missing CAPrivateKey"), ) } - kubeadm.SetClusterConfigurationOverrides(machine, &s.scope.ClusterConfig.ClusterConfiguration) - clusterConfigYAML, err := kubeadm.ConfigurationToYAML(&s.scope.ClusterConfig.ClusterConfiguration) + clusterConfiguration := kubeadm.SetClusterConfigurationOverrides(machine, &s.scope.ClusterConfig.ClusterConfiguration) + clusterConfigYAML, err := kubeadm.ConfigurationToYAML(clusterConfiguration) if err != nil { return nil, err } - kubeadm.SetInitConfigurationOverrides(&machine.MachineConfig.KubeadmConfiguration.Init) - initConfigYAML, err := kubeadm.ConfigurationToYAML(&machine.MachineConfig.KubeadmConfiguration.Init) + initConfiguration := kubeadm.SetInitConfigurationOverrides(machine, &machine.MachineConfig.KubeadmConfiguration.Init) + initConfigYAML, err := kubeadm.ConfigurationToYAML(initConfiguration) if err != nil { return nil, err } @@ -233,10 +241,11 @@ func (s *Service) createInstance(machine *actuators.MachineScope, bootstrapToken input.UserData = aws.String(userData) input.SecurityGroupIDs = append(input.SecurityGroupIDs, s.scope.SecurityGroups()[v1alpha1.SecurityGroupControlPlane].ID, s.scope.SecurityGroups()[v1alpha1.SecurityGroupNode].ID) case "node": + s.scope.V(2).Info("Joining a worker node to the cluster") input.SecurityGroupIDs = append(input.SecurityGroupIDs, s.scope.SecurityGroups()[v1alpha1.SecurityGroupNode].ID) - kubeadm.SetJoinNodeConfigurationOverrides(caCertHash, bootstrapToken, machine, &machine.MachineConfig.KubeadmConfiguration.Join) - joinConfigurationYAML, err := kubeadm.ConfigurationToYAML(&machine.MachineConfig.KubeadmConfiguration.Join) + joinConfiguration := kubeadm.SetJoinNodeConfigurationOverrides(caCertHash, bootstrapToken, machine, &machine.MachineConfig.KubeadmConfiguration.Join) + joinConfigurationYAML, err := kubeadm.ConfigurationToYAML(joinConfiguration) if err != nil { return nil, err } @@ -262,6 +271,7 @@ func (s *Service) createInstance(machine *actuators.MachineScope, bootstrapToken input.KeyName = aws.String(defaultSSHKeyName) } + s.scope.V(2).Info("Running instance", "machine-role", machine.Role()) out, err := s.runInstance(machine.Role(), input) if err != nil { return nil, err @@ -274,7 +284,7 @@ func (s *Service) createInstance(machine *actuators.MachineScope, bootstrapToken // TerminateInstance terminates an EC2 instance. // Returns nil on success, error in all other cases. func (s *Service) TerminateInstance(instanceID string) error { - klog.V(2).Infof("Attempting to terminate instance with id %q", instanceID) + s.scope.V(2).Info("Attempting to terminate instance", "instance-id", instanceID) input := &ec2.TerminateInstancesInput{ InstanceIds: aws.StringSlice([]string{instanceID}), @@ -284,7 +294,7 @@ func (s *Service) TerminateInstance(instanceID string) error { return errors.Wrapf(err, "failed to terminate instance with id %q", instanceID) } - klog.V(2).Infof("Terminated instance with id %q", instanceID) + s.scope.V(2).Info("Terminated instance", "instance-id", instanceID) record.Eventf(s.scope.Cluster, "DeletedInstance", "Terminated instance %q", instanceID) return nil } @@ -296,7 +306,7 @@ func (s *Service) TerminateInstanceAndWait(instanceID string) error { return err } - klog.V(2).Infof("Waiting for EC2 instance with id %q to terminate", instanceID) + s.scope.V(2).Info("Waiting for EC2 instance to terminate", "instance-id", instanceID) input := &ec2.DescribeInstancesInput{ InstanceIds: aws.StringSlice([]string{instanceID}), @@ -330,11 +340,11 @@ func (s *Service) MachineExists(machine *actuators.MachineScope) (bool, error) { // CreateOrGetMachine will either return an existing instance or create and return an instance. func (s *Service) CreateOrGetMachine(machine *actuators.MachineScope, bootstrapToken, kubeConfig string) (*v1alpha1.Instance, error) { - klog.V(2).Infof("Attempting to create or get machine %q", machine.Name()) + s.scope.V(2).Info("Attempting to create or get machine") // instance id exists, try to get it if machine.MachineStatus.InstanceID != nil { - klog.V(2).Infof("Looking up machine %q by id %q", machine.Name(), *machine.MachineStatus.InstanceID) + s.scope.V(2).Info("Looking up machine by id", "instance-id", *machine.MachineStatus.InstanceID) instance, err := s.InstanceIfExists(machine.MachineStatus.InstanceID) if err != nil && !awserrors.IsNotFound(err) { @@ -344,7 +354,7 @@ func (s *Service) CreateOrGetMachine(machine *actuators.MachineScope, bootstrapT } } - klog.V(2).Infof("Looking up machine %q by tags", machine.Name()) + s.scope.V(2).Info("Looking up machine by tags") instance, err := s.InstanceByTags(machine) if err != nil && !awserrors.IsNotFound(err) { return nil, errors.Wrapf(err, "failed to query machine %q instance by tags", machine.Name()) @@ -364,11 +374,21 @@ func (s *Service) runInstance(role string, i *v1alpha1.Instance) (*v1alpha1.Inst EbsOptimized: i.EBSOptimized, MaxCount: aws.Int64(1), MinCount: aws.Int64(1), - UserData: i.UserData, } if i.UserData != nil { - input.UserData = aws.String(base64.StdEncoding.EncodeToString([]byte(*i.UserData))) + var buf bytes.Buffer + + gz := gzip.NewWriter(&buf) + if _, err := gz.Write([]byte(*i.UserData)); err != nil { + return nil, errors.Wrap(err, "failed to gzip userdata") + } + + if err := gz.Close(); err != nil { + return nil, errors.Wrap(err, "failed to gzip userdata") + } + + input.UserData = aws.String(base64.StdEncoding.EncodeToString(buf.Bytes())) } if len(i.SecurityGroupIDs) > 0 { @@ -381,6 +401,23 @@ func (s *Service) runInstance(role string, i *v1alpha1.Instance) (*v1alpha1.Inst } } + if i.RootDeviceSize != 0 { + rootDeviceName, err := s.getImageRootDevice(i.ImageID) + if err != nil { + return nil, errors.Wrapf(err, "failed to get root volume from image %q", i.ImageID) + } + + input.BlockDeviceMappings = []*ec2.BlockDeviceMapping{ + { + DeviceName: rootDeviceName, + Ebs: &ec2.EbsBlockDevice{ + DeleteOnTermination: aws.Bool(true), + VolumeSize: aws.Int64(i.RootDeviceSize), + }, + }, + } + } + if len(i.Tags) > 0 { spec := &ec2.TagSpecification{ResourceType: aws.String(ec2.ResourceTypeInstance)} for key, value := range i.Tags { @@ -402,21 +439,42 @@ func (s *Service) runInstance(role string, i *v1alpha1.Instance) (*v1alpha1.Inst return nil, errors.Errorf("no instance returned for reservation %v", out.GoString()) } - s.scope.EC2.WaitUntilInstanceRunning(&ec2.DescribeInstancesInput{InstanceIds: []*string{out.Instances[0].InstanceId}}) + waitTimeout := 1 * time.Minute + s.scope.V(2).Info("Waiting for instance to be in running state", "instance-id", *out.Instances[0].InstanceId, "timeout", waitTimeout.String()) + ctx, cancel := context.WithTimeout(aws.BackgroundContext(), waitTimeout) + defer cancel() + + if err := s.scope.EC2.WaitUntilInstanceRunningWithContext( + ctx, + &ec2.DescribeInstancesInput{InstanceIds: []*string{out.Instances[0].InstanceId}}, + request.WithWaiterLogger(&awslog{s.scope.Logger}), + ); err != nil { + s.scope.V(2).Info("Could not determine if Machine is running. Machine state might be unavailable until next renconciliation.") + } + return converters.SDKToInstance(out.Instances[0]), nil } +// An internal type to satisfy aws' log interface. +type awslog struct { + logr.Logger +} + +func (a *awslog) Log(args ...interface{}) { + a.WithName("aws-logger").Info("AWS context", args...) +} + // UpdateInstanceSecurityGroups modifies the security groups of the given // EC2 instance. func (s *Service) UpdateInstanceSecurityGroups(instanceID string, ids []string) error { - klog.V(2).Infof("Attempting to update security groups on instance %q", instanceID) + s.scope.V(2).Info("Attempting to update security groups on instance", "instance-id", instanceID) enis, err := s.getInstanceENIs(instanceID) if err != nil { return errors.Wrapf(err, "failed to get ENIs for instance %q", instanceID) } - klog.V(3).Infof("Found %v ENIs on instance %q", len(enis), instanceID) + s.scope.V(3).Info("Found ENIs on instance", "number-of-enis", len(enis), "instance-id", instanceID) for _, eni := range enis { input := &ec2.ModifyNetworkInterfaceAttributeInput{ @@ -437,11 +495,11 @@ func (s *Service) UpdateInstanceSecurityGroups(instanceID string, ids []string) // We may not always have to perform each action, so we check what we're // receiving to avoid calling AWS if we don't need to. func (s *Service) UpdateResourceTags(resourceID *string, create map[string]string, remove map[string]string) error { - klog.V(2).Infof("Attempting to update tags on resource %q", *resourceID) + s.scope.V(2).Info("Attempting to update tags on resource", "resource-id", *resourceID) // If we have anything to create or update if len(create) > 0 { - klog.V(2).Infof("Attempting to create tags on resource %q", *resourceID) + s.scope.V(2).Info("Attempting to create tags on resource", "resource-id", *resourceID) // Convert our create map into an array of *ec2.Tag createTagsInput := converters.MapToTags(create) @@ -460,7 +518,7 @@ func (s *Service) UpdateResourceTags(resourceID *string, create map[string]strin // If we have anything to remove if len(remove) > 0 { - klog.V(2).Infof("Attempting to delete tags on resource %q", *resourceID) + s.scope.V(2).Info("Attempting to delete tags on resource", "resource-id", *resourceID) // Convert our remove map into an array of *ec2.Tag removeTagsInput := converters.MapToTags(remove) @@ -497,3 +555,88 @@ func (s *Service) getInstanceENIs(instanceID string) ([]*ec2.NetworkInterface, e return output.NetworkInterfaces, nil } + +func (s *Service) getImageRootDevice(imageID string) (*string, error) { + input := &ec2.DescribeImagesInput{ + ImageIds: []*string{aws.String(imageID)}, + } + + output, err := s.scope.EC2.DescribeImages(input) + if err != nil { + return nil, err + } + + if len(output.Images) == 0 { + return nil, errors.Errorf("no images returned when looking up ID %q", imageID) + } + + return output.Images[0].RootDeviceName, nil +} + +func (s *Service) getInstanceRootDeviceSize(instance *ec2.Instance) (*int64, error) { + + for _, bdm := range instance.BlockDeviceMappings { + if aws.StringValue(bdm.DeviceName) == aws.StringValue(instance.RootDeviceName) { + input := &ec2.DescribeVolumesInput{ + VolumeIds: []*string{bdm.Ebs.VolumeId}, + } + + out, err := s.scope.EC2.DescribeVolumes(input) + if err != nil { + return nil, err + } + + if len(out.Volumes) == 0 { + return nil, errors.Errorf("no volumes found for id %q", aws.StringValue(bdm.Ebs.VolumeId)) + } + + return out.Volumes[0].Size, nil + } + } + return nil, nil +} + +// SDKToInstance converts an AWS EC2 SDK instance to the CAPA instance type. +// converters.SDKToInstance populates all instance fields except for rootVolumeSize, +// because EC2.DescribeInstances does not return the size of storage devices. An +// additional call to EC2 is required to get this value. +func (s *Service) SDKToInstance(v *ec2.Instance) (*v1alpha1.Instance, error) { + i := &v1alpha1.Instance{ + ID: aws.StringValue(v.InstanceId), + State: v1alpha1.InstanceState(*v.State.Name), + Type: aws.StringValue(v.InstanceType), + SubnetID: aws.StringValue(v.SubnetId), + ImageID: aws.StringValue(v.ImageId), + KeyName: v.KeyName, + PrivateIP: v.PrivateIpAddress, + PublicIP: v.PublicIpAddress, + ENASupport: v.EnaSupport, + EBSOptimized: v.EbsOptimized, + } + + // Extract IAM Instance Profile name from ARN + // TODO: Handle this comparison more safely, perhaps by querying IAM for the + // instance profile ARN and comparing to the ARN returned by EC2 + if v.IamInstanceProfile != nil && v.IamInstanceProfile.Arn != nil { + split := strings.Split(aws.StringValue(v.IamInstanceProfile.Arn), "instance-profile/") + if len(split) > 1 && split[1] != "" { + i.IAMProfile = split[1] + } + } + + for _, sg := range v.SecurityGroups { + i.SecurityGroupIDs = append(i.SecurityGroupIDs, *sg.GroupId) + } + + if len(v.Tags) > 0 { + i.Tags = converters.TagsToMap(v.Tags) + } + + rootSize, err := s.getInstanceRootDeviceSize(v) + if err != nil { + return nil, errors.Wrapf(err, "unable to get root volume size for instance: %q", aws.StringValue(v.InstanceId)) + } + + i.RootDeviceSize = aws.Int64Value(rootSize) + return i, nil +} diff --git a/pkg/cloud/aws/services/ec2/instances_test.go b/pkg/cloud/aws/services/ec2/instances_test.go index 94d3a654fc..8a41ad77ab 100644 --- a/pkg/cloud/aws/services/ec2/instances_test.go +++ b/pkg/cloud/aws/services/ec2/instances_test.go @@ -381,7 +381,7 @@ vuO9LYxDXLVY9F7W4ccyCqe27Cj1xyAvdZxwhITrib8Wg5CMqoRpqTw5V3+TpA== }, }, }, nil) - m.WaitUntilInstanceRunning(gomock.Any()). + m.WaitUntilInstanceRunningWithContext(gomock.Any(), gomock.Any(), gomock.Any()). Return(nil) }, check: func(instance *v1alpha1.Instance, err error) { diff --git a/pkg/cloud/aws/services/ec2/mock_ec2iface/BUILD b/pkg/cloud/aws/services/ec2/mock_ec2iface/BUILD deleted file mode 100644 index ebdce78f36..0000000000 --- a/pkg/cloud/aws/services/ec2/mock_ec2iface/BUILD +++ /dev/null @@ -1,20 +0,0 @@ -load("//build:go_mock.bzl", "go_mock") - -go_mock( - name = "go_default_library", - importpath = "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/ec2/mock_ec2iface", - visibility = ["//visibility:public"], - mocks = [ - { - "prefix": "github.com/aws/aws-sdk-go", - "package": "service/ec2/ec2iface", - "interface": "EC2API", - "vendored": True, - }, - ], - deps = [ - "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", - "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", - "//vendor/github.com/aws/aws-sdk-go/service/ec2:go_default_library", - ], -) diff --git a/pkg/cloud/aws/services/ec2/mock_ec2iface/BUILD.bazel b/pkg/cloud/aws/services/ec2/mock_ec2iface/BUILD.bazel new file mode 100644 index 0000000000..6de49df533 --- /dev/null +++ b/pkg/cloud/aws/services/ec2/mock_ec2iface/BUILD.bazel @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@bazel_gomock//:gomock.bzl", "gomock") + +gomock( + name = "mocks", + out = "ec2api_mock.go", + interfaces = ["EC2API"], + library = "//vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface:go_default_library", + package = "mock_ec2iface", + visibility = ["//visibility:public"], +) + +go_library( + name = "go_default_library", + srcs = ["ec2api_mock.go"], + importpath = "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/ec2/mock_ec2iface", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/ec2:go_default_library", + "//vendor/github.com/golang/mock/gomock:go_default_library", + ], +) diff --git a/pkg/cloud/aws/services/ec2/mock_ec2iface/ec2api.go b/pkg/cloud/aws/services/ec2/mock_ec2iface/ec2api_mock.go old mode 100755 new mode 100644 similarity index 90% rename from pkg/cloud/aws/services/ec2/mock_ec2iface/ec2api.go rename to pkg/cloud/aws/services/ec2/mock_ec2iface/ec2api_mock.go index 7b2a84a4f1..ded78898fc --- a/pkg/cloud/aws/services/ec2/mock_ec2iface/ec2api.go +++ b/pkg/cloud/aws/services/ec2/mock_ec2iface/ec2api_mock.go @@ -14,8 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ - - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/aws/aws-sdk-go/service/ec2/ec2iface (interfaces: EC2API) @@ -6468,6 +6466,39 @@ func (mr *MockEC2APIMockRecorder) DescribeByoipCidrs(arg0 interface{}) *gomock.C return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeByoipCidrs", reflect.TypeOf((*MockEC2API)(nil).DescribeByoipCidrs), arg0) } +// DescribeByoipCidrsPages mocks base method +func (m *MockEC2API) DescribeByoipCidrsPages(arg0 *ec2.DescribeByoipCidrsInput, arg1 func(*ec2.DescribeByoipCidrsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeByoipCidrsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeByoipCidrsPages indicates an expected call of DescribeByoipCidrsPages +func (mr *MockEC2APIMockRecorder) DescribeByoipCidrsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeByoipCidrsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeByoipCidrsPages), arg0, arg1) +} + +// DescribeByoipCidrsPagesWithContext mocks base method +func (m *MockEC2API) DescribeByoipCidrsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeByoipCidrsInput, arg2 func(*ec2.DescribeByoipCidrsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeByoipCidrsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeByoipCidrsPagesWithContext indicates an expected call of DescribeByoipCidrsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeByoipCidrsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeByoipCidrsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeByoipCidrsPagesWithContext), varargs...) +} + // DescribeByoipCidrsRequest mocks base method func (m *MockEC2API) DescribeByoipCidrsRequest(arg0 *ec2.DescribeByoipCidrsInput) (*request.Request, *ec2.DescribeByoipCidrsOutput) { m.ctrl.T.Helper() @@ -6518,6 +6549,39 @@ func (mr *MockEC2APIMockRecorder) DescribeCapacityReservations(arg0 interface{}) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeCapacityReservations", reflect.TypeOf((*MockEC2API)(nil).DescribeCapacityReservations), arg0) } +// DescribeCapacityReservationsPages mocks base method +func (m *MockEC2API) DescribeCapacityReservationsPages(arg0 *ec2.DescribeCapacityReservationsInput, arg1 func(*ec2.DescribeCapacityReservationsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeCapacityReservationsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeCapacityReservationsPages indicates an expected call of DescribeCapacityReservationsPages +func (mr *MockEC2APIMockRecorder) DescribeCapacityReservationsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeCapacityReservationsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeCapacityReservationsPages), arg0, arg1) +} + +// DescribeCapacityReservationsPagesWithContext mocks base method +func (m *MockEC2API) DescribeCapacityReservationsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeCapacityReservationsInput, arg2 func(*ec2.DescribeCapacityReservationsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeCapacityReservationsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeCapacityReservationsPagesWithContext indicates an expected call of DescribeCapacityReservationsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeCapacityReservationsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeCapacityReservationsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeCapacityReservationsPagesWithContext), varargs...) +} + // DescribeCapacityReservationsRequest mocks base method func (m *MockEC2API) DescribeCapacityReservationsRequest(arg0 *ec2.DescribeCapacityReservationsInput) (*request.Request, *ec2.DescribeCapacityReservationsOutput) { m.ctrl.T.Helper() @@ -6568,6 +6632,39 @@ func (mr *MockEC2APIMockRecorder) DescribeClassicLinkInstances(arg0 interface{}) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClassicLinkInstances", reflect.TypeOf((*MockEC2API)(nil).DescribeClassicLinkInstances), arg0) } +// DescribeClassicLinkInstancesPages mocks base method +func (m *MockEC2API) DescribeClassicLinkInstancesPages(arg0 *ec2.DescribeClassicLinkInstancesInput, arg1 func(*ec2.DescribeClassicLinkInstancesOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeClassicLinkInstancesPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeClassicLinkInstancesPages indicates an expected call of DescribeClassicLinkInstancesPages +func (mr *MockEC2APIMockRecorder) DescribeClassicLinkInstancesPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClassicLinkInstancesPages", reflect.TypeOf((*MockEC2API)(nil).DescribeClassicLinkInstancesPages), arg0, arg1) +} + +// DescribeClassicLinkInstancesPagesWithContext mocks base method +func (m *MockEC2API) DescribeClassicLinkInstancesPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeClassicLinkInstancesInput, arg2 func(*ec2.DescribeClassicLinkInstancesOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeClassicLinkInstancesPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeClassicLinkInstancesPagesWithContext indicates an expected call of DescribeClassicLinkInstancesPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeClassicLinkInstancesPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClassicLinkInstancesPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeClassicLinkInstancesPagesWithContext), varargs...) +} + // DescribeClassicLinkInstancesRequest mocks base method func (m *MockEC2API) DescribeClassicLinkInstancesRequest(arg0 *ec2.DescribeClassicLinkInstancesInput) (*request.Request, *ec2.DescribeClassicLinkInstancesOutput) { m.ctrl.T.Helper() @@ -6618,6 +6715,39 @@ func (mr *MockEC2APIMockRecorder) DescribeClientVpnAuthorizationRules(arg0 inter return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClientVpnAuthorizationRules", reflect.TypeOf((*MockEC2API)(nil).DescribeClientVpnAuthorizationRules), arg0) } +// DescribeClientVpnAuthorizationRulesPages mocks base method +func (m *MockEC2API) DescribeClientVpnAuthorizationRulesPages(arg0 *ec2.DescribeClientVpnAuthorizationRulesInput, arg1 func(*ec2.DescribeClientVpnAuthorizationRulesOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeClientVpnAuthorizationRulesPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeClientVpnAuthorizationRulesPages indicates an expected call of DescribeClientVpnAuthorizationRulesPages +func (mr *MockEC2APIMockRecorder) DescribeClientVpnAuthorizationRulesPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClientVpnAuthorizationRulesPages", reflect.TypeOf((*MockEC2API)(nil).DescribeClientVpnAuthorizationRulesPages), arg0, arg1) +} + +// DescribeClientVpnAuthorizationRulesPagesWithContext mocks base method +func (m *MockEC2API) DescribeClientVpnAuthorizationRulesPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeClientVpnAuthorizationRulesInput, arg2 func(*ec2.DescribeClientVpnAuthorizationRulesOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeClientVpnAuthorizationRulesPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeClientVpnAuthorizationRulesPagesWithContext indicates an expected call of DescribeClientVpnAuthorizationRulesPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeClientVpnAuthorizationRulesPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClientVpnAuthorizationRulesPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeClientVpnAuthorizationRulesPagesWithContext), varargs...) +} + // DescribeClientVpnAuthorizationRulesRequest mocks base method func (m *MockEC2API) DescribeClientVpnAuthorizationRulesRequest(arg0 *ec2.DescribeClientVpnAuthorizationRulesInput) (*request.Request, *ec2.DescribeClientVpnAuthorizationRulesOutput) { m.ctrl.T.Helper() @@ -6668,6 +6798,39 @@ func (mr *MockEC2APIMockRecorder) DescribeClientVpnConnections(arg0 interface{}) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClientVpnConnections", reflect.TypeOf((*MockEC2API)(nil).DescribeClientVpnConnections), arg0) } +// DescribeClientVpnConnectionsPages mocks base method +func (m *MockEC2API) DescribeClientVpnConnectionsPages(arg0 *ec2.DescribeClientVpnConnectionsInput, arg1 func(*ec2.DescribeClientVpnConnectionsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeClientVpnConnectionsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeClientVpnConnectionsPages indicates an expected call of DescribeClientVpnConnectionsPages +func (mr *MockEC2APIMockRecorder) DescribeClientVpnConnectionsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClientVpnConnectionsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeClientVpnConnectionsPages), arg0, arg1) +} + +// DescribeClientVpnConnectionsPagesWithContext mocks base method +func (m *MockEC2API) DescribeClientVpnConnectionsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeClientVpnConnectionsInput, arg2 func(*ec2.DescribeClientVpnConnectionsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeClientVpnConnectionsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeClientVpnConnectionsPagesWithContext indicates an expected call of DescribeClientVpnConnectionsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeClientVpnConnectionsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClientVpnConnectionsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeClientVpnConnectionsPagesWithContext), varargs...) +} + // DescribeClientVpnConnectionsRequest mocks base method func (m *MockEC2API) DescribeClientVpnConnectionsRequest(arg0 *ec2.DescribeClientVpnConnectionsInput) (*request.Request, *ec2.DescribeClientVpnConnectionsOutput) { m.ctrl.T.Helper() @@ -6718,6 +6881,39 @@ func (mr *MockEC2APIMockRecorder) DescribeClientVpnEndpoints(arg0 interface{}) * return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClientVpnEndpoints", reflect.TypeOf((*MockEC2API)(nil).DescribeClientVpnEndpoints), arg0) } +// DescribeClientVpnEndpointsPages mocks base method +func (m *MockEC2API) DescribeClientVpnEndpointsPages(arg0 *ec2.DescribeClientVpnEndpointsInput, arg1 func(*ec2.DescribeClientVpnEndpointsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeClientVpnEndpointsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeClientVpnEndpointsPages indicates an expected call of DescribeClientVpnEndpointsPages +func (mr *MockEC2APIMockRecorder) DescribeClientVpnEndpointsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClientVpnEndpointsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeClientVpnEndpointsPages), arg0, arg1) +} + +// DescribeClientVpnEndpointsPagesWithContext mocks base method +func (m *MockEC2API) DescribeClientVpnEndpointsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeClientVpnEndpointsInput, arg2 func(*ec2.DescribeClientVpnEndpointsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeClientVpnEndpointsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeClientVpnEndpointsPagesWithContext indicates an expected call of DescribeClientVpnEndpointsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeClientVpnEndpointsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClientVpnEndpointsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeClientVpnEndpointsPagesWithContext), varargs...) +} + // DescribeClientVpnEndpointsRequest mocks base method func (m *MockEC2API) DescribeClientVpnEndpointsRequest(arg0 *ec2.DescribeClientVpnEndpointsInput) (*request.Request, *ec2.DescribeClientVpnEndpointsOutput) { m.ctrl.T.Helper() @@ -6768,6 +6964,39 @@ func (mr *MockEC2APIMockRecorder) DescribeClientVpnRoutes(arg0 interface{}) *gom return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClientVpnRoutes", reflect.TypeOf((*MockEC2API)(nil).DescribeClientVpnRoutes), arg0) } +// DescribeClientVpnRoutesPages mocks base method +func (m *MockEC2API) DescribeClientVpnRoutesPages(arg0 *ec2.DescribeClientVpnRoutesInput, arg1 func(*ec2.DescribeClientVpnRoutesOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeClientVpnRoutesPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeClientVpnRoutesPages indicates an expected call of DescribeClientVpnRoutesPages +func (mr *MockEC2APIMockRecorder) DescribeClientVpnRoutesPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClientVpnRoutesPages", reflect.TypeOf((*MockEC2API)(nil).DescribeClientVpnRoutesPages), arg0, arg1) +} + +// DescribeClientVpnRoutesPagesWithContext mocks base method +func (m *MockEC2API) DescribeClientVpnRoutesPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeClientVpnRoutesInput, arg2 func(*ec2.DescribeClientVpnRoutesOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeClientVpnRoutesPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeClientVpnRoutesPagesWithContext indicates an expected call of DescribeClientVpnRoutesPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeClientVpnRoutesPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClientVpnRoutesPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeClientVpnRoutesPagesWithContext), varargs...) +} + // DescribeClientVpnRoutesRequest mocks base method func (m *MockEC2API) DescribeClientVpnRoutesRequest(arg0 *ec2.DescribeClientVpnRoutesInput) (*request.Request, *ec2.DescribeClientVpnRoutesOutput) { m.ctrl.T.Helper() @@ -6818,6 +7047,39 @@ func (mr *MockEC2APIMockRecorder) DescribeClientVpnTargetNetworks(arg0 interface return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClientVpnTargetNetworks", reflect.TypeOf((*MockEC2API)(nil).DescribeClientVpnTargetNetworks), arg0) } +// DescribeClientVpnTargetNetworksPages mocks base method +func (m *MockEC2API) DescribeClientVpnTargetNetworksPages(arg0 *ec2.DescribeClientVpnTargetNetworksInput, arg1 func(*ec2.DescribeClientVpnTargetNetworksOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeClientVpnTargetNetworksPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeClientVpnTargetNetworksPages indicates an expected call of DescribeClientVpnTargetNetworksPages +func (mr *MockEC2APIMockRecorder) DescribeClientVpnTargetNetworksPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClientVpnTargetNetworksPages", reflect.TypeOf((*MockEC2API)(nil).DescribeClientVpnTargetNetworksPages), arg0, arg1) +} + +// DescribeClientVpnTargetNetworksPagesWithContext mocks base method +func (m *MockEC2API) DescribeClientVpnTargetNetworksPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeClientVpnTargetNetworksInput, arg2 func(*ec2.DescribeClientVpnTargetNetworksOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeClientVpnTargetNetworksPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeClientVpnTargetNetworksPagesWithContext indicates an expected call of DescribeClientVpnTargetNetworksPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeClientVpnTargetNetworksPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClientVpnTargetNetworksPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeClientVpnTargetNetworksPagesWithContext), varargs...) +} + // DescribeClientVpnTargetNetworksRequest mocks base method func (m *MockEC2API) DescribeClientVpnTargetNetworksRequest(arg0 *ec2.DescribeClientVpnTargetNetworksInput) (*request.Request, *ec2.DescribeClientVpnTargetNetworksOutput) { m.ctrl.T.Helper() @@ -7018,6 +7280,39 @@ func (mr *MockEC2APIMockRecorder) DescribeEgressOnlyInternetGateways(arg0 interf return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeEgressOnlyInternetGateways", reflect.TypeOf((*MockEC2API)(nil).DescribeEgressOnlyInternetGateways), arg0) } +// DescribeEgressOnlyInternetGatewaysPages mocks base method +func (m *MockEC2API) DescribeEgressOnlyInternetGatewaysPages(arg0 *ec2.DescribeEgressOnlyInternetGatewaysInput, arg1 func(*ec2.DescribeEgressOnlyInternetGatewaysOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeEgressOnlyInternetGatewaysPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeEgressOnlyInternetGatewaysPages indicates an expected call of DescribeEgressOnlyInternetGatewaysPages +func (mr *MockEC2APIMockRecorder) DescribeEgressOnlyInternetGatewaysPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeEgressOnlyInternetGatewaysPages", reflect.TypeOf((*MockEC2API)(nil).DescribeEgressOnlyInternetGatewaysPages), arg0, arg1) +} + +// DescribeEgressOnlyInternetGatewaysPagesWithContext mocks base method +func (m *MockEC2API) DescribeEgressOnlyInternetGatewaysPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeEgressOnlyInternetGatewaysInput, arg2 func(*ec2.DescribeEgressOnlyInternetGatewaysOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeEgressOnlyInternetGatewaysPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeEgressOnlyInternetGatewaysPagesWithContext indicates an expected call of DescribeEgressOnlyInternetGatewaysPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeEgressOnlyInternetGatewaysPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeEgressOnlyInternetGatewaysPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeEgressOnlyInternetGatewaysPagesWithContext), varargs...) +} + // DescribeEgressOnlyInternetGatewaysRequest mocks base method func (m *MockEC2API) DescribeEgressOnlyInternetGatewaysRequest(arg0 *ec2.DescribeEgressOnlyInternetGatewaysInput) (*request.Request, *ec2.DescribeEgressOnlyInternetGatewaysOutput) { m.ctrl.T.Helper() @@ -7268,6 +7563,39 @@ func (mr *MockEC2APIMockRecorder) DescribeFleets(arg0 interface{}) *gomock.Call return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeFleets", reflect.TypeOf((*MockEC2API)(nil).DescribeFleets), arg0) } +// DescribeFleetsPages mocks base method +func (m *MockEC2API) DescribeFleetsPages(arg0 *ec2.DescribeFleetsInput, arg1 func(*ec2.DescribeFleetsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeFleetsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeFleetsPages indicates an expected call of DescribeFleetsPages +func (mr *MockEC2APIMockRecorder) DescribeFleetsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeFleetsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeFleetsPages), arg0, arg1) +} + +// DescribeFleetsPagesWithContext mocks base method +func (m *MockEC2API) DescribeFleetsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeFleetsInput, arg2 func(*ec2.DescribeFleetsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeFleetsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeFleetsPagesWithContext indicates an expected call of DescribeFleetsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeFleetsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeFleetsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeFleetsPagesWithContext), varargs...) +} + // DescribeFleetsRequest mocks base method func (m *MockEC2API) DescribeFleetsRequest(arg0 *ec2.DescribeFleetsInput) (*request.Request, *ec2.DescribeFleetsOutput) { m.ctrl.T.Helper() @@ -7318,6 +7646,39 @@ func (mr *MockEC2APIMockRecorder) DescribeFlowLogs(arg0 interface{}) *gomock.Cal return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeFlowLogs", reflect.TypeOf((*MockEC2API)(nil).DescribeFlowLogs), arg0) } +// DescribeFlowLogsPages mocks base method +func (m *MockEC2API) DescribeFlowLogsPages(arg0 *ec2.DescribeFlowLogsInput, arg1 func(*ec2.DescribeFlowLogsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeFlowLogsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeFlowLogsPages indicates an expected call of DescribeFlowLogsPages +func (mr *MockEC2APIMockRecorder) DescribeFlowLogsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeFlowLogsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeFlowLogsPages), arg0, arg1) +} + +// DescribeFlowLogsPagesWithContext mocks base method +func (m *MockEC2API) DescribeFlowLogsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeFlowLogsInput, arg2 func(*ec2.DescribeFlowLogsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeFlowLogsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeFlowLogsPagesWithContext indicates an expected call of DescribeFlowLogsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeFlowLogsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeFlowLogsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeFlowLogsPagesWithContext), varargs...) +} + // DescribeFlowLogsRequest mocks base method func (m *MockEC2API) DescribeFlowLogsRequest(arg0 *ec2.DescribeFlowLogsInput) (*request.Request, *ec2.DescribeFlowLogsOutput) { m.ctrl.T.Helper() @@ -7418,6 +7779,39 @@ func (mr *MockEC2APIMockRecorder) DescribeFpgaImages(arg0 interface{}) *gomock.C return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeFpgaImages", reflect.TypeOf((*MockEC2API)(nil).DescribeFpgaImages), arg0) } +// DescribeFpgaImagesPages mocks base method +func (m *MockEC2API) DescribeFpgaImagesPages(arg0 *ec2.DescribeFpgaImagesInput, arg1 func(*ec2.DescribeFpgaImagesOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeFpgaImagesPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeFpgaImagesPages indicates an expected call of DescribeFpgaImagesPages +func (mr *MockEC2APIMockRecorder) DescribeFpgaImagesPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeFpgaImagesPages", reflect.TypeOf((*MockEC2API)(nil).DescribeFpgaImagesPages), arg0, arg1) +} + +// DescribeFpgaImagesPagesWithContext mocks base method +func (m *MockEC2API) DescribeFpgaImagesPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeFpgaImagesInput, arg2 func(*ec2.DescribeFpgaImagesOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeFpgaImagesPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeFpgaImagesPagesWithContext indicates an expected call of DescribeFpgaImagesPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeFpgaImagesPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeFpgaImagesPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeFpgaImagesPagesWithContext), varargs...) +} + // DescribeFpgaImagesRequest mocks base method func (m *MockEC2API) DescribeFpgaImagesRequest(arg0 *ec2.DescribeFpgaImagesInput) (*request.Request, *ec2.DescribeFpgaImagesOutput) { m.ctrl.T.Helper() @@ -7468,8 +7862,41 @@ func (mr *MockEC2APIMockRecorder) DescribeHostReservationOfferings(arg0 interfac return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeHostReservationOfferings", reflect.TypeOf((*MockEC2API)(nil).DescribeHostReservationOfferings), arg0) } -// DescribeHostReservationOfferingsRequest mocks base method -func (m *MockEC2API) DescribeHostReservationOfferingsRequest(arg0 *ec2.DescribeHostReservationOfferingsInput) (*request.Request, *ec2.DescribeHostReservationOfferingsOutput) { +// DescribeHostReservationOfferingsPages mocks base method +func (m *MockEC2API) DescribeHostReservationOfferingsPages(arg0 *ec2.DescribeHostReservationOfferingsInput, arg1 func(*ec2.DescribeHostReservationOfferingsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeHostReservationOfferingsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeHostReservationOfferingsPages indicates an expected call of DescribeHostReservationOfferingsPages +func (mr *MockEC2APIMockRecorder) DescribeHostReservationOfferingsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeHostReservationOfferingsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeHostReservationOfferingsPages), arg0, arg1) +} + +// DescribeHostReservationOfferingsPagesWithContext mocks base method +func (m *MockEC2API) DescribeHostReservationOfferingsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeHostReservationOfferingsInput, arg2 func(*ec2.DescribeHostReservationOfferingsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeHostReservationOfferingsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeHostReservationOfferingsPagesWithContext indicates an expected call of DescribeHostReservationOfferingsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeHostReservationOfferingsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeHostReservationOfferingsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeHostReservationOfferingsPagesWithContext), varargs...) +} + +// DescribeHostReservationOfferingsRequest mocks base method +func (m *MockEC2API) DescribeHostReservationOfferingsRequest(arg0 *ec2.DescribeHostReservationOfferingsInput) (*request.Request, *ec2.DescribeHostReservationOfferingsOutput) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DescribeHostReservationOfferingsRequest", arg0) ret0, _ := ret[0].(*request.Request) @@ -7518,6 +7945,39 @@ func (mr *MockEC2APIMockRecorder) DescribeHostReservations(arg0 interface{}) *go return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeHostReservations", reflect.TypeOf((*MockEC2API)(nil).DescribeHostReservations), arg0) } +// DescribeHostReservationsPages mocks base method +func (m *MockEC2API) DescribeHostReservationsPages(arg0 *ec2.DescribeHostReservationsInput, arg1 func(*ec2.DescribeHostReservationsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeHostReservationsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeHostReservationsPages indicates an expected call of DescribeHostReservationsPages +func (mr *MockEC2APIMockRecorder) DescribeHostReservationsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeHostReservationsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeHostReservationsPages), arg0, arg1) +} + +// DescribeHostReservationsPagesWithContext mocks base method +func (m *MockEC2API) DescribeHostReservationsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeHostReservationsInput, arg2 func(*ec2.DescribeHostReservationsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeHostReservationsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeHostReservationsPagesWithContext indicates an expected call of DescribeHostReservationsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeHostReservationsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeHostReservationsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeHostReservationsPagesWithContext), varargs...) +} + // DescribeHostReservationsRequest mocks base method func (m *MockEC2API) DescribeHostReservationsRequest(arg0 *ec2.DescribeHostReservationsInput) (*request.Request, *ec2.DescribeHostReservationsOutput) { m.ctrl.T.Helper() @@ -7568,6 +8028,39 @@ func (mr *MockEC2APIMockRecorder) DescribeHosts(arg0 interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeHosts", reflect.TypeOf((*MockEC2API)(nil).DescribeHosts), arg0) } +// DescribeHostsPages mocks base method +func (m *MockEC2API) DescribeHostsPages(arg0 *ec2.DescribeHostsInput, arg1 func(*ec2.DescribeHostsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeHostsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeHostsPages indicates an expected call of DescribeHostsPages +func (mr *MockEC2APIMockRecorder) DescribeHostsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeHostsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeHostsPages), arg0, arg1) +} + +// DescribeHostsPagesWithContext mocks base method +func (m *MockEC2API) DescribeHostsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeHostsInput, arg2 func(*ec2.DescribeHostsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeHostsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeHostsPagesWithContext indicates an expected call of DescribeHostsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeHostsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeHostsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeHostsPagesWithContext), varargs...) +} + // DescribeHostsRequest mocks base method func (m *MockEC2API) DescribeHostsRequest(arg0 *ec2.DescribeHostsInput) (*request.Request, *ec2.DescribeHostsOutput) { m.ctrl.T.Helper() @@ -7618,6 +8111,39 @@ func (mr *MockEC2APIMockRecorder) DescribeIamInstanceProfileAssociations(arg0 in return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeIamInstanceProfileAssociations", reflect.TypeOf((*MockEC2API)(nil).DescribeIamInstanceProfileAssociations), arg0) } +// DescribeIamInstanceProfileAssociationsPages mocks base method +func (m *MockEC2API) DescribeIamInstanceProfileAssociationsPages(arg0 *ec2.DescribeIamInstanceProfileAssociationsInput, arg1 func(*ec2.DescribeIamInstanceProfileAssociationsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeIamInstanceProfileAssociationsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeIamInstanceProfileAssociationsPages indicates an expected call of DescribeIamInstanceProfileAssociationsPages +func (mr *MockEC2APIMockRecorder) DescribeIamInstanceProfileAssociationsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeIamInstanceProfileAssociationsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeIamInstanceProfileAssociationsPages), arg0, arg1) +} + +// DescribeIamInstanceProfileAssociationsPagesWithContext mocks base method +func (m *MockEC2API) DescribeIamInstanceProfileAssociationsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeIamInstanceProfileAssociationsInput, arg2 func(*ec2.DescribeIamInstanceProfileAssociationsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeIamInstanceProfileAssociationsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeIamInstanceProfileAssociationsPagesWithContext indicates an expected call of DescribeIamInstanceProfileAssociationsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeIamInstanceProfileAssociationsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeIamInstanceProfileAssociationsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeIamInstanceProfileAssociationsPagesWithContext), varargs...) +} + // DescribeIamInstanceProfileAssociationsRequest mocks base method func (m *MockEC2API) DescribeIamInstanceProfileAssociationsRequest(arg0 *ec2.DescribeIamInstanceProfileAssociationsInput) (*request.Request, *ec2.DescribeIamInstanceProfileAssociationsOutput) { m.ctrl.T.Helper() @@ -7868,6 +8394,39 @@ func (mr *MockEC2APIMockRecorder) DescribeImportImageTasks(arg0 interface{}) *go return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeImportImageTasks", reflect.TypeOf((*MockEC2API)(nil).DescribeImportImageTasks), arg0) } +// DescribeImportImageTasksPages mocks base method +func (m *MockEC2API) DescribeImportImageTasksPages(arg0 *ec2.DescribeImportImageTasksInput, arg1 func(*ec2.DescribeImportImageTasksOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeImportImageTasksPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeImportImageTasksPages indicates an expected call of DescribeImportImageTasksPages +func (mr *MockEC2APIMockRecorder) DescribeImportImageTasksPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeImportImageTasksPages", reflect.TypeOf((*MockEC2API)(nil).DescribeImportImageTasksPages), arg0, arg1) +} + +// DescribeImportImageTasksPagesWithContext mocks base method +func (m *MockEC2API) DescribeImportImageTasksPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeImportImageTasksInput, arg2 func(*ec2.DescribeImportImageTasksOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeImportImageTasksPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeImportImageTasksPagesWithContext indicates an expected call of DescribeImportImageTasksPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeImportImageTasksPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeImportImageTasksPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeImportImageTasksPagesWithContext), varargs...) +} + // DescribeImportImageTasksRequest mocks base method func (m *MockEC2API) DescribeImportImageTasksRequest(arg0 *ec2.DescribeImportImageTasksInput) (*request.Request, *ec2.DescribeImportImageTasksOutput) { m.ctrl.T.Helper() @@ -7918,6 +8477,39 @@ func (mr *MockEC2APIMockRecorder) DescribeImportSnapshotTasks(arg0 interface{}) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeImportSnapshotTasks", reflect.TypeOf((*MockEC2API)(nil).DescribeImportSnapshotTasks), arg0) } +// DescribeImportSnapshotTasksPages mocks base method +func (m *MockEC2API) DescribeImportSnapshotTasksPages(arg0 *ec2.DescribeImportSnapshotTasksInput, arg1 func(*ec2.DescribeImportSnapshotTasksOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeImportSnapshotTasksPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeImportSnapshotTasksPages indicates an expected call of DescribeImportSnapshotTasksPages +func (mr *MockEC2APIMockRecorder) DescribeImportSnapshotTasksPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeImportSnapshotTasksPages", reflect.TypeOf((*MockEC2API)(nil).DescribeImportSnapshotTasksPages), arg0, arg1) +} + +// DescribeImportSnapshotTasksPagesWithContext mocks base method +func (m *MockEC2API) DescribeImportSnapshotTasksPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeImportSnapshotTasksInput, arg2 func(*ec2.DescribeImportSnapshotTasksOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeImportSnapshotTasksPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeImportSnapshotTasksPagesWithContext indicates an expected call of DescribeImportSnapshotTasksPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeImportSnapshotTasksPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeImportSnapshotTasksPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeImportSnapshotTasksPagesWithContext), varargs...) +} + // DescribeImportSnapshotTasksRequest mocks base method func (m *MockEC2API) DescribeImportSnapshotTasksRequest(arg0 *ec2.DescribeImportSnapshotTasksInput) (*request.Request, *ec2.DescribeImportSnapshotTasksOutput) { m.ctrl.T.Helper() @@ -8018,6 +8610,39 @@ func (mr *MockEC2APIMockRecorder) DescribeInstanceCreditSpecifications(arg0 inte return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeInstanceCreditSpecifications", reflect.TypeOf((*MockEC2API)(nil).DescribeInstanceCreditSpecifications), arg0) } +// DescribeInstanceCreditSpecificationsPages mocks base method +func (m *MockEC2API) DescribeInstanceCreditSpecificationsPages(arg0 *ec2.DescribeInstanceCreditSpecificationsInput, arg1 func(*ec2.DescribeInstanceCreditSpecificationsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeInstanceCreditSpecificationsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeInstanceCreditSpecificationsPages indicates an expected call of DescribeInstanceCreditSpecificationsPages +func (mr *MockEC2APIMockRecorder) DescribeInstanceCreditSpecificationsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeInstanceCreditSpecificationsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeInstanceCreditSpecificationsPages), arg0, arg1) +} + +// DescribeInstanceCreditSpecificationsPagesWithContext mocks base method +func (m *MockEC2API) DescribeInstanceCreditSpecificationsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeInstanceCreditSpecificationsInput, arg2 func(*ec2.DescribeInstanceCreditSpecificationsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeInstanceCreditSpecificationsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeInstanceCreditSpecificationsPagesWithContext indicates an expected call of DescribeInstanceCreditSpecificationsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeInstanceCreditSpecificationsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeInstanceCreditSpecificationsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeInstanceCreditSpecificationsPagesWithContext), varargs...) +} + // DescribeInstanceCreditSpecificationsRequest mocks base method func (m *MockEC2API) DescribeInstanceCreditSpecificationsRequest(arg0 *ec2.DescribeInstanceCreditSpecificationsInput) (*request.Request, *ec2.DescribeInstanceCreditSpecificationsOutput) { m.ctrl.T.Helper() @@ -8234,6 +8859,39 @@ func (mr *MockEC2APIMockRecorder) DescribeInternetGateways(arg0 interface{}) *go return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeInternetGateways", reflect.TypeOf((*MockEC2API)(nil).DescribeInternetGateways), arg0) } +// DescribeInternetGatewaysPages mocks base method +func (m *MockEC2API) DescribeInternetGatewaysPages(arg0 *ec2.DescribeInternetGatewaysInput, arg1 func(*ec2.DescribeInternetGatewaysOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeInternetGatewaysPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeInternetGatewaysPages indicates an expected call of DescribeInternetGatewaysPages +func (mr *MockEC2APIMockRecorder) DescribeInternetGatewaysPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeInternetGatewaysPages", reflect.TypeOf((*MockEC2API)(nil).DescribeInternetGatewaysPages), arg0, arg1) +} + +// DescribeInternetGatewaysPagesWithContext mocks base method +func (m *MockEC2API) DescribeInternetGatewaysPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeInternetGatewaysInput, arg2 func(*ec2.DescribeInternetGatewaysOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeInternetGatewaysPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeInternetGatewaysPagesWithContext indicates an expected call of DescribeInternetGatewaysPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeInternetGatewaysPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeInternetGatewaysPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeInternetGatewaysPagesWithContext), varargs...) +} + // DescribeInternetGatewaysRequest mocks base method func (m *MockEC2API) DescribeInternetGatewaysRequest(arg0 *ec2.DescribeInternetGatewaysInput) (*request.Request, *ec2.DescribeInternetGatewaysOutput) { m.ctrl.T.Helper() @@ -8334,6 +8992,39 @@ func (mr *MockEC2APIMockRecorder) DescribeLaunchTemplateVersions(arg0 interface{ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeLaunchTemplateVersions", reflect.TypeOf((*MockEC2API)(nil).DescribeLaunchTemplateVersions), arg0) } +// DescribeLaunchTemplateVersionsPages mocks base method +func (m *MockEC2API) DescribeLaunchTemplateVersionsPages(arg0 *ec2.DescribeLaunchTemplateVersionsInput, arg1 func(*ec2.DescribeLaunchTemplateVersionsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeLaunchTemplateVersionsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeLaunchTemplateVersionsPages indicates an expected call of DescribeLaunchTemplateVersionsPages +func (mr *MockEC2APIMockRecorder) DescribeLaunchTemplateVersionsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeLaunchTemplateVersionsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeLaunchTemplateVersionsPages), arg0, arg1) +} + +// DescribeLaunchTemplateVersionsPagesWithContext mocks base method +func (m *MockEC2API) DescribeLaunchTemplateVersionsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeLaunchTemplateVersionsInput, arg2 func(*ec2.DescribeLaunchTemplateVersionsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeLaunchTemplateVersionsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeLaunchTemplateVersionsPagesWithContext indicates an expected call of DescribeLaunchTemplateVersionsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeLaunchTemplateVersionsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeLaunchTemplateVersionsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeLaunchTemplateVersionsPagesWithContext), varargs...) +} + // DescribeLaunchTemplateVersionsRequest mocks base method func (m *MockEC2API) DescribeLaunchTemplateVersionsRequest(arg0 *ec2.DescribeLaunchTemplateVersionsInput) (*request.Request, *ec2.DescribeLaunchTemplateVersionsOutput) { m.ctrl.T.Helper() @@ -8384,6 +9075,39 @@ func (mr *MockEC2APIMockRecorder) DescribeLaunchTemplates(arg0 interface{}) *gom return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeLaunchTemplates", reflect.TypeOf((*MockEC2API)(nil).DescribeLaunchTemplates), arg0) } +// DescribeLaunchTemplatesPages mocks base method +func (m *MockEC2API) DescribeLaunchTemplatesPages(arg0 *ec2.DescribeLaunchTemplatesInput, arg1 func(*ec2.DescribeLaunchTemplatesOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeLaunchTemplatesPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeLaunchTemplatesPages indicates an expected call of DescribeLaunchTemplatesPages +func (mr *MockEC2APIMockRecorder) DescribeLaunchTemplatesPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeLaunchTemplatesPages", reflect.TypeOf((*MockEC2API)(nil).DescribeLaunchTemplatesPages), arg0, arg1) +} + +// DescribeLaunchTemplatesPagesWithContext mocks base method +func (m *MockEC2API) DescribeLaunchTemplatesPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeLaunchTemplatesInput, arg2 func(*ec2.DescribeLaunchTemplatesOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeLaunchTemplatesPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeLaunchTemplatesPagesWithContext indicates an expected call of DescribeLaunchTemplatesPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeLaunchTemplatesPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeLaunchTemplatesPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeLaunchTemplatesPagesWithContext), varargs...) +} + // DescribeLaunchTemplatesRequest mocks base method func (m *MockEC2API) DescribeLaunchTemplatesRequest(arg0 *ec2.DescribeLaunchTemplatesInput) (*request.Request, *ec2.DescribeLaunchTemplatesOutput) { m.ctrl.T.Helper() @@ -8434,6 +9158,39 @@ func (mr *MockEC2APIMockRecorder) DescribeMovingAddresses(arg0 interface{}) *gom return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeMovingAddresses", reflect.TypeOf((*MockEC2API)(nil).DescribeMovingAddresses), arg0) } +// DescribeMovingAddressesPages mocks base method +func (m *MockEC2API) DescribeMovingAddressesPages(arg0 *ec2.DescribeMovingAddressesInput, arg1 func(*ec2.DescribeMovingAddressesOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeMovingAddressesPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeMovingAddressesPages indicates an expected call of DescribeMovingAddressesPages +func (mr *MockEC2APIMockRecorder) DescribeMovingAddressesPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeMovingAddressesPages", reflect.TypeOf((*MockEC2API)(nil).DescribeMovingAddressesPages), arg0, arg1) +} + +// DescribeMovingAddressesPagesWithContext mocks base method +func (m *MockEC2API) DescribeMovingAddressesPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeMovingAddressesInput, arg2 func(*ec2.DescribeMovingAddressesOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeMovingAddressesPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeMovingAddressesPagesWithContext indicates an expected call of DescribeMovingAddressesPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeMovingAddressesPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeMovingAddressesPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeMovingAddressesPagesWithContext), varargs...) +} + // DescribeMovingAddressesRequest mocks base method func (m *MockEC2API) DescribeMovingAddressesRequest(arg0 *ec2.DescribeMovingAddressesInput) (*request.Request, *ec2.DescribeMovingAddressesOutput) { m.ctrl.T.Helper() @@ -8567,6 +9324,39 @@ func (mr *MockEC2APIMockRecorder) DescribeNetworkAcls(arg0 interface{}) *gomock. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeNetworkAcls", reflect.TypeOf((*MockEC2API)(nil).DescribeNetworkAcls), arg0) } +// DescribeNetworkAclsPages mocks base method +func (m *MockEC2API) DescribeNetworkAclsPages(arg0 *ec2.DescribeNetworkAclsInput, arg1 func(*ec2.DescribeNetworkAclsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeNetworkAclsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeNetworkAclsPages indicates an expected call of DescribeNetworkAclsPages +func (mr *MockEC2APIMockRecorder) DescribeNetworkAclsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeNetworkAclsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeNetworkAclsPages), arg0, arg1) +} + +// DescribeNetworkAclsPagesWithContext mocks base method +func (m *MockEC2API) DescribeNetworkAclsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeNetworkAclsInput, arg2 func(*ec2.DescribeNetworkAclsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeNetworkAclsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeNetworkAclsPagesWithContext indicates an expected call of DescribeNetworkAclsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeNetworkAclsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeNetworkAclsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeNetworkAclsPagesWithContext), varargs...) +} + // DescribeNetworkAclsRequest mocks base method func (m *MockEC2API) DescribeNetworkAclsRequest(arg0 *ec2.DescribeNetworkAclsInput) (*request.Request, *ec2.DescribeNetworkAclsOutput) { m.ctrl.T.Helper() @@ -8667,6 +9457,39 @@ func (mr *MockEC2APIMockRecorder) DescribeNetworkInterfacePermissions(arg0 inter return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeNetworkInterfacePermissions", reflect.TypeOf((*MockEC2API)(nil).DescribeNetworkInterfacePermissions), arg0) } +// DescribeNetworkInterfacePermissionsPages mocks base method +func (m *MockEC2API) DescribeNetworkInterfacePermissionsPages(arg0 *ec2.DescribeNetworkInterfacePermissionsInput, arg1 func(*ec2.DescribeNetworkInterfacePermissionsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeNetworkInterfacePermissionsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeNetworkInterfacePermissionsPages indicates an expected call of DescribeNetworkInterfacePermissionsPages +func (mr *MockEC2APIMockRecorder) DescribeNetworkInterfacePermissionsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeNetworkInterfacePermissionsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeNetworkInterfacePermissionsPages), arg0, arg1) +} + +// DescribeNetworkInterfacePermissionsPagesWithContext mocks base method +func (m *MockEC2API) DescribeNetworkInterfacePermissionsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeNetworkInterfacePermissionsInput, arg2 func(*ec2.DescribeNetworkInterfacePermissionsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeNetworkInterfacePermissionsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeNetworkInterfacePermissionsPagesWithContext indicates an expected call of DescribeNetworkInterfacePermissionsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeNetworkInterfacePermissionsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeNetworkInterfacePermissionsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeNetworkInterfacePermissionsPagesWithContext), varargs...) +} + // DescribeNetworkInterfacePermissionsRequest mocks base method func (m *MockEC2API) DescribeNetworkInterfacePermissionsRequest(arg0 *ec2.DescribeNetworkInterfacePermissionsInput) (*request.Request, *ec2.DescribeNetworkInterfacePermissionsOutput) { m.ctrl.T.Helper() @@ -8850,6 +9673,39 @@ func (mr *MockEC2APIMockRecorder) DescribePrefixLists(arg0 interface{}) *gomock. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribePrefixLists", reflect.TypeOf((*MockEC2API)(nil).DescribePrefixLists), arg0) } +// DescribePrefixListsPages mocks base method +func (m *MockEC2API) DescribePrefixListsPages(arg0 *ec2.DescribePrefixListsInput, arg1 func(*ec2.DescribePrefixListsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribePrefixListsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribePrefixListsPages indicates an expected call of DescribePrefixListsPages +func (mr *MockEC2APIMockRecorder) DescribePrefixListsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribePrefixListsPages", reflect.TypeOf((*MockEC2API)(nil).DescribePrefixListsPages), arg0, arg1) +} + +// DescribePrefixListsPagesWithContext mocks base method +func (m *MockEC2API) DescribePrefixListsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribePrefixListsInput, arg2 func(*ec2.DescribePrefixListsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribePrefixListsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribePrefixListsPagesWithContext indicates an expected call of DescribePrefixListsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribePrefixListsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribePrefixListsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribePrefixListsPagesWithContext), varargs...) +} + // DescribePrefixListsRequest mocks base method func (m *MockEC2API) DescribePrefixListsRequest(arg0 *ec2.DescribePrefixListsInput) (*request.Request, *ec2.DescribePrefixListsOutput) { m.ctrl.T.Helper() @@ -8900,6 +9756,39 @@ func (mr *MockEC2APIMockRecorder) DescribePrincipalIdFormat(arg0 interface{}) *g return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribePrincipalIdFormat", reflect.TypeOf((*MockEC2API)(nil).DescribePrincipalIdFormat), arg0) } +// DescribePrincipalIdFormatPages mocks base method +func (m *MockEC2API) DescribePrincipalIdFormatPages(arg0 *ec2.DescribePrincipalIdFormatInput, arg1 func(*ec2.DescribePrincipalIdFormatOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribePrincipalIdFormatPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribePrincipalIdFormatPages indicates an expected call of DescribePrincipalIdFormatPages +func (mr *MockEC2APIMockRecorder) DescribePrincipalIdFormatPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribePrincipalIdFormatPages", reflect.TypeOf((*MockEC2API)(nil).DescribePrincipalIdFormatPages), arg0, arg1) +} + +// DescribePrincipalIdFormatPagesWithContext mocks base method +func (m *MockEC2API) DescribePrincipalIdFormatPagesWithContext(arg0 context.Context, arg1 *ec2.DescribePrincipalIdFormatInput, arg2 func(*ec2.DescribePrincipalIdFormatOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribePrincipalIdFormatPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribePrincipalIdFormatPagesWithContext indicates an expected call of DescribePrincipalIdFormatPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribePrincipalIdFormatPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribePrincipalIdFormatPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribePrincipalIdFormatPagesWithContext), varargs...) +} + // DescribePrincipalIdFormatRequest mocks base method func (m *MockEC2API) DescribePrincipalIdFormatRequest(arg0 *ec2.DescribePrincipalIdFormatInput) (*request.Request, *ec2.DescribePrincipalIdFormatOutput) { m.ctrl.T.Helper() @@ -8950,6 +9839,39 @@ func (mr *MockEC2APIMockRecorder) DescribePublicIpv4Pools(arg0 interface{}) *gom return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribePublicIpv4Pools", reflect.TypeOf((*MockEC2API)(nil).DescribePublicIpv4Pools), arg0) } +// DescribePublicIpv4PoolsPages mocks base method +func (m *MockEC2API) DescribePublicIpv4PoolsPages(arg0 *ec2.DescribePublicIpv4PoolsInput, arg1 func(*ec2.DescribePublicIpv4PoolsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribePublicIpv4PoolsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribePublicIpv4PoolsPages indicates an expected call of DescribePublicIpv4PoolsPages +func (mr *MockEC2APIMockRecorder) DescribePublicIpv4PoolsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribePublicIpv4PoolsPages", reflect.TypeOf((*MockEC2API)(nil).DescribePublicIpv4PoolsPages), arg0, arg1) +} + +// DescribePublicIpv4PoolsPagesWithContext mocks base method +func (m *MockEC2API) DescribePublicIpv4PoolsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribePublicIpv4PoolsInput, arg2 func(*ec2.DescribePublicIpv4PoolsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribePublicIpv4PoolsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribePublicIpv4PoolsPagesWithContext indicates an expected call of DescribePublicIpv4PoolsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribePublicIpv4PoolsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribePublicIpv4PoolsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribePublicIpv4PoolsPagesWithContext), varargs...) +} + // DescribePublicIpv4PoolsRequest mocks base method func (m *MockEC2API) DescribePublicIpv4PoolsRequest(arg0 *ec2.DescribePublicIpv4PoolsInput) (*request.Request, *ec2.DescribePublicIpv4PoolsOutput) { m.ctrl.T.Helper() @@ -9399,6 +10321,39 @@ func (mr *MockEC2APIMockRecorder) DescribeScheduledInstanceAvailability(arg0 int return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeScheduledInstanceAvailability", reflect.TypeOf((*MockEC2API)(nil).DescribeScheduledInstanceAvailability), arg0) } +// DescribeScheduledInstanceAvailabilityPages mocks base method +func (m *MockEC2API) DescribeScheduledInstanceAvailabilityPages(arg0 *ec2.DescribeScheduledInstanceAvailabilityInput, arg1 func(*ec2.DescribeScheduledInstanceAvailabilityOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeScheduledInstanceAvailabilityPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeScheduledInstanceAvailabilityPages indicates an expected call of DescribeScheduledInstanceAvailabilityPages +func (mr *MockEC2APIMockRecorder) DescribeScheduledInstanceAvailabilityPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeScheduledInstanceAvailabilityPages", reflect.TypeOf((*MockEC2API)(nil).DescribeScheduledInstanceAvailabilityPages), arg0, arg1) +} + +// DescribeScheduledInstanceAvailabilityPagesWithContext mocks base method +func (m *MockEC2API) DescribeScheduledInstanceAvailabilityPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeScheduledInstanceAvailabilityInput, arg2 func(*ec2.DescribeScheduledInstanceAvailabilityOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeScheduledInstanceAvailabilityPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeScheduledInstanceAvailabilityPagesWithContext indicates an expected call of DescribeScheduledInstanceAvailabilityPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeScheduledInstanceAvailabilityPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeScheduledInstanceAvailabilityPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeScheduledInstanceAvailabilityPagesWithContext), varargs...) +} + // DescribeScheduledInstanceAvailabilityRequest mocks base method func (m *MockEC2API) DescribeScheduledInstanceAvailabilityRequest(arg0 *ec2.DescribeScheduledInstanceAvailabilityInput) (*request.Request, *ec2.DescribeScheduledInstanceAvailabilityOutput) { m.ctrl.T.Helper() @@ -9449,6 +10404,39 @@ func (mr *MockEC2APIMockRecorder) DescribeScheduledInstances(arg0 interface{}) * return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeScheduledInstances", reflect.TypeOf((*MockEC2API)(nil).DescribeScheduledInstances), arg0) } +// DescribeScheduledInstancesPages mocks base method +func (m *MockEC2API) DescribeScheduledInstancesPages(arg0 *ec2.DescribeScheduledInstancesInput, arg1 func(*ec2.DescribeScheduledInstancesOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeScheduledInstancesPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeScheduledInstancesPages indicates an expected call of DescribeScheduledInstancesPages +func (mr *MockEC2APIMockRecorder) DescribeScheduledInstancesPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeScheduledInstancesPages", reflect.TypeOf((*MockEC2API)(nil).DescribeScheduledInstancesPages), arg0, arg1) +} + +// DescribeScheduledInstancesPagesWithContext mocks base method +func (m *MockEC2API) DescribeScheduledInstancesPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeScheduledInstancesInput, arg2 func(*ec2.DescribeScheduledInstancesOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeScheduledInstancesPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeScheduledInstancesPagesWithContext indicates an expected call of DescribeScheduledInstancesPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeScheduledInstancesPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeScheduledInstancesPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeScheduledInstancesPagesWithContext), varargs...) +} + // DescribeScheduledInstancesRequest mocks base method func (m *MockEC2API) DescribeScheduledInstancesRequest(arg0 *ec2.DescribeScheduledInstancesInput) (*request.Request, *ec2.DescribeScheduledInstancesOutput) { m.ctrl.T.Helper() @@ -9998,6 +10986,39 @@ func (mr *MockEC2APIMockRecorder) DescribeSpotInstanceRequests(arg0 interface{}) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeSpotInstanceRequests", reflect.TypeOf((*MockEC2API)(nil).DescribeSpotInstanceRequests), arg0) } +// DescribeSpotInstanceRequestsPages mocks base method +func (m *MockEC2API) DescribeSpotInstanceRequestsPages(arg0 *ec2.DescribeSpotInstanceRequestsInput, arg1 func(*ec2.DescribeSpotInstanceRequestsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeSpotInstanceRequestsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeSpotInstanceRequestsPages indicates an expected call of DescribeSpotInstanceRequestsPages +func (mr *MockEC2APIMockRecorder) DescribeSpotInstanceRequestsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeSpotInstanceRequestsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeSpotInstanceRequestsPages), arg0, arg1) +} + +// DescribeSpotInstanceRequestsPagesWithContext mocks base method +func (m *MockEC2API) DescribeSpotInstanceRequestsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeSpotInstanceRequestsInput, arg2 func(*ec2.DescribeSpotInstanceRequestsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeSpotInstanceRequestsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeSpotInstanceRequestsPagesWithContext indicates an expected call of DescribeSpotInstanceRequestsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeSpotInstanceRequestsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeSpotInstanceRequestsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeSpotInstanceRequestsPagesWithContext), varargs...) +} + // DescribeSpotInstanceRequestsRequest mocks base method func (m *MockEC2API) DescribeSpotInstanceRequestsRequest(arg0 *ec2.DescribeSpotInstanceRequestsInput) (*request.Request, *ec2.DescribeSpotInstanceRequestsOutput) { m.ctrl.T.Helper() @@ -10131,6 +11152,39 @@ func (mr *MockEC2APIMockRecorder) DescribeStaleSecurityGroups(arg0 interface{}) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeStaleSecurityGroups", reflect.TypeOf((*MockEC2API)(nil).DescribeStaleSecurityGroups), arg0) } +// DescribeStaleSecurityGroupsPages mocks base method +func (m *MockEC2API) DescribeStaleSecurityGroupsPages(arg0 *ec2.DescribeStaleSecurityGroupsInput, arg1 func(*ec2.DescribeStaleSecurityGroupsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeStaleSecurityGroupsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeStaleSecurityGroupsPages indicates an expected call of DescribeStaleSecurityGroupsPages +func (mr *MockEC2APIMockRecorder) DescribeStaleSecurityGroupsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeStaleSecurityGroupsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeStaleSecurityGroupsPages), arg0, arg1) +} + +// DescribeStaleSecurityGroupsPagesWithContext mocks base method +func (m *MockEC2API) DescribeStaleSecurityGroupsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeStaleSecurityGroupsInput, arg2 func(*ec2.DescribeStaleSecurityGroupsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeStaleSecurityGroupsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeStaleSecurityGroupsPagesWithContext indicates an expected call of DescribeStaleSecurityGroupsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeStaleSecurityGroupsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeStaleSecurityGroupsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeStaleSecurityGroupsPagesWithContext), varargs...) +} + // DescribeStaleSecurityGroupsRequest mocks base method func (m *MockEC2API) DescribeStaleSecurityGroupsRequest(arg0 *ec2.DescribeStaleSecurityGroupsInput) (*request.Request, *ec2.DescribeStaleSecurityGroupsOutput) { m.ctrl.T.Helper() @@ -10314,6 +11368,39 @@ func (mr *MockEC2APIMockRecorder) DescribeTransitGatewayAttachments(arg0 interfa return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTransitGatewayAttachments", reflect.TypeOf((*MockEC2API)(nil).DescribeTransitGatewayAttachments), arg0) } +// DescribeTransitGatewayAttachmentsPages mocks base method +func (m *MockEC2API) DescribeTransitGatewayAttachmentsPages(arg0 *ec2.DescribeTransitGatewayAttachmentsInput, arg1 func(*ec2.DescribeTransitGatewayAttachmentsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeTransitGatewayAttachmentsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeTransitGatewayAttachmentsPages indicates an expected call of DescribeTransitGatewayAttachmentsPages +func (mr *MockEC2APIMockRecorder) DescribeTransitGatewayAttachmentsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTransitGatewayAttachmentsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeTransitGatewayAttachmentsPages), arg0, arg1) +} + +// DescribeTransitGatewayAttachmentsPagesWithContext mocks base method +func (m *MockEC2API) DescribeTransitGatewayAttachmentsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeTransitGatewayAttachmentsInput, arg2 func(*ec2.DescribeTransitGatewayAttachmentsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeTransitGatewayAttachmentsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeTransitGatewayAttachmentsPagesWithContext indicates an expected call of DescribeTransitGatewayAttachmentsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeTransitGatewayAttachmentsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTransitGatewayAttachmentsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeTransitGatewayAttachmentsPagesWithContext), varargs...) +} + // DescribeTransitGatewayAttachmentsRequest mocks base method func (m *MockEC2API) DescribeTransitGatewayAttachmentsRequest(arg0 *ec2.DescribeTransitGatewayAttachmentsInput) (*request.Request, *ec2.DescribeTransitGatewayAttachmentsOutput) { m.ctrl.T.Helper() @@ -10364,6 +11451,39 @@ func (mr *MockEC2APIMockRecorder) DescribeTransitGatewayRouteTables(arg0 interfa return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTransitGatewayRouteTables", reflect.TypeOf((*MockEC2API)(nil).DescribeTransitGatewayRouteTables), arg0) } +// DescribeTransitGatewayRouteTablesPages mocks base method +func (m *MockEC2API) DescribeTransitGatewayRouteTablesPages(arg0 *ec2.DescribeTransitGatewayRouteTablesInput, arg1 func(*ec2.DescribeTransitGatewayRouteTablesOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeTransitGatewayRouteTablesPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeTransitGatewayRouteTablesPages indicates an expected call of DescribeTransitGatewayRouteTablesPages +func (mr *MockEC2APIMockRecorder) DescribeTransitGatewayRouteTablesPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTransitGatewayRouteTablesPages", reflect.TypeOf((*MockEC2API)(nil).DescribeTransitGatewayRouteTablesPages), arg0, arg1) +} + +// DescribeTransitGatewayRouteTablesPagesWithContext mocks base method +func (m *MockEC2API) DescribeTransitGatewayRouteTablesPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeTransitGatewayRouteTablesInput, arg2 func(*ec2.DescribeTransitGatewayRouteTablesOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeTransitGatewayRouteTablesPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeTransitGatewayRouteTablesPagesWithContext indicates an expected call of DescribeTransitGatewayRouteTablesPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeTransitGatewayRouteTablesPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTransitGatewayRouteTablesPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeTransitGatewayRouteTablesPagesWithContext), varargs...) +} + // DescribeTransitGatewayRouteTablesRequest mocks base method func (m *MockEC2API) DescribeTransitGatewayRouteTablesRequest(arg0 *ec2.DescribeTransitGatewayRouteTablesInput) (*request.Request, *ec2.DescribeTransitGatewayRouteTablesOutput) { m.ctrl.T.Helper() @@ -10414,6 +11534,39 @@ func (mr *MockEC2APIMockRecorder) DescribeTransitGatewayVpcAttachments(arg0 inte return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTransitGatewayVpcAttachments", reflect.TypeOf((*MockEC2API)(nil).DescribeTransitGatewayVpcAttachments), arg0) } +// DescribeTransitGatewayVpcAttachmentsPages mocks base method +func (m *MockEC2API) DescribeTransitGatewayVpcAttachmentsPages(arg0 *ec2.DescribeTransitGatewayVpcAttachmentsInput, arg1 func(*ec2.DescribeTransitGatewayVpcAttachmentsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeTransitGatewayVpcAttachmentsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeTransitGatewayVpcAttachmentsPages indicates an expected call of DescribeTransitGatewayVpcAttachmentsPages +func (mr *MockEC2APIMockRecorder) DescribeTransitGatewayVpcAttachmentsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTransitGatewayVpcAttachmentsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeTransitGatewayVpcAttachmentsPages), arg0, arg1) +} + +// DescribeTransitGatewayVpcAttachmentsPagesWithContext mocks base method +func (m *MockEC2API) DescribeTransitGatewayVpcAttachmentsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeTransitGatewayVpcAttachmentsInput, arg2 func(*ec2.DescribeTransitGatewayVpcAttachmentsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeTransitGatewayVpcAttachmentsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeTransitGatewayVpcAttachmentsPagesWithContext indicates an expected call of DescribeTransitGatewayVpcAttachmentsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeTransitGatewayVpcAttachmentsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTransitGatewayVpcAttachmentsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeTransitGatewayVpcAttachmentsPagesWithContext), varargs...) +} + // DescribeTransitGatewayVpcAttachmentsRequest mocks base method func (m *MockEC2API) DescribeTransitGatewayVpcAttachmentsRequest(arg0 *ec2.DescribeTransitGatewayVpcAttachmentsInput) (*request.Request, *ec2.DescribeTransitGatewayVpcAttachmentsOutput) { m.ctrl.T.Helper() @@ -10464,6 +11617,39 @@ func (mr *MockEC2APIMockRecorder) DescribeTransitGateways(arg0 interface{}) *gom return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTransitGateways", reflect.TypeOf((*MockEC2API)(nil).DescribeTransitGateways), arg0) } +// DescribeTransitGatewaysPages mocks base method +func (m *MockEC2API) DescribeTransitGatewaysPages(arg0 *ec2.DescribeTransitGatewaysInput, arg1 func(*ec2.DescribeTransitGatewaysOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeTransitGatewaysPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeTransitGatewaysPages indicates an expected call of DescribeTransitGatewaysPages +func (mr *MockEC2APIMockRecorder) DescribeTransitGatewaysPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTransitGatewaysPages", reflect.TypeOf((*MockEC2API)(nil).DescribeTransitGatewaysPages), arg0, arg1) +} + +// DescribeTransitGatewaysPagesWithContext mocks base method +func (m *MockEC2API) DescribeTransitGatewaysPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeTransitGatewaysInput, arg2 func(*ec2.DescribeTransitGatewaysOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeTransitGatewaysPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeTransitGatewaysPagesWithContext indicates an expected call of DescribeTransitGatewaysPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeTransitGatewaysPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTransitGatewaysPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeTransitGatewaysPagesWithContext), varargs...) +} + // DescribeTransitGatewaysRequest mocks base method func (m *MockEC2API) DescribeTransitGatewaysRequest(arg0 *ec2.DescribeTransitGatewaysInput) (*request.Request, *ec2.DescribeTransitGatewaysOutput) { m.ctrl.T.Helper() @@ -10662,6 +11848,39 @@ func (mr *MockEC2APIMockRecorder) DescribeVolumesModifications(arg0 interface{}) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVolumesModifications", reflect.TypeOf((*MockEC2API)(nil).DescribeVolumesModifications), arg0) } +// DescribeVolumesModificationsPages mocks base method +func (m *MockEC2API) DescribeVolumesModificationsPages(arg0 *ec2.DescribeVolumesModificationsInput, arg1 func(*ec2.DescribeVolumesModificationsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeVolumesModificationsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVolumesModificationsPages indicates an expected call of DescribeVolumesModificationsPages +func (mr *MockEC2APIMockRecorder) DescribeVolumesModificationsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVolumesModificationsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeVolumesModificationsPages), arg0, arg1) +} + +// DescribeVolumesModificationsPagesWithContext mocks base method +func (m *MockEC2API) DescribeVolumesModificationsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeVolumesModificationsInput, arg2 func(*ec2.DescribeVolumesModificationsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeVolumesModificationsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVolumesModificationsPagesWithContext indicates an expected call of DescribeVolumesModificationsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeVolumesModificationsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVolumesModificationsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeVolumesModificationsPagesWithContext), varargs...) +} + // DescribeVolumesModificationsRequest mocks base method func (m *MockEC2API) DescribeVolumesModificationsRequest(arg0 *ec2.DescribeVolumesModificationsInput) (*request.Request, *ec2.DescribeVolumesModificationsOutput) { m.ctrl.T.Helper() @@ -10827,22 +12046,55 @@ func (m *MockEC2API) DescribeVpcClassicLink(arg0 *ec2.DescribeVpcClassicLinkInpu // DescribeVpcClassicLink indicates an expected call of DescribeVpcClassicLink func (mr *MockEC2APIMockRecorder) DescribeVpcClassicLink(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcClassicLink", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcClassicLink), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcClassicLink", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcClassicLink), arg0) +} + +// DescribeVpcClassicLinkDnsSupport mocks base method +func (m *MockEC2API) DescribeVpcClassicLinkDnsSupport(arg0 *ec2.DescribeVpcClassicLinkDnsSupportInput) (*ec2.DescribeVpcClassicLinkDnsSupportOutput, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeVpcClassicLinkDnsSupport", arg0) + ret0, _ := ret[0].(*ec2.DescribeVpcClassicLinkDnsSupportOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DescribeVpcClassicLinkDnsSupport indicates an expected call of DescribeVpcClassicLinkDnsSupport +func (mr *MockEC2APIMockRecorder) DescribeVpcClassicLinkDnsSupport(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcClassicLinkDnsSupport", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcClassicLinkDnsSupport), arg0) +} + +// DescribeVpcClassicLinkDnsSupportPages mocks base method +func (m *MockEC2API) DescribeVpcClassicLinkDnsSupportPages(arg0 *ec2.DescribeVpcClassicLinkDnsSupportInput, arg1 func(*ec2.DescribeVpcClassicLinkDnsSupportOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeVpcClassicLinkDnsSupportPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVpcClassicLinkDnsSupportPages indicates an expected call of DescribeVpcClassicLinkDnsSupportPages +func (mr *MockEC2APIMockRecorder) DescribeVpcClassicLinkDnsSupportPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcClassicLinkDnsSupportPages", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcClassicLinkDnsSupportPages), arg0, arg1) } -// DescribeVpcClassicLinkDnsSupport mocks base method -func (m *MockEC2API) DescribeVpcClassicLinkDnsSupport(arg0 *ec2.DescribeVpcClassicLinkDnsSupportInput) (*ec2.DescribeVpcClassicLinkDnsSupportOutput, error) { +// DescribeVpcClassicLinkDnsSupportPagesWithContext mocks base method +func (m *MockEC2API) DescribeVpcClassicLinkDnsSupportPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeVpcClassicLinkDnsSupportInput, arg2 func(*ec2.DescribeVpcClassicLinkDnsSupportOutput, bool) bool, arg3 ...request.Option) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DescribeVpcClassicLinkDnsSupport", arg0) - ret0, _ := ret[0].(*ec2.DescribeVpcClassicLinkDnsSupportOutput) - ret1, _ := ret[1].(error) - return ret0, ret1 + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeVpcClassicLinkDnsSupportPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 } -// DescribeVpcClassicLinkDnsSupport indicates an expected call of DescribeVpcClassicLinkDnsSupport -func (mr *MockEC2APIMockRecorder) DescribeVpcClassicLinkDnsSupport(arg0 interface{}) *gomock.Call { +// DescribeVpcClassicLinkDnsSupportPagesWithContext indicates an expected call of DescribeVpcClassicLinkDnsSupportPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeVpcClassicLinkDnsSupportPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcClassicLinkDnsSupport", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcClassicLinkDnsSupport), arg0) + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcClassicLinkDnsSupportPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcClassicLinkDnsSupportPagesWithContext), varargs...) } // DescribeVpcClassicLinkDnsSupportRequest mocks base method @@ -10930,6 +12182,39 @@ func (mr *MockEC2APIMockRecorder) DescribeVpcEndpointConnectionNotifications(arg return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcEndpointConnectionNotifications", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcEndpointConnectionNotifications), arg0) } +// DescribeVpcEndpointConnectionNotificationsPages mocks base method +func (m *MockEC2API) DescribeVpcEndpointConnectionNotificationsPages(arg0 *ec2.DescribeVpcEndpointConnectionNotificationsInput, arg1 func(*ec2.DescribeVpcEndpointConnectionNotificationsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeVpcEndpointConnectionNotificationsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVpcEndpointConnectionNotificationsPages indicates an expected call of DescribeVpcEndpointConnectionNotificationsPages +func (mr *MockEC2APIMockRecorder) DescribeVpcEndpointConnectionNotificationsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcEndpointConnectionNotificationsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcEndpointConnectionNotificationsPages), arg0, arg1) +} + +// DescribeVpcEndpointConnectionNotificationsPagesWithContext mocks base method +func (m *MockEC2API) DescribeVpcEndpointConnectionNotificationsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeVpcEndpointConnectionNotificationsInput, arg2 func(*ec2.DescribeVpcEndpointConnectionNotificationsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeVpcEndpointConnectionNotificationsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVpcEndpointConnectionNotificationsPagesWithContext indicates an expected call of DescribeVpcEndpointConnectionNotificationsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeVpcEndpointConnectionNotificationsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcEndpointConnectionNotificationsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcEndpointConnectionNotificationsPagesWithContext), varargs...) +} + // DescribeVpcEndpointConnectionNotificationsRequest mocks base method func (m *MockEC2API) DescribeVpcEndpointConnectionNotificationsRequest(arg0 *ec2.DescribeVpcEndpointConnectionNotificationsInput) (*request.Request, *ec2.DescribeVpcEndpointConnectionNotificationsOutput) { m.ctrl.T.Helper() @@ -10980,6 +12265,39 @@ func (mr *MockEC2APIMockRecorder) DescribeVpcEndpointConnections(arg0 interface{ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcEndpointConnections", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcEndpointConnections), arg0) } +// DescribeVpcEndpointConnectionsPages mocks base method +func (m *MockEC2API) DescribeVpcEndpointConnectionsPages(arg0 *ec2.DescribeVpcEndpointConnectionsInput, arg1 func(*ec2.DescribeVpcEndpointConnectionsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeVpcEndpointConnectionsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVpcEndpointConnectionsPages indicates an expected call of DescribeVpcEndpointConnectionsPages +func (mr *MockEC2APIMockRecorder) DescribeVpcEndpointConnectionsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcEndpointConnectionsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcEndpointConnectionsPages), arg0, arg1) +} + +// DescribeVpcEndpointConnectionsPagesWithContext mocks base method +func (m *MockEC2API) DescribeVpcEndpointConnectionsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeVpcEndpointConnectionsInput, arg2 func(*ec2.DescribeVpcEndpointConnectionsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeVpcEndpointConnectionsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVpcEndpointConnectionsPagesWithContext indicates an expected call of DescribeVpcEndpointConnectionsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeVpcEndpointConnectionsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcEndpointConnectionsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcEndpointConnectionsPagesWithContext), varargs...) +} + // DescribeVpcEndpointConnectionsRequest mocks base method func (m *MockEC2API) DescribeVpcEndpointConnectionsRequest(arg0 *ec2.DescribeVpcEndpointConnectionsInput) (*request.Request, *ec2.DescribeVpcEndpointConnectionsOutput) { m.ctrl.T.Helper() @@ -11030,6 +12348,39 @@ func (mr *MockEC2APIMockRecorder) DescribeVpcEndpointServiceConfigurations(arg0 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcEndpointServiceConfigurations", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcEndpointServiceConfigurations), arg0) } +// DescribeVpcEndpointServiceConfigurationsPages mocks base method +func (m *MockEC2API) DescribeVpcEndpointServiceConfigurationsPages(arg0 *ec2.DescribeVpcEndpointServiceConfigurationsInput, arg1 func(*ec2.DescribeVpcEndpointServiceConfigurationsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeVpcEndpointServiceConfigurationsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVpcEndpointServiceConfigurationsPages indicates an expected call of DescribeVpcEndpointServiceConfigurationsPages +func (mr *MockEC2APIMockRecorder) DescribeVpcEndpointServiceConfigurationsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcEndpointServiceConfigurationsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcEndpointServiceConfigurationsPages), arg0, arg1) +} + +// DescribeVpcEndpointServiceConfigurationsPagesWithContext mocks base method +func (m *MockEC2API) DescribeVpcEndpointServiceConfigurationsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeVpcEndpointServiceConfigurationsInput, arg2 func(*ec2.DescribeVpcEndpointServiceConfigurationsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeVpcEndpointServiceConfigurationsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVpcEndpointServiceConfigurationsPagesWithContext indicates an expected call of DescribeVpcEndpointServiceConfigurationsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeVpcEndpointServiceConfigurationsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcEndpointServiceConfigurationsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcEndpointServiceConfigurationsPagesWithContext), varargs...) +} + // DescribeVpcEndpointServiceConfigurationsRequest mocks base method func (m *MockEC2API) DescribeVpcEndpointServiceConfigurationsRequest(arg0 *ec2.DescribeVpcEndpointServiceConfigurationsInput) (*request.Request, *ec2.DescribeVpcEndpointServiceConfigurationsOutput) { m.ctrl.T.Helper() @@ -11080,6 +12431,39 @@ func (mr *MockEC2APIMockRecorder) DescribeVpcEndpointServicePermissions(arg0 int return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcEndpointServicePermissions", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcEndpointServicePermissions), arg0) } +// DescribeVpcEndpointServicePermissionsPages mocks base method +func (m *MockEC2API) DescribeVpcEndpointServicePermissionsPages(arg0 *ec2.DescribeVpcEndpointServicePermissionsInput, arg1 func(*ec2.DescribeVpcEndpointServicePermissionsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeVpcEndpointServicePermissionsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVpcEndpointServicePermissionsPages indicates an expected call of DescribeVpcEndpointServicePermissionsPages +func (mr *MockEC2APIMockRecorder) DescribeVpcEndpointServicePermissionsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcEndpointServicePermissionsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcEndpointServicePermissionsPages), arg0, arg1) +} + +// DescribeVpcEndpointServicePermissionsPagesWithContext mocks base method +func (m *MockEC2API) DescribeVpcEndpointServicePermissionsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeVpcEndpointServicePermissionsInput, arg2 func(*ec2.DescribeVpcEndpointServicePermissionsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeVpcEndpointServicePermissionsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVpcEndpointServicePermissionsPagesWithContext indicates an expected call of DescribeVpcEndpointServicePermissionsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeVpcEndpointServicePermissionsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcEndpointServicePermissionsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcEndpointServicePermissionsPagesWithContext), varargs...) +} + // DescribeVpcEndpointServicePermissionsRequest mocks base method func (m *MockEC2API) DescribeVpcEndpointServicePermissionsRequest(arg0 *ec2.DescribeVpcEndpointServicePermissionsInput) (*request.Request, *ec2.DescribeVpcEndpointServicePermissionsOutput) { m.ctrl.T.Helper() @@ -11180,6 +12564,39 @@ func (mr *MockEC2APIMockRecorder) DescribeVpcEndpoints(arg0 interface{}) *gomock return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcEndpoints", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcEndpoints), arg0) } +// DescribeVpcEndpointsPages mocks base method +func (m *MockEC2API) DescribeVpcEndpointsPages(arg0 *ec2.DescribeVpcEndpointsInput, arg1 func(*ec2.DescribeVpcEndpointsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeVpcEndpointsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVpcEndpointsPages indicates an expected call of DescribeVpcEndpointsPages +func (mr *MockEC2APIMockRecorder) DescribeVpcEndpointsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcEndpointsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcEndpointsPages), arg0, arg1) +} + +// DescribeVpcEndpointsPagesWithContext mocks base method +func (m *MockEC2API) DescribeVpcEndpointsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeVpcEndpointsInput, arg2 func(*ec2.DescribeVpcEndpointsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeVpcEndpointsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVpcEndpointsPagesWithContext indicates an expected call of DescribeVpcEndpointsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeVpcEndpointsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcEndpointsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcEndpointsPagesWithContext), varargs...) +} + // DescribeVpcEndpointsRequest mocks base method func (m *MockEC2API) DescribeVpcEndpointsRequest(arg0 *ec2.DescribeVpcEndpointsInput) (*request.Request, *ec2.DescribeVpcEndpointsOutput) { m.ctrl.T.Helper() @@ -11230,6 +12647,39 @@ func (mr *MockEC2APIMockRecorder) DescribeVpcPeeringConnections(arg0 interface{} return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcPeeringConnections", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcPeeringConnections), arg0) } +// DescribeVpcPeeringConnectionsPages mocks base method +func (m *MockEC2API) DescribeVpcPeeringConnectionsPages(arg0 *ec2.DescribeVpcPeeringConnectionsInput, arg1 func(*ec2.DescribeVpcPeeringConnectionsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeVpcPeeringConnectionsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVpcPeeringConnectionsPages indicates an expected call of DescribeVpcPeeringConnectionsPages +func (mr *MockEC2APIMockRecorder) DescribeVpcPeeringConnectionsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcPeeringConnectionsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcPeeringConnectionsPages), arg0, arg1) +} + +// DescribeVpcPeeringConnectionsPagesWithContext mocks base method +func (m *MockEC2API) DescribeVpcPeeringConnectionsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeVpcPeeringConnectionsInput, arg2 func(*ec2.DescribeVpcPeeringConnectionsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeVpcPeeringConnectionsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVpcPeeringConnectionsPagesWithContext indicates an expected call of DescribeVpcPeeringConnectionsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeVpcPeeringConnectionsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcPeeringConnectionsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcPeeringConnectionsPagesWithContext), varargs...) +} + // DescribeVpcPeeringConnectionsRequest mocks base method func (m *MockEC2API) DescribeVpcPeeringConnectionsRequest(arg0 *ec2.DescribeVpcPeeringConnectionsInput) (*request.Request, *ec2.DescribeVpcPeeringConnectionsOutput) { m.ctrl.T.Helper() @@ -11280,6 +12730,39 @@ func (mr *MockEC2APIMockRecorder) DescribeVpcs(arg0 interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcs", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcs), arg0) } +// DescribeVpcsPages mocks base method +func (m *MockEC2API) DescribeVpcsPages(arg0 *ec2.DescribeVpcsInput, arg1 func(*ec2.DescribeVpcsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeVpcsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVpcsPages indicates an expected call of DescribeVpcsPages +func (mr *MockEC2APIMockRecorder) DescribeVpcsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcsPages), arg0, arg1) +} + +// DescribeVpcsPagesWithContext mocks base method +func (m *MockEC2API) DescribeVpcsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeVpcsInput, arg2 func(*ec2.DescribeVpcsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeVpcsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeVpcsPagesWithContext indicates an expected call of DescribeVpcsPagesWithContext +func (mr *MockEC2APIMockRecorder) DescribeVpcsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVpcsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeVpcsPagesWithContext), varargs...) +} + // DescribeVpcsRequest mocks base method func (m *MockEC2API) DescribeVpcsRequest(arg0 *ec2.DescribeVpcsInput) (*request.Request, *ec2.DescribeVpcsOutput) { m.ctrl.T.Helper() @@ -12930,6 +14413,39 @@ func (mr *MockEC2APIMockRecorder) GetTransitGatewayAttachmentPropagations(arg0 i return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTransitGatewayAttachmentPropagations", reflect.TypeOf((*MockEC2API)(nil).GetTransitGatewayAttachmentPropagations), arg0) } +// GetTransitGatewayAttachmentPropagationsPages mocks base method +func (m *MockEC2API) GetTransitGatewayAttachmentPropagationsPages(arg0 *ec2.GetTransitGatewayAttachmentPropagationsInput, arg1 func(*ec2.GetTransitGatewayAttachmentPropagationsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTransitGatewayAttachmentPropagationsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// GetTransitGatewayAttachmentPropagationsPages indicates an expected call of GetTransitGatewayAttachmentPropagationsPages +func (mr *MockEC2APIMockRecorder) GetTransitGatewayAttachmentPropagationsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTransitGatewayAttachmentPropagationsPages", reflect.TypeOf((*MockEC2API)(nil).GetTransitGatewayAttachmentPropagationsPages), arg0, arg1) +} + +// GetTransitGatewayAttachmentPropagationsPagesWithContext mocks base method +func (m *MockEC2API) GetTransitGatewayAttachmentPropagationsPagesWithContext(arg0 context.Context, arg1 *ec2.GetTransitGatewayAttachmentPropagationsInput, arg2 func(*ec2.GetTransitGatewayAttachmentPropagationsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetTransitGatewayAttachmentPropagationsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// GetTransitGatewayAttachmentPropagationsPagesWithContext indicates an expected call of GetTransitGatewayAttachmentPropagationsPagesWithContext +func (mr *MockEC2APIMockRecorder) GetTransitGatewayAttachmentPropagationsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTransitGatewayAttachmentPropagationsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).GetTransitGatewayAttachmentPropagationsPagesWithContext), varargs...) +} + // GetTransitGatewayAttachmentPropagationsRequest mocks base method func (m *MockEC2API) GetTransitGatewayAttachmentPropagationsRequest(arg0 *ec2.GetTransitGatewayAttachmentPropagationsInput) (*request.Request, *ec2.GetTransitGatewayAttachmentPropagationsOutput) { m.ctrl.T.Helper() @@ -12980,6 +14496,39 @@ func (mr *MockEC2APIMockRecorder) GetTransitGatewayRouteTableAssociations(arg0 i return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTransitGatewayRouteTableAssociations", reflect.TypeOf((*MockEC2API)(nil).GetTransitGatewayRouteTableAssociations), arg0) } +// GetTransitGatewayRouteTableAssociationsPages mocks base method +func (m *MockEC2API) GetTransitGatewayRouteTableAssociationsPages(arg0 *ec2.GetTransitGatewayRouteTableAssociationsInput, arg1 func(*ec2.GetTransitGatewayRouteTableAssociationsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTransitGatewayRouteTableAssociationsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// GetTransitGatewayRouteTableAssociationsPages indicates an expected call of GetTransitGatewayRouteTableAssociationsPages +func (mr *MockEC2APIMockRecorder) GetTransitGatewayRouteTableAssociationsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTransitGatewayRouteTableAssociationsPages", reflect.TypeOf((*MockEC2API)(nil).GetTransitGatewayRouteTableAssociationsPages), arg0, arg1) +} + +// GetTransitGatewayRouteTableAssociationsPagesWithContext mocks base method +func (m *MockEC2API) GetTransitGatewayRouteTableAssociationsPagesWithContext(arg0 context.Context, arg1 *ec2.GetTransitGatewayRouteTableAssociationsInput, arg2 func(*ec2.GetTransitGatewayRouteTableAssociationsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetTransitGatewayRouteTableAssociationsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// GetTransitGatewayRouteTableAssociationsPagesWithContext indicates an expected call of GetTransitGatewayRouteTableAssociationsPagesWithContext +func (mr *MockEC2APIMockRecorder) GetTransitGatewayRouteTableAssociationsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTransitGatewayRouteTableAssociationsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).GetTransitGatewayRouteTableAssociationsPagesWithContext), varargs...) +} + // GetTransitGatewayRouteTableAssociationsRequest mocks base method func (m *MockEC2API) GetTransitGatewayRouteTableAssociationsRequest(arg0 *ec2.GetTransitGatewayRouteTableAssociationsInput) (*request.Request, *ec2.GetTransitGatewayRouteTableAssociationsOutput) { m.ctrl.T.Helper() @@ -13030,6 +14579,39 @@ func (mr *MockEC2APIMockRecorder) GetTransitGatewayRouteTablePropagations(arg0 i return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTransitGatewayRouteTablePropagations", reflect.TypeOf((*MockEC2API)(nil).GetTransitGatewayRouteTablePropagations), arg0) } +// GetTransitGatewayRouteTablePropagationsPages mocks base method +func (m *MockEC2API) GetTransitGatewayRouteTablePropagationsPages(arg0 *ec2.GetTransitGatewayRouteTablePropagationsInput, arg1 func(*ec2.GetTransitGatewayRouteTablePropagationsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTransitGatewayRouteTablePropagationsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// GetTransitGatewayRouteTablePropagationsPages indicates an expected call of GetTransitGatewayRouteTablePropagationsPages +func (mr *MockEC2APIMockRecorder) GetTransitGatewayRouteTablePropagationsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTransitGatewayRouteTablePropagationsPages", reflect.TypeOf((*MockEC2API)(nil).GetTransitGatewayRouteTablePropagationsPages), arg0, arg1) +} + +// GetTransitGatewayRouteTablePropagationsPagesWithContext mocks base method +func (m *MockEC2API) GetTransitGatewayRouteTablePropagationsPagesWithContext(arg0 context.Context, arg1 *ec2.GetTransitGatewayRouteTablePropagationsInput, arg2 func(*ec2.GetTransitGatewayRouteTablePropagationsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetTransitGatewayRouteTablePropagationsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// GetTransitGatewayRouteTablePropagationsPagesWithContext indicates an expected call of GetTransitGatewayRouteTablePropagationsPagesWithContext +func (mr *MockEC2APIMockRecorder) GetTransitGatewayRouteTablePropagationsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTransitGatewayRouteTablePropagationsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).GetTransitGatewayRouteTablePropagationsPagesWithContext), varargs...) +} + // GetTransitGatewayRouteTablePropagationsRequest mocks base method func (m *MockEC2API) GetTransitGatewayRouteTablePropagationsRequest(arg0 *ec2.GetTransitGatewayRouteTablePropagationsInput) (*request.Request, *ec2.GetTransitGatewayRouteTablePropagationsOutput) { m.ctrl.T.Helper() @@ -13915,6 +15497,56 @@ func (mr *MockEC2APIMockRecorder) ModifyInstanceCreditSpecificationWithContext(a return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ModifyInstanceCreditSpecificationWithContext", reflect.TypeOf((*MockEC2API)(nil).ModifyInstanceCreditSpecificationWithContext), varargs...) } +// ModifyInstanceEventStartTime mocks base method +func (m *MockEC2API) ModifyInstanceEventStartTime(arg0 *ec2.ModifyInstanceEventStartTimeInput) (*ec2.ModifyInstanceEventStartTimeOutput, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ModifyInstanceEventStartTime", arg0) + ret0, _ := ret[0].(*ec2.ModifyInstanceEventStartTimeOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ModifyInstanceEventStartTime indicates an expected call of ModifyInstanceEventStartTime +func (mr *MockEC2APIMockRecorder) ModifyInstanceEventStartTime(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ModifyInstanceEventStartTime", reflect.TypeOf((*MockEC2API)(nil).ModifyInstanceEventStartTime), arg0) +} + +// ModifyInstanceEventStartTimeRequest mocks base method +func (m *MockEC2API) ModifyInstanceEventStartTimeRequest(arg0 *ec2.ModifyInstanceEventStartTimeInput) (*request.Request, *ec2.ModifyInstanceEventStartTimeOutput) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ModifyInstanceEventStartTimeRequest", arg0) + ret0, _ := ret[0].(*request.Request) + ret1, _ := ret[1].(*ec2.ModifyInstanceEventStartTimeOutput) + return ret0, ret1 +} + +// ModifyInstanceEventStartTimeRequest indicates an expected call of ModifyInstanceEventStartTimeRequest +func (mr *MockEC2APIMockRecorder) ModifyInstanceEventStartTimeRequest(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ModifyInstanceEventStartTimeRequest", reflect.TypeOf((*MockEC2API)(nil).ModifyInstanceEventStartTimeRequest), arg0) +} + +// ModifyInstanceEventStartTimeWithContext mocks base method +func (m *MockEC2API) ModifyInstanceEventStartTimeWithContext(arg0 context.Context, arg1 *ec2.ModifyInstanceEventStartTimeInput, arg2 ...request.Option) (*ec2.ModifyInstanceEventStartTimeOutput, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ModifyInstanceEventStartTimeWithContext", varargs...) + ret0, _ := ret[0].(*ec2.ModifyInstanceEventStartTimeOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ModifyInstanceEventStartTimeWithContext indicates an expected call of ModifyInstanceEventStartTimeWithContext +func (mr *MockEC2APIMockRecorder) ModifyInstanceEventStartTimeWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ModifyInstanceEventStartTimeWithContext", reflect.TypeOf((*MockEC2API)(nil).ModifyInstanceEventStartTimeWithContext), varargs...) +} + // ModifyInstancePlacement mocks base method func (m *MockEC2API) ModifyInstancePlacement(arg0 *ec2.ModifyInstancePlacementInput) (*ec2.ModifyInstancePlacementOutput, error) { m.ctrl.T.Helper() diff --git a/pkg/cloud/aws/services/ec2/natgateways.go b/pkg/cloud/aws/services/ec2/natgateways.go index 701f92107a..a6c8da14b4 100644 --- a/pkg/cloud/aws/services/ec2/natgateways.go +++ b/pkg/cloud/aws/services/ec2/natgateways.go @@ -22,7 +22,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" - "k8s.io/klog" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1alpha1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/filter" @@ -33,17 +32,17 @@ import ( func (s *Service) reconcileNatGateways() error { if s.scope.VPC().IsProvided() { - klog.V(4).Info("Skipping NAT gateway reconcile in unmanaged mode") + s.scope.V(4).Info("Skipping NAT gateway reconcile in unmanaged mode") return nil } - klog.V(2).Infof("Reconciling NAT gateways") + s.scope.V(2).Info("Reconciling NAT gateways") if len(s.scope.Subnets().FilterPrivate()) == 0 { - klog.V(2).Infof("No private subnets available, skipping NAT gateways") + s.scope.V(2).Info("No private subnets available, skipping NAT gateways") return nil } else if len(s.scope.Subnets().FilterPublic()) == 0 { - klog.V(2).Infof("No public subnets available. Cannot create NAT gateways for private subnets, this might be a configuration error.") + s.scope.V(2).Info("No public subnets available. Cannot create NAT gateways for private subnets, this might be a configuration error.") return nil } @@ -84,15 +83,15 @@ func (s *Service) reconcileNatGateways() error { func (s *Service) deleteNatGateways() error { if s.scope.VPC().IsProvided() { - klog.V(4).Info("Skipping NAT gateway deletion in unmanaged mode") + s.scope.V(4).Info("Skipping NAT gateway deletion in unmanaged mode") return nil } if len(s.scope.Subnets().FilterPrivate()) == 0 { - klog.V(2).Infof("No private subnets available, skipping NAT gateways") + s.scope.V(2).Info("No private subnets available, skipping NAT gateways") return nil } else if len(s.scope.Subnets().FilterPublic()) == 0 { - klog.V(2).Infof("No public subnets available. Cannot create NAT gateways for private subnets, this might be a configuration error.") + s.scope.V(2).Info("No public subnets available. Cannot create NAT gateways for private subnets, this might be a configuration error.") return nil } @@ -178,14 +177,14 @@ func (s *Service) createNatGateway(subnetID string) (*ec2.NatGateway, error) { return nil, errors.Wrapf(err, "failed to tag nat gateway %q", *out.NatGateway.NatGatewayId) } - klog.Infof("Created NAT gateway %q for subnet ID %q, waiting for it to become available...", *out.NatGateway.NatGatewayId, subnetID) + s.scope.Info("Created NAT gateway for subnet, waiting for it to become available...", "nat-gateway-id", *out.NatGateway.NatGatewayId, "subnet-id", subnetID) wReq := &ec2.DescribeNatGatewaysInput{NatGatewayIds: []*string{out.NatGateway.NatGatewayId}} if err := s.scope.EC2.WaitUntilNatGatewayAvailable(wReq); err != nil { return nil, errors.Wrapf(err, "failed to wait for nat gateway %q in subnet %q", *out.NatGateway.NatGatewayId, subnetID) } - klog.Infof("NAT gateway %q for subnet ID %q is now available", *out.NatGateway.NatGatewayId, subnetID) + s.scope.Info("NAT gateway for subnet is now available", "nat-gateway-id", *out.NatGateway.NatGatewayId, "subnet-id", subnetID) record.Eventf(s.scope.Cluster, "CreatedNATGateway", "Created new NAT Gateway %q", *out.NatGateway.NatGatewayId) return out.NatGateway, nil } @@ -232,7 +231,7 @@ func (s *Service) deleteNatGateway(id string) error { return errors.Wrapf(err, "failed to wait for NAT gateway deletion %q", id) } - klog.Infof("Deleted NAT gateway %q", id) + s.scope.Info("Deleted NAT gateway", "nat-gateway-id", id) record.Eventf(s.scope.Cluster, "DeletedNATGateway", "Deleted NAT Gateway %q", id) return nil } diff --git a/pkg/cloud/aws/services/ec2/network.go b/pkg/cloud/aws/services/ec2/network.go index 7d55fc9d22..b91b9b00da 100644 --- a/pkg/cloud/aws/services/ec2/network.go +++ b/pkg/cloud/aws/services/ec2/network.go @@ -16,13 +16,9 @@ limitations under the License. package ec2 -import ( - "k8s.io/klog" -) - // ReconcileNetwork reconciles the network of the given cluster. func (s *Service) ReconcileNetwork() (err error) { - klog.V(2).Infof("Reconciling network for cluster %q", s.scope.Cluster.Name) + s.scope.V(2).Info("Reconciling network for cluster", "cluster-name", s.scope.Cluster.Name, "cluster-namespace", s.scope.Cluster.Namespace) // VPC. if err := s.reconcileVPC(); err != nil { @@ -54,13 +50,13 @@ func (s *Service) ReconcileNetwork() (err error) { return err } - klog.V(2).Info("Reconcile network completed successfully") + s.scope.V(2).Info("Reconcile network completed successfully") return nil } // DeleteNetwork deletes the network of the given cluster. func (s *Service) DeleteNetwork() (err error) { - klog.V(2).Info("Deleting network") + s.scope.V(2).Info("Deleting network") // Security groups. if err := s.deleteSecurityGroups(); err != nil { @@ -97,6 +93,6 @@ func (s *Service) DeleteNetwork() (err error) { return err } - klog.V(2).Info("Delete network completed successfully") + s.scope.V(2).Info("Delete network completed successfully") return nil } diff --git a/pkg/cloud/aws/services/ec2/routetables.go b/pkg/cloud/aws/services/ec2/routetables.go index b2153bff63..1e7795fbb6 100644 --- a/pkg/cloud/aws/services/ec2/routetables.go +++ b/pkg/cloud/aws/services/ec2/routetables.go @@ -22,7 +22,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" - "k8s.io/klog" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1alpha1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/filter" @@ -35,11 +34,11 @@ const ( func (s *Service) reconcileRouteTables() error { if s.scope.VPC().IsProvided() { - klog.V(4).Info("Skipping routing tables reconcile in unmanaged mode") + s.scope.V(4).Info("Skipping routing tables reconcile in unmanaged mode") return nil } - klog.V(2).Infof("Reconciling routing tables") + s.scope.V(2).Info("Reconciling routing tables") subnetRouteMap, err := s.describeVpcRouteTablesBySubnet() if err != nil { @@ -48,7 +47,7 @@ func (s *Service) reconcileRouteTables() error { for _, sn := range s.scope.Subnets() { if igw, ok := subnetRouteMap[sn.ID]; ok { - klog.V(2).Infof("Subnet %q is already associated with route table %q", sn.ID, *igw.RouteTableId) + s.scope.V(2).Info("Subnet is already associated with route table", "subnet-id", sn.ID, "route-table-id", *igw.RouteTableId) // TODO(vincepri): if the route table ids are both non-empty and they don't match, replace the association. // TODO(vincepri): check that everything is in order, e.g. routes match the subnet type. @@ -92,7 +91,7 @@ func (s *Service) reconcileRouteTables() error { return err } - klog.V(2).Infof("Subnet %q has been associated with route table %q", sn.ID, rt.ID) + s.scope.V(2).Info("Subnet has been associated with route table", "subnet-id", sn.ID, "route-table-id", rt.ID) sn.RouteTableID = aws.String(rt.ID) } @@ -123,7 +122,7 @@ func (s *Service) describeVpcRouteTablesBySubnet() (map[string]*ec2.RouteTable, func (s *Service) deleteRouteTables() error { if s.scope.VPC().IsProvided() { - klog.V(4).Info("Skipping routing tables deletion in unmanaged mode") + s.scope.V(4).Info("Skipping routing tables deletion in unmanaged mode") return nil } @@ -142,14 +141,14 @@ func (s *Service) deleteRouteTables() error { return errors.Wrapf(err, "failed to disassociate route table %q from subnet %q", *rt.RouteTableId, *as.SubnetId) } - klog.Infof("Deleted association between route table %q and subnet %q", *rt.RouteTableId, *as.SubnetId) + s.scope.Info("Deleted association between route table and subnet", "route-table-id", *rt.RouteTableId, "subnet-id", *as.SubnetId) } if _, err := s.scope.EC2.DeleteRouteTable(&ec2.DeleteRouteTableInput{RouteTableId: rt.RouteTableId}); err != nil { return errors.Wrapf(err, "failed to delete route table %q", *rt.RouteTableId) } - klog.Infof("Deleted route table %q", *rt.RouteTableId) + s.scope.Info("Deleted route table", "route-table-id", *rt.RouteTableId) } return nil } diff --git a/pkg/cloud/aws/services/ec2/securitygroups.go b/pkg/cloud/aws/services/ec2/securitygroups.go index cde6de0a5a..004a92a479 100644 --- a/pkg/cloud/aws/services/ec2/securitygroups.go +++ b/pkg/cloud/aws/services/ec2/securitygroups.go @@ -26,13 +26,26 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" - "k8s.io/klog" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1alpha1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/awserrors" ) +const ( + // IPProtocolTCP is how EC2 represents the TCP protocol in ingress rules + IPProtocolTCP = "tcp" + + // IPProtocolUDP is how EC2 represents the UDP protocol in ingress rules + IPProtocolUDP = "udp" + + // IPProtocolICMP is how EC2 represents the ICMP protocol in ingress rules + IPProtocolICMP = "icmp" + + // IPProtocolICMPv6 is how EC2 represents the ICMPv6 protocol in ingress rules + IPProtocolICMPv6 = "58" +) + func (s *Service) reconcileSecurityGroups() error { - klog.V(2).Infof("Reconciling security groups") + s.scope.V(2).Info("Reconciling security groups") if s.scope.Network().SecurityGroups == nil { s.scope.Network().SecurityGroups = make(map[v1alpha1.SecurityGroupRole]*v1alpha1.SecurityGroup) @@ -64,7 +77,7 @@ func (s *Service) reconcileSecurityGroups() error { ID: *sg.GroupId, Name: *sg.GroupName, } - klog.V(2).Infof("Security group for role %q: %v", role, s.scope.SecurityGroups()[role]) + s.scope.V(2).Info("Created security group for role", "role", role, "security-group", s.scope.SecurityGroups()[role]) continue } @@ -98,7 +111,7 @@ func (s *Service) reconcileSecurityGroups() error { return errors.Wrapf(err, "failed to revoke security group ingress rules for %q", sg.ID) } - klog.V(2).Infof("Revoked ingress rules %v from security group %q", toRevoke, sg) + s.scope.V(2).Info("Revoked ingress rules from security group", "revoked-ingress-rules", toRevoke, "security-group-id", sg.ID) } toAuthorize := want.Difference(current) @@ -107,7 +120,7 @@ func (s *Service) reconcileSecurityGroups() error { return err } - klog.V(2).Infof("Authorized ingress rules %v in security group %q", toAuthorize, sg) + s.scope.V(2).Info("Authorized ingress rules in security group", "authorized-ingress-rules", toAuthorize, "security-group-id", sg.ID) } } @@ -122,7 +135,7 @@ func (s *Service) deleteSecurityGroups() error { return err } - klog.V(2).Infof("Revoked ingress rules %v from security group %q", current, sg.ID) + s.scope.V(2).Info("Revoked ingress rules from security group", "revoked-ingress-rules", current, "security-group-id", sg.ID) } for _, sg := range s.scope.SecurityGroups() { @@ -134,7 +147,7 @@ func (s *Service) deleteSecurityGroups() error { return errors.Wrapf(err, "failed to delete security group %q", sg.ID) } - klog.V(2).Infof("Deleted security group security group %q", sg.ID) + s.scope.V(2).Info("Deleted security group security group", "security-group-id", sg.ID) } return nil @@ -275,6 +288,16 @@ func (s *Service) getSecurityGroupIngressRules(role v1alpha1.SecurityGroupRole) s.scope.SecurityGroups()[v1alpha1.SecurityGroupNode].ID, }, }, + { + Description: "IP-in-IP (calico)", + Protocol: v1alpha1.SecurityGroupProtocolIPinIP, + FromPort: -1, + ToPort: 65535, + SourceSecurityGroupIDs: []string{ + s.scope.SecurityGroups()[v1alpha1.SecurityGroupControlPlane].ID, + s.scope.SecurityGroups()[v1alpha1.SecurityGroupNode].ID, + }, + }, }, nil case v1alpha1.SecurityGroupNode: @@ -304,6 +327,16 @@ func (s *Service) getSecurityGroupIngressRules(role v1alpha1.SecurityGroupRole) s.scope.SecurityGroups()[v1alpha1.SecurityGroupNode].ID, }, }, + { + Description: "IP-in-IP (calico)", + Protocol: v1alpha1.SecurityGroupProtocolIPinIP, + FromPort: -1, + ToPort: 65535, + SourceSecurityGroupIDs: []string{ + s.scope.SecurityGroups()[v1alpha1.SecurityGroupNode].ID, + s.scope.SecurityGroups()[v1alpha1.SecurityGroupControlPlane].ID, + }, + }, }, nil } @@ -333,35 +366,72 @@ func (s *Service) getSecurityGroupTagParams(name string, role v1alpha1.SecurityG } } -func ingressRuleToSDKType(i *v1alpha1.IngressRule) *ec2.IpPermission { - res := &ec2.IpPermission{ - IpProtocol: aws.String(string(i.Protocol)), - FromPort: aws.Int64(i.FromPort), - ToPort: aws.Int64(i.ToPort), +func ingressRuleToSDKType(i *v1alpha1.IngressRule) (res *ec2.IpPermission) { + // AWS seems to ignore the From/To port when set on protocols where it doesn't apply, but + // we avoid serializing it out for clarity's sake. + // See: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IpPermission.html + switch i.Protocol { + case v1alpha1.SecurityGroupProtocolTCP, + v1alpha1.SecurityGroupProtocolUDP, + v1alpha1.SecurityGroupProtocolICMP, + v1alpha1.SecurityGroupProtocolICMPv6: + res = &ec2.IpPermission{ + IpProtocol: aws.String(string(i.Protocol)), + FromPort: aws.Int64(i.FromPort), + ToPort: aws.Int64(i.ToPort), + } + default: + res = &ec2.IpPermission{ + IpProtocol: aws.String(string(i.Protocol)), + } } for _, cidr := range i.CidrBlocks { - res.IpRanges = append(res.IpRanges, &ec2.IpRange{ - Description: aws.String(i.Description), - CidrIp: aws.String(cidr), - }) + ipRange := &ec2.IpRange{ + CidrIp: aws.String(cidr), + } + + if i.Description != "" { + ipRange.Description = aws.String(i.Description) + } + + res.IpRanges = append(res.IpRanges, ipRange) } for _, groupID := range i.SourceSecurityGroupIDs { - res.UserIdGroupPairs = append(res.UserIdGroupPairs, &ec2.UserIdGroupPair{ - Description: aws.String(i.Description), - GroupId: aws.String(groupID), - }) + userIDGroupPair := &ec2.UserIdGroupPair{ + GroupId: aws.String(groupID), + } + + if i.Description != "" { + userIDGroupPair.Description = aws.String(i.Description) + } + + res.UserIdGroupPairs = append(res.UserIdGroupPairs, userIDGroupPair) } return res } -func ingressRuleFromSDKType(v *ec2.IpPermission) *v1alpha1.IngressRule { - res := &v1alpha1.IngressRule{ - Protocol: v1alpha1.SecurityGroupProtocol(*v.IpProtocol), - FromPort: *v.FromPort, - ToPort: *v.ToPort, +func ingressRuleFromSDKType(v *ec2.IpPermission) (res *v1alpha1.IngressRule) { + // Ports are only well-defined for TCP and UDP protocols, but EC2 overloads the port range + // in the case of ICMP(v6) traffic to indicate which codes are allowed. For all other protocols, + // including the custom "-1" All Traffic protcol, FromPort and ToPort are omitted from the response. + // See: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IpPermission.html + switch *v.IpProtocol { + case IPProtocolTCP, + IPProtocolUDP, + IPProtocolICMP, + IPProtocolICMPv6: + res = &v1alpha1.IngressRule{ + Protocol: v1alpha1.SecurityGroupProtocol(*v.IpProtocol), + FromPort: *v.FromPort, + ToPort: *v.ToPort, + } + default: + res = &v1alpha1.IngressRule{ + Protocol: v1alpha1.SecurityGroupProtocol(*v.IpProtocol), + } } for _, ec2range := range v.IpRanges { diff --git a/pkg/cloud/aws/services/ec2/subnets.go b/pkg/cloud/aws/services/ec2/subnets.go index 97c3b21d3d..05400b64aa 100644 --- a/pkg/cloud/aws/services/ec2/subnets.go +++ b/pkg/cloud/aws/services/ec2/subnets.go @@ -24,7 +24,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" - "k8s.io/klog" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1alpha1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/filter" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/tags" @@ -37,7 +36,7 @@ const ( ) func (s *Service) reconcileSubnets() error { - klog.V(2).Infof("Reconciling subnets") + s.scope.V(2).Info("Reconciling subnets") subnets := s.scope.Subnets() defer func() { @@ -132,13 +131,13 @@ LoopExisting: } } - klog.V(2).Infof("Subnets available: %v", subnets) + s.scope.V(2).Info("Subnets available", "subnets", subnets) return nil } func (s *Service) deleteSubnets() error { if s.scope.VPC().IsProvided() { - klog.V(4).Info("Skipping subnets deletion in unmanaged mode") + s.scope.V(4).Info("Skipping subnets deletion in unmanaged mode") return nil } @@ -260,8 +259,11 @@ func (s *Service) createSubnet(sn *v1alpha1.SubnetSpec) (*v1alpha1.SubnetSpec, e } } - klog.V(2).Infof("Created new subnet %q in VPC %q with cidr %q and availability zone %q", - *out.Subnet.SubnetId, *out.Subnet.VpcId, *out.Subnet.CidrBlock, *out.Subnet.AvailabilityZone) + s.scope.V(2).Info("Created new subnet in VPC with cidr and availability zone ", + "subnet-id", *out.Subnet.SubnetId, + "vpc-id", *out.Subnet.VpcId, + "cidr-block", *out.Subnet.CidrBlock, + "availability-zone", *out.Subnet.AvailabilityZone) record.Eventf(s.scope.Cluster, "CreatedSubnet", "Created new managed Subnet %q", *out.Subnet.SubnetId) @@ -282,7 +284,7 @@ func (s *Service) deleteSubnet(id string) error { return errors.Wrapf(err, "failed to delete subnet %q", id) } - klog.V(2).Infof("Deleted subnet %q in vpc %q", id, s.scope.VPC().ID) + s.scope.V(2).Info("Deleted subnet in vpc", "subnet-id", id, "vpc-id", s.scope.VPC().ID) record.Eventf(s.scope.Cluster, "DeletedSubnet", "Deleted managed Subnet %q", id) return nil } diff --git a/pkg/cloud/aws/services/ec2/vpc.go b/pkg/cloud/aws/services/ec2/vpc.go index 1c4deaa3c1..da3054e4d9 100644 --- a/pkg/cloud/aws/services/ec2/vpc.go +++ b/pkg/cloud/aws/services/ec2/vpc.go @@ -24,7 +24,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" - "k8s.io/klog" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1alpha1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/filter" @@ -37,7 +36,7 @@ const ( ) func (s *Service) reconcileVPC() error { - klog.V(2).Infof("Reconciling VPC") + s.scope.V(2).Info("Reconciling VPC") vpc, err := s.describeVPC() if awserrors.IsNotFound(err) { @@ -53,7 +52,7 @@ func (s *Service) reconcileVPC() error { if vpc.IsProvided() { vpc.DeepCopyInto(s.scope.VPC()) - klog.V(2).Infof("Working on unmanaged VPC %q", vpc.ID) + s.scope.V(2).Info("Working on unmanaged VPC", "vpc-id", vpc.ID) return nil } @@ -68,7 +67,7 @@ func (s *Service) reconcileVPC() error { } vpc.DeepCopyInto(s.scope.VPC()) - klog.V(2).Infof("Working on managed VPC %q", vpc.ID) + s.scope.V(2).Info("Working on managed VPC", "vpc-id", vpc.ID) return nil } @@ -95,7 +94,7 @@ func (s *Service) createVPC() (*v1alpha1.VPCSpec, error) { return nil, errors.Wrapf(err, "failed to wait for vpc %q", *out.Vpc.VpcId) } - klog.V(2).Infof("Created new VPC %q with cidr %q", *out.Vpc.VpcId, *out.Vpc.CidrBlock) + s.scope.V(2).Info("Created new VPC with cidr", "vpc-id", *out.Vpc.VpcId, "cidr-block", *out.Vpc.CidrBlock) record.Eventf(s.scope.Cluster, "CreatedVPC", "Created new managed VPC %q", *out.Vpc.VpcId) tagParams := s.getVPCTagParams(*out.Vpc.VpcId) @@ -119,7 +118,7 @@ func (s *Service) deleteVPC() error { vpc := s.scope.VPC() if vpc.IsProvided() { - klog.V(4).Info("Skipping VPC deletion in unmanaged mode") + s.scope.V(4).Info("Skipping VPC deletion in unmanaged mode") return nil } @@ -131,13 +130,13 @@ func (s *Service) deleteVPC() error { if err != nil { // Ignore if it's already deleted if code, ok := awserrors.Code(err); code == "InvalidVpcID.NotFound" && ok { - klog.V(4).Info("Skipping VPC deletion, VPC not found") + s.scope.V(4).Info("Skipping VPC deletion, VPC not found") return nil } return errors.Wrapf(err, "failed to delete vpc %q", vpc.ID) } - klog.V(2).Infof("Deleted VPC %q", vpc.ID) + s.scope.V(2).Info("Deleted VPC", "vpc-id", vpc.ID) record.Eventf(s.scope.Cluster, "DeletedVPC", "Deleted managed VPC %q", vpc.ID) return nil } diff --git a/pkg/cloud/aws/services/elb/BUILD.bazel b/pkg/cloud/aws/services/elb/BUILD.bazel index dcf0a3888b..99c232bab4 100644 --- a/pkg/cloud/aws/services/elb/BUILD.bazel +++ b/pkg/cloud/aws/services/elb/BUILD.bazel @@ -20,7 +20,6 @@ go_library( "//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/elb:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", - "//vendor/k8s.io/klog:go_default_library", ], ) diff --git a/pkg/cloud/aws/services/elb/loadbalancer.go b/pkg/cloud/aws/services/elb/loadbalancer.go index ac051b6b19..62f5cbd0f8 100644 --- a/pkg/cloud/aws/services/elb/loadbalancer.go +++ b/pkg/cloud/aws/services/elb/loadbalancer.go @@ -30,13 +30,12 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/elb" "github.com/pkg/errors" - "k8s.io/klog" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1alpha1" ) // ReconcileLoadbalancers reconciles the load balancers for the given cluster. func (s *Service) ReconcileLoadbalancers() error { - klog.V(2).Info("Reconciling load balancers") + s.scope.V(2).Info("Reconciling load balancers") // Get default api server spec. spec := s.getAPIServerClassicELBSpec() @@ -49,7 +48,7 @@ func (s *Service) ReconcileLoadbalancers() error { return err } - klog.V(2).Infof("Created new classic load balancer for apiserver: %v", apiELB) + s.scope.V(2).Info("Created new classic load balancer for apiserver", "api-server-elb-name", apiELB.Name) } else if err != nil { return err } @@ -63,9 +62,9 @@ func (s *Service) ReconcileLoadbalancers() error { // TODO(vincepri): check if anything has changed and reconcile as necessary. apiELB.DeepCopyInto(&s.scope.Network().APIServerELB) - klog.V(2).Infof("Control plane load balancer: %+v", apiELB) + s.scope.V(4).Info("Control plane load balancer", "api-server-elb", apiELB) - klog.V(2).Info("Reconcile load balancers completed successfully") + s.scope.V(2).Info("Reconcile load balancers completed successfully") return nil } @@ -82,7 +81,7 @@ func (s *Service) GetAPIServerDNSName() (string, error) { // DeleteLoadbalancers deletes the load balancers for the given cluster. func (s *Service) DeleteLoadbalancers() error { - klog.V(2).Info("Deleting load balancers") + s.scope.V(2).Info("Deleting load balancers") // Get default api server spec. spec := s.getAPIServerClassicELBSpec() @@ -100,7 +99,7 @@ func (s *Service) DeleteLoadbalancers() error { return err } - klog.V(2).Info("Deleting load balancers completed successfully") + s.scope.V(2).Info("Deleting load balancers completed successfully") return nil } @@ -218,7 +217,7 @@ func (s *Service) createClassicELB(spec *v1alpha1.ClassicELB) (*v1alpha1.Classic } } - klog.V(2).Infof("Created classic load balancer with dns name: %q", *out.DNSName) + s.scope.V(2).Info("Created classic load balancer", "dns-name", *out.DNSName) res := spec.DeepCopy() res.DNSName = *out.DNSName @@ -312,7 +311,7 @@ func (s *Service) describeClassicELB(name string) (*v1alpha1.ClassicELB, error) } } - if out == nil && len(out.LoadBalancerDescriptions) == 0 { + if out != nil && len(out.LoadBalancerDescriptions) == 0 { return nil, NewNotFound(fmt.Errorf("no classic load balancer found with name %q", name)) } diff --git a/pkg/cloud/aws/services/elb/mock_elbiface/BUILD b/pkg/cloud/aws/services/elb/mock_elbiface/BUILD deleted file mode 100644 index 8224e12dce..0000000000 --- a/pkg/cloud/aws/services/elb/mock_elbiface/BUILD +++ /dev/null @@ -1,20 +0,0 @@ -load("//build:go_mock.bzl", "go_mock") - -go_mock( - name = "go_default_library", - importpath = "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/elb/mock_elbiface", - visibility = ["//visibility:public"], - mocks = [ - { - "prefix": "github.com/aws/aws-sdk-go", - "package": "service/elb/elbiface", - "interface": "ELBAPI", - "vendored": True, - }, - ], - deps = [ - "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", - "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", - "//vendor/github.com/aws/aws-sdk-go/service/elb:go_default_library", - ], -) diff --git a/pkg/cloud/aws/services/elb/mock_elbiface/BUILD.bazel b/pkg/cloud/aws/services/elb/mock_elbiface/BUILD.bazel new file mode 100644 index 0000000000..ee75b94dd9 --- /dev/null +++ b/pkg/cloud/aws/services/elb/mock_elbiface/BUILD.bazel @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@bazel_gomock//:gomock.bzl", "gomock") + +gomock( + name = "mocks", + out = "elbapi_mock.go", + interfaces = ["ELBAPI"], + library = "//vendor/github.com/aws/aws-sdk-go/service/elb/elbiface:go_default_library", + package = "mock_elbiface", + visibility = ["//visibility:public"], +) + +go_library( + name = "go_default_library", + srcs = ["elbapi_mock.go"], + importpath = "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/elb/mock_elbiface", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/elb:go_default_library", + "//vendor/github.com/golang/mock/gomock:go_default_library", + ], +) diff --git a/pkg/cloud/aws/services/elb/mock_elbiface/elbapi.go b/pkg/cloud/aws/services/elb/mock_elbiface/elbapi_mock.go similarity index 99% rename from pkg/cloud/aws/services/elb/mock_elbiface/elbapi.go rename to pkg/cloud/aws/services/elb/mock_elbiface/elbapi_mock.go index ec6289e7f0..ae76c0a284 100755 --- a/pkg/cloud/aws/services/elb/mock_elbiface/elbapi.go +++ b/pkg/cloud/aws/services/elb/mock_elbiface/elbapi_mock.go @@ -14,8 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ - - // Code generated by MockGen. DO NOT EDIT. // Source: github.com/aws/aws-sdk-go/service/elb/elbiface (interfaces: ELBAPI) diff --git a/pkg/cloud/aws/services/iam/BUILD b/pkg/cloud/aws/services/iam/BUILD.bazel similarity index 100% rename from pkg/cloud/aws/services/iam/BUILD rename to pkg/cloud/aws/services/iam/BUILD.bazel diff --git a/pkg/cloud/aws/services/kubeadm/BUILD.bazel b/pkg/cloud/aws/services/kubeadm/BUILD.bazel index 7862d93d85..77fdb0154b 100644 --- a/pkg/cloud/aws/services/kubeadm/BUILD.bazel +++ b/pkg/cloud/aws/services/kubeadm/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", @@ -13,10 +13,24 @@ go_library( "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", - "//vendor/k8s.io/klog:go_default_library", "//vendor/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta1:go_default_library", "//vendor/k8s.io/kubernetes/cmd/kubeadm/app/util:go_default_library", + "//vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1:go_default_library", "//vendor/sigs.k8s.io/cluster-api/pkg/util:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/runtime/scheme:go_default_library", ], ) + +go_test( + name = "go_default_test", + srcs = ["aws_defaults_test.go"], + embed = [":go_default_library"], + deps = [ + "//pkg/apis/awsprovider/v1alpha1:go_default_library", + "//pkg/cloud/aws/actuators:go_default_library", + "//pkg/cloudtest:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta1:go_default_library", + "//vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1:go_default_library", + ], +) diff --git a/pkg/cloud/aws/services/kubeadm/aws_defaults.go b/pkg/cloud/aws/services/kubeadm/aws_defaults.go index 9721c87401..95095b8387 100644 --- a/pkg/cloud/aws/services/kubeadm/aws_defaults.go +++ b/pkg/cloud/aws/services/kubeadm/aws_defaults.go @@ -19,9 +19,9 @@ package kubeadm import ( "fmt" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "sigs.k8s.io/cluster-api/pkg/util" - "k8s.io/klog" kubeadmv1beta1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/actuators" ) @@ -31,155 +31,185 @@ const ( // See https://cloudinit.readthedocs.io/en/latest/topics/instancedata.html localIPV4Lookup = "{{ ds.meta_data.local_ipv4 }}" - // hostname lookup uses the instance metadata service to lookup its own hostname. - hostnameLookup = "{{ ds.meta_data.hostname }}" + // HostnameLookup uses the instance metadata service to lookup its own hostname. + HostnameLookup = "{{ ds.meta_data.hostname }}" - // containerdSocket is the expected path to containerd socket. - containerdSocket = "/var/run/containerd/containerd.sock" + // ContainerdSocket is the expected path to containerd socket. + ContainerdSocket = "/var/run/containerd/containerd.sock" - // apiServerBindPort is the default port for the kube-apiserver to bind to. - apiServerBindPort = 6443 + // APIServerBindPort is the default port for the kube-apiserver to bind to. + APIServerBindPort = 6443 - cloudProvider = "aws" + // CloudProvider is the name of the cloud provider passed to various + // kubernetes components. + CloudProvider = "aws" nodeRole = "node-role.kubernetes.io/node=" ) +// joinMachine is a local interface to scope down dependencies +type joinMachine interface { + GetScope() *actuators.Scope + GetMachine() *v1alpha1.Machine +} + // SetDefaultClusterConfiguration sets default dynamic values without overriding // user specified values. -func SetDefaultClusterConfiguration(machine *actuators.MachineScope, base *kubeadmv1beta1.ClusterConfiguration) { +func SetDefaultClusterConfiguration(machine joinMachine, base *kubeadmv1beta1.ClusterConfiguration) *kubeadmv1beta1.ClusterConfiguration { if base == nil { base = &kubeadmv1beta1.ClusterConfiguration{} } - s := machine.Scope + out := base.DeepCopy() + + s := machine.GetScope() // Only set the control plane endpoint if the user hasn't specified one. - if base.ControlPlaneEndpoint == "" { - base.ControlPlaneEndpoint = fmt.Sprintf("%s:%d", s.Network().APIServerELB.DNSName, apiServerBindPort) + if out.ControlPlaneEndpoint == "" { + out.ControlPlaneEndpoint = fmt.Sprintf("%s:%d", s.Network().APIServerELB.DNSName, APIServerBindPort) } // Add the control plane endpoint to the list of cert SAN - base.APIServer.CertSANs = append(base.APIServer.CertSANs, localIPV4Lookup, s.Network().APIServerELB.DNSName) + out.APIServer.CertSANs = append(out.APIServer.CertSANs, localIPV4Lookup, s.Network().APIServerELB.DNSName) + return out } // SetClusterConfigurationOverrides will modify the supplied configuration with certain values // that cluster-api-provider-aws requires overriding user specified input. -func SetClusterConfigurationOverrides(machine *actuators.MachineScope, base *kubeadmv1beta1.ClusterConfiguration) { +func SetClusterConfigurationOverrides(machine joinMachine, base *kubeadmv1beta1.ClusterConfiguration) *kubeadmv1beta1.ClusterConfiguration { if base == nil { base = &kubeadmv1beta1.ClusterConfiguration{} } - s := machine.Scope + s := machine.GetScope() - SetDefaultClusterConfiguration(machine, base) + out := SetDefaultClusterConfiguration(machine, base.DeepCopy()) // cloud-provider for the APIServer must be set to 'aws'. - if base.APIServer.ControlPlaneComponent.ExtraArgs == nil { - base.APIServer.ControlPlaneComponent.ExtraArgs = map[string]string{} + if out.APIServer.ControlPlaneComponent.ExtraArgs == nil { + out.APIServer.ControlPlaneComponent.ExtraArgs = map[string]string{} } - if cp, ok := base.APIServer.ControlPlaneComponent.ExtraArgs["cloud-provider"]; ok && cp != cloudProvider { - klog.Infof("Overriding cloud provider %q with required value %q", cp, cloudProvider) + if cp, ok := out.APIServer.ControlPlaneComponent.ExtraArgs["cloud-provider"]; ok && cp != CloudProvider { + machine.GetScope().Logger.Info("Overriding cloud provider with required value", "provided-cloud-provider", cp, "required-cloud-provider", CloudProvider) } - base.APIServer.ControlPlaneComponent.ExtraArgs["cloud-provider"] = cloudProvider + out.APIServer.ControlPlaneComponent.ExtraArgs["cloud-provider"] = CloudProvider - if base.ControllerManager.ExtraArgs == nil { - base.ControllerManager.ExtraArgs = map[string]string{} + if out.ControllerManager.ExtraArgs == nil { + out.ControllerManager.ExtraArgs = map[string]string{} } - if cp, ok := base.ControllerManager.ExtraArgs["cloud-provider"]; ok && cp != cloudProvider { - klog.Infof("Overriding cloud provider %q with required value %q", cp, cloudProvider) + if cp, ok := out.ControllerManager.ExtraArgs["cloud-provider"]; ok && cp != CloudProvider { + machine.GetScope().Logger.Info("Overriding cloud provider with required value", "provided-cloud-provider", cp, "required-cloud-provider", CloudProvider) } - base.ControllerManager.ExtraArgs["cloud-provider"] = cloudProvider + out.ControllerManager.ExtraArgs["cloud-provider"] = CloudProvider // The kubeadm config clustername must match the provided name of the cluster. - if base.ClusterName != "" && base.ClusterName != s.Name() { - klog.Infof("Overriding provided cluster name %q with %q. The kubeadm cluster name and cluster-api name must match.", base.ClusterName, s.Name()) + if out.ClusterName != "" && out.ClusterName != s.Name() { + machine.GetScope().Logger.Info("Overriding provided cluster name. The kubeadm cluster name and cluster-api name must match.", + "provided-cluster-name", out.ClusterName, + "required-cluster-name", s.Name()) } - base.ClusterName = s.Name() + out.ClusterName = s.Name() // The networking values provided by the Cluster object must equal the // kubeadm networking configuration. - base.Networking.DNSDomain = s.Cluster.Spec.ClusterNetwork.ServiceDomain - base.Networking.PodSubnet = s.Cluster.Spec.ClusterNetwork.Pods.CIDRBlocks[0] - base.Networking.ServiceSubnet = s.Cluster.Spec.ClusterNetwork.Services.CIDRBlocks[0] + out.Networking.DNSDomain = s.Cluster.Spec.ClusterNetwork.ServiceDomain + out.Networking.PodSubnet = s.Cluster.Spec.ClusterNetwork.Pods.CIDRBlocks[0] + out.Networking.ServiceSubnet = s.Cluster.Spec.ClusterNetwork.Services.CIDRBlocks[0] // The kubernetes version that kubeadm is using must be the same as the // requested version in the config - base.KubernetesVersion = machine.Machine.Spec.Versions.ControlPlane + out.KubernetesVersion = machine.GetMachine().Spec.Versions.ControlPlane + return out } // SetInitConfigurationOverrides overrides user input on particular fields for // the kubeadm InitConfiguration. -func SetInitConfigurationOverrides(base *kubeadmv1beta1.InitConfiguration) { +func SetInitConfigurationOverrides(machine joinMachine, base *kubeadmv1beta1.InitConfiguration) *kubeadmv1beta1.InitConfiguration { if base == nil { base = &kubeadmv1beta1.InitConfiguration{} } + out := base.DeepCopy() - if base.NodeRegistration.Name != "" && base.NodeRegistration.Name != hostnameLookup { - klog.Infof("Overriding NodeRegistration name from %q to %q. The node registration needs to be dynamically generated in aws.", base.NodeRegistration.Name, hostnameLookup) + if out.NodeRegistration.Name != "" && out.NodeRegistration.Name != HostnameLookup { + machine.GetScope().Info("Overriding NodeRegistration name. The node registration needs to be dynamically generated in aws.", + "provided-node-registration-name", out.NodeRegistration.Name, + "required-node-registration-name", HostnameLookup) } - base.NodeRegistration.Name = hostnameLookup + out.NodeRegistration.Name = HostnameLookup // TODO(chuckha): This may become a default instead of an override. - if base.NodeRegistration.CRISocket != "" && base.NodeRegistration.CRISocket != containerdSocket { - klog.Infof("Overriding CRISocket from %q to %q. Containerd is only supported container runtime.", base.NodeRegistration.CRISocket, containerdSocket) + if out.NodeRegistration.CRISocket != "" && out.NodeRegistration.CRISocket != ContainerdSocket { + machine.GetScope().Info("Overriding CRISocket. Containerd is only supported container runtime.", + "provided-container-runtime-socket", out.NodeRegistration.CRISocket, + "required-container-runtime-socket", ContainerdSocket) } - base.NodeRegistration.CRISocket = containerdSocket + out.NodeRegistration.CRISocket = ContainerdSocket - if base.NodeRegistration.KubeletExtraArgs == nil { - base.NodeRegistration.KubeletExtraArgs = map[string]string{} + if out.NodeRegistration.KubeletExtraArgs == nil { + out.NodeRegistration.KubeletExtraArgs = map[string]string{} } - if cp, ok := base.NodeRegistration.KubeletExtraArgs["cloud-provider"]; ok && cp != cloudProvider { - klog.Infof("Overriding node's cloud-provider to the required value of %q.", cloudProvider) + if cp, ok := out.NodeRegistration.KubeletExtraArgs["cloud-provider"]; ok && cp != CloudProvider { + machine.GetScope().Info("Overriding node's cloud-provider", "provided-cloud-provider", cp, "required-cloud-provider", CloudProvider) } - base.NodeRegistration.KubeletExtraArgs["cloud-provider"] = cloudProvider + out.NodeRegistration.KubeletExtraArgs["cloud-provider"] = CloudProvider + return out } // SetJoinNodeConfigurationOverrides overrides user input for certain fields of // the kubeadm JoinConfiguration during a worker node join. -func SetJoinNodeConfigurationOverrides(caCertHash, bootstrapToken string, machine *actuators.MachineScope, base *kubeadmv1beta1.JoinConfiguration) { +func SetJoinNodeConfigurationOverrides(caCertHash, bootstrapToken string, machine joinMachine, base *kubeadmv1beta1.JoinConfiguration) *kubeadmv1beta1.JoinConfiguration { if base == nil { base = &kubeadmv1beta1.JoinConfiguration{} } - s := machine.Scope + out := base.DeepCopy() - if base.Discovery.BootstrapToken == nil { - base.Discovery.BootstrapToken = &kubeadmv1beta1.BootstrapTokenDiscovery{} + if out.Discovery.BootstrapToken == nil { + out.Discovery.BootstrapToken = &kubeadmv1beta1.BootstrapTokenDiscovery{} } // TODO: should this actually be the cluster's ContolPlaneEndpoint? - base.Discovery.BootstrapToken.APIServerEndpoint = fmt.Sprintf("%s:%d", s.Network().APIServerELB.DNSName, apiServerBindPort) - base.Discovery.BootstrapToken.Token = bootstrapToken - base.Discovery.BootstrapToken.CACertHashes = append(base.Discovery.BootstrapToken.CACertHashes, caCertHash) + out.Discovery.BootstrapToken.APIServerEndpoint = fmt.Sprintf("%s:%d", machine.GetScope().Network().APIServerELB.DNSName, APIServerBindPort) + out.Discovery.BootstrapToken.Token = bootstrapToken + out.Discovery.BootstrapToken.CACertHashes = append(out.Discovery.BootstrapToken.CACertHashes, caCertHash) - if base.NodeRegistration.Name != "" && base.NodeRegistration.Name != hostnameLookup { - klog.Infof("Overriding NodeRegistration name from %q to %q. The node registration needs to be dynamically generated in aws.", base.NodeRegistration.Name, hostnameLookup) + if out.NodeRegistration.Name != "" && out.NodeRegistration.Name != HostnameLookup { + machine.GetScope().Logger.Info("Overriding NodeRegistration name . The node registration needs to be dynamically generated in aws.", + "provided-node-registration-name", out.NodeRegistration.Name, + "required-node-registration-name", HostnameLookup) } - base.NodeRegistration.Name = hostnameLookup + out.NodeRegistration.Name = HostnameLookup // TODO(chuckha): This may become a default instead of an override. - if base.NodeRegistration.CRISocket != "" && base.NodeRegistration.CRISocket != containerdSocket { - klog.Infof("Overriding CRISocket from %q to %q. Containerd is only supported container runtime.", base.NodeRegistration.CRISocket, containerdSocket) + if out.NodeRegistration.CRISocket != "" && out.NodeRegistration.CRISocket != ContainerdSocket { + machine.GetScope().Logger.Info("Overriding CRISocket. Containerd is only supported container runtime.", + "provided-container-runtime-socket", out.NodeRegistration.CRISocket, + "required-container-runtime-socket", ContainerdSocket) } - base.NodeRegistration.CRISocket = containerdSocket + out.NodeRegistration.CRISocket = ContainerdSocket - if base.NodeRegistration.KubeletExtraArgs == nil { - base.NodeRegistration.KubeletExtraArgs = map[string]string{} + if out.NodeRegistration.KubeletExtraArgs == nil { + out.NodeRegistration.KubeletExtraArgs = map[string]string{} } - if cp, ok := base.NodeRegistration.KubeletExtraArgs["cloud-provider"]; ok && cp != cloudProvider { - klog.Infof("Overriding node's cloud-provider to the required value of %q.", cloudProvider) + if cp, ok := out.NodeRegistration.KubeletExtraArgs["cloud-provider"]; ok && cp != CloudProvider { + machine.GetScope().Logger.Info("Overriding node's cloud-provider to the required value", + "provided-cloud-provider", cp, + "required-cloud-provider", CloudProvider) } - base.NodeRegistration.KubeletExtraArgs["cloud-provider"] = cloudProvider - if !util.IsControlPlaneMachine(machine.Machine) { - base.NodeRegistration.KubeletExtraArgs["node-labels"] = nodeRole + out.NodeRegistration.KubeletExtraArgs["cloud-provider"] = CloudProvider + if !util.IsControlPlaneMachine(machine.GetMachine()) { + out.NodeRegistration.KubeletExtraArgs["node-labels"] = nodeRole } + return out } // SetControlPlaneJoinConfigurationOverrides user input for kubeadm join // configuration during a control plane join action. -func SetControlPlaneJoinConfigurationOverrides(base *kubeadmv1beta1.JoinConfiguration) { +func SetControlPlaneJoinConfigurationOverrides(base *kubeadmv1beta1.JoinConfiguration) *kubeadmv1beta1.JoinConfiguration { if base == nil { base = &kubeadmv1beta1.JoinConfiguration{} } - if base.ControlPlane == nil { - base.ControlPlane = &kubeadmv1beta1.JoinControlPlane{} + out := base.DeepCopy() + + if out.ControlPlane == nil { + out.ControlPlane = &kubeadmv1beta1.JoinControlPlane{} } - base.ControlPlane.LocalAPIEndpoint.AdvertiseAddress = localIPV4Lookup - base.ControlPlane.LocalAPIEndpoint.BindPort = apiServerBindPort + out.ControlPlane.LocalAPIEndpoint.AdvertiseAddress = localIPV4Lookup + out.ControlPlane.LocalAPIEndpoint.BindPort = APIServerBindPort + return out } diff --git a/pkg/cloud/aws/services/kubeadm/aws_defaults_test.go b/pkg/cloud/aws/services/kubeadm/aws_defaults_test.go new file mode 100644 index 0000000000..18719da208 --- /dev/null +++ b/pkg/cloud/aws/services/kubeadm/aws_defaults_test.go @@ -0,0 +1,438 @@ +/* +Copyright 2019 The Kubernetes Authors. + +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 kubeadm_test + +import ( + "fmt" + "testing" + + "sigs.k8s.io/cluster-api-provider-aws/pkg/cloudtest" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + kubeadmv1beta1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta1" + "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1alpha1" + "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/actuators" + "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/kubeadm" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" +) + +type jm struct { + *actuators.Scope + *clusterv1.Machine +} + +func (j *jm) GetScope() *actuators.Scope { + return j.Scope +} +func (j *jm) GetMachine() *clusterv1.Machine { + return j.Machine +} + +func TestSetJoinNodeConfigurationBootstrapSettings(t *testing.T) { + testcases := []struct { + name string + caCertHash string + bootstrapToken string + joinMachine *jm + joinConfiguration *kubeadmv1beta1.JoinConfiguration + }{ + { + name: "test default values", + joinMachine: &jm{ + Scope: &actuators.Scope{ + ClusterStatus: &v1alpha1.AWSClusterProviderStatus{ + Network: v1alpha1.Network{ + APIServerELB: v1alpha1.ClassicELB{ + DNSName: "test.test", + }, + }, + }, + }, + Machine: &clusterv1.Machine{}, + }, + }, + } + + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + out := kubeadm.SetJoinNodeConfigurationOverrides(tc.caCertHash, tc.bootstrapToken, tc.joinMachine, tc.joinConfiguration) + + // The apiserver endpoint should always match the incoming machine's network + expected := fmt.Sprintf("%v:%v", tc.joinMachine.GetScope().Network().APIServerELB.DNSName, kubeadm.APIServerBindPort) + if out.Discovery.BootstrapToken.APIServerEndpoint != expected { + t.Fatalf("join configuration apiserver endpoint: %q but expected %q", out.Discovery.BootstrapToken.APIServerEndpoint, expected) + } + + // The bootstrap token on the new join node configuration should be + // the same that is passed in + if out.Discovery.BootstrapToken.Token != tc.bootstrapToken { + t.Fatalf("bootstrap tokens did not match: got %q but expected %q", out.Discovery.BootstrapToken.Token, tc.bootstrapToken) + } + + // The passed in caCertHash should be appended to the existing hashes + if !contains(out.Discovery.BootstrapToken.CACertHashes, tc.caCertHash) { + t.Fatalf("did not find %q in %v", tc.caCertHash, out.Discovery.BootstrapToken.CACertHashes) + } + }) + } +} + +func TestSetJoinNodeConfigurationOverrides(t *testing.T) { + testcases := []struct { + name string + caCertHash string + bootstrapToken string + joinMachine *jm + joinConfiguration *kubeadmv1beta1.JoinConfiguration + }{ + { + name: "test node registration override values", + joinMachine: &jm{ + Scope: &actuators.Scope{ + ClusterStatus: &v1alpha1.AWSClusterProviderStatus{ + Network: v1alpha1.Network{ + APIServerELB: v1alpha1.ClassicELB{ + DNSName: "test.test", + }, + }, + }, + Logger: &cloudtest.Log{}, + }, + Machine: &clusterv1.Machine{}, + }, + joinConfiguration: &kubeadmv1beta1.JoinConfiguration{ + NodeRegistration: kubeadmv1beta1.NodeRegistrationOptions{ + Name: "cat", + CRISocket: "unix:///var/run/docker/docker.sock", + KubeletExtraArgs: map[string]string{ + "cloud-provider": "gcp", + }, + }, + }, + }, + { + name: "should set the cloud-provider extra args even if args are nil", + joinMachine: &jm{ + Scope: &actuators.Scope{ + ClusterStatus: &v1alpha1.AWSClusterProviderStatus{}, + Logger: &cloudtest.Log{}, + }, + Machine: &clusterv1.Machine{}, + }, + joinConfiguration: &kubeadmv1beta1.JoinConfiguration{}, + }, + } + + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + out := kubeadm.SetJoinNodeConfigurationOverrides(tc.caCertHash, tc.bootstrapToken, tc.joinMachine, tc.joinConfiguration) + + if tc.joinConfiguration.NodeRegistration.Name != kubeadm.HostnameLookup && + tc.joinConfiguration.NodeRegistration.Name == out.NodeRegistration.Name { + t.Fatal("did not properly override the NodeRegistration.Name") + } + + if tc.joinConfiguration.NodeRegistration.CRISocket != kubeadm.ContainerdSocket && + tc.joinConfiguration.NodeRegistration.CRISocket == out.NodeRegistration.CRISocket { + t.Fatal("did not properly override the CRISocket") + } + + if out.NodeRegistration.KubeletExtraArgs["cloud-provider"] != kubeadm.CloudProvider { + t.Fatal("did not properly set the cloud-provider on the kubelet extra args") + } + }) + } +} + +func TestSetControlPlaneJoinConfigurationOverrides(t *testing.T) { + testcases := []struct { + name string + joinconfig *kubeadmv1beta1.JoinConfiguration + }{ + { + name: "simple override test", + joinconfig: &kubeadmv1beta1.JoinConfiguration{ + ControlPlane: &kubeadmv1beta1.JoinControlPlane{ + LocalAPIEndpoint: kubeadmv1beta1.APIEndpoint{ + AdvertiseAddress: "fake.endpoint", + BindPort: 420, + }, + }, + }, + }, + { + name: "nil join config", + }, + } + + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + out := kubeadm.SetControlPlaneJoinConfigurationOverrides(tc.joinconfig) + + // ignore assertions if nil was passed in + if tc.joinconfig == nil { + return + } + + // Assertion assumes the test case does not start with the override value + if tc.joinconfig.ControlPlane.LocalAPIEndpoint.AdvertiseAddress == out.ControlPlane.LocalAPIEndpoint.AdvertiseAddress { + t.Fatal("did not properly override the local api endpoint advertise address") + } + if tc.joinconfig.ControlPlane.LocalAPIEndpoint.BindPort == out.ControlPlane.LocalAPIEndpoint.BindPort { + t.Fatal("did not properly override the local api endpoint bind port") + } + }) + } +} + +func TestSetDefaultClusterConfiguration(t *testing.T) { + testcases := []struct { + name string + joinMachine *jm + clusterConfiguration *kubeadmv1beta1.ClusterConfiguration + }{ + { + name: "simple", + joinMachine: &jm{ + Scope: &actuators.Scope{ + ClusterStatus: &v1alpha1.AWSClusterProviderStatus{}, + }, + Machine: &clusterv1.Machine{}, + }, + clusterConfiguration: &kubeadmv1beta1.ClusterConfiguration{}, + }, + { + name: "handle nil", + joinMachine: &jm{ + Scope: &actuators.Scope{ + ClusterStatus: &v1alpha1.AWSClusterProviderStatus{}, + }, + Machine: &clusterv1.Machine{}, + }, + }, + } + + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + out := kubeadm.SetDefaultClusterConfiguration(tc.joinMachine, tc.clusterConfiguration) + + // Ignore the assertions of the base is nil + if tc.clusterConfiguration == nil { + return + } + + // Assertion: set a control plane only if the user hasn't specified one + if tc.clusterConfiguration.ControlPlaneEndpoint == "" { + if out.ControlPlaneEndpoint == "" { + t.Fatal("Failed to set a control plane endpoint when one was not provided") + } + } + + if tc.clusterConfiguration.ControlPlaneEndpoint != "" && out.ControlPlaneEndpoint != tc.clusterConfiguration.ControlPlaneEndpoint { + t.Fatal("Overrode ControlPlaneEndpoint. This user supplied value should not be overridden") + } + + // Assertion: always add local ipv4 lookup and the ELB's DNS name to the CertSANs + if len(out.APIServer.CertSANs)-len(tc.clusterConfiguration.APIServer.CertSANs) != 2 { + t.Fatal("expected one additional CertSAN in the output") + } + }) + } +} + +func TestSetInitConfigurationOverrides(t *testing.T) { + testcasts := []struct { + name string + joinMachine *jm + initConfiguration *kubeadmv1beta1.InitConfiguration + }{ + // Assumption: Do not use any default values as input values for testcases. + { + name: "assertions pass with an empty configuration", + joinMachine: &jm{ + Scope: &actuators.Scope{}, + }, + initConfiguration: &kubeadmv1beta1.InitConfiguration{}, + }, + { + name: "nil configuration should not break", + }, + { + name: "overrides actually work", + joinMachine: &jm{ + Scope: &actuators.Scope{ + Logger: &cloudtest.Log{}, + }, + }, + initConfiguration: &kubeadmv1beta1.InitConfiguration{ + NodeRegistration: kubeadmv1beta1.NodeRegistrationOptions{ + Name: "moonshine", + CRISocket: "/dev/null", + KubeletExtraArgs: map[string]string{ + "cloud-provider": "gcp", + }, + }, + }, + }, + } + + for _, tc := range testcasts { + t.Run(tc.name, func(t *testing.T) { + out := kubeadm.SetInitConfigurationOverrides(tc.joinMachine, tc.initConfiguration) + + // Ignore assertions if the initConfiguration is nil + if tc.initConfiguration == nil { + return + } + + // Assertion: Override the user provided value, if any, to the dynamic lookup value + if tc.initConfiguration.NodeRegistration.Name != "" && tc.initConfiguration.NodeRegistration.Name == out.NodeRegistration.Name { + t.Fatal("Provided node name was not properly overridden") + } + + // Assertion: Override the user provided CRI socket with containerd's CRI socket + if tc.initConfiguration.NodeRegistration.CRISocket != "" && tc.initConfiguration.NodeRegistration.CRISocket == out.NodeRegistration.CRISocket { + t.Fatal("Provided CRISocket was not properly overridden") + } + + // Assertion: Kubelet extra args are populated with the aws cloud provier + if out.NodeRegistration.KubeletExtraArgs["cloud-provider"] != kubeadm.CloudProvider { + t.Fatal("Cloud provider was not successfully set to aws") + } + + }) + } +} + +func TestSetClusterConfigurationOverrides(t *testing.T) { + testcases := []struct { + name string + joinMachine *jm + clusterConfiguration *kubeadmv1beta1.ClusterConfiguration + }{ + { + name: "simple test", + joinMachine: &jm{ + Scope: &actuators.Scope{ + ClusterStatus: &v1alpha1.AWSClusterProviderStatus{}, + Cluster: &clusterv1.Cluster{ + ObjectMeta: metav1.ObjectMeta{ + Name: "hello", + }, + Spec: clusterv1.ClusterSpec{ + ClusterNetwork: clusterv1.ClusterNetworkingConfig{ + ServiceDomain: "hogwarts", + Pods: clusterv1.NetworkRanges{ + CIDRBlocks: []string{"123/127"}, + }, + Services: clusterv1.NetworkRanges{ + CIDRBlocks: []string{"456/128"}, + }, + }, + }, + }, + Logger: &cloudtest.Log{}, + }, + Machine: &clusterv1.Machine{}, + }, + clusterConfiguration: &kubeadmv1beta1.ClusterConfiguration{ + ClusterName: "some test", + APIServer: kubeadmv1beta1.APIServer{ + ControlPlaneComponent: kubeadmv1beta1.ControlPlaneComponent{ + ExtraArgs: map[string]string{"cloud-provider": "not-aws"}, + }, + }, + ControllerManager: kubeadmv1beta1.ControlPlaneComponent{ + ExtraArgs: map[string]string{"cloud-provider": "azure"}, + }, + }, + }, + { + name: "nil cluster configuration test", + joinMachine: &jm{ + Scope: &actuators.Scope{ + ClusterStatus: &v1alpha1.AWSClusterProviderStatus{}, + Cluster: &clusterv1.Cluster{ + ObjectMeta: metav1.ObjectMeta{ + Name: "hello", + }, + Spec: clusterv1.ClusterSpec{ + ClusterNetwork: clusterv1.ClusterNetworkingConfig{ + ServiceDomain: "hogwarts", + Pods: clusterv1.NetworkRanges{ + CIDRBlocks: []string{"123/127"}, + }, + Services: clusterv1.NetworkRanges{ + CIDRBlocks: []string{"456/128"}, + }, + }, + }, + }, + }, + Machine: &clusterv1.Machine{}, + }, + }, + } + + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + + out := kubeadm.SetClusterConfigurationOverrides(tc.joinMachine, tc.clusterConfiguration) + // Assertion: Forces apiserver cloud-provider to aws + if out.APIServer.ControlPlaneComponent.ExtraArgs["cloud-provider"] != kubeadm.CloudProvider { + t.Fatal("cloud-provider argument was not set properly on the apiserver") + } + + // Assertion: Forces controller-manager cloud-provider to aws + if out.ControllerManager.ExtraArgs["cloud-provider"] != kubeadm.CloudProvider { + t.Fatal("cloud-provider argument was not set properly on the controller-manager") + } + + // Assertion: Sets the kubeadm cluster name to match the cluster-api cluster name + if out.ClusterName != tc.joinMachine.GetScope().Name() { + t.Fatal("The cluster name was not set properly") + } + + // Assertion: Sets necessary networking attributes from the ClusterSpec + if out.Networking.DNSDomain != tc.joinMachine.GetScope().Cluster.Spec.ClusterNetwork.ServiceDomain { + t.Fatal("Failed to set the DNSDomain properly") + } + if out.Networking.PodSubnet != tc.joinMachine.GetScope().Cluster.Spec.ClusterNetwork.Pods.CIDRBlocks[0] { + t.Fatal("Failed to set the pod subnet") + } + if out.Networking.ServiceSubnet != tc.joinMachine.GetScope().Cluster.Spec.ClusterNetwork.Services.CIDRBlocks[0] { + t.Fatal("Failed to set the service subnet") + } + + // Assertion: Sets the Kubernetes version from the ClusterSpec + if out.KubernetesVersion != tc.joinMachine.GetMachine().Spec.Versions.ControlPlane { + t.Fatal("Failed to set the kubernetes version properly") + } + }) + } +} + +/** Helpers **/ + +func contains(haystack []string, needle string) bool { + for _, hay := range haystack { + if needle == hay { + return true + } + } + return false +} diff --git a/pkg/cloud/aws/services/kubeadm/scheme.go b/pkg/cloud/aws/services/kubeadm/scheme.go index 2c3a0e0e45..fb5e8cfed6 100644 --- a/pkg/cloud/aws/services/kubeadm/scheme.go +++ b/pkg/cloud/aws/services/kubeadm/scheme.go @@ -20,7 +20,6 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/klog" kubeadmv1beta1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta1" "k8s.io/kubernetes/cmd/kubeadm/app/util" "sigs.k8s.io/controller-runtime/pkg/runtime/scheme" @@ -34,7 +33,7 @@ func GetCodecs() serializer.CodecFactory { sb.Register(&kubeadmv1beta1.JoinConfiguration{}, &kubeadmv1beta1.InitConfiguration{}, &kubeadmv1beta1.ClusterConfiguration{}) kubeadmScheme, err := sb.Build() if err != nil { - klog.Fatal(err) + panic(err) } return serializer.NewCodecFactory(kubeadmScheme) } diff --git a/pkg/cloud/aws/services/mocks/BUILD.bazel b/pkg/cloud/aws/services/mocks/BUILD.bazel index 0e7f23484d..8b3ab6317c 100644 --- a/pkg/cloud/aws/services/mocks/BUILD.bazel +++ b/pkg/cloud/aws/services/mocks/BUILD.bazel @@ -1,11 +1,11 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@bazel_gomock//:gomock.bzl", "gomock") go_library( name = "go_default_library", srcs = [ - "ec2interface.go", - "elbinterface.go", "getters.go", + "services_mock.go", ], importpath = "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/mocks", visibility = ["//visibility:public"], @@ -18,29 +18,14 @@ go_library( ], ) -load("//build:go_mock.bzl", "go_mock") - -go_mock( - name = "go_mock_interfaces", - importpath = "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/mocks", - visibility = ["//visibility:public"], - mocks = [ - { - "prefix": "sigs.k8s.io/cluster-api-provider-aws", - "package": "pkg/cloud/aws/services", - "interface": "EC2Interface", - "vendored": False, - }, - { - "prefix": "sigs.k8s.io/cluster-api-provider-aws", - "package": "pkg/cloud/aws/services", - "interface": "ELBInterface", - "vendored": False, - }, - ], - deps = [ - "//pkg/apis/awsprovider/v1alpha1:go_default_library", - "//pkg/cloud/aws/actuators:go_default_library", - "//vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1:go_default_library", +gomock( + name = "mocks", + out = "services_mock.go", + interfaces = [ + "EC2Interface", + "ELBInterface", ], + library = "//pkg/cloud/aws/services:go_default_library", + package = "mocks", + visibility = ["//visibility:public"], ) diff --git a/pkg/cloud/aws/services/mocks/elbinterface.go b/pkg/cloud/aws/services/mocks/elbinterface.go deleted file mode 100755 index f8d77a0ffa..0000000000 --- a/pkg/cloud/aws/services/mocks/elbinterface.go +++ /dev/null @@ -1,108 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -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. -*/ - - - -// Code generated by MockGen. DO NOT EDIT. -// Source: sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services (interfaces: ELBInterface) - -// Package mocks is a generated GoMock package. -package mocks - -import ( - gomock "github.com/golang/mock/gomock" - reflect "reflect" -) - -// MockELBInterface is a mock of ELBInterface interface -type MockELBInterface struct { - ctrl *gomock.Controller - recorder *MockELBInterfaceMockRecorder -} - -// MockELBInterfaceMockRecorder is the mock recorder for MockELBInterface -type MockELBInterfaceMockRecorder struct { - mock *MockELBInterface -} - -// NewMockELBInterface creates a new mock instance -func NewMockELBInterface(ctrl *gomock.Controller) *MockELBInterface { - mock := &MockELBInterface{ctrl: ctrl} - mock.recorder = &MockELBInterfaceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockELBInterface) EXPECT() *MockELBInterfaceMockRecorder { - return m.recorder -} - -// DeleteLoadbalancers mocks base method -func (m *MockELBInterface) DeleteLoadbalancers() error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DeleteLoadbalancers") - ret0, _ := ret[0].(error) - return ret0 -} - -// DeleteLoadbalancers indicates an expected call of DeleteLoadbalancers -func (mr *MockELBInterfaceMockRecorder) DeleteLoadbalancers() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteLoadbalancers", reflect.TypeOf((*MockELBInterface)(nil).DeleteLoadbalancers)) -} - -// GetAPIServerDNSName mocks base method -func (m *MockELBInterface) GetAPIServerDNSName() (string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAPIServerDNSName") - ret0, _ := ret[0].(string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetAPIServerDNSName indicates an expected call of GetAPIServerDNSName -func (mr *MockELBInterfaceMockRecorder) GetAPIServerDNSName() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAPIServerDNSName", reflect.TypeOf((*MockELBInterface)(nil).GetAPIServerDNSName)) -} - -// ReconcileLoadbalancers mocks base method -func (m *MockELBInterface) ReconcileLoadbalancers() error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ReconcileLoadbalancers") - ret0, _ := ret[0].(error) - return ret0 -} - -// ReconcileLoadbalancers indicates an expected call of ReconcileLoadbalancers -func (mr *MockELBInterfaceMockRecorder) ReconcileLoadbalancers() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileLoadbalancers", reflect.TypeOf((*MockELBInterface)(nil).ReconcileLoadbalancers)) -} - -// RegisterInstanceWithAPIServerELB mocks base method -func (m *MockELBInterface) RegisterInstanceWithAPIServerELB(arg0 string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RegisterInstanceWithAPIServerELB", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// RegisterInstanceWithAPIServerELB indicates an expected call of RegisterInstanceWithAPIServerELB -func (mr *MockELBInterfaceMockRecorder) RegisterInstanceWithAPIServerELB(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInstanceWithAPIServerELB", reflect.TypeOf((*MockELBInterface)(nil).RegisterInstanceWithAPIServerELB), arg0) -} diff --git a/pkg/cloud/aws/services/mocks/ec2interface.go b/pkg/cloud/aws/services/mocks/services_mock.go similarity index 68% rename from pkg/cloud/aws/services/mocks/ec2interface.go rename to pkg/cloud/aws/services/mocks/services_mock.go index 07f85456c1..2a41b98cd8 100755 --- a/pkg/cloud/aws/services/mocks/ec2interface.go +++ b/pkg/cloud/aws/services/mocks/services_mock.go @@ -14,10 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ - - // Code generated by MockGen. DO NOT EDIT. -// Source: sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services (interfaces: EC2Interface) +// Source: sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services (interfaces: EC2Interface,ELBInterface) // Package mocks is a generated GoMock package. package mocks @@ -179,3 +177,83 @@ func (mr *MockEC2InterfaceMockRecorder) UpdateResourceTags(arg0, arg1, arg2 inte mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateResourceTags", reflect.TypeOf((*MockEC2Interface)(nil).UpdateResourceTags), arg0, arg1, arg2) } + +// MockELBInterface is a mock of ELBInterface interface +type MockELBInterface struct { + ctrl *gomock.Controller + recorder *MockELBInterfaceMockRecorder +} + +// MockELBInterfaceMockRecorder is the mock recorder for MockELBInterface +type MockELBInterfaceMockRecorder struct { + mock *MockELBInterface +} + +// NewMockELBInterface creates a new mock instance +func NewMockELBInterface(ctrl *gomock.Controller) *MockELBInterface { + mock := &MockELBInterface{ctrl: ctrl} + mock.recorder = &MockELBInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockELBInterface) EXPECT() *MockELBInterfaceMockRecorder { + return m.recorder +} + +// DeleteLoadbalancers mocks base method +func (m *MockELBInterface) DeleteLoadbalancers() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteLoadbalancers") + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteLoadbalancers indicates an expected call of DeleteLoadbalancers +func (mr *MockELBInterfaceMockRecorder) DeleteLoadbalancers() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteLoadbalancers", reflect.TypeOf((*MockELBInterface)(nil).DeleteLoadbalancers)) +} + +// GetAPIServerDNSName mocks base method +func (m *MockELBInterface) GetAPIServerDNSName() (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAPIServerDNSName") + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAPIServerDNSName indicates an expected call of GetAPIServerDNSName +func (mr *MockELBInterfaceMockRecorder) GetAPIServerDNSName() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAPIServerDNSName", reflect.TypeOf((*MockELBInterface)(nil).GetAPIServerDNSName)) +} + +// ReconcileLoadbalancers mocks base method +func (m *MockELBInterface) ReconcileLoadbalancers() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileLoadbalancers") + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileLoadbalancers indicates an expected call of ReconcileLoadbalancers +func (mr *MockELBInterfaceMockRecorder) ReconcileLoadbalancers() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileLoadbalancers", reflect.TypeOf((*MockELBInterface)(nil).ReconcileLoadbalancers)) +} + +// RegisterInstanceWithAPIServerELB mocks base method +func (m *MockELBInterface) RegisterInstanceWithAPIServerELB(arg0 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RegisterInstanceWithAPIServerELB", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// RegisterInstanceWithAPIServerELB indicates an expected call of RegisterInstanceWithAPIServerELB +func (mr *MockELBInterfaceMockRecorder) RegisterInstanceWithAPIServerELB(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInstanceWithAPIServerELB", reflect.TypeOf((*MockELBInterface)(nil).RegisterInstanceWithAPIServerELB), arg0) +} diff --git a/pkg/cloud/aws/services/sts/BUILD b/pkg/cloud/aws/services/sts/BUILD.bazel similarity index 100% rename from pkg/cloud/aws/services/sts/BUILD rename to pkg/cloud/aws/services/sts/BUILD.bazel diff --git a/pkg/cloud/aws/services/wait/BUILD b/pkg/cloud/aws/services/wait/BUILD.bazel similarity index 100% rename from pkg/cloud/aws/services/wait/BUILD rename to pkg/cloud/aws/services/wait/BUILD.bazel diff --git a/pkg/cloudtest/BUILD b/pkg/cloudtest/BUILD.bazel similarity index 61% rename from pkg/cloudtest/BUILD rename to pkg/cloudtest/BUILD.bazel index 910346114a..ebe0e86be0 100644 --- a/pkg/cloudtest/BUILD +++ b/pkg/cloudtest/BUILD.bazel @@ -5,5 +5,8 @@ go_library( srcs = ["cloudtest.go"], importpath = "sigs.k8s.io/cluster-api-provider-aws/pkg/cloudtest", visibility = ["//visibility:public"], - deps = ["//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library"], + deps = [ + "//vendor/github.com/go-logr/logr:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + ], ) diff --git a/pkg/cloudtest/cloudtest.go b/pkg/cloudtest/cloudtest.go index 2e4bf4678f..ad72a6c1f2 100644 --- a/pkg/cloudtest/cloudtest.go +++ b/pkg/cloudtest/cloudtest.go @@ -20,6 +20,7 @@ import ( "encoding/json" "testing" + "github.com/go-logr/logr" "k8s.io/apimachinery/pkg/runtime" ) @@ -36,3 +37,14 @@ func RuntimeRawExtension(t *testing.T, p interface{}) *runtime.RawExtension { Raw: out, } } + +// Log implements logr.Logger for testing. Do not use if you actually want to +// test log messages. +type Log struct{} + +func (l *Log) Error(err error, msg string, keysAndValues ...interface{}) {} +func (l *Log) V(level int) logr.InfoLogger { return l } +func (l *Log) WithValues(keysAndValues ...interface{}) logr.Logger { return l } +func (l *Log) WithName(name string) logr.Logger { return l } +func (l *Log) Info(msg string, keysAndValues ...interface{}) {} +func (l *Log) Enabled() bool { return false } diff --git a/pkg/record/BUILD b/pkg/record/BUILD.bazel similarity index 100% rename from pkg/record/BUILD rename to pkg/record/BUILD.bazel diff --git a/test/e2e/BUILD b/test/e2e/BUILD.bazel similarity index 98% rename from test/e2e/BUILD rename to test/e2e/BUILD.bazel index 1fbcee9fe4..d66ac3c6ca 100644 --- a/test/e2e/BUILD +++ b/test/e2e/BUILD.bazel @@ -60,6 +60,7 @@ go_test( "//pkg/cloud/aws/services/awserrors:go_default_library", "//pkg/cloud/aws/services/cloudformation:go_default_library", "//pkg/cloud/aws/services/sts:go_default_library", + "//pkg/cloudtest:go_default_library", "//test/e2e/util/kind:go_default_library", "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", "//vendor/github.com/aws/aws-sdk-go/aws/client:go_default_library", @@ -89,6 +90,7 @@ genrule( "//cmd/clusterctl/examples/aws:cluster.yaml.template", "//cmd/clusterctl/examples/aws:cluster-network-spec.yaml.template", "//cmd/clusterctl/examples/aws:machines.yaml.template", + "//cmd/clusterctl/examples/aws:machines-ha.yaml.template", "//cmd/clusterctl/examples/aws:provider-components-base.yaml", "//cmd/clusterctl/examples/aws:generate-yaml.sh", "manifests/provider-credentials.sh", @@ -97,6 +99,7 @@ genrule( "manifests/addons.yaml", "manifests/cluster.yaml", "manifests/machines.yaml", + "manifests/machines-ha.yaml", "manifests/provider-components.yaml", ], cmd = " && ".join([ diff --git a/test/e2e/aws_test.go b/test/e2e/aws_test.go index 0343a05487..0e1b794c87 100644 --- a/test/e2e/aws_test.go +++ b/test/e2e/aws_test.go @@ -19,6 +19,7 @@ package e2e_test import ( "bytes" "flag" + "fmt" "io/ioutil" "time" @@ -39,15 +40,13 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/client-go/kubernetes" - - "fmt" - capa "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1alpha1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/actuators" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/actuators/machine" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/cloudformation" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/services/sts" + "sigs.k8s.io/cluster-api-provider-aws/pkg/cloudtest" "sigs.k8s.io/cluster-api-provider-aws/test/e2e/util/kind" capi "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" @@ -181,7 +180,7 @@ func makeMachine() *capi.Machine { machine.ObjectMeta.Name = controlPlaneName machine.ObjectMeta.Labels[capi.MachineClusterLabelName] = clusterName - awsSpec, err := actuators.MachineConfigFromProviderSpec(nil, machine.Spec.ProviderSpec) + awsSpec, err := actuators.MachineConfigFromProviderSpec(nil, machine.Spec.ProviderSpec, &cloudtest.Log{}) Expect(err).To(BeNil()) awsSpec.KeyName = keyPairName machine.Spec.ProviderSpec.Value, err = capa.EncodeMachineSpec(awsSpec) diff --git a/test/e2e/util/kind/setup.go b/test/e2e/util/kind/setup.go index 17f0963c7d..12195403c0 100644 --- a/test/e2e/util/kind/setup.go +++ b/test/e2e/util/kind/setup.go @@ -51,8 +51,6 @@ var ( managerImageTar = flag.String("managerImageTar", "", "a script to load the manager Docker image into Docker") ) -const kindContainerName = "kind-1-control-plane" - // Cluster represents the running state of a KIND cluster. // An empty struct is enough to call Setup() on. type Cluster struct { @@ -73,28 +71,16 @@ func (c *Cluster) Setup() { fmt.Fprintf(ginkgo.GinkgoWriter, "export KUBECONFIG=%s\n", c.kubepath) if *managerImageTar != "" { - c.loadImage() + fmt.Fprintf( + ginkgo.GinkgoWriter, + "loading image %q into Kind node\n", + *managerImageTar) + c.run(exec.Command(*kindBinary, "load", "image-archive", *managerImageTar)) } c.applyYAML() } -func (c *Cluster) loadImage() { - // TODO(EKF): once kind supports loading images directly, remove this hack - fmt.Fprintf( - ginkgo.GinkgoWriter, - "loading image %q into nested docker instance\n", - *managerImageTar) - file, err := os.Open(*managerImageTar) - gomega.Expect(err).To(gomega.BeNil()) - - // Pipe the tar file into the kind container then docker-load it - cmd := exec.Command("docker", "exec", "--interactive", kindContainerName, "docker", "load") - cmd.Stdin = file - cmd.Stdout = ginkgo.GinkgoWriter - c.run(cmd) -} - // Teardown attempts to delete the KIND cluster func (c *Cluster) Teardown() { c.run(exec.Command(*kindBinary, "delete", "cluster")) diff --git a/test/integration/BUILD b/test/integration/BUILD.bazel similarity index 100% rename from test/integration/BUILD rename to test/integration/BUILD.bazel diff --git a/vendor/github.com/aws/aws-sdk-go/NOTICE.txt b/vendor/github.com/aws/aws-sdk-go/NOTICE.txt index 5f14d1162e..899129ecc4 100644 --- a/vendor/github.com/aws/aws-sdk-go/NOTICE.txt +++ b/vendor/github.com/aws/aws-sdk-go/NOTICE.txt @@ -1,3 +1,3 @@ AWS SDK for Go -Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. +Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. Copyright 2014-2015 Stripe, Inc. diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go index 59fa4a558a..142a7a01c5 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go @@ -15,7 +15,7 @@ func DeepEqual(a, b interface{}) bool { rb := reflect.Indirect(reflect.ValueOf(b)) if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid { - // If the elements are both nil, and of the same type the are equal + // If the elements are both nil, and of the same type they are equal // If they are of different types they are not equal return reflect.TypeOf(a) == reflect.TypeOf(b) } else if raValid != rbValid { 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 ce9fb896d9..7b5e1276ac 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 @@ -118,6 +118,12 @@ var LogHTTPResponseHandler = request.NamedHandler{ func logResponse(r *request.Request) { lw := &logWriter{r.Config.Logger, bytes.NewBuffer(nil)} + if r.HTTPResponse == nil { + lw.Logger.Log(fmt.Sprintf(logRespErrMsg, + r.ClientInfo.ServiceName, r.Operation.Name, "request's HTTPResponse is nil")) + return + } + logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) if logBody { r.HTTPResponse.Body = &teeReaderCloser{ diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/BUILD.bazel index f97e06520c..9071bd4084 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/BUILD.bazel +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/BUILD.bazel @@ -11,6 +11,7 @@ go_library( "//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library", "//vendor/github.com/aws/aws-sdk-go/aws/client:go_default_library", "//vendor/github.com/aws/aws-sdk-go/aws/credentials:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/internal/sdkrand:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/sts:go_default_library", ], ) 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 4108e433e6..b6dbfd2467 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 @@ -80,16 +80,18 @@ package stscreds import ( "fmt" + "os" "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/internal/sdkrand" "github.com/aws/aws-sdk-go/service/sts" ) -// StdinTokenProvider will prompt on stdout and read from stdin for a string value. +// StdinTokenProvider will prompt on stderr and read from stdin for a string value. // An error is returned if reading from stdin fails. // // Use this function go read MFA tokens from stdin. The function makes no attempt @@ -102,7 +104,7 @@ import ( // Will wait forever until something is provided on the stdin. func StdinTokenProvider() (string, error) { var v string - fmt.Printf("Assume Role MFA token code: ") + fmt.Fprintf(os.Stderr, "Assume Role MFA token code: ") _, err := fmt.Scanln(&v) return v, err @@ -193,6 +195,18 @@ type AssumeRoleProvider struct { // // If ExpiryWindow is 0 or less it will be ignored. ExpiryWindow time.Duration + + // MaxJitterFrac reduces the effective Duration of each credential requested + // by a random percentage between 0 and MaxJitterFraction. MaxJitterFrac must + // have a value between 0 and 1. Any other value may lead to expected behavior. + // With a MaxJitterFrac value of 0, default) will no jitter will be used. + // + // For example, with a Duration of 30m and a MaxJitterFrac of 0.1, the + // AssumeRole call will be made with an arbitrary Duration between 27m and + // 30m. + // + // MaxJitterFrac should not be negative. + MaxJitterFrac float64 } // NewCredentials returns a pointer to a new Credentials object wrapping the @@ -254,8 +268,9 @@ func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) { // Expire as often as AWS permits. p.Duration = DefaultDuration } + jitter := time.Duration(sdkrand.SeededRand.Float64() * p.MaxJitterFrac * float64(p.Duration)) input := &sts.AssumeRoleInput{ - DurationSeconds: aws.Int64(int64(p.Duration / time.Second)), + DurationSeconds: aws.Int64(int64((p.Duration - jitter) / time.Second)), RoleArn: aws.String(p.RoleARN), RoleSessionName: aws.String(p.RoleSessionName), ExternalId: p.ExternalID, 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 88e2fc7073..d57a1af599 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 @@ -24,8 +24,9 @@ func (c *EC2Metadata) GetMetadata(p string) (string, error) { output := &metadataOutput{} req := c.NewRequest(op, nil, output) + err := req.Send() - return output.Content, req.Send() + return output.Content, err } // GetUserData returns the userdata that was configured for the service. If @@ -45,8 +46,9 @@ func (c *EC2Metadata) GetUserData() (string, error) { r.Error = awserr.New("NotFoundError", "user-data not found", r.Error) } }) + err := req.Send() - return output.Content, req.Send() + return output.Content, err } // GetDynamicData uses the path provided to request information from the EC2 @@ -61,8 +63,9 @@ func (c *EC2Metadata) GetDynamicData(p string) (string, error) { output := &metadataOutput{} req := c.NewRequest(op, nil, output) + err := req.Send() - return output.Content, req.Send() + return output.Content, err } // GetInstanceIdentityDocument retrieves an identity document describing an 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 7d1f66e4e8..f4438eae9c 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 @@ -92,6 +92,9 @@ func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Send.SwapNamed(request.NamedHandler{ Name: corehandlers.SendHandler.Name, Fn: func(r *request.Request) { + r.HTTPResponse = &http.Response{ + Header: http.Header{}, + } r.Error = awserr.New( request.CanceledErrorCode, "EC2 IMDS access disabled via "+disableServiceEnvVar+" env var", 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 29a8ae3e43..50e170eee2 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 @@ -15,6 +15,7 @@ const ( // AWS Standard partition's regions. const ( + ApEast1RegionID = "ap-east-1" // Asia Pacific (Hong Kong). ApNortheast1RegionID = "ap-northeast-1" // Asia Pacific (Tokyo). ApNortheast2RegionID = "ap-northeast-2" // Asia Pacific (Seoul). ApSouth1RegionID = "ap-south-1" // Asia Pacific (Mumbai). @@ -91,6 +92,9 @@ var awsPartition = partition{ SignatureVersions: []string{"v4"}, }, Regions: regions{ + "ap-east-1": region{ + Description: "Asia Pacific (Hong Kong)", + }, "ap-northeast-1": region{ Description: "Asia Pacific (Tokyo)", }, @@ -150,6 +154,7 @@ var awsPartition = partition{ "acm": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -174,20 +179,31 @@ 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{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, "api.ecr": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{ + Hostname: "api.ecr.ap-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-east-1", + }, + }, "ap-northeast-1": endpoint{ Hostname: "api.ecr.ap-northeast-1.amazonaws.com", CredentialScope: credentialScope{ @@ -353,6 +369,7 @@ var awsPartition = partition{ "apigateway": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -380,6 +397,7 @@ var awsPartition = partition{ }, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -426,6 +444,7 @@ var awsPartition = partition{ "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{}, @@ -439,6 +458,7 @@ var awsPartition = partition{ "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, @@ -452,6 +472,7 @@ var awsPartition = partition{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -561,6 +582,7 @@ var awsPartition = partition{ "cloud9": service{ Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, @@ -585,6 +607,7 @@ var awsPartition = partition{ "cloudformation": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -674,6 +697,7 @@ var awsPartition = partition{ "cloudtrail": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -904,14 +928,25 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, + "comprehendmedical": service{ + + Endpoints: endpoints{ + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "config": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -968,6 +1003,7 @@ var awsPartition = partition{ "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, @@ -1012,6 +1048,7 @@ var awsPartition = partition{ "dms": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1033,6 +1070,12 @@ var awsPartition = partition{ "docdb": service{ Endpoints: endpoints{ + "eu-central-1": endpoint{ + Hostname: "rds.eu-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-central-1", + }, + }, "eu-west-1": endpoint{ Hostname: "rds.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ @@ -1083,6 +1126,7 @@ var awsPartition = partition{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1113,6 +1157,7 @@ var awsPartition = partition{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1145,6 +1190,7 @@ var awsPartition = partition{ "ecs": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1166,6 +1212,7 @@ var awsPartition = partition{ "elasticache": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1232,6 +1279,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{}, @@ -1256,6 +1304,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{}, @@ -1294,9 +1343,10 @@ var awsPartition = partition{ "email": service{ Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "entitlement.marketplace": service{ @@ -1312,6 +1362,7 @@ var awsPartition = partition{ "es": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1339,6 +1390,7 @@ var awsPartition = partition{ "events": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1394,10 +1446,12 @@ var awsPartition = partition{ "fsx": service{ Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, + "ap-northeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, }, }, "gamelift": service{ @@ -1424,6 +1478,7 @@ var awsPartition = partition{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1581,6 +1636,7 @@ var awsPartition = partition{ "kinesis": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1613,6 +1669,7 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, @@ -1628,6 +1685,7 @@ var awsPartition = partition{ Region: "ca-central-1", }, }, + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1649,6 +1707,7 @@ var awsPartition = partition{ "lambda": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1704,6 +1763,7 @@ var awsPartition = partition{ "logs": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1735,6 +1795,25 @@ var awsPartition = partition{ "us-east-1": endpoint{}, }, }, + "mediaconnect": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "mediaconvert": service{ Endpoints: endpoints{ @@ -1747,6 +1826,7 @@ var awsPartition = partition{ "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1805,6 +1885,7 @@ var awsPartition = partition{ }, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1852,6 +1933,7 @@ var awsPartition = partition{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1879,6 +1961,7 @@ var awsPartition = partition{ "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{}, @@ -1904,6 +1987,12 @@ var awsPartition = partition{ Region: "ap-northeast-1", }, }, + "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{ @@ -2008,10 +2097,12 @@ var awsPartition = partition{ }, }, Endpoints: endpoints{ - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "polly": service{ @@ -2038,6 +2129,7 @@ var awsPartition = partition{ "rds": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2061,6 +2153,7 @@ var awsPartition = partition{ "redshift": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2095,6 +2188,7 @@ var awsPartition = partition{ "resource-groups": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2116,9 +2210,10 @@ var awsPartition = partition{ "robomaker": service{ Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "ap-northeast-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "route53": service{ @@ -2146,11 +2241,18 @@ var awsPartition = partition{ }, Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -2195,6 +2297,7 @@ var awsPartition = partition{ DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{ Hostname: "s3.ap-northeast-1.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, @@ -2423,6 +2526,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{}, @@ -2503,12 +2607,18 @@ var awsPartition = partition{ "eu-central-1": endpoint{ Protocols: []string{"https"}, }, + "eu-north-1": endpoint{ + Protocols: []string{"https"}, + }, "eu-west-1": endpoint{ Protocols: []string{"https"}, }, "eu-west-2": endpoint{ Protocols: []string{"https"}, }, + "eu-west-3": endpoint{ + Protocols: []string{"https"}, + }, "sa-east-1": endpoint{ Protocols: []string{"https"}, }, @@ -2611,6 +2721,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{}, @@ -2645,6 +2756,7 @@ var awsPartition = partition{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2669,6 +2781,7 @@ var awsPartition = partition{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2716,6 +2829,7 @@ var awsPartition = partition{ "ssm": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2737,6 +2851,7 @@ var awsPartition = partition{ "states": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2818,6 +2933,12 @@ var awsPartition = partition{ }, }, Endpoints: endpoints{ + "ap-east-1": endpoint{ + Hostname: "sts.ap-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-east-1", + }, + }, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{ Hostname: "sts.ap-northeast-2.amazonaws.com", @@ -2875,6 +2996,7 @@ var awsPartition = partition{ "swf": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2896,6 +3018,7 @@ var awsPartition = partition{ "tagging": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2938,8 +3061,10 @@ var awsPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "translate-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -2979,9 +3104,13 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -3131,6 +3260,20 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "cloudfront": service{ + PartitionEndpoint: "aws-cn-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-cn-global": endpoint{ + Hostname: "cloudfront.cn-northwest-1.amazonaws.com.cn", + Protocols: []string{"http", "https"}, + CredentialScope: credentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, "cloudtrail": service{ Endpoints: endpoints{ @@ -3334,6 +3477,12 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "mediaconvert": service{ + + Endpoints: endpoints{ + "cn-northwest-1": endpoint{}, + }, + }, "monitoring": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, @@ -3613,6 +3762,12 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "codecommit": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "codedeploy": service{ Endpoints: endpoints{ @@ -3632,6 +3787,14 @@ var awsusgovPartition = partition{ }, }, }, + "comprehend": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "config": service{ Endpoints: endpoints{ @@ -3848,6 +4011,13 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "license-manager": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, "logs": service{ Endpoints: endpoints{ @@ -4072,6 +4242,12 @@ var awsusgovPartition = partition{ }, }, }, + "waf-regional": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "workspaces": service{ Endpoints: endpoints{ 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 7bc5da7826..d0aa54c6d1 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 @@ -38,6 +38,7 @@ var throttleCodes = map[string]struct{}{ "ThrottlingException": {}, "RequestLimitExceeded": {}, "RequestThrottled": {}, + "RequestThrottledException": {}, "TooManyRequestsException": {}, // Lambda functions "PriorRequestNotComplete": {}, // Route53 "TransactionInProgressException": {}, diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/aws/session/BUILD.bazel index 046d7fb763..7e7adb7fb6 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/BUILD.bazel +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/BUILD.bazel @@ -3,6 +3,9 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = [ + "cabundle_transport.go", + "cabundle_transport_1_5.go", + "cabundle_transport_1_6.go", "doc.go", "env_config.go", "session.go", diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport.go b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport.go new file mode 100644 index 0000000000..ea9ebb6f6a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport.go @@ -0,0 +1,26 @@ +// +build go1.7 + +package session + +import ( + "net" + "net/http" + "time" +) + +// Transport that should be used when a custom CA bundle is specified with the +// SDK. +func getCABundleTransport() *http.Transport { + return &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + DualStack: true, + }).DialContext, + MaxIdleConns: 100, + IdleConnTimeout: 90 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_5.go b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_5.go new file mode 100644 index 0000000000..fec39dfc12 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_5.go @@ -0,0 +1,22 @@ +// +build !go1.6,go1.5 + +package session + +import ( + "net" + "net/http" + "time" +) + +// Transport that should be used when a custom CA bundle is specified with the +// SDK. +func getCABundleTransport() *http.Transport { + return &http.Transport{ + Proxy: http.ProxyFromEnvironment, + Dial: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + }).Dial, + TLSHandshakeTimeout: 10 * time.Second, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_6.go b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_6.go new file mode 100644 index 0000000000..1c5a5391e6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_6.go @@ -0,0 +1,23 @@ +// +build !go1.7,go1.6 + +package session + +import ( + "net" + "net/http" + "time" +) + +// Transport that should be used when a custom CA bundle is specified with the +// SDK. +func getCABundleTransport() *http.Transport { + return &http.Transport{ + Proxy: http.ProxyFromEnvironment, + Dial: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + }).Dial, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, + } +} 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 9bdbafd65c..be4b5f0777 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 @@ -407,7 +407,10 @@ func loadCustomCABundle(s *Session, bundle io.Reader) error { } } if t == nil { - t = &http.Transport{} + // Nil transport implies `http.DefaultTransport` should be used. Since + // the SDK cannot modify, nor copy the `DefaultTransport` specifying + // the values the next closest behavior. + t = getCABundleTransport() } p, err := loadCertPool(bundle) 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 07f7e10ec1..15ad9cfe46 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.17.5" +const SDKVersion = "1.19.18" diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go index b34f5258a4..b80f84fbb8 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go @@ -155,6 +155,9 @@ func buildHeader(header *http.Header, v reflect.Value, name string, tag reflect. return awserr.New("SerializationError", "failed to encode REST request", err) } + name = strings.TrimSpace(name) + str = strings.TrimSpace(str) + header.Add(name, str) return nil @@ -170,8 +173,10 @@ func buildHeaderMap(header *http.Header, v reflect.Value, tag reflect.StructTag) return awserr.New("SerializationError", "failed to encode REST request", err) } + keyStr := strings.TrimSpace(key.String()) + str = strings.TrimSpace(str) - header.Add(prefix+key.String(), str) + header.Add(prefix+keyStr, str) } return nil } 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 b033dc8c5f..212a58946f 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 @@ -143,7 +143,7 @@ func (c *CloudFormation) ContinueUpdateRollbackRequest(input *ContinueUpdateRoll // // For a specified stack that is in the UPDATE_ROLLBACK_FAILED state, continues // rolling it back to the UPDATE_ROLLBACK_COMPLETE state. Depending on the cause -// of the failure, you can manually fix the error (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-update-rollback-failed) +// of the failure, you can manually fix the error (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-update-rollback-failed) // and continue the rollback. By continuing the rollback, you can return your // stack to a working state (the UPDATE_ROLLBACK_COMPLETE state), and then try // to update the stack again. @@ -272,7 +272,8 @@ func (c *CloudFormation) CreateChangeSetRequest(input *CreateChangeSetInput) (re // * ErrCodeLimitExceededException "LimitExceededException" // The quota for the resource has already been reached. // -// For information on stack set limitations, see Limitations of StackSets (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-limitations.html). +// For information on resource and stack limitations, see Limits (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) +// in the AWS CloudFormation User Guide. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateChangeSet func (c *CloudFormation) CreateChangeSet(input *CreateChangeSetInput) (*CreateChangeSetOutput, error) { @@ -355,7 +356,8 @@ func (c *CloudFormation) CreateStackRequest(input *CreateStackInput) (req *reque // * ErrCodeLimitExceededException "LimitExceededException" // The quota for the resource has already been reached. // -// For information on stack set limitations, see Limitations of StackSets (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-limitations.html). +// For information on resource and stack limitations, see Limits (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) +// in the AWS CloudFormation User Guide. // // * ErrCodeAlreadyExistsException "AlreadyExistsException" // The resource with the name requested already exists. @@ -466,7 +468,8 @@ func (c *CloudFormation) CreateStackInstancesRequest(input *CreateStackInstances // * ErrCodeLimitExceededException "LimitExceededException" // The quota for the resource has already been reached. // -// For information on stack set limitations, see Limitations of StackSets (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-limitations.html). +// For information on resource and stack limitations, see Limits (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) +// in the AWS CloudFormation User Guide. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateStackInstances func (c *CloudFormation) CreateStackInstances(input *CreateStackInstancesInput) (*CreateStackInstancesOutput, error) { @@ -553,7 +556,8 @@ func (c *CloudFormation) CreateStackSetRequest(input *CreateStackSetInput) (req // * ErrCodeLimitExceededException "LimitExceededException" // The quota for the resource has already been reached. // -// For information on stack set limitations, see Limitations of StackSets (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-limitations.html). +// For information on resource and stack limitations, see Limits (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) +// in the AWS CloudFormation User Guide. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateStackSet func (c *CloudFormation) CreateStackSet(input *CreateStackSetInput) (*CreateStackSetOutput, error) { @@ -971,7 +975,9 @@ func (c *CloudFormation) DescribeAccountLimitsRequest(input *DescribeAccountLimi // DescribeAccountLimits API operation for AWS CloudFormation. // // Retrieves your account's AWS CloudFormation limits, such as the maximum number -// of stacks that you can create in your account. +// of stacks that you can create in your account. 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. // // 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 @@ -1047,7 +1053,7 @@ func (c *CloudFormation) DescribeChangeSetRequest(input *DescribeChangeSetInput) // // Returns the inputs for the change set and a list of changes that AWS CloudFormation // will make if you execute the change set. For more information, see Updating -// Stacks Using Change Sets (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets.html) +// Stacks Using Change Sets (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets.html) // in the AWS CloudFormation User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1134,7 +1140,7 @@ func (c *CloudFormation) DescribeStackDriftDetectionStatusRequest(input *Describ // template and any values specified as template parameters. A stack is considered // to have drifted if one or more of its resources have drifted. For more information // on stack and resource drift, see Detecting Unregulated Configuration Changes -// to Stacks and Resources (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html). +// to Stacks and Resources (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html). // // Use DetectStackDrift to initiate a stack drift detection operation. DetectStackDrift // returns a StackDriftDetectionId you can use to monitor the progress of the @@ -1221,7 +1227,7 @@ func (c *CloudFormation) DescribeStackEventsRequest(input *DescribeStackEventsIn // DescribeStackEvents API operation for AWS CloudFormation. // // Returns all stack related events for a specified stack in reverse chronological -// order. For more information about a stack's event history, go to Stacks (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/concept-stack.html) +// order. For more information about a stack's event history, go to Stacks (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/concept-stack.html) // in the AWS CloudFormation User Guide. // // You can list events for stacks that have failed to create or have been deleted @@ -1526,7 +1532,7 @@ func (c *CloudFormation) DescribeStackResourceDriftsRequest(input *DescribeStack // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html). +// support drift detection, see Resources that Support Drift Detection (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html). // // Use DetectStackResourceDrift to detect drift on individual resources, or // DetectStackDrift to detect drift on all supported resources for a given stack. @@ -1667,7 +1673,7 @@ func (c *CloudFormation) DescribeStackResourcesRequest(input *DescribeStackResou // You must specify either StackName or PhysicalResourceId, but not both. In // addition, you can specify LogicalResourceId to filter the returned result. // For more information about resources, the LogicalResourceId and PhysicalResourceId, -// go to the AWS CloudFormation User Guide (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/). +// go to the AWS CloudFormation User Guide (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/). // // A ValidationError is returned if you specify both StackName and PhysicalResourceId // in the same request. @@ -2046,13 +2052,13 @@ func (c *CloudFormation) DetectStackDriftRequest(input *DetectStackDriftInput) ( // explicitly defined in the stack template are checked for drift. A stack is // considered to have drifted if one or more of its resources differ from their // expected template configurations. For more information, see Detecting Unregulated -// Configuration Changes to Stacks and Resources (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html). +// Configuration Changes to Stacks and Resources (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html). // // Use DetectStackDrift to detect drift on all supported resources for a given // stack, or DetectStackResourceDrift to detect drift on individual resources. // // For a list of stack resources that currently support drift detection, see -// Resources that Support Drift Detection (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html). +// Resources that Support Drift Detection (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html). // // DetectStackDrift can take up to several minutes, depending on the number // of resources contained within the stack. Use DescribeStackDriftDetectionStatus @@ -2142,7 +2148,7 @@ func (c *CloudFormation) DetectStackResourceDriftRequest(input *DetectStackResou // includes actual and expected property values for resources in which AWS CloudFormation // detects drift. Only resource properties explicitly defined in the stack template // are checked for drift. For more information about stack and resource drift, -// see Detecting Unregulated Configuration Changes to Stacks and Resources (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html). +// see Detecting Unregulated Configuration Changes to Stacks and Resources (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html). // // Use DetectStackResourceDrift to detect drift on individual resources, or // DetectStackDrift to detect drift on all resources in a given stack that support @@ -2150,7 +2156,7 @@ func (c *CloudFormation) DetectStackResourceDriftRequest(input *DetectStackResou // // Resources that do not currently support drift detection cannot be checked. // For a list of resources that support drift detection, see Resources that -// Support Drift Detection (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html). +// Support Drift Detection (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.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 @@ -2739,11 +2745,11 @@ func (c *CloudFormation) ListExportsRequest(input *ListExportsInput) (req *reque // // Lists all exported output values in the account and region in which you call // this action. Use this action to see the exported output values that you can -// import into other stacks. To import values, use the Fn::ImportValue (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-importvalue.html) +// import into other stacks. To import values, use the Fn::ImportValue (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-importvalue.html) // function. // // For more information, see AWS CloudFormation Export Stack Output Values -// (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-exports.html). +// (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-exports.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 @@ -2878,7 +2884,7 @@ func (c *CloudFormation) ListImportsRequest(input *ListImportsInput) (req *reque // are using it. To see the exported output values in your account, see ListExports. // // For more information about importing an exported output value, see the Fn::ImportValue -// (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-importvalue.html) +// (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-importvalue.html) // function. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -3836,7 +3842,7 @@ func (c *CloudFormation) UpdateStackRequest(input *UpdateStackInput) (req *reque // action. // // For more information about creating an update template, updating a stack, -// and monitoring the progress of the update, see Updating a Stack (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks.html). +// 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 @@ -3924,16 +3930,16 @@ func (c *CloudFormation) UpdateStackInstancesRequest(input *UpdateStackInstances // account and region. // // You can only update stack instances in regions and accounts where they already -// exist; to create additional stack instances, use CreateStackInstances (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStackInstances.html). +// 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html) +// 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html) +// 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. @@ -4261,7 +4267,7 @@ func (c *CloudFormation) ValidateTemplateWithContext(ctx aws.Context, input *Val // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-account-gating.html). +// 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"` @@ -4320,11 +4326,13 @@ func (s *AccountGateResult) SetStatusReason(v string) *AccountGateResult { return s } -// The AccountLimit data type. +// 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"` - // The name of the account limit. Currently, the only account limit is StackLimit. + // The name of the account limit. Name *string `type:"string"` // The value that is associated with the account limit name. @@ -4581,7 +4589,7 @@ type ContinueUpdateRollbackInput struct { // reason. // // Specify this property to skip rolling back resources that AWS CloudFormation - // can't successfully roll back. We recommend that you troubleshoot (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-update-rollback-failed) + // 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 @@ -4603,7 +4611,7 @@ type ContinueUpdateRollbackInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-continueupdaterollback.html#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) @@ -4730,19 +4738,19 @@ type CreateChangeSetInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html) + // AWS::IAM::AccessKey (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html) // - // AWS::IAM::Group (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html) + // AWS::IAM::Group (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html) // - // AWS::IAM::InstanceProfile (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) + // AWS::IAM::InstanceProfile (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) // - // AWS::IAM::Policy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html) + // AWS::IAM::Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html) // - // AWS::IAM::Role (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html) + // AWS::IAM::Role (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html) // - // AWS::IAM::User (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) + // AWS::IAM::User (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) // - // AWS::IAM::UserToGroupAddition (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.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). @@ -4788,7 +4796,7 @@ type CreateChangeSetInput struct { // // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-describing-stacks.html#d0e11995) + // 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 @@ -4823,7 +4831,7 @@ type CreateChangeSetInput struct { // 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 - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html) + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html) // in the AWS CloudFormation User Guide. ResourceTypes []*string `type:"list"` @@ -5090,19 +5098,19 @@ type CreateStackInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html) + // AWS::IAM::AccessKey (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html) // - // AWS::IAM::Group (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html) + // AWS::IAM::Group (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html) // - // AWS::IAM::InstanceProfile (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) + // AWS::IAM::InstanceProfile (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) // - // AWS::IAM::Policy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html) + // AWS::IAM::Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html) // - // AWS::IAM::Role (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html) + // AWS::IAM::Role (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html) // - // AWS::IAM::User (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) + // AWS::IAM::User (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) // - // AWS::IAM::UserToGroupAddition (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.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). @@ -5184,7 +5192,7 @@ type CreateStackInput struct { OnFailure *string `type:"string" enum:"OnFailure"` // A list of Parameter structures that specify input parameters for the stack. - // For more information, see the Parameter (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html) + // For more information, see the Parameter (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html) // data type. Parameters []*Parameter `type:"list"` @@ -5201,7 +5209,7 @@ type CreateStackInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html). + // 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) @@ -5232,7 +5240,7 @@ type CreateStackInput struct { StackName *string `type:"string" required:"true"` // Structure containing the stack policy body. For more information, go to - // Prevent Updates to Stack Resources (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html) + // 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"` @@ -5250,7 +5258,7 @@ type CreateStackInput struct { // 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 - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // (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 @@ -5259,7 +5267,7 @@ type CreateStackInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // information, go to the 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 @@ -5487,7 +5495,7 @@ type CreateStackInstancesInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html) + // 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"` @@ -5662,19 +5670,19 @@ type CreateStackSetInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html) + // AWS::IAM::AccessKey (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html) // - // AWS::IAM::Group (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html) + // AWS::IAM::Group (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html) // - // AWS::IAM::InstanceProfile (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) + // AWS::IAM::InstanceProfile (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) // - // AWS::IAM::Policy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html) + // AWS::IAM::Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html) // - // AWS::IAM::Role (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html) + // AWS::IAM::Role (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html) // - // AWS::IAM::User (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) + // AWS::IAM::User (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) // - // AWS::IAM::UserToGroupAddition (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.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). @@ -5741,7 +5749,7 @@ type CreateStackSetInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // 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 @@ -5750,7 +5758,7 @@ type CreateStackSetInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // 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 @@ -6093,7 +6101,7 @@ type DeleteStackInstancesInput struct { // the stacks. You can't reassociate a retained stack or add an existing, saved // stack to a new stack set. // - // For more information, see Stack set operation options (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-ops-options). + // For more information, see Stack set operation options (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-ops-options). // // RetainStacks is a required field RetainStacks *bool `type:"boolean" required:"true"` @@ -6453,7 +6461,7 @@ type DescribeChangeSetOutput struct { // 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 - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html) + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html) // data type. Parameters []*Parameter `type:"list"` @@ -7036,7 +7044,7 @@ type DescribeStackResourceDriftsOutput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html). + // 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"` @@ -7642,7 +7650,7 @@ type EstimateTemplateCostInput struct { // 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 - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // (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, @@ -7651,7 +7659,7 @@ type EstimateTemplateCostInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // 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, @@ -7905,7 +7913,7 @@ type GetStackPolicyOutput struct { _ struct{} `type:"structure"` // Structure containing the stack policy body. (For more information, go to - // Prevent Updates to Stack Resources (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html) + // 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"` } @@ -8008,7 +8016,7 @@ type GetTemplateOutput struct { StagesAvailable []*string `type:"list"` // Structure containing the template body. (For more information, go to Template - // Anatomy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // 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 @@ -8059,7 +8067,7 @@ type GetTemplateSummaryInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // 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, @@ -8068,7 +8076,7 @@ type GetTemplateSummaryInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // 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, @@ -8140,7 +8148,7 @@ type GetTemplateSummaryOutput struct { // error. // // For more information, see Acknowledging IAM Resources in AWS CloudFormation - // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). + // 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 @@ -9168,7 +9176,7 @@ type Parameter struct { ParameterValue *string `type:"string"` // Read-only. The value that corresponds to a Systems Manager parameter key. - // This field is returned only for SSM (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html#aws-ssm-parameter-types) + // This field is returned only for SSM (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html#aws-ssm-parameter-types) // parameter types in the template. ResolvedValue *string `type:"string"` @@ -9353,7 +9361,7 @@ func (s *PhysicalResourceIdContextKeyValuePair) SetValue(v string) *PhysicalReso // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html). +// Changes to Stacks and Resources (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html). type PropertyDifference struct { _ struct{} `type:"structure"` @@ -9625,7 +9633,7 @@ type ResourceTargetDefinition struct { // If the Attribute value is Properties, indicates whether a change to this // property causes the resource to be recreated. The value can be Never, Always, // or Conditionally. To determine the conditions for a Conditionally recreation, - // see the update behavior for that property (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) + // see the update behavior for that property (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) // in the AWS CloudFormation User Guide. RequiresRecreation *string `type:"string" enum:"RequiresRecreation"` } @@ -9680,7 +9688,7 @@ type RollbackConfiguration struct { // CloudFormation still waits the specified period of time before cleaning up // old resources after update operations. You can use this monitoring period // to perform any manual stack validation desired, and manually cancel the stack - // creation or update (using CancelUpdateStack (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CancelUpdateStack.html), + // creation or update (using CancelUpdateStack (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CancelUpdateStack.html), // for example) as necessary. // // If you specify 0 for this parameter, CloudFormation still monitors the specified @@ -9772,7 +9780,7 @@ type RollbackTrigger struct { Arn *string `type:"string" required:"true"` // The resource type of the rollback trigger. Currently, AWS::CloudWatch::Alarm - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html) + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html) // is the only supported resource type. // // Type is a required field @@ -9827,7 +9835,7 @@ type SetStackPolicyInput struct { StackName *string `type:"string" required:"true"` // Structure containing the stack policy body. For more information, go to - // Prevent Updates to Stack Resources (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html) + // 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"` @@ -10396,7 +10404,7 @@ type StackEvent struct { ResourceStatusReason *string `type:"string"` // Type of resource. (For more information, go to AWS Resource Types Reference - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) // in the AWS CloudFormation User Guide.) ResourceType *string `min:"1" type:"string"` @@ -10714,7 +10722,7 @@ type StackResource struct { ResourceStatusReason *string `type:"string"` // Type of resource. (For more information, go to AWS Resource Types Reference - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) // in the AWS CloudFormation User Guide.) // // ResourceType is a required field @@ -10826,7 +10834,7 @@ type StackResourceDetail struct { LogicalResourceId *string `type:"string" required:"true"` // The content of the Metadata attribute declared for the resource. For more - // information, see Metadata Attribute (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html) + // information, see Metadata Attribute (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html) // in the AWS CloudFormation User Guide. Metadata *string `type:"string"` @@ -10843,7 +10851,7 @@ type StackResourceDetail struct { ResourceStatusReason *string `type:"string"` // Type of resource. ((For more information, go to AWS Resource Types Reference - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) // in the AWS CloudFormation User Guide.) // // ResourceType is a required field @@ -10936,7 +10944,7 @@ func (s *StackResourceDetail) SetStackName(v string) *StackResourceDetail { // This includes actual and expected property values for resources in which // AWS CloudFormation has detected drift. Only resource properties explicitly // defined in the stack template are checked for drift. For more information, -// see Detecting Unregulated Configuration Changes to Stacks and Resources (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html). +// see Detecting Unregulated Configuration Changes to Stacks and Resources (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html). // // Resources that do not currently support drift detection cannot be checked. // For a list of resources that support drift detection, see Resources that @@ -11106,7 +11114,7 @@ type StackResourceDriftInformation struct { // // Any resources that do not currently support drift detection have a status // of NOT_CHECKED. For more information, see Resources that Support Drift - // Detection (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html). + // Detection (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html). // // // * IN_SYNC: The resources's actual configuration matches its expected configuration. @@ -11158,11 +11166,11 @@ type StackResourceDriftInformationSummary struct { // // Any resources that do not currently support drift detection have a status // of NOT_CHECKED. For more information, see Resources that Support Drift - // Detection (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html). + // Detection (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html). // If you performed an ContinueUpdateRollback operation on a stack, any resources // included in ResourcesToSkip will also have a status of NOT_CHECKED. For // more information on skipping resources during rollback operations, see - // Continue Rolling Back an Update (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-continueupdaterollback.html) + // Continue Rolling Back an Update (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-continueupdaterollback.html) // in the AWS CloudFormation User Guide. // // * IN_SYNC: The resources's actual configuration matches its expected configuration. @@ -11226,7 +11234,7 @@ type StackResourceSummary struct { ResourceStatusReason *string `type:"string"` // Type of resource. (For more information, go to AWS Resource Types Reference - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) // in the AWS CloudFormation User Guide.) // // ResourceType is a required field @@ -11305,7 +11313,7 @@ type StackSet struct { // might include resources that can affect permissions in your AWS account—for // example, by creating new AWS Identity and Access Management (IAM) users. // For more information, see Acknowledging IAM Resources in AWS CloudFormation - // Templates. (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities) + // Templates. (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities) Capabilities []*string `type:"list"` // A description of the stack set that you specify when the stack set is created @@ -11566,7 +11574,7 @@ func (s *StackSetOperation) SetStatus(v string) *StackSetOperation { // set operation. // // For more information on maximum concurrent accounts and failure tolerance, -// see Stack set operation options (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-ops-options). +// see Stack set operation options (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-ops-options). type StackSetOperationPreferences struct { _ struct{} `type:"structure"` @@ -12247,19 +12255,19 @@ type UpdateStackInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html) + // AWS::IAM::AccessKey (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html) // - // AWS::IAM::Group (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html) + // AWS::IAM::Group (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html) // - // AWS::IAM::InstanceProfile (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) + // AWS::IAM::InstanceProfile (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) // - // AWS::IAM::Policy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html) + // AWS::IAM::Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html) // - // AWS::IAM::Role (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html) + // AWS::IAM::Role (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html) // - // AWS::IAM::User (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) + // AWS::IAM::User (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) // - // AWS::IAM::UserToGroupAddition (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.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). @@ -12316,7 +12324,7 @@ type UpdateStackInput struct { NotificationARNs []*string `type:"list"` // A list of Parameter structures that specify input parameters for the stack. - // For more information, see the Parameter (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html) + // For more information, see the Parameter (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html) // data type. Parameters []*Parameter `type:"list"` @@ -12328,7 +12336,7 @@ type UpdateStackInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html). + // 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) @@ -12401,7 +12409,7 @@ type UpdateStackInput struct { // 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 - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // (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: TemplateBody, @@ -12410,7 +12418,7 @@ type UpdateStackInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // 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: TemplateBody, @@ -12638,7 +12646,7 @@ type UpdateStackInstancesInput struct { // set; to add or delete a parameter itself, use UpdateStackSet 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html) + // 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. @@ -12802,15 +12810,13 @@ type UpdateStackSetInput struct { // // Specify an IAM role only if you are using customized administrator roles // to control which users or groups can manage specific stack sets within the - // same administrator account. For more information, see Define Permissions - // for Multiple Administrators (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html) + // same administrator account. For more information, see Granting Permissions + // for Stack Set Operations (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html) // in the AWS CloudFormation User Guide. // - // If you specify a customized administrator role, AWS CloudFormation uses that - // role to update the stack. If you do not specify a customized administrator - // role, AWS CloudFormation performs the update using the role previously associated - // with the stack set, so long as you have permissions to perform operations - // on the stack set. + // If you specified a customized administrator role when you created the stack + // set, you must specify a customized administrator role, even if it is the + // 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 @@ -12838,19 +12844,19 @@ type UpdateStackSetInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html) + // AWS::IAM::AccessKey (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html) // - // AWS::IAM::Group (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html) + // AWS::IAM::Group (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html) // - // AWS::IAM::InstanceProfile (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) + // AWS::IAM::InstanceProfile (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) // - // AWS::IAM::Policy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html) + // AWS::IAM::Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html) // - // AWS::IAM::Role (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html) + // AWS::IAM::Role (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html) // - // AWS::IAM::User (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) + // AWS::IAM::User (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) // - // AWS::IAM::UserToGroupAddition (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.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). @@ -12959,7 +12965,7 @@ type UpdateStackSetInput struct { // 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 (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // 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: TemplateBody @@ -12968,7 +12974,7 @@ type UpdateStackSetInput struct { // The location of the file that contains the template body. The URL must point // to a template (maximum size: 460,800 bytes) that is located in an Amazon - // S3 bucket. For more information, see Template Anatomy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // 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 only one of the following parameters: TemplateBody @@ -13231,7 +13237,7 @@ type ValidateTemplateInput struct { // 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 - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // (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, @@ -13240,7 +13246,7 @@ type ValidateTemplateInput struct { // 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 Template Anatomy (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) + // 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, @@ -13297,7 +13303,7 @@ type ValidateTemplateOutput struct { // error. // // For more information, see Acknowledging IAM Resources in AWS CloudFormation - // Templates (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities). + // 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 diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/doc.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/doc.go index d82dd221d6..fa6a0c9f29 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/doc.go @@ -21,7 +21,7 @@ // // Amazon CloudFormation makes use of other AWS products. If you need additional // technical information about a specific AWS product, you can find the product's -// technical documentation at docs.aws.amazon.com (http://docs.aws.amazon.com/). +// technical documentation at docs.aws.amazon.com (https://docs.aws.amazon.com/). // // See https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15 for more information on this service. // 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 8744a3b76b..9ced8d7bd6 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 @@ -49,7 +49,8 @@ const ( // // The quota for the resource has already been reached. // - // For information on stack set limitations, see Limitations of StackSets (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-limitations.html). + // For information on resource and stack limitations, see Limits (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) + // in the AWS CloudFormation User Guide. ErrCodeLimitExceededException = "LimitExceededException" // ErrCodeNameAlreadyExistsException for service response error code diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go index ecc3fa772e..d50235417c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go @@ -2017,9 +2017,9 @@ func (c *EC2) AuthorizeSecurityGroupEgressRequest(input *AuthorizeSecurityGroupE // AuthorizeSecurityGroupEgress API operation for Amazon Elastic Compute Cloud. // -// [EC2-VPC only] Adds one or more egress rules to a security group for use +// [EC2-VPC only] Adds the specified egress rules to a security group for use // with a VPC. Specifically, this action permits instances to send traffic to -// one or more destination IPv4 or IPv6 CIDR address ranges, or to one or more +// the specified destination IPv4 or IPv6 CIDR address ranges, or to the specified // destination security groups for the same VPC. This action doesn't apply to // security groups for use in EC2-Classic. For more information, see Security // Groups for Your VPC (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) @@ -2109,19 +2109,19 @@ func (c *EC2) AuthorizeSecurityGroupIngressRequest(input *AuthorizeSecurityGroup // AuthorizeSecurityGroupIngress API operation for Amazon Elastic Compute Cloud. // -// Adds one or more ingress rules to a security group. +// Adds the specified ingress rules to a security group. // // Rule changes are propagated to instances within the security group as quickly // as possible. However, a small delay might occur. // -// [EC2-Classic] This action gives one or more IPv4 CIDR address ranges permission -// to access a security group in your account, or gives one or more security -// groups (called the source groups) permission to access a security group for -// your account. A source group can be for your own AWS account, or another. -// You can have up to 100 rules per group. +// [EC2-Classic] This action gives the IPv4 CIDR address ranges permission to +// access a security group in your account, or gives the security groups (called +// the source groups) permission to access a security group for your account. +// A source group can be for your own AWS account, or another. You can have +// up to 100 rules per group. // -// [EC2-VPC] This action gives one or more IPv4 or IPv6 CIDR address ranges -// permission to access a security group in your VPC, or gives one or more other +// [EC2-VPC] This action gives the specified IPv4 or IPv6 CIDR address ranges +// permission to access a security group in your VPC, or gives the specified // security groups (called the source groups) permission to access a security // group for your VPC. The security groups must all be for the same VPC or a // peer VPC in a VPC peering connection. For more information about VPC security @@ -3142,7 +3142,7 @@ func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *request.Reques // CopySnapshot API operation for Amazon Elastic Compute Cloud. // // Copies a point-in-time snapshot of an EBS volume and stores it in Amazon -// S3. You can copy the snapshot within the same region or from one region to +// S3. You can copy the snapshot within the same Region or from one Region to // another. You can use the snapshot to create EBS volumes or Amazon Machine // Images (AMIs). The snapshot is copied to the regional endpoint that you send // the HTTP request to. @@ -5160,9 +5160,8 @@ func (c *EC2) CreateReservedInstancesListingRequest(input *CreateReservedInstanc // listing at a time. To get a list of your Standard Reserved Instances, you // can use the DescribeReservedInstances operation. // -// Only Standard Reserved Instances with a capacity reservation can be sold -// in the Reserved Instance Marketplace. Convertible Reserved Instances and -// Standard Reserved Instances with a regional benefit cannot be sold. +// Only Standard Reserved Instances can be sold in the Reserved Instance Marketplace. +// Convertible Reserved Instances cannot be sold. // // The Reserved Instance Marketplace matches sellers who want to resell Standard // Reserved Instance capacity that they no longer need with buyers who want @@ -5806,7 +5805,7 @@ func (c *EC2) CreateTagsRequest(input *CreateTagsInput) (req *request.Request, o // CreateTags API operation for Amazon Elastic Compute Cloud. // -// Adds or overwrites one or more tags for the specified Amazon EC2 resource +// Adds or overwrites the specified tags for the specified Amazon EC2 resource // or resources. Each resource can have a maximum of 50 tags. Each tag consists // of a key and optional value. Tag keys must be unique per resource. // @@ -10168,7 +10167,7 @@ func (c *EC2) DescribeAddressesRequest(input *DescribeAddressesInput) (req *requ // DescribeAddresses API operation for Amazon Elastic Compute Cloud. // -// Describes one or more of your Elastic IP addresses. +// Describes the specified Elastic IP addresses or all of your Elastic IP addresses. // // An Elastic IP address is for use in either the EC2-Classic platform or in // a VPC. For more information, see Elastic IP Addresses (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) @@ -10334,10 +10333,10 @@ func (c *EC2) DescribeAvailabilityZonesRequest(input *DescribeAvailabilityZonesI // DescribeAvailabilityZones API operation for Amazon Elastic Compute Cloud. // -// Describes one or more of the Availability Zones that are available to you. -// The results include zones only for the region you're currently using. If -// there is an event impacting an Availability Zone, you can use this request -// to view the state and any provided message for that Availability Zone. +// Describes the Availability Zones that are available to you. The results include +// zones only for the region you're currently using. If there is an event impacting +// an Availability Zone, you can use this request to view the state and any +// provided message for that Availability Zone. // // For more information, see Regions and Availability Zones (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html) // in the Amazon Elastic Compute Cloud User Guide. @@ -10414,7 +10413,7 @@ func (c *EC2) DescribeBundleTasksRequest(input *DescribeBundleTasksInput) (req * // DescribeBundleTasks API operation for Amazon Elastic Compute Cloud. // -// Describes one or more of your bundling tasks. +// Describes the specified bundle tasks or all of your bundle tasks. // // Completed bundle tasks are listed for only a limited time. If your bundle // task is no longer in the list, you can still register an AMI from it. Just @@ -10480,6 +10479,12 @@ func (c *EC2) DescribeByoipCidrsRequest(input *DescribeByoipCidrsInput) (req *re Name: opDescribeByoipCidrs, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -10526,6 +10531,56 @@ func (c *EC2) DescribeByoipCidrsWithContext(ctx aws.Context, input *DescribeByoi return out, req.Send() } +// DescribeByoipCidrsPages iterates over the pages of a DescribeByoipCidrs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeByoipCidrs 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 DescribeByoipCidrs operation. +// pageNum := 0 +// err := client.DescribeByoipCidrsPages(params, +// func(page *DescribeByoipCidrsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeByoipCidrsPages(input *DescribeByoipCidrsInput, fn func(*DescribeByoipCidrsOutput, bool) bool) error { + return c.DescribeByoipCidrsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeByoipCidrsPagesWithContext same as DescribeByoipCidrsPages 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 *EC2) DescribeByoipCidrsPagesWithContext(ctx aws.Context, input *DescribeByoipCidrsInput, fn func(*DescribeByoipCidrsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeByoipCidrsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeByoipCidrsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeByoipCidrsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeCapacityReservations = "DescribeCapacityReservations" // DescribeCapacityReservationsRequest generates a "aws/request.Request" representing the @@ -10557,6 +10612,12 @@ func (c *EC2) DescribeCapacityReservationsRequest(input *DescribeCapacityReserva Name: opDescribeCapacityReservations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -10601,6 +10662,56 @@ func (c *EC2) DescribeCapacityReservationsWithContext(ctx aws.Context, input *De return out, req.Send() } +// DescribeCapacityReservationsPages iterates over the pages of a DescribeCapacityReservations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeCapacityReservations 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 DescribeCapacityReservations operation. +// pageNum := 0 +// err := client.DescribeCapacityReservationsPages(params, +// func(page *DescribeCapacityReservationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeCapacityReservationsPages(input *DescribeCapacityReservationsInput, fn func(*DescribeCapacityReservationsOutput, bool) bool) error { + return c.DescribeCapacityReservationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeCapacityReservationsPagesWithContext same as DescribeCapacityReservationsPages 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 *EC2) DescribeCapacityReservationsPagesWithContext(ctx aws.Context, input *DescribeCapacityReservationsInput, fn func(*DescribeCapacityReservationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeCapacityReservationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeCapacityReservationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeCapacityReservationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeClassicLinkInstances = "DescribeClassicLinkInstances" // DescribeClassicLinkInstancesRequest generates a "aws/request.Request" representing the @@ -10632,6 +10743,12 @@ func (c *EC2) DescribeClassicLinkInstancesRequest(input *DescribeClassicLinkInst Name: opDescribeClassicLinkInstances, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -10678,6 +10795,56 @@ func (c *EC2) DescribeClassicLinkInstancesWithContext(ctx aws.Context, input *De return out, req.Send() } +// DescribeClassicLinkInstancesPages iterates over the pages of a DescribeClassicLinkInstances operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeClassicLinkInstances 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 DescribeClassicLinkInstances operation. +// pageNum := 0 +// err := client.DescribeClassicLinkInstancesPages(params, +// func(page *DescribeClassicLinkInstancesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeClassicLinkInstancesPages(input *DescribeClassicLinkInstancesInput, fn func(*DescribeClassicLinkInstancesOutput, bool) bool) error { + return c.DescribeClassicLinkInstancesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeClassicLinkInstancesPagesWithContext same as DescribeClassicLinkInstancesPages 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 *EC2) DescribeClassicLinkInstancesPagesWithContext(ctx aws.Context, input *DescribeClassicLinkInstancesInput, fn func(*DescribeClassicLinkInstancesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClassicLinkInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClassicLinkInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClassicLinkInstancesOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeClientVpnAuthorizationRules = "DescribeClientVpnAuthorizationRules" // DescribeClientVpnAuthorizationRulesRequest generates a "aws/request.Request" representing the @@ -10709,6 +10876,12 @@ func (c *EC2) DescribeClientVpnAuthorizationRulesRequest(input *DescribeClientVp Name: opDescribeClientVpnAuthorizationRules, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -10752,6 +10925,56 @@ func (c *EC2) DescribeClientVpnAuthorizationRulesWithContext(ctx aws.Context, in return out, req.Send() } +// DescribeClientVpnAuthorizationRulesPages iterates over the pages of a DescribeClientVpnAuthorizationRules operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeClientVpnAuthorizationRules 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 DescribeClientVpnAuthorizationRules operation. +// pageNum := 0 +// err := client.DescribeClientVpnAuthorizationRulesPages(params, +// func(page *DescribeClientVpnAuthorizationRulesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeClientVpnAuthorizationRulesPages(input *DescribeClientVpnAuthorizationRulesInput, fn func(*DescribeClientVpnAuthorizationRulesOutput, bool) bool) error { + return c.DescribeClientVpnAuthorizationRulesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeClientVpnAuthorizationRulesPagesWithContext same as DescribeClientVpnAuthorizationRulesPages 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 *EC2) DescribeClientVpnAuthorizationRulesPagesWithContext(ctx aws.Context, input *DescribeClientVpnAuthorizationRulesInput, fn func(*DescribeClientVpnAuthorizationRulesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClientVpnAuthorizationRulesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClientVpnAuthorizationRulesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClientVpnAuthorizationRulesOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeClientVpnConnections = "DescribeClientVpnConnections" // DescribeClientVpnConnectionsRequest generates a "aws/request.Request" representing the @@ -10783,6 +11006,12 @@ func (c *EC2) DescribeClientVpnConnectionsRequest(input *DescribeClientVpnConnec Name: opDescribeClientVpnConnections, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -10827,6 +11056,56 @@ func (c *EC2) DescribeClientVpnConnectionsWithContext(ctx aws.Context, input *De return out, req.Send() } +// DescribeClientVpnConnectionsPages iterates over the pages of a DescribeClientVpnConnections operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeClientVpnConnections 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 DescribeClientVpnConnections operation. +// pageNum := 0 +// err := client.DescribeClientVpnConnectionsPages(params, +// func(page *DescribeClientVpnConnectionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeClientVpnConnectionsPages(input *DescribeClientVpnConnectionsInput, fn func(*DescribeClientVpnConnectionsOutput, bool) bool) error { + return c.DescribeClientVpnConnectionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeClientVpnConnectionsPagesWithContext same as DescribeClientVpnConnectionsPages 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 *EC2) DescribeClientVpnConnectionsPagesWithContext(ctx aws.Context, input *DescribeClientVpnConnectionsInput, fn func(*DescribeClientVpnConnectionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClientVpnConnectionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClientVpnConnectionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClientVpnConnectionsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeClientVpnEndpoints = "DescribeClientVpnEndpoints" // DescribeClientVpnEndpointsRequest generates a "aws/request.Request" representing the @@ -10858,6 +11137,12 @@ func (c *EC2) DescribeClientVpnEndpointsRequest(input *DescribeClientVpnEndpoint Name: opDescribeClientVpnEndpoints, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -10901,6 +11186,56 @@ func (c *EC2) DescribeClientVpnEndpointsWithContext(ctx aws.Context, input *Desc return out, req.Send() } +// DescribeClientVpnEndpointsPages iterates over the pages of a DescribeClientVpnEndpoints operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeClientVpnEndpoints 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 DescribeClientVpnEndpoints operation. +// pageNum := 0 +// err := client.DescribeClientVpnEndpointsPages(params, +// func(page *DescribeClientVpnEndpointsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeClientVpnEndpointsPages(input *DescribeClientVpnEndpointsInput, fn func(*DescribeClientVpnEndpointsOutput, bool) bool) error { + return c.DescribeClientVpnEndpointsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeClientVpnEndpointsPagesWithContext same as DescribeClientVpnEndpointsPages 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 *EC2) DescribeClientVpnEndpointsPagesWithContext(ctx aws.Context, input *DescribeClientVpnEndpointsInput, fn func(*DescribeClientVpnEndpointsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClientVpnEndpointsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClientVpnEndpointsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClientVpnEndpointsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeClientVpnRoutes = "DescribeClientVpnRoutes" // DescribeClientVpnRoutesRequest generates a "aws/request.Request" representing the @@ -10932,6 +11267,12 @@ func (c *EC2) DescribeClientVpnRoutesRequest(input *DescribeClientVpnRoutesInput Name: opDescribeClientVpnRoutes, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -10975,6 +11316,56 @@ func (c *EC2) DescribeClientVpnRoutesWithContext(ctx aws.Context, input *Describ return out, req.Send() } +// DescribeClientVpnRoutesPages iterates over the pages of a DescribeClientVpnRoutes operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeClientVpnRoutes 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 DescribeClientVpnRoutes operation. +// pageNum := 0 +// err := client.DescribeClientVpnRoutesPages(params, +// func(page *DescribeClientVpnRoutesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeClientVpnRoutesPages(input *DescribeClientVpnRoutesInput, fn func(*DescribeClientVpnRoutesOutput, bool) bool) error { + return c.DescribeClientVpnRoutesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeClientVpnRoutesPagesWithContext same as DescribeClientVpnRoutesPages 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 *EC2) DescribeClientVpnRoutesPagesWithContext(ctx aws.Context, input *DescribeClientVpnRoutesInput, fn func(*DescribeClientVpnRoutesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClientVpnRoutesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClientVpnRoutesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClientVpnRoutesOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeClientVpnTargetNetworks = "DescribeClientVpnTargetNetworks" // DescribeClientVpnTargetNetworksRequest generates a "aws/request.Request" representing the @@ -11006,6 +11397,12 @@ func (c *EC2) DescribeClientVpnTargetNetworksRequest(input *DescribeClientVpnTar Name: opDescribeClientVpnTargetNetworks, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -11049,6 +11446,56 @@ func (c *EC2) DescribeClientVpnTargetNetworksWithContext(ctx aws.Context, input return out, req.Send() } +// DescribeClientVpnTargetNetworksPages iterates over the pages of a DescribeClientVpnTargetNetworks operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeClientVpnTargetNetworks 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 DescribeClientVpnTargetNetworks operation. +// pageNum := 0 +// err := client.DescribeClientVpnTargetNetworksPages(params, +// func(page *DescribeClientVpnTargetNetworksOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeClientVpnTargetNetworksPages(input *DescribeClientVpnTargetNetworksInput, fn func(*DescribeClientVpnTargetNetworksOutput, bool) bool) error { + return c.DescribeClientVpnTargetNetworksPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeClientVpnTargetNetworksPagesWithContext same as DescribeClientVpnTargetNetworksPages 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 *EC2) DescribeClientVpnTargetNetworksPagesWithContext(ctx aws.Context, input *DescribeClientVpnTargetNetworksInput, fn func(*DescribeClientVpnTargetNetworksOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClientVpnTargetNetworksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClientVpnTargetNetworksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClientVpnTargetNetworksOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeConversionTasks = "DescribeConversionTasks" // DescribeConversionTasksRequest generates a "aws/request.Request" representing the @@ -11312,6 +11759,12 @@ func (c *EC2) DescribeEgressOnlyInternetGatewaysRequest(input *DescribeEgressOnl Name: opDescribeEgressOnlyInternetGateways, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -11355,6 +11808,56 @@ func (c *EC2) DescribeEgressOnlyInternetGatewaysWithContext(ctx aws.Context, inp return out, req.Send() } +// DescribeEgressOnlyInternetGatewaysPages iterates over the pages of a DescribeEgressOnlyInternetGateways operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeEgressOnlyInternetGateways 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 DescribeEgressOnlyInternetGateways operation. +// pageNum := 0 +// err := client.DescribeEgressOnlyInternetGatewaysPages(params, +// func(page *DescribeEgressOnlyInternetGatewaysOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeEgressOnlyInternetGatewaysPages(input *DescribeEgressOnlyInternetGatewaysInput, fn func(*DescribeEgressOnlyInternetGatewaysOutput, bool) bool) error { + return c.DescribeEgressOnlyInternetGatewaysPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeEgressOnlyInternetGatewaysPagesWithContext same as DescribeEgressOnlyInternetGatewaysPages 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 *EC2) DescribeEgressOnlyInternetGatewaysPagesWithContext(ctx aws.Context, input *DescribeEgressOnlyInternetGatewaysInput, fn func(*DescribeEgressOnlyInternetGatewaysOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeEgressOnlyInternetGatewaysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeEgressOnlyInternetGatewaysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeEgressOnlyInternetGatewaysOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeElasticGpus = "DescribeElasticGpus" // DescribeElasticGpusRequest generates a "aws/request.Request" representing the @@ -11684,6 +12187,12 @@ func (c *EC2) DescribeFleetsRequest(input *DescribeFleetsInput) (req *request.Re Name: opDescribeFleets, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -11727,6 +12236,56 @@ func (c *EC2) DescribeFleetsWithContext(ctx aws.Context, input *DescribeFleetsIn return out, req.Send() } +// DescribeFleetsPages iterates over the pages of a DescribeFleets operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeFleets 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 DescribeFleets operation. +// pageNum := 0 +// err := client.DescribeFleetsPages(params, +// func(page *DescribeFleetsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeFleetsPages(input *DescribeFleetsInput, fn func(*DescribeFleetsOutput, bool) bool) error { + return c.DescribeFleetsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeFleetsPagesWithContext same as DescribeFleetsPages 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 *EC2) DescribeFleetsPagesWithContext(ctx aws.Context, input *DescribeFleetsInput, fn func(*DescribeFleetsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeFleetsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeFleetsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeFleetsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeFlowLogs = "DescribeFlowLogs" // DescribeFlowLogsRequest generates a "aws/request.Request" representing the @@ -11758,6 +12317,12 @@ func (c *EC2) DescribeFlowLogsRequest(input *DescribeFlowLogsInput) (req *reques Name: opDescribeFlowLogs, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -11803,6 +12368,56 @@ func (c *EC2) DescribeFlowLogsWithContext(ctx aws.Context, input *DescribeFlowLo return out, req.Send() } +// DescribeFlowLogsPages iterates over the pages of a DescribeFlowLogs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeFlowLogs 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 DescribeFlowLogs operation. +// pageNum := 0 +// err := client.DescribeFlowLogsPages(params, +// func(page *DescribeFlowLogsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeFlowLogsPages(input *DescribeFlowLogsInput, fn func(*DescribeFlowLogsOutput, bool) bool) error { + return c.DescribeFlowLogsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeFlowLogsPagesWithContext same as DescribeFlowLogsPages 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 *EC2) DescribeFlowLogsPagesWithContext(ctx aws.Context, input *DescribeFlowLogsInput, fn func(*DescribeFlowLogsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeFlowLogsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeFlowLogsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeFlowLogsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeFpgaImageAttribute = "DescribeFpgaImageAttribute" // DescribeFpgaImageAttributeRequest generates a "aws/request.Request" representing the @@ -11908,6 +12523,12 @@ func (c *EC2) DescribeFpgaImagesRequest(input *DescribeFpgaImagesInput) (req *re Name: opDescribeFpgaImages, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -11953,6 +12574,56 @@ func (c *EC2) DescribeFpgaImagesWithContext(ctx aws.Context, input *DescribeFpga return out, req.Send() } +// DescribeFpgaImagesPages iterates over the pages of a DescribeFpgaImages operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeFpgaImages 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 DescribeFpgaImages operation. +// pageNum := 0 +// err := client.DescribeFpgaImagesPages(params, +// func(page *DescribeFpgaImagesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeFpgaImagesPages(input *DescribeFpgaImagesInput, fn func(*DescribeFpgaImagesOutput, bool) bool) error { + return c.DescribeFpgaImagesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeFpgaImagesPagesWithContext same as DescribeFpgaImagesPages 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 *EC2) DescribeFpgaImagesPagesWithContext(ctx aws.Context, input *DescribeFpgaImagesInput, fn func(*DescribeFpgaImagesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeFpgaImagesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeFpgaImagesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeFpgaImagesOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeHostReservationOfferings = "DescribeHostReservationOfferings" // DescribeHostReservationOfferingsRequest generates a "aws/request.Request" representing the @@ -11984,6 +12655,12 @@ func (c *EC2) DescribeHostReservationOfferingsRequest(input *DescribeHostReserva Name: opDescribeHostReservationOfferings, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -12035,6 +12712,56 @@ func (c *EC2) DescribeHostReservationOfferingsWithContext(ctx aws.Context, input return out, req.Send() } +// DescribeHostReservationOfferingsPages iterates over the pages of a DescribeHostReservationOfferings operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeHostReservationOfferings 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 DescribeHostReservationOfferings operation. +// pageNum := 0 +// err := client.DescribeHostReservationOfferingsPages(params, +// func(page *DescribeHostReservationOfferingsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeHostReservationOfferingsPages(input *DescribeHostReservationOfferingsInput, fn func(*DescribeHostReservationOfferingsOutput, bool) bool) error { + return c.DescribeHostReservationOfferingsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeHostReservationOfferingsPagesWithContext same as DescribeHostReservationOfferingsPages 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 *EC2) DescribeHostReservationOfferingsPagesWithContext(ctx aws.Context, input *DescribeHostReservationOfferingsInput, fn func(*DescribeHostReservationOfferingsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeHostReservationOfferingsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeHostReservationOfferingsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeHostReservationOfferingsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeHostReservations = "DescribeHostReservations" // DescribeHostReservationsRequest generates a "aws/request.Request" representing the @@ -12066,6 +12793,12 @@ func (c *EC2) DescribeHostReservationsRequest(input *DescribeHostReservationsInp Name: opDescribeHostReservations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -12109,6 +12842,56 @@ func (c *EC2) DescribeHostReservationsWithContext(ctx aws.Context, input *Descri return out, req.Send() } +// DescribeHostReservationsPages iterates over the pages of a DescribeHostReservations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeHostReservations 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 DescribeHostReservations operation. +// pageNum := 0 +// err := client.DescribeHostReservationsPages(params, +// func(page *DescribeHostReservationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeHostReservationsPages(input *DescribeHostReservationsInput, fn func(*DescribeHostReservationsOutput, bool) bool) error { + return c.DescribeHostReservationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeHostReservationsPagesWithContext same as DescribeHostReservationsPages 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 *EC2) DescribeHostReservationsPagesWithContext(ctx aws.Context, input *DescribeHostReservationsInput, fn func(*DescribeHostReservationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeHostReservationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeHostReservationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeHostReservationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeHosts = "DescribeHosts" // DescribeHostsRequest generates a "aws/request.Request" representing the @@ -12140,6 +12923,12 @@ func (c *EC2) DescribeHostsRequest(input *DescribeHostsInput) (req *request.Requ Name: opDescribeHosts, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -12187,6 +12976,56 @@ func (c *EC2) DescribeHostsWithContext(ctx aws.Context, input *DescribeHostsInpu return out, req.Send() } +// DescribeHostsPages iterates over the pages of a DescribeHosts operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeHosts 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 DescribeHosts operation. +// pageNum := 0 +// err := client.DescribeHostsPages(params, +// func(page *DescribeHostsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeHostsPages(input *DescribeHostsInput, fn func(*DescribeHostsOutput, bool) bool) error { + return c.DescribeHostsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeHostsPagesWithContext same as DescribeHostsPages 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 *EC2) DescribeHostsPagesWithContext(ctx aws.Context, input *DescribeHostsInput, fn func(*DescribeHostsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeHostsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeHostsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeHostsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeIamInstanceProfileAssociations = "DescribeIamInstanceProfileAssociations" // DescribeIamInstanceProfileAssociationsRequest generates a "aws/request.Request" representing the @@ -12218,6 +13057,12 @@ func (c *EC2) DescribeIamInstanceProfileAssociationsRequest(input *DescribeIamIn Name: opDescribeIamInstanceProfileAssociations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -12261,6 +13106,56 @@ func (c *EC2) DescribeIamInstanceProfileAssociationsWithContext(ctx aws.Context, return out, req.Send() } +// DescribeIamInstanceProfileAssociationsPages iterates over the pages of a DescribeIamInstanceProfileAssociations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeIamInstanceProfileAssociations 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 DescribeIamInstanceProfileAssociations operation. +// pageNum := 0 +// err := client.DescribeIamInstanceProfileAssociationsPages(params, +// func(page *DescribeIamInstanceProfileAssociationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeIamInstanceProfileAssociationsPages(input *DescribeIamInstanceProfileAssociationsInput, fn func(*DescribeIamInstanceProfileAssociationsOutput, bool) bool) error { + return c.DescribeIamInstanceProfileAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeIamInstanceProfileAssociationsPagesWithContext same as DescribeIamInstanceProfileAssociationsPages 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 *EC2) DescribeIamInstanceProfileAssociationsPagesWithContext(ctx aws.Context, input *DescribeIamInstanceProfileAssociationsInput, fn func(*DescribeIamInstanceProfileAssociationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeIamInstanceProfileAssociationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeIamInstanceProfileAssociationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeIamInstanceProfileAssociationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeIdFormat = "DescribeIdFormat" // DescribeIdFormatRequest generates a "aws/request.Request" representing the @@ -12562,9 +13457,11 @@ func (c *EC2) DescribeImagesRequest(input *DescribeImagesInput) (req *request.Re // DescribeImages API operation for Amazon Elastic Compute Cloud. // -// Describes one or more of the images (AMIs, AKIs, and ARIs) available to you. -// Images available to you include public images, private images that you own, -// and private images owned by other AWS accounts but for which you have explicit +// Describes the specified images (AMIs, AKIs, and ARIs) available to you or +// all of the images available to you. +// +// The images available to you include public images, private images that you +// own, and private images owned by other AWS accounts for which you have explicit // launch permissions. // // Deregistered images are included in the returned results for an unspecified @@ -12629,6 +13526,12 @@ func (c *EC2) DescribeImportImageTasksRequest(input *DescribeImportImageTasksInp Name: opDescribeImportImageTasks, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -12673,6 +13576,56 @@ func (c *EC2) DescribeImportImageTasksWithContext(ctx aws.Context, input *Descri return out, req.Send() } +// DescribeImportImageTasksPages iterates over the pages of a DescribeImportImageTasks operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeImportImageTasks 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 DescribeImportImageTasks operation. +// pageNum := 0 +// err := client.DescribeImportImageTasksPages(params, +// func(page *DescribeImportImageTasksOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeImportImageTasksPages(input *DescribeImportImageTasksInput, fn func(*DescribeImportImageTasksOutput, bool) bool) error { + return c.DescribeImportImageTasksPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeImportImageTasksPagesWithContext same as DescribeImportImageTasksPages 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 *EC2) DescribeImportImageTasksPagesWithContext(ctx aws.Context, input *DescribeImportImageTasksInput, fn func(*DescribeImportImageTasksOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeImportImageTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeImportImageTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeImportImageTasksOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeImportSnapshotTasks = "DescribeImportSnapshotTasks" // DescribeImportSnapshotTasksRequest generates a "aws/request.Request" representing the @@ -12704,6 +13657,12 @@ func (c *EC2) DescribeImportSnapshotTasksRequest(input *DescribeImportSnapshotTa Name: opDescribeImportSnapshotTasks, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -12747,6 +13706,56 @@ func (c *EC2) DescribeImportSnapshotTasksWithContext(ctx aws.Context, input *Des return out, req.Send() } +// DescribeImportSnapshotTasksPages iterates over the pages of a DescribeImportSnapshotTasks operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeImportSnapshotTasks 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 DescribeImportSnapshotTasks operation. +// pageNum := 0 +// err := client.DescribeImportSnapshotTasksPages(params, +// func(page *DescribeImportSnapshotTasksOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeImportSnapshotTasksPages(input *DescribeImportSnapshotTasksInput, fn func(*DescribeImportSnapshotTasksOutput, bool) bool) error { + return c.DescribeImportSnapshotTasksPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeImportSnapshotTasksPagesWithContext same as DescribeImportSnapshotTasksPages 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 *EC2) DescribeImportSnapshotTasksPagesWithContext(ctx aws.Context, input *DescribeImportSnapshotTasksInput, fn func(*DescribeImportSnapshotTasksOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeImportSnapshotTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeImportSnapshotTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeImportSnapshotTasksOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeInstanceAttribute = "DescribeInstanceAttribute" // DescribeInstanceAttributeRequest generates a "aws/request.Request" representing the @@ -12856,6 +13865,12 @@ func (c *EC2) DescribeInstanceCreditSpecificationsRequest(input *DescribeInstanc Name: opDescribeInstanceCreditSpecifications, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -12869,8 +13884,8 @@ func (c *EC2) DescribeInstanceCreditSpecificationsRequest(input *DescribeInstanc // DescribeInstanceCreditSpecifications API operation for Amazon Elastic Compute Cloud. // -// Describes the credit option for CPU usage of one or more of your T2 or T3 -// instances. The credit options are standard and unlimited. +// Describes the credit option for CPU usage of the specified T2 or T3 instances. +// The credit options are standard and unlimited. // // If you do not specify an instance ID, Amazon EC2 returns T2 and T3 instances // with the unlimited credit option, as well as instances that were previously @@ -12922,6 +13937,56 @@ func (c *EC2) DescribeInstanceCreditSpecificationsWithContext(ctx aws.Context, i return out, req.Send() } +// DescribeInstanceCreditSpecificationsPages iterates over the pages of a DescribeInstanceCreditSpecifications operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeInstanceCreditSpecifications 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 DescribeInstanceCreditSpecifications operation. +// pageNum := 0 +// err := client.DescribeInstanceCreditSpecificationsPages(params, +// func(page *DescribeInstanceCreditSpecificationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeInstanceCreditSpecificationsPages(input *DescribeInstanceCreditSpecificationsInput, fn func(*DescribeInstanceCreditSpecificationsOutput, bool) bool) error { + return c.DescribeInstanceCreditSpecificationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeInstanceCreditSpecificationsPagesWithContext same as DescribeInstanceCreditSpecificationsPages 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 *EC2) DescribeInstanceCreditSpecificationsPagesWithContext(ctx aws.Context, input *DescribeInstanceCreditSpecificationsInput, fn func(*DescribeInstanceCreditSpecificationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeInstanceCreditSpecificationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstanceCreditSpecificationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeInstanceCreditSpecificationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeInstanceStatus = "DescribeInstanceStatus" // DescribeInstanceStatusRequest generates a "aws/request.Request" representing the @@ -12972,9 +14037,9 @@ func (c *EC2) DescribeInstanceStatusRequest(input *DescribeInstanceStatusInput) // DescribeInstanceStatus API operation for Amazon Elastic Compute Cloud. // -// Describes the status of one or more instances. By default, only running instances -// are described, unless you specifically indicate to return the status of all -// instances. +// Describes the status of the specified instances or all of your instances. +// By default, only running instances are described, unless you specifically +// indicate to return the status of all instances. // // Instance status includes the following components: // @@ -13123,7 +14188,7 @@ func (c *EC2) DescribeInstancesRequest(input *DescribeInstancesInput) (req *requ // DescribeInstances API operation for Amazon Elastic Compute Cloud. // -// Describes one or more of your instances. +// Describes the specified instances or all of your instances. // // If you specify one or more instance IDs, Amazon EC2 returns information for // those instances. If you do not specify instance IDs, Amazon EC2 returns information @@ -13249,6 +14314,12 @@ func (c *EC2) DescribeInternetGatewaysRequest(input *DescribeInternetGatewaysInp Name: opDescribeInternetGateways, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -13292,6 +14363,56 @@ func (c *EC2) DescribeInternetGatewaysWithContext(ctx aws.Context, input *Descri return out, req.Send() } +// DescribeInternetGatewaysPages iterates over the pages of a DescribeInternetGateways operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeInternetGateways 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 DescribeInternetGateways operation. +// pageNum := 0 +// err := client.DescribeInternetGatewaysPages(params, +// func(page *DescribeInternetGatewaysOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeInternetGatewaysPages(input *DescribeInternetGatewaysInput, fn func(*DescribeInternetGatewaysOutput, bool) bool) error { + return c.DescribeInternetGatewaysPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeInternetGatewaysPagesWithContext same as DescribeInternetGatewaysPages 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 *EC2) DescribeInternetGatewaysPagesWithContext(ctx aws.Context, input *DescribeInternetGatewaysInput, fn func(*DescribeInternetGatewaysOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeInternetGatewaysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInternetGatewaysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeInternetGatewaysOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeKeyPairs = "DescribeKeyPairs" // DescribeKeyPairsRequest generates a "aws/request.Request" representing the @@ -13336,7 +14457,7 @@ func (c *EC2) DescribeKeyPairsRequest(input *DescribeKeyPairsInput) (req *reques // DescribeKeyPairs API operation for Amazon Elastic Compute Cloud. // -// Describes one or more of your key pairs. +// Describes the specified key pairs or all of your key pairs. // // For more information about key pairs, see Key Pairs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) // in the Amazon Elastic Compute Cloud User Guide. @@ -13400,6 +14521,12 @@ func (c *EC2) DescribeLaunchTemplateVersionsRequest(input *DescribeLaunchTemplat Name: opDescribeLaunchTemplateVersions, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -13444,6 +14571,56 @@ func (c *EC2) DescribeLaunchTemplateVersionsWithContext(ctx aws.Context, input * return out, req.Send() } +// DescribeLaunchTemplateVersionsPages iterates over the pages of a DescribeLaunchTemplateVersions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeLaunchTemplateVersions 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 DescribeLaunchTemplateVersions operation. +// pageNum := 0 +// err := client.DescribeLaunchTemplateVersionsPages(params, +// func(page *DescribeLaunchTemplateVersionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeLaunchTemplateVersionsPages(input *DescribeLaunchTemplateVersionsInput, fn func(*DescribeLaunchTemplateVersionsOutput, bool) bool) error { + return c.DescribeLaunchTemplateVersionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeLaunchTemplateVersionsPagesWithContext same as DescribeLaunchTemplateVersionsPages 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 *EC2) DescribeLaunchTemplateVersionsPagesWithContext(ctx aws.Context, input *DescribeLaunchTemplateVersionsInput, fn func(*DescribeLaunchTemplateVersionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeLaunchTemplateVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeLaunchTemplateVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeLaunchTemplateVersionsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeLaunchTemplates = "DescribeLaunchTemplates" // DescribeLaunchTemplatesRequest generates a "aws/request.Request" representing the @@ -13475,6 +14652,12 @@ func (c *EC2) DescribeLaunchTemplatesRequest(input *DescribeLaunchTemplatesInput Name: opDescribeLaunchTemplates, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -13518,6 +14701,56 @@ func (c *EC2) DescribeLaunchTemplatesWithContext(ctx aws.Context, input *Describ return out, req.Send() } +// DescribeLaunchTemplatesPages iterates over the pages of a DescribeLaunchTemplates operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeLaunchTemplates 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 DescribeLaunchTemplates operation. +// pageNum := 0 +// err := client.DescribeLaunchTemplatesPages(params, +// func(page *DescribeLaunchTemplatesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeLaunchTemplatesPages(input *DescribeLaunchTemplatesInput, fn func(*DescribeLaunchTemplatesOutput, bool) bool) error { + return c.DescribeLaunchTemplatesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeLaunchTemplatesPagesWithContext same as DescribeLaunchTemplatesPages 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 *EC2) DescribeLaunchTemplatesPagesWithContext(ctx aws.Context, input *DescribeLaunchTemplatesInput, fn func(*DescribeLaunchTemplatesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeLaunchTemplatesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeLaunchTemplatesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeLaunchTemplatesOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeMovingAddresses = "DescribeMovingAddresses" // DescribeMovingAddressesRequest generates a "aws/request.Request" representing the @@ -13549,6 +14782,12 @@ func (c *EC2) DescribeMovingAddressesRequest(input *DescribeMovingAddressesInput Name: opDescribeMovingAddresses, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -13594,6 +14833,56 @@ func (c *EC2) DescribeMovingAddressesWithContext(ctx aws.Context, input *Describ return out, req.Send() } +// DescribeMovingAddressesPages iterates over the pages of a DescribeMovingAddresses operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeMovingAddresses 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 DescribeMovingAddresses operation. +// pageNum := 0 +// err := client.DescribeMovingAddressesPages(params, +// func(page *DescribeMovingAddressesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeMovingAddressesPages(input *DescribeMovingAddressesInput, fn func(*DescribeMovingAddressesOutput, bool) bool) error { + return c.DescribeMovingAddressesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeMovingAddressesPagesWithContext same as DescribeMovingAddressesPages 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 *EC2) DescribeMovingAddressesPagesWithContext(ctx aws.Context, input *DescribeMovingAddressesInput, fn func(*DescribeMovingAddressesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeMovingAddressesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeMovingAddressesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeMovingAddressesOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeNatGateways = "DescribeNatGateways" // DescribeNatGatewaysRequest generates a "aws/request.Request" representing the @@ -13755,6 +15044,12 @@ func (c *EC2) DescribeNetworkAclsRequest(input *DescribeNetworkAclsInput) (req * Name: opDescribeNetworkAcls, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -13801,6 +15096,56 @@ func (c *EC2) DescribeNetworkAclsWithContext(ctx aws.Context, input *DescribeNet return out, req.Send() } +// DescribeNetworkAclsPages iterates over the pages of a DescribeNetworkAcls operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeNetworkAcls 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 DescribeNetworkAcls operation. +// pageNum := 0 +// err := client.DescribeNetworkAclsPages(params, +// func(page *DescribeNetworkAclsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeNetworkAclsPages(input *DescribeNetworkAclsInput, fn func(*DescribeNetworkAclsOutput, bool) bool) error { + return c.DescribeNetworkAclsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeNetworkAclsPagesWithContext same as DescribeNetworkAclsPages 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 *EC2) DescribeNetworkAclsPagesWithContext(ctx aws.Context, input *DescribeNetworkAclsInput, fn func(*DescribeNetworkAclsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeNetworkAclsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeNetworkAclsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeNetworkAclsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeNetworkInterfaceAttribute = "DescribeNetworkInterfaceAttribute" // DescribeNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the @@ -13907,6 +15252,12 @@ func (c *EC2) DescribeNetworkInterfacePermissionsRequest(input *DescribeNetworkI Name: opDescribeNetworkInterfacePermissions, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -13950,6 +15301,56 @@ func (c *EC2) DescribeNetworkInterfacePermissionsWithContext(ctx aws.Context, in return out, req.Send() } +// DescribeNetworkInterfacePermissionsPages iterates over the pages of a DescribeNetworkInterfacePermissions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeNetworkInterfacePermissions 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 DescribeNetworkInterfacePermissions operation. +// pageNum := 0 +// err := client.DescribeNetworkInterfacePermissionsPages(params, +// func(page *DescribeNetworkInterfacePermissionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeNetworkInterfacePermissionsPages(input *DescribeNetworkInterfacePermissionsInput, fn func(*DescribeNetworkInterfacePermissionsOutput, bool) bool) error { + return c.DescribeNetworkInterfacePermissionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeNetworkInterfacePermissionsPagesWithContext same as DescribeNetworkInterfacePermissionsPages 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 *EC2) DescribeNetworkInterfacePermissionsPagesWithContext(ctx aws.Context, input *DescribeNetworkInterfacePermissionsInput, fn func(*DescribeNetworkInterfacePermissionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeNetworkInterfacePermissionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeNetworkInterfacePermissionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeNetworkInterfacePermissionsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeNetworkInterfaces = "DescribeNetworkInterfaces" // DescribeNetworkInterfacesRequest generates a "aws/request.Request" representing the @@ -14124,8 +15525,8 @@ func (c *EC2) DescribePlacementGroupsRequest(input *DescribePlacementGroupsInput // DescribePlacementGroups API operation for Amazon Elastic Compute Cloud. // -// Describes one or more of your placement groups. For more information, see -// Placement Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) +// Describes the specified placement groups or all of your placement groups. +// For more information, see Placement Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -14187,6 +15588,12 @@ func (c *EC2) DescribePrefixListsRequest(input *DescribePrefixListsInput) (req * Name: opDescribePrefixLists, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -14235,6 +15642,56 @@ func (c *EC2) DescribePrefixListsWithContext(ctx aws.Context, input *DescribePre return out, req.Send() } +// DescribePrefixListsPages iterates over the pages of a DescribePrefixLists operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribePrefixLists 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 DescribePrefixLists operation. +// pageNum := 0 +// err := client.DescribePrefixListsPages(params, +// func(page *DescribePrefixListsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribePrefixListsPages(input *DescribePrefixListsInput, fn func(*DescribePrefixListsOutput, bool) bool) error { + return c.DescribePrefixListsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribePrefixListsPagesWithContext same as DescribePrefixListsPages 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 *EC2) DescribePrefixListsPagesWithContext(ctx aws.Context, input *DescribePrefixListsInput, fn func(*DescribePrefixListsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribePrefixListsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribePrefixListsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribePrefixListsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribePrincipalIdFormat = "DescribePrincipalIdFormat" // DescribePrincipalIdFormatRequest generates a "aws/request.Request" representing the @@ -14266,6 +15723,12 @@ func (c *EC2) DescribePrincipalIdFormatRequest(input *DescribePrincipalIdFormatI Name: opDescribePrincipalIdFormat, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -14323,6 +15786,56 @@ func (c *EC2) DescribePrincipalIdFormatWithContext(ctx aws.Context, input *Descr return out, req.Send() } +// DescribePrincipalIdFormatPages iterates over the pages of a DescribePrincipalIdFormat operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribePrincipalIdFormat 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 DescribePrincipalIdFormat operation. +// pageNum := 0 +// err := client.DescribePrincipalIdFormatPages(params, +// func(page *DescribePrincipalIdFormatOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribePrincipalIdFormatPages(input *DescribePrincipalIdFormatInput, fn func(*DescribePrincipalIdFormatOutput, bool) bool) error { + return c.DescribePrincipalIdFormatPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribePrincipalIdFormatPagesWithContext same as DescribePrincipalIdFormatPages 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 *EC2) DescribePrincipalIdFormatPagesWithContext(ctx aws.Context, input *DescribePrincipalIdFormatInput, fn func(*DescribePrincipalIdFormatOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribePrincipalIdFormatInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribePrincipalIdFormatRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribePrincipalIdFormatOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribePublicIpv4Pools = "DescribePublicIpv4Pools" // DescribePublicIpv4PoolsRequest generates a "aws/request.Request" representing the @@ -14354,6 +15867,12 @@ func (c *EC2) DescribePublicIpv4PoolsRequest(input *DescribePublicIpv4PoolsInput Name: opDescribePublicIpv4Pools, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -14397,6 +15916,56 @@ func (c *EC2) DescribePublicIpv4PoolsWithContext(ctx aws.Context, input *Describ return out, req.Send() } +// DescribePublicIpv4PoolsPages iterates over the pages of a DescribePublicIpv4Pools operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribePublicIpv4Pools 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 DescribePublicIpv4Pools operation. +// pageNum := 0 +// err := client.DescribePublicIpv4PoolsPages(params, +// func(page *DescribePublicIpv4PoolsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribePublicIpv4PoolsPages(input *DescribePublicIpv4PoolsInput, fn func(*DescribePublicIpv4PoolsOutput, bool) bool) error { + return c.DescribePublicIpv4PoolsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribePublicIpv4PoolsPagesWithContext same as DescribePublicIpv4PoolsPages 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 *EC2) DescribePublicIpv4PoolsPagesWithContext(ctx aws.Context, input *DescribePublicIpv4PoolsInput, fn func(*DescribePublicIpv4PoolsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribePublicIpv4PoolsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribePublicIpv4PoolsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribePublicIpv4PoolsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeRegions = "DescribeRegions" // DescribeRegionsRequest generates a "aws/request.Request" representing the @@ -14441,7 +16010,7 @@ func (c *EC2) DescribeRegionsRequest(input *DescribeRegionsInput) (req *request. // DescribeRegions API operation for Amazon Elastic Compute Cloud. // -// Describes one or more regions that are currently available to you. +// Describes the regions that are currently available to you. // // For a list of the regions supported by Amazon EC2, see Regions and Endpoints // (https://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region). @@ -15092,6 +16661,12 @@ func (c *EC2) DescribeScheduledInstanceAvailabilityRequest(input *DescribeSchedu Name: opDescribeScheduledInstanceAvailability, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -15143,6 +16718,56 @@ func (c *EC2) DescribeScheduledInstanceAvailabilityWithContext(ctx aws.Context, return out, req.Send() } +// DescribeScheduledInstanceAvailabilityPages iterates over the pages of a DescribeScheduledInstanceAvailability operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeScheduledInstanceAvailability 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 DescribeScheduledInstanceAvailability operation. +// pageNum := 0 +// err := client.DescribeScheduledInstanceAvailabilityPages(params, +// func(page *DescribeScheduledInstanceAvailabilityOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeScheduledInstanceAvailabilityPages(input *DescribeScheduledInstanceAvailabilityInput, fn func(*DescribeScheduledInstanceAvailabilityOutput, bool) bool) error { + return c.DescribeScheduledInstanceAvailabilityPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeScheduledInstanceAvailabilityPagesWithContext same as DescribeScheduledInstanceAvailabilityPages 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 *EC2) DescribeScheduledInstanceAvailabilityPagesWithContext(ctx aws.Context, input *DescribeScheduledInstanceAvailabilityInput, fn func(*DescribeScheduledInstanceAvailabilityOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeScheduledInstanceAvailabilityInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeScheduledInstanceAvailabilityRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeScheduledInstanceAvailabilityOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeScheduledInstances = "DescribeScheduledInstances" // DescribeScheduledInstancesRequest generates a "aws/request.Request" representing the @@ -15174,6 +16799,12 @@ func (c *EC2) DescribeScheduledInstancesRequest(input *DescribeScheduledInstance Name: opDescribeScheduledInstances, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -15217,6 +16848,56 @@ func (c *EC2) DescribeScheduledInstancesWithContext(ctx aws.Context, input *Desc return out, req.Send() } +// DescribeScheduledInstancesPages iterates over the pages of a DescribeScheduledInstances operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeScheduledInstances 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 DescribeScheduledInstances operation. +// pageNum := 0 +// err := client.DescribeScheduledInstancesPages(params, +// func(page *DescribeScheduledInstancesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeScheduledInstancesPages(input *DescribeScheduledInstancesInput, fn func(*DescribeScheduledInstancesOutput, bool) bool) error { + return c.DescribeScheduledInstancesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeScheduledInstancesPagesWithContext same as DescribeScheduledInstancesPages 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 *EC2) DescribeScheduledInstancesPagesWithContext(ctx aws.Context, input *DescribeScheduledInstancesInput, fn func(*DescribeScheduledInstancesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeScheduledInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeScheduledInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeScheduledInstancesOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeSecurityGroupReferences = "DescribeSecurityGroupReferences" // DescribeSecurityGroupReferencesRequest generates a "aws/request.Request" representing the @@ -15342,7 +17023,7 @@ func (c *EC2) DescribeSecurityGroupsRequest(input *DescribeSecurityGroupsInput) // DescribeSecurityGroups API operation for Amazon Elastic Compute Cloud. // -// Describes one or more of your security groups. +// Describes the specified security groups or all of your security groups. // // A security group is for use with instances either in the EC2-Classic platform // or in a specific VPC. For more information, see Amazon EC2 Security Groups @@ -15557,10 +17238,12 @@ func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *requ // DescribeSnapshots API operation for Amazon Elastic Compute Cloud. // -// Describes one or more of the EBS snapshots available to you. Available snapshots -// include public snapshots available for any AWS account to launch, private -// snapshots that you own, and private snapshots owned by another AWS account -// but for which you've been given explicit create volume permissions. +// Describes the specified EBS snapshots available to you or all of the EBS +// snapshots available to you. +// +// The snapshots available to you include public snapshots, private snapshots +// that you own, and private snapshots owned by other AWS accounts for which +// you have explicit create volume permissions. // // The create volume permissions fall into the following categories: // @@ -16075,6 +17758,12 @@ func (c *EC2) DescribeSpotInstanceRequestsRequest(input *DescribeSpotInstanceReq Name: opDescribeSpotInstanceRequests, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -16134,6 +17823,56 @@ func (c *EC2) DescribeSpotInstanceRequestsWithContext(ctx aws.Context, input *De return out, req.Send() } +// DescribeSpotInstanceRequestsPages iterates over the pages of a DescribeSpotInstanceRequests operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeSpotInstanceRequests 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 DescribeSpotInstanceRequests operation. +// pageNum := 0 +// err := client.DescribeSpotInstanceRequestsPages(params, +// func(page *DescribeSpotInstanceRequestsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeSpotInstanceRequestsPages(input *DescribeSpotInstanceRequestsInput, fn func(*DescribeSpotInstanceRequestsOutput, bool) bool) error { + return c.DescribeSpotInstanceRequestsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeSpotInstanceRequestsPagesWithContext same as DescribeSpotInstanceRequestsPages 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 *EC2) DescribeSpotInstanceRequestsPagesWithContext(ctx aws.Context, input *DescribeSpotInstanceRequestsInput, fn func(*DescribeSpotInstanceRequestsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeSpotInstanceRequestsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeSpotInstanceRequestsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeSpotInstanceRequestsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeSpotPriceHistory = "DescribeSpotPriceHistory" // DescribeSpotPriceHistoryRequest generates a "aws/request.Request" representing the @@ -16302,6 +18041,12 @@ func (c *EC2) DescribeStaleSecurityGroupsRequest(input *DescribeStaleSecurityGro Name: opDescribeStaleSecurityGroups, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -16348,6 +18093,56 @@ func (c *EC2) DescribeStaleSecurityGroupsWithContext(ctx aws.Context, input *Des return out, req.Send() } +// DescribeStaleSecurityGroupsPages iterates over the pages of a DescribeStaleSecurityGroups operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeStaleSecurityGroups 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 DescribeStaleSecurityGroups operation. +// pageNum := 0 +// err := client.DescribeStaleSecurityGroupsPages(params, +// func(page *DescribeStaleSecurityGroupsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeStaleSecurityGroupsPages(input *DescribeStaleSecurityGroupsInput, fn func(*DescribeStaleSecurityGroupsOutput, bool) bool) error { + return c.DescribeStaleSecurityGroupsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeStaleSecurityGroupsPagesWithContext same as DescribeStaleSecurityGroupsPages 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 *EC2) DescribeStaleSecurityGroupsPagesWithContext(ctx aws.Context, input *DescribeStaleSecurityGroupsInput, fn func(*DescribeStaleSecurityGroupsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeStaleSecurityGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeStaleSecurityGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeStaleSecurityGroupsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeSubnets = "DescribeSubnets" // DescribeSubnetsRequest generates a "aws/request.Request" representing the @@ -16475,7 +18270,7 @@ func (c *EC2) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Reques // DescribeTags API operation for Amazon Elastic Compute Cloud. // -// Describes one or more of the tags for your EC2 resources. +// Describes the specified tags for your EC2 resources. // // For more information about tags, see Tagging Your Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) // in the Amazon Elastic Compute Cloud User Guide. @@ -16589,6 +18384,12 @@ func (c *EC2) DescribeTransitGatewayAttachmentsRequest(input *DescribeTransitGat Name: opDescribeTransitGatewayAttachments, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -16635,6 +18436,56 @@ func (c *EC2) DescribeTransitGatewayAttachmentsWithContext(ctx aws.Context, inpu return out, req.Send() } +// DescribeTransitGatewayAttachmentsPages iterates over the pages of a DescribeTransitGatewayAttachments operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeTransitGatewayAttachments 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 DescribeTransitGatewayAttachments operation. +// pageNum := 0 +// err := client.DescribeTransitGatewayAttachmentsPages(params, +// func(page *DescribeTransitGatewayAttachmentsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeTransitGatewayAttachmentsPages(input *DescribeTransitGatewayAttachmentsInput, fn func(*DescribeTransitGatewayAttachmentsOutput, bool) bool) error { + return c.DescribeTransitGatewayAttachmentsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeTransitGatewayAttachmentsPagesWithContext same as DescribeTransitGatewayAttachmentsPages 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 *EC2) DescribeTransitGatewayAttachmentsPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayAttachmentsInput, fn func(*DescribeTransitGatewayAttachmentsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTransitGatewayAttachmentsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTransitGatewayAttachmentsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeTransitGatewayAttachmentsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeTransitGatewayRouteTables = "DescribeTransitGatewayRouteTables" // DescribeTransitGatewayRouteTablesRequest generates a "aws/request.Request" representing the @@ -16666,6 +18517,12 @@ func (c *EC2) DescribeTransitGatewayRouteTablesRequest(input *DescribeTransitGat Name: opDescribeTransitGatewayRouteTables, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -16710,6 +18567,56 @@ func (c *EC2) DescribeTransitGatewayRouteTablesWithContext(ctx aws.Context, inpu return out, req.Send() } +// DescribeTransitGatewayRouteTablesPages iterates over the pages of a DescribeTransitGatewayRouteTables operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeTransitGatewayRouteTables 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 DescribeTransitGatewayRouteTables operation. +// pageNum := 0 +// err := client.DescribeTransitGatewayRouteTablesPages(params, +// func(page *DescribeTransitGatewayRouteTablesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeTransitGatewayRouteTablesPages(input *DescribeTransitGatewayRouteTablesInput, fn func(*DescribeTransitGatewayRouteTablesOutput, bool) bool) error { + return c.DescribeTransitGatewayRouteTablesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeTransitGatewayRouteTablesPagesWithContext same as DescribeTransitGatewayRouteTablesPages 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 *EC2) DescribeTransitGatewayRouteTablesPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayRouteTablesInput, fn func(*DescribeTransitGatewayRouteTablesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTransitGatewayRouteTablesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTransitGatewayRouteTablesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeTransitGatewayRouteTablesOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeTransitGatewayVpcAttachments = "DescribeTransitGatewayVpcAttachments" // DescribeTransitGatewayVpcAttachmentsRequest generates a "aws/request.Request" representing the @@ -16741,6 +18648,12 @@ func (c *EC2) DescribeTransitGatewayVpcAttachmentsRequest(input *DescribeTransit Name: opDescribeTransitGatewayVpcAttachments, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -16785,6 +18698,56 @@ func (c *EC2) DescribeTransitGatewayVpcAttachmentsWithContext(ctx aws.Context, i return out, req.Send() } +// DescribeTransitGatewayVpcAttachmentsPages iterates over the pages of a DescribeTransitGatewayVpcAttachments operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeTransitGatewayVpcAttachments 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 DescribeTransitGatewayVpcAttachments operation. +// pageNum := 0 +// err := client.DescribeTransitGatewayVpcAttachmentsPages(params, +// func(page *DescribeTransitGatewayVpcAttachmentsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeTransitGatewayVpcAttachmentsPages(input *DescribeTransitGatewayVpcAttachmentsInput, fn func(*DescribeTransitGatewayVpcAttachmentsOutput, bool) bool) error { + return c.DescribeTransitGatewayVpcAttachmentsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeTransitGatewayVpcAttachmentsPagesWithContext same as DescribeTransitGatewayVpcAttachmentsPages 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 *EC2) DescribeTransitGatewayVpcAttachmentsPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayVpcAttachmentsInput, fn func(*DescribeTransitGatewayVpcAttachmentsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTransitGatewayVpcAttachmentsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTransitGatewayVpcAttachmentsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeTransitGatewayVpcAttachmentsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeTransitGateways = "DescribeTransitGateways" // DescribeTransitGatewaysRequest generates a "aws/request.Request" representing the @@ -16816,6 +18779,12 @@ func (c *EC2) DescribeTransitGatewaysRequest(input *DescribeTransitGatewaysInput Name: opDescribeTransitGateways, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -16860,6 +18829,56 @@ func (c *EC2) DescribeTransitGatewaysWithContext(ctx aws.Context, input *Describ return out, req.Send() } +// DescribeTransitGatewaysPages iterates over the pages of a DescribeTransitGateways operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeTransitGateways 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 DescribeTransitGateways operation. +// pageNum := 0 +// err := client.DescribeTransitGatewaysPages(params, +// func(page *DescribeTransitGatewaysOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeTransitGatewaysPages(input *DescribeTransitGatewaysInput, fn func(*DescribeTransitGatewaysOutput, bool) bool) error { + return c.DescribeTransitGatewaysPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeTransitGatewaysPagesWithContext same as DescribeTransitGatewaysPages 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 *EC2) DescribeTransitGatewaysPagesWithContext(ctx aws.Context, input *DescribeTransitGatewaysInput, fn func(*DescribeTransitGatewaysOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTransitGatewaysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTransitGatewaysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeTransitGatewaysOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVolumeAttribute = "DescribeVolumeAttribute" // DescribeVolumeAttributeRequest generates a "aws/request.Request" representing the @@ -17153,7 +19172,7 @@ func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *request. // DescribeVolumes API operation for Amazon Elastic Compute Cloud. // -// Describes the specified EBS volumes. +// Describes the specified EBS volumes or all of your EBS volumes. // // If you are describing a long list of volumes, you can paginate the output // to make the list more manageable. The MaxResults parameter sets the maximum @@ -17274,6 +19293,12 @@ func (c *EC2) DescribeVolumesModificationsRequest(input *DescribeVolumesModifica Name: opDescribeVolumesModifications, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -17330,6 +19355,56 @@ func (c *EC2) DescribeVolumesModificationsWithContext(ctx aws.Context, input *De return out, req.Send() } +// DescribeVolumesModificationsPages iterates over the pages of a DescribeVolumesModifications operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVolumesModifications 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 DescribeVolumesModifications operation. +// pageNum := 0 +// err := client.DescribeVolumesModificationsPages(params, +// func(page *DescribeVolumesModificationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVolumesModificationsPages(input *DescribeVolumesModificationsInput, fn func(*DescribeVolumesModificationsOutput, bool) bool) error { + return c.DescribeVolumesModificationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVolumesModificationsPagesWithContext same as DescribeVolumesModificationsPages 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 *EC2) DescribeVolumesModificationsPagesWithContext(ctx aws.Context, input *DescribeVolumesModificationsInput, fn func(*DescribeVolumesModificationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVolumesModificationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVolumesModificationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVolumesModificationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpcAttribute = "DescribeVpcAttribute" // DescribeVpcAttributeRequest generates a "aws/request.Request" representing the @@ -17510,6 +19585,12 @@ func (c *EC2) DescribeVpcClassicLinkDnsSupportRequest(input *DescribeVpcClassicL Name: opDescribeVpcClassicLinkDnsSupport, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -17559,6 +19640,56 @@ func (c *EC2) DescribeVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input return out, req.Send() } +// DescribeVpcClassicLinkDnsSupportPages iterates over the pages of a DescribeVpcClassicLinkDnsSupport operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcClassicLinkDnsSupport 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 DescribeVpcClassicLinkDnsSupport operation. +// pageNum := 0 +// err := client.DescribeVpcClassicLinkDnsSupportPages(params, +// func(page *DescribeVpcClassicLinkDnsSupportOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcClassicLinkDnsSupportPages(input *DescribeVpcClassicLinkDnsSupportInput, fn func(*DescribeVpcClassicLinkDnsSupportOutput, bool) bool) error { + return c.DescribeVpcClassicLinkDnsSupportPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcClassicLinkDnsSupportPagesWithContext same as DescribeVpcClassicLinkDnsSupportPages 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 *EC2) DescribeVpcClassicLinkDnsSupportPagesWithContext(ctx aws.Context, input *DescribeVpcClassicLinkDnsSupportInput, fn func(*DescribeVpcClassicLinkDnsSupportOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcClassicLinkDnsSupportInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcClassicLinkDnsSupportRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVpcClassicLinkDnsSupportOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpcEndpointConnectionNotifications = "DescribeVpcEndpointConnectionNotifications" // DescribeVpcEndpointConnectionNotificationsRequest generates a "aws/request.Request" representing the @@ -17590,6 +19721,12 @@ func (c *EC2) DescribeVpcEndpointConnectionNotificationsRequest(input *DescribeV Name: opDescribeVpcEndpointConnectionNotifications, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -17634,6 +19771,56 @@ func (c *EC2) DescribeVpcEndpointConnectionNotificationsWithContext(ctx aws.Cont return out, req.Send() } +// DescribeVpcEndpointConnectionNotificationsPages iterates over the pages of a DescribeVpcEndpointConnectionNotifications operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcEndpointConnectionNotifications 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 DescribeVpcEndpointConnectionNotifications operation. +// pageNum := 0 +// err := client.DescribeVpcEndpointConnectionNotificationsPages(params, +// func(page *DescribeVpcEndpointConnectionNotificationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcEndpointConnectionNotificationsPages(input *DescribeVpcEndpointConnectionNotificationsInput, fn func(*DescribeVpcEndpointConnectionNotificationsOutput, bool) bool) error { + return c.DescribeVpcEndpointConnectionNotificationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcEndpointConnectionNotificationsPagesWithContext same as DescribeVpcEndpointConnectionNotificationsPages 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 *EC2) DescribeVpcEndpointConnectionNotificationsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointConnectionNotificationsInput, fn func(*DescribeVpcEndpointConnectionNotificationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcEndpointConnectionNotificationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcEndpointConnectionNotificationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVpcEndpointConnectionNotificationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpcEndpointConnections = "DescribeVpcEndpointConnections" // DescribeVpcEndpointConnectionsRequest generates a "aws/request.Request" representing the @@ -17665,6 +19852,12 @@ func (c *EC2) DescribeVpcEndpointConnectionsRequest(input *DescribeVpcEndpointCo Name: opDescribeVpcEndpointConnections, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -17709,6 +19902,56 @@ func (c *EC2) DescribeVpcEndpointConnectionsWithContext(ctx aws.Context, input * return out, req.Send() } +// DescribeVpcEndpointConnectionsPages iterates over the pages of a DescribeVpcEndpointConnections operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcEndpointConnections 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 DescribeVpcEndpointConnections operation. +// pageNum := 0 +// err := client.DescribeVpcEndpointConnectionsPages(params, +// func(page *DescribeVpcEndpointConnectionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcEndpointConnectionsPages(input *DescribeVpcEndpointConnectionsInput, fn func(*DescribeVpcEndpointConnectionsOutput, bool) bool) error { + return c.DescribeVpcEndpointConnectionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcEndpointConnectionsPagesWithContext same as DescribeVpcEndpointConnectionsPages 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 *EC2) DescribeVpcEndpointConnectionsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointConnectionsInput, fn func(*DescribeVpcEndpointConnectionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcEndpointConnectionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcEndpointConnectionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVpcEndpointConnectionsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpcEndpointServiceConfigurations = "DescribeVpcEndpointServiceConfigurations" // DescribeVpcEndpointServiceConfigurationsRequest generates a "aws/request.Request" representing the @@ -17740,6 +19983,12 @@ func (c *EC2) DescribeVpcEndpointServiceConfigurationsRequest(input *DescribeVpc Name: opDescribeVpcEndpointServiceConfigurations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -17783,6 +20032,56 @@ func (c *EC2) DescribeVpcEndpointServiceConfigurationsWithContext(ctx aws.Contex return out, req.Send() } +// DescribeVpcEndpointServiceConfigurationsPages iterates over the pages of a DescribeVpcEndpointServiceConfigurations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcEndpointServiceConfigurations 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 DescribeVpcEndpointServiceConfigurations operation. +// pageNum := 0 +// err := client.DescribeVpcEndpointServiceConfigurationsPages(params, +// func(page *DescribeVpcEndpointServiceConfigurationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcEndpointServiceConfigurationsPages(input *DescribeVpcEndpointServiceConfigurationsInput, fn func(*DescribeVpcEndpointServiceConfigurationsOutput, bool) bool) error { + return c.DescribeVpcEndpointServiceConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcEndpointServiceConfigurationsPagesWithContext same as DescribeVpcEndpointServiceConfigurationsPages 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 *EC2) DescribeVpcEndpointServiceConfigurationsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointServiceConfigurationsInput, fn func(*DescribeVpcEndpointServiceConfigurationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcEndpointServiceConfigurationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcEndpointServiceConfigurationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVpcEndpointServiceConfigurationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpcEndpointServicePermissions = "DescribeVpcEndpointServicePermissions" // DescribeVpcEndpointServicePermissionsRequest generates a "aws/request.Request" representing the @@ -17814,6 +20113,12 @@ func (c *EC2) DescribeVpcEndpointServicePermissionsRequest(input *DescribeVpcEnd Name: opDescribeVpcEndpointServicePermissions, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -17858,6 +20163,56 @@ func (c *EC2) DescribeVpcEndpointServicePermissionsWithContext(ctx aws.Context, return out, req.Send() } +// DescribeVpcEndpointServicePermissionsPages iterates over the pages of a DescribeVpcEndpointServicePermissions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcEndpointServicePermissions 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 DescribeVpcEndpointServicePermissions operation. +// pageNum := 0 +// err := client.DescribeVpcEndpointServicePermissionsPages(params, +// func(page *DescribeVpcEndpointServicePermissionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcEndpointServicePermissionsPages(input *DescribeVpcEndpointServicePermissionsInput, fn func(*DescribeVpcEndpointServicePermissionsOutput, bool) bool) error { + return c.DescribeVpcEndpointServicePermissionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcEndpointServicePermissionsPagesWithContext same as DescribeVpcEndpointServicePermissionsPages 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 *EC2) DescribeVpcEndpointServicePermissionsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointServicePermissionsInput, fn func(*DescribeVpcEndpointServicePermissionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcEndpointServicePermissionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcEndpointServicePermissionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVpcEndpointServicePermissionsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpcEndpointServices = "DescribeVpcEndpointServices" // DescribeVpcEndpointServicesRequest generates a "aws/request.Request" representing the @@ -17963,6 +20318,12 @@ func (c *EC2) DescribeVpcEndpointsRequest(input *DescribeVpcEndpointsInput) (req Name: opDescribeVpcEndpoints, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -18006,6 +20367,56 @@ func (c *EC2) DescribeVpcEndpointsWithContext(ctx aws.Context, input *DescribeVp return out, req.Send() } +// DescribeVpcEndpointsPages iterates over the pages of a DescribeVpcEndpoints operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcEndpoints 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 DescribeVpcEndpoints operation. +// pageNum := 0 +// err := client.DescribeVpcEndpointsPages(params, +// func(page *DescribeVpcEndpointsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcEndpointsPages(input *DescribeVpcEndpointsInput, fn func(*DescribeVpcEndpointsOutput, bool) bool) error { + return c.DescribeVpcEndpointsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcEndpointsPagesWithContext same as DescribeVpcEndpointsPages 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 *EC2) DescribeVpcEndpointsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointsInput, fn func(*DescribeVpcEndpointsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcEndpointsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcEndpointsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVpcEndpointsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpcPeeringConnections = "DescribeVpcPeeringConnections" // DescribeVpcPeeringConnectionsRequest generates a "aws/request.Request" representing the @@ -18037,6 +20448,12 @@ func (c *EC2) DescribeVpcPeeringConnectionsRequest(input *DescribeVpcPeeringConn Name: opDescribeVpcPeeringConnections, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -18080,6 +20497,56 @@ func (c *EC2) DescribeVpcPeeringConnectionsWithContext(ctx aws.Context, input *D return out, req.Send() } +// DescribeVpcPeeringConnectionsPages iterates over the pages of a DescribeVpcPeeringConnections operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcPeeringConnections 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 DescribeVpcPeeringConnections operation. +// pageNum := 0 +// err := client.DescribeVpcPeeringConnectionsPages(params, +// func(page *DescribeVpcPeeringConnectionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcPeeringConnectionsPages(input *DescribeVpcPeeringConnectionsInput, fn func(*DescribeVpcPeeringConnectionsOutput, bool) bool) error { + return c.DescribeVpcPeeringConnectionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcPeeringConnectionsPagesWithContext same as DescribeVpcPeeringConnectionsPages 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 *EC2) DescribeVpcPeeringConnectionsPagesWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, fn func(*DescribeVpcPeeringConnectionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcPeeringConnectionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcPeeringConnectionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVpcPeeringConnectionsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpcs = "DescribeVpcs" // DescribeVpcsRequest generates a "aws/request.Request" representing the @@ -18111,6 +20578,12 @@ func (c *EC2) DescribeVpcsRequest(input *DescribeVpcsInput) (req *request.Reques Name: opDescribeVpcs, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -18154,6 +20627,56 @@ func (c *EC2) DescribeVpcsWithContext(ctx aws.Context, input *DescribeVpcsInput, return out, req.Send() } +// DescribeVpcsPages iterates over the pages of a DescribeVpcs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcs 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 DescribeVpcs operation. +// pageNum := 0 +// err := client.DescribeVpcsPages(params, +// func(page *DescribeVpcsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcsPages(input *DescribeVpcsInput, fn func(*DescribeVpcsOutput, bool) bool) error { + return c.DescribeVpcsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcsPagesWithContext same as DescribeVpcsPages 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 *EC2) DescribeVpcsPagesWithContext(ctx aws.Context, input *DescribeVpcsInput, fn func(*DescribeVpcsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVpcsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpnConnections = "DescribeVpnConnections" // DescribeVpnConnectionsRequest generates a "aws/request.Request" representing the @@ -20696,6 +23219,12 @@ func (c *EC2) GetTransitGatewayAttachmentPropagationsRequest(input *GetTransitGa Name: opGetTransitGatewayAttachmentPropagations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -20740,6 +23269,56 @@ func (c *EC2) GetTransitGatewayAttachmentPropagationsWithContext(ctx aws.Context return out, req.Send() } +// GetTransitGatewayAttachmentPropagationsPages iterates over the pages of a GetTransitGatewayAttachmentPropagations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetTransitGatewayAttachmentPropagations 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 GetTransitGatewayAttachmentPropagations operation. +// pageNum := 0 +// err := client.GetTransitGatewayAttachmentPropagationsPages(params, +// func(page *GetTransitGatewayAttachmentPropagationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) GetTransitGatewayAttachmentPropagationsPages(input *GetTransitGatewayAttachmentPropagationsInput, fn func(*GetTransitGatewayAttachmentPropagationsOutput, bool) bool) error { + return c.GetTransitGatewayAttachmentPropagationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetTransitGatewayAttachmentPropagationsPagesWithContext same as GetTransitGatewayAttachmentPropagationsPages 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 *EC2) GetTransitGatewayAttachmentPropagationsPagesWithContext(ctx aws.Context, input *GetTransitGatewayAttachmentPropagationsInput, fn func(*GetTransitGatewayAttachmentPropagationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetTransitGatewayAttachmentPropagationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetTransitGatewayAttachmentPropagationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetTransitGatewayAttachmentPropagationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opGetTransitGatewayRouteTableAssociations = "GetTransitGatewayRouteTableAssociations" // GetTransitGatewayRouteTableAssociationsRequest generates a "aws/request.Request" representing the @@ -20771,6 +23350,12 @@ func (c *EC2) GetTransitGatewayRouteTableAssociationsRequest(input *GetTransitGa Name: opGetTransitGatewayRouteTableAssociations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -20815,6 +23400,56 @@ func (c *EC2) GetTransitGatewayRouteTableAssociationsWithContext(ctx aws.Context return out, req.Send() } +// GetTransitGatewayRouteTableAssociationsPages iterates over the pages of a GetTransitGatewayRouteTableAssociations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetTransitGatewayRouteTableAssociations 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 GetTransitGatewayRouteTableAssociations operation. +// pageNum := 0 +// err := client.GetTransitGatewayRouteTableAssociationsPages(params, +// func(page *GetTransitGatewayRouteTableAssociationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) GetTransitGatewayRouteTableAssociationsPages(input *GetTransitGatewayRouteTableAssociationsInput, fn func(*GetTransitGatewayRouteTableAssociationsOutput, bool) bool) error { + return c.GetTransitGatewayRouteTableAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetTransitGatewayRouteTableAssociationsPagesWithContext same as GetTransitGatewayRouteTableAssociationsPages 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 *EC2) GetTransitGatewayRouteTableAssociationsPagesWithContext(ctx aws.Context, input *GetTransitGatewayRouteTableAssociationsInput, fn func(*GetTransitGatewayRouteTableAssociationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetTransitGatewayRouteTableAssociationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetTransitGatewayRouteTableAssociationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetTransitGatewayRouteTableAssociationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opGetTransitGatewayRouteTablePropagations = "GetTransitGatewayRouteTablePropagations" // GetTransitGatewayRouteTablePropagationsRequest generates a "aws/request.Request" representing the @@ -20846,6 +23481,12 @@ func (c *EC2) GetTransitGatewayRouteTablePropagationsRequest(input *GetTransitGa Name: opGetTransitGatewayRouteTablePropagations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -20890,6 +23531,56 @@ func (c *EC2) GetTransitGatewayRouteTablePropagationsWithContext(ctx aws.Context return out, req.Send() } +// GetTransitGatewayRouteTablePropagationsPages iterates over the pages of a GetTransitGatewayRouteTablePropagations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetTransitGatewayRouteTablePropagations 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 GetTransitGatewayRouteTablePropagations operation. +// pageNum := 0 +// err := client.GetTransitGatewayRouteTablePropagationsPages(params, +// func(page *GetTransitGatewayRouteTablePropagationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) GetTransitGatewayRouteTablePropagationsPages(input *GetTransitGatewayRouteTablePropagationsInput, fn func(*GetTransitGatewayRouteTablePropagationsOutput, bool) bool) error { + return c.GetTransitGatewayRouteTablePropagationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetTransitGatewayRouteTablePropagationsPagesWithContext same as GetTransitGatewayRouteTablePropagationsPages 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 *EC2) GetTransitGatewayRouteTablePropagationsPagesWithContext(ctx aws.Context, input *GetTransitGatewayRouteTablePropagationsInput, fn func(*GetTransitGatewayRouteTablePropagationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetTransitGatewayRouteTablePropagationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetTransitGatewayRouteTablePropagationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetTransitGatewayRouteTablePropagationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opImportClientVpnClientCertificateRevocationList = "ImportClientVpnClientCertificateRevocationList" // ImportClientVpnClientCertificateRevocationListRequest generates a "aws/request.Request" representing the @@ -22263,6 +24954,80 @@ func (c *EC2) ModifyInstanceCreditSpecificationWithContext(ctx aws.Context, inpu return out, req.Send() } +const opModifyInstanceEventStartTime = "ModifyInstanceEventStartTime" + +// ModifyInstanceEventStartTimeRequest generates a "aws/request.Request" representing the +// client's request for the ModifyInstanceEventStartTime 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 ModifyInstanceEventStartTime for more information on using the ModifyInstanceEventStartTime +// 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 ModifyInstanceEventStartTimeRequest method. +// req, resp := client.ModifyInstanceEventStartTimeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceEventStartTime +func (c *EC2) ModifyInstanceEventStartTimeRequest(input *ModifyInstanceEventStartTimeInput) (req *request.Request, output *ModifyInstanceEventStartTimeOutput) { + op := &request.Operation{ + Name: opModifyInstanceEventStartTime, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyInstanceEventStartTimeInput{} + } + + output = &ModifyInstanceEventStartTimeOutput{} + req = c.newRequest(op, input, output) + return +} + +// ModifyInstanceEventStartTime API operation for Amazon Elastic Compute Cloud. +// +// Modifies the start time for a scheduled Amazon EC2 instance event. +// +// 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 Compute Cloud's +// API operation ModifyInstanceEventStartTime for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceEventStartTime +func (c *EC2) ModifyInstanceEventStartTime(input *ModifyInstanceEventStartTimeInput) (*ModifyInstanceEventStartTimeOutput, error) { + req, out := c.ModifyInstanceEventStartTimeRequest(input) + return out, req.Send() +} + +// ModifyInstanceEventStartTimeWithContext is the same as ModifyInstanceEventStartTime with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyInstanceEventStartTime 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 *EC2) ModifyInstanceEventStartTimeWithContext(ctx aws.Context, input *ModifyInstanceEventStartTimeInput, opts ...request.Option) (*ModifyInstanceEventStartTimeOutput, error) { + req, out := c.ModifyInstanceEventStartTimeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opModifyInstancePlacement = "ModifyInstancePlacement" // ModifyInstancePlacementRequest generates a "aws/request.Request" representing the @@ -22480,7 +25245,8 @@ func (c *EC2) ModifyNetworkInterfaceAttributeRequest(input *ModifyNetworkInterfa // ModifyNetworkInterfaceAttribute API operation for Amazon Elastic Compute Cloud. // // Modifies the specified network interface attribute. You can specify only -// one attribute at a time. +// one attribute at a time. You can use this action to attach and detach security +// groups from an existing 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 @@ -24214,7 +26980,7 @@ func (c *EC2) RebootInstancesRequest(input *RebootInstancesInput) (req *request. // RebootInstances API operation for Amazon Elastic Compute Cloud. // -// Requests a reboot of one or more instances. This operation is asynchronous; +// Requests a reboot of the specified instances. This operation is asynchronous; // it only queues a request to reboot the specified instances. The operation // succeeds if the instances are valid and belong to you. Requests to reboot // terminated instances are ignored. @@ -26080,7 +28846,7 @@ func (c *EC2) RevokeSecurityGroupEgressRequest(input *RevokeSecurityGroupEgressI // RevokeSecurityGroupEgress API operation for Amazon Elastic Compute Cloud. // -// [EC2-VPC only] Removes one or more egress rules from a security group for +// [EC2-VPC only] Removes the specified egress rules from a security group for // EC2-VPC. This action doesn't apply to security groups for use in EC2-Classic. // To remove a rule, the values that you specify (for example, ports) must match // the existing rule's values exactly. @@ -26167,7 +28933,7 @@ func (c *EC2) RevokeSecurityGroupIngressRequest(input *RevokeSecurityGroupIngres // RevokeSecurityGroupIngress API operation for Amazon Elastic Compute Cloud. // -// Removes one or more ingress rules from a security group. To remove a rule, +// Removes the specified ingress rules from a security group. To remove a rule, // the values that you specify (for example, ports) must match the existing // rule's values exactly. // @@ -26830,8 +29596,8 @@ func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *re // TerminateInstances API operation for Amazon Elastic Compute Cloud. // -// Shuts down one or more instances. This operation is idempotent; if you terminate -// an instance more than once, each call succeeds. +// Shuts down the specified instances. This operation is idempotent; if you +// terminate an instance more than once, each call succeeds. // // If you specify multiple instances and the request fails (for example, because // of a single incorrect instance ID), none of the instances are terminated. @@ -27672,7 +30438,7 @@ type AccountAttribute struct { // The name of the account attribute. AttributeName *string `locationName:"attributeName" type:"string"` - // One or more values for the account attribute. + // The values for the account attribute. AttributeValues []*AccountAttributeValue `locationName:"attributeValueSet" locationNameList:"item" type:"list"` } @@ -30002,8 +32768,8 @@ type AuthorizeSecurityGroupEgressInput struct { // GroupId is a required field GroupId *string `locationName:"groupId" type:"string" required:"true"` - // One or more sets of IP permissions. You can't specify a destination security - // group and a CIDR IP address range in the same set of permissions. + // The sets of IP permissions. You can't specify a destination security group + // and a CIDR IP address range in the same set of permissions. IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` // Not supported. Use a set of IP permissions to specify the protocol name or @@ -30140,8 +32906,8 @@ type AuthorizeSecurityGroupIngressInput struct { // either the security group ID or the security group name in the request. GroupName *string `type:"string"` - // One or more sets of IP permissions. Can be used to specify multiple rules - // in a single command. + // The sets of IP permissions. Can be used to specify multiple rules in a single + // command. IpPermissions []*IpPermission `locationNameList:"item" type:"list"` // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). @@ -31868,7 +34634,10 @@ func (s *CertificateAuthenticationRequest) SetClientRootCertificateChainArn(v st } // Provides authorization for Amazon to bring a specific IP address range to -// a specific AWS account using bring your own IP addresses (BYOIP). +// a specific AWS account using bring your own IP addresses (BYOIP). For more +// information, see Prepare to Bring Your Address Range to Your AWS Account +// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#prepare-for-byoip) +// in the Amazon Elastic Compute Cloud User Guide. type CidrAuthorizationContext struct { _ struct{} `type:"structure"` @@ -32178,8 +34947,8 @@ func (s *ClientData) SetUploadStart(v time.Time) *ClientData { // Describes the authentication methods used by a Client VPN endpoint. Client // VPN supports Active Directory and mutual authentication. For more information, -// see Authentication (vpn/latest/clientvpn-admin/authentication-authrization.html#client-authentication) -// in the AWS Client VPN Admin Guide. +// see Authentication (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/authentication-authrization.html#client-authentication) +// in the AWS Client VPN Administrator Guide. type ClientVpnAuthentication struct { _ struct{} `type:"structure"` @@ -32223,8 +34992,8 @@ func (s *ClientVpnAuthentication) SetType(v string) *ClientVpnAuthentication { // Describes the authentication method to be used by a Client VPN endpoint. // Client VPN supports Active Directory and mutual authentication. For more -// information, see Authentication (vpn/latest/clientvpn-admin/authentication-authrization.html#client-authentication) -// in the AWS Client VPN Admin Guide. +// information, see Authentication (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/authentication-authrization.html#client-authentication) +// in the AWS Client VPN Administrator Guide. type ClientVpnAuthenticationRequest struct { _ struct{} `type:"structure"` @@ -33293,7 +36062,9 @@ type CopyImageInput struct { // // * Key ID // - // * Key alias, in the form alias/ExampleAlias + // * Key alias. The alias ARN contains the arn:aws:kms namespace, followed + // by the region of the CMK, the AWS account ID of the CMK owner, the alias + // namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. // // * ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed // by the region of the CMK, the AWS account ID of the CMK owner, the key @@ -33437,13 +36208,13 @@ type CopySnapshotInput struct { // A description for the EBS snapshot. Description *string `type:"string"` - // The destination region to use in the PresignedUrl parameter of a snapshot + // The destination Region to use in the PresignedUrl parameter of a snapshot // copy operation. This parameter is only valid for specifying the destination - // region in a PresignedUrl parameter, where it is required. + // Region in a PresignedUrl parameter, where it is required. // // The snapshot copy is sent to the regional endpoint that you sent the HTTP // request to (for example, ec2.us-east-1.amazonaws.com). With the AWS CLI, - // this is specified using the --region parameter or the default region in your + // this is specified using the --region parameter or the default Region in your // AWS configuration file. DestinationRegion *string `locationName:"destinationRegion" type:"string"` @@ -33471,7 +36242,9 @@ type CopySnapshotInput struct { // // * Key ID // - // * Key alias + // * Key alias. The alias ARN contains the arn:aws:kms namespace, followed + // by the region of the CMK, the AWS account ID of the CMK owner, the alias + // namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. // // * ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed // by the region of the CMK, the AWS account ID of the CMK owner, the key @@ -33503,7 +36276,7 @@ type CopySnapshotInput struct { // and the snapshot will move to an error state. PresignedUrl *string `locationName:"presignedUrl" type:"string"` - // The ID of the region that contains the snapshot to be copied. + // The ID of the Region that contains the snapshot to be copied. // // SourceRegion is a required field SourceRegion *string `type:"string" required:"true"` @@ -33970,7 +36743,7 @@ type CreateClientVpnEndpointInput struct { DryRun *bool `type:"boolean"` // The ARN of the server certificate. For more information, see the AWS Certificate - // Manager User Guide (acm/latest/userguide/acm-overview.html) . + // Manager User Guide (https://docs.aws.amazon.com/acm/latest/userguide/). // // ServerCertificateArn is a required field ServerCertificateArn *string `type:"string" required:"true"` @@ -34752,7 +37525,7 @@ type CreateFleetInput struct { // The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). // At this point, no new EC2 Fleet requests are placed or able to fulfill the - // request. The default end date is 7 days from the current date. + // request. If no value is specified, the request remains until you cancel it. ValidUntil *time.Time `type:"timestamp"` } @@ -35287,13 +38060,12 @@ func (s *CreateFpgaImageOutput) SetFpgaImageId(v string) *CreateFpgaImageOutput return s } -// Contains the parameters for CreateImage. type CreateImageInput struct { _ struct{} `type:"structure"` - // Information about one or more block device mappings. This parameter cannot - // be used to modify the encryption status of existing volumes or snapshots. - // To create an AMI with encrypted snapshots, use the CopyImage action. + // Tthe block device mappings. This parameter cannot be used to modify the encryption + // status of existing volumes or snapshots. To create an AMI with encrypted + // snapshots, use the CopyImage action. BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` // A description for the new image. @@ -35388,7 +38160,6 @@ func (s *CreateImageInput) SetNoReboot(v bool) *CreateImageInput { return s } -// Contains the output of CreateImage. type CreateImageOutput struct { _ struct{} `type:"structure"` @@ -37298,7 +40069,7 @@ type CreateTagsInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The IDs of one or more resources, separated by spaces. + // The IDs of the resources, separated by spaces. // // Constraints: Up to 1000 resource IDs. We recommend breaking up this request // into smaller batches. @@ -37818,8 +40589,8 @@ type CreateVolumeInput struct { // The number of I/O operations per second (IOPS) to provision for the volume, // with a maximum ratio of 50 IOPS/GiB. Range is 100 to 64,000 IOPS for volumes - // in most regions. Maximum IOPS of 64,000 is guaranteed only on Nitro-based - // instances (AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). + // in most Regions. Maximum IOPS of 64,000 is guaranteed only on Nitro-based + // instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). // Other instance families guarantee performance up to 32,000 IOPS. For more // information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) // in the Amazon Elastic Compute Cloud User Guide. @@ -37837,7 +40608,9 @@ type CreateVolumeInput struct { // // * Key ID // - // * Key alias + // * Key alias. The alias ARN contains the arn:aws:kms namespace, followed + // by the region of the CMK, the AWS account ID of the CMK owner, the alias + // namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. // // * ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed // by the region of the CMK, the AWS account ID of the CMK owner, the key @@ -37881,7 +40654,7 @@ type CreateVolumeInput struct { // Defaults: If no volume type is specified, the default is standard in us-east-1, // eu-west-1, eu-central-1, us-west-2, us-west-1, sa-east-1, ap-northeast-1, // ap-northeast-2, ap-southeast-1, ap-southeast-2, ap-south-1, us-gov-west-1, - // and cn-north-1. In all other regions, EBS defaults to gp2. + // and cn-north-1. In all other Regions, EBS defaults to gp2. VolumeType *string `type:"string" enum:"VolumeType"` } @@ -37962,17 +40735,15 @@ func (s *CreateVolumeInput) SetVolumeType(v string) *CreateVolumeInput { return s } -// Describes the user or group to be added or removed from the permissions for -// a volume. +// Describes the user or group to be added or removed from the list of create +// volume permissions for a volume. type CreateVolumePermission struct { _ struct{} `type:"structure"` - // The specific group that is to be added or removed from a volume's list of - // create volume permissions. + // The group to be added or removed. The possible value is all. Group *string `locationName:"group" type:"string" enum:"PermissionGroup"` - // The specific AWS account ID that is to be added or removed from a volume's - // list of create volume permissions. + // The AWS account ID to be added or removed. UserId *string `locationName:"userId" type:"string"` } @@ -37998,16 +40769,14 @@ func (s *CreateVolumePermission) SetUserId(v string) *CreateVolumePermission { return s } -// Describes modifications to the permissions for a volume. +// Describes modifications to the list of create volume permissions for a volume. type CreateVolumePermissionModifications struct { _ struct{} `type:"structure"` - // Adds a specific AWS account ID or group to a volume's list of create volume - // permissions. + // Adds the specified AWS account ID or group to the list. Add []*CreateVolumePermission `locationNameList:"item" type:"list"` - // Removes a specific AWS account ID or group from a volume's list of create - // volume permissions. + // Removes the specified AWS account ID or group from the list. Remove []*CreateVolumePermission `locationNameList:"item" type:"list"` } @@ -38173,10 +40942,9 @@ type CreateVpcEndpointInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // (Gateway endpoint) A policy to attach to the endpoint that controls access - // to the service. The policy must be in valid JSON format. If this parameter - // is not specified, we attach a default policy that allows full access to the - // service. + // A policy to attach to the endpoint that controls access to the service. The + // policy must be in valid JSON format. If this parameter is not specified, + // we attach a default policy that allows full access to the service. PolicyDocument *string `type:"string"` // (Interface endpoint) Indicate whether to associate a private hosted zone @@ -41004,7 +43772,7 @@ type DeleteTagsInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The IDs of one or more resources, separated by spaces. + // The IDs of the resources, separated by spaces. // // Constraints: Up to 1000 resource IDs. We recommend breaking up this request // into smaller batches. @@ -42146,7 +44914,7 @@ func (s DeregisterImageOutput) GoString() string { type DescribeAccountAttributesInput struct { _ struct{} `type:"structure"` - // One or more account attribute names. + // The account attribute names. AttributeNames []*string `locationName:"attributeName" locationNameList:"attributeName" type:"list"` // Checks whether you have the required permissions for the action, without @@ -42181,7 +44949,7 @@ func (s *DescribeAccountAttributesInput) SetDryRun(v bool) *DescribeAccountAttri type DescribeAccountAttributesOutput struct { _ struct{} `type:"structure"` - // Information about one or more account attributes. + // Information about the account attributes. AccountAttributes []*AccountAttribute `locationName:"accountAttributeSet" locationNameList:"item" type:"list"` } @@ -42204,9 +44972,7 @@ func (s *DescribeAccountAttributesOutput) SetAccountAttributes(v []*AccountAttri type DescribeAddressesInput struct { _ struct{} `type:"structure"` - // [EC2-VPC] One or more allocation IDs. - // - // Default: Describes all your Elastic IP addresses. + // [EC2-VPC] Information about the allocation IDs. AllocationIds []*string `locationName:"AllocationId" locationNameList:"AllocationId" type:"list"` // Checks whether you have the required permissions for the action, without @@ -42291,7 +45057,7 @@ func (s *DescribeAddressesInput) SetPublicIps(v []*string) *DescribeAddressesInp type DescribeAddressesOutput struct { _ struct{} `type:"structure"` - // Information about one or more Elastic IP addresses. + // Information about the Elastic IP addresses. Addresses []*Address `locationName:"addressesSet" locationNameList:"item" type:"list"` } @@ -42380,7 +45146,7 @@ type DescribeAvailabilityZonesInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more filters. + // The filters. // // * message - Information about the Availability Zone. // @@ -42395,10 +45161,10 @@ type DescribeAvailabilityZonesInput struct { // * zone-name - The name of the Availability Zone (for example, us-east-1a). Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The IDs of one or more Availability Zones. + // The IDs of the Availability Zones. ZoneIds []*string `locationName:"ZoneId" locationNameList:"ZoneId" type:"list"` - // The names of one or more Availability Zones. + // The names of the Availability Zones. ZoneNames []*string `locationName:"ZoneName" locationNameList:"ZoneName" type:"list"` } @@ -42439,7 +45205,7 @@ func (s *DescribeAvailabilityZonesInput) SetZoneNames(v []*string) *DescribeAvai type DescribeAvailabilityZonesOutput struct { _ struct{} `type:"structure"` - // Information about one or more Availability Zones. + // Information about the Availability Zones. AvailabilityZones []*AvailabilityZone `locationName:"availabilityZoneInfo" locationNameList:"item" type:"list"` } @@ -42459,7 +45225,6 @@ func (s *DescribeAvailabilityZonesOutput) SetAvailabilityZones(v []*Availability return s } -// Contains the parameters for DescribeBundleTasks. type DescribeBundleTasksInput struct { _ struct{} `type:"structure"` @@ -42528,11 +45293,10 @@ func (s *DescribeBundleTasksInput) SetFilters(v []*Filter) *DescribeBundleTasksI return s } -// Contains the output of DescribeBundleTasks. type DescribeBundleTasksOutput struct { _ struct{} `type:"structure"` - // Information about one or more bundle tasks. + // Information about the bundle tasks. BundleTasks []*BundleTask `locationName:"bundleInstanceTasksSet" locationNameList:"item" type:"list"` } @@ -42782,17 +45546,13 @@ type DescribeClassicLinkInstancesInput struct { // One or more instance IDs. Must be instances linked to a VPC through ClassicLink. InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` - // The maximum number of results to return for the request in a single page. - // The remaining results of the initial request can be seen by sending another - // request with the returned NextToken value. This value can be between 5 and - // 1000. If MaxResults is given a value larger than 1000, only 1000 results - // are returned. You cannot specify this parameter and the instance IDs parameter - // in the same request. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. // // Constraint: If the value is greater than 1000, we return only 1000 items. MaxResults *int64 `locationName:"maxResults" type:"integer"` - // The token to retrieve the next page of results. + // The token for the next page of results. NextToken *string `locationName:"nextToken" type:"string"` } @@ -43717,13 +46477,11 @@ type DescribeEgressOnlyInternetGatewaysInput struct { // One or more egress-only internet gateway IDs. EgressOnlyInternetGatewayIds []*string `locationName:"EgressOnlyInternetGatewayId" locationNameList:"item" type:"list"` - // The maximum number of results to return for the request in a single page. - // The remaining results can be seen by sending another request with the returned - // NextToken value. This value can be between 5 and 1000. If MaxResults is given - // a value larger than 1000, only 1000 results are returned. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. MaxResults *int64 `type:"integer"` - // The token to retrieve the next page of results. + // The token for the next page of results. NextToken *string `type:"string"` } @@ -43767,7 +46525,8 @@ type DescribeEgressOnlyInternetGatewaysOutput struct { // Information about the egress-only internet gateways. EgressOnlyInternetGateways []*EgressOnlyInternetGateway `locationName:"egressOnlyInternetGatewaySet" locationNameList:"item" type:"list"` - // The token to use to retrieve the next page of results. + // The token to use 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"` } @@ -44500,14 +47259,11 @@ type DescribeFlowLogsInput struct { // One or more flow log IDs. FlowLogIds []*string `locationName:"FlowLogId" locationNameList:"item" type:"list"` - // The maximum number of results to return for the request in a single page. - // The remaining results can be seen by sending another request with the returned - // NextToken value. This value can be between 5 and 1000. If MaxResults is given - // a value larger than 1000, only 1000 results are returned. You cannot specify - // this parameter and the flow log IDs parameter in the same request. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. MaxResults *int64 `type:"integer"` - // The token to retrieve the next page of results. + // The token for the next page of results. NextToken *string `type:"string"` } @@ -44843,7 +47599,7 @@ type DescribeHostReservationOfferingsInput struct { // The remaining results can be seen by sending another request with the returned // nextToken value. This value can be between 5 and 500. If maxResults is given // a larger value than 500, you receive an error. - MaxResults *int64 `type:"integer"` + MaxResults *int64 `min:"5" type:"integer"` // This is the minimum duration of the reservation you'd like to purchase, specified // in seconds. Reservations are available in one-year and three-year terms. @@ -44869,6 +47625,19 @@ func (s DescribeHostReservationOfferingsInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeHostReservationOfferingsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeHostReservationOfferingsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetFilter sets the Filter field's value. func (s *DescribeHostReservationOfferingsInput) SetFilter(v []*Filter) *DescribeHostReservationOfferingsInput { s.Filter = v @@ -44949,6 +47718,16 @@ type DescribeHostReservationsInput struct { // // * state - The state of the reservation (payment-pending | payment-failed // | active | retired). + // + // * tag: - The key/value combination of a tag assigned to the resource. + // Use the tag key in the filter name and the tag value as the filter value. + // For example, to find all resources that have a tag with the key Owner + // and the value TeamA, specify tag:Owner for the filter name and TeamA for + // the filter value. + // + // * tag-key - The key of a tag assigned to the resource. Use this filter + // to find all resources assigned a tag with a specific key, regardless of + // the tag value. Filter []*Filter `locationNameList:"Filter" type:"list"` // One or more host reservation IDs. @@ -45529,7 +48308,6 @@ func (s *DescribeImageAttributeOutput) SetSriovNetSupport(v *AttributeValue) *De return s } -// Contains the parameters for DescribeImages. type DescribeImagesInput struct { _ struct{} `type:"structure"` @@ -45677,11 +48455,10 @@ func (s *DescribeImagesInput) SetOwners(v []*string) *DescribeImagesInput { return s } -// Contains the output of DescribeImages. type DescribeImagesOutput struct { _ struct{} `type:"structure"` - // Information about one or more images. + // Information about the images. Images []*Image `locationName:"imagesSet" locationNameList:"item" type:"list"` } @@ -46130,12 +48907,12 @@ type DescribeInstanceCreditSpecificationsInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // One or more filters. + // The filters. // // * instance-id - The ID of the instance. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // One or more instance IDs. + // The instance IDs. // // Default: Describes all your instances. // @@ -46146,7 +48923,7 @@ type DescribeInstanceCreditSpecificationsInput struct { // remaining results, make another call with the returned NextToken value. This // value can be between 5 and 1000. You cannot specify this parameter and the // instance IDs parameter in the same call. - MaxResults *int64 `type:"integer"` + MaxResults *int64 `min:"5" type:"integer"` // The token to retrieve the next page of results. NextToken *string `type:"string"` @@ -46162,6 +48939,19 @@ func (s DescribeInstanceCreditSpecificationsInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeInstanceCreditSpecificationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeInstanceCreditSpecificationsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetDryRun sets the DryRun field's value. func (s *DescribeInstanceCreditSpecificationsInput) SetDryRun(v bool) *DescribeInstanceCreditSpecificationsInput { s.DryRun = &v @@ -46234,7 +49024,7 @@ type DescribeInstanceStatusInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more filters. + // The filters. // // * availability-zone - The Availability Zone of the instance. // @@ -46243,12 +49033,18 @@ type DescribeInstanceStatusInput struct { // // * event.description - A description of the event. // + // * event.instance-event-id - The ID of the event whose date and time you + // are modifying. + // // * event.not-after - The latest end time for the scheduled event (for example, // 2014-09-15T17:15:20.000Z). // // * event.not-before - The earliest start time for the scheduled event (for // example, 2014-09-15T17:15:20.000Z). // + // * event.not-before-deadline - The deadline for starting the event (for + // example, 2014-09-15T17:15:20.000Z). + // // * instance-state-code - The code for the instance state, as a 16-bit unsigned // integer. The high byte is used for internal purposes and should be ignored. // The low byte is set based on the state represented. The valid values are @@ -46277,7 +49073,7 @@ type DescribeInstanceStatusInput struct { // Default: false IncludeAllInstances *bool `locationName:"includeAllInstances" type:"boolean"` - // One or more instance IDs. + // The instance IDs. // // Default: Describes all your instances. // @@ -46343,7 +49139,7 @@ func (s *DescribeInstanceStatusInput) SetNextToken(v string) *DescribeInstanceSt type DescribeInstanceStatusOutput struct { _ struct{} `type:"structure"` - // One or more instance status descriptions. + // Information about the status of the instances. InstanceStatuses []*InstanceStatus `locationName:"instanceStatusSet" locationNameList:"item" type:"list"` // The token to use to retrieve the next page of results. This value is null @@ -46382,7 +49178,7 @@ type DescribeInstancesInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more filters. + // The filters. // // * affinity - The affinity setting for an instance running on a Dedicated // Host (default | host). @@ -46624,7 +49420,7 @@ type DescribeInstancesInput struct { // * vpc-id - The ID of the VPC that the instance is running in. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // One or more instance IDs. + // The instance IDs. // // Default: Describes all your instances. InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` @@ -46686,7 +49482,7 @@ type DescribeInstancesOutput struct { // when there are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` - // Zero or more reservations. + // Information about the reservations. Reservations []*Reservation `locationName:"reservationSet" locationNameList:"item" type:"list"` } @@ -46747,6 +49543,13 @@ type DescribeInternetGatewaysInput struct { // // Default: Describes all your internet gateways. InternetGatewayIds []*string `locationName:"internetGatewayId" locationNameList:"item" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` } // String returns the string representation @@ -46759,6 +49562,19 @@ func (s DescribeInternetGatewaysInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeInternetGatewaysInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeInternetGatewaysInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetDryRun sets the DryRun field's value. func (s *DescribeInternetGatewaysInput) SetDryRun(v bool) *DescribeInternetGatewaysInput { s.DryRun = &v @@ -46777,11 +49593,27 @@ func (s *DescribeInternetGatewaysInput) SetInternetGatewayIds(v []*string) *Desc return s } +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeInternetGatewaysInput) SetMaxResults(v int64) *DescribeInternetGatewaysInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeInternetGatewaysInput) SetNextToken(v string) *DescribeInternetGatewaysInput { + s.NextToken = &v + return s +} + type DescribeInternetGatewaysOutput struct { _ struct{} `type:"structure"` // Information about one or more internet gateways. InternetGateways []*InternetGateway `locationName:"internetGatewaySet" locationNameList:"item" type:"list"` + + // The token to use 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 @@ -46800,6 +49632,12 @@ func (s *DescribeInternetGatewaysOutput) SetInternetGateways(v []*InternetGatewa return s } +// SetNextToken sets the NextToken field's value. +func (s *DescribeInternetGatewaysOutput) SetNextToken(v string) *DescribeInternetGatewaysOutput { + s.NextToken = &v + return s +} + type DescribeKeyPairsInput struct { _ struct{} `type:"structure"` @@ -46809,14 +49647,14 @@ type DescribeKeyPairsInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more filters. + // The filters. // // * fingerprint - The fingerprint of the key pair. // // * key-name - The name of the key pair. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // One or more key pair names. + // The key pair names. // // Default: Describes all your key pairs. KeyNames []*string `locationName:"KeyName" locationNameList:"KeyName" type:"list"` @@ -46853,7 +49691,7 @@ func (s *DescribeKeyPairsInput) SetKeyNames(v []*string) *DescribeKeyPairsInput type DescribeKeyPairsOutput struct { _ struct{} `type:"structure"` - // Information about one or more key pairs. + // Information about the key pairs. KeyPairs []*KeyPairInfo `locationName:"keySet" locationNameList:"item" type:"list"` } @@ -47287,18 +50125,14 @@ type DescribeNatGatewaysInput struct { // * vpc-id - The ID of the VPC in which the NAT gateway resides. Filter []*Filter `locationNameList:"Filter" type:"list"` - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - // - // Constraint: If the value specified is greater than 1000, we return only 1000 - // items. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. MaxResults *int64 `type:"integer"` // One or more NAT gateway IDs. NatGatewayIds []*string `locationName:"NatGatewayId" locationNameList:"item" type:"list"` - // The token to retrieve the next page of results. + // The token for the next page of results. NextToken *string `type:"string"` } @@ -47429,10 +50263,17 @@ type DescribeNetworkAclsInput struct { // * vpc-id - The ID of the VPC for the network ACL. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + // One or more network ACL IDs. // // Default: Describes all your network ACLs. NetworkAclIds []*string `locationName:"NetworkAclId" locationNameList:"item" type:"list"` + + // The token for the next page of results. + NextToken *string `type:"string"` } // String returns the string representation @@ -47445,6 +50286,19 @@ func (s DescribeNetworkAclsInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeNetworkAclsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeNetworkAclsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetDryRun sets the DryRun field's value. func (s *DescribeNetworkAclsInput) SetDryRun(v bool) *DescribeNetworkAclsInput { s.DryRun = &v @@ -47457,17 +50311,33 @@ func (s *DescribeNetworkAclsInput) SetFilters(v []*Filter) *DescribeNetworkAclsI return s } +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeNetworkAclsInput) SetMaxResults(v int64) *DescribeNetworkAclsInput { + s.MaxResults = &v + return s +} + // SetNetworkAclIds sets the NetworkAclIds field's value. func (s *DescribeNetworkAclsInput) SetNetworkAclIds(v []*string) *DescribeNetworkAclsInput { s.NetworkAclIds = v return s } +// SetNextToken sets the NextToken field's value. +func (s *DescribeNetworkAclsInput) SetNextToken(v string) *DescribeNetworkAclsInput { + s.NextToken = &v + return s +} + type DescribeNetworkAclsOutput struct { _ struct{} `type:"structure"` // Information about one or more network ACLs. NetworkAcls []*NetworkAcl `locationName:"networkAclSet" locationNameList:"item" type:"list"` + + // The token to use 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 @@ -47486,6 +50356,12 @@ func (s *DescribeNetworkAclsOutput) SetNetworkAcls(v []*NetworkAcl) *DescribeNet return s } +// SetNextToken sets the NextToken field's value. +func (s *DescribeNetworkAclsOutput) SetNextToken(v string) *DescribeNetworkAclsOutput { + s.NextToken = &v + return s +} + // Contains the parameters for DescribeNetworkInterfaceAttribute. type DescribeNetworkInterfaceAttributeInput struct { _ struct{} `type:"structure"` @@ -47919,7 +50795,7 @@ type DescribePlacementGroupsInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more filters. + // The filters. // // * group-name - The name of the placement group. // @@ -47929,7 +50805,7 @@ type DescribePlacementGroupsInput struct { // * strategy - The strategy of the placement group (cluster | spread | partition). Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // One or more placement group names. + // The names of the placement groups. // // Default: Describes all your placement groups, or only those otherwise specified. GroupNames []*string `locationName:"groupName" type:"list"` @@ -47966,7 +50842,7 @@ func (s *DescribePlacementGroupsInput) SetGroupNames(v []*string) *DescribePlace type DescribePlacementGroupsOutput struct { _ struct{} `type:"structure"` - // One or more placement groups. + // Information about the placement groups. PlacementGroups []*PlacementGroup `locationName:"placementGroupSet" locationNameList:"item" type:"list"` } @@ -48002,16 +50878,11 @@ type DescribePrefixListsInput struct { // * prefix-list-name: The name of a prefix list. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - // - // Constraint: If the value specified is greater than 1000, we return only 1000 - // items. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. MaxResults *int64 `type:"integer"` - // The token for the next set of items to return. (You received this token from - // a prior call.) + // The token for the next page of results. NextToken *string `type:"string"` // One or more prefix list IDs. @@ -48061,8 +50932,8 @@ func (s *DescribePrefixListsInput) SetPrefixListIds(v []*string) *DescribePrefix type DescribePrefixListsOutput struct { _ struct{} `type:"structure"` - // The token to use when requesting the next set of items. If there are no additional - // items to return, the string is empty. + // The token to use 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"` // All available prefix lists. @@ -48284,14 +51155,14 @@ type DescribeRegionsInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more filters. + // The filters. // // * endpoint - The endpoint of the region (for example, ec2.us-east-1.amazonaws.com). // // * region-name - The name of the region (for example, us-east-1). Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The names of one or more regions. + // The names of the regions. RegionNames []*string `locationName:"RegionName" locationNameList:"RegionName" type:"list"` } @@ -48326,7 +51197,7 @@ func (s *DescribeRegionsInput) SetRegionNames(v []*string) *DescribeRegionsInput type DescribeRegionsOutput struct { _ struct{} `type:"structure"` - // Information about one or more regions. + // Information about the regions. Regions []*Region `locationName:"regionInfo" locationNameList:"item" type:"list"` } @@ -48987,12 +51858,11 @@ type DescribeRouteTablesInput struct { // * vpc-id - The ID of the VPC for the route table. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 5 and 100. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. MaxResults *int64 `type:"integer"` - // The token to retrieve the next page of results. + // The token for the next page of results. NextToken *string `type:"string"` // One or more route table IDs. @@ -49363,7 +52233,7 @@ type DescribeSecurityGroupReferencesInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // One or more security group IDs in your account. + // The IDs of the security groups in your account. // // GroupId is a required field GroupId []*string `locationNameList:"item" type:"list" required:"true"` @@ -49436,9 +52306,9 @@ type DescribeSecurityGroupsInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more filters. If using multiple filters for rules, the results include - // security groups for which any combination of rules - not necessarily a single - // rule - match all filters. + // The filters. If using multiple filters for rules, the results include security + // groups for which any combination of rules - not necessarily a single rule + // - match all filters. // // * description - The description of the security group. // @@ -49515,13 +52385,13 @@ type DescribeSecurityGroupsInput struct { // * vpc-id - The ID of the VPC specified when the security group was created. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // One or more security group IDs. Required for security groups in a nondefault + // The IDs of the security groups. Required for security groups in a nondefault // VPC. // // Default: Describes all your security groups. GroupIds []*string `locationName:"GroupId" locationNameList:"groupId" type:"list"` - // [EC2-Classic and default VPC only] One or more security group names. You + // [EC2-Classic and default VPC only] The names of the security groups. You // can specify either the security group name or the security group ID. For // security groups in a nondefault VPC, use the group-name filter to describe // security groups by name. @@ -49592,7 +52462,7 @@ type DescribeSecurityGroupsOutput struct { // when there are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` - // Information about one or more security groups. + // Information about the security groups. SecurityGroups []*SecurityGroup `locationName:"securityGroupInfo" locationNameList:"item" type:"list"` } @@ -49687,10 +52557,11 @@ func (s *DescribeSnapshotAttributeInput) SetSnapshotId(v string) *DescribeSnapsh type DescribeSnapshotAttributeOutput struct { _ struct{} `type:"structure"` - // A list of permissions for creating volumes from the snapshot. + // The users and groups that have the permissions for creating volumes from + // the snapshot. CreateVolumePermissions []*CreateVolumePermission `locationName:"createVolumePermission" locationNameList:"item" type:"list"` - // A list of product codes. + // The product codes. ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` // The ID of the EBS snapshot. @@ -49725,7 +52596,6 @@ func (s *DescribeSnapshotAttributeOutput) SetSnapshotId(v string) *DescribeSnaps return s } -// Contains the parameters for DescribeSnapshots. type DescribeSnapshotsInput struct { _ struct{} `type:"structure"` @@ -49735,13 +52605,14 @@ type DescribeSnapshotsInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more filters. + // The filters. // // * description - A description of the snapshot. // - // * owner-alias - Value from an Amazon-maintained list (amazon | aws-marketplace - // | microsoft) of snapshot owners. Not to be confused with the user-configured - // AWS account alias, which is set from the IAM console. + // * owner-alias - Value from an Amazon-maintained list (amazon | self | + // all | aws-marketplace | microsoft) of snapshot owners. Not to be confused + // with the user-configured AWS account alias, which is set from the IAM + // console. // // * owner-id - The ID of the AWS account that owns the snapshot. // @@ -49787,16 +52658,15 @@ type DescribeSnapshotsInput struct { // to return. NextToken *string `type:"string"` - // Returns the snapshots owned by the specified owner. Multiple owners can be - // specified. + // Describes the snapshots owned by these owners. OwnerIds []*string `locationName:"Owner" locationNameList:"Owner" type:"list"` - // One or more AWS accounts IDs that can create volumes from the snapshot. + // The IDs of the AWS accounts that can create volumes from the snapshot. RestorableByUserIds []*string `locationName:"RestorableBy" type:"list"` - // One or more snapshot IDs. + // The snapshot IDs. // - // Default: Describes snapshots for which you have launch permissions. + // Default: Describes the snapshots for which you have create volume permissions. SnapshotIds []*string `locationName:"SnapshotId" locationNameList:"SnapshotId" type:"list"` } @@ -49852,7 +52722,6 @@ func (s *DescribeSnapshotsInput) SetSnapshotIds(v []*string) *DescribeSnapshotsI return s } -// Contains the output of DescribeSnapshots. type DescribeSnapshotsOutput struct { _ struct{} `type:"structure"` @@ -50901,9 +53770,10 @@ type DescribeTagsInput struct { // // * resource-type - The resource type (customer-gateway | dedicated-host // | dhcp-options | elastic-ip | fleet | fpga-image | image | instance | - // internet-gateway | launch-template | natgateway | network-acl | network-interface - // | reserved-instances | route-table | security-group | snapshot | spot-instances-request - // | subnet | volume | vpc | vpc-peering-connection | vpn-connection | vpn-gateway). + // host-reservation | internet-gateway | launch-template | natgateway | network-acl + // | network-interface | reserved-instances | route-table | security-group + // | snapshot | spot-instances-request | subnet | volume | vpc | vpc-peering-connection + // | vpn-connection | vpn-gateway). // // * tag: - The key/value combination of the tag. For example, specify // "tag:Owner" for the filter name and "TeamA" for the filter value to find @@ -51613,7 +54483,6 @@ func (s *DescribeVolumeAttributeOutput) SetVolumeId(v string) *DescribeVolumeAtt return s } -// Contains the parameters for DescribeVolumeStatus. type DescribeVolumeStatusInput struct { _ struct{} `type:"structure"` @@ -51623,7 +54492,7 @@ type DescribeVolumeStatusInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more filters. + // The filters. // // * action.code - The action code for the event (for example, enable-volume-io). // @@ -51672,7 +54541,7 @@ type DescribeVolumeStatusInput struct { // more results to return. NextToken *string `type:"string"` - // One or more volume IDs. + // The IDs of the volumes. // // Default: Describes all your volumes. VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` @@ -51718,7 +54587,6 @@ func (s *DescribeVolumeStatusInput) SetVolumeIds(v []*string) *DescribeVolumeSta return s } -// Contains the output of DescribeVolumeStatus. type DescribeVolumeStatusOutput struct { _ struct{} `type:"structure"` @@ -51726,7 +54594,7 @@ type DescribeVolumeStatusOutput struct { // when there are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` - // A list of volumes. + // Information about the status of the volumes. VolumeStatuses []*VolumeStatusItem `locationName:"volumeStatusSet" locationNameList:"item" type:"list"` } @@ -51752,7 +54620,6 @@ func (s *DescribeVolumeStatusOutput) SetVolumeStatuses(v []*VolumeStatusItem) *D return s } -// Contains the parameters for DescribeVolumes. type DescribeVolumesInput struct { _ struct{} `type:"structure"` @@ -51762,7 +54629,7 @@ type DescribeVolumesInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more filters. + // The filters. // // * attachment.attach-time - The time stamp when the attachment initiated. // @@ -51824,7 +54691,7 @@ type DescribeVolumesInput struct { // NextToken value. This value is null when there are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` - // One or more volume IDs. + // The volume IDs. VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` } @@ -51877,7 +54744,7 @@ type DescribeVolumesModificationsInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // One or more filters. Supported filters: volume-id, modification-state, target-size, + // The filters. Supported filters: volume-id, modification-state, target-size, // target-iops, target-volume-type, original-size, original-iops, original-volume-type, // start-time. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` @@ -51889,7 +54756,7 @@ type DescribeVolumesModificationsInput struct { // The nextToken value returned by a previous paginated request. NextToken *string `type:"string"` - // One or more volume IDs for which in-progress modifications will be described. + // The IDs of the volumes for which in-progress modifications will be described. VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` } @@ -51939,7 +54806,7 @@ type DescribeVolumesModificationsOutput struct { // Token for pagination, null if there are no more results NextToken *string `locationName:"nextToken" type:"string"` - // A list of returned VolumeModification objects. + // Information about the volume modifications. VolumesModifications []*VolumeModification `locationName:"volumeModificationSet" locationNameList:"item" type:"list"` } @@ -51965,7 +54832,6 @@ func (s *DescribeVolumesModificationsOutput) SetVolumesModifications(v []*Volume return s } -// Contains the output of DescribeVolumes. type DescribeVolumesOutput struct { _ struct{} `type:"structure"` @@ -52113,13 +54979,11 @@ func (s *DescribeVpcAttributeOutput) SetVpcId(v string) *DescribeVpcAttributeOut type DescribeVpcClassicLinkDnsSupportInput struct { _ struct{} `type:"structure"` - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. MaxResults *int64 `locationName:"maxResults" min:"5" type:"integer"` - // The token for the next set of items to return. (You received this token from - // a prior call.) + // The token for the next page of results. NextToken *string `locationName:"nextToken" min:"1" type:"string"` // One or more VPC IDs. @@ -52173,7 +55037,8 @@ func (s *DescribeVpcClassicLinkDnsSupportInput) SetVpcIds(v []*string) *Describe type DescribeVpcClassicLinkDnsSupportOutput struct { _ struct{} `type:"structure"` - // The token to use when requesting the next set of items. + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. NextToken *string `locationName:"nextToken" min:"1" type:"string"` // Information about the ClassicLink DNS support status of the VPCs. @@ -52986,13 +55851,11 @@ type DescribeVpcPeeringConnectionsInput struct { // * vpc-peering-connection-id - The ID of the VPC peering connection. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The maximum number of results to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. MaxResults *int64 `min:"5" type:"integer"` - // The token to request the next page of results. (You received this token from - // a prior call.) + // The token for the next page of results. NextToken *string `type:"string"` // One or more VPC peering connection IDs. @@ -53142,6 +56005,13 @@ type DescribeVpcsInput struct { // * vpc-id - The ID of the VPC. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` + // One or more VPC IDs. // // Default: Describes all your VPCs. @@ -53158,6 +56028,19 @@ func (s DescribeVpcsInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeVpcsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeVpcsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetDryRun sets the DryRun field's value. func (s *DescribeVpcsInput) SetDryRun(v bool) *DescribeVpcsInput { s.DryRun = &v @@ -53170,6 +56053,18 @@ func (s *DescribeVpcsInput) SetFilters(v []*Filter) *DescribeVpcsInput { return s } +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeVpcsInput) SetMaxResults(v int64) *DescribeVpcsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeVpcsInput) SetNextToken(v string) *DescribeVpcsInput { + s.NextToken = &v + return s +} + // SetVpcIds sets the VpcIds field's value. func (s *DescribeVpcsInput) SetVpcIds(v []*string) *DescribeVpcsInput { s.VpcIds = v @@ -53179,6 +56074,10 @@ func (s *DescribeVpcsInput) SetVpcIds(v []*string) *DescribeVpcsInput { type DescribeVpcsOutput struct { _ struct{} `type:"structure"` + // The token to use 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"` + // Information about one or more VPCs. Vpcs []*Vpc `locationName:"vpcSet" locationNameList:"item" type:"list"` } @@ -53193,6 +56092,12 @@ func (s DescribeVpcsOutput) GoString() string { return s.String() } +// SetNextToken sets the NextToken field's value. +func (s *DescribeVpcsOutput) SetNextToken(v string) *DescribeVpcsOutput { + s.NextToken = &v + return s +} + // SetVpcs sets the Vpcs field's value. func (s *DescribeVpcsOutput) SetVpcs(v []*Vpc) *DescribeVpcsOutput { s.Vpcs = v @@ -55045,19 +57950,16 @@ type EbsBlockDevice struct { Encrypted *bool `locationName:"encrypted" type:"boolean"` // The number of I/O operations per second (IOPS) that the volume supports. - // For io1, this represents the number of IOPS that are provisioned for the - // volume. For gp2, this represents the baseline performance of the volume and - // the rate at which the volume accumulates I/O credits for bursting. For more - // information about General Purpose SSD baseline performance, I/O credits, - // and bursting, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) + // For io1 volumes, this represents the number of IOPS that are provisioned + // for the volume. For gp2 volumes, this represents the baseline performance + // of the volume and the rate at which the volume accumulates I/O credits for + // bursting. For more information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) // in the Amazon Elastic Compute Cloud User Guide. // // Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS - // for io1 volumes in most Regions. Maximum io1IOPS of 64,000 is guaranteed - // only on Nitro-based instances (AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). - // Other instance families guarantee performance up to 32,000 IOPS. For more - // information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. + // for io1 volumes, in most Regions. The maximum IOPS for io1 of 64,000 is guaranteed + // only on Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). + // Other instance families guarantee performance up to 32,000 IOPS. // // Condition: This parameter is required for requests to create io1 volumes; // it is not used in requests to create gp2, st1, sc1, or standard volumes. @@ -55915,10 +58817,6 @@ type EventInformation struct { // * iamFleetRoleInvalid - The Spot Fleet did not have the required permissions // either to launch or terminate an instance. // - // * launchSpecTemporarilyBlacklisted - The configuration is not valid and - // several attempts to launch instances have failed. For more information, - // see the description of the event. - // // * spotFleetRequestConfigurationInvalid - The configuration is not valid. // For more information, see the description of the event. // @@ -55963,6 +58861,10 @@ type EventInformation struct { // // The following are the Information events: // + // * launchSpecTemporarilyBlacklisted - The configuration is not valid and + // several attempts to launch instances have failed. For more information, + // see the description of the event. + // // * launchSpecUnusable - The price in a launch specification is not valid // because it is below the Spot price or the Spot price is above the On-Demand // price. @@ -56488,7 +59390,7 @@ type Filter struct { // The name of the filter. Filter names are case-sensitive. Name *string `type:"string"` - // One or more filter values. Filter values are case-sensitive. + // The filter values. Filter values are case-sensitive. Values []*string `locationName:"Value" locationNameList:"item" type:"list"` } @@ -57231,6 +60133,9 @@ type FpgaImage struct { // The date and time the AFI was created. CreateTime *time.Time `locationName:"createTime" type:"timestamp"` + // Indicates whether data retention support is enabled for the AFI. + DataRetentionSupport *bool `locationName:"dataRetentionSupport" type:"boolean"` + // The description of the AFI. Description *string `locationName:"description" type:"string"` @@ -57287,6 +60192,12 @@ func (s *FpgaImage) SetCreateTime(v time.Time) *FpgaImage { return s } +// SetDataRetentionSupport sets the DataRetentionSupport field's value. +func (s *FpgaImage) SetDataRetentionSupport(v bool) *FpgaImage { + s.DataRetentionSupport = &v + return s +} + // SetDescription sets the Description field's value. func (s *FpgaImage) SetDescription(v string) *FpgaImage { s.Description = &v @@ -58973,6 +61884,9 @@ type HostReservation struct { // The state of the reservation. State *string `locationName:"state" type:"string" enum:"ReservationState"` + // Any tags assigned to the Dedicated Host Reservation. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + // The upfront price of the reservation. UpfrontPrice *string `locationName:"upfrontPrice" type:"string"` } @@ -59059,6 +61973,12 @@ func (s *HostReservation) SetState(v string) *HostReservation { return s } +// SetTags sets the Tags field's value. +func (s *HostReservation) SetTags(v []*Tag) *HostReservation { + s.Tags = v + return s +} + // SetUpfrontPrice sets the UpfrontPrice field's value. func (s *HostReservation) SetUpfrontPrice(v string) *HostReservation { s.UpfrontPrice = &v @@ -59583,8 +62503,8 @@ type ImportClientVpnClientCertificateRevocationListInput struct { _ struct{} `type:"structure"` // The client certificate revocation list file. For more information, see Generate - // a Client Certificate Revocation List (vpn/latest/clientvpn-admin/cvpn-working-certificates.html#cvpn-working-certificates-generate) - // in the AWS Client VPN Admin Guide. + // a Client Certificate Revocation List (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/cvpn-working-certificates.html#cvpn-working-certificates-generate) + // in the AWS Client VPN Administrator Guide. // // CertificateRevocationList is a required field CertificateRevocationList *string `type:"string" required:"true"` @@ -59718,7 +62638,9 @@ type ImportImageInput struct { // // * Key ID // - // * Key alias, in the form alias/ExampleAlias + // * Key alias. The alias ARN contains the arn:aws:kms namespace, followed + // by the region of the CMK, the AWS account ID of the CMK owner, the alias + // namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. // // * ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed // by the region of the CMK, the AWS account ID of the CMK owner, the key @@ -60612,7 +63534,9 @@ type ImportSnapshotInput struct { // // * Key ID // - // * Key alias, in the form alias/ExampleAlias + // * Key alias. The alias ARN contains the arn:aws:kms namespace, followed + // by the region of the CMK, the AWS account ID of the CMK owner, the alias + // namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. // // * ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed // by the region of the CMK, the AWS account ID of the CMK owner, the key @@ -61038,7 +63962,7 @@ type Instance struct { // The monitoring for the instance. Monitoring *Monitoring `locationName:"monitoring" type:"structure"` - // [EC2-VPC] One or more network interfaces for the instance. + // [EC2-VPC] The network interfaces for the instance. NetworkInterfaces []*InstanceNetworkInterface `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"` // The location where the instance launched, if applicable. @@ -61081,7 +64005,7 @@ type Instance struct { // instance store volume. RootDeviceType *string `locationName:"rootDeviceType" type:"string" enum:"DeviceType"` - // One or more security groups for the instance. + // The security groups for the instance. SecurityGroups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` // Specifies whether to enable an instance launched in a VPC to perform NAT. @@ -62235,8 +65159,17 @@ func (s *InstancePrivateIpAddress) SetPrivateIpAddress(v string) *InstancePrivat type InstanceState struct { _ struct{} `type:"structure"` - // The low byte represents the state. The high byte is used for internal purposes - // and should be ignored. + // The state of the instance as a 16-bit unsigned integer. + // + // The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal + // values between 256 and 65,535. These numerical values are used for internal + // purposes and should be ignored. + // + // The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal + // values between 0 and 255. + // + // The valid values for instance-state-code will all be in the range of the + // low byte and they are: // // * 0 : pending // @@ -62249,6 +65182,9 @@ type InstanceState struct { // * 64 : stopping // // * 80 : stopped + // + // You can ignore the high byte value by zeroing out all of the bits above 2^8 + // or 256 in decimal. Code *int64 `locationName:"code" type:"integer"` // The current state of the instance. @@ -62449,11 +65385,17 @@ type InstanceStatusEvent struct { // following text: [Completed]. Description *string `locationName:"description" type:"string"` + // The ID of the event. + InstanceEventId *string `locationName:"instanceEventId" type:"string"` + // The latest scheduled end time for the event. NotAfter *time.Time `locationName:"notAfter" type:"timestamp"` // The earliest scheduled start time for the event. NotBefore *time.Time `locationName:"notBefore" type:"timestamp"` + + // The deadline for starting the event. + NotBeforeDeadline *time.Time `locationName:"notBeforeDeadline" type:"timestamp"` } // String returns the string representation @@ -62478,6 +65420,12 @@ func (s *InstanceStatusEvent) SetDescription(v string) *InstanceStatusEvent { return s } +// SetInstanceEventId sets the InstanceEventId field's value. +func (s *InstanceStatusEvent) SetInstanceEventId(v string) *InstanceStatusEvent { + s.InstanceEventId = &v + return s +} + // SetNotAfter sets the NotAfter field's value. func (s *InstanceStatusEvent) SetNotAfter(v time.Time) *InstanceStatusEvent { s.NotAfter = &v @@ -62490,6 +65438,12 @@ func (s *InstanceStatusEvent) SetNotBefore(v time.Time) *InstanceStatusEvent { return s } +// SetNotBeforeDeadline sets the NotBeforeDeadline field's value. +func (s *InstanceStatusEvent) SetNotBeforeDeadline(v time.Time) *InstanceStatusEvent { + s.NotBeforeDeadline = &v + return s +} + // Describes the status of an instance. type InstanceStatusSummary struct { _ struct{} `type:"structure"` @@ -62628,13 +65582,13 @@ type IpPermission struct { // for all types and codes is allowed when authorizing rules. IpProtocol *string `locationName:"ipProtocol" type:"string"` - // One or more IPv4 ranges. + // The IPv4 ranges. IpRanges []*IpRange `locationName:"ipRanges" locationNameList:"item" type:"list"` - // [EC2-VPC only] One or more IPv6 ranges. + // [EC2-VPC only] The IPv6 ranges. Ipv6Ranges []*Ipv6Range `locationName:"ipv6Ranges" locationNameList:"item" type:"list"` - // [EC2-VPC only] One or more prefix list IDs for an AWS service. With AuthorizeSecurityGroupEgress, + // [EC2-VPC only] The prefix list IDs for an AWS service. With AuthorizeSecurityGroupEgress, // this is the AWS service that you want to access through a VPC endpoint from // instances associated with the security group. PrefixListIds []*PrefixListId `locationName:"prefixListIds" locationNameList:"item" type:"list"` @@ -62644,7 +65598,7 @@ type IpPermission struct { // If you specify all ICMP/ICMPv6 types, you must specify all codes. ToPort *int64 `locationName:"toPort" type:"integer"` - // One or more security group and AWS account ID pairs. + // The security group and AWS account ID pairs. UserIdGroupPairs []*UserIdGroupPair `locationName:"groups" locationNameList:"item" type:"list"` } @@ -66296,6 +69250,107 @@ func (s *ModifyInstanceCreditSpecificationOutput) SetUnsuccessfulInstanceCreditS return s } +type ModifyInstanceEventStartTimeInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The ID of the event whose date and time you are modifying. + // + // InstanceEventId is a required field + InstanceEventId *string `type:"string" required:"true"` + + // The ID of the instance with the scheduled event. + // + // InstanceId is a required field + InstanceId *string `type:"string" required:"true"` + + // The new date and time when the event will take place. + // + // NotBefore is a required field + NotBefore *time.Time `type:"timestamp" required:"true"` +} + +// String returns the string representation +func (s ModifyInstanceEventStartTimeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyInstanceEventStartTimeInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyInstanceEventStartTimeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyInstanceEventStartTimeInput"} + if s.InstanceEventId == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceEventId")) + } + if s.InstanceId == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceId")) + } + if s.NotBefore == nil { + invalidParams.Add(request.NewErrParamRequired("NotBefore")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *ModifyInstanceEventStartTimeInput) SetDryRun(v bool) *ModifyInstanceEventStartTimeInput { + s.DryRun = &v + return s +} + +// SetInstanceEventId sets the InstanceEventId field's value. +func (s *ModifyInstanceEventStartTimeInput) SetInstanceEventId(v string) *ModifyInstanceEventStartTimeInput { + s.InstanceEventId = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *ModifyInstanceEventStartTimeInput) SetInstanceId(v string) *ModifyInstanceEventStartTimeInput { + s.InstanceId = &v + return s +} + +// SetNotBefore sets the NotBefore field's value. +func (s *ModifyInstanceEventStartTimeInput) SetNotBefore(v time.Time) *ModifyInstanceEventStartTimeInput { + s.NotBefore = &v + return s +} + +type ModifyInstanceEventStartTimeOutput struct { + _ struct{} `type:"structure"` + + // Describes a scheduled event for an instance. + Event *InstanceStatusEvent `locationName:"event" type:"structure"` +} + +// String returns the string representation +func (s ModifyInstanceEventStartTimeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyInstanceEventStartTimeOutput) GoString() string { + return s.String() +} + +// SetEvent sets the Event field's value. +func (s *ModifyInstanceEventStartTimeOutput) SetEvent(v *InstanceStatusEvent) *ModifyInstanceEventStartTimeOutput { + s.Event = v + return s +} + type ModifyInstancePlacementInput struct { _ struct{} `type:"structure"` @@ -67493,8 +70548,9 @@ type ModifyVpcEndpointInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // (Gateway endpoint) A policy document to attach to the endpoint. The policy - // must be in valid JSON format. + // A policy to attach to the endpoint that controls access to the service. The + // policy must be in valid JSON format. If this parameter is not specified, + // we attach a default policy that allows full access to the service. PolicyDocument *string `type:"string"` // (Interface endpoint) Indicate whether a private hosted zone is associated @@ -68025,7 +71081,7 @@ type MonitorInstancesInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more instance IDs. + // The IDs of the instances. // // InstanceIds is a required field InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` @@ -70795,7 +73851,7 @@ type RebootInstancesInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more instance IDs. + // The instance IDs. // // InstanceIds is a required field InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` @@ -72158,12 +75214,12 @@ type ReportInstanceStatusInput struct { // The time at which the reported instance health state ended. EndTime *time.Time `locationName:"endTime" type:"timestamp"` - // One or more instances. + // The instances. // // Instances is a required field Instances []*string `locationName:"instanceId" locationNameList:"InstanceId" type:"list" required:"true"` - // One or more reason codes that describe the health state of your instance. + // The reason codes that describe the health state of your instance. // // * instance-stuck-in-state: My instance is stuck in a state. // @@ -73088,10 +76144,10 @@ func (s *RequestSpotLaunchSpecification) SetUserData(v string) *RequestSpotLaunc type Reservation struct { _ struct{} `type:"structure"` - // [EC2-Classic only] One or more security groups. + // [EC2-Classic only] The security groups. Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - // One or more instances. + // The instances. Instances []*Instance `locationName:"instancesSet" locationNameList:"item" type:"list"` // The ID of the AWS account that owns the reservation. @@ -74805,8 +77861,8 @@ type RevokeSecurityGroupEgressInput struct { // GroupId is a required field GroupId *string `locationName:"groupId" type:"string" required:"true"` - // One or more sets of IP permissions. You can't specify a destination security - // group and a CIDR IP address range in the same set of permissions. + // The sets of IP permissions. You can't specify a destination security group + // and a CIDR IP address range in the same set of permissions. IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` // Not supported. Use a set of IP permissions to specify the protocol name or @@ -74942,8 +77998,8 @@ type RevokeSecurityGroupIngressInput struct { // either the security group ID or the security group name in the request. GroupName *string `type:"string"` - // One or more sets of IP permissions. You can't specify a source security group - // and a CIDR IP address range in the same set of permissions. + // The sets of IP permissions. You can't specify a source security group and + // a CIDR IP address range in the same set of permissions. IpPermissions []*IpPermission `locationNameList:"item" type:"list"` // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). @@ -75331,8 +78387,8 @@ type RunInstancesInput struct { // Reserved. AdditionalInfo *string `locationName:"additionalInfo" type:"string"` - // One or more block device mapping entries. You can't specify both a snapshot - // ID and an encryption value. This is because only blank volumes can be encrypted + // The block device mapping entries. You can't specify both a snapshot ID and + // an encryption value. This is because only blank volumes can be encrypted // on creation. If a snapshot is the basis for a volume, it is not blank and // its encryption status is used for the volume encryption status. BlockDeviceMappings []*BlockDeviceMapping `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` @@ -75433,11 +78489,10 @@ type RunInstancesInput struct { // request. Ipv6AddressCount *int64 `type:"integer"` - // [EC2-VPC] Specify one or more IPv6 addresses from the range of the subnet - // to associate with the primary network interface. You cannot specify this - // option and the option to assign a number of IPv6 addresses in the same request. - // You cannot specify this option if you've specified a minimum number of instances - // to launch. + // [EC2-VPC] The IPv6 addresses from the range of the subnet to associate with + // the primary network interface. You cannot specify this option and the option + // to assign a number of IPv6 addresses in the same request. You cannot specify + // this option if you've specified a minimum number of instances to launch. // // You cannot specify this option and the network interfaces option in the same // request. @@ -75492,7 +78547,7 @@ type RunInstancesInput struct { // The monitoring for the instance. Monitoring *RunInstancesMonitoringEnabled `type:"structure"` - // One or more network interfaces. + // The network interfaces. // // You cannot specify this option and the network interfaces option in the same // request. @@ -75520,7 +78575,7 @@ type RunInstancesInput struct { // in the Amazon Elastic Compute Cloud User Guide. RamdiskId *string `type:"string"` - // One or more security group IDs. You can create a security group using CreateSecurityGroup. + // The IDs of the security groups. You can create a security group using CreateSecurityGroup. // // Default: Amazon EC2 uses the default security group. // @@ -75528,7 +78583,7 @@ type RunInstancesInput struct { // request. SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` - // [EC2-Classic, default VPC] One or more security group names. For a nondefault + // [EC2-Classic, default VPC] The names of the security groups. For a nondefault // VPC, you must use security group IDs instead. // // You cannot specify this option and the network interfaces option in the same @@ -77201,10 +80256,10 @@ type SecurityGroup struct { // The name of the security group. GroupName *string `locationName:"groupName" type:"string"` - // One or more inbound rules associated with the security group. + // The inbound rules associated with the security group. IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` - // [EC2-VPC] One or more outbound rules associated with the security group. + // [EC2-VPC] The outbound rules associated with the security group. IpPermissionsEgress []*IpPermission `locationName:"ipPermissionsEgress" locationNameList:"item" type:"list"` // The AWS account ID of the owner of the security group. @@ -77364,6 +80419,10 @@ type ServiceConfiguration struct { // The DNS names for the service. BaseEndpointDnsNames []*string `locationName:"baseEndpointDnsNameSet" locationNameList:"item" type:"list"` + // Indicates whether the service manages it's VPC Endpoints. Management of the + // service VPC Endpoints using the VPC Endpoint API is restricted. + ManagesVpcEndpoints *bool `locationName:"managesVpcEndpoints" type:"boolean"` + // The Amazon Resource Names (ARNs) of the Network Load Balancers for the service. NetworkLoadBalancerArns []*string `locationName:"networkLoadBalancerArnSet" locationNameList:"item" type:"list"` @@ -77411,6 +80470,12 @@ func (s *ServiceConfiguration) SetBaseEndpointDnsNames(v []*string) *ServiceConf return s } +// SetManagesVpcEndpoints sets the ManagesVpcEndpoints field's value. +func (s *ServiceConfiguration) SetManagesVpcEndpoints(v bool) *ServiceConfiguration { + s.ManagesVpcEndpoints = &v + return s +} + // SetNetworkLoadBalancerArns sets the NetworkLoadBalancerArns field's value. func (s *ServiceConfiguration) SetNetworkLoadBalancerArns(v []*string) *ServiceConfiguration { s.NetworkLoadBalancerArns = v @@ -77461,6 +80526,10 @@ type ServiceDetail struct { // The DNS names for the service. BaseEndpointDnsNames []*string `locationName:"baseEndpointDnsNameSet" locationNameList:"item" type:"list"` + // Indicates whether the service manages it's VPC Endpoints. Management of the + // service VPC Endpoints using the VPC Endpoint API is restricted. + ManagesVpcEndpoints *bool `locationName:"managesVpcEndpoints" type:"boolean"` + // The AWS account ID of the service owner. Owner *string `locationName:"owner" type:"string"` @@ -77505,6 +80574,12 @@ func (s *ServiceDetail) SetBaseEndpointDnsNames(v []*string) *ServiceDetail { return s } +// SetManagesVpcEndpoints sets the ManagesVpcEndpoints field's value. +func (s *ServiceDetail) SetManagesVpcEndpoints(v bool) *ServiceDetail { + s.ManagesVpcEndpoints = &v + return s +} + // SetOwner sets the Owner field's value. func (s *ServiceDetail) SetOwner(v string) *ServiceDetail { s.Owner = &v @@ -77671,9 +80746,9 @@ type Snapshot struct { // volume. KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - // Value from an Amazon-maintained list (amazon | aws-marketplace | microsoft) - // of snapshot owners. Not to be confused with the user-configured AWS account - // alias, which is set from the IAM console. + // Value from an Amazon-maintained list (amazon | self | all | aws-marketplace + // | microsoft) of snapshot owners. Not to be confused with the user-configured + // AWS account alias, which is set from the IAM console. OwnerAlias *string `locationName:"ownerAlias" type:"string"` // The AWS account ID of the EBS snapshot owner. @@ -78536,7 +81611,8 @@ type SpotFleetRequestConfigData struct { // The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). // At this point, no new Spot Instance requests are placed or able to fulfill - // the request. The default end date is 7 days from the current date. + // the request. If no value is specified, the Spot Fleet request remains until + // you cancel it. ValidUntil *time.Time `locationName:"validUntil" type:"timestamp"` } @@ -79352,19 +82428,19 @@ type StaleIpPermission struct { // (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). IpProtocol *string `locationName:"ipProtocol" type:"string"` - // One or more IP ranges. Not applicable for stale security group rules. + // The IP ranges. Not applicable for stale security group rules. IpRanges []*string `locationName:"ipRanges" locationNameList:"item" type:"list"` - // One or more prefix list IDs for an AWS service. Not applicable for stale - // security group rules. + // The prefix list IDs for an AWS service. Not applicable for stale security + // group rules. PrefixListIds []*string `locationName:"prefixListIds" locationNameList:"item" type:"list"` // The end of the port range for the TCP and UDP protocols, or an ICMP type // number. A value of -1 indicates all ICMP types. ToPort *int64 `locationName:"toPort" type:"integer"` - // One or more security group pairs. Returns the ID of the referenced security - // group and VPC, and the ID and status of the VPC peering connection. + // The security group pairs. Returns the ID of the referenced security group + // and VPC, and the ID and status of the VPC peering connection. UserIdGroupPairs []*UserIdGroupPair `locationName:"groups" locationNameList:"item" type:"list"` } @@ -79495,7 +82571,7 @@ type StartInstancesInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more instance IDs. + // The IDs of the instances. // // InstanceIds is a required field InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` @@ -79545,7 +82621,7 @@ func (s *StartInstancesInput) SetInstanceIds(v []*string) *StartInstancesInput { type StartInstancesOutput struct { _ struct{} `type:"structure"` - // Information about one or more started instances. + // Information about the started instances. StartingInstances []*InstanceStateChange `locationName:"instancesSet" locationNameList:"item" type:"list"` } @@ -79661,7 +82737,7 @@ type StopInstancesInput struct { // Default: false Hibernate *bool `type:"boolean"` - // One or more instance IDs. + // The IDs of the instances. // // InstanceIds is a required field InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` @@ -79717,7 +82793,7 @@ func (s *StopInstancesInput) SetInstanceIds(v []*string) *StopInstancesInput { type StopInstancesOutput struct { _ struct{} `type:"structure"` - // Information about one or more stopped instances. + // Information about the stopped instances. StoppingInstances []*InstanceStateChange `locationName:"instancesSet" locationNameList:"item" type:"list"` } @@ -80700,7 +83776,7 @@ type TerminateInstancesInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more instance IDs. + // The IDs of the instances. // // Constraints: Up to 1000 instance IDs. We recommend breaking up this request // into smaller batches. @@ -80747,7 +83823,7 @@ func (s *TerminateInstancesInput) SetInstanceIds(v []*string) *TerminateInstance type TerminateInstancesOutput struct { _ struct{} `type:"structure"` - // Information about one or more terminated instances. + // Information about the terminated instances. TerminatingInstances []*InstanceStateChange `locationName:"instancesSet" locationNameList:"item" type:"list"` } @@ -81876,7 +84952,7 @@ type UnmonitorInstancesInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more instance IDs. + // The IDs of the instances. // // InstanceIds is a required field InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` @@ -82531,17 +85607,14 @@ type Volume struct { // For Provisioned IOPS SSD volumes, this represents the number of IOPS that // are provisioned for the volume. For General Purpose SSD volumes, this represents // the baseline performance of the volume and the rate at which the volume accumulates - // I/O credits for bursting. For more information about General Purpose SSD - // baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types + // I/O credits for bursting. For more information, see Amazon EBS Volume Types // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) // in the Amazon Elastic Compute Cloud User Guide. // // Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS - // for io1 volumes in most regions. Maximum io1IOPS of 64,000 is guaranteed - // only on Nitro-based instances (AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). - // Other instance families guarantee performance up to 32,000 IOPS. For more - // information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. + // for io1 volumes, in most Regions. The maximum IOPS for io1 of 64,000 is guaranteed + // only on Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). + // Other instance families guarantee performance up to 32,000 IOPS. // // Condition: This parameter is required for requests to create io1 volumes; // it is not used in requests to create gp2, st1, sc1, or standard volumes. @@ -83405,6 +86478,9 @@ type VpcEndpoint struct { // hosted zone. PrivateDnsEnabled *bool `locationName:"privateDnsEnabled" type:"boolean"` + // Indicates whether the VPC Endpoint is being managed by its service. + RequesterManaged *bool `locationName:"requesterManaged" type:"boolean"` + // (Gateway endpoint) One or more route tables associated with the endpoint. RouteTableIds []*string `locationName:"routeTableIdSet" locationNameList:"item" type:"list"` @@ -83473,6 +86549,12 @@ func (s *VpcEndpoint) SetPrivateDnsEnabled(v bool) *VpcEndpoint { return s } +// SetRequesterManaged sets the RequesterManaged field's value. +func (s *VpcEndpoint) SetRequesterManaged(v bool) *VpcEndpoint { + s.RequesterManaged = &v + return s +} + // SetRouteTableIds sets the RouteTableIds field's value. func (s *VpcEndpoint) SetRouteTableIds(v []*string) *VpcEndpoint { s.RouteTableIds = v @@ -85215,6 +88297,27 @@ const ( // InstanceTypeT32xlarge is a InstanceType enum value InstanceTypeT32xlarge = "t3.2xlarge" + // InstanceTypeT3aNano is a InstanceType enum value + InstanceTypeT3aNano = "t3a.nano" + + // InstanceTypeT3aMicro is a InstanceType enum value + InstanceTypeT3aMicro = "t3a.micro" + + // InstanceTypeT3aSmall is a InstanceType enum value + InstanceTypeT3aSmall = "t3a.small" + + // InstanceTypeT3aMedium is a InstanceType enum value + InstanceTypeT3aMedium = "t3a.medium" + + // InstanceTypeT3aLarge is a InstanceType enum value + InstanceTypeT3aLarge = "t3a.large" + + // InstanceTypeT3aXlarge is a InstanceType enum value + InstanceTypeT3aXlarge = "t3a.xlarge" + + // InstanceTypeT3a2xlarge is a InstanceType enum value + InstanceTypeT3a2xlarge = "t3a.2xlarge" + // InstanceTypeM1Small is a InstanceType enum value InstanceTypeM1Small = "m1.small" @@ -85362,6 +88465,30 @@ const ( // InstanceTypeR5dMetal is a InstanceType enum value InstanceTypeR5dMetal = "r5d.metal" + // InstanceTypeR5adLarge is a InstanceType enum value + InstanceTypeR5adLarge = "r5ad.large" + + // InstanceTypeR5adXlarge is a InstanceType enum value + InstanceTypeR5adXlarge = "r5ad.xlarge" + + // InstanceTypeR5ad2xlarge is a InstanceType enum value + InstanceTypeR5ad2xlarge = "r5ad.2xlarge" + + // InstanceTypeR5ad4xlarge is a InstanceType enum value + InstanceTypeR5ad4xlarge = "r5ad.4xlarge" + + // InstanceTypeR5ad8xlarge is a InstanceType enum value + InstanceTypeR5ad8xlarge = "r5ad.8xlarge" + + // InstanceTypeR5ad12xlarge is a InstanceType enum value + InstanceTypeR5ad12xlarge = "r5ad.12xlarge" + + // InstanceTypeR5ad16xlarge is a InstanceType enum value + InstanceTypeR5ad16xlarge = "r5ad.16xlarge" + + // InstanceTypeR5ad24xlarge is a InstanceType enum value + InstanceTypeR5ad24xlarge = "r5ad.24xlarge" + // InstanceTypeX116xlarge is a InstanceType enum value InstanceTypeX116xlarge = "x1.16xlarge" @@ -85644,6 +88771,30 @@ const ( // InstanceTypeM5dMetal is a InstanceType enum value InstanceTypeM5dMetal = "m5d.metal" + // InstanceTypeM5adLarge is a InstanceType enum value + InstanceTypeM5adLarge = "m5ad.large" + + // InstanceTypeM5adXlarge is a InstanceType enum value + InstanceTypeM5adXlarge = "m5ad.xlarge" + + // InstanceTypeM5ad2xlarge is a InstanceType enum value + InstanceTypeM5ad2xlarge = "m5ad.2xlarge" + + // InstanceTypeM5ad4xlarge is a InstanceType enum value + InstanceTypeM5ad4xlarge = "m5ad.4xlarge" + + // InstanceTypeM5ad8xlarge is a InstanceType enum value + InstanceTypeM5ad8xlarge = "m5ad.8xlarge" + + // InstanceTypeM5ad12xlarge is a InstanceType enum value + InstanceTypeM5ad12xlarge = "m5ad.12xlarge" + + // InstanceTypeM5ad16xlarge is a InstanceType enum value + InstanceTypeM5ad16xlarge = "m5ad.16xlarge" + + // InstanceTypeM5ad24xlarge is a InstanceType enum value + InstanceTypeM5ad24xlarge = "m5ad.24xlarge" + // InstanceTypeH12xlarge is a InstanceType enum value InstanceTypeH12xlarge = "h1.2xlarge" @@ -86105,6 +89256,9 @@ const ( // ResourceTypeFpgaImage is a ResourceType enum value ResourceTypeFpgaImage = "fpga-image" + // ResourceTypeHostReservation is a ResourceType enum value + ResourceTypeHostReservation = "host-reservation" + // ResourceTypeImage is a ResourceType enum value ResourceTypeImage = "image" diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go index b501759b60..bace99ddc3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go @@ -576,34 +576,58 @@ type EC2API interface { DescribeByoipCidrsWithContext(aws.Context, *ec2.DescribeByoipCidrsInput, ...request.Option) (*ec2.DescribeByoipCidrsOutput, error) DescribeByoipCidrsRequest(*ec2.DescribeByoipCidrsInput) (*request.Request, *ec2.DescribeByoipCidrsOutput) + DescribeByoipCidrsPages(*ec2.DescribeByoipCidrsInput, func(*ec2.DescribeByoipCidrsOutput, bool) bool) error + DescribeByoipCidrsPagesWithContext(aws.Context, *ec2.DescribeByoipCidrsInput, func(*ec2.DescribeByoipCidrsOutput, bool) bool, ...request.Option) error + DescribeCapacityReservations(*ec2.DescribeCapacityReservationsInput) (*ec2.DescribeCapacityReservationsOutput, error) DescribeCapacityReservationsWithContext(aws.Context, *ec2.DescribeCapacityReservationsInput, ...request.Option) (*ec2.DescribeCapacityReservationsOutput, error) DescribeCapacityReservationsRequest(*ec2.DescribeCapacityReservationsInput) (*request.Request, *ec2.DescribeCapacityReservationsOutput) + DescribeCapacityReservationsPages(*ec2.DescribeCapacityReservationsInput, func(*ec2.DescribeCapacityReservationsOutput, bool) bool) error + DescribeCapacityReservationsPagesWithContext(aws.Context, *ec2.DescribeCapacityReservationsInput, func(*ec2.DescribeCapacityReservationsOutput, bool) bool, ...request.Option) error + DescribeClassicLinkInstances(*ec2.DescribeClassicLinkInstancesInput) (*ec2.DescribeClassicLinkInstancesOutput, error) DescribeClassicLinkInstancesWithContext(aws.Context, *ec2.DescribeClassicLinkInstancesInput, ...request.Option) (*ec2.DescribeClassicLinkInstancesOutput, error) DescribeClassicLinkInstancesRequest(*ec2.DescribeClassicLinkInstancesInput) (*request.Request, *ec2.DescribeClassicLinkInstancesOutput) + DescribeClassicLinkInstancesPages(*ec2.DescribeClassicLinkInstancesInput, func(*ec2.DescribeClassicLinkInstancesOutput, bool) bool) error + DescribeClassicLinkInstancesPagesWithContext(aws.Context, *ec2.DescribeClassicLinkInstancesInput, func(*ec2.DescribeClassicLinkInstancesOutput, bool) bool, ...request.Option) error + DescribeClientVpnAuthorizationRules(*ec2.DescribeClientVpnAuthorizationRulesInput) (*ec2.DescribeClientVpnAuthorizationRulesOutput, error) DescribeClientVpnAuthorizationRulesWithContext(aws.Context, *ec2.DescribeClientVpnAuthorizationRulesInput, ...request.Option) (*ec2.DescribeClientVpnAuthorizationRulesOutput, error) DescribeClientVpnAuthorizationRulesRequest(*ec2.DescribeClientVpnAuthorizationRulesInput) (*request.Request, *ec2.DescribeClientVpnAuthorizationRulesOutput) + DescribeClientVpnAuthorizationRulesPages(*ec2.DescribeClientVpnAuthorizationRulesInput, func(*ec2.DescribeClientVpnAuthorizationRulesOutput, bool) bool) error + DescribeClientVpnAuthorizationRulesPagesWithContext(aws.Context, *ec2.DescribeClientVpnAuthorizationRulesInput, func(*ec2.DescribeClientVpnAuthorizationRulesOutput, bool) bool, ...request.Option) error + DescribeClientVpnConnections(*ec2.DescribeClientVpnConnectionsInput) (*ec2.DescribeClientVpnConnectionsOutput, error) DescribeClientVpnConnectionsWithContext(aws.Context, *ec2.DescribeClientVpnConnectionsInput, ...request.Option) (*ec2.DescribeClientVpnConnectionsOutput, error) DescribeClientVpnConnectionsRequest(*ec2.DescribeClientVpnConnectionsInput) (*request.Request, *ec2.DescribeClientVpnConnectionsOutput) + DescribeClientVpnConnectionsPages(*ec2.DescribeClientVpnConnectionsInput, func(*ec2.DescribeClientVpnConnectionsOutput, bool) bool) error + DescribeClientVpnConnectionsPagesWithContext(aws.Context, *ec2.DescribeClientVpnConnectionsInput, func(*ec2.DescribeClientVpnConnectionsOutput, bool) bool, ...request.Option) error + DescribeClientVpnEndpoints(*ec2.DescribeClientVpnEndpointsInput) (*ec2.DescribeClientVpnEndpointsOutput, error) DescribeClientVpnEndpointsWithContext(aws.Context, *ec2.DescribeClientVpnEndpointsInput, ...request.Option) (*ec2.DescribeClientVpnEndpointsOutput, error) DescribeClientVpnEndpointsRequest(*ec2.DescribeClientVpnEndpointsInput) (*request.Request, *ec2.DescribeClientVpnEndpointsOutput) + DescribeClientVpnEndpointsPages(*ec2.DescribeClientVpnEndpointsInput, func(*ec2.DescribeClientVpnEndpointsOutput, bool) bool) error + DescribeClientVpnEndpointsPagesWithContext(aws.Context, *ec2.DescribeClientVpnEndpointsInput, func(*ec2.DescribeClientVpnEndpointsOutput, bool) bool, ...request.Option) error + DescribeClientVpnRoutes(*ec2.DescribeClientVpnRoutesInput) (*ec2.DescribeClientVpnRoutesOutput, error) DescribeClientVpnRoutesWithContext(aws.Context, *ec2.DescribeClientVpnRoutesInput, ...request.Option) (*ec2.DescribeClientVpnRoutesOutput, error) DescribeClientVpnRoutesRequest(*ec2.DescribeClientVpnRoutesInput) (*request.Request, *ec2.DescribeClientVpnRoutesOutput) + DescribeClientVpnRoutesPages(*ec2.DescribeClientVpnRoutesInput, func(*ec2.DescribeClientVpnRoutesOutput, bool) bool) error + DescribeClientVpnRoutesPagesWithContext(aws.Context, *ec2.DescribeClientVpnRoutesInput, func(*ec2.DescribeClientVpnRoutesOutput, bool) bool, ...request.Option) error + DescribeClientVpnTargetNetworks(*ec2.DescribeClientVpnTargetNetworksInput) (*ec2.DescribeClientVpnTargetNetworksOutput, error) DescribeClientVpnTargetNetworksWithContext(aws.Context, *ec2.DescribeClientVpnTargetNetworksInput, ...request.Option) (*ec2.DescribeClientVpnTargetNetworksOutput, error) DescribeClientVpnTargetNetworksRequest(*ec2.DescribeClientVpnTargetNetworksInput) (*request.Request, *ec2.DescribeClientVpnTargetNetworksOutput) + DescribeClientVpnTargetNetworksPages(*ec2.DescribeClientVpnTargetNetworksInput, func(*ec2.DescribeClientVpnTargetNetworksOutput, bool) bool) error + DescribeClientVpnTargetNetworksPagesWithContext(aws.Context, *ec2.DescribeClientVpnTargetNetworksInput, func(*ec2.DescribeClientVpnTargetNetworksOutput, bool) bool, ...request.Option) error + DescribeConversionTasks(*ec2.DescribeConversionTasksInput) (*ec2.DescribeConversionTasksOutput, error) DescribeConversionTasksWithContext(aws.Context, *ec2.DescribeConversionTasksInput, ...request.Option) (*ec2.DescribeConversionTasksOutput, error) DescribeConversionTasksRequest(*ec2.DescribeConversionTasksInput) (*request.Request, *ec2.DescribeConversionTasksOutput) @@ -620,6 +644,9 @@ type EC2API interface { DescribeEgressOnlyInternetGatewaysWithContext(aws.Context, *ec2.DescribeEgressOnlyInternetGatewaysInput, ...request.Option) (*ec2.DescribeEgressOnlyInternetGatewaysOutput, error) DescribeEgressOnlyInternetGatewaysRequest(*ec2.DescribeEgressOnlyInternetGatewaysInput) (*request.Request, *ec2.DescribeEgressOnlyInternetGatewaysOutput) + DescribeEgressOnlyInternetGatewaysPages(*ec2.DescribeEgressOnlyInternetGatewaysInput, func(*ec2.DescribeEgressOnlyInternetGatewaysOutput, bool) bool) error + DescribeEgressOnlyInternetGatewaysPagesWithContext(aws.Context, *ec2.DescribeEgressOnlyInternetGatewaysInput, func(*ec2.DescribeEgressOnlyInternetGatewaysOutput, bool) bool, ...request.Option) error + DescribeElasticGpus(*ec2.DescribeElasticGpusInput) (*ec2.DescribeElasticGpusOutput, error) DescribeElasticGpusWithContext(aws.Context, *ec2.DescribeElasticGpusInput, ...request.Option) (*ec2.DescribeElasticGpusOutput, error) DescribeElasticGpusRequest(*ec2.DescribeElasticGpusInput) (*request.Request, *ec2.DescribeElasticGpusOutput) @@ -640,10 +667,16 @@ type EC2API interface { DescribeFleetsWithContext(aws.Context, *ec2.DescribeFleetsInput, ...request.Option) (*ec2.DescribeFleetsOutput, error) DescribeFleetsRequest(*ec2.DescribeFleetsInput) (*request.Request, *ec2.DescribeFleetsOutput) + DescribeFleetsPages(*ec2.DescribeFleetsInput, func(*ec2.DescribeFleetsOutput, bool) bool) error + DescribeFleetsPagesWithContext(aws.Context, *ec2.DescribeFleetsInput, func(*ec2.DescribeFleetsOutput, bool) bool, ...request.Option) error + DescribeFlowLogs(*ec2.DescribeFlowLogsInput) (*ec2.DescribeFlowLogsOutput, error) DescribeFlowLogsWithContext(aws.Context, *ec2.DescribeFlowLogsInput, ...request.Option) (*ec2.DescribeFlowLogsOutput, error) DescribeFlowLogsRequest(*ec2.DescribeFlowLogsInput) (*request.Request, *ec2.DescribeFlowLogsOutput) + DescribeFlowLogsPages(*ec2.DescribeFlowLogsInput, func(*ec2.DescribeFlowLogsOutput, bool) bool) error + DescribeFlowLogsPagesWithContext(aws.Context, *ec2.DescribeFlowLogsInput, func(*ec2.DescribeFlowLogsOutput, bool) bool, ...request.Option) error + DescribeFpgaImageAttribute(*ec2.DescribeFpgaImageAttributeInput) (*ec2.DescribeFpgaImageAttributeOutput, error) DescribeFpgaImageAttributeWithContext(aws.Context, *ec2.DescribeFpgaImageAttributeInput, ...request.Option) (*ec2.DescribeFpgaImageAttributeOutput, error) DescribeFpgaImageAttributeRequest(*ec2.DescribeFpgaImageAttributeInput) (*request.Request, *ec2.DescribeFpgaImageAttributeOutput) @@ -652,22 +685,37 @@ type EC2API interface { DescribeFpgaImagesWithContext(aws.Context, *ec2.DescribeFpgaImagesInput, ...request.Option) (*ec2.DescribeFpgaImagesOutput, error) DescribeFpgaImagesRequest(*ec2.DescribeFpgaImagesInput) (*request.Request, *ec2.DescribeFpgaImagesOutput) + DescribeFpgaImagesPages(*ec2.DescribeFpgaImagesInput, func(*ec2.DescribeFpgaImagesOutput, bool) bool) error + DescribeFpgaImagesPagesWithContext(aws.Context, *ec2.DescribeFpgaImagesInput, func(*ec2.DescribeFpgaImagesOutput, bool) bool, ...request.Option) error + DescribeHostReservationOfferings(*ec2.DescribeHostReservationOfferingsInput) (*ec2.DescribeHostReservationOfferingsOutput, error) DescribeHostReservationOfferingsWithContext(aws.Context, *ec2.DescribeHostReservationOfferingsInput, ...request.Option) (*ec2.DescribeHostReservationOfferingsOutput, error) DescribeHostReservationOfferingsRequest(*ec2.DescribeHostReservationOfferingsInput) (*request.Request, *ec2.DescribeHostReservationOfferingsOutput) + DescribeHostReservationOfferingsPages(*ec2.DescribeHostReservationOfferingsInput, func(*ec2.DescribeHostReservationOfferingsOutput, bool) bool) error + DescribeHostReservationOfferingsPagesWithContext(aws.Context, *ec2.DescribeHostReservationOfferingsInput, func(*ec2.DescribeHostReservationOfferingsOutput, bool) bool, ...request.Option) error + DescribeHostReservations(*ec2.DescribeHostReservationsInput) (*ec2.DescribeHostReservationsOutput, error) DescribeHostReservationsWithContext(aws.Context, *ec2.DescribeHostReservationsInput, ...request.Option) (*ec2.DescribeHostReservationsOutput, error) DescribeHostReservationsRequest(*ec2.DescribeHostReservationsInput) (*request.Request, *ec2.DescribeHostReservationsOutput) + DescribeHostReservationsPages(*ec2.DescribeHostReservationsInput, func(*ec2.DescribeHostReservationsOutput, bool) bool) error + DescribeHostReservationsPagesWithContext(aws.Context, *ec2.DescribeHostReservationsInput, func(*ec2.DescribeHostReservationsOutput, bool) bool, ...request.Option) error + DescribeHosts(*ec2.DescribeHostsInput) (*ec2.DescribeHostsOutput, error) DescribeHostsWithContext(aws.Context, *ec2.DescribeHostsInput, ...request.Option) (*ec2.DescribeHostsOutput, error) DescribeHostsRequest(*ec2.DescribeHostsInput) (*request.Request, *ec2.DescribeHostsOutput) + DescribeHostsPages(*ec2.DescribeHostsInput, func(*ec2.DescribeHostsOutput, bool) bool) error + DescribeHostsPagesWithContext(aws.Context, *ec2.DescribeHostsInput, func(*ec2.DescribeHostsOutput, bool) bool, ...request.Option) error + DescribeIamInstanceProfileAssociations(*ec2.DescribeIamInstanceProfileAssociationsInput) (*ec2.DescribeIamInstanceProfileAssociationsOutput, error) DescribeIamInstanceProfileAssociationsWithContext(aws.Context, *ec2.DescribeIamInstanceProfileAssociationsInput, ...request.Option) (*ec2.DescribeIamInstanceProfileAssociationsOutput, error) DescribeIamInstanceProfileAssociationsRequest(*ec2.DescribeIamInstanceProfileAssociationsInput) (*request.Request, *ec2.DescribeIamInstanceProfileAssociationsOutput) + DescribeIamInstanceProfileAssociationsPages(*ec2.DescribeIamInstanceProfileAssociationsInput, func(*ec2.DescribeIamInstanceProfileAssociationsOutput, bool) bool) error + DescribeIamInstanceProfileAssociationsPagesWithContext(aws.Context, *ec2.DescribeIamInstanceProfileAssociationsInput, func(*ec2.DescribeIamInstanceProfileAssociationsOutput, bool) bool, ...request.Option) error + DescribeIdFormat(*ec2.DescribeIdFormatInput) (*ec2.DescribeIdFormatOutput, error) DescribeIdFormatWithContext(aws.Context, *ec2.DescribeIdFormatInput, ...request.Option) (*ec2.DescribeIdFormatOutput, error) DescribeIdFormatRequest(*ec2.DescribeIdFormatInput) (*request.Request, *ec2.DescribeIdFormatOutput) @@ -688,10 +736,16 @@ type EC2API interface { DescribeImportImageTasksWithContext(aws.Context, *ec2.DescribeImportImageTasksInput, ...request.Option) (*ec2.DescribeImportImageTasksOutput, error) DescribeImportImageTasksRequest(*ec2.DescribeImportImageTasksInput) (*request.Request, *ec2.DescribeImportImageTasksOutput) + DescribeImportImageTasksPages(*ec2.DescribeImportImageTasksInput, func(*ec2.DescribeImportImageTasksOutput, bool) bool) error + DescribeImportImageTasksPagesWithContext(aws.Context, *ec2.DescribeImportImageTasksInput, func(*ec2.DescribeImportImageTasksOutput, bool) bool, ...request.Option) error + DescribeImportSnapshotTasks(*ec2.DescribeImportSnapshotTasksInput) (*ec2.DescribeImportSnapshotTasksOutput, error) DescribeImportSnapshotTasksWithContext(aws.Context, *ec2.DescribeImportSnapshotTasksInput, ...request.Option) (*ec2.DescribeImportSnapshotTasksOutput, error) DescribeImportSnapshotTasksRequest(*ec2.DescribeImportSnapshotTasksInput) (*request.Request, *ec2.DescribeImportSnapshotTasksOutput) + DescribeImportSnapshotTasksPages(*ec2.DescribeImportSnapshotTasksInput, func(*ec2.DescribeImportSnapshotTasksOutput, bool) bool) error + DescribeImportSnapshotTasksPagesWithContext(aws.Context, *ec2.DescribeImportSnapshotTasksInput, func(*ec2.DescribeImportSnapshotTasksOutput, bool) bool, ...request.Option) error + DescribeInstanceAttribute(*ec2.DescribeInstanceAttributeInput) (*ec2.DescribeInstanceAttributeOutput, error) DescribeInstanceAttributeWithContext(aws.Context, *ec2.DescribeInstanceAttributeInput, ...request.Option) (*ec2.DescribeInstanceAttributeOutput, error) DescribeInstanceAttributeRequest(*ec2.DescribeInstanceAttributeInput) (*request.Request, *ec2.DescribeInstanceAttributeOutput) @@ -700,6 +754,9 @@ type EC2API interface { DescribeInstanceCreditSpecificationsWithContext(aws.Context, *ec2.DescribeInstanceCreditSpecificationsInput, ...request.Option) (*ec2.DescribeInstanceCreditSpecificationsOutput, error) DescribeInstanceCreditSpecificationsRequest(*ec2.DescribeInstanceCreditSpecificationsInput) (*request.Request, *ec2.DescribeInstanceCreditSpecificationsOutput) + DescribeInstanceCreditSpecificationsPages(*ec2.DescribeInstanceCreditSpecificationsInput, func(*ec2.DescribeInstanceCreditSpecificationsOutput, bool) bool) error + DescribeInstanceCreditSpecificationsPagesWithContext(aws.Context, *ec2.DescribeInstanceCreditSpecificationsInput, func(*ec2.DescribeInstanceCreditSpecificationsOutput, bool) bool, ...request.Option) error + DescribeInstanceStatus(*ec2.DescribeInstanceStatusInput) (*ec2.DescribeInstanceStatusOutput, error) DescribeInstanceStatusWithContext(aws.Context, *ec2.DescribeInstanceStatusInput, ...request.Option) (*ec2.DescribeInstanceStatusOutput, error) DescribeInstanceStatusRequest(*ec2.DescribeInstanceStatusInput) (*request.Request, *ec2.DescribeInstanceStatusOutput) @@ -718,6 +775,9 @@ type EC2API interface { DescribeInternetGatewaysWithContext(aws.Context, *ec2.DescribeInternetGatewaysInput, ...request.Option) (*ec2.DescribeInternetGatewaysOutput, error) DescribeInternetGatewaysRequest(*ec2.DescribeInternetGatewaysInput) (*request.Request, *ec2.DescribeInternetGatewaysOutput) + DescribeInternetGatewaysPages(*ec2.DescribeInternetGatewaysInput, func(*ec2.DescribeInternetGatewaysOutput, bool) bool) error + DescribeInternetGatewaysPagesWithContext(aws.Context, *ec2.DescribeInternetGatewaysInput, func(*ec2.DescribeInternetGatewaysOutput, bool) bool, ...request.Option) error + DescribeKeyPairs(*ec2.DescribeKeyPairsInput) (*ec2.DescribeKeyPairsOutput, error) DescribeKeyPairsWithContext(aws.Context, *ec2.DescribeKeyPairsInput, ...request.Option) (*ec2.DescribeKeyPairsOutput, error) DescribeKeyPairsRequest(*ec2.DescribeKeyPairsInput) (*request.Request, *ec2.DescribeKeyPairsOutput) @@ -726,14 +786,23 @@ type EC2API interface { DescribeLaunchTemplateVersionsWithContext(aws.Context, *ec2.DescribeLaunchTemplateVersionsInput, ...request.Option) (*ec2.DescribeLaunchTemplateVersionsOutput, error) DescribeLaunchTemplateVersionsRequest(*ec2.DescribeLaunchTemplateVersionsInput) (*request.Request, *ec2.DescribeLaunchTemplateVersionsOutput) + DescribeLaunchTemplateVersionsPages(*ec2.DescribeLaunchTemplateVersionsInput, func(*ec2.DescribeLaunchTemplateVersionsOutput, bool) bool) error + DescribeLaunchTemplateVersionsPagesWithContext(aws.Context, *ec2.DescribeLaunchTemplateVersionsInput, func(*ec2.DescribeLaunchTemplateVersionsOutput, bool) bool, ...request.Option) error + DescribeLaunchTemplates(*ec2.DescribeLaunchTemplatesInput) (*ec2.DescribeLaunchTemplatesOutput, error) DescribeLaunchTemplatesWithContext(aws.Context, *ec2.DescribeLaunchTemplatesInput, ...request.Option) (*ec2.DescribeLaunchTemplatesOutput, error) DescribeLaunchTemplatesRequest(*ec2.DescribeLaunchTemplatesInput) (*request.Request, *ec2.DescribeLaunchTemplatesOutput) + DescribeLaunchTemplatesPages(*ec2.DescribeLaunchTemplatesInput, func(*ec2.DescribeLaunchTemplatesOutput, bool) bool) error + DescribeLaunchTemplatesPagesWithContext(aws.Context, *ec2.DescribeLaunchTemplatesInput, func(*ec2.DescribeLaunchTemplatesOutput, bool) bool, ...request.Option) error + DescribeMovingAddresses(*ec2.DescribeMovingAddressesInput) (*ec2.DescribeMovingAddressesOutput, error) DescribeMovingAddressesWithContext(aws.Context, *ec2.DescribeMovingAddressesInput, ...request.Option) (*ec2.DescribeMovingAddressesOutput, error) DescribeMovingAddressesRequest(*ec2.DescribeMovingAddressesInput) (*request.Request, *ec2.DescribeMovingAddressesOutput) + DescribeMovingAddressesPages(*ec2.DescribeMovingAddressesInput, func(*ec2.DescribeMovingAddressesOutput, bool) bool) error + DescribeMovingAddressesPagesWithContext(aws.Context, *ec2.DescribeMovingAddressesInput, func(*ec2.DescribeMovingAddressesOutput, bool) bool, ...request.Option) error + DescribeNatGateways(*ec2.DescribeNatGatewaysInput) (*ec2.DescribeNatGatewaysOutput, error) DescribeNatGatewaysWithContext(aws.Context, *ec2.DescribeNatGatewaysInput, ...request.Option) (*ec2.DescribeNatGatewaysOutput, error) DescribeNatGatewaysRequest(*ec2.DescribeNatGatewaysInput) (*request.Request, *ec2.DescribeNatGatewaysOutput) @@ -745,6 +814,9 @@ type EC2API interface { DescribeNetworkAclsWithContext(aws.Context, *ec2.DescribeNetworkAclsInput, ...request.Option) (*ec2.DescribeNetworkAclsOutput, error) DescribeNetworkAclsRequest(*ec2.DescribeNetworkAclsInput) (*request.Request, *ec2.DescribeNetworkAclsOutput) + DescribeNetworkAclsPages(*ec2.DescribeNetworkAclsInput, func(*ec2.DescribeNetworkAclsOutput, bool) bool) error + DescribeNetworkAclsPagesWithContext(aws.Context, *ec2.DescribeNetworkAclsInput, func(*ec2.DescribeNetworkAclsOutput, bool) bool, ...request.Option) error + DescribeNetworkInterfaceAttribute(*ec2.DescribeNetworkInterfaceAttributeInput) (*ec2.DescribeNetworkInterfaceAttributeOutput, error) DescribeNetworkInterfaceAttributeWithContext(aws.Context, *ec2.DescribeNetworkInterfaceAttributeInput, ...request.Option) (*ec2.DescribeNetworkInterfaceAttributeOutput, error) DescribeNetworkInterfaceAttributeRequest(*ec2.DescribeNetworkInterfaceAttributeInput) (*request.Request, *ec2.DescribeNetworkInterfaceAttributeOutput) @@ -753,6 +825,9 @@ type EC2API interface { DescribeNetworkInterfacePermissionsWithContext(aws.Context, *ec2.DescribeNetworkInterfacePermissionsInput, ...request.Option) (*ec2.DescribeNetworkInterfacePermissionsOutput, error) DescribeNetworkInterfacePermissionsRequest(*ec2.DescribeNetworkInterfacePermissionsInput) (*request.Request, *ec2.DescribeNetworkInterfacePermissionsOutput) + DescribeNetworkInterfacePermissionsPages(*ec2.DescribeNetworkInterfacePermissionsInput, func(*ec2.DescribeNetworkInterfacePermissionsOutput, bool) bool) error + DescribeNetworkInterfacePermissionsPagesWithContext(aws.Context, *ec2.DescribeNetworkInterfacePermissionsInput, func(*ec2.DescribeNetworkInterfacePermissionsOutput, bool) bool, ...request.Option) error + DescribeNetworkInterfaces(*ec2.DescribeNetworkInterfacesInput) (*ec2.DescribeNetworkInterfacesOutput, error) DescribeNetworkInterfacesWithContext(aws.Context, *ec2.DescribeNetworkInterfacesInput, ...request.Option) (*ec2.DescribeNetworkInterfacesOutput, error) DescribeNetworkInterfacesRequest(*ec2.DescribeNetworkInterfacesInput) (*request.Request, *ec2.DescribeNetworkInterfacesOutput) @@ -768,14 +843,23 @@ type EC2API interface { DescribePrefixListsWithContext(aws.Context, *ec2.DescribePrefixListsInput, ...request.Option) (*ec2.DescribePrefixListsOutput, error) DescribePrefixListsRequest(*ec2.DescribePrefixListsInput) (*request.Request, *ec2.DescribePrefixListsOutput) + DescribePrefixListsPages(*ec2.DescribePrefixListsInput, func(*ec2.DescribePrefixListsOutput, bool) bool) error + DescribePrefixListsPagesWithContext(aws.Context, *ec2.DescribePrefixListsInput, func(*ec2.DescribePrefixListsOutput, bool) bool, ...request.Option) error + DescribePrincipalIdFormat(*ec2.DescribePrincipalIdFormatInput) (*ec2.DescribePrincipalIdFormatOutput, error) DescribePrincipalIdFormatWithContext(aws.Context, *ec2.DescribePrincipalIdFormatInput, ...request.Option) (*ec2.DescribePrincipalIdFormatOutput, error) DescribePrincipalIdFormatRequest(*ec2.DescribePrincipalIdFormatInput) (*request.Request, *ec2.DescribePrincipalIdFormatOutput) + DescribePrincipalIdFormatPages(*ec2.DescribePrincipalIdFormatInput, func(*ec2.DescribePrincipalIdFormatOutput, bool) bool) error + DescribePrincipalIdFormatPagesWithContext(aws.Context, *ec2.DescribePrincipalIdFormatInput, func(*ec2.DescribePrincipalIdFormatOutput, bool) bool, ...request.Option) error + DescribePublicIpv4Pools(*ec2.DescribePublicIpv4PoolsInput) (*ec2.DescribePublicIpv4PoolsOutput, error) DescribePublicIpv4PoolsWithContext(aws.Context, *ec2.DescribePublicIpv4PoolsInput, ...request.Option) (*ec2.DescribePublicIpv4PoolsOutput, error) DescribePublicIpv4PoolsRequest(*ec2.DescribePublicIpv4PoolsInput) (*request.Request, *ec2.DescribePublicIpv4PoolsOutput) + DescribePublicIpv4PoolsPages(*ec2.DescribePublicIpv4PoolsInput, func(*ec2.DescribePublicIpv4PoolsOutput, bool) bool) error + DescribePublicIpv4PoolsPagesWithContext(aws.Context, *ec2.DescribePublicIpv4PoolsInput, func(*ec2.DescribePublicIpv4PoolsOutput, bool) bool, ...request.Option) error + DescribeRegions(*ec2.DescribeRegionsInput) (*ec2.DescribeRegionsOutput, error) DescribeRegionsWithContext(aws.Context, *ec2.DescribeRegionsInput, ...request.Option) (*ec2.DescribeRegionsOutput, error) DescribeRegionsRequest(*ec2.DescribeRegionsInput) (*request.Request, *ec2.DescribeRegionsOutput) @@ -813,10 +897,16 @@ type EC2API interface { DescribeScheduledInstanceAvailabilityWithContext(aws.Context, *ec2.DescribeScheduledInstanceAvailabilityInput, ...request.Option) (*ec2.DescribeScheduledInstanceAvailabilityOutput, error) DescribeScheduledInstanceAvailabilityRequest(*ec2.DescribeScheduledInstanceAvailabilityInput) (*request.Request, *ec2.DescribeScheduledInstanceAvailabilityOutput) + DescribeScheduledInstanceAvailabilityPages(*ec2.DescribeScheduledInstanceAvailabilityInput, func(*ec2.DescribeScheduledInstanceAvailabilityOutput, bool) bool) error + DescribeScheduledInstanceAvailabilityPagesWithContext(aws.Context, *ec2.DescribeScheduledInstanceAvailabilityInput, func(*ec2.DescribeScheduledInstanceAvailabilityOutput, bool) bool, ...request.Option) error + DescribeScheduledInstances(*ec2.DescribeScheduledInstancesInput) (*ec2.DescribeScheduledInstancesOutput, error) DescribeScheduledInstancesWithContext(aws.Context, *ec2.DescribeScheduledInstancesInput, ...request.Option) (*ec2.DescribeScheduledInstancesOutput, error) DescribeScheduledInstancesRequest(*ec2.DescribeScheduledInstancesInput) (*request.Request, *ec2.DescribeScheduledInstancesOutput) + DescribeScheduledInstancesPages(*ec2.DescribeScheduledInstancesInput, func(*ec2.DescribeScheduledInstancesOutput, bool) bool) error + DescribeScheduledInstancesPagesWithContext(aws.Context, *ec2.DescribeScheduledInstancesInput, func(*ec2.DescribeScheduledInstancesOutput, bool) bool, ...request.Option) error + DescribeSecurityGroupReferences(*ec2.DescribeSecurityGroupReferencesInput) (*ec2.DescribeSecurityGroupReferencesOutput, error) DescribeSecurityGroupReferencesWithContext(aws.Context, *ec2.DescribeSecurityGroupReferencesInput, ...request.Option) (*ec2.DescribeSecurityGroupReferencesOutput, error) DescribeSecurityGroupReferencesRequest(*ec2.DescribeSecurityGroupReferencesInput) (*request.Request, *ec2.DescribeSecurityGroupReferencesOutput) @@ -862,6 +952,9 @@ type EC2API interface { DescribeSpotInstanceRequestsWithContext(aws.Context, *ec2.DescribeSpotInstanceRequestsInput, ...request.Option) (*ec2.DescribeSpotInstanceRequestsOutput, error) DescribeSpotInstanceRequestsRequest(*ec2.DescribeSpotInstanceRequestsInput) (*request.Request, *ec2.DescribeSpotInstanceRequestsOutput) + DescribeSpotInstanceRequestsPages(*ec2.DescribeSpotInstanceRequestsInput, func(*ec2.DescribeSpotInstanceRequestsOutput, bool) bool) error + DescribeSpotInstanceRequestsPagesWithContext(aws.Context, *ec2.DescribeSpotInstanceRequestsInput, func(*ec2.DescribeSpotInstanceRequestsOutput, bool) bool, ...request.Option) error + DescribeSpotPriceHistory(*ec2.DescribeSpotPriceHistoryInput) (*ec2.DescribeSpotPriceHistoryOutput, error) DescribeSpotPriceHistoryWithContext(aws.Context, *ec2.DescribeSpotPriceHistoryInput, ...request.Option) (*ec2.DescribeSpotPriceHistoryOutput, error) DescribeSpotPriceHistoryRequest(*ec2.DescribeSpotPriceHistoryInput) (*request.Request, *ec2.DescribeSpotPriceHistoryOutput) @@ -873,6 +966,9 @@ type EC2API interface { DescribeStaleSecurityGroupsWithContext(aws.Context, *ec2.DescribeStaleSecurityGroupsInput, ...request.Option) (*ec2.DescribeStaleSecurityGroupsOutput, error) DescribeStaleSecurityGroupsRequest(*ec2.DescribeStaleSecurityGroupsInput) (*request.Request, *ec2.DescribeStaleSecurityGroupsOutput) + DescribeStaleSecurityGroupsPages(*ec2.DescribeStaleSecurityGroupsInput, func(*ec2.DescribeStaleSecurityGroupsOutput, bool) bool) error + DescribeStaleSecurityGroupsPagesWithContext(aws.Context, *ec2.DescribeStaleSecurityGroupsInput, func(*ec2.DescribeStaleSecurityGroupsOutput, bool) bool, ...request.Option) error + DescribeSubnets(*ec2.DescribeSubnetsInput) (*ec2.DescribeSubnetsOutput, error) DescribeSubnetsWithContext(aws.Context, *ec2.DescribeSubnetsInput, ...request.Option) (*ec2.DescribeSubnetsOutput, error) DescribeSubnetsRequest(*ec2.DescribeSubnetsInput) (*request.Request, *ec2.DescribeSubnetsOutput) @@ -888,18 +984,30 @@ type EC2API interface { DescribeTransitGatewayAttachmentsWithContext(aws.Context, *ec2.DescribeTransitGatewayAttachmentsInput, ...request.Option) (*ec2.DescribeTransitGatewayAttachmentsOutput, error) DescribeTransitGatewayAttachmentsRequest(*ec2.DescribeTransitGatewayAttachmentsInput) (*request.Request, *ec2.DescribeTransitGatewayAttachmentsOutput) + DescribeTransitGatewayAttachmentsPages(*ec2.DescribeTransitGatewayAttachmentsInput, func(*ec2.DescribeTransitGatewayAttachmentsOutput, bool) bool) error + DescribeTransitGatewayAttachmentsPagesWithContext(aws.Context, *ec2.DescribeTransitGatewayAttachmentsInput, func(*ec2.DescribeTransitGatewayAttachmentsOutput, bool) bool, ...request.Option) error + DescribeTransitGatewayRouteTables(*ec2.DescribeTransitGatewayRouteTablesInput) (*ec2.DescribeTransitGatewayRouteTablesOutput, error) DescribeTransitGatewayRouteTablesWithContext(aws.Context, *ec2.DescribeTransitGatewayRouteTablesInput, ...request.Option) (*ec2.DescribeTransitGatewayRouteTablesOutput, error) DescribeTransitGatewayRouteTablesRequest(*ec2.DescribeTransitGatewayRouteTablesInput) (*request.Request, *ec2.DescribeTransitGatewayRouteTablesOutput) + DescribeTransitGatewayRouteTablesPages(*ec2.DescribeTransitGatewayRouteTablesInput, func(*ec2.DescribeTransitGatewayRouteTablesOutput, bool) bool) error + DescribeTransitGatewayRouteTablesPagesWithContext(aws.Context, *ec2.DescribeTransitGatewayRouteTablesInput, func(*ec2.DescribeTransitGatewayRouteTablesOutput, bool) bool, ...request.Option) error + DescribeTransitGatewayVpcAttachments(*ec2.DescribeTransitGatewayVpcAttachmentsInput) (*ec2.DescribeTransitGatewayVpcAttachmentsOutput, error) DescribeTransitGatewayVpcAttachmentsWithContext(aws.Context, *ec2.DescribeTransitGatewayVpcAttachmentsInput, ...request.Option) (*ec2.DescribeTransitGatewayVpcAttachmentsOutput, error) DescribeTransitGatewayVpcAttachmentsRequest(*ec2.DescribeTransitGatewayVpcAttachmentsInput) (*request.Request, *ec2.DescribeTransitGatewayVpcAttachmentsOutput) + DescribeTransitGatewayVpcAttachmentsPages(*ec2.DescribeTransitGatewayVpcAttachmentsInput, func(*ec2.DescribeTransitGatewayVpcAttachmentsOutput, bool) bool) error + DescribeTransitGatewayVpcAttachmentsPagesWithContext(aws.Context, *ec2.DescribeTransitGatewayVpcAttachmentsInput, func(*ec2.DescribeTransitGatewayVpcAttachmentsOutput, bool) bool, ...request.Option) error + DescribeTransitGateways(*ec2.DescribeTransitGatewaysInput) (*ec2.DescribeTransitGatewaysOutput, error) DescribeTransitGatewaysWithContext(aws.Context, *ec2.DescribeTransitGatewaysInput, ...request.Option) (*ec2.DescribeTransitGatewaysOutput, error) DescribeTransitGatewaysRequest(*ec2.DescribeTransitGatewaysInput) (*request.Request, *ec2.DescribeTransitGatewaysOutput) + DescribeTransitGatewaysPages(*ec2.DescribeTransitGatewaysInput, func(*ec2.DescribeTransitGatewaysOutput, bool) bool) error + DescribeTransitGatewaysPagesWithContext(aws.Context, *ec2.DescribeTransitGatewaysInput, func(*ec2.DescribeTransitGatewaysOutput, bool) bool, ...request.Option) error + DescribeVolumeAttribute(*ec2.DescribeVolumeAttributeInput) (*ec2.DescribeVolumeAttributeOutput, error) DescribeVolumeAttributeWithContext(aws.Context, *ec2.DescribeVolumeAttributeInput, ...request.Option) (*ec2.DescribeVolumeAttributeOutput, error) DescribeVolumeAttributeRequest(*ec2.DescribeVolumeAttributeInput) (*request.Request, *ec2.DescribeVolumeAttributeOutput) @@ -922,6 +1030,9 @@ type EC2API interface { DescribeVolumesModificationsWithContext(aws.Context, *ec2.DescribeVolumesModificationsInput, ...request.Option) (*ec2.DescribeVolumesModificationsOutput, error) DescribeVolumesModificationsRequest(*ec2.DescribeVolumesModificationsInput) (*request.Request, *ec2.DescribeVolumesModificationsOutput) + DescribeVolumesModificationsPages(*ec2.DescribeVolumesModificationsInput, func(*ec2.DescribeVolumesModificationsOutput, bool) bool) error + DescribeVolumesModificationsPagesWithContext(aws.Context, *ec2.DescribeVolumesModificationsInput, func(*ec2.DescribeVolumesModificationsOutput, bool) bool, ...request.Option) error + DescribeVpcAttribute(*ec2.DescribeVpcAttributeInput) (*ec2.DescribeVpcAttributeOutput, error) DescribeVpcAttributeWithContext(aws.Context, *ec2.DescribeVpcAttributeInput, ...request.Option) (*ec2.DescribeVpcAttributeOutput, error) DescribeVpcAttributeRequest(*ec2.DescribeVpcAttributeInput) (*request.Request, *ec2.DescribeVpcAttributeOutput) @@ -934,22 +1045,37 @@ type EC2API interface { DescribeVpcClassicLinkDnsSupportWithContext(aws.Context, *ec2.DescribeVpcClassicLinkDnsSupportInput, ...request.Option) (*ec2.DescribeVpcClassicLinkDnsSupportOutput, error) DescribeVpcClassicLinkDnsSupportRequest(*ec2.DescribeVpcClassicLinkDnsSupportInput) (*request.Request, *ec2.DescribeVpcClassicLinkDnsSupportOutput) + DescribeVpcClassicLinkDnsSupportPages(*ec2.DescribeVpcClassicLinkDnsSupportInput, func(*ec2.DescribeVpcClassicLinkDnsSupportOutput, bool) bool) error + DescribeVpcClassicLinkDnsSupportPagesWithContext(aws.Context, *ec2.DescribeVpcClassicLinkDnsSupportInput, func(*ec2.DescribeVpcClassicLinkDnsSupportOutput, bool) bool, ...request.Option) error + DescribeVpcEndpointConnectionNotifications(*ec2.DescribeVpcEndpointConnectionNotificationsInput) (*ec2.DescribeVpcEndpointConnectionNotificationsOutput, error) DescribeVpcEndpointConnectionNotificationsWithContext(aws.Context, *ec2.DescribeVpcEndpointConnectionNotificationsInput, ...request.Option) (*ec2.DescribeVpcEndpointConnectionNotificationsOutput, error) DescribeVpcEndpointConnectionNotificationsRequest(*ec2.DescribeVpcEndpointConnectionNotificationsInput) (*request.Request, *ec2.DescribeVpcEndpointConnectionNotificationsOutput) + DescribeVpcEndpointConnectionNotificationsPages(*ec2.DescribeVpcEndpointConnectionNotificationsInput, func(*ec2.DescribeVpcEndpointConnectionNotificationsOutput, bool) bool) error + DescribeVpcEndpointConnectionNotificationsPagesWithContext(aws.Context, *ec2.DescribeVpcEndpointConnectionNotificationsInput, func(*ec2.DescribeVpcEndpointConnectionNotificationsOutput, bool) bool, ...request.Option) error + DescribeVpcEndpointConnections(*ec2.DescribeVpcEndpointConnectionsInput) (*ec2.DescribeVpcEndpointConnectionsOutput, error) DescribeVpcEndpointConnectionsWithContext(aws.Context, *ec2.DescribeVpcEndpointConnectionsInput, ...request.Option) (*ec2.DescribeVpcEndpointConnectionsOutput, error) DescribeVpcEndpointConnectionsRequest(*ec2.DescribeVpcEndpointConnectionsInput) (*request.Request, *ec2.DescribeVpcEndpointConnectionsOutput) + DescribeVpcEndpointConnectionsPages(*ec2.DescribeVpcEndpointConnectionsInput, func(*ec2.DescribeVpcEndpointConnectionsOutput, bool) bool) error + DescribeVpcEndpointConnectionsPagesWithContext(aws.Context, *ec2.DescribeVpcEndpointConnectionsInput, func(*ec2.DescribeVpcEndpointConnectionsOutput, bool) bool, ...request.Option) error + DescribeVpcEndpointServiceConfigurations(*ec2.DescribeVpcEndpointServiceConfigurationsInput) (*ec2.DescribeVpcEndpointServiceConfigurationsOutput, error) DescribeVpcEndpointServiceConfigurationsWithContext(aws.Context, *ec2.DescribeVpcEndpointServiceConfigurationsInput, ...request.Option) (*ec2.DescribeVpcEndpointServiceConfigurationsOutput, error) DescribeVpcEndpointServiceConfigurationsRequest(*ec2.DescribeVpcEndpointServiceConfigurationsInput) (*request.Request, *ec2.DescribeVpcEndpointServiceConfigurationsOutput) + DescribeVpcEndpointServiceConfigurationsPages(*ec2.DescribeVpcEndpointServiceConfigurationsInput, func(*ec2.DescribeVpcEndpointServiceConfigurationsOutput, bool) bool) error + DescribeVpcEndpointServiceConfigurationsPagesWithContext(aws.Context, *ec2.DescribeVpcEndpointServiceConfigurationsInput, func(*ec2.DescribeVpcEndpointServiceConfigurationsOutput, bool) bool, ...request.Option) error + DescribeVpcEndpointServicePermissions(*ec2.DescribeVpcEndpointServicePermissionsInput) (*ec2.DescribeVpcEndpointServicePermissionsOutput, error) DescribeVpcEndpointServicePermissionsWithContext(aws.Context, *ec2.DescribeVpcEndpointServicePermissionsInput, ...request.Option) (*ec2.DescribeVpcEndpointServicePermissionsOutput, error) DescribeVpcEndpointServicePermissionsRequest(*ec2.DescribeVpcEndpointServicePermissionsInput) (*request.Request, *ec2.DescribeVpcEndpointServicePermissionsOutput) + DescribeVpcEndpointServicePermissionsPages(*ec2.DescribeVpcEndpointServicePermissionsInput, func(*ec2.DescribeVpcEndpointServicePermissionsOutput, bool) bool) error + DescribeVpcEndpointServicePermissionsPagesWithContext(aws.Context, *ec2.DescribeVpcEndpointServicePermissionsInput, func(*ec2.DescribeVpcEndpointServicePermissionsOutput, bool) bool, ...request.Option) error + DescribeVpcEndpointServices(*ec2.DescribeVpcEndpointServicesInput) (*ec2.DescribeVpcEndpointServicesOutput, error) DescribeVpcEndpointServicesWithContext(aws.Context, *ec2.DescribeVpcEndpointServicesInput, ...request.Option) (*ec2.DescribeVpcEndpointServicesOutput, error) DescribeVpcEndpointServicesRequest(*ec2.DescribeVpcEndpointServicesInput) (*request.Request, *ec2.DescribeVpcEndpointServicesOutput) @@ -958,14 +1084,23 @@ type EC2API interface { DescribeVpcEndpointsWithContext(aws.Context, *ec2.DescribeVpcEndpointsInput, ...request.Option) (*ec2.DescribeVpcEndpointsOutput, error) DescribeVpcEndpointsRequest(*ec2.DescribeVpcEndpointsInput) (*request.Request, *ec2.DescribeVpcEndpointsOutput) + DescribeVpcEndpointsPages(*ec2.DescribeVpcEndpointsInput, func(*ec2.DescribeVpcEndpointsOutput, bool) bool) error + DescribeVpcEndpointsPagesWithContext(aws.Context, *ec2.DescribeVpcEndpointsInput, func(*ec2.DescribeVpcEndpointsOutput, bool) bool, ...request.Option) error + DescribeVpcPeeringConnections(*ec2.DescribeVpcPeeringConnectionsInput) (*ec2.DescribeVpcPeeringConnectionsOutput, error) DescribeVpcPeeringConnectionsWithContext(aws.Context, *ec2.DescribeVpcPeeringConnectionsInput, ...request.Option) (*ec2.DescribeVpcPeeringConnectionsOutput, error) DescribeVpcPeeringConnectionsRequest(*ec2.DescribeVpcPeeringConnectionsInput) (*request.Request, *ec2.DescribeVpcPeeringConnectionsOutput) + DescribeVpcPeeringConnectionsPages(*ec2.DescribeVpcPeeringConnectionsInput, func(*ec2.DescribeVpcPeeringConnectionsOutput, bool) bool) error + DescribeVpcPeeringConnectionsPagesWithContext(aws.Context, *ec2.DescribeVpcPeeringConnectionsInput, func(*ec2.DescribeVpcPeeringConnectionsOutput, bool) bool, ...request.Option) error + DescribeVpcs(*ec2.DescribeVpcsInput) (*ec2.DescribeVpcsOutput, error) DescribeVpcsWithContext(aws.Context, *ec2.DescribeVpcsInput, ...request.Option) (*ec2.DescribeVpcsOutput, error) DescribeVpcsRequest(*ec2.DescribeVpcsInput) (*request.Request, *ec2.DescribeVpcsOutput) + DescribeVpcsPages(*ec2.DescribeVpcsInput, func(*ec2.DescribeVpcsOutput, bool) bool) error + DescribeVpcsPagesWithContext(aws.Context, *ec2.DescribeVpcsInput, func(*ec2.DescribeVpcsOutput, bool) bool, ...request.Option) error + DescribeVpnConnections(*ec2.DescribeVpnConnectionsInput) (*ec2.DescribeVpnConnectionsOutput, error) DescribeVpnConnectionsWithContext(aws.Context, *ec2.DescribeVpnConnectionsInput, ...request.Option) (*ec2.DescribeVpnConnectionsOutput, error) DescribeVpnConnectionsRequest(*ec2.DescribeVpnConnectionsInput) (*request.Request, *ec2.DescribeVpnConnectionsOutput) @@ -1098,14 +1233,23 @@ type EC2API interface { GetTransitGatewayAttachmentPropagationsWithContext(aws.Context, *ec2.GetTransitGatewayAttachmentPropagationsInput, ...request.Option) (*ec2.GetTransitGatewayAttachmentPropagationsOutput, error) GetTransitGatewayAttachmentPropagationsRequest(*ec2.GetTransitGatewayAttachmentPropagationsInput) (*request.Request, *ec2.GetTransitGatewayAttachmentPropagationsOutput) + GetTransitGatewayAttachmentPropagationsPages(*ec2.GetTransitGatewayAttachmentPropagationsInput, func(*ec2.GetTransitGatewayAttachmentPropagationsOutput, bool) bool) error + GetTransitGatewayAttachmentPropagationsPagesWithContext(aws.Context, *ec2.GetTransitGatewayAttachmentPropagationsInput, func(*ec2.GetTransitGatewayAttachmentPropagationsOutput, bool) bool, ...request.Option) error + GetTransitGatewayRouteTableAssociations(*ec2.GetTransitGatewayRouteTableAssociationsInput) (*ec2.GetTransitGatewayRouteTableAssociationsOutput, error) GetTransitGatewayRouteTableAssociationsWithContext(aws.Context, *ec2.GetTransitGatewayRouteTableAssociationsInput, ...request.Option) (*ec2.GetTransitGatewayRouteTableAssociationsOutput, error) GetTransitGatewayRouteTableAssociationsRequest(*ec2.GetTransitGatewayRouteTableAssociationsInput) (*request.Request, *ec2.GetTransitGatewayRouteTableAssociationsOutput) + GetTransitGatewayRouteTableAssociationsPages(*ec2.GetTransitGatewayRouteTableAssociationsInput, func(*ec2.GetTransitGatewayRouteTableAssociationsOutput, bool) bool) error + GetTransitGatewayRouteTableAssociationsPagesWithContext(aws.Context, *ec2.GetTransitGatewayRouteTableAssociationsInput, func(*ec2.GetTransitGatewayRouteTableAssociationsOutput, bool) bool, ...request.Option) error + GetTransitGatewayRouteTablePropagations(*ec2.GetTransitGatewayRouteTablePropagationsInput) (*ec2.GetTransitGatewayRouteTablePropagationsOutput, error) GetTransitGatewayRouteTablePropagationsWithContext(aws.Context, *ec2.GetTransitGatewayRouteTablePropagationsInput, ...request.Option) (*ec2.GetTransitGatewayRouteTablePropagationsOutput, error) GetTransitGatewayRouteTablePropagationsRequest(*ec2.GetTransitGatewayRouteTablePropagationsInput) (*request.Request, *ec2.GetTransitGatewayRouteTablePropagationsOutput) + GetTransitGatewayRouteTablePropagationsPages(*ec2.GetTransitGatewayRouteTablePropagationsInput, func(*ec2.GetTransitGatewayRouteTablePropagationsOutput, bool) bool) error + GetTransitGatewayRouteTablePropagationsPagesWithContext(aws.Context, *ec2.GetTransitGatewayRouteTablePropagationsInput, func(*ec2.GetTransitGatewayRouteTablePropagationsOutput, bool) bool, ...request.Option) error + ImportClientVpnClientCertificateRevocationList(*ec2.ImportClientVpnClientCertificateRevocationListInput) (*ec2.ImportClientVpnClientCertificateRevocationListOutput, error) ImportClientVpnClientCertificateRevocationListWithContext(aws.Context, *ec2.ImportClientVpnClientCertificateRevocationListInput, ...request.Option) (*ec2.ImportClientVpnClientCertificateRevocationListOutput, error) ImportClientVpnClientCertificateRevocationListRequest(*ec2.ImportClientVpnClientCertificateRevocationListInput) (*request.Request, *ec2.ImportClientVpnClientCertificateRevocationListOutput) @@ -1174,6 +1318,10 @@ type EC2API interface { ModifyInstanceCreditSpecificationWithContext(aws.Context, *ec2.ModifyInstanceCreditSpecificationInput, ...request.Option) (*ec2.ModifyInstanceCreditSpecificationOutput, error) ModifyInstanceCreditSpecificationRequest(*ec2.ModifyInstanceCreditSpecificationInput) (*request.Request, *ec2.ModifyInstanceCreditSpecificationOutput) + ModifyInstanceEventStartTime(*ec2.ModifyInstanceEventStartTimeInput) (*ec2.ModifyInstanceEventStartTimeOutput, error) + ModifyInstanceEventStartTimeWithContext(aws.Context, *ec2.ModifyInstanceEventStartTimeInput, ...request.Option) (*ec2.ModifyInstanceEventStartTimeOutput, error) + ModifyInstanceEventStartTimeRequest(*ec2.ModifyInstanceEventStartTimeInput) (*request.Request, *ec2.ModifyInstanceEventStartTimeOutput) + ModifyInstancePlacement(*ec2.ModifyInstancePlacementInput) (*ec2.ModifyInstancePlacementOutput, error) ModifyInstancePlacementWithContext(aws.Context, *ec2.ModifyInstancePlacementInput, ...request.Option) (*ec2.ModifyInstancePlacementOutput, error) ModifyInstancePlacementRequest(*ec2.ModifyInstancePlacementInput) (*request.Request, *ec2.ModifyInstancePlacementOutput) diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/service/sts/BUILD.bazel index 6e9732abff..355e5d3198 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/BUILD.bazel +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/BUILD.bazel @@ -4,7 +4,6 @@ go_library( name = "go_default_library", srcs = [ "api.go", - "customizations.go", "doc.go", "errors.go", "service.go", @@ -17,6 +16,7 @@ go_library( "//vendor/github.com/aws/aws-sdk-go/aws/awsutil:go_default_library", "//vendor/github.com/aws/aws-sdk-go/aws/client:go_default_library", "//vendor/github.com/aws/aws-sdk-go/aws/client/metadata:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/credentials:go_default_library", "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", "//vendor/github.com/aws/aws-sdk-go/aws/signer/v4:go_default_library", "//vendor/github.com/aws/aws-sdk-go/private/protocol/query:go_default_library", 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 ee908f9167..8113089649 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 @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/request" ) @@ -243,6 +244,7 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re output = &AssumeRoleWithSAMLOutput{} req = c.newRequest(op, input, output) + req.Config.Credentials = credentials.AnonymousCredentials return } @@ -425,6 +427,7 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI output = &AssumeRoleWithWebIdentityOutput{} req = c.newRequest(op, input, output) + req.Config.Credentials = credentials.AnonymousCredentials return } 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 deleted file mode 100644 index 4010cc7fa1..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go +++ /dev/null @@ -1,12 +0,0 @@ -package sts - -import "github.com/aws/aws-sdk-go/aws/request" - -func init() { - initRequest = func(r *request.Request) { - switch r.Operation.Name { - case opAssumeRoleWithSAML, opAssumeRoleWithWebIdentity: - r.Handlers.Sign.Clear() // these operations are unsigned - } - } -} diff --git a/vendor/k8s.io/component-base/LICENSE b/vendor/k8s.io/component-base/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/vendor/k8s.io/component-base/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/k8s.io/component-base/cli/flag/BUILD.bazel b/vendor/k8s.io/component-base/cli/flag/BUILD.bazel new file mode 100644 index 0000000000..78b437887d --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/BUILD.bazel @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "ciphersuites_flag.go", + "colon_separated_multimap_string_string.go", + "configuration_map.go", + "flags.go", + "langle_separated_map_string_string.go", + "map_string_bool.go", + "map_string_string.go", + "namedcertkey_flag.go", + "noop.go", + "omitempty.go", + "sectioned.go", + "string_flag.go", + "tristate.go", + ], + importmap = "sigs.k8s.io/cluster-api-provider-aws/vendor/k8s.io/component-base/cli/flag", + importpath = "k8s.io/component-base/cli/flag", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", + "//vendor/k8s.io/klog:go_default_library", + ], +) diff --git a/vendor/k8s.io/component-base/cli/flag/ciphersuites_flag.go b/vendor/k8s.io/component-base/cli/flag/ciphersuites_flag.go new file mode 100644 index 0000000000..764747c259 --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/ciphersuites_flag.go @@ -0,0 +1,105 @@ +/* +Copyright 2017 The Kubernetes Authors. + +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 flag + +import ( + "crypto/tls" + "fmt" + + "k8s.io/apimachinery/pkg/util/sets" +) + +// ciphers maps strings into tls package cipher constants in +// https://golang.org/pkg/crypto/tls/#pkg-constants +var ciphers = map[string]uint16{ + "TLS_RSA_WITH_RC4_128_SHA": tls.TLS_RSA_WITH_RC4_128_SHA, + "TLS_RSA_WITH_3DES_EDE_CBC_SHA": tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA, + "TLS_RSA_WITH_AES_128_CBC_SHA": tls.TLS_RSA_WITH_AES_128_CBC_SHA, + "TLS_RSA_WITH_AES_256_CBC_SHA": tls.TLS_RSA_WITH_AES_256_CBC_SHA, + "TLS_RSA_WITH_AES_128_CBC_SHA256": tls.TLS_RSA_WITH_AES_128_CBC_SHA256, + "TLS_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_RSA_WITH_AES_128_GCM_SHA256, + "TLS_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_RSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA": tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA": tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + "TLS_ECDHE_RSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA, + "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256": tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305": tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, + "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305": tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, +} + +func TLSCipherPossibleValues() []string { + cipherKeys := sets.NewString() + for key := range ciphers { + cipherKeys.Insert(key) + } + return cipherKeys.List() +} + +func TLSCipherSuites(cipherNames []string) ([]uint16, error) { + if len(cipherNames) == 0 { + return nil, nil + } + ciphersIntSlice := make([]uint16, 0) + for _, cipher := range cipherNames { + intValue, ok := ciphers[cipher] + if !ok { + return nil, fmt.Errorf("Cipher suite %s not supported or doesn't exist", cipher) + } + ciphersIntSlice = append(ciphersIntSlice, intValue) + } + return ciphersIntSlice, nil +} + +var versions = map[string]uint16{ + "VersionTLS10": tls.VersionTLS10, + "VersionTLS11": tls.VersionTLS11, + "VersionTLS12": tls.VersionTLS12, +} + +func TLSPossibleVersions() []string { + versionsKeys := sets.NewString() + for key := range versions { + versionsKeys.Insert(key) + } + return versionsKeys.List() +} + +func TLSVersion(versionName string) (uint16, error) { + if len(versionName) == 0 { + return DefaultTLSVersion(), nil + } + if version, ok := versions[versionName]; ok { + return version, nil + } + return 0, fmt.Errorf("unknown tls version %q", versionName) +} + +func DefaultTLSVersion() uint16 { + // Can't use SSLv3 because of POODLE and BEAST + // Can't use TLSv1.0 because of POODLE and BEAST using CBC cipher + // Can't use TLSv1.1 because of RC4 cipher usage + return tls.VersionTLS12 +} diff --git a/vendor/k8s.io/component-base/cli/flag/colon_separated_multimap_string_string.go b/vendor/k8s.io/component-base/cli/flag/colon_separated_multimap_string_string.go new file mode 100644 index 0000000000..bd2cf5f875 --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/colon_separated_multimap_string_string.go @@ -0,0 +1,102 @@ +/* +Copyright 2017 The Kubernetes Authors. + +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 flag + +import ( + "fmt" + "sort" + "strings" +) + +// ColonSeparatedMultimapStringString supports setting a map[string][]string from an encoding +// that separates keys from values with ':' and separates key-value pairs with ','. +// A key can be repeated multiple times, in which case the values are appended to a +// slice of strings associated with that key. Items in the list associated with a given +// key will appear in the order provided. +// For example: `a:hello,b:again,c:world,b:beautiful` results in `{"a": ["hello"], "b": ["again", "beautiful"], "c": ["world"]}` +// The first call to Set will clear the map before adding entries; subsequent calls will simply append to the map. +// This makes it possible to override default values with a command-line option rather than appending to defaults, +// while still allowing the distribution of key-value pairs across multiple flag invocations. +// For example: `--flag "a:hello" --flag "b:again" --flag "b:beautiful" --flag "c:world"` results in `{"a": ["hello"], "b": ["again", "beautiful"], "c": ["world"]}` +type ColonSeparatedMultimapStringString struct { + Multimap *map[string][]string + initialized bool // set to true after the first Set call +} + +// NewColonSeparatedMultimapStringString takes a pointer to a map[string][]string and returns the +// ColonSeparatedMultimapStringString flag parsing shim for that map. +func NewColonSeparatedMultimapStringString(m *map[string][]string) *ColonSeparatedMultimapStringString { + return &ColonSeparatedMultimapStringString{Multimap: m} +} + +// Set implements github.com/spf13/pflag.Value +func (m *ColonSeparatedMultimapStringString) Set(value string) error { + if m.Multimap == nil { + return fmt.Errorf("no target (nil pointer to map[string][]string)") + } + if !m.initialized || *m.Multimap == nil { + // clear default values, or allocate if no existing map + *m.Multimap = make(map[string][]string) + m.initialized = true + } + for _, pair := range strings.Split(value, ",") { + if len(pair) == 0 { + continue + } + kv := strings.SplitN(pair, ":", 2) + if len(kv) != 2 { + return fmt.Errorf("malformed pair, expect string:string") + } + k := strings.TrimSpace(kv[0]) + v := strings.TrimSpace(kv[1]) + (*m.Multimap)[k] = append((*m.Multimap)[k], v) + } + return nil +} + +// String implements github.com/spf13/pflag.Value +func (m *ColonSeparatedMultimapStringString) String() string { + type kv struct { + k string + v string + } + kvs := make([]kv, 0, len(*m.Multimap)) + for k, vs := range *m.Multimap { + for i := range vs { + kvs = append(kvs, kv{k: k, v: vs[i]}) + } + } + // stable sort by keys, order of values should be preserved + sort.SliceStable(kvs, func(i, j int) bool { + return kvs[i].k < kvs[j].k + }) + pairs := make([]string, 0, len(kvs)) + for i := range kvs { + pairs = append(pairs, fmt.Sprintf("%s:%s", kvs[i].k, kvs[i].v)) + } + return strings.Join(pairs, ",") +} + +// Type implements github.com/spf13/pflag.Value +func (m *ColonSeparatedMultimapStringString) Type() string { + return "colonSeparatedMultimapStringString" +} + +// Empty implements OmitEmpty +func (m *ColonSeparatedMultimapStringString) Empty() bool { + return len(*m.Multimap) == 0 +} diff --git a/vendor/k8s.io/component-base/cli/flag/configuration_map.go b/vendor/k8s.io/component-base/cli/flag/configuration_map.go new file mode 100644 index 0000000000..911b05ec6c --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/configuration_map.go @@ -0,0 +1,53 @@ +/* +Copyright 2014 The Kubernetes Authors. + +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 flag + +import ( + "fmt" + "sort" + "strings" +) + +type ConfigurationMap map[string]string + +func (m *ConfigurationMap) String() string { + pairs := []string{} + for k, v := range *m { + pairs = append(pairs, fmt.Sprintf("%s=%s", k, v)) + } + sort.Strings(pairs) + return strings.Join(pairs, ",") +} + +func (m *ConfigurationMap) Set(value string) error { + for _, s := range strings.Split(value, ",") { + if len(s) == 0 { + continue + } + arr := strings.SplitN(s, "=", 2) + if len(arr) == 2 { + (*m)[strings.TrimSpace(arr[0])] = strings.TrimSpace(arr[1]) + } else { + (*m)[strings.TrimSpace(arr[0])] = "" + } + } + return nil +} + +func (*ConfigurationMap) Type() string { + return "mapStringString" +} diff --git a/vendor/k8s.io/component-base/cli/flag/flags.go b/vendor/k8s.io/component-base/cli/flag/flags.go new file mode 100644 index 0000000000..d0fff8db2e --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/flags.go @@ -0,0 +1,54 @@ +/* +Copyright 2014 The Kubernetes Authors. + +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 flag + +import ( + goflag "flag" + "strings" + + "github.com/spf13/pflag" + "k8s.io/klog" +) + +// WordSepNormalizeFunc changes all flags that contain "_" separators +func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { + if strings.Contains(name, "_") { + return pflag.NormalizedName(strings.Replace(name, "_", "-", -1)) + } + return pflag.NormalizedName(name) +} + +// WarnWordSepNormalizeFunc changes and warns for flags that contain "_" separators +func WarnWordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { + if strings.Contains(name, "_") { + nname := strings.Replace(name, "_", "-", -1) + klog.Warningf("%s is DEPRECATED and will be removed in a future version. Use %s instead.", name, nname) + + return pflag.NormalizedName(nname) + } + return pflag.NormalizedName(name) +} + +// InitFlags normalizes, parses, then logs the command line flags +func InitFlags() { + pflag.CommandLine.SetNormalizeFunc(WordSepNormalizeFunc) + pflag.CommandLine.AddGoFlagSet(goflag.CommandLine) + pflag.Parse() + pflag.VisitAll(func(flag *pflag.Flag) { + klog.V(2).Infof("FLAG: --%s=%q", flag.Name, flag.Value) + }) +} diff --git a/vendor/k8s.io/component-base/cli/flag/langle_separated_map_string_string.go b/vendor/k8s.io/component-base/cli/flag/langle_separated_map_string_string.go new file mode 100644 index 0000000000..bf8dbfb9bf --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/langle_separated_map_string_string.go @@ -0,0 +1,82 @@ +/* +Copyright 2017 The Kubernetes Authors. + +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 flag + +import ( + "fmt" + "sort" + "strings" +) + +// LangleSeparatedMapStringString can be set from the command line with the format `--flag "string 0 { + s = s + ":" + strings.Join(nkc.Names, ",") + } + return s +} + +func (nkc *NamedCertKey) Set(value string) error { + cs := strings.SplitN(value, ":", 2) + var keycert string + if len(cs) == 2 { + var names string + keycert, names = strings.TrimSpace(cs[0]), strings.TrimSpace(cs[1]) + if names == "" { + return errors.New("empty names list is not allowed") + } + nkc.Names = nil + for _, name := range strings.Split(names, ",") { + nkc.Names = append(nkc.Names, strings.TrimSpace(name)) + } + } else { + nkc.Names = nil + keycert = strings.TrimSpace(cs[0]) + } + cs = strings.Split(keycert, ",") + if len(cs) != 2 { + return errors.New("expected comma separated certificate and key file paths") + } + nkc.CertFile = strings.TrimSpace(cs[0]) + nkc.KeyFile = strings.TrimSpace(cs[1]) + return nil +} + +func (*NamedCertKey) Type() string { + return "namedCertKey" +} + +// NamedCertKeyArray is a flag value parsing NamedCertKeys, each passed with its own +// flag instance (in contrast to comma separated slices). +type NamedCertKeyArray struct { + value *[]NamedCertKey + changed bool +} + +var _ flag.Value = &NamedCertKey{} + +// NewNamedKeyCertArray creates a new NamedCertKeyArray with the internal value +// pointing to p. +func NewNamedCertKeyArray(p *[]NamedCertKey) *NamedCertKeyArray { + return &NamedCertKeyArray{ + value: p, + } +} + +func (a *NamedCertKeyArray) Set(val string) error { + nkc := NamedCertKey{} + err := nkc.Set(val) + if err != nil { + return err + } + if !a.changed { + *a.value = []NamedCertKey{nkc} + a.changed = true + } else { + *a.value = append(*a.value, nkc) + } + return nil +} + +func (a *NamedCertKeyArray) Type() string { + return "namedCertKey" +} + +func (a *NamedCertKeyArray) String() string { + nkcs := make([]string, 0, len(*a.value)) + for i := range *a.value { + nkcs = append(nkcs, (*a.value)[i].String()) + } + return "[" + strings.Join(nkcs, ";") + "]" +} diff --git a/vendor/k8s.io/component-base/cli/flag/noop.go b/vendor/k8s.io/component-base/cli/flag/noop.go new file mode 100644 index 0000000000..03f7f14c0b --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/noop.go @@ -0,0 +1,41 @@ +/* +Copyright 2018 The Kubernetes Authors. + +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 flag + +import ( + goflag "flag" + "github.com/spf13/pflag" +) + +// NoOp implements goflag.Value and plfag.Value, +// but has a noop Set implementation +type NoOp struct{} + +var _ goflag.Value = NoOp{} +var _ pflag.Value = NoOp{} + +func (NoOp) String() string { + return "" +} + +func (NoOp) Set(val string) error { + return nil +} + +func (NoOp) Type() string { + return "NoOp" +} diff --git a/build/asmshim/c.go b/vendor/k8s.io/component-base/cli/flag/omitempty.go similarity index 62% rename from build/asmshim/c.go rename to vendor/k8s.io/component-base/cli/flag/omitempty.go index 68867107b8..c354754ea7 100644 --- a/build/asmshim/c.go +++ b/vendor/k8s.io/component-base/cli/flag/omitempty.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,8 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -package asmshim +package flag -import ( - "C" -) +// OmitEmpty is an interface for flags to report whether their underlying value +// is "empty." If a flag implements OmitEmpty and returns true for a call to Empty(), +// it is assumed that flag may be omitted from the command line. +type OmitEmpty interface { + Empty() bool +} diff --git a/vendor/k8s.io/component-base/cli/flag/sectioned.go b/vendor/k8s.io/component-base/cli/flag/sectioned.go new file mode 100644 index 0000000000..493a6c0f0f --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/sectioned.go @@ -0,0 +1,79 @@ +/* +Copyright 2018 The Kubernetes Authors. + +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 flag + +import ( + "bytes" + "fmt" + "io" + "strings" + + "github.com/spf13/pflag" +) + +// NamedFlagSets stores named flag sets in the order of calling FlagSet. +type NamedFlagSets struct { + // Order is an ordered list of flag set names. + Order []string + // FlagSets stores the flag sets by name. + FlagSets map[string]*pflag.FlagSet +} + +// FlagSet returns the flag set with the given name and adds it to the +// ordered name list if it is not in there yet. +func (nfs *NamedFlagSets) FlagSet(name string) *pflag.FlagSet { + if nfs.FlagSets == nil { + nfs.FlagSets = map[string]*pflag.FlagSet{} + } + if _, ok := nfs.FlagSets[name]; !ok { + nfs.FlagSets[name] = pflag.NewFlagSet(name, pflag.ExitOnError) + nfs.Order = append(nfs.Order, name) + } + return nfs.FlagSets[name] +} + +// PrintSections prints the given names flag sets in sections, with the maximal given column number. +// If cols is zero, lines are not wrapped. +func PrintSections(w io.Writer, fss NamedFlagSets, cols int) { + for _, name := range fss.Order { + fs := fss.FlagSets[name] + if !fs.HasFlags() { + continue + } + + wideFS := pflag.NewFlagSet("", pflag.ExitOnError) + wideFS.AddFlagSet(fs) + + var zzz string + if cols > 24 { + zzz = strings.Repeat("z", cols-24) + wideFS.Int(zzz, 0, strings.Repeat("z", cols-24)) + } + + var buf bytes.Buffer + fmt.Fprintf(&buf, "\n%s flags:\n\n%s", strings.ToUpper(name[:1])+name[1:], wideFS.FlagUsagesWrapped(cols)) + + if cols > 24 { + i := strings.Index(buf.String(), zzz) + lines := strings.Split(buf.String()[:i], "\n") + fmt.Fprint(w, strings.Join(lines[:len(lines)-1], "\n")) + fmt.Fprintln(w) + } else { + fmt.Fprint(w, buf.String()) + } + } +} diff --git a/vendor/k8s.io/component-base/cli/flag/string_flag.go b/vendor/k8s.io/component-base/cli/flag/string_flag.go new file mode 100644 index 0000000000..331bdb66e2 --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/string_flag.go @@ -0,0 +1,56 @@ +/* +Copyright 2014 The Kubernetes Authors. + +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 flag + +// StringFlag is a string flag compatible with flags and pflags that keeps track of whether it had a value supplied or not. +type StringFlag struct { + // If Set has been invoked this value is true + provided bool + // The exact value provided on the flag + value string +} + +func NewStringFlag(defaultVal string) StringFlag { + return StringFlag{value: defaultVal} +} + +func (f *StringFlag) Default(value string) { + f.value = value +} + +func (f StringFlag) String() string { + return f.value +} + +func (f StringFlag) Value() string { + return f.value +} + +func (f *StringFlag) Set(value string) error { + f.value = value + f.provided = true + + return nil +} + +func (f StringFlag) Provided() bool { + return f.provided +} + +func (f *StringFlag) Type() string { + return "string" +} diff --git a/vendor/k8s.io/component-base/cli/flag/tristate.go b/vendor/k8s.io/component-base/cli/flag/tristate.go new file mode 100644 index 0000000000..cf16376bf9 --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/tristate.go @@ -0,0 +1,83 @@ +/* +Copyright 2014 The Kubernetes Authors. + +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 flag + +import ( + "fmt" + "strconv" +) + +// Tristate is a flag compatible with flags and pflags that +// keeps track of whether it had a value supplied or not. +type Tristate int + +const ( + Unset Tristate = iota // 0 + True + False +) + +func (f *Tristate) Default(value bool) { + *f = triFromBool(value) +} + +func (f Tristate) String() string { + b := boolFromTri(f) + return fmt.Sprintf("%t", b) +} + +func (f Tristate) Value() bool { + b := boolFromTri(f) + return b +} + +func (f *Tristate) Set(value string) error { + boolVal, err := strconv.ParseBool(value) + if err != nil { + return err + } + + *f = triFromBool(boolVal) + return nil +} + +func (f Tristate) Provided() bool { + if f != Unset { + return true + } + return false +} + +func (f *Tristate) Type() string { + return "tristate" +} + +func boolFromTri(t Tristate) bool { + if t == True { + return true + } else { + return false + } +} + +func triFromBool(b bool) Tristate { + if b { + return True + } else { + return False + } +} diff --git a/vendor/k8s.io/klog/klogr/BUILD.bazel b/vendor/k8s.io/klog/klogr/BUILD.bazel new file mode 100644 index 0000000000..a5ece4bb9d --- /dev/null +++ b/vendor/k8s.io/klog/klogr/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["klogr.go"], + importmap = "sigs.k8s.io/cluster-api-provider-aws/vendor/k8s.io/klog/klogr", + importpath = "k8s.io/klog/klogr", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/go-logr/logr:go_default_library", + "//vendor/k8s.io/klog:go_default_library", + ], +) diff --git a/vendor/k8s.io/klog/klogr/README.md b/vendor/k8s.io/klog/klogr/README.md new file mode 100644 index 0000000000..4f5618d7f0 --- /dev/null +++ b/vendor/k8s.io/klog/klogr/README.md @@ -0,0 +1,8 @@ +# Minimal Go logging using klog + +This package implements the [logr interface](github.com/go-logr/logr) +in terms of Kubernetes' [klog](https://github.com/kubernetes/klog). This +provides a relatively minimalist API to logging in Go, backed by a well-proven +implementation. + +This is a BETA grade implementation. diff --git a/vendor/k8s.io/klog/klogr/klogr.go b/vendor/k8s.io/klog/klogr/klogr.go new file mode 100644 index 0000000000..e09e82212e --- /dev/null +++ b/vendor/k8s.io/klog/klogr/klogr.go @@ -0,0 +1,147 @@ +// Package klogr implements github.com/go-logr/logr.Logger in terms of +// k8s.io/klog. +package klogr + +import ( + "bytes" + "encoding/json" + "fmt" + "runtime" + "sort" + + "github.com/go-logr/logr" + "k8s.io/klog" +) + +// New returns a logr.Logger which is implemented by klog. +func New() logr.Logger { + return klogger{ + level: 0, + prefix: "", + values: nil, + } +} + +type klogger struct { + level int + prefix string + values []interface{} +} + +func (l klogger) clone() klogger { + return klogger{ + level: l.level, + prefix: l.prefix, + values: copySlice(l.values), + } +} + +func copySlice(in []interface{}) []interface{} { + out := make([]interface{}, len(in)) + copy(out, in) + return out +} + +// Magic string for intermediate frames that we should ignore. +const autogeneratedFrameName = "" + +// Discover how many frames we need to climb to find the caller. This approach +// was suggested by Ian Lance Taylor of the Go team, so it *should* be safe +// enough (famous last words). +func framesToCaller() int { + // 1 is the immediate caller. 3 should be too many. + for i := 1; i < 3; i++ { + _, file, _, _ := runtime.Caller(i + 1) // +1 for this function's frame + if file != autogeneratedFrameName { + return i + } + } + return 1 // something went wrong, this is safe +} + +func flatten(kvList ...interface{}) string { + keys := make([]string, 0, len(kvList)) + vals := make(map[string]interface{}, len(kvList)) + for i := 0; i < len(kvList); i += 2 { + k, ok := kvList[i].(string) + if !ok { + panic(fmt.Sprintf("key is not a string: %s", pretty(kvList[i]))) + } + var v interface{} + if i+1 < len(kvList) { + v = kvList[i+1] + } + keys = append(keys, k) + vals[k] = v + } + sort.Strings(keys) + buf := bytes.Buffer{} + for i, k := range keys { + v := vals[k] + if i > 0 { + buf.WriteRune(' ') + } + buf.WriteString(pretty(k)) + buf.WriteString("=") + buf.WriteString(pretty(v)) + } + return buf.String() +} + +func pretty(value interface{}) string { + jb, _ := json.Marshal(value) + return string(jb) +} + +func (l klogger) Info(msg string, kvList ...interface{}) { + if l.Enabled() { + lvlStr := flatten("level", l.level) + msgStr := flatten("msg", msg) + fixedStr := flatten(l.values...) + userStr := flatten(kvList...) + klog.InfoDepth(framesToCaller(), l.prefix, " ", lvlStr, " ", msgStr, " ", fixedStr, " ", userStr) + } +} + +func (l klogger) Enabled() bool { + return bool(klog.V(klog.Level(l.level))) +} + +func (l klogger) Error(err error, msg string, kvList ...interface{}) { + msgStr := flatten("msg", msg) + var loggableErr interface{} + if err != nil { + loggableErr = err.Error() + } + errStr := flatten("error", loggableErr) + fixedStr := flatten(l.values...) + userStr := flatten(kvList...) + klog.ErrorDepth(framesToCaller(), l.prefix, " ", msgStr, " ", errStr, " ", fixedStr, " ", userStr) +} + +func (l klogger) V(level int) logr.InfoLogger { + new := l.clone() + new.level = level + return new +} + +// WithName returns a new logr.Logger with the specified name appended. klogr +// uses '/' characters to separate name elements. Callers should not pass '/' +// in the provided name string, but this library does not actually enforce that. +func (l klogger) WithName(name string) logr.Logger { + new := l.clone() + if len(l.prefix) > 0 { + new.prefix = l.prefix + "/" + } + new.prefix += name + return new +} + +func (l klogger) WithValues(kvList ...interface{}) logr.Logger { + new := l.clone() + new.values = append(new.values, kvList...) + return new +} + +var _ logr.Logger = klogger{} +var _ logr.InfoLogger = klogger{} diff --git a/vendor/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/BUILD b/vendor/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/BUILD index 259b75dfb8..1ce30afa24 100644 --- a/vendor/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/BUILD +++ b/vendor/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/BUILD @@ -1,6 +1,9 @@ package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load( + "@io_bazel_rules_go//go:def.bzl", + "go_library", +) go_library( name = "go_default_library", diff --git a/vendor/k8s.io/kubernetes/cmd/kubeadm/app/constants/BUILD b/vendor/k8s.io/kubernetes/cmd/kubeadm/app/constants/BUILD index 1ca03c17d5..e92654198a 100644 --- a/vendor/k8s.io/kubernetes/cmd/kubeadm/app/constants/BUILD +++ b/vendor/k8s.io/kubernetes/cmd/kubeadm/app/constants/BUILD @@ -1,6 +1,9 @@ package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load( + "@io_bazel_rules_go//go:def.bzl", + "go_library", +) go_library( name = "go_default_library", diff --git a/vendor/k8s.io/kubernetes/cmd/kubeadm/app/util/BUILD b/vendor/k8s.io/kubernetes/cmd/kubeadm/app/util/BUILD index 65436cf8c2..13de0775ee 100644 --- a/vendor/k8s.io/kubernetes/cmd/kubeadm/app/util/BUILD +++ b/vendor/k8s.io/kubernetes/cmd/kubeadm/app/util/BUILD @@ -1,6 +1,9 @@ package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load( + "@io_bazel_rules_go//go:def.bzl", + "go_library", +) go_library( name = "go_default_library", diff --git a/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/BUILD b/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/BUILD index 861a4dd045..31939a56c9 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/BUILD +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/BUILD @@ -1,6 +1,9 @@ package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load( + "@io_bazel_rules_go//go:def.bzl", + "go_library", +) go_library( name = "go_default_library", diff --git a/vendor/k8s.io/kubernetes/pkg/registry/core/service/allocator/BUILD b/vendor/k8s.io/kubernetes/pkg/registry/core/service/allocator/BUILD index 2c1d6f3f01..017ad42dac 100644 --- a/vendor/k8s.io/kubernetes/pkg/registry/core/service/allocator/BUILD +++ b/vendor/k8s.io/kubernetes/pkg/registry/core/service/allocator/BUILD @@ -1,6 +1,9 @@ package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load( + "@io_bazel_rules_go//go:def.bzl", + "go_library", +) go_library( name = "go_default_library", diff --git a/vendor/k8s.io/kubernetes/pkg/registry/core/service/ipallocator/BUILD b/vendor/k8s.io/kubernetes/pkg/registry/core/service/ipallocator/BUILD index 3219bea0cc..5ed92e0cad 100644 --- a/vendor/k8s.io/kubernetes/pkg/registry/core/service/ipallocator/BUILD +++ b/vendor/k8s.io/kubernetes/pkg/registry/core/service/ipallocator/BUILD @@ -1,6 +1,9 @@ package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load( + "@io_bazel_rules_go//go:def.bzl", + "go_library", +) go_library( name = "go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/Dockerfile b/vendor/sigs.k8s.io/cluster-api/Dockerfile index e89f319d02..bca9820330 100644 --- a/vendor/sigs.k8s.io/cluster-api/Dockerfile +++ b/vendor/sigs.k8s.io/cluster-api/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. # Build the manager binary -FROM golang:1.11.6 as builder +FROM golang:1.12.3 as builder # Copy in the go src WORKDIR $GOPATH/src/sigs.k8s.io/cluster-api diff --git a/vendor/sigs.k8s.io/cluster-api/Gopkg.lock b/vendor/sigs.k8s.io/cluster-api/Gopkg.lock index 724e64ff24..dad988a854 100644 --- a/vendor/sigs.k8s.io/cluster-api/Gopkg.lock +++ b/vendor/sigs.k8s.io/cluster-api/Gopkg.lock @@ -1079,6 +1079,14 @@ pruneopts = "UT" revision = "3a2206dd6a78497deceb3ae058417fdeb2036c7e" +[[projects]] + branch = "master" + digest = "1:dc54d24e166e75a89145883b6080306f5684db2e8ab7a068625f010dee604c6e" + name = "k8s.io/component-base" + packages = ["cli/flag"] + pruneopts = "UT" + revision = "fd5d14dd6d20b9f3b0c066e2702d877b0b8c049f" + [[projects]] branch = "master" digest = "1:28514fabca4356625720ffb012408790a9d00d31963a9bd9daf7b5ccd894c301" @@ -1096,12 +1104,12 @@ revision = "f8a0810f38afb8478882b3835a615aebfda39afa" [[projects]] - digest = "1:e2999bf1bb6eddc2a6aa03fe5e6629120a53088926520ca3b4765f77d7ff7eab" + digest = "1:c696379ad201c1e86591785579e16bf6cf886c362e9a7534e8eb0d1028b20582" name = "k8s.io/klog" packages = ["."] pruneopts = "UT" - revision = "a5bc97fbc634d635061f3146511332c7e313a55a" - version = "v0.1.0" + revision = "e531227889390a39d9533dde61f590fe9f4b0035" + version = "v0.3.0" [[projects]] branch = "master" @@ -1254,6 +1262,7 @@ "k8s.io/code-generator/cmd/deepcopy-gen", "k8s.io/code-generator/cmd/informer-gen", "k8s.io/code-generator/cmd/lister-gen", + "k8s.io/component-base/cli/flag", "k8s.io/klog", "sigs.k8s.io/controller-runtime/pkg/client", "sigs.k8s.io/controller-runtime/pkg/client/config", diff --git a/vendor/sigs.k8s.io/cluster-api/Makefile b/vendor/sigs.k8s.io/cluster-api/Makefile index 178bc617ee..760743f7e4 100644 --- a/vendor/sigs.k8s.io/cluster-api/Makefile +++ b/vendor/sigs.k8s.io/cluster-api/Makefile @@ -111,7 +111,7 @@ clean: ## Remove all generated files docker-build: generate fmt vet manifests ## Build the docker image for controller-manager docker build . -t ${CONTROLLER_IMG} @echo "updating kustomize image patch file for manager resource" - sed -i.tmp -e 's@image: .*@image: '"${CONTROLLER_IMG}"'@' ./config/default/manager_image_patch.yaml + hack/sed.sh -i.tmp -e 's@image: .*@image: '"${CONTROLLER_IMG}"'@' ./config/default/manager_image_patch.yaml .PHONY: docker-push docker-push: docker-build ## Push the docker image @@ -121,7 +121,7 @@ docker-push: docker-build ## Push the docker image docker-build-ci: generate fmt vet manifests ## Build the docker image for example provider docker build . -f ./pkg/provider/example/container/Dockerfile -t ${EXAMPLE_PROVIDER_IMG} @echo "updating kustomize image patch file for ci" - sed -i.tmp -e 's@image: .*@image: '"${EXAMPLE_PROVIDER_IMG}"'@' ./config/ci/manager_image_patch.yaml + hack/sed.sh -i.tmp -e 's@image: .*@image: '"${EXAMPLE_PROVIDER_IMG}"'@' ./config/ci/manager_image_patch.yaml .PHONY: docker-push-ci docker-push-ci: docker-build-ci ## Build the docker image for ci diff --git a/vendor/sigs.k8s.io/cluster-api/OWNERS_ALIASES b/vendor/sigs.k8s.io/cluster-api/OWNERS_ALIASES index d8f6e3cea8..e7059b003e 100644 --- a/vendor/sigs.k8s.io/cluster-api/OWNERS_ALIASES +++ b/vendor/sigs.k8s.io/cluster-api/OWNERS_ALIASES @@ -3,16 +3,13 @@ aliases: sig-cluster-lifecycle-leads: - luxas - - roberthbailey + - justinsb - timothysc cluster-api-admins: - justinsb - - kris-nova - - krousey - - luxas - - roberthbailey + - detiber + - davidewatson cluster-api-maintainers: - justinsb - - krousey - - roberthbailey + - detiber - vincepri diff --git a/vendor/sigs.k8s.io/cluster-api/SECURITY_CONTACTS b/vendor/sigs.k8s.io/cluster-api/SECURITY_CONTACTS index 6867576631..7da23c405f 100644 --- a/vendor/sigs.k8s.io/cluster-api/SECURITY_CONTACTS +++ b/vendor/sigs.k8s.io/cluster-api/SECURITY_CONTACTS @@ -10,7 +10,7 @@ # DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE # INSTRUCTIONS AT https://kubernetes.io/security/ -lukemarsden +detiber +justinsb luxas -roberthbailey timothysc diff --git a/vendor/sigs.k8s.io/cluster-api/WORKSPACE b/vendor/sigs.k8s.io/cluster-api/WORKSPACE index 710510fb0e..c442a2afb1 100644 --- a/vendor/sigs.k8s.io/cluster-api/WORKSPACE +++ b/vendor/sigs.k8s.io/cluster-api/WORKSPACE @@ -3,8 +3,8 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") http_archive( name = "io_bazel_rules_go", - sha256 = "77dfd303492f2634de7a660445ee2d3de2960cbd52f97d8c0dffa9362d3ddef9", - url = "https://github.com/bazelbuild/rules_go/releases/download/0.18.1/rules_go-0.18.1.tar.gz", + sha256 = "86ae934bd4c43b99893fc64be9d9fc684b81461581df7ea8fc291c816f5ee8c5", + url = "https://github.com/bazelbuild/rules_go/releases/download/0.18.3/rules_go-0.18.3.tar.gz", ) http_archive( @@ -18,7 +18,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe go_rules_dependencies() go_register_toolchains( - go_version = "1.11.6", + go_version = "1.12.3", ) load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") @@ -27,13 +27,13 @@ gazelle_dependencies() go_repository( name = "io_k8s_sigs_kustomize", - commit = "58492e2d83c59ed63881311f46ad6251f77dabc3", importpath = "sigs.k8s.io/kustomize", + tag = "v1.0.11", ) go_repository( name = "com_github_golangci_golangci-lint", build_file_generation = "on", importpath = "github.com/golangci/golangci-lint", - tag = "v1.15.0", + tag = "v1.16.0", ) diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/README.md b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/README.md index 33f2baba3e..e9ef1f4372 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/README.md +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/README.md @@ -50,6 +50,9 @@ If you are using minikube, to choose a specific minikube driver, please use the Additional advanced flags can be found via help. +Also, some environment variables are supported: +`CLUSTER_API_MACHINE_READY_TIMEOUT`: set this value to adjust the timeout value in minutes for a machine to become ready, The default timeout is currently 30 minutes, `export CLUSTER_API_MACHINE_READY_TIMEOUT=45` will extend the timeout value to 45 minutes. + ```shell ./clusterctl create cluster --help ``` diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/minikube.go b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/minikube.go index 272bb939ec..bb9044a10d 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/minikube.go +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/minikube.go @@ -61,7 +61,7 @@ func WithOptionsAndKubeConfigPath(options []string, kubeconfigpath string) *Mini } return true }() { - options = append(options, fmt.Sprintf("p=%s", minikubeClusterName)) + options = append(options, fmt.Sprintf("profile=%s", minikubeClusterName)) } return &Minikube{ diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go index 9bdd7a9fc9..3511982c82 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go @@ -55,6 +55,10 @@ const ( machineClusterLabelName = "cluster.k8s.io/cluster-name" ) +const ( + TimeoutMachineReady = "CLUSTER_API_MACHINE_READY_TIMEOUT" +) + // Provides interaction with a cluster type Client interface { Apply(string) error @@ -919,7 +923,7 @@ func (c *client) waitForKubectlApply(manifest string) error { klog.V(2).Infof("Waiting for kubectl apply...") err := c.kubectlApply(manifest) if err != nil { - if strings.Contains(err.Error(), io.EOF.Error()) || strings.Contains(err.Error(), "refused") { + if strings.Contains(err.Error(), io.EOF.Error()) || strings.Contains(err.Error(), "refused") || strings.Contains(err.Error(), "no such host") { // Connection was refused, probably because the API server is not ready yet. klog.V(4).Infof("Waiting for kubectl apply... server not yet available: %v", err) return false, nil @@ -968,7 +972,17 @@ func waitForClusterResourceReady(cs clientset.Interface) error { } func waitForMachineReady(cs clientset.Interface, machine *clusterv1.Machine) error { - err := util.PollImmediate(retryIntervalResourceReady, timeoutMachineReady, func() (bool, error) { + timeout := timeoutMachineReady + if p := os.Getenv(TimeoutMachineReady); p != "" { + t, err := strconv.Atoi(p) + if err == nil { + // only valid value will be used + timeout = time.Duration(t) * time.Minute + klog.V(4).Info("Setting wait for machine timeout value to ", timeout) + } + } + + err := util.PollImmediate(retryIntervalResourceReady, timeout, func() (bool, error) { klog.V(2).Infof("Waiting for Machine %v to become ready...", machine.Name) m, err := cs.ClusterV1alpha1().Machines(machine.Namespace).Get(machine.Name, metav1.GetOptions{}) if err != nil { @@ -1019,17 +1033,16 @@ func GetClusterAPIObject(client Client, clusterName, namespace string) (*cluster return nil, nil, nil, errors.Wrapf(err, "unable to fetch cluster %s/%s", namespace, clusterName) } - controlPlane, nodes, err := ExtractControlPlaneMachine(machines) + controlPlane, nodes, err := ExtractControlPlaneMachines(machines) if err != nil { return nil, nil, nil, errors.Wrapf(err, "unable to fetch control plane machine in cluster %s/%s", namespace, clusterName) } - return cluster, controlPlane, nodes, nil + return cluster, controlPlane[0], nodes, nil } -// ExtractControlPlaneMachine separates the machines running the control plane (singular) from the incoming machines. +// ExtractControlPlaneMachines separates the machines running the control plane from the incoming machines. // This is currently done by looking at which machine specifies the control plane version. -// TODO: Cleanup. -func ExtractControlPlaneMachine(machines []*clusterv1.Machine) (*clusterv1.Machine, []*clusterv1.Machine, error) { +func ExtractControlPlaneMachines(machines []*clusterv1.Machine) ([]*clusterv1.Machine, []*clusterv1.Machine, error) { nodes := []*clusterv1.Machine{} controlPlaneMachines := []*clusterv1.Machine{} for _, machine := range machines { @@ -1039,8 +1052,8 @@ func ExtractControlPlaneMachine(machines []*clusterv1.Machine) (*clusterv1.Machi nodes = append(nodes, machine) } } - if len(controlPlaneMachines) != 1 { - return nil, nil, errors.Errorf("expected one control plane machine, got: %v", len(controlPlaneMachines)) + if len(controlPlaneMachines) < 1 { + return nil, nil, errors.Errorf("expected one or more control plane machines, got: %v", len(controlPlaneMachines)) } - return controlPlaneMachines[0], nodes, nil + return controlPlaneMachines, nodes, nil } diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterdeployer.go b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterdeployer.go index 73d17b3e09..f3263b508c 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterdeployer.go +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterdeployer.go @@ -57,7 +57,7 @@ func New( // Create the cluster from the provided cluster definition and machine list. func (d *ClusterDeployer) Create(cluster *clusterv1.Cluster, machines []*clusterv1.Machine, provider provider.Deployer, kubeconfigOutput string, providerComponentsStoreFactory provider.ComponentsStoreFactory) error { - controlPlaneMachine, nodes, err := clusterclient.ExtractControlPlaneMachine(machines) + controlPlaneMachines, nodes, err := clusterclient.ExtractControlPlaneMachines(machines) if err != nil { return errors.Wrap(err, "unable to separate control plane machines from node machines") } @@ -89,12 +89,12 @@ func (d *ClusterDeployer) Create(cluster *clusterv1.Cluster, machines []*cluster cluster.Namespace = bootstrapClient.GetContextNamespace() } - klog.Infof("Creating control plane %v in namespace %q", controlPlaneMachine.Name, cluster.Namespace) - if err := phases.ApplyMachines(bootstrapClient, cluster.Namespace, []*clusterv1.Machine{controlPlaneMachine}); err != nil { + klog.Infof("Creating control plane %v in namespace %q", controlPlaneMachines[0].Name, cluster.Namespace) + if err := phases.ApplyMachines(bootstrapClient, cluster.Namespace, []*clusterv1.Machine{controlPlaneMachines[0]}); err != nil { return errors.Wrap(err, "unable to create control plane machine") } - klog.Infof("Updating bootstrap cluster object for cluster %v in namespace %q with control plane endpoint running on %s", cluster.Name, cluster.Namespace, controlPlaneMachine.Name) + klog.Infof("Updating bootstrap cluster object for cluster %v in namespace %q with control plane endpoint running on %s", cluster.Name, cluster.Namespace, controlPlaneMachines[0].Name) if err := d.updateClusterEndpoint(bootstrapClient, provider, cluster.Name, cluster.Namespace); err != nil { return errors.Wrap(err, "unable to update bootstrap cluster endpoint") } @@ -130,11 +130,22 @@ func (d *ClusterDeployer) Create(cluster *clusterv1.Cluster, machines []*cluster // For some reason, endpoint doesn't get updated in bootstrap cluster sometimes. So we // update the target cluster endpoint as well to be sure. - klog.Infof("Updating target cluster object with control plane endpoint running on %s", controlPlaneMachine.Name) + klog.Infof("Updating target cluster object with control plane endpoint running on %s", controlPlaneMachines[0].Name) if err := d.updateClusterEndpoint(targetClient, provider, cluster.Name, cluster.Namespace); err != nil { return errors.Wrap(err, "unable to update target cluster endpoint") } + if len(controlPlaneMachines) > 1 { + // TODO(h0tbird) Done serially until kubernetes/kubeadm#1097 is resolved and all + // supported versions of k8s we are deploying (using kubeadm) have the fix. + klog.Info("Creating additional control plane machines in target cluster.") + for _, controlPlaneMachine := range controlPlaneMachines[1:] { + if err := phases.ApplyMachines(targetClient, cluster.Namespace, []*clusterv1.Machine{controlPlaneMachine}); err != nil { + return errors.Wrap(err, "unable to create additional control plane machines") + } + } + } + klog.Info("Creating node machines in target cluster.") if err := phases.ApplyMachines(targetClient, cluster.Namespace, nodes); err != nil { return errors.Wrap(err, "unable to create node machines") diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/BUILD.bazel b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/BUILD.bazel index 3400abec03..fc4d206d85 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/BUILD.bazel +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/BUILD.bazel @@ -33,6 +33,7 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", + "//vendor/k8s.io/component-base/cli/flag:go_default_library", "//vendor/k8s.io/klog:go_default_library", "//vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clientcmd:go_default_library", "//vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/root.go b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/root.go index 8266a6030b..b584efb165 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/root.go +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/root.go @@ -22,6 +22,7 @@ import ( "os" "github.com/spf13/cobra" + cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog" ) @@ -54,6 +55,7 @@ func exitWithHelp(cmd *cobra.Command, err string) { func init() { klog.InitFlags(flag.CommandLine) flag.CommandLine.Set("logtostderr", "true") + RootCmd.SetGlobalNormalizationFunc(cliflag.WordSepNormalizeFunc) RootCmd.PersistentFlags().AddGoFlagSet(flag.CommandLine) InitLogs() } diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/createbootstrapcluster.go b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/createbootstrapcluster.go index 2b4cdce6d8..9c6643651b 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/createbootstrapcluster.go +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/createbootstrapcluster.go @@ -24,7 +24,7 @@ import ( ) func CreateBootstrapCluster(provisioner bootstrap.ClusterProvisioner, cleanupBootstrapCluster bool, clientFactory clusterclient.Factory) (clusterclient.Client, func(), error) { - klog.Info("Creating bootstrap cluster") + klog.Info("Preparing bootstrap cluster") cleanupFn := func() {} if err := provisioner.Create(); err != nil { diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args-invalid-flag.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args-invalid-flag.golden index d1dae5312d..4e89d69d1b 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args-invalid-flag.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args-invalid-flag.golden @@ -19,15 +19,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging unknown flag: --invalid-flag diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args.golden index 520a03db65..c3b2f2d266 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args.golden @@ -19,15 +19,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging required flag(s) "cluster", "machines", "provider", "provider-components" not set diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args-invalid-flag.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args-invalid-flag.golden index c13e2242f3..b6ca97cd1b 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args-invalid-flag.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args-invalid-flag.golden @@ -11,15 +11,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "clusterctl create [command] --help" for more information about a command. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args.golden index 436766ad1e..5369b32f31 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args.golden @@ -12,15 +12,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "clusterctl create [command] --help" for more information about a command. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden index dc7a15fb36..4c2c40b13d 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden @@ -16,15 +16,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging unknown flag: --invalid-flag diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args.golden index 3eaea4c89b..82e0add99b 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args.golden @@ -18,13 +18,15 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args-invalid-flag.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args-invalid-flag.golden index 2641ea0f98..54ed0e0ebc 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args-invalid-flag.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args-invalid-flag.golden @@ -11,15 +11,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "clusterctl delete [command] --help" for more information about a command. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args.golden index a0f13986cf..86cc1d355e 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args.golden @@ -12,15 +12,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "clusterctl delete [command] --help" for more information about a command. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args-invalid-flag.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args-invalid-flag.golden index d96b83c831..cbe4f8e4ef 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args-invalid-flag.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args-invalid-flag.golden @@ -14,15 +14,17 @@ Flags: --alsologtostderr log to standard error as well as files -h, --help help for clusterctl --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "clusterctl [command] --help" for more information about a command. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args.golden index 3394e22f28..005a7c359f 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args.golden @@ -15,15 +15,17 @@ Flags: --alsologtostderr log to standard error as well as files -h, --help help for clusterctl --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "clusterctl [command] --help" for more information about a command. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-cluster-no-args-invalid-flag.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-cluster-no-args-invalid-flag.golden index 75243978ba..9ca44dee7c 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-cluster-no-args-invalid-flag.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-cluster-no-args-invalid-flag.golden @@ -11,15 +11,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging unknown flag: --invalid-flag diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args-invalid-flag.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args-invalid-flag.golden index fe1fd2036a..9435739423 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args-invalid-flag.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args-invalid-flag.golden @@ -11,15 +11,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "clusterctl validate [command] --help" for more information about a command. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args.golden index ba24210517..e88396b032 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args.golden @@ -12,15 +12,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "clusterctl validate [command] --help" for more information about a command. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go b/vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go index e46e7cbde1..f10eb99060 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go +++ b/vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go @@ -33,8 +33,14 @@ import ( func main() { flag.Set("logtostderr", "true") klog.InitFlags(nil) - flag.Parse() + watchNamespace := flag.String("namespace", "", + "Namespace that the controller watches to reconcile cluster-api objects. If unspecified, the controller watches for cluster-api objects across all namespaces.") + flag.Parse() + if *watchNamespace != "" { + log.Printf("Watching cluster-api objects only in namespace %q for reconciliation.", *watchNamespace) + } + log.Printf("Registering Components.") // Get a config to talk to the apiserver cfg, err := config.GetConfig() if err != nil { @@ -45,6 +51,7 @@ func main() { syncPeriod := 10 * time.Minute mgr, err := manager.New(cfg, manager.Options{ SyncPeriod: &syncPeriod, + Namespace: *watchNamespace, }) if err != nil { log.Fatal(err) diff --git a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machine.yaml b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machine.yaml index 8b77b8ffd8..ecc0f00fac 100644 --- a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machine.yaml +++ b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machine.yaml @@ -15,6 +15,11 @@ spec: description: Machine status such as Terminating/Pending/Running/Failed etc name: Phase type: string + - JSONPath: .status.nodeRef.name + description: Node name associated with this machine + name: NodeName + priority: 1 + type: string group: cluster.k8s.io names: kind: Machine @@ -61,11 +66,11 @@ spec: could not get registered as Kubernetes nodes. With cluster-api as a generic out-of-tree provider for autoscaler, this field is required by autoscaler to be able to have a provider view of the list of machines. - Another list of nodes is queried from the k8s apiserver and then comparison - is done to find out unregistered machines and are marked for delete. - This field will be set by the actuators and consumed by higher level - entities like autoscaler that will be interfacing with cluster-api - as generic provider. + Another list of nodes is queried from the k8s apiserver and then a + comparison is done to find out unregistered machines and are marked + for delete. This field will be set by the actuators and consumed by + higher level entities like autoscaler that will be interfacing with + cluster-api as generic provider. type: string providerSpec: description: ProviderSpec details Provider-specific configuration to @@ -93,9 +98,12 @@ spec: type: object type: object taints: - description: Taints is the full, authoritative list of taints to apply - to the corresponding Node. This list will overwrite any modifications - made to the Node on an ongoing basis. + description: The list of the taints to be applied to the corresponding + Node in additive manner. This list will not overwrite any other taints + added to the Node on an ongoing basis by other entities. These taints + should be actively reconciled e.g. if you ask the machine controller + to apply a taint and then manually remove the taint the machine controller + will put it back) but not have the machine controller remove any taints items: type: object type: array diff --git a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml index 488d76a3d3..8532253447 100644 --- a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml +++ b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml @@ -181,9 +181,13 @@ spec: type: object type: object taints: - description: Taints is the full, authoritative list of taints - to apply to the corresponding Node. This list will overwrite - any modifications made to the Node on an ongoing basis. + description: The list of the taints to be applied to the corresponding + Node in additive manner. This list will not overwrite any + other taints added to the Node on an ongoing basis by other + entities. These taints should be actively reconciled e.g. + if you ask the machine controller to apply a taint and then + manually remove the taint the machine controller will put + it back) but not have the machine controller remove any taints items: type: object type: array diff --git a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml index fb69e27543..73fda8c335 100644 --- a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml +++ b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml @@ -130,9 +130,13 @@ spec: type: object type: object taints: - description: Taints is the full, authoritative list of taints - to apply to the corresponding Node. This list will overwrite - any modifications made to the Node on an ongoing basis. + description: The list of the taints to be applied to the corresponding + Node in additive manner. This list will not overwrite any + other taints added to the Node on an ongoing basis by other + entities. These taints should be actively reconciled e.g. + if you ask the machine controller to apply a taint and then + manually remove the taint the machine controller will put + it back) but not have the machine controller remove any taints items: type: object type: array diff --git a/vendor/sigs.k8s.io/cluster-api/config/rbac/rbac_role.yaml b/vendor/sigs.k8s.io/cluster-api/config/rbac/rbac_role.yaml index f47b06161c..90cbd805e0 100644 --- a/vendor/sigs.k8s.io/cluster-api/config/rbac/rbac_role.yaml +++ b/vendor/sigs.k8s.io/cluster-api/config/rbac/rbac_role.yaml @@ -42,6 +42,7 @@ rules: - cluster.k8s.io resources: - machinedeployments + - machinedeployments/status verbs: - get - list @@ -54,6 +55,7 @@ rules: - cluster.k8s.io resources: - machinesets + - machinesets/status verbs: - get - list diff --git a/vendor/sigs.k8s.io/cluster-api/hack/sed.sh b/vendor/sigs.k8s.io/cluster-api/hack/sed.sh new file mode 100755 index 0000000000..680b184bda --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/hack/sed.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env sh +# Copyright 2019 The Kubernetes Authors. +# +# 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. + +# this script is a drop in wrapper around gnu-sed that will attempt to only +# use gnu sed (as opposed to E.G. the default sed on macOS) + +# darwin is great +SED="sed" +if command -v gsed >/dev/null 2>&1; then + SED="gsed" +fi +if ! (${SED} --version 2>&1 | grep -q GNU); then + echo "!!! GNU sed is required. If on OS X, use 'brew install gnu-sed'." >&2 + exit 1 +fi + +"${SED}" "$@" diff --git a/vendor/sigs.k8s.io/cluster-api/hack/update-bazel.sh b/vendor/sigs.k8s.io/cluster-api/hack/update-bazel.sh index b32b850967..a00bd54e3d 100755 --- a/vendor/sigs.k8s.io/cluster-api/hack/update-bazel.sh +++ b/vendor/sigs.k8s.io/cluster-api/hack/update-bazel.sh @@ -17,8 +17,9 @@ set -o errexit set -o nounset set -o pipefail -export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. +KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. +export KUBE_ROOT -cd $KUBE_ROOT -find $KUBE_ROOT/vendor -name 'BUILD' -delete +cd "${KUBE_ROOT}" +find "${KUBE_ROOT}/vendor" -name 'BUILD' -delete bazel run //:gazelle diff --git a/vendor/sigs.k8s.io/cluster-api/hack/verify_clientset.sh b/vendor/sigs.k8s.io/cluster-api/hack/verify_clientset.sh index 939c873481..8554bbac04 100755 --- a/vendor/sigs.k8s.io/cluster-api/hack/verify_clientset.sh +++ b/vendor/sigs.k8s.io/cluster-api/hack/verify_clientset.sh @@ -18,11 +18,12 @@ set -o errexit set -o nounset set -o pipefail -SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/.. +SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. DIFFROOT="${SCRIPT_ROOT}/pkg/client" TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg" _tmp="${SCRIPT_ROOT}/_tmp" GOPATH=$(go env GOPATH) +export GOPATH cleanup() { rm -rf "${_tmp}" diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go index 427e7a3036..ac5623bad3 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go @@ -40,6 +40,7 @@ const ( // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="Provider ID" // +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Machine status such as Terminating/Pending/Running/Failed etc" +// +kubebuilder:printcolumn:name="NodeName",type="string",JSONPath=".status.nodeRef.name",description="Node name associated with this machine",priority=1 type Machine struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/controller.go b/vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/controller.go index 3b657c1c9a..d8fba73f8a 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/controller.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/controller.go @@ -163,7 +163,7 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul } if !r.isDeleteAllowed(m) { - klog.Infof("Skipping reconciling of machine %q", name) + klog.Infof("Deleting machine hosting this controller is not allowed. Skipping reconciliation of machine %q", name) return reconcile.Result{}, nil } @@ -235,7 +235,7 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul func (r *ReconcileMachine) getCluster(ctx context.Context, machine *clusterv1.Machine) (*clusterv1.Cluster, error) { if machine.Labels[clusterv1.MachineClusterLabelName] == "" { - klog.Infof("Machine %q in namespace %q doesn't specify %q label, assuming nil cluster", machine.Name, clusterv1.MachineClusterLabelName, machine.Namespace) + klog.Infof("Machine %q in namespace %q doesn't specify %q label, assuming nil cluster", machine.Name, machine.Namespace, clusterv1.MachineClusterLabelName) return nil, nil } diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/controller.go b/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/controller.go index 939dea58d6..3fa7a4848a 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/controller.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/controller.go @@ -92,7 +92,9 @@ func add(mgr manager.Manager, r reconcile.Reconciler, mapFn handler.ToRequestsFu return err } - // Map MachineSet changes to MachineDeployment. + // Watch for changes to MachineSets using a mapping function to MachineDeployment. + // This watcher is required for use cases like adoption. In case a MachineSet doesn't have + // a controller reference, it'll look for potential matching MachineDeployments to reconcile. err = c.Watch( &source.Kind{Type: &v1alpha1.MachineSet{}}, &handler.EnqueueRequestsFromMapFunc{ToRequests: mapFn}, @@ -160,7 +162,7 @@ func (r *ReconcileMachineDeployment) adoptOrphan(deployment *v1alpha1.MachineDep // Reconcile reads that state of the cluster for a MachineDeployment object and makes changes based on the state read // and what is in the MachineDeployment.Spec -// +kubebuilder:rbac:groups=cluster.k8s.io,resources=machinedeployments,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=cluster.k8s.io,resources=machinedeployments;machinedeployments/status,verbs=get;list;watch;create;update;patch;delete func (r *ReconcileMachineDeployment) Reconcile(request reconcile.Request) (reconcile.Result, error) { // Fetch the MachineDeployment instance d := &v1alpha1.MachineDeployment{} @@ -272,7 +274,7 @@ func (r *ReconcileMachineDeployment) reconcile(ctx context.Context, d *v1alpha1. func (r *ReconcileMachineDeployment) getCluster(d *v1alpha1.MachineDeployment) (*v1alpha1.Cluster, error) { if d.Spec.Template.Labels[v1alpha1.MachineClusterLabelName] == "" { - klog.Infof("Deployment %q in namespace %q doesn't specify %q label, assuming nil cluster", d.Name, v1alpha1.MachineClusterLabelName, d.Namespace) + klog.Infof("Deployment %q in namespace %q doesn't specify %q label, assuming nil cluster", d.Name, d.Namespace, v1alpha1.MachineClusterLabelName) return nil, nil } @@ -289,39 +291,6 @@ func (r *ReconcileMachineDeployment) getCluster(d *v1alpha1.MachineDeployment) ( return cluster, nil } -// getMachineDeploymentsForMachineSet returns a list of Deployments that potentially -// match a MachineSet. -func (r *ReconcileMachineDeployment) getMachineDeploymentsForMachineSet(ms *v1alpha1.MachineSet) []*v1alpha1.MachineDeployment { - if len(ms.Labels) == 0 { - klog.Warningf("No machine deployments found for MachineSet %v because it has no labels", ms.Name) - return nil - } - - dList := &v1alpha1.MachineDeploymentList{} - listOptions := &client.ListOptions{Namespace: ms.Namespace} - if err := r.Client.List(context.Background(), listOptions, dList); err != nil { - klog.Warningf("Failed to list machine deployments: %v", err) - return nil - } - - deployments := make([]*v1alpha1.MachineDeployment, 0, len(dList.Items)) - for idx, d := range dList.Items { - selector, err := metav1.LabelSelectorAsSelector(&d.Spec.Selector) - if err != nil { - continue - } - - // If a deployment with a nil or empty selector creeps in, it should match nothing, not everything. - if selector.Empty() || !selector.Matches(labels.Set(ms.Labels)) { - continue - } - - deployments = append(deployments, &dList.Items[idx]) - } - - return deployments -} - // getMachineMapForDeployment returns the Machines managed by a Deployment. // // It returns a map from MachineSet UID to a list of Machines controlled by that MS, @@ -367,6 +336,39 @@ func (r *ReconcileMachineDeployment) getMachineMapForDeployment(d *v1alpha1.Mach return machineMap, nil } +// getMachineDeploymentsForMachineSet returns a list of Deployments that potentially +// match a MachineSet. +func (r *ReconcileMachineDeployment) getMachineDeploymentsForMachineSet(ms *v1alpha1.MachineSet) []*v1alpha1.MachineDeployment { + if len(ms.Labels) == 0 { + klog.Warningf("No machine deployments found for MachineSet %v because it has no labels", ms.Name) + return nil + } + + dList := &v1alpha1.MachineDeploymentList{} + listOptions := &client.ListOptions{Namespace: ms.Namespace} + if err := r.Client.List(context.Background(), listOptions, dList); err != nil { + klog.Warningf("Failed to list machine deployments: %v", err) + return nil + } + + deployments := make([]*v1alpha1.MachineDeployment, 0, len(dList.Items)) + for idx, d := range dList.Items { + selector, err := metav1.LabelSelectorAsSelector(&d.Spec.Selector) + if err != nil { + continue + } + + // If a deployment with a nil or empty selector creeps in, it should match nothing, not everything. + if selector.Empty() || !selector.Matches(labels.Set(ms.Labels)) { + continue + } + + deployments = append(deployments, &dList.Items[idx]) + } + + return deployments +} + func (r *ReconcileMachineDeployment) MachineSetToDeployments(o handler.MapObject) []reconcile.Request { result := []reconcile.Request{} @@ -377,6 +379,8 @@ func (r *ReconcileMachineDeployment) MachineSetToDeployments(o handler.MapObject return nil } + // Check if the controller reference is already set and + // return an empty result when one is found. for _, ref := range ms.ObjectMeta.OwnerReferences { if ref.Controller != nil && *ref.Controller { return result diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/controller.go b/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/controller.go index b61030c530..86d0c8cbb5 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/controller.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/controller.go @@ -140,7 +140,7 @@ func (r *ReconcileMachineSet) MachineToMachineSets(o handler.MapObject) []reconc // Reconcile reads that state of the cluster for a MachineSet object and makes changes based on the state read // and what is in the MachineSet.Spec // Automatically generate RBAC rules to allow the Controller to read and write Deployments -// +kubebuilder:rbac:groups=cluster.k8s.io,resources=machinesets,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=cluster.k8s.io,resources=machinesets;machinesets/status,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=cluster.k8s.io,resources=machines,verbs=get;list;watch;create;update;patch;delete func (r *ReconcileMachineSet) Reconcile(request reconcile.Request) (reconcile.Result, error) { // Fetch the MachineSet instance @@ -251,6 +251,10 @@ func (r *ReconcileMachineSet) reconcile(ctx context.Context, machineSet *cluster return reconcile.Result{}, errors.Wrap(err, "failed to update machine set status") } + if syncErr != nil { + return reconcile.Result{}, errors.Wrapf(syncErr, "failed to sync Machineset replicas") + } + var replicas int32 if updatedMS.Spec.Replicas != nil { replicas = *updatedMS.Spec.Replicas @@ -263,7 +267,7 @@ func (r *ReconcileMachineSet) reconcile(ctx context.Context, machineSet *cluster // exceeds MinReadySeconds could be incorrect. // To avoid an available replica stuck in the ready state, we force a reconcile after MinReadySeconds, // at which point it should confirm any available replica to be available. - if syncErr == nil && updatedMS.Spec.MinReadySeconds > 0 && + if updatedMS.Spec.MinReadySeconds > 0 && updatedMS.Status.ReadyReplicas == replicas && updatedMS.Status.AvailableReplicas != replicas { @@ -275,7 +279,7 @@ func (r *ReconcileMachineSet) reconcile(ctx context.Context, machineSet *cluster func (r *ReconcileMachineSet) getCluster(ms *clusterv1alpha1.MachineSet) (*clusterv1alpha1.Cluster, error) { if ms.Spec.Template.Labels[clusterv1alpha1.MachineClusterLabelName] == "" { - klog.Infof("MachineSet %q in namespace %q doesn't specify %q label, assuming nil cluster", ms.Name, clusterv1alpha1.MachineClusterLabelName, ms.Namespace) + klog.Infof("MachineSet %q in namespace %q doesn't specify %q label, assuming nil cluster", ms.Name, ms.Namespace, clusterv1alpha1.MachineClusterLabelName) return nil, nil } diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/status.go b/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/status.go index c22b19ffb7..645d0dbb8c 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/status.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/status.go @@ -112,7 +112,7 @@ func updateMachineSetStatus(c client.Client, ms *v1alpha1.MachineSet, newStatus break } // Update the MachineSet with the latest resource version for the next poll - if getErr = c.Get(context.Background(), client.ObjectKey{Name: ms.Name}, ms); getErr != nil { + if getErr = c.Get(context.Background(), client.ObjectKey{Namespace: ms.Namespace, Name: ms.Name}, ms); getErr != nil { // If the GET fails we can't trust status.Replicas anymore. This error // is bound to be more interesting than the update failure. return nil, getErr diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/noderefutil/util.go b/vendor/sigs.k8s.io/cluster-api/pkg/controller/noderefutil/util.go index a5bf0b8422..d7dd79b8db 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/noderefutil/util.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/controller/noderefutil/util.go @@ -60,7 +60,7 @@ func GetReadyCondition(status *corev1.NodeStatus) *corev1.NodeCondition { // IsNodeReady returns true if a node is ready; false otherwise. func IsNodeReady(node *corev1.Node) bool { - if node == nil || &node.Status == nil { + if node == nil { return false } for _, c := range node.Status.Conditions { diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/util/util.go b/vendor/sigs.k8s.io/cluster-api/pkg/util/util.go index b6bd7d926e..519b2add7f 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/util/util.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/util/util.go @@ -85,16 +85,6 @@ func GetControlPlaneMachines(machines []*clusterv1.Machine) (res []*clusterv1.Ma return } -// MachineP converts a slice of machines into a slice of machine pointers. -func MachineP(machines []clusterv1.Machine) []*clusterv1.Machine { - // Convert to list of pointers - ret := make([]*clusterv1.Machine, 0, len(machines)) - for _, machine := range machines { - ret = append(ret, machine.DeepCopy()) - } - return ret -} - // Home returns the user home directory. func Home() string { home := os.Getenv("HOME") @@ -247,8 +237,7 @@ func ParseMachinesYaml(file string) ([]*clusterv1.Machine, error) { var ( bytes [][]byte machineList clusterv1.MachineList - machine clusterv1.Machine - machines = []clusterv1.Machine{} + machines = []*clusterv1.Machine{} ) // TODO: use the universal decoder instead of doing this. @@ -264,7 +253,8 @@ func ParseMachinesYaml(file string) ([]*clusterv1.Machine, error) { if err := json.Unmarshal(ml, &machineList); err != nil { return nil, err } - for _, machine := range machineList.Items { + for i := range machineList.Items { + machine := &machineList.Items[i] if machine.APIVersion == "" || machine.Kind == "" { return nil, errors.New(MachineListFormatDeprecationMessage) } @@ -282,13 +272,14 @@ func ParseMachinesYaml(file string) ([]*clusterv1.Machine, error) { } for _, m := range bytes { - if err := json.Unmarshal(m, &machine); err != nil { + machine := &clusterv1.Machine{} + if err := json.Unmarshal(m, machine); err != nil { return nil, err } machines = append(machines, machine) } - return MachineP(machines), nil + return machines, nil } // isMissingKind reimplements runtime.IsMissingKind as the YAMLOrJSONDecoder diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/ci-build.sh b/vendor/sigs.k8s.io/cluster-api/scripts/ci-build.sh index 132ec82607..fbd9fca082 100755 --- a/vendor/sigs.k8s.io/cluster-api/scripts/ci-build.sh +++ b/vendor/sigs.k8s.io/cluster-api/scripts/ci-build.sh @@ -18,6 +18,6 @@ set -o errexit set -o nounset set -o pipefail -REPO_ROOT=$(dirname "${BASH_SOURCE}")/.. +REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -cd $REPO_ROOT && make manager clusterctl +cd "$REPO_ROOT" && make manager clusterctl diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/ci-integration.sh b/vendor/sigs.k8s.io/cluster-api/scripts/ci-integration.sh index 5d664c3369..2222f2189b 100755 --- a/vendor/sigs.k8s.io/cluster-api/scripts/ci-integration.sh +++ b/vendor/sigs.k8s.io/cluster-api/scripts/ci-integration.sh @@ -21,6 +21,7 @@ set -o pipefail MAKE="make" KUSTOMIZE="kustomize" KUBECTL="kubectl" +KUBECTL_VERSION="v1.13.2" CRD_YAML="crd.yaml" BOOTSTRAP_CLUSTER_NAME="clusterapi-bootstrap" CONTROLLER_REPO="controller-ci" # use arbitrary repo name since we don't need to publish it @@ -32,13 +33,13 @@ install_kustomize() { } install_kubectl() { - wget https://storage.googleapis.com/kubernetes-release/release/v1.10.2/bin/linux/amd64/kubectl \ + wget https://storage.googleapis.com/kubernetes-release/release/"${KUBECTL_VERSION}"/bin/linux/amd64/kubectl \ --no-verbose -O /usr/local/bin/kubectl chmod +x /usr/local/bin/kubectl } build_containers() { - VERSION=$(git describe --exact-match 2> /dev/null || git describe --match=$(git rev-parse --short=8 HEAD) --always --dirty --abbrev=8) + VERSION="$(git describe --exact-match 2> /dev/null || git describe --match="$(git rev-parse --short=8 HEAD)" --always --dirty --abbrev=8)" CONTROLLER_IMG="${CONTROLLER_REPO}:${VERSION}" EXAMPLE_PROVIDER_IMG="${EXAMPLE_PROVIDER_REPO}:${VERSION}" export CONTROLLER_IMG="${CONTROLLER_IMG}" @@ -58,7 +59,8 @@ prepare_crd_yaml() { create_bootstrap() { go get sigs.k8s.io/kind kind create cluster --name "${BOOTSTRAP_CLUSTER_NAME}" - export KUBECONFIG="$(kind get kubeconfig-path --name="${BOOTSTRAP_CLUSTER_NAME}")" + KUBECONFIG="$(kind get kubeconfig-path --name="${BOOTSTRAP_CLUSTER_NAME}")" + export KUBECONFIG kind load docker-image "${CONTROLLER_IMG}" --name "${BOOTSTRAP_CLUSTER_NAME}" kind load docker-image "${EXAMPLE_PROVIDER_IMG}" --name "${BOOTSTRAP_CLUSTER_NAME}" diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/ci-is-vendor-in-sync.sh b/vendor/sigs.k8s.io/cluster-api/scripts/ci-is-vendor-in-sync.sh index 71c11a718a..d4d04d9355 100755 --- a/vendor/sigs.k8s.io/cluster-api/scripts/ci-is-vendor-in-sync.sh +++ b/vendor/sigs.k8s.io/cluster-api/scripts/ci-is-vendor-in-sync.sh @@ -18,8 +18,8 @@ set -o errexit set -o nounset set -o pipefail -REPO_ROOT=$(dirname "${BASH_SOURCE}")/.. +REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -cd $REPO_ROOT +cd "$REPO_ROOT" find vendor -name 'BUILD.bazel' -delete dep check diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/ci-make.sh b/vendor/sigs.k8s.io/cluster-api/scripts/ci-make.sh index 7c55a20df6..542f741cb9 100755 --- a/vendor/sigs.k8s.io/cluster-api/scripts/ci-make.sh +++ b/vendor/sigs.k8s.io/cluster-api/scripts/ci-make.sh @@ -18,6 +18,6 @@ set -o errexit set -o nounset set -o pipefail -REPO_ROOT=$(dirname "${BASH_SOURCE}")/.. +REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -cd $REPO_ROOT && make lint-full docker-build +cd "$REPO_ROOT" && make lint-full docker-build diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/ci-test.sh b/vendor/sigs.k8s.io/cluster-api/scripts/ci-test.sh index 909cf60128..a697bc3b86 100755 --- a/vendor/sigs.k8s.io/cluster-api/scripts/ci-test.sh +++ b/vendor/sigs.k8s.io/cluster-api/scripts/ci-test.sh @@ -18,9 +18,9 @@ set -o errexit set -o nounset set -o pipefail -REPO_ROOT=$(dirname "${BASH_SOURCE}")/.. +REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -cd $REPO_ROOT && \ +cd "$REPO_ROOT" && \ source ./scripts/fetch_ext_bins.sh && \ fetch_tools && \ setup_envs && \ diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/fetch_ext_bins.sh b/vendor/sigs.k8s.io/cluster-api/scripts/fetch_ext_bins.sh index 7b0f29173e..fcb4aa7e70 100755 --- a/vendor/sigs.k8s.io/cluster-api/scripts/fetch_ext_bins.sh +++ b/vendor/sigs.k8s.io/cluster-api/scripts/fetch_ext_bins.sh @@ -59,11 +59,9 @@ function header_text { echo "$header$*$reset" } -rc=0 tmp_root=/tmp kb_root_dir=$tmp_root/kubebuilder -kb_orig=$(pwd) # Skip fetching and untaring the tools by setting the SKIP_FETCH_TOOLS variable # in your environment to any value: