diff --git a/heartbeat/docs/autodiscover-aws-elb-config.asciidoc b/heartbeat/docs/autodiscover-aws-elb-config.asciidoc new file mode 100644 index 000000000000..94db4d823e0d --- /dev/null +++ b/heartbeat/docs/autodiscover-aws-elb-config.asciidoc @@ -0,0 +1,27 @@ +{beatname_uc} supports templates for modules: + +["source","yaml",subs="attributes"] +------------------------------------------------------------------------------------- +heartbeat.autodiscover: + providers: + - type: aws_elb + period: 1m + regions: ["us-east-1", "us-east-2"] + # If you don't wish to use env vars or shared credentials files explicitly put credentials here. + #access_key_id: my-access-key + #secret_access_key: my-secret-access-key + #session_token: my-session-token + templates: + - condition: + equals.port: 8080 + config: + - type: tcp + hosts: ["${data.host}:${data.port}"] + schedule: "@every 5s" + timeout: 1s +------------------------------------------------------------------------------------- + +This configuration launches a `tcp` monitor for all ELBs that have a declared port. + +This autodiscover provider takes our standard AWS credentials options. + diff --git a/heartbeat/docs/configuring-howto.asciidoc b/heartbeat/docs/configuring-howto.asciidoc index 4ba92dd4be53..e033406ce64a 100644 --- a/heartbeat/docs/configuring-howto.asciidoc +++ b/heartbeat/docs/configuring-howto.asciidoc @@ -75,7 +75,9 @@ include::{libbeat-dir}/docs/loggingconfig.asciidoc[] include::{libbeat-dir}/docs/shared-env-vars.asciidoc[] :standalone!: +:autodiscoverAWSELB: include::{libbeat-dir}/docs/shared-autodiscover.asciidoc[] +:autodiscoverAWSELB!: :standalone: include::{libbeat-dir}/docs/yaml.asciidoc[] diff --git a/libbeat/docs/shared-autodiscover.asciidoc b/libbeat/docs/shared-autodiscover.asciidoc index 3d743b0ea3f0..96d74a2382c8 100644 --- a/libbeat/docs/shared-autodiscover.asciidoc +++ b/libbeat/docs/shared-autodiscover.asciidoc @@ -21,7 +21,10 @@ start/stop events. This ensures you don't need to worry about state, but only de [float] ===== Docker -The Docker autodiscover provider watches for Docker containers to start and stop. These are the available fields on every +The Docker autodiscover provider watches for Docker containers to start and stop. + + +These are the available fields during within config templating. The `docker.*` fields will be available on each emitted event. event: * host @@ -113,8 +116,9 @@ endif::[] [float] ===== Kubernetes -The Kubernetes autodiscover provider watches for Kubernetes pods to start, update, and stop. These are the available fields on every -event: +The Kubernetes autodiscover provider watches for Kubernetes pods to start, update, and stop. + +These are the available fields during within config templating. The `kubernetes.*` fields will be available on each emitted event. * host * port (if exposed) @@ -231,7 +235,7 @@ and the Jolokia agents has to be allowed. Also notice that this multicast address is in the 239.0.0.0/8 range, that is reserved for private use within an organization, so it can only be used in private networks. -These are the available fields on every event: +These are the available fields during within config templating. The `jolokia.*` fields will be available on each emitted event. * jolokia.agent.id * jolokia.agent.version @@ -257,6 +261,43 @@ the ones used for discovery probes, they have these settings: include::../../{beatname_lc}/docs/autodiscover-jolokia-config.asciidoc[] endif::autodiscoverJolokia[] +ifdef::autodiscoverAWSELB[] +[float] +===== Amazon ELBs + +*Note: This provider is experimental* + +The Amazon ELB autodiscover provider discovers https://aws.amazon.com/elasticloadbalancing/[ELBs] and their listeners. This is useful when you don't want to connect +directly to a service, but rather to the ELB fronting a pool of services. + +This provider will yield one config block per ELB Listener. So, if you have one ELB exposing both ports 80 and 443, it +will generate two configs, one for each port. Keep in mind that the beat will de-duplicate configs. So, if the generated +configs are the same only one will actually run. + +This provider will load AWS credentials using the standard AWS environment variables and shared credentials files see https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html[Best Practices for Managing AWS Access Keys] for more information. If you do not wish to use these, you may explicitly set the `access_key_id` and `secret_access_key` variables. + +These are the available fields during within config templating. The `elb_listener.*` fields will be available on each emitted event. + + * host + * port + * elb_listener.listener_arn + * elb_listener.load_balancer_arn + * elb_listener.protocol + * elb_listener.type + * elb_listener.scheme + * elb_listener.availability_zones + * elb_listener.created + * elb_listener.state + * elb_listener.ip_address_type + * elb_listener.security_groups + * elb_listener.vpc_id + * elb_listener.ssl_policy + +include::../../{beatname_lc}/docs/autodiscover-aws-elb-config.asciidoc[] + +endif::autodiscoverAWSELB[] + + ifdef::autodiscoverHints[] [[configuration-autodiscover-hints]] === Hints based autodiscover diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_client.go new file mode 100644 index 000000000000..08b6a5a4ce85 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_client.go @@ -0,0 +1,79 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/private/protocol/query" +) + +// Client provides the API operation methods for making requests to +// Elastic Load Balancing v2. See this package's package overview docs +// for details on the service. +// +// The client's methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type Client struct { + *aws.Client +} + +// Used for custom client initialization logic +var initClient func(*Client) + +// Used for custom request initialization logic +var initRequest func(*Client, *aws.Request) + +const ( + ServiceName = "Elastic Load Balancing v2" // Service's name + ServiceID = "ElasticLoadBalancingV2" // Service's identifier + EndpointsID = "elasticloadbalancing" // Service's Endpoint identifier +) + +// New creates a new instance of the client from the provided Config. +// +// Example: +// // Create a client from just a config. +// svc := elasticloadbalancingv2.New(myConfig) +func New(config aws.Config) *Client { + svc := &Client{ + Client: aws.NewClient( + config, + aws.Metadata{ + ServiceName: ServiceName, + ServiceID: ServiceID, + EndpointsID: EndpointsID, + SigningName: "elasticloadbalancing", + SigningRegion: config.Region, + APIVersion: "2015-12-01", + }, + ), + } + + // Handlers + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) + svc.Handlers.Build.PushBackNamed(query.BuildHandler) + svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) + svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) + svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc) + } + + return svc +} + +// newRequest creates a new request for a client operation and runs any +// custom request initialization. +func (c *Client) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { + req := c.NewRequest(op, params, data) + + // Run custom request initialization if present + if initRequest != nil { + initRequest(c, req) + } + + return req +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_doc.go new file mode 100644 index 000000000000..8b74a2c7c30d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_doc.go @@ -0,0 +1,76 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package elasticloadbalancingv2 provides the client and types for making API +// requests to Elastic Load Balancing v2. +// +// A load balancer distributes incoming traffic across targets, such as your +// EC2 instances. This enables you to increase the availability of your application. +// The load balancer also monitors the health of its registered targets and +// ensures that it routes traffic only to healthy targets. You configure your +// load balancer to accept incoming traffic by specifying one or more listeners, +// which are configured with a protocol and port number for connections from +// clients to the load balancer. You configure a target group with a protocol +// and port number for connections from the load balancer to the targets, and +// with health check settings to be used when checking the health status of +// the targets. +// +// Elastic Load Balancing supports the following types of load balancers: Application +// Load Balancers, Network Load Balancers, and Classic Load Balancers. +// +// An Application Load Balancer makes routing and load balancing decisions at +// the application layer (HTTP/HTTPS). A Network Load Balancer makes routing +// and load balancing decisions at the transport layer (TCP/TLS). Both Application +// Load Balancers and Network Load Balancers can route requests to one or more +// ports on each EC2 instance or container instance in your virtual private +// cloud (VPC). +// +// A Classic Load Balancer makes routing and load balancing decisions either +// at the transport layer (TCP/SSL) or the application layer (HTTP/HTTPS), and +// supports either EC2-Classic or a VPC. For more information, see the Elastic +// Load Balancing User Guide (https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/). +// +// This reference covers the 2015-12-01 API, which supports Application Load +// Balancers and Network Load Balancers. The 2012-06-01 API supports Classic +// Load Balancers. +// +// To get started, complete the following tasks: +// +// Create a load balancer using CreateLoadBalancer. +// +// Create a target group using CreateTargetGroup. +// +// Register targets for the target group using RegisterTargets. +// +// Create one or more listeners for your load balancer using CreateListener. +// +// To delete a load balancer and its related resources, complete the following +// tasks: +// +// Delete the load balancer using DeleteLoadBalancer. +// +// Delete the target group using DeleteTargetGroup. +// +// All Elastic Load Balancing operations are idempotent, which means that they +// complete at most one time. If you repeat an operation, it succeeds. +// +// See https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01 for more information on this service. +// +// See elasticloadbalancingv2 package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/elasticloadbalancingv2/ +// +// Using the Client +// +// To use Elastic Load Balancing v2 with the SDK use the New function to create +// a new service client. With that client you can make API requests to the service. +// These clients are safe to use concurrently. +// +// See the SDK's documentation for more information on how to use the SDK. +// https://docs.aws.amazon.com/sdk-for-go/api/ +// +// See aws.Config documentation for more information on configuring SDK clients. +// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config +// +// See the Elastic Load Balancing v2 client for more information on +// creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/elasticloadbalancingv2/#New +package elasticloadbalancingv2 diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_enums.go new file mode 100644 index 000000000000..a16734caae6b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_enums.go @@ -0,0 +1,231 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +type ActionTypeEnum string + +// Enum values for ActionTypeEnum +const ( + ActionTypeEnumForward ActionTypeEnum = "forward" + ActionTypeEnumAuthenticateOidc ActionTypeEnum = "authenticate-oidc" + ActionTypeEnumAuthenticateCognito ActionTypeEnum = "authenticate-cognito" + ActionTypeEnumRedirect ActionTypeEnum = "redirect" + ActionTypeEnumFixedResponse ActionTypeEnum = "fixed-response" +) + +func (enum ActionTypeEnum) MarshalValue() (string, error) { + return string(enum), nil +} + +func (enum ActionTypeEnum) MarshalValueBuf(b []byte) ([]byte, error) { + b = b[0:0] + return append(b, enum...), nil +} + +type AuthenticateCognitoActionConditionalBehaviorEnum string + +// Enum values for AuthenticateCognitoActionConditionalBehaviorEnum +const ( + AuthenticateCognitoActionConditionalBehaviorEnumDeny AuthenticateCognitoActionConditionalBehaviorEnum = "deny" + AuthenticateCognitoActionConditionalBehaviorEnumAllow AuthenticateCognitoActionConditionalBehaviorEnum = "allow" + AuthenticateCognitoActionConditionalBehaviorEnumAuthenticate AuthenticateCognitoActionConditionalBehaviorEnum = "authenticate" +) + +func (enum AuthenticateCognitoActionConditionalBehaviorEnum) MarshalValue() (string, error) { + return string(enum), nil +} + +func (enum AuthenticateCognitoActionConditionalBehaviorEnum) MarshalValueBuf(b []byte) ([]byte, error) { + b = b[0:0] + return append(b, enum...), nil +} + +type AuthenticateOidcActionConditionalBehaviorEnum string + +// Enum values for AuthenticateOidcActionConditionalBehaviorEnum +const ( + AuthenticateOidcActionConditionalBehaviorEnumDeny AuthenticateOidcActionConditionalBehaviorEnum = "deny" + AuthenticateOidcActionConditionalBehaviorEnumAllow AuthenticateOidcActionConditionalBehaviorEnum = "allow" + AuthenticateOidcActionConditionalBehaviorEnumAuthenticate AuthenticateOidcActionConditionalBehaviorEnum = "authenticate" +) + +func (enum AuthenticateOidcActionConditionalBehaviorEnum) MarshalValue() (string, error) { + return string(enum), nil +} + +func (enum AuthenticateOidcActionConditionalBehaviorEnum) MarshalValueBuf(b []byte) ([]byte, error) { + b = b[0:0] + return append(b, enum...), nil +} + +type IpAddressType string + +// Enum values for IpAddressType +const ( + IpAddressTypeIpv4 IpAddressType = "ipv4" + IpAddressTypeDualstack IpAddressType = "dualstack" +) + +func (enum IpAddressType) MarshalValue() (string, error) { + return string(enum), nil +} + +func (enum IpAddressType) MarshalValueBuf(b []byte) ([]byte, error) { + b = b[0:0] + return append(b, enum...), nil +} + +type LoadBalancerSchemeEnum string + +// Enum values for LoadBalancerSchemeEnum +const ( + LoadBalancerSchemeEnumInternetFacing LoadBalancerSchemeEnum = "internet-facing" + LoadBalancerSchemeEnumInternal LoadBalancerSchemeEnum = "internal" +) + +func (enum LoadBalancerSchemeEnum) MarshalValue() (string, error) { + return string(enum), nil +} + +func (enum LoadBalancerSchemeEnum) MarshalValueBuf(b []byte) ([]byte, error) { + b = b[0:0] + return append(b, enum...), nil +} + +type LoadBalancerStateEnum string + +// Enum values for LoadBalancerStateEnum +const ( + LoadBalancerStateEnumActive LoadBalancerStateEnum = "active" + LoadBalancerStateEnumProvisioning LoadBalancerStateEnum = "provisioning" + LoadBalancerStateEnumActiveImpaired LoadBalancerStateEnum = "active_impaired" + LoadBalancerStateEnumFailed LoadBalancerStateEnum = "failed" +) + +func (enum LoadBalancerStateEnum) MarshalValue() (string, error) { + return string(enum), nil +} + +func (enum LoadBalancerStateEnum) MarshalValueBuf(b []byte) ([]byte, error) { + b = b[0:0] + return append(b, enum...), nil +} + +type LoadBalancerTypeEnum string + +// Enum values for LoadBalancerTypeEnum +const ( + LoadBalancerTypeEnumApplication LoadBalancerTypeEnum = "application" + LoadBalancerTypeEnumNetwork LoadBalancerTypeEnum = "network" +) + +func (enum LoadBalancerTypeEnum) MarshalValue() (string, error) { + return string(enum), nil +} + +func (enum LoadBalancerTypeEnum) MarshalValueBuf(b []byte) ([]byte, error) { + b = b[0:0] + return append(b, enum...), nil +} + +type ProtocolEnum string + +// Enum values for ProtocolEnum +const ( + ProtocolEnumHttp ProtocolEnum = "HTTP" + ProtocolEnumHttps ProtocolEnum = "HTTPS" + ProtocolEnumTcp ProtocolEnum = "TCP" + ProtocolEnumTls ProtocolEnum = "TLS" +) + +func (enum ProtocolEnum) MarshalValue() (string, error) { + return string(enum), nil +} + +func (enum ProtocolEnum) MarshalValueBuf(b []byte) ([]byte, error) { + b = b[0:0] + return append(b, enum...), nil +} + +type RedirectActionStatusCodeEnum string + +// Enum values for RedirectActionStatusCodeEnum +const ( + RedirectActionStatusCodeEnumHttp301 RedirectActionStatusCodeEnum = "HTTP_301" + RedirectActionStatusCodeEnumHttp302 RedirectActionStatusCodeEnum = "HTTP_302" +) + +func (enum RedirectActionStatusCodeEnum) MarshalValue() (string, error) { + return string(enum), nil +} + +func (enum RedirectActionStatusCodeEnum) MarshalValueBuf(b []byte) ([]byte, error) { + b = b[0:0] + return append(b, enum...), nil +} + +type TargetHealthReasonEnum string + +// Enum values for TargetHealthReasonEnum +const ( + TargetHealthReasonEnumElbRegistrationInProgress TargetHealthReasonEnum = "Elb.RegistrationInProgress" + TargetHealthReasonEnumElbInitialHealthChecking TargetHealthReasonEnum = "Elb.InitialHealthChecking" + TargetHealthReasonEnumTargetResponseCodeMismatch TargetHealthReasonEnum = "Target.ResponseCodeMismatch" + TargetHealthReasonEnumTargetTimeout TargetHealthReasonEnum = "Target.Timeout" + TargetHealthReasonEnumTargetFailedHealthChecks TargetHealthReasonEnum = "Target.FailedHealthChecks" + TargetHealthReasonEnumTargetNotRegistered TargetHealthReasonEnum = "Target.NotRegistered" + TargetHealthReasonEnumTargetNotInUse TargetHealthReasonEnum = "Target.NotInUse" + TargetHealthReasonEnumTargetDeregistrationInProgress TargetHealthReasonEnum = "Target.DeregistrationInProgress" + TargetHealthReasonEnumTargetInvalidState TargetHealthReasonEnum = "Target.InvalidState" + TargetHealthReasonEnumTargetIpUnusable TargetHealthReasonEnum = "Target.IpUnusable" + TargetHealthReasonEnumTargetHealthCheckDisabled TargetHealthReasonEnum = "Target.HealthCheckDisabled" + TargetHealthReasonEnumElbInternalError TargetHealthReasonEnum = "Elb.InternalError" +) + +func (enum TargetHealthReasonEnum) MarshalValue() (string, error) { + return string(enum), nil +} + +func (enum TargetHealthReasonEnum) MarshalValueBuf(b []byte) ([]byte, error) { + b = b[0:0] + return append(b, enum...), nil +} + +type TargetHealthStateEnum string + +// Enum values for TargetHealthStateEnum +const ( + TargetHealthStateEnumInitial TargetHealthStateEnum = "initial" + TargetHealthStateEnumHealthy TargetHealthStateEnum = "healthy" + TargetHealthStateEnumUnhealthy TargetHealthStateEnum = "unhealthy" + TargetHealthStateEnumUnused TargetHealthStateEnum = "unused" + TargetHealthStateEnumDraining TargetHealthStateEnum = "draining" + TargetHealthStateEnumUnavailable TargetHealthStateEnum = "unavailable" +) + +func (enum TargetHealthStateEnum) MarshalValue() (string, error) { + return string(enum), nil +} + +func (enum TargetHealthStateEnum) MarshalValueBuf(b []byte) ([]byte, error) { + b = b[0:0] + return append(b, enum...), nil +} + +type TargetTypeEnum string + +// Enum values for TargetTypeEnum +const ( + TargetTypeEnumInstance TargetTypeEnum = "instance" + TargetTypeEnumIp TargetTypeEnum = "ip" + TargetTypeEnumLambda TargetTypeEnum = "lambda" +) + +func (enum TargetTypeEnum) MarshalValue() (string, error) { + return string(enum), nil +} + +func (enum TargetTypeEnum) MarshalValueBuf(b []byte) ([]byte, error) { + b = b[0:0] + return append(b, enum...), nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_errors.go new file mode 100644 index 000000000000..24712753b7c1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_errors.go @@ -0,0 +1,219 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +const ( + + // ErrCodeAllocationIdNotFoundException for service response error code + // "AllocationIdNotFound". + // + // The specified allocation ID does not exist. + ErrCodeAllocationIdNotFoundException = "AllocationIdNotFound" + + // ErrCodeAvailabilityZoneNotSupportedException for service response error code + // "AvailabilityZoneNotSupported". + // + // The specified Availability Zone is not supported. + ErrCodeAvailabilityZoneNotSupportedException = "AvailabilityZoneNotSupported" + + // ErrCodeCertificateNotFoundException for service response error code + // "CertificateNotFound". + // + // The specified certificate does not exist. + ErrCodeCertificateNotFoundException = "CertificateNotFound" + + // ErrCodeDuplicateListenerException for service response error code + // "DuplicateListener". + // + // A listener with the specified port already exists. + ErrCodeDuplicateListenerException = "DuplicateListener" + + // ErrCodeDuplicateLoadBalancerNameException for service response error code + // "DuplicateLoadBalancerName". + // + // A load balancer with the specified name already exists. + ErrCodeDuplicateLoadBalancerNameException = "DuplicateLoadBalancerName" + + // ErrCodeDuplicateTagKeysException for service response error code + // "DuplicateTagKeys". + // + // A tag key was specified more than once. + ErrCodeDuplicateTagKeysException = "DuplicateTagKeys" + + // ErrCodeDuplicateTargetGroupNameException for service response error code + // "DuplicateTargetGroupName". + // + // A target group with the specified name already exists. + ErrCodeDuplicateTargetGroupNameException = "DuplicateTargetGroupName" + + // ErrCodeHealthUnavailableException for service response error code + // "HealthUnavailable". + // + // The health of the specified targets could not be retrieved due to an internal + // error. + ErrCodeHealthUnavailableException = "HealthUnavailable" + + // ErrCodeIncompatibleProtocolsException for service response error code + // "IncompatibleProtocols". + // + // The specified configuration is not valid with this protocol. + ErrCodeIncompatibleProtocolsException = "IncompatibleProtocols" + + // ErrCodeInvalidConfigurationRequestException for service response error code + // "InvalidConfigurationRequest". + // + // The requested configuration is not valid. + ErrCodeInvalidConfigurationRequestException = "InvalidConfigurationRequest" + + // ErrCodeInvalidLoadBalancerActionException for service response error code + // "InvalidLoadBalancerAction". + // + // The requested action is not valid. + ErrCodeInvalidLoadBalancerActionException = "InvalidLoadBalancerAction" + + // ErrCodeInvalidSchemeException for service response error code + // "InvalidScheme". + // + // The requested scheme is not valid. + ErrCodeInvalidSchemeException = "InvalidScheme" + + // ErrCodeInvalidSecurityGroupException for service response error code + // "InvalidSecurityGroup". + // + // The specified security group does not exist. + ErrCodeInvalidSecurityGroupException = "InvalidSecurityGroup" + + // ErrCodeInvalidSubnetException for service response error code + // "InvalidSubnet". + // + // The specified subnet is out of available addresses. + ErrCodeInvalidSubnetException = "InvalidSubnet" + + // ErrCodeInvalidTargetException for service response error code + // "InvalidTarget". + // + // The specified target does not exist, is not in the same VPC as the target + // group, or has an unsupported instance type. + ErrCodeInvalidTargetException = "InvalidTarget" + + // ErrCodeListenerNotFoundException for service response error code + // "ListenerNotFound". + // + // The specified listener does not exist. + ErrCodeListenerNotFoundException = "ListenerNotFound" + + // ErrCodeLoadBalancerNotFoundException for service response error code + // "LoadBalancerNotFound". + // + // The specified load balancer does not exist. + ErrCodeLoadBalancerNotFoundException = "LoadBalancerNotFound" + + // ErrCodeOperationNotPermittedException for service response error code + // "OperationNotPermitted". + // + // This operation is not allowed. + ErrCodeOperationNotPermittedException = "OperationNotPermitted" + + // ErrCodePriorityInUseException for service response error code + // "PriorityInUse". + // + // The specified priority is in use. + ErrCodePriorityInUseException = "PriorityInUse" + + // ErrCodeResourceInUseException for service response error code + // "ResourceInUse". + // + // A specified resource is in use. + ErrCodeResourceInUseException = "ResourceInUse" + + // ErrCodeRuleNotFoundException for service response error code + // "RuleNotFound". + // + // The specified rule does not exist. + ErrCodeRuleNotFoundException = "RuleNotFound" + + // ErrCodeSSLPolicyNotFoundException for service response error code + // "SSLPolicyNotFound". + // + // The specified SSL policy does not exist. + ErrCodeSSLPolicyNotFoundException = "SSLPolicyNotFound" + + // ErrCodeSubnetNotFoundException for service response error code + // "SubnetNotFound". + // + // The specified subnet does not exist. + ErrCodeSubnetNotFoundException = "SubnetNotFound" + + // ErrCodeTargetGroupAssociationLimitException for service response error code + // "TargetGroupAssociationLimit". + // + // You've reached the limit on the number of load balancers per target group. + ErrCodeTargetGroupAssociationLimitException = "TargetGroupAssociationLimit" + + // ErrCodeTargetGroupNotFoundException for service response error code + // "TargetGroupNotFound". + // + // The specified target group does not exist. + ErrCodeTargetGroupNotFoundException = "TargetGroupNotFound" + + // ErrCodeTooManyActionsException for service response error code + // "TooManyActions". + // + // You've reached the limit on the number of actions per rule. + ErrCodeTooManyActionsException = "TooManyActions" + + // ErrCodeTooManyCertificatesException for service response error code + // "TooManyCertificates". + // + // You've reached the limit on the number of certificates per load balancer. + ErrCodeTooManyCertificatesException = "TooManyCertificates" + + // ErrCodeTooManyListenersException for service response error code + // "TooManyListeners". + // + // You've reached the limit on the number of listeners per load balancer. + ErrCodeTooManyListenersException = "TooManyListeners" + + // ErrCodeTooManyLoadBalancersException for service response error code + // "TooManyLoadBalancers". + // + // You've reached the limit on the number of load balancers for your AWS account. + ErrCodeTooManyLoadBalancersException = "TooManyLoadBalancers" + + // ErrCodeTooManyRegistrationsForTargetIdException for service response error code + // "TooManyRegistrationsForTargetId". + // + // You've reached the limit on the number of times a target can be registered + // with a load balancer. + ErrCodeTooManyRegistrationsForTargetIdException = "TooManyRegistrationsForTargetId" + + // ErrCodeTooManyRulesException for service response error code + // "TooManyRules". + // + // You've reached the limit on the number of rules per load balancer. + ErrCodeTooManyRulesException = "TooManyRules" + + // ErrCodeTooManyTagsException for service response error code + // "TooManyTags". + // + // You've reached the limit on the number of tags per load balancer. + ErrCodeTooManyTagsException = "TooManyTags" + + // ErrCodeTooManyTargetGroupsException for service response error code + // "TooManyTargetGroups". + // + // You've reached the limit on the number of target groups for your AWS account. + ErrCodeTooManyTargetGroupsException = "TooManyTargetGroups" + + // ErrCodeTooManyTargetsException for service response error code + // "TooManyTargets". + // + // You've reached the limit on the number of targets. + ErrCodeTooManyTargetsException = "TooManyTargets" + + // ErrCodeUnsupportedProtocolException for service response error code + // "UnsupportedProtocol". + // + // The specified protocol is not supported. + ErrCodeUnsupportedProtocolException = "UnsupportedProtocol" +) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_AddListenerCertificates.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_AddListenerCertificates.go new file mode 100644 index 000000000000..2e32957bae0e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_AddListenerCertificates.go @@ -0,0 +1,137 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/AddListenerCertificatesInput +type AddListenerCertificatesInput struct { + _ struct{} `type:"structure"` + + // The certificate to add. You can specify one certificate per call. Set CertificateArn + // to the certificate ARN but do not set IsDefault. + // + // Certificates is a required field + Certificates []Certificate `type:"list" required:"true"` + + // The Amazon Resource Name (ARN) of the listener. + // + // ListenerArn is a required field + ListenerArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AddListenerCertificatesInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AddListenerCertificatesInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "AddListenerCertificatesInput"} + + if s.Certificates == nil { + invalidParams.Add(aws.NewErrParamRequired("Certificates")) + } + + if s.ListenerArn == nil { + invalidParams.Add(aws.NewErrParamRequired("ListenerArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/AddListenerCertificatesOutput +type AddListenerCertificatesOutput struct { + _ struct{} `type:"structure"` + + // Information about the certificates. + Certificates []Certificate `type:"list"` +} + +// String returns the string representation +func (s AddListenerCertificatesOutput) String() string { + return awsutil.Prettify(s) +} + +const opAddListenerCertificates = "AddListenerCertificates" + +// AddListenerCertificatesRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Adds the specified certificate to the specified HTTPS listener. +// +// If the certificate was already added, the call is successful but the certificate +// is not added again. +// +// To list the certificates for your listener, use DescribeListenerCertificates. +// To remove certificates from your listener, use RemoveListenerCertificates. +// To specify the default SSL server certificate, use ModifyListener. +// +// // Example sending a request using AddListenerCertificatesRequest. +// req := client.AddListenerCertificatesRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/AddListenerCertificates +func (c *Client) AddListenerCertificatesRequest(input *AddListenerCertificatesInput) AddListenerCertificatesRequest { + op := &aws.Operation{ + Name: opAddListenerCertificates, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AddListenerCertificatesInput{} + } + + req := c.newRequest(op, input, &AddListenerCertificatesOutput{}) + return AddListenerCertificatesRequest{Request: req, Input: input, Copy: c.AddListenerCertificatesRequest} +} + +// AddListenerCertificatesRequest is the request type for the +// AddListenerCertificates API operation. +type AddListenerCertificatesRequest struct { + *aws.Request + Input *AddListenerCertificatesInput + Copy func(*AddListenerCertificatesInput) AddListenerCertificatesRequest +} + +// Send marshals and sends the AddListenerCertificates API request. +func (r AddListenerCertificatesRequest) Send(ctx context.Context) (*AddListenerCertificatesResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &AddListenerCertificatesResponse{ + AddListenerCertificatesOutput: r.Request.Data.(*AddListenerCertificatesOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// AddListenerCertificatesResponse is the response type for the +// AddListenerCertificates API operation. +type AddListenerCertificatesResponse struct { + *AddListenerCertificatesOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// AddListenerCertificates request. +func (r *AddListenerCertificatesResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_AddTags.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_AddTags.go new file mode 100644 index 000000000000..3274361cad4b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_AddTags.go @@ -0,0 +1,145 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/AddTagsInput +type AddTagsInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + // + // ResourceArns is a required field + ResourceArns []string `type:"list" required:"true"` + + // The tags. Each resource can have a maximum of 10 tags. + // + // Tags is a required field + Tags []Tag `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s AddTagsInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AddTagsInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "AddTagsInput"} + + if s.ResourceArns == nil { + invalidParams.Add(aws.NewErrParamRequired("ResourceArns")) + } + + if s.Tags == nil { + invalidParams.Add(aws.NewErrParamRequired("Tags")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(aws.NewErrParamMinLen("Tags", 1)) + } + if s.Tags != nil { + for i, v := range s.Tags { + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(aws.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/AddTagsOutput +type AddTagsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AddTagsOutput) String() string { + return awsutil.Prettify(s) +} + +const opAddTags = "AddTags" + +// AddTagsRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Adds the specified tags to the specified Elastic Load Balancing resource. +// You can tag your Application Load Balancers, Network Load Balancers, and +// your target groups. +// +// Each tag consists of a key and an optional value. If a resource already has +// a tag with the same key, AddTags updates its value. +// +// To list the current tags for your resources, use DescribeTags. To remove +// tags from your resources, use RemoveTags. +// +// // Example sending a request using AddTagsRequest. +// req := client.AddTagsRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/AddTags +func (c *Client) AddTagsRequest(input *AddTagsInput) AddTagsRequest { + op := &aws.Operation{ + Name: opAddTags, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AddTagsInput{} + } + + req := c.newRequest(op, input, &AddTagsOutput{}) + return AddTagsRequest{Request: req, Input: input, Copy: c.AddTagsRequest} +} + +// AddTagsRequest is the request type for the +// AddTags API operation. +type AddTagsRequest struct { + *aws.Request + Input *AddTagsInput + Copy func(*AddTagsInput) AddTagsRequest +} + +// Send marshals and sends the AddTags API request. +func (r AddTagsRequest) Send(ctx context.Context) (*AddTagsResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &AddTagsResponse{ + AddTagsOutput: r.Request.Data.(*AddTagsOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// AddTagsResponse is the response type for the +// AddTags API operation. +type AddTagsResponse struct { + *AddTagsOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// AddTags request. +func (r *AddTagsResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_CreateListener.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_CreateListener.go new file mode 100644 index 000000000000..27e7eefadcde --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_CreateListener.go @@ -0,0 +1,202 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateListenerInput +type CreateListenerInput struct { + _ struct{} `type:"structure"` + + // [HTTPS and TLS listeners] The default SSL server certificate. You must provide + // exactly one certificate. Set CertificateArn to the certificate ARN but do + // not set IsDefault. + // + // To create a certificate list, use AddListenerCertificates. + Certificates []Certificate `type:"list"` + + // The actions for the default rule. The rule must include one forward action + // or one or more fixed-response actions. + // + // If the action type is forward, you specify a target group. The protocol of + // the target group must be HTTP or HTTPS for an Application Load Balancer. + // The protocol of the target group must be TCP or TLS for a Network Load Balancer. + // + // [HTTPS listeners] If the action type is authenticate-oidc, you authenticate + // users through an identity provider that is OpenID Connect (OIDC) compliant. + // + // [HTTPS listeners] If the action type is authenticate-cognito, you authenticate + // users through the user pools supported by Amazon Cognito. + // + // [Application Load Balancer] If the action type is redirect, you redirect + // specified client requests from one URL to another. + // + // [Application Load Balancer] If the action type is fixed-response, you drop + // specified client requests and return a custom HTTP response. + // + // DefaultActions is a required field + DefaultActions []Action `type:"list" required:"true"` + + // The Amazon Resource Name (ARN) of the load balancer. + // + // LoadBalancerArn is a required field + LoadBalancerArn *string `type:"string" required:"true"` + + // The port on which the load balancer is listening. + // + // Port is a required field + Port *int64 `min:"1" type:"integer" required:"true"` + + // The protocol for connections from clients to the load balancer. For Application + // Load Balancers, the supported protocols are HTTP and HTTPS. For Network Load + // Balancers, the supported protocols are TCP and TLS. + // + // Protocol is a required field + Protocol ProtocolEnum `type:"string" required:"true" enum:"true"` + + // [HTTPS and TLS listeners] The security policy that defines which ciphers + // and protocols are supported. The default is the current predefined security + // policy. + SslPolicy *string `type:"string"` +} + +// String returns the string representation +func (s CreateListenerInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateListenerInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "CreateListenerInput"} + + if s.DefaultActions == nil { + invalidParams.Add(aws.NewErrParamRequired("DefaultActions")) + } + + if s.LoadBalancerArn == nil { + invalidParams.Add(aws.NewErrParamRequired("LoadBalancerArn")) + } + + if s.Port == nil { + invalidParams.Add(aws.NewErrParamRequired("Port")) + } + if s.Port != nil && *s.Port < 1 { + invalidParams.Add(aws.NewErrParamMinValue("Port", 1)) + } + if len(s.Protocol) == 0 { + invalidParams.Add(aws.NewErrParamRequired("Protocol")) + } + if s.DefaultActions != nil { + for i, v := range s.DefaultActions { + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DefaultActions", i), err.(aws.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateListenerOutput +type CreateListenerOutput struct { + _ struct{} `type:"structure"` + + // Information about the listener. + Listeners []Listener `type:"list"` +} + +// String returns the string representation +func (s CreateListenerOutput) String() string { + return awsutil.Prettify(s) +} + +const opCreateListener = "CreateListener" + +// CreateListenerRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Creates a listener for the specified Application Load Balancer or Network +// Load Balancer. +// +// To update a listener, use ModifyListener. When you are finished with a listener, +// you can delete it using DeleteListener. If you are finished with both the +// listener and the load balancer, you can delete them both using DeleteLoadBalancer. +// +// This operation is idempotent, which means that it completes at most one time. +// If you attempt to create multiple listeners with the same settings, each +// call succeeds. +// +// For more information, see Listeners for Your Application Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html) +// in the Application Load Balancers Guide and Listeners for Your Network Load +// Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-listeners.html) +// in the Network Load Balancers Guide. +// +// // Example sending a request using CreateListenerRequest. +// req := client.CreateListenerRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateListener +func (c *Client) CreateListenerRequest(input *CreateListenerInput) CreateListenerRequest { + op := &aws.Operation{ + Name: opCreateListener, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateListenerInput{} + } + + req := c.newRequest(op, input, &CreateListenerOutput{}) + return CreateListenerRequest{Request: req, Input: input, Copy: c.CreateListenerRequest} +} + +// CreateListenerRequest is the request type for the +// CreateListener API operation. +type CreateListenerRequest struct { + *aws.Request + Input *CreateListenerInput + Copy func(*CreateListenerInput) CreateListenerRequest +} + +// Send marshals and sends the CreateListener API request. +func (r CreateListenerRequest) Send(ctx context.Context) (*CreateListenerResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &CreateListenerResponse{ + CreateListenerOutput: r.Request.Data.(*CreateListenerOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// CreateListenerResponse is the response type for the +// CreateListener API operation. +type CreateListenerResponse struct { + *CreateListenerOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// CreateListener request. +func (r *CreateListenerResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_CreateLoadBalancer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_CreateLoadBalancer.go new file mode 100644 index 000000000000..edd16e3b6b53 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_CreateLoadBalancer.go @@ -0,0 +1,205 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateLoadBalancerInput +type CreateLoadBalancerInput struct { + _ struct{} `type:"structure"` + + // [Application Load Balancers] The type of IP addresses used by the subnets + // for your load balancer. The possible values are ipv4 (for IPv4 addresses) + // and dualstack (for IPv4 and IPv6 addresses). Internal load balancers must + // use ipv4. + IpAddressType IpAddressType `type:"string" enum:"true"` + + // The name of the load balancer. + // + // This name must be unique per region per account, can have a maximum of 32 + // characters, must contain only alphanumeric characters or hyphens, must not + // begin or end with a hyphen, and must not begin with "internal-". + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // The nodes of an Internet-facing load balancer have public IP addresses. The + // DNS name of an Internet-facing load balancer is publicly resolvable to the + // public IP addresses of the nodes. Therefore, Internet-facing load balancers + // can route requests from clients over the internet. + // + // The nodes of an internal load balancer have only private IP addresses. The + // DNS name of an internal load balancer is publicly resolvable to the private + // IP addresses of the nodes. Therefore, internal load balancers can only route + // requests from clients with access to the VPC for the load balancer. + // + // The default is an Internet-facing load balancer. + Scheme LoadBalancerSchemeEnum `type:"string" enum:"true"` + + // [Application Load Balancers] The IDs of the security groups for the load + // balancer. + SecurityGroups []string `type:"list"` + + // The IDs of the public subnets. You can specify only one subnet per Availability + // Zone. You must specify either subnets or subnet mappings. + // + // [Application Load Balancers] You must specify subnets from at least two Availability + // Zones. You cannot specify Elastic IP addresses for your subnets. + // + // [Network Load Balancers] You can specify subnets from one or more Availability + // Zones. You can specify one Elastic IP address per subnet. + SubnetMappings []SubnetMapping `type:"list"` + + // The IDs of the public subnets. You can specify only one subnet per Availability + // Zone. You must specify either subnets or subnet mappings. + // + // [Application Load Balancers] You must specify subnets from at least two Availability + // Zones. + // + // [Network Load Balancers] You can specify subnets from one or more Availability + // Zones. + Subnets []string `type:"list"` + + // One or more tags to assign to the load balancer. + Tags []Tag `min:"1" type:"list"` + + // The type of load balancer. The default is application. + Type LoadBalancerTypeEnum `type:"string" enum:"true"` +} + +// String returns the string representation +func (s CreateLoadBalancerInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateLoadBalancerInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "CreateLoadBalancerInput"} + + if s.Name == nil { + invalidParams.Add(aws.NewErrParamRequired("Name")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(aws.NewErrParamMinLen("Tags", 1)) + } + if s.Tags != nil { + for i, v := range s.Tags { + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(aws.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateLoadBalancerOutput +type CreateLoadBalancerOutput struct { + _ struct{} `type:"structure"` + + // Information about the load balancer. + LoadBalancers []LoadBalancer `type:"list"` +} + +// String returns the string representation +func (s CreateLoadBalancerOutput) String() string { + return awsutil.Prettify(s) +} + +const opCreateLoadBalancer = "CreateLoadBalancer" + +// CreateLoadBalancerRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Creates an Application Load Balancer or a Network Load Balancer. +// +// When you create a load balancer, you can specify security groups, public +// subnets, IP address type, and tags. Otherwise, you could do so later using +// SetSecurityGroups, SetSubnets, SetIpAddressType, and AddTags. +// +// To create listeners for your load balancer, use CreateListener. To describe +// your current load balancers, see DescribeLoadBalancers. When you are finished +// with a load balancer, you can delete it using DeleteLoadBalancer. +// +// For limit information, see Limits for Your Application Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-limits.html) +// in the Application Load Balancers Guide and Limits for Your Network Load +// Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-limits.html) +// in the Network Load Balancers Guide. +// +// This operation is idempotent, which means that it completes at most one time. +// If you attempt to create multiple load balancers with the same settings, +// each call succeeds. +// +// For more information, see Application Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html) +// in the Application Load Balancers Guide and Network Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-load-balancers.html) +// in the Network Load Balancers Guide. +// +// // Example sending a request using CreateLoadBalancerRequest. +// req := client.CreateLoadBalancerRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateLoadBalancer +func (c *Client) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) CreateLoadBalancerRequest { + op := &aws.Operation{ + Name: opCreateLoadBalancer, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateLoadBalancerInput{} + } + + req := c.newRequest(op, input, &CreateLoadBalancerOutput{}) + return CreateLoadBalancerRequest{Request: req, Input: input, Copy: c.CreateLoadBalancerRequest} +} + +// CreateLoadBalancerRequest is the request type for the +// CreateLoadBalancer API operation. +type CreateLoadBalancerRequest struct { + *aws.Request + Input *CreateLoadBalancerInput + Copy func(*CreateLoadBalancerInput) CreateLoadBalancerRequest +} + +// Send marshals and sends the CreateLoadBalancer API request. +func (r CreateLoadBalancerRequest) Send(ctx context.Context) (*CreateLoadBalancerResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &CreateLoadBalancerResponse{ + CreateLoadBalancerOutput: r.Request.Data.(*CreateLoadBalancerOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// CreateLoadBalancerResponse is the response type for the +// CreateLoadBalancer API operation. +type CreateLoadBalancerResponse struct { + *CreateLoadBalancerOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// CreateLoadBalancer request. +func (r *CreateLoadBalancerResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_CreateRule.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_CreateRule.go new file mode 100644 index 000000000000..754980c21e42 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_CreateRule.go @@ -0,0 +1,214 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateRuleInput +type CreateRuleInput struct { + _ struct{} `type:"structure"` + + // The actions. Each rule must include exactly one of the following types of + // actions: forward, fixed-response, or redirect. + // + // If the action type is forward, you specify a target group. The protocol of + // the target group must be HTTP or HTTPS for an Application Load Balancer. + // The protocol of the target group must be TCP or TLS for a Network Load Balancer. + // + // [HTTPS listeners] If the action type is authenticate-oidc, you authenticate + // users through an identity provider that is OpenID Connect (OIDC) compliant. + // + // [HTTPS listeners] If the action type is authenticate-cognito, you authenticate + // users through the user pools supported by Amazon Cognito. + // + // [Application Load Balancer] If the action type is redirect, you redirect + // specified client requests from one URL to another. + // + // [Application Load Balancer] If the action type is fixed-response, you drop + // specified client requests and return a custom HTTP response. + // + // Actions is a required field + Actions []Action `type:"list" required:"true"` + + // The conditions. Each condition specifies a field name and a single value. + // + // If the field name is host-header, you can specify a single host name (for + // example, my.example.com). A host name is case insensitive, can be up to 128 + // characters in length, and can contain any of the following characters. You + // can include up to three wildcard characters. + // + // * A-Z, a-z, 0-9 + // + // * - . + // + // * * (matches 0 or more characters) + // + // * ? (matches exactly 1 character) + // + // If the field name is path-pattern, you can specify a single path pattern. + // A path pattern is case-sensitive, can be up to 128 characters in length, + // and can contain any of the following characters. You can include up to three + // wildcard characters. + // + // * A-Z, a-z, 0-9 + // + // * _ - . $ / ~ " ' @ : + + // + // * & (using &) + // + // * * (matches 0 or more characters) + // + // * ? (matches exactly 1 character) + // + // Conditions is a required field + Conditions []RuleCondition `type:"list" required:"true"` + + // The Amazon Resource Name (ARN) of the listener. + // + // ListenerArn is a required field + ListenerArn *string `type:"string" required:"true"` + + // The rule priority. A listener can't have multiple rules with the same priority. + // + // Priority is a required field + Priority *int64 `min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s CreateRuleInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateRuleInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "CreateRuleInput"} + + if s.Actions == nil { + invalidParams.Add(aws.NewErrParamRequired("Actions")) + } + + if s.Conditions == nil { + invalidParams.Add(aws.NewErrParamRequired("Conditions")) + } + + if s.ListenerArn == nil { + invalidParams.Add(aws.NewErrParamRequired("ListenerArn")) + } + + if s.Priority == nil { + invalidParams.Add(aws.NewErrParamRequired("Priority")) + } + if s.Priority != nil && *s.Priority < 1 { + invalidParams.Add(aws.NewErrParamMinValue("Priority", 1)) + } + if s.Actions != nil { + for i, v := range s.Actions { + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Actions", i), err.(aws.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateRuleOutput +type CreateRuleOutput struct { + _ struct{} `type:"structure"` + + // Information about the rule. + Rules []Rule `type:"list"` +} + +// String returns the string representation +func (s CreateRuleOutput) String() string { + return awsutil.Prettify(s) +} + +const opCreateRule = "CreateRule" + +// CreateRuleRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Creates a rule for the specified listener. The listener must be associated +// with an Application Load Balancer. +// +// Rules are evaluated in priority order, from the lowest value to the highest +// value. When the conditions for a rule are met, its actions are performed. +// If the conditions for no rules are met, the actions for the default rule +// are performed. For more information, see Listener Rules (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#listener-rules) +// in the Application Load Balancers Guide. +// +// To view your current rules, use DescribeRules. To update a rule, use ModifyRule. +// To set the priorities of your rules, use SetRulePriorities. To delete a rule, +// use DeleteRule. +// +// // Example sending a request using CreateRuleRequest. +// req := client.CreateRuleRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateRule +func (c *Client) CreateRuleRequest(input *CreateRuleInput) CreateRuleRequest { + op := &aws.Operation{ + Name: opCreateRule, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateRuleInput{} + } + + req := c.newRequest(op, input, &CreateRuleOutput{}) + return CreateRuleRequest{Request: req, Input: input, Copy: c.CreateRuleRequest} +} + +// CreateRuleRequest is the request type for the +// CreateRule API operation. +type CreateRuleRequest struct { + *aws.Request + Input *CreateRuleInput + Copy func(*CreateRuleInput) CreateRuleRequest +} + +// Send marshals and sends the CreateRule API request. +func (r CreateRuleRequest) Send(ctx context.Context) (*CreateRuleResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &CreateRuleResponse{ + CreateRuleOutput: r.Request.Data.(*CreateRuleOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// CreateRuleResponse is the response type for the +// CreateRule API operation. +type CreateRuleResponse struct { + *CreateRuleOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// CreateRule request. +func (r *CreateRuleResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_CreateTargetGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_CreateTargetGroup.go new file mode 100644 index 000000000000..ad1fa9d522b7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_CreateTargetGroup.go @@ -0,0 +1,248 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateTargetGroupInput +type CreateTargetGroupInput struct { + _ struct{} `type:"structure"` + + // Indicates whether health checks are enabled. If the target type is instance + // or ip, the default is true. If the target type is lambda, the default is + // false. + HealthCheckEnabled *bool `type:"boolean"` + + // The approximate amount of time, in seconds, between health checks of an individual + // target. For Application Load Balancers, the range is 5–300 seconds. For + // Network Load Balancers, the supported values are 10 or 30 seconds. If the + // target type is instance or ip, the default is 30 seconds. If the target type + // is lambda, the default is 35 seconds. + HealthCheckIntervalSeconds *int64 `min:"5" type:"integer"` + + // [HTTP/HTTPS health checks] The ping path that is the destination on the targets + // for health checks. The default is /. + HealthCheckPath *string `min:"1" type:"string"` + + // The port the load balancer uses when performing health checks on targets. + // The default is traffic-port, which is the port on which each target receives + // traffic from the load balancer. + HealthCheckPort *string `type:"string"` + + // The protocol the load balancer uses when performing health checks on targets. + // For Application Load Balancers, the default is HTTP. For Network Load Balancers, + // the default is TCP. The TCP protocol is supported for health checks only + // if the protocol of the target group is TCP or TLS. The TLS protocol is not + // supported for health checks. + HealthCheckProtocol ProtocolEnum `type:"string" enum:"true"` + + // The amount of time, in seconds, during which no response from a target means + // a failed health check. For Application Load Balancers, the range is 2–120 + // seconds and the default is 5 seconds if the target type is instance or ip + // and 30 seconds if the target type is lambda. For Network Load Balancers, + // this is 10 seconds for TCP and HTTPS health checks and 6 seconds for HTTP + // health checks. + HealthCheckTimeoutSeconds *int64 `min:"2" type:"integer"` + + // The number of consecutive health checks successes required before considering + // an unhealthy target healthy. For Application Load Balancers, the default + // is 5. For Network Load Balancers, the default is 3. + HealthyThresholdCount *int64 `min:"2" type:"integer"` + + // [HTTP/HTTPS health checks] The HTTP codes to use when checking for a successful + // response from a target. + Matcher *Matcher `type:"structure"` + + // The name of the target group. + // + // This name must be unique per region per account, can have a maximum of 32 + // characters, must contain only alphanumeric characters or hyphens, and must + // not begin or end with a hyphen. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // The port on which the targets receive traffic. This port is used unless you + // specify a port override when registering the target. If the target is a Lambda + // function, this parameter does not apply. + Port *int64 `min:"1" type:"integer"` + + // The protocol to use for routing traffic to the targets. For Application Load + // Balancers, the supported protocols are HTTP and HTTPS. For Network Load Balancers, + // the supported protocols are TCP and TLS. If the target is a Lambda function, + // this parameter does not apply. + Protocol ProtocolEnum `type:"string" enum:"true"` + + // The type of target that you must specify when registering targets with this + // target group. You can't specify targets for a target group using more than + // one target type. + // + // * instance - Targets are specified by instance ID. This is the default + // value. + // + // * ip - Targets are specified by IP address. You can specify IP addresses + // from the subnets of the virtual private cloud (VPC) for the target group, + // the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16), and + // the RFC 6598 range (100.64.0.0/10). You can't specify publicly routable + // IP addresses. + // + // * lambda - The target groups contains a single Lambda function. + TargetType TargetTypeEnum `type:"string" enum:"true"` + + // The number of consecutive health check failures required before considering + // a target unhealthy. For Application Load Balancers, the default is 2. For + // Network Load Balancers, this value must be the same as the healthy threshold + // count. + UnhealthyThresholdCount *int64 `min:"2" type:"integer"` + + // The identifier of the virtual private cloud (VPC). If the target is a Lambda + // function, this parameter does not apply. + VpcId *string `type:"string"` +} + +// String returns the string representation +func (s CreateTargetGroupInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTargetGroupInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "CreateTargetGroupInput"} + if s.HealthCheckIntervalSeconds != nil && *s.HealthCheckIntervalSeconds < 5 { + invalidParams.Add(aws.NewErrParamMinValue("HealthCheckIntervalSeconds", 5)) + } + if s.HealthCheckPath != nil && len(*s.HealthCheckPath) < 1 { + invalidParams.Add(aws.NewErrParamMinLen("HealthCheckPath", 1)) + } + if s.HealthCheckTimeoutSeconds != nil && *s.HealthCheckTimeoutSeconds < 2 { + invalidParams.Add(aws.NewErrParamMinValue("HealthCheckTimeoutSeconds", 2)) + } + if s.HealthyThresholdCount != nil && *s.HealthyThresholdCount < 2 { + invalidParams.Add(aws.NewErrParamMinValue("HealthyThresholdCount", 2)) + } + + if s.Name == nil { + invalidParams.Add(aws.NewErrParamRequired("Name")) + } + if s.Port != nil && *s.Port < 1 { + invalidParams.Add(aws.NewErrParamMinValue("Port", 1)) + } + if s.UnhealthyThresholdCount != nil && *s.UnhealthyThresholdCount < 2 { + invalidParams.Add(aws.NewErrParamMinValue("UnhealthyThresholdCount", 2)) + } + if s.Matcher != nil { + if err := s.Matcher.Validate(); err != nil { + invalidParams.AddNested("Matcher", err.(aws.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateTargetGroupOutput +type CreateTargetGroupOutput struct { + _ struct{} `type:"structure"` + + // Information about the target group. + TargetGroups []TargetGroup `type:"list"` +} + +// String returns the string representation +func (s CreateTargetGroupOutput) String() string { + return awsutil.Prettify(s) +} + +const opCreateTargetGroup = "CreateTargetGroup" + +// CreateTargetGroupRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Creates a target group. +// +// To register targets with the target group, use RegisterTargets. To update +// the health check settings for the target group, use ModifyTargetGroup. To +// monitor the health of targets in the target group, use DescribeTargetHealth. +// +// To route traffic to the targets in a target group, specify the target group +// in an action using CreateListener or CreateRule. +// +// To delete a target group, use DeleteTargetGroup. +// +// This operation is idempotent, which means that it completes at most one time. +// If you attempt to create multiple target groups with the same settings, each +// call succeeds. +// +// For more information, see Target Groups for Your Application Load Balancers +// (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html) +// in the Application Load Balancers Guide or Target Groups for Your Network +// Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html) +// in the Network Load Balancers Guide. +// +// // Example sending a request using CreateTargetGroupRequest. +// req := client.CreateTargetGroupRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/CreateTargetGroup +func (c *Client) CreateTargetGroupRequest(input *CreateTargetGroupInput) CreateTargetGroupRequest { + op := &aws.Operation{ + Name: opCreateTargetGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateTargetGroupInput{} + } + + req := c.newRequest(op, input, &CreateTargetGroupOutput{}) + return CreateTargetGroupRequest{Request: req, Input: input, Copy: c.CreateTargetGroupRequest} +} + +// CreateTargetGroupRequest is the request type for the +// CreateTargetGroup API operation. +type CreateTargetGroupRequest struct { + *aws.Request + Input *CreateTargetGroupInput + Copy func(*CreateTargetGroupInput) CreateTargetGroupRequest +} + +// Send marshals and sends the CreateTargetGroup API request. +func (r CreateTargetGroupRequest) Send(ctx context.Context) (*CreateTargetGroupResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &CreateTargetGroupResponse{ + CreateTargetGroupOutput: r.Request.Data.(*CreateTargetGroupOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// CreateTargetGroupResponse is the response type for the +// CreateTargetGroup API operation. +type CreateTargetGroupResponse struct { + *CreateTargetGroupOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// CreateTargetGroup request. +func (r *CreateTargetGroupResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DeleteListener.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DeleteListener.go new file mode 100644 index 000000000000..a2a3399af78a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DeleteListener.go @@ -0,0 +1,120 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteListenerInput +type DeleteListenerInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the listener. + // + // ListenerArn is a required field + ListenerArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteListenerInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteListenerInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DeleteListenerInput"} + + if s.ListenerArn == nil { + invalidParams.Add(aws.NewErrParamRequired("ListenerArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteListenerOutput +type DeleteListenerOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteListenerOutput) String() string { + return awsutil.Prettify(s) +} + +const opDeleteListener = "DeleteListener" + +// DeleteListenerRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Deletes the specified listener. +// +// Alternatively, your listener is deleted when you delete the load balancer +// to which it is attached, using DeleteLoadBalancer. +// +// // Example sending a request using DeleteListenerRequest. +// req := client.DeleteListenerRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteListener +func (c *Client) DeleteListenerRequest(input *DeleteListenerInput) DeleteListenerRequest { + op := &aws.Operation{ + Name: opDeleteListener, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteListenerInput{} + } + + req := c.newRequest(op, input, &DeleteListenerOutput{}) + return DeleteListenerRequest{Request: req, Input: input, Copy: c.DeleteListenerRequest} +} + +// DeleteListenerRequest is the request type for the +// DeleteListener API operation. +type DeleteListenerRequest struct { + *aws.Request + Input *DeleteListenerInput + Copy func(*DeleteListenerInput) DeleteListenerRequest +} + +// Send marshals and sends the DeleteListener API request. +func (r DeleteListenerRequest) Send(ctx context.Context) (*DeleteListenerResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &DeleteListenerResponse{ + DeleteListenerOutput: r.Request.Data.(*DeleteListenerOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// DeleteListenerResponse is the response type for the +// DeleteListener API operation. +type DeleteListenerResponse struct { + *DeleteListenerOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// DeleteListener request. +func (r *DeleteListenerResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DeleteLoadBalancer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DeleteLoadBalancer.go new file mode 100644 index 000000000000..151fb2788a07 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DeleteLoadBalancer.go @@ -0,0 +1,126 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteLoadBalancerInput +type DeleteLoadBalancerInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the load balancer. + // + // LoadBalancerArn is a required field + LoadBalancerArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteLoadBalancerInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteLoadBalancerInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DeleteLoadBalancerInput"} + + if s.LoadBalancerArn == nil { + invalidParams.Add(aws.NewErrParamRequired("LoadBalancerArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteLoadBalancerOutput +type DeleteLoadBalancerOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteLoadBalancerOutput) String() string { + return awsutil.Prettify(s) +} + +const opDeleteLoadBalancer = "DeleteLoadBalancer" + +// DeleteLoadBalancerRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Deletes the specified Application Load Balancer or Network Load Balancer +// and its attached listeners. +// +// You can't delete a load balancer if deletion protection is enabled. If the +// load balancer does not exist or has already been deleted, the call succeeds. +// +// Deleting a load balancer does not affect its registered targets. For example, +// your EC2 instances continue to run and are still registered to their target +// groups. If you no longer need these EC2 instances, you can stop or terminate +// them. +// +// // Example sending a request using DeleteLoadBalancerRequest. +// req := client.DeleteLoadBalancerRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteLoadBalancer +func (c *Client) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) DeleteLoadBalancerRequest { + op := &aws.Operation{ + Name: opDeleteLoadBalancer, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteLoadBalancerInput{} + } + + req := c.newRequest(op, input, &DeleteLoadBalancerOutput{}) + return DeleteLoadBalancerRequest{Request: req, Input: input, Copy: c.DeleteLoadBalancerRequest} +} + +// DeleteLoadBalancerRequest is the request type for the +// DeleteLoadBalancer API operation. +type DeleteLoadBalancerRequest struct { + *aws.Request + Input *DeleteLoadBalancerInput + Copy func(*DeleteLoadBalancerInput) DeleteLoadBalancerRequest +} + +// Send marshals and sends the DeleteLoadBalancer API request. +func (r DeleteLoadBalancerRequest) Send(ctx context.Context) (*DeleteLoadBalancerResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &DeleteLoadBalancerResponse{ + DeleteLoadBalancerOutput: r.Request.Data.(*DeleteLoadBalancerOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// DeleteLoadBalancerResponse is the response type for the +// DeleteLoadBalancer API operation. +type DeleteLoadBalancerResponse struct { + *DeleteLoadBalancerOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// DeleteLoadBalancer request. +func (r *DeleteLoadBalancerResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DeleteRule.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DeleteRule.go new file mode 100644 index 000000000000..eefb034d565c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DeleteRule.go @@ -0,0 +1,117 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteRuleInput +type DeleteRuleInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the rule. + // + // RuleArn is a required field + RuleArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteRuleInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteRuleInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DeleteRuleInput"} + + if s.RuleArn == nil { + invalidParams.Add(aws.NewErrParamRequired("RuleArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteRuleOutput +type DeleteRuleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteRuleOutput) String() string { + return awsutil.Prettify(s) +} + +const opDeleteRule = "DeleteRule" + +// DeleteRuleRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Deletes the specified rule. +// +// // Example sending a request using DeleteRuleRequest. +// req := client.DeleteRuleRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteRule +func (c *Client) DeleteRuleRequest(input *DeleteRuleInput) DeleteRuleRequest { + op := &aws.Operation{ + Name: opDeleteRule, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteRuleInput{} + } + + req := c.newRequest(op, input, &DeleteRuleOutput{}) + return DeleteRuleRequest{Request: req, Input: input, Copy: c.DeleteRuleRequest} +} + +// DeleteRuleRequest is the request type for the +// DeleteRule API operation. +type DeleteRuleRequest struct { + *aws.Request + Input *DeleteRuleInput + Copy func(*DeleteRuleInput) DeleteRuleRequest +} + +// Send marshals and sends the DeleteRule API request. +func (r DeleteRuleRequest) Send(ctx context.Context) (*DeleteRuleResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &DeleteRuleResponse{ + DeleteRuleOutput: r.Request.Data.(*DeleteRuleOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// DeleteRuleResponse is the response type for the +// DeleteRule API operation. +type DeleteRuleResponse struct { + *DeleteRuleOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// DeleteRule request. +func (r *DeleteRuleResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DeleteTargetGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DeleteTargetGroup.go new file mode 100644 index 000000000000..b498cc9127a6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DeleteTargetGroup.go @@ -0,0 +1,120 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteTargetGroupInput +type DeleteTargetGroupInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the target group. + // + // TargetGroupArn is a required field + TargetGroupArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteTargetGroupInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteTargetGroupInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DeleteTargetGroupInput"} + + if s.TargetGroupArn == nil { + invalidParams.Add(aws.NewErrParamRequired("TargetGroupArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteTargetGroupOutput +type DeleteTargetGroupOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteTargetGroupOutput) String() string { + return awsutil.Prettify(s) +} + +const opDeleteTargetGroup = "DeleteTargetGroup" + +// DeleteTargetGroupRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Deletes the specified target group. +// +// You can delete a target group if it is not referenced by any actions. Deleting +// a target group also deletes any associated health checks. +// +// // Example sending a request using DeleteTargetGroupRequest. +// req := client.DeleteTargetGroupRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeleteTargetGroup +func (c *Client) DeleteTargetGroupRequest(input *DeleteTargetGroupInput) DeleteTargetGroupRequest { + op := &aws.Operation{ + Name: opDeleteTargetGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteTargetGroupInput{} + } + + req := c.newRequest(op, input, &DeleteTargetGroupOutput{}) + return DeleteTargetGroupRequest{Request: req, Input: input, Copy: c.DeleteTargetGroupRequest} +} + +// DeleteTargetGroupRequest is the request type for the +// DeleteTargetGroup API operation. +type DeleteTargetGroupRequest struct { + *aws.Request + Input *DeleteTargetGroupInput + Copy func(*DeleteTargetGroupInput) DeleteTargetGroupRequest +} + +// Send marshals and sends the DeleteTargetGroup API request. +func (r DeleteTargetGroupRequest) Send(ctx context.Context) (*DeleteTargetGroupResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &DeleteTargetGroupResponse{ + DeleteTargetGroupOutput: r.Request.Data.(*DeleteTargetGroupOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// DeleteTargetGroupResponse is the response type for the +// DeleteTargetGroup API operation. +type DeleteTargetGroupResponse struct { + *DeleteTargetGroupOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// DeleteTargetGroup request. +func (r *DeleteTargetGroupResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DeregisterTargets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DeregisterTargets.go new file mode 100644 index 000000000000..0bced73a4796 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DeregisterTargets.go @@ -0,0 +1,137 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeregisterTargetsInput +type DeregisterTargetsInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the target group. + // + // TargetGroupArn is a required field + TargetGroupArn *string `type:"string" required:"true"` + + // The targets. If you specified a port override when you registered a target, + // you must specify both the target ID and the port when you deregister it. + // + // Targets is a required field + Targets []TargetDescription `type:"list" required:"true"` +} + +// String returns the string representation +func (s DeregisterTargetsInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeregisterTargetsInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DeregisterTargetsInput"} + + if s.TargetGroupArn == nil { + invalidParams.Add(aws.NewErrParamRequired("TargetGroupArn")) + } + + if s.Targets == nil { + invalidParams.Add(aws.NewErrParamRequired("Targets")) + } + if s.Targets != nil { + for i, v := range s.Targets { + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(aws.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeregisterTargetsOutput +type DeregisterTargetsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeregisterTargetsOutput) String() string { + return awsutil.Prettify(s) +} + +const opDeregisterTargets = "DeregisterTargets" + +// DeregisterTargetsRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Deregisters the specified targets from the specified target group. After +// the targets are deregistered, they no longer receive traffic from the load +// balancer. +// +// // Example sending a request using DeregisterTargetsRequest. +// req := client.DeregisterTargetsRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DeregisterTargets +func (c *Client) DeregisterTargetsRequest(input *DeregisterTargetsInput) DeregisterTargetsRequest { + op := &aws.Operation{ + Name: opDeregisterTargets, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeregisterTargetsInput{} + } + + req := c.newRequest(op, input, &DeregisterTargetsOutput{}) + return DeregisterTargetsRequest{Request: req, Input: input, Copy: c.DeregisterTargetsRequest} +} + +// DeregisterTargetsRequest is the request type for the +// DeregisterTargets API operation. +type DeregisterTargetsRequest struct { + *aws.Request + Input *DeregisterTargetsInput + Copy func(*DeregisterTargetsInput) DeregisterTargetsRequest +} + +// Send marshals and sends the DeregisterTargets API request. +func (r DeregisterTargetsRequest) Send(ctx context.Context) (*DeregisterTargetsResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &DeregisterTargetsResponse{ + DeregisterTargetsOutput: r.Request.Data.(*DeregisterTargetsOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// DeregisterTargetsResponse is the response type for the +// DeregisterTargets API operation. +type DeregisterTargetsResponse struct { + *DeregisterTargetsOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// DeregisterTargets request. +func (r *DeregisterTargetsResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeAccountLimits.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeAccountLimits.go new file mode 100644 index 000000000000..f1960ab1381b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeAccountLimits.go @@ -0,0 +1,131 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeAccountLimitsInput +type DescribeAccountLimitsInput struct { + _ struct{} `type:"structure"` + + // The marker for the next set of results. (You received this marker from a + // previous call.) + Marker *string `type:"string"` + + // The maximum number of results to return with this call. + PageSize *int64 `min:"1" type:"integer"` +} + +// String returns the string representation +func (s DescribeAccountLimitsInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeAccountLimitsInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DescribeAccountLimitsInput"} + if s.PageSize != nil && *s.PageSize < 1 { + invalidParams.Add(aws.NewErrParamMinValue("PageSize", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeAccountLimitsOutput +type DescribeAccountLimitsOutput struct { + _ struct{} `type:"structure"` + + // Information about the limits. + Limits []Limit `type:"list"` + + // The marker to use when requesting the next set of results. If there are no + // additional results, the string is empty. + NextMarker *string `type:"string"` +} + +// String returns the string representation +func (s DescribeAccountLimitsOutput) String() string { + return awsutil.Prettify(s) +} + +const opDescribeAccountLimits = "DescribeAccountLimits" + +// DescribeAccountLimitsRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Describes the current Elastic Load Balancing resource limits for your AWS +// account. +// +// For more information, see Limits for Your Application Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-limits.html) +// in the Application Load Balancer Guide or Limits for Your Network Load Balancers +// (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-limits.html) +// in the Network Load Balancers Guide. +// +// // Example sending a request using DescribeAccountLimitsRequest. +// req := client.DescribeAccountLimitsRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeAccountLimits +func (c *Client) DescribeAccountLimitsRequest(input *DescribeAccountLimitsInput) DescribeAccountLimitsRequest { + op := &aws.Operation{ + Name: opDescribeAccountLimits, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeAccountLimitsInput{} + } + + req := c.newRequest(op, input, &DescribeAccountLimitsOutput{}) + return DescribeAccountLimitsRequest{Request: req, Input: input, Copy: c.DescribeAccountLimitsRequest} +} + +// DescribeAccountLimitsRequest is the request type for the +// DescribeAccountLimits API operation. +type DescribeAccountLimitsRequest struct { + *aws.Request + Input *DescribeAccountLimitsInput + Copy func(*DescribeAccountLimitsInput) DescribeAccountLimitsRequest +} + +// Send marshals and sends the DescribeAccountLimits API request. +func (r DescribeAccountLimitsRequest) Send(ctx context.Context) (*DescribeAccountLimitsResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &DescribeAccountLimitsResponse{ + DescribeAccountLimitsOutput: r.Request.Data.(*DescribeAccountLimitsOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// DescribeAccountLimitsResponse is the response type for the +// DescribeAccountLimits API operation. +type DescribeAccountLimitsResponse struct { + *DescribeAccountLimitsOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// DescribeAccountLimits request. +func (r *DescribeAccountLimitsResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeListenerCertificates.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeListenerCertificates.go new file mode 100644 index 000000000000..e515957544f6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeListenerCertificates.go @@ -0,0 +1,134 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeListenerCertificatesInput +type DescribeListenerCertificatesInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Names (ARN) of the listener. + // + // ListenerArn is a required field + ListenerArn *string `type:"string" required:"true"` + + // The marker for the next set of results. (You received this marker from a + // previous call.) + Marker *string `type:"string"` + + // The maximum number of results to return with this call. + PageSize *int64 `min:"1" type:"integer"` +} + +// String returns the string representation +func (s DescribeListenerCertificatesInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeListenerCertificatesInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DescribeListenerCertificatesInput"} + + if s.ListenerArn == nil { + invalidParams.Add(aws.NewErrParamRequired("ListenerArn")) + } + if s.PageSize != nil && *s.PageSize < 1 { + invalidParams.Add(aws.NewErrParamMinValue("PageSize", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeListenerCertificatesOutput +type DescribeListenerCertificatesOutput struct { + _ struct{} `type:"structure"` + + // Information about the certificates. + Certificates []Certificate `type:"list"` + + // The marker to use when requesting the next set of results. If there are no + // additional results, the string is empty. + NextMarker *string `type:"string"` +} + +// String returns the string representation +func (s DescribeListenerCertificatesOutput) String() string { + return awsutil.Prettify(s) +} + +const opDescribeListenerCertificates = "DescribeListenerCertificates" + +// DescribeListenerCertificatesRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Describes the certificates for the specified HTTPS listener. +// +// // Example sending a request using DescribeListenerCertificatesRequest. +// req := client.DescribeListenerCertificatesRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeListenerCertificates +func (c *Client) DescribeListenerCertificatesRequest(input *DescribeListenerCertificatesInput) DescribeListenerCertificatesRequest { + op := &aws.Operation{ + Name: opDescribeListenerCertificates, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeListenerCertificatesInput{} + } + + req := c.newRequest(op, input, &DescribeListenerCertificatesOutput{}) + return DescribeListenerCertificatesRequest{Request: req, Input: input, Copy: c.DescribeListenerCertificatesRequest} +} + +// DescribeListenerCertificatesRequest is the request type for the +// DescribeListenerCertificates API operation. +type DescribeListenerCertificatesRequest struct { + *aws.Request + Input *DescribeListenerCertificatesInput + Copy func(*DescribeListenerCertificatesInput) DescribeListenerCertificatesRequest +} + +// Send marshals and sends the DescribeListenerCertificates API request. +func (r DescribeListenerCertificatesRequest) Send(ctx context.Context) (*DescribeListenerCertificatesResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &DescribeListenerCertificatesResponse{ + DescribeListenerCertificatesOutput: r.Request.Data.(*DescribeListenerCertificatesOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// DescribeListenerCertificatesResponse is the response type for the +// DescribeListenerCertificates API operation. +type DescribeListenerCertificatesResponse struct { + *DescribeListenerCertificatesOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// DescribeListenerCertificates request. +func (r *DescribeListenerCertificatesResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeListeners.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeListeners.go new file mode 100644 index 000000000000..e95e6b57fd80 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeListeners.go @@ -0,0 +1,186 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeListenersInput +type DescribeListenersInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Names (ARN) of the listeners. + ListenerArns []string `type:"list"` + + // The Amazon Resource Name (ARN) of the load balancer. + LoadBalancerArn *string `type:"string"` + + // The marker for the next set of results. (You received this marker from a + // previous call.) + Marker *string `type:"string"` + + // The maximum number of results to return with this call. + PageSize *int64 `min:"1" type:"integer"` +} + +// String returns the string representation +func (s DescribeListenersInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeListenersInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DescribeListenersInput"} + if s.PageSize != nil && *s.PageSize < 1 { + invalidParams.Add(aws.NewErrParamMinValue("PageSize", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeListenersOutput +type DescribeListenersOutput struct { + _ struct{} `type:"structure"` + + // Information about the listeners. + Listeners []Listener `type:"list"` + + // The marker to use when requesting the next set of results. If there are no + // additional results, the string is empty. + NextMarker *string `type:"string"` +} + +// String returns the string representation +func (s DescribeListenersOutput) String() string { + return awsutil.Prettify(s) +} + +const opDescribeListeners = "DescribeListeners" + +// DescribeListenersRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Describes the specified listeners or the listeners for the specified Application +// Load Balancer or Network Load Balancer. You must specify either a load balancer +// or one or more listeners. +// +// // Example sending a request using DescribeListenersRequest. +// req := client.DescribeListenersRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeListeners +func (c *Client) DescribeListenersRequest(input *DescribeListenersInput) DescribeListenersRequest { + op := &aws.Operation{ + Name: opDescribeListeners, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &aws.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"NextMarker"}, + LimitToken: "", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeListenersInput{} + } + + req := c.newRequest(op, input, &DescribeListenersOutput{}) + return DescribeListenersRequest{Request: req, Input: input, Copy: c.DescribeListenersRequest} +} + +// DescribeListenersRequest is the request type for the +// DescribeListeners API operation. +type DescribeListenersRequest struct { + *aws.Request + Input *DescribeListenersInput + Copy func(*DescribeListenersInput) DescribeListenersRequest +} + +// Send marshals and sends the DescribeListeners API request. +func (r DescribeListenersRequest) Send(ctx context.Context) (*DescribeListenersResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &DescribeListenersResponse{ + DescribeListenersOutput: r.Request.Data.(*DescribeListenersOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// NewDescribeListenersRequestPaginator returns a paginator for DescribeListeners. +// Use Next method to get the next page, and CurrentPage to get the current +// response page from the paginator. Next will return false, if there are +// no more pages, or an error was encountered. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over pages. +// req := client.DescribeListenersRequest(input) +// p := elasticloadbalancingv2.NewDescribeListenersRequestPaginator(req) +// +// for p.Next(context.TODO()) { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func NewDescribeListenersPaginator(req DescribeListenersRequest) DescribeListenersPaginator { + return DescribeListenersPaginator{ + Pager: aws.Pager{ + NewRequest: func(ctx context.Context) (*aws.Request, error) { + var inCpy *DescribeListenersInput + if req.Input != nil { + tmp := *req.Input + inCpy = &tmp + } + + newReq := req.Copy(inCpy) + newReq.SetContext(ctx) + return newReq.Request, nil + }, + }, + } +} + +// DescribeListenersPaginator is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeListenersPaginator struct { + aws.Pager +} + +func (p *DescribeListenersPaginator) CurrentPage() *DescribeListenersOutput { + return p.Pager.CurrentPage().(*DescribeListenersOutput) +} + +// DescribeListenersResponse is the response type for the +// DescribeListeners API operation. +type DescribeListenersResponse struct { + *DescribeListenersOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// DescribeListeners request. +func (r *DescribeListenersResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeLoadBalancerAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeLoadBalancerAttributes.go new file mode 100644 index 000000000000..9f8b91a12337 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeLoadBalancerAttributes.go @@ -0,0 +1,125 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancerAttributesInput +type DescribeLoadBalancerAttributesInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the load balancer. + // + // LoadBalancerArn is a required field + LoadBalancerArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeLoadBalancerAttributesInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeLoadBalancerAttributesInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DescribeLoadBalancerAttributesInput"} + + if s.LoadBalancerArn == nil { + invalidParams.Add(aws.NewErrParamRequired("LoadBalancerArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancerAttributesOutput +type DescribeLoadBalancerAttributesOutput struct { + _ struct{} `type:"structure"` + + // Information about the load balancer attributes. + Attributes []LoadBalancerAttribute `type:"list"` +} + +// String returns the string representation +func (s DescribeLoadBalancerAttributesOutput) String() string { + return awsutil.Prettify(s) +} + +const opDescribeLoadBalancerAttributes = "DescribeLoadBalancerAttributes" + +// DescribeLoadBalancerAttributesRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Describes the attributes for the specified Application Load Balancer or Network +// Load Balancer. +// +// For more information, see Load Balancer Attributes (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html#load-balancer-attributes) +// in the Application Load Balancers Guide or Load Balancer Attributes (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-load-balancers.html#load-balancer-attributes) +// in the Network Load Balancers Guide. +// +// // Example sending a request using DescribeLoadBalancerAttributesRequest. +// req := client.DescribeLoadBalancerAttributesRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancerAttributes +func (c *Client) DescribeLoadBalancerAttributesRequest(input *DescribeLoadBalancerAttributesInput) DescribeLoadBalancerAttributesRequest { + op := &aws.Operation{ + Name: opDescribeLoadBalancerAttributes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeLoadBalancerAttributesInput{} + } + + req := c.newRequest(op, input, &DescribeLoadBalancerAttributesOutput{}) + return DescribeLoadBalancerAttributesRequest{Request: req, Input: input, Copy: c.DescribeLoadBalancerAttributesRequest} +} + +// DescribeLoadBalancerAttributesRequest is the request type for the +// DescribeLoadBalancerAttributes API operation. +type DescribeLoadBalancerAttributesRequest struct { + *aws.Request + Input *DescribeLoadBalancerAttributesInput + Copy func(*DescribeLoadBalancerAttributesInput) DescribeLoadBalancerAttributesRequest +} + +// Send marshals and sends the DescribeLoadBalancerAttributes API request. +func (r DescribeLoadBalancerAttributesRequest) Send(ctx context.Context) (*DescribeLoadBalancerAttributesResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &DescribeLoadBalancerAttributesResponse{ + DescribeLoadBalancerAttributesOutput: r.Request.Data.(*DescribeLoadBalancerAttributesOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// DescribeLoadBalancerAttributesResponse is the response type for the +// DescribeLoadBalancerAttributes API operation. +type DescribeLoadBalancerAttributesResponse struct { + *DescribeLoadBalancerAttributesOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// DescribeLoadBalancerAttributes request. +func (r *DescribeLoadBalancerAttributesResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeLoadBalancers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeLoadBalancers.go new file mode 100644 index 000000000000..118615db1007 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeLoadBalancers.go @@ -0,0 +1,188 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancersInput +type DescribeLoadBalancersInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Names (ARN) of the load balancers. You can specify up + // to 20 load balancers in a single call. + LoadBalancerArns []string `type:"list"` + + // The marker for the next set of results. (You received this marker from a + // previous call.) + Marker *string `type:"string"` + + // The names of the load balancers. + Names []string `type:"list"` + + // The maximum number of results to return with this call. + PageSize *int64 `min:"1" type:"integer"` +} + +// String returns the string representation +func (s DescribeLoadBalancersInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeLoadBalancersInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DescribeLoadBalancersInput"} + if s.PageSize != nil && *s.PageSize < 1 { + invalidParams.Add(aws.NewErrParamMinValue("PageSize", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancersOutput +type DescribeLoadBalancersOutput struct { + _ struct{} `type:"structure"` + + // Information about the load balancers. + LoadBalancers []LoadBalancer `type:"list"` + + // The marker to use when requesting the next set of results. If there are no + // additional results, the string is empty. + NextMarker *string `type:"string"` +} + +// String returns the string representation +func (s DescribeLoadBalancersOutput) String() string { + return awsutil.Prettify(s) +} + +const opDescribeLoadBalancers = "DescribeLoadBalancers" + +// DescribeLoadBalancersRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Describes the specified load balancers or all of your load balancers. +// +// To describe the listeners for a load balancer, use DescribeListeners. To +// describe the attributes for a load balancer, use DescribeLoadBalancerAttributes. +// +// // Example sending a request using DescribeLoadBalancersRequest. +// req := client.DescribeLoadBalancersRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancers +func (c *Client) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) DescribeLoadBalancersRequest { + op := &aws.Operation{ + Name: opDescribeLoadBalancers, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &aws.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"NextMarker"}, + LimitToken: "", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeLoadBalancersInput{} + } + + req := c.newRequest(op, input, &DescribeLoadBalancersOutput{}) + return DescribeLoadBalancersRequest{Request: req, Input: input, Copy: c.DescribeLoadBalancersRequest} +} + +// DescribeLoadBalancersRequest is the request type for the +// DescribeLoadBalancers API operation. +type DescribeLoadBalancersRequest struct { + *aws.Request + Input *DescribeLoadBalancersInput + Copy func(*DescribeLoadBalancersInput) DescribeLoadBalancersRequest +} + +// Send marshals and sends the DescribeLoadBalancers API request. +func (r DescribeLoadBalancersRequest) Send(ctx context.Context) (*DescribeLoadBalancersResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &DescribeLoadBalancersResponse{ + DescribeLoadBalancersOutput: r.Request.Data.(*DescribeLoadBalancersOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// NewDescribeLoadBalancersRequestPaginator returns a paginator for DescribeLoadBalancers. +// Use Next method to get the next page, and CurrentPage to get the current +// response page from the paginator. Next will return false, if there are +// no more pages, or an error was encountered. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over pages. +// req := client.DescribeLoadBalancersRequest(input) +// p := elasticloadbalancingv2.NewDescribeLoadBalancersRequestPaginator(req) +// +// for p.Next(context.TODO()) { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func NewDescribeLoadBalancersPaginator(req DescribeLoadBalancersRequest) DescribeLoadBalancersPaginator { + return DescribeLoadBalancersPaginator{ + Pager: aws.Pager{ + NewRequest: func(ctx context.Context) (*aws.Request, error) { + var inCpy *DescribeLoadBalancersInput + if req.Input != nil { + tmp := *req.Input + inCpy = &tmp + } + + newReq := req.Copy(inCpy) + newReq.SetContext(ctx) + return newReq.Request, nil + }, + }, + } +} + +// DescribeLoadBalancersPaginator is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeLoadBalancersPaginator struct { + aws.Pager +} + +func (p *DescribeLoadBalancersPaginator) CurrentPage() *DescribeLoadBalancersOutput { + return p.Pager.CurrentPage().(*DescribeLoadBalancersOutput) +} + +// DescribeLoadBalancersResponse is the response type for the +// DescribeLoadBalancers API operation. +type DescribeLoadBalancersResponse struct { + *DescribeLoadBalancersOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// DescribeLoadBalancers request. +func (r *DescribeLoadBalancersResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeRules.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeRules.go new file mode 100644 index 000000000000..528ffd1e8294 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeRules.go @@ -0,0 +1,132 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeRulesInput +type DescribeRulesInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the listener. + ListenerArn *string `type:"string"` + + // The marker for the next set of results. (You received this marker from a + // previous call.) + Marker *string `type:"string"` + + // The maximum number of results to return with this call. + PageSize *int64 `min:"1" type:"integer"` + + // The Amazon Resource Names (ARN) of the rules. + RuleArns []string `type:"list"` +} + +// String returns the string representation +func (s DescribeRulesInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeRulesInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DescribeRulesInput"} + if s.PageSize != nil && *s.PageSize < 1 { + invalidParams.Add(aws.NewErrParamMinValue("PageSize", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeRulesOutput +type DescribeRulesOutput struct { + _ struct{} `type:"structure"` + + // The marker to use when requesting the next set of results. If there are no + // additional results, the string is empty. + NextMarker *string `type:"string"` + + // Information about the rules. + Rules []Rule `type:"list"` +} + +// String returns the string representation +func (s DescribeRulesOutput) String() string { + return awsutil.Prettify(s) +} + +const opDescribeRules = "DescribeRules" + +// DescribeRulesRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Describes the specified rules or the rules for the specified listener. You +// must specify either a listener or one or more rules. +// +// // Example sending a request using DescribeRulesRequest. +// req := client.DescribeRulesRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeRules +func (c *Client) DescribeRulesRequest(input *DescribeRulesInput) DescribeRulesRequest { + op := &aws.Operation{ + Name: opDescribeRules, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeRulesInput{} + } + + req := c.newRequest(op, input, &DescribeRulesOutput{}) + return DescribeRulesRequest{Request: req, Input: input, Copy: c.DescribeRulesRequest} +} + +// DescribeRulesRequest is the request type for the +// DescribeRules API operation. +type DescribeRulesRequest struct { + *aws.Request + Input *DescribeRulesInput + Copy func(*DescribeRulesInput) DescribeRulesRequest +} + +// Send marshals and sends the DescribeRules API request. +func (r DescribeRulesRequest) Send(ctx context.Context) (*DescribeRulesResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &DescribeRulesResponse{ + DescribeRulesOutput: r.Request.Data.(*DescribeRulesOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// DescribeRulesResponse is the response type for the +// DescribeRules API operation. +type DescribeRulesResponse struct { + *DescribeRulesOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// DescribeRules request. +func (r *DescribeRulesResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeSSLPolicies.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeSSLPolicies.go new file mode 100644 index 000000000000..4ec885d8df92 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeSSLPolicies.go @@ -0,0 +1,131 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeSSLPoliciesInput +type DescribeSSLPoliciesInput struct { + _ struct{} `type:"structure"` + + // The marker for the next set of results. (You received this marker from a + // previous call.) + Marker *string `type:"string"` + + // The names of the policies. + Names []string `type:"list"` + + // The maximum number of results to return with this call. + PageSize *int64 `min:"1" type:"integer"` +} + +// String returns the string representation +func (s DescribeSSLPoliciesInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeSSLPoliciesInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DescribeSSLPoliciesInput"} + if s.PageSize != nil && *s.PageSize < 1 { + invalidParams.Add(aws.NewErrParamMinValue("PageSize", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeSSLPoliciesOutput +type DescribeSSLPoliciesOutput struct { + _ struct{} `type:"structure"` + + // The marker to use when requesting the next set of results. If there are no + // additional results, the string is empty. + NextMarker *string `type:"string"` + + // Information about the policies. + SslPolicies []SslPolicy `type:"list"` +} + +// String returns the string representation +func (s DescribeSSLPoliciesOutput) String() string { + return awsutil.Prettify(s) +} + +const opDescribeSSLPolicies = "DescribeSSLPolicies" + +// DescribeSSLPoliciesRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Describes the specified policies or all policies used for SSL negotiation. +// +// For more information, see Security Policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies) +// in the Application Load Balancers Guide. +// +// // Example sending a request using DescribeSSLPoliciesRequest. +// req := client.DescribeSSLPoliciesRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeSSLPolicies +func (c *Client) DescribeSSLPoliciesRequest(input *DescribeSSLPoliciesInput) DescribeSSLPoliciesRequest { + op := &aws.Operation{ + Name: opDescribeSSLPolicies, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeSSLPoliciesInput{} + } + + req := c.newRequest(op, input, &DescribeSSLPoliciesOutput{}) + return DescribeSSLPoliciesRequest{Request: req, Input: input, Copy: c.DescribeSSLPoliciesRequest} +} + +// DescribeSSLPoliciesRequest is the request type for the +// DescribeSSLPolicies API operation. +type DescribeSSLPoliciesRequest struct { + *aws.Request + Input *DescribeSSLPoliciesInput + Copy func(*DescribeSSLPoliciesInput) DescribeSSLPoliciesRequest +} + +// Send marshals and sends the DescribeSSLPolicies API request. +func (r DescribeSSLPoliciesRequest) Send(ctx context.Context) (*DescribeSSLPoliciesResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &DescribeSSLPoliciesResponse{ + DescribeSSLPoliciesOutput: r.Request.Data.(*DescribeSSLPoliciesOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// DescribeSSLPoliciesResponse is the response type for the +// DescribeSSLPolicies API operation. +type DescribeSSLPoliciesResponse struct { + *DescribeSSLPoliciesOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// DescribeSSLPolicies request. +func (r *DescribeSSLPoliciesResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeTags.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeTags.go new file mode 100644 index 000000000000..122d25d2e491 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeTags.go @@ -0,0 +1,122 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTagsInput +type DescribeTagsInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Names (ARN) of the resources. + // + // ResourceArns is a required field + ResourceArns []string `type:"list" required:"true"` +} + +// String returns the string representation +func (s DescribeTagsInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeTagsInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DescribeTagsInput"} + + if s.ResourceArns == nil { + invalidParams.Add(aws.NewErrParamRequired("ResourceArns")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTagsOutput +type DescribeTagsOutput struct { + _ struct{} `type:"structure"` + + // Information about the tags. + TagDescriptions []TagDescription `type:"list"` +} + +// String returns the string representation +func (s DescribeTagsOutput) String() string { + return awsutil.Prettify(s) +} + +const opDescribeTags = "DescribeTags" + +// DescribeTagsRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Describes the tags for the specified resources. You can describe the tags +// for one or more Application Load Balancers, Network Load Balancers, and target +// groups. +// +// // Example sending a request using DescribeTagsRequest. +// req := client.DescribeTagsRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTags +func (c *Client) DescribeTagsRequest(input *DescribeTagsInput) DescribeTagsRequest { + op := &aws.Operation{ + Name: opDescribeTags, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeTagsInput{} + } + + req := c.newRequest(op, input, &DescribeTagsOutput{}) + return DescribeTagsRequest{Request: req, Input: input, Copy: c.DescribeTagsRequest} +} + +// DescribeTagsRequest is the request type for the +// DescribeTags API operation. +type DescribeTagsRequest struct { + *aws.Request + Input *DescribeTagsInput + Copy func(*DescribeTagsInput) DescribeTagsRequest +} + +// Send marshals and sends the DescribeTags API request. +func (r DescribeTagsRequest) Send(ctx context.Context) (*DescribeTagsResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &DescribeTagsResponse{ + DescribeTagsOutput: r.Request.Data.(*DescribeTagsOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// DescribeTagsResponse is the response type for the +// DescribeTags API operation. +type DescribeTagsResponse struct { + *DescribeTagsOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// DescribeTags request. +func (r *DescribeTagsResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeTargetGroupAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeTargetGroupAttributes.go new file mode 100644 index 000000000000..4f556add2271 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeTargetGroupAttributes.go @@ -0,0 +1,124 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetGroupAttributesInput +type DescribeTargetGroupAttributesInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the target group. + // + // TargetGroupArn is a required field + TargetGroupArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeTargetGroupAttributesInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeTargetGroupAttributesInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DescribeTargetGroupAttributesInput"} + + if s.TargetGroupArn == nil { + invalidParams.Add(aws.NewErrParamRequired("TargetGroupArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetGroupAttributesOutput +type DescribeTargetGroupAttributesOutput struct { + _ struct{} `type:"structure"` + + // Information about the target group attributes + Attributes []TargetGroupAttribute `type:"list"` +} + +// String returns the string representation +func (s DescribeTargetGroupAttributesOutput) String() string { + return awsutil.Prettify(s) +} + +const opDescribeTargetGroupAttributes = "DescribeTargetGroupAttributes" + +// DescribeTargetGroupAttributesRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Describes the attributes for the specified target group. +// +// For more information, see Target Group Attributes (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html#target-group-attributes) +// in the Application Load Balancers Guide or Target Group Attributes (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#target-group-attributes) +// in the Network Load Balancers Guide. +// +// // Example sending a request using DescribeTargetGroupAttributesRequest. +// req := client.DescribeTargetGroupAttributesRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetGroupAttributes +func (c *Client) DescribeTargetGroupAttributesRequest(input *DescribeTargetGroupAttributesInput) DescribeTargetGroupAttributesRequest { + op := &aws.Operation{ + Name: opDescribeTargetGroupAttributes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeTargetGroupAttributesInput{} + } + + req := c.newRequest(op, input, &DescribeTargetGroupAttributesOutput{}) + return DescribeTargetGroupAttributesRequest{Request: req, Input: input, Copy: c.DescribeTargetGroupAttributesRequest} +} + +// DescribeTargetGroupAttributesRequest is the request type for the +// DescribeTargetGroupAttributes API operation. +type DescribeTargetGroupAttributesRequest struct { + *aws.Request + Input *DescribeTargetGroupAttributesInput + Copy func(*DescribeTargetGroupAttributesInput) DescribeTargetGroupAttributesRequest +} + +// Send marshals and sends the DescribeTargetGroupAttributes API request. +func (r DescribeTargetGroupAttributesRequest) Send(ctx context.Context) (*DescribeTargetGroupAttributesResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &DescribeTargetGroupAttributesResponse{ + DescribeTargetGroupAttributesOutput: r.Request.Data.(*DescribeTargetGroupAttributesOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// DescribeTargetGroupAttributesResponse is the response type for the +// DescribeTargetGroupAttributes API operation. +type DescribeTargetGroupAttributesResponse struct { + *DescribeTargetGroupAttributesOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// DescribeTargetGroupAttributes request. +func (r *DescribeTargetGroupAttributesResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeTargetGroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeTargetGroups.go new file mode 100644 index 000000000000..32d059e88ecf --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeTargetGroups.go @@ -0,0 +1,193 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetGroupsInput +type DescribeTargetGroupsInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the load balancer. + LoadBalancerArn *string `type:"string"` + + // The marker for the next set of results. (You received this marker from a + // previous call.) + Marker *string `type:"string"` + + // The names of the target groups. + Names []string `type:"list"` + + // The maximum number of results to return with this call. + PageSize *int64 `min:"1" type:"integer"` + + // The Amazon Resource Names (ARN) of the target groups. + TargetGroupArns []string `type:"list"` +} + +// String returns the string representation +func (s DescribeTargetGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeTargetGroupsInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DescribeTargetGroupsInput"} + if s.PageSize != nil && *s.PageSize < 1 { + invalidParams.Add(aws.NewErrParamMinValue("PageSize", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetGroupsOutput +type DescribeTargetGroupsOutput struct { + _ struct{} `type:"structure"` + + // The marker to use when requesting the next set of results. If there are no + // additional results, the string is empty. + NextMarker *string `type:"string"` + + // Information about the target groups. + TargetGroups []TargetGroup `type:"list"` +} + +// String returns the string representation +func (s DescribeTargetGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +const opDescribeTargetGroups = "DescribeTargetGroups" + +// DescribeTargetGroupsRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Describes the specified target groups or all of your target groups. By default, +// all target groups are described. Alternatively, you can specify one of the +// following to filter the results: the ARN of the load balancer, the names +// of one or more target groups, or the ARNs of one or more target groups. +// +// To describe the targets for a target group, use DescribeTargetHealth. To +// describe the attributes of a target group, use DescribeTargetGroupAttributes. +// +// // Example sending a request using DescribeTargetGroupsRequest. +// req := client.DescribeTargetGroupsRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetGroups +func (c *Client) DescribeTargetGroupsRequest(input *DescribeTargetGroupsInput) DescribeTargetGroupsRequest { + op := &aws.Operation{ + Name: opDescribeTargetGroups, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &aws.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"NextMarker"}, + LimitToken: "", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeTargetGroupsInput{} + } + + req := c.newRequest(op, input, &DescribeTargetGroupsOutput{}) + return DescribeTargetGroupsRequest{Request: req, Input: input, Copy: c.DescribeTargetGroupsRequest} +} + +// DescribeTargetGroupsRequest is the request type for the +// DescribeTargetGroups API operation. +type DescribeTargetGroupsRequest struct { + *aws.Request + Input *DescribeTargetGroupsInput + Copy func(*DescribeTargetGroupsInput) DescribeTargetGroupsRequest +} + +// Send marshals and sends the DescribeTargetGroups API request. +func (r DescribeTargetGroupsRequest) Send(ctx context.Context) (*DescribeTargetGroupsResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &DescribeTargetGroupsResponse{ + DescribeTargetGroupsOutput: r.Request.Data.(*DescribeTargetGroupsOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// NewDescribeTargetGroupsRequestPaginator returns a paginator for DescribeTargetGroups. +// Use Next method to get the next page, and CurrentPage to get the current +// response page from the paginator. Next will return false, if there are +// no more pages, or an error was encountered. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over pages. +// req := client.DescribeTargetGroupsRequest(input) +// p := elasticloadbalancingv2.NewDescribeTargetGroupsRequestPaginator(req) +// +// for p.Next(context.TODO()) { +// page := p.CurrentPage() +// } +// +// if err := p.Err(); err != nil { +// return err +// } +// +func NewDescribeTargetGroupsPaginator(req DescribeTargetGroupsRequest) DescribeTargetGroupsPaginator { + return DescribeTargetGroupsPaginator{ + Pager: aws.Pager{ + NewRequest: func(ctx context.Context) (*aws.Request, error) { + var inCpy *DescribeTargetGroupsInput + if req.Input != nil { + tmp := *req.Input + inCpy = &tmp + } + + newReq := req.Copy(inCpy) + newReq.SetContext(ctx) + return newReq.Request, nil + }, + }, + } +} + +// DescribeTargetGroupsPaginator is used to paginate the request. This can be done by +// calling Next and CurrentPage. +type DescribeTargetGroupsPaginator struct { + aws.Pager +} + +func (p *DescribeTargetGroupsPaginator) CurrentPage() *DescribeTargetGroupsOutput { + return p.Pager.CurrentPage().(*DescribeTargetGroupsOutput) +} + +// DescribeTargetGroupsResponse is the response type for the +// DescribeTargetGroups API operation. +type DescribeTargetGroupsResponse struct { + *DescribeTargetGroupsOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// DescribeTargetGroups request. +func (r *DescribeTargetGroupsResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeTargetHealth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeTargetHealth.go new file mode 100644 index 000000000000..6940bbef9178 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_DescribeTargetHealth.go @@ -0,0 +1,131 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetHealthInput +type DescribeTargetHealthInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the target group. + // + // TargetGroupArn is a required field + TargetGroupArn *string `type:"string" required:"true"` + + // The targets. + Targets []TargetDescription `type:"list"` +} + +// String returns the string representation +func (s DescribeTargetHealthInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeTargetHealthInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "DescribeTargetHealthInput"} + + if s.TargetGroupArn == nil { + invalidParams.Add(aws.NewErrParamRequired("TargetGroupArn")) + } + if s.Targets != nil { + for i, v := range s.Targets { + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(aws.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetHealthOutput +type DescribeTargetHealthOutput struct { + _ struct{} `type:"structure"` + + // Information about the health of the targets. + TargetHealthDescriptions []TargetHealthDescription `type:"list"` +} + +// String returns the string representation +func (s DescribeTargetHealthOutput) String() string { + return awsutil.Prettify(s) +} + +const opDescribeTargetHealth = "DescribeTargetHealth" + +// DescribeTargetHealthRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Describes the health of the specified targets or all of your targets. +// +// // Example sending a request using DescribeTargetHealthRequest. +// req := client.DescribeTargetHealthRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/DescribeTargetHealth +func (c *Client) DescribeTargetHealthRequest(input *DescribeTargetHealthInput) DescribeTargetHealthRequest { + op := &aws.Operation{ + Name: opDescribeTargetHealth, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeTargetHealthInput{} + } + + req := c.newRequest(op, input, &DescribeTargetHealthOutput{}) + return DescribeTargetHealthRequest{Request: req, Input: input, Copy: c.DescribeTargetHealthRequest} +} + +// DescribeTargetHealthRequest is the request type for the +// DescribeTargetHealth API operation. +type DescribeTargetHealthRequest struct { + *aws.Request + Input *DescribeTargetHealthInput + Copy func(*DescribeTargetHealthInput) DescribeTargetHealthRequest +} + +// Send marshals and sends the DescribeTargetHealth API request. +func (r DescribeTargetHealthRequest) Send(ctx context.Context) (*DescribeTargetHealthResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &DescribeTargetHealthResponse{ + DescribeTargetHealthOutput: r.Request.Data.(*DescribeTargetHealthOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// DescribeTargetHealthResponse is the response type for the +// DescribeTargetHealth API operation. +type DescribeTargetHealthResponse struct { + *DescribeTargetHealthOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// DescribeTargetHealth request. +func (r *DescribeTargetHealthResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_ModifyListener.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_ModifyListener.go new file mode 100644 index 000000000000..9e43f66bbde1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_ModifyListener.go @@ -0,0 +1,177 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyListenerInput +type ModifyListenerInput struct { + _ struct{} `type:"structure"` + + // [HTTPS and TLS listeners] The default SSL server certificate. You must provide + // exactly one certificate. Set CertificateArn to the certificate ARN but do + // not set IsDefault. + // + // To create a certificate list, use AddListenerCertificates. + Certificates []Certificate `type:"list"` + + // The actions for the default rule. The rule must include one forward action + // or one or more fixed-response actions. + // + // If the action type is forward, you specify a target group. The protocol of + // the target group must be HTTP or HTTPS for an Application Load Balancer. + // The protocol of the target group must be TCP or TLS for a Network Load Balancer. + // + // [HTTPS listeners] If the action type is authenticate-oidc, you authenticate + // users through an identity provider that is OpenID Connect (OIDC) compliant. + // + // [HTTPS listeners] If the action type is authenticate-cognito, you authenticate + // users through the user pools supported by Amazon Cognito. + // + // [Application Load Balancer] If the action type is redirect, you redirect + // specified client requests from one URL to another. + // + // [Application Load Balancer] If the action type is fixed-response, you drop + // specified client requests and return a custom HTTP response. + DefaultActions []Action `type:"list"` + + // The Amazon Resource Name (ARN) of the listener. + // + // ListenerArn is a required field + ListenerArn *string `type:"string" required:"true"` + + // The port for connections from clients to the load balancer. + Port *int64 `min:"1" type:"integer"` + + // The protocol for connections from clients to the load balancer. Application + // Load Balancers support the HTTP and HTTPS protocols. Network Load Balancers + // support the TCP and TLS protocols. + Protocol ProtocolEnum `type:"string" enum:"true"` + + // [HTTPS and TLS listeners] The security policy that defines which protocols + // and ciphers are supported. For more information, see Security Policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies) + // in the Application Load Balancers Guide. + SslPolicy *string `type:"string"` +} + +// String returns the string representation +func (s ModifyListenerInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyListenerInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "ModifyListenerInput"} + + if s.ListenerArn == nil { + invalidParams.Add(aws.NewErrParamRequired("ListenerArn")) + } + if s.Port != nil && *s.Port < 1 { + invalidParams.Add(aws.NewErrParamMinValue("Port", 1)) + } + if s.DefaultActions != nil { + for i, v := range s.DefaultActions { + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DefaultActions", i), err.(aws.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyListenerOutput +type ModifyListenerOutput struct { + _ struct{} `type:"structure"` + + // Information about the modified listener. + Listeners []Listener `type:"list"` +} + +// String returns the string representation +func (s ModifyListenerOutput) String() string { + return awsutil.Prettify(s) +} + +const opModifyListener = "ModifyListener" + +// ModifyListenerRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Modifies the specified properties of the specified listener. +// +// Any properties that you do not specify retain their current values. However, +// changing the protocol from HTTPS to HTTP, or from TLS to TCP, removes the +// security policy and server certificate properties. If you change the protocol +// from HTTP to HTTPS, or from TCP to TLS, you must add the security policy +// and server certificate properties. +// +// // Example sending a request using ModifyListenerRequest. +// req := client.ModifyListenerRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyListener +func (c *Client) ModifyListenerRequest(input *ModifyListenerInput) ModifyListenerRequest { + op := &aws.Operation{ + Name: opModifyListener, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyListenerInput{} + } + + req := c.newRequest(op, input, &ModifyListenerOutput{}) + return ModifyListenerRequest{Request: req, Input: input, Copy: c.ModifyListenerRequest} +} + +// ModifyListenerRequest is the request type for the +// ModifyListener API operation. +type ModifyListenerRequest struct { + *aws.Request + Input *ModifyListenerInput + Copy func(*ModifyListenerInput) ModifyListenerRequest +} + +// Send marshals and sends the ModifyListener API request. +func (r ModifyListenerRequest) Send(ctx context.Context) (*ModifyListenerResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &ModifyListenerResponse{ + ModifyListenerOutput: r.Request.Data.(*ModifyListenerOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// ModifyListenerResponse is the response type for the +// ModifyListener API operation. +type ModifyListenerResponse struct { + *ModifyListenerOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// ModifyListener request. +func (r *ModifyListenerResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_ModifyLoadBalancerAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_ModifyLoadBalancerAttributes.go new file mode 100644 index 000000000000..76a5718965c5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_ModifyLoadBalancerAttributes.go @@ -0,0 +1,134 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyLoadBalancerAttributesInput +type ModifyLoadBalancerAttributesInput struct { + _ struct{} `type:"structure"` + + // The load balancer attributes. + // + // Attributes is a required field + Attributes []LoadBalancerAttribute `type:"list" required:"true"` + + // The Amazon Resource Name (ARN) of the load balancer. + // + // LoadBalancerArn is a required field + LoadBalancerArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ModifyLoadBalancerAttributesInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyLoadBalancerAttributesInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "ModifyLoadBalancerAttributesInput"} + + if s.Attributes == nil { + invalidParams.Add(aws.NewErrParamRequired("Attributes")) + } + + if s.LoadBalancerArn == nil { + invalidParams.Add(aws.NewErrParamRequired("LoadBalancerArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyLoadBalancerAttributesOutput +type ModifyLoadBalancerAttributesOutput struct { + _ struct{} `type:"structure"` + + // Information about the load balancer attributes. + Attributes []LoadBalancerAttribute `type:"list"` +} + +// String returns the string representation +func (s ModifyLoadBalancerAttributesOutput) String() string { + return awsutil.Prettify(s) +} + +const opModifyLoadBalancerAttributes = "ModifyLoadBalancerAttributes" + +// ModifyLoadBalancerAttributesRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Modifies the specified attributes of the specified Application Load Balancer +// or Network Load Balancer. +// +// If any of the specified attributes can't be modified as requested, the call +// fails. Any existing attributes that you do not modify retain their current +// values. +// +// // Example sending a request using ModifyLoadBalancerAttributesRequest. +// req := client.ModifyLoadBalancerAttributesRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyLoadBalancerAttributes +func (c *Client) ModifyLoadBalancerAttributesRequest(input *ModifyLoadBalancerAttributesInput) ModifyLoadBalancerAttributesRequest { + op := &aws.Operation{ + Name: opModifyLoadBalancerAttributes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyLoadBalancerAttributesInput{} + } + + req := c.newRequest(op, input, &ModifyLoadBalancerAttributesOutput{}) + return ModifyLoadBalancerAttributesRequest{Request: req, Input: input, Copy: c.ModifyLoadBalancerAttributesRequest} +} + +// ModifyLoadBalancerAttributesRequest is the request type for the +// ModifyLoadBalancerAttributes API operation. +type ModifyLoadBalancerAttributesRequest struct { + *aws.Request + Input *ModifyLoadBalancerAttributesInput + Copy func(*ModifyLoadBalancerAttributesInput) ModifyLoadBalancerAttributesRequest +} + +// Send marshals and sends the ModifyLoadBalancerAttributes API request. +func (r ModifyLoadBalancerAttributesRequest) Send(ctx context.Context) (*ModifyLoadBalancerAttributesResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &ModifyLoadBalancerAttributesResponse{ + ModifyLoadBalancerAttributesOutput: r.Request.Data.(*ModifyLoadBalancerAttributesOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// ModifyLoadBalancerAttributesResponse is the response type for the +// ModifyLoadBalancerAttributes API operation. +type ModifyLoadBalancerAttributesResponse struct { + *ModifyLoadBalancerAttributesOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// ModifyLoadBalancerAttributes request. +func (r *ModifyLoadBalancerAttributesResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_ModifyRule.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_ModifyRule.go new file mode 100644 index 000000000000..382de759144b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_ModifyRule.go @@ -0,0 +1,182 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyRuleInput +type ModifyRuleInput struct { + _ struct{} `type:"structure"` + + // The actions. + // + // If the action type is forward, you specify a target group. The protocol of + // the target group must be HTTP or HTTPS for an Application Load Balancer. + // The protocol of the target group must be TCP or TLS for a Network Load Balancer. + // + // [HTTPS listeners] If the action type is authenticate-oidc, you authenticate + // users through an identity provider that is OpenID Connect (OIDC) compliant. + // + // [HTTPS listeners] If the action type is authenticate-cognito, you authenticate + // users through the user pools supported by Amazon Cognito. + // + // [Application Load Balancer] If the action type is redirect, you redirect + // specified client requests from one URL to another. + // + // [Application Load Balancer] If the action type is fixed-response, you drop + // specified client requests and return a custom HTTP response. + Actions []Action `type:"list"` + + // The conditions. Each condition specifies a field name and a single value. + // + // If the field name is host-header, you can specify a single host name (for + // example, my.example.com). A host name is case insensitive, can be up to 128 + // characters in length, and can contain any of the following characters. You + // can include up to three wildcard characters. + // + // * A-Z, a-z, 0-9 + // + // * - . + // + // * * (matches 0 or more characters) + // + // * ? (matches exactly 1 character) + // + // If the field name is path-pattern, you can specify a single path pattern. + // A path pattern is case-sensitive, can be up to 128 characters in length, + // and can contain any of the following characters. You can include up to three + // wildcard characters. + // + // * A-Z, a-z, 0-9 + // + // * _ - . $ / ~ " ' @ : + + // + // * & (using &) + // + // * * (matches 0 or more characters) + // + // * ? (matches exactly 1 character) + Conditions []RuleCondition `type:"list"` + + // The Amazon Resource Name (ARN) of the rule. + // + // RuleArn is a required field + RuleArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ModifyRuleInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyRuleInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "ModifyRuleInput"} + + if s.RuleArn == nil { + invalidParams.Add(aws.NewErrParamRequired("RuleArn")) + } + if s.Actions != nil { + for i, v := range s.Actions { + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Actions", i), err.(aws.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyRuleOutput +type ModifyRuleOutput struct { + _ struct{} `type:"structure"` + + // Information about the modified rule. + Rules []Rule `type:"list"` +} + +// String returns the string representation +func (s ModifyRuleOutput) String() string { + return awsutil.Prettify(s) +} + +const opModifyRule = "ModifyRule" + +// ModifyRuleRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Modifies the specified rule. +// +// Any existing properties that you do not modify retain their current values. +// +// To modify the actions for the default rule, use ModifyListener. +// +// // Example sending a request using ModifyRuleRequest. +// req := client.ModifyRuleRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyRule +func (c *Client) ModifyRuleRequest(input *ModifyRuleInput) ModifyRuleRequest { + op := &aws.Operation{ + Name: opModifyRule, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyRuleInput{} + } + + req := c.newRequest(op, input, &ModifyRuleOutput{}) + return ModifyRuleRequest{Request: req, Input: input, Copy: c.ModifyRuleRequest} +} + +// ModifyRuleRequest is the request type for the +// ModifyRule API operation. +type ModifyRuleRequest struct { + *aws.Request + Input *ModifyRuleInput + Copy func(*ModifyRuleInput) ModifyRuleRequest +} + +// Send marshals and sends the ModifyRule API request. +func (r ModifyRuleRequest) Send(ctx context.Context) (*ModifyRuleResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &ModifyRuleResponse{ + ModifyRuleOutput: r.Request.Data.(*ModifyRuleOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// ModifyRuleResponse is the response type for the +// ModifyRule API operation. +type ModifyRuleResponse struct { + *ModifyRuleOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// ModifyRule request. +func (r *ModifyRuleResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_ModifyTargetGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_ModifyTargetGroup.go new file mode 100644 index 000000000000..ebce912b1479 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_ModifyTargetGroup.go @@ -0,0 +1,189 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyTargetGroupInput +type ModifyTargetGroupInput struct { + _ struct{} `type:"structure"` + + // Indicates whether health checks are enabled. + HealthCheckEnabled *bool `type:"boolean"` + + // The approximate amount of time, in seconds, between health checks of an individual + // target. For Application Load Balancers, the range is 5–300 seconds. For + // Network Load Balancers, the supported values are 10 or 30 seconds. + // + // If the protocol of the target group is TCP, you can't modify this setting. + HealthCheckIntervalSeconds *int64 `min:"5" type:"integer"` + + // [HTTP/HTTPS health checks] The ping path that is the destination for the + // health check request. + HealthCheckPath *string `min:"1" type:"string"` + + // The port the load balancer uses when performing health checks on targets. + HealthCheckPort *string `type:"string"` + + // The protocol the load balancer uses when performing health checks on targets. + // The TCP protocol is supported for health checks only if the protocol of the + // target group is TCP or TLS. The TLS protocol is not supported for health + // checks. + // + // If the protocol of the target group is TCP, you can't modify this setting. + HealthCheckProtocol ProtocolEnum `type:"string" enum:"true"` + + // [HTTP/HTTPS health checks] The amount of time, in seconds, during which no + // response means a failed health check. + // + // If the protocol of the target group is TCP, you can't modify this setting. + HealthCheckTimeoutSeconds *int64 `min:"2" type:"integer"` + + // The number of consecutive health checks successes required before considering + // an unhealthy target healthy. + HealthyThresholdCount *int64 `min:"2" type:"integer"` + + // [HTTP/HTTPS health checks] The HTTP codes to use when checking for a successful + // response from a target. + // + // If the protocol of the target group is TCP, you can't modify this setting. + Matcher *Matcher `type:"structure"` + + // The Amazon Resource Name (ARN) of the target group. + // + // TargetGroupArn is a required field + TargetGroupArn *string `type:"string" required:"true"` + + // The number of consecutive health check failures required before considering + // the target unhealthy. For Network Load Balancers, this value must be the + // same as the healthy threshold count. + UnhealthyThresholdCount *int64 `min:"2" type:"integer"` +} + +// String returns the string representation +func (s ModifyTargetGroupInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyTargetGroupInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "ModifyTargetGroupInput"} + if s.HealthCheckIntervalSeconds != nil && *s.HealthCheckIntervalSeconds < 5 { + invalidParams.Add(aws.NewErrParamMinValue("HealthCheckIntervalSeconds", 5)) + } + if s.HealthCheckPath != nil && len(*s.HealthCheckPath) < 1 { + invalidParams.Add(aws.NewErrParamMinLen("HealthCheckPath", 1)) + } + if s.HealthCheckTimeoutSeconds != nil && *s.HealthCheckTimeoutSeconds < 2 { + invalidParams.Add(aws.NewErrParamMinValue("HealthCheckTimeoutSeconds", 2)) + } + if s.HealthyThresholdCount != nil && *s.HealthyThresholdCount < 2 { + invalidParams.Add(aws.NewErrParamMinValue("HealthyThresholdCount", 2)) + } + + if s.TargetGroupArn == nil { + invalidParams.Add(aws.NewErrParamRequired("TargetGroupArn")) + } + if s.UnhealthyThresholdCount != nil && *s.UnhealthyThresholdCount < 2 { + invalidParams.Add(aws.NewErrParamMinValue("UnhealthyThresholdCount", 2)) + } + if s.Matcher != nil { + if err := s.Matcher.Validate(); err != nil { + invalidParams.AddNested("Matcher", err.(aws.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyTargetGroupOutput +type ModifyTargetGroupOutput struct { + _ struct{} `type:"structure"` + + // Information about the modified target group. + TargetGroups []TargetGroup `type:"list"` +} + +// String returns the string representation +func (s ModifyTargetGroupOutput) String() string { + return awsutil.Prettify(s) +} + +const opModifyTargetGroup = "ModifyTargetGroup" + +// ModifyTargetGroupRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Modifies the health checks used when evaluating the health state of the targets +// in the specified target group. +// +// To monitor the health of the targets, use DescribeTargetHealth. +// +// // Example sending a request using ModifyTargetGroupRequest. +// req := client.ModifyTargetGroupRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyTargetGroup +func (c *Client) ModifyTargetGroupRequest(input *ModifyTargetGroupInput) ModifyTargetGroupRequest { + op := &aws.Operation{ + Name: opModifyTargetGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyTargetGroupInput{} + } + + req := c.newRequest(op, input, &ModifyTargetGroupOutput{}) + return ModifyTargetGroupRequest{Request: req, Input: input, Copy: c.ModifyTargetGroupRequest} +} + +// ModifyTargetGroupRequest is the request type for the +// ModifyTargetGroup API operation. +type ModifyTargetGroupRequest struct { + *aws.Request + Input *ModifyTargetGroupInput + Copy func(*ModifyTargetGroupInput) ModifyTargetGroupRequest +} + +// Send marshals and sends the ModifyTargetGroup API request. +func (r ModifyTargetGroupRequest) Send(ctx context.Context) (*ModifyTargetGroupResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &ModifyTargetGroupResponse{ + ModifyTargetGroupOutput: r.Request.Data.(*ModifyTargetGroupOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// ModifyTargetGroupResponse is the response type for the +// ModifyTargetGroup API operation. +type ModifyTargetGroupResponse struct { + *ModifyTargetGroupOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// ModifyTargetGroup request. +func (r *ModifyTargetGroupResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_ModifyTargetGroupAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_ModifyTargetGroupAttributes.go new file mode 100644 index 000000000000..ec129a95c8c7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_ModifyTargetGroupAttributes.go @@ -0,0 +1,129 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyTargetGroupAttributesInput +type ModifyTargetGroupAttributesInput struct { + _ struct{} `type:"structure"` + + // The attributes. + // + // Attributes is a required field + Attributes []TargetGroupAttribute `type:"list" required:"true"` + + // The Amazon Resource Name (ARN) of the target group. + // + // TargetGroupArn is a required field + TargetGroupArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ModifyTargetGroupAttributesInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyTargetGroupAttributesInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "ModifyTargetGroupAttributesInput"} + + if s.Attributes == nil { + invalidParams.Add(aws.NewErrParamRequired("Attributes")) + } + + if s.TargetGroupArn == nil { + invalidParams.Add(aws.NewErrParamRequired("TargetGroupArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyTargetGroupAttributesOutput +type ModifyTargetGroupAttributesOutput struct { + _ struct{} `type:"structure"` + + // Information about the attributes. + Attributes []TargetGroupAttribute `type:"list"` +} + +// String returns the string representation +func (s ModifyTargetGroupAttributesOutput) String() string { + return awsutil.Prettify(s) +} + +const opModifyTargetGroupAttributes = "ModifyTargetGroupAttributes" + +// ModifyTargetGroupAttributesRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Modifies the specified attributes of the specified target group. +// +// // Example sending a request using ModifyTargetGroupAttributesRequest. +// req := client.ModifyTargetGroupAttributesRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/ModifyTargetGroupAttributes +func (c *Client) ModifyTargetGroupAttributesRequest(input *ModifyTargetGroupAttributesInput) ModifyTargetGroupAttributesRequest { + op := &aws.Operation{ + Name: opModifyTargetGroupAttributes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyTargetGroupAttributesInput{} + } + + req := c.newRequest(op, input, &ModifyTargetGroupAttributesOutput{}) + return ModifyTargetGroupAttributesRequest{Request: req, Input: input, Copy: c.ModifyTargetGroupAttributesRequest} +} + +// ModifyTargetGroupAttributesRequest is the request type for the +// ModifyTargetGroupAttributes API operation. +type ModifyTargetGroupAttributesRequest struct { + *aws.Request + Input *ModifyTargetGroupAttributesInput + Copy func(*ModifyTargetGroupAttributesInput) ModifyTargetGroupAttributesRequest +} + +// Send marshals and sends the ModifyTargetGroupAttributes API request. +func (r ModifyTargetGroupAttributesRequest) Send(ctx context.Context) (*ModifyTargetGroupAttributesResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &ModifyTargetGroupAttributesResponse{ + ModifyTargetGroupAttributesOutput: r.Request.Data.(*ModifyTargetGroupAttributesOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// ModifyTargetGroupAttributesResponse is the response type for the +// ModifyTargetGroupAttributes API operation. +type ModifyTargetGroupAttributesResponse struct { + *ModifyTargetGroupAttributesOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// ModifyTargetGroupAttributes request. +func (r *ModifyTargetGroupAttributesResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_RegisterTargets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_RegisterTargets.go new file mode 100644 index 000000000000..32d124323bc4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_RegisterTargets.go @@ -0,0 +1,153 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RegisterTargetsInput +type RegisterTargetsInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the target group. + // + // TargetGroupArn is a required field + TargetGroupArn *string `type:"string" required:"true"` + + // The targets. + // + // To register a target by instance ID, specify the instance ID. To register + // a target by IP address, specify the IP address. To register a Lambda function, + // specify the ARN of the Lambda function. + // + // Targets is a required field + Targets []TargetDescription `type:"list" required:"true"` +} + +// String returns the string representation +func (s RegisterTargetsInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RegisterTargetsInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "RegisterTargetsInput"} + + if s.TargetGroupArn == nil { + invalidParams.Add(aws.NewErrParamRequired("TargetGroupArn")) + } + + if s.Targets == nil { + invalidParams.Add(aws.NewErrParamRequired("Targets")) + } + if s.Targets != nil { + for i, v := range s.Targets { + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(aws.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RegisterTargetsOutput +type RegisterTargetsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s RegisterTargetsOutput) String() string { + return awsutil.Prettify(s) +} + +const opRegisterTargets = "RegisterTargets" + +// RegisterTargetsRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Registers the specified targets with the specified target group. +// +// If the target is an EC2 instance, it must be in the running state when you +// register it. +// +// By default, the load balancer routes requests to registered targets using +// the protocol and port for the target group. Alternatively, you can override +// the port for a target when you register it. You can register each EC2 instance +// or IP address with the same target group multiple times using different ports. +// +// With a Network Load Balancer, you cannot register instances by instance ID +// if they have the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, +// G1, G2, HI1, HS1, M1, M2, M3, and T1. You can register instances of these +// types by IP address. +// +// To remove a target from a target group, use DeregisterTargets. +// +// // Example sending a request using RegisterTargetsRequest. +// req := client.RegisterTargetsRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RegisterTargets +func (c *Client) RegisterTargetsRequest(input *RegisterTargetsInput) RegisterTargetsRequest { + op := &aws.Operation{ + Name: opRegisterTargets, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RegisterTargetsInput{} + } + + req := c.newRequest(op, input, &RegisterTargetsOutput{}) + return RegisterTargetsRequest{Request: req, Input: input, Copy: c.RegisterTargetsRequest} +} + +// RegisterTargetsRequest is the request type for the +// RegisterTargets API operation. +type RegisterTargetsRequest struct { + *aws.Request + Input *RegisterTargetsInput + Copy func(*RegisterTargetsInput) RegisterTargetsRequest +} + +// Send marshals and sends the RegisterTargets API request. +func (r RegisterTargetsRequest) Send(ctx context.Context) (*RegisterTargetsResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &RegisterTargetsResponse{ + RegisterTargetsOutput: r.Request.Data.(*RegisterTargetsOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// RegisterTargetsResponse is the response type for the +// RegisterTargets API operation. +type RegisterTargetsResponse struct { + *RegisterTargetsOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// RegisterTargets request. +func (r *RegisterTargetsResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_RemoveListenerCertificates.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_RemoveListenerCertificates.go new file mode 100644 index 000000000000..80f153eab572 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_RemoveListenerCertificates.go @@ -0,0 +1,132 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RemoveListenerCertificatesInput +type RemoveListenerCertificatesInput struct { + _ struct{} `type:"structure"` + + // The certificate to remove. You can specify one certificate per call. Set + // CertificateArn to the certificate ARN but do not set IsDefault. + // + // Certificates is a required field + Certificates []Certificate `type:"list" required:"true"` + + // The Amazon Resource Name (ARN) of the listener. + // + // ListenerArn is a required field + ListenerArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s RemoveListenerCertificatesInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RemoveListenerCertificatesInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "RemoveListenerCertificatesInput"} + + if s.Certificates == nil { + invalidParams.Add(aws.NewErrParamRequired("Certificates")) + } + + if s.ListenerArn == nil { + invalidParams.Add(aws.NewErrParamRequired("ListenerArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RemoveListenerCertificatesOutput +type RemoveListenerCertificatesOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s RemoveListenerCertificatesOutput) String() string { + return awsutil.Prettify(s) +} + +const opRemoveListenerCertificates = "RemoveListenerCertificates" + +// RemoveListenerCertificatesRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Removes the specified certificate from the specified HTTPS listener. +// +// You can't remove the default certificate for a listener. To replace the default +// certificate, call ModifyListener. +// +// To list the certificates for your listener, use DescribeListenerCertificates. +// +// // Example sending a request using RemoveListenerCertificatesRequest. +// req := client.RemoveListenerCertificatesRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RemoveListenerCertificates +func (c *Client) RemoveListenerCertificatesRequest(input *RemoveListenerCertificatesInput) RemoveListenerCertificatesRequest { + op := &aws.Operation{ + Name: opRemoveListenerCertificates, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RemoveListenerCertificatesInput{} + } + + req := c.newRequest(op, input, &RemoveListenerCertificatesOutput{}) + return RemoveListenerCertificatesRequest{Request: req, Input: input, Copy: c.RemoveListenerCertificatesRequest} +} + +// RemoveListenerCertificatesRequest is the request type for the +// RemoveListenerCertificates API operation. +type RemoveListenerCertificatesRequest struct { + *aws.Request + Input *RemoveListenerCertificatesInput + Copy func(*RemoveListenerCertificatesInput) RemoveListenerCertificatesRequest +} + +// Send marshals and sends the RemoveListenerCertificates API request. +func (r RemoveListenerCertificatesRequest) Send(ctx context.Context) (*RemoveListenerCertificatesResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &RemoveListenerCertificatesResponse{ + RemoveListenerCertificatesOutput: r.Request.Data.(*RemoveListenerCertificatesOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// RemoveListenerCertificatesResponse is the response type for the +// RemoveListenerCertificates API operation. +type RemoveListenerCertificatesResponse struct { + *RemoveListenerCertificatesOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// RemoveListenerCertificates request. +func (r *RemoveListenerCertificatesResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_RemoveTags.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_RemoveTags.go new file mode 100644 index 000000000000..b2fb1af4d639 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_RemoveTags.go @@ -0,0 +1,128 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RemoveTagsInput +type RemoveTagsInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + // + // ResourceArns is a required field + ResourceArns []string `type:"list" required:"true"` + + // The tag keys for the tags to remove. + // + // TagKeys is a required field + TagKeys []string `type:"list" required:"true"` +} + +// String returns the string representation +func (s RemoveTagsInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RemoveTagsInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "RemoveTagsInput"} + + if s.ResourceArns == nil { + invalidParams.Add(aws.NewErrParamRequired("ResourceArns")) + } + + if s.TagKeys == nil { + invalidParams.Add(aws.NewErrParamRequired("TagKeys")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RemoveTagsOutput +type RemoveTagsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s RemoveTagsOutput) String() string { + return awsutil.Prettify(s) +} + +const opRemoveTags = "RemoveTags" + +// RemoveTagsRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Removes the specified tags from the specified Elastic Load Balancing resource. +// +// To list the current tags for your resources, use DescribeTags. +// +// // Example sending a request using RemoveTagsRequest. +// req := client.RemoveTagsRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RemoveTags +func (c *Client) RemoveTagsRequest(input *RemoveTagsInput) RemoveTagsRequest { + op := &aws.Operation{ + Name: opRemoveTags, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RemoveTagsInput{} + } + + req := c.newRequest(op, input, &RemoveTagsOutput{}) + return RemoveTagsRequest{Request: req, Input: input, Copy: c.RemoveTagsRequest} +} + +// RemoveTagsRequest is the request type for the +// RemoveTags API operation. +type RemoveTagsRequest struct { + *aws.Request + Input *RemoveTagsInput + Copy func(*RemoveTagsInput) RemoveTagsRequest +} + +// Send marshals and sends the RemoveTags API request. +func (r RemoveTagsRequest) Send(ctx context.Context) (*RemoveTagsResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &RemoveTagsResponse{ + RemoveTagsOutput: r.Request.Data.(*RemoveTagsOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// RemoveTagsResponse is the response type for the +// RemoveTags API operation. +type RemoveTagsResponse struct { + *RemoveTagsOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// RemoveTags request. +func (r *RemoveTagsResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_SetIpAddressType.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_SetIpAddressType.go new file mode 100644 index 000000000000..4a314f903210 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_SetIpAddressType.go @@ -0,0 +1,133 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetIpAddressTypeInput +type SetIpAddressTypeInput struct { + _ struct{} `type:"structure"` + + // The IP address type. The possible values are ipv4 (for IPv4 addresses) and + // dualstack (for IPv4 and IPv6 addresses). Internal load balancers must use + // ipv4. + // + // IpAddressType is a required field + IpAddressType IpAddressType `type:"string" required:"true" enum:"true"` + + // The Amazon Resource Name (ARN) of the load balancer. + // + // LoadBalancerArn is a required field + LoadBalancerArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s SetIpAddressTypeInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetIpAddressTypeInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "SetIpAddressTypeInput"} + if len(s.IpAddressType) == 0 { + invalidParams.Add(aws.NewErrParamRequired("IpAddressType")) + } + + if s.LoadBalancerArn == nil { + invalidParams.Add(aws.NewErrParamRequired("LoadBalancerArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetIpAddressTypeOutput +type SetIpAddressTypeOutput struct { + _ struct{} `type:"structure"` + + // The IP address type. + IpAddressType IpAddressType `type:"string" enum:"true"` +} + +// String returns the string representation +func (s SetIpAddressTypeOutput) String() string { + return awsutil.Prettify(s) +} + +const opSetIpAddressType = "SetIpAddressType" + +// SetIpAddressTypeRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Sets the type of IP addresses used by the subnets of the specified Application +// Load Balancer or Network Load Balancer. +// +// Network Load Balancers must use ipv4. +// +// // Example sending a request using SetIpAddressTypeRequest. +// req := client.SetIpAddressTypeRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetIpAddressType +func (c *Client) SetIpAddressTypeRequest(input *SetIpAddressTypeInput) SetIpAddressTypeRequest { + op := &aws.Operation{ + Name: opSetIpAddressType, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SetIpAddressTypeInput{} + } + + req := c.newRequest(op, input, &SetIpAddressTypeOutput{}) + return SetIpAddressTypeRequest{Request: req, Input: input, Copy: c.SetIpAddressTypeRequest} +} + +// SetIpAddressTypeRequest is the request type for the +// SetIpAddressType API operation. +type SetIpAddressTypeRequest struct { + *aws.Request + Input *SetIpAddressTypeInput + Copy func(*SetIpAddressTypeInput) SetIpAddressTypeRequest +} + +// Send marshals and sends the SetIpAddressType API request. +func (r SetIpAddressTypeRequest) Send(ctx context.Context) (*SetIpAddressTypeResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &SetIpAddressTypeResponse{ + SetIpAddressTypeOutput: r.Request.Data.(*SetIpAddressTypeOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// SetIpAddressTypeResponse is the response type for the +// SetIpAddressType API operation. +type SetIpAddressTypeResponse struct { + *SetIpAddressTypeOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// SetIpAddressType request. +func (r *SetIpAddressTypeResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_SetRulePriorities.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_SetRulePriorities.go new file mode 100644 index 000000000000..d1f6e97a7530 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_SetRulePriorities.go @@ -0,0 +1,132 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetRulePrioritiesInput +type SetRulePrioritiesInput struct { + _ struct{} `type:"structure"` + + // The rule priorities. + // + // RulePriorities is a required field + RulePriorities []RulePriorityPair `type:"list" required:"true"` +} + +// String returns the string representation +func (s SetRulePrioritiesInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetRulePrioritiesInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "SetRulePrioritiesInput"} + + if s.RulePriorities == nil { + invalidParams.Add(aws.NewErrParamRequired("RulePriorities")) + } + if s.RulePriorities != nil { + for i, v := range s.RulePriorities { + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RulePriorities", i), err.(aws.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetRulePrioritiesOutput +type SetRulePrioritiesOutput struct { + _ struct{} `type:"structure"` + + // Information about the rules. + Rules []Rule `type:"list"` +} + +// String returns the string representation +func (s SetRulePrioritiesOutput) String() string { + return awsutil.Prettify(s) +} + +const opSetRulePriorities = "SetRulePriorities" + +// SetRulePrioritiesRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Sets the priorities of the specified rules. +// +// You can reorder the rules as long as there are no priority conflicts in the +// new order. Any existing rules that you do not specify retain their current +// priority. +// +// // Example sending a request using SetRulePrioritiesRequest. +// req := client.SetRulePrioritiesRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetRulePriorities +func (c *Client) SetRulePrioritiesRequest(input *SetRulePrioritiesInput) SetRulePrioritiesRequest { + op := &aws.Operation{ + Name: opSetRulePriorities, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SetRulePrioritiesInput{} + } + + req := c.newRequest(op, input, &SetRulePrioritiesOutput{}) + return SetRulePrioritiesRequest{Request: req, Input: input, Copy: c.SetRulePrioritiesRequest} +} + +// SetRulePrioritiesRequest is the request type for the +// SetRulePriorities API operation. +type SetRulePrioritiesRequest struct { + *aws.Request + Input *SetRulePrioritiesInput + Copy func(*SetRulePrioritiesInput) SetRulePrioritiesRequest +} + +// Send marshals and sends the SetRulePriorities API request. +func (r SetRulePrioritiesRequest) Send(ctx context.Context) (*SetRulePrioritiesResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &SetRulePrioritiesResponse{ + SetRulePrioritiesOutput: r.Request.Data.(*SetRulePrioritiesOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// SetRulePrioritiesResponse is the response type for the +// SetRulePriorities API operation. +type SetRulePrioritiesResponse struct { + *SetRulePrioritiesOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// SetRulePriorities request. +func (r *SetRulePrioritiesResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_SetSecurityGroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_SetSecurityGroups.go new file mode 100644 index 000000000000..e1f1f3ccb3fa --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_SetSecurityGroups.go @@ -0,0 +1,133 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSecurityGroupsInput +type SetSecurityGroupsInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the load balancer. + // + // LoadBalancerArn is a required field + LoadBalancerArn *string `type:"string" required:"true"` + + // The IDs of the security groups. + // + // SecurityGroups is a required field + SecurityGroups []string `type:"list" required:"true"` +} + +// String returns the string representation +func (s SetSecurityGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetSecurityGroupsInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "SetSecurityGroupsInput"} + + if s.LoadBalancerArn == nil { + invalidParams.Add(aws.NewErrParamRequired("LoadBalancerArn")) + } + + if s.SecurityGroups == nil { + invalidParams.Add(aws.NewErrParamRequired("SecurityGroups")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSecurityGroupsOutput +type SetSecurityGroupsOutput struct { + _ struct{} `type:"structure"` + + // The IDs of the security groups associated with the load balancer. + SecurityGroupIds []string `type:"list"` +} + +// String returns the string representation +func (s SetSecurityGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +const opSetSecurityGroups = "SetSecurityGroups" + +// SetSecurityGroupsRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Associates the specified security groups with the specified Application Load +// Balancer. The specified security groups override the previously associated +// security groups. +// +// You can't specify a security group for a Network Load Balancer. +// +// // Example sending a request using SetSecurityGroupsRequest. +// req := client.SetSecurityGroupsRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSecurityGroups +func (c *Client) SetSecurityGroupsRequest(input *SetSecurityGroupsInput) SetSecurityGroupsRequest { + op := &aws.Operation{ + Name: opSetSecurityGroups, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SetSecurityGroupsInput{} + } + + req := c.newRequest(op, input, &SetSecurityGroupsOutput{}) + return SetSecurityGroupsRequest{Request: req, Input: input, Copy: c.SetSecurityGroupsRequest} +} + +// SetSecurityGroupsRequest is the request type for the +// SetSecurityGroups API operation. +type SetSecurityGroupsRequest struct { + *aws.Request + Input *SetSecurityGroupsInput + Copy func(*SetSecurityGroupsInput) SetSecurityGroupsRequest +} + +// Send marshals and sends the SetSecurityGroups API request. +func (r SetSecurityGroupsRequest) Send(ctx context.Context) (*SetSecurityGroupsResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &SetSecurityGroupsResponse{ + SetSecurityGroupsOutput: r.Request.Data.(*SetSecurityGroupsOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// SetSecurityGroupsResponse is the response type for the +// SetSecurityGroups API operation. +type SetSecurityGroupsResponse struct { + *SetSecurityGroupsOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// SetSecurityGroups request. +func (r *SetSecurityGroupsResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_SetSubnets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_SetSubnets.go new file mode 100644 index 000000000000..0f12202ea129 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_op_SetSubnets.go @@ -0,0 +1,136 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSubnetsInput +type SetSubnetsInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the load balancer. + // + // LoadBalancerArn is a required field + LoadBalancerArn *string `type:"string" required:"true"` + + // The IDs of the public subnets. You must specify subnets from at least two + // Availability Zones. You can specify only one subnet per Availability Zone. + // You must specify either subnets or subnet mappings. + // + // You cannot specify Elastic IP addresses for your subnets. + SubnetMappings []SubnetMapping `type:"list"` + + // The IDs of the public subnets. You must specify subnets from at least two + // Availability Zones. You can specify only one subnet per Availability Zone. + // You must specify either subnets or subnet mappings. + Subnets []string `type:"list"` +} + +// String returns the string representation +func (s SetSubnetsInput) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetSubnetsInput) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "SetSubnetsInput"} + + if s.LoadBalancerArn == nil { + invalidParams.Add(aws.NewErrParamRequired("LoadBalancerArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSubnetsOutput +type SetSubnetsOutput struct { + _ struct{} `type:"structure"` + + // Information about the subnet and Availability Zone. + AvailabilityZones []AvailabilityZone `type:"list"` +} + +// String returns the string representation +func (s SetSubnetsOutput) String() string { + return awsutil.Prettify(s) +} + +const opSetSubnets = "SetSubnets" + +// SetSubnetsRequest returns a request value for making API operation for +// Elastic Load Balancing. +// +// Enables the Availability Zone for the specified public subnets for the specified +// Application Load Balancer. The specified subnets replace the previously enabled +// subnets. +// +// You can't change the subnets for a Network Load Balancer. +// +// // Example sending a request using SetSubnetsRequest. +// req := client.SetSubnetsRequest(params) +// resp, err := req.Send(context.TODO()) +// if err == nil { +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSubnets +func (c *Client) SetSubnetsRequest(input *SetSubnetsInput) SetSubnetsRequest { + op := &aws.Operation{ + Name: opSetSubnets, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SetSubnetsInput{} + } + + req := c.newRequest(op, input, &SetSubnetsOutput{}) + return SetSubnetsRequest{Request: req, Input: input, Copy: c.SetSubnetsRequest} +} + +// SetSubnetsRequest is the request type for the +// SetSubnets API operation. +type SetSubnetsRequest struct { + *aws.Request + Input *SetSubnetsInput + Copy func(*SetSubnetsInput) SetSubnetsRequest +} + +// Send marshals and sends the SetSubnets API request. +func (r SetSubnetsRequest) Send(ctx context.Context) (*SetSubnetsResponse, error) { + r.Request.SetContext(ctx) + err := r.Request.Send() + if err != nil { + return nil, err + } + + resp := &SetSubnetsResponse{ + SetSubnetsOutput: r.Request.Data.(*SetSubnetsOutput), + response: &aws.Response{Request: r.Request}, + } + + return resp, nil +} + +// SetSubnetsResponse is the response type for the +// SetSubnets API operation. +type SetSubnetsResponse struct { + *SetSubnetsOutput + + response *aws.Response +} + +// SDKResponseMetdata returns the response metadata for the +// SetSubnets request. +func (r *SetSubnetsResponse) SDKResponseMetdata() *aws.Response { + return r.response +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_types.go new file mode 100644 index 000000000000..34d02218fce7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_types.go @@ -0,0 +1,1262 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/awsutil" +) + +var _ aws.Config +var _ = awsutil.Prettify + +// Information about an action. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/Action +type Action struct { + _ struct{} `type:"structure"` + + // [HTTPS listeners] Information for using Amazon Cognito to authenticate users. + // Specify only when Type is authenticate-cognito. + AuthenticateCognitoConfig *AuthenticateCognitoActionConfig `type:"structure"` + + // [HTTPS listeners] Information about an identity provider that is compliant + // with OpenID Connect (OIDC). Specify only when Type is authenticate-oidc. + AuthenticateOidcConfig *AuthenticateOidcActionConfig `type:"structure"` + + // [Application Load Balancer] Information for creating an action that returns + // a custom HTTP response. Specify only when Type is fixed-response. + FixedResponseConfig *FixedResponseActionConfig `type:"structure"` + + // The order for the action. This value is required for rules with multiple + // actions. The action with the lowest value for order is performed first. The + // final action to be performed must be a forward or a fixed-response action. + Order *int64 `min:"1" type:"integer"` + + // [Application Load Balancer] Information for creating a redirect action. Specify + // only when Type is redirect. + RedirectConfig *RedirectActionConfig `type:"structure"` + + // The Amazon Resource Name (ARN) of the target group. Specify only when Type + // is forward. + TargetGroupArn *string `type:"string"` + + // The type of action. Each rule must include exactly one of the following types + // of actions: forward, fixed-response, or redirect. + // + // Type is a required field + Type ActionTypeEnum `type:"string" required:"true" enum:"true"` +} + +// String returns the string representation +func (s Action) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Action) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "Action"} + if s.Order != nil && *s.Order < 1 { + invalidParams.Add(aws.NewErrParamMinValue("Order", 1)) + } + if len(s.Type) == 0 { + invalidParams.Add(aws.NewErrParamRequired("Type")) + } + if s.AuthenticateCognitoConfig != nil { + if err := s.AuthenticateCognitoConfig.Validate(); err != nil { + invalidParams.AddNested("AuthenticateCognitoConfig", err.(aws.ErrInvalidParams)) + } + } + if s.AuthenticateOidcConfig != nil { + if err := s.AuthenticateOidcConfig.Validate(); err != nil { + invalidParams.AddNested("AuthenticateOidcConfig", err.(aws.ErrInvalidParams)) + } + } + if s.FixedResponseConfig != nil { + if err := s.FixedResponseConfig.Validate(); err != nil { + invalidParams.AddNested("FixedResponseConfig", err.(aws.ErrInvalidParams)) + } + } + if s.RedirectConfig != nil { + if err := s.RedirectConfig.Validate(); err != nil { + invalidParams.AddNested("RedirectConfig", err.(aws.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Request parameters to use when integrating with Amazon Cognito to authenticate +// users. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/AuthenticateCognitoActionConfig +type AuthenticateCognitoActionConfig struct { + _ struct{} `type:"structure"` + + // The query parameters (up to 10) to include in the redirect request to the + // authorization endpoint. + AuthenticationRequestExtraParams map[string]string `type:"map"` + + // The behavior if the user is not authenticated. The following are possible + // values: + // + // * deny - Return an HTTP 401 Unauthorized error. + // + // * allow - Allow the request to be forwarded to the target. + // + // * authenticate - Redirect the request to the IdP authorization endpoint. + // This is the default value. + OnUnauthenticatedRequest AuthenticateCognitoActionConditionalBehaviorEnum `type:"string" enum:"true"` + + // The set of user claims to be requested from the IdP. The default is openid. + // + // To verify which scope values your IdP supports and how to separate multiple + // values, see the documentation for your IdP. + Scope *string `type:"string"` + + // The name of the cookie used to maintain session information. The default + // is AWSELBAuthSessionCookie. + SessionCookieName *string `type:"string"` + + // The maximum duration of the authentication session, in seconds. The default + // is 604800 seconds (7 days). + SessionTimeout *int64 `type:"long"` + + // The Amazon Resource Name (ARN) of the Amazon Cognito user pool. + // + // UserPoolArn is a required field + UserPoolArn *string `type:"string" required:"true"` + + // The ID of the Amazon Cognito user pool client. + // + // UserPoolClientId is a required field + UserPoolClientId *string `type:"string" required:"true"` + + // The domain prefix or fully-qualified domain name of the Amazon Cognito user + // pool. + // + // UserPoolDomain is a required field + UserPoolDomain *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AuthenticateCognitoActionConfig) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AuthenticateCognitoActionConfig) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "AuthenticateCognitoActionConfig"} + + if s.UserPoolArn == nil { + invalidParams.Add(aws.NewErrParamRequired("UserPoolArn")) + } + + if s.UserPoolClientId == nil { + invalidParams.Add(aws.NewErrParamRequired("UserPoolClientId")) + } + + if s.UserPoolDomain == nil { + invalidParams.Add(aws.NewErrParamRequired("UserPoolDomain")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Request parameters when using an identity provider (IdP) that is compliant +// with OpenID Connect (OIDC) to authenticate users. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/AuthenticateOidcActionConfig +type AuthenticateOidcActionConfig struct { + _ struct{} `type:"structure"` + + // The query parameters (up to 10) to include in the redirect request to the + // authorization endpoint. + AuthenticationRequestExtraParams map[string]string `type:"map"` + + // The authorization endpoint of the IdP. This must be a full URL, including + // the HTTPS protocol, the domain, and the path. + // + // AuthorizationEndpoint is a required field + AuthorizationEndpoint *string `type:"string" required:"true"` + + // The OAuth 2.0 client identifier. + // + // ClientId is a required field + ClientId *string `type:"string" required:"true"` + + // The OAuth 2.0 client secret. This parameter is required if you are creating + // a rule. If you are modifying a rule, you can omit this parameter if you set + // UseExistingClientSecret to true. + ClientSecret *string `type:"string"` + + // The OIDC issuer identifier of the IdP. This must be a full URL, including + // the HTTPS protocol, the domain, and the path. + // + // Issuer is a required field + Issuer *string `type:"string" required:"true"` + + // The behavior if the user is not authenticated. The following are possible + // values: + // + // * deny - Return an HTTP 401 Unauthorized error. + // + // * allow - Allow the request to be forwarded to the target. + // + // * authenticate - Redirect the request to the IdP authorization endpoint. + // This is the default value. + OnUnauthenticatedRequest AuthenticateOidcActionConditionalBehaviorEnum `type:"string" enum:"true"` + + // The set of user claims to be requested from the IdP. The default is openid. + // + // To verify which scope values your IdP supports and how to separate multiple + // values, see the documentation for your IdP. + Scope *string `type:"string"` + + // The name of the cookie used to maintain session information. The default + // is AWSELBAuthSessionCookie. + SessionCookieName *string `type:"string"` + + // The maximum duration of the authentication session, in seconds. The default + // is 604800 seconds (7 days). + SessionTimeout *int64 `type:"long"` + + // The token endpoint of the IdP. This must be a full URL, including the HTTPS + // protocol, the domain, and the path. + // + // TokenEndpoint is a required field + TokenEndpoint *string `type:"string" required:"true"` + + // Indicates whether to use the existing client secret when modifying a rule. + // If you are creating a rule, you can omit this parameter or set it to false. + UseExistingClientSecret *bool `type:"boolean"` + + // The user info endpoint of the IdP. This must be a full URL, including the + // HTTPS protocol, the domain, and the path. + // + // UserInfoEndpoint is a required field + UserInfoEndpoint *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AuthenticateOidcActionConfig) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AuthenticateOidcActionConfig) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "AuthenticateOidcActionConfig"} + + if s.AuthorizationEndpoint == nil { + invalidParams.Add(aws.NewErrParamRequired("AuthorizationEndpoint")) + } + + if s.ClientId == nil { + invalidParams.Add(aws.NewErrParamRequired("ClientId")) + } + + if s.Issuer == nil { + invalidParams.Add(aws.NewErrParamRequired("Issuer")) + } + + if s.TokenEndpoint == nil { + invalidParams.Add(aws.NewErrParamRequired("TokenEndpoint")) + } + + if s.UserInfoEndpoint == nil { + invalidParams.Add(aws.NewErrParamRequired("UserInfoEndpoint")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Information about an Availability Zone. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/AvailabilityZone +type AvailabilityZone struct { + _ struct{} `type:"structure"` + + // [Network Load Balancers] The static IP address. + LoadBalancerAddresses []LoadBalancerAddress `type:"list"` + + // The ID of the subnet. + SubnetId *string `type:"string"` + + // The name of the Availability Zone. + ZoneName *string `type:"string"` +} + +// String returns the string representation +func (s AvailabilityZone) String() string { + return awsutil.Prettify(s) +} + +// Information about an SSL server certificate. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/Certificate +type Certificate struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the certificate. + CertificateArn *string `type:"string"` + + // Indicates whether the certificate is the default certificate. Do not set + // IsDefault when specifying a certificate as an input parameter. + IsDefault *bool `type:"boolean"` +} + +// String returns the string representation +func (s Certificate) String() string { + return awsutil.Prettify(s) +} + +// Information about a cipher used in a policy. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/Cipher +type Cipher struct { + _ struct{} `type:"structure"` + + // The name of the cipher. + Name *string `type:"string"` + + // The priority of the cipher. + Priority *int64 `type:"integer"` +} + +// String returns the string representation +func (s Cipher) String() string { + return awsutil.Prettify(s) +} + +// Information about an action that returns a custom HTTP response. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/FixedResponseActionConfig +type FixedResponseActionConfig struct { + _ struct{} `type:"structure"` + + // The content type. + // + // Valid Values: text/plain | text/css | text/html | application/javascript + // | application/json + ContentType *string `type:"string"` + + // The message. + MessageBody *string `type:"string"` + + // The HTTP response code (2XX, 4XX, or 5XX). + // + // StatusCode is a required field + StatusCode *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s FixedResponseActionConfig) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *FixedResponseActionConfig) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "FixedResponseActionConfig"} + + if s.StatusCode == nil { + invalidParams.Add(aws.NewErrParamRequired("StatusCode")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/HostHeaderConditionConfig +type HostHeaderConditionConfig struct { + _ struct{} `type:"structure"` + + Values []string `type:"list"` +} + +// String returns the string representation +func (s HostHeaderConditionConfig) String() string { + return awsutil.Prettify(s) +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/HttpHeaderConditionConfig +type HttpHeaderConditionConfig struct { + _ struct{} `type:"structure"` + + HttpHeaderName *string `type:"string"` + + Values []string `type:"list"` +} + +// String returns the string representation +func (s HttpHeaderConditionConfig) String() string { + return awsutil.Prettify(s) +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/HttpRequestMethodConditionConfig +type HttpRequestMethodConditionConfig struct { + _ struct{} `type:"structure"` + + Values []string `type:"list"` +} + +// String returns the string representation +func (s HttpRequestMethodConditionConfig) String() string { + return awsutil.Prettify(s) +} + +// Information about an Elastic Load Balancing resource limit for your AWS account. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/Limit +type Limit struct { + _ struct{} `type:"structure"` + + // The maximum value of the limit. + Max *string `type:"string"` + + // The name of the limit. The possible values are: + // + // * application-load-balancers + // + // * listeners-per-application-load-balancer + // + // * listeners-per-network-load-balancer + // + // * network-load-balancers + // + // * rules-per-application-load-balancer + // + // * target-groups + // + // * targets-per-application-load-balancer + // + // * targets-per-availability-zone-per-network-load-balancer + // + // * targets-per-network-load-balancer + Name *string `type:"string"` +} + +// String returns the string representation +func (s Limit) String() string { + return awsutil.Prettify(s) +} + +// Information about a listener. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/Listener +type Listener struct { + _ struct{} `type:"structure"` + + // The SSL server certificate. You must provide a certificate if the protocol + // is HTTPS or TLS. + Certificates []Certificate `type:"list"` + + // The default actions for the listener. + DefaultActions []Action `type:"list"` + + // The Amazon Resource Name (ARN) of the listener. + ListenerArn *string `type:"string"` + + // The Amazon Resource Name (ARN) of the load balancer. + LoadBalancerArn *string `type:"string"` + + // The port on which the load balancer is listening. + Port *int64 `min:"1" type:"integer"` + + // The protocol for connections from clients to the load balancer. + Protocol ProtocolEnum `type:"string" enum:"true"` + + // The security policy that defines which ciphers and protocols are supported. + // The default is the current predefined security policy. + SslPolicy *string `type:"string"` +} + +// String returns the string representation +func (s Listener) String() string { + return awsutil.Prettify(s) +} + +// Information about a load balancer. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/LoadBalancer +type LoadBalancer struct { + _ struct{} `type:"structure"` + + // The Availability Zones for the load balancer. + AvailabilityZones []AvailabilityZone `type:"list"` + + // The ID of the Amazon Route 53 hosted zone associated with the load balancer. + CanonicalHostedZoneId *string `type:"string"` + + // The date and time the load balancer was created. + CreatedTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + // The public DNS name of the load balancer. + DNSName *string `type:"string"` + + // The type of IP addresses used by the subnets for your load balancer. The + // possible values are ipv4 (for IPv4 addresses) and dualstack (for IPv4 and + // IPv6 addresses). + IpAddressType IpAddressType `type:"string" enum:"true"` + + // The Amazon Resource Name (ARN) of the load balancer. + LoadBalancerArn *string `type:"string"` + + // The name of the load balancer. + LoadBalancerName *string `type:"string"` + + // The nodes of an Internet-facing load balancer have public IP addresses. The + // DNS name of an Internet-facing load balancer is publicly resolvable to the + // public IP addresses of the nodes. Therefore, Internet-facing load balancers + // can route requests from clients over the internet. + // + // The nodes of an internal load balancer have only private IP addresses. The + // DNS name of an internal load balancer is publicly resolvable to the private + // IP addresses of the nodes. Therefore, internal load balancers can only route + // requests from clients with access to the VPC for the load balancer. + Scheme LoadBalancerSchemeEnum `type:"string" enum:"true"` + + // The IDs of the security groups for the load balancer. + SecurityGroups []string `type:"list"` + + // The state of the load balancer. + State *LoadBalancerState `type:"structure"` + + // The type of load balancer. + Type LoadBalancerTypeEnum `type:"string" enum:"true"` + + // The ID of the VPC for the load balancer. + VpcId *string `type:"string"` +} + +// String returns the string representation +func (s LoadBalancer) String() string { + return awsutil.Prettify(s) +} + +// Information about a static IP address for a load balancer. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/LoadBalancerAddress +type LoadBalancerAddress struct { + _ struct{} `type:"structure"` + + // [Network Load Balancers] The allocation ID of the Elastic IP address. + AllocationId *string `type:"string"` + + // The static IP address. + IpAddress *string `type:"string"` +} + +// String returns the string representation +func (s LoadBalancerAddress) String() string { + return awsutil.Prettify(s) +} + +// Information about a load balancer attribute. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/LoadBalancerAttribute +type LoadBalancerAttribute struct { + _ struct{} `type:"structure"` + + // The name of the attribute. + // + // The following attributes are supported by both Application Load Balancers + // and Network Load Balancers: + // + // * access_logs.s3.enabled - Indicates whether access logs are enabled. + // The value is true or false. The default is false. + // + // * access_logs.s3.bucket - The name of the S3 bucket for the access logs. + // This attribute is required if access logs are enabled. The bucket must + // exist in the same region as the load balancer and have a bucket policy + // that grants Elastic Load Balancing permissions to write to the bucket. + // + // * access_logs.s3.prefix - The prefix for the location in the S3 bucket + // for the access logs. + // + // * deletion_protection.enabled - Indicates whether deletion protection + // is enabled. The value is true or false. The default is false. + // + // The following attributes are supported by only Application Load Balancers: + // + // * idle_timeout.timeout_seconds - The idle timeout value, in seconds. The + // valid range is 1-4000 seconds. The default is 60 seconds. + // + // * routing.http2.enabled - Indicates whether HTTP/2 is enabled. The value + // is true or false. The default is true. + // + // The following attributes are supported by only Network Load Balancers: + // + // * load_balancing.cross_zone.enabled - Indicates whether cross-zone load + // balancing is enabled. The value is true or false. The default is false. + Key *string `type:"string"` + + // The value of the attribute. + Value *string `type:"string"` +} + +// String returns the string representation +func (s LoadBalancerAttribute) String() string { + return awsutil.Prettify(s) +} + +// Information about the state of the load balancer. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/LoadBalancerState +type LoadBalancerState struct { + _ struct{} `type:"structure"` + + // The state code. The initial state of the load balancer is provisioning. After + // the load balancer is fully set up and ready to route traffic, its state is + // active. If the load balancer could not be set up, its state is failed. + Code LoadBalancerStateEnum `type:"string" enum:"true"` + + // A description of the state. + Reason *string `type:"string"` +} + +// String returns the string representation +func (s LoadBalancerState) String() string { + return awsutil.Prettify(s) +} + +// Information to use when checking for a successful response from a target. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/Matcher +type Matcher struct { + _ struct{} `type:"structure"` + + // The HTTP codes. + // + // For Application Load Balancers, you can specify values between 200 and 499, + // and the default value is 200. You can specify multiple values (for example, + // "200,202") or a range of values (for example, "200-299"). + // + // For Network Load Balancers, this is 200–399. + // + // HttpCode is a required field + HttpCode *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s Matcher) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Matcher) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "Matcher"} + + if s.HttpCode == nil { + invalidParams.Add(aws.NewErrParamRequired("HttpCode")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/PathPatternConditionConfig +type PathPatternConditionConfig struct { + _ struct{} `type:"structure"` + + Values []string `type:"list"` +} + +// String returns the string representation +func (s PathPatternConditionConfig) String() string { + return awsutil.Prettify(s) +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/QueryStringConditionConfig +type QueryStringConditionConfig struct { + _ struct{} `type:"structure"` + + Values []QueryStringKeyValuePair `type:"list"` +} + +// String returns the string representation +func (s QueryStringConditionConfig) String() string { + return awsutil.Prettify(s) +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/QueryStringKeyValuePair +type QueryStringKeyValuePair struct { + _ struct{} `type:"structure"` + + Key *string `type:"string"` + + Value *string `type:"string"` +} + +// String returns the string representation +func (s QueryStringKeyValuePair) String() string { + return awsutil.Prettify(s) +} + +// Information about a redirect action. +// +// A URI consists of the following components: protocol://hostname:port/path?query. +// You must modify at least one of the following components to avoid a redirect +// loop: protocol, hostname, port, or path. Any components that you do not modify +// retain their original values. +// +// You can reuse URI components using the following reserved keywords: +// +// * #{protocol} +// +// * #{host} +// +// * #{port} +// +// * #{path} (the leading "/" is removed) +// +// * #{query} +// +// For example, you can change the path to "/new/#{path}", the hostname to "example.#{host}", +// or the query to "#{query}&value=xyz". +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RedirectActionConfig +type RedirectActionConfig struct { + _ struct{} `type:"structure"` + + // The hostname. This component is not percent-encoded. The hostname can contain + // #{host}. + Host *string `min:"1" type:"string"` + + // The absolute path, starting with the leading "/". This component is not percent-encoded. + // The path can contain #{host}, #{path}, and #{port}. + Path *string `min:"1" type:"string"` + + // The port. You can specify a value from 1 to 65535 or #{port}. + Port *string `type:"string"` + + // The protocol. You can specify HTTP, HTTPS, or #{protocol}. You can redirect + // HTTP to HTTP, HTTP to HTTPS, and HTTPS to HTTPS. You cannot redirect HTTPS + // to HTTP. + Protocol *string `type:"string"` + + // The query parameters, URL-encoded when necessary, but not percent-encoded. + // Do not include the leading "?", as it is automatically added. You can specify + // any of the reserved keywords. + Query *string `type:"string"` + + // The HTTP redirect code. The redirect is either permanent (HTTP 301) or temporary + // (HTTP 302). + // + // StatusCode is a required field + StatusCode RedirectActionStatusCodeEnum `type:"string" required:"true" enum:"true"` +} + +// String returns the string representation +func (s RedirectActionConfig) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RedirectActionConfig) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "RedirectActionConfig"} + if s.Host != nil && len(*s.Host) < 1 { + invalidParams.Add(aws.NewErrParamMinLen("Host", 1)) + } + if s.Path != nil && len(*s.Path) < 1 { + invalidParams.Add(aws.NewErrParamMinLen("Path", 1)) + } + if len(s.StatusCode) == 0 { + invalidParams.Add(aws.NewErrParamRequired("StatusCode")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Information about a rule. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/Rule +type Rule struct { + _ struct{} `type:"structure"` + + // The actions. + Actions []Action `type:"list"` + + // The conditions. + Conditions []RuleCondition `type:"list"` + + // Indicates whether this is the default rule. + IsDefault *bool `type:"boolean"` + + // The priority. + Priority *string `type:"string"` + + // The Amazon Resource Name (ARN) of the rule. + RuleArn *string `type:"string"` +} + +// String returns the string representation +func (s Rule) String() string { + return awsutil.Prettify(s) +} + +// Information about a condition for a rule. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RuleCondition +type RuleCondition struct { + _ struct{} `type:"structure"` + + // The name of the field. The possible values are host-header and path-pattern. + Field *string `type:"string"` + + HostHeaderConfig *HostHeaderConditionConfig `type:"structure"` + + HttpHeaderConfig *HttpHeaderConditionConfig `type:"structure"` + + HttpRequestMethodConfig *HttpRequestMethodConditionConfig `type:"structure"` + + PathPatternConfig *PathPatternConditionConfig `type:"structure"` + + QueryStringConfig *QueryStringConditionConfig `type:"structure"` + + SourceIpConfig *SourceIpConditionConfig `type:"structure"` + + // The condition value. + // + // If the field name is host-header, you can specify a single host name (for + // example, my.example.com). A host name is case insensitive, can be up to 128 + // characters in length, and can contain any of the following characters. You + // can include up to three wildcard characters. + // + // * A-Z, a-z, 0-9 + // + // * - . + // + // * * (matches 0 or more characters) + // + // * ? (matches exactly 1 character) + // + // If the field name is path-pattern, you can specify a single path pattern + // (for example, /img/*). A path pattern is case-sensitive, can be up to 128 + // characters in length, and can contain any of the following characters. You + // can include up to three wildcard characters. + // + // * A-Z, a-z, 0-9 + // + // * _ - . $ / ~ " ' @ : + + // + // * & (using &) + // + // * * (matches 0 or more characters) + // + // * ? (matches exactly 1 character) + Values []string `type:"list"` +} + +// String returns the string representation +func (s RuleCondition) String() string { + return awsutil.Prettify(s) +} + +// Information about the priorities for the rules for a listener. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/RulePriorityPair +type RulePriorityPair struct { + _ struct{} `type:"structure"` + + // The rule priority. + Priority *int64 `min:"1" type:"integer"` + + // The Amazon Resource Name (ARN) of the rule. + RuleArn *string `type:"string"` +} + +// String returns the string representation +func (s RulePriorityPair) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RulePriorityPair) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "RulePriorityPair"} + if s.Priority != nil && *s.Priority < 1 { + invalidParams.Add(aws.NewErrParamMinValue("Priority", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SourceIpConditionConfig +type SourceIpConditionConfig struct { + _ struct{} `type:"structure"` + + Values []string `type:"list"` +} + +// String returns the string representation +func (s SourceIpConditionConfig) String() string { + return awsutil.Prettify(s) +} + +// Information about a policy used for SSL negotiation. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SslPolicy +type SslPolicy struct { + _ struct{} `type:"structure"` + + // The ciphers. + Ciphers []Cipher `type:"list"` + + // The name of the policy. + Name *string `type:"string"` + + // The protocols. + SslProtocols []string `type:"list"` +} + +// String returns the string representation +func (s SslPolicy) String() string { + return awsutil.Prettify(s) +} + +// Information about a subnet mapping. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SubnetMapping +type SubnetMapping struct { + _ struct{} `type:"structure"` + + // [Network Load Balancers] The allocation ID of the Elastic IP address. + AllocationId *string `type:"string"` + + // The ID of the subnet. + SubnetId *string `type:"string"` +} + +// String returns the string representation +func (s SubnetMapping) String() string { + return awsutil.Prettify(s) +} + +// Information about a tag. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/Tag +type Tag struct { + _ struct{} `type:"structure"` + + // The key of the tag. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // The value of the tag. + Value *string `type:"string"` +} + +// String returns the string representation +func (s Tag) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Tag) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "Tag"} + + if s.Key == nil { + invalidParams.Add(aws.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(aws.NewErrParamMinLen("Key", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The tags associated with a resource. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/TagDescription +type TagDescription struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + ResourceArn *string `type:"string"` + + // Information about the tags. + Tags []Tag `min:"1" type:"list"` +} + +// String returns the string representation +func (s TagDescription) String() string { + return awsutil.Prettify(s) +} + +// Information about a target. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/TargetDescription +type TargetDescription struct { + _ struct{} `type:"structure"` + + // An Availability Zone or all. This determines whether the target receives + // traffic from the load balancer nodes in the specified Availability Zone or + // from all enabled Availability Zones for the load balancer. + // + // This parameter is not supported if the target type of the target group is + // instance. + // + // If the target type is ip and the IP address is in a subnet of the VPC for + // the target group, the Availability Zone is automatically detected and this + // parameter is optional. If the IP address is outside the VPC, this parameter + // is required. + // + // With an Application Load Balancer, if the target type is ip and the IP address + // is outside the VPC for the target group, the only supported value is all. + // + // If the target type is lambda, this parameter is optional and the only supported + // value is all. + AvailabilityZone *string `type:"string"` + + // The ID of the target. If the target type of the target group is instance, + // specify an instance ID. If the target type is ip, specify an IP address. + // If the target type is lambda, specify the ARN of the Lambda function. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // The port on which the target is listening. + Port *int64 `min:"1" type:"integer"` +} + +// String returns the string representation +func (s TargetDescription) String() string { + return awsutil.Prettify(s) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TargetDescription) Validate() error { + invalidParams := aws.ErrInvalidParams{Context: "TargetDescription"} + + if s.Id == nil { + invalidParams.Add(aws.NewErrParamRequired("Id")) + } + if s.Port != nil && *s.Port < 1 { + invalidParams.Add(aws.NewErrParamMinValue("Port", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Information about a target group. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/TargetGroup +type TargetGroup struct { + _ struct{} `type:"structure"` + + // Indicates whether health checks are enabled. + HealthCheckEnabled *bool `type:"boolean"` + + // The approximate amount of time, in seconds, between health checks of an individual + // target. + HealthCheckIntervalSeconds *int64 `min:"5" type:"integer"` + + // The destination for the health check request. + HealthCheckPath *string `min:"1" type:"string"` + + // The port to use to connect with the target. + HealthCheckPort *string `type:"string"` + + // The protocol to use to connect with the target. + HealthCheckProtocol ProtocolEnum `type:"string" enum:"true"` + + // The amount of time, in seconds, during which no response means a failed health + // check. + HealthCheckTimeoutSeconds *int64 `min:"2" type:"integer"` + + // The number of consecutive health checks successes required before considering + // an unhealthy target healthy. + HealthyThresholdCount *int64 `min:"2" type:"integer"` + + // The Amazon Resource Names (ARN) of the load balancers that route traffic + // to this target group. + LoadBalancerArns []string `type:"list"` + + // The HTTP codes to use when checking for a successful response from a target. + Matcher *Matcher `type:"structure"` + + // The port on which the targets are listening. + Port *int64 `min:"1" type:"integer"` + + // The protocol to use for routing traffic to the targets. + Protocol ProtocolEnum `type:"string" enum:"true"` + + // The Amazon Resource Name (ARN) of the target group. + TargetGroupArn *string `type:"string"` + + // The name of the target group. + TargetGroupName *string `type:"string"` + + // The type of target that you must specify when registering targets with this + // target group. The possible values are instance (targets are specified by + // instance ID) or ip (targets are specified by IP address). + TargetType TargetTypeEnum `type:"string" enum:"true"` + + // The number of consecutive health check failures required before considering + // the target unhealthy. + UnhealthyThresholdCount *int64 `min:"2" type:"integer"` + + // The ID of the VPC for the targets. + VpcId *string `type:"string"` +} + +// String returns the string representation +func (s TargetGroup) String() string { + return awsutil.Prettify(s) +} + +// Information about a target group attribute. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/TargetGroupAttribute +type TargetGroupAttribute struct { + _ struct{} `type:"structure"` + + // The name of the attribute. + // + // The following attribute is supported by both Application Load Balancers and + // Network Load Balancers: + // + // * deregistration_delay.timeout_seconds - The amount of time, in seconds, + // for Elastic Load Balancing to wait before changing the state of a deregistering + // target from draining to unused. The range is 0-3600 seconds. The default + // value is 300 seconds. If the target is a Lambda function, this attribute + // is not supported. + // + // The following attributes are supported by Application Load Balancers if the + // target is not a Lambda function: + // + // * slow_start.duration_seconds - The time period, in seconds, during which + // a newly registered target receives a linearly increasing share of the + // traffic to the target group. After this time period ends, the target receives + // its full share of traffic. The range is 30-900 seconds (15 minutes). Slow + // start mode is disabled by default. + // + // * stickiness.enabled - Indicates whether sticky sessions are enabled. + // The value is true or false. The default is false. + // + // * stickiness.type - The type of sticky sessions. The possible value is + // lb_cookie. + // + // * stickiness.lb_cookie.duration_seconds - The time period, in seconds, + // during which requests from a client should be routed to the same target. + // After this time period expires, the load balancer-generated cookie is + // considered stale. The range is 1 second to 1 week (604800 seconds). The + // default value is 1 day (86400 seconds). + // + // The following attribute is supported only if the target is a Lambda function. + // + // * lambda.multi_value_headers.enabled - Indicates whether the request and + // response headers exchanged between the load balancer and the Lambda function + // include arrays of values or strings. The value is true or false. The default + // is false. If the value is false and the request contains a duplicate header + // field name or query parameter key, the load balancer uses the last value + // sent by the client. + // + // The following attribute is supported only by Network Load Balancers: + // + // * proxy_protocol_v2.enabled - Indicates whether Proxy Protocol version + // 2 is enabled. The value is true or false. The default is false. + Key *string `type:"string"` + + // The value of the attribute. + Value *string `type:"string"` +} + +// String returns the string representation +func (s TargetGroupAttribute) String() string { + return awsutil.Prettify(s) +} + +// Information about the current health of a target. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/TargetHealth +type TargetHealth struct { + _ struct{} `type:"structure"` + + // A description of the target health that provides additional details. If the + // state is healthy, a description is not provided. + Description *string `type:"string"` + + // The reason code. + // + // If the target state is healthy, a reason code is not provided. + // + // If the target state is initial, the reason code can be one of the following + // values: + // + // * Elb.RegistrationInProgress - The target is in the process of being registered + // with the load balancer. + // + // * Elb.InitialHealthChecking - The load balancer is still sending the target + // the minimum number of health checks required to determine its health status. + // + // If the target state is unhealthy, the reason code can be one of the following + // values: + // + // * Target.ResponseCodeMismatch - The health checks did not return an expected + // HTTP code. + // + // * Target.Timeout - The health check requests timed out. + // + // * Target.FailedHealthChecks - The health checks failed because the connection + // to the target timed out, the target response was malformed, or the target + // failed the health check for an unknown reason. + // + // * Elb.InternalError - The health checks failed due to an internal error. + // + // If the target state is unused, the reason code can be one of the following + // values: + // + // * Target.NotRegistered - The target is not registered with the target + // group. + // + // * Target.NotInUse - The target group is not used by any load balancer + // or the target is in an Availability Zone that is not enabled for its load + // balancer. + // + // * Target.IpUnusable - The target IP address is reserved for use by a load + // balancer. + // + // * Target.InvalidState - The target is in the stopped or terminated state. + // + // If the target state is draining, the reason code can be the following value: + // + // * Target.DeregistrationInProgress - The target is in the process of being + // deregistered and the deregistration delay period has not expired. + // + // If the target state is unavailable, the reason code can be the following + // value: + // + // * Target.HealthCheckDisabled - Health checks are disabled for the target + // group. + Reason TargetHealthReasonEnum `type:"string" enum:"true"` + + // The state of the target. + State TargetHealthStateEnum `type:"string" enum:"true"` +} + +// String returns the string representation +func (s TargetHealth) String() string { + return awsutil.Prettify(s) +} + +// Information about the health of a target. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/TargetHealthDescription +type TargetHealthDescription struct { + _ struct{} `type:"structure"` + + // The port to use to connect with the target. + HealthCheckPort *string `type:"string"` + + // The description of the target. + Target *TargetDescription `type:"structure"` + + // The health information for the target. + TargetHealth *TargetHealth `type:"structure"` +} + +// String returns the string representation +func (s TargetHealthDescription) String() string { + return awsutil.Prettify(s) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_waiters.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_waiters.go new file mode 100644 index 000000000000..e30e2df0abe0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/api_waiters.go @@ -0,0 +1,235 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" +) + +// WaitUntilLoadBalancerAvailable uses the Elastic Load Balancing v2 API operation +// DescribeLoadBalancers to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +// +// 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 *Client) WaitUntilLoadBalancerAvailable(ctx context.Context, input *DescribeLoadBalancersInput, opts ...aws.WaiterOption) error { + w := aws.Waiter{ + Name: "WaitUntilLoadBalancerAvailable", + MaxAttempts: 40, + Delay: aws.ConstantWaiterDelay(15 * time.Second), + Acceptors: []aws.WaiterAcceptor{ + { + State: aws.SuccessWaiterState, + Matcher: aws.PathAllWaiterMatch, Argument: "LoadBalancers[].State.Code", + Expected: "active", + }, + { + State: aws.RetryWaiterState, + Matcher: aws.PathAnyWaiterMatch, Argument: "LoadBalancers[].State.Code", + Expected: "provisioning", + }, + { + State: aws.RetryWaiterState, + Matcher: aws.ErrorWaiterMatch, + Expected: "LoadBalancerNotFound", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []aws.Option) (*aws.Request, error) { + var inCpy *DescribeLoadBalancersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req := c.DescribeLoadBalancersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req.Request, nil + }, + } + w.ApplyOptions(opts...) + + return w.Wait(ctx) +} + +// WaitUntilLoadBalancerExists uses the Elastic Load Balancing v2 API operation +// DescribeLoadBalancers to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +// +// 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 *Client) WaitUntilLoadBalancerExists(ctx context.Context, input *DescribeLoadBalancersInput, opts ...aws.WaiterOption) error { + w := aws.Waiter{ + Name: "WaitUntilLoadBalancerExists", + MaxAttempts: 40, + Delay: aws.ConstantWaiterDelay(15 * time.Second), + Acceptors: []aws.WaiterAcceptor{ + { + State: aws.SuccessWaiterState, + Matcher: aws.StatusWaiterMatch, + Expected: 200, + }, + { + State: aws.RetryWaiterState, + Matcher: aws.ErrorWaiterMatch, + Expected: "LoadBalancerNotFound", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []aws.Option) (*aws.Request, error) { + var inCpy *DescribeLoadBalancersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req := c.DescribeLoadBalancersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req.Request, nil + }, + } + w.ApplyOptions(opts...) + + return w.Wait(ctx) +} + +// WaitUntilLoadBalancersDeleted uses the Elastic Load Balancing v2 API operation +// DescribeLoadBalancers to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +// +// 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 *Client) WaitUntilLoadBalancersDeleted(ctx context.Context, input *DescribeLoadBalancersInput, opts ...aws.WaiterOption) error { + w := aws.Waiter{ + Name: "WaitUntilLoadBalancersDeleted", + MaxAttempts: 40, + Delay: aws.ConstantWaiterDelay(15 * time.Second), + Acceptors: []aws.WaiterAcceptor{ + { + State: aws.RetryWaiterState, + Matcher: aws.PathAllWaiterMatch, Argument: "LoadBalancers[].State.Code", + Expected: "active", + }, + { + State: aws.SuccessWaiterState, + Matcher: aws.ErrorWaiterMatch, + Expected: "LoadBalancerNotFound", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []aws.Option) (*aws.Request, error) { + var inCpy *DescribeLoadBalancersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req := c.DescribeLoadBalancersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req.Request, nil + }, + } + w.ApplyOptions(opts...) + + return w.Wait(ctx) +} + +// WaitUntilTargetDeregistered uses the Elastic Load Balancing v2 API operation +// DescribeTargetHealth to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +// +// 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 *Client) WaitUntilTargetDeregistered(ctx context.Context, input *DescribeTargetHealthInput, opts ...aws.WaiterOption) error { + w := aws.Waiter{ + Name: "WaitUntilTargetDeregistered", + MaxAttempts: 40, + Delay: aws.ConstantWaiterDelay(15 * time.Second), + Acceptors: []aws.WaiterAcceptor{ + { + State: aws.SuccessWaiterState, + Matcher: aws.ErrorWaiterMatch, + Expected: "InvalidTarget", + }, + { + State: aws.SuccessWaiterState, + Matcher: aws.PathAllWaiterMatch, Argument: "TargetHealthDescriptions[].TargetHealth.State", + Expected: "unused", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []aws.Option) (*aws.Request, error) { + var inCpy *DescribeTargetHealthInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req := c.DescribeTargetHealthRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req.Request, nil + }, + } + w.ApplyOptions(opts...) + + return w.Wait(ctx) +} + +// WaitUntilTargetInService uses the Elastic Load Balancing v2 API operation +// DescribeTargetHealth to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +// +// 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 *Client) WaitUntilTargetInService(ctx context.Context, input *DescribeTargetHealthInput, opts ...aws.WaiterOption) error { + w := aws.Waiter{ + Name: "WaitUntilTargetInService", + MaxAttempts: 40, + Delay: aws.ConstantWaiterDelay(15 * time.Second), + Acceptors: []aws.WaiterAcceptor{ + { + State: aws.SuccessWaiterState, + Matcher: aws.PathAllWaiterMatch, Argument: "TargetHealthDescriptions[].TargetHealth.State", + Expected: "healthy", + }, + { + State: aws.RetryWaiterState, + Matcher: aws.ErrorWaiterMatch, + Expected: "InvalidInstance", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []aws.Option) (*aws.Request, error) { + var inCpy *DescribeTargetHealthInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req := c.DescribeTargetHealthRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req.Request, nil + }, + } + w.ApplyOptions(opts...) + + return w.Wait(ctx) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/elasticloadbalancingv2iface/interface.go b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/elasticloadbalancingv2iface/interface.go new file mode 100644 index 000000000000..0c8957344264 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/elasticloadbalancingv2iface/interface.go @@ -0,0 +1,146 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package elasticloadbalancingv2iface provides an interface to enable mocking the Elastic Load Balancing service client +// for testing your code. +// +// It is important to note that this interface will have breaking changes +// when the service model is updated and adds new API operations, paginators, +// and waiters. +package elasticloadbalancingv2iface + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" +) + +// ClientAPI provides an interface to enable mocking the +// elasticloadbalancingv2.Client methods. This make unit testing your code that +// calls out to the SDK's service client's calls easier. +// +// The best way to use this interface is so the SDK's service client's calls +// can be stubbed out for unit testing your code with the SDK without needing +// to inject custom request handlers into the SDK's request pipeline. +// +// // myFunc uses an SDK service client to make a request to +// // Elastic Load Balancing v2. +// func myFunc(svc elasticloadbalancingv2iface.ClientAPI) bool { +// // Make svc.AddListenerCertificates request +// } +// +// func main() { +// cfg, err := external.LoadDefaultAWSConfig() +// if err != nil { +// panic("failed to load config, " + err.Error()) +// } +// +// svc := elasticloadbalancingv2.New(cfg) +// +// myFunc(svc) +// } +// +// In your _test.go file: +// +// // Define a mock struct to be used in your unit tests of myFunc. +// type mockClientClient struct { +// elasticloadbalancingv2iface.ClientPI +// } +// func (m *mockClientClient) AddListenerCertificates(input *elasticloadbalancingv2.AddListenerCertificatesInput) (*elasticloadbalancingv2.AddListenerCertificatesOutput, error) { +// // mock response/functionality +// } +// +// func TestMyFunc(t *testing.T) { +// // Setup Test +// mockSvc := &mockClientClient{} +// +// myfunc(mockSvc) +// +// // Verify myFunc's functionality +// } +// +// It is important to note that this interface will have breaking changes +// when the service model is updated and adds new API operations, paginators, +// and waiters. Its suggested to use the pattern above for testing, or using +// tooling to generate mocks to satisfy the interfaces. +type ClientAPI interface { + AddListenerCertificatesRequest(*elasticloadbalancingv2.AddListenerCertificatesInput) elasticloadbalancingv2.AddListenerCertificatesRequest + + AddTagsRequest(*elasticloadbalancingv2.AddTagsInput) elasticloadbalancingv2.AddTagsRequest + + CreateListenerRequest(*elasticloadbalancingv2.CreateListenerInput) elasticloadbalancingv2.CreateListenerRequest + + CreateLoadBalancerRequest(*elasticloadbalancingv2.CreateLoadBalancerInput) elasticloadbalancingv2.CreateLoadBalancerRequest + + CreateRuleRequest(*elasticloadbalancingv2.CreateRuleInput) elasticloadbalancingv2.CreateRuleRequest + + CreateTargetGroupRequest(*elasticloadbalancingv2.CreateTargetGroupInput) elasticloadbalancingv2.CreateTargetGroupRequest + + DeleteListenerRequest(*elasticloadbalancingv2.DeleteListenerInput) elasticloadbalancingv2.DeleteListenerRequest + + DeleteLoadBalancerRequest(*elasticloadbalancingv2.DeleteLoadBalancerInput) elasticloadbalancingv2.DeleteLoadBalancerRequest + + DeleteRuleRequest(*elasticloadbalancingv2.DeleteRuleInput) elasticloadbalancingv2.DeleteRuleRequest + + DeleteTargetGroupRequest(*elasticloadbalancingv2.DeleteTargetGroupInput) elasticloadbalancingv2.DeleteTargetGroupRequest + + DeregisterTargetsRequest(*elasticloadbalancingv2.DeregisterTargetsInput) elasticloadbalancingv2.DeregisterTargetsRequest + + DescribeAccountLimitsRequest(*elasticloadbalancingv2.DescribeAccountLimitsInput) elasticloadbalancingv2.DescribeAccountLimitsRequest + + DescribeListenerCertificatesRequest(*elasticloadbalancingv2.DescribeListenerCertificatesInput) elasticloadbalancingv2.DescribeListenerCertificatesRequest + + DescribeListenersRequest(*elasticloadbalancingv2.DescribeListenersInput) elasticloadbalancingv2.DescribeListenersRequest + + DescribeLoadBalancerAttributesRequest(*elasticloadbalancingv2.DescribeLoadBalancerAttributesInput) elasticloadbalancingv2.DescribeLoadBalancerAttributesRequest + + DescribeLoadBalancersRequest(*elasticloadbalancingv2.DescribeLoadBalancersInput) elasticloadbalancingv2.DescribeLoadBalancersRequest + + DescribeRulesRequest(*elasticloadbalancingv2.DescribeRulesInput) elasticloadbalancingv2.DescribeRulesRequest + + DescribeSSLPoliciesRequest(*elasticloadbalancingv2.DescribeSSLPoliciesInput) elasticloadbalancingv2.DescribeSSLPoliciesRequest + + DescribeTagsRequest(*elasticloadbalancingv2.DescribeTagsInput) elasticloadbalancingv2.DescribeTagsRequest + + DescribeTargetGroupAttributesRequest(*elasticloadbalancingv2.DescribeTargetGroupAttributesInput) elasticloadbalancingv2.DescribeTargetGroupAttributesRequest + + DescribeTargetGroupsRequest(*elasticloadbalancingv2.DescribeTargetGroupsInput) elasticloadbalancingv2.DescribeTargetGroupsRequest + + DescribeTargetHealthRequest(*elasticloadbalancingv2.DescribeTargetHealthInput) elasticloadbalancingv2.DescribeTargetHealthRequest + + ModifyListenerRequest(*elasticloadbalancingv2.ModifyListenerInput) elasticloadbalancingv2.ModifyListenerRequest + + ModifyLoadBalancerAttributesRequest(*elasticloadbalancingv2.ModifyLoadBalancerAttributesInput) elasticloadbalancingv2.ModifyLoadBalancerAttributesRequest + + ModifyRuleRequest(*elasticloadbalancingv2.ModifyRuleInput) elasticloadbalancingv2.ModifyRuleRequest + + ModifyTargetGroupRequest(*elasticloadbalancingv2.ModifyTargetGroupInput) elasticloadbalancingv2.ModifyTargetGroupRequest + + ModifyTargetGroupAttributesRequest(*elasticloadbalancingv2.ModifyTargetGroupAttributesInput) elasticloadbalancingv2.ModifyTargetGroupAttributesRequest + + RegisterTargetsRequest(*elasticloadbalancingv2.RegisterTargetsInput) elasticloadbalancingv2.RegisterTargetsRequest + + RemoveListenerCertificatesRequest(*elasticloadbalancingv2.RemoveListenerCertificatesInput) elasticloadbalancingv2.RemoveListenerCertificatesRequest + + RemoveTagsRequest(*elasticloadbalancingv2.RemoveTagsInput) elasticloadbalancingv2.RemoveTagsRequest + + SetIpAddressTypeRequest(*elasticloadbalancingv2.SetIpAddressTypeInput) elasticloadbalancingv2.SetIpAddressTypeRequest + + SetRulePrioritiesRequest(*elasticloadbalancingv2.SetRulePrioritiesInput) elasticloadbalancingv2.SetRulePrioritiesRequest + + SetSecurityGroupsRequest(*elasticloadbalancingv2.SetSecurityGroupsInput) elasticloadbalancingv2.SetSecurityGroupsRequest + + SetSubnetsRequest(*elasticloadbalancingv2.SetSubnetsInput) elasticloadbalancingv2.SetSubnetsRequest + + WaitUntilLoadBalancerAvailable(context.Context, *elasticloadbalancingv2.DescribeLoadBalancersInput, ...aws.WaiterOption) error + + WaitUntilLoadBalancerExists(context.Context, *elasticloadbalancingv2.DescribeLoadBalancersInput, ...aws.WaiterOption) error + + WaitUntilLoadBalancersDeleted(context.Context, *elasticloadbalancingv2.DescribeLoadBalancersInput, ...aws.WaiterOption) error + + WaitUntilTargetDeregistered(context.Context, *elasticloadbalancingv2.DescribeTargetHealthInput, ...aws.WaiterOption) error + + WaitUntilTargetInService(context.Context, *elasticloadbalancingv2.DescribeTargetHealthInput, ...aws.WaiterOption) error +} + +var _ ClientAPI = (*elasticloadbalancingv2.Client)(nil) diff --git a/vendor/github.com/docker/go-connections/tlsconfig/certpool_other.go b/vendor/github.com/docker/go-connections/tlsconfig/certpool_other.go index 9ca974539a77..1ff81c333c36 100644 --- a/vendor/github.com/docker/go-connections/tlsconfig/certpool_other.go +++ b/vendor/github.com/docker/go-connections/tlsconfig/certpool_other.go @@ -4,7 +4,6 @@ package tlsconfig import ( "crypto/x509" - ) // SystemCertPool returns an new empty cert pool, diff --git a/vendor/github.com/dop251/goja/parser/lexer.go b/vendor/github.com/dop251/goja/parser/lexer.go index 771822271c7c..0626b007c343 100644 --- a/vendor/github.com/dop251/goja/parser/lexer.go +++ b/vendor/github.com/dop251/goja/parser/lexer.go @@ -631,7 +631,7 @@ func parseStringLiteral(literal string) (string, error) { str := literal buffer := bytes.NewBuffer(make([]byte, 0, 3*len(literal)/2)) var surrogate rune - S: +S: for len(str) > 0 { switch chr := str[0]; { // We do not explicitly handle the case of the quote diff --git a/vendor/github.com/dop251/goja/parser/parser.go b/vendor/github.com/dop251/goja/parser/parser.go index d108e2565335..20f86c9c6c0d 100644 --- a/vendor/github.com/dop251/goja/parser/parser.go +++ b/vendor/github.com/dop251/goja/parser/parser.go @@ -52,9 +52,9 @@ const ( ) type _parser struct { - str string - length int - base int + str string + length int + base int chr rune // The current character chrOffset int // The offset of current character diff --git a/vendor/github.com/dop251/goja/parser/regexp.go b/vendor/github.com/dop251/goja/parser/regexp.go index 3244858cf62d..8ceaf8fe9e14 100644 --- a/vendor/github.com/dop251/goja/parser/regexp.go +++ b/vendor/github.com/dop251/goja/parser/regexp.go @@ -144,7 +144,6 @@ func (self *_RegExp_parser) scanBracket() { return } - self.pass() for self.chr != -1 { if self.chr == ']' { diff --git a/vendor/github.com/dop251/goja/parser/statement.go b/vendor/github.com/dop251/goja/parser/statement.go index cd513357c958..7ac0ac59d40b 100644 --- a/vendor/github.com/dop251/goja/parser/statement.go +++ b/vendor/github.com/dop251/goja/parser/statement.go @@ -1,15 +1,15 @@ package parser import ( + "encoding/base64" "github.com/dop251/goja/ast" "github.com/dop251/goja/file" "github.com/dop251/goja/token" "github.com/go-sourcemap/sourcemap" - "encoding/base64" - "strings" - "os" "io/ioutil" "net/url" + "os" + "strings" ) func (self *_parser) parseBlockStatement() *ast.BlockStatement { @@ -558,7 +558,7 @@ func (self *_parser) parseProgram() *ast.Program { } func (self *_parser) parseSourceMap() *sourcemap.Consumer { - lastLine := self.str[strings.LastIndexByte(self.str, '\n') + 1:] + lastLine := self.str[strings.LastIndexByte(self.str, '\n')+1:] if strings.HasPrefix(lastLine, "//# sourceMappingURL") { urlIndex := strings.Index(lastLine, "=") urlStr := lastLine[urlIndex+1:] diff --git a/vendor/github.com/sirupsen/logrus/terminal/terminal_check_bsd.go b/vendor/github.com/sirupsen/logrus/terminal/terminal_check_bsd.go index 6a47df6d48af..b6c7415c80ef 100644 --- a/vendor/github.com/sirupsen/logrus/terminal/terminal_check_bsd.go +++ b/vendor/github.com/sirupsen/logrus/terminal/terminal_check_bsd.go @@ -10,4 +10,3 @@ func IsTerminal(fd int) bool { _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) return err == nil } - diff --git a/vendor/github.com/sirupsen/logrus/terminal/terminal_check_unix.go b/vendor/github.com/sirupsen/logrus/terminal/terminal_check_unix.go index f30ea8784b98..1c4aa519445a 100644 --- a/vendor/github.com/sirupsen/logrus/terminal/terminal_check_unix.go +++ b/vendor/github.com/sirupsen/logrus/terminal/terminal_check_unix.go @@ -10,4 +10,3 @@ func IsTerminal(fd int) bool { _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) return err == nil } - diff --git a/x-pack/libbeat/autodiscover/providers/aws/aws.go b/x-pack/libbeat/autodiscover/providers/aws/aws.go new file mode 100644 index 000000000000..34e92c6addbc --- /dev/null +++ b/x-pack/libbeat/autodiscover/providers/aws/aws.go @@ -0,0 +1,5 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package aws diff --git a/x-pack/libbeat/autodiscover/providers/aws/elb/_meta/fields.yml b/x-pack/libbeat/autodiscover/providers/aws/elb/_meta/fields.yml new file mode 100644 index 000000000000..70759d53b3a3 --- /dev/null +++ b/x-pack/libbeat/autodiscover/providers/aws/elb/_meta/fields.yml @@ -0,0 +1,70 @@ +- key: elb_listener + title: "ELB Listener" + description: > + AWS ELB Listeners + short_config: false + release: experimental + fields: + - name: elb_listener + type: group + description: > + Represents an AWS ELB Listener, e.g. a port on an ELB. + fields: + - name: ip_address_type + type: keyword + required: true + example: "ipv4" + description: Whether this is an ipv4 or dual-stack IP + - name: state + type: keyword + example: active + description: Current state of the ELB + - name: type + type: keyword + example: application + description: Whether this is an application or network loadbalancer + - name: protocol + type: keyword + example: HTTP + description: The application layer protocol + - name: vpc_id + type: keyword + example: vpc-123456 + description: ID of the VPC + - name: ssl_policy + type: keyword + description: The specific SSL policy + - name: load_balancer_arn + type: keyword + example: arn:aws:elasticloadbalancing:us-east-1:331574139922:loadbalancer/app/testytesty/a14c9934d2a6e438 + description: ARN for the ELB itself + - name: security_groups + type: keyword + example: sg-a1b555d4 + description: List of security groups for this + - name: created + type: date + example: 2019-06-12T21:55:14.490Z + description: Date of creation + - name: availability_zones + type: keyword + example: "us-east-1e" + description: List of AZs this is active in + - name: host + type: keyword + example: testytesty-141141146.us-east-1.elb.amazonaws.com + description: the hostname for this ELB + - name: listener_arn + type: keyword + example: arn:aws:elasticloadbalancing:us-east-1:334575128422:listener/app/testytesty/b74b9934c5a6e438/0e8425ad18d4d529 + description: ARN for this ELB listener + - name: scheme + type: keyword + example: internet-facing + description: whether this ELB is internet facing or internal-only + - name: port + type: number + example: 8080 + description: Port number for this listener + + diff --git a/x-pack/libbeat/autodiscover/providers/aws/elb/config.go b/x-pack/libbeat/autodiscover/providers/aws/elb/config.go new file mode 100644 index 000000000000..0eb8fb73c0c4 --- /dev/null +++ b/x-pack/libbeat/autodiscover/providers/aws/elb/config.go @@ -0,0 +1,41 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package elb + +import ( + "time" + + "github.com/elastic/beats/x-pack/libbeat/common/aws" + + "github.com/elastic/beats/libbeat/autodiscover/template" + "github.com/elastic/beats/libbeat/common" +) + +// Config for the aws_elb autodiscover provider. +type Config struct { + Type string `config:"type"` + + // Standard autodiscover fields. + + // Hints are currently not supported, but may be implemented in a later release + HintsEnabled bool `config:"hints.enabled"` + Builders []*common.Config `config:"builders"` + Appenders []*common.Config `config:"appenders"` + Templates template.MapperSettings `config:"templates"` + + // Period defines how often to poll the AWS API. + Period time.Duration `config:"period" validate:"nonzero,required"` + + // AWS Specific autodiscover fields + + Regions []string `config:"regions" validate:"required"` + AWSConfig aws.ConfigAWS `config:",inline"` +} + +func defaultConfig() *Config { + return &Config{ + Period: time.Minute, + } +} diff --git a/x-pack/libbeat/autodiscover/providers/aws/elb/fetch.go b/x-pack/libbeat/autodiscover/providers/aws/elb/fetch.go new file mode 100644 index 000000000000..1cdb8e899844 --- /dev/null +++ b/x-pack/libbeat/autodiscover/providers/aws/elb/fetch.go @@ -0,0 +1,223 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package elb + +import ( + "context" + "sync" + + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/elasticloadbalancingv2iface" + "go.uber.org/multierr" + + "github.com/elastic/beats/libbeat/logp" +) + +const logSelector = "autodiscover-elb-fetch" + +// fetcher is an interface that can fetch a list of lbListener (load balancer + listener) objects without pagination being necessary. +type fetcher interface { + fetch(ctx context.Context) ([]*lbListener, error) +} + +// apiMultiFetcher fetches results from multiple clients concatenating their results together +// Useful since we have a fetcher per region, this combines them. +type apiMultiFetcher struct { + fetchers []fetcher +} + +func (amf *apiMultiFetcher) fetch(ctx context.Context) ([]*lbListener, error) { + fetchResults := make(chan []*lbListener) + fetchErr := make(chan error) + + // Simultaneously fetch all from each region + for _, f := range amf.fetchers { + go func(f fetcher) { + fres, ferr := f.fetch(ctx) + if ferr != nil { + fetchErr <- ferr + } else { + fetchResults <- fres + } + }(f) + } + + var results []*lbListener + var errs []error + + for pending := len(amf.fetchers); pending > 0; pending-- { + select { + case r := <-fetchResults: + results = append(results, r...) + case e := <-fetchErr: + errs = append(errs, e) + } + } + + return results, multierr.Combine(errs...) +} + +// apiFetcher is a concrete implementation of fetcher that hits the real AWS API. +type apiFetcher struct { + client elasticloadbalancingv2iface.ClientAPI +} + +func newAPIFetcher(ctx context.Context, clients []elasticloadbalancingv2iface.ClientAPI) fetcher { + fetchers := make([]fetcher, len(clients)) + for idx, client := range clients { + fetchers[idx] = &apiFetcher{client} + } + return &apiMultiFetcher{fetchers} +} + +// fetch attempts to request the full list of lbListener objects. +// It accomplishes this by fetching a page of load balancers, then one go routine +// per listener API request. Each page of results has O(n)+1 perf since we need that +// additional fetch per lb. We let the goroutine scheduler sort things out, and use +// a sync.Pool to limit the number of in-flight requests. +func (f *apiFetcher) fetch(ctx context.Context) ([]*lbListener, error) { + var pageSize int64 = 50 + + req := f.client.DescribeLoadBalancersRequest(&elasticloadbalancingv2.DescribeLoadBalancersInput{PageSize: &pageSize}) + + ctx, cancel := context.WithCancel(ctx) + ir := &fetchRequest{ + paginator: elasticloadbalancingv2.NewDescribeLoadBalancersPaginator(req), + client: f.client, + taskPool: sync.Pool{}, + context: ctx, + cancel: cancel, + } + + // Limit concurrency against the AWS API by creating a pool of objects + // This is hard coded for now. The concurrency limit of 10 was set semi-arbitrarily. + for i := 0; i < 10; i++ { + ir.taskPool.Put(nil) + } + + return ir.fetch() +} + +// fetchRequest provides a way to get all pages from a +// elbv2.DescribeLoadBalancersPager and all listeners for the given LoadBalancers. +type fetchRequest struct { + paginator elasticloadbalancingv2.DescribeLoadBalancersPaginator + client elasticloadbalancingv2iface.ClientAPI + lbListeners []*lbListener + errs []error + resultsLock sync.Mutex + taskPool sync.Pool + pendingTasks sync.WaitGroup + context context.Context + cancel func() +} + +func (p *fetchRequest) fetch() ([]*lbListener, error) { + p.dispatch(p.fetchAllPages) + + // Only fetch future pages when there are no longer requests in-flight from a previous page + p.pendingTasks.Wait() + + // Acquire the results lock to ensure memory + // consistency between the last write and this read + p.resultsLock.Lock() + defer p.resultsLock.Unlock() + + // Since everything is async we have to retrieve any errors that occurred from here + if len(p.errs) > 0 { + return nil, multierr.Combine(p.errs...) + } + + return p.lbListeners, nil +} + +func (p *fetchRequest) fetchAllPages() { + // Keep fetching pages unless we're stopped OR there are no pages left + for { + select { + case <-p.context.Done(): + logp.Debug(logSelector, "done fetching ELB pages, context cancelled") + return + default: + if !p.fetchNextPage() { + logp.Debug(logSelector, "fetched all ELB pages") + return + } + logp.Debug(logSelector, "fetched ELB page") + } + } +} + +func (p *fetchRequest) fetchNextPage() (more bool) { + success := p.paginator.Next(p.context) + + if success { + for _, lb := range p.paginator.CurrentPage().LoadBalancers { + p.dispatch(func() { p.fetchListeners(lb) }) + } + } + + if p.paginator.Err() != nil { + p.recordErrResult(p.paginator.Err()) + } + + return success +} + +// dispatch runs the given func in a new goroutine, properly throttling requests +// with the taskPool and also managing the pendingTasks waitGroup to ensure all +// results are accumulated. +func (p *fetchRequest) dispatch(fn func()) { + p.pendingTasks.Add(1) + + go func() { + slot := p.taskPool.Get() + defer p.taskPool.Put(slot) + defer p.pendingTasks.Done() + + fn() + }() +} + +func (p *fetchRequest) fetchListeners(lb elasticloadbalancingv2.LoadBalancer) { + listenReq := p.client.DescribeListenersRequest(&elasticloadbalancingv2.DescribeListenersInput{LoadBalancerArn: lb.LoadBalancerArn}) + listen := elasticloadbalancingv2.NewDescribeListenersPaginator(listenReq) + + if listen.Err() != nil { + p.recordErrResult(listen.Err()) + } + + for { + select { + case <-p.context.Done(): + return + default: + if !listen.Next(p.context) { + return + } + + for _, listener := range listen.CurrentPage().Listeners { + p.recordGoodResult(&lb, &listener) + } + } + + } +} + +func (p *fetchRequest) recordGoodResult(lb *elasticloadbalancingv2.LoadBalancer, lbl *elasticloadbalancingv2.Listener) { + p.resultsLock.Lock() + defer p.resultsLock.Unlock() + + p.lbListeners = append(p.lbListeners, &lbListener{lb, lbl}) +} + +func (p *fetchRequest) recordErrResult(err error) { + p.resultsLock.Lock() + defer p.resultsLock.Unlock() + + p.errs = append(p.errs, err) + + p.cancel() +} diff --git a/x-pack/libbeat/autodiscover/providers/aws/elb/fetch_test.go b/x-pack/libbeat/autodiscover/providers/aws/elb/fetch_test.go new file mode 100644 index 000000000000..747c9738ed37 --- /dev/null +++ b/x-pack/libbeat/autodiscover/providers/aws/elb/fetch_test.go @@ -0,0 +1,19 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package elb + +import ( + "context" + "testing" + + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/elasticloadbalancingv2iface" + "github.com/stretchr/testify/require" +) + +func Test_newAPIFetcher(t *testing.T) { + client := newMockELBClient(0) + fetcher := newAPIFetcher(context.TODO(), []elasticloadbalancingv2iface.ClientAPI{client}) + require.NotNil(t, fetcher) +} diff --git a/x-pack/libbeat/autodiscover/providers/aws/elb/lblistener.go b/x-pack/libbeat/autodiscover/providers/aws/elb/lblistener.go new file mode 100644 index 000000000000..94e498677811 --- /dev/null +++ b/x-pack/libbeat/autodiscover/providers/aws/elb/lblistener.go @@ -0,0 +1,98 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package elb + +import ( + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" + + "github.com/elastic/beats/libbeat/common" +) + +// lbListener is a tuple type representing an elasticloadbalancingv2.Listener and its associated elasticloadbalancingv2.LoadBalancer. +type lbListener struct { + lb *elasticloadbalancingv2.LoadBalancer + listener *elasticloadbalancingv2.Listener +} + +// toMap converts this lbListener into the form consumed as metadata in the autodiscovery process. +func (l *lbListener) toMap() common.MapStr { + // We fully spell out listener_arn to avoid confusion with the ARN for the whole ELB + m := common.MapStr{ + "listener_arn": l.listener.ListenerArn, + "load_balancer_arn": safeStrp(l.lb.LoadBalancerArn), + "host": safeStrp(l.lb.DNSName), + "protocol": l.listener.Protocol, + "type": string(l.lb.Type), + "scheme": l.lb.Scheme, + "availability_zones": l.azStrings(), + "created": l.lb.CreatedTime, + "state": l.stateMap(), + "ip_address_type": string(l.lb.IpAddressType), + "security_groups": l.lb.SecurityGroups, + "vpc_id": safeStrp(l.lb.VpcId), + "ssl_policy": l.listener.SslPolicy, + } + + if l.listener.Port != nil { + m["port"] = *l.listener.Port + } + + return m +} + +// safeStrp makes handling AWS *string types easier. +// The AWS lib never returns plain strings, always using pointers, probably for memory efficiency reasons. +// This is a bit odd, because strings are just pointers into byte arrays, however this is the choice they've made. +// This will return the plain version of the given string or an empty string if the pointer is null +func safeStrp(strp *string) string { + if strp == nil { + return "" + } + + return *strp +} + +func (l *lbListener) toCloudMap() common.MapStr { + m := common.MapStr{} + + var azs []string + for _, az := range l.lb.AvailabilityZones { + azs = append(azs, *az.ZoneName) + } + m["availability_zone"] = azs + m["provider"] = "aws" + + // The region is just an AZ with the last character removed + firstAz := azs[0] + m["region"] = firstAz[:len(firstAz)-2] + + return m +} + +// arn returns a globally unique ID. In the case of an lbListener, that would be its listenerArn. +func (l *lbListener) arn() string { + return *l.listener.ListenerArn +} + +// azStrings transforms the weird list of availability zone string pointers to a slice of plain strings. +func (l *lbListener) azStrings() []string { + azs := l.lb.AvailabilityZones + res := make([]string, 0, len(azs)) + for _, az := range azs { + res = append(res, *az.ZoneName) + } + return res +} + +// stateMap converts the State part of the lb struct into a friendlier map with 'reason' and 'code' fields. +func (l *lbListener) stateMap() (stateMap common.MapStr) { + state := l.lb.State + stateMap = common.MapStr{} + if state.Reason != nil { + stateMap["reason"] = *state.Reason + } + stateMap["code"] = state.Code + return stateMap +} diff --git a/x-pack/libbeat/autodiscover/providers/aws/elb/mock_elb_client_test.go b/x-pack/libbeat/autodiscover/providers/aws/elb/mock_elb_client_test.go new file mode 100644 index 000000000000..aba1eefb9d11 --- /dev/null +++ b/x-pack/libbeat/autodiscover/providers/aws/elb/mock_elb_client_test.go @@ -0,0 +1,18 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package elb + +import ( + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/elasticloadbalancingv2iface" +) + +func newMockELBClient(numResults int) mockELBClient { + return mockELBClient{numResults: numResults} +} + +type mockELBClient struct { + elasticloadbalancingv2iface.ClientAPI + numResults int +} diff --git a/x-pack/libbeat/autodiscover/providers/aws/elb/mocks_test.go b/x-pack/libbeat/autodiscover/providers/aws/elb/mocks_test.go new file mode 100644 index 000000000000..8c7536c6c51f --- /dev/null +++ b/x-pack/libbeat/autodiscover/providers/aws/elb/mocks_test.go @@ -0,0 +1,82 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package elb + +import ( + "context" + "sync" + "time" + + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" +) + +// mockFetcher is a fetcher that returns a customizable list of results, useful for testing. +type mockFetcher struct { + lblListeners []*lbListener + err error + lock sync.Mutex +} + +func newMockFetcher(lbListeners []*lbListener, err error) *mockFetcher { + return &mockFetcher{lblListeners: lbListeners, err: err} +} + +func (f *mockFetcher) fetch(ctx context.Context) ([]*lbListener, error) { + f.lock.Lock() + defer f.lock.Unlock() + + result := make([]*lbListener, len(f.lblListeners)) + copy(result, f.lblListeners) + + return result, f.err +} + +func (f *mockFetcher) setLbls(newLbls []*lbListener) { + f.lock.Lock() + defer f.lock.Unlock() + + f.lblListeners = newLbls +} + +func (f *mockFetcher) setError(err error) { + f.lock.Lock() + defer f.lock.Unlock() + + f.lblListeners = []*lbListener{} + f.err = err +} + +func fakeLbl() *lbListener { + dnsName := "fake.example.net" + strVal := "strVal" + lbARN := "lb_arn" + listenerARN := "listen_arn" + state := elasticloadbalancingv2.LoadBalancerState{Reason: &strVal, Code: elasticloadbalancingv2.LoadBalancerStateEnumActive} + now := time.Now() + + lb := &elasticloadbalancingv2.LoadBalancer{ + LoadBalancerArn: &lbARN, + DNSName: &dnsName, + Type: elasticloadbalancingv2.LoadBalancerTypeEnumApplication, + Scheme: elasticloadbalancingv2.LoadBalancerSchemeEnumInternetFacing, + AvailabilityZones: []elasticloadbalancingv2.AvailabilityZone{{ZoneName: &strVal}}, + CreatedTime: &now, + State: &state, + IpAddressType: elasticloadbalancingv2.IpAddressTypeDualstack, + SecurityGroups: []string{"foo-security-group"}, + VpcId: &strVal, + } + + var port int64 = 1234 + listener := &elasticloadbalancingv2.Listener{ + ListenerArn: &listenerARN, + LoadBalancerArn: lb.LoadBalancerArn, + Port: &port, + Protocol: elasticloadbalancingv2.ProtocolEnumHttps, + SslPolicy: &strVal, + } + + return &lbListener{lb: lb, listener: listener} +} diff --git a/x-pack/libbeat/autodiscover/providers/aws/elb/provider.go b/x-pack/libbeat/autodiscover/providers/aws/elb/provider.go new file mode 100644 index 000000000000..e1037b7f8d35 --- /dev/null +++ b/x-pack/libbeat/autodiscover/providers/aws/elb/provider.go @@ -0,0 +1,150 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package elb + +import ( + "context" + "time" + + awscommon "github.com/elastic/beats/x-pack/libbeat/common/aws" + + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/elasticloadbalancingv2iface" + "github.com/gofrs/uuid" + + "github.com/elastic/beats/libbeat/autodiscover" + "github.com/elastic/beats/libbeat/autodiscover/template" + "github.com/elastic/beats/libbeat/common" + "github.com/elastic/beats/libbeat/common/bus" + "github.com/elastic/beats/libbeat/common/cfgwarn" + "github.com/elastic/beats/libbeat/logp" +) + +func init() { + autodiscover.Registry.AddProvider("aws_elb", AutodiscoverBuilder) +} + +// Provider implements autodiscover provider for aws ELBs. +type Provider struct { + fetcher fetcher + period time.Duration + config *Config + bus bus.Bus + builders autodiscover.Builders + appenders autodiscover.Appenders + templates *template.Mapper + startListener bus.Listener + stopListener bus.Listener + watcher *watcher + uuid uuid.UUID +} + +// AutodiscoverBuilder is the main builder for this provider. +func AutodiscoverBuilder(bus bus.Bus, uuid uuid.UUID, c *common.Config) (autodiscover.Provider, error) { + cfgwarn.Experimental("aws_elb autodiscover is experimental") + + config := defaultConfig() + err := c.Unpack(&config) + if err != nil { + return nil, err + } + + var clients []elasticloadbalancingv2iface.ClientAPI + for _, region := range config.Regions { + awsCfg, err := awscommon.GetAWSCredentials(awscommon.ConfigAWS{ + AccessKeyID: config.AWSConfig.AccessKeyID, + SecretAccessKey: config.AWSConfig.SecretAccessKey, + SessionToken: config.AWSConfig.SessionToken, + ProfileName: config.AWSConfig.ProfileName, + }) + if err != nil { + logp.Err("error loading AWS config for aws_elb autodiscover provider: %s", err) + } + awsCfg.Region = region + clients = append(clients, elasticloadbalancingv2.New(awsCfg)) + } + + return internalBuilder(uuid, bus, config, newAPIFetcher(context.TODO(), clients)) +} + +// internalBuilder is mainly intended for testing via mocks and stubs. +// it can be configured to use a fetcher that doesn't actually hit the AWS API. +func internalBuilder(uuid uuid.UUID, bus bus.Bus, config *Config, fetcher fetcher) (*Provider, error) { + mapper, err := template.NewConfigMapper(config.Templates) + if err != nil { + return nil, err + } + + builders, err := autodiscover.NewBuilders(config.Builders, nil) + if err != nil { + return nil, err + } + + appenders, err := autodiscover.NewAppenders(config.Appenders) + if err != nil { + return nil, err + } + + return &Provider{ + fetcher: fetcher, + period: config.Period, + config: config, + bus: bus, + builders: builders, + appenders: appenders, + templates: &mapper, + uuid: uuid, + }, nil +} + +// Start the autodiscover process. +func (p *Provider) Start() { + p.watcher = newWatcher( + p.fetcher, + p.period, + p.onWatcherStart, + p.onWatcherStop, + ) + p.watcher.start() +} + +// Stop the autodiscover process. +func (p *Provider) Stop() { + p.watcher.stop() +} + +func (p *Provider) onWatcherStart(arn string, lbl *lbListener) { + lblMap := lbl.toMap() + e := bus.Event{ + "start": true, + "provider": p.uuid, + "id": arn, + "host": lblMap["host"], + "port": lblMap["port"], + "meta": common.MapStr{ + "elb_listener": lbl.toMap(), + "cloud": lbl.toCloudMap(), + }, + } + + if configs := p.templates.GetConfig(e); configs != nil { + e["config"] = configs + } + p.appenders.Append(e) + p.bus.Publish(e) +} + +func (p *Provider) onWatcherStop(arn string) { + e := bus.Event{ + "stop": true, + "id": arn, + "provider": p.uuid, + } + p.bus.Publish(e) +} + +func (p *Provider) String() string { + return "aws_elb" +} diff --git a/x-pack/libbeat/autodiscover/providers/aws/elb/provider_test.go b/x-pack/libbeat/autodiscover/providers/aws/elb/provider_test.go new file mode 100644 index 000000000000..23c39d4551c6 --- /dev/null +++ b/x-pack/libbeat/autodiscover/providers/aws/elb/provider_test.go @@ -0,0 +1,143 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package elb + +import ( + "sync" + "testing" + "time" + + "github.com/gofrs/uuid" + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/elastic/beats/libbeat/common" + "github.com/elastic/beats/libbeat/common/bus" +) + +type testEventAccumulator struct { + events []bus.Event + lock sync.Mutex +} + +func (tea *testEventAccumulator) add(e bus.Event) { + tea.lock.Lock() + defer tea.lock.Unlock() + + tea.events = append(tea.events, e) +} + +func (tea *testEventAccumulator) len() int { + tea.lock.Lock() + defer tea.lock.Unlock() + + return len(tea.events) +} + +func (tea *testEventAccumulator) get() []bus.Event { + tea.lock.Lock() + defer tea.lock.Unlock() + + res := make([]bus.Event, len(tea.events)) + copy(res, tea.events) + return res +} + +func (tea *testEventAccumulator) waitForNumEvents(t *testing.T, targetLen int, timeout time.Duration) { + start := time.Now() + + for time.Now().Sub(start) < timeout { + if tea.len() >= targetLen { + return + } + time.Sleep(time.Millisecond) + } + + t.Fatalf("Timed out waiting for num events to be %d", targetLen) +} + +func Test_internalBuilder(t *testing.T) { + lbl := fakeLbl() + lbls := []*lbListener{lbl} + fetcher := newMockFetcher(lbls, nil) + pBus := bus.New("test") + + cfg := &Config{ + Regions: []string{"us-east-1a", "us-west-1b"}, + Period: time.Nanosecond, + } + + uuid, _ := uuid.NewV4() + provider, err := internalBuilder(uuid, pBus, cfg, fetcher) + require.NoError(t, err) + + provider.Start() + + startListener := pBus.Subscribe("start") + stopListener := pBus.Subscribe("stop") + listenerDone := make(chan struct{}) + defer close(listenerDone) + + var events testEventAccumulator + go func() { + for { + select { + case e := <-startListener.Events(): + events.add(e) + case e := <-stopListener.Events(): + events.add(e) + case <-listenerDone: + return + } + } + }() + + // Let run twice to ensure that duplicates don't create two start events + // 20ms should be enough to see more than two events since the loop is once per nanosecond + time.Sleep(time.Millisecond * 50) + events.waitForNumEvents(t, 1, 5*time.Second) + + assert.Equal(t, 1, events.len()) + + expectedStartEvent := bus.Event{ + "id": lbl.arn(), + "provider": uuid, + "start": true, + "host": *lbl.lb.DNSName, + "port": *lbl.listener.Port, + "meta": common.MapStr{ + "elb_listener": lbl.toMap(), + "cloud": lbl.toCloudMap(), + }, + } + + require.Equal(t, expectedStartEvent, events.get()[0]) + + fetcher.setLbls([]*lbListener{}) + + // Let run twice to ensure that duplicates don't create two start events + // 20ms should be enough to see more than two events since the loop is once per nanosecond + time.Sleep(time.Millisecond * 50) + events.waitForNumEvents(t, 2, 5*time.Second) + + require.Equal(t, 2, events.len()) + + expectedStopEvent := bus.Event{ + "stop": true, + "id": lbl.arn(), + "provider": uuid, + } + + require.Equal(t, expectedStopEvent, events.get()[1]) + + // Test that in an error situation nothing changes. + preErrorEventCount := events.len() + fetcher.setError(errors.New("oops")) + + time.Sleep(time.Millisecond * 50) + + assert.Equal(t, preErrorEventCount, events.len()) +} diff --git a/x-pack/libbeat/autodiscover/providers/aws/elb/watch.go b/x-pack/libbeat/autodiscover/providers/aws/elb/watch.go new file mode 100644 index 000000000000..cdc74ae455f2 --- /dev/null +++ b/x-pack/libbeat/autodiscover/providers/aws/elb/watch.go @@ -0,0 +1,102 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package elb + +import ( + "context" + "time" + + "github.com/elastic/beats/libbeat/logp" +) + +type watcher struct { + // gen tracks changes we increment the 'generation' of each entry in the map. + gen uint64 + fetcher fetcher + onStart func(uuid string, lblMap *lbListener) + onStop func(uuid string) + done chan struct{} + ticker *time.Ticker + period time.Duration + lbListeners map[string]uint64 +} + +func newWatcher( + fetcher fetcher, + period time.Duration, + onStart func(uuid string, lblMap *lbListener), + onStop func(uuid string)) *watcher { + return &watcher{ + fetcher: fetcher, + onStart: onStart, + onStop: onStop, + done: make(chan struct{}), + ticker: time.NewTicker(period), + period: period, + lbListeners: map[string]uint64{}, + } +} + +func (w *watcher) start() { + go w.forever() +} + +func (w *watcher) stop() { + close(w.done) +} + +func (w *watcher) forever() { + for { + select { + case <-w.done: + w.ticker.Stop() + return + case <-w.ticker.C: + err := w.once() + if err != nil { + logp.Err("error while fetching AWS ELBs: %s", err) + } + } + } +} + +// once executes the watch loop a single time. +// This is mostly useful for testing. +func (w *watcher) once() error { + ctx, cancelCtx := context.WithTimeout(context.Background(), w.period) + defer cancelCtx() // Always cancel to avoid leak + + fetchedLbls, err := w.fetcher.fetch(ctx) + if err != nil { + return err + } + logp.Debug("autodiscover-elb-listeners", "fetched %d load balancer listeners from AWS for autodiscovery", len(fetchedLbls)) + + oldGen := w.gen + w.gen++ + + // Increment the generation of all ELBs returned by the API request + for _, lbl := range fetchedLbls { + arn := lbl.arn() + if _, exists := w.lbListeners[arn]; !exists { + if w.onStart != nil { + w.onStart(arn, lbl) + } + } + w.lbListeners[arn] = w.gen + } + + // ELBs not seen in the API request get deleted + for uuid, entryGen := range w.lbListeners { + if entryGen == oldGen { + if w.onStop != nil { + w.onStop(uuid) + delete(w.lbListeners, uuid) + } + } + } + + return nil +} diff --git a/x-pack/libbeat/autodiscover/providers/aws/elb/watch_test.go b/x-pack/libbeat/autodiscover/providers/aws/elb/watch_test.go new file mode 100644 index 000000000000..36159cfee36b --- /dev/null +++ b/x-pack/libbeat/autodiscover/providers/aws/elb/watch_test.go @@ -0,0 +1,65 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package elb + +import ( + "sync" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/stretchr/testify/assert" +) + +func TestWatchTicks(t *testing.T) { + lbls := []*lbListener{fakeLbl()} + + lock := sync.Mutex{} + var startUUIDs []string + var startLbls []*lbListener + var stopUUIDs []string + + fetcher := newMockFetcher(lbls, nil) + watcher := newWatcher( + fetcher, + time.Millisecond, + func(uuid string, lbListener *lbListener) { + lock.Lock() + defer lock.Unlock() + + startUUIDs = append(startUUIDs, uuid) + startLbls = append(startLbls, lbListener) + }, + func(uuid string) { + lock.Lock() + defer lock.Unlock() + + stopUUIDs = append(stopUUIDs, uuid) + }) + defer watcher.stop() // unnecessary, but good hygiene + + // Run through 10 ticks + for i := 0; i < 10; i++ { + err := watcher.once() + require.NoError(t, err) + } + + // The listener ARN is the unique identifier used. + uuids := []string{*lbls[0].listener.ListenerArn} + + // Test that we've seen one lbl start, but none stop + assert.Equal(t, uuids, startUUIDs) + assert.Len(t, stopUUIDs, 0) + assert.Equal(t, lbls, startLbls) + + // Stop the lbl and test that we see a single stop + // and no change to starts + fetcher.setLbls(nil) + watcher.once() + + assert.Equal(t, uuids, startUUIDs) + assert.Equal(t, uuids, stopUUIDs) +} diff --git a/x-pack/libbeat/cmd/inject.go b/x-pack/libbeat/cmd/inject.go index b55427ae4036..6d4f212cb0c1 100644 --- a/x-pack/libbeat/cmd/inject.go +++ b/x-pack/libbeat/cmd/inject.go @@ -11,6 +11,9 @@ import ( // register central management "github.com/elastic/beats/x-pack/libbeat/licenser" _ "github.com/elastic/beats/x-pack/libbeat/management" + + // register autodiscover providers + _ "github.com/elastic/beats/x-pack/libbeat/autodiscover/providers/aws/elb" ) const licenseDebugK = "license"