diff --git a/cloudmock/aws/mockautoscaling/api.go b/cloudmock/aws/mockautoscaling/api.go index cd7f0e540d..a0a034b824 100644 --- a/cloudmock/aws/mockautoscaling/api.go +++ b/cloudmock/aws/mockautoscaling/api.go @@ -31,6 +31,7 @@ type MockAutoscaling struct { Groups map[string]*autoscaling.Group WarmPoolInstances map[string][]*autoscaling.Instance LaunchConfigurations map[string]*autoscaling.LaunchConfiguration + LifecycleHooks map[string]*autoscaling.LifecycleHook } var _ autoscalingiface.AutoScalingAPI = &MockAutoscaling{} diff --git a/cloudmock/aws/mockautoscaling/group.go b/cloudmock/aws/mockautoscaling/group.go index a10d7a0806..c02288dbba 100644 --- a/cloudmock/aws/mockautoscaling/group.go +++ b/cloudmock/aws/mockautoscaling/group.go @@ -336,3 +336,41 @@ func (m *MockAutoscaling) DeleteAutoScalingGroupRequest(*autoscaling.DeleteAutoS klog.Fatalf("Not implemented") return nil, nil } + +func (m *MockAutoscaling) PutLifecycleHook(input *autoscaling.PutLifecycleHookInput) (*autoscaling.PutLifecycleHookOutput, error) { + m.mutex.Lock() + defer m.mutex.Unlock() + hook := &autoscaling.LifecycleHook{ + AutoScalingGroupName: input.AutoScalingGroupName, + DefaultResult: input.DefaultResult, + GlobalTimeout: input.HeartbeatTimeout, + HeartbeatTimeout: input.HeartbeatTimeout, + LifecycleHookName: input.LifecycleHookName, + LifecycleTransition: input.LifecycleTransition, + NotificationMetadata: input.NotificationMetadata, + NotificationTargetARN: input.NotificationTargetARN, + RoleARN: input.RoleARN, + } + + if m.LifecycleHooks == nil { + m.LifecycleHooks = make(map[string]*autoscaling.LifecycleHook) + } + m.LifecycleHooks[*hook.AutoScalingGroupName] = hook + + return &autoscaling.PutLifecycleHookOutput{}, nil +} + +func (m *MockAutoscaling) DescribeLifecycleHooks(input *autoscaling.DescribeLifecycleHooksInput) (*autoscaling.DescribeLifecycleHooksOutput, error) { + m.mutex.Lock() + defer m.mutex.Unlock() + + name := *input.AutoScalingGroupName + response := &autoscaling.DescribeLifecycleHooksOutput{} + + hook := m.LifecycleHooks[name] + if hook == nil { + return response, nil + } + response.LifecycleHooks = []*autoscaling.LifecycleHook{hook} + return response, nil +} diff --git a/cloudmock/aws/mockeventbridge/BUILD.bazel b/cloudmock/aws/mockeventbridge/BUILD.bazel new file mode 100644 index 0000000000..ab6817f5e1 --- /dev/null +++ b/cloudmock/aws/mockeventbridge/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["api.go"], + importpath = "k8s.io/kops/cloudmock/aws/mockeventbridge", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/service/eventbridge:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/eventbridge/eventbridgeiface:go_default_library", + ], +) diff --git a/cloudmock/aws/mockeventbridge/api.go b/cloudmock/aws/mockeventbridge/api.go new file mode 100644 index 0000000000..ebd354e4e7 --- /dev/null +++ b/cloudmock/aws/mockeventbridge/api.go @@ -0,0 +1,115 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package mockeventbridge + +import ( + "sync" + + "github.com/aws/aws-sdk-go/service/eventbridge" + "github.com/aws/aws-sdk-go/service/eventbridge/eventbridgeiface" +) + +type MockEventBridge struct { + eventbridgeiface.EventBridgeAPI + mutex sync.Mutex + + Rules map[string]*eventbridge.Rule + TagsByArn map[string][]*eventbridge.Tag + TargetsByRule map[string][]*eventbridge.Target +} + +var _ eventbridgeiface.EventBridgeAPI = &MockEventBridge{} + +func (m *MockEventBridge) PutRule(input *eventbridge.PutRuleInput) (*eventbridge.PutRuleOutput, error) { + m.mutex.Lock() + defer m.mutex.Unlock() + + name := *input.Name + arn := "arn:aws:events:us-east-1:012345678901:rule/" + name + + rule := &eventbridge.Rule{ + Arn: &arn, + EventPattern: input.EventPattern, + } + if m.Rules == nil { + m.Rules = make(map[string]*eventbridge.Rule) + } + if m.TagsByArn == nil { + m.TagsByArn = make(map[string][]*eventbridge.Tag) + } + m.Rules[name] = rule + m.TagsByArn[arn] = input.Tags + + response := &eventbridge.PutRuleOutput{ + RuleArn: &arn, + } + return response, nil +} + +func (m *MockEventBridge) ListRules(input *eventbridge.ListRulesInput) (*eventbridge.ListRulesOutput, error) { + m.mutex.Lock() + defer m.mutex.Unlock() + + response := &eventbridge.ListRulesOutput{} + + rule := m.Rules[*input.NamePrefix] + if rule == nil { + return response, nil + } + response.Rules = []*eventbridge.Rule{rule} + return response, nil +} + +func (m *MockEventBridge) DeleteRule(*eventbridge.DeleteRuleInput) (*eventbridge.DeleteRuleOutput, error) { + panic("Not implemented") +} + +func (m *MockEventBridge) ListTagsForResource(input *eventbridge.ListTagsForResourceInput) (*eventbridge.ListTagsForResourceOutput, error) { + m.mutex.Lock() + defer m.mutex.Unlock() + + response := &eventbridge.ListTagsForResourceOutput{ + Tags: m.TagsByArn[*input.ResourceARN], + } + return response, nil +} + +func (m *MockEventBridge) PutTargets(input *eventbridge.PutTargetsInput) (*eventbridge.PutTargetsOutput, error) { + m.mutex.Lock() + defer m.mutex.Unlock() + + if m.TargetsByRule == nil { + m.TargetsByRule = make(map[string][]*eventbridge.Target) + } + m.TargetsByRule[*input.Rule] = input.Targets + + return &eventbridge.PutTargetsOutput{}, nil +} + +func (m *MockEventBridge) ListTargetsByRule(input *eventbridge.ListTargetsByRuleInput) (*eventbridge.ListTargetsByRuleOutput, error) { + m.mutex.Lock() + defer m.mutex.Unlock() + + response := &eventbridge.ListTargetsByRuleOutput{ + Targets: m.TargetsByRule[*input.Rule], + } + return response, nil +} + +func (m *MockEventBridge) RemoveTargets(*eventbridge.RemoveTargetsInput) (*eventbridge.RemoveTargetsOutput, error) { + panic("Not implemented") +} diff --git a/cloudmock/aws/mocksqs/BUILD.bazel b/cloudmock/aws/mocksqs/BUILD.bazel new file mode 100644 index 0000000000..eaba34a6f2 --- /dev/null +++ b/cloudmock/aws/mocksqs/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["api.go"], + importpath = "k8s.io/kops/cloudmock/aws/mocksqs", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/service/sqs:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/sqs/sqsiface:go_default_library", + ], +) diff --git a/cloudmock/aws/mocksqs/api.go b/cloudmock/aws/mocksqs/api.go new file mode 100644 index 0000000000..906cc6f482 --- /dev/null +++ b/cloudmock/aws/mocksqs/api.go @@ -0,0 +1,109 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package mocksqs + +import ( + "sync" + + "github.com/aws/aws-sdk-go/service/sqs" + "github.com/aws/aws-sdk-go/service/sqs/sqsiface" +) + +type MockSQS struct { + sqsiface.SQSAPI + mutex sync.Mutex + + Queues map[string]mockQueue +} + +type mockQueue struct { + url *string + attributes map[string]*string + tags map[string]*string +} + +var _ sqsiface.SQSAPI = &MockSQS{} + +func (m *MockSQS) CreateQueue(input *sqs.CreateQueueInput) (*sqs.CreateQueueOutput, error) { + m.mutex.Lock() + defer m.mutex.Unlock() + + name := *input.QueueName + url := "https://sqs.us-east-1.amazonaws.com/123456789123/" + name + + if m.Queues == nil { + m.Queues = make(map[string]mockQueue) + } + queue := mockQueue{ + url: &url, + attributes: input.Attributes, + tags: input.Tags, + } + + m.Queues[name] = queue + + response := &sqs.CreateQueueOutput{ + QueueUrl: &url, + } + return response, nil +} + +func (m *MockSQS) ListQueues(input *sqs.ListQueuesInput) (*sqs.ListQueuesOutput, error) { + m.mutex.Lock() + defer m.mutex.Unlock() + + response := &sqs.ListQueuesOutput{} + + if queue, ok := m.Queues[*input.QueueNamePrefix]; ok { + response.QueueUrls = []*string{queue.url} + } + return response, nil +} + +func (m *MockSQS) GetQueueAttributes(input *sqs.GetQueueAttributesInput) (*sqs.GetQueueAttributesOutput, error) { + m.mutex.Lock() + defer m.mutex.Unlock() + + response := &sqs.GetQueueAttributesOutput{} + + for _, v := range m.Queues { + if *v.url == *input.QueueUrl { + response.Attributes = v.attributes + return response, nil + } + } + return response, nil +} + +func (m *MockSQS) ListQueueTags(input *sqs.ListQueueTagsInput) (*sqs.ListQueueTagsOutput, error) { + m.mutex.Lock() + defer m.mutex.Unlock() + + response := &sqs.ListQueueTagsOutput{} + + for _, v := range m.Queues { + if *v.url == *input.QueueUrl { + response.Tags = v.tags + return response, nil + } + } + return response, nil +} + +func (m *MockSQS) DeleteQueue(*sqs.DeleteQueueInput) (*sqs.DeleteQueueOutput, error) { + panic("Not implemented") +} diff --git a/cmd/kops/integration_test.go b/cmd/kops/integration_test.go index cdce6ccd60..b9a5df3295 100644 --- a/cmd/kops/integration_test.go +++ b/cmd/kops/integration_test.go @@ -67,6 +67,8 @@ type integrationTest struct { caKey bool jsonOutput bool bastionUserData bool + // nth is true if we should check for files created by nth queue processor add on + nth bool } func newIntegrationTest(clusterName, srcDir string) *integrationTest { @@ -135,6 +137,11 @@ func (i *integrationTest) withBastionUserData() *integrationTest { return i } +func (i *integrationTest) withNTH() *integrationTest { + i.nth = true + return i +} + // TestMinimal runs the test on a minimum configuration, similar to kops create cluster minimal.example.com --zones us-west-1a func TestMinimal(t *testing.T) { newIntegrationTest("minimal.example.com", "minimal").runTestTerraformAWS(t) @@ -387,6 +394,12 @@ func TestAPIServerNodes(t *testing.T) { newIntegrationTest("minimal.example.com", "apiservernodes").runTestCloudformation(t) } +// TestNTHQueueProcessor tests the output for resources required by NTH Queue Processor mode +func TestNTHQueueProcessor(t *testing.T) { + newIntegrationTest("nthsqsresources.example.com", "nth_sqs_resources").withNTH().runTestTerraformAWS(t) + newIntegrationTest("nthsqsresources.example.com", "nth_sqs_resources").runTestCloudformation(t) +} + func (i *integrationTest) runTest(t *testing.T, h *testutils.IntegrationTestHarness, expectedDataFilenames []string, tfFileName string, expectedTfFileName string, phase *cloudup.Phase) { ctx := context.Background() @@ -579,6 +592,14 @@ func (i *integrationTest) runTestTerraformAWS(t *testing.T) { expectedFilenames = append(expectedFilenames, "aws_launch_template_bastion."+i.clusterName+"_user_data") } } + if i.nth { + expectedFilenames = append(expectedFilenames, []string{ + "aws_cloudwatch_event_rule_" + i.clusterName + "-ASGLifecycle_event_pattern", + "aws_cloudwatch_event_rule_" + i.clusterName + "-RebalanceRecommendation_event_pattern", + "aws_cloudwatch_event_rule_" + i.clusterName + "-SpotInterruption_event_pattern", + "aws_sqs_queue_" + strings.Replace(i.clusterName, ".", "-", -1) + "-nth_policy", + }...) + } } expectedFilenames = append(expectedFilenames, i.expectServiceAccountRolePolicies...) diff --git a/cmd/kops/lifecycle_integration_test.go b/cmd/kops/lifecycle_integration_test.go index 0e8632c068..fdbc112a74 100644 --- a/cmd/kops/lifecycle_integration_test.go +++ b/cmd/kops/lifecycle_integration_test.go @@ -153,6 +153,14 @@ func TestLifecyclePrivateSharedIP(t *testing.T) { }) } +// TestLifecycleNodeTerminationHandlerQueueProcessor runs the test on a cluster with requisite resources for NTH Queue Processor +func TestLifecycleNodeTerminationHandlerQueueProcessor(t *testing.T) { + runLifecycleTestAWS(&LifecycleTestOptions{ + t: t, + SrcDir: "nth_sqs_resources", + }) +} + func runLifecycleTest(h *testutils.IntegrationTestHarness, o *LifecycleTestOptions, cloud *awsup.MockAWSCloud) { ctx := context.Background() diff --git a/docs/addons.md b/docs/addons.md index fd46e5f12b..14e45dc4a5 100644 --- a/docs/addons.md +++ b/docs/addons.md @@ -127,14 +127,39 @@ spec: {{ kops_feature_table(kops_added_default='1.19') }} -Node Termination Handler ensures that the Kubernetes control plane responds appropriately to events that can cause your EC2 instance to become unavailable, such as EC2 maintenance events, EC2 Spot interruptions, ASG Scale-In, ASG AZ Rebalance, and EC2 Instance Termination via the API or Console. If not handled, your application code may not stop gracefully, take longer to recover full availability, or accidentally schedule work to nodes that are going down. +[Node Termination Handler](https://github.com/aws/aws-node-termination-handler) ensures that the Kubernetes control plane responds appropriately to events that can cause your EC2 instance to become unavailable, such as EC2 maintenance events, EC2 Spot interruptions, and EC2 instance rebalance recommendations. If not handled, your application code may not stop gracefully, take longer to recover full availability, or accidentally schedule work to nodes that are going down. ```yaml spec: nodeTerminationHandler: enabled: true + enableSQSTerminationDraining: true + managedASGTag: "aws-node-termination-handler/managed" ``` +If `enableSQSTerminationDraining` is true Node Termination Handler will operate in Queue Processor mode. In addition to the events mentioned above, Queue Processor mode allows Node Termination Handler to take care of ASG Scale-In, AZ-Rebalance, Unhealthy Instances, EC2 Instance Termination via the API or Console, and more. kOps will provision the necessary infrastructure: an SQS queue, EventBridge rules, and ASG Lifecycle hooks. `managedASGTag` can be configured with Queue Processor mode to distinguish resource ownership between multiple clusters. + +The kOps CLI requires additional IAM permissions to create the requisite EventBridge rules and SQS queue: + +```json +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "events:PutEvents", + "events:PutTargets", + "sqs:CreateQueue" + ], + "Resource": "*" + } + ] +} +``` + +**Warning: If you switch between the two operating modes on an existing cluster, the old resources have to be manually deleted. For IMDS to Queue Processor, this means deleting the k8s nth daemonset. For Queue Processor to IMDS, this means deleting the k8s nth deployment and the AWS resources: the SQS queue, EventBridge rules, and ASG Lifecycle hooks.** + ## Static addons The command `kops create cluster` does not support specifying addons to be added to the cluster when it is created. Instead they can be added after cluster creation using kubectl. Alternatively when creating a cluster from a yaml manifest, addons can be specified using `spec.addons`. diff --git a/k8s/crds/kops.k8s.io_clusters.yaml b/k8s/crds/kops.k8s.io_clusters.yaml index f70ba5208d..faee84cab5 100644 --- a/k8s/crds/kops.k8s.io_clusters.yaml +++ b/k8s/crds/kops.k8s.io_clusters.yaml @@ -3906,6 +3906,10 @@ spec: description: NodeTerminationHandler determines the cluster autoscaler configuration. properties: + enableSQSTerminationDraining: + description: EnableSQSTerminationDraining enables queue-processor + mode which drains nodes when an SQS termination event is received. + type: boolean enableScheduledEventDraining: description: 'EnableScheduledEventDraining makes node termination handler drain nodes before the maintenance window starts for @@ -3920,6 +3924,10 @@ spec: description: 'Enabled enables the node termination handler. Default: true' type: boolean + managedASGTag: + description: ManagedASGTag is the tag used to determine which + nodes NTH can take action on + type: string prometheusEnable: description: EnablePrometheusMetrics enables the "/metrics" endpoint. type: boolean diff --git a/pkg/apis/kops/cluster.go b/pkg/apis/kops/cluster.go index 06adc2cb7a..4519f745e6 100644 --- a/pkg/apis/kops/cluster.go +++ b/pkg/apis/kops/cluster.go @@ -161,7 +161,7 @@ type ClusterSpec struct { ExternalDNS *ExternalDNSConfig `json:"externalDns,omitempty"` NTP *NTPConfig `json:"ntp,omitempty"` - // NodeTerminationHandler determines the cluster autoscaler configuration. + // NodeTerminationHandler determines the node termination handler configuration. NodeTerminationHandler *NodeTerminationHandlerConfig `json:"nodeTerminationHandler,omitempty"` // MetricsServer determines the metrics server configuration. MetricsServer *MetricsServerConfig `json:"metricsServer,omitempty"` diff --git a/pkg/apis/kops/componentconfig.go b/pkg/apis/kops/componentconfig.go index 508e0d96af..6b78400217 100644 --- a/pkg/apis/kops/componentconfig.go +++ b/pkg/apis/kops/componentconfig.go @@ -854,6 +854,12 @@ type NodeTerminationHandlerConfig struct { // EnablePrometheusMetrics enables the "/metrics" endpoint. EnablePrometheusMetrics *bool `json:"prometheusEnable,omitempty"` + + // EnableSQSTerminationDraining enables queue-processor mode which drains nodes when an SQS termination event is received. + EnableSQSTerminationDraining *bool `json:"enableSQSTerminationDraining,omitempty"` + + // ManagedASGTag is the tag used to determine which nodes NTH can take action on + ManagedASGTag *string `json:"managedASGTag,omitempty"` } // ClusterAutoscalerConfig determines the cluster autoscaler configuration. diff --git a/pkg/apis/kops/v1alpha2/componentconfig.go b/pkg/apis/kops/v1alpha2/componentconfig.go index b5e4b0d26d..65b772eeed 100644 --- a/pkg/apis/kops/v1alpha2/componentconfig.go +++ b/pkg/apis/kops/v1alpha2/componentconfig.go @@ -853,6 +853,12 @@ type NodeTerminationHandlerConfig struct { // EnablePrometheusMetrics enables the "/metrics" endpoint. EnablePrometheusMetrics *bool `json:"prometheusEnable,omitempty"` + + // EnableSQSTerminationDraining enables queue-processor mode which drains nodes when an SQS termination event is received. + EnableSQSTerminationDraining *bool `json:"enableSQSTerminationDraining,omitempty"` + + // ManagedASGTag is the tag used to determine which nodes NTH can take action on + ManagedASGTag *string `json:"managedASGTag,omitempty"` } // ClusterAutoscalerConfig determines the cluster autoscaler configuration. diff --git a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go index 526120b6ce..d6a4870ffa 100644 --- a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go +++ b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go @@ -5761,6 +5761,8 @@ func autoConvert_v1alpha2_NodeTerminationHandlerConfig_To_kops_NodeTerminationHa out.EnableSpotInterruptionDraining = in.EnableSpotInterruptionDraining out.EnableScheduledEventDraining = in.EnableScheduledEventDraining out.EnablePrometheusMetrics = in.EnablePrometheusMetrics + out.EnableSQSTerminationDraining = in.EnableSQSTerminationDraining + out.ManagedASGTag = in.ManagedASGTag return nil } @@ -5774,6 +5776,8 @@ func autoConvert_kops_NodeTerminationHandlerConfig_To_v1alpha2_NodeTerminationHa out.EnableSpotInterruptionDraining = in.EnableSpotInterruptionDraining out.EnableScheduledEventDraining = in.EnableScheduledEventDraining out.EnablePrometheusMetrics = in.EnablePrometheusMetrics + out.EnableSQSTerminationDraining = in.EnableSQSTerminationDraining + out.ManagedASGTag = in.ManagedASGTag return nil } diff --git a/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go index 1b08d8f6df..4fe165ec1f 100644 --- a/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go @@ -3894,6 +3894,16 @@ func (in *NodeTerminationHandlerConfig) DeepCopyInto(out *NodeTerminationHandler *out = new(bool) **out = **in } + if in.EnableSQSTerminationDraining != nil { + in, out := &in.EnableSQSTerminationDraining, &out.EnableSQSTerminationDraining + *out = new(bool) + **out = **in + } + if in.ManagedASGTag != nil { + in, out := &in.ManagedASGTag, &out.ManagedASGTag + *out = new(string) + **out = **in + } return } diff --git a/pkg/apis/kops/zz_generated.deepcopy.go b/pkg/apis/kops/zz_generated.deepcopy.go index ebdb1f8171..09c557d9ae 100644 --- a/pkg/apis/kops/zz_generated.deepcopy.go +++ b/pkg/apis/kops/zz_generated.deepcopy.go @@ -4092,6 +4092,16 @@ func (in *NodeTerminationHandlerConfig) DeepCopyInto(out *NodeTerminationHandler *out = new(bool) **out = **in } + if in.EnableSQSTerminationDraining != nil { + in, out := &in.EnableSQSTerminationDraining, &out.EnableSQSTerminationDraining + *out = new(bool) + **out = **in + } + if in.ManagedASGTag != nil { + in, out := &in.ManagedASGTag, &out.ManagedASGTag + *out = new(string) + **out = **in + } return } diff --git a/pkg/model/awsmodel/BUILD.bazel b/pkg/model/awsmodel/BUILD.bazel index 8ab4caa47d..ce1a0e0bb0 100644 --- a/pkg/model/awsmodel/BUILD.bazel +++ b/pkg/model/awsmodel/BUILD.bazel @@ -9,6 +9,7 @@ go_library( "context.go", "dns.go", "external_access.go", + "nodeterminationhandler.go", "oidc_provider.go", "spotinst.go", ], @@ -26,6 +27,7 @@ go_library( "//upup/pkg/fi/cloudup/awsup:go_default_library", "//upup/pkg/fi/cloudup/spotinsttasks:go_default_library", "//upup/pkg/fi/fitasks:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/ec2:go_default_library", "//vendor/gopkg.in/square/go-jose.v2:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", diff --git a/pkg/model/awsmodel/nodeterminationhandler.go b/pkg/model/awsmodel/nodeterminationhandler.go new file mode 100644 index 0000000000..009fc2a9d3 --- /dev/null +++ b/pkg/model/awsmodel/nodeterminationhandler.go @@ -0,0 +1,173 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package awsmodel + +import ( + "strings" + + "k8s.io/kops/pkg/model" + + "k8s.io/kops/upup/pkg/fi/cloudup/awstasks" + + "github.com/aws/aws-sdk-go/aws" + "k8s.io/kops/pkg/apis/kops" + "k8s.io/kops/upup/pkg/fi" +) + +const ( + NTHTemplate = `{ + "Version": "2012-10-17", + "Statement": [{ + "Effect": "Allow", + "Principal": { + "Service": ["events.amazonaws.com", "sqs.amazonaws.com"] + }, + "Action": "sqs:SendMessage", + "Resource": [ + "arn:aws:sqs:{{ AWS_REGION }}:{{ ACCOUNT_ID }}:{{ SQS_QUEUE_NAME }}" + ] + }] + }` + DefaultMessageRetentionPeriod = 300 +) + +type event struct { + name string + pattern string +} + +var ( + _ fi.ModelBuilder = &NodeTerminationHandlerBuilder{} + + events = []event{ + { + name: "ASGLifecycle", + pattern: `{"source":["aws.autoscaling"],"detail-type":["EC2 Instance-terminate Lifecycle Action"]}`, + }, + { + name: "SpotInterruption", + pattern: `{"source": ["aws.ec2"],"detail-type": ["EC2 Spot Instance Interruption Warning"]}`, + }, + { + name: "RebalanceRecommendation", + pattern: `{"source": ["aws.ec2"],"detail-type": ["EC2 Instance Rebalance Recommendation"]}`, + }, + } +) + +type NodeTerminationHandlerBuilder struct { + *AWSModelContext + + Lifecycle *fi.Lifecycle +} + +func (b *NodeTerminationHandlerBuilder) Build(c *fi.ModelBuilderContext) error { + + for _, ig := range b.InstanceGroups { + err := b.configureASG(c, ig) + if err != nil { + return err + } + } + + err := b.buildSQSQueue(c) + if err != nil { + return err + } + + err = b.buildEventBridgeRules(c) + if err != nil { + return err + } + + return nil +} + +func (b *NodeTerminationHandlerBuilder) configureASG(c *fi.ModelBuilderContext, ig *kops.InstanceGroup) error { + name := ig.Name + "-NTHLifecycleHook" + + lifecyleTask := &awstasks.AutoscalingLifecycleHook{ + ID: aws.String(name), + Name: aws.String(name), + Lifecycle: b.Lifecycle, + AutoscalingGroup: b.LinkToAutoscalingGroup(ig), + DefaultResult: aws.String("CONTINUE"), + HeartbeatTimeout: aws.Int64(DefaultMessageRetentionPeriod), + LifecycleTransition: aws.String("autoscaling:EC2_INSTANCE_TERMINATING"), + } + + c.AddTask(lifecyleTask) + + return nil +} + +func (b *NodeTerminationHandlerBuilder) buildSQSQueue(c *fi.ModelBuilderContext) error { + queueName := model.QueueNamePrefix(b.ClusterName()) + "-nth" + policy := strings.ReplaceAll(NTHTemplate, "{{ AWS_REGION }}", b.Region) + policy = strings.ReplaceAll(policy, "{{ ACCOUNT_ID }}", b.AWSAccountID) + policy = strings.ReplaceAll(policy, "{{ SQS_QUEUE_NAME }}", queueName) + + task := &awstasks.SQS{ + Name: aws.String(queueName), + Lifecycle: b.Lifecycle, + Policy: fi.NewStringResource(policy), + MessageRetentionPeriod: DefaultMessageRetentionPeriod, + Tags: b.CloudTags(queueName, false), + } + + c.AddTask(task) + + return nil +} + +func (b *NodeTerminationHandlerBuilder) buildEventBridgeRules(c *fi.ModelBuilderContext) error { + clusterName := b.ClusterName() + queueName := model.QueueNamePrefix(clusterName) + "-nth" + region := b.Region + accountID := b.AWSAccountID + targetArn := "arn:aws:sqs:" + region + ":" + accountID + ":" + queueName + + for _, event := range events { + // build rule + ruleName := aws.String(clusterName + "-" + event.name) + pattern := event.pattern + + ruleTask := &awstasks.EventBridgeRule{ + Name: ruleName, + Lifecycle: b.Lifecycle, + Tags: b.CloudTags(*ruleName, false), + + EventPattern: &pattern, + TargetArn: &targetArn, + } + + c.AddTask(ruleTask) + + // build target + targetTask := &awstasks.EventBridgeTarget{ + Name: aws.String(*ruleName + "-Target"), + Lifecycle: b.Lifecycle, + + Rule: ruleTask, + TargetArn: &targetArn, + } + + c.AddTask(targetTask) + } + + return nil +} diff --git a/pkg/model/components/nodeterminationhandler.go b/pkg/model/components/nodeterminationhandler.go index 8742828ec9..58b738e1dc 100644 --- a/pkg/model/components/nodeterminationhandler.go +++ b/pkg/model/components/nodeterminationhandler.go @@ -48,5 +48,14 @@ func (b *NodeTerminationHandlerOptionsBuilder) BuildOptions(o interface{}) error if nth.EnablePrometheusMetrics == nil { nth.EnablePrometheusMetrics = fi.Bool(false) } + + if nth.EnableSQSTerminationDraining == nil { + nth.EnableSQSTerminationDraining = fi.Bool(false) + } + + if nth.ManagedASGTag == nil { + nth.ManagedASGTag = fi.String("aws-node-termination-handler/managed") + } + return nil } diff --git a/pkg/model/context.go b/pkg/model/context.go index 94fc2617e1..d8ec38e1eb 100644 --- a/pkg/model/context.go +++ b/pkg/model/context.go @@ -143,6 +143,12 @@ func (m *KopsModelContext) CloudTagsForInstanceGroup(ig *kops.InstanceGroup) (ma labels[k] = v } + // Apply NTH Labels + nth := m.Cluster.Spec.NodeTerminationHandler + if nth != nil && fi.BoolValue(nth.Enabled) && fi.BoolValue(nth.EnableSQSTerminationDraining) { + labels[fi.StringValue(nth.ManagedASGTag)] = "" + } + // Apply labels for cluster autoscaler node labels for k, v := range nodelabels.BuildNodeLabels(m.Cluster, ig) { labels[nodeidentityaws.ClusterAutoscalerNodeTemplateLabel+k] = v diff --git a/pkg/model/iam/iam_builder.go b/pkg/model/iam/iam_builder.go index 82e039aa04..b0e7945426 100644 --- a/pkg/model/iam/iam_builder.go +++ b/pkg/model/iam/iam_builder.go @@ -337,6 +337,11 @@ func (r *NodeRoleMaster) BuildAWSPolicy(b *PolicyBuilder) (*Policy, error) { addCalicoSrcDstCheckPermissions(p) } + nth := b.Cluster.Spec.NodeTerminationHandler + if nth != nil && fi.BoolValue(nth.Enabled) && fi.BoolValue(nth.EnableSQSTerminationDraining) { + addNodeTerminationHandlerSQSPermissions(p, resource) + } + return p, nil } @@ -1143,6 +1148,21 @@ func addAmazonVPCCNIPermissions(p *Policy, resource stringorslice.StringOrSlice, ) } +func addNodeTerminationHandlerSQSPermissions(p *Policy, resource stringorslice.StringOrSlice) { + p.Statement = append(p.Statement, + &Statement{ + Effect: StatementEffectAllow, + Action: stringorslice.Slice([]string{ + "autoscaling:CompleteLifecycleAction", + "autoscaling:DescribeAutoScalingInstances", + "sqs:DeleteMessage", + "sqs:ReceiveMessage", + }), + Resource: resource, + }, + ) +} + func createResource(b *PolicyBuilder) stringorslice.StringOrSlice { var resource stringorslice.StringOrSlice if b.ResourceARN != nil { diff --git a/pkg/model/names.go b/pkg/model/names.go index 2a05f05f5f..4ce1bed9d8 100644 --- a/pkg/model/names.go +++ b/pkg/model/names.go @@ -265,3 +265,8 @@ func (b *KopsModelContext) LinkToPrivateRouteTableInZone(zoneName string) *awsta func (b *KopsModelContext) InstanceName(ig *kops.InstanceGroup, suffix string) string { return b.AutoscalingGroupName(ig) + suffix } + +func QueueNamePrefix(clusterName string) string { + // periods aren't allowed in queue name + return strings.ReplaceAll(clusterName, ".", "-") +} diff --git a/pkg/resources/aws/BUILD.bazel b/pkg/resources/aws/BUILD.bazel index c76a5031fb..39ed4d8bc0 100644 --- a/pkg/resources/aws/BUILD.bazel +++ b/pkg/resources/aws/BUILD.bazel @@ -6,10 +6,12 @@ go_library( "aws.go", "elasticip.go", "errors.go", + "eventbridge.go", "filters.go", "natgateway.go", "routetable.go", "securitygroup.go", + "sqs.go", "subnet.go", "tags.go", "vpc.go", @@ -29,8 +31,10 @@ go_library( "//vendor/github.com/aws/aws-sdk-go/service/ec2:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/elb:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/elbv2:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/eventbridge:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/iam:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/route53:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/sqs:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//vendor/k8s.io/klog/v2:go_default_library", ], diff --git a/pkg/resources/aws/aws.go b/pkg/resources/aws/aws.go index 54ba3337f4..f3ac2101d9 100644 --- a/pkg/resources/aws/aws.go +++ b/pkg/resources/aws/aws.go @@ -83,6 +83,11 @@ func ListResourcesAWS(cloud awsup.AWSCloud, clusterName string) (map[string]*res ListIAMInstanceProfiles, ListIAMRoles, ListIAMOIDCProviders, + + // SQS + ListSQSQueues, + // EventBridge + ListEventBridgeRules, } if featureflag.Spotinst.Enabled() { diff --git a/pkg/resources/aws/eventbridge.go b/pkg/resources/aws/eventbridge.go new file mode 100644 index 0000000000..aa3c2e2e90 --- /dev/null +++ b/pkg/resources/aws/eventbridge.go @@ -0,0 +1,112 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package aws + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/eventbridge" + "k8s.io/klog/v2" + + "k8s.io/kops/pkg/resources" + "k8s.io/kops/upup/pkg/fi" + "k8s.io/kops/upup/pkg/fi/cloudup/awsup" +) + +func DumpEventBridgeRule(op *resources.DumpOperation, r *resources.Resource) error { + data := make(map[string]interface{}) + data["id"] = r.ID + data["name"] = r.Name + data["type"] = r.Type + data["raw"] = r.Obj + op.Dump.Resources = append(op.Dump.Resources, data) + + return nil +} + +func DeleteEventBridgeRule(cloud fi.Cloud, r *resources.Resource) error { + c := cloud.(awsup.AWSCloud) + + targets, err := c.EventBridge().ListTargetsByRule(&eventbridge.ListTargetsByRuleInput{ + Rule: aws.String(r.Name), + }) + if err != nil { + return fmt.Errorf("error listing targets for EventBridge rule %q: %v", r.Name, err) + } + + var ids []*string + for _, target := range targets.Targets { + ids = append(ids, target.Id) + } + + klog.V(2).Infof("Removing EventBridge Targets for rule %q", r.Name) + _, err = c.EventBridge().RemoveTargets(&eventbridge.RemoveTargetsInput{ + Ids: ids, + Rule: aws.String(r.Name), + }) + if err != nil { + return fmt.Errorf("error removing targets for EventBridge rule %q: %v", r.Name, err) + } + + klog.V(2).Infof("Deleting EventBridge rule %q", r.Name) + request := &eventbridge.DeleteRuleInput{ + Name: aws.String(r.Name), + } + _, err = c.EventBridge().DeleteRule(request) + if err != nil { + return fmt.Errorf("error deleting EventBridge rule %q: %v", r.Name, err) + } + return nil +} + +func ListEventBridgeRules(cloud fi.Cloud, clusterName string) ([]*resources.Resource, error) { + c := cloud.(awsup.AWSCloud) + + klog.V(2).Infof("Listing EventBridge rules") + + // rule names start with the cluster name so that we can search for them + request := &eventbridge.ListRulesInput{ + EventBusName: nil, + Limit: nil, + NamePrefix: aws.String(clusterName), + } + response, err := c.EventBridge().ListRules(request) + if err != nil { + return nil, fmt.Errorf("error listing Eventbridge rules: %v", err) + } + if response == nil || len(response.Rules) == 0 { + return nil, nil + } + + var resourceTrackers []*resources.Resource + + for _, rule := range response.Rules { + resourceTracker := &resources.Resource{ + Name: *rule.Name, + ID: *rule.Name, + Type: "eventbridge", + Deleter: DeleteEventBridgeRule, + Dumper: DumpEventBridgeRule, + Obj: rule, + } + + resourceTrackers = append(resourceTrackers, resourceTracker) + } + + return resourceTrackers, nil +} diff --git a/pkg/resources/aws/sqs.go b/pkg/resources/aws/sqs.go new file mode 100644 index 0000000000..9578db6a8b --- /dev/null +++ b/pkg/resources/aws/sqs.go @@ -0,0 +1,90 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package aws + +import ( + "fmt" + "strings" + + "github.com/aws/aws-sdk-go/service/sqs" + "k8s.io/klog/v2" + "k8s.io/kops/pkg/resources" + "k8s.io/kops/upup/pkg/fi" + "k8s.io/kops/upup/pkg/fi/cloudup/awsup" +) + +func DumpSQSQueue(op *resources.DumpOperation, r *resources.Resource) error { + data := make(map[string]interface{}) + data["id"] = r.ID + data["name"] = r.Name + data["type"] = r.Type + data["raw"] = r.Obj + op.Dump.Resources = append(op.Dump.Resources, data) + + return nil +} + +func DeleteSQSQueue(cloud fi.Cloud, r *resources.Resource) error { + c := cloud.(awsup.AWSCloud) + + url := r.ID + + klog.V(2).Infof("Deleting SQS queue %q", url) + request := &sqs.DeleteQueueInput{ + QueueUrl: &url, + } + _, err := c.SQS().DeleteQueue(request) + if err != nil { + return fmt.Errorf("error deleting SQS queue %q: %v", url, err) + } + return nil +} + +func ListSQSQueues(cloud fi.Cloud, clusterName string) ([]*resources.Resource, error) { + c := cloud.(awsup.AWSCloud) + + klog.V(2).Infof("Listing SQS queues") + queuePrefix := strings.ReplaceAll(clusterName, ".", "-") + + request := &sqs.ListQueuesInput{ + QueueNamePrefix: &queuePrefix, + } + response, err := c.SQS().ListQueues(request) + if err != nil { + return nil, fmt.Errorf("error listing SQS queues: %v", err) + } + if response == nil || len(response.QueueUrls) == 0 { + return nil, nil + } + + var resourceTrackers []*resources.Resource + + for _, queueUrl := range response.QueueUrls { + resourceTracker := &resources.Resource{ + Name: *queueUrl, + ID: *queueUrl, + Type: "sqs", + Deleter: DeleteSQSQueue, + Dumper: DumpSQSQueue, + Obj: queueUrl, + } + + resourceTrackers = append(resourceTrackers, resourceTracker) + } + + return resourceTrackers, nil +} diff --git a/pkg/testutils/BUILD.bazel b/pkg/testutils/BUILD.bazel index 71ae0307ca..c8a85ade93 100644 --- a/pkg/testutils/BUILD.bazel +++ b/pkg/testutils/BUILD.bazel @@ -15,8 +15,10 @@ go_library( "//cloudmock/aws/mockec2:go_default_library", "//cloudmock/aws/mockelb:go_default_library", "//cloudmock/aws/mockelbv2:go_default_library", + "//cloudmock/aws/mockeventbridge:go_default_library", "//cloudmock/aws/mockiam:go_default_library", "//cloudmock/aws/mockroute53:go_default_library", + "//cloudmock/aws/mocksqs:go_default_library", "//cloudmock/openstack/mockblockstorage:go_default_library", "//cloudmock/openstack/mockcompute:go_default_library", "//cloudmock/openstack/mockdns:go_default_library", diff --git a/pkg/testutils/integrationtestharness.go b/pkg/testutils/integrationtestharness.go index 24c67e20c2..ce3f5560b6 100644 --- a/pkg/testutils/integrationtestharness.go +++ b/pkg/testutils/integrationtestharness.go @@ -23,6 +23,9 @@ import ( "path/filepath" "testing" + "k8s.io/kops/cloudmock/aws/mockeventbridge" + "k8s.io/kops/cloudmock/aws/mocksqs" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/elbv2" @@ -140,6 +143,10 @@ func (h *IntegrationTestHarness) SetupMockAWS() *awsup.MockAWSCloud { cloud.MockIAM = mockIAM mockAutoscaling := &mockautoscaling.MockAutoscaling{} cloud.MockAutoscaling = mockAutoscaling + mockSQS := &mocksqs.MockSQS{} + cloud.MockSQS = mockSQS + mockEventBridge := &mockeventbridge.MockEventBridge{} + cloud.MockEventBridge = mockEventBridge mockRoute53.MockCreateZone(&route53.HostedZone{ Id: aws.String("/hostedzone/Z1AFAKE1ZON3YO"), diff --git a/tests/integration/update_cluster/nth_sqs_resources/cloudformation.json b/tests/integration/update_cluster/nth_sqs_resources/cloudformation.json new file mode 100644 index 0000000000..fec93c3a5f --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/cloudformation.json @@ -0,0 +1,1352 @@ +{ + "Resources": { + "AWSAutoScalingAutoScalingGroupmasterustest1amastersnthsqsresourcesexamplecom": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "AutoScalingGroupName": "master-us-test-1a.masters.nthsqsresources.example.com", + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "AWSEC2LaunchTemplatemasterustest1amastersnthsqsresourcesexamplecom" + }, + "Version": { + "Fn::GetAtt": [ + "AWSEC2LaunchTemplatemasterustest1amastersnthsqsresourcesexamplecom", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "1", + "MinSize": "1", + "VPCZoneIdentifier": [ + { + "Ref": "AWSEC2Subnetustest1anthsqsresourcesexamplecom" + } + ], + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com", + "PropagateAtLaunch": true + }, + { + "Key": "Name", + "Value": "master-us-test-1a.masters.nthsqsresources.example.com", + "PropagateAtLaunch": true + }, + { + "Key": "aws-node-termination-handler/managed", + "Value": "", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki", + "Value": "", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane", + "Value": "", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers", + "Value": "", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/role/master", + "Value": "1", + "PropagateAtLaunch": true + }, + { + "Key": "kops.k8s.io/instancegroup", + "Value": "master-us-test-1a", + "PropagateAtLaunch": true + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned", + "PropagateAtLaunch": true + } + ], + "MetricsCollection": [ + { + "Granularity": "1Minute", + "Metrics": [ + "GroupDesiredCapacity", + "GroupInServiceInstances", + "GroupMaxSize", + "GroupMinSize", + "GroupPendingInstances", + "GroupStandbyInstances", + "GroupTerminatingInstances", + "GroupTotalInstances" + ] + } + ] + } + }, + "AWSAutoScalingAutoScalingGroupnodesnthsqsresourcesexamplecom": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "AutoScalingGroupName": "nodes.nthsqsresources.example.com", + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "AWSEC2LaunchTemplatenodesnthsqsresourcesexamplecom" + }, + "Version": { + "Fn::GetAtt": [ + "AWSEC2LaunchTemplatenodesnthsqsresourcesexamplecom", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "2", + "MinSize": "2", + "VPCZoneIdentifier": [ + { + "Ref": "AWSEC2Subnetustest1anthsqsresourcesexamplecom" + } + ], + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com", + "PropagateAtLaunch": true + }, + { + "Key": "Name", + "Value": "nodes.nthsqsresources.example.com", + "PropagateAtLaunch": true + }, + { + "Key": "aws-node-termination-handler/managed", + "Value": "", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/role/node", + "Value": "1", + "PropagateAtLaunch": true + }, + { + "Key": "kops.k8s.io/instancegroup", + "Value": "nodes", + "PropagateAtLaunch": true + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned", + "PropagateAtLaunch": true + } + ], + "MetricsCollection": [ + { + "Granularity": "1Minute", + "Metrics": [ + "GroupDesiredCapacity", + "GroupInServiceInstances", + "GroupMaxSize", + "GroupMinSize", + "GroupPendingInstances", + "GroupStandbyInstances", + "GroupTerminatingInstances", + "GroupTotalInstances" + ] + } + ] + } + }, + "AWSAutoScalingLifecycleHookmasterustest1aNTHLifecycleHook": { + "Type": "AWS::AutoScaling::LifecycleHook", + "Properties": { + "LifecycleHookName": "master-us-test-1a-NTHLifecycleHook", + "AutoScalingGroupName": { + "Ref": "AWSAutoScalingAutoScalingGroupmasterustest1amastersnthsqsresourcesexamplecom" + }, + "DefaultResult": "CONTINUE", + "HeartbeatTimeout": 300, + "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING" + } + }, + "AWSAutoScalingLifecycleHooknodesNTHLifecycleHook": { + "Type": "AWS::AutoScaling::LifecycleHook", + "Properties": { + "LifecycleHookName": "nodes-NTHLifecycleHook", + "AutoScalingGroupName": { + "Ref": "AWSAutoScalingAutoScalingGroupnodesnthsqsresourcesexamplecom" + }, + "DefaultResult": "CONTINUE", + "HeartbeatTimeout": 300, + "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING" + } + }, + "AWSEC2DHCPOptionsnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::DHCPOptions", + "Properties": { + "DomainName": "us-test-1.compute.internal", + "DomainNameServers": [ + "AmazonProvidedDNS" + ], + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "Name", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned" + } + ] + } + }, + "AWSEC2InternetGatewaynthsqsresourcesexamplecom": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "Name", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned" + } + ] + } + }, + "AWSEC2LaunchTemplatemasterustest1amastersnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateName": "master-us-test-1a.masters.nthsqsresources.example.com", + "LaunchTemplateData": { + "BlockDeviceMappings": [ + { + "DeviceName": "/dev/xvda", + "Ebs": { + "VolumeType": "gp3", + "VolumeSize": 64, + "Iops": 3000, + "Throughput": 125, + "DeleteOnTermination": true, + "Encrypted": true + } + }, + { + "DeviceName": "/dev/sdc", + "VirtualName": "ephemeral0" + } + ], + "IamInstanceProfile": { + "Name": { + "Ref": "AWSIAMInstanceProfilemastersnthsqsresourcesexamplecom" + } + }, + "ImageId": "ami-12345678", + "InstanceType": "m3.medium", + "KeyName": "kubernetes.nthsqsresources.example.com-c4:a6:ed:9a:a8:89:b9:e2:c3:9c:d6:63:eb:9c:71:57", + "MetadataOptions": { + "HttpPutResponseHopLimit": 1, + "HttpTokens": "optional" + }, + "NetworkInterfaces": [ + { + "AssociatePublicIpAddress": true, + "DeleteOnTermination": true, + "DeviceIndex": 0, + "Groups": [ + { + "Ref": "AWSEC2SecurityGroupmastersnthsqsresourcesexamplecom" + } + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "Name", + "Value": "master-us-test-1a.masters.nthsqsresources.example.com" + }, + { + "Key": "aws-node-termination-handler/managed", + "Value": "" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki", + "Value": "" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane", + "Value": "" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers", + "Value": "" + }, + { + "Key": "k8s.io/role/master", + "Value": "1" + }, + { + "Key": "kops.k8s.io/instancegroup", + "Value": "master-us-test-1a" + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "Name", + "Value": "master-us-test-1a.masters.nthsqsresources.example.com" + }, + { + "Key": "aws-node-termination-handler/managed", + "Value": "" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki", + "Value": "" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane", + "Value": "" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers", + "Value": "" + }, + { + "Key": "k8s.io/role/master", + "Value": "1" + }, + { + "Key": "kops.k8s.io/instancegroup", + "Value": "master-us-test-1a" + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned" + } + ] + } + ], + "UserData": "extracted" + } + } + }, + "AWSEC2LaunchTemplatenodesnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateName": "nodes.nthsqsresources.example.com", + "LaunchTemplateData": { + "BlockDeviceMappings": [ + { + "DeviceName": "/dev/xvda", + "Ebs": { + "VolumeType": "gp3", + "VolumeSize": 128, + "Iops": 3000, + "Throughput": 125, + "DeleteOnTermination": true, + "Encrypted": true + } + } + ], + "IamInstanceProfile": { + "Name": { + "Ref": "AWSIAMInstanceProfilenodesnthsqsresourcesexamplecom" + } + }, + "ImageId": "ami-12345678", + "InstanceType": "t2.medium", + "KeyName": "kubernetes.nthsqsresources.example.com-c4:a6:ed:9a:a8:89:b9:e2:c3:9c:d6:63:eb:9c:71:57", + "MetadataOptions": { + "HttpPutResponseHopLimit": 1, + "HttpTokens": "optional" + }, + "NetworkInterfaces": [ + { + "AssociatePublicIpAddress": true, + "DeleteOnTermination": true, + "DeviceIndex": 0, + "Groups": [ + { + "Ref": "AWSEC2SecurityGroupnodesnthsqsresourcesexamplecom" + } + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "Name", + "Value": "nodes.nthsqsresources.example.com" + }, + { + "Key": "aws-node-termination-handler/managed", + "Value": "" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, + { + "Key": "k8s.io/role/node", + "Value": "1" + }, + { + "Key": "kops.k8s.io/instancegroup", + "Value": "nodes" + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "Name", + "Value": "nodes.nthsqsresources.example.com" + }, + { + "Key": "aws-node-termination-handler/managed", + "Value": "" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, + { + "Key": "k8s.io/role/node", + "Value": "1" + }, + { + "Key": "kops.k8s.io/instancegroup", + "Value": "nodes" + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned" + } + ] + } + ], + "UserData": "extracted" + } + } + }, + "AWSEC2Route00000": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "AWSEC2RouteTablenthsqsresourcesexamplecom" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "AWSEC2InternetGatewaynthsqsresourcesexamplecom" + } + } + }, + "AWSEC2RouteTablenthsqsresourcesexamplecom": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "AWSEC2VPCnthsqsresourcesexamplecom" + }, + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "Name", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned" + }, + { + "Key": "kubernetes.io/kops/role", + "Value": "public" + } + ] + } + }, + "AWSEC2SecurityGroupEgressfrommastersnthsqsresourcesexamplecomegressall0to000000": { + "Type": "AWS::EC2::SecurityGroupEgress", + "Properties": { + "GroupId": { + "Ref": "AWSEC2SecurityGroupmastersnthsqsresourcesexamplecom" + }, + "FromPort": 0, + "ToPort": 0, + "IpProtocol": "-1", + "CidrIp": "0.0.0.0/0" + } + }, + "AWSEC2SecurityGroupEgressfromnodesnthsqsresourcesexamplecomegressall0to000000": { + "Type": "AWS::EC2::SecurityGroupEgress", + "Properties": { + "GroupId": { + "Ref": "AWSEC2SecurityGroupnodesnthsqsresourcesexamplecom" + }, + "FromPort": 0, + "ToPort": 0, + "IpProtocol": "-1", + "CidrIp": "0.0.0.0/0" + } + }, + "AWSEC2SecurityGroupIngressfrom00000ingresstcp22to22mastersnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::SecurityGroupIngress", + "Properties": { + "GroupId": { + "Ref": "AWSEC2SecurityGroupmastersnthsqsresourcesexamplecom" + }, + "FromPort": 22, + "ToPort": 22, + "IpProtocol": "tcp", + "CidrIp": "0.0.0.0/0" + } + }, + "AWSEC2SecurityGroupIngressfrom00000ingresstcp22to22nodesnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::SecurityGroupIngress", + "Properties": { + "GroupId": { + "Ref": "AWSEC2SecurityGroupnodesnthsqsresourcesexamplecom" + }, + "FromPort": 22, + "ToPort": 22, + "IpProtocol": "tcp", + "CidrIp": "0.0.0.0/0" + } + }, + "AWSEC2SecurityGroupIngressfrom00000ingresstcp443to443mastersnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::SecurityGroupIngress", + "Properties": { + "GroupId": { + "Ref": "AWSEC2SecurityGroupmastersnthsqsresourcesexamplecom" + }, + "FromPort": 443, + "ToPort": 443, + "IpProtocol": "tcp", + "CidrIp": "0.0.0.0/0" + } + }, + "AWSEC2SecurityGroupIngressfrommastersnthsqsresourcesexamplecomingressall0to0mastersnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::SecurityGroupIngress", + "Properties": { + "GroupId": { + "Ref": "AWSEC2SecurityGroupmastersnthsqsresourcesexamplecom" + }, + "SourceSecurityGroupId": { + "Ref": "AWSEC2SecurityGroupmastersnthsqsresourcesexamplecom" + }, + "FromPort": 0, + "ToPort": 0, + "IpProtocol": "-1" + } + }, + "AWSEC2SecurityGroupIngressfrommastersnthsqsresourcesexamplecomingressall0to0nodesnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::SecurityGroupIngress", + "Properties": { + "GroupId": { + "Ref": "AWSEC2SecurityGroupnodesnthsqsresourcesexamplecom" + }, + "SourceSecurityGroupId": { + "Ref": "AWSEC2SecurityGroupmastersnthsqsresourcesexamplecom" + }, + "FromPort": 0, + "ToPort": 0, + "IpProtocol": "-1" + } + }, + "AWSEC2SecurityGroupIngressfromnodesnthsqsresourcesexamplecomingressall0to0nodesnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::SecurityGroupIngress", + "Properties": { + "GroupId": { + "Ref": "AWSEC2SecurityGroupnodesnthsqsresourcesexamplecom" + }, + "SourceSecurityGroupId": { + "Ref": "AWSEC2SecurityGroupnodesnthsqsresourcesexamplecom" + }, + "FromPort": 0, + "ToPort": 0, + "IpProtocol": "-1" + } + }, + "AWSEC2SecurityGroupIngressfromnodesnthsqsresourcesexamplecomingresstcp1to2379mastersnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::SecurityGroupIngress", + "Properties": { + "GroupId": { + "Ref": "AWSEC2SecurityGroupmastersnthsqsresourcesexamplecom" + }, + "SourceSecurityGroupId": { + "Ref": "AWSEC2SecurityGroupnodesnthsqsresourcesexamplecom" + }, + "FromPort": 1, + "ToPort": 2379, + "IpProtocol": "tcp" + } + }, + "AWSEC2SecurityGroupIngressfromnodesnthsqsresourcesexamplecomingresstcp2382to4000mastersnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::SecurityGroupIngress", + "Properties": { + "GroupId": { + "Ref": "AWSEC2SecurityGroupmastersnthsqsresourcesexamplecom" + }, + "SourceSecurityGroupId": { + "Ref": "AWSEC2SecurityGroupnodesnthsqsresourcesexamplecom" + }, + "FromPort": 2382, + "ToPort": 4000, + "IpProtocol": "tcp" + } + }, + "AWSEC2SecurityGroupIngressfromnodesnthsqsresourcesexamplecomingresstcp4003to65535mastersnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::SecurityGroupIngress", + "Properties": { + "GroupId": { + "Ref": "AWSEC2SecurityGroupmastersnthsqsresourcesexamplecom" + }, + "SourceSecurityGroupId": { + "Ref": "AWSEC2SecurityGroupnodesnthsqsresourcesexamplecom" + }, + "FromPort": 4003, + "ToPort": 65535, + "IpProtocol": "tcp" + } + }, + "AWSEC2SecurityGroupIngressfromnodesnthsqsresourcesexamplecomingressudp1to65535mastersnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::SecurityGroupIngress", + "Properties": { + "GroupId": { + "Ref": "AWSEC2SecurityGroupmastersnthsqsresourcesexamplecom" + }, + "SourceSecurityGroupId": { + "Ref": "AWSEC2SecurityGroupnodesnthsqsresourcesexamplecom" + }, + "FromPort": 1, + "ToPort": 65535, + "IpProtocol": "udp" + } + }, + "AWSEC2SecurityGroupmastersnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupName": "masters.nthsqsresources.example.com", + "VpcId": { + "Ref": "AWSEC2VPCnthsqsresourcesexamplecom" + }, + "GroupDescription": "Security group for masters", + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "Name", + "Value": "masters.nthsqsresources.example.com" + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned" + } + ] + } + }, + "AWSEC2SecurityGroupnodesnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupName": "nodes.nthsqsresources.example.com", + "VpcId": { + "Ref": "AWSEC2VPCnthsqsresourcesexamplecom" + }, + "GroupDescription": "Security group for nodes", + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "Name", + "Value": "nodes.nthsqsresources.example.com" + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned" + } + ] + } + }, + "AWSEC2SubnetRouteTableAssociationustest1anthsqsresourcesexamplecom": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "SubnetId": { + "Ref": "AWSEC2Subnetustest1anthsqsresourcesexamplecom" + }, + "RouteTableId": { + "Ref": "AWSEC2RouteTablenthsqsresourcesexamplecom" + } + } + }, + "AWSEC2Subnetustest1anthsqsresourcesexamplecom": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "AWSEC2VPCnthsqsresourcesexamplecom" + }, + "CidrBlock": "172.20.32.0/19", + "AvailabilityZone": "us-test-1a", + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "Name", + "Value": "us-test-1a.nthsqsresources.example.com" + }, + { + "Key": "SubnetType", + "Value": "Public" + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned" + }, + { + "Key": "kubernetes.io/role/elb", + "Value": "1" + } + ] + } + }, + "AWSEC2VPCDHCPOptionsAssociationnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::VPCDHCPOptionsAssociation", + "Properties": { + "VpcId": { + "Ref": "AWSEC2VPCnthsqsresourcesexamplecom" + }, + "DhcpOptionsId": { + "Ref": "AWSEC2DHCPOptionsnthsqsresourcesexamplecom" + } + } + }, + "AWSEC2VPCGatewayAttachmentnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "VpcId": { + "Ref": "AWSEC2VPCnthsqsresourcesexamplecom" + }, + "InternetGatewayId": { + "Ref": "AWSEC2InternetGatewaynthsqsresourcesexamplecom" + } + } + }, + "AWSEC2VPCnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "172.20.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "Name", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned" + } + ] + } + }, + "AWSEC2Volumeustest1aetcdeventsnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::Volume", + "Properties": { + "AvailabilityZone": "us-test-1a", + "Size": 20, + "VolumeType": "gp3", + "Iops": 3000, + "Throughput": 125, + "Encrypted": false, + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "Name", + "Value": "us-test-1a.etcd-events.nthsqsresources.example.com" + }, + { + "Key": "k8s.io/etcd/events", + "Value": "us-test-1a/us-test-1a" + }, + { + "Key": "k8s.io/role/master", + "Value": "1" + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned" + } + ] + } + }, + "AWSEC2Volumeustest1aetcdmainnthsqsresourcesexamplecom": { + "Type": "AWS::EC2::Volume", + "Properties": { + "AvailabilityZone": "us-test-1a", + "Size": 20, + "VolumeType": "gp3", + "Iops": 3000, + "Throughput": 125, + "Encrypted": false, + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "Name", + "Value": "us-test-1a.etcd-main.nthsqsresources.example.com" + }, + { + "Key": "k8s.io/etcd/main", + "Value": "us-test-1a/us-test-1a" + }, + { + "Key": "k8s.io/role/master", + "Value": "1" + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned" + } + ] + } + }, + "AWSEventsRulenthsqsresourcesexamplecomASGLifecycle": { + "Type": "AWS::Events::Rule", + "Properties": { + "Name": "nthsqsresources.example.com-ASGLifecycle", + "EventPattern": { + "detail-type": [ + "EC2 Instance-terminate Lifecycle Action" + ], + "source": [ + "aws.autoscaling" + ] + }, + "Targets": [ + { + "Id": "1", + "Arn": "arn:aws:sqs:us-test-1:123456789012:nthsqsresources-example-com-nth" + } + ] + } + }, + "AWSEventsRulenthsqsresourcesexamplecomRebalanceRecommendation": { + "Type": "AWS::Events::Rule", + "Properties": { + "Name": "nthsqsresources.example.com-RebalanceRecommendation", + "EventPattern": { + "detail-type": [ + "EC2 Instance Rebalance Recommendation" + ], + "source": [ + "aws.ec2" + ] + }, + "Targets": [ + { + "Id": "1", + "Arn": "arn:aws:sqs:us-test-1:123456789012:nthsqsresources-example-com-nth" + } + ] + } + }, + "AWSEventsRulenthsqsresourcesexamplecomSpotInterruption": { + "Type": "AWS::Events::Rule", + "Properties": { + "Name": "nthsqsresources.example.com-SpotInterruption", + "EventPattern": { + "detail-type": [ + "EC2 Spot Instance Interruption Warning" + ], + "source": [ + "aws.ec2" + ] + }, + "Targets": [ + { + "Id": "1", + "Arn": "arn:aws:sqs:us-test-1:123456789012:nthsqsresources-example-com-nth" + } + ] + } + }, + "AWSIAMInstanceProfilemastersnthsqsresourcesexamplecom": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "InstanceProfileName": "masters.nthsqsresources.example.com", + "Roles": [ + { + "Ref": "AWSIAMRolemastersnthsqsresourcesexamplecom" + } + ] + } + }, + "AWSIAMInstanceProfilenodesnthsqsresourcesexamplecom": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "InstanceProfileName": "nodes.nthsqsresources.example.com", + "Roles": [ + { + "Ref": "AWSIAMRolenodesnthsqsresourcesexamplecom" + } + ] + } + }, + "AWSIAMPolicymastersnthsqsresourcesexamplecom": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyName": "masters.nthsqsresources.example.com", + "Roles": [ + { + "Ref": "AWSIAMRolemastersnthsqsresourcesexamplecom" + } + ], + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ec2:DescribeAccountAttributes", + "ec2:DescribeInstances", + "ec2:DescribeInternetGateways", + "ec2:DescribeRegions", + "ec2:DescribeRouteTables", + "ec2:DescribeSecurityGroups", + "ec2:DescribeSubnets", + "ec2:DescribeVolumes" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "ec2:CreateSecurityGroup", + "ec2:CreateTags", + "ec2:CreateVolume", + "ec2:DescribeVolumesModifications", + "ec2:ModifyInstanceAttribute", + "ec2:ModifyVolume" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "ec2:AttachVolume", + "ec2:AuthorizeSecurityGroupIngress", + "ec2:CreateRoute", + "ec2:DeleteRoute", + "ec2:DeleteSecurityGroup", + "ec2:DeleteVolume", + "ec2:DetachVolume", + "ec2:RevokeSecurityGroupIngress" + ], + "Condition": { + "StringEquals": { + "ec2:ResourceTag/KubernetesCluster": "nthsqsresources.example.com" + } + }, + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "autoscaling:DescribeAutoScalingGroups", + "autoscaling:DescribeLaunchConfigurations", + "autoscaling:DescribeTags", + "ec2:DescribeLaunchTemplateVersions" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "autoscaling:SetDesiredCapacity", + "autoscaling:TerminateInstanceInAutoScalingGroup", + "autoscaling:UpdateAutoScalingGroup" + ], + "Condition": { + "StringEquals": { + "autoscaling:ResourceTag/KubernetesCluster": "nthsqsresources.example.com" + } + }, + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "autoscaling:CompleteLifecycleAction", + "autoscaling:DescribeAutoScalingInstances" + ], + "Condition": { + "StringEquals": { + "autoscaling:ResourceTag/KubernetesCluster": "nthsqsresources.example.com" + } + }, + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "elasticloadbalancing:AddTags", + "elasticloadbalancing:AttachLoadBalancerToSubnets", + "elasticloadbalancing:ApplySecurityGroupsToLoadBalancer", + "elasticloadbalancing:CreateLoadBalancer", + "elasticloadbalancing:CreateLoadBalancerPolicy", + "elasticloadbalancing:CreateLoadBalancerListeners", + "elasticloadbalancing:ConfigureHealthCheck", + "elasticloadbalancing:DeleteLoadBalancer", + "elasticloadbalancing:DeleteLoadBalancerListeners", + "elasticloadbalancing:DescribeLoadBalancers", + "elasticloadbalancing:DescribeLoadBalancerAttributes", + "elasticloadbalancing:DetachLoadBalancerFromSubnets", + "elasticloadbalancing:DeregisterInstancesFromLoadBalancer", + "elasticloadbalancing:ModifyLoadBalancerAttributes", + "elasticloadbalancing:RegisterInstancesWithLoadBalancer", + "elasticloadbalancing:SetLoadBalancerPoliciesForBackendServer" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "ec2:DescribeVpcs", + "elasticloadbalancing:AddTags", + "elasticloadbalancing:CreateListener", + "elasticloadbalancing:CreateTargetGroup", + "elasticloadbalancing:DeleteListener", + "elasticloadbalancing:DeleteTargetGroup", + "elasticloadbalancing:DeregisterTargets", + "elasticloadbalancing:DescribeListeners", + "elasticloadbalancing:DescribeLoadBalancerPolicies", + "elasticloadbalancing:DescribeTargetGroups", + "elasticloadbalancing:DescribeTargetHealth", + "elasticloadbalancing:ModifyListener", + "elasticloadbalancing:ModifyTargetGroup", + "elasticloadbalancing:RegisterTargets", + "elasticloadbalancing:SetLoadBalancerPoliciesOfListener" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "iam:ListServerCertificates", + "iam:GetServerCertificate" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "route53:ChangeResourceRecordSets", + "route53:ListResourceRecordSets", + "route53:GetHostedZone" + ], + "Effect": "Allow", + "Resource": [ + "arn:aws:route53:::hostedzone/Z1AFAKE1ZON3YO" + ] + }, + { + "Action": [ + "route53:GetChange" + ], + "Effect": "Allow", + "Resource": [ + "arn:aws:route53:::change/*" + ] + }, + { + "Action": [ + "route53:ListHostedZones" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "autoscaling:CompleteLifecycleAction", + "autoscaling:DescribeAutoScalingInstances", + "sqs:DeleteMessage", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + } + ], + "Version": "2012-10-17" + } + } + }, + "AWSIAMPolicynodesnthsqsresourcesexamplecom": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyName": "nodes.nthsqsresources.example.com", + "Roles": [ + { + "Ref": "AWSIAMRolenodesnthsqsresourcesexamplecom" + } + ], + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ec2:DescribeInstances", + "ec2:DescribeRegions" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": "autoscaling:DescribeAutoScalingInstances", + "Effect": "Allow", + "Resource": [ + "*" + ] + } + ], + "Version": "2012-10-17" + } + } + }, + "AWSIAMRolemastersnthsqsresourcesexamplecom": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": "masters.nthsqsresources.example.com", + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "Name", + "Value": "masters.nthsqsresources.example.com" + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned" + } + ] + } + }, + "AWSIAMRolenodesnthsqsresourcesexamplecom": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": "nodes.nthsqsresources.example.com", + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "Name", + "Value": "nodes.nthsqsresources.example.com" + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned" + } + ] + } + }, + "AWSSQSQueuePolicynthsqsresourcesexamplecomnthPolicy": { + "Type": "AWS::SQS::QueuePolicy", + "Properties": { + "Queues": [ + { + "Ref": "AWSSQSQueuenthsqsresourcesexamplecomnth" + } + ], + "PolicyDocument": { + "Statement": [ + { + "Action": "sqs:SendMessage", + "Effect": "Allow", + "Principal": { + "Service": [ + "events.amazonaws.com", + "sqs.amazonaws.com" + ] + }, + "Resource": [ + "arn:aws:sqs:us-test-1:123456789012:nthsqsresources-example-com-nth" + ] + } + ], + "Version": "2012-10-17" + } + } + }, + "AWSSQSQueuenthsqsresourcesexamplecomnth": { + "Type": "AWS::SQS::Queue", + "Properties": { + "QueueName": "nthsqsresources-example-com-nth", + "MessageRetentionPeriod": 300, + "Tags": [ + { + "Key": "KubernetesCluster", + "Value": "nthsqsresources.example.com" + }, + { + "Key": "Name", + "Value": "nthsqsresources-example-com-nth" + }, + { + "Key": "kubernetes.io/cluster/nthsqsresources.example.com", + "Value": "owned" + } + ] + } + } + } +} diff --git a/tests/integration/update_cluster/nth_sqs_resources/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/nth_sqs_resources/cloudformation.json.extracted.yaml new file mode 100644 index 0000000000..61f8c1c4ae --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/cloudformation.json.extracted.yaml @@ -0,0 +1,562 @@ +Resources.AWSEC2LaunchTemplatemasterustest1amastersnthsqsresourcesexamplecom.Properties.LaunchTemplateData.UserData: | + #!/bin/bash + set -o errexit + set -o nounset + set -o pipefail + + NODEUP_URL_AMD64=https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/amd64/nodeup,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/nodeup-linux-amd64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/amd64/nodeup + NODEUP_HASH_AMD64=585fbda0f0a43184656b4bfc0cc5f0c0b85612faf43b8816acca1f99d422c924 + NODEUP_URL_ARM64=https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/arm64/nodeup,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/nodeup-linux-arm64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/arm64/nodeup + NODEUP_HASH_ARM64=7603675379699105a9b9915ff97718ea99b1bbb01a4c184e2f827c8a96e8e865 + + export AWS_REGION=us-test-1 + + + + + sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true + + + function ensure-install-dir() { + INSTALL_DIR="/opt/kops" + # On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec + if [[ -d /var/lib/toolbox ]]; then + INSTALL_DIR="/var/lib/toolbox/kops" + fi + mkdir -p ${INSTALL_DIR}/bin + mkdir -p ${INSTALL_DIR}/conf + cd ${INSTALL_DIR} + } + + # Retry a download until we get it. args: name, sha, url1, url2... + download-or-bust() { + local -r file="$1" + local -r hash="$2" + shift 2 + + urls=( $* ) + while true; do + for url in "${urls[@]}"; do + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" + continue + fi + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" + else + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return + fi + done + done + + echo "All downloads failed; sleeping before retrying" + sleep 60 + done + } + + validate-hash() { + local -r file="$1" + local -r expected="$2" + local actual + + actual=$(sha256sum ${file} | awk '{ print $1 }') || true + if [[ "${actual}" != "${expected}" ]]; then + echo "== ${file} corrupted, hash ${actual} doesn't match expected ${expected} ==" + return 1 + fi + } + + function split-commas() { + echo $1 | tr "," "\n" + } + + function try-download-release() { + local -r nodeup_urls=( $(split-commas "${NODEUP_URL}") ) + if [[ -n "${NODEUP_HASH:-}" ]]; then + local -r nodeup_hash="${NODEUP_HASH}" + else + # TODO: Remove? + echo "Downloading sha256 (not found in env)" + download-or-bust nodeup.sha256 "" "${nodeup_urls[@]/%/.sha256}" + local -r nodeup_hash=$(cat nodeup.sha256) + fi + + echo "Downloading nodeup (${nodeup_urls[@]})" + download-or-bust nodeup "${nodeup_hash}" "${nodeup_urls[@]}" + + chmod +x nodeup + } + + function download-release() { + case "$(uname -m)" in + x86_64*|i?86_64*|amd64*) + NODEUP_URL="${NODEUP_URL_AMD64}" + NODEUP_HASH="${NODEUP_HASH_AMD64}" + ;; + aarch64*|arm64*) + NODEUP_URL="${NODEUP_URL_ARM64}" + NODEUP_HASH="${NODEUP_HASH_ARM64}" + ;; + *) + echo "Unsupported host arch: $(uname -m)" >&2 + exit 1 + ;; + esac + + # In case of failure checking integrity of release, retry. + cd ${INSTALL_DIR}/bin + until try-download-release; do + sleep 15 + echo "Couldn't download release. Retrying..." + done + + echo "Running nodeup" + # We can't run in the foreground because of https://github.com/docker/docker/issues/23793 + ( cd ${INSTALL_DIR}/bin; ./nodeup --install-systemd-unit --conf=${INSTALL_DIR}/conf/kube_env.yaml --v=8 ) + } + + #################################################################################### + + /bin/systemd-machine-id-setup || echo "failed to set up ensure machine-id configured" + + echo "== nodeup node config starting ==" + ensure-install-dir + + cat > conf/cluster_spec.yaml << '__EOF_CLUSTER_SPEC' + cloudConfig: + manageStorageClasses: true + containerRuntime: containerd + containerd: + configOverride: | + version = 2 + + [plugins] + + [plugins."io.containerd.grpc.v1.cri"] + + [plugins."io.containerd.grpc.v1.cri".containerd] + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes] + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] + runtime_type = "io.containerd.runc.v2" + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] + SystemdCgroup = true + logLevel: info + version: 1.4.4 + docker: + skipInstall: true + encryptionConfig: null + etcdClusters: + events: + version: 3.4.13 + main: + version: 3.4.13 + kubeAPIServer: + allowPrivileged: true + anonymousAuth: false + apiAudiences: + - kubernetes.svc.default + apiServerCount: 1 + authorizationMode: AlwaysAllow + bindAddress: 0.0.0.0 + cloudProvider: aws + enableAdmissionPlugins: + - NamespaceLifecycle + - LimitRanger + - ServiceAccount + - PersistentVolumeLabel + - DefaultStorageClass + - DefaultTolerationSeconds + - MutatingAdmissionWebhook + - ValidatingAdmissionWebhook + - NodeRestriction + - ResourceQuota + etcdServers: + - http://127.0.0.1:4001 + etcdServersOverrides: + - /events#http://127.0.0.1:4002 + image: k8s.gcr.io/kube-apiserver:v1.20.0 + kubeletPreferredAddressTypes: + - InternalIP + - Hostname + - ExternalIP + logLevel: 2 + requestheaderAllowedNames: + - aggregator + requestheaderExtraHeaderPrefixes: + - X-Remote-Extra- + requestheaderGroupHeaders: + - X-Remote-Group + requestheaderUsernameHeaders: + - X-Remote-User + securePort: 443 + serviceAccountIssuer: https://api.internal.nthsqsresources.example.com + serviceAccountJWKSURI: https://api.internal.nthsqsresources.example.com/openid/v1/jwks + serviceClusterIPRange: 100.64.0.0/13 + storageBackend: etcd3 + kubeControllerManager: + allocateNodeCIDRs: true + attachDetachReconcileSyncPeriod: 1m0s + cloudProvider: aws + clusterCIDR: 100.96.0.0/11 + clusterName: nthsqsresources.example.com + configureCloudRoutes: false + image: k8s.gcr.io/kube-controller-manager:v1.20.0 + leaderElection: + leaderElect: true + logLevel: 2 + useServiceAccountCredentials: true + kubeProxy: + clusterCIDR: 100.96.0.0/11 + cpuRequest: 100m + hostnameOverride: '@aws' + image: k8s.gcr.io/kube-proxy:v1.20.0 + logLevel: 2 + kubeScheduler: + image: k8s.gcr.io/kube-scheduler:v1.20.0 + leaderElection: + leaderElect: true + logLevel: 2 + kubelet: + anonymousAuth: false + cgroupDriver: systemd + cgroupRoot: / + cloudProvider: aws + clusterDNS: 100.64.0.10 + clusterDomain: cluster.local + enableDebuggingHandlers: true + evictionHard: memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<10%,imagefs.inodesFree<5% + hostnameOverride: '@aws' + kubeconfigPath: /var/lib/kubelet/kubeconfig + logLevel: 2 + networkPluginName: cni + nonMasqueradeCIDR: 100.64.0.0/10 + podManifestPath: /etc/kubernetes/manifests + masterKubelet: + anonymousAuth: false + cgroupDriver: systemd + cgroupRoot: / + cloudProvider: aws + clusterDNS: 100.64.0.10 + clusterDomain: cluster.local + enableDebuggingHandlers: true + evictionHard: memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<10%,imagefs.inodesFree<5% + hostnameOverride: '@aws' + kubeconfigPath: /var/lib/kubelet/kubeconfig + logLevel: 2 + networkPluginName: cni + nonMasqueradeCIDR: 100.64.0.0/10 + podManifestPath: /etc/kubernetes/manifests + registerSchedulable: false + + __EOF_CLUSTER_SPEC + + cat > conf/ig_spec.yaml << '__EOF_IG_SPEC' + {} + + __EOF_IG_SPEC + + cat > conf/kube_env.yaml << '__EOF_KUBE_ENV' + Assets: + amd64: + - ff2422571c4c1e9696e367f5f25466b96fb6e501f28aed29f414b1524a52dea0@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/amd64/kubelet + - a5895007f331f08d2e082eb12458764949559f30bcc5beae26c38f3e2724262c@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/amd64/kubectl + - 977824932d5667c7a37aa6a3cbba40100a6873e7bd97e83e8be837e3e7afd0a8@https://storage.googleapis.com/k8s-artifacts-cni/release/v0.8.7/cni-plugins-linux-amd64-v0.8.7.tgz + - 96641849cb78a0a119223a427dfdc1ade88412ef791a14193212c8c8e29d447b@https://github.com/containerd/containerd/releases/download/v1.4.4/cri-containerd-cni-1.4.4-linux-amd64.tar.gz + - f90ed6dcef534e6d1ae17907dc7eb40614b8945ad4af7f0e98d2be7cde8165c6@https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/amd64/protokube,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/protokube-linux-amd64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/amd64/protokube + - 9992e7eb2a2e93f799e5a9e98eb718637433524bc65f630357201a79f49b13d0@https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/amd64/channels,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/channels-linux-amd64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/amd64/channels + arm64: + - 47ab6c4273fc3bb0cb8ec9517271d915890c5a6b0e54b2991e7a8fbbe77b06e4@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/arm64/kubelet + - 25e4465870c99167e6c466623ed8f05a1d20fbcb48cab6688109389b52d87623@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/arm64/kubectl + - ae13d7b5c05bd180ea9b5b68f44bdaa7bfb41034a2ef1d68fd8e1259797d642f@https://storage.googleapis.com/k8s-artifacts-cni/release/v0.8.7/cni-plugins-linux-arm64-v0.8.7.tgz + - 998b3b6669335f1a1d8c475fb7c211ed1e41c2ff37275939e2523666ccb7d910@https://download.docker.com/linux/static/stable/aarch64/docker-20.10.6.tgz + - 2f599c3d54f4c4bdbcc95aaf0c7b513a845d8f9503ec5b34c9f86aa1bc34fc0c@https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/arm64/protokube,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/protokube-linux-arm64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/arm64/protokube + - 9d842e3636a95de2315cdea2be7a282355aac0658ef0b86d5dc2449066538f13@https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/arm64/channels,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/channels-linux-arm64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/arm64/channels + ClusterName: nthsqsresources.example.com + ConfigBase: memfs://clusters.example.com/nthsqsresources.example.com + InstanceGroupName: master-us-test-1a + InstanceGroupRole: Master + KubeletConfig: + anonymousAuth: false + cgroupDriver: systemd + cgroupRoot: / + cloudProvider: aws + clusterDNS: 100.64.0.10 + clusterDomain: cluster.local + enableDebuggingHandlers: true + evictionHard: memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<10%,imagefs.inodesFree<5% + hostnameOverride: '@aws' + kubeconfigPath: /var/lib/kubelet/kubeconfig + logLevel: 2 + networkPluginName: cni + nodeLabels: + kops.k8s.io/kops-controller-pki: "" + kubernetes.io/role: master + node-role.kubernetes.io/control-plane: "" + node-role.kubernetes.io/master: "" + node.kubernetes.io/exclude-from-external-load-balancers: "" + nonMasqueradeCIDR: 100.64.0.0/10 + podManifestPath: /etc/kubernetes/manifests + registerSchedulable: false + channels: + - memfs://clusters.example.com/nthsqsresources.example.com/addons/bootstrap-channel.yaml + etcdManifests: + - memfs://clusters.example.com/nthsqsresources.example.com/manifests/etcd/main.yaml + - memfs://clusters.example.com/nthsqsresources.example.com/manifests/etcd/events.yaml + staticManifests: + - key: kube-apiserver-healthcheck + path: manifests/static/kube-apiserver-healthcheck.yaml + + __EOF_KUBE_ENV + + download-release + echo "== nodeup node config done ==" +Resources.AWSEC2LaunchTemplatenodesnthsqsresourcesexamplecom.Properties.LaunchTemplateData.UserData: | + #!/bin/bash + set -o errexit + set -o nounset + set -o pipefail + + NODEUP_URL_AMD64=https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/amd64/nodeup,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/nodeup-linux-amd64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/amd64/nodeup + NODEUP_HASH_AMD64=585fbda0f0a43184656b4bfc0cc5f0c0b85612faf43b8816acca1f99d422c924 + NODEUP_URL_ARM64=https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/arm64/nodeup,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/nodeup-linux-arm64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/arm64/nodeup + NODEUP_HASH_ARM64=7603675379699105a9b9915ff97718ea99b1bbb01a4c184e2f827c8a96e8e865 + + export AWS_REGION=us-test-1 + + + + + sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true + + + function ensure-install-dir() { + INSTALL_DIR="/opt/kops" + # On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec + if [[ -d /var/lib/toolbox ]]; then + INSTALL_DIR="/var/lib/toolbox/kops" + fi + mkdir -p ${INSTALL_DIR}/bin + mkdir -p ${INSTALL_DIR}/conf + cd ${INSTALL_DIR} + } + + # Retry a download until we get it. args: name, sha, url1, url2... + download-or-bust() { + local -r file="$1" + local -r hash="$2" + shift 2 + + urls=( $* ) + while true; do + for url in "${urls[@]}"; do + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" + continue + fi + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" + else + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return + fi + done + done + + echo "All downloads failed; sleeping before retrying" + sleep 60 + done + } + + validate-hash() { + local -r file="$1" + local -r expected="$2" + local actual + + actual=$(sha256sum ${file} | awk '{ print $1 }') || true + if [[ "${actual}" != "${expected}" ]]; then + echo "== ${file} corrupted, hash ${actual} doesn't match expected ${expected} ==" + return 1 + fi + } + + function split-commas() { + echo $1 | tr "," "\n" + } + + function try-download-release() { + local -r nodeup_urls=( $(split-commas "${NODEUP_URL}") ) + if [[ -n "${NODEUP_HASH:-}" ]]; then + local -r nodeup_hash="${NODEUP_HASH}" + else + # TODO: Remove? + echo "Downloading sha256 (not found in env)" + download-or-bust nodeup.sha256 "" "${nodeup_urls[@]/%/.sha256}" + local -r nodeup_hash=$(cat nodeup.sha256) + fi + + echo "Downloading nodeup (${nodeup_urls[@]})" + download-or-bust nodeup "${nodeup_hash}" "${nodeup_urls[@]}" + + chmod +x nodeup + } + + function download-release() { + case "$(uname -m)" in + x86_64*|i?86_64*|amd64*) + NODEUP_URL="${NODEUP_URL_AMD64}" + NODEUP_HASH="${NODEUP_HASH_AMD64}" + ;; + aarch64*|arm64*) + NODEUP_URL="${NODEUP_URL_ARM64}" + NODEUP_HASH="${NODEUP_HASH_ARM64}" + ;; + *) + echo "Unsupported host arch: $(uname -m)" >&2 + exit 1 + ;; + esac + + # In case of failure checking integrity of release, retry. + cd ${INSTALL_DIR}/bin + until try-download-release; do + sleep 15 + echo "Couldn't download release. Retrying..." + done + + echo "Running nodeup" + # We can't run in the foreground because of https://github.com/docker/docker/issues/23793 + ( cd ${INSTALL_DIR}/bin; ./nodeup --install-systemd-unit --conf=${INSTALL_DIR}/conf/kube_env.yaml --v=8 ) + } + + #################################################################################### + + /bin/systemd-machine-id-setup || echo "failed to set up ensure machine-id configured" + + echo "== nodeup node config starting ==" + ensure-install-dir + + cat > conf/cluster_spec.yaml << '__EOF_CLUSTER_SPEC' + cloudConfig: + manageStorageClasses: true + containerRuntime: containerd + containerd: + configOverride: | + version = 2 + + [plugins] + + [plugins."io.containerd.grpc.v1.cri"] + + [plugins."io.containerd.grpc.v1.cri".containerd] + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes] + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] + runtime_type = "io.containerd.runc.v2" + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] + SystemdCgroup = true + logLevel: info + version: 1.4.4 + docker: + skipInstall: true + kubeProxy: + clusterCIDR: 100.96.0.0/11 + cpuRequest: 100m + hostnameOverride: '@aws' + image: k8s.gcr.io/kube-proxy:v1.20.0 + logLevel: 2 + kubelet: + anonymousAuth: false + cgroupDriver: systemd + cgroupRoot: / + cloudProvider: aws + clusterDNS: 100.64.0.10 + clusterDomain: cluster.local + enableDebuggingHandlers: true + evictionHard: memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<10%,imagefs.inodesFree<5% + hostnameOverride: '@aws' + kubeconfigPath: /var/lib/kubelet/kubeconfig + logLevel: 2 + networkPluginName: cni + nonMasqueradeCIDR: 100.64.0.0/10 + podManifestPath: /etc/kubernetes/manifests + + __EOF_CLUSTER_SPEC + + cat > conf/ig_spec.yaml << '__EOF_IG_SPEC' + {} + + __EOF_IG_SPEC + + cat > conf/kube_env.yaml << '__EOF_KUBE_ENV' + Assets: + amd64: + - ff2422571c4c1e9696e367f5f25466b96fb6e501f28aed29f414b1524a52dea0@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/amd64/kubelet + - a5895007f331f08d2e082eb12458764949559f30bcc5beae26c38f3e2724262c@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/amd64/kubectl + - 977824932d5667c7a37aa6a3cbba40100a6873e7bd97e83e8be837e3e7afd0a8@https://storage.googleapis.com/k8s-artifacts-cni/release/v0.8.7/cni-plugins-linux-amd64-v0.8.7.tgz + - 96641849cb78a0a119223a427dfdc1ade88412ef791a14193212c8c8e29d447b@https://github.com/containerd/containerd/releases/download/v1.4.4/cri-containerd-cni-1.4.4-linux-amd64.tar.gz + arm64: + - 47ab6c4273fc3bb0cb8ec9517271d915890c5a6b0e54b2991e7a8fbbe77b06e4@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/arm64/kubelet + - 25e4465870c99167e6c466623ed8f05a1d20fbcb48cab6688109389b52d87623@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/arm64/kubectl + - ae13d7b5c05bd180ea9b5b68f44bdaa7bfb41034a2ef1d68fd8e1259797d642f@https://storage.googleapis.com/k8s-artifacts-cni/release/v0.8.7/cni-plugins-linux-arm64-v0.8.7.tgz + - 998b3b6669335f1a1d8c475fb7c211ed1e41c2ff37275939e2523666ccb7d910@https://download.docker.com/linux/static/stable/aarch64/docker-20.10.6.tgz + ClusterName: nthsqsresources.example.com + ConfigBase: memfs://clusters.example.com/nthsqsresources.example.com + InstanceGroupName: nodes + InstanceGroupRole: Node + KubeletConfig: + anonymousAuth: false + cgroupDriver: systemd + cgroupRoot: / + cloudProvider: aws + clusterDNS: 100.64.0.10 + clusterDomain: cluster.local + enableDebuggingHandlers: true + evictionHard: memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<10%,imagefs.inodesFree<5% + hostnameOverride: '@aws' + kubeconfigPath: /var/lib/kubelet/kubeconfig + logLevel: 2 + networkPluginName: cni + nodeLabels: + kubernetes.io/role: node + node-role.kubernetes.io/node: "" + nonMasqueradeCIDR: 100.64.0.0/10 + podManifestPath: /etc/kubernetes/manifests + channels: + - memfs://clusters.example.com/nthsqsresources.example.com/addons/bootstrap-channel.yaml + + __EOF_KUBE_ENV + + download-release + echo "== nodeup node config done ==" diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_nthsqsresources.example.com-ASGLifecycle_event_pattern b/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_nthsqsresources.example.com-ASGLifecycle_event_pattern new file mode 100644 index 0000000000..c8db9dbe9c --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_nthsqsresources.example.com-ASGLifecycle_event_pattern @@ -0,0 +1 @@ +{"source":["aws.autoscaling"],"detail-type":["EC2 Instance-terminate Lifecycle Action"]} diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_nthsqsresources.example.com-RebalanceRecommendation_event_pattern b/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_nthsqsresources.example.com-RebalanceRecommendation_event_pattern new file mode 100644 index 0000000000..226b0ac52d --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_nthsqsresources.example.com-RebalanceRecommendation_event_pattern @@ -0,0 +1 @@ +{"source": ["aws.ec2"],"detail-type": ["EC2 Instance Rebalance Recommendation"]} diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_nthsqsresources.example.com-SpotInterruption_event_pattern b/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_nthsqsresources.example.com-SpotInterruption_event_pattern new file mode 100644 index 0000000000..2d0e83b416 --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_nthsqsresources.example.com-SpotInterruption_event_pattern @@ -0,0 +1 @@ +{"source": ["aws.ec2"],"detail-type": ["EC2 Spot Instance Interruption Warning"]} diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_queueprocessor.example.com-ASGLifecycle_event_pattern b/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_queueprocessor.example.com-ASGLifecycle_event_pattern new file mode 100644 index 0000000000..c8db9dbe9c --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_queueprocessor.example.com-ASGLifecycle_event_pattern @@ -0,0 +1 @@ +{"source":["aws.autoscaling"],"detail-type":["EC2 Instance-terminate Lifecycle Action"]} diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_queueprocessor.example.com-RebalanceRecommendation_event_pattern b/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_queueprocessor.example.com-RebalanceRecommendation_event_pattern new file mode 100644 index 0000000000..226b0ac52d --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_queueprocessor.example.com-RebalanceRecommendation_event_pattern @@ -0,0 +1 @@ +{"source": ["aws.ec2"],"detail-type": ["EC2 Instance Rebalance Recommendation"]} diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_queueprocessor.example.com-SpotInterruption_event_pattern b/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_queueprocessor.example.com-SpotInterruption_event_pattern new file mode 100644 index 0000000000..2d0e83b416 --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_cloudwatch_event_rule_queueprocessor.example.com-SpotInterruption_event_pattern @@ -0,0 +1 @@ +{"source": ["aws.ec2"],"detail-type": ["EC2 Spot Instance Interruption Warning"]} diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_masters.nthsqsresources.example.com_policy b/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_masters.nthsqsresources.example.com_policy new file mode 100644 index 0000000000..66d5de1d5a --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_masters.nthsqsresources.example.com_policy @@ -0,0 +1,10 @@ +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { "Service": "ec2.amazonaws.com"}, + "Action": "sts:AssumeRole" + } + ] +} diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_masters.queueprocessor.example.com_policy b/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_masters.queueprocessor.example.com_policy new file mode 100644 index 0000000000..66d5de1d5a --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_masters.queueprocessor.example.com_policy @@ -0,0 +1,10 @@ +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { "Service": "ec2.amazonaws.com"}, + "Action": "sts:AssumeRole" + } + ] +} diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_nodes.nthsqsresources.example.com_policy b/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_nodes.nthsqsresources.example.com_policy new file mode 100644 index 0000000000..66d5de1d5a --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_nodes.nthsqsresources.example.com_policy @@ -0,0 +1,10 @@ +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { "Service": "ec2.amazonaws.com"}, + "Action": "sts:AssumeRole" + } + ] +} diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_nodes.queueprocessor.example.com_policy b/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_nodes.queueprocessor.example.com_policy new file mode 100644 index 0000000000..66d5de1d5a --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_nodes.queueprocessor.example.com_policy @@ -0,0 +1,10 @@ +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { "Service": "ec2.amazonaws.com"}, + "Action": "sts:AssumeRole" + } + ] +} diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_policy_masters.nthsqsresources.example.com_policy b/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_policy_masters.nthsqsresources.example.com_policy new file mode 100644 index 0000000000..01ce42941a --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_policy_masters.nthsqsresources.example.com_policy @@ -0,0 +1,197 @@ +{ + "Statement": [ + { + "Action": [ + "ec2:DescribeAccountAttributes", + "ec2:DescribeInstances", + "ec2:DescribeInternetGateways", + "ec2:DescribeRegions", + "ec2:DescribeRouteTables", + "ec2:DescribeSecurityGroups", + "ec2:DescribeSubnets", + "ec2:DescribeVolumes" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "ec2:CreateSecurityGroup", + "ec2:CreateTags", + "ec2:CreateVolume", + "ec2:DescribeVolumesModifications", + "ec2:ModifyInstanceAttribute", + "ec2:ModifyVolume" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "ec2:AttachVolume", + "ec2:AuthorizeSecurityGroupIngress", + "ec2:CreateRoute", + "ec2:DeleteRoute", + "ec2:DeleteSecurityGroup", + "ec2:DeleteVolume", + "ec2:DetachVolume", + "ec2:RevokeSecurityGroupIngress" + ], + "Condition": { + "StringEquals": { + "ec2:ResourceTag/KubernetesCluster": "nthsqsresources.example.com" + } + }, + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "autoscaling:DescribeAutoScalingGroups", + "autoscaling:DescribeLaunchConfigurations", + "autoscaling:DescribeTags", + "ec2:DescribeLaunchTemplateVersions" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "autoscaling:SetDesiredCapacity", + "autoscaling:TerminateInstanceInAutoScalingGroup", + "autoscaling:UpdateAutoScalingGroup" + ], + "Condition": { + "StringEquals": { + "autoscaling:ResourceTag/KubernetesCluster": "nthsqsresources.example.com" + } + }, + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "autoscaling:CompleteLifecycleAction", + "autoscaling:DescribeAutoScalingInstances" + ], + "Condition": { + "StringEquals": { + "autoscaling:ResourceTag/KubernetesCluster": "nthsqsresources.example.com" + } + }, + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "elasticloadbalancing:AddTags", + "elasticloadbalancing:AttachLoadBalancerToSubnets", + "elasticloadbalancing:ApplySecurityGroupsToLoadBalancer", + "elasticloadbalancing:CreateLoadBalancer", + "elasticloadbalancing:CreateLoadBalancerPolicy", + "elasticloadbalancing:CreateLoadBalancerListeners", + "elasticloadbalancing:ConfigureHealthCheck", + "elasticloadbalancing:DeleteLoadBalancer", + "elasticloadbalancing:DeleteLoadBalancerListeners", + "elasticloadbalancing:DescribeLoadBalancers", + "elasticloadbalancing:DescribeLoadBalancerAttributes", + "elasticloadbalancing:DetachLoadBalancerFromSubnets", + "elasticloadbalancing:DeregisterInstancesFromLoadBalancer", + "elasticloadbalancing:ModifyLoadBalancerAttributes", + "elasticloadbalancing:RegisterInstancesWithLoadBalancer", + "elasticloadbalancing:SetLoadBalancerPoliciesForBackendServer" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "ec2:DescribeVpcs", + "elasticloadbalancing:AddTags", + "elasticloadbalancing:CreateListener", + "elasticloadbalancing:CreateTargetGroup", + "elasticloadbalancing:DeleteListener", + "elasticloadbalancing:DeleteTargetGroup", + "elasticloadbalancing:DeregisterTargets", + "elasticloadbalancing:DescribeListeners", + "elasticloadbalancing:DescribeLoadBalancerPolicies", + "elasticloadbalancing:DescribeTargetGroups", + "elasticloadbalancing:DescribeTargetHealth", + "elasticloadbalancing:ModifyListener", + "elasticloadbalancing:ModifyTargetGroup", + "elasticloadbalancing:RegisterTargets", + "elasticloadbalancing:SetLoadBalancerPoliciesOfListener" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "iam:ListServerCertificates", + "iam:GetServerCertificate" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "route53:ChangeResourceRecordSets", + "route53:ListResourceRecordSets", + "route53:GetHostedZone" + ], + "Effect": "Allow", + "Resource": [ + "arn:aws:route53:::hostedzone/Z1AFAKE1ZON3YO" + ] + }, + { + "Action": [ + "route53:GetChange" + ], + "Effect": "Allow", + "Resource": [ + "arn:aws:route53:::change/*" + ] + }, + { + "Action": [ + "route53:ListHostedZones" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "autoscaling:CompleteLifecycleAction", + "autoscaling:DescribeAutoScalingInstances", + "sqs:DeleteMessage", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + } + ], + "Version": "2012-10-17" +} diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_policy_masters.queueprocessor.example.com_policy b/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_policy_masters.queueprocessor.example.com_policy new file mode 100644 index 0000000000..5952d6a3e9 --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_policy_masters.queueprocessor.example.com_policy @@ -0,0 +1,182 @@ +{ + "Statement": [ + { + "Action": [ + "ec2:DescribeAccountAttributes", + "ec2:DescribeInstances", + "ec2:DescribeInternetGateways", + "ec2:DescribeRegions", + "ec2:DescribeRouteTables", + "ec2:DescribeSecurityGroups", + "ec2:DescribeSubnets", + "ec2:DescribeVolumes" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "ec2:CreateSecurityGroup", + "ec2:CreateTags", + "ec2:CreateVolume", + "ec2:DescribeVolumesModifications", + "ec2:ModifyInstanceAttribute", + "ec2:ModifyVolume" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "ec2:AttachVolume", + "ec2:AuthorizeSecurityGroupIngress", + "ec2:CreateRoute", + "ec2:DeleteRoute", + "ec2:DeleteSecurityGroup", + "ec2:DeleteVolume", + "ec2:DetachVolume", + "ec2:RevokeSecurityGroupIngress" + ], + "Condition": { + "StringEquals": { + "ec2:ResourceTag/KubernetesCluster": "queueprocessor.example.com" + } + }, + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "autoscaling:DescribeAutoScalingGroups", + "autoscaling:DescribeLaunchConfigurations", + "autoscaling:DescribeTags", + "ec2:DescribeLaunchTemplateVersions" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "autoscaling:SetDesiredCapacity", + "autoscaling:TerminateInstanceInAutoScalingGroup", + "autoscaling:UpdateAutoScalingGroup" + ], + "Condition": { + "StringEquals": { + "autoscaling:ResourceTag/KubernetesCluster": "queueprocessor.example.com" + } + }, + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "elasticloadbalancing:AddTags", + "elasticloadbalancing:AttachLoadBalancerToSubnets", + "elasticloadbalancing:ApplySecurityGroupsToLoadBalancer", + "elasticloadbalancing:CreateLoadBalancer", + "elasticloadbalancing:CreateLoadBalancerPolicy", + "elasticloadbalancing:CreateLoadBalancerListeners", + "elasticloadbalancing:ConfigureHealthCheck", + "elasticloadbalancing:DeleteLoadBalancer", + "elasticloadbalancing:DeleteLoadBalancerListeners", + "elasticloadbalancing:DescribeLoadBalancers", + "elasticloadbalancing:DescribeLoadBalancerAttributes", + "elasticloadbalancing:DetachLoadBalancerFromSubnets", + "elasticloadbalancing:DeregisterInstancesFromLoadBalancer", + "elasticloadbalancing:ModifyLoadBalancerAttributes", + "elasticloadbalancing:RegisterInstancesWithLoadBalancer", + "elasticloadbalancing:SetLoadBalancerPoliciesForBackendServer" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "ec2:DescribeVpcs", + "elasticloadbalancing:AddTags", + "elasticloadbalancing:CreateListener", + "elasticloadbalancing:CreateTargetGroup", + "elasticloadbalancing:DeleteListener", + "elasticloadbalancing:DeleteTargetGroup", + "elasticloadbalancing:DeregisterTargets", + "elasticloadbalancing:DescribeListeners", + "elasticloadbalancing:DescribeLoadBalancerPolicies", + "elasticloadbalancing:DescribeTargetGroups", + "elasticloadbalancing:DescribeTargetHealth", + "elasticloadbalancing:ModifyListener", + "elasticloadbalancing:ModifyTargetGroup", + "elasticloadbalancing:RegisterTargets", + "elasticloadbalancing:SetLoadBalancerPoliciesOfListener" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "iam:ListServerCertificates", + "iam:GetServerCertificate" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "route53:ChangeResourceRecordSets", + "route53:ListResourceRecordSets", + "route53:GetHostedZone" + ], + "Effect": "Allow", + "Resource": [ + "arn:aws:route53:::hostedzone/Z1AFAKE1ZON3YO" + ] + }, + { + "Action": [ + "route53:GetChange" + ], + "Effect": "Allow", + "Resource": [ + "arn:aws:route53:::change/*" + ] + }, + { + "Action": [ + "route53:ListHostedZones" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "autoscaling:CompleteLifecycleAction", + "autoscaling:DescribeAutoScalingInstances", + "sqs:DeleteMessage", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + } + ], + "Version": "2012-10-17" +} diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_policy_nodes.nthsqsresources.example.com_policy b/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_policy_nodes.nthsqsresources.example.com_policy new file mode 100644 index 0000000000..5ff94c80f4 --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_policy_nodes.nthsqsresources.example.com_policy @@ -0,0 +1,22 @@ +{ + "Statement": [ + { + "Action": [ + "ec2:DescribeInstances", + "ec2:DescribeRegions" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": "autoscaling:DescribeAutoScalingInstances", + "Effect": "Allow", + "Resource": [ + "*" + ] + } + ], + "Version": "2012-10-17" +} diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_policy_nodes.queueprocessor.example.com_policy b/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_policy_nodes.queueprocessor.example.com_policy new file mode 100644 index 0000000000..49749a010d --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_iam_role_policy_nodes.queueprocessor.example.com_policy @@ -0,0 +1,15 @@ +{ + "Statement": [ + { + "Action": [ + "ec2:DescribeInstances", + "ec2:DescribeRegions" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + } + ], + "Version": "2012-10-17" +} diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_key_pair_kubernetes.nthsqsresources.example.com-c4a6ed9aa889b9e2c39cd663eb9c7157_public_key b/tests/integration/update_cluster/nth_sqs_resources/data/aws_key_pair_kubernetes.nthsqsresources.example.com-c4a6ed9aa889b9e2c39cd663eb9c7157_public_key new file mode 100644 index 0000000000..81cb012783 --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_key_pair_kubernetes.nthsqsresources.example.com-c4a6ed9aa889b9e2c39cd663eb9c7157_public_key @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ== diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_key_pair_kubernetes.queueprocessor.example.com-c4a6ed9aa889b9e2c39cd663eb9c7157_public_key b/tests/integration/update_cluster/nth_sqs_resources/data/aws_key_pair_kubernetes.queueprocessor.example.com-c4a6ed9aa889b9e2c39cd663eb9c7157_public_key new file mode 100644 index 0000000000..81cb012783 --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_key_pair_kubernetes.queueprocessor.example.com-c4a6ed9aa889b9e2c39cd663eb9c7157_public_key @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ== diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_launch_template_master-us-test-1a.masters.nthsqsresources.example.com_user_data b/tests/integration/update_cluster/nth_sqs_resources/data/aws_launch_template_master-us-test-1a.masters.nthsqsresources.example.com_user_data new file mode 100644 index 0000000000..93542afac0 --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_launch_template_master-us-test-1a.masters.nthsqsresources.example.com_user_data @@ -0,0 +1,328 @@ +#!/bin/bash +set -o errexit +set -o nounset +set -o pipefail + +NODEUP_URL_AMD64=https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/amd64/nodeup,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/nodeup-linux-amd64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/amd64/nodeup +NODEUP_HASH_AMD64=585fbda0f0a43184656b4bfc0cc5f0c0b85612faf43b8816acca1f99d422c924 +NODEUP_URL_ARM64=https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/arm64/nodeup,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/nodeup-linux-arm64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/arm64/nodeup +NODEUP_HASH_ARM64=7603675379699105a9b9915ff97718ea99b1bbb01a4c184e2f827c8a96e8e865 + +export AWS_REGION=us-test-1 + + + + +sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true + + +function ensure-install-dir() { + INSTALL_DIR="/opt/kops" + # On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec + if [[ -d /var/lib/toolbox ]]; then + INSTALL_DIR="/var/lib/toolbox/kops" + fi + mkdir -p ${INSTALL_DIR}/bin + mkdir -p ${INSTALL_DIR}/conf + cd ${INSTALL_DIR} +} + +# Retry a download until we get it. args: name, sha, url1, url2... +download-or-bust() { + local -r file="$1" + local -r hash="$2" + shift 2 + + urls=( $* ) + while true; do + for url in "${urls[@]}"; do + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" + continue + fi + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" + else + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return + fi + done + done + + echo "All downloads failed; sleeping before retrying" + sleep 60 + done +} + +validate-hash() { + local -r file="$1" + local -r expected="$2" + local actual + + actual=$(sha256sum ${file} | awk '{ print $1 }') || true + if [[ "${actual}" != "${expected}" ]]; then + echo "== ${file} corrupted, hash ${actual} doesn't match expected ${expected} ==" + return 1 + fi +} + +function split-commas() { + echo $1 | tr "," "\n" +} + +function try-download-release() { + local -r nodeup_urls=( $(split-commas "${NODEUP_URL}") ) + if [[ -n "${NODEUP_HASH:-}" ]]; then + local -r nodeup_hash="${NODEUP_HASH}" + else + # TODO: Remove? + echo "Downloading sha256 (not found in env)" + download-or-bust nodeup.sha256 "" "${nodeup_urls[@]/%/.sha256}" + local -r nodeup_hash=$(cat nodeup.sha256) + fi + + echo "Downloading nodeup (${nodeup_urls[@]})" + download-or-bust nodeup "${nodeup_hash}" "${nodeup_urls[@]}" + + chmod +x nodeup +} + +function download-release() { + case "$(uname -m)" in + x86_64*|i?86_64*|amd64*) + NODEUP_URL="${NODEUP_URL_AMD64}" + NODEUP_HASH="${NODEUP_HASH_AMD64}" + ;; + aarch64*|arm64*) + NODEUP_URL="${NODEUP_URL_ARM64}" + NODEUP_HASH="${NODEUP_HASH_ARM64}" + ;; + *) + echo "Unsupported host arch: $(uname -m)" >&2 + exit 1 + ;; + esac + + # In case of failure checking integrity of release, retry. + cd ${INSTALL_DIR}/bin + until try-download-release; do + sleep 15 + echo "Couldn't download release. Retrying..." + done + + echo "Running nodeup" + # We can't run in the foreground because of https://github.com/docker/docker/issues/23793 + ( cd ${INSTALL_DIR}/bin; ./nodeup --install-systemd-unit --conf=${INSTALL_DIR}/conf/kube_env.yaml --v=8 ) +} + +#################################################################################### + +/bin/systemd-machine-id-setup || echo "failed to set up ensure machine-id configured" + +echo "== nodeup node config starting ==" +ensure-install-dir + +cat > conf/cluster_spec.yaml << '__EOF_CLUSTER_SPEC' +cloudConfig: + manageStorageClasses: true +containerRuntime: containerd +containerd: + configOverride: | + version = 2 + + [plugins] + + [plugins."io.containerd.grpc.v1.cri"] + + [plugins."io.containerd.grpc.v1.cri".containerd] + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes] + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] + runtime_type = "io.containerd.runc.v2" + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] + SystemdCgroup = true + logLevel: info + version: 1.4.4 +docker: + skipInstall: true +encryptionConfig: null +etcdClusters: + events: + version: 3.4.13 + main: + version: 3.4.13 +kubeAPIServer: + allowPrivileged: true + anonymousAuth: false + apiAudiences: + - kubernetes.svc.default + apiServerCount: 1 + authorizationMode: AlwaysAllow + bindAddress: 0.0.0.0 + cloudProvider: aws + enableAdmissionPlugins: + - NamespaceLifecycle + - LimitRanger + - ServiceAccount + - PersistentVolumeLabel + - DefaultStorageClass + - DefaultTolerationSeconds + - MutatingAdmissionWebhook + - ValidatingAdmissionWebhook + - NodeRestriction + - ResourceQuota + etcdServers: + - http://127.0.0.1:4001 + etcdServersOverrides: + - /events#http://127.0.0.1:4002 + image: k8s.gcr.io/kube-apiserver:v1.20.0 + kubeletPreferredAddressTypes: + - InternalIP + - Hostname + - ExternalIP + logLevel: 2 + requestheaderAllowedNames: + - aggregator + requestheaderExtraHeaderPrefixes: + - X-Remote-Extra- + requestheaderGroupHeaders: + - X-Remote-Group + requestheaderUsernameHeaders: + - X-Remote-User + securePort: 443 + serviceAccountIssuer: https://api.internal.nthsqsresources.example.com + serviceAccountJWKSURI: https://api.internal.nthsqsresources.example.com/openid/v1/jwks + serviceClusterIPRange: 100.64.0.0/13 + storageBackend: etcd3 +kubeControllerManager: + allocateNodeCIDRs: true + attachDetachReconcileSyncPeriod: 1m0s + cloudProvider: aws + clusterCIDR: 100.96.0.0/11 + clusterName: nthsqsresources.example.com + configureCloudRoutes: false + image: k8s.gcr.io/kube-controller-manager:v1.20.0 + leaderElection: + leaderElect: true + logLevel: 2 + useServiceAccountCredentials: true +kubeProxy: + clusterCIDR: 100.96.0.0/11 + cpuRequest: 100m + hostnameOverride: '@aws' + image: k8s.gcr.io/kube-proxy:v1.20.0 + logLevel: 2 +kubeScheduler: + image: k8s.gcr.io/kube-scheduler:v1.20.0 + leaderElection: + leaderElect: true + logLevel: 2 +kubelet: + anonymousAuth: false + cgroupDriver: systemd + cgroupRoot: / + cloudProvider: aws + clusterDNS: 100.64.0.10 + clusterDomain: cluster.local + enableDebuggingHandlers: true + evictionHard: memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<10%,imagefs.inodesFree<5% + hostnameOverride: '@aws' + kubeconfigPath: /var/lib/kubelet/kubeconfig + logLevel: 2 + networkPluginName: cni + nonMasqueradeCIDR: 100.64.0.0/10 + podManifestPath: /etc/kubernetes/manifests +masterKubelet: + anonymousAuth: false + cgroupDriver: systemd + cgroupRoot: / + cloudProvider: aws + clusterDNS: 100.64.0.10 + clusterDomain: cluster.local + enableDebuggingHandlers: true + evictionHard: memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<10%,imagefs.inodesFree<5% + hostnameOverride: '@aws' + kubeconfigPath: /var/lib/kubelet/kubeconfig + logLevel: 2 + networkPluginName: cni + nonMasqueradeCIDR: 100.64.0.0/10 + podManifestPath: /etc/kubernetes/manifests + registerSchedulable: false + +__EOF_CLUSTER_SPEC + +cat > conf/ig_spec.yaml << '__EOF_IG_SPEC' +{} + +__EOF_IG_SPEC + +cat > conf/kube_env.yaml << '__EOF_KUBE_ENV' +Assets: + amd64: + - ff2422571c4c1e9696e367f5f25466b96fb6e501f28aed29f414b1524a52dea0@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/amd64/kubelet + - a5895007f331f08d2e082eb12458764949559f30bcc5beae26c38f3e2724262c@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/amd64/kubectl + - 977824932d5667c7a37aa6a3cbba40100a6873e7bd97e83e8be837e3e7afd0a8@https://storage.googleapis.com/k8s-artifacts-cni/release/v0.8.7/cni-plugins-linux-amd64-v0.8.7.tgz + - 96641849cb78a0a119223a427dfdc1ade88412ef791a14193212c8c8e29d447b@https://github.com/containerd/containerd/releases/download/v1.4.4/cri-containerd-cni-1.4.4-linux-amd64.tar.gz + - f90ed6dcef534e6d1ae17907dc7eb40614b8945ad4af7f0e98d2be7cde8165c6@https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/amd64/protokube,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/protokube-linux-amd64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/amd64/protokube + - 9992e7eb2a2e93f799e5a9e98eb718637433524bc65f630357201a79f49b13d0@https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/amd64/channels,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/channels-linux-amd64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/amd64/channels + arm64: + - 47ab6c4273fc3bb0cb8ec9517271d915890c5a6b0e54b2991e7a8fbbe77b06e4@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/arm64/kubelet + - 25e4465870c99167e6c466623ed8f05a1d20fbcb48cab6688109389b52d87623@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/arm64/kubectl + - ae13d7b5c05bd180ea9b5b68f44bdaa7bfb41034a2ef1d68fd8e1259797d642f@https://storage.googleapis.com/k8s-artifacts-cni/release/v0.8.7/cni-plugins-linux-arm64-v0.8.7.tgz + - 998b3b6669335f1a1d8c475fb7c211ed1e41c2ff37275939e2523666ccb7d910@https://download.docker.com/linux/static/stable/aarch64/docker-20.10.6.tgz + - 2f599c3d54f4c4bdbcc95aaf0c7b513a845d8f9503ec5b34c9f86aa1bc34fc0c@https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/arm64/protokube,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/protokube-linux-arm64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/arm64/protokube + - 9d842e3636a95de2315cdea2be7a282355aac0658ef0b86d5dc2449066538f13@https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/arm64/channels,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/channels-linux-arm64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/arm64/channels +ClusterName: nthsqsresources.example.com +ConfigBase: memfs://clusters.example.com/nthsqsresources.example.com +InstanceGroupName: master-us-test-1a +InstanceGroupRole: Master +KubeletConfig: + anonymousAuth: false + cgroupDriver: systemd + cgroupRoot: / + cloudProvider: aws + clusterDNS: 100.64.0.10 + clusterDomain: cluster.local + enableDebuggingHandlers: true + evictionHard: memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<10%,imagefs.inodesFree<5% + hostnameOverride: '@aws' + kubeconfigPath: /var/lib/kubelet/kubeconfig + logLevel: 2 + networkPluginName: cni + nodeLabels: + kops.k8s.io/kops-controller-pki: "" + kubernetes.io/role: master + node-role.kubernetes.io/control-plane: "" + node-role.kubernetes.io/master: "" + node.kubernetes.io/exclude-from-external-load-balancers: "" + nonMasqueradeCIDR: 100.64.0.0/10 + podManifestPath: /etc/kubernetes/manifests + registerSchedulable: false +channels: +- memfs://clusters.example.com/nthsqsresources.example.com/addons/bootstrap-channel.yaml +etcdManifests: +- memfs://clusters.example.com/nthsqsresources.example.com/manifests/etcd/main.yaml +- memfs://clusters.example.com/nthsqsresources.example.com/manifests/etcd/events.yaml +staticManifests: +- key: kube-apiserver-healthcheck + path: manifests/static/kube-apiserver-healthcheck.yaml + +__EOF_KUBE_ENV + +download-release +echo "== nodeup node config done ==" diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_launch_template_master-us-test-1a.masters.queueprocessor.example.com_user_data b/tests/integration/update_cluster/nth_sqs_resources/data/aws_launch_template_master-us-test-1a.masters.queueprocessor.example.com_user_data new file mode 100644 index 0000000000..5da1c8d985 --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_launch_template_master-us-test-1a.masters.queueprocessor.example.com_user_data @@ -0,0 +1,328 @@ +#!/bin/bash +set -o errexit +set -o nounset +set -o pipefail + +NODEUP_URL_AMD64=https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/amd64/nodeup,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/nodeup-linux-amd64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/amd64/nodeup +NODEUP_HASH_AMD64=585fbda0f0a43184656b4bfc0cc5f0c0b85612faf43b8816acca1f99d422c924 +NODEUP_URL_ARM64=https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/arm64/nodeup,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/nodeup-linux-arm64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/arm64/nodeup +NODEUP_HASH_ARM64=7603675379699105a9b9915ff97718ea99b1bbb01a4c184e2f827c8a96e8e865 + +export AWS_REGION=us-test-1 + + + + +sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true + + +function ensure-install-dir() { + INSTALL_DIR="/opt/kops" + # On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec + if [[ -d /var/lib/toolbox ]]; then + INSTALL_DIR="/var/lib/toolbox/kops" + fi + mkdir -p ${INSTALL_DIR}/bin + mkdir -p ${INSTALL_DIR}/conf + cd ${INSTALL_DIR} +} + +# Retry a download until we get it. args: name, sha, url1, url2... +download-or-bust() { + local -r file="$1" + local -r hash="$2" + shift 2 + + urls=( $* ) + while true; do + for url in "${urls[@]}"; do + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" + continue + fi + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" + else + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return + fi + done + done + + echo "All downloads failed; sleeping before retrying" + sleep 60 + done +} + +validate-hash() { + local -r file="$1" + local -r expected="$2" + local actual + + actual=$(sha256sum ${file} | awk '{ print $1 }') || true + if [[ "${actual}" != "${expected}" ]]; then + echo "== ${file} corrupted, hash ${actual} doesn't match expected ${expected} ==" + return 1 + fi +} + +function split-commas() { + echo $1 | tr "," "\n" +} + +function try-download-release() { + local -r nodeup_urls=( $(split-commas "${NODEUP_URL}") ) + if [[ -n "${NODEUP_HASH:-}" ]]; then + local -r nodeup_hash="${NODEUP_HASH}" + else + # TODO: Remove? + echo "Downloading sha256 (not found in env)" + download-or-bust nodeup.sha256 "" "${nodeup_urls[@]/%/.sha256}" + local -r nodeup_hash=$(cat nodeup.sha256) + fi + + echo "Downloading nodeup (${nodeup_urls[@]})" + download-or-bust nodeup "${nodeup_hash}" "${nodeup_urls[@]}" + + chmod +x nodeup +} + +function download-release() { + case "$(uname -m)" in + x86_64*|i?86_64*|amd64*) + NODEUP_URL="${NODEUP_URL_AMD64}" + NODEUP_HASH="${NODEUP_HASH_AMD64}" + ;; + aarch64*|arm64*) + NODEUP_URL="${NODEUP_URL_ARM64}" + NODEUP_HASH="${NODEUP_HASH_ARM64}" + ;; + *) + echo "Unsupported host arch: $(uname -m)" >&2 + exit 1 + ;; + esac + + # In case of failure checking integrity of release, retry. + cd ${INSTALL_DIR}/bin + until try-download-release; do + sleep 15 + echo "Couldn't download release. Retrying..." + done + + echo "Running nodeup" + # We can't run in the foreground because of https://github.com/docker/docker/issues/23793 + ( cd ${INSTALL_DIR}/bin; ./nodeup --install-systemd-unit --conf=${INSTALL_DIR}/conf/kube_env.yaml --v=8 ) +} + +#################################################################################### + +/bin/systemd-machine-id-setup || echo "failed to set up ensure machine-id configured" + +echo "== nodeup node config starting ==" +ensure-install-dir + +cat > conf/cluster_spec.yaml << '__EOF_CLUSTER_SPEC' +cloudConfig: + manageStorageClasses: true +containerRuntime: containerd +containerd: + configOverride: | + version = 2 + + [plugins] + + [plugins."io.containerd.grpc.v1.cri"] + + [plugins."io.containerd.grpc.v1.cri".containerd] + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes] + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] + runtime_type = "io.containerd.runc.v2" + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] + SystemdCgroup = true + logLevel: info + version: 1.4.4 +docker: + skipInstall: true +encryptionConfig: null +etcdClusters: + events: + version: 3.4.13 + main: + version: 3.4.13 +kubeAPIServer: + allowPrivileged: true + anonymousAuth: false + apiAudiences: + - kubernetes.svc.default + apiServerCount: 1 + authorizationMode: AlwaysAllow + bindAddress: 0.0.0.0 + cloudProvider: aws + enableAdmissionPlugins: + - NamespaceLifecycle + - LimitRanger + - ServiceAccount + - PersistentVolumeLabel + - DefaultStorageClass + - DefaultTolerationSeconds + - MutatingAdmissionWebhook + - ValidatingAdmissionWebhook + - NodeRestriction + - ResourceQuota + etcdServers: + - http://127.0.0.1:4001 + etcdServersOverrides: + - /events#http://127.0.0.1:4002 + image: k8s.gcr.io/kube-apiserver:v1.20.0 + kubeletPreferredAddressTypes: + - InternalIP + - Hostname + - ExternalIP + logLevel: 2 + requestheaderAllowedNames: + - aggregator + requestheaderExtraHeaderPrefixes: + - X-Remote-Extra- + requestheaderGroupHeaders: + - X-Remote-Group + requestheaderUsernameHeaders: + - X-Remote-User + securePort: 443 + serviceAccountIssuer: https://api.internal.queueprocessor.example.com + serviceAccountJWKSURI: https://api.internal.queueprocessor.example.com/openid/v1/jwks + serviceClusterIPRange: 100.64.0.0/13 + storageBackend: etcd3 +kubeControllerManager: + allocateNodeCIDRs: true + attachDetachReconcileSyncPeriod: 1m0s + cloudProvider: aws + clusterCIDR: 100.96.0.0/11 + clusterName: queueprocessor.example.com + configureCloudRoutes: false + image: k8s.gcr.io/kube-controller-manager:v1.20.0 + leaderElection: + leaderElect: true + logLevel: 2 + useServiceAccountCredentials: true +kubeProxy: + clusterCIDR: 100.96.0.0/11 + cpuRequest: 100m + hostnameOverride: '@aws' + image: k8s.gcr.io/kube-proxy:v1.20.0 + logLevel: 2 +kubeScheduler: + image: k8s.gcr.io/kube-scheduler:v1.20.0 + leaderElection: + leaderElect: true + logLevel: 2 +kubelet: + anonymousAuth: false + cgroupDriver: systemd + cgroupRoot: / + cloudProvider: aws + clusterDNS: 100.64.0.10 + clusterDomain: cluster.local + enableDebuggingHandlers: true + evictionHard: memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<10%,imagefs.inodesFree<5% + hostnameOverride: '@aws' + kubeconfigPath: /var/lib/kubelet/kubeconfig + logLevel: 2 + networkPluginName: cni + nonMasqueradeCIDR: 100.64.0.0/10 + podManifestPath: /etc/kubernetes/manifests +masterKubelet: + anonymousAuth: false + cgroupDriver: systemd + cgroupRoot: / + cloudProvider: aws + clusterDNS: 100.64.0.10 + clusterDomain: cluster.local + enableDebuggingHandlers: true + evictionHard: memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<10%,imagefs.inodesFree<5% + hostnameOverride: '@aws' + kubeconfigPath: /var/lib/kubelet/kubeconfig + logLevel: 2 + networkPluginName: cni + nonMasqueradeCIDR: 100.64.0.0/10 + podManifestPath: /etc/kubernetes/manifests + registerSchedulable: false + +__EOF_CLUSTER_SPEC + +cat > conf/ig_spec.yaml << '__EOF_IG_SPEC' +{} + +__EOF_IG_SPEC + +cat > conf/kube_env.yaml << '__EOF_KUBE_ENV' +Assets: + amd64: + - ff2422571c4c1e9696e367f5f25466b96fb6e501f28aed29f414b1524a52dea0@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/amd64/kubelet + - a5895007f331f08d2e082eb12458764949559f30bcc5beae26c38f3e2724262c@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/amd64/kubectl + - 977824932d5667c7a37aa6a3cbba40100a6873e7bd97e83e8be837e3e7afd0a8@https://storage.googleapis.com/k8s-artifacts-cni/release/v0.8.7/cni-plugins-linux-amd64-v0.8.7.tgz + - 96641849cb78a0a119223a427dfdc1ade88412ef791a14193212c8c8e29d447b@https://github.com/containerd/containerd/releases/download/v1.4.4/cri-containerd-cni-1.4.4-linux-amd64.tar.gz + - f90ed6dcef534e6d1ae17907dc7eb40614b8945ad4af7f0e98d2be7cde8165c6@https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/amd64/protokube,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/protokube-linux-amd64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/amd64/protokube + - 9992e7eb2a2e93f799e5a9e98eb718637433524bc65f630357201a79f49b13d0@https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/amd64/channels,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/channels-linux-amd64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/amd64/channels + arm64: + - 47ab6c4273fc3bb0cb8ec9517271d915890c5a6b0e54b2991e7a8fbbe77b06e4@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/arm64/kubelet + - 25e4465870c99167e6c466623ed8f05a1d20fbcb48cab6688109389b52d87623@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/arm64/kubectl + - ae13d7b5c05bd180ea9b5b68f44bdaa7bfb41034a2ef1d68fd8e1259797d642f@https://storage.googleapis.com/k8s-artifacts-cni/release/v0.8.7/cni-plugins-linux-arm64-v0.8.7.tgz + - 6e3f80e8451ecbe7b3559247721c3e226be6b228acaadee7e13683f80c20e81c@https://download.docker.com/linux/static/stable/aarch64/docker-20.10.0.tgz + - 2f599c3d54f4c4bdbcc95aaf0c7b513a845d8f9503ec5b34c9f86aa1bc34fc0c@https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/arm64/protokube,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/protokube-linux-arm64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/arm64/protokube + - 9d842e3636a95de2315cdea2be7a282355aac0658ef0b86d5dc2449066538f13@https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/arm64/channels,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/channels-linux-arm64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/arm64/channels +ClusterName: queueprocessor.example.com +ConfigBase: memfs://clusters.example.com/queueprocessor.example.com +InstanceGroupName: master-us-test-1a +InstanceGroupRole: Master +KubeletConfig: + anonymousAuth: false + cgroupDriver: systemd + cgroupRoot: / + cloudProvider: aws + clusterDNS: 100.64.0.10 + clusterDomain: cluster.local + enableDebuggingHandlers: true + evictionHard: memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<10%,imagefs.inodesFree<5% + hostnameOverride: '@aws' + kubeconfigPath: /var/lib/kubelet/kubeconfig + logLevel: 2 + networkPluginName: cni + nodeLabels: + kops.k8s.io/kops-controller-pki: "" + kubernetes.io/role: master + node-role.kubernetes.io/control-plane: "" + node-role.kubernetes.io/master: "" + node.kubernetes.io/exclude-from-external-load-balancers: "" + nonMasqueradeCIDR: 100.64.0.0/10 + podManifestPath: /etc/kubernetes/manifests + registerSchedulable: false +channels: +- memfs://clusters.example.com/queueprocessor.example.com/addons/bootstrap-channel.yaml +etcdManifests: +- memfs://clusters.example.com/queueprocessor.example.com/manifests/etcd/main.yaml +- memfs://clusters.example.com/queueprocessor.example.com/manifests/etcd/events.yaml +staticManifests: +- key: kube-apiserver-healthcheck + path: manifests/static/kube-apiserver-healthcheck.yaml + +__EOF_KUBE_ENV + +download-release +echo "== nodeup node config done ==" diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_launch_template_nodes.nthsqsresources.example.com_user_data b/tests/integration/update_cluster/nth_sqs_resources/data/aws_launch_template_nodes.nthsqsresources.example.com_user_data new file mode 100644 index 0000000000..83bbb59d24 --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_launch_template_nodes.nthsqsresources.example.com_user_data @@ -0,0 +1,232 @@ +#!/bin/bash +set -o errexit +set -o nounset +set -o pipefail + +NODEUP_URL_AMD64=https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/amd64/nodeup,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/nodeup-linux-amd64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/amd64/nodeup +NODEUP_HASH_AMD64=585fbda0f0a43184656b4bfc0cc5f0c0b85612faf43b8816acca1f99d422c924 +NODEUP_URL_ARM64=https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/arm64/nodeup,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/nodeup-linux-arm64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/arm64/nodeup +NODEUP_HASH_ARM64=7603675379699105a9b9915ff97718ea99b1bbb01a4c184e2f827c8a96e8e865 + +export AWS_REGION=us-test-1 + + + + +sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true + + +function ensure-install-dir() { + INSTALL_DIR="/opt/kops" + # On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec + if [[ -d /var/lib/toolbox ]]; then + INSTALL_DIR="/var/lib/toolbox/kops" + fi + mkdir -p ${INSTALL_DIR}/bin + mkdir -p ${INSTALL_DIR}/conf + cd ${INSTALL_DIR} +} + +# Retry a download until we get it. args: name, sha, url1, url2... +download-or-bust() { + local -r file="$1" + local -r hash="$2" + shift 2 + + urls=( $* ) + while true; do + for url in "${urls[@]}"; do + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" + continue + fi + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" + else + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return + fi + done + done + + echo "All downloads failed; sleeping before retrying" + sleep 60 + done +} + +validate-hash() { + local -r file="$1" + local -r expected="$2" + local actual + + actual=$(sha256sum ${file} | awk '{ print $1 }') || true + if [[ "${actual}" != "${expected}" ]]; then + echo "== ${file} corrupted, hash ${actual} doesn't match expected ${expected} ==" + return 1 + fi +} + +function split-commas() { + echo $1 | tr "," "\n" +} + +function try-download-release() { + local -r nodeup_urls=( $(split-commas "${NODEUP_URL}") ) + if [[ -n "${NODEUP_HASH:-}" ]]; then + local -r nodeup_hash="${NODEUP_HASH}" + else + # TODO: Remove? + echo "Downloading sha256 (not found in env)" + download-or-bust nodeup.sha256 "" "${nodeup_urls[@]/%/.sha256}" + local -r nodeup_hash=$(cat nodeup.sha256) + fi + + echo "Downloading nodeup (${nodeup_urls[@]})" + download-or-bust nodeup "${nodeup_hash}" "${nodeup_urls[@]}" + + chmod +x nodeup +} + +function download-release() { + case "$(uname -m)" in + x86_64*|i?86_64*|amd64*) + NODEUP_URL="${NODEUP_URL_AMD64}" + NODEUP_HASH="${NODEUP_HASH_AMD64}" + ;; + aarch64*|arm64*) + NODEUP_URL="${NODEUP_URL_ARM64}" + NODEUP_HASH="${NODEUP_HASH_ARM64}" + ;; + *) + echo "Unsupported host arch: $(uname -m)" >&2 + exit 1 + ;; + esac + + # In case of failure checking integrity of release, retry. + cd ${INSTALL_DIR}/bin + until try-download-release; do + sleep 15 + echo "Couldn't download release. Retrying..." + done + + echo "Running nodeup" + # We can't run in the foreground because of https://github.com/docker/docker/issues/23793 + ( cd ${INSTALL_DIR}/bin; ./nodeup --install-systemd-unit --conf=${INSTALL_DIR}/conf/kube_env.yaml --v=8 ) +} + +#################################################################################### + +/bin/systemd-machine-id-setup || echo "failed to set up ensure machine-id configured" + +echo "== nodeup node config starting ==" +ensure-install-dir + +cat > conf/cluster_spec.yaml << '__EOF_CLUSTER_SPEC' +cloudConfig: + manageStorageClasses: true +containerRuntime: containerd +containerd: + configOverride: | + version = 2 + + [plugins] + + [plugins."io.containerd.grpc.v1.cri"] + + [plugins."io.containerd.grpc.v1.cri".containerd] + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes] + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] + runtime_type = "io.containerd.runc.v2" + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] + SystemdCgroup = true + logLevel: info + version: 1.4.4 +docker: + skipInstall: true +kubeProxy: + clusterCIDR: 100.96.0.0/11 + cpuRequest: 100m + hostnameOverride: '@aws' + image: k8s.gcr.io/kube-proxy:v1.20.0 + logLevel: 2 +kubelet: + anonymousAuth: false + cgroupDriver: systemd + cgroupRoot: / + cloudProvider: aws + clusterDNS: 100.64.0.10 + clusterDomain: cluster.local + enableDebuggingHandlers: true + evictionHard: memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<10%,imagefs.inodesFree<5% + hostnameOverride: '@aws' + kubeconfigPath: /var/lib/kubelet/kubeconfig + logLevel: 2 + networkPluginName: cni + nonMasqueradeCIDR: 100.64.0.0/10 + podManifestPath: /etc/kubernetes/manifests + +__EOF_CLUSTER_SPEC + +cat > conf/ig_spec.yaml << '__EOF_IG_SPEC' +{} + +__EOF_IG_SPEC + +cat > conf/kube_env.yaml << '__EOF_KUBE_ENV' +Assets: + amd64: + - ff2422571c4c1e9696e367f5f25466b96fb6e501f28aed29f414b1524a52dea0@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/amd64/kubelet + - a5895007f331f08d2e082eb12458764949559f30bcc5beae26c38f3e2724262c@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/amd64/kubectl + - 977824932d5667c7a37aa6a3cbba40100a6873e7bd97e83e8be837e3e7afd0a8@https://storage.googleapis.com/k8s-artifacts-cni/release/v0.8.7/cni-plugins-linux-amd64-v0.8.7.tgz + - 96641849cb78a0a119223a427dfdc1ade88412ef791a14193212c8c8e29d447b@https://github.com/containerd/containerd/releases/download/v1.4.4/cri-containerd-cni-1.4.4-linux-amd64.tar.gz + arm64: + - 47ab6c4273fc3bb0cb8ec9517271d915890c5a6b0e54b2991e7a8fbbe77b06e4@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/arm64/kubelet + - 25e4465870c99167e6c466623ed8f05a1d20fbcb48cab6688109389b52d87623@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/arm64/kubectl + - ae13d7b5c05bd180ea9b5b68f44bdaa7bfb41034a2ef1d68fd8e1259797d642f@https://storage.googleapis.com/k8s-artifacts-cni/release/v0.8.7/cni-plugins-linux-arm64-v0.8.7.tgz + - 998b3b6669335f1a1d8c475fb7c211ed1e41c2ff37275939e2523666ccb7d910@https://download.docker.com/linux/static/stable/aarch64/docker-20.10.6.tgz +ClusterName: nthsqsresources.example.com +ConfigBase: memfs://clusters.example.com/nthsqsresources.example.com +InstanceGroupName: nodes +InstanceGroupRole: Node +KubeletConfig: + anonymousAuth: false + cgroupDriver: systemd + cgroupRoot: / + cloudProvider: aws + clusterDNS: 100.64.0.10 + clusterDomain: cluster.local + enableDebuggingHandlers: true + evictionHard: memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<10%,imagefs.inodesFree<5% + hostnameOverride: '@aws' + kubeconfigPath: /var/lib/kubelet/kubeconfig + logLevel: 2 + networkPluginName: cni + nodeLabels: + kubernetes.io/role: node + node-role.kubernetes.io/node: "" + nonMasqueradeCIDR: 100.64.0.0/10 + podManifestPath: /etc/kubernetes/manifests +channels: +- memfs://clusters.example.com/nthsqsresources.example.com/addons/bootstrap-channel.yaml + +__EOF_KUBE_ENV + +download-release +echo "== nodeup node config done ==" diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_launch_template_nodes.queueprocessor.example.com_user_data b/tests/integration/update_cluster/nth_sqs_resources/data/aws_launch_template_nodes.queueprocessor.example.com_user_data new file mode 100644 index 0000000000..151754d579 --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_launch_template_nodes.queueprocessor.example.com_user_data @@ -0,0 +1,232 @@ +#!/bin/bash +set -o errexit +set -o nounset +set -o pipefail + +NODEUP_URL_AMD64=https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/amd64/nodeup,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/nodeup-linux-amd64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/amd64/nodeup +NODEUP_HASH_AMD64=585fbda0f0a43184656b4bfc0cc5f0c0b85612faf43b8816acca1f99d422c924 +NODEUP_URL_ARM64=https://artifacts.k8s.io/binaries/kops/1.21.0-alpha.1/linux/arm64/nodeup,https://github.com/kubernetes/kops/releases/download/v1.21.0-alpha.1/nodeup-linux-arm64,https://kubeupv2.s3.amazonaws.com/kops/1.21.0-alpha.1/linux/arm64/nodeup +NODEUP_HASH_ARM64=7603675379699105a9b9915ff97718ea99b1bbb01a4c184e2f827c8a96e8e865 + +export AWS_REGION=us-test-1 + + + + +sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true + + +function ensure-install-dir() { + INSTALL_DIR="/opt/kops" + # On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec + if [[ -d /var/lib/toolbox ]]; then + INSTALL_DIR="/var/lib/toolbox/kops" + fi + mkdir -p ${INSTALL_DIR}/bin + mkdir -p ${INSTALL_DIR}/conf + cd ${INSTALL_DIR} +} + +# Retry a download until we get it. args: name, sha, url1, url2... +download-or-bust() { + local -r file="$1" + local -r hash="$2" + shift 2 + + urls=( $* ) + while true; do + for url in "${urls[@]}"; do + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" + continue + fi + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" + else + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return + fi + done + done + + echo "All downloads failed; sleeping before retrying" + sleep 60 + done +} + +validate-hash() { + local -r file="$1" + local -r expected="$2" + local actual + + actual=$(sha256sum ${file} | awk '{ print $1 }') || true + if [[ "${actual}" != "${expected}" ]]; then + echo "== ${file} corrupted, hash ${actual} doesn't match expected ${expected} ==" + return 1 + fi +} + +function split-commas() { + echo $1 | tr "," "\n" +} + +function try-download-release() { + local -r nodeup_urls=( $(split-commas "${NODEUP_URL}") ) + if [[ -n "${NODEUP_HASH:-}" ]]; then + local -r nodeup_hash="${NODEUP_HASH}" + else + # TODO: Remove? + echo "Downloading sha256 (not found in env)" + download-or-bust nodeup.sha256 "" "${nodeup_urls[@]/%/.sha256}" + local -r nodeup_hash=$(cat nodeup.sha256) + fi + + echo "Downloading nodeup (${nodeup_urls[@]})" + download-or-bust nodeup "${nodeup_hash}" "${nodeup_urls[@]}" + + chmod +x nodeup +} + +function download-release() { + case "$(uname -m)" in + x86_64*|i?86_64*|amd64*) + NODEUP_URL="${NODEUP_URL_AMD64}" + NODEUP_HASH="${NODEUP_HASH_AMD64}" + ;; + aarch64*|arm64*) + NODEUP_URL="${NODEUP_URL_ARM64}" + NODEUP_HASH="${NODEUP_HASH_ARM64}" + ;; + *) + echo "Unsupported host arch: $(uname -m)" >&2 + exit 1 + ;; + esac + + # In case of failure checking integrity of release, retry. + cd ${INSTALL_DIR}/bin + until try-download-release; do + sleep 15 + echo "Couldn't download release. Retrying..." + done + + echo "Running nodeup" + # We can't run in the foreground because of https://github.com/docker/docker/issues/23793 + ( cd ${INSTALL_DIR}/bin; ./nodeup --install-systemd-unit --conf=${INSTALL_DIR}/conf/kube_env.yaml --v=8 ) +} + +#################################################################################### + +/bin/systemd-machine-id-setup || echo "failed to set up ensure machine-id configured" + +echo "== nodeup node config starting ==" +ensure-install-dir + +cat > conf/cluster_spec.yaml << '__EOF_CLUSTER_SPEC' +cloudConfig: + manageStorageClasses: true +containerRuntime: containerd +containerd: + configOverride: | + version = 2 + + [plugins] + + [plugins."io.containerd.grpc.v1.cri"] + + [plugins."io.containerd.grpc.v1.cri".containerd] + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes] + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] + runtime_type = "io.containerd.runc.v2" + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] + SystemdCgroup = true + logLevel: info + version: 1.4.4 +docker: + skipInstall: true +kubeProxy: + clusterCIDR: 100.96.0.0/11 + cpuRequest: 100m + hostnameOverride: '@aws' + image: k8s.gcr.io/kube-proxy:v1.20.0 + logLevel: 2 +kubelet: + anonymousAuth: false + cgroupDriver: systemd + cgroupRoot: / + cloudProvider: aws + clusterDNS: 100.64.0.10 + clusterDomain: cluster.local + enableDebuggingHandlers: true + evictionHard: memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<10%,imagefs.inodesFree<5% + hostnameOverride: '@aws' + kubeconfigPath: /var/lib/kubelet/kubeconfig + logLevel: 2 + networkPluginName: cni + nonMasqueradeCIDR: 100.64.0.0/10 + podManifestPath: /etc/kubernetes/manifests + +__EOF_CLUSTER_SPEC + +cat > conf/ig_spec.yaml << '__EOF_IG_SPEC' +{} + +__EOF_IG_SPEC + +cat > conf/kube_env.yaml << '__EOF_KUBE_ENV' +Assets: + amd64: + - ff2422571c4c1e9696e367f5f25466b96fb6e501f28aed29f414b1524a52dea0@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/amd64/kubelet + - a5895007f331f08d2e082eb12458764949559f30bcc5beae26c38f3e2724262c@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/amd64/kubectl + - 977824932d5667c7a37aa6a3cbba40100a6873e7bd97e83e8be837e3e7afd0a8@https://storage.googleapis.com/k8s-artifacts-cni/release/v0.8.7/cni-plugins-linux-amd64-v0.8.7.tgz + - 96641849cb78a0a119223a427dfdc1ade88412ef791a14193212c8c8e29d447b@https://github.com/containerd/containerd/releases/download/v1.4.4/cri-containerd-cni-1.4.4-linux-amd64.tar.gz + arm64: + - 47ab6c4273fc3bb0cb8ec9517271d915890c5a6b0e54b2991e7a8fbbe77b06e4@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/arm64/kubelet + - 25e4465870c99167e6c466623ed8f05a1d20fbcb48cab6688109389b52d87623@https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/arm64/kubectl + - ae13d7b5c05bd180ea9b5b68f44bdaa7bfb41034a2ef1d68fd8e1259797d642f@https://storage.googleapis.com/k8s-artifacts-cni/release/v0.8.7/cni-plugins-linux-arm64-v0.8.7.tgz + - 6e3f80e8451ecbe7b3559247721c3e226be6b228acaadee7e13683f80c20e81c@https://download.docker.com/linux/static/stable/aarch64/docker-20.10.0.tgz +ClusterName: queueprocessor.example.com +ConfigBase: memfs://clusters.example.com/queueprocessor.example.com +InstanceGroupName: nodes +InstanceGroupRole: Node +KubeletConfig: + anonymousAuth: false + cgroupDriver: systemd + cgroupRoot: / + cloudProvider: aws + clusterDNS: 100.64.0.10 + clusterDomain: cluster.local + enableDebuggingHandlers: true + evictionHard: memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<10%,imagefs.inodesFree<5% + hostnameOverride: '@aws' + kubeconfigPath: /var/lib/kubelet/kubeconfig + logLevel: 2 + networkPluginName: cni + nodeLabels: + kubernetes.io/role: node + node-role.kubernetes.io/node: "" + nonMasqueradeCIDR: 100.64.0.0/10 + podManifestPath: /etc/kubernetes/manifests +channels: +- memfs://clusters.example.com/queueprocessor.example.com/addons/bootstrap-channel.yaml + +__EOF_KUBE_ENV + +download-release +echo "== nodeup node config done ==" diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_sqs_queue_nthsqsresources-example-com-nth_policy b/tests/integration/update_cluster/nth_sqs_resources/data/aws_sqs_queue_nthsqsresources-example-com-nth_policy new file mode 100644 index 0000000000..8a1835212c --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_sqs_queue_nthsqsresources-example-com-nth_policy @@ -0,0 +1,13 @@ +{ + "Version": "2012-10-17", + "Statement": [{ + "Effect": "Allow", + "Principal": { + "Service": ["events.amazonaws.com", "sqs.amazonaws.com"] + }, + "Action": "sqs:SendMessage", + "Resource": [ + "arn:aws:sqs:us-test-1:123456789012:nthsqsresources-example-com-nth" + ] + }] + } diff --git a/tests/integration/update_cluster/nth_sqs_resources/data/aws_sqs_queue_queueprocessor-example-com-nth_policy b/tests/integration/update_cluster/nth_sqs_resources/data/aws_sqs_queue_queueprocessor-example-com-nth_policy new file mode 100644 index 0000000000..b3b4dcb7df --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/data/aws_sqs_queue_queueprocessor-example-com-nth_policy @@ -0,0 +1,13 @@ +{ + "Version": "2012-10-17", + "Statement": [{ + "Effect": "Allow", + "Principal": { + "Service": ["events.amazonaws.com", "sqs.amazonaws.com"] + }, + "Action": "sqs:SendMessage", + "Resource": [ + "arn:aws:sqs:us-test-1:123456789012:queueprocessor-example-com-nth" + ] + }] + } diff --git a/tests/integration/update_cluster/nth_sqs_resources/id_rsa.pub b/tests/integration/update_cluster/nth_sqs_resources/id_rsa.pub new file mode 100755 index 0000000000..81cb012783 --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/id_rsa.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ== diff --git a/tests/integration/update_cluster/nth_sqs_resources/in-v1alpha2.yaml b/tests/integration/update_cluster/nth_sqs_resources/in-v1alpha2.yaml new file mode 100644 index 0000000000..50357a13b4 --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/in-v1alpha2.yaml @@ -0,0 +1,81 @@ +apiVersion: kops.k8s.io/v1alpha2 +kind: Cluster +metadata: + creationTimestamp: "2016-12-10T22:42:27Z" + name: nthsqsresources.example.com +spec: + kubernetesApiAccess: + - 0.0.0.0/0 + channel: stable + cloudProvider: aws + configBase: memfs://clusters.example.com/nthsqsresources.example.com + etcdClusters: + - etcdMembers: + - instanceGroup: master-us-test-1a + name: us-test-1a + name: main + - etcdMembers: + - instanceGroup: master-us-test-1a + name: us-test-1a + name: events + iam: {} + kubelet: + anonymousAuth: false + kubernetesVersion: v1.20.0 + masterInternalName: api.internal.nthsqsresources.example.com + masterPublicName: api.nthsqsresources.example.com + networkCIDR: 172.20.0.0/16 + networking: + cni: {} + nonMasqueradeCIDR: 100.64.0.0/10 + nodeTerminationHandler: + enabled: true + enableSQSTerminationDraining: true + sshAccess: + - 0.0.0.0/0 + topology: + masters: public + nodes: public + subnets: + - cidr: 172.20.32.0/19 + name: us-test-1a + type: Public + zone: us-test-1a + +--- + +apiVersion: kops.k8s.io/v1alpha2 +kind: InstanceGroup +metadata: + creationTimestamp: "2016-12-10T22:42:28Z" + name: nodes + labels: + kops.k8s.io/cluster: nthsqsresources.example.com +spec: + associatePublicIp: true + image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21 + machineType: t2.medium + maxSize: 2 + minSize: 2 + role: Node + subnets: + - us-test-1a + +--- + +apiVersion: kops.k8s.io/v1alpha2 +kind: InstanceGroup +metadata: + creationTimestamp: "2016-12-10T22:42:28Z" + name: master-us-test-1a + labels: + kops.k8s.io/cluster: nthsqsresources.example.com +spec: + associatePublicIp: true + image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21 + machineType: m3.medium + maxSize: 1 + minSize: 1 + role: Master + subnets: + - us-test-1a diff --git a/tests/integration/update_cluster/nth_sqs_resources/kubernetes.tf b/tests/integration/update_cluster/nth_sqs_resources/kubernetes.tf new file mode 100644 index 0000000000..76012e5032 --- /dev/null +++ b/tests/integration/update_cluster/nth_sqs_resources/kubernetes.tf @@ -0,0 +1,732 @@ +locals { + cluster_name = "nthsqsresources.example.com" + master_autoscaling_group_ids = [aws_autoscaling_group.master-us-test-1a-masters-nthsqsresources-example-com.id] + master_security_group_ids = [aws_security_group.masters-nthsqsresources-example-com.id] + masters_role_arn = aws_iam_role.masters-nthsqsresources-example-com.arn + masters_role_name = aws_iam_role.masters-nthsqsresources-example-com.name + node_autoscaling_group_ids = [aws_autoscaling_group.nodes-nthsqsresources-example-com.id] + node_security_group_ids = [aws_security_group.nodes-nthsqsresources-example-com.id] + node_subnet_ids = [aws_subnet.us-test-1a-nthsqsresources-example-com.id] + nodes_role_arn = aws_iam_role.nodes-nthsqsresources-example-com.arn + nodes_role_name = aws_iam_role.nodes-nthsqsresources-example-com.name + region = "us-test-1" + route_table_public_id = aws_route_table.nthsqsresources-example-com.id + subnet_us-test-1a_id = aws_subnet.us-test-1a-nthsqsresources-example-com.id + vpc_cidr_block = aws_vpc.nthsqsresources-example-com.cidr_block + vpc_id = aws_vpc.nthsqsresources-example-com.id +} + +output "cluster_name" { + value = "nthsqsresources.example.com" +} + +output "master_autoscaling_group_ids" { + value = [aws_autoscaling_group.master-us-test-1a-masters-nthsqsresources-example-com.id] +} + +output "master_security_group_ids" { + value = [aws_security_group.masters-nthsqsresources-example-com.id] +} + +output "masters_role_arn" { + value = aws_iam_role.masters-nthsqsresources-example-com.arn +} + +output "masters_role_name" { + value = aws_iam_role.masters-nthsqsresources-example-com.name +} + +output "node_autoscaling_group_ids" { + value = [aws_autoscaling_group.nodes-nthsqsresources-example-com.id] +} + +output "node_security_group_ids" { + value = [aws_security_group.nodes-nthsqsresources-example-com.id] +} + +output "node_subnet_ids" { + value = [aws_subnet.us-test-1a-nthsqsresources-example-com.id] +} + +output "nodes_role_arn" { + value = aws_iam_role.nodes-nthsqsresources-example-com.arn +} + +output "nodes_role_name" { + value = aws_iam_role.nodes-nthsqsresources-example-com.name +} + +output "region" { + value = "us-test-1" +} + +output "route_table_public_id" { + value = aws_route_table.nthsqsresources-example-com.id +} + +output "subnet_us-test-1a_id" { + value = aws_subnet.us-test-1a-nthsqsresources-example-com.id +} + +output "vpc_cidr_block" { + value = aws_vpc.nthsqsresources-example-com.cidr_block +} + +output "vpc_id" { + value = aws_vpc.nthsqsresources-example-com.id +} + +provider "aws" { + region = "us-test-1" +} + +resource "aws_autoscaling_group" "master-us-test-1a-masters-nthsqsresources-example-com" { + enabled_metrics = ["GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"] + launch_template { + id = aws_launch_template.master-us-test-1a-masters-nthsqsresources-example-com.id + version = aws_launch_template.master-us-test-1a-masters-nthsqsresources-example-com.latest_version + } + max_size = 1 + metrics_granularity = "1Minute" + min_size = 1 + name = "master-us-test-1a.masters.nthsqsresources.example.com" + tag { + key = "KubernetesCluster" + propagate_at_launch = true + value = "nthsqsresources.example.com" + } + tag { + key = "Name" + propagate_at_launch = true + value = "master-us-test-1a.masters.nthsqsresources.example.com" + } + tag { + key = "aws-node-termination-handler/managed" + propagate_at_launch = true + value = "" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki" + propagate_at_launch = true + value = "" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane" + propagate_at_launch = true + value = "" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers" + propagate_at_launch = true + value = "" + } + tag { + key = "k8s.io/role/master" + propagate_at_launch = true + value = "1" + } + tag { + key = "kops.k8s.io/instancegroup" + propagate_at_launch = true + value = "master-us-test-1a" + } + tag { + key = "kubernetes.io/cluster/nthsqsresources.example.com" + propagate_at_launch = true + value = "owned" + } + vpc_zone_identifier = [aws_subnet.us-test-1a-nthsqsresources-example-com.id] +} + +resource "aws_autoscaling_group" "nodes-nthsqsresources-example-com" { + enabled_metrics = ["GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"] + launch_template { + id = aws_launch_template.nodes-nthsqsresources-example-com.id + version = aws_launch_template.nodes-nthsqsresources-example-com.latest_version + } + max_size = 2 + metrics_granularity = "1Minute" + min_size = 2 + name = "nodes.nthsqsresources.example.com" + tag { + key = "KubernetesCluster" + propagate_at_launch = true + value = "nthsqsresources.example.com" + } + tag { + key = "Name" + propagate_at_launch = true + value = "nodes.nthsqsresources.example.com" + } + tag { + key = "aws-node-termination-handler/managed" + propagate_at_launch = true + value = "" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } + tag { + key = "k8s.io/role/node" + propagate_at_launch = true + value = "1" + } + tag { + key = "kops.k8s.io/instancegroup" + propagate_at_launch = true + value = "nodes" + } + tag { + key = "kubernetes.io/cluster/nthsqsresources.example.com" + propagate_at_launch = true + value = "owned" + } + vpc_zone_identifier = [aws_subnet.us-test-1a-nthsqsresources-example-com.id] +} + +resource "aws_autoscaling_lifecycle_hook" "master-us-test-1a-NTHLifecycleHook" { + autoscaling_group_name = aws_autoscaling_group.master-us-test-1a-masters-nthsqsresources-example-com.id + default_result = "CONTINUE" + heartbeat_timeout = 300 + lifecycle_transition = "autoscaling:EC2_INSTANCE_TERMINATING" + name = "master-us-test-1a-NTHLifecycleHook" +} + +resource "aws_autoscaling_lifecycle_hook" "nodes-NTHLifecycleHook" { + autoscaling_group_name = aws_autoscaling_group.nodes-nthsqsresources-example-com.id + default_result = "CONTINUE" + heartbeat_timeout = 300 + lifecycle_transition = "autoscaling:EC2_INSTANCE_TERMINATING" + name = "nodes-NTHLifecycleHook" +} + +resource "aws_cloudwatch_event_rule" "nthsqsresources-example-com-ASGLifecycle" { + event_pattern = file("${path.module}/data/aws_cloudwatch_event_rule_nthsqsresources.example.com-ASGLifecycle_event_pattern") + name = "nthsqsresources.example.com-ASGLifecycle" + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "nthsqsresources.example.com-ASGLifecycle" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } +} + +resource "aws_cloudwatch_event_rule" "nthsqsresources-example-com-RebalanceRecommendation" { + event_pattern = file("${path.module}/data/aws_cloudwatch_event_rule_nthsqsresources.example.com-RebalanceRecommendation_event_pattern") + name = "nthsqsresources.example.com-RebalanceRecommendation" + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "nthsqsresources.example.com-RebalanceRecommendation" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } +} + +resource "aws_cloudwatch_event_rule" "nthsqsresources-example-com-SpotInterruption" { + event_pattern = file("${path.module}/data/aws_cloudwatch_event_rule_nthsqsresources.example.com-SpotInterruption_event_pattern") + name = "nthsqsresources.example.com-SpotInterruption" + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "nthsqsresources.example.com-SpotInterruption" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } +} + +resource "aws_cloudwatch_event_target" "nthsqsresources-example-com-ASGLifecycle-Target" { + arn = "arn:aws:sqs:us-test-1:123456789012:nthsqsresources-example-com-nth" + rule = aws_cloudwatch_event_rule.nthsqsresources-example-com-ASGLifecycle.id +} + +resource "aws_cloudwatch_event_target" "nthsqsresources-example-com-RebalanceRecommendation-Target" { + arn = "arn:aws:sqs:us-test-1:123456789012:nthsqsresources-example-com-nth" + rule = aws_cloudwatch_event_rule.nthsqsresources-example-com-RebalanceRecommendation.id +} + +resource "aws_cloudwatch_event_target" "nthsqsresources-example-com-SpotInterruption-Target" { + arn = "arn:aws:sqs:us-test-1:123456789012:nthsqsresources-example-com-nth" + rule = aws_cloudwatch_event_rule.nthsqsresources-example-com-SpotInterruption.id +} + +resource "aws_ebs_volume" "us-test-1a-etcd-events-nthsqsresources-example-com" { + availability_zone = "us-test-1a" + encrypted = false + iops = 3000 + size = 20 + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "us-test-1a.etcd-events.nthsqsresources.example.com" + "k8s.io/etcd/events" = "us-test-1a/us-test-1a" + "k8s.io/role/master" = "1" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } + throughput = 125 + type = "gp3" +} + +resource "aws_ebs_volume" "us-test-1a-etcd-main-nthsqsresources-example-com" { + availability_zone = "us-test-1a" + encrypted = false + iops = 3000 + size = 20 + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "us-test-1a.etcd-main.nthsqsresources.example.com" + "k8s.io/etcd/main" = "us-test-1a/us-test-1a" + "k8s.io/role/master" = "1" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } + throughput = 125 + type = "gp3" +} + +resource "aws_iam_instance_profile" "masters-nthsqsresources-example-com" { + name = "masters.nthsqsresources.example.com" + role = aws_iam_role.masters-nthsqsresources-example-com.name + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "masters.nthsqsresources.example.com" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } +} + +resource "aws_iam_instance_profile" "nodes-nthsqsresources-example-com" { + name = "nodes.nthsqsresources.example.com" + role = aws_iam_role.nodes-nthsqsresources-example-com.name + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "nodes.nthsqsresources.example.com" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } +} + +resource "aws_iam_role_policy" "masters-nthsqsresources-example-com" { + name = "masters.nthsqsresources.example.com" + policy = file("${path.module}/data/aws_iam_role_policy_masters.nthsqsresources.example.com_policy") + role = aws_iam_role.masters-nthsqsresources-example-com.name +} + +resource "aws_iam_role_policy" "nodes-nthsqsresources-example-com" { + name = "nodes.nthsqsresources.example.com" + policy = file("${path.module}/data/aws_iam_role_policy_nodes.nthsqsresources.example.com_policy") + role = aws_iam_role.nodes-nthsqsresources-example-com.name +} + +resource "aws_iam_role" "masters-nthsqsresources-example-com" { + assume_role_policy = file("${path.module}/data/aws_iam_role_masters.nthsqsresources.example.com_policy") + name = "masters.nthsqsresources.example.com" + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "masters.nthsqsresources.example.com" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } +} + +resource "aws_iam_role" "nodes-nthsqsresources-example-com" { + assume_role_policy = file("${path.module}/data/aws_iam_role_nodes.nthsqsresources.example.com_policy") + name = "nodes.nthsqsresources.example.com" + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "nodes.nthsqsresources.example.com" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } +} + +resource "aws_internet_gateway" "nthsqsresources-example-com" { + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "nthsqsresources.example.com" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } + vpc_id = aws_vpc.nthsqsresources-example-com.id +} + +resource "aws_key_pair" "kubernetes-nthsqsresources-example-com-c4a6ed9aa889b9e2c39cd663eb9c7157" { + key_name = "kubernetes.nthsqsresources.example.com-c4:a6:ed:9a:a8:89:b9:e2:c3:9c:d6:63:eb:9c:71:57" + public_key = file("${path.module}/data/aws_key_pair_kubernetes.nthsqsresources.example.com-c4a6ed9aa889b9e2c39cd663eb9c7157_public_key") + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "nthsqsresources.example.com" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } +} + +resource "aws_launch_template" "master-us-test-1a-masters-nthsqsresources-example-com" { + block_device_mappings { + device_name = "/dev/xvda" + ebs { + delete_on_termination = true + encrypted = true + iops = 3000 + throughput = 125 + volume_size = 64 + volume_type = "gp3" + } + } + block_device_mappings { + device_name = "/dev/sdc" + virtual_name = "ephemeral0" + } + iam_instance_profile { + name = aws_iam_instance_profile.masters-nthsqsresources-example-com.id + } + image_id = "ami-12345678" + instance_type = "m3.medium" + key_name = aws_key_pair.kubernetes-nthsqsresources-example-com-c4a6ed9aa889b9e2c39cd663eb9c7157.id + lifecycle { + create_before_destroy = true + } + metadata_options { + http_endpoint = "enabled" + http_put_response_hop_limit = 1 + http_tokens = "optional" + } + name = "master-us-test-1a.masters.nthsqsresources.example.com" + network_interfaces { + associate_public_ip_address = true + delete_on_termination = true + security_groups = [aws_security_group.masters-nthsqsresources-example-com.id] + } + tag_specifications { + resource_type = "instance" + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "master-us-test-1a.masters.nthsqsresources.example.com" + "aws-node-termination-handler/managed" = "" + "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki" = "" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane" = "" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } + } + tag_specifications { + resource_type = "volume" + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "master-us-test-1a.masters.nthsqsresources.example.com" + "aws-node-termination-handler/managed" = "" + "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki" = "" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane" = "" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } + } + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "master-us-test-1a.masters.nthsqsresources.example.com" + "aws-node-termination-handler/managed" = "" + "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki" = "" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane" = "" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } + user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.nthsqsresources.example.com_user_data") +} + +resource "aws_launch_template" "nodes-nthsqsresources-example-com" { + block_device_mappings { + device_name = "/dev/xvda" + ebs { + delete_on_termination = true + encrypted = true + iops = 3000 + throughput = 125 + volume_size = 128 + volume_type = "gp3" + } + } + iam_instance_profile { + name = aws_iam_instance_profile.nodes-nthsqsresources-example-com.id + } + image_id = "ami-12345678" + instance_type = "t2.medium" + key_name = aws_key_pair.kubernetes-nthsqsresources-example-com-c4a6ed9aa889b9e2c39cd663eb9c7157.id + lifecycle { + create_before_destroy = true + } + metadata_options { + http_endpoint = "enabled" + http_put_response_hop_limit = 1 + http_tokens = "optional" + } + name = "nodes.nthsqsresources.example.com" + network_interfaces { + associate_public_ip_address = true + delete_on_termination = true + security_groups = [aws_security_group.nodes-nthsqsresources-example-com.id] + } + tag_specifications { + resource_type = "instance" + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "nodes.nthsqsresources.example.com" + "aws-node-termination-handler/managed" = "" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } + } + tag_specifications { + resource_type = "volume" + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "nodes.nthsqsresources.example.com" + "aws-node-termination-handler/managed" = "" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } + } + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "nodes.nthsqsresources.example.com" + "aws-node-termination-handler/managed" = "" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } + user_data = filebase64("${path.module}/data/aws_launch_template_nodes.nthsqsresources.example.com_user_data") +} + +resource "aws_route_table_association" "us-test-1a-nthsqsresources-example-com" { + route_table_id = aws_route_table.nthsqsresources-example-com.id + subnet_id = aws_subnet.us-test-1a-nthsqsresources-example-com.id +} + +resource "aws_route_table" "nthsqsresources-example-com" { + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "nthsqsresources.example.com" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + "kubernetes.io/kops/role" = "public" + } + vpc_id = aws_vpc.nthsqsresources-example-com.id +} + +resource "aws_route" "route-0-0-0-0--0" { + destination_cidr_block = "0.0.0.0/0" + gateway_id = aws_internet_gateway.nthsqsresources-example-com.id + route_table_id = aws_route_table.nthsqsresources-example-com.id +} + +resource "aws_security_group_rule" "from-0-0-0-0--0-ingress-tcp-22to22-masters-nthsqsresources-example-com" { + cidr_blocks = ["0.0.0.0/0"] + from_port = 22 + protocol = "tcp" + security_group_id = aws_security_group.masters-nthsqsresources-example-com.id + to_port = 22 + type = "ingress" +} + +resource "aws_security_group_rule" "from-0-0-0-0--0-ingress-tcp-22to22-nodes-nthsqsresources-example-com" { + cidr_blocks = ["0.0.0.0/0"] + from_port = 22 + protocol = "tcp" + security_group_id = aws_security_group.nodes-nthsqsresources-example-com.id + to_port = 22 + type = "ingress" +} + +resource "aws_security_group_rule" "from-0-0-0-0--0-ingress-tcp-443to443-masters-nthsqsresources-example-com" { + cidr_blocks = ["0.0.0.0/0"] + from_port = 443 + protocol = "tcp" + security_group_id = aws_security_group.masters-nthsqsresources-example-com.id + to_port = 443 + type = "ingress" +} + +resource "aws_security_group_rule" "from-masters-nthsqsresources-example-com-egress-all-0to0-0-0-0-0--0" { + cidr_blocks = ["0.0.0.0/0"] + from_port = 0 + protocol = "-1" + security_group_id = aws_security_group.masters-nthsqsresources-example-com.id + to_port = 0 + type = "egress" +} + +resource "aws_security_group_rule" "from-masters-nthsqsresources-example-com-ingress-all-0to0-masters-nthsqsresources-example-com" { + from_port = 0 + protocol = "-1" + security_group_id = aws_security_group.masters-nthsqsresources-example-com.id + source_security_group_id = aws_security_group.masters-nthsqsresources-example-com.id + to_port = 0 + type = "ingress" +} + +resource "aws_security_group_rule" "from-masters-nthsqsresources-example-com-ingress-all-0to0-nodes-nthsqsresources-example-com" { + from_port = 0 + protocol = "-1" + security_group_id = aws_security_group.nodes-nthsqsresources-example-com.id + source_security_group_id = aws_security_group.masters-nthsqsresources-example-com.id + to_port = 0 + type = "ingress" +} + +resource "aws_security_group_rule" "from-nodes-nthsqsresources-example-com-egress-all-0to0-0-0-0-0--0" { + cidr_blocks = ["0.0.0.0/0"] + from_port = 0 + protocol = "-1" + security_group_id = aws_security_group.nodes-nthsqsresources-example-com.id + to_port = 0 + type = "egress" +} + +resource "aws_security_group_rule" "from-nodes-nthsqsresources-example-com-ingress-all-0to0-nodes-nthsqsresources-example-com" { + from_port = 0 + protocol = "-1" + security_group_id = aws_security_group.nodes-nthsqsresources-example-com.id + source_security_group_id = aws_security_group.nodes-nthsqsresources-example-com.id + to_port = 0 + type = "ingress" +} + +resource "aws_security_group_rule" "from-nodes-nthsqsresources-example-com-ingress-tcp-1to2379-masters-nthsqsresources-example-com" { + from_port = 1 + protocol = "tcp" + security_group_id = aws_security_group.masters-nthsqsresources-example-com.id + source_security_group_id = aws_security_group.nodes-nthsqsresources-example-com.id + to_port = 2379 + type = "ingress" +} + +resource "aws_security_group_rule" "from-nodes-nthsqsresources-example-com-ingress-tcp-2382to4000-masters-nthsqsresources-example-com" { + from_port = 2382 + protocol = "tcp" + security_group_id = aws_security_group.masters-nthsqsresources-example-com.id + source_security_group_id = aws_security_group.nodes-nthsqsresources-example-com.id + to_port = 4000 + type = "ingress" +} + +resource "aws_security_group_rule" "from-nodes-nthsqsresources-example-com-ingress-tcp-4003to65535-masters-nthsqsresources-example-com" { + from_port = 4003 + protocol = "tcp" + security_group_id = aws_security_group.masters-nthsqsresources-example-com.id + source_security_group_id = aws_security_group.nodes-nthsqsresources-example-com.id + to_port = 65535 + type = "ingress" +} + +resource "aws_security_group_rule" "from-nodes-nthsqsresources-example-com-ingress-udp-1to65535-masters-nthsqsresources-example-com" { + from_port = 1 + protocol = "udp" + security_group_id = aws_security_group.masters-nthsqsresources-example-com.id + source_security_group_id = aws_security_group.nodes-nthsqsresources-example-com.id + to_port = 65535 + type = "ingress" +} + +resource "aws_security_group" "masters-nthsqsresources-example-com" { + description = "Security group for masters" + name = "masters.nthsqsresources.example.com" + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "masters.nthsqsresources.example.com" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } + vpc_id = aws_vpc.nthsqsresources-example-com.id +} + +resource "aws_security_group" "nodes-nthsqsresources-example-com" { + description = "Security group for nodes" + name = "nodes.nthsqsresources.example.com" + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "nodes.nthsqsresources.example.com" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } + vpc_id = aws_vpc.nthsqsresources-example-com.id +} + +resource "aws_sqs_queue" "nthsqsresources-example-com-nth" { + message_retention_seconds = 300 + name = "nthsqsresources-example-com-nth" + policy = file("${path.module}/data/aws_sqs_queue_nthsqsresources-example-com-nth_policy") + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "nthsqsresources-example-com-nth" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } +} + +resource "aws_subnet" "us-test-1a-nthsqsresources-example-com" { + availability_zone = "us-test-1a" + cidr_block = "172.20.32.0/19" + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "us-test-1a.nthsqsresources.example.com" + "SubnetType" = "Public" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + "kubernetes.io/role/elb" = "1" + } + vpc_id = aws_vpc.nthsqsresources-example-com.id +} + +resource "aws_vpc_dhcp_options_association" "nthsqsresources-example-com" { + dhcp_options_id = aws_vpc_dhcp_options.nthsqsresources-example-com.id + vpc_id = aws_vpc.nthsqsresources-example-com.id +} + +resource "aws_vpc_dhcp_options" "nthsqsresources-example-com" { + domain_name = "us-test-1.compute.internal" + domain_name_servers = ["AmazonProvidedDNS"] + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "nthsqsresources.example.com" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } +} + +resource "aws_vpc" "nthsqsresources-example-com" { + cidr_block = "172.20.0.0/16" + enable_dns_hostnames = true + enable_dns_support = true + tags = { + "KubernetesCluster" = "nthsqsresources.example.com" + "Name" = "nthsqsresources.example.com" + "kubernetes.io/cluster/nthsqsresources.example.com" = "owned" + } +} + +terraform { + required_version = ">= 0.12.26" + required_providers { + aws = { + "source" = "hashicorp/aws" + "version" = ">= 3.34.0" + } + } +} diff --git a/upup/models/cloudup/resources/addons/node-termination-handler.aws/k8s-1.11.yaml.template b/upup/models/cloudup/resources/addons/node-termination-handler.aws/k8s-1.11.yaml.template index 186c73d6c5..8210001732 100644 --- a/upup/models/cloudup/resources/addons/node-termination-handler.aws/k8s-1.11.yaml.template +++ b/upup/models/cloudup/resources/addons/node-termination-handler.aws/k8s-1.11.yaml.template @@ -66,6 +66,148 @@ roleRef: kind: ClusterRole name: aws-node-termination-handler apiGroup: rbac.authorization.k8s.io +{{ if EnableSQSTerminationDraining }} +--- +# Source: aws-node-termination-handler/templates/deployment.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: aws-node-termination-handler + namespace: kube-system + labels: + app.kubernetes.io/name: aws-node-termination-handler + app.kubernetes.io/instance: aws-node-termination-handler + k8s-app: aws-node-termination-handler + app.kubernetes.io/version: "1.12.1" +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: aws-node-termination-handler + app.kubernetes.io/instance: aws-node-termination-handler + kubernetes.io/os: linux + template: + metadata: + labels: + app.kubernetes.io/name: aws-node-termination-handler + app.kubernetes.io/instance: aws-node-termination-handler + k8s-app: aws-node-termination-handler + kubernetes.io/os: linux + spec: + priorityClassName: "system-node-critical" + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: "kubernetes.io/os" + operator: In + values: + - linux + - key: "kubernetes.io/arch" + operator: In + values: + - amd64 + - arm64 + - arm + serviceAccountName: aws-node-termination-handler + hostNetwork: false + dnsPolicy: "" + securityContext: + fsGroup: 1000 + containers: + - name: aws-node-termination-handler + image: public.ecr.aws/aws-ec2/aws-node-termination-handler:v1.12.1 + imagePullPolicy: IfNotPresent + securityContext: + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 1000 + runAsGroup: 1000 + allowPrivilegeEscalation: false + env: + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: SPOT_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: DELETE_LOCAL_DATA + value: "" + - name: IGNORE_DAEMON_SETS + value: "" + - name: POD_TERMINATION_GRACE_PERIOD + value: "" + - name: INSTANCE_METADATA_URL + value: "" + - name: NODE_TERMINATION_GRACE_PERIOD + value: "" + - name: WEBHOOK_URL + value: "" + - name: WEBHOOK_HEADERS + value: "" + - name: WEBHOOK_TEMPLATE + value: "" + - name: DRY_RUN + value: "false" + - name: METADATA_TRIES + value: "3" + - name: CORDON_ONLY + value: "false" + - name: TAINT_NODE + value: "false" + - name: JSON_LOGGING + value: "false" + - name: LOG_LEVEL + value: "info" + - name: WEBHOOK_PROXY + value: "" + - name: ENABLE_PROMETHEUS_SERVER + value: "{{ .EnablePrometheusMetrics }}" + - name: ENABLE_SPOT_INTERRUPTION_DRAINING + value: "false" + - name: ENABLE_SCHEDULED_EVENT_DRAINING + value: "false" + - name: ENABLE_REBALANCE_MONITORING + value: "false" + - name: ENABLE_SQS_TERMINATION_DRAINING + value: "true" + - name: QUEUE_URL + value: "{{ DefaultQueueName }}" + - name: PROMETHEUS_SERVER_PORT + value: "9092" + - name: AWS_REGION + value: "" + - name: AWS_ENDPOINT + value: "" + - name: CHECK_ASG_TAG_BEFORE_DRAINING + value: "true" + - name: MANAGED_ASG_TAG + value: "{{ .ManagedASGTag }}" + - name: WORKERS + value: "10" + resources: + limits: + cpu: 100m + memory: 128Mi + requests: + cpu: 50m + memory: 64Mi + nodeSelector: + node-role.kubernetes.io/master: "" + tolerations: + - operator: Exists +{{ else }} --- # Source: aws-node-termination-handler/templates/daemonset.linux.yaml apiVersion: apps/v1 @@ -176,4 +318,5 @@ spec: kubernetes.io/os: linux tolerations: - operator: Exists +{{ end }} {{ end }} \ No newline at end of file diff --git a/upup/pkg/fi/cloudup/apply_cluster.go b/upup/pkg/fi/cloudup/apply_cluster.go index 3e53723a75..f39345be0b 100644 --- a/upup/pkg/fi/cloudup/apply_cluster.go +++ b/upup/pkg/fi/cloudup/apply_cluster.go @@ -580,6 +580,14 @@ func (c *ApplyClusterCmd) Run(ctx context.Context) error { l.Builders = append(l.Builders, awsModelBuilder) } + nth := c.Cluster.Spec.NodeTerminationHandler + if nth != nil && fi.BoolValue(nth.Enabled) && fi.BoolValue(nth.EnableSQSTerminationDraining) { + l.Builders = append(l.Builders, &awsmodel.NodeTerminationHandlerBuilder{ + AWSModelContext: awsModelContext, + Lifecycle: &clusterLifecycle, + }) + } + case kops.CloudProviderDO: doModelContext := &domodel.DOModelContext{ KopsModelContext: modelContext, diff --git a/upup/pkg/fi/cloudup/awstasks/BUILD.bazel b/upup/pkg/fi/cloudup/awstasks/BUILD.bazel index 8def2449ed..22b189ef90 100644 --- a/upup/pkg/fi/cloudup/awstasks/BUILD.bazel +++ b/upup/pkg/fi/cloudup/awstasks/BUILD.bazel @@ -5,6 +5,8 @@ go_library( srcs = [ "autoscalinggroup.go", "autoscalinggroup_fitask.go", + "autoscalinggroup_lifecyclehook.go", + "autoscalinglifecyclehook_fitask.go", "block_device_mappings.go", "classic_load_balancer.go", "classic_loadbalancer_attributes.go", @@ -22,6 +24,10 @@ go_library( "ebsvolume_fitask.go", "elastic_ip.go", "elasticip_fitask.go", + "eventbridgerule.go", + "eventbridgerule_fitask.go", + "eventbridgetarget.go", + "eventbridgetarget_fitask.go", "helper.go", "iaminstanceprofile.go", "iaminstanceprofile_fitask.go", @@ -59,6 +65,8 @@ go_library( "securitygroup_fitask.go", "securitygrouprule.go", "securitygrouprule_fitask.go", + "sqs.go", + "sqs_fitask.go", "sshkey.go", "sshkey_fitask.go", "subnet.go", @@ -97,8 +105,10 @@ go_library( "//vendor/github.com/aws/aws-sdk-go/service/ec2:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/elb:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/elbv2:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/eventbridge:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/iam:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/route53:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/sqs:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", "//vendor/k8s.io/klog/v2:go_default_library", ], diff --git a/upup/pkg/fi/cloudup/awstasks/autoscalinggroup_lifecyclehook.go b/upup/pkg/fi/cloudup/awstasks/autoscalinggroup_lifecyclehook.go new file mode 100644 index 0000000000..ff69872716 --- /dev/null +++ b/upup/pkg/fi/cloudup/awstasks/autoscalinggroup_lifecyclehook.go @@ -0,0 +1,154 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package awstasks + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/service/autoscaling" + "k8s.io/apimachinery/pkg/util/validation/field" + "k8s.io/kops/upup/pkg/fi" + "k8s.io/kops/upup/pkg/fi/cloudup/awsup" + "k8s.io/kops/upup/pkg/fi/cloudup/cloudformation" + "k8s.io/kops/upup/pkg/fi/cloudup/terraform" +) + +// +kops:fitask +type AutoscalingLifecycleHook struct { + ID *string + Name *string + Lifecycle *fi.Lifecycle + + AutoscalingGroup *AutoscalingGroup + DefaultResult *string + HeartbeatTimeout *int64 + LifecycleTransition *string +} + +var _ fi.CompareWithID = &AutoscalingLifecycleHook{} + +func (h *AutoscalingLifecycleHook) CompareWithID() *string { + return h.Name +} + +func (h *AutoscalingLifecycleHook) Find(c *fi.Context) (*AutoscalingLifecycleHook, error) { + cloud := c.Cloud.(awsup.AWSCloud) + + request := &autoscaling.DescribeLifecycleHooksInput{ + AutoScalingGroupName: h.AutoscalingGroup.Name, + LifecycleHookNames: []*string{h.Name}, + } + + response, err := cloud.Autoscaling().DescribeLifecycleHooks(request) + if err != nil { + return nil, fmt.Errorf("error listing ASG Lifecycle Hooks: %v", err) + } + if response == nil || len(response.LifecycleHooks) == 0 { + return nil, nil + } + if len(response.LifecycleHooks) > 1 { + return nil, fmt.Errorf("found multiple ASG Lifecycle Hooks with the same name") + } + + hook := response.LifecycleHooks[0] + actual := &AutoscalingLifecycleHook{ + ID: hook.LifecycleHookName, + Name: hook.LifecycleHookName, + Lifecycle: h.Lifecycle, + AutoscalingGroup: h.AutoscalingGroup, + DefaultResult: hook.DefaultResult, + HeartbeatTimeout: hook.HeartbeatTimeout, + LifecycleTransition: hook.LifecycleTransition, + } + + return actual, nil +} + +func (h *AutoscalingLifecycleHook) Run(c *fi.Context) error { + return fi.DefaultDeltaRunMethod(h, c) +} + +func (_ *AutoscalingLifecycleHook) CheckChanges(a, e, changes *AutoscalingLifecycleHook) error { + if a == nil { + if e.Name == nil { + return field.Required(field.NewPath("Name"), "") + } + if e.AutoscalingGroup == nil { + return field.Required(field.NewPath("AutoScalingGroupName"), "") + } + } + + return nil +} + +func (h *AutoscalingLifecycleHook) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *AutoscalingLifecycleHook) error { + if a == nil { + request := &autoscaling.PutLifecycleHookInput{ + AutoScalingGroupName: e.AutoscalingGroup.Name, + DefaultResult: h.DefaultResult, + HeartbeatTimeout: h.HeartbeatTimeout, + LifecycleHookName: e.Name, + LifecycleTransition: h.LifecycleTransition, + } + _, err := t.Cloud.Autoscaling().PutLifecycleHook(request) + if err != nil { + return err + } + } + + return nil +} + +type terraformASGLifecycleHook struct { + Name *string `json:"name" cty:"name"` + AutoScalingGroupName *terraform.Literal `json:"autoscaling_group_name" cty:"autoscaling_group_name"` + DefaultResult *string `json:"default_result" cty:"default_result"` + HeartbeatTimeout *int64 `json:"heartbeat_timeout" cty:"heartbeat_timeout"` + LifecycleTransition *string `json:"lifecycle_transition" cty:"lifecycle_transition"` +} + +func (_ *AutoscalingLifecycleHook) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *AutoscalingLifecycleHook) error { + tf := &terraformASGLifecycleHook{ + Name: e.Name, + AutoScalingGroupName: e.AutoscalingGroup.TerraformLink(), + DefaultResult: e.DefaultResult, + HeartbeatTimeout: e.HeartbeatTimeout, + LifecycleTransition: e.LifecycleTransition, + } + + return t.RenderResource("aws_autoscaling_lifecycle_hook", *e.Name, tf) +} + +type cloudformationASGLifecycleHook struct { + LifecycleHookName *string + AutoScalingGroupName *cloudformation.Literal + DefaultResult *string + HeartbeatTimeout *int64 + LifecycleTransition *string +} + +func (_ *AutoscalingLifecycleHook) RenderCloudformation(t *cloudformation.CloudformationTarget, a, e, changes *AutoscalingLifecycleHook) error { + tf := &cloudformationASGLifecycleHook{ + LifecycleHookName: e.Name, + AutoScalingGroupName: e.AutoscalingGroup.CloudformationLink(), + DefaultResult: e.DefaultResult, + HeartbeatTimeout: e.HeartbeatTimeout, + LifecycleTransition: e.LifecycleTransition, + } + + return t.RenderResource("AWS::AutoScaling::LifecycleHook", *e.Name, tf) +} diff --git a/upup/pkg/fi/cloudup/awstasks/autoscalinglifecyclehook_fitask.go b/upup/pkg/fi/cloudup/awstasks/autoscalinglifecyclehook_fitask.go new file mode 100644 index 0000000000..1514b11771 --- /dev/null +++ b/upup/pkg/fi/cloudup/awstasks/autoscalinglifecyclehook_fitask.go @@ -0,0 +1,51 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by fitask. DO NOT EDIT. + +package awstasks + +import ( + "k8s.io/kops/upup/pkg/fi" +) + +// AutoscalingLifecycleHook + +var _ fi.HasLifecycle = &AutoscalingLifecycleHook{} + +// GetLifecycle returns the Lifecycle of the object, implementing fi.HasLifecycle +func (o *AutoscalingLifecycleHook) GetLifecycle() *fi.Lifecycle { + return o.Lifecycle +} + +// SetLifecycle sets the Lifecycle of the object, implementing fi.SetLifecycle +func (o *AutoscalingLifecycleHook) SetLifecycle(lifecycle fi.Lifecycle) { + o.Lifecycle = &lifecycle +} + +var _ fi.HasName = &AutoscalingLifecycleHook{} + +// GetName returns the Name of the object, implementing fi.HasName +func (o *AutoscalingLifecycleHook) GetName() *string { + return o.Name +} + +// String is the stringer function for the task, producing readable output using fi.TaskAsString +func (o *AutoscalingLifecycleHook) String() string { + return fi.TaskAsString(o) +} diff --git a/upup/pkg/fi/cloudup/awstasks/eventbridgerule.go b/upup/pkg/fi/cloudup/awstasks/eventbridgerule.go new file mode 100644 index 0000000000..1f5f61e87b --- /dev/null +++ b/upup/pkg/fi/cloudup/awstasks/eventbridgerule.go @@ -0,0 +1,188 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package awstasks + +import ( + "encoding/json" + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/eventbridge" + "k8s.io/apimachinery/pkg/util/validation/field" + "k8s.io/kops/upup/pkg/fi" + "k8s.io/kops/upup/pkg/fi/cloudup/awsup" + "k8s.io/kops/upup/pkg/fi/cloudup/cloudformation" + "k8s.io/kops/upup/pkg/fi/cloudup/terraform" +) + +// +kops:fitask +type EventBridgeRule struct { + ID *string + Name *string + Lifecycle *fi.Lifecycle + + EventPattern *string + TargetArn *string // required for cloudformation rendering + + Tags map[string]string +} + +var _ fi.CompareWithID = &EventBridgeRule{} + +func (eb *EventBridgeRule) CompareWithID() *string { + return eb.Name +} + +func (eb *EventBridgeRule) Find(c *fi.Context) (*EventBridgeRule, error) { + cloud := c.Cloud.(awsup.AWSCloud) + + if eb.Name == nil { + return nil, nil + } + + request := &eventbridge.ListRulesInput{ + NamePrefix: eb.Name, + } + response, err := cloud.EventBridge().ListRules(request) + if err != nil { + return nil, fmt.Errorf("error listing EventBridge rules: %v", err) + } + if response == nil || len(response.Rules) == 0 { + return nil, nil + } + if len(response.Rules) > 1 { + return nil, fmt.Errorf("found multiple EventBridge rules with the same name") + } + + rule := response.Rules[0] + + tagResponse, err := cloud.EventBridge().ListTagsForResource(&eventbridge.ListTagsForResourceInput{ResourceARN: rule.Arn}) + if err != nil { + return nil, fmt.Errorf("error listing tags for EventBridge rule: %v", err) + } + + actual := &EventBridgeRule{ + ID: eb.ID, + Name: eb.Name, + Lifecycle: eb.Lifecycle, + EventPattern: rule.EventPattern, + TargetArn: eb.TargetArn, + Tags: mapEventBridgeTagsToMap(tagResponse.Tags), + } + return actual, nil +} + +func (eb *EventBridgeRule) Run(c *fi.Context) error { + return fi.DefaultDeltaRunMethod(eb, c) +} + +func (_ *EventBridgeRule) CheckChanges(a, e, changes *EventBridgeRule) error { + if a == nil { + if e.Name == nil { + return field.Required(field.NewPath("Name"), "") + } + } + + return nil +} + +func (eb *EventBridgeRule) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *EventBridgeRule) error { + if a == nil { + var tags []*eventbridge.Tag + for k, v := range eb.Tags { + tags = append(tags, &eventbridge.Tag{ + Key: aws.String(k), + Value: aws.String(v), + }) + } + + request := &eventbridge.PutRuleInput{ + Name: eb.Name, + EventPattern: e.EventPattern, + Tags: tags, + } + + _, err := t.Cloud.EventBridge().PutRule(request) + if err != nil { + return fmt.Errorf("error creating EventBridge rule: %v", err) + } + } + + return nil +} + +type terraformEventBridgeRule struct { + Name *string `json:"name" cty:"name"` + EventPattern *terraform.Literal `json:"event_pattern" cty:"event_pattern"` + Tags map[string]string `json:"tags,omitempty" cty:"tags"` +} + +func (_ *EventBridgeRule) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *EventBridgeRule) error { + m, err := t.AddFile("aws_cloudwatch_event_rule", *e.Name, "event_pattern", fi.NewStringResource(*e.EventPattern), false) + if err != nil { + return err + } + + tf := &terraformEventBridgeRule{ + Name: e.Name, + EventPattern: m, + Tags: e.Tags, + } + + return t.RenderResource("aws_cloudwatch_event_rule", *e.Name, tf) +} + +func (eb *EventBridgeRule) TerraformLink() *terraform.Literal { + return terraform.LiteralProperty("aws_cloudwatch_event_rule", fi.StringValue(eb.Name), "id") +} + +type cloudformationTarget struct { + Id *string + Arn *string +} + +type cloudformationEventBridgeRule struct { + Name *string `json:"Name"` + EventPattern map[string]interface{} `json:"EventPattern"` + Targets []cloudformationTarget `json:"Targets"` +} + +func (_ *EventBridgeRule) RenderCloudformation(t *cloudformation.CloudformationTarget, a, e, changes *EventBridgeRule) error { + // convert event pattern string into a json struct + jsonString, err := fi.ResourceAsBytes(fi.NewStringResource(*e.EventPattern)) + if err != nil { + return err + } + data := make(map[string]interface{}) + err = json.Unmarshal(jsonString, &data) + if err != nil { + return fmt.Errorf("error parsing SQS PolicyDocument: %v", err) + } + + target := &cloudformationTarget{ + Id: s("1"), + Arn: e.TargetArn, + } + + cf := &cloudformationEventBridgeRule{ + Name: e.Name, + EventPattern: data, + Targets: []cloudformationTarget{*target}, + } + + return t.RenderResource("AWS::Events::Rule", *e.Name, cf) +} diff --git a/upup/pkg/fi/cloudup/awstasks/eventbridgerule_fitask.go b/upup/pkg/fi/cloudup/awstasks/eventbridgerule_fitask.go new file mode 100644 index 0000000000..cb76afdb95 --- /dev/null +++ b/upup/pkg/fi/cloudup/awstasks/eventbridgerule_fitask.go @@ -0,0 +1,51 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by fitask. DO NOT EDIT. + +package awstasks + +import ( + "k8s.io/kops/upup/pkg/fi" +) + +// EventBridgeRule + +var _ fi.HasLifecycle = &EventBridgeRule{} + +// GetLifecycle returns the Lifecycle of the object, implementing fi.HasLifecycle +func (o *EventBridgeRule) GetLifecycle() *fi.Lifecycle { + return o.Lifecycle +} + +// SetLifecycle sets the Lifecycle of the object, implementing fi.SetLifecycle +func (o *EventBridgeRule) SetLifecycle(lifecycle fi.Lifecycle) { + o.Lifecycle = &lifecycle +} + +var _ fi.HasName = &EventBridgeRule{} + +// GetName returns the Name of the object, implementing fi.HasName +func (o *EventBridgeRule) GetName() *string { + return o.Name +} + +// String is the stringer function for the task, producing readable output using fi.TaskAsString +func (o *EventBridgeRule) String() string { + return fi.TaskAsString(o) +} diff --git a/upup/pkg/fi/cloudup/awstasks/eventbridgetarget.go b/upup/pkg/fi/cloudup/awstasks/eventbridgetarget.go new file mode 100644 index 0000000000..9d12b13345 --- /dev/null +++ b/upup/pkg/fi/cloudup/awstasks/eventbridgetarget.go @@ -0,0 +1,146 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package awstasks + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/util/validation/field" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/eventbridge" + "k8s.io/kops/upup/pkg/fi" + "k8s.io/kops/upup/pkg/fi/cloudup/awsup" + "k8s.io/kops/upup/pkg/fi/cloudup/cloudformation" + "k8s.io/kops/upup/pkg/fi/cloudup/terraform" +) + +// +kops:fitask +type EventBridgeTarget struct { + ID *string + Name *string + Lifecycle *fi.Lifecycle + + Rule *EventBridgeRule + TargetArn *string +} + +var _ fi.CompareWithID = &EventBridgeTarget{} + +func (eb *EventBridgeTarget) CompareWithID() *string { + return eb.Name +} + +func (eb *EventBridgeTarget) Find(c *fi.Context) (*EventBridgeTarget, error) { + cloud := c.Cloud.(awsup.AWSCloud) + + if eb.Rule == nil || eb.TargetArn == nil { + return nil, nil + } + + // find the rule the target is attached to + rule, err := eb.Rule.Find(c) + if err != nil { + return nil, err + } + if rule == nil { + return nil, nil + } + + request := &eventbridge.ListTargetsByRuleInput{ + Rule: eb.Rule.Name, + } + + response, err := cloud.EventBridge().ListTargetsByRule(request) + if err != nil { + return nil, fmt.Errorf("error listing EventBridge targets: %v", err) + } + if response == nil || len(response.Targets) == 0 { + return nil, nil + } + for _, target := range response.Targets { + if *target.Arn == *eb.TargetArn { + actual := &EventBridgeTarget{ + ID: target.Id, + Name: eb.Name, + Lifecycle: eb.Lifecycle, + Rule: eb.Rule, + TargetArn: eb.TargetArn, + } + return actual, nil + } + } + + return nil, nil +} + +func (eb *EventBridgeTarget) Run(c *fi.Context) error { + return fi.DefaultDeltaRunMethod(eb, c) +} + +func (_ *EventBridgeTarget) CheckChanges(a, e, changes *EventBridgeTarget) error { + if a == nil { + if e.Rule == nil { + return field.Required(field.NewPath("Rule"), "") + } + if e.TargetArn == nil { + return field.Required(field.NewPath("TargetArn"), "") + } + } + + return nil +} + +func (eb *EventBridgeTarget) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *EventBridgeTarget) error { + if a == nil { + target := &eventbridge.Target{ + Arn: eb.TargetArn, + Id: aws.String("1"), + } + + request := &eventbridge.PutTargetsInput{ + Rule: eb.Rule.Name, + Targets: []*eventbridge.Target{target}, + } + + _, err := t.Cloud.EventBridge().PutTargets(request) + if err != nil { + return fmt.Errorf("error creating EventBridge target: %v", err) + } + } + + return nil +} + +type terraformEventBridgeTarget struct { + RuleName *terraform.Literal `json:"rule" cty:"rule"` + TargetArn *string `json:"arn" cty:"arn"` +} + +func (_ *EventBridgeTarget) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *EventBridgeTarget) error { + tf := &terraformEventBridgeTarget{ + RuleName: e.Rule.TerraformLink(), + TargetArn: e.TargetArn, + } + + return t.RenderResource("aws_cloudwatch_event_target", *e.Name, tf) +} + +func (_ *EventBridgeTarget) RenderCloudformation(t *cloudformation.CloudformationTarget, a, e, changes *EventBridgeTarget) error { + // There is no Cloudformation EventBridge Target resource. Instead it's included in Cloudformation's EventBridge Rule resource + return nil +} diff --git a/upup/pkg/fi/cloudup/awstasks/eventbridgetarget_fitask.go b/upup/pkg/fi/cloudup/awstasks/eventbridgetarget_fitask.go new file mode 100644 index 0000000000..8511fe3f73 --- /dev/null +++ b/upup/pkg/fi/cloudup/awstasks/eventbridgetarget_fitask.go @@ -0,0 +1,51 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by fitask. DO NOT EDIT. + +package awstasks + +import ( + "k8s.io/kops/upup/pkg/fi" +) + +// EventBridgeTarget + +var _ fi.HasLifecycle = &EventBridgeTarget{} + +// GetLifecycle returns the Lifecycle of the object, implementing fi.HasLifecycle +func (o *EventBridgeTarget) GetLifecycle() *fi.Lifecycle { + return o.Lifecycle +} + +// SetLifecycle sets the Lifecycle of the object, implementing fi.SetLifecycle +func (o *EventBridgeTarget) SetLifecycle(lifecycle fi.Lifecycle) { + o.Lifecycle = &lifecycle +} + +var _ fi.HasName = &EventBridgeTarget{} + +// GetName returns the Name of the object, implementing fi.HasName +func (o *EventBridgeTarget) GetName() *string { + return o.Name +} + +// String is the stringer function for the task, producing readable output using fi.TaskAsString +func (o *EventBridgeTarget) String() string { + return fi.TaskAsString(o) +} diff --git a/upup/pkg/fi/cloudup/awstasks/sqs.go b/upup/pkg/fi/cloudup/awstasks/sqs.go new file mode 100644 index 0000000000..b3a684ec51 --- /dev/null +++ b/upup/pkg/fi/cloudup/awstasks/sqs.go @@ -0,0 +1,246 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package awstasks + +import ( + "encoding/json" + "fmt" + "strconv" + + "k8s.io/apimachinery/pkg/util/validation/field" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/sqs" + "k8s.io/kops/upup/pkg/fi" + "k8s.io/kops/upup/pkg/fi/cloudup/awsup" + "k8s.io/kops/upup/pkg/fi/cloudup/cloudformation" + "k8s.io/kops/upup/pkg/fi/cloudup/terraform" +) + +// +kops:fitask +type SQS struct { + Name *string + Lifecycle *fi.Lifecycle + + URL *string + MessageRetentionPeriod int + Policy fi.Resource // "inline" IAM policy + + Tags map[string]string +} + +var _ fi.CompareWithID = &SQS{} + +func (q *SQS) CompareWithID() *string { + return q.URL +} + +func (q *SQS) Find(c *fi.Context) (*SQS, error) { + cloud := c.Cloud.(awsup.AWSCloud) + + if q.Name == nil { + return nil, nil + } + + response, err := cloud.SQS().ListQueues(&sqs.ListQueuesInput{ + MaxResults: aws.Int64(2), + QueueNamePrefix: q.Name, + }) + if err != nil { + return nil, fmt.Errorf("error listing SQS queues: %v", err) + } + if response == nil || len(response.QueueUrls) == 0 { + return nil, nil + } + if len(response.QueueUrls) != 1 { + return nil, fmt.Errorf("found multiple SQS queues matching queue name") + } + url := response.QueueUrls[0] + + attributes, err := cloud.SQS().GetQueueAttributes(&sqs.GetQueueAttributesInput{ + AttributeNames: []*string{s("MessageRetentionPeriod"), s("Policy")}, + QueueUrl: url, + }) + if err != nil { + return nil, fmt.Errorf("error getting SQS queue attributes: %v", err) + } + policy := fi.NewStringResource(*attributes.Attributes["Policy"]) + period, err := strconv.Atoi(*attributes.Attributes["MessageRetentionPeriod"]) + if err != nil { + return nil, fmt.Errorf("error coverting MessageRetentionPeriod to int: %v", err) + } + + tags, err := cloud.SQS().ListQueueTags(&sqs.ListQueueTagsInput{ + QueueUrl: url, + }) + if err != nil { + return nil, fmt.Errorf("error listing SQS queue tags: %v", err) + } + + actual := &SQS{ + Name: q.Name, + URL: url, + Lifecycle: q.Lifecycle, + Policy: policy, + MessageRetentionPeriod: period, + Tags: intersectSQSTags(tags.Tags, q.Tags), + } + + return actual, nil +} + +func (q *SQS) Run(c *fi.Context) error { + return fi.DefaultDeltaRunMethod(q, c) +} + +func (q *SQS) CheckChanges(a, e, changes *SQS) error { + if a == nil { + if e.Name == nil { + return field.Required(field.NewPath("Name"), "") + } + } + if a != nil { + if changes.URL != nil { + return fi.CannotChangeField("URL") + } + } + return nil +} + +func (q *SQS) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *SQS) error { + policy, err := fi.ResourceAsString(e.Policy) + if err != nil { + return fmt.Errorf("error rendering RolePolicyDocument: %v", err) + } + + if a == nil { + request := &sqs.CreateQueueInput{ + Attributes: map[string]*string{ + "MessageRetentionPeriod": s(strconv.Itoa(q.MessageRetentionPeriod)), + "Policy": s(policy), + }, + QueueName: q.Name, + Tags: convertTagsToPointers(q.Tags), + } + response, err := t.Cloud.SQS().CreateQueue(request) + if err != nil { + return fmt.Errorf("error creating SQS queue: %v", err) + } + + q.URL = response.QueueUrl + } + + return nil +} + +type terraformSQSQueue struct { + Name *string `json:"name" cty:"name"` + MessageRetentionSeconds int `json:"message_retention_seconds" cty:"message_retention_seconds"` + Policy *terraform.Literal `json:"policy" cty:"policy"` + Tags map[string]string `json:"tags" cty:"tags"` +} + +func (_ *SQS) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *SQS) error { + p, err := t.AddFile("aws_sqs_queue", *e.Name, "policy", e.Policy, false) + if err != nil { + return err + } + + tf := &terraformSQSQueue{ + Name: e.Name, + MessageRetentionSeconds: e.MessageRetentionPeriod, + Policy: p, + Tags: e.Tags, + } + + return t.RenderResource("aws_sqs_queue", *e.Name, tf) +} + +type cloudformationSQSQueue struct { + QueueName *string `json:"QueueName"` + MessageRetentionPeriod int `json:"MessageRetentionPeriod"` + Tags []cloudformationTag `json:"Tags,omitempty"` +} + +type cloudformationSQSQueuePolicy struct { + Queues []*cloudformation.Literal `json:"Queues"` + PolicyDocument map[string]interface{} `json:"PolicyDocument"` + Tags []cloudformationTag `json:"Tags,omitempty"` +} + +func (_ *SQS) RenderCloudformation(t *cloudformation.CloudformationTarget, a, e, changes *SQS) error { + cfQueue := &cloudformationSQSQueue{ + QueueName: e.Name, + MessageRetentionPeriod: e.MessageRetentionPeriod, + Tags: buildCloudformationTags(e.Tags), + } + + err := t.RenderResource("AWS::SQS::Queue", *e.Name, cfQueue) + if err != nil { + return err + } + + // convert Policy string into json + jsonString, err := fi.ResourceAsBytes(e.Policy) + if err != nil { + return err + } + data := make(map[string]interface{}) + err = json.Unmarshal(jsonString, &data) + if err != nil { + return fmt.Errorf("error parsing SQS PolicyDocument: %v", err) + } + + cfQueueRef := cloudformation.Ref("AWS::SQS::Queue", fi.StringValue(e.Name)) + + cfQueuePolicy := &cloudformationSQSQueuePolicy{ + Queues: []*cloudformation.Literal{cfQueueRef}, + PolicyDocument: data, + } + return t.RenderResource("AWS::SQS::QueuePolicy", *e.Name+"Policy", cfQueuePolicy) +} + +// change tags to format required by CreateQueue +func convertTagsToPointers(tags map[string]string) map[string]*string { + newTags := map[string]*string{} + for k, v := range tags { + vv := v + newTags[k] = &vv + } + + return newTags +} + +// intersectSQSTags does the same thing as intersectTags, but takes different input because SQS tags are listed differently +func intersectSQSTags(tags map[string]*string, desired map[string]string) map[string]string { + if tags == nil { + return nil + } + actual := make(map[string]string) + for k, v := range tags { + vv := aws.StringValue(v) + + if _, found := desired[k]; found { + actual[k] = vv + } + } + if len(actual) == 0 && desired == nil { + // Avoid problems with comparison between nil & {} + return nil + } + return actual +} diff --git a/upup/pkg/fi/cloudup/awstasks/sqs_fitask.go b/upup/pkg/fi/cloudup/awstasks/sqs_fitask.go new file mode 100644 index 0000000000..ff1bb8c93f --- /dev/null +++ b/upup/pkg/fi/cloudup/awstasks/sqs_fitask.go @@ -0,0 +1,51 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by fitask. DO NOT EDIT. + +package awstasks + +import ( + "k8s.io/kops/upup/pkg/fi" +) + +// SQS + +var _ fi.HasLifecycle = &SQS{} + +// GetLifecycle returns the Lifecycle of the object, implementing fi.HasLifecycle +func (o *SQS) GetLifecycle() *fi.Lifecycle { + return o.Lifecycle +} + +// SetLifecycle sets the Lifecycle of the object, implementing fi.SetLifecycle +func (o *SQS) SetLifecycle(lifecycle fi.Lifecycle) { + o.Lifecycle = &lifecycle +} + +var _ fi.HasName = &SQS{} + +// GetName returns the Name of the object, implementing fi.HasName +func (o *SQS) GetName() *string { + return o.Name +} + +// String is the stringer function for the task, producing readable output using fi.TaskAsString +func (o *SQS) String() string { + return fi.TaskAsString(o) +} diff --git a/upup/pkg/fi/cloudup/awstasks/tags.go b/upup/pkg/fi/cloudup/awstasks/tags.go index 3627c92c01..e75d2c8826 100644 --- a/upup/pkg/fi/cloudup/awstasks/tags.go +++ b/upup/pkg/fi/cloudup/awstasks/tags.go @@ -21,6 +21,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/aws/aws-sdk-go/service/eventbridge" "github.com/aws/aws-sdk-go/service/iam" ) @@ -66,6 +67,20 @@ func mapToIAMTags(tags map[string]string) []*iam.Tag { return m } +func mapEventBridgeTagsToMap(tags []*eventbridge.Tag) map[string]string { + if tags == nil { + return nil + } + m := make(map[string]string) + for _, t := range tags { + if strings.HasPrefix(aws.StringValue(t.Key), "aws:cloudformation:") { + continue + } + m[aws.StringValue(t.Key)] = aws.StringValue(t.Value) + } + return m +} + func findNameTag(tags []*ec2.Tag) *string { for _, tag := range tags { if aws.StringValue(tag.Key) == "Name" { diff --git a/upup/pkg/fi/cloudup/awsup/BUILD.bazel b/upup/pkg/fi/cloudup/awsup/BUILD.bazel index f0d02f89a5..0015893513 100644 --- a/upup/pkg/fi/cloudup/awsup/BUILD.bazel +++ b/upup/pkg/fi/cloudup/awsup/BUILD.bazel @@ -45,10 +45,14 @@ go_library( "//vendor/github.com/aws/aws-sdk-go/service/elb/elbiface:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/elbv2:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/elbv2/elbv2iface:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/eventbridge:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/eventbridge/eventbridgeiface:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/iam:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/iam/iamiface:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/route53:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/route53/route53iface:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/sqs:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/sqs/sqsiface:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/sts:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", diff --git a/upup/pkg/fi/cloudup/awsup/aws_cloud.go b/upup/pkg/fi/cloudup/awsup/aws_cloud.go index 6dfbfc6a20..ba79c87986 100644 --- a/upup/pkg/fi/cloudup/awsup/aws_cloud.go +++ b/upup/pkg/fi/cloudup/awsup/aws_cloud.go @@ -23,6 +23,11 @@ import ( "sync" "time" + "github.com/aws/aws-sdk-go/service/eventbridge" + "github.com/aws/aws-sdk-go/service/eventbridge/eventbridgeiface" + "github.com/aws/aws-sdk-go/service/sqs" + "github.com/aws/aws-sdk-go/service/sqs/sqsiface" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/awserr" @@ -114,6 +119,9 @@ type AWSCloud interface { Route53() route53iface.Route53API Spotinst() spotinst.Cloud + SQS() sqsiface.SQSAPI + EventBridge() eventbridgeiface.EventBridgeAPI + // TODO: Document and rationalize these tags/filters methods AddTags(name *string, tags map[string]string) BuildFilters(name *string) []*ec2.Filter @@ -181,6 +189,8 @@ type awsCloudImplementation struct { route53 *route53.Route53 spotinst spotinst.Cloud sts *sts.STS + sqs *sqs.SQS + eventbridge *eventbridge.EventBridge region string @@ -314,6 +324,22 @@ func NewAWSCloud(region string, tags map[string]string) (AWSCloud, error) { } } + sess, err = session.NewSession(config) + if err != nil { + return c, err + } + c.sqs = sqs.New(sess, config) + c.sqs.Handlers.Send.PushFront(requestLogger) + c.addHandlers(region, &c.sqs.Handlers) + + sess, err = session.NewSession(config) + if err != nil { + return c, err + } + c.eventbridge = eventbridge.New(sess, config) + c.eventbridge.Handlers.Send.PushFront(requestLogger) + c.addHandlers(region, &c.eventbridge.Handlers) + awsCloudInstances[region] = c raw = c } @@ -1608,6 +1634,14 @@ func (c *awsCloudImplementation) Spotinst() spotinst.Cloud { return c.spotinst } +func (c *awsCloudImplementation) SQS() sqsiface.SQSAPI { + return c.sqs +} + +func (c *awsCloudImplementation) EventBridge() eventbridgeiface.EventBridgeAPI { + return c.eventbridge +} + func (c *awsCloudImplementation) FindVPCInfo(vpcID string) (*fi.VPCInfo, error) { return findVPCInfo(c, vpcID) } diff --git a/upup/pkg/fi/cloudup/awsup/mock_aws_cloud.go b/upup/pkg/fi/cloudup/awsup/mock_aws_cloud.go index 938598260c..6e6f0a4ea7 100644 --- a/upup/pkg/fi/cloudup/awsup/mock_aws_cloud.go +++ b/upup/pkg/fi/cloudup/awsup/mock_aws_cloud.go @@ -19,6 +19,9 @@ package awsup import ( "fmt" + "github.com/aws/aws-sdk-go/service/eventbridge/eventbridgeiface" + "github.com/aws/aws-sdk-go/service/sqs/sqsiface" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface" "github.com/aws/aws-sdk-go/service/cloudformation" @@ -80,6 +83,8 @@ type MockCloud struct { MockELB elbiface.ELBAPI MockELBV2 elbv2iface.ELBV2API MockSpotinst spotinst.Cloud + MockSQS sqsiface.SQSAPI + MockEventBridge eventbridgeiface.EventBridgeAPI } func (c *MockAWSCloud) DeleteGroup(g *cloudinstances.CloudInstanceGroup) error { @@ -261,6 +266,20 @@ func (c *MockAWSCloud) Spotinst() spotinst.Cloud { return c.MockSpotinst } +func (c *MockAWSCloud) SQS() sqsiface.SQSAPI { + if c.MockSQS == nil { + klog.Fatalf("MockSQS not set") + } + return c.MockSQS +} + +func (c *MockAWSCloud) EventBridge() eventbridgeiface.EventBridgeAPI { + if c.MockEventBridge == nil { + klog.Fatalf("MockEventBridgess not set") + } + return c.MockEventBridge +} + func (c *MockAWSCloud) FindVPCInfo(id string) (*fi.VPCInfo, error) { return findVPCInfo(c, id) } diff --git a/upup/pkg/fi/cloudup/template_functions.go b/upup/pkg/fi/cloudup/template_functions.go index 31c156de5f..e84d15015b 100644 --- a/upup/pkg/fi/cloudup/template_functions.go +++ b/upup/pkg/fi/cloudup/template_functions.go @@ -217,6 +217,20 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS dest["UseServiceAccountIAM"] = tf.UseServiceAccountIAM + if cluster.Spec.NodeTerminationHandler != nil { + dest["DefaultQueueName"] = func() string { + s := strings.Replace(tf.ClusterName(), ".", "-", -1) + domain := ".amazonaws.com/" + if strings.Contains(tf.Region, "cn-") { + domain = ".amazonaws.com.cn/" + } + url := "https://sqs." + tf.Region + domain + tf.AWSAccountID + "/" + s + "-nth" + return url + } + + dest["EnableSQSTerminationDraining"] = func() bool { return *cluster.Spec.NodeTerminationHandler.EnableSQSTerminationDraining } + } + return nil } diff --git a/vendor/github.com/aws/aws-sdk-go/service/eventbridge/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/service/eventbridge/BUILD.bazel new file mode 100644 index 0000000000..42a7976ac6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/eventbridge/BUILD.bazel @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "api.go", + "doc.go", + "errors.go", + "service.go", + ], + importmap = "k8s.io/kops/vendor/github.com/aws/aws-sdk-go/service/eventbridge", + importpath = "github.com/aws/aws-sdk-go/service/eventbridge", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/awsutil:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/client:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/client/metadata:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/signer/v4:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc:go_default_library", + ], +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/eventbridge/api.go b/vendor/github.com/aws/aws-sdk-go/service/eventbridge/api.go new file mode 100644 index 0000000000..e83771867b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/eventbridge/api.go @@ -0,0 +1,14448 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package eventbridge + +import ( + "fmt" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" +) + +const opActivateEventSource = "ActivateEventSource" + +// ActivateEventSourceRequest generates a "aws/request.Request" representing the +// client's request for the ActivateEventSource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ActivateEventSource for more information on using the ActivateEventSource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ActivateEventSourceRequest method. +// req, resp := client.ActivateEventSourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ActivateEventSource +func (c *EventBridge) ActivateEventSourceRequest(input *ActivateEventSourceInput) (req *request.Request, output *ActivateEventSourceOutput) { + op := &request.Operation{ + Name: opActivateEventSource, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ActivateEventSourceInput{} + } + + output = &ActivateEventSourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// ActivateEventSource API operation for Amazon EventBridge. +// +// Activates a partner event source that has been deactivated. Once activated, +// your matching event bus will start receiving events from the event source. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation ActivateEventSource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * InvalidStateException +// The specified state is not a valid state for an event source. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * OperationDisabledException +// The operation you are attempting is not available in this region. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ActivateEventSource +func (c *EventBridge) ActivateEventSource(input *ActivateEventSourceInput) (*ActivateEventSourceOutput, error) { + req, out := c.ActivateEventSourceRequest(input) + return out, req.Send() +} + +// ActivateEventSourceWithContext is the same as ActivateEventSource with the addition of +// the ability to pass a context and additional request options. +// +// See ActivateEventSource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) ActivateEventSourceWithContext(ctx aws.Context, input *ActivateEventSourceInput, opts ...request.Option) (*ActivateEventSourceOutput, error) { + req, out := c.ActivateEventSourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCancelReplay = "CancelReplay" + +// CancelReplayRequest generates a "aws/request.Request" representing the +// client's request for the CancelReplay operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CancelReplay for more information on using the CancelReplay +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CancelReplayRequest method. +// req, resp := client.CancelReplayRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/CancelReplay +func (c *EventBridge) CancelReplayRequest(input *CancelReplayInput) (req *request.Request, output *CancelReplayOutput) { + op := &request.Operation{ + Name: opCancelReplay, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CancelReplayInput{} + } + + output = &CancelReplayOutput{} + req = c.newRequest(op, input, output) + return +} + +// CancelReplay API operation for Amazon EventBridge. +// +// Cancels the specified replay. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation CancelReplay for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * IllegalStatusException +// An error occurred because a replay can be canceled only when the state is +// Running or Starting. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/CancelReplay +func (c *EventBridge) CancelReplay(input *CancelReplayInput) (*CancelReplayOutput, error) { + req, out := c.CancelReplayRequest(input) + return out, req.Send() +} + +// CancelReplayWithContext is the same as CancelReplay with the addition of +// the ability to pass a context and additional request options. +// +// See CancelReplay for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) CancelReplayWithContext(ctx aws.Context, input *CancelReplayInput, opts ...request.Option) (*CancelReplayOutput, error) { + req, out := c.CancelReplayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateApiDestination = "CreateApiDestination" + +// CreateApiDestinationRequest generates a "aws/request.Request" representing the +// client's request for the CreateApiDestination operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateApiDestination for more information on using the CreateApiDestination +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateApiDestinationRequest method. +// req, resp := client.CreateApiDestinationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/CreateApiDestination +func (c *EventBridge) CreateApiDestinationRequest(input *CreateApiDestinationInput) (req *request.Request, output *CreateApiDestinationOutput) { + op := &request.Operation{ + Name: opCreateApiDestination, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateApiDestinationInput{} + } + + output = &CreateApiDestinationOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateApiDestination API operation for Amazon EventBridge. +// +// Creates an API destination, which is an HTTP invocation endpoint configured +// as a target for events. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation CreateApiDestination for usage and error information. +// +// Returned Error Types: +// * ResourceAlreadyExistsException +// The resource you are trying to create already exists. +// +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * LimitExceededException +// The request failed because it attempted to create resource beyond the allowed +// service quota. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/CreateApiDestination +func (c *EventBridge) CreateApiDestination(input *CreateApiDestinationInput) (*CreateApiDestinationOutput, error) { + req, out := c.CreateApiDestinationRequest(input) + return out, req.Send() +} + +// CreateApiDestinationWithContext is the same as CreateApiDestination with the addition of +// the ability to pass a context and additional request options. +// +// See CreateApiDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) CreateApiDestinationWithContext(ctx aws.Context, input *CreateApiDestinationInput, opts ...request.Option) (*CreateApiDestinationOutput, error) { + req, out := c.CreateApiDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateArchive = "CreateArchive" + +// CreateArchiveRequest generates a "aws/request.Request" representing the +// client's request for the CreateArchive operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateArchive for more information on using the CreateArchive +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateArchiveRequest method. +// req, resp := client.CreateArchiveRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/CreateArchive +func (c *EventBridge) CreateArchiveRequest(input *CreateArchiveInput) (req *request.Request, output *CreateArchiveOutput) { + op := &request.Operation{ + Name: opCreateArchive, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateArchiveInput{} + } + + output = &CreateArchiveOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateArchive API operation for Amazon EventBridge. +// +// Creates an archive of events with the specified settings. When you create +// an archive, incoming events might not immediately start being sent to the +// archive. Allow a short period of time for changes to take effect. If you +// do not specify a pattern to filter events sent to the archive, all events +// are sent to the archive except replayed events. Replayed events are not sent +// to an archive. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation CreateArchive for usage and error information. +// +// Returned Error Types: +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * ResourceAlreadyExistsException +// The resource you are trying to create already exists. +// +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * LimitExceededException +// The request failed because it attempted to create resource beyond the allowed +// service quota. +// +// * InvalidEventPatternException +// The event pattern is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/CreateArchive +func (c *EventBridge) CreateArchive(input *CreateArchiveInput) (*CreateArchiveOutput, error) { + req, out := c.CreateArchiveRequest(input) + return out, req.Send() +} + +// CreateArchiveWithContext is the same as CreateArchive with the addition of +// the ability to pass a context and additional request options. +// +// See CreateArchive for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) CreateArchiveWithContext(ctx aws.Context, input *CreateArchiveInput, opts ...request.Option) (*CreateArchiveOutput, error) { + req, out := c.CreateArchiveRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateConnection = "CreateConnection" + +// CreateConnectionRequest generates a "aws/request.Request" representing the +// client's request for the CreateConnection operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateConnection for more information on using the CreateConnection +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateConnectionRequest method. +// req, resp := client.CreateConnectionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/CreateConnection +func (c *EventBridge) CreateConnectionRequest(input *CreateConnectionInput) (req *request.Request, output *CreateConnectionOutput) { + op := &request.Operation{ + Name: opCreateConnection, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateConnectionInput{} + } + + output = &CreateConnectionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateConnection API operation for Amazon EventBridge. +// +// Creates a connection. A connection defines the authorization type and credentials +// to use for authorization with an API destination HTTP endpoint. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation CreateConnection for usage and error information. +// +// Returned Error Types: +// * ResourceAlreadyExistsException +// The resource you are trying to create already exists. +// +// * LimitExceededException +// The request failed because it attempted to create resource beyond the allowed +// service quota. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/CreateConnection +func (c *EventBridge) CreateConnection(input *CreateConnectionInput) (*CreateConnectionOutput, error) { + req, out := c.CreateConnectionRequest(input) + return out, req.Send() +} + +// CreateConnectionWithContext is the same as CreateConnection with the addition of +// the ability to pass a context and additional request options. +// +// See CreateConnection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) CreateConnectionWithContext(ctx aws.Context, input *CreateConnectionInput, opts ...request.Option) (*CreateConnectionOutput, error) { + req, out := c.CreateConnectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateEventBus = "CreateEventBus" + +// CreateEventBusRequest generates a "aws/request.Request" representing the +// client's request for the CreateEventBus operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateEventBus for more information on using the CreateEventBus +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateEventBusRequest method. +// req, resp := client.CreateEventBusRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/CreateEventBus +func (c *EventBridge) CreateEventBusRequest(input *CreateEventBusInput) (req *request.Request, output *CreateEventBusOutput) { + op := &request.Operation{ + Name: opCreateEventBus, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateEventBusInput{} + } + + output = &CreateEventBusOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateEventBus API operation for Amazon EventBridge. +// +// Creates a new event bus within your account. This can be a custom event bus +// which you can use to receive events from your custom applications and services, +// or it can be a partner event bus which can be matched to a partner event +// source. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation CreateEventBus for usage and error information. +// +// Returned Error Types: +// * ResourceAlreadyExistsException +// The resource you are trying to create already exists. +// +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InvalidStateException +// The specified state is not a valid state for an event source. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * LimitExceededException +// The request failed because it attempted to create resource beyond the allowed +// service quota. +// +// * OperationDisabledException +// The operation you are attempting is not available in this region. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/CreateEventBus +func (c *EventBridge) CreateEventBus(input *CreateEventBusInput) (*CreateEventBusOutput, error) { + req, out := c.CreateEventBusRequest(input) + return out, req.Send() +} + +// CreateEventBusWithContext is the same as CreateEventBus with the addition of +// the ability to pass a context and additional request options. +// +// See CreateEventBus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) CreateEventBusWithContext(ctx aws.Context, input *CreateEventBusInput, opts ...request.Option) (*CreateEventBusOutput, error) { + req, out := c.CreateEventBusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreatePartnerEventSource = "CreatePartnerEventSource" + +// CreatePartnerEventSourceRequest generates a "aws/request.Request" representing the +// client's request for the CreatePartnerEventSource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreatePartnerEventSource for more information on using the CreatePartnerEventSource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreatePartnerEventSourceRequest method. +// req, resp := client.CreatePartnerEventSourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/CreatePartnerEventSource +func (c *EventBridge) CreatePartnerEventSourceRequest(input *CreatePartnerEventSourceInput) (req *request.Request, output *CreatePartnerEventSourceOutput) { + op := &request.Operation{ + Name: opCreatePartnerEventSource, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreatePartnerEventSourceInput{} + } + + output = &CreatePartnerEventSourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreatePartnerEventSource API operation for Amazon EventBridge. +// +// Called by an SaaS partner to create a partner event source. This operation +// is not used by AWS customers. +// +// Each partner event source can be used by one AWS account to create a matching +// partner event bus in that AWS account. A SaaS partner must create one partner +// event source for each AWS account that wants to receive those event types. +// +// A partner event source creates events based on resources within the SaaS +// partner's service or application. +// +// An AWS account that creates a partner event bus that matches the partner +// event source can use that event bus to receive events from the partner, and +// then process them using AWS Events rules and targets. +// +// Partner event source names follow this format: +// +// partner_name/event_namespace/event_name +// +// partner_name is determined during partner registration and identifies the +// partner to AWS customers. event_namespace is determined by the partner and +// is a way for the partner to categorize their events. event_name is determined +// by the partner, and should uniquely identify an event-generating resource +// within the partner system. The combination of event_namespace and event_name +// should help AWS customers decide whether to create an event bus to receive +// these events. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation CreatePartnerEventSource for usage and error information. +// +// Returned Error Types: +// * ResourceAlreadyExistsException +// The resource you are trying to create already exists. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * LimitExceededException +// The request failed because it attempted to create resource beyond the allowed +// service quota. +// +// * OperationDisabledException +// The operation you are attempting is not available in this region. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/CreatePartnerEventSource +func (c *EventBridge) CreatePartnerEventSource(input *CreatePartnerEventSourceInput) (*CreatePartnerEventSourceOutput, error) { + req, out := c.CreatePartnerEventSourceRequest(input) + return out, req.Send() +} + +// CreatePartnerEventSourceWithContext is the same as CreatePartnerEventSource with the addition of +// the ability to pass a context and additional request options. +// +// See CreatePartnerEventSource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) CreatePartnerEventSourceWithContext(ctx aws.Context, input *CreatePartnerEventSourceInput, opts ...request.Option) (*CreatePartnerEventSourceOutput, error) { + req, out := c.CreatePartnerEventSourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeactivateEventSource = "DeactivateEventSource" + +// DeactivateEventSourceRequest generates a "aws/request.Request" representing the +// client's request for the DeactivateEventSource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeactivateEventSource for more information on using the DeactivateEventSource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeactivateEventSourceRequest method. +// req, resp := client.DeactivateEventSourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DeactivateEventSource +func (c *EventBridge) DeactivateEventSourceRequest(input *DeactivateEventSourceInput) (req *request.Request, output *DeactivateEventSourceOutput) { + op := &request.Operation{ + Name: opDeactivateEventSource, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeactivateEventSourceInput{} + } + + output = &DeactivateEventSourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeactivateEventSource API operation for Amazon EventBridge. +// +// You can use this operation to temporarily stop receiving events from the +// specified partner event source. The matching event bus is not deleted. +// +// When you deactivate a partner event source, the source goes into PENDING +// state. If it remains in PENDING state for more than two weeks, it is deleted. +// +// To activate a deactivated partner event source, use ActivateEventSource. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DeactivateEventSource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * InvalidStateException +// The specified state is not a valid state for an event source. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * OperationDisabledException +// The operation you are attempting is not available in this region. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DeactivateEventSource +func (c *EventBridge) DeactivateEventSource(input *DeactivateEventSourceInput) (*DeactivateEventSourceOutput, error) { + req, out := c.DeactivateEventSourceRequest(input) + return out, req.Send() +} + +// DeactivateEventSourceWithContext is the same as DeactivateEventSource with the addition of +// the ability to pass a context and additional request options. +// +// See DeactivateEventSource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DeactivateEventSourceWithContext(ctx aws.Context, input *DeactivateEventSourceInput, opts ...request.Option) (*DeactivateEventSourceOutput, error) { + req, out := c.DeactivateEventSourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeauthorizeConnection = "DeauthorizeConnection" + +// DeauthorizeConnectionRequest generates a "aws/request.Request" representing the +// client's request for the DeauthorizeConnection operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeauthorizeConnection for more information on using the DeauthorizeConnection +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeauthorizeConnectionRequest method. +// req, resp := client.DeauthorizeConnectionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DeauthorizeConnection +func (c *EventBridge) DeauthorizeConnectionRequest(input *DeauthorizeConnectionInput) (req *request.Request, output *DeauthorizeConnectionOutput) { + op := &request.Operation{ + Name: opDeauthorizeConnection, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeauthorizeConnectionInput{} + } + + output = &DeauthorizeConnectionOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeauthorizeConnection API operation for Amazon EventBridge. +// +// Removes all authorization parameters from the connection. This lets you remove +// the secret from the connection so you can reuse it without having to create +// a new connection. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DeauthorizeConnection for usage and error information. +// +// Returned Error Types: +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DeauthorizeConnection +func (c *EventBridge) DeauthorizeConnection(input *DeauthorizeConnectionInput) (*DeauthorizeConnectionOutput, error) { + req, out := c.DeauthorizeConnectionRequest(input) + return out, req.Send() +} + +// DeauthorizeConnectionWithContext is the same as DeauthorizeConnection with the addition of +// the ability to pass a context and additional request options. +// +// See DeauthorizeConnection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DeauthorizeConnectionWithContext(ctx aws.Context, input *DeauthorizeConnectionInput, opts ...request.Option) (*DeauthorizeConnectionOutput, error) { + req, out := c.DeauthorizeConnectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteApiDestination = "DeleteApiDestination" + +// DeleteApiDestinationRequest generates a "aws/request.Request" representing the +// client's request for the DeleteApiDestination operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteApiDestination for more information on using the DeleteApiDestination +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteApiDestinationRequest method. +// req, resp := client.DeleteApiDestinationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DeleteApiDestination +func (c *EventBridge) DeleteApiDestinationRequest(input *DeleteApiDestinationInput) (req *request.Request, output *DeleteApiDestinationOutput) { + op := &request.Operation{ + Name: opDeleteApiDestination, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteApiDestinationInput{} + } + + output = &DeleteApiDestinationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteApiDestination API operation for Amazon EventBridge. +// +// Deletes the specified API destination. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DeleteApiDestination for usage and error information. +// +// Returned Error Types: +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DeleteApiDestination +func (c *EventBridge) DeleteApiDestination(input *DeleteApiDestinationInput) (*DeleteApiDestinationOutput, error) { + req, out := c.DeleteApiDestinationRequest(input) + return out, req.Send() +} + +// DeleteApiDestinationWithContext is the same as DeleteApiDestination with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteApiDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DeleteApiDestinationWithContext(ctx aws.Context, input *DeleteApiDestinationInput, opts ...request.Option) (*DeleteApiDestinationOutput, error) { + req, out := c.DeleteApiDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteArchive = "DeleteArchive" + +// DeleteArchiveRequest generates a "aws/request.Request" representing the +// client's request for the DeleteArchive operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteArchive for more information on using the DeleteArchive +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteArchiveRequest method. +// req, resp := client.DeleteArchiveRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DeleteArchive +func (c *EventBridge) DeleteArchiveRequest(input *DeleteArchiveInput) (req *request.Request, output *DeleteArchiveOutput) { + op := &request.Operation{ + Name: opDeleteArchive, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteArchiveInput{} + } + + output = &DeleteArchiveOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteArchive API operation for Amazon EventBridge. +// +// Deletes the specified archive. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DeleteArchive for usage and error information. +// +// Returned Error Types: +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DeleteArchive +func (c *EventBridge) DeleteArchive(input *DeleteArchiveInput) (*DeleteArchiveOutput, error) { + req, out := c.DeleteArchiveRequest(input) + return out, req.Send() +} + +// DeleteArchiveWithContext is the same as DeleteArchive with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteArchive for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DeleteArchiveWithContext(ctx aws.Context, input *DeleteArchiveInput, opts ...request.Option) (*DeleteArchiveOutput, error) { + req, out := c.DeleteArchiveRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteConnection = "DeleteConnection" + +// DeleteConnectionRequest generates a "aws/request.Request" representing the +// client's request for the DeleteConnection operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteConnection for more information on using the DeleteConnection +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteConnectionRequest method. +// req, resp := client.DeleteConnectionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DeleteConnection +func (c *EventBridge) DeleteConnectionRequest(input *DeleteConnectionInput) (req *request.Request, output *DeleteConnectionOutput) { + op := &request.Operation{ + Name: opDeleteConnection, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteConnectionInput{} + } + + output = &DeleteConnectionOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteConnection API operation for Amazon EventBridge. +// +// Deletes a connection. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DeleteConnection for usage and error information. +// +// Returned Error Types: +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DeleteConnection +func (c *EventBridge) DeleteConnection(input *DeleteConnectionInput) (*DeleteConnectionOutput, error) { + req, out := c.DeleteConnectionRequest(input) + return out, req.Send() +} + +// DeleteConnectionWithContext is the same as DeleteConnection with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteConnection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DeleteConnectionWithContext(ctx aws.Context, input *DeleteConnectionInput, opts ...request.Option) (*DeleteConnectionOutput, error) { + req, out := c.DeleteConnectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteEventBus = "DeleteEventBus" + +// DeleteEventBusRequest generates a "aws/request.Request" representing the +// client's request for the DeleteEventBus operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteEventBus for more information on using the DeleteEventBus +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteEventBusRequest method. +// req, resp := client.DeleteEventBusRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DeleteEventBus +func (c *EventBridge) DeleteEventBusRequest(input *DeleteEventBusInput) (req *request.Request, output *DeleteEventBusOutput) { + op := &request.Operation{ + Name: opDeleteEventBus, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteEventBusInput{} + } + + output = &DeleteEventBusOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteEventBus API operation for Amazon EventBridge. +// +// Deletes the specified custom event bus or partner event bus. All rules associated +// with this event bus need to be deleted. You can't delete your account's default +// event bus. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DeleteEventBus for usage and error information. +// +// Returned Error Types: +// * InternalException +// This exception occurs due to unexpected causes. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DeleteEventBus +func (c *EventBridge) DeleteEventBus(input *DeleteEventBusInput) (*DeleteEventBusOutput, error) { + req, out := c.DeleteEventBusRequest(input) + return out, req.Send() +} + +// DeleteEventBusWithContext is the same as DeleteEventBus with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteEventBus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DeleteEventBusWithContext(ctx aws.Context, input *DeleteEventBusInput, opts ...request.Option) (*DeleteEventBusOutput, error) { + req, out := c.DeleteEventBusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeletePartnerEventSource = "DeletePartnerEventSource" + +// DeletePartnerEventSourceRequest generates a "aws/request.Request" representing the +// client's request for the DeletePartnerEventSource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeletePartnerEventSource for more information on using the DeletePartnerEventSource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeletePartnerEventSourceRequest method. +// req, resp := client.DeletePartnerEventSourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DeletePartnerEventSource +func (c *EventBridge) DeletePartnerEventSourceRequest(input *DeletePartnerEventSourceInput) (req *request.Request, output *DeletePartnerEventSourceOutput) { + op := &request.Operation{ + Name: opDeletePartnerEventSource, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeletePartnerEventSourceInput{} + } + + output = &DeletePartnerEventSourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeletePartnerEventSource API operation for Amazon EventBridge. +// +// This operation is used by SaaS partners to delete a partner event source. +// This operation is not used by AWS customers. +// +// When you delete an event source, the status of the corresponding partner +// event bus in the AWS customer account becomes DELETED. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DeletePartnerEventSource for usage and error information. +// +// Returned Error Types: +// * InternalException +// This exception occurs due to unexpected causes. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * OperationDisabledException +// The operation you are attempting is not available in this region. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DeletePartnerEventSource +func (c *EventBridge) DeletePartnerEventSource(input *DeletePartnerEventSourceInput) (*DeletePartnerEventSourceOutput, error) { + req, out := c.DeletePartnerEventSourceRequest(input) + return out, req.Send() +} + +// DeletePartnerEventSourceWithContext is the same as DeletePartnerEventSource with the addition of +// the ability to pass a context and additional request options. +// +// See DeletePartnerEventSource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DeletePartnerEventSourceWithContext(ctx aws.Context, input *DeletePartnerEventSourceInput, opts ...request.Option) (*DeletePartnerEventSourceOutput, error) { + req, out := c.DeletePartnerEventSourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteRule = "DeleteRule" + +// DeleteRuleRequest generates a "aws/request.Request" representing the +// client's request for the DeleteRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteRule for more information on using the DeleteRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteRuleRequest method. +// req, resp := client.DeleteRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DeleteRule +func (c *EventBridge) DeleteRuleRequest(input *DeleteRuleInput) (req *request.Request, output *DeleteRuleOutput) { + op := &request.Operation{ + Name: opDeleteRule, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteRuleInput{} + } + + output = &DeleteRuleOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteRule API operation for Amazon EventBridge. +// +// Deletes the specified rule. +// +// Before you can delete the rule, you must remove all targets, using RemoveTargets. +// +// When you delete a rule, incoming events might continue to match to the deleted +// rule. Allow a short period of time for changes to take effect. +// +// Managed rules are rules created and managed by another AWS service on your +// behalf. These rules are created by those other AWS services to support functionality +// in those services. You can delete these rules using the Force option, but +// you should do so only if you are sure the other service is not still using +// that rule. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DeleteRule for usage and error information. +// +// Returned Error Types: +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * ManagedRuleException +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DeleteRule +func (c *EventBridge) DeleteRule(input *DeleteRuleInput) (*DeleteRuleOutput, error) { + req, out := c.DeleteRuleRequest(input) + return out, req.Send() +} + +// DeleteRuleWithContext is the same as DeleteRule with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DeleteRuleWithContext(ctx aws.Context, input *DeleteRuleInput, opts ...request.Option) (*DeleteRuleOutput, error) { + req, out := c.DeleteRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeApiDestination = "DescribeApiDestination" + +// DescribeApiDestinationRequest generates a "aws/request.Request" representing the +// client's request for the DescribeApiDestination operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeApiDestination for more information on using the DescribeApiDestination +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeApiDestinationRequest method. +// req, resp := client.DescribeApiDestinationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DescribeApiDestination +func (c *EventBridge) DescribeApiDestinationRequest(input *DescribeApiDestinationInput) (req *request.Request, output *DescribeApiDestinationOutput) { + op := &request.Operation{ + Name: opDescribeApiDestination, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeApiDestinationInput{} + } + + output = &DescribeApiDestinationOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeApiDestination API operation for Amazon EventBridge. +// +// Retrieves details about an API destination. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DescribeApiDestination for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DescribeApiDestination +func (c *EventBridge) DescribeApiDestination(input *DescribeApiDestinationInput) (*DescribeApiDestinationOutput, error) { + req, out := c.DescribeApiDestinationRequest(input) + return out, req.Send() +} + +// DescribeApiDestinationWithContext is the same as DescribeApiDestination with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeApiDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DescribeApiDestinationWithContext(ctx aws.Context, input *DescribeApiDestinationInput, opts ...request.Option) (*DescribeApiDestinationOutput, error) { + req, out := c.DescribeApiDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeArchive = "DescribeArchive" + +// DescribeArchiveRequest generates a "aws/request.Request" representing the +// client's request for the DescribeArchive operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeArchive for more information on using the DescribeArchive +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeArchiveRequest method. +// req, resp := client.DescribeArchiveRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DescribeArchive +func (c *EventBridge) DescribeArchiveRequest(input *DescribeArchiveInput) (req *request.Request, output *DescribeArchiveOutput) { + op := &request.Operation{ + Name: opDescribeArchive, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeArchiveInput{} + } + + output = &DescribeArchiveOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeArchive API operation for Amazon EventBridge. +// +// Retrieves details about an archive. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DescribeArchive for usage and error information. +// +// Returned Error Types: +// * ResourceAlreadyExistsException +// The resource you are trying to create already exists. +// +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DescribeArchive +func (c *EventBridge) DescribeArchive(input *DescribeArchiveInput) (*DescribeArchiveOutput, error) { + req, out := c.DescribeArchiveRequest(input) + return out, req.Send() +} + +// DescribeArchiveWithContext is the same as DescribeArchive with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeArchive for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DescribeArchiveWithContext(ctx aws.Context, input *DescribeArchiveInput, opts ...request.Option) (*DescribeArchiveOutput, error) { + req, out := c.DescribeArchiveRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeConnection = "DescribeConnection" + +// DescribeConnectionRequest generates a "aws/request.Request" representing the +// client's request for the DescribeConnection operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeConnection for more information on using the DescribeConnection +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeConnectionRequest method. +// req, resp := client.DescribeConnectionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DescribeConnection +func (c *EventBridge) DescribeConnectionRequest(input *DescribeConnectionInput) (req *request.Request, output *DescribeConnectionOutput) { + op := &request.Operation{ + Name: opDescribeConnection, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeConnectionInput{} + } + + output = &DescribeConnectionOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeConnection API operation for Amazon EventBridge. +// +// Retrieves details about a connection. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DescribeConnection for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DescribeConnection +func (c *EventBridge) DescribeConnection(input *DescribeConnectionInput) (*DescribeConnectionOutput, error) { + req, out := c.DescribeConnectionRequest(input) + return out, req.Send() +} + +// DescribeConnectionWithContext is the same as DescribeConnection with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeConnection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DescribeConnectionWithContext(ctx aws.Context, input *DescribeConnectionInput, opts ...request.Option) (*DescribeConnectionOutput, error) { + req, out := c.DescribeConnectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeEventBus = "DescribeEventBus" + +// DescribeEventBusRequest generates a "aws/request.Request" representing the +// client's request for the DescribeEventBus operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeEventBus for more information on using the DescribeEventBus +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeEventBusRequest method. +// req, resp := client.DescribeEventBusRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DescribeEventBus +func (c *EventBridge) DescribeEventBusRequest(input *DescribeEventBusInput) (req *request.Request, output *DescribeEventBusOutput) { + op := &request.Operation{ + Name: opDescribeEventBus, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeEventBusInput{} + } + + output = &DescribeEventBusOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeEventBus API operation for Amazon EventBridge. +// +// Displays details about an event bus in your account. This can include the +// external AWS accounts that are permitted to write events to your default +// event bus, and the associated policy. For custom event buses and partner +// event buses, it displays the name, ARN, policy, state, and creation time. +// +// To enable your account to receive events from other accounts on its default +// event bus, use PutPermission. +// +// For more information about partner event buses, see CreateEventBus. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DescribeEventBus for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DescribeEventBus +func (c *EventBridge) DescribeEventBus(input *DescribeEventBusInput) (*DescribeEventBusOutput, error) { + req, out := c.DescribeEventBusRequest(input) + return out, req.Send() +} + +// DescribeEventBusWithContext is the same as DescribeEventBus with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEventBus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DescribeEventBusWithContext(ctx aws.Context, input *DescribeEventBusInput, opts ...request.Option) (*DescribeEventBusOutput, error) { + req, out := c.DescribeEventBusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeEventSource = "DescribeEventSource" + +// DescribeEventSourceRequest generates a "aws/request.Request" representing the +// client's request for the DescribeEventSource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeEventSource for more information on using the DescribeEventSource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeEventSourceRequest method. +// req, resp := client.DescribeEventSourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DescribeEventSource +func (c *EventBridge) DescribeEventSourceRequest(input *DescribeEventSourceInput) (req *request.Request, output *DescribeEventSourceOutput) { + op := &request.Operation{ + Name: opDescribeEventSource, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeEventSourceInput{} + } + + output = &DescribeEventSourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeEventSource API operation for Amazon EventBridge. +// +// This operation lists details about a partner event source that is shared +// with your account. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DescribeEventSource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * OperationDisabledException +// The operation you are attempting is not available in this region. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DescribeEventSource +func (c *EventBridge) DescribeEventSource(input *DescribeEventSourceInput) (*DescribeEventSourceOutput, error) { + req, out := c.DescribeEventSourceRequest(input) + return out, req.Send() +} + +// DescribeEventSourceWithContext is the same as DescribeEventSource with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEventSource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DescribeEventSourceWithContext(ctx aws.Context, input *DescribeEventSourceInput, opts ...request.Option) (*DescribeEventSourceOutput, error) { + req, out := c.DescribeEventSourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribePartnerEventSource = "DescribePartnerEventSource" + +// DescribePartnerEventSourceRequest generates a "aws/request.Request" representing the +// client's request for the DescribePartnerEventSource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribePartnerEventSource for more information on using the DescribePartnerEventSource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribePartnerEventSourceRequest method. +// req, resp := client.DescribePartnerEventSourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DescribePartnerEventSource +func (c *EventBridge) DescribePartnerEventSourceRequest(input *DescribePartnerEventSourceInput) (req *request.Request, output *DescribePartnerEventSourceOutput) { + op := &request.Operation{ + Name: opDescribePartnerEventSource, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribePartnerEventSourceInput{} + } + + output = &DescribePartnerEventSourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribePartnerEventSource API operation for Amazon EventBridge. +// +// An SaaS partner can use this operation to list details about a partner event +// source that they have created. AWS customers do not use this operation. Instead, +// AWS customers can use DescribeEventSource to see details about a partner +// event source that is shared with them. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DescribePartnerEventSource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * OperationDisabledException +// The operation you are attempting is not available in this region. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DescribePartnerEventSource +func (c *EventBridge) DescribePartnerEventSource(input *DescribePartnerEventSourceInput) (*DescribePartnerEventSourceOutput, error) { + req, out := c.DescribePartnerEventSourceRequest(input) + return out, req.Send() +} + +// DescribePartnerEventSourceWithContext is the same as DescribePartnerEventSource with the addition of +// the ability to pass a context and additional request options. +// +// See DescribePartnerEventSource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DescribePartnerEventSourceWithContext(ctx aws.Context, input *DescribePartnerEventSourceInput, opts ...request.Option) (*DescribePartnerEventSourceOutput, error) { + req, out := c.DescribePartnerEventSourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeReplay = "DescribeReplay" + +// DescribeReplayRequest generates a "aws/request.Request" representing the +// client's request for the DescribeReplay operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeReplay for more information on using the DescribeReplay +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeReplayRequest method. +// req, resp := client.DescribeReplayRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DescribeReplay +func (c *EventBridge) DescribeReplayRequest(input *DescribeReplayInput) (req *request.Request, output *DescribeReplayOutput) { + op := &request.Operation{ + Name: opDescribeReplay, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeReplayInput{} + } + + output = &DescribeReplayOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeReplay API operation for Amazon EventBridge. +// +// Retrieves details about a replay. Use DescribeReplay to determine the progress +// of a running replay. A replay processes events to replay based on the time +// in the event, and replays them using 1 minute intervals. If you use StartReplay +// and specify an EventStartTime and an EventEndTime that covers a 20 minute +// time range, the events are replayed from the first minute of that 20 minute +// range first. Then the events from the second minute are replayed. You can +// use DescribeReplay to determine the progress of a replay. The value returned +// for EventLastReplayedTime indicates the time within the specified time range +// associated with the last event replayed. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DescribeReplay for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DescribeReplay +func (c *EventBridge) DescribeReplay(input *DescribeReplayInput) (*DescribeReplayOutput, error) { + req, out := c.DescribeReplayRequest(input) + return out, req.Send() +} + +// DescribeReplayWithContext is the same as DescribeReplay with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReplay for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DescribeReplayWithContext(ctx aws.Context, input *DescribeReplayInput, opts ...request.Option) (*DescribeReplayOutput, error) { + req, out := c.DescribeReplayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeRule = "DescribeRule" + +// DescribeRuleRequest generates a "aws/request.Request" representing the +// client's request for the DescribeRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeRule for more information on using the DescribeRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeRuleRequest method. +// req, resp := client.DescribeRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DescribeRule +func (c *EventBridge) DescribeRuleRequest(input *DescribeRuleInput) (req *request.Request, output *DescribeRuleOutput) { + op := &request.Operation{ + Name: opDescribeRule, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeRuleInput{} + } + + output = &DescribeRuleOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeRule API operation for Amazon EventBridge. +// +// Describes the specified rule. +// +// DescribeRule does not list the targets of a rule. To see the targets associated +// with a rule, use ListTargetsByRule. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DescribeRule for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DescribeRule +func (c *EventBridge) DescribeRule(input *DescribeRuleInput) (*DescribeRuleOutput, error) { + req, out := c.DescribeRuleRequest(input) + return out, req.Send() +} + +// DescribeRuleWithContext is the same as DescribeRule with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DescribeRuleWithContext(ctx aws.Context, input *DescribeRuleInput, opts ...request.Option) (*DescribeRuleOutput, error) { + req, out := c.DescribeRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDisableRule = "DisableRule" + +// DisableRuleRequest generates a "aws/request.Request" representing the +// client's request for the DisableRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DisableRule for more information on using the DisableRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DisableRuleRequest method. +// req, resp := client.DisableRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DisableRule +func (c *EventBridge) DisableRuleRequest(input *DisableRuleInput) (req *request.Request, output *DisableRuleOutput) { + op := &request.Operation{ + Name: opDisableRule, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DisableRuleInput{} + } + + output = &DisableRuleOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DisableRule API operation for Amazon EventBridge. +// +// Disables the specified rule. A disabled rule won't match any events, and +// won't self-trigger if it has a schedule expression. +// +// When you disable a rule, incoming events might continue to match to the disabled +// rule. Allow a short period of time for changes to take effect. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation DisableRule for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * ManagedRuleException +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/DisableRule +func (c *EventBridge) DisableRule(input *DisableRuleInput) (*DisableRuleOutput, error) { + req, out := c.DisableRuleRequest(input) + return out, req.Send() +} + +// DisableRuleWithContext is the same as DisableRule with the addition of +// the ability to pass a context and additional request options. +// +// See DisableRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) DisableRuleWithContext(ctx aws.Context, input *DisableRuleInput, opts ...request.Option) (*DisableRuleOutput, error) { + req, out := c.DisableRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opEnableRule = "EnableRule" + +// EnableRuleRequest generates a "aws/request.Request" representing the +// client's request for the EnableRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See EnableRule for more information on using the EnableRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the EnableRuleRequest method. +// req, resp := client.EnableRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/EnableRule +func (c *EventBridge) EnableRuleRequest(input *EnableRuleInput) (req *request.Request, output *EnableRuleOutput) { + op := &request.Operation{ + Name: opEnableRule, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &EnableRuleInput{} + } + + output = &EnableRuleOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// EnableRule API operation for Amazon EventBridge. +// +// Enables the specified rule. If the rule does not exist, the operation fails. +// +// When you enable a rule, incoming events might not immediately start matching +// to a newly enabled rule. Allow a short period of time for changes to take +// effect. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation EnableRule for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * ManagedRuleException +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/EnableRule +func (c *EventBridge) EnableRule(input *EnableRuleInput) (*EnableRuleOutput, error) { + req, out := c.EnableRuleRequest(input) + return out, req.Send() +} + +// EnableRuleWithContext is the same as EnableRule with the addition of +// the ability to pass a context and additional request options. +// +// See EnableRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) EnableRuleWithContext(ctx aws.Context, input *EnableRuleInput, opts ...request.Option) (*EnableRuleOutput, error) { + req, out := c.EnableRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListApiDestinations = "ListApiDestinations" + +// ListApiDestinationsRequest generates a "aws/request.Request" representing the +// client's request for the ListApiDestinations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListApiDestinations for more information on using the ListApiDestinations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListApiDestinationsRequest method. +// req, resp := client.ListApiDestinationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListApiDestinations +func (c *EventBridge) ListApiDestinationsRequest(input *ListApiDestinationsInput) (req *request.Request, output *ListApiDestinationsOutput) { + op := &request.Operation{ + Name: opListApiDestinations, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListApiDestinationsInput{} + } + + output = &ListApiDestinationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListApiDestinations API operation for Amazon EventBridge. +// +// Retrieves a list of API destination in the account in the current Region. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation ListApiDestinations for usage and error information. +// +// Returned Error Types: +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListApiDestinations +func (c *EventBridge) ListApiDestinations(input *ListApiDestinationsInput) (*ListApiDestinationsOutput, error) { + req, out := c.ListApiDestinationsRequest(input) + return out, req.Send() +} + +// ListApiDestinationsWithContext is the same as ListApiDestinations with the addition of +// the ability to pass a context and additional request options. +// +// See ListApiDestinations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) ListApiDestinationsWithContext(ctx aws.Context, input *ListApiDestinationsInput, opts ...request.Option) (*ListApiDestinationsOutput, error) { + req, out := c.ListApiDestinationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListArchives = "ListArchives" + +// ListArchivesRequest generates a "aws/request.Request" representing the +// client's request for the ListArchives operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListArchives for more information on using the ListArchives +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListArchivesRequest method. +// req, resp := client.ListArchivesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListArchives +func (c *EventBridge) ListArchivesRequest(input *ListArchivesInput) (req *request.Request, output *ListArchivesOutput) { + op := &request.Operation{ + Name: opListArchives, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListArchivesInput{} + } + + output = &ListArchivesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListArchives API operation for Amazon EventBridge. +// +// Lists your archives. You can either list all the archives or you can provide +// a prefix to match to the archive names. Filter parameters are exclusive. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation ListArchives for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListArchives +func (c *EventBridge) ListArchives(input *ListArchivesInput) (*ListArchivesOutput, error) { + req, out := c.ListArchivesRequest(input) + return out, req.Send() +} + +// ListArchivesWithContext is the same as ListArchives with the addition of +// the ability to pass a context and additional request options. +// +// See ListArchives for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) ListArchivesWithContext(ctx aws.Context, input *ListArchivesInput, opts ...request.Option) (*ListArchivesOutput, error) { + req, out := c.ListArchivesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListConnections = "ListConnections" + +// ListConnectionsRequest generates a "aws/request.Request" representing the +// client's request for the ListConnections operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListConnections for more information on using the ListConnections +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListConnectionsRequest method. +// req, resp := client.ListConnectionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListConnections +func (c *EventBridge) ListConnectionsRequest(input *ListConnectionsInput) (req *request.Request, output *ListConnectionsOutput) { + op := &request.Operation{ + Name: opListConnections, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListConnectionsInput{} + } + + output = &ListConnectionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListConnections API operation for Amazon EventBridge. +// +// Retrieves a list of connections from the account. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation ListConnections for usage and error information. +// +// Returned Error Types: +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListConnections +func (c *EventBridge) ListConnections(input *ListConnectionsInput) (*ListConnectionsOutput, error) { + req, out := c.ListConnectionsRequest(input) + return out, req.Send() +} + +// ListConnectionsWithContext is the same as ListConnections with the addition of +// the ability to pass a context and additional request options. +// +// See ListConnections for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) ListConnectionsWithContext(ctx aws.Context, input *ListConnectionsInput, opts ...request.Option) (*ListConnectionsOutput, error) { + req, out := c.ListConnectionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListEventBuses = "ListEventBuses" + +// ListEventBusesRequest generates a "aws/request.Request" representing the +// client's request for the ListEventBuses operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListEventBuses for more information on using the ListEventBuses +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListEventBusesRequest method. +// req, resp := client.ListEventBusesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListEventBuses +func (c *EventBridge) ListEventBusesRequest(input *ListEventBusesInput) (req *request.Request, output *ListEventBusesOutput) { + op := &request.Operation{ + Name: opListEventBuses, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListEventBusesInput{} + } + + output = &ListEventBusesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListEventBuses API operation for Amazon EventBridge. +// +// Lists all the event buses in your account, including the default event bus, +// custom event buses, and partner event buses. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation ListEventBuses for usage and error information. +// +// Returned Error Types: +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListEventBuses +func (c *EventBridge) ListEventBuses(input *ListEventBusesInput) (*ListEventBusesOutput, error) { + req, out := c.ListEventBusesRequest(input) + return out, req.Send() +} + +// ListEventBusesWithContext is the same as ListEventBuses with the addition of +// the ability to pass a context and additional request options. +// +// See ListEventBuses for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) ListEventBusesWithContext(ctx aws.Context, input *ListEventBusesInput, opts ...request.Option) (*ListEventBusesOutput, error) { + req, out := c.ListEventBusesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListEventSources = "ListEventSources" + +// ListEventSourcesRequest generates a "aws/request.Request" representing the +// client's request for the ListEventSources operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListEventSources for more information on using the ListEventSources +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListEventSourcesRequest method. +// req, resp := client.ListEventSourcesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListEventSources +func (c *EventBridge) ListEventSourcesRequest(input *ListEventSourcesInput) (req *request.Request, output *ListEventSourcesOutput) { + op := &request.Operation{ + Name: opListEventSources, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListEventSourcesInput{} + } + + output = &ListEventSourcesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListEventSources API operation for Amazon EventBridge. +// +// You can use this to see all the partner event sources that have been shared +// with your AWS account. For more information about partner event sources, +// see CreateEventBus. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation ListEventSources for usage and error information. +// +// Returned Error Types: +// * InternalException +// This exception occurs due to unexpected causes. +// +// * OperationDisabledException +// The operation you are attempting is not available in this region. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListEventSources +func (c *EventBridge) ListEventSources(input *ListEventSourcesInput) (*ListEventSourcesOutput, error) { + req, out := c.ListEventSourcesRequest(input) + return out, req.Send() +} + +// ListEventSourcesWithContext is the same as ListEventSources with the addition of +// the ability to pass a context and additional request options. +// +// See ListEventSources for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) ListEventSourcesWithContext(ctx aws.Context, input *ListEventSourcesInput, opts ...request.Option) (*ListEventSourcesOutput, error) { + req, out := c.ListEventSourcesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListPartnerEventSourceAccounts = "ListPartnerEventSourceAccounts" + +// ListPartnerEventSourceAccountsRequest generates a "aws/request.Request" representing the +// client's request for the ListPartnerEventSourceAccounts operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListPartnerEventSourceAccounts for more information on using the ListPartnerEventSourceAccounts +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListPartnerEventSourceAccountsRequest method. +// req, resp := client.ListPartnerEventSourceAccountsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListPartnerEventSourceAccounts +func (c *EventBridge) ListPartnerEventSourceAccountsRequest(input *ListPartnerEventSourceAccountsInput) (req *request.Request, output *ListPartnerEventSourceAccountsOutput) { + op := &request.Operation{ + Name: opListPartnerEventSourceAccounts, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListPartnerEventSourceAccountsInput{} + } + + output = &ListPartnerEventSourceAccountsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListPartnerEventSourceAccounts API operation for Amazon EventBridge. +// +// An SaaS partner can use this operation to display the AWS account ID that +// a particular partner event source name is associated with. This operation +// is not used by AWS customers. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation ListPartnerEventSourceAccounts for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * OperationDisabledException +// The operation you are attempting is not available in this region. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListPartnerEventSourceAccounts +func (c *EventBridge) ListPartnerEventSourceAccounts(input *ListPartnerEventSourceAccountsInput) (*ListPartnerEventSourceAccountsOutput, error) { + req, out := c.ListPartnerEventSourceAccountsRequest(input) + return out, req.Send() +} + +// ListPartnerEventSourceAccountsWithContext is the same as ListPartnerEventSourceAccounts with the addition of +// the ability to pass a context and additional request options. +// +// See ListPartnerEventSourceAccounts for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) ListPartnerEventSourceAccountsWithContext(ctx aws.Context, input *ListPartnerEventSourceAccountsInput, opts ...request.Option) (*ListPartnerEventSourceAccountsOutput, error) { + req, out := c.ListPartnerEventSourceAccountsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListPartnerEventSources = "ListPartnerEventSources" + +// ListPartnerEventSourcesRequest generates a "aws/request.Request" representing the +// client's request for the ListPartnerEventSources operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListPartnerEventSources for more information on using the ListPartnerEventSources +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListPartnerEventSourcesRequest method. +// req, resp := client.ListPartnerEventSourcesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListPartnerEventSources +func (c *EventBridge) ListPartnerEventSourcesRequest(input *ListPartnerEventSourcesInput) (req *request.Request, output *ListPartnerEventSourcesOutput) { + op := &request.Operation{ + Name: opListPartnerEventSources, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListPartnerEventSourcesInput{} + } + + output = &ListPartnerEventSourcesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListPartnerEventSources API operation for Amazon EventBridge. +// +// An SaaS partner can use this operation to list all the partner event source +// names that they have created. This operation is not used by AWS customers. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation ListPartnerEventSources for usage and error information. +// +// Returned Error Types: +// * InternalException +// This exception occurs due to unexpected causes. +// +// * OperationDisabledException +// The operation you are attempting is not available in this region. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListPartnerEventSources +func (c *EventBridge) ListPartnerEventSources(input *ListPartnerEventSourcesInput) (*ListPartnerEventSourcesOutput, error) { + req, out := c.ListPartnerEventSourcesRequest(input) + return out, req.Send() +} + +// ListPartnerEventSourcesWithContext is the same as ListPartnerEventSources with the addition of +// the ability to pass a context and additional request options. +// +// See ListPartnerEventSources for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) ListPartnerEventSourcesWithContext(ctx aws.Context, input *ListPartnerEventSourcesInput, opts ...request.Option) (*ListPartnerEventSourcesOutput, error) { + req, out := c.ListPartnerEventSourcesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListReplays = "ListReplays" + +// ListReplaysRequest generates a "aws/request.Request" representing the +// client's request for the ListReplays operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListReplays for more information on using the ListReplays +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListReplaysRequest method. +// req, resp := client.ListReplaysRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListReplays +func (c *EventBridge) ListReplaysRequest(input *ListReplaysInput) (req *request.Request, output *ListReplaysOutput) { + op := &request.Operation{ + Name: opListReplays, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListReplaysInput{} + } + + output = &ListReplaysOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListReplays API operation for Amazon EventBridge. +// +// Lists your replays. You can either list all the replays or you can provide +// a prefix to match to the replay names. Filter parameters are exclusive. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation ListReplays for usage and error information. +// +// Returned Error Types: +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListReplays +func (c *EventBridge) ListReplays(input *ListReplaysInput) (*ListReplaysOutput, error) { + req, out := c.ListReplaysRequest(input) + return out, req.Send() +} + +// ListReplaysWithContext is the same as ListReplays with the addition of +// the ability to pass a context and additional request options. +// +// See ListReplays for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) ListReplaysWithContext(ctx aws.Context, input *ListReplaysInput, opts ...request.Option) (*ListReplaysOutput, error) { + req, out := c.ListReplaysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListRuleNamesByTarget = "ListRuleNamesByTarget" + +// ListRuleNamesByTargetRequest generates a "aws/request.Request" representing the +// client's request for the ListRuleNamesByTarget operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListRuleNamesByTarget for more information on using the ListRuleNamesByTarget +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListRuleNamesByTargetRequest method. +// req, resp := client.ListRuleNamesByTargetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListRuleNamesByTarget +func (c *EventBridge) ListRuleNamesByTargetRequest(input *ListRuleNamesByTargetInput) (req *request.Request, output *ListRuleNamesByTargetOutput) { + op := &request.Operation{ + Name: opListRuleNamesByTarget, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListRuleNamesByTargetInput{} + } + + output = &ListRuleNamesByTargetOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListRuleNamesByTarget API operation for Amazon EventBridge. +// +// Lists the rules for the specified target. You can see which of the rules +// in Amazon EventBridge can invoke a specific target in your account. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation ListRuleNamesByTarget for usage and error information. +// +// Returned Error Types: +// * InternalException +// This exception occurs due to unexpected causes. +// +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListRuleNamesByTarget +func (c *EventBridge) ListRuleNamesByTarget(input *ListRuleNamesByTargetInput) (*ListRuleNamesByTargetOutput, error) { + req, out := c.ListRuleNamesByTargetRequest(input) + return out, req.Send() +} + +// ListRuleNamesByTargetWithContext is the same as ListRuleNamesByTarget with the addition of +// the ability to pass a context and additional request options. +// +// See ListRuleNamesByTarget for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) ListRuleNamesByTargetWithContext(ctx aws.Context, input *ListRuleNamesByTargetInput, opts ...request.Option) (*ListRuleNamesByTargetOutput, error) { + req, out := c.ListRuleNamesByTargetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListRules = "ListRules" + +// ListRulesRequest generates a "aws/request.Request" representing the +// client's request for the ListRules operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListRules for more information on using the ListRules +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListRulesRequest method. +// req, resp := client.ListRulesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListRules +func (c *EventBridge) ListRulesRequest(input *ListRulesInput) (req *request.Request, output *ListRulesOutput) { + op := &request.Operation{ + Name: opListRules, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListRulesInput{} + } + + output = &ListRulesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListRules API operation for Amazon EventBridge. +// +// Lists your Amazon EventBridge rules. You can either list all the rules or +// you can provide a prefix to match to the rule names. +// +// ListRules does not list the targets of a rule. To see the targets associated +// with a rule, use ListTargetsByRule. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation ListRules for usage and error information. +// +// Returned Error Types: +// * InternalException +// This exception occurs due to unexpected causes. +// +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListRules +func (c *EventBridge) ListRules(input *ListRulesInput) (*ListRulesOutput, error) { + req, out := c.ListRulesRequest(input) + return out, req.Send() +} + +// ListRulesWithContext is the same as ListRules with the addition of +// the ability to pass a context and additional request options. +// +// See ListRules for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) ListRulesWithContext(ctx aws.Context, input *ListRulesInput, opts ...request.Option) (*ListRulesOutput, error) { + req, out := c.ListRulesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListTagsForResource +func (c *EventBridge) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { + op := &request.Operation{ + Name: opListTagsForResource, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListTagsForResourceInput{} + } + + output = &ListTagsForResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTagsForResource API operation for Amazon EventBridge. +// +// Displays the tags associated with an EventBridge resource. In EventBridge, +// rules and event buses can be tagged. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListTagsForResource +func (c *EventBridge) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListTargetsByRule = "ListTargetsByRule" + +// ListTargetsByRuleRequest generates a "aws/request.Request" representing the +// client's request for the ListTargetsByRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTargetsByRule for more information on using the ListTargetsByRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTargetsByRuleRequest method. +// req, resp := client.ListTargetsByRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListTargetsByRule +func (c *EventBridge) ListTargetsByRuleRequest(input *ListTargetsByRuleInput) (req *request.Request, output *ListTargetsByRuleOutput) { + op := &request.Operation{ + Name: opListTargetsByRule, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListTargetsByRuleInput{} + } + + output = &ListTargetsByRuleOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTargetsByRule API operation for Amazon EventBridge. +// +// Lists the targets assigned to the specified rule. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation ListTargetsByRule for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/ListTargetsByRule +func (c *EventBridge) ListTargetsByRule(input *ListTargetsByRuleInput) (*ListTargetsByRuleOutput, error) { + req, out := c.ListTargetsByRuleRequest(input) + return out, req.Send() +} + +// ListTargetsByRuleWithContext is the same as ListTargetsByRule with the addition of +// the ability to pass a context and additional request options. +// +// See ListTargetsByRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) ListTargetsByRuleWithContext(ctx aws.Context, input *ListTargetsByRuleInput, opts ...request.Option) (*ListTargetsByRuleOutput, error) { + req, out := c.ListTargetsByRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutEvents = "PutEvents" + +// PutEventsRequest generates a "aws/request.Request" representing the +// client's request for the PutEvents operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutEvents for more information on using the PutEvents +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutEventsRequest method. +// req, resp := client.PutEventsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/PutEvents +func (c *EventBridge) PutEventsRequest(input *PutEventsInput) (req *request.Request, output *PutEventsOutput) { + op := &request.Operation{ + Name: opPutEvents, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutEventsInput{} + } + + output = &PutEventsOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutEvents API operation for Amazon EventBridge. +// +// Sends custom events to Amazon EventBridge so that they can be matched to +// rules. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation PutEvents for usage and error information. +// +// Returned Error Types: +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/PutEvents +func (c *EventBridge) PutEvents(input *PutEventsInput) (*PutEventsOutput, error) { + req, out := c.PutEventsRequest(input) + return out, req.Send() +} + +// PutEventsWithContext is the same as PutEvents with the addition of +// the ability to pass a context and additional request options. +// +// See PutEvents for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) PutEventsWithContext(ctx aws.Context, input *PutEventsInput, opts ...request.Option) (*PutEventsOutput, error) { + req, out := c.PutEventsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutPartnerEvents = "PutPartnerEvents" + +// PutPartnerEventsRequest generates a "aws/request.Request" representing the +// client's request for the PutPartnerEvents operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutPartnerEvents for more information on using the PutPartnerEvents +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutPartnerEventsRequest method. +// req, resp := client.PutPartnerEventsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/PutPartnerEvents +func (c *EventBridge) PutPartnerEventsRequest(input *PutPartnerEventsInput) (req *request.Request, output *PutPartnerEventsOutput) { + op := &request.Operation{ + Name: opPutPartnerEvents, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutPartnerEventsInput{} + } + + output = &PutPartnerEventsOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutPartnerEvents API operation for Amazon EventBridge. +// +// This is used by SaaS partners to write events to a customer's partner event +// bus. AWS customers do not use this operation. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation PutPartnerEvents for usage and error information. +// +// Returned Error Types: +// * InternalException +// This exception occurs due to unexpected causes. +// +// * OperationDisabledException +// The operation you are attempting is not available in this region. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/PutPartnerEvents +func (c *EventBridge) PutPartnerEvents(input *PutPartnerEventsInput) (*PutPartnerEventsOutput, error) { + req, out := c.PutPartnerEventsRequest(input) + return out, req.Send() +} + +// PutPartnerEventsWithContext is the same as PutPartnerEvents with the addition of +// the ability to pass a context and additional request options. +// +// See PutPartnerEvents for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) PutPartnerEventsWithContext(ctx aws.Context, input *PutPartnerEventsInput, opts ...request.Option) (*PutPartnerEventsOutput, error) { + req, out := c.PutPartnerEventsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutPermission = "PutPermission" + +// PutPermissionRequest generates a "aws/request.Request" representing the +// client's request for the PutPermission operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutPermission for more information on using the PutPermission +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutPermissionRequest method. +// req, resp := client.PutPermissionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/PutPermission +func (c *EventBridge) PutPermissionRequest(input *PutPermissionInput) (req *request.Request, output *PutPermissionOutput) { + op := &request.Operation{ + Name: opPutPermission, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutPermissionInput{} + } + + output = &PutPermissionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutPermission API operation for Amazon EventBridge. +// +// Running PutPermission permits the specified AWS account or AWS organization +// to put events to the specified event bus. Amazon EventBridge (CloudWatch +// Events) rules in your account are triggered by these events arriving to an +// event bus in your account. +// +// For another account to send events to your account, that external account +// must have an EventBridge rule with your account's event bus as a target. +// +// To enable multiple AWS accounts to put events to your event bus, run PutPermission +// once for each of these accounts. Or, if all the accounts are members of the +// same AWS organization, you can run PutPermission once specifying Principal +// as "*" and specifying the AWS organization ID in Condition, to grant permissions +// to all accounts in that organization. +// +// If you grant permissions using an organization, then accounts in that organization +// must specify a RoleArn with proper permissions when they use PutTarget to +// add your account's event bus as a target. For more information, see Sending +// and Receiving Events Between AWS Accounts (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) +// in the Amazon EventBridge User Guide. +// +// The permission policy on the default event bus cannot exceed 10 KB in size. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation PutPermission for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * PolicyLengthExceededException +// The event bus policy is too long. For more information, see the limits. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * OperationDisabledException +// The operation you are attempting is not available in this region. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/PutPermission +func (c *EventBridge) PutPermission(input *PutPermissionInput) (*PutPermissionOutput, error) { + req, out := c.PutPermissionRequest(input) + return out, req.Send() +} + +// PutPermissionWithContext is the same as PutPermission with the addition of +// the ability to pass a context and additional request options. +// +// See PutPermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) PutPermissionWithContext(ctx aws.Context, input *PutPermissionInput, opts ...request.Option) (*PutPermissionOutput, error) { + req, out := c.PutPermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutRule = "PutRule" + +// PutRuleRequest generates a "aws/request.Request" representing the +// client's request for the PutRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutRule for more information on using the PutRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutRuleRequest method. +// req, resp := client.PutRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/PutRule +func (c *EventBridge) PutRuleRequest(input *PutRuleInput) (req *request.Request, output *PutRuleOutput) { + op := &request.Operation{ + Name: opPutRule, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutRuleInput{} + } + + output = &PutRuleOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutRule API operation for Amazon EventBridge. +// +// Creates or updates the specified rule. Rules are enabled by default, or based +// on value of the state. You can disable a rule using DisableRule. +// +// A single rule watches for events from a single event bus. Events generated +// by AWS services go to your account's default event bus. Events generated +// by SaaS partner services or applications go to the matching partner event +// bus. If you have custom applications or services, you can specify whether +// their events go to your default event bus or a custom event bus that you +// have created. For more information, see CreateEventBus. +// +// If you are updating an existing rule, the rule is replaced with what you +// specify in this PutRule command. If you omit arguments in PutRule, the old +// values for those arguments are not kept. Instead, they are replaced with +// null values. +// +// When you create or update a rule, incoming events might not immediately start +// matching to new or updated rules. Allow a short period of time for changes +// to take effect. +// +// A rule must contain at least an EventPattern or ScheduleExpression. Rules +// with EventPatterns are triggered when a matching event is observed. Rules +// with ScheduleExpressions self-trigger based on the given schedule. A rule +// can have both an EventPattern and a ScheduleExpression, in which case the +// rule triggers on matching events as well as on a schedule. +// +// When you initially create a rule, you can optionally assign one or more tags +// to the rule. Tags can help you organize and categorize your resources. You +// can also use them to scope user permissions, by granting a user permission +// to access or change only rules with certain tag values. To use the PutRule +// operation and assign tags, you must have both the events:PutRule and events:TagResource +// permissions. +// +// If you are updating an existing rule, any tags you specify in the PutRule +// operation are ignored. To update the tags of an existing rule, use TagResource +// and UntagResource. +// +// Most services in AWS treat : or / as the same character in Amazon Resource +// Names (ARNs). However, EventBridge uses an exact match in event patterns +// and rules. Be sure to use the correct ARN characters when creating event +// patterns so that they match the ARN syntax in the event you want to match. +// +// In EventBridge, it is possible to create rules that lead to infinite loops, +// where a rule is fired repeatedly. For example, a rule might detect that ACLs +// have changed on an S3 bucket, and trigger software to change them to the +// desired state. If the rule is not written carefully, the subsequent change +// to the ACLs fires the rule again, creating an infinite loop. +// +// To prevent this, write the rules so that the triggered actions do not re-fire +// the same rule. For example, your rule could fire only if ACLs are found to +// be in a bad state, instead of after any change. +// +// An infinite loop can quickly cause higher than expected charges. We recommend +// that you use budgeting, which alerts you when charges exceed your specified +// limit. For more information, see Managing Your Costs with Budgets (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/budgets-managing-costs.html). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation PutRule for usage and error information. +// +// Returned Error Types: +// * InvalidEventPatternException +// The event pattern is not valid. +// +// * LimitExceededException +// The request failed because it attempted to create resource beyond the allowed +// service quota. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * ManagedRuleException +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/PutRule +func (c *EventBridge) PutRule(input *PutRuleInput) (*PutRuleOutput, error) { + req, out := c.PutRuleRequest(input) + return out, req.Send() +} + +// PutRuleWithContext is the same as PutRule with the addition of +// the ability to pass a context and additional request options. +// +// See PutRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) PutRuleWithContext(ctx aws.Context, input *PutRuleInput, opts ...request.Option) (*PutRuleOutput, error) { + req, out := c.PutRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutTargets = "PutTargets" + +// PutTargetsRequest generates a "aws/request.Request" representing the +// client's request for the PutTargets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutTargets for more information on using the PutTargets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutTargetsRequest method. +// req, resp := client.PutTargetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/PutTargets +func (c *EventBridge) PutTargetsRequest(input *PutTargetsInput) (req *request.Request, output *PutTargetsOutput) { + op := &request.Operation{ + Name: opPutTargets, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutTargetsInput{} + } + + output = &PutTargetsOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutTargets API operation for Amazon EventBridge. +// +// Adds the specified targets to the specified rule, or updates the targets +// if they are already associated with the rule. +// +// Targets are the resources that are invoked when a rule is triggered. +// +// You can configure the following as targets for Events: +// +// * EC2 instances +// +// * SSM Run Command +// +// * SSM Automation +// +// * AWS Lambda functions +// +// * Data streams in Amazon Kinesis Data Streams +// +// * Data delivery streams in Amazon Kinesis Data Firehose +// +// * Amazon ECS tasks +// +// * AWS Step Functions state machines +// +// * AWS Batch jobs +// +// * AWS CodeBuild projects +// +// * Pipelines in AWS CodePipeline +// +// * Amazon Inspector assessment templates +// +// * Amazon SNS topics +// +// * Amazon SQS queues, including FIFO queues +// +// * The default event bus of another AWS account +// +// * Amazon API Gateway REST APIs +// +// * Redshift Clusters to invoke Data API ExecuteStatement on +// +// * Custom/SaaS HTTPS APIs via EventBridge API Destinations +// +// * Amazon SageMaker Model Building Pipelines +// +// Creating rules with built-in targets is supported only in the AWS Management +// Console. The built-in targets are EC2 CreateSnapshot API call, EC2 RebootInstances +// API call, EC2 StopInstances API call, and EC2 TerminateInstances API call. +// +// For some target types, PutTargets provides target-specific parameters. If +// the target is a Kinesis data stream, you can optionally specify which shard +// the event goes to by using the KinesisParameters argument. To invoke a command +// on multiple EC2 instances with one rule, you can use the RunCommandParameters +// field. +// +// To be able to make API calls against the resources that you own, Amazon EventBridge +// (CloudWatch Events) needs the appropriate permissions. For AWS Lambda and +// Amazon SNS resources, EventBridge relies on resource-based policies. For +// EC2 instances, Kinesis data streams, AWS Step Functions state machines and +// API Gateway REST APIs, EventBridge relies on IAM roles that you specify in +// the RoleARN argument in PutTargets. For more information, see Authentication +// and Access Control (https://docs.aws.amazon.com/eventbridge/latest/userguide/auth-and-access-control-eventbridge.html) +// in the Amazon EventBridge User Guide. +// +// If another AWS account is in the same region and has granted you permission +// (using PutPermission), you can send events to that account. Set that account's +// event bus as a target of the rules in your account. To send the matched events +// to the other account, specify that account's event bus as the Arn value when +// you run PutTargets. If your account sends events to another account, your +// account is charged for each sent event. Each event sent to another account +// is charged as a custom event. The account receiving the event is not charged. +// For more information, see Amazon EventBridge (CloudWatch Events) Pricing +// (https://aws.amazon.com/eventbridge/pricing/). +// +// Input, InputPath, and InputTransformer are not available with PutTarget if +// the target is an event bus of a different AWS account. +// +// If you are setting the event bus of another account as the target, and that +// account granted permission to your account through an organization instead +// of directly by the account ID, then you must specify a RoleArn with proper +// permissions in the Target structure. For more information, see Sending and +// Receiving Events Between AWS Accounts (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) +// in the Amazon EventBridge User Guide. +// +// For more information about enabling cross-account events, see PutPermission. +// +// Input, InputPath, and InputTransformer are mutually exclusive and optional +// parameters of a target. When a rule is triggered due to a matched event: +// +// * If none of the following arguments are specified for a target, then +// the entire event is passed to the target in JSON format (unless the target +// is Amazon EC2 Run Command or Amazon ECS task, in which case nothing from +// the event is passed to the target). +// +// * If Input is specified in the form of valid JSON, then the matched event +// is overridden with this constant. +// +// * If InputPath is specified in the form of JSONPath (for example, $.detail), +// then only the part of the event specified in the path is passed to the +// target (for example, only the detail part of the event is passed). +// +// * If InputTransformer is specified, then one or more specified JSONPaths +// are extracted from the event and used as values in a template that you +// specify as the input to the target. +// +// When you specify InputPath or InputTransformer, you must use JSON dot notation, +// not bracket notation. +// +// When you add targets to a rule and the associated rule triggers soon after, +// new or updated targets might not be immediately invoked. Allow a short period +// of time for changes to take effect. +// +// This action can partially fail if too many requests are made at the same +// time. If that happens, FailedEntryCount is non-zero in the response and each +// entry in FailedEntries provides the ID of the failed target and the error +// code. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation PutTargets for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * LimitExceededException +// The request failed because it attempted to create resource beyond the allowed +// service quota. +// +// * ManagedRuleException +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/PutTargets +func (c *EventBridge) PutTargets(input *PutTargetsInput) (*PutTargetsOutput, error) { + req, out := c.PutTargetsRequest(input) + return out, req.Send() +} + +// PutTargetsWithContext is the same as PutTargets with the addition of +// the ability to pass a context and additional request options. +// +// See PutTargets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) PutTargetsWithContext(ctx aws.Context, input *PutTargetsInput, opts ...request.Option) (*PutTargetsOutput, error) { + req, out := c.PutTargetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRemovePermission = "RemovePermission" + +// RemovePermissionRequest generates a "aws/request.Request" representing the +// client's request for the RemovePermission operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RemovePermission for more information on using the RemovePermission +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RemovePermissionRequest method. +// req, resp := client.RemovePermissionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/RemovePermission +func (c *EventBridge) RemovePermissionRequest(input *RemovePermissionInput) (req *request.Request, output *RemovePermissionOutput) { + op := &request.Operation{ + Name: opRemovePermission, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RemovePermissionInput{} + } + + output = &RemovePermissionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// RemovePermission API operation for Amazon EventBridge. +// +// Revokes the permission of another AWS account to be able to put events to +// the specified event bus. Specify the account to revoke by the StatementId +// value that you associated with the account when you granted it permission +// with PutPermission. You can find the StatementId by using DescribeEventBus. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation RemovePermission for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * OperationDisabledException +// The operation you are attempting is not available in this region. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/RemovePermission +func (c *EventBridge) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) { + req, out := c.RemovePermissionRequest(input) + return out, req.Send() +} + +// RemovePermissionWithContext is the same as RemovePermission with the addition of +// the ability to pass a context and additional request options. +// +// See RemovePermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) RemovePermissionWithContext(ctx aws.Context, input *RemovePermissionInput, opts ...request.Option) (*RemovePermissionOutput, error) { + req, out := c.RemovePermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRemoveTargets = "RemoveTargets" + +// RemoveTargetsRequest generates a "aws/request.Request" representing the +// client's request for the RemoveTargets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RemoveTargets for more information on using the RemoveTargets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RemoveTargetsRequest method. +// req, resp := client.RemoveTargetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/RemoveTargets +func (c *EventBridge) RemoveTargetsRequest(input *RemoveTargetsInput) (req *request.Request, output *RemoveTargetsOutput) { + op := &request.Operation{ + Name: opRemoveTargets, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RemoveTargetsInput{} + } + + output = &RemoveTargetsOutput{} + req = c.newRequest(op, input, output) + return +} + +// RemoveTargets API operation for Amazon EventBridge. +// +// Removes the specified targets from the specified rule. When the rule is triggered, +// those targets are no longer be invoked. +// +// When you remove a target, when the associated rule triggers, removed targets +// might continue to be invoked. Allow a short period of time for changes to +// take effect. +// +// This action can partially fail if too many requests are made at the same +// time. If that happens, FailedEntryCount is non-zero in the response and each +// entry in FailedEntries provides the ID of the failed target and the error +// code. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation RemoveTargets for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * ManagedRuleException +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/RemoveTargets +func (c *EventBridge) RemoveTargets(input *RemoveTargetsInput) (*RemoveTargetsOutput, error) { + req, out := c.RemoveTargetsRequest(input) + return out, req.Send() +} + +// RemoveTargetsWithContext is the same as RemoveTargets with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTargets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) RemoveTargetsWithContext(ctx aws.Context, input *RemoveTargetsInput, opts ...request.Option) (*RemoveTargetsOutput, error) { + req, out := c.RemoveTargetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartReplay = "StartReplay" + +// StartReplayRequest generates a "aws/request.Request" representing the +// client's request for the StartReplay operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartReplay for more information on using the StartReplay +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartReplayRequest method. +// req, resp := client.StartReplayRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/StartReplay +func (c *EventBridge) StartReplayRequest(input *StartReplayInput) (req *request.Request, output *StartReplayOutput) { + op := &request.Operation{ + Name: opStartReplay, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StartReplayInput{} + } + + output = &StartReplayOutput{} + req = c.newRequest(op, input, output) + return +} + +// StartReplay API operation for Amazon EventBridge. +// +// Starts the specified replay. Events are not necessarily replayed in the exact +// same order that they were added to the archive. A replay processes events +// to replay based on the time in the event, and replays them using 1 minute +// intervals. If you specify an EventStartTime and an EventEndTime that covers +// a 20 minute time range, the events are replayed from the first minute of +// that 20 minute range first. Then the events from the second minute are replayed. +// You can use DescribeReplay to determine the progress of a replay. The value +// returned for EventLastReplayedTime indicates the time within the specified +// time range associated with the last event replayed. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation StartReplay for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * ResourceAlreadyExistsException +// The resource you are trying to create already exists. +// +// * InvalidEventPatternException +// The event pattern is not valid. +// +// * LimitExceededException +// The request failed because it attempted to create resource beyond the allowed +// service quota. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/StartReplay +func (c *EventBridge) StartReplay(input *StartReplayInput) (*StartReplayOutput, error) { + req, out := c.StartReplayRequest(input) + return out, req.Send() +} + +// StartReplayWithContext is the same as StartReplay with the addition of +// the ability to pass a context and additional request options. +// +// See StartReplay for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) StartReplayWithContext(ctx aws.Context, input *StartReplayInput, opts ...request.Option) (*StartReplayOutput, error) { + req, out := c.StartReplayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/TagResource +func (c *EventBridge) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { + op := &request.Operation{ + Name: opTagResource, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &TagResourceInput{} + } + + output = &TagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagResource API operation for Amazon EventBridge. +// +// Assigns one or more tags (key-value pairs) to the specified EventBridge resource. +// Tags can help you organize and categorize your resources. You can also use +// them to scope user permissions by granting a user permission to access or +// change only resources with certain tag values. In EventBridge, rules and +// event buses can be tagged. +// +// Tags don't have any semantic meaning to AWS and are interpreted strictly +// as strings of characters. +// +// You can use the TagResource action with a resource that already has tags. +// If you specify a new tag key, this tag is appended to the list of tags associated +// with the resource. If you specify a tag key that is already associated with +// the resource, the new tag value that you specify replaces the previous value +// for that tag. +// +// You can associate as many as 50 tags with a resource. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation TagResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * ManagedRuleException +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/TagResource +func (c *EventBridge) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTestEventPattern = "TestEventPattern" + +// TestEventPatternRequest generates a "aws/request.Request" representing the +// client's request for the TestEventPattern operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TestEventPattern for more information on using the TestEventPattern +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TestEventPatternRequest method. +// req, resp := client.TestEventPatternRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/TestEventPattern +func (c *EventBridge) TestEventPatternRequest(input *TestEventPatternInput) (req *request.Request, output *TestEventPatternOutput) { + op := &request.Operation{ + Name: opTestEventPattern, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &TestEventPatternInput{} + } + + output = &TestEventPatternOutput{} + req = c.newRequest(op, input, output) + return +} + +// TestEventPattern API operation for Amazon EventBridge. +// +// Tests whether the specified event pattern matches the provided event. +// +// Most services in AWS treat : or / as the same character in Amazon Resource +// Names (ARNs). However, EventBridge uses an exact match in event patterns +// and rules. Be sure to use the correct ARN characters when creating event +// patterns so that they match the ARN syntax in the event you want to match. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation TestEventPattern for usage and error information. +// +// Returned Error Types: +// * InvalidEventPatternException +// The event pattern is not valid. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/TestEventPattern +func (c *EventBridge) TestEventPattern(input *TestEventPatternInput) (*TestEventPatternOutput, error) { + req, out := c.TestEventPatternRequest(input) + return out, req.Send() +} + +// TestEventPatternWithContext is the same as TestEventPattern with the addition of +// the ability to pass a context and additional request options. +// +// See TestEventPattern for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) TestEventPatternWithContext(ctx aws.Context, input *TestEventPatternInput, opts ...request.Option) (*TestEventPatternOutput, error) { + req, out := c.TestEventPatternRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/UntagResource +func (c *EventBridge) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { + op := &request.Operation{ + Name: opUntagResource, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UntagResourceInput{} + } + + output = &UntagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for Amazon EventBridge. +// +// Removes one or more tags from the specified EventBridge resource. In Amazon +// EventBridge (CloudWatch Events, rules and event buses can be tagged. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation UntagResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * ManagedRuleException +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/UntagResource +func (c *EventBridge) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateApiDestination = "UpdateApiDestination" + +// UpdateApiDestinationRequest generates a "aws/request.Request" representing the +// client's request for the UpdateApiDestination operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateApiDestination for more information on using the UpdateApiDestination +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateApiDestinationRequest method. +// req, resp := client.UpdateApiDestinationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/UpdateApiDestination +func (c *EventBridge) UpdateApiDestinationRequest(input *UpdateApiDestinationInput) (req *request.Request, output *UpdateApiDestinationOutput) { + op := &request.Operation{ + Name: opUpdateApiDestination, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateApiDestinationInput{} + } + + output = &UpdateApiDestinationOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateApiDestination API operation for Amazon EventBridge. +// +// Updates an API destination. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation UpdateApiDestination for usage and error information. +// +// Returned Error Types: +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * LimitExceededException +// The request failed because it attempted to create resource beyond the allowed +// service quota. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/UpdateApiDestination +func (c *EventBridge) UpdateApiDestination(input *UpdateApiDestinationInput) (*UpdateApiDestinationOutput, error) { + req, out := c.UpdateApiDestinationRequest(input) + return out, req.Send() +} + +// UpdateApiDestinationWithContext is the same as UpdateApiDestination with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApiDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) UpdateApiDestinationWithContext(ctx aws.Context, input *UpdateApiDestinationInput, opts ...request.Option) (*UpdateApiDestinationOutput, error) { + req, out := c.UpdateApiDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateArchive = "UpdateArchive" + +// UpdateArchiveRequest generates a "aws/request.Request" representing the +// client's request for the UpdateArchive operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateArchive for more information on using the UpdateArchive +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateArchiveRequest method. +// req, resp := client.UpdateArchiveRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/UpdateArchive +func (c *EventBridge) UpdateArchiveRequest(input *UpdateArchiveInput) (req *request.Request, output *UpdateArchiveOutput) { + op := &request.Operation{ + Name: opUpdateArchive, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateArchiveInput{} + } + + output = &UpdateArchiveOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateArchive API operation for Amazon EventBridge. +// +// Updates the specified archive. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation UpdateArchive for usage and error information. +// +// Returned Error Types: +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * LimitExceededException +// The request failed because it attempted to create resource beyond the allowed +// service quota. +// +// * InvalidEventPatternException +// The event pattern is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/UpdateArchive +func (c *EventBridge) UpdateArchive(input *UpdateArchiveInput) (*UpdateArchiveOutput, error) { + req, out := c.UpdateArchiveRequest(input) + return out, req.Send() +} + +// UpdateArchiveWithContext is the same as UpdateArchive with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateArchive for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) UpdateArchiveWithContext(ctx aws.Context, input *UpdateArchiveInput, opts ...request.Option) (*UpdateArchiveOutput, error) { + req, out := c.UpdateArchiveRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateConnection = "UpdateConnection" + +// UpdateConnectionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateConnection operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateConnection for more information on using the UpdateConnection +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateConnectionRequest method. +// req, resp := client.UpdateConnectionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/UpdateConnection +func (c *EventBridge) UpdateConnectionRequest(input *UpdateConnectionInput) (req *request.Request, output *UpdateConnectionOutput) { + op := &request.Operation{ + Name: opUpdateConnection, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateConnectionInput{} + } + + output = &UpdateConnectionOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateConnection API operation for Amazon EventBridge. +// +// Updates settings for a connection. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EventBridge's +// API operation UpdateConnection for usage and error information. +// +// Returned Error Types: +// * ConcurrentModificationException +// There is concurrent modification on a rule, target, archive, or replay. +// +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * InternalException +// This exception occurs due to unexpected causes. +// +// * LimitExceededException +// The request failed because it attempted to create resource beyond the allowed +// service quota. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07/UpdateConnection +func (c *EventBridge) UpdateConnection(input *UpdateConnectionInput) (*UpdateConnectionOutput, error) { + req, out := c.UpdateConnectionRequest(input) + return out, req.Send() +} + +// UpdateConnectionWithContext is the same as UpdateConnection with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateConnection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EventBridge) UpdateConnectionWithContext(ctx aws.Context, input *UpdateConnectionInput, opts ...request.Option) (*UpdateConnectionOutput, error) { + req, out := c.UpdateConnectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +type ActivateEventSourceInput struct { + _ struct{} `type:"structure"` + + // The name of the partner event source to activate. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ActivateEventSourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ActivateEventSourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ActivateEventSourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ActivateEventSourceInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *ActivateEventSourceInput) SetName(v string) *ActivateEventSourceInput { + s.Name = &v + return s +} + +type ActivateEventSourceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ActivateEventSourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ActivateEventSourceOutput) GoString() string { + return s.String() +} + +// Contains details about an API destination. +type ApiDestination struct { + _ struct{} `type:"structure"` + + // The ARN of the API destination. + ApiDestinationArn *string `min:"1" type:"string"` + + // The state of the API destination. + ApiDestinationState *string `type:"string" enum:"ApiDestinationState"` + + // The ARN of the connection specified for the API destination. + ConnectionArn *string `min:"1" type:"string"` + + // A time stamp for the time that the API destination was created. + CreationTime *time.Time `type:"timestamp"` + + // The method to use to connect to the HTTP endpoint. + HttpMethod *string `type:"string" enum:"ApiDestinationHttpMethod"` + + // The URL to the endpoint for the API destination. + InvocationEndpoint *string `min:"1" type:"string"` + + // The maximum number of invocations per second to send to the HTTP endpoint. + InvocationRateLimitPerSecond *int64 `min:"1" type:"integer"` + + // A time stamp for the time that the API destination was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The name of the API destination. + Name *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ApiDestination) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApiDestination) GoString() string { + return s.String() +} + +// SetApiDestinationArn sets the ApiDestinationArn field's value. +func (s *ApiDestination) SetApiDestinationArn(v string) *ApiDestination { + s.ApiDestinationArn = &v + return s +} + +// SetApiDestinationState sets the ApiDestinationState field's value. +func (s *ApiDestination) SetApiDestinationState(v string) *ApiDestination { + s.ApiDestinationState = &v + return s +} + +// SetConnectionArn sets the ConnectionArn field's value. +func (s *ApiDestination) SetConnectionArn(v string) *ApiDestination { + s.ConnectionArn = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *ApiDestination) SetCreationTime(v time.Time) *ApiDestination { + s.CreationTime = &v + return s +} + +// SetHttpMethod sets the HttpMethod field's value. +func (s *ApiDestination) SetHttpMethod(v string) *ApiDestination { + s.HttpMethod = &v + return s +} + +// SetInvocationEndpoint sets the InvocationEndpoint field's value. +func (s *ApiDestination) SetInvocationEndpoint(v string) *ApiDestination { + s.InvocationEndpoint = &v + return s +} + +// SetInvocationRateLimitPerSecond sets the InvocationRateLimitPerSecond field's value. +func (s *ApiDestination) SetInvocationRateLimitPerSecond(v int64) *ApiDestination { + s.InvocationRateLimitPerSecond = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *ApiDestination) SetLastModifiedTime(v time.Time) *ApiDestination { + s.LastModifiedTime = &v + return s +} + +// SetName sets the Name field's value. +func (s *ApiDestination) SetName(v string) *ApiDestination { + s.Name = &v + return s +} + +// An Archive object that contains details about an archive. +type Archive struct { + _ struct{} `type:"structure"` + + // The name of the archive. + ArchiveName *string `min:"1" type:"string"` + + // The time stamp for the time that the archive was created. + CreationTime *time.Time `type:"timestamp"` + + // The number of events in the archive. + EventCount *int64 `type:"long"` + + // The ARN of the event bus associated with the archive. Only events from this + // event bus are sent to the archive. + EventSourceArn *string `min:"1" type:"string"` + + // The number of days to retain events in the archive before they are deleted. + RetentionDays *int64 `type:"integer"` + + // The size of the archive, in bytes. + SizeBytes *int64 `type:"long"` + + // The current state of the archive. + State *string `type:"string" enum:"ArchiveState"` + + // A description for the reason that the archive is in the current state. + StateReason *string `type:"string"` +} + +// String returns the string representation +func (s Archive) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Archive) GoString() string { + return s.String() +} + +// SetArchiveName sets the ArchiveName field's value. +func (s *Archive) SetArchiveName(v string) *Archive { + s.ArchiveName = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *Archive) SetCreationTime(v time.Time) *Archive { + s.CreationTime = &v + return s +} + +// SetEventCount sets the EventCount field's value. +func (s *Archive) SetEventCount(v int64) *Archive { + s.EventCount = &v + return s +} + +// SetEventSourceArn sets the EventSourceArn field's value. +func (s *Archive) SetEventSourceArn(v string) *Archive { + s.EventSourceArn = &v + return s +} + +// SetRetentionDays sets the RetentionDays field's value. +func (s *Archive) SetRetentionDays(v int64) *Archive { + s.RetentionDays = &v + return s +} + +// SetSizeBytes sets the SizeBytes field's value. +func (s *Archive) SetSizeBytes(v int64) *Archive { + s.SizeBytes = &v + return s +} + +// SetState sets the State field's value. +func (s *Archive) SetState(v string) *Archive { + s.State = &v + return s +} + +// SetStateReason sets the StateReason field's value. +func (s *Archive) SetStateReason(v string) *Archive { + s.StateReason = &v + return s +} + +// This structure specifies the VPC subnets and security groups for the task, +// and whether a public IP address is to be used. This structure is relevant +// only for ECS tasks that use the awsvpc network mode. +type AwsVpcConfiguration struct { + _ struct{} `type:"structure"` + + // Specifies whether the task's elastic network interface receives a public + // IP address. You can specify ENABLED only when LaunchType in EcsParameters + // is set to FARGATE. + AssignPublicIp *string `type:"string" enum:"AssignPublicIp"` + + // Specifies the security groups associated with the task. These security groups + // must all be in the same VPC. You can specify as many as five security groups. + // If you do not specify a security group, the default security group for the + // VPC is used. + SecurityGroups []*string `type:"list"` + + // Specifies the subnets associated with the task. These subnets must all be + // in the same VPC. You can specify as many as 16 subnets. + // + // Subnets is a required field + Subnets []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s AwsVpcConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsVpcConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AwsVpcConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AwsVpcConfiguration"} + if s.Subnets == nil { + invalidParams.Add(request.NewErrParamRequired("Subnets")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssignPublicIp sets the AssignPublicIp field's value. +func (s *AwsVpcConfiguration) SetAssignPublicIp(v string) *AwsVpcConfiguration { + s.AssignPublicIp = &v + return s +} + +// SetSecurityGroups sets the SecurityGroups field's value. +func (s *AwsVpcConfiguration) SetSecurityGroups(v []*string) *AwsVpcConfiguration { + s.SecurityGroups = v + return s +} + +// SetSubnets sets the Subnets field's value. +func (s *AwsVpcConfiguration) SetSubnets(v []*string) *AwsVpcConfiguration { + s.Subnets = v + return s +} + +// The array properties for the submitted job, such as the size of the array. +// The array size can be between 2 and 10,000. If you specify array properties +// for a job, it becomes an array job. This parameter is used only if the target +// is an AWS Batch job. +type BatchArrayProperties struct { + _ struct{} `type:"structure"` + + // The size of the array, if this is an array batch job. Valid values are integers + // between 2 and 10,000. + Size *int64 `type:"integer"` +} + +// String returns the string representation +func (s BatchArrayProperties) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchArrayProperties) GoString() string { + return s.String() +} + +// SetSize sets the Size field's value. +func (s *BatchArrayProperties) SetSize(v int64) *BatchArrayProperties { + s.Size = &v + return s +} + +// The custom parameters to be used when the target is an AWS Batch job. +type BatchParameters struct { + _ struct{} `type:"structure"` + + // The array properties for the submitted job, such as the size of the array. + // The array size can be between 2 and 10,000. If you specify array properties + // for a job, it becomes an array job. This parameter is used only if the target + // is an AWS Batch job. + ArrayProperties *BatchArrayProperties `type:"structure"` + + // The ARN or name of the job definition to use if the event target is an AWS + // Batch job. This job definition must already exist. + // + // JobDefinition is a required field + JobDefinition *string `type:"string" required:"true"` + + // The name to use for this execution of the job, if the target is an AWS Batch + // job. + // + // JobName is a required field + JobName *string `type:"string" required:"true"` + + // The retry strategy to use for failed jobs, if the target is an AWS Batch + // job. The retry strategy is the number of times to retry the failed job execution. + // Valid values are 1–10. When you specify a retry strategy here, it overrides + // the retry strategy defined in the job definition. + RetryStrategy *BatchRetryStrategy `type:"structure"` +} + +// String returns the string representation +func (s BatchParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchParameters"} + if s.JobDefinition == nil { + invalidParams.Add(request.NewErrParamRequired("JobDefinition")) + } + if s.JobName == nil { + invalidParams.Add(request.NewErrParamRequired("JobName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArrayProperties sets the ArrayProperties field's value. +func (s *BatchParameters) SetArrayProperties(v *BatchArrayProperties) *BatchParameters { + s.ArrayProperties = v + return s +} + +// SetJobDefinition sets the JobDefinition field's value. +func (s *BatchParameters) SetJobDefinition(v string) *BatchParameters { + s.JobDefinition = &v + return s +} + +// SetJobName sets the JobName field's value. +func (s *BatchParameters) SetJobName(v string) *BatchParameters { + s.JobName = &v + return s +} + +// SetRetryStrategy sets the RetryStrategy field's value. +func (s *BatchParameters) SetRetryStrategy(v *BatchRetryStrategy) *BatchParameters { + s.RetryStrategy = v + return s +} + +// The retry strategy to use for failed jobs, if the target is an AWS Batch +// job. If you specify a retry strategy here, it overrides the retry strategy +// defined in the job definition. +type BatchRetryStrategy struct { + _ struct{} `type:"structure"` + + // The number of times to attempt to retry, if the job fails. Valid values are + // 1–10. + Attempts *int64 `type:"integer"` +} + +// String returns the string representation +func (s BatchRetryStrategy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchRetryStrategy) GoString() string { + return s.String() +} + +// SetAttempts sets the Attempts field's value. +func (s *BatchRetryStrategy) SetAttempts(v int64) *BatchRetryStrategy { + s.Attempts = &v + return s +} + +type CancelReplayInput struct { + _ struct{} `type:"structure"` + + // The name of the replay to cancel. + // + // ReplayName is a required field + ReplayName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CancelReplayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelReplayInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CancelReplayInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CancelReplayInput"} + if s.ReplayName == nil { + invalidParams.Add(request.NewErrParamRequired("ReplayName")) + } + if s.ReplayName != nil && len(*s.ReplayName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ReplayName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetReplayName sets the ReplayName field's value. +func (s *CancelReplayInput) SetReplayName(v string) *CancelReplayInput { + s.ReplayName = &v + return s +} + +type CancelReplayOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the replay to cancel. + ReplayArn *string `min:"1" type:"string"` + + // The current state of the replay. + State *string `type:"string" enum:"ReplayState"` + + // The reason that the replay is in the current state. + StateReason *string `type:"string"` +} + +// String returns the string representation +func (s CancelReplayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelReplayOutput) GoString() string { + return s.String() +} + +// SetReplayArn sets the ReplayArn field's value. +func (s *CancelReplayOutput) SetReplayArn(v string) *CancelReplayOutput { + s.ReplayArn = &v + return s +} + +// SetState sets the State field's value. +func (s *CancelReplayOutput) SetState(v string) *CancelReplayOutput { + s.State = &v + return s +} + +// SetStateReason sets the StateReason field's value. +func (s *CancelReplayOutput) SetStateReason(v string) *CancelReplayOutput { + s.StateReason = &v + return s +} + +// There is concurrent modification on a rule, target, archive, or replay. +type ConcurrentModificationException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConcurrentModificationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentModificationException) GoString() string { + return s.String() +} + +func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { + return &ConcurrentModificationException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *ConcurrentModificationException) Code() string { + return "ConcurrentModificationException" +} + +// Message returns the exception's message. +func (s *ConcurrentModificationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *ConcurrentModificationException) OrigErr() error { + return nil +} + +func (s *ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *ConcurrentModificationException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *ConcurrentModificationException) RequestID() string { + return s.RespMetadata.RequestID +} + +// A JSON string which you can use to limit the event bus permissions you are +// granting to only accounts that fulfill the condition. Currently, the only +// supported condition is membership in a certain AWS organization. The string +// must contain Type, Key, and Value fields. The Value field specifies the ID +// of the AWS organization. Following is an example value for Condition: +// +// '{"Type" : "StringEquals", "Key": "aws:PrincipalOrgID", "Value": "o-1234567890"}' +type Condition struct { + _ struct{} `type:"structure"` + + // Specifies the key for the condition. Currently the only supported key is + // aws:PrincipalOrgID. + // + // Key is a required field + Key *string `type:"string" required:"true"` + + // Specifies the type of condition. Currently the only supported value is StringEquals. + // + // Type is a required field + Type *string `type:"string" required:"true"` + + // Specifies the value for the key. Currently, this must be the ID of the organization. + // + // Value is a required field + Value *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s Condition) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Condition) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Condition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Condition"} + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + if s.Value == nil { + invalidParams.Add(request.NewErrParamRequired("Value")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKey sets the Key field's value. +func (s *Condition) SetKey(v string) *Condition { + s.Key = &v + return s +} + +// SetType sets the Type field's value. +func (s *Condition) SetType(v string) *Condition { + s.Type = &v + return s +} + +// SetValue sets the Value field's value. +func (s *Condition) SetValue(v string) *Condition { + s.Value = &v + return s +} + +// Contains information about a connection. +type Connection struct { + _ struct{} `type:"structure"` + + // The authorization type specified for the connection. + AuthorizationType *string `type:"string" enum:"ConnectionAuthorizationType"` + + // The ARN of the connection. + ConnectionArn *string `min:"1" type:"string"` + + // The state of the connection. + ConnectionState *string `type:"string" enum:"ConnectionState"` + + // A time stamp for the time that the connection was created. + CreationTime *time.Time `type:"timestamp"` + + // A time stamp for the time that the connection was last authorized. + LastAuthorizedTime *time.Time `type:"timestamp"` + + // A time stamp for the time that the connection was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The name of the connection. + Name *string `min:"1" type:"string"` + + // The reason that the connection is in the connection state. + StateReason *string `type:"string"` +} + +// String returns the string representation +func (s Connection) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Connection) GoString() string { + return s.String() +} + +// SetAuthorizationType sets the AuthorizationType field's value. +func (s *Connection) SetAuthorizationType(v string) *Connection { + s.AuthorizationType = &v + return s +} + +// SetConnectionArn sets the ConnectionArn field's value. +func (s *Connection) SetConnectionArn(v string) *Connection { + s.ConnectionArn = &v + return s +} + +// SetConnectionState sets the ConnectionState field's value. +func (s *Connection) SetConnectionState(v string) *Connection { + s.ConnectionState = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *Connection) SetCreationTime(v time.Time) *Connection { + s.CreationTime = &v + return s +} + +// SetLastAuthorizedTime sets the LastAuthorizedTime field's value. +func (s *Connection) SetLastAuthorizedTime(v time.Time) *Connection { + s.LastAuthorizedTime = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *Connection) SetLastModifiedTime(v time.Time) *Connection { + s.LastModifiedTime = &v + return s +} + +// SetName sets the Name field's value. +func (s *Connection) SetName(v string) *Connection { + s.Name = &v + return s +} + +// SetStateReason sets the StateReason field's value. +func (s *Connection) SetStateReason(v string) *Connection { + s.StateReason = &v + return s +} + +// Contains the authorization parameters for the connection if API Key is specified +// as the authorization type. +type ConnectionApiKeyAuthResponseParameters struct { + _ struct{} `type:"structure"` + + // The name of the header to use for the APIKeyValue used for authorization. + ApiKeyName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ConnectionApiKeyAuthResponseParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectionApiKeyAuthResponseParameters) GoString() string { + return s.String() +} + +// SetApiKeyName sets the ApiKeyName field's value. +func (s *ConnectionApiKeyAuthResponseParameters) SetApiKeyName(v string) *ConnectionApiKeyAuthResponseParameters { + s.ApiKeyName = &v + return s +} + +// Contains the authorization parameters to use for the connection. +type ConnectionAuthResponseParameters struct { + _ struct{} `type:"structure"` + + // The API Key parameters to use for authorization. + ApiKeyAuthParameters *ConnectionApiKeyAuthResponseParameters `type:"structure"` + + // The authorization parameters for Basic authorization. + BasicAuthParameters *ConnectionBasicAuthResponseParameters `type:"structure"` + + // Additional parameters for the connection that are passed through with every + // invocation to the HTTP endpoint. + InvocationHttpParameters *ConnectionHttpParameters `type:"structure"` + + // The OAuth parameters to use for authorization. + OAuthParameters *ConnectionOAuthResponseParameters `type:"structure"` +} + +// String returns the string representation +func (s ConnectionAuthResponseParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectionAuthResponseParameters) GoString() string { + return s.String() +} + +// SetApiKeyAuthParameters sets the ApiKeyAuthParameters field's value. +func (s *ConnectionAuthResponseParameters) SetApiKeyAuthParameters(v *ConnectionApiKeyAuthResponseParameters) *ConnectionAuthResponseParameters { + s.ApiKeyAuthParameters = v + return s +} + +// SetBasicAuthParameters sets the BasicAuthParameters field's value. +func (s *ConnectionAuthResponseParameters) SetBasicAuthParameters(v *ConnectionBasicAuthResponseParameters) *ConnectionAuthResponseParameters { + s.BasicAuthParameters = v + return s +} + +// SetInvocationHttpParameters sets the InvocationHttpParameters field's value. +func (s *ConnectionAuthResponseParameters) SetInvocationHttpParameters(v *ConnectionHttpParameters) *ConnectionAuthResponseParameters { + s.InvocationHttpParameters = v + return s +} + +// SetOAuthParameters sets the OAuthParameters field's value. +func (s *ConnectionAuthResponseParameters) SetOAuthParameters(v *ConnectionOAuthResponseParameters) *ConnectionAuthResponseParameters { + s.OAuthParameters = v + return s +} + +// Contains the authorization parameters for the connection if Basic is specified +// as the authorization type. +type ConnectionBasicAuthResponseParameters struct { + _ struct{} `type:"structure"` + + // The user name to use for Basic authorization. + Username *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ConnectionBasicAuthResponseParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectionBasicAuthResponseParameters) GoString() string { + return s.String() +} + +// SetUsername sets the Username field's value. +func (s *ConnectionBasicAuthResponseParameters) SetUsername(v string) *ConnectionBasicAuthResponseParameters { + s.Username = &v + return s +} + +// Additional parameter included in the body. You can include up to 100 additional +// body parameters per request. An event payload cannot exceed 64 KB. +type ConnectionBodyParameter struct { + _ struct{} `type:"structure"` + + // Specified whether the value is secret. + IsValueSecret *bool `type:"boolean"` + + // The key for the parameter. + Key *string `type:"string"` + + // The value associated with the key. + Value *string `type:"string"` +} + +// String returns the string representation +func (s ConnectionBodyParameter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectionBodyParameter) GoString() string { + return s.String() +} + +// SetIsValueSecret sets the IsValueSecret field's value. +func (s *ConnectionBodyParameter) SetIsValueSecret(v bool) *ConnectionBodyParameter { + s.IsValueSecret = &v + return s +} + +// SetKey sets the Key field's value. +func (s *ConnectionBodyParameter) SetKey(v string) *ConnectionBodyParameter { + s.Key = &v + return s +} + +// SetValue sets the Value field's value. +func (s *ConnectionBodyParameter) SetValue(v string) *ConnectionBodyParameter { + s.Value = &v + return s +} + +// Additional parameter included in the header. You can include up to 100 additional +// header parameters per request. An event payload cannot exceed 64 KB. +type ConnectionHeaderParameter struct { + _ struct{} `type:"structure"` + + // Specified whether the value is a secret. + IsValueSecret *bool `type:"boolean"` + + // The key for the parameter. + Key *string `type:"string"` + + // The value associated with the key. + Value *string `type:"string"` +} + +// String returns the string representation +func (s ConnectionHeaderParameter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectionHeaderParameter) GoString() string { + return s.String() +} + +// SetIsValueSecret sets the IsValueSecret field's value. +func (s *ConnectionHeaderParameter) SetIsValueSecret(v bool) *ConnectionHeaderParameter { + s.IsValueSecret = &v + return s +} + +// SetKey sets the Key field's value. +func (s *ConnectionHeaderParameter) SetKey(v string) *ConnectionHeaderParameter { + s.Key = &v + return s +} + +// SetValue sets the Value field's value. +func (s *ConnectionHeaderParameter) SetValue(v string) *ConnectionHeaderParameter { + s.Value = &v + return s +} + +// Contains additional parameters for the connection. +type ConnectionHttpParameters struct { + _ struct{} `type:"structure"` + + // Contains additional body string parameters for the connection. + BodyParameters []*ConnectionBodyParameter `type:"list"` + + // Contains additional header parameters for the connection. + HeaderParameters []*ConnectionHeaderParameter `type:"list"` + + // Contains additional query string parameters for the connection. + QueryStringParameters []*ConnectionQueryStringParameter `type:"list"` +} + +// String returns the string representation +func (s ConnectionHttpParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectionHttpParameters) GoString() string { + return s.String() +} + +// SetBodyParameters sets the BodyParameters field's value. +func (s *ConnectionHttpParameters) SetBodyParameters(v []*ConnectionBodyParameter) *ConnectionHttpParameters { + s.BodyParameters = v + return s +} + +// SetHeaderParameters sets the HeaderParameters field's value. +func (s *ConnectionHttpParameters) SetHeaderParameters(v []*ConnectionHeaderParameter) *ConnectionHttpParameters { + s.HeaderParameters = v + return s +} + +// SetQueryStringParameters sets the QueryStringParameters field's value. +func (s *ConnectionHttpParameters) SetQueryStringParameters(v []*ConnectionQueryStringParameter) *ConnectionHttpParameters { + s.QueryStringParameters = v + return s +} + +// Contains the client response parameters for the connection when OAuth is +// specified as the authorization type. +type ConnectionOAuthClientResponseParameters struct { + _ struct{} `type:"structure"` + + // The client ID associated with the response to the connection request. + ClientID *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ConnectionOAuthClientResponseParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectionOAuthClientResponseParameters) GoString() string { + return s.String() +} + +// SetClientID sets the ClientID field's value. +func (s *ConnectionOAuthClientResponseParameters) SetClientID(v string) *ConnectionOAuthClientResponseParameters { + s.ClientID = &v + return s +} + +// Contains the response parameters when OAuth is specified as the authorization +// type. +type ConnectionOAuthResponseParameters struct { + _ struct{} `type:"structure"` + + // The URL to the HTTP endpoint that authorized the request. + AuthorizationEndpoint *string `min:"1" type:"string"` + + // A ConnectionOAuthClientResponseParameters object that contains details about + // the client parameters returned when OAuth is specified as the authorization + // type. + ClientParameters *ConnectionOAuthClientResponseParameters `type:"structure"` + + // The method used to connect to the HTTP endpoint. + HttpMethod *string `type:"string" enum:"ConnectionOAuthHttpMethod"` + + // The additional HTTP parameters used for the OAuth authorization request. + OAuthHttpParameters *ConnectionHttpParameters `type:"structure"` +} + +// String returns the string representation +func (s ConnectionOAuthResponseParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectionOAuthResponseParameters) GoString() string { + return s.String() +} + +// SetAuthorizationEndpoint sets the AuthorizationEndpoint field's value. +func (s *ConnectionOAuthResponseParameters) SetAuthorizationEndpoint(v string) *ConnectionOAuthResponseParameters { + s.AuthorizationEndpoint = &v + return s +} + +// SetClientParameters sets the ClientParameters field's value. +func (s *ConnectionOAuthResponseParameters) SetClientParameters(v *ConnectionOAuthClientResponseParameters) *ConnectionOAuthResponseParameters { + s.ClientParameters = v + return s +} + +// SetHttpMethod sets the HttpMethod field's value. +func (s *ConnectionOAuthResponseParameters) SetHttpMethod(v string) *ConnectionOAuthResponseParameters { + s.HttpMethod = &v + return s +} + +// SetOAuthHttpParameters sets the OAuthHttpParameters field's value. +func (s *ConnectionOAuthResponseParameters) SetOAuthHttpParameters(v *ConnectionHttpParameters) *ConnectionOAuthResponseParameters { + s.OAuthHttpParameters = v + return s +} + +// Additional query string parameter for the connection. You can include up +// to 100 additional query string parameters per request. Each additional parameter +// counts towards the event payload size, which cannot exceed 64 KB. +type ConnectionQueryStringParameter struct { + _ struct{} `type:"structure"` + + // Specifies whether the value is secret. + IsValueSecret *bool `type:"boolean"` + + // The key for a query string parameter. + Key *string `type:"string"` + + // The value associated with the key for the query string parameter. + Value *string `type:"string"` +} + +// String returns the string representation +func (s ConnectionQueryStringParameter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectionQueryStringParameter) GoString() string { + return s.String() +} + +// SetIsValueSecret sets the IsValueSecret field's value. +func (s *ConnectionQueryStringParameter) SetIsValueSecret(v bool) *ConnectionQueryStringParameter { + s.IsValueSecret = &v + return s +} + +// SetKey sets the Key field's value. +func (s *ConnectionQueryStringParameter) SetKey(v string) *ConnectionQueryStringParameter { + s.Key = &v + return s +} + +// SetValue sets the Value field's value. +func (s *ConnectionQueryStringParameter) SetValue(v string) *ConnectionQueryStringParameter { + s.Value = &v + return s +} + +type CreateApiDestinationInput struct { + _ struct{} `type:"structure"` + + // The ARN of the connection to use for the API destination. The destination + // endpoint must support the authorization type specified for the connection. + // + // ConnectionArn is a required field + ConnectionArn *string `min:"1" type:"string" required:"true"` + + // A description for the API destination to create. + Description *string `type:"string"` + + // The method to use for the request to the HTTP invocation endpoint. + // + // HttpMethod is a required field + HttpMethod *string `type:"string" required:"true" enum:"ApiDestinationHttpMethod"` + + // The URL to the HTTP invocation endpoint for the API destination. + // + // InvocationEndpoint is a required field + InvocationEndpoint *string `min:"1" type:"string" required:"true"` + + // The maximum number of requests per second to send to the HTTP invocation + // endpoint. + InvocationRateLimitPerSecond *int64 `min:"1" type:"integer"` + + // The name for the API destination to create. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateApiDestinationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateApiDestinationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateApiDestinationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateApiDestinationInput"} + if s.ConnectionArn == nil { + invalidParams.Add(request.NewErrParamRequired("ConnectionArn")) + } + if s.ConnectionArn != nil && len(*s.ConnectionArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConnectionArn", 1)) + } + if s.HttpMethod == nil { + invalidParams.Add(request.NewErrParamRequired("HttpMethod")) + } + if s.InvocationEndpoint == nil { + invalidParams.Add(request.NewErrParamRequired("InvocationEndpoint")) + } + if s.InvocationEndpoint != nil && len(*s.InvocationEndpoint) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InvocationEndpoint", 1)) + } + if s.InvocationRateLimitPerSecond != nil && *s.InvocationRateLimitPerSecond < 1 { + invalidParams.Add(request.NewErrParamMinValue("InvocationRateLimitPerSecond", 1)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConnectionArn sets the ConnectionArn field's value. +func (s *CreateApiDestinationInput) SetConnectionArn(v string) *CreateApiDestinationInput { + s.ConnectionArn = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateApiDestinationInput) SetDescription(v string) *CreateApiDestinationInput { + s.Description = &v + return s +} + +// SetHttpMethod sets the HttpMethod field's value. +func (s *CreateApiDestinationInput) SetHttpMethod(v string) *CreateApiDestinationInput { + s.HttpMethod = &v + return s +} + +// SetInvocationEndpoint sets the InvocationEndpoint field's value. +func (s *CreateApiDestinationInput) SetInvocationEndpoint(v string) *CreateApiDestinationInput { + s.InvocationEndpoint = &v + return s +} + +// SetInvocationRateLimitPerSecond sets the InvocationRateLimitPerSecond field's value. +func (s *CreateApiDestinationInput) SetInvocationRateLimitPerSecond(v int64) *CreateApiDestinationInput { + s.InvocationRateLimitPerSecond = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateApiDestinationInput) SetName(v string) *CreateApiDestinationInput { + s.Name = &v + return s +} + +type CreateApiDestinationOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the API destination that was created by the request. + ApiDestinationArn *string `min:"1" type:"string"` + + // The state of the API destination that was created by the request. + ApiDestinationState *string `type:"string" enum:"ApiDestinationState"` + + // A time stamp indicating the time that the API destination was created. + CreationTime *time.Time `type:"timestamp"` + + // A time stamp indicating the time that the API destination was last modified. + LastModifiedTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s CreateApiDestinationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateApiDestinationOutput) GoString() string { + return s.String() +} + +// SetApiDestinationArn sets the ApiDestinationArn field's value. +func (s *CreateApiDestinationOutput) SetApiDestinationArn(v string) *CreateApiDestinationOutput { + s.ApiDestinationArn = &v + return s +} + +// SetApiDestinationState sets the ApiDestinationState field's value. +func (s *CreateApiDestinationOutput) SetApiDestinationState(v string) *CreateApiDestinationOutput { + s.ApiDestinationState = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *CreateApiDestinationOutput) SetCreationTime(v time.Time) *CreateApiDestinationOutput { + s.CreationTime = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *CreateApiDestinationOutput) SetLastModifiedTime(v time.Time) *CreateApiDestinationOutput { + s.LastModifiedTime = &v + return s +} + +type CreateArchiveInput struct { + _ struct{} `type:"structure"` + + // The name for the archive to create. + // + // ArchiveName is a required field + ArchiveName *string `min:"1" type:"string" required:"true"` + + // A description for the archive. + Description *string `type:"string"` + + // An event pattern to use to filter events sent to the archive. + EventPattern *string `type:"string"` + + // The ARN of the event source associated with the archive. + // + // EventSourceArn is a required field + EventSourceArn *string `min:"1" type:"string" required:"true"` + + // The number of days to retain events for. Default value is 0. If set to 0, + // events are retained indefinitely + RetentionDays *int64 `type:"integer"` +} + +// String returns the string representation +func (s CreateArchiveInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateArchiveInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateArchiveInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateArchiveInput"} + if s.ArchiveName == nil { + invalidParams.Add(request.NewErrParamRequired("ArchiveName")) + } + if s.ArchiveName != nil && len(*s.ArchiveName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ArchiveName", 1)) + } + if s.EventSourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("EventSourceArn")) + } + if s.EventSourceArn != nil && len(*s.EventSourceArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventSourceArn", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArchiveName sets the ArchiveName field's value. +func (s *CreateArchiveInput) SetArchiveName(v string) *CreateArchiveInput { + s.ArchiveName = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateArchiveInput) SetDescription(v string) *CreateArchiveInput { + s.Description = &v + return s +} + +// SetEventPattern sets the EventPattern field's value. +func (s *CreateArchiveInput) SetEventPattern(v string) *CreateArchiveInput { + s.EventPattern = &v + return s +} + +// SetEventSourceArn sets the EventSourceArn field's value. +func (s *CreateArchiveInput) SetEventSourceArn(v string) *CreateArchiveInput { + s.EventSourceArn = &v + return s +} + +// SetRetentionDays sets the RetentionDays field's value. +func (s *CreateArchiveInput) SetRetentionDays(v int64) *CreateArchiveInput { + s.RetentionDays = &v + return s +} + +type CreateArchiveOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the archive that was created. + ArchiveArn *string `min:"1" type:"string"` + + // The time at which the archive was created. + CreationTime *time.Time `type:"timestamp"` + + // The state of the archive that was created. + State *string `type:"string" enum:"ArchiveState"` + + // The reason that the archive is in the state. + StateReason *string `type:"string"` +} + +// String returns the string representation +func (s CreateArchiveOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateArchiveOutput) GoString() string { + return s.String() +} + +// SetArchiveArn sets the ArchiveArn field's value. +func (s *CreateArchiveOutput) SetArchiveArn(v string) *CreateArchiveOutput { + s.ArchiveArn = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *CreateArchiveOutput) SetCreationTime(v time.Time) *CreateArchiveOutput { + s.CreationTime = &v + return s +} + +// SetState sets the State field's value. +func (s *CreateArchiveOutput) SetState(v string) *CreateArchiveOutput { + s.State = &v + return s +} + +// SetStateReason sets the StateReason field's value. +func (s *CreateArchiveOutput) SetStateReason(v string) *CreateArchiveOutput { + s.StateReason = &v + return s +} + +// Contains the API key authorization parameters for the connection. +type CreateConnectionApiKeyAuthRequestParameters struct { + _ struct{} `type:"structure"` + + // The name of the API key to use for authorization. + // + // ApiKeyName is a required field + ApiKeyName *string `min:"1" type:"string" required:"true"` + + // The value for the API key to use for authorization. + // + // ApiKeyValue is a required field + ApiKeyValue *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateConnectionApiKeyAuthRequestParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateConnectionApiKeyAuthRequestParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateConnectionApiKeyAuthRequestParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateConnectionApiKeyAuthRequestParameters"} + if s.ApiKeyName == nil { + invalidParams.Add(request.NewErrParamRequired("ApiKeyName")) + } + if s.ApiKeyName != nil && len(*s.ApiKeyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApiKeyName", 1)) + } + if s.ApiKeyValue == nil { + invalidParams.Add(request.NewErrParamRequired("ApiKeyValue")) + } + if s.ApiKeyValue != nil && len(*s.ApiKeyValue) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApiKeyValue", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApiKeyName sets the ApiKeyName field's value. +func (s *CreateConnectionApiKeyAuthRequestParameters) SetApiKeyName(v string) *CreateConnectionApiKeyAuthRequestParameters { + s.ApiKeyName = &v + return s +} + +// SetApiKeyValue sets the ApiKeyValue field's value. +func (s *CreateConnectionApiKeyAuthRequestParameters) SetApiKeyValue(v string) *CreateConnectionApiKeyAuthRequestParameters { + s.ApiKeyValue = &v + return s +} + +// Contains the authorization parameters for the connection. +type CreateConnectionAuthRequestParameters struct { + _ struct{} `type:"structure"` + + // A CreateConnectionApiKeyAuthRequestParameters object that contains the API + // key authorization parameters to use for the connection. + ApiKeyAuthParameters *CreateConnectionApiKeyAuthRequestParameters `type:"structure"` + + // A CreateConnectionBasicAuthRequestParameters object that contains the Basic + // authorization parameters to use for the connection. + BasicAuthParameters *CreateConnectionBasicAuthRequestParameters `type:"structure"` + + // A ConnectionHttpParameters object that contains the API key authorization + // parameters to use for the connection. Note that if you include additional + // parameters for the target of a rule via HttpParameters, including query strings, + // the parameters added for the connection take precedence. + InvocationHttpParameters *ConnectionHttpParameters `type:"structure"` + + // A CreateConnectionOAuthRequestParameters object that contains the OAuth authorization + // parameters to use for the connection. + OAuthParameters *CreateConnectionOAuthRequestParameters `type:"structure"` +} + +// String returns the string representation +func (s CreateConnectionAuthRequestParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateConnectionAuthRequestParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateConnectionAuthRequestParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateConnectionAuthRequestParameters"} + if s.ApiKeyAuthParameters != nil { + if err := s.ApiKeyAuthParameters.Validate(); err != nil { + invalidParams.AddNested("ApiKeyAuthParameters", err.(request.ErrInvalidParams)) + } + } + if s.BasicAuthParameters != nil { + if err := s.BasicAuthParameters.Validate(); err != nil { + invalidParams.AddNested("BasicAuthParameters", err.(request.ErrInvalidParams)) + } + } + if s.OAuthParameters != nil { + if err := s.OAuthParameters.Validate(); err != nil { + invalidParams.AddNested("OAuthParameters", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApiKeyAuthParameters sets the ApiKeyAuthParameters field's value. +func (s *CreateConnectionAuthRequestParameters) SetApiKeyAuthParameters(v *CreateConnectionApiKeyAuthRequestParameters) *CreateConnectionAuthRequestParameters { + s.ApiKeyAuthParameters = v + return s +} + +// SetBasicAuthParameters sets the BasicAuthParameters field's value. +func (s *CreateConnectionAuthRequestParameters) SetBasicAuthParameters(v *CreateConnectionBasicAuthRequestParameters) *CreateConnectionAuthRequestParameters { + s.BasicAuthParameters = v + return s +} + +// SetInvocationHttpParameters sets the InvocationHttpParameters field's value. +func (s *CreateConnectionAuthRequestParameters) SetInvocationHttpParameters(v *ConnectionHttpParameters) *CreateConnectionAuthRequestParameters { + s.InvocationHttpParameters = v + return s +} + +// SetOAuthParameters sets the OAuthParameters field's value. +func (s *CreateConnectionAuthRequestParameters) SetOAuthParameters(v *CreateConnectionOAuthRequestParameters) *CreateConnectionAuthRequestParameters { + s.OAuthParameters = v + return s +} + +// Contains the Basic authorization parameters to use for the connection. +type CreateConnectionBasicAuthRequestParameters struct { + _ struct{} `type:"structure"` + + // The password associated with the user name to use for Basic authorization. + // + // Password is a required field + Password *string `min:"1" type:"string" required:"true"` + + // The user name to use for Basic authorization. + // + // Username is a required field + Username *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateConnectionBasicAuthRequestParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateConnectionBasicAuthRequestParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateConnectionBasicAuthRequestParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateConnectionBasicAuthRequestParameters"} + if s.Password == nil { + invalidParams.Add(request.NewErrParamRequired("Password")) + } + if s.Password != nil && len(*s.Password) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Password", 1)) + } + if s.Username == nil { + invalidParams.Add(request.NewErrParamRequired("Username")) + } + if s.Username != nil && len(*s.Username) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Username", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPassword sets the Password field's value. +func (s *CreateConnectionBasicAuthRequestParameters) SetPassword(v string) *CreateConnectionBasicAuthRequestParameters { + s.Password = &v + return s +} + +// SetUsername sets the Username field's value. +func (s *CreateConnectionBasicAuthRequestParameters) SetUsername(v string) *CreateConnectionBasicAuthRequestParameters { + s.Username = &v + return s +} + +type CreateConnectionInput struct { + _ struct{} `type:"structure"` + + // A CreateConnectionAuthRequestParameters object that contains the authorization + // parameters to use to authorize with the endpoint. + // + // AuthParameters is a required field + AuthParameters *CreateConnectionAuthRequestParameters `type:"structure" required:"true"` + + // The type of authorization to use for the connection. + // + // AuthorizationType is a required field + AuthorizationType *string `type:"string" required:"true" enum:"ConnectionAuthorizationType"` + + // A description for the connection to create. + Description *string `type:"string"` + + // The name for the connection to create. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateConnectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateConnectionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateConnectionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateConnectionInput"} + if s.AuthParameters == nil { + invalidParams.Add(request.NewErrParamRequired("AuthParameters")) + } + if s.AuthorizationType == nil { + invalidParams.Add(request.NewErrParamRequired("AuthorizationType")) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.AuthParameters != nil { + if err := s.AuthParameters.Validate(); err != nil { + invalidParams.AddNested("AuthParameters", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuthParameters sets the AuthParameters field's value. +func (s *CreateConnectionInput) SetAuthParameters(v *CreateConnectionAuthRequestParameters) *CreateConnectionInput { + s.AuthParameters = v + return s +} + +// SetAuthorizationType sets the AuthorizationType field's value. +func (s *CreateConnectionInput) SetAuthorizationType(v string) *CreateConnectionInput { + s.AuthorizationType = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateConnectionInput) SetDescription(v string) *CreateConnectionInput { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateConnectionInput) SetName(v string) *CreateConnectionInput { + s.Name = &v + return s +} + +// Contains the Basic authorization parameters to use for the connection. +type CreateConnectionOAuthClientRequestParameters struct { + _ struct{} `type:"structure"` + + // The client ID to use for OAuth authorization for the connection. + // + // ClientID is a required field + ClientID *string `min:"1" type:"string" required:"true"` + + // The client secret associated with the client ID to use for OAuth authorization + // for the connection. + // + // ClientSecret is a required field + ClientSecret *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateConnectionOAuthClientRequestParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateConnectionOAuthClientRequestParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateConnectionOAuthClientRequestParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateConnectionOAuthClientRequestParameters"} + if s.ClientID == nil { + invalidParams.Add(request.NewErrParamRequired("ClientID")) + } + if s.ClientID != nil && len(*s.ClientID) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientID", 1)) + } + if s.ClientSecret == nil { + invalidParams.Add(request.NewErrParamRequired("ClientSecret")) + } + if s.ClientSecret != nil && len(*s.ClientSecret) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientSecret", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientID sets the ClientID field's value. +func (s *CreateConnectionOAuthClientRequestParameters) SetClientID(v string) *CreateConnectionOAuthClientRequestParameters { + s.ClientID = &v + return s +} + +// SetClientSecret sets the ClientSecret field's value. +func (s *CreateConnectionOAuthClientRequestParameters) SetClientSecret(v string) *CreateConnectionOAuthClientRequestParameters { + s.ClientSecret = &v + return s +} + +// Contains the OAuth authorization parameters to use for the connection. +type CreateConnectionOAuthRequestParameters struct { + _ struct{} `type:"structure"` + + // The URL to the authorization endpoint when OAuth is specified as the authorization + // type. + // + // AuthorizationEndpoint is a required field + AuthorizationEndpoint *string `min:"1" type:"string" required:"true"` + + // A CreateConnectionOAuthClientRequestParameters object that contains the client + // parameters for OAuth authorization. + // + // ClientParameters is a required field + ClientParameters *CreateConnectionOAuthClientRequestParameters `type:"structure" required:"true"` + + // The method to use for the authorization request. + // + // HttpMethod is a required field + HttpMethod *string `type:"string" required:"true" enum:"ConnectionOAuthHttpMethod"` + + // A ConnectionHttpParameters object that contains details about the additional + // parameters to use for the connection. + OAuthHttpParameters *ConnectionHttpParameters `type:"structure"` +} + +// String returns the string representation +func (s CreateConnectionOAuthRequestParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateConnectionOAuthRequestParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateConnectionOAuthRequestParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateConnectionOAuthRequestParameters"} + if s.AuthorizationEndpoint == nil { + invalidParams.Add(request.NewErrParamRequired("AuthorizationEndpoint")) + } + if s.AuthorizationEndpoint != nil && len(*s.AuthorizationEndpoint) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AuthorizationEndpoint", 1)) + } + if s.ClientParameters == nil { + invalidParams.Add(request.NewErrParamRequired("ClientParameters")) + } + if s.HttpMethod == nil { + invalidParams.Add(request.NewErrParamRequired("HttpMethod")) + } + if s.ClientParameters != nil { + if err := s.ClientParameters.Validate(); err != nil { + invalidParams.AddNested("ClientParameters", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuthorizationEndpoint sets the AuthorizationEndpoint field's value. +func (s *CreateConnectionOAuthRequestParameters) SetAuthorizationEndpoint(v string) *CreateConnectionOAuthRequestParameters { + s.AuthorizationEndpoint = &v + return s +} + +// SetClientParameters sets the ClientParameters field's value. +func (s *CreateConnectionOAuthRequestParameters) SetClientParameters(v *CreateConnectionOAuthClientRequestParameters) *CreateConnectionOAuthRequestParameters { + s.ClientParameters = v + return s +} + +// SetHttpMethod sets the HttpMethod field's value. +func (s *CreateConnectionOAuthRequestParameters) SetHttpMethod(v string) *CreateConnectionOAuthRequestParameters { + s.HttpMethod = &v + return s +} + +// SetOAuthHttpParameters sets the OAuthHttpParameters field's value. +func (s *CreateConnectionOAuthRequestParameters) SetOAuthHttpParameters(v *ConnectionHttpParameters) *CreateConnectionOAuthRequestParameters { + s.OAuthHttpParameters = v + return s +} + +type CreateConnectionOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the connection that was created by the request. + ConnectionArn *string `min:"1" type:"string"` + + // The state of the connection that was created by the request. + ConnectionState *string `type:"string" enum:"ConnectionState"` + + // A time stamp for the time that the connection was created. + CreationTime *time.Time `type:"timestamp"` + + // A time stamp for the time that the connection was last updated. + LastModifiedTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s CreateConnectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateConnectionOutput) GoString() string { + return s.String() +} + +// SetConnectionArn sets the ConnectionArn field's value. +func (s *CreateConnectionOutput) SetConnectionArn(v string) *CreateConnectionOutput { + s.ConnectionArn = &v + return s +} + +// SetConnectionState sets the ConnectionState field's value. +func (s *CreateConnectionOutput) SetConnectionState(v string) *CreateConnectionOutput { + s.ConnectionState = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *CreateConnectionOutput) SetCreationTime(v time.Time) *CreateConnectionOutput { + s.CreationTime = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *CreateConnectionOutput) SetLastModifiedTime(v time.Time) *CreateConnectionOutput { + s.LastModifiedTime = &v + return s +} + +type CreateEventBusInput struct { + _ struct{} `type:"structure"` + + // If you are creating a partner event bus, this specifies the partner event + // source that the new event bus will be matched with. + EventSourceName *string `min:"1" type:"string"` + + // The name of the new event bus. + // + // Event bus names cannot contain the / character. You can't use the name default + // for a custom event bus, as this name is already used for your account's default + // event bus. + // + // If this is a partner event bus, the name must exactly match the name of the + // partner event source that this event bus is matched to. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // Tags to associate with the event bus. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s CreateEventBusInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateEventBusInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateEventBusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateEventBusInput"} + if s.EventSourceName != nil && len(*s.EventSourceName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventSourceName", 1)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.Tags != nil { + for i, v := range s.Tags { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventSourceName sets the EventSourceName field's value. +func (s *CreateEventBusInput) SetEventSourceName(v string) *CreateEventBusInput { + s.EventSourceName = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateEventBusInput) SetName(v string) *CreateEventBusInput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateEventBusInput) SetTags(v []*Tag) *CreateEventBusInput { + s.Tags = v + return s +} + +type CreateEventBusOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the new event bus. + EventBusArn *string `type:"string"` +} + +// String returns the string representation +func (s CreateEventBusOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateEventBusOutput) GoString() string { + return s.String() +} + +// SetEventBusArn sets the EventBusArn field's value. +func (s *CreateEventBusOutput) SetEventBusArn(v string) *CreateEventBusOutput { + s.EventBusArn = &v + return s +} + +type CreatePartnerEventSourceInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID that is permitted to create a matching partner event bus + // for this partner event source. + // + // Account is a required field + Account *string `min:"12" type:"string" required:"true"` + + // The name of the partner event source. This name must be unique and must be + // in the format partner_name/event_namespace/event_name . The AWS account that + // wants to use this partner event source must create a partner event bus with + // a name that matches the name of the partner event source. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreatePartnerEventSourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePartnerEventSourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreatePartnerEventSourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreatePartnerEventSourceInput"} + if s.Account == nil { + invalidParams.Add(request.NewErrParamRequired("Account")) + } + if s.Account != nil && len(*s.Account) < 12 { + invalidParams.Add(request.NewErrParamMinLen("Account", 12)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccount sets the Account field's value. +func (s *CreatePartnerEventSourceInput) SetAccount(v string) *CreatePartnerEventSourceInput { + s.Account = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreatePartnerEventSourceInput) SetName(v string) *CreatePartnerEventSourceInput { + s.Name = &v + return s +} + +type CreatePartnerEventSourceOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the partner event source. + EventSourceArn *string `type:"string"` +} + +// String returns the string representation +func (s CreatePartnerEventSourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePartnerEventSourceOutput) GoString() string { + return s.String() +} + +// SetEventSourceArn sets the EventSourceArn field's value. +func (s *CreatePartnerEventSourceOutput) SetEventSourceArn(v string) *CreatePartnerEventSourceOutput { + s.EventSourceArn = &v + return s +} + +type DeactivateEventSourceInput struct { + _ struct{} `type:"structure"` + + // The name of the partner event source to deactivate. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeactivateEventSourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeactivateEventSourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeactivateEventSourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeactivateEventSourceInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DeactivateEventSourceInput) SetName(v string) *DeactivateEventSourceInput { + s.Name = &v + return s +} + +type DeactivateEventSourceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeactivateEventSourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeactivateEventSourceOutput) GoString() string { + return s.String() +} + +// A DeadLetterConfig object that contains information about a dead-letter queue +// configuration. +type DeadLetterConfig struct { + _ struct{} `type:"structure"` + + // The ARN of the SQS queue specified as the target for the dead-letter queue. + Arn *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DeadLetterConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeadLetterConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeadLetterConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeadLetterConfig"} + if s.Arn != nil && len(*s.Arn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *DeadLetterConfig) SetArn(v string) *DeadLetterConfig { + s.Arn = &v + return s +} + +type DeauthorizeConnectionInput struct { + _ struct{} `type:"structure"` + + // The name of the connection to remove authorization from. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeauthorizeConnectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeauthorizeConnectionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeauthorizeConnectionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeauthorizeConnectionInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DeauthorizeConnectionInput) SetName(v string) *DeauthorizeConnectionInput { + s.Name = &v + return s +} + +type DeauthorizeConnectionOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the connection that authorization was removed from. + ConnectionArn *string `min:"1" type:"string"` + + // The state of the connection. + ConnectionState *string `type:"string" enum:"ConnectionState"` + + // A time stamp for the time that the connection was created. + CreationTime *time.Time `type:"timestamp"` + + // A time stamp for the time that the connection was last authorized. + LastAuthorizedTime *time.Time `type:"timestamp"` + + // A time stamp for the time that the connection was last updated. + LastModifiedTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s DeauthorizeConnectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeauthorizeConnectionOutput) GoString() string { + return s.String() +} + +// SetConnectionArn sets the ConnectionArn field's value. +func (s *DeauthorizeConnectionOutput) SetConnectionArn(v string) *DeauthorizeConnectionOutput { + s.ConnectionArn = &v + return s +} + +// SetConnectionState sets the ConnectionState field's value. +func (s *DeauthorizeConnectionOutput) SetConnectionState(v string) *DeauthorizeConnectionOutput { + s.ConnectionState = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DeauthorizeConnectionOutput) SetCreationTime(v time.Time) *DeauthorizeConnectionOutput { + s.CreationTime = &v + return s +} + +// SetLastAuthorizedTime sets the LastAuthorizedTime field's value. +func (s *DeauthorizeConnectionOutput) SetLastAuthorizedTime(v time.Time) *DeauthorizeConnectionOutput { + s.LastAuthorizedTime = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DeauthorizeConnectionOutput) SetLastModifiedTime(v time.Time) *DeauthorizeConnectionOutput { + s.LastModifiedTime = &v + return s +} + +type DeleteApiDestinationInput struct { + _ struct{} `type:"structure"` + + // The name of the destination to delete. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteApiDestinationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteApiDestinationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteApiDestinationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteApiDestinationInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DeleteApiDestinationInput) SetName(v string) *DeleteApiDestinationInput { + s.Name = &v + return s +} + +type DeleteApiDestinationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteApiDestinationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteApiDestinationOutput) GoString() string { + return s.String() +} + +type DeleteArchiveInput struct { + _ struct{} `type:"structure"` + + // The name of the archive to delete. + // + // ArchiveName is a required field + ArchiveName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteArchiveInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteArchiveInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteArchiveInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteArchiveInput"} + if s.ArchiveName == nil { + invalidParams.Add(request.NewErrParamRequired("ArchiveName")) + } + if s.ArchiveName != nil && len(*s.ArchiveName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ArchiveName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArchiveName sets the ArchiveName field's value. +func (s *DeleteArchiveInput) SetArchiveName(v string) *DeleteArchiveInput { + s.ArchiveName = &v + return s +} + +type DeleteArchiveOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteArchiveOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteArchiveOutput) GoString() string { + return s.String() +} + +type DeleteConnectionInput struct { + _ struct{} `type:"structure"` + + // The name of the connection to delete. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteConnectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteConnectionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteConnectionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteConnectionInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DeleteConnectionInput) SetName(v string) *DeleteConnectionInput { + s.Name = &v + return s +} + +type DeleteConnectionOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the connection that was deleted. + ConnectionArn *string `min:"1" type:"string"` + + // The state of the connection before it was deleted. + ConnectionState *string `type:"string" enum:"ConnectionState"` + + // A time stamp for the time that the connection was created. + CreationTime *time.Time `type:"timestamp"` + + // A time stamp for the time that the connection was last authorized before + // it wa deleted. + LastAuthorizedTime *time.Time `type:"timestamp"` + + // A time stamp for the time that the connection was last modified before it + // was deleted. + LastModifiedTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s DeleteConnectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteConnectionOutput) GoString() string { + return s.String() +} + +// SetConnectionArn sets the ConnectionArn field's value. +func (s *DeleteConnectionOutput) SetConnectionArn(v string) *DeleteConnectionOutput { + s.ConnectionArn = &v + return s +} + +// SetConnectionState sets the ConnectionState field's value. +func (s *DeleteConnectionOutput) SetConnectionState(v string) *DeleteConnectionOutput { + s.ConnectionState = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DeleteConnectionOutput) SetCreationTime(v time.Time) *DeleteConnectionOutput { + s.CreationTime = &v + return s +} + +// SetLastAuthorizedTime sets the LastAuthorizedTime field's value. +func (s *DeleteConnectionOutput) SetLastAuthorizedTime(v time.Time) *DeleteConnectionOutput { + s.LastAuthorizedTime = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DeleteConnectionOutput) SetLastModifiedTime(v time.Time) *DeleteConnectionOutput { + s.LastModifiedTime = &v + return s +} + +type DeleteEventBusInput struct { + _ struct{} `type:"structure"` + + // The name of the event bus to delete. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteEventBusInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteEventBusInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteEventBusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteEventBusInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DeleteEventBusInput) SetName(v string) *DeleteEventBusInput { + s.Name = &v + return s +} + +type DeleteEventBusOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteEventBusOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteEventBusOutput) GoString() string { + return s.String() +} + +type DeletePartnerEventSourceInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID of the AWS customer that the event source was created + // for. + // + // Account is a required field + Account *string `min:"12" type:"string" required:"true"` + + // The name of the event source to delete. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeletePartnerEventSourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePartnerEventSourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeletePartnerEventSourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeletePartnerEventSourceInput"} + if s.Account == nil { + invalidParams.Add(request.NewErrParamRequired("Account")) + } + if s.Account != nil && len(*s.Account) < 12 { + invalidParams.Add(request.NewErrParamMinLen("Account", 12)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccount sets the Account field's value. +func (s *DeletePartnerEventSourceInput) SetAccount(v string) *DeletePartnerEventSourceInput { + s.Account = &v + return s +} + +// SetName sets the Name field's value. +func (s *DeletePartnerEventSourceInput) SetName(v string) *DeletePartnerEventSourceInput { + s.Name = &v + return s +} + +type DeletePartnerEventSourceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeletePartnerEventSourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePartnerEventSourceOutput) GoString() string { + return s.String() +} + +type DeleteRuleInput struct { + _ struct{} `type:"structure"` + + // The name or ARN of the event bus associated with the rule. If you omit this, + // the default event bus is used. + EventBusName *string `min:"1" type:"string"` + + // If this is a managed rule, created by an AWS service on your behalf, you + // must specify Force as True to delete the rule. This parameter is ignored + // for rules that are not managed rules. You can check whether a rule is a managed + // rule by using DescribeRule or ListRules and checking the ManagedBy field + // of the response. + Force *bool `type:"boolean"` + + // The name of the rule. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteRuleInput"} + if s.EventBusName != nil && len(*s.EventBusName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventBusName", 1)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventBusName sets the EventBusName field's value. +func (s *DeleteRuleInput) SetEventBusName(v string) *DeleteRuleInput { + s.EventBusName = &v + return s +} + +// SetForce sets the Force field's value. +func (s *DeleteRuleInput) SetForce(v bool) *DeleteRuleInput { + s.Force = &v + return s +} + +// SetName sets the Name field's value. +func (s *DeleteRuleInput) SetName(v string) *DeleteRuleInput { + s.Name = &v + return s +} + +type DeleteRuleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRuleOutput) GoString() string { + return s.String() +} + +type DescribeApiDestinationInput struct { + _ struct{} `type:"structure"` + + // The name of the API destination to retrieve. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeApiDestinationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeApiDestinationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeApiDestinationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeApiDestinationInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DescribeApiDestinationInput) SetName(v string) *DescribeApiDestinationInput { + s.Name = &v + return s +} + +type DescribeApiDestinationOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the API destination retrieved. + ApiDestinationArn *string `min:"1" type:"string"` + + // The state of the API destination retrieved. + ApiDestinationState *string `type:"string" enum:"ApiDestinationState"` + + // The ARN of the connection specified for the API destination retrieved. + ConnectionArn *string `min:"1" type:"string"` + + // A time stamp for the time that the API destination was created. + CreationTime *time.Time `type:"timestamp"` + + // The description for the API destination retrieved. + Description *string `type:"string"` + + // The method to use to connect to the HTTP endpoint. + HttpMethod *string `type:"string" enum:"ApiDestinationHttpMethod"` + + // The URL to use to connect to the HTTP endpoint. + InvocationEndpoint *string `min:"1" type:"string"` + + // The maximum number of invocations per second to specified for the API destination. + // Note that if you set the invocation rate maximum to a value lower the rate + // necessary to send all events received on to the destination HTTP endpoint, + // some events may not be delivered within the 24-hour retry window. If you + // plan to set the rate lower than the rate necessary to deliver all events, + // consider using a dead-letter queue to catch events that are not delivered + // within 24 hours. + InvocationRateLimitPerSecond *int64 `min:"1" type:"integer"` + + // A time stamp for the time that the API destination was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The name of the API destination retrieved. + Name *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DescribeApiDestinationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeApiDestinationOutput) GoString() string { + return s.String() +} + +// SetApiDestinationArn sets the ApiDestinationArn field's value. +func (s *DescribeApiDestinationOutput) SetApiDestinationArn(v string) *DescribeApiDestinationOutput { + s.ApiDestinationArn = &v + return s +} + +// SetApiDestinationState sets the ApiDestinationState field's value. +func (s *DescribeApiDestinationOutput) SetApiDestinationState(v string) *DescribeApiDestinationOutput { + s.ApiDestinationState = &v + return s +} + +// SetConnectionArn sets the ConnectionArn field's value. +func (s *DescribeApiDestinationOutput) SetConnectionArn(v string) *DescribeApiDestinationOutput { + s.ConnectionArn = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeApiDestinationOutput) SetCreationTime(v time.Time) *DescribeApiDestinationOutput { + s.CreationTime = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *DescribeApiDestinationOutput) SetDescription(v string) *DescribeApiDestinationOutput { + s.Description = &v + return s +} + +// SetHttpMethod sets the HttpMethod field's value. +func (s *DescribeApiDestinationOutput) SetHttpMethod(v string) *DescribeApiDestinationOutput { + s.HttpMethod = &v + return s +} + +// SetInvocationEndpoint sets the InvocationEndpoint field's value. +func (s *DescribeApiDestinationOutput) SetInvocationEndpoint(v string) *DescribeApiDestinationOutput { + s.InvocationEndpoint = &v + return s +} + +// SetInvocationRateLimitPerSecond sets the InvocationRateLimitPerSecond field's value. +func (s *DescribeApiDestinationOutput) SetInvocationRateLimitPerSecond(v int64) *DescribeApiDestinationOutput { + s.InvocationRateLimitPerSecond = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeApiDestinationOutput) SetLastModifiedTime(v time.Time) *DescribeApiDestinationOutput { + s.LastModifiedTime = &v + return s +} + +// SetName sets the Name field's value. +func (s *DescribeApiDestinationOutput) SetName(v string) *DescribeApiDestinationOutput { + s.Name = &v + return s +} + +type DescribeArchiveInput struct { + _ struct{} `type:"structure"` + + // The name of the archive to retrieve. + // + // ArchiveName is a required field + ArchiveName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeArchiveInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeArchiveInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeArchiveInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeArchiveInput"} + if s.ArchiveName == nil { + invalidParams.Add(request.NewErrParamRequired("ArchiveName")) + } + if s.ArchiveName != nil && len(*s.ArchiveName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ArchiveName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArchiveName sets the ArchiveName field's value. +func (s *DescribeArchiveInput) SetArchiveName(v string) *DescribeArchiveInput { + s.ArchiveName = &v + return s +} + +type DescribeArchiveOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the archive. + ArchiveArn *string `min:"1" type:"string"` + + // The name of the archive. + ArchiveName *string `min:"1" type:"string"` + + // The time at which the archive was created. + CreationTime *time.Time `type:"timestamp"` + + // The description of the archive. + Description *string `type:"string"` + + // The number of events in the archive. + EventCount *int64 `type:"long"` + + // The event pattern used to filter events sent to the archive. + EventPattern *string `type:"string"` + + // The ARN of the event source associated with the archive. + EventSourceArn *string `min:"1" type:"string"` + + // The number of days to retain events for in the archive. + RetentionDays *int64 `type:"integer"` + + // The size of the archive in bytes. + SizeBytes *int64 `type:"long"` + + // The state of the archive. + State *string `type:"string" enum:"ArchiveState"` + + // The reason that the archive is in the state. + StateReason *string `type:"string"` +} + +// String returns the string representation +func (s DescribeArchiveOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeArchiveOutput) GoString() string { + return s.String() +} + +// SetArchiveArn sets the ArchiveArn field's value. +func (s *DescribeArchiveOutput) SetArchiveArn(v string) *DescribeArchiveOutput { + s.ArchiveArn = &v + return s +} + +// SetArchiveName sets the ArchiveName field's value. +func (s *DescribeArchiveOutput) SetArchiveName(v string) *DescribeArchiveOutput { + s.ArchiveName = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeArchiveOutput) SetCreationTime(v time.Time) *DescribeArchiveOutput { + s.CreationTime = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *DescribeArchiveOutput) SetDescription(v string) *DescribeArchiveOutput { + s.Description = &v + return s +} + +// SetEventCount sets the EventCount field's value. +func (s *DescribeArchiveOutput) SetEventCount(v int64) *DescribeArchiveOutput { + s.EventCount = &v + return s +} + +// SetEventPattern sets the EventPattern field's value. +func (s *DescribeArchiveOutput) SetEventPattern(v string) *DescribeArchiveOutput { + s.EventPattern = &v + return s +} + +// SetEventSourceArn sets the EventSourceArn field's value. +func (s *DescribeArchiveOutput) SetEventSourceArn(v string) *DescribeArchiveOutput { + s.EventSourceArn = &v + return s +} + +// SetRetentionDays sets the RetentionDays field's value. +func (s *DescribeArchiveOutput) SetRetentionDays(v int64) *DescribeArchiveOutput { + s.RetentionDays = &v + return s +} + +// SetSizeBytes sets the SizeBytes field's value. +func (s *DescribeArchiveOutput) SetSizeBytes(v int64) *DescribeArchiveOutput { + s.SizeBytes = &v + return s +} + +// SetState sets the State field's value. +func (s *DescribeArchiveOutput) SetState(v string) *DescribeArchiveOutput { + s.State = &v + return s +} + +// SetStateReason sets the StateReason field's value. +func (s *DescribeArchiveOutput) SetStateReason(v string) *DescribeArchiveOutput { + s.StateReason = &v + return s +} + +type DescribeConnectionInput struct { + _ struct{} `type:"structure"` + + // The name of the connection to retrieve. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeConnectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeConnectionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeConnectionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeConnectionInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DescribeConnectionInput) SetName(v string) *DescribeConnectionInput { + s.Name = &v + return s +} + +type DescribeConnectionOutput struct { + _ struct{} `type:"structure"` + + // The parameters to use for authorization for the connection. + AuthParameters *ConnectionAuthResponseParameters `type:"structure"` + + // The type of authorization specified for the connection. + AuthorizationType *string `type:"string" enum:"ConnectionAuthorizationType"` + + // The ARN of the connection retrieved. + ConnectionArn *string `min:"1" type:"string"` + + // The state of the connection retrieved. + ConnectionState *string `type:"string" enum:"ConnectionState"` + + // A time stamp for the time that the connection was created. + CreationTime *time.Time `type:"timestamp"` + + // The description for the connection retrieved. + Description *string `type:"string"` + + // A time stamp for the time that the connection was last authorized. + LastAuthorizedTime *time.Time `type:"timestamp"` + + // A time stamp for the time that the connection was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The name of the connection retrieved. + Name *string `min:"1" type:"string"` + + // The ARN of the secret created from the authorization parameters specified + // for the connection. + SecretArn *string `min:"20" type:"string"` + + // The reason that the connection is in the current connection state. + StateReason *string `type:"string"` +} + +// String returns the string representation +func (s DescribeConnectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeConnectionOutput) GoString() string { + return s.String() +} + +// SetAuthParameters sets the AuthParameters field's value. +func (s *DescribeConnectionOutput) SetAuthParameters(v *ConnectionAuthResponseParameters) *DescribeConnectionOutput { + s.AuthParameters = v + return s +} + +// SetAuthorizationType sets the AuthorizationType field's value. +func (s *DescribeConnectionOutput) SetAuthorizationType(v string) *DescribeConnectionOutput { + s.AuthorizationType = &v + return s +} + +// SetConnectionArn sets the ConnectionArn field's value. +func (s *DescribeConnectionOutput) SetConnectionArn(v string) *DescribeConnectionOutput { + s.ConnectionArn = &v + return s +} + +// SetConnectionState sets the ConnectionState field's value. +func (s *DescribeConnectionOutput) SetConnectionState(v string) *DescribeConnectionOutput { + s.ConnectionState = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeConnectionOutput) SetCreationTime(v time.Time) *DescribeConnectionOutput { + s.CreationTime = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *DescribeConnectionOutput) SetDescription(v string) *DescribeConnectionOutput { + s.Description = &v + return s +} + +// SetLastAuthorizedTime sets the LastAuthorizedTime field's value. +func (s *DescribeConnectionOutput) SetLastAuthorizedTime(v time.Time) *DescribeConnectionOutput { + s.LastAuthorizedTime = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeConnectionOutput) SetLastModifiedTime(v time.Time) *DescribeConnectionOutput { + s.LastModifiedTime = &v + return s +} + +// SetName sets the Name field's value. +func (s *DescribeConnectionOutput) SetName(v string) *DescribeConnectionOutput { + s.Name = &v + return s +} + +// SetSecretArn sets the SecretArn field's value. +func (s *DescribeConnectionOutput) SetSecretArn(v string) *DescribeConnectionOutput { + s.SecretArn = &v + return s +} + +// SetStateReason sets the StateReason field's value. +func (s *DescribeConnectionOutput) SetStateReason(v string) *DescribeConnectionOutput { + s.StateReason = &v + return s +} + +type DescribeEventBusInput struct { + _ struct{} `type:"structure"` + + // The name or ARN of the event bus to show details for. If you omit this, the + // default event bus is displayed. + Name *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DescribeEventBusInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeEventBusInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeEventBusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeEventBusInput"} + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DescribeEventBusInput) SetName(v string) *DescribeEventBusInput { + s.Name = &v + return s +} + +type DescribeEventBusOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the account permitted to write events to + // the current account. + Arn *string `type:"string"` + + // The name of the event bus. Currently, this is always default. + Name *string `type:"string"` + + // The policy that enables the external account to send events to your account. + Policy *string `type:"string"` +} + +// String returns the string representation +func (s DescribeEventBusOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeEventBusOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DescribeEventBusOutput) SetArn(v string) *DescribeEventBusOutput { + s.Arn = &v + return s +} + +// SetName sets the Name field's value. +func (s *DescribeEventBusOutput) SetName(v string) *DescribeEventBusOutput { + s.Name = &v + return s +} + +// SetPolicy sets the Policy field's value. +func (s *DescribeEventBusOutput) SetPolicy(v string) *DescribeEventBusOutput { + s.Policy = &v + return s +} + +type DescribeEventSourceInput struct { + _ struct{} `type:"structure"` + + // The name of the partner event source to display the details of. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeEventSourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeEventSourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeEventSourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeEventSourceInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DescribeEventSourceInput) SetName(v string) *DescribeEventSourceInput { + s.Name = &v + return s +} + +type DescribeEventSourceOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the partner event source. + Arn *string `type:"string"` + + // The name of the SaaS partner that created the event source. + CreatedBy *string `type:"string"` + + // The date and time that the event source was created. + CreationTime *time.Time `type:"timestamp"` + + // The date and time that the event source will expire if you do not create + // a matching event bus. + ExpirationTime *time.Time `type:"timestamp"` + + // The name of the partner event source. + Name *string `type:"string"` + + // The state of the event source. If it is ACTIVE, you have already created + // a matching event bus for this event source, and that event bus is active. + // If it is PENDING, either you haven't yet created a matching event bus, or + // that event bus is deactivated. If it is DELETED, you have created a matching + // event bus, but the event source has since been deleted. + State *string `type:"string" enum:"EventSourceState"` +} + +// String returns the string representation +func (s DescribeEventSourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeEventSourceOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DescribeEventSourceOutput) SetArn(v string) *DescribeEventSourceOutput { + s.Arn = &v + return s +} + +// SetCreatedBy sets the CreatedBy field's value. +func (s *DescribeEventSourceOutput) SetCreatedBy(v string) *DescribeEventSourceOutput { + s.CreatedBy = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeEventSourceOutput) SetCreationTime(v time.Time) *DescribeEventSourceOutput { + s.CreationTime = &v + return s +} + +// SetExpirationTime sets the ExpirationTime field's value. +func (s *DescribeEventSourceOutput) SetExpirationTime(v time.Time) *DescribeEventSourceOutput { + s.ExpirationTime = &v + return s +} + +// SetName sets the Name field's value. +func (s *DescribeEventSourceOutput) SetName(v string) *DescribeEventSourceOutput { + s.Name = &v + return s +} + +// SetState sets the State field's value. +func (s *DescribeEventSourceOutput) SetState(v string) *DescribeEventSourceOutput { + s.State = &v + return s +} + +type DescribePartnerEventSourceInput struct { + _ struct{} `type:"structure"` + + // The name of the event source to display. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribePartnerEventSourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribePartnerEventSourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribePartnerEventSourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribePartnerEventSourceInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DescribePartnerEventSourceInput) SetName(v string) *DescribePartnerEventSourceInput { + s.Name = &v + return s +} + +type DescribePartnerEventSourceOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the event source. + Arn *string `type:"string"` + + // The name of the event source. + Name *string `type:"string"` +} + +// String returns the string representation +func (s DescribePartnerEventSourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribePartnerEventSourceOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DescribePartnerEventSourceOutput) SetArn(v string) *DescribePartnerEventSourceOutput { + s.Arn = &v + return s +} + +// SetName sets the Name field's value. +func (s *DescribePartnerEventSourceOutput) SetName(v string) *DescribePartnerEventSourceOutput { + s.Name = &v + return s +} + +type DescribeReplayInput struct { + _ struct{} `type:"structure"` + + // The name of the replay to retrieve. + // + // ReplayName is a required field + ReplayName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeReplayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeReplayInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeReplayInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeReplayInput"} + if s.ReplayName == nil { + invalidParams.Add(request.NewErrParamRequired("ReplayName")) + } + if s.ReplayName != nil && len(*s.ReplayName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ReplayName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetReplayName sets the ReplayName field's value. +func (s *DescribeReplayInput) SetReplayName(v string) *DescribeReplayInput { + s.ReplayName = &v + return s +} + +type DescribeReplayOutput struct { + _ struct{} `type:"structure"` + + // The description of the replay. + Description *string `type:"string"` + + // A ReplayDestination object that contains details about the replay. + Destination *ReplayDestination `type:"structure"` + + // The time stamp for the last event that was replayed from the archive. + EventEndTime *time.Time `type:"timestamp"` + + // The time that the event was last replayed. + EventLastReplayedTime *time.Time `type:"timestamp"` + + // The ARN of the archive events were replayed from. + EventSourceArn *string `min:"1" type:"string"` + + // The time stamp of the first event that was last replayed from the archive. + EventStartTime *time.Time `type:"timestamp"` + + // The ARN of the replay. + ReplayArn *string `min:"1" type:"string"` + + // A time stamp for the time that the replay stopped. + ReplayEndTime *time.Time `type:"timestamp"` + + // The name of the replay. + ReplayName *string `min:"1" type:"string"` + + // A time stamp for the time that the replay started. + ReplayStartTime *time.Time `type:"timestamp"` + + // The current state of the replay. + State *string `type:"string" enum:"ReplayState"` + + // The reason that the replay is in the current state. + StateReason *string `type:"string"` +} + +// String returns the string representation +func (s DescribeReplayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeReplayOutput) GoString() string { + return s.String() +} + +// SetDescription sets the Description field's value. +func (s *DescribeReplayOutput) SetDescription(v string) *DescribeReplayOutput { + s.Description = &v + return s +} + +// SetDestination sets the Destination field's value. +func (s *DescribeReplayOutput) SetDestination(v *ReplayDestination) *DescribeReplayOutput { + s.Destination = v + return s +} + +// SetEventEndTime sets the EventEndTime field's value. +func (s *DescribeReplayOutput) SetEventEndTime(v time.Time) *DescribeReplayOutput { + s.EventEndTime = &v + return s +} + +// SetEventLastReplayedTime sets the EventLastReplayedTime field's value. +func (s *DescribeReplayOutput) SetEventLastReplayedTime(v time.Time) *DescribeReplayOutput { + s.EventLastReplayedTime = &v + return s +} + +// SetEventSourceArn sets the EventSourceArn field's value. +func (s *DescribeReplayOutput) SetEventSourceArn(v string) *DescribeReplayOutput { + s.EventSourceArn = &v + return s +} + +// SetEventStartTime sets the EventStartTime field's value. +func (s *DescribeReplayOutput) SetEventStartTime(v time.Time) *DescribeReplayOutput { + s.EventStartTime = &v + return s +} + +// SetReplayArn sets the ReplayArn field's value. +func (s *DescribeReplayOutput) SetReplayArn(v string) *DescribeReplayOutput { + s.ReplayArn = &v + return s +} + +// SetReplayEndTime sets the ReplayEndTime field's value. +func (s *DescribeReplayOutput) SetReplayEndTime(v time.Time) *DescribeReplayOutput { + s.ReplayEndTime = &v + return s +} + +// SetReplayName sets the ReplayName field's value. +func (s *DescribeReplayOutput) SetReplayName(v string) *DescribeReplayOutput { + s.ReplayName = &v + return s +} + +// SetReplayStartTime sets the ReplayStartTime field's value. +func (s *DescribeReplayOutput) SetReplayStartTime(v time.Time) *DescribeReplayOutput { + s.ReplayStartTime = &v + return s +} + +// SetState sets the State field's value. +func (s *DescribeReplayOutput) SetState(v string) *DescribeReplayOutput { + s.State = &v + return s +} + +// SetStateReason sets the StateReason field's value. +func (s *DescribeReplayOutput) SetStateReason(v string) *DescribeReplayOutput { + s.StateReason = &v + return s +} + +type DescribeRuleInput struct { + _ struct{} `type:"structure"` + + // The name or ARN of the event bus associated with the rule. If you omit this, + // the default event bus is used. + EventBusName *string `min:"1" type:"string"` + + // The name of the rule. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeRuleInput"} + if s.EventBusName != nil && len(*s.EventBusName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventBusName", 1)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventBusName sets the EventBusName field's value. +func (s *DescribeRuleInput) SetEventBusName(v string) *DescribeRuleInput { + s.EventBusName = &v + return s +} + +// SetName sets the Name field's value. +func (s *DescribeRuleInput) SetName(v string) *DescribeRuleInput { + s.Name = &v + return s +} + +type DescribeRuleOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the rule. + Arn *string `min:"1" type:"string"` + + // The account ID of the user that created the rule. If you use PutRule to put + // a rule on an event bus in another account, the other account is the owner + // of the rule, and the rule ARN includes the account ID for that account. However, + // the value for CreatedBy is the account ID as the account that created the + // rule in the other account. + CreatedBy *string `min:"1" type:"string"` + + // The description of the rule. + Description *string `type:"string"` + + // The name of the event bus associated with the rule. + EventBusName *string `min:"1" type:"string"` + + // The event pattern. For more information, see Events and Event Patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) + // in the Amazon EventBridge User Guide. + EventPattern *string `type:"string"` + + // If this is a managed rule, created by an AWS service on your behalf, this + // field displays the principal name of the AWS service that created the rule. + ManagedBy *string `min:"1" type:"string"` + + // The name of the rule. + Name *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the IAM role associated with the rule. + RoleArn *string `min:"1" type:"string"` + + // The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)". + ScheduleExpression *string `type:"string"` + + // Specifies whether the rule is enabled or disabled. + State *string `type:"string" enum:"RuleState"` +} + +// String returns the string representation +func (s DescribeRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeRuleOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DescribeRuleOutput) SetArn(v string) *DescribeRuleOutput { + s.Arn = &v + return s +} + +// SetCreatedBy sets the CreatedBy field's value. +func (s *DescribeRuleOutput) SetCreatedBy(v string) *DescribeRuleOutput { + s.CreatedBy = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *DescribeRuleOutput) SetDescription(v string) *DescribeRuleOutput { + s.Description = &v + return s +} + +// SetEventBusName sets the EventBusName field's value. +func (s *DescribeRuleOutput) SetEventBusName(v string) *DescribeRuleOutput { + s.EventBusName = &v + return s +} + +// SetEventPattern sets the EventPattern field's value. +func (s *DescribeRuleOutput) SetEventPattern(v string) *DescribeRuleOutput { + s.EventPattern = &v + return s +} + +// SetManagedBy sets the ManagedBy field's value. +func (s *DescribeRuleOutput) SetManagedBy(v string) *DescribeRuleOutput { + s.ManagedBy = &v + return s +} + +// SetName sets the Name field's value. +func (s *DescribeRuleOutput) SetName(v string) *DescribeRuleOutput { + s.Name = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *DescribeRuleOutput) SetRoleArn(v string) *DescribeRuleOutput { + s.RoleArn = &v + return s +} + +// SetScheduleExpression sets the ScheduleExpression field's value. +func (s *DescribeRuleOutput) SetScheduleExpression(v string) *DescribeRuleOutput { + s.ScheduleExpression = &v + return s +} + +// SetState sets the State field's value. +func (s *DescribeRuleOutput) SetState(v string) *DescribeRuleOutput { + s.State = &v + return s +} + +type DisableRuleInput struct { + _ struct{} `type:"structure"` + + // The name or ARN of the event bus associated with the rule. If you omit this, + // the default event bus is used. + EventBusName *string `min:"1" type:"string"` + + // The name of the rule. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DisableRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisableRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisableRuleInput"} + if s.EventBusName != nil && len(*s.EventBusName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventBusName", 1)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventBusName sets the EventBusName field's value. +func (s *DisableRuleInput) SetEventBusName(v string) *DisableRuleInput { + s.EventBusName = &v + return s +} + +// SetName sets the Name field's value. +func (s *DisableRuleInput) SetName(v string) *DisableRuleInput { + s.Name = &v + return s +} + +type DisableRuleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DisableRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableRuleOutput) GoString() string { + return s.String() +} + +// The custom parameters to be used when the target is an Amazon ECS task. +type EcsParameters struct { + _ struct{} `type:"structure"` + + // Specifies an ECS task group for the task. The maximum length is 255 characters. + Group *string `type:"string"` + + // Specifies the launch type on which your task is running. The launch type + // that you specify here must match one of the launch type (compatibilities) + // of the target task. The FARGATE value is supported only in the Regions where + // AWS Fargate with Amazon ECS is supported. For more information, see AWS Fargate + // on Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS-Fargate.html) + // in the Amazon Elastic Container Service Developer Guide. + LaunchType *string `type:"string" enum:"LaunchType"` + + // Use this structure if the ECS task uses the awsvpc network mode. This structure + // specifies the VPC subnets and security groups associated with the task, and + // whether a public IP address is to be used. This structure is required if + // LaunchType is FARGATE because the awsvpc mode is required for Fargate tasks. + // + // If you specify NetworkConfiguration when the target ECS task does not use + // the awsvpc network mode, the task fails. + NetworkConfiguration *NetworkConfiguration `type:"structure"` + + // Specifies the platform version for the task. Specify only the numeric portion + // of the platform version, such as 1.1.0. + // + // This structure is used only if LaunchType is FARGATE. For more information + // about valid platform versions, see AWS Fargate Platform Versions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) + // in the Amazon Elastic Container Service Developer Guide. + PlatformVersion *string `type:"string"` + + // The number of tasks to create based on TaskDefinition. The default is 1. + TaskCount *int64 `min:"1" type:"integer"` + + // The ARN of the task definition to use if the event target is an Amazon ECS + // task. + // + // TaskDefinitionArn is a required field + TaskDefinitionArn *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s EcsParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EcsParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *EcsParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EcsParameters"} + if s.TaskCount != nil && *s.TaskCount < 1 { + invalidParams.Add(request.NewErrParamMinValue("TaskCount", 1)) + } + if s.TaskDefinitionArn == nil { + invalidParams.Add(request.NewErrParamRequired("TaskDefinitionArn")) + } + if s.TaskDefinitionArn != nil && len(*s.TaskDefinitionArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TaskDefinitionArn", 1)) + } + if s.NetworkConfiguration != nil { + if err := s.NetworkConfiguration.Validate(); err != nil { + invalidParams.AddNested("NetworkConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroup sets the Group field's value. +func (s *EcsParameters) SetGroup(v string) *EcsParameters { + s.Group = &v + return s +} + +// SetLaunchType sets the LaunchType field's value. +func (s *EcsParameters) SetLaunchType(v string) *EcsParameters { + s.LaunchType = &v + return s +} + +// SetNetworkConfiguration sets the NetworkConfiguration field's value. +func (s *EcsParameters) SetNetworkConfiguration(v *NetworkConfiguration) *EcsParameters { + s.NetworkConfiguration = v + return s +} + +// SetPlatformVersion sets the PlatformVersion field's value. +func (s *EcsParameters) SetPlatformVersion(v string) *EcsParameters { + s.PlatformVersion = &v + return s +} + +// SetTaskCount sets the TaskCount field's value. +func (s *EcsParameters) SetTaskCount(v int64) *EcsParameters { + s.TaskCount = &v + return s +} + +// SetTaskDefinitionArn sets the TaskDefinitionArn field's value. +func (s *EcsParameters) SetTaskDefinitionArn(v string) *EcsParameters { + s.TaskDefinitionArn = &v + return s +} + +type EnableRuleInput struct { + _ struct{} `type:"structure"` + + // The name or ARN of the event bus associated with the rule. If you omit this, + // the default event bus is used. + EventBusName *string `min:"1" type:"string"` + + // The name of the rule. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s EnableRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *EnableRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EnableRuleInput"} + if s.EventBusName != nil && len(*s.EventBusName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventBusName", 1)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventBusName sets the EventBusName field's value. +func (s *EnableRuleInput) SetEventBusName(v string) *EnableRuleInput { + s.EventBusName = &v + return s +} + +// SetName sets the Name field's value. +func (s *EnableRuleInput) SetName(v string) *EnableRuleInput { + s.Name = &v + return s +} + +type EnableRuleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s EnableRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableRuleOutput) GoString() string { + return s.String() +} + +// An event bus receives events from a source and routes them to rules associated +// with that event bus. Your account's default event bus receives rules from +// AWS services. A custom event bus can receive rules from AWS services as well +// as your custom applications and services. A partner event bus receives events +// from an event source created by an SaaS partner. These events come from the +// partners services or applications. +type EventBus struct { + _ struct{} `type:"structure"` + + // The ARN of the event bus. + Arn *string `type:"string"` + + // The name of the event bus. + Name *string `type:"string"` + + // The permissions policy of the event bus, describing which other AWS accounts + // can write events to this event bus. + Policy *string `type:"string"` +} + +// String returns the string representation +func (s EventBus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EventBus) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *EventBus) SetArn(v string) *EventBus { + s.Arn = &v + return s +} + +// SetName sets the Name field's value. +func (s *EventBus) SetName(v string) *EventBus { + s.Name = &v + return s +} + +// SetPolicy sets the Policy field's value. +func (s *EventBus) SetPolicy(v string) *EventBus { + s.Policy = &v + return s +} + +// A partner event source is created by an SaaS partner. If a customer creates +// a partner event bus that matches this event source, that AWS account can +// receive events from the partner's applications or services. +type EventSource struct { + _ struct{} `type:"structure"` + + // The ARN of the event source. + Arn *string `type:"string"` + + // The name of the partner that created the event source. + CreatedBy *string `type:"string"` + + // The date and time the event source was created. + CreationTime *time.Time `type:"timestamp"` + + // The date and time that the event source will expire, if the AWS account doesn't + // create a matching event bus for it. + ExpirationTime *time.Time `type:"timestamp"` + + // The name of the event source. + Name *string `type:"string"` + + // The state of the event source. If it is ACTIVE, you have already created + // a matching event bus for this event source, and that event bus is active. + // If it is PENDING, either you haven't yet created a matching event bus, or + // that event bus is deactivated. If it is DELETED, you have created a matching + // event bus, but the event source has since been deleted. + State *string `type:"string" enum:"EventSourceState"` +} + +// String returns the string representation +func (s EventSource) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EventSource) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *EventSource) SetArn(v string) *EventSource { + s.Arn = &v + return s +} + +// SetCreatedBy sets the CreatedBy field's value. +func (s *EventSource) SetCreatedBy(v string) *EventSource { + s.CreatedBy = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *EventSource) SetCreationTime(v time.Time) *EventSource { + s.CreationTime = &v + return s +} + +// SetExpirationTime sets the ExpirationTime field's value. +func (s *EventSource) SetExpirationTime(v time.Time) *EventSource { + s.ExpirationTime = &v + return s +} + +// SetName sets the Name field's value. +func (s *EventSource) SetName(v string) *EventSource { + s.Name = &v + return s +} + +// SetState sets the State field's value. +func (s *EventSource) SetState(v string) *EventSource { + s.State = &v + return s +} + +// These are custom parameter to be used when the target is an API Gateway REST +// APIs or EventBridge ApiDestinations. In the latter case, these are merged +// with any InvocationParameters specified on the Connection, with any values +// from the Connection taking precedence. +type HttpParameters struct { + _ struct{} `type:"structure"` + + // The headers that need to be sent as part of request invoking the API Gateway + // REST API or EventBridge ApiDestination. + HeaderParameters map[string]*string `type:"map"` + + // The path parameter values to be used to populate API Gateway REST API or + // EventBridge ApiDestination path wildcards ("*"). + PathParameterValues []*string `type:"list"` + + // The query string keys/values that need to be sent as part of request invoking + // the API Gateway REST API or EventBridge ApiDestination. + QueryStringParameters map[string]*string `type:"map"` +} + +// String returns the string representation +func (s HttpParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HttpParameters) GoString() string { + return s.String() +} + +// SetHeaderParameters sets the HeaderParameters field's value. +func (s *HttpParameters) SetHeaderParameters(v map[string]*string) *HttpParameters { + s.HeaderParameters = v + return s +} + +// SetPathParameterValues sets the PathParameterValues field's value. +func (s *HttpParameters) SetPathParameterValues(v []*string) *HttpParameters { + s.PathParameterValues = v + return s +} + +// SetQueryStringParameters sets the QueryStringParameters field's value. +func (s *HttpParameters) SetQueryStringParameters(v map[string]*string) *HttpParameters { + s.QueryStringParameters = v + return s +} + +// An error occurred because a replay can be canceled only when the state is +// Running or Starting. +type IllegalStatusException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s IllegalStatusException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IllegalStatusException) GoString() string { + return s.String() +} + +func newErrorIllegalStatusException(v protocol.ResponseMetadata) error { + return &IllegalStatusException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *IllegalStatusException) Code() string { + return "IllegalStatusException" +} + +// Message returns the exception's message. +func (s *IllegalStatusException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *IllegalStatusException) OrigErr() error { + return nil +} + +func (s *IllegalStatusException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *IllegalStatusException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *IllegalStatusException) RequestID() string { + return s.RespMetadata.RequestID +} + +// Contains the parameters needed for you to provide custom input to a target +// based on one or more pieces of data extracted from the event. +type InputTransformer struct { + _ struct{} `type:"structure"` + + // Map of JSON paths to be extracted from the event. You can then insert these + // in the template in InputTemplate to produce the output you want to be sent + // to the target. + // + // InputPathsMap is an array key-value pairs, where each value is a valid JSON + // path. You can have as many as 100 key-value pairs. You must use JSON dot + // notation, not bracket notation. + // + // The keys cannot start with "AWS." + InputPathsMap map[string]*string `type:"map"` + + // Input template where you specify placeholders that will be filled with the + // values of the keys from InputPathsMap to customize the data sent to the target. + // Enclose each InputPathsMaps value in brackets: The InputTemplate + // must be valid JSON. + // + // If InputTemplate is a JSON object (surrounded by curly braces), the following + // restrictions apply: + // + // * The placeholder cannot be used as an object key. + // + // The following example shows the syntax for using InputPathsMap and InputTemplate. + // + // "InputTransformer": + // + // { + // + // "InputPathsMap": {"instance": "$.detail.instance","status": "$.detail.status"}, + // + // "InputTemplate": " is in state " + // + // } + // + // To have the InputTemplate include quote marks within a JSON string, escape + // each quote marks with a slash, as in the following example: + // + // "InputTransformer": + // + // { + // + // "InputPathsMap": {"instance": "$.detail.instance","status": "$.detail.status"}, + // + // "InputTemplate": " is in state \"\"" + // + // } + // + // The InputTemplate can also be valid JSON with varibles in quotes or out, + // as in the following example: + // + // "InputTransformer": + // + // { + // + // "InputPathsMap": {"instance": "$.detail.instance","status": "$.detail.status"}, + // + // "InputTemplate": '{"myInstance": ,"myStatus": " is in + // state \"\""}' + // + // } + // + // InputTemplate is a required field + InputTemplate *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s InputTransformer) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InputTransformer) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *InputTransformer) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InputTransformer"} + if s.InputTemplate == nil { + invalidParams.Add(request.NewErrParamRequired("InputTemplate")) + } + if s.InputTemplate != nil && len(*s.InputTemplate) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InputTemplate", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInputPathsMap sets the InputPathsMap field's value. +func (s *InputTransformer) SetInputPathsMap(v map[string]*string) *InputTransformer { + s.InputPathsMap = v + return s +} + +// SetInputTemplate sets the InputTemplate field's value. +func (s *InputTransformer) SetInputTemplate(v string) *InputTransformer { + s.InputTemplate = &v + return s +} + +// This exception occurs due to unexpected causes. +type InternalException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalException) GoString() string { + return s.String() +} + +func newErrorInternalException(v protocol.ResponseMetadata) error { + return &InternalException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InternalException) Code() string { + return "InternalException" +} + +// Message returns the exception's message. +func (s *InternalException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InternalException) OrigErr() error { + return nil +} + +func (s *InternalException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *InternalException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InternalException) RequestID() string { + return s.RespMetadata.RequestID +} + +// The event pattern is not valid. +type InvalidEventPatternException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidEventPatternException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidEventPatternException) GoString() string { + return s.String() +} + +func newErrorInvalidEventPatternException(v protocol.ResponseMetadata) error { + return &InvalidEventPatternException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidEventPatternException) Code() string { + return "InvalidEventPatternException" +} + +// Message returns the exception's message. +func (s *InvalidEventPatternException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidEventPatternException) OrigErr() error { + return nil +} + +func (s *InvalidEventPatternException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *InvalidEventPatternException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidEventPatternException) RequestID() string { + return s.RespMetadata.RequestID +} + +// The specified state is not a valid state for an event source. +type InvalidStateException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidStateException) GoString() string { + return s.String() +} + +func newErrorInvalidStateException(v protocol.ResponseMetadata) error { + return &InvalidStateException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidStateException) Code() string { + return "InvalidStateException" +} + +// Message returns the exception's message. +func (s *InvalidStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidStateException) OrigErr() error { + return nil +} + +func (s *InvalidStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *InvalidStateException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidStateException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This object enables you to specify a JSON path to extract from the event +// and use as the partition key for the Amazon Kinesis data stream, so that +// you can control the shard to which the event goes. If you do not include +// this parameter, the default is to use the eventId as the partition key. +type KinesisParameters struct { + _ struct{} `type:"structure"` + + // The JSON path to be extracted from the event and used as the partition key. + // For more information, see Amazon Kinesis Streams Key Concepts (https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key) + // in the Amazon Kinesis Streams Developer Guide. + // + // PartitionKeyPath is a required field + PartitionKeyPath *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s KinesisParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KinesisParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *KinesisParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "KinesisParameters"} + if s.PartitionKeyPath == nil { + invalidParams.Add(request.NewErrParamRequired("PartitionKeyPath")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPartitionKeyPath sets the PartitionKeyPath field's value. +func (s *KinesisParameters) SetPartitionKeyPath(v string) *KinesisParameters { + s.PartitionKeyPath = &v + return s +} + +// The request failed because it attempted to create resource beyond the allowed +// service quota. +type LimitExceededException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s *LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *LimitExceededException) OrigErr() error { + return nil +} + +func (s *LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *LimitExceededException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *LimitExceededException) RequestID() string { + return s.RespMetadata.RequestID +} + +type ListApiDestinationsInput struct { + _ struct{} `type:"structure"` + + // The ARN of the connection specified for the API destination. + ConnectionArn *string `min:"1" type:"string"` + + // The maximum number of API destinations to include in the response. + Limit *int64 `min:"1" type:"integer"` + + // A name prefix to filter results returned. Only API destinations with a name + // that starts with the prefix are returned. + NamePrefix *string `min:"1" type:"string"` + + // The token returned by a previous call to retrieve the next set of results. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListApiDestinationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListApiDestinationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListApiDestinationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListApiDestinationsInput"} + if s.ConnectionArn != nil && len(*s.ConnectionArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConnectionArn", 1)) + } + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NamePrefix != nil && len(*s.NamePrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NamePrefix", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConnectionArn sets the ConnectionArn field's value. +func (s *ListApiDestinationsInput) SetConnectionArn(v string) *ListApiDestinationsInput { + s.ConnectionArn = &v + return s +} + +// SetLimit sets the Limit field's value. +func (s *ListApiDestinationsInput) SetLimit(v int64) *ListApiDestinationsInput { + s.Limit = &v + return s +} + +// SetNamePrefix sets the NamePrefix field's value. +func (s *ListApiDestinationsInput) SetNamePrefix(v string) *ListApiDestinationsInput { + s.NamePrefix = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListApiDestinationsInput) SetNextToken(v string) *ListApiDestinationsInput { + s.NextToken = &v + return s +} + +type ListApiDestinationsOutput struct { + _ struct{} `type:"structure"` + + // An array of ApiDestination objects that include information about an API + // destination. + ApiDestinations []*ApiDestination `type:"list"` + + // A token you can use in a subsequent request to retrieve the next set of results. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListApiDestinationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListApiDestinationsOutput) GoString() string { + return s.String() +} + +// SetApiDestinations sets the ApiDestinations field's value. +func (s *ListApiDestinationsOutput) SetApiDestinations(v []*ApiDestination) *ListApiDestinationsOutput { + s.ApiDestinations = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListApiDestinationsOutput) SetNextToken(v string) *ListApiDestinationsOutput { + s.NextToken = &v + return s +} + +type ListArchivesInput struct { + _ struct{} `type:"structure"` + + // The ARN of the event source associated with the archive. + EventSourceArn *string `min:"1" type:"string"` + + // The maximum number of results to return. + Limit *int64 `min:"1" type:"integer"` + + // A name prefix to filter the archives returned. Only archives with name that + // match the prefix are returned. + NamePrefix *string `min:"1" type:"string"` + + // The token returned by a previous call to retrieve the next set of results. + NextToken *string `min:"1" type:"string"` + + // The state of the archive. + State *string `type:"string" enum:"ArchiveState"` +} + +// String returns the string representation +func (s ListArchivesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListArchivesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListArchivesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListArchivesInput"} + if s.EventSourceArn != nil && len(*s.EventSourceArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventSourceArn", 1)) + } + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NamePrefix != nil && len(*s.NamePrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NamePrefix", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventSourceArn sets the EventSourceArn field's value. +func (s *ListArchivesInput) SetEventSourceArn(v string) *ListArchivesInput { + s.EventSourceArn = &v + return s +} + +// SetLimit sets the Limit field's value. +func (s *ListArchivesInput) SetLimit(v int64) *ListArchivesInput { + s.Limit = &v + return s +} + +// SetNamePrefix sets the NamePrefix field's value. +func (s *ListArchivesInput) SetNamePrefix(v string) *ListArchivesInput { + s.NamePrefix = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListArchivesInput) SetNextToken(v string) *ListArchivesInput { + s.NextToken = &v + return s +} + +// SetState sets the State field's value. +func (s *ListArchivesInput) SetState(v string) *ListArchivesInput { + s.State = &v + return s +} + +type ListArchivesOutput struct { + _ struct{} `type:"structure"` + + // An array of Archive objects that include details about an archive. + Archives []*Archive `type:"list"` + + // The token returned by a previous call to retrieve the next set of results. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListArchivesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListArchivesOutput) GoString() string { + return s.String() +} + +// SetArchives sets the Archives field's value. +func (s *ListArchivesOutput) SetArchives(v []*Archive) *ListArchivesOutput { + s.Archives = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListArchivesOutput) SetNextToken(v string) *ListArchivesOutput { + s.NextToken = &v + return s +} + +type ListConnectionsInput struct { + _ struct{} `type:"structure"` + + // The state of the connection. + ConnectionState *string `type:"string" enum:"ConnectionState"` + + // The maximum number of connections to return. + Limit *int64 `min:"1" type:"integer"` + + // A name prefix to filter results returned. Only connections with a name that + // starts with the prefix are returned. + NamePrefix *string `min:"1" type:"string"` + + // The token returned by a previous call to retrieve the next set of results. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListConnectionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListConnectionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListConnectionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListConnectionsInput"} + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NamePrefix != nil && len(*s.NamePrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NamePrefix", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConnectionState sets the ConnectionState field's value. +func (s *ListConnectionsInput) SetConnectionState(v string) *ListConnectionsInput { + s.ConnectionState = &v + return s +} + +// SetLimit sets the Limit field's value. +func (s *ListConnectionsInput) SetLimit(v int64) *ListConnectionsInput { + s.Limit = &v + return s +} + +// SetNamePrefix sets the NamePrefix field's value. +func (s *ListConnectionsInput) SetNamePrefix(v string) *ListConnectionsInput { + s.NamePrefix = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListConnectionsInput) SetNextToken(v string) *ListConnectionsInput { + s.NextToken = &v + return s +} + +type ListConnectionsOutput struct { + _ struct{} `type:"structure"` + + // An array of connections objects that include details about the connections. + Connections []*Connection `type:"list"` + + // A token you can use in a subsequent request to retrieve the next set of results. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListConnectionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListConnectionsOutput) GoString() string { + return s.String() +} + +// SetConnections sets the Connections field's value. +func (s *ListConnectionsOutput) SetConnections(v []*Connection) *ListConnectionsOutput { + s.Connections = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListConnectionsOutput) SetNextToken(v string) *ListConnectionsOutput { + s.NextToken = &v + return s +} + +type ListEventBusesInput struct { + _ struct{} `type:"structure"` + + // Specifying this limits the number of results returned by this operation. + // The operation also returns a NextToken which you can use in a subsequent + // operation to retrieve the next set of results. + Limit *int64 `min:"1" type:"integer"` + + // Specifying this limits the results to only those event buses with names that + // start with the specified prefix. + NamePrefix *string `min:"1" type:"string"` + + // The token returned by a previous call to retrieve the next set of results. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListEventBusesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListEventBusesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListEventBusesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListEventBusesInput"} + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NamePrefix != nil && len(*s.NamePrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NamePrefix", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLimit sets the Limit field's value. +func (s *ListEventBusesInput) SetLimit(v int64) *ListEventBusesInput { + s.Limit = &v + return s +} + +// SetNamePrefix sets the NamePrefix field's value. +func (s *ListEventBusesInput) SetNamePrefix(v string) *ListEventBusesInput { + s.NamePrefix = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListEventBusesInput) SetNextToken(v string) *ListEventBusesInput { + s.NextToken = &v + return s +} + +type ListEventBusesOutput struct { + _ struct{} `type:"structure"` + + // This list of event buses. + EventBuses []*EventBus `type:"list"` + + // A token you can use in a subsequent operation to retrieve the next set of + // results. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListEventBusesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListEventBusesOutput) GoString() string { + return s.String() +} + +// SetEventBuses sets the EventBuses field's value. +func (s *ListEventBusesOutput) SetEventBuses(v []*EventBus) *ListEventBusesOutput { + s.EventBuses = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListEventBusesOutput) SetNextToken(v string) *ListEventBusesOutput { + s.NextToken = &v + return s +} + +type ListEventSourcesInput struct { + _ struct{} `type:"structure"` + + // Specifying this limits the number of results returned by this operation. + // The operation also returns a NextToken which you can use in a subsequent + // operation to retrieve the next set of results. + Limit *int64 `min:"1" type:"integer"` + + // Specifying this limits the results to only those partner event sources with + // names that start with the specified prefix. + NamePrefix *string `min:"1" type:"string"` + + // The token returned by a previous call to retrieve the next set of results. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListEventSourcesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListEventSourcesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListEventSourcesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListEventSourcesInput"} + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NamePrefix != nil && len(*s.NamePrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NamePrefix", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLimit sets the Limit field's value. +func (s *ListEventSourcesInput) SetLimit(v int64) *ListEventSourcesInput { + s.Limit = &v + return s +} + +// SetNamePrefix sets the NamePrefix field's value. +func (s *ListEventSourcesInput) SetNamePrefix(v string) *ListEventSourcesInput { + s.NamePrefix = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListEventSourcesInput) SetNextToken(v string) *ListEventSourcesInput { + s.NextToken = &v + return s +} + +type ListEventSourcesOutput struct { + _ struct{} `type:"structure"` + + // The list of event sources. + EventSources []*EventSource `type:"list"` + + // A token you can use in a subsequent operation to retrieve the next set of + // results. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListEventSourcesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListEventSourcesOutput) GoString() string { + return s.String() +} + +// SetEventSources sets the EventSources field's value. +func (s *ListEventSourcesOutput) SetEventSources(v []*EventSource) *ListEventSourcesOutput { + s.EventSources = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListEventSourcesOutput) SetNextToken(v string) *ListEventSourcesOutput { + s.NextToken = &v + return s +} + +type ListPartnerEventSourceAccountsInput struct { + _ struct{} `type:"structure"` + + // The name of the partner event source to display account information about. + // + // EventSourceName is a required field + EventSourceName *string `min:"1" type:"string" required:"true"` + + // Specifying this limits the number of results returned by this operation. + // The operation also returns a NextToken which you can use in a subsequent + // operation to retrieve the next set of results. + Limit *int64 `min:"1" type:"integer"` + + // The token returned by a previous call to this operation. Specifying this + // retrieves the next set of results. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListPartnerEventSourceAccountsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPartnerEventSourceAccountsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListPartnerEventSourceAccountsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListPartnerEventSourceAccountsInput"} + if s.EventSourceName == nil { + invalidParams.Add(request.NewErrParamRequired("EventSourceName")) + } + if s.EventSourceName != nil && len(*s.EventSourceName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventSourceName", 1)) + } + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventSourceName sets the EventSourceName field's value. +func (s *ListPartnerEventSourceAccountsInput) SetEventSourceName(v string) *ListPartnerEventSourceAccountsInput { + s.EventSourceName = &v + return s +} + +// SetLimit sets the Limit field's value. +func (s *ListPartnerEventSourceAccountsInput) SetLimit(v int64) *ListPartnerEventSourceAccountsInput { + s.Limit = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListPartnerEventSourceAccountsInput) SetNextToken(v string) *ListPartnerEventSourceAccountsInput { + s.NextToken = &v + return s +} + +type ListPartnerEventSourceAccountsOutput struct { + _ struct{} `type:"structure"` + + // A token you can use in a subsequent operation to retrieve the next set of + // results. + NextToken *string `min:"1" type:"string"` + + // The list of partner event sources returned by the operation. + PartnerEventSourceAccounts []*PartnerEventSourceAccount `type:"list"` +} + +// String returns the string representation +func (s ListPartnerEventSourceAccountsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPartnerEventSourceAccountsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListPartnerEventSourceAccountsOutput) SetNextToken(v string) *ListPartnerEventSourceAccountsOutput { + s.NextToken = &v + return s +} + +// SetPartnerEventSourceAccounts sets the PartnerEventSourceAccounts field's value. +func (s *ListPartnerEventSourceAccountsOutput) SetPartnerEventSourceAccounts(v []*PartnerEventSourceAccount) *ListPartnerEventSourceAccountsOutput { + s.PartnerEventSourceAccounts = v + return s +} + +type ListPartnerEventSourcesInput struct { + _ struct{} `type:"structure"` + + // pecifying this limits the number of results returned by this operation. The + // operation also returns a NextToken which you can use in a subsequent operation + // to retrieve the next set of results. + Limit *int64 `min:"1" type:"integer"` + + // If you specify this, the results are limited to only those partner event + // sources that start with the string you specify. + // + // NamePrefix is a required field + NamePrefix *string `min:"1" type:"string" required:"true"` + + // The token returned by a previous call to this operation. Specifying this + // retrieves the next set of results. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListPartnerEventSourcesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPartnerEventSourcesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListPartnerEventSourcesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListPartnerEventSourcesInput"} + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NamePrefix == nil { + invalidParams.Add(request.NewErrParamRequired("NamePrefix")) + } + if s.NamePrefix != nil && len(*s.NamePrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NamePrefix", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLimit sets the Limit field's value. +func (s *ListPartnerEventSourcesInput) SetLimit(v int64) *ListPartnerEventSourcesInput { + s.Limit = &v + return s +} + +// SetNamePrefix sets the NamePrefix field's value. +func (s *ListPartnerEventSourcesInput) SetNamePrefix(v string) *ListPartnerEventSourcesInput { + s.NamePrefix = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListPartnerEventSourcesInput) SetNextToken(v string) *ListPartnerEventSourcesInput { + s.NextToken = &v + return s +} + +type ListPartnerEventSourcesOutput struct { + _ struct{} `type:"structure"` + + // A token you can use in a subsequent operation to retrieve the next set of + // results. + NextToken *string `min:"1" type:"string"` + + // The list of partner event sources returned by the operation. + PartnerEventSources []*PartnerEventSource `type:"list"` +} + +// String returns the string representation +func (s ListPartnerEventSourcesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPartnerEventSourcesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListPartnerEventSourcesOutput) SetNextToken(v string) *ListPartnerEventSourcesOutput { + s.NextToken = &v + return s +} + +// SetPartnerEventSources sets the PartnerEventSources field's value. +func (s *ListPartnerEventSourcesOutput) SetPartnerEventSources(v []*PartnerEventSource) *ListPartnerEventSourcesOutput { + s.PartnerEventSources = v + return s +} + +type ListReplaysInput struct { + _ struct{} `type:"structure"` + + // The ARN of the event source associated with the replay. + EventSourceArn *string `min:"1" type:"string"` + + // The maximum number of replays to retrieve. + Limit *int64 `min:"1" type:"integer"` + + // A name prefix to filter the replays returned. Only replays with name that + // match the prefix are returned. + NamePrefix *string `min:"1" type:"string"` + + // The token returned by a previous call to retrieve the next set of results. + NextToken *string `min:"1" type:"string"` + + // The state of the replay. + State *string `type:"string" enum:"ReplayState"` +} + +// String returns the string representation +func (s ListReplaysInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListReplaysInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListReplaysInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListReplaysInput"} + if s.EventSourceArn != nil && len(*s.EventSourceArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventSourceArn", 1)) + } + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NamePrefix != nil && len(*s.NamePrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NamePrefix", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventSourceArn sets the EventSourceArn field's value. +func (s *ListReplaysInput) SetEventSourceArn(v string) *ListReplaysInput { + s.EventSourceArn = &v + return s +} + +// SetLimit sets the Limit field's value. +func (s *ListReplaysInput) SetLimit(v int64) *ListReplaysInput { + s.Limit = &v + return s +} + +// SetNamePrefix sets the NamePrefix field's value. +func (s *ListReplaysInput) SetNamePrefix(v string) *ListReplaysInput { + s.NamePrefix = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListReplaysInput) SetNextToken(v string) *ListReplaysInput { + s.NextToken = &v + return s +} + +// SetState sets the State field's value. +func (s *ListReplaysInput) SetState(v string) *ListReplaysInput { + s.State = &v + return s +} + +type ListReplaysOutput struct { + _ struct{} `type:"structure"` + + // The token returned by a previous call to retrieve the next set of results. + NextToken *string `min:"1" type:"string"` + + // An array of Replay objects that contain information about the replay. + Replays []*Replay `type:"list"` +} + +// String returns the string representation +func (s ListReplaysOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListReplaysOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListReplaysOutput) SetNextToken(v string) *ListReplaysOutput { + s.NextToken = &v + return s +} + +// SetReplays sets the Replays field's value. +func (s *ListReplaysOutput) SetReplays(v []*Replay) *ListReplaysOutput { + s.Replays = v + return s +} + +type ListRuleNamesByTargetInput struct { + _ struct{} `type:"structure"` + + // The name or ARN of the event bus to list rules for. If you omit this, the + // default event bus is used. + EventBusName *string `min:"1" type:"string"` + + // The maximum number of results to return. + Limit *int64 `min:"1" type:"integer"` + + // The token returned by a previous call to retrieve the next set of results. + NextToken *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the target resource. + // + // TargetArn is a required field + TargetArn *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListRuleNamesByTargetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListRuleNamesByTargetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListRuleNamesByTargetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListRuleNamesByTargetInput"} + if s.EventBusName != nil && len(*s.EventBusName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventBusName", 1)) + } + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + if s.TargetArn == nil { + invalidParams.Add(request.NewErrParamRequired("TargetArn")) + } + if s.TargetArn != nil && len(*s.TargetArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TargetArn", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventBusName sets the EventBusName field's value. +func (s *ListRuleNamesByTargetInput) SetEventBusName(v string) *ListRuleNamesByTargetInput { + s.EventBusName = &v + return s +} + +// SetLimit sets the Limit field's value. +func (s *ListRuleNamesByTargetInput) SetLimit(v int64) *ListRuleNamesByTargetInput { + s.Limit = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListRuleNamesByTargetInput) SetNextToken(v string) *ListRuleNamesByTargetInput { + s.NextToken = &v + return s +} + +// SetTargetArn sets the TargetArn field's value. +func (s *ListRuleNamesByTargetInput) SetTargetArn(v string) *ListRuleNamesByTargetInput { + s.TargetArn = &v + return s +} + +type ListRuleNamesByTargetOutput struct { + _ struct{} `type:"structure"` + + // Indicates whether there are additional results to retrieve. If there are + // no more results, the value is null. + NextToken *string `min:"1" type:"string"` + + // The names of the rules that can invoke the given target. + RuleNames []*string `type:"list"` +} + +// String returns the string representation +func (s ListRuleNamesByTargetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListRuleNamesByTargetOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListRuleNamesByTargetOutput) SetNextToken(v string) *ListRuleNamesByTargetOutput { + s.NextToken = &v + return s +} + +// SetRuleNames sets the RuleNames field's value. +func (s *ListRuleNamesByTargetOutput) SetRuleNames(v []*string) *ListRuleNamesByTargetOutput { + s.RuleNames = v + return s +} + +type ListRulesInput struct { + _ struct{} `type:"structure"` + + // The name or ARN of the event bus to list the rules for. If you omit this, + // the default event bus is used. + EventBusName *string `min:"1" type:"string"` + + // The maximum number of results to return. + Limit *int64 `min:"1" type:"integer"` + + // The prefix matching the rule name. + NamePrefix *string `min:"1" type:"string"` + + // The token returned by a previous call to retrieve the next set of results. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListRulesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListRulesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListRulesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListRulesInput"} + if s.EventBusName != nil && len(*s.EventBusName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventBusName", 1)) + } + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NamePrefix != nil && len(*s.NamePrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NamePrefix", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventBusName sets the EventBusName field's value. +func (s *ListRulesInput) SetEventBusName(v string) *ListRulesInput { + s.EventBusName = &v + return s +} + +// SetLimit sets the Limit field's value. +func (s *ListRulesInput) SetLimit(v int64) *ListRulesInput { + s.Limit = &v + return s +} + +// SetNamePrefix sets the NamePrefix field's value. +func (s *ListRulesInput) SetNamePrefix(v string) *ListRulesInput { + s.NamePrefix = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListRulesInput) SetNextToken(v string) *ListRulesInput { + s.NextToken = &v + return s +} + +type ListRulesOutput struct { + _ struct{} `type:"structure"` + + // Indicates whether there are additional results to retrieve. If there are + // no more results, the value is null. + NextToken *string `min:"1" type:"string"` + + // The rules that match the specified criteria. + Rules []*Rule `type:"list"` +} + +// String returns the string representation +func (s ListRulesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListRulesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListRulesOutput) SetNextToken(v string) *ListRulesOutput { + s.NextToken = &v + return s +} + +// SetRules sets the Rules field's value. +func (s *ListRulesOutput) SetRules(v []*Rule) *ListRulesOutput { + s.Rules = v + return s +} + +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // The ARN of the EventBridge resource for which you want to view tags. + // + // ResourceARN is a required field + ResourceARN *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListTagsForResourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTagsForResourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTagsForResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} + if s.ResourceARN == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceARN")) + } + if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceARN sets the ResourceARN field's value. +func (s *ListTagsForResourceInput) SetResourceARN(v string) *ListTagsForResourceInput { + s.ResourceARN = &v + return s +} + +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // The list of tag keys and values associated with the resource you specified + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s ListTagsForResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTagsForResourceOutput) GoString() string { + return s.String() +} + +// SetTags sets the Tags field's value. +func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { + s.Tags = v + return s +} + +type ListTargetsByRuleInput struct { + _ struct{} `type:"structure"` + + // The name or ARN of the event bus associated with the rule. If you omit this, + // the default event bus is used. + EventBusName *string `min:"1" type:"string"` + + // The maximum number of results to return. + Limit *int64 `min:"1" type:"integer"` + + // The token returned by a previous call to retrieve the next set of results. + NextToken *string `min:"1" type:"string"` + + // The name of the rule. + // + // Rule is a required field + Rule *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListTargetsByRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTargetsByRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTargetsByRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTargetsByRuleInput"} + if s.EventBusName != nil && len(*s.EventBusName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventBusName", 1)) + } + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + if s.Rule == nil { + invalidParams.Add(request.NewErrParamRequired("Rule")) + } + if s.Rule != nil && len(*s.Rule) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Rule", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventBusName sets the EventBusName field's value. +func (s *ListTargetsByRuleInput) SetEventBusName(v string) *ListTargetsByRuleInput { + s.EventBusName = &v + return s +} + +// SetLimit sets the Limit field's value. +func (s *ListTargetsByRuleInput) SetLimit(v int64) *ListTargetsByRuleInput { + s.Limit = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTargetsByRuleInput) SetNextToken(v string) *ListTargetsByRuleInput { + s.NextToken = &v + return s +} + +// SetRule sets the Rule field's value. +func (s *ListTargetsByRuleInput) SetRule(v string) *ListTargetsByRuleInput { + s.Rule = &v + return s +} + +type ListTargetsByRuleOutput struct { + _ struct{} `type:"structure"` + + // Indicates whether there are additional results to retrieve. If there are + // no more results, the value is null. + NextToken *string `min:"1" type:"string"` + + // The targets assigned to the rule. + Targets []*Target `min:"1" type:"list"` +} + +// String returns the string representation +func (s ListTargetsByRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTargetsByRuleOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTargetsByRuleOutput) SetNextToken(v string) *ListTargetsByRuleOutput { + s.NextToken = &v + return s +} + +// SetTargets sets the Targets field's value. +func (s *ListTargetsByRuleOutput) SetTargets(v []*Target) *ListTargetsByRuleOutput { + s.Targets = v + return s +} + +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. +type ManagedRuleException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ManagedRuleException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ManagedRuleException) GoString() string { + return s.String() +} + +func newErrorManagedRuleException(v protocol.ResponseMetadata) error { + return &ManagedRuleException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *ManagedRuleException) Code() string { + return "ManagedRuleException" +} + +// Message returns the exception's message. +func (s *ManagedRuleException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *ManagedRuleException) OrigErr() error { + return nil +} + +func (s *ManagedRuleException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *ManagedRuleException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *ManagedRuleException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This structure specifies the network configuration for an ECS task. +type NetworkConfiguration struct { + _ struct{} `type:"structure"` + + // Use this structure to specify the VPC subnets and security groups for the + // task, and whether a public IP address is to be used. This structure is relevant + // only for ECS tasks that use the awsvpc network mode. + AwsvpcConfiguration *AwsVpcConfiguration `locationName:"awsvpcConfiguration" type:"structure"` +} + +// String returns the string representation +func (s NetworkConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NetworkConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *NetworkConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "NetworkConfiguration"} + if s.AwsvpcConfiguration != nil { + if err := s.AwsvpcConfiguration.Validate(); err != nil { + invalidParams.AddNested("AwsvpcConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsvpcConfiguration sets the AwsvpcConfiguration field's value. +func (s *NetworkConfiguration) SetAwsvpcConfiguration(v *AwsVpcConfiguration) *NetworkConfiguration { + s.AwsvpcConfiguration = v + return s +} + +// The operation you are attempting is not available in this region. +type OperationDisabledException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s OperationDisabledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OperationDisabledException) GoString() string { + return s.String() +} + +func newErrorOperationDisabledException(v protocol.ResponseMetadata) error { + return &OperationDisabledException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *OperationDisabledException) Code() string { + return "OperationDisabledException" +} + +// Message returns the exception's message. +func (s *OperationDisabledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *OperationDisabledException) OrigErr() error { + return nil +} + +func (s *OperationDisabledException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *OperationDisabledException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *OperationDisabledException) RequestID() string { + return s.RespMetadata.RequestID +} + +// A partner event source is created by an SaaS partner. If a customer creates +// a partner event bus that matches this event source, that AWS account can +// receive events from the partner's applications or services. +type PartnerEventSource struct { + _ struct{} `type:"structure"` + + // The ARN of the partner event source. + Arn *string `type:"string"` + + // The name of the partner event source. + Name *string `type:"string"` +} + +// String returns the string representation +func (s PartnerEventSource) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PartnerEventSource) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *PartnerEventSource) SetArn(v string) *PartnerEventSource { + s.Arn = &v + return s +} + +// SetName sets the Name field's value. +func (s *PartnerEventSource) SetName(v string) *PartnerEventSource { + s.Name = &v + return s +} + +// The AWS account that a partner event source has been offered to. +type PartnerEventSourceAccount struct { + _ struct{} `type:"structure"` + + // The AWS account ID that the partner event source was offered to. + Account *string `min:"12" type:"string"` + + // The date and time the event source was created. + CreationTime *time.Time `type:"timestamp"` + + // The date and time that the event source will expire, if the AWS account doesn't + // create a matching event bus for it. + ExpirationTime *time.Time `type:"timestamp"` + + // The state of the event source. If it is ACTIVE, you have already created + // a matching event bus for this event source, and that event bus is active. + // If it is PENDING, either you haven't yet created a matching event bus, or + // that event bus is deactivated. If it is DELETED, you have created a matching + // event bus, but the event source has since been deleted. + State *string `type:"string" enum:"EventSourceState"` +} + +// String returns the string representation +func (s PartnerEventSourceAccount) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PartnerEventSourceAccount) GoString() string { + return s.String() +} + +// SetAccount sets the Account field's value. +func (s *PartnerEventSourceAccount) SetAccount(v string) *PartnerEventSourceAccount { + s.Account = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *PartnerEventSourceAccount) SetCreationTime(v time.Time) *PartnerEventSourceAccount { + s.CreationTime = &v + return s +} + +// SetExpirationTime sets the ExpirationTime field's value. +func (s *PartnerEventSourceAccount) SetExpirationTime(v time.Time) *PartnerEventSourceAccount { + s.ExpirationTime = &v + return s +} + +// SetState sets the State field's value. +func (s *PartnerEventSourceAccount) SetState(v string) *PartnerEventSourceAccount { + s.State = &v + return s +} + +// The event bus policy is too long. For more information, see the limits. +type PolicyLengthExceededException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PolicyLengthExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyLengthExceededException) GoString() string { + return s.String() +} + +func newErrorPolicyLengthExceededException(v protocol.ResponseMetadata) error { + return &PolicyLengthExceededException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *PolicyLengthExceededException) Code() string { + return "PolicyLengthExceededException" +} + +// Message returns the exception's message. +func (s *PolicyLengthExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *PolicyLengthExceededException) OrigErr() error { + return nil +} + +func (s *PolicyLengthExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *PolicyLengthExceededException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *PolicyLengthExceededException) RequestID() string { + return s.RespMetadata.RequestID +} + +type PutEventsInput struct { + _ struct{} `type:"structure"` + + // The entry that defines an event in your system. You can specify several parameters + // for the entry such as the source and type of the event, resources associated + // with the event, and so on. + // + // Entries is a required field + Entries []*PutEventsRequestEntry `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s PutEventsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutEventsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutEventsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutEventsInput"} + if s.Entries == nil { + invalidParams.Add(request.NewErrParamRequired("Entries")) + } + if s.Entries != nil && len(s.Entries) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Entries", 1)) + } + if s.Entries != nil { + for i, v := range s.Entries { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEntries sets the Entries field's value. +func (s *PutEventsInput) SetEntries(v []*PutEventsRequestEntry) *PutEventsInput { + s.Entries = v + return s +} + +type PutEventsOutput struct { + _ struct{} `type:"structure"` + + // The successfully and unsuccessfully ingested events results. If the ingestion + // was successful, the entry has the event ID in it. Otherwise, you can use + // the error code and error message to identify the problem with the entry. + Entries []*PutEventsResultEntry `type:"list"` + + // The number of failed entries. + FailedEntryCount *int64 `type:"integer"` +} + +// String returns the string representation +func (s PutEventsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutEventsOutput) GoString() string { + return s.String() +} + +// SetEntries sets the Entries field's value. +func (s *PutEventsOutput) SetEntries(v []*PutEventsResultEntry) *PutEventsOutput { + s.Entries = v + return s +} + +// SetFailedEntryCount sets the FailedEntryCount field's value. +func (s *PutEventsOutput) SetFailedEntryCount(v int64) *PutEventsOutput { + s.FailedEntryCount = &v + return s +} + +// Represents an event to be submitted. +type PutEventsRequestEntry struct { + _ struct{} `type:"structure"` + + // A valid JSON string. There is no other schema imposed. The JSON string may + // contain fields and nested subobjects. + Detail *string `type:"string"` + + // Free-form string used to decide what fields to expect in the event detail. + DetailType *string `type:"string"` + + // The name or ARN of the event bus to receive the event. Only the rules that + // are associated with this event bus are used to match the event. If you omit + // this, the default event bus is used. + EventBusName *string `min:"1" type:"string"` + + // AWS resources, identified by Amazon Resource Name (ARN), which the event + // primarily concerns. Any number, including zero, may be present. + Resources []*string `type:"list"` + + // The source of the event. + Source *string `type:"string"` + + // The time stamp of the event, per RFC3339 (https://www.rfc-editor.org/rfc/rfc3339.txt). + // If no time stamp is provided, the time stamp of the PutEvents call is used. + Time *time.Time `type:"timestamp"` + + // An AWS X-Ray trade header, which is an http header (X-Amzn-Trace-Id) that + // contains the trace-id associated with the event. + // + // To learn more about X-Ray trace headers, see Tracing header (https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-tracingheader) + // in the AWS X-Ray Developer Guide. + TraceHeader *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PutEventsRequestEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutEventsRequestEntry) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutEventsRequestEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutEventsRequestEntry"} + if s.EventBusName != nil && len(*s.EventBusName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventBusName", 1)) + } + if s.TraceHeader != nil && len(*s.TraceHeader) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TraceHeader", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDetail sets the Detail field's value. +func (s *PutEventsRequestEntry) SetDetail(v string) *PutEventsRequestEntry { + s.Detail = &v + return s +} + +// SetDetailType sets the DetailType field's value. +func (s *PutEventsRequestEntry) SetDetailType(v string) *PutEventsRequestEntry { + s.DetailType = &v + return s +} + +// SetEventBusName sets the EventBusName field's value. +func (s *PutEventsRequestEntry) SetEventBusName(v string) *PutEventsRequestEntry { + s.EventBusName = &v + return s +} + +// SetResources sets the Resources field's value. +func (s *PutEventsRequestEntry) SetResources(v []*string) *PutEventsRequestEntry { + s.Resources = v + return s +} + +// SetSource sets the Source field's value. +func (s *PutEventsRequestEntry) SetSource(v string) *PutEventsRequestEntry { + s.Source = &v + return s +} + +// SetTime sets the Time field's value. +func (s *PutEventsRequestEntry) SetTime(v time.Time) *PutEventsRequestEntry { + s.Time = &v + return s +} + +// SetTraceHeader sets the TraceHeader field's value. +func (s *PutEventsRequestEntry) SetTraceHeader(v string) *PutEventsRequestEntry { + s.TraceHeader = &v + return s +} + +// Represents an event that failed to be submitted. +type PutEventsResultEntry struct { + _ struct{} `type:"structure"` + + // The error code that indicates why the event submission failed. + ErrorCode *string `type:"string"` + + // The error message that explains why the event submission failed. + ErrorMessage *string `type:"string"` + + // The ID of the event. + EventId *string `type:"string"` +} + +// String returns the string representation +func (s PutEventsResultEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutEventsResultEntry) GoString() string { + return s.String() +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *PutEventsResultEntry) SetErrorCode(v string) *PutEventsResultEntry { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *PutEventsResultEntry) SetErrorMessage(v string) *PutEventsResultEntry { + s.ErrorMessage = &v + return s +} + +// SetEventId sets the EventId field's value. +func (s *PutEventsResultEntry) SetEventId(v string) *PutEventsResultEntry { + s.EventId = &v + return s +} + +type PutPartnerEventsInput struct { + _ struct{} `type:"structure"` + + // The list of events to write to the event bus. + // + // Entries is a required field + Entries []*PutPartnerEventsRequestEntry `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s PutPartnerEventsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutPartnerEventsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutPartnerEventsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutPartnerEventsInput"} + if s.Entries == nil { + invalidParams.Add(request.NewErrParamRequired("Entries")) + } + if s.Entries != nil && len(s.Entries) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Entries", 1)) + } + if s.Entries != nil { + for i, v := range s.Entries { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEntries sets the Entries field's value. +func (s *PutPartnerEventsInput) SetEntries(v []*PutPartnerEventsRequestEntry) *PutPartnerEventsInput { + s.Entries = v + return s +} + +type PutPartnerEventsOutput struct { + _ struct{} `type:"structure"` + + // The list of events from this operation that were successfully written to + // the partner event bus. + Entries []*PutPartnerEventsResultEntry `type:"list"` + + // The number of events from this operation that could not be written to the + // partner event bus. + FailedEntryCount *int64 `type:"integer"` +} + +// String returns the string representation +func (s PutPartnerEventsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutPartnerEventsOutput) GoString() string { + return s.String() +} + +// SetEntries sets the Entries field's value. +func (s *PutPartnerEventsOutput) SetEntries(v []*PutPartnerEventsResultEntry) *PutPartnerEventsOutput { + s.Entries = v + return s +} + +// SetFailedEntryCount sets the FailedEntryCount field's value. +func (s *PutPartnerEventsOutput) SetFailedEntryCount(v int64) *PutPartnerEventsOutput { + s.FailedEntryCount = &v + return s +} + +// The details about an event generated by an SaaS partner. +type PutPartnerEventsRequestEntry struct { + _ struct{} `type:"structure"` + + // A valid JSON string. There is no other schema imposed. The JSON string may + // contain fields and nested subobjects. + Detail *string `type:"string"` + + // A free-form string used to decide what fields to expect in the event detail. + DetailType *string `type:"string"` + + // AWS resources, identified by Amazon Resource Name (ARN), which the event + // primarily concerns. Any number, including zero, may be present. + Resources []*string `type:"list"` + + // The event source that is generating the evntry. + Source *string `min:"1" type:"string"` + + // The date and time of the event. + Time *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s PutPartnerEventsRequestEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutPartnerEventsRequestEntry) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutPartnerEventsRequestEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutPartnerEventsRequestEntry"} + if s.Source != nil && len(*s.Source) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Source", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDetail sets the Detail field's value. +func (s *PutPartnerEventsRequestEntry) SetDetail(v string) *PutPartnerEventsRequestEntry { + s.Detail = &v + return s +} + +// SetDetailType sets the DetailType field's value. +func (s *PutPartnerEventsRequestEntry) SetDetailType(v string) *PutPartnerEventsRequestEntry { + s.DetailType = &v + return s +} + +// SetResources sets the Resources field's value. +func (s *PutPartnerEventsRequestEntry) SetResources(v []*string) *PutPartnerEventsRequestEntry { + s.Resources = v + return s +} + +// SetSource sets the Source field's value. +func (s *PutPartnerEventsRequestEntry) SetSource(v string) *PutPartnerEventsRequestEntry { + s.Source = &v + return s +} + +// SetTime sets the Time field's value. +func (s *PutPartnerEventsRequestEntry) SetTime(v time.Time) *PutPartnerEventsRequestEntry { + s.Time = &v + return s +} + +// Represents an event that a partner tried to generate, but failed. +type PutPartnerEventsResultEntry struct { + _ struct{} `type:"structure"` + + // The error code that indicates why the event submission failed. + ErrorCode *string `type:"string"` + + // The error message that explains why the event submission failed. + ErrorMessage *string `type:"string"` + + // The ID of the event. + EventId *string `type:"string"` +} + +// String returns the string representation +func (s PutPartnerEventsResultEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutPartnerEventsResultEntry) GoString() string { + return s.String() +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *PutPartnerEventsResultEntry) SetErrorCode(v string) *PutPartnerEventsResultEntry { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *PutPartnerEventsResultEntry) SetErrorMessage(v string) *PutPartnerEventsResultEntry { + s.ErrorMessage = &v + return s +} + +// SetEventId sets the EventId field's value. +func (s *PutPartnerEventsResultEntry) SetEventId(v string) *PutPartnerEventsResultEntry { + s.EventId = &v + return s +} + +type PutPermissionInput struct { + _ struct{} `type:"structure"` + + // The action that you are enabling the other account to perform. Currently, + // this must be events:PutEvents. + Action *string `min:"1" type:"string"` + + // This parameter enables you to limit the permission to accounts that fulfill + // a certain condition, such as being a member of a certain AWS organization. + // For more information about AWS Organizations, see What Is AWS Organizations + // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html) + // in the AWS Organizations User Guide. + // + // If you specify Condition with an AWS organization ID, and specify "*" as + // the value for Principal, you grant permission to all the accounts in the + // named organization. + // + // The Condition is a JSON string which must contain Type, Key, and Value fields. + Condition *Condition `type:"structure"` + + // The name of the event bus associated with the rule. If you omit this, the + // default event bus is used. + EventBusName *string `min:"1" type:"string"` + + // A JSON string that describes the permission policy statement. You can include + // a Policy parameter in the request instead of using the StatementId, Action, + // Principal, or Condition parameters. + Policy *string `type:"string"` + + // The 12-digit AWS account ID that you are permitting to put events to your + // default event bus. Specify "*" to permit any account to put events to your + // default event bus. + // + // If you specify "*" without specifying Condition, avoid creating rules that + // may match undesirable events. To create more secure rules, make sure that + // the event pattern for each rule contains an account field with a specific + // account ID from which to receive events. Rules with an account field do not + // match any events sent from other accounts. + Principal *string `min:"1" type:"string"` + + // An identifier string for the external account that you are granting permissions + // to. If you later want to revoke the permission for this external account, + // specify this StatementId when you run RemovePermission. + StatementId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PutPermissionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutPermissionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutPermissionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutPermissionInput"} + if s.Action != nil && len(*s.Action) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Action", 1)) + } + if s.EventBusName != nil && len(*s.EventBusName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventBusName", 1)) + } + if s.Principal != nil && len(*s.Principal) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Principal", 1)) + } + if s.StatementId != nil && len(*s.StatementId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StatementId", 1)) + } + if s.Condition != nil { + if err := s.Condition.Validate(); err != nil { + invalidParams.AddNested("Condition", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAction sets the Action field's value. +func (s *PutPermissionInput) SetAction(v string) *PutPermissionInput { + s.Action = &v + return s +} + +// SetCondition sets the Condition field's value. +func (s *PutPermissionInput) SetCondition(v *Condition) *PutPermissionInput { + s.Condition = v + return s +} + +// SetEventBusName sets the EventBusName field's value. +func (s *PutPermissionInput) SetEventBusName(v string) *PutPermissionInput { + s.EventBusName = &v + return s +} + +// SetPolicy sets the Policy field's value. +func (s *PutPermissionInput) SetPolicy(v string) *PutPermissionInput { + s.Policy = &v + return s +} + +// SetPrincipal sets the Principal field's value. +func (s *PutPermissionInput) SetPrincipal(v string) *PutPermissionInput { + s.Principal = &v + return s +} + +// SetStatementId sets the StatementId field's value. +func (s *PutPermissionInput) SetStatementId(v string) *PutPermissionInput { + s.StatementId = &v + return s +} + +type PutPermissionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutPermissionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutPermissionOutput) GoString() string { + return s.String() +} + +type PutRuleInput struct { + _ struct{} `type:"structure"` + + // A description of the rule. + Description *string `type:"string"` + + // The name or ARN of the event bus to associate with this rule. If you omit + // this, the default event bus is used. + EventBusName *string `min:"1" type:"string"` + + // The event pattern. For more information, see Events and Event Patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) + // in the Amazon EventBridge User Guide. + EventPattern *string `type:"string"` + + // The name of the rule that you are creating or updating. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the IAM role associated with the rule. + RoleArn *string `min:"1" type:"string"` + + // The scheduling expression. For example, "cron(0 20 * * ? *)" or "rate(5 minutes)". + ScheduleExpression *string `type:"string"` + + // Indicates whether the rule is enabled or disabled. + State *string `type:"string" enum:"RuleState"` + + // The list of key-value pairs to associate with the rule. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s PutRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutRuleInput"} + if s.EventBusName != nil && len(*s.EventBusName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventBusName", 1)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.RoleArn != nil && len(*s.RoleArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1)) + } + if s.Tags != nil { + for i, v := range s.Tags { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDescription sets the Description field's value. +func (s *PutRuleInput) SetDescription(v string) *PutRuleInput { + s.Description = &v + return s +} + +// SetEventBusName sets the EventBusName field's value. +func (s *PutRuleInput) SetEventBusName(v string) *PutRuleInput { + s.EventBusName = &v + return s +} + +// SetEventPattern sets the EventPattern field's value. +func (s *PutRuleInput) SetEventPattern(v string) *PutRuleInput { + s.EventPattern = &v + return s +} + +// SetName sets the Name field's value. +func (s *PutRuleInput) SetName(v string) *PutRuleInput { + s.Name = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *PutRuleInput) SetRoleArn(v string) *PutRuleInput { + s.RoleArn = &v + return s +} + +// SetScheduleExpression sets the ScheduleExpression field's value. +func (s *PutRuleInput) SetScheduleExpression(v string) *PutRuleInput { + s.ScheduleExpression = &v + return s +} + +// SetState sets the State field's value. +func (s *PutRuleInput) SetState(v string) *PutRuleInput { + s.State = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *PutRuleInput) SetTags(v []*Tag) *PutRuleInput { + s.Tags = v + return s +} + +type PutRuleOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the rule. + RuleArn *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PutRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutRuleOutput) GoString() string { + return s.String() +} + +// SetRuleArn sets the RuleArn field's value. +func (s *PutRuleOutput) SetRuleArn(v string) *PutRuleOutput { + s.RuleArn = &v + return s +} + +type PutTargetsInput struct { + _ struct{} `type:"structure"` + + // The name or ARN of the event bus associated with the rule. If you omit this, + // the default event bus is used. + EventBusName *string `min:"1" type:"string"` + + // The name of the rule. + // + // Rule is a required field + Rule *string `min:"1" type:"string" required:"true"` + + // The targets to update or add to the rule. + // + // Targets is a required field + Targets []*Target `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s PutTargetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutTargetsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutTargetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutTargetsInput"} + if s.EventBusName != nil && len(*s.EventBusName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventBusName", 1)) + } + if s.Rule == nil { + invalidParams.Add(request.NewErrParamRequired("Rule")) + } + if s.Rule != nil && len(*s.Rule) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Rule", 1)) + } + if s.Targets == nil { + invalidParams.Add(request.NewErrParamRequired("Targets")) + } + if s.Targets != nil && len(s.Targets) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Targets", 1)) + } + if s.Targets != nil { + for i, v := range s.Targets { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventBusName sets the EventBusName field's value. +func (s *PutTargetsInput) SetEventBusName(v string) *PutTargetsInput { + s.EventBusName = &v + return s +} + +// SetRule sets the Rule field's value. +func (s *PutTargetsInput) SetRule(v string) *PutTargetsInput { + s.Rule = &v + return s +} + +// SetTargets sets the Targets field's value. +func (s *PutTargetsInput) SetTargets(v []*Target) *PutTargetsInput { + s.Targets = v + return s +} + +type PutTargetsOutput struct { + _ struct{} `type:"structure"` + + // The failed target entries. + FailedEntries []*PutTargetsResultEntry `type:"list"` + + // The number of failed entries. + FailedEntryCount *int64 `type:"integer"` +} + +// String returns the string representation +func (s PutTargetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutTargetsOutput) GoString() string { + return s.String() +} + +// SetFailedEntries sets the FailedEntries field's value. +func (s *PutTargetsOutput) SetFailedEntries(v []*PutTargetsResultEntry) *PutTargetsOutput { + s.FailedEntries = v + return s +} + +// SetFailedEntryCount sets the FailedEntryCount field's value. +func (s *PutTargetsOutput) SetFailedEntryCount(v int64) *PutTargetsOutput { + s.FailedEntryCount = &v + return s +} + +// Represents a target that failed to be added to a rule. +type PutTargetsResultEntry struct { + _ struct{} `type:"structure"` + + // The error code that indicates why the target addition failed. If the value + // is ConcurrentModificationException, too many requests were made at the same + // time. + ErrorCode *string `type:"string"` + + // The error message that explains why the target addition failed. + ErrorMessage *string `type:"string"` + + // The ID of the target. + TargetId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PutTargetsResultEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutTargetsResultEntry) GoString() string { + return s.String() +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *PutTargetsResultEntry) SetErrorCode(v string) *PutTargetsResultEntry { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *PutTargetsResultEntry) SetErrorMessage(v string) *PutTargetsResultEntry { + s.ErrorMessage = &v + return s +} + +// SetTargetId sets the TargetId field's value. +func (s *PutTargetsResultEntry) SetTargetId(v string) *PutTargetsResultEntry { + s.TargetId = &v + return s +} + +// These are custom parameters to be used when the target is a Redshift cluster +// to invoke the Redshift Data API ExecuteStatement based on EventBridge events. +type RedshiftDataParameters struct { + _ struct{} `type:"structure"` + + // The name of the database. Required when authenticating using temporary credentials. + // + // Database is a required field + Database *string `min:"1" type:"string" required:"true"` + + // The database user name. Required when authenticating using temporary credentials. + DbUser *string `min:"1" type:"string"` + + // The name or ARN of the secret that enables access to the database. Required + // when authenticating using AWS Secrets Manager. + SecretManagerArn *string `min:"1" type:"string"` + + // The SQL statement text to run. + // + // Sql is a required field + Sql *string `min:"1" type:"string" required:"true"` + + // The name of the SQL statement. You can name the SQL statement when you create + // it to identify the query. + StatementName *string `min:"1" type:"string"` + + // Indicates whether to send an event back to EventBridge after the SQL statement + // runs. + WithEvent *bool `type:"boolean"` +} + +// String returns the string representation +func (s RedshiftDataParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RedshiftDataParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RedshiftDataParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RedshiftDataParameters"} + if s.Database == nil { + invalidParams.Add(request.NewErrParamRequired("Database")) + } + if s.Database != nil && len(*s.Database) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Database", 1)) + } + if s.DbUser != nil && len(*s.DbUser) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DbUser", 1)) + } + if s.SecretManagerArn != nil && len(*s.SecretManagerArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SecretManagerArn", 1)) + } + if s.Sql == nil { + invalidParams.Add(request.NewErrParamRequired("Sql")) + } + if s.Sql != nil && len(*s.Sql) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Sql", 1)) + } + if s.StatementName != nil && len(*s.StatementName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StatementName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDatabase sets the Database field's value. +func (s *RedshiftDataParameters) SetDatabase(v string) *RedshiftDataParameters { + s.Database = &v + return s +} + +// SetDbUser sets the DbUser field's value. +func (s *RedshiftDataParameters) SetDbUser(v string) *RedshiftDataParameters { + s.DbUser = &v + return s +} + +// SetSecretManagerArn sets the SecretManagerArn field's value. +func (s *RedshiftDataParameters) SetSecretManagerArn(v string) *RedshiftDataParameters { + s.SecretManagerArn = &v + return s +} + +// SetSql sets the Sql field's value. +func (s *RedshiftDataParameters) SetSql(v string) *RedshiftDataParameters { + s.Sql = &v + return s +} + +// SetStatementName sets the StatementName field's value. +func (s *RedshiftDataParameters) SetStatementName(v string) *RedshiftDataParameters { + s.StatementName = &v + return s +} + +// SetWithEvent sets the WithEvent field's value. +func (s *RedshiftDataParameters) SetWithEvent(v bool) *RedshiftDataParameters { + s.WithEvent = &v + return s +} + +type RemovePermissionInput struct { + _ struct{} `type:"structure"` + + // The name of the event bus to revoke permissions for. If you omit this, the + // default event bus is used. + EventBusName *string `min:"1" type:"string"` + + // Specifies whether to remove all permissions. + RemoveAllPermissions *bool `type:"boolean"` + + // The statement ID corresponding to the account that is no longer allowed to + // put events to the default event bus. + StatementId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s RemovePermissionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemovePermissionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RemovePermissionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RemovePermissionInput"} + if s.EventBusName != nil && len(*s.EventBusName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventBusName", 1)) + } + if s.StatementId != nil && len(*s.StatementId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StatementId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventBusName sets the EventBusName field's value. +func (s *RemovePermissionInput) SetEventBusName(v string) *RemovePermissionInput { + s.EventBusName = &v + return s +} + +// SetRemoveAllPermissions sets the RemoveAllPermissions field's value. +func (s *RemovePermissionInput) SetRemoveAllPermissions(v bool) *RemovePermissionInput { + s.RemoveAllPermissions = &v + return s +} + +// SetStatementId sets the StatementId field's value. +func (s *RemovePermissionInput) SetStatementId(v string) *RemovePermissionInput { + s.StatementId = &v + return s +} + +type RemovePermissionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s RemovePermissionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemovePermissionOutput) GoString() string { + return s.String() +} + +type RemoveTargetsInput struct { + _ struct{} `type:"structure"` + + // The name or ARN of the event bus associated with the rule. If you omit this, + // the default event bus is used. + EventBusName *string `min:"1" type:"string"` + + // If this is a managed rule, created by an AWS service on your behalf, you + // must specify Force as True to remove targets. This parameter is ignored for + // rules that are not managed rules. You can check whether a rule is a managed + // rule by using DescribeRule or ListRules and checking the ManagedBy field + // of the response. + Force *bool `type:"boolean"` + + // The IDs of the targets to remove from the rule. + // + // Ids is a required field + Ids []*string `min:"1" type:"list" required:"true"` + + // The name of the rule. + // + // Rule is a required field + Rule *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s RemoveTargetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemoveTargetsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RemoveTargetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RemoveTargetsInput"} + if s.EventBusName != nil && len(*s.EventBusName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventBusName", 1)) + } + if s.Ids == nil { + invalidParams.Add(request.NewErrParamRequired("Ids")) + } + if s.Ids != nil && len(s.Ids) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Ids", 1)) + } + if s.Rule == nil { + invalidParams.Add(request.NewErrParamRequired("Rule")) + } + if s.Rule != nil && len(*s.Rule) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Rule", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventBusName sets the EventBusName field's value. +func (s *RemoveTargetsInput) SetEventBusName(v string) *RemoveTargetsInput { + s.EventBusName = &v + return s +} + +// SetForce sets the Force field's value. +func (s *RemoveTargetsInput) SetForce(v bool) *RemoveTargetsInput { + s.Force = &v + return s +} + +// SetIds sets the Ids field's value. +func (s *RemoveTargetsInput) SetIds(v []*string) *RemoveTargetsInput { + s.Ids = v + return s +} + +// SetRule sets the Rule field's value. +func (s *RemoveTargetsInput) SetRule(v string) *RemoveTargetsInput { + s.Rule = &v + return s +} + +type RemoveTargetsOutput struct { + _ struct{} `type:"structure"` + + // The failed target entries. + FailedEntries []*RemoveTargetsResultEntry `type:"list"` + + // The number of failed entries. + FailedEntryCount *int64 `type:"integer"` +} + +// String returns the string representation +func (s RemoveTargetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemoveTargetsOutput) GoString() string { + return s.String() +} + +// SetFailedEntries sets the FailedEntries field's value. +func (s *RemoveTargetsOutput) SetFailedEntries(v []*RemoveTargetsResultEntry) *RemoveTargetsOutput { + s.FailedEntries = v + return s +} + +// SetFailedEntryCount sets the FailedEntryCount field's value. +func (s *RemoveTargetsOutput) SetFailedEntryCount(v int64) *RemoveTargetsOutput { + s.FailedEntryCount = &v + return s +} + +// Represents a target that failed to be removed from a rule. +type RemoveTargetsResultEntry struct { + _ struct{} `type:"structure"` + + // The error code that indicates why the target removal failed. If the value + // is ConcurrentModificationException, too many requests were made at the same + // time. + ErrorCode *string `type:"string"` + + // The error message that explains why the target removal failed. + ErrorMessage *string `type:"string"` + + // The ID of the target. + TargetId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s RemoveTargetsResultEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemoveTargetsResultEntry) GoString() string { + return s.String() +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *RemoveTargetsResultEntry) SetErrorCode(v string) *RemoveTargetsResultEntry { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *RemoveTargetsResultEntry) SetErrorMessage(v string) *RemoveTargetsResultEntry { + s.ErrorMessage = &v + return s +} + +// SetTargetId sets the TargetId field's value. +func (s *RemoveTargetsResultEntry) SetTargetId(v string) *RemoveTargetsResultEntry { + s.TargetId = &v + return s +} + +// A Replay object that contains details about a replay. +type Replay struct { + _ struct{} `type:"structure"` + + // A time stamp for the time to start replaying events. Any event with a creation + // time prior to the EventEndTime specified is replayed. + EventEndTime *time.Time `type:"timestamp"` + + // A time stamp for the time that the last event was replayed. + EventLastReplayedTime *time.Time `type:"timestamp"` + + // The ARN of the archive to replay event from. + EventSourceArn *string `min:"1" type:"string"` + + // A time stamp for the time to start replaying events. This is determined by + // the time in the event as described in Time (https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEventsRequestEntry.html#eventbridge-Type-PutEventsRequestEntry-Time). + EventStartTime *time.Time `type:"timestamp"` + + // A time stamp for the time that the replay completed. + ReplayEndTime *time.Time `type:"timestamp"` + + // The name of the replay. + ReplayName *string `min:"1" type:"string"` + + // A time stamp for the time that the replay started. + ReplayStartTime *time.Time `type:"timestamp"` + + // The current state of the replay. + State *string `type:"string" enum:"ReplayState"` + + // A description of why the replay is in the current state. + StateReason *string `type:"string"` +} + +// String returns the string representation +func (s Replay) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Replay) GoString() string { + return s.String() +} + +// SetEventEndTime sets the EventEndTime field's value. +func (s *Replay) SetEventEndTime(v time.Time) *Replay { + s.EventEndTime = &v + return s +} + +// SetEventLastReplayedTime sets the EventLastReplayedTime field's value. +func (s *Replay) SetEventLastReplayedTime(v time.Time) *Replay { + s.EventLastReplayedTime = &v + return s +} + +// SetEventSourceArn sets the EventSourceArn field's value. +func (s *Replay) SetEventSourceArn(v string) *Replay { + s.EventSourceArn = &v + return s +} + +// SetEventStartTime sets the EventStartTime field's value. +func (s *Replay) SetEventStartTime(v time.Time) *Replay { + s.EventStartTime = &v + return s +} + +// SetReplayEndTime sets the ReplayEndTime field's value. +func (s *Replay) SetReplayEndTime(v time.Time) *Replay { + s.ReplayEndTime = &v + return s +} + +// SetReplayName sets the ReplayName field's value. +func (s *Replay) SetReplayName(v string) *Replay { + s.ReplayName = &v + return s +} + +// SetReplayStartTime sets the ReplayStartTime field's value. +func (s *Replay) SetReplayStartTime(v time.Time) *Replay { + s.ReplayStartTime = &v + return s +} + +// SetState sets the State field's value. +func (s *Replay) SetState(v string) *Replay { + s.State = &v + return s +} + +// SetStateReason sets the StateReason field's value. +func (s *Replay) SetStateReason(v string) *Replay { + s.StateReason = &v + return s +} + +// A ReplayDestination object that contains details about a replay. +type ReplayDestination struct { + _ struct{} `type:"structure"` + + // The ARN of the event bus to replay event to. You can replay events only to + // the event bus specified to create the archive. + // + // Arn is a required field + Arn *string `min:"1" type:"string" required:"true"` + + // A list of ARNs for rules to replay events to. + FilterArns []*string `type:"list"` +} + +// String returns the string representation +func (s ReplayDestination) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplayDestination) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReplayDestination) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplayDestination"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.Arn != nil && len(*s.Arn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *ReplayDestination) SetArn(v string) *ReplayDestination { + s.Arn = &v + return s +} + +// SetFilterArns sets the FilterArns field's value. +func (s *ReplayDestination) SetFilterArns(v []*string) *ReplayDestination { + s.FilterArns = v + return s +} + +// The resource you are trying to create already exists. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s *ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s *ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *ResourceAlreadyExistsException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *ResourceAlreadyExistsException) RequestID() string { + return s.RespMetadata.RequestID +} + +// An entity that you specified does not exist. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s *ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *ResourceNotFoundException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *ResourceNotFoundException) RequestID() string { + return s.RespMetadata.RequestID +} + +// A RetryPolicy object that includes information about the retry policy settings. +type RetryPolicy struct { + _ struct{} `type:"structure"` + + // The maximum amount of time, in seconds, to continue to make retry attempts. + MaximumEventAgeInSeconds *int64 `min:"60" type:"integer"` + + // The maximum number of retry attempts to make before the request fails. Retry + // attempts continue until either the maximum number of attempts is made or + // until the duration of the MaximumEventAgeInSeconds is met. + MaximumRetryAttempts *int64 `type:"integer"` +} + +// String returns the string representation +func (s RetryPolicy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RetryPolicy) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RetryPolicy) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RetryPolicy"} + if s.MaximumEventAgeInSeconds != nil && *s.MaximumEventAgeInSeconds < 60 { + invalidParams.Add(request.NewErrParamMinValue("MaximumEventAgeInSeconds", 60)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaximumEventAgeInSeconds sets the MaximumEventAgeInSeconds field's value. +func (s *RetryPolicy) SetMaximumEventAgeInSeconds(v int64) *RetryPolicy { + s.MaximumEventAgeInSeconds = &v + return s +} + +// SetMaximumRetryAttempts sets the MaximumRetryAttempts field's value. +func (s *RetryPolicy) SetMaximumRetryAttempts(v int64) *RetryPolicy { + s.MaximumRetryAttempts = &v + return s +} + +// Contains information about a rule in Amazon EventBridge. +type Rule struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the rule. + Arn *string `min:"1" type:"string"` + + // The description of the rule. + Description *string `type:"string"` + + // The name or ARN of the event bus associated with the rule. If you omit this, + // the default event bus is used. + EventBusName *string `min:"1" type:"string"` + + // The event pattern of the rule. For more information, see Events and Event + // Patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) + // in the Amazon EventBridge User Guide. + EventPattern *string `type:"string"` + + // If the rule was created on behalf of your account by an AWS service, this + // field displays the principal name of the service that created the rule. + ManagedBy *string `min:"1" type:"string"` + + // The name of the rule. + Name *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the role that is used for target invocation. + RoleArn *string `min:"1" type:"string"` + + // The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)". + ScheduleExpression *string `type:"string"` + + // The state of the rule. + State *string `type:"string" enum:"RuleState"` +} + +// String returns the string representation +func (s Rule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Rule) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *Rule) SetArn(v string) *Rule { + s.Arn = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *Rule) SetDescription(v string) *Rule { + s.Description = &v + return s +} + +// SetEventBusName sets the EventBusName field's value. +func (s *Rule) SetEventBusName(v string) *Rule { + s.EventBusName = &v + return s +} + +// SetEventPattern sets the EventPattern field's value. +func (s *Rule) SetEventPattern(v string) *Rule { + s.EventPattern = &v + return s +} + +// SetManagedBy sets the ManagedBy field's value. +func (s *Rule) SetManagedBy(v string) *Rule { + s.ManagedBy = &v + return s +} + +// SetName sets the Name field's value. +func (s *Rule) SetName(v string) *Rule { + s.Name = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *Rule) SetRoleArn(v string) *Rule { + s.RoleArn = &v + return s +} + +// SetScheduleExpression sets the ScheduleExpression field's value. +func (s *Rule) SetScheduleExpression(v string) *Rule { + s.ScheduleExpression = &v + return s +} + +// SetState sets the State field's value. +func (s *Rule) SetState(v string) *Rule { + s.State = &v + return s +} + +// This parameter contains the criteria (either InstanceIds or a tag) used to +// specify which EC2 instances are to be sent the command. +type RunCommandParameters struct { + _ struct{} `type:"structure"` + + // Currently, we support including only one RunCommandTarget block, which specifies + // either an array of InstanceIds or a tag. + // + // RunCommandTargets is a required field + RunCommandTargets []*RunCommandTarget `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s RunCommandParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RunCommandParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RunCommandParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RunCommandParameters"} + if s.RunCommandTargets == nil { + invalidParams.Add(request.NewErrParamRequired("RunCommandTargets")) + } + if s.RunCommandTargets != nil && len(s.RunCommandTargets) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RunCommandTargets", 1)) + } + if s.RunCommandTargets != nil { + for i, v := range s.RunCommandTargets { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RunCommandTargets", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRunCommandTargets sets the RunCommandTargets field's value. +func (s *RunCommandParameters) SetRunCommandTargets(v []*RunCommandTarget) *RunCommandParameters { + s.RunCommandTargets = v + return s +} + +// Information about the EC2 instances that are to be sent the command, specified +// as key-value pairs. Each RunCommandTarget block can include only one key, +// but this key may specify multiple values. +type RunCommandTarget struct { + _ struct{} `type:"structure"` + + // Can be either tag: tag-key or InstanceIds. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // If Key is tag: tag-key, Values is a list of tag values. If Key is InstanceIds, + // Values is a list of Amazon EC2 instance IDs. + // + // Values is a required field + Values []*string `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s RunCommandTarget) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RunCommandTarget) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RunCommandTarget) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RunCommandTarget"} + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + if s.Values == nil { + invalidParams.Add(request.NewErrParamRequired("Values")) + } + if s.Values != nil && len(s.Values) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Values", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKey sets the Key field's value. +func (s *RunCommandTarget) SetKey(v string) *RunCommandTarget { + s.Key = &v + return s +} + +// SetValues sets the Values field's value. +func (s *RunCommandTarget) SetValues(v []*string) *RunCommandTarget { + s.Values = v + return s +} + +// Name/Value pair of a parameter to start execution of a SageMaker Model Building +// Pipeline. +type SageMakerPipelineParameter struct { + _ struct{} `type:"structure"` + + // Name of parameter to start execution of a SageMaker Model Building Pipeline. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // Value of parameter to start execution of a SageMaker Model Building Pipeline. + // + // Value is a required field + Value *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s SageMakerPipelineParameter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SageMakerPipelineParameter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SageMakerPipelineParameter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SageMakerPipelineParameter"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.Value == nil { + invalidParams.Add(request.NewErrParamRequired("Value")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *SageMakerPipelineParameter) SetName(v string) *SageMakerPipelineParameter { + s.Name = &v + return s +} + +// SetValue sets the Value field's value. +func (s *SageMakerPipelineParameter) SetValue(v string) *SageMakerPipelineParameter { + s.Value = &v + return s +} + +// These are custom parameters to use when the target is a SageMaker Model Building +// Pipeline that starts based on EventBridge events. +type SageMakerPipelineParameters struct { + _ struct{} `type:"structure"` + + // List of Parameter names and values for SageMaker Model Building Pipeline + // execution. + PipelineParameterList []*SageMakerPipelineParameter `type:"list"` +} + +// String returns the string representation +func (s SageMakerPipelineParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SageMakerPipelineParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SageMakerPipelineParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SageMakerPipelineParameters"} + if s.PipelineParameterList != nil { + for i, v := range s.PipelineParameterList { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PipelineParameterList", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPipelineParameterList sets the PipelineParameterList field's value. +func (s *SageMakerPipelineParameters) SetPipelineParameterList(v []*SageMakerPipelineParameter) *SageMakerPipelineParameters { + s.PipelineParameterList = v + return s +} + +// This structure includes the custom parameter to be used when the target is +// an SQS FIFO queue. +type SqsParameters struct { + _ struct{} `type:"structure"` + + // The FIFO message group ID to use as the target. + MessageGroupId *string `type:"string"` +} + +// String returns the string representation +func (s SqsParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SqsParameters) GoString() string { + return s.String() +} + +// SetMessageGroupId sets the MessageGroupId field's value. +func (s *SqsParameters) SetMessageGroupId(v string) *SqsParameters { + s.MessageGroupId = &v + return s +} + +type StartReplayInput struct { + _ struct{} `type:"structure"` + + // A description for the replay to start. + Description *string `type:"string"` + + // A ReplayDestination object that includes details about the destination for + // the replay. + // + // Destination is a required field + Destination *ReplayDestination `type:"structure" required:"true"` + + // A time stamp for the time to stop replaying events. Only events that occurred + // between the EventStartTime and EventEndTime are replayed. + // + // EventEndTime is a required field + EventEndTime *time.Time `type:"timestamp" required:"true"` + + // The ARN of the archive to replay events from. + // + // EventSourceArn is a required field + EventSourceArn *string `min:"1" type:"string" required:"true"` + + // A time stamp for the time to start replaying events. Only events that occurred + // between the EventStartTime and EventEndTime are replayed. + // + // EventStartTime is a required field + EventStartTime *time.Time `type:"timestamp" required:"true"` + + // The name of the replay to start. + // + // ReplayName is a required field + ReplayName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s StartReplayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartReplayInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StartReplayInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartReplayInput"} + if s.Destination == nil { + invalidParams.Add(request.NewErrParamRequired("Destination")) + } + if s.EventEndTime == nil { + invalidParams.Add(request.NewErrParamRequired("EventEndTime")) + } + if s.EventSourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("EventSourceArn")) + } + if s.EventSourceArn != nil && len(*s.EventSourceArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EventSourceArn", 1)) + } + if s.EventStartTime == nil { + invalidParams.Add(request.NewErrParamRequired("EventStartTime")) + } + if s.ReplayName == nil { + invalidParams.Add(request.NewErrParamRequired("ReplayName")) + } + if s.ReplayName != nil && len(*s.ReplayName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ReplayName", 1)) + } + if s.Destination != nil { + if err := s.Destination.Validate(); err != nil { + invalidParams.AddNested("Destination", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDescription sets the Description field's value. +func (s *StartReplayInput) SetDescription(v string) *StartReplayInput { + s.Description = &v + return s +} + +// SetDestination sets the Destination field's value. +func (s *StartReplayInput) SetDestination(v *ReplayDestination) *StartReplayInput { + s.Destination = v + return s +} + +// SetEventEndTime sets the EventEndTime field's value. +func (s *StartReplayInput) SetEventEndTime(v time.Time) *StartReplayInput { + s.EventEndTime = &v + return s +} + +// SetEventSourceArn sets the EventSourceArn field's value. +func (s *StartReplayInput) SetEventSourceArn(v string) *StartReplayInput { + s.EventSourceArn = &v + return s +} + +// SetEventStartTime sets the EventStartTime field's value. +func (s *StartReplayInput) SetEventStartTime(v time.Time) *StartReplayInput { + s.EventStartTime = &v + return s +} + +// SetReplayName sets the ReplayName field's value. +func (s *StartReplayInput) SetReplayName(v string) *StartReplayInput { + s.ReplayName = &v + return s +} + +type StartReplayOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the replay. + ReplayArn *string `min:"1" type:"string"` + + // The time at which the replay started. + ReplayStartTime *time.Time `type:"timestamp"` + + // The state of the replay. + State *string `type:"string" enum:"ReplayState"` + + // The reason that the replay is in the state. + StateReason *string `type:"string"` +} + +// String returns the string representation +func (s StartReplayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartReplayOutput) GoString() string { + return s.String() +} + +// SetReplayArn sets the ReplayArn field's value. +func (s *StartReplayOutput) SetReplayArn(v string) *StartReplayOutput { + s.ReplayArn = &v + return s +} + +// SetReplayStartTime sets the ReplayStartTime field's value. +func (s *StartReplayOutput) SetReplayStartTime(v time.Time) *StartReplayOutput { + s.ReplayStartTime = &v + return s +} + +// SetState sets the State field's value. +func (s *StartReplayOutput) SetState(v string) *StartReplayOutput { + s.State = &v + return s +} + +// SetStateReason sets the StateReason field's value. +func (s *StartReplayOutput) SetStateReason(v string) *StartReplayOutput { + s.StateReason = &v + return s +} + +// A key-value pair associated with an AWS resource. In EventBridge, rules and +// event buses support tagging. +type Tag struct { + _ struct{} `type:"structure"` + + // A string you can use to assign a value. The combination of tag keys and values + // can help you organize and categorize your resources. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // The value for the specified tag key. + // + // Value is a required field + Value *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s Tag) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Tag) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Tag) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Tag"} + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + if s.Value == nil { + invalidParams.Add(request.NewErrParamRequired("Value")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKey sets the Key field's value. +func (s *Tag) SetKey(v string) *Tag { + s.Key = &v + return s +} + +// SetValue sets the Value field's value. +func (s *Tag) SetValue(v string) *Tag { + s.Value = &v + return s +} + +type TagResourceInput struct { + _ struct{} `type:"structure"` + + // The ARN of the EventBridge resource that you're adding tags to. + // + // ResourceARN is a required field + ResourceARN *string `min:"1" type:"string" required:"true"` + + // The list of key-value pairs to associate with the resource. + // + // Tags is a required field + Tags []*Tag `type:"list" required:"true"` +} + +// String returns the string representation +func (s TagResourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagResourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TagResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} + if s.ResourceARN == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceARN")) + } + if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) + } + if s.Tags == nil { + invalidParams.Add(request.NewErrParamRequired("Tags")) + } + if s.Tags != nil { + for i, v := range s.Tags { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceARN sets the ResourceARN field's value. +func (s *TagResourceInput) SetResourceARN(v string) *TagResourceInput { + s.ResourceARN = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { + s.Tags = v + return s +} + +type TagResourceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s TagResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagResourceOutput) GoString() string { + return s.String() +} + +// Targets are the resources to be invoked when a rule is triggered. For a complete +// list of services and resources that can be set as a target, see PutTargets. +// +// If you are setting the event bus of another account as the target, and that +// account granted permission to your account through an organization instead +// of directly by the account ID, then you must specify a RoleArn with proper +// permissions in the Target structure. For more information, see Sending and +// Receiving Events Between AWS Accounts (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) +// in the Amazon EventBridge User Guide. +type Target struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the target. + // + // Arn is a required field + Arn *string `min:"1" type:"string" required:"true"` + + // If the event target is an AWS Batch job, this contains the job definition, + // job name, and other parameters. For more information, see Jobs (https://docs.aws.amazon.com/batch/latest/userguide/jobs.html) + // in the AWS Batch User Guide. + BatchParameters *BatchParameters `type:"structure"` + + // The DeadLetterConfig that defines the target queue to send dead-letter queue + // events to. + DeadLetterConfig *DeadLetterConfig `type:"structure"` + + // Contains the Amazon ECS task definition and task count to be used, if the + // event target is an Amazon ECS task. For more information about Amazon ECS + // tasks, see Task Definitions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) + // in the Amazon EC2 Container Service Developer Guide. + EcsParameters *EcsParameters `type:"structure"` + + // Contains the HTTP parameters to use when the target is a API Gateway REST + // endpoint or EventBridge ApiDestination. + // + // If you specify an API Gateway REST API or EventBridge ApiDestination as a + // target, you can use this parameter to specify headers, path parameters, and + // query string keys/values as part of your target invoking request. If you're + // using ApiDestinations, the corresponding Connection can also have these values + // configured. In case of any conflicting keys, values from the Connection take + // precedence. + HttpParameters *HttpParameters `type:"structure"` + + // The ID of the target. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // Valid JSON text passed to the target. In this case, nothing from the event + // itself is passed to the target. For more information, see The JavaScript + // Object Notation (JSON) Data Interchange Format (http://www.rfc-editor.org/rfc/rfc7159.txt). + Input *string `type:"string"` + + // The value of the JSONPath that is used for extracting part of the matched + // event when passing it to the target. You must use JSON dot notation, not + // bracket notation. For more information about JSON paths, see JSONPath (http://goessner.net/articles/JsonPath/). + InputPath *string `type:"string"` + + // Settings to enable you to provide custom input to a target based on certain + // event data. You can extract one or more key-value pairs from the event and + // then use that data to send customized input to the target. + InputTransformer *InputTransformer `type:"structure"` + + // The custom parameter you can use to control the shard assignment, when the + // target is a Kinesis data stream. If you do not include this parameter, the + // default is to use the eventId as the partition key. + KinesisParameters *KinesisParameters `type:"structure"` + + // Contains the Redshift Data API parameters to use when the target is a Redshift + // cluster. + // + // If you specify a Redshift Cluster as a Target, you can use this to specify + // parameters to invoke the Redshift Data API ExecuteStatement based on EventBridge + // events. + RedshiftDataParameters *RedshiftDataParameters `type:"structure"` + + // The RetryPolicy object that contains the retry policy configuration to use + // for the dead-letter queue. + RetryPolicy *RetryPolicy `type:"structure"` + + // The Amazon Resource Name (ARN) of the IAM role to be used for this target + // when the rule is triggered. If one rule triggers multiple targets, you can + // use a different IAM role for each target. + RoleArn *string `min:"1" type:"string"` + + // Parameters used when you are using the rule to invoke Amazon EC2 Run Command. + RunCommandParameters *RunCommandParameters `type:"structure"` + + // Contains the SageMaker Model Building Pipeline parameters to start execution + // of a SageMaker Model Building Pipeline. + // + // If you specify a SageMaker Model Building Pipeline as a target, you can use + // this to specify parameters to start a pipeline execution based on EventBridge + // events. + SageMakerPipelineParameters *SageMakerPipelineParameters `type:"structure"` + + // Contains the message group ID to use when the target is a FIFO queue. + // + // If you specify an SQS FIFO queue as a target, the queue must have content-based + // deduplication enabled. + SqsParameters *SqsParameters `type:"structure"` +} + +// String returns the string representation +func (s Target) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Target) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Target) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Target"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.Arn != nil && len(*s.Arn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Id != nil && len(*s.Id) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Id", 1)) + } + if s.RoleArn != nil && len(*s.RoleArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1)) + } + if s.BatchParameters != nil { + if err := s.BatchParameters.Validate(); err != nil { + invalidParams.AddNested("BatchParameters", err.(request.ErrInvalidParams)) + } + } + if s.DeadLetterConfig != nil { + if err := s.DeadLetterConfig.Validate(); err != nil { + invalidParams.AddNested("DeadLetterConfig", err.(request.ErrInvalidParams)) + } + } + if s.EcsParameters != nil { + if err := s.EcsParameters.Validate(); err != nil { + invalidParams.AddNested("EcsParameters", err.(request.ErrInvalidParams)) + } + } + if s.InputTransformer != nil { + if err := s.InputTransformer.Validate(); err != nil { + invalidParams.AddNested("InputTransformer", err.(request.ErrInvalidParams)) + } + } + if s.KinesisParameters != nil { + if err := s.KinesisParameters.Validate(); err != nil { + invalidParams.AddNested("KinesisParameters", err.(request.ErrInvalidParams)) + } + } + if s.RedshiftDataParameters != nil { + if err := s.RedshiftDataParameters.Validate(); err != nil { + invalidParams.AddNested("RedshiftDataParameters", err.(request.ErrInvalidParams)) + } + } + if s.RetryPolicy != nil { + if err := s.RetryPolicy.Validate(); err != nil { + invalidParams.AddNested("RetryPolicy", err.(request.ErrInvalidParams)) + } + } + if s.RunCommandParameters != nil { + if err := s.RunCommandParameters.Validate(); err != nil { + invalidParams.AddNested("RunCommandParameters", err.(request.ErrInvalidParams)) + } + } + if s.SageMakerPipelineParameters != nil { + if err := s.SageMakerPipelineParameters.Validate(); err != nil { + invalidParams.AddNested("SageMakerPipelineParameters", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *Target) SetArn(v string) *Target { + s.Arn = &v + return s +} + +// SetBatchParameters sets the BatchParameters field's value. +func (s *Target) SetBatchParameters(v *BatchParameters) *Target { + s.BatchParameters = v + return s +} + +// SetDeadLetterConfig sets the DeadLetterConfig field's value. +func (s *Target) SetDeadLetterConfig(v *DeadLetterConfig) *Target { + s.DeadLetterConfig = v + return s +} + +// SetEcsParameters sets the EcsParameters field's value. +func (s *Target) SetEcsParameters(v *EcsParameters) *Target { + s.EcsParameters = v + return s +} + +// SetHttpParameters sets the HttpParameters field's value. +func (s *Target) SetHttpParameters(v *HttpParameters) *Target { + s.HttpParameters = v + return s +} + +// SetId sets the Id field's value. +func (s *Target) SetId(v string) *Target { + s.Id = &v + return s +} + +// SetInput sets the Input field's value. +func (s *Target) SetInput(v string) *Target { + s.Input = &v + return s +} + +// SetInputPath sets the InputPath field's value. +func (s *Target) SetInputPath(v string) *Target { + s.InputPath = &v + return s +} + +// SetInputTransformer sets the InputTransformer field's value. +func (s *Target) SetInputTransformer(v *InputTransformer) *Target { + s.InputTransformer = v + return s +} + +// SetKinesisParameters sets the KinesisParameters field's value. +func (s *Target) SetKinesisParameters(v *KinesisParameters) *Target { + s.KinesisParameters = v + return s +} + +// SetRedshiftDataParameters sets the RedshiftDataParameters field's value. +func (s *Target) SetRedshiftDataParameters(v *RedshiftDataParameters) *Target { + s.RedshiftDataParameters = v + return s +} + +// SetRetryPolicy sets the RetryPolicy field's value. +func (s *Target) SetRetryPolicy(v *RetryPolicy) *Target { + s.RetryPolicy = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *Target) SetRoleArn(v string) *Target { + s.RoleArn = &v + return s +} + +// SetRunCommandParameters sets the RunCommandParameters field's value. +func (s *Target) SetRunCommandParameters(v *RunCommandParameters) *Target { + s.RunCommandParameters = v + return s +} + +// SetSageMakerPipelineParameters sets the SageMakerPipelineParameters field's value. +func (s *Target) SetSageMakerPipelineParameters(v *SageMakerPipelineParameters) *Target { + s.SageMakerPipelineParameters = v + return s +} + +// SetSqsParameters sets the SqsParameters field's value. +func (s *Target) SetSqsParameters(v *SqsParameters) *Target { + s.SqsParameters = v + return s +} + +type TestEventPatternInput struct { + _ struct{} `type:"structure"` + + // The event, in JSON format, to test against the event pattern. The JSON must + // follow the format specified in AWS Events (https://docs.aws.amazon.com/eventbridge/latest/userguide/aws-events.html), + // and the following fields are mandatory: + // + // * id + // + // * account + // + // * source + // + // * time + // + // * region + // + // * resources + // + // * detail-type + // + // Event is a required field + Event *string `type:"string" required:"true"` + + // The event pattern. For more information, see Events and Event Patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) + // in the Amazon EventBridge User Guide. + // + // EventPattern is a required field + EventPattern *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s TestEventPatternInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TestEventPatternInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TestEventPatternInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TestEventPatternInput"} + if s.Event == nil { + invalidParams.Add(request.NewErrParamRequired("Event")) + } + if s.EventPattern == nil { + invalidParams.Add(request.NewErrParamRequired("EventPattern")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEvent sets the Event field's value. +func (s *TestEventPatternInput) SetEvent(v string) *TestEventPatternInput { + s.Event = &v + return s +} + +// SetEventPattern sets the EventPattern field's value. +func (s *TestEventPatternInput) SetEventPattern(v string) *TestEventPatternInput { + s.EventPattern = &v + return s +} + +type TestEventPatternOutput struct { + _ struct{} `type:"structure"` + + // Indicates whether the event matches the event pattern. + Result *bool `type:"boolean"` +} + +// String returns the string representation +func (s TestEventPatternOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TestEventPatternOutput) GoString() string { + return s.String() +} + +// SetResult sets the Result field's value. +func (s *TestEventPatternOutput) SetResult(v bool) *TestEventPatternOutput { + s.Result = &v + return s +} + +type UntagResourceInput struct { + _ struct{} `type:"structure"` + + // The ARN of the EventBridge resource from which you are removing tags. + // + // ResourceARN is a required field + ResourceARN *string `min:"1" type:"string" required:"true"` + + // The list of tag keys to remove from the resource. + // + // TagKeys is a required field + TagKeys []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s UntagResourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UntagResourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UntagResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} + if s.ResourceARN == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceARN")) + } + if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) + } + if s.TagKeys == nil { + invalidParams.Add(request.NewErrParamRequired("TagKeys")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceARN sets the ResourceARN field's value. +func (s *UntagResourceInput) SetResourceARN(v string) *UntagResourceInput { + s.ResourceARN = &v + return s +} + +// SetTagKeys sets the TagKeys field's value. +func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { + s.TagKeys = v + return s +} + +type UntagResourceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UntagResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UntagResourceOutput) GoString() string { + return s.String() +} + +type UpdateApiDestinationInput struct { + _ struct{} `type:"structure"` + + // The ARN of the connection to use for the API destination. + ConnectionArn *string `min:"1" type:"string"` + + // The name of the API destination to update. + Description *string `type:"string"` + + // The method to use for the API destination. + HttpMethod *string `type:"string" enum:"ApiDestinationHttpMethod"` + + // The URL to the endpoint to use for the API destination. + InvocationEndpoint *string `min:"1" type:"string"` + + // The maximum number of invocations per second to send to the API destination. + InvocationRateLimitPerSecond *int64 `min:"1" type:"integer"` + + // The name of the API destination to update. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateApiDestinationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateApiDestinationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateApiDestinationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateApiDestinationInput"} + if s.ConnectionArn != nil && len(*s.ConnectionArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConnectionArn", 1)) + } + if s.InvocationEndpoint != nil && len(*s.InvocationEndpoint) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InvocationEndpoint", 1)) + } + if s.InvocationRateLimitPerSecond != nil && *s.InvocationRateLimitPerSecond < 1 { + invalidParams.Add(request.NewErrParamMinValue("InvocationRateLimitPerSecond", 1)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConnectionArn sets the ConnectionArn field's value. +func (s *UpdateApiDestinationInput) SetConnectionArn(v string) *UpdateApiDestinationInput { + s.ConnectionArn = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *UpdateApiDestinationInput) SetDescription(v string) *UpdateApiDestinationInput { + s.Description = &v + return s +} + +// SetHttpMethod sets the HttpMethod field's value. +func (s *UpdateApiDestinationInput) SetHttpMethod(v string) *UpdateApiDestinationInput { + s.HttpMethod = &v + return s +} + +// SetInvocationEndpoint sets the InvocationEndpoint field's value. +func (s *UpdateApiDestinationInput) SetInvocationEndpoint(v string) *UpdateApiDestinationInput { + s.InvocationEndpoint = &v + return s +} + +// SetInvocationRateLimitPerSecond sets the InvocationRateLimitPerSecond field's value. +func (s *UpdateApiDestinationInput) SetInvocationRateLimitPerSecond(v int64) *UpdateApiDestinationInput { + s.InvocationRateLimitPerSecond = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateApiDestinationInput) SetName(v string) *UpdateApiDestinationInput { + s.Name = &v + return s +} + +type UpdateApiDestinationOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the API destination that was updated. + ApiDestinationArn *string `min:"1" type:"string"` + + // The state of the API destination that was updated. + ApiDestinationState *string `type:"string" enum:"ApiDestinationState"` + + // A time stamp for the time that the API destination was created. + CreationTime *time.Time `type:"timestamp"` + + // A time stamp for the time that the API destination was last modified. + LastModifiedTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s UpdateApiDestinationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateApiDestinationOutput) GoString() string { + return s.String() +} + +// SetApiDestinationArn sets the ApiDestinationArn field's value. +func (s *UpdateApiDestinationOutput) SetApiDestinationArn(v string) *UpdateApiDestinationOutput { + s.ApiDestinationArn = &v + return s +} + +// SetApiDestinationState sets the ApiDestinationState field's value. +func (s *UpdateApiDestinationOutput) SetApiDestinationState(v string) *UpdateApiDestinationOutput { + s.ApiDestinationState = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *UpdateApiDestinationOutput) SetCreationTime(v time.Time) *UpdateApiDestinationOutput { + s.CreationTime = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *UpdateApiDestinationOutput) SetLastModifiedTime(v time.Time) *UpdateApiDestinationOutput { + s.LastModifiedTime = &v + return s +} + +type UpdateArchiveInput struct { + _ struct{} `type:"structure"` + + // The name of the archive to update. + // + // ArchiveName is a required field + ArchiveName *string `min:"1" type:"string" required:"true"` + + // The description for the archive. + Description *string `type:"string"` + + // The event pattern to use to filter events sent to the archive. + EventPattern *string `type:"string"` + + // The number of days to retain events in the archive. + RetentionDays *int64 `type:"integer"` +} + +// String returns the string representation +func (s UpdateArchiveInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateArchiveInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateArchiveInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateArchiveInput"} + if s.ArchiveName == nil { + invalidParams.Add(request.NewErrParamRequired("ArchiveName")) + } + if s.ArchiveName != nil && len(*s.ArchiveName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ArchiveName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArchiveName sets the ArchiveName field's value. +func (s *UpdateArchiveInput) SetArchiveName(v string) *UpdateArchiveInput { + s.ArchiveName = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *UpdateArchiveInput) SetDescription(v string) *UpdateArchiveInput { + s.Description = &v + return s +} + +// SetEventPattern sets the EventPattern field's value. +func (s *UpdateArchiveInput) SetEventPattern(v string) *UpdateArchiveInput { + s.EventPattern = &v + return s +} + +// SetRetentionDays sets the RetentionDays field's value. +func (s *UpdateArchiveInput) SetRetentionDays(v int64) *UpdateArchiveInput { + s.RetentionDays = &v + return s +} + +type UpdateArchiveOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the archive. + ArchiveArn *string `min:"1" type:"string"` + + // The time at which the archive was updated. + CreationTime *time.Time `type:"timestamp"` + + // The state of the archive. + State *string `type:"string" enum:"ArchiveState"` + + // The reason that the archive is in the current state. + StateReason *string `type:"string"` +} + +// String returns the string representation +func (s UpdateArchiveOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateArchiveOutput) GoString() string { + return s.String() +} + +// SetArchiveArn sets the ArchiveArn field's value. +func (s *UpdateArchiveOutput) SetArchiveArn(v string) *UpdateArchiveOutput { + s.ArchiveArn = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *UpdateArchiveOutput) SetCreationTime(v time.Time) *UpdateArchiveOutput { + s.CreationTime = &v + return s +} + +// SetState sets the State field's value. +func (s *UpdateArchiveOutput) SetState(v string) *UpdateArchiveOutput { + s.State = &v + return s +} + +// SetStateReason sets the StateReason field's value. +func (s *UpdateArchiveOutput) SetStateReason(v string) *UpdateArchiveOutput { + s.StateReason = &v + return s +} + +// Contains the API key authorization parameters to use to update the connection. +type UpdateConnectionApiKeyAuthRequestParameters struct { + _ struct{} `type:"structure"` + + // The name of the API key to use for authorization. + ApiKeyName *string `min:"1" type:"string"` + + // The value associated with teh API key to use for authorization. + ApiKeyValue *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateConnectionApiKeyAuthRequestParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateConnectionApiKeyAuthRequestParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateConnectionApiKeyAuthRequestParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateConnectionApiKeyAuthRequestParameters"} + if s.ApiKeyName != nil && len(*s.ApiKeyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApiKeyName", 1)) + } + if s.ApiKeyValue != nil && len(*s.ApiKeyValue) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApiKeyValue", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApiKeyName sets the ApiKeyName field's value. +func (s *UpdateConnectionApiKeyAuthRequestParameters) SetApiKeyName(v string) *UpdateConnectionApiKeyAuthRequestParameters { + s.ApiKeyName = &v + return s +} + +// SetApiKeyValue sets the ApiKeyValue field's value. +func (s *UpdateConnectionApiKeyAuthRequestParameters) SetApiKeyValue(v string) *UpdateConnectionApiKeyAuthRequestParameters { + s.ApiKeyValue = &v + return s +} + +// Contains the additional parameters to use for the connection. +type UpdateConnectionAuthRequestParameters struct { + _ struct{} `type:"structure"` + + // A UpdateConnectionApiKeyAuthRequestParameters object that contains the authorization + // parameters for API key authorization. + ApiKeyAuthParameters *UpdateConnectionApiKeyAuthRequestParameters `type:"structure"` + + // A UpdateConnectionBasicAuthRequestParameters object that contains the authorization + // parameters for Basic authorization. + BasicAuthParameters *UpdateConnectionBasicAuthRequestParameters `type:"structure"` + + // A ConnectionHttpParameters object that contains the additional parameters + // to use for the connection. + InvocationHttpParameters *ConnectionHttpParameters `type:"structure"` + + // A UpdateConnectionOAuthRequestParameters object that contains the authorization + // parameters for OAuth authorization. + OAuthParameters *UpdateConnectionOAuthRequestParameters `type:"structure"` +} + +// String returns the string representation +func (s UpdateConnectionAuthRequestParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateConnectionAuthRequestParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateConnectionAuthRequestParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateConnectionAuthRequestParameters"} + if s.ApiKeyAuthParameters != nil { + if err := s.ApiKeyAuthParameters.Validate(); err != nil { + invalidParams.AddNested("ApiKeyAuthParameters", err.(request.ErrInvalidParams)) + } + } + if s.BasicAuthParameters != nil { + if err := s.BasicAuthParameters.Validate(); err != nil { + invalidParams.AddNested("BasicAuthParameters", err.(request.ErrInvalidParams)) + } + } + if s.OAuthParameters != nil { + if err := s.OAuthParameters.Validate(); err != nil { + invalidParams.AddNested("OAuthParameters", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApiKeyAuthParameters sets the ApiKeyAuthParameters field's value. +func (s *UpdateConnectionAuthRequestParameters) SetApiKeyAuthParameters(v *UpdateConnectionApiKeyAuthRequestParameters) *UpdateConnectionAuthRequestParameters { + s.ApiKeyAuthParameters = v + return s +} + +// SetBasicAuthParameters sets the BasicAuthParameters field's value. +func (s *UpdateConnectionAuthRequestParameters) SetBasicAuthParameters(v *UpdateConnectionBasicAuthRequestParameters) *UpdateConnectionAuthRequestParameters { + s.BasicAuthParameters = v + return s +} + +// SetInvocationHttpParameters sets the InvocationHttpParameters field's value. +func (s *UpdateConnectionAuthRequestParameters) SetInvocationHttpParameters(v *ConnectionHttpParameters) *UpdateConnectionAuthRequestParameters { + s.InvocationHttpParameters = v + return s +} + +// SetOAuthParameters sets the OAuthParameters field's value. +func (s *UpdateConnectionAuthRequestParameters) SetOAuthParameters(v *UpdateConnectionOAuthRequestParameters) *UpdateConnectionAuthRequestParameters { + s.OAuthParameters = v + return s +} + +// Contains the Basic authorization parameters for the connection. +type UpdateConnectionBasicAuthRequestParameters struct { + _ struct{} `type:"structure"` + + // The password associated with the user name to use for Basic authorization. + Password *string `min:"1" type:"string"` + + // The user name to use for Basic authorization. + Username *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateConnectionBasicAuthRequestParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateConnectionBasicAuthRequestParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateConnectionBasicAuthRequestParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateConnectionBasicAuthRequestParameters"} + if s.Password != nil && len(*s.Password) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Password", 1)) + } + if s.Username != nil && len(*s.Username) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Username", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPassword sets the Password field's value. +func (s *UpdateConnectionBasicAuthRequestParameters) SetPassword(v string) *UpdateConnectionBasicAuthRequestParameters { + s.Password = &v + return s +} + +// SetUsername sets the Username field's value. +func (s *UpdateConnectionBasicAuthRequestParameters) SetUsername(v string) *UpdateConnectionBasicAuthRequestParameters { + s.Username = &v + return s +} + +type UpdateConnectionInput struct { + _ struct{} `type:"structure"` + + // The authorization parameters to use for the connection. + AuthParameters *UpdateConnectionAuthRequestParameters `type:"structure"` + + // The type of authorization to use for the connection. + AuthorizationType *string `type:"string" enum:"ConnectionAuthorizationType"` + + // A description for the connection. + Description *string `type:"string"` + + // The name of the connection to update. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateConnectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateConnectionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateConnectionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateConnectionInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.AuthParameters != nil { + if err := s.AuthParameters.Validate(); err != nil { + invalidParams.AddNested("AuthParameters", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuthParameters sets the AuthParameters field's value. +func (s *UpdateConnectionInput) SetAuthParameters(v *UpdateConnectionAuthRequestParameters) *UpdateConnectionInput { + s.AuthParameters = v + return s +} + +// SetAuthorizationType sets the AuthorizationType field's value. +func (s *UpdateConnectionInput) SetAuthorizationType(v string) *UpdateConnectionInput { + s.AuthorizationType = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *UpdateConnectionInput) SetDescription(v string) *UpdateConnectionInput { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateConnectionInput) SetName(v string) *UpdateConnectionInput { + s.Name = &v + return s +} + +// Contains the OAuth authorization parameters to use for the connection. +type UpdateConnectionOAuthClientRequestParameters struct { + _ struct{} `type:"structure"` + + // The client ID to use for OAuth authorization. + ClientID *string `min:"1" type:"string"` + + // The client secret assciated with the client ID to use for OAuth authorization. + ClientSecret *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateConnectionOAuthClientRequestParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateConnectionOAuthClientRequestParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateConnectionOAuthClientRequestParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateConnectionOAuthClientRequestParameters"} + if s.ClientID != nil && len(*s.ClientID) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientID", 1)) + } + if s.ClientSecret != nil && len(*s.ClientSecret) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientSecret", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientID sets the ClientID field's value. +func (s *UpdateConnectionOAuthClientRequestParameters) SetClientID(v string) *UpdateConnectionOAuthClientRequestParameters { + s.ClientID = &v + return s +} + +// SetClientSecret sets the ClientSecret field's value. +func (s *UpdateConnectionOAuthClientRequestParameters) SetClientSecret(v string) *UpdateConnectionOAuthClientRequestParameters { + s.ClientSecret = &v + return s +} + +// Contains the OAuth request parameters to use for the connection. +type UpdateConnectionOAuthRequestParameters struct { + _ struct{} `type:"structure"` + + // The URL to the authorization endpoint when OAuth is specified as the authorization + // type. + AuthorizationEndpoint *string `min:"1" type:"string"` + + // A UpdateConnectionOAuthClientRequestParameters object that contains the client + // parameters to use for the connection when OAuth is specified as the authorization + // type. + ClientParameters *UpdateConnectionOAuthClientRequestParameters `type:"structure"` + + // The method used to connect to the HTTP endpoint. + HttpMethod *string `type:"string" enum:"ConnectionOAuthHttpMethod"` + + // The additional HTTP parameters used for the OAuth authorization request. + OAuthHttpParameters *ConnectionHttpParameters `type:"structure"` +} + +// String returns the string representation +func (s UpdateConnectionOAuthRequestParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateConnectionOAuthRequestParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateConnectionOAuthRequestParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateConnectionOAuthRequestParameters"} + if s.AuthorizationEndpoint != nil && len(*s.AuthorizationEndpoint) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AuthorizationEndpoint", 1)) + } + if s.ClientParameters != nil { + if err := s.ClientParameters.Validate(); err != nil { + invalidParams.AddNested("ClientParameters", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuthorizationEndpoint sets the AuthorizationEndpoint field's value. +func (s *UpdateConnectionOAuthRequestParameters) SetAuthorizationEndpoint(v string) *UpdateConnectionOAuthRequestParameters { + s.AuthorizationEndpoint = &v + return s +} + +// SetClientParameters sets the ClientParameters field's value. +func (s *UpdateConnectionOAuthRequestParameters) SetClientParameters(v *UpdateConnectionOAuthClientRequestParameters) *UpdateConnectionOAuthRequestParameters { + s.ClientParameters = v + return s +} + +// SetHttpMethod sets the HttpMethod field's value. +func (s *UpdateConnectionOAuthRequestParameters) SetHttpMethod(v string) *UpdateConnectionOAuthRequestParameters { + s.HttpMethod = &v + return s +} + +// SetOAuthHttpParameters sets the OAuthHttpParameters field's value. +func (s *UpdateConnectionOAuthRequestParameters) SetOAuthHttpParameters(v *ConnectionHttpParameters) *UpdateConnectionOAuthRequestParameters { + s.OAuthHttpParameters = v + return s +} + +type UpdateConnectionOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the connection that was updated. + ConnectionArn *string `min:"1" type:"string"` + + // The state of the connection that was updated. + ConnectionState *string `type:"string" enum:"ConnectionState"` + + // A time stamp for the time that the connection was created. + CreationTime *time.Time `type:"timestamp"` + + // A time stamp for the time that the connection was last authorized. + LastAuthorizedTime *time.Time `type:"timestamp"` + + // A time stamp for the time that the connection was last modified. + LastModifiedTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s UpdateConnectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateConnectionOutput) GoString() string { + return s.String() +} + +// SetConnectionArn sets the ConnectionArn field's value. +func (s *UpdateConnectionOutput) SetConnectionArn(v string) *UpdateConnectionOutput { + s.ConnectionArn = &v + return s +} + +// SetConnectionState sets the ConnectionState field's value. +func (s *UpdateConnectionOutput) SetConnectionState(v string) *UpdateConnectionOutput { + s.ConnectionState = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *UpdateConnectionOutput) SetCreationTime(v time.Time) *UpdateConnectionOutput { + s.CreationTime = &v + return s +} + +// SetLastAuthorizedTime sets the LastAuthorizedTime field's value. +func (s *UpdateConnectionOutput) SetLastAuthorizedTime(v time.Time) *UpdateConnectionOutput { + s.LastAuthorizedTime = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *UpdateConnectionOutput) SetLastModifiedTime(v time.Time) *UpdateConnectionOutput { + s.LastModifiedTime = &v + return s +} + +const ( + // ApiDestinationHttpMethodPost is a ApiDestinationHttpMethod enum value + ApiDestinationHttpMethodPost = "POST" + + // ApiDestinationHttpMethodGet is a ApiDestinationHttpMethod enum value + ApiDestinationHttpMethodGet = "GET" + + // ApiDestinationHttpMethodHead is a ApiDestinationHttpMethod enum value + ApiDestinationHttpMethodHead = "HEAD" + + // ApiDestinationHttpMethodOptions is a ApiDestinationHttpMethod enum value + ApiDestinationHttpMethodOptions = "OPTIONS" + + // ApiDestinationHttpMethodPut is a ApiDestinationHttpMethod enum value + ApiDestinationHttpMethodPut = "PUT" + + // ApiDestinationHttpMethodPatch is a ApiDestinationHttpMethod enum value + ApiDestinationHttpMethodPatch = "PATCH" + + // ApiDestinationHttpMethodDelete is a ApiDestinationHttpMethod enum value + ApiDestinationHttpMethodDelete = "DELETE" +) + +// ApiDestinationHttpMethod_Values returns all elements of the ApiDestinationHttpMethod enum +func ApiDestinationHttpMethod_Values() []string { + return []string{ + ApiDestinationHttpMethodPost, + ApiDestinationHttpMethodGet, + ApiDestinationHttpMethodHead, + ApiDestinationHttpMethodOptions, + ApiDestinationHttpMethodPut, + ApiDestinationHttpMethodPatch, + ApiDestinationHttpMethodDelete, + } +} + +const ( + // ApiDestinationStateActive is a ApiDestinationState enum value + ApiDestinationStateActive = "ACTIVE" + + // ApiDestinationStateInactive is a ApiDestinationState enum value + ApiDestinationStateInactive = "INACTIVE" +) + +// ApiDestinationState_Values returns all elements of the ApiDestinationState enum +func ApiDestinationState_Values() []string { + return []string{ + ApiDestinationStateActive, + ApiDestinationStateInactive, + } +} + +const ( + // ArchiveStateEnabled is a ArchiveState enum value + ArchiveStateEnabled = "ENABLED" + + // ArchiveStateDisabled is a ArchiveState enum value + ArchiveStateDisabled = "DISABLED" + + // ArchiveStateCreating is a ArchiveState enum value + ArchiveStateCreating = "CREATING" + + // ArchiveStateUpdating is a ArchiveState enum value + ArchiveStateUpdating = "UPDATING" + + // ArchiveStateCreateFailed is a ArchiveState enum value + ArchiveStateCreateFailed = "CREATE_FAILED" + + // ArchiveStateUpdateFailed is a ArchiveState enum value + ArchiveStateUpdateFailed = "UPDATE_FAILED" +) + +// ArchiveState_Values returns all elements of the ArchiveState enum +func ArchiveState_Values() []string { + return []string{ + ArchiveStateEnabled, + ArchiveStateDisabled, + ArchiveStateCreating, + ArchiveStateUpdating, + ArchiveStateCreateFailed, + ArchiveStateUpdateFailed, + } +} + +const ( + // AssignPublicIpEnabled is a AssignPublicIp enum value + AssignPublicIpEnabled = "ENABLED" + + // AssignPublicIpDisabled is a AssignPublicIp enum value + AssignPublicIpDisabled = "DISABLED" +) + +// AssignPublicIp_Values returns all elements of the AssignPublicIp enum +func AssignPublicIp_Values() []string { + return []string{ + AssignPublicIpEnabled, + AssignPublicIpDisabled, + } +} + +const ( + // ConnectionAuthorizationTypeBasic is a ConnectionAuthorizationType enum value + ConnectionAuthorizationTypeBasic = "BASIC" + + // ConnectionAuthorizationTypeOauthClientCredentials is a ConnectionAuthorizationType enum value + ConnectionAuthorizationTypeOauthClientCredentials = "OAUTH_CLIENT_CREDENTIALS" + + // ConnectionAuthorizationTypeApiKey is a ConnectionAuthorizationType enum value + ConnectionAuthorizationTypeApiKey = "API_KEY" +) + +// ConnectionAuthorizationType_Values returns all elements of the ConnectionAuthorizationType enum +func ConnectionAuthorizationType_Values() []string { + return []string{ + ConnectionAuthorizationTypeBasic, + ConnectionAuthorizationTypeOauthClientCredentials, + ConnectionAuthorizationTypeApiKey, + } +} + +const ( + // ConnectionOAuthHttpMethodGet is a ConnectionOAuthHttpMethod enum value + ConnectionOAuthHttpMethodGet = "GET" + + // ConnectionOAuthHttpMethodPost is a ConnectionOAuthHttpMethod enum value + ConnectionOAuthHttpMethodPost = "POST" + + // ConnectionOAuthHttpMethodPut is a ConnectionOAuthHttpMethod enum value + ConnectionOAuthHttpMethodPut = "PUT" +) + +// ConnectionOAuthHttpMethod_Values returns all elements of the ConnectionOAuthHttpMethod enum +func ConnectionOAuthHttpMethod_Values() []string { + return []string{ + ConnectionOAuthHttpMethodGet, + ConnectionOAuthHttpMethodPost, + ConnectionOAuthHttpMethodPut, + } +} + +const ( + // ConnectionStateCreating is a ConnectionState enum value + ConnectionStateCreating = "CREATING" + + // ConnectionStateUpdating is a ConnectionState enum value + ConnectionStateUpdating = "UPDATING" + + // ConnectionStateDeleting is a ConnectionState enum value + ConnectionStateDeleting = "DELETING" + + // ConnectionStateAuthorized is a ConnectionState enum value + ConnectionStateAuthorized = "AUTHORIZED" + + // ConnectionStateDeauthorized is a ConnectionState enum value + ConnectionStateDeauthorized = "DEAUTHORIZED" + + // ConnectionStateAuthorizing is a ConnectionState enum value + ConnectionStateAuthorizing = "AUTHORIZING" + + // ConnectionStateDeauthorizing is a ConnectionState enum value + ConnectionStateDeauthorizing = "DEAUTHORIZING" +) + +// ConnectionState_Values returns all elements of the ConnectionState enum +func ConnectionState_Values() []string { + return []string{ + ConnectionStateCreating, + ConnectionStateUpdating, + ConnectionStateDeleting, + ConnectionStateAuthorized, + ConnectionStateDeauthorized, + ConnectionStateAuthorizing, + ConnectionStateDeauthorizing, + } +} + +const ( + // EventSourceStatePending is a EventSourceState enum value + EventSourceStatePending = "PENDING" + + // EventSourceStateActive is a EventSourceState enum value + EventSourceStateActive = "ACTIVE" + + // EventSourceStateDeleted is a EventSourceState enum value + EventSourceStateDeleted = "DELETED" +) + +// EventSourceState_Values returns all elements of the EventSourceState enum +func EventSourceState_Values() []string { + return []string{ + EventSourceStatePending, + EventSourceStateActive, + EventSourceStateDeleted, + } +} + +const ( + // LaunchTypeEc2 is a LaunchType enum value + LaunchTypeEc2 = "EC2" + + // LaunchTypeFargate is a LaunchType enum value + LaunchTypeFargate = "FARGATE" +) + +// LaunchType_Values returns all elements of the LaunchType enum +func LaunchType_Values() []string { + return []string{ + LaunchTypeEc2, + LaunchTypeFargate, + } +} + +const ( + // ReplayStateStarting is a ReplayState enum value + ReplayStateStarting = "STARTING" + + // ReplayStateRunning is a ReplayState enum value + ReplayStateRunning = "RUNNING" + + // ReplayStateCancelling is a ReplayState enum value + ReplayStateCancelling = "CANCELLING" + + // ReplayStateCompleted is a ReplayState enum value + ReplayStateCompleted = "COMPLETED" + + // ReplayStateCancelled is a ReplayState enum value + ReplayStateCancelled = "CANCELLED" + + // ReplayStateFailed is a ReplayState enum value + ReplayStateFailed = "FAILED" +) + +// ReplayState_Values returns all elements of the ReplayState enum +func ReplayState_Values() []string { + return []string{ + ReplayStateStarting, + ReplayStateRunning, + ReplayStateCancelling, + ReplayStateCompleted, + ReplayStateCancelled, + ReplayStateFailed, + } +} + +const ( + // RuleStateEnabled is a RuleState enum value + RuleStateEnabled = "ENABLED" + + // RuleStateDisabled is a RuleState enum value + RuleStateDisabled = "DISABLED" +) + +// RuleState_Values returns all elements of the RuleState enum +func RuleState_Values() []string { + return []string{ + RuleStateEnabled, + RuleStateDisabled, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/eventbridge/doc.go b/vendor/github.com/aws/aws-sdk-go/service/eventbridge/doc.go new file mode 100644 index 0000000000..c148c5154b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/eventbridge/doc.go @@ -0,0 +1,46 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package eventbridge provides the client and types for making API +// requests to Amazon EventBridge. +// +// Amazon EventBridge helps you to respond to state changes in your AWS resources. +// When your resources change state, they automatically send events into an +// event stream. You can create rules that match selected events in the stream +// and route them to targets to take action. You can also use rules to take +// action on a predetermined schedule. For example, you can configure rules +// to: +// +// * Automatically invoke an AWS Lambda function to update DNS entries when +// an event notifies you that Amazon EC2 instance enters the running state. +// +// * Direct specific API records from AWS CloudTrail to an Amazon Kinesis +// data stream for detailed analysis of potential security or availability +// risks. +// +// * Periodically invoke a built-in target to create a snapshot of an Amazon +// EBS volume. +// +// For more information about the features of Amazon EventBridge, see the Amazon +// EventBridge User Guide (https://docs.aws.amazon.com/eventbridge/latest/userguide). +// +// See https://docs.aws.amazon.com/goto/WebAPI/eventbridge-2015-10-07 for more information on this service. +// +// See eventbridge package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/eventbridge/ +// +// Using the Client +// +// To contact Amazon EventBridge 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 Amazon EventBridge client EventBridge for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/eventbridge/#New +package eventbridge diff --git a/vendor/github.com/aws/aws-sdk-go/service/eventbridge/errors.go b/vendor/github.com/aws/aws-sdk-go/service/eventbridge/errors.go new file mode 100644 index 0000000000..ca60eab9f9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/eventbridge/errors.go @@ -0,0 +1,97 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package eventbridge + +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + +const ( + + // ErrCodeConcurrentModificationException for service response error code + // "ConcurrentModificationException". + // + // There is concurrent modification on a rule, target, archive, or replay. + ErrCodeConcurrentModificationException = "ConcurrentModificationException" + + // ErrCodeIllegalStatusException for service response error code + // "IllegalStatusException". + // + // An error occurred because a replay can be canceled only when the state is + // Running or Starting. + ErrCodeIllegalStatusException = "IllegalStatusException" + + // ErrCodeInternalException for service response error code + // "InternalException". + // + // This exception occurs due to unexpected causes. + ErrCodeInternalException = "InternalException" + + // ErrCodeInvalidEventPatternException for service response error code + // "InvalidEventPatternException". + // + // The event pattern is not valid. + ErrCodeInvalidEventPatternException = "InvalidEventPatternException" + + // ErrCodeInvalidStateException for service response error code + // "InvalidStateException". + // + // The specified state is not a valid state for an event source. + ErrCodeInvalidStateException = "InvalidStateException" + + // ErrCodeLimitExceededException for service response error code + // "LimitExceededException". + // + // The request failed because it attempted to create resource beyond the allowed + // service quota. + ErrCodeLimitExceededException = "LimitExceededException" + + // ErrCodeManagedRuleException for service response error code + // "ManagedRuleException". + // + // This rule was created by an AWS service on behalf of your account. It is + // managed by that service. If you see this error in response to DeleteRule + // or RemoveTargets, you can use the Force parameter in those calls to delete + // the rule or remove targets from the rule. You cannot modify these managed + // rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, + // or UntagResource. + ErrCodeManagedRuleException = "ManagedRuleException" + + // ErrCodeOperationDisabledException for service response error code + // "OperationDisabledException". + // + // The operation you are attempting is not available in this region. + ErrCodeOperationDisabledException = "OperationDisabledException" + + // ErrCodePolicyLengthExceededException for service response error code + // "PolicyLengthExceededException". + // + // The event bus policy is too long. For more information, see the limits. + ErrCodePolicyLengthExceededException = "PolicyLengthExceededException" + + // ErrCodeResourceAlreadyExistsException for service response error code + // "ResourceAlreadyExistsException". + // + // The resource you are trying to create already exists. + ErrCodeResourceAlreadyExistsException = "ResourceAlreadyExistsException" + + // ErrCodeResourceNotFoundException for service response error code + // "ResourceNotFoundException". + // + // An entity that you specified does not exist. + ErrCodeResourceNotFoundException = "ResourceNotFoundException" +) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ConcurrentModificationException": newErrorConcurrentModificationException, + "IllegalStatusException": newErrorIllegalStatusException, + "InternalException": newErrorInternalException, + "InvalidEventPatternException": newErrorInvalidEventPatternException, + "InvalidStateException": newErrorInvalidStateException, + "LimitExceededException": newErrorLimitExceededException, + "ManagedRuleException": newErrorManagedRuleException, + "OperationDisabledException": newErrorOperationDisabledException, + "PolicyLengthExceededException": newErrorPolicyLengthExceededException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceNotFoundException": newErrorResourceNotFoundException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/eventbridge/eventbridgeiface/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/service/eventbridge/eventbridgeiface/BUILD.bazel new file mode 100644 index 0000000000..81e1de7aba --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/eventbridge/eventbridgeiface/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["interface.go"], + importmap = "k8s.io/kops/vendor/github.com/aws/aws-sdk-go/service/eventbridge/eventbridgeiface", + importpath = "github.com/aws/aws-sdk-go/service/eventbridge/eventbridgeiface", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/eventbridge:go_default_library", + ], +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/eventbridge/eventbridgeiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/eventbridge/eventbridgeiface/interface.go new file mode 100644 index 0000000000..398644d636 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/eventbridge/eventbridgeiface/interface.go @@ -0,0 +1,268 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package eventbridgeiface provides an interface to enable mocking the Amazon EventBridge 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 eventbridgeiface + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/eventbridge" +) + +// EventBridgeAPI provides an interface to enable mocking the +// eventbridge.EventBridge service client's API operation, +// paginators, and waiters. This make unit testing your code that calls out +// to the SDK's service client's calls easier. +// +// The best way to use this interface is so the SDK's service client's calls +// can be stubbed out for unit testing your code with the SDK without needing +// to inject custom request handlers into the SDK's request pipeline. +// +// // myFunc uses an SDK service client to make a request to +// // Amazon EventBridge. +// func myFunc(svc eventbridgeiface.EventBridgeAPI) bool { +// // Make svc.ActivateEventSource request +// } +// +// func main() { +// sess := session.New() +// svc := eventbridge.New(sess) +// +// myFunc(svc) +// } +// +// In your _test.go file: +// +// // Define a mock struct to be used in your unit tests of myFunc. +// type mockEventBridgeClient struct { +// eventbridgeiface.EventBridgeAPI +// } +// func (m *mockEventBridgeClient) ActivateEventSource(input *eventbridge.ActivateEventSourceInput) (*eventbridge.ActivateEventSourceOutput, error) { +// // mock response/functionality +// } +// +// func TestMyFunc(t *testing.T) { +// // Setup Test +// mockSvc := &mockEventBridgeClient{} +// +// 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 EventBridgeAPI interface { + ActivateEventSource(*eventbridge.ActivateEventSourceInput) (*eventbridge.ActivateEventSourceOutput, error) + ActivateEventSourceWithContext(aws.Context, *eventbridge.ActivateEventSourceInput, ...request.Option) (*eventbridge.ActivateEventSourceOutput, error) + ActivateEventSourceRequest(*eventbridge.ActivateEventSourceInput) (*request.Request, *eventbridge.ActivateEventSourceOutput) + + CancelReplay(*eventbridge.CancelReplayInput) (*eventbridge.CancelReplayOutput, error) + CancelReplayWithContext(aws.Context, *eventbridge.CancelReplayInput, ...request.Option) (*eventbridge.CancelReplayOutput, error) + CancelReplayRequest(*eventbridge.CancelReplayInput) (*request.Request, *eventbridge.CancelReplayOutput) + + CreateApiDestination(*eventbridge.CreateApiDestinationInput) (*eventbridge.CreateApiDestinationOutput, error) + CreateApiDestinationWithContext(aws.Context, *eventbridge.CreateApiDestinationInput, ...request.Option) (*eventbridge.CreateApiDestinationOutput, error) + CreateApiDestinationRequest(*eventbridge.CreateApiDestinationInput) (*request.Request, *eventbridge.CreateApiDestinationOutput) + + CreateArchive(*eventbridge.CreateArchiveInput) (*eventbridge.CreateArchiveOutput, error) + CreateArchiveWithContext(aws.Context, *eventbridge.CreateArchiveInput, ...request.Option) (*eventbridge.CreateArchiveOutput, error) + CreateArchiveRequest(*eventbridge.CreateArchiveInput) (*request.Request, *eventbridge.CreateArchiveOutput) + + CreateConnection(*eventbridge.CreateConnectionInput) (*eventbridge.CreateConnectionOutput, error) + CreateConnectionWithContext(aws.Context, *eventbridge.CreateConnectionInput, ...request.Option) (*eventbridge.CreateConnectionOutput, error) + CreateConnectionRequest(*eventbridge.CreateConnectionInput) (*request.Request, *eventbridge.CreateConnectionOutput) + + CreateEventBus(*eventbridge.CreateEventBusInput) (*eventbridge.CreateEventBusOutput, error) + CreateEventBusWithContext(aws.Context, *eventbridge.CreateEventBusInput, ...request.Option) (*eventbridge.CreateEventBusOutput, error) + CreateEventBusRequest(*eventbridge.CreateEventBusInput) (*request.Request, *eventbridge.CreateEventBusOutput) + + CreatePartnerEventSource(*eventbridge.CreatePartnerEventSourceInput) (*eventbridge.CreatePartnerEventSourceOutput, error) + CreatePartnerEventSourceWithContext(aws.Context, *eventbridge.CreatePartnerEventSourceInput, ...request.Option) (*eventbridge.CreatePartnerEventSourceOutput, error) + CreatePartnerEventSourceRequest(*eventbridge.CreatePartnerEventSourceInput) (*request.Request, *eventbridge.CreatePartnerEventSourceOutput) + + DeactivateEventSource(*eventbridge.DeactivateEventSourceInput) (*eventbridge.DeactivateEventSourceOutput, error) + DeactivateEventSourceWithContext(aws.Context, *eventbridge.DeactivateEventSourceInput, ...request.Option) (*eventbridge.DeactivateEventSourceOutput, error) + DeactivateEventSourceRequest(*eventbridge.DeactivateEventSourceInput) (*request.Request, *eventbridge.DeactivateEventSourceOutput) + + DeauthorizeConnection(*eventbridge.DeauthorizeConnectionInput) (*eventbridge.DeauthorizeConnectionOutput, error) + DeauthorizeConnectionWithContext(aws.Context, *eventbridge.DeauthorizeConnectionInput, ...request.Option) (*eventbridge.DeauthorizeConnectionOutput, error) + DeauthorizeConnectionRequest(*eventbridge.DeauthorizeConnectionInput) (*request.Request, *eventbridge.DeauthorizeConnectionOutput) + + DeleteApiDestination(*eventbridge.DeleteApiDestinationInput) (*eventbridge.DeleteApiDestinationOutput, error) + DeleteApiDestinationWithContext(aws.Context, *eventbridge.DeleteApiDestinationInput, ...request.Option) (*eventbridge.DeleteApiDestinationOutput, error) + DeleteApiDestinationRequest(*eventbridge.DeleteApiDestinationInput) (*request.Request, *eventbridge.DeleteApiDestinationOutput) + + DeleteArchive(*eventbridge.DeleteArchiveInput) (*eventbridge.DeleteArchiveOutput, error) + DeleteArchiveWithContext(aws.Context, *eventbridge.DeleteArchiveInput, ...request.Option) (*eventbridge.DeleteArchiveOutput, error) + DeleteArchiveRequest(*eventbridge.DeleteArchiveInput) (*request.Request, *eventbridge.DeleteArchiveOutput) + + DeleteConnection(*eventbridge.DeleteConnectionInput) (*eventbridge.DeleteConnectionOutput, error) + DeleteConnectionWithContext(aws.Context, *eventbridge.DeleteConnectionInput, ...request.Option) (*eventbridge.DeleteConnectionOutput, error) + DeleteConnectionRequest(*eventbridge.DeleteConnectionInput) (*request.Request, *eventbridge.DeleteConnectionOutput) + + DeleteEventBus(*eventbridge.DeleteEventBusInput) (*eventbridge.DeleteEventBusOutput, error) + DeleteEventBusWithContext(aws.Context, *eventbridge.DeleteEventBusInput, ...request.Option) (*eventbridge.DeleteEventBusOutput, error) + DeleteEventBusRequest(*eventbridge.DeleteEventBusInput) (*request.Request, *eventbridge.DeleteEventBusOutput) + + DeletePartnerEventSource(*eventbridge.DeletePartnerEventSourceInput) (*eventbridge.DeletePartnerEventSourceOutput, error) + DeletePartnerEventSourceWithContext(aws.Context, *eventbridge.DeletePartnerEventSourceInput, ...request.Option) (*eventbridge.DeletePartnerEventSourceOutput, error) + DeletePartnerEventSourceRequest(*eventbridge.DeletePartnerEventSourceInput) (*request.Request, *eventbridge.DeletePartnerEventSourceOutput) + + DeleteRule(*eventbridge.DeleteRuleInput) (*eventbridge.DeleteRuleOutput, error) + DeleteRuleWithContext(aws.Context, *eventbridge.DeleteRuleInput, ...request.Option) (*eventbridge.DeleteRuleOutput, error) + DeleteRuleRequest(*eventbridge.DeleteRuleInput) (*request.Request, *eventbridge.DeleteRuleOutput) + + DescribeApiDestination(*eventbridge.DescribeApiDestinationInput) (*eventbridge.DescribeApiDestinationOutput, error) + DescribeApiDestinationWithContext(aws.Context, *eventbridge.DescribeApiDestinationInput, ...request.Option) (*eventbridge.DescribeApiDestinationOutput, error) + DescribeApiDestinationRequest(*eventbridge.DescribeApiDestinationInput) (*request.Request, *eventbridge.DescribeApiDestinationOutput) + + DescribeArchive(*eventbridge.DescribeArchiveInput) (*eventbridge.DescribeArchiveOutput, error) + DescribeArchiveWithContext(aws.Context, *eventbridge.DescribeArchiveInput, ...request.Option) (*eventbridge.DescribeArchiveOutput, error) + DescribeArchiveRequest(*eventbridge.DescribeArchiveInput) (*request.Request, *eventbridge.DescribeArchiveOutput) + + DescribeConnection(*eventbridge.DescribeConnectionInput) (*eventbridge.DescribeConnectionOutput, error) + DescribeConnectionWithContext(aws.Context, *eventbridge.DescribeConnectionInput, ...request.Option) (*eventbridge.DescribeConnectionOutput, error) + DescribeConnectionRequest(*eventbridge.DescribeConnectionInput) (*request.Request, *eventbridge.DescribeConnectionOutput) + + DescribeEventBus(*eventbridge.DescribeEventBusInput) (*eventbridge.DescribeEventBusOutput, error) + DescribeEventBusWithContext(aws.Context, *eventbridge.DescribeEventBusInput, ...request.Option) (*eventbridge.DescribeEventBusOutput, error) + DescribeEventBusRequest(*eventbridge.DescribeEventBusInput) (*request.Request, *eventbridge.DescribeEventBusOutput) + + DescribeEventSource(*eventbridge.DescribeEventSourceInput) (*eventbridge.DescribeEventSourceOutput, error) + DescribeEventSourceWithContext(aws.Context, *eventbridge.DescribeEventSourceInput, ...request.Option) (*eventbridge.DescribeEventSourceOutput, error) + DescribeEventSourceRequest(*eventbridge.DescribeEventSourceInput) (*request.Request, *eventbridge.DescribeEventSourceOutput) + + DescribePartnerEventSource(*eventbridge.DescribePartnerEventSourceInput) (*eventbridge.DescribePartnerEventSourceOutput, error) + DescribePartnerEventSourceWithContext(aws.Context, *eventbridge.DescribePartnerEventSourceInput, ...request.Option) (*eventbridge.DescribePartnerEventSourceOutput, error) + DescribePartnerEventSourceRequest(*eventbridge.DescribePartnerEventSourceInput) (*request.Request, *eventbridge.DescribePartnerEventSourceOutput) + + DescribeReplay(*eventbridge.DescribeReplayInput) (*eventbridge.DescribeReplayOutput, error) + DescribeReplayWithContext(aws.Context, *eventbridge.DescribeReplayInput, ...request.Option) (*eventbridge.DescribeReplayOutput, error) + DescribeReplayRequest(*eventbridge.DescribeReplayInput) (*request.Request, *eventbridge.DescribeReplayOutput) + + DescribeRule(*eventbridge.DescribeRuleInput) (*eventbridge.DescribeRuleOutput, error) + DescribeRuleWithContext(aws.Context, *eventbridge.DescribeRuleInput, ...request.Option) (*eventbridge.DescribeRuleOutput, error) + DescribeRuleRequest(*eventbridge.DescribeRuleInput) (*request.Request, *eventbridge.DescribeRuleOutput) + + DisableRule(*eventbridge.DisableRuleInput) (*eventbridge.DisableRuleOutput, error) + DisableRuleWithContext(aws.Context, *eventbridge.DisableRuleInput, ...request.Option) (*eventbridge.DisableRuleOutput, error) + DisableRuleRequest(*eventbridge.DisableRuleInput) (*request.Request, *eventbridge.DisableRuleOutput) + + EnableRule(*eventbridge.EnableRuleInput) (*eventbridge.EnableRuleOutput, error) + EnableRuleWithContext(aws.Context, *eventbridge.EnableRuleInput, ...request.Option) (*eventbridge.EnableRuleOutput, error) + EnableRuleRequest(*eventbridge.EnableRuleInput) (*request.Request, *eventbridge.EnableRuleOutput) + + ListApiDestinations(*eventbridge.ListApiDestinationsInput) (*eventbridge.ListApiDestinationsOutput, error) + ListApiDestinationsWithContext(aws.Context, *eventbridge.ListApiDestinationsInput, ...request.Option) (*eventbridge.ListApiDestinationsOutput, error) + ListApiDestinationsRequest(*eventbridge.ListApiDestinationsInput) (*request.Request, *eventbridge.ListApiDestinationsOutput) + + ListArchives(*eventbridge.ListArchivesInput) (*eventbridge.ListArchivesOutput, error) + ListArchivesWithContext(aws.Context, *eventbridge.ListArchivesInput, ...request.Option) (*eventbridge.ListArchivesOutput, error) + ListArchivesRequest(*eventbridge.ListArchivesInput) (*request.Request, *eventbridge.ListArchivesOutput) + + ListConnections(*eventbridge.ListConnectionsInput) (*eventbridge.ListConnectionsOutput, error) + ListConnectionsWithContext(aws.Context, *eventbridge.ListConnectionsInput, ...request.Option) (*eventbridge.ListConnectionsOutput, error) + ListConnectionsRequest(*eventbridge.ListConnectionsInput) (*request.Request, *eventbridge.ListConnectionsOutput) + + ListEventBuses(*eventbridge.ListEventBusesInput) (*eventbridge.ListEventBusesOutput, error) + ListEventBusesWithContext(aws.Context, *eventbridge.ListEventBusesInput, ...request.Option) (*eventbridge.ListEventBusesOutput, error) + ListEventBusesRequest(*eventbridge.ListEventBusesInput) (*request.Request, *eventbridge.ListEventBusesOutput) + + ListEventSources(*eventbridge.ListEventSourcesInput) (*eventbridge.ListEventSourcesOutput, error) + ListEventSourcesWithContext(aws.Context, *eventbridge.ListEventSourcesInput, ...request.Option) (*eventbridge.ListEventSourcesOutput, error) + ListEventSourcesRequest(*eventbridge.ListEventSourcesInput) (*request.Request, *eventbridge.ListEventSourcesOutput) + + ListPartnerEventSourceAccounts(*eventbridge.ListPartnerEventSourceAccountsInput) (*eventbridge.ListPartnerEventSourceAccountsOutput, error) + ListPartnerEventSourceAccountsWithContext(aws.Context, *eventbridge.ListPartnerEventSourceAccountsInput, ...request.Option) (*eventbridge.ListPartnerEventSourceAccountsOutput, error) + ListPartnerEventSourceAccountsRequest(*eventbridge.ListPartnerEventSourceAccountsInput) (*request.Request, *eventbridge.ListPartnerEventSourceAccountsOutput) + + ListPartnerEventSources(*eventbridge.ListPartnerEventSourcesInput) (*eventbridge.ListPartnerEventSourcesOutput, error) + ListPartnerEventSourcesWithContext(aws.Context, *eventbridge.ListPartnerEventSourcesInput, ...request.Option) (*eventbridge.ListPartnerEventSourcesOutput, error) + ListPartnerEventSourcesRequest(*eventbridge.ListPartnerEventSourcesInput) (*request.Request, *eventbridge.ListPartnerEventSourcesOutput) + + ListReplays(*eventbridge.ListReplaysInput) (*eventbridge.ListReplaysOutput, error) + ListReplaysWithContext(aws.Context, *eventbridge.ListReplaysInput, ...request.Option) (*eventbridge.ListReplaysOutput, error) + ListReplaysRequest(*eventbridge.ListReplaysInput) (*request.Request, *eventbridge.ListReplaysOutput) + + ListRuleNamesByTarget(*eventbridge.ListRuleNamesByTargetInput) (*eventbridge.ListRuleNamesByTargetOutput, error) + ListRuleNamesByTargetWithContext(aws.Context, *eventbridge.ListRuleNamesByTargetInput, ...request.Option) (*eventbridge.ListRuleNamesByTargetOutput, error) + ListRuleNamesByTargetRequest(*eventbridge.ListRuleNamesByTargetInput) (*request.Request, *eventbridge.ListRuleNamesByTargetOutput) + + ListRules(*eventbridge.ListRulesInput) (*eventbridge.ListRulesOutput, error) + ListRulesWithContext(aws.Context, *eventbridge.ListRulesInput, ...request.Option) (*eventbridge.ListRulesOutput, error) + ListRulesRequest(*eventbridge.ListRulesInput) (*request.Request, *eventbridge.ListRulesOutput) + + ListTagsForResource(*eventbridge.ListTagsForResourceInput) (*eventbridge.ListTagsForResourceOutput, error) + ListTagsForResourceWithContext(aws.Context, *eventbridge.ListTagsForResourceInput, ...request.Option) (*eventbridge.ListTagsForResourceOutput, error) + ListTagsForResourceRequest(*eventbridge.ListTagsForResourceInput) (*request.Request, *eventbridge.ListTagsForResourceOutput) + + ListTargetsByRule(*eventbridge.ListTargetsByRuleInput) (*eventbridge.ListTargetsByRuleOutput, error) + ListTargetsByRuleWithContext(aws.Context, *eventbridge.ListTargetsByRuleInput, ...request.Option) (*eventbridge.ListTargetsByRuleOutput, error) + ListTargetsByRuleRequest(*eventbridge.ListTargetsByRuleInput) (*request.Request, *eventbridge.ListTargetsByRuleOutput) + + PutEvents(*eventbridge.PutEventsInput) (*eventbridge.PutEventsOutput, error) + PutEventsWithContext(aws.Context, *eventbridge.PutEventsInput, ...request.Option) (*eventbridge.PutEventsOutput, error) + PutEventsRequest(*eventbridge.PutEventsInput) (*request.Request, *eventbridge.PutEventsOutput) + + PutPartnerEvents(*eventbridge.PutPartnerEventsInput) (*eventbridge.PutPartnerEventsOutput, error) + PutPartnerEventsWithContext(aws.Context, *eventbridge.PutPartnerEventsInput, ...request.Option) (*eventbridge.PutPartnerEventsOutput, error) + PutPartnerEventsRequest(*eventbridge.PutPartnerEventsInput) (*request.Request, *eventbridge.PutPartnerEventsOutput) + + PutPermission(*eventbridge.PutPermissionInput) (*eventbridge.PutPermissionOutput, error) + PutPermissionWithContext(aws.Context, *eventbridge.PutPermissionInput, ...request.Option) (*eventbridge.PutPermissionOutput, error) + PutPermissionRequest(*eventbridge.PutPermissionInput) (*request.Request, *eventbridge.PutPermissionOutput) + + PutRule(*eventbridge.PutRuleInput) (*eventbridge.PutRuleOutput, error) + PutRuleWithContext(aws.Context, *eventbridge.PutRuleInput, ...request.Option) (*eventbridge.PutRuleOutput, error) + PutRuleRequest(*eventbridge.PutRuleInput) (*request.Request, *eventbridge.PutRuleOutput) + + PutTargets(*eventbridge.PutTargetsInput) (*eventbridge.PutTargetsOutput, error) + PutTargetsWithContext(aws.Context, *eventbridge.PutTargetsInput, ...request.Option) (*eventbridge.PutTargetsOutput, error) + PutTargetsRequest(*eventbridge.PutTargetsInput) (*request.Request, *eventbridge.PutTargetsOutput) + + RemovePermission(*eventbridge.RemovePermissionInput) (*eventbridge.RemovePermissionOutput, error) + RemovePermissionWithContext(aws.Context, *eventbridge.RemovePermissionInput, ...request.Option) (*eventbridge.RemovePermissionOutput, error) + RemovePermissionRequest(*eventbridge.RemovePermissionInput) (*request.Request, *eventbridge.RemovePermissionOutput) + + RemoveTargets(*eventbridge.RemoveTargetsInput) (*eventbridge.RemoveTargetsOutput, error) + RemoveTargetsWithContext(aws.Context, *eventbridge.RemoveTargetsInput, ...request.Option) (*eventbridge.RemoveTargetsOutput, error) + RemoveTargetsRequest(*eventbridge.RemoveTargetsInput) (*request.Request, *eventbridge.RemoveTargetsOutput) + + StartReplay(*eventbridge.StartReplayInput) (*eventbridge.StartReplayOutput, error) + StartReplayWithContext(aws.Context, *eventbridge.StartReplayInput, ...request.Option) (*eventbridge.StartReplayOutput, error) + StartReplayRequest(*eventbridge.StartReplayInput) (*request.Request, *eventbridge.StartReplayOutput) + + TagResource(*eventbridge.TagResourceInput) (*eventbridge.TagResourceOutput, error) + TagResourceWithContext(aws.Context, *eventbridge.TagResourceInput, ...request.Option) (*eventbridge.TagResourceOutput, error) + TagResourceRequest(*eventbridge.TagResourceInput) (*request.Request, *eventbridge.TagResourceOutput) + + TestEventPattern(*eventbridge.TestEventPatternInput) (*eventbridge.TestEventPatternOutput, error) + TestEventPatternWithContext(aws.Context, *eventbridge.TestEventPatternInput, ...request.Option) (*eventbridge.TestEventPatternOutput, error) + TestEventPatternRequest(*eventbridge.TestEventPatternInput) (*request.Request, *eventbridge.TestEventPatternOutput) + + UntagResource(*eventbridge.UntagResourceInput) (*eventbridge.UntagResourceOutput, error) + UntagResourceWithContext(aws.Context, *eventbridge.UntagResourceInput, ...request.Option) (*eventbridge.UntagResourceOutput, error) + UntagResourceRequest(*eventbridge.UntagResourceInput) (*request.Request, *eventbridge.UntagResourceOutput) + + UpdateApiDestination(*eventbridge.UpdateApiDestinationInput) (*eventbridge.UpdateApiDestinationOutput, error) + UpdateApiDestinationWithContext(aws.Context, *eventbridge.UpdateApiDestinationInput, ...request.Option) (*eventbridge.UpdateApiDestinationOutput, error) + UpdateApiDestinationRequest(*eventbridge.UpdateApiDestinationInput) (*request.Request, *eventbridge.UpdateApiDestinationOutput) + + UpdateArchive(*eventbridge.UpdateArchiveInput) (*eventbridge.UpdateArchiveOutput, error) + UpdateArchiveWithContext(aws.Context, *eventbridge.UpdateArchiveInput, ...request.Option) (*eventbridge.UpdateArchiveOutput, error) + UpdateArchiveRequest(*eventbridge.UpdateArchiveInput) (*request.Request, *eventbridge.UpdateArchiveOutput) + + UpdateConnection(*eventbridge.UpdateConnectionInput) (*eventbridge.UpdateConnectionOutput, error) + UpdateConnectionWithContext(aws.Context, *eventbridge.UpdateConnectionInput, ...request.Option) (*eventbridge.UpdateConnectionOutput, error) + UpdateConnectionRequest(*eventbridge.UpdateConnectionInput) (*request.Request, *eventbridge.UpdateConnectionOutput) +} + +var _ EventBridgeAPI = (*eventbridge.EventBridge)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/eventbridge/service.go b/vendor/github.com/aws/aws-sdk-go/service/eventbridge/service.go new file mode 100644 index 0000000000..34aa9d67ed --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/eventbridge/service.go @@ -0,0 +1,103 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package eventbridge + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" +) + +// EventBridge provides the API operation methods for making requests to +// Amazon EventBridge. See this package's package overview docs +// for details on the service. +// +// EventBridge methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type EventBridge struct { + *client.Client +} + +// Used for custom client initialization logic +var initClient func(*client.Client) + +// Used for custom request initialization logic +var initRequest func(*request.Request) + +// Service information constants +const ( + ServiceName = "EventBridge" // Name of service. + EndpointsID = "events" // ID to lookup a service endpoint with. + ServiceID = "EventBridge" // ServiceID is a unique identifier of a specific service. +) + +// New creates a new instance of the EventBridge client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// mySession := session.Must(session.NewSession()) +// +// // Create a EventBridge client from just a session. +// svc := eventbridge.New(mySession) +// +// // Create a EventBridge client with additional configuration +// svc := eventbridge.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *EventBridge { + c := p.ClientConfig(EndpointsID, cfgs...) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *EventBridge { + svc := &EventBridge{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + PartitionID: partitionID, + Endpoint: endpoint, + APIVersion: "2015-10-07", + JSONVersion: "1.1", + TargetPrefix: "AWSEvents", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) + svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) + svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) + svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a EventBridge operation and runs any +// custom request initialization. +func (c *EventBridge) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + // Run custom request initialization if present + if initRequest != nil { + initRequest(req) + } + + return req +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/service/sqs/BUILD.bazel new file mode 100644 index 0000000000..fa57a00e0c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sqs/BUILD.bazel @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "api.go", + "checksums.go", + "customizations.go", + "doc.go", + "errors.go", + "service.go", + ], + importmap = "k8s.io/kops/vendor/github.com/aws/aws-sdk-go/service/sqs", + importpath = "github.com/aws/aws-sdk-go/service/sqs", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/awsutil:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/client:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/client/metadata:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/signer/v4:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/private/protocol/query:go_default_library", + ], +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/api.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/api.go new file mode 100644 index 0000000000..38ef4185f4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sqs/api.go @@ -0,0 +1,5443 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package sqs + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/query" +) + +const opAddPermission = "AddPermission" + +// AddPermissionRequest generates a "aws/request.Request" representing the +// client's request for the AddPermission operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AddPermission for more information on using the AddPermission +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AddPermissionRequest method. +// req, resp := client.AddPermissionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/AddPermission +func (c *SQS) AddPermissionRequest(input *AddPermissionInput) (req *request.Request, output *AddPermissionOutput) { + op := &request.Operation{ + Name: opAddPermission, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AddPermissionInput{} + } + + output = &AddPermissionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// AddPermission API operation for Amazon Simple Queue Service. +// +// Adds a permission to a queue for a specific principal (https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P). +// This allows sharing access to the queue. +// +// When you create a queue, you have full control access rights for the queue. +// Only you, the owner of the queue, can grant or deny permissions to the queue. +// For more information about these permissions, see Allow Developers to Write +// Messages to a Shared Queue (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-writing-an-sqs-policy.html#write-messages-to-shared-queue) +// in the Amazon Simple Queue Service Developer Guide. +// +// * AddPermission generates a policy for you. You can use SetQueueAttributes +// to upload your policy. For more information, see Using Custom Policies +// with the Amazon SQS Access Policy Language (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-creating-custom-policies.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// * An Amazon SQS policy can have a maximum of 7 actions. +// +// * To remove the ability to change queue permissions, you must deny permission +// to the AddPermission, RemovePermission, and SetQueueAttributes actions +// in your IAM policy. +// +// Some actions take lists of parameters. These lists are specified using the +// param.n notation. Values of n are integers starting from 1. For example, +// a parameter list with two elements looks like this: +// +// &AttributeName.1=first +// +// &AttributeName.2=second +// +// Cross-account permissions don't apply to this action. For more information, +// see Grant cross-account permissions to a role and a user name (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation AddPermission for usage and error information. +// +// Returned Error Codes: +// * ErrCodeOverLimit "OverLimit" +// The specified action violates a limit. For example, ReceiveMessage returns +// this error if the maximum number of inflight messages is reached and AddPermission +// returns this error if the maximum number of permissions for the queue is +// reached. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/AddPermission +func (c *SQS) AddPermission(input *AddPermissionInput) (*AddPermissionOutput, error) { + req, out := c.AddPermissionRequest(input) + return out, req.Send() +} + +// AddPermissionWithContext is the same as AddPermission with the addition of +// the ability to pass a context and additional request options. +// +// See AddPermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) AddPermissionWithContext(ctx aws.Context, input *AddPermissionInput, opts ...request.Option) (*AddPermissionOutput, error) { + req, out := c.AddPermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opChangeMessageVisibility = "ChangeMessageVisibility" + +// ChangeMessageVisibilityRequest generates a "aws/request.Request" representing the +// client's request for the ChangeMessageVisibility operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ChangeMessageVisibility for more information on using the ChangeMessageVisibility +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ChangeMessageVisibilityRequest method. +// req, resp := client.ChangeMessageVisibilityRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibility +func (c *SQS) ChangeMessageVisibilityRequest(input *ChangeMessageVisibilityInput) (req *request.Request, output *ChangeMessageVisibilityOutput) { + op := &request.Operation{ + Name: opChangeMessageVisibility, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ChangeMessageVisibilityInput{} + } + + output = &ChangeMessageVisibilityOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// ChangeMessageVisibility API operation for Amazon Simple Queue Service. +// +// Changes the visibility timeout of a specified message in a queue to a new +// value. The default visibility timeout for a message is 30 seconds. The minimum +// is 0 seconds. The maximum is 12 hours. For more information, see Visibility +// Timeout (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// For example, you have a message with a visibility timeout of 5 minutes. After +// 3 minutes, you call ChangeMessageVisibility with a timeout of 10 minutes. +// You can continue to call ChangeMessageVisibility to extend the visibility +// timeout to the maximum allowed time. If you try to extend the visibility +// timeout beyond the maximum, your request is rejected. +// +// An Amazon SQS message has three basic states: +// +// Sent to a queue by a producer. +// +// Received from the queue by a consumer. +// +// Deleted from the queue. +// +// A message is considered to be stored after it is sent to a queue by a producer, +// but not yet received from the queue by a consumer (that is, between states +// 1 and 2). There is no limit to the number of stored messages. A message is +// considered to be in flight after it is received from a queue by a consumer, +// but not yet deleted from the queue (that is, between states 2 and 3). There +// is a limit to the number of inflight messages. +// +// Limits that apply to inflight messages are unrelated to the unlimited number +// of stored messages. +// +// For most standard queues (depending on queue traffic and message backlog), +// there can be a maximum of approximately 120,000 inflight messages (received +// from a queue by a consumer, but not yet deleted from the queue). If you reach +// this limit, Amazon SQS returns the OverLimit error message. To avoid reaching +// the limit, you should delete messages from the queue after they're processed. +// You can also increase the number of queues you use to process your messages. +// To request a limit increase, file a support request (https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-sqs). +// +// For FIFO queues, there can be a maximum of 20,000 inflight messages (received +// from a queue by a consumer, but not yet deleted from the queue). If you reach +// this limit, Amazon SQS returns no error messages. +// +// If you attempt to set the VisibilityTimeout to a value greater than the maximum +// time left, Amazon SQS returns an error. Amazon SQS doesn't automatically +// recalculate and increase the timeout to the maximum remaining time. +// +// Unlike with a queue, when you change the visibility timeout for a specific +// message the timeout value is applied immediately but isn't saved in memory +// for that message. If you don't delete a message after it is received, the +// visibility timeout for the message reverts to the original timeout value +// (not to the value you set using the ChangeMessageVisibility action) the next +// time the message is received. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation ChangeMessageVisibility for usage and error information. +// +// Returned Error Codes: +// * ErrCodeMessageNotInflight "AWS.SimpleQueueService.MessageNotInflight" +// The specified message isn't in flight. +// +// * ErrCodeReceiptHandleIsInvalid "ReceiptHandleIsInvalid" +// The specified receipt handle isn't valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibility +func (c *SQS) ChangeMessageVisibility(input *ChangeMessageVisibilityInput) (*ChangeMessageVisibilityOutput, error) { + req, out := c.ChangeMessageVisibilityRequest(input) + return out, req.Send() +} + +// ChangeMessageVisibilityWithContext is the same as ChangeMessageVisibility with the addition of +// the ability to pass a context and additional request options. +// +// See ChangeMessageVisibility for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) ChangeMessageVisibilityWithContext(ctx aws.Context, input *ChangeMessageVisibilityInput, opts ...request.Option) (*ChangeMessageVisibilityOutput, error) { + req, out := c.ChangeMessageVisibilityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opChangeMessageVisibilityBatch = "ChangeMessageVisibilityBatch" + +// ChangeMessageVisibilityBatchRequest generates a "aws/request.Request" representing the +// client's request for the ChangeMessageVisibilityBatch operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ChangeMessageVisibilityBatch for more information on using the ChangeMessageVisibilityBatch +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ChangeMessageVisibilityBatchRequest method. +// req, resp := client.ChangeMessageVisibilityBatchRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityBatch +func (c *SQS) ChangeMessageVisibilityBatchRequest(input *ChangeMessageVisibilityBatchInput) (req *request.Request, output *ChangeMessageVisibilityBatchOutput) { + op := &request.Operation{ + Name: opChangeMessageVisibilityBatch, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ChangeMessageVisibilityBatchInput{} + } + + output = &ChangeMessageVisibilityBatchOutput{} + req = c.newRequest(op, input, output) + return +} + +// ChangeMessageVisibilityBatch API operation for Amazon Simple Queue Service. +// +// Changes the visibility timeout of multiple messages. This is a batch version +// of ChangeMessageVisibility. The result of the action on each message is reported +// individually in the response. You can send up to 10 ChangeMessageVisibility +// requests with each ChangeMessageVisibilityBatch action. +// +// Because the batch request can result in a combination of successful and unsuccessful +// actions, you should check for batch errors even when the call returns an +// HTTP status code of 200. +// +// Some actions take lists of parameters. These lists are specified using the +// param.n notation. Values of n are integers starting from 1. For example, +// a parameter list with two elements looks like this: +// +// &AttributeName.1=first +// +// &AttributeName.2=second +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation ChangeMessageVisibilityBatch for usage and error information. +// +// Returned Error Codes: +// * ErrCodeTooManyEntriesInBatchRequest "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" +// The batch request contains more entries than permissible. +// +// * ErrCodeEmptyBatchRequest "AWS.SimpleQueueService.EmptyBatchRequest" +// The batch request doesn't contain any entries. +// +// * ErrCodeBatchEntryIdsNotDistinct "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" +// Two or more batch entries in the request have the same Id. +// +// * ErrCodeInvalidBatchEntryId "AWS.SimpleQueueService.InvalidBatchEntryId" +// The Id of a batch entry in a batch request doesn't abide by the specification. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityBatch +func (c *SQS) ChangeMessageVisibilityBatch(input *ChangeMessageVisibilityBatchInput) (*ChangeMessageVisibilityBatchOutput, error) { + req, out := c.ChangeMessageVisibilityBatchRequest(input) + return out, req.Send() +} + +// ChangeMessageVisibilityBatchWithContext is the same as ChangeMessageVisibilityBatch with the addition of +// the ability to pass a context and additional request options. +// +// See ChangeMessageVisibilityBatch for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) ChangeMessageVisibilityBatchWithContext(ctx aws.Context, input *ChangeMessageVisibilityBatchInput, opts ...request.Option) (*ChangeMessageVisibilityBatchOutput, error) { + req, out := c.ChangeMessageVisibilityBatchRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateQueue = "CreateQueue" + +// CreateQueueRequest generates a "aws/request.Request" representing the +// client's request for the CreateQueue operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateQueue for more information on using the CreateQueue +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateQueueRequest method. +// req, resp := client.CreateQueueRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/CreateQueue +func (c *SQS) CreateQueueRequest(input *CreateQueueInput) (req *request.Request, output *CreateQueueOutput) { + op := &request.Operation{ + Name: opCreateQueue, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateQueueInput{} + } + + output = &CreateQueueOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateQueue API operation for Amazon Simple Queue Service. +// +// Creates a new standard or FIFO queue. You can pass one or more attributes +// in the request. Keep the following in mind: +// +// * If you don't specify the FifoQueue attribute, Amazon SQS creates a standard +// queue. You can't change the queue type after you create it and you can't +// convert an existing standard queue into a FIFO queue. You must either +// create a new FIFO queue for your application or delete your existing standard +// queue and recreate it as a FIFO queue. For more information, see Moving +// From a Standard Queue to a FIFO Queue (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-moving) +// in the Amazon Simple Queue Service Developer Guide. +// +// * If you don't provide a value for an attribute, the queue is created +// with the default value for the attribute. +// +// * If you delete a queue, you must wait at least 60 seconds before creating +// a queue with the same name. +// +// To successfully create a new queue, you must provide a queue name that adheres +// to the limits related to queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/limits-queues.html) +// and is unique within the scope of your queues. +// +// After you create a queue, you must wait at least one second after the queue +// is created to be able to use the queue. +// +// To get the queue URL, use the GetQueueUrl action. GetQueueUrl requires only +// the QueueName parameter. be aware of existing queue names: +// +// * If you provide the name of an existing queue along with the exact names +// and values of all the queue's attributes, CreateQueue returns the queue +// URL for the existing queue. +// +// * If the queue name, attribute names, or attribute values don't match +// an existing queue, CreateQueue returns an error. +// +// Some actions take lists of parameters. These lists are specified using the +// param.n notation. Values of n are integers starting from 1. For example, +// a parameter list with two elements looks like this: +// +// &AttributeName.1=first +// +// &AttributeName.2=second +// +// Cross-account permissions don't apply to this action. For more information, +// see Grant cross-account permissions to a role and a user name (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation CreateQueue for usage and error information. +// +// Returned Error Codes: +// * ErrCodeQueueDeletedRecently "AWS.SimpleQueueService.QueueDeletedRecently" +// You must wait 60 seconds after deleting a queue before you can create another +// queue with the same name. +// +// * ErrCodeQueueNameExists "QueueAlreadyExists" +// A queue with this name already exists. Amazon SQS returns this error only +// if the request includes attributes whose values differ from those of the +// existing queue. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/CreateQueue +func (c *SQS) CreateQueue(input *CreateQueueInput) (*CreateQueueOutput, error) { + req, out := c.CreateQueueRequest(input) + return out, req.Send() +} + +// CreateQueueWithContext is the same as CreateQueue with the addition of +// the ability to pass a context and additional request options. +// +// See CreateQueue for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) CreateQueueWithContext(ctx aws.Context, input *CreateQueueInput, opts ...request.Option) (*CreateQueueOutput, error) { + req, out := c.CreateQueueRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteMessage = "DeleteMessage" + +// DeleteMessageRequest generates a "aws/request.Request" representing the +// client's request for the DeleteMessage operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteMessage for more information on using the DeleteMessage +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteMessageRequest method. +// req, resp := client.DeleteMessageRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessage +func (c *SQS) DeleteMessageRequest(input *DeleteMessageInput) (req *request.Request, output *DeleteMessageOutput) { + op := &request.Operation{ + Name: opDeleteMessage, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteMessageInput{} + } + + output = &DeleteMessageOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteMessage API operation for Amazon Simple Queue Service. +// +// Deletes the specified message from the specified queue. To select the message +// to delete, use the ReceiptHandle of the message (not the MessageId which +// you receive when you send the message). Amazon SQS can delete a message from +// a queue even if a visibility timeout setting causes the message to be locked +// by another consumer. Amazon SQS automatically deletes messages left in a +// queue longer than the retention period configured for the queue. +// +// The ReceiptHandle is associated with a specific instance of receiving a message. +// If you receive a message more than once, the ReceiptHandle is different each +// time you receive a message. When you use the DeleteMessage action, you must +// provide the most recently received ReceiptHandle for the message (otherwise, +// the request succeeds, but the message might not be deleted). +// +// For standard queues, it is possible to receive a message even after you delete +// it. This might happen on rare occasions if one of the servers which stores +// a copy of the message is unavailable when you send the request to delete +// the message. The copy remains on the server and might be returned to you +// during a subsequent receive request. You should ensure that your application +// is idempotent, so that receiving a message more than once does not cause +// issues. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation DeleteMessage for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidIdFormat "InvalidIdFormat" +// The specified receipt handle isn't valid for the current version. +// +// * ErrCodeReceiptHandleIsInvalid "ReceiptHandleIsInvalid" +// The specified receipt handle isn't valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessage +func (c *SQS) DeleteMessage(input *DeleteMessageInput) (*DeleteMessageOutput, error) { + req, out := c.DeleteMessageRequest(input) + return out, req.Send() +} + +// DeleteMessageWithContext is the same as DeleteMessage with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteMessage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) DeleteMessageWithContext(ctx aws.Context, input *DeleteMessageInput, opts ...request.Option) (*DeleteMessageOutput, error) { + req, out := c.DeleteMessageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteMessageBatch = "DeleteMessageBatch" + +// DeleteMessageBatchRequest generates a "aws/request.Request" representing the +// client's request for the DeleteMessageBatch operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteMessageBatch for more information on using the DeleteMessageBatch +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteMessageBatchRequest method. +// req, resp := client.DeleteMessageBatchRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageBatch +func (c *SQS) DeleteMessageBatchRequest(input *DeleteMessageBatchInput) (req *request.Request, output *DeleteMessageBatchOutput) { + op := &request.Operation{ + Name: opDeleteMessageBatch, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteMessageBatchInput{} + } + + output = &DeleteMessageBatchOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteMessageBatch API operation for Amazon Simple Queue Service. +// +// Deletes up to ten messages from the specified queue. This is a batch version +// of DeleteMessage. The result of the action on each message is reported individually +// in the response. +// +// Because the batch request can result in a combination of successful and unsuccessful +// actions, you should check for batch errors even when the call returns an +// HTTP status code of 200. +// +// Some actions take lists of parameters. These lists are specified using the +// param.n notation. Values of n are integers starting from 1. For example, +// a parameter list with two elements looks like this: +// +// &AttributeName.1=first +// +// &AttributeName.2=second +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation DeleteMessageBatch for usage and error information. +// +// Returned Error Codes: +// * ErrCodeTooManyEntriesInBatchRequest "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" +// The batch request contains more entries than permissible. +// +// * ErrCodeEmptyBatchRequest "AWS.SimpleQueueService.EmptyBatchRequest" +// The batch request doesn't contain any entries. +// +// * ErrCodeBatchEntryIdsNotDistinct "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" +// Two or more batch entries in the request have the same Id. +// +// * ErrCodeInvalidBatchEntryId "AWS.SimpleQueueService.InvalidBatchEntryId" +// The Id of a batch entry in a batch request doesn't abide by the specification. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageBatch +func (c *SQS) DeleteMessageBatch(input *DeleteMessageBatchInput) (*DeleteMessageBatchOutput, error) { + req, out := c.DeleteMessageBatchRequest(input) + return out, req.Send() +} + +// DeleteMessageBatchWithContext is the same as DeleteMessageBatch with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteMessageBatch for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) DeleteMessageBatchWithContext(ctx aws.Context, input *DeleteMessageBatchInput, opts ...request.Option) (*DeleteMessageBatchOutput, error) { + req, out := c.DeleteMessageBatchRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteQueue = "DeleteQueue" + +// DeleteQueueRequest generates a "aws/request.Request" representing the +// client's request for the DeleteQueue operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteQueue for more information on using the DeleteQueue +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteQueueRequest method. +// req, resp := client.DeleteQueueRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteQueue +func (c *SQS) DeleteQueueRequest(input *DeleteQueueInput) (req *request.Request, output *DeleteQueueOutput) { + op := &request.Operation{ + Name: opDeleteQueue, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteQueueInput{} + } + + output = &DeleteQueueOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteQueue API operation for Amazon Simple Queue Service. +// +// Deletes the queue specified by the QueueUrl, regardless of the queue's contents. +// +// Be careful with the DeleteQueue action: When you delete a queue, any messages +// in the queue are no longer available. +// +// When you delete a queue, the deletion process takes up to 60 seconds. Requests +// you send involving that queue during the 60 seconds might succeed. For example, +// a SendMessage request might succeed, but after 60 seconds the queue and the +// message you sent no longer exist. +// +// When you delete a queue, you must wait at least 60 seconds before creating +// a queue with the same name. +// +// Cross-account permissions don't apply to this action. For more information, +// see Grant cross-account permissions to a role and a user name (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation DeleteQueue for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteQueue +func (c *SQS) DeleteQueue(input *DeleteQueueInput) (*DeleteQueueOutput, error) { + req, out := c.DeleteQueueRequest(input) + return out, req.Send() +} + +// DeleteQueueWithContext is the same as DeleteQueue with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteQueue for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) DeleteQueueWithContext(ctx aws.Context, input *DeleteQueueInput, opts ...request.Option) (*DeleteQueueOutput, error) { + req, out := c.DeleteQueueRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetQueueAttributes = "GetQueueAttributes" + +// GetQueueAttributesRequest generates a "aws/request.Request" representing the +// client's request for the GetQueueAttributes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetQueueAttributes for more information on using the GetQueueAttributes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetQueueAttributesRequest method. +// req, resp := client.GetQueueAttributesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueAttributes +func (c *SQS) GetQueueAttributesRequest(input *GetQueueAttributesInput) (req *request.Request, output *GetQueueAttributesOutput) { + op := &request.Operation{ + Name: opGetQueueAttributes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetQueueAttributesInput{} + } + + output = &GetQueueAttributesOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetQueueAttributes API operation for Amazon Simple Queue Service. +// +// Gets attributes for the specified queue. +// +// To determine whether a queue is FIFO (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html), +// you can check whether QueueName ends with the .fifo suffix. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation GetQueueAttributes for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidAttributeName "InvalidAttributeName" +// The specified attribute doesn't exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueAttributes +func (c *SQS) GetQueueAttributes(input *GetQueueAttributesInput) (*GetQueueAttributesOutput, error) { + req, out := c.GetQueueAttributesRequest(input) + return out, req.Send() +} + +// GetQueueAttributesWithContext is the same as GetQueueAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See GetQueueAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) GetQueueAttributesWithContext(ctx aws.Context, input *GetQueueAttributesInput, opts ...request.Option) (*GetQueueAttributesOutput, error) { + req, out := c.GetQueueAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetQueueUrl = "GetQueueUrl" + +// GetQueueUrlRequest generates a "aws/request.Request" representing the +// client's request for the GetQueueUrl operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetQueueUrl for more information on using the GetQueueUrl +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetQueueUrlRequest method. +// req, resp := client.GetQueueUrlRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueUrl +func (c *SQS) GetQueueUrlRequest(input *GetQueueUrlInput) (req *request.Request, output *GetQueueUrlOutput) { + op := &request.Operation{ + Name: opGetQueueUrl, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetQueueUrlInput{} + } + + output = &GetQueueUrlOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetQueueUrl API operation for Amazon Simple Queue Service. +// +// Returns the URL of an existing Amazon SQS queue. +// +// To access a queue that belongs to another AWS account, use the QueueOwnerAWSAccountId +// parameter to specify the account ID of the queue's owner. The queue's owner +// must grant you permission to access the queue. For more information about +// shared queue access, see AddPermission or see Allow Developers to Write Messages +// to a Shared Queue (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-writing-an-sqs-policy.html#write-messages-to-shared-queue) +// in the Amazon Simple Queue Service Developer Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation GetQueueUrl for usage and error information. +// +// Returned Error Codes: +// * ErrCodeQueueDoesNotExist "AWS.SimpleQueueService.NonExistentQueue" +// The specified queue doesn't exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueUrl +func (c *SQS) GetQueueUrl(input *GetQueueUrlInput) (*GetQueueUrlOutput, error) { + req, out := c.GetQueueUrlRequest(input) + return out, req.Send() +} + +// GetQueueUrlWithContext is the same as GetQueueUrl with the addition of +// the ability to pass a context and additional request options. +// +// See GetQueueUrl for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) GetQueueUrlWithContext(ctx aws.Context, input *GetQueueUrlInput, opts ...request.Option) (*GetQueueUrlOutput, error) { + req, out := c.GetQueueUrlRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListDeadLetterSourceQueues = "ListDeadLetterSourceQueues" + +// ListDeadLetterSourceQueuesRequest generates a "aws/request.Request" representing the +// client's request for the ListDeadLetterSourceQueues operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListDeadLetterSourceQueues for more information on using the ListDeadLetterSourceQueues +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListDeadLetterSourceQueuesRequest method. +// req, resp := client.ListDeadLetterSourceQueuesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListDeadLetterSourceQueues +func (c *SQS) ListDeadLetterSourceQueuesRequest(input *ListDeadLetterSourceQueuesInput) (req *request.Request, output *ListDeadLetterSourceQueuesOutput) { + op := &request.Operation{ + Name: opListDeadLetterSourceQueues, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListDeadLetterSourceQueuesInput{} + } + + output = &ListDeadLetterSourceQueuesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListDeadLetterSourceQueues API operation for Amazon Simple Queue Service. +// +// Returns a list of your queues that have the RedrivePolicy queue attribute +// configured with a dead-letter queue. +// +// The ListDeadLetterSourceQueues methods supports pagination. Set parameter +// MaxResults in the request to specify the maximum number of results to be +// returned in the response. If you do not set MaxResults, the response includes +// a maximum of 1,000 results. If you set MaxResults and there are additional +// results to display, the response includes a value for NextToken. Use NextToken +// as a parameter in your next request to ListDeadLetterSourceQueues to receive +// the next page of results. +// +// For more information about using dead-letter queues, see Using Amazon SQS +// Dead-Letter Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation ListDeadLetterSourceQueues for usage and error information. +// +// Returned Error Codes: +// * ErrCodeQueueDoesNotExist "AWS.SimpleQueueService.NonExistentQueue" +// The specified queue doesn't exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListDeadLetterSourceQueues +func (c *SQS) ListDeadLetterSourceQueues(input *ListDeadLetterSourceQueuesInput) (*ListDeadLetterSourceQueuesOutput, error) { + req, out := c.ListDeadLetterSourceQueuesRequest(input) + return out, req.Send() +} + +// ListDeadLetterSourceQueuesWithContext is the same as ListDeadLetterSourceQueues with the addition of +// the ability to pass a context and additional request options. +// +// See ListDeadLetterSourceQueues for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) ListDeadLetterSourceQueuesWithContext(ctx aws.Context, input *ListDeadLetterSourceQueuesInput, opts ...request.Option) (*ListDeadLetterSourceQueuesOutput, error) { + req, out := c.ListDeadLetterSourceQueuesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListDeadLetterSourceQueuesPages iterates over the pages of a ListDeadLetterSourceQueues operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListDeadLetterSourceQueues method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a ListDeadLetterSourceQueues operation. +// pageNum := 0 +// err := client.ListDeadLetterSourceQueuesPages(params, +// func(page *sqs.ListDeadLetterSourceQueuesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SQS) ListDeadLetterSourceQueuesPages(input *ListDeadLetterSourceQueuesInput, fn func(*ListDeadLetterSourceQueuesOutput, bool) bool) error { + return c.ListDeadLetterSourceQueuesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListDeadLetterSourceQueuesPagesWithContext same as ListDeadLetterSourceQueuesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) ListDeadLetterSourceQueuesPagesWithContext(ctx aws.Context, input *ListDeadLetterSourceQueuesInput, fn func(*ListDeadLetterSourceQueuesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListDeadLetterSourceQueuesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListDeadLetterSourceQueuesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListDeadLetterSourceQueuesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListQueueTags = "ListQueueTags" + +// ListQueueTagsRequest generates a "aws/request.Request" representing the +// client's request for the ListQueueTags operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListQueueTags for more information on using the ListQueueTags +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListQueueTagsRequest method. +// req, resp := client.ListQueueTagsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListQueueTags +func (c *SQS) ListQueueTagsRequest(input *ListQueueTagsInput) (req *request.Request, output *ListQueueTagsOutput) { + op := &request.Operation{ + Name: opListQueueTags, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListQueueTagsInput{} + } + + output = &ListQueueTagsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListQueueTags API operation for Amazon Simple Queue Service. +// +// List all cost allocation tags added to the specified Amazon SQS queue. For +// an overview, see Tagging Your Amazon SQS Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// Cross-account permissions don't apply to this action. For more information, +// see Grant cross-account permissions to a role and a user name (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation ListQueueTags for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListQueueTags +func (c *SQS) ListQueueTags(input *ListQueueTagsInput) (*ListQueueTagsOutput, error) { + req, out := c.ListQueueTagsRequest(input) + return out, req.Send() +} + +// ListQueueTagsWithContext is the same as ListQueueTags with the addition of +// the ability to pass a context and additional request options. +// +// See ListQueueTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) ListQueueTagsWithContext(ctx aws.Context, input *ListQueueTagsInput, opts ...request.Option) (*ListQueueTagsOutput, error) { + req, out := c.ListQueueTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListQueues = "ListQueues" + +// ListQueuesRequest generates a "aws/request.Request" representing the +// client's request for the ListQueues operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListQueues for more information on using the ListQueues +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListQueuesRequest method. +// req, resp := client.ListQueuesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListQueues +func (c *SQS) ListQueuesRequest(input *ListQueuesInput) (req *request.Request, output *ListQueuesOutput) { + op := &request.Operation{ + Name: opListQueues, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListQueuesInput{} + } + + output = &ListQueuesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListQueues API operation for Amazon Simple Queue Service. +// +// Returns a list of your queues in the current region. The response includes +// a maximum of 1,000 results. If you specify a value for the optional QueueNamePrefix +// parameter, only queues with a name that begins with the specified value are +// returned. +// +// The listQueues methods supports pagination. Set parameter MaxResults in the +// request to specify the maximum number of results to be returned in the response. +// If you do not set MaxResults, the response includes a maximum of 1,000 results. +// If you set MaxResults and there are additional results to display, the response +// includes a value for NextToken. Use NextToken as a parameter in your next +// request to listQueues to receive the next page of results. +// +// Cross-account permissions don't apply to this action. For more information, +// see Grant cross-account permissions to a role and a user name (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation ListQueues for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListQueues +func (c *SQS) ListQueues(input *ListQueuesInput) (*ListQueuesOutput, error) { + req, out := c.ListQueuesRequest(input) + return out, req.Send() +} + +// ListQueuesWithContext is the same as ListQueues with the addition of +// the ability to pass a context and additional request options. +// +// See ListQueues for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) ListQueuesWithContext(ctx aws.Context, input *ListQueuesInput, opts ...request.Option) (*ListQueuesOutput, error) { + req, out := c.ListQueuesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListQueuesPages iterates over the pages of a ListQueues operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListQueues method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a ListQueues operation. +// pageNum := 0 +// err := client.ListQueuesPages(params, +// func(page *sqs.ListQueuesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SQS) ListQueuesPages(input *ListQueuesInput, fn func(*ListQueuesOutput, bool) bool) error { + return c.ListQueuesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListQueuesPagesWithContext same as ListQueuesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) ListQueuesPagesWithContext(ctx aws.Context, input *ListQueuesInput, fn func(*ListQueuesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListQueuesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListQueuesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListQueuesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opPurgeQueue = "PurgeQueue" + +// PurgeQueueRequest generates a "aws/request.Request" representing the +// client's request for the PurgeQueue operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PurgeQueue for more information on using the PurgeQueue +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PurgeQueueRequest method. +// req, resp := client.PurgeQueueRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/PurgeQueue +func (c *SQS) PurgeQueueRequest(input *PurgeQueueInput) (req *request.Request, output *PurgeQueueOutput) { + op := &request.Operation{ + Name: opPurgeQueue, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PurgeQueueInput{} + } + + output = &PurgeQueueOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// PurgeQueue API operation for Amazon Simple Queue Service. +// +// Deletes the messages in a queue specified by the QueueURL parameter. +// +// When you use the PurgeQueue action, you can't retrieve any messages deleted +// from a queue. +// +// The message deletion process takes up to 60 seconds. We recommend waiting +// for 60 seconds regardless of your queue's size. +// +// Messages sent to the queue before you call PurgeQueue might be received but +// are deleted within the next minute. +// +// Messages sent to the queue after you call PurgeQueue might be deleted while +// the queue is being purged. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation PurgeQueue for usage and error information. +// +// Returned Error Codes: +// * ErrCodeQueueDoesNotExist "AWS.SimpleQueueService.NonExistentQueue" +// The specified queue doesn't exist. +// +// * ErrCodePurgeQueueInProgress "AWS.SimpleQueueService.PurgeQueueInProgress" +// Indicates that the specified queue previously received a PurgeQueue request +// within the last 60 seconds (the time it can take to delete the messages in +// the queue). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/PurgeQueue +func (c *SQS) PurgeQueue(input *PurgeQueueInput) (*PurgeQueueOutput, error) { + req, out := c.PurgeQueueRequest(input) + return out, req.Send() +} + +// PurgeQueueWithContext is the same as PurgeQueue with the addition of +// the ability to pass a context and additional request options. +// +// See PurgeQueue for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) PurgeQueueWithContext(ctx aws.Context, input *PurgeQueueInput, opts ...request.Option) (*PurgeQueueOutput, error) { + req, out := c.PurgeQueueRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opReceiveMessage = "ReceiveMessage" + +// ReceiveMessageRequest generates a "aws/request.Request" representing the +// client's request for the ReceiveMessage operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ReceiveMessage for more information on using the ReceiveMessage +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ReceiveMessageRequest method. +// req, resp := client.ReceiveMessageRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ReceiveMessage +func (c *SQS) ReceiveMessageRequest(input *ReceiveMessageInput) (req *request.Request, output *ReceiveMessageOutput) { + op := &request.Operation{ + Name: opReceiveMessage, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ReceiveMessageInput{} + } + + output = &ReceiveMessageOutput{} + req = c.newRequest(op, input, output) + return +} + +// ReceiveMessage API operation for Amazon Simple Queue Service. +// +// Retrieves one or more messages (up to 10), from the specified queue. Using +// the WaitTimeSeconds parameter enables long-poll support. For more information, +// see Amazon SQS Long Polling (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// Short poll is the default behavior where a weighted random set of machines +// is sampled on a ReceiveMessage call. Thus, only the messages on the sampled +// machines are returned. If the number of messages in the queue is small (fewer +// than 1,000), you most likely get fewer messages than you requested per ReceiveMessage +// call. If the number of messages in the queue is extremely small, you might +// not receive any messages in a particular ReceiveMessage response. If this +// happens, repeat the request. +// +// For each message returned, the response includes the following: +// +// * The message body. +// +// * An MD5 digest of the message body. For information about MD5, see RFC1321 +// (https://www.ietf.org/rfc/rfc1321.txt). +// +// * The MessageId you received when you sent the message to the queue. +// +// * The receipt handle. +// +// * The message attributes. +// +// * An MD5 digest of the message attributes. +// +// The receipt handle is the identifier you must provide when deleting the message. +// For more information, see Queue and Message Identifiers (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// You can provide the VisibilityTimeout parameter in your request. The parameter +// is applied to the messages that Amazon SQS returns in the response. If you +// don't include the parameter, the overall visibility timeout for the queue +// is used for the returned messages. For more information, see Visibility Timeout +// (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// A message that isn't deleted or a message whose visibility isn't extended +// before the visibility timeout expires counts as a failed receive. Depending +// on the configuration of the queue, the message might be sent to the dead-letter +// queue. +// +// In the future, new attributes might be added. If you write code that calls +// this action, we recommend that you structure your code so that it can handle +// new attributes gracefully. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation ReceiveMessage for usage and error information. +// +// Returned Error Codes: +// * ErrCodeOverLimit "OverLimit" +// The specified action violates a limit. For example, ReceiveMessage returns +// this error if the maximum number of inflight messages is reached and AddPermission +// returns this error if the maximum number of permissions for the queue is +// reached. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ReceiveMessage +func (c *SQS) ReceiveMessage(input *ReceiveMessageInput) (*ReceiveMessageOutput, error) { + req, out := c.ReceiveMessageRequest(input) + return out, req.Send() +} + +// ReceiveMessageWithContext is the same as ReceiveMessage with the addition of +// the ability to pass a context and additional request options. +// +// See ReceiveMessage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) ReceiveMessageWithContext(ctx aws.Context, input *ReceiveMessageInput, opts ...request.Option) (*ReceiveMessageOutput, error) { + req, out := c.ReceiveMessageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRemovePermission = "RemovePermission" + +// RemovePermissionRequest generates a "aws/request.Request" representing the +// client's request for the RemovePermission operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RemovePermission for more information on using the RemovePermission +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RemovePermissionRequest method. +// req, resp := client.RemovePermissionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/RemovePermission +func (c *SQS) RemovePermissionRequest(input *RemovePermissionInput) (req *request.Request, output *RemovePermissionOutput) { + op := &request.Operation{ + Name: opRemovePermission, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RemovePermissionInput{} + } + + output = &RemovePermissionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// RemovePermission API operation for Amazon Simple Queue Service. +// +// Revokes any permissions in the queue policy that matches the specified Label +// parameter. +// +// * Only the owner of a queue can remove permissions from it. +// +// * Cross-account permissions don't apply to this action. For more information, +// see Grant cross-account permissions to a role and a user name (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// * To remove the ability to change queue permissions, you must deny permission +// to the AddPermission, RemovePermission, and SetQueueAttributes actions +// in your IAM policy. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation RemovePermission for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/RemovePermission +func (c *SQS) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) { + req, out := c.RemovePermissionRequest(input) + return out, req.Send() +} + +// RemovePermissionWithContext is the same as RemovePermission with the addition of +// the ability to pass a context and additional request options. +// +// See RemovePermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) RemovePermissionWithContext(ctx aws.Context, input *RemovePermissionInput, opts ...request.Option) (*RemovePermissionOutput, error) { + req, out := c.RemovePermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSendMessage = "SendMessage" + +// SendMessageRequest generates a "aws/request.Request" representing the +// client's request for the SendMessage operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SendMessage for more information on using the SendMessage +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SendMessageRequest method. +// req, resp := client.SendMessageRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessage +func (c *SQS) SendMessageRequest(input *SendMessageInput) (req *request.Request, output *SendMessageOutput) { + op := &request.Operation{ + Name: opSendMessage, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SendMessageInput{} + } + + output = &SendMessageOutput{} + req = c.newRequest(op, input, output) + return +} + +// SendMessage API operation for Amazon Simple Queue Service. +// +// Delivers a message to the specified queue. +// +// A message can include only XML, JSON, and unformatted text. The following +// Unicode characters are allowed: +// +// #x9 | #xA | #xD | #x20 to #xD7FF | #xE000 to #xFFFD | #x10000 to #x10FFFF +// +// Any characters not included in this list will be rejected. For more information, +// see the W3C specification for characters (http://www.w3.org/TR/REC-xml/#charsets). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation SendMessage for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidMessageContents "InvalidMessageContents" +// The message contains characters outside the allowed set. +// +// * ErrCodeUnsupportedOperation "AWS.SimpleQueueService.UnsupportedOperation" +// Error code 400. Unsupported operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessage +func (c *SQS) SendMessage(input *SendMessageInput) (*SendMessageOutput, error) { + req, out := c.SendMessageRequest(input) + return out, req.Send() +} + +// SendMessageWithContext is the same as SendMessage with the addition of +// the ability to pass a context and additional request options. +// +// See SendMessage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) SendMessageWithContext(ctx aws.Context, input *SendMessageInput, opts ...request.Option) (*SendMessageOutput, error) { + req, out := c.SendMessageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSendMessageBatch = "SendMessageBatch" + +// SendMessageBatchRequest generates a "aws/request.Request" representing the +// client's request for the SendMessageBatch operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SendMessageBatch for more information on using the SendMessageBatch +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SendMessageBatchRequest method. +// req, resp := client.SendMessageBatchRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageBatch +func (c *SQS) SendMessageBatchRequest(input *SendMessageBatchInput) (req *request.Request, output *SendMessageBatchOutput) { + op := &request.Operation{ + Name: opSendMessageBatch, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SendMessageBatchInput{} + } + + output = &SendMessageBatchOutput{} + req = c.newRequest(op, input, output) + return +} + +// SendMessageBatch API operation for Amazon Simple Queue Service. +// +// Delivers up to ten messages to the specified queue. This is a batch version +// of SendMessage. For a FIFO queue, multiple messages within a single batch +// are enqueued in the order they are sent. +// +// The result of sending each message is reported individually in the response. +// Because the batch request can result in a combination of successful and unsuccessful +// actions, you should check for batch errors even when the call returns an +// HTTP status code of 200. +// +// The maximum allowed individual message size and the maximum total payload +// size (the sum of the individual lengths of all of the batched messages) are +// both 256 KB (262,144 bytes). +// +// A message can include only XML, JSON, and unformatted text. The following +// Unicode characters are allowed: +// +// #x9 | #xA | #xD | #x20 to #xD7FF | #xE000 to #xFFFD | #x10000 to #x10FFFF +// +// Any characters not included in this list will be rejected. For more information, +// see the W3C specification for characters (http://www.w3.org/TR/REC-xml/#charsets). +// +// If you don't specify the DelaySeconds parameter for an entry, Amazon SQS +// uses the default value for the queue. +// +// Some actions take lists of parameters. These lists are specified using the +// param.n notation. Values of n are integers starting from 1. For example, +// a parameter list with two elements looks like this: +// +// &AttributeName.1=first +// +// &AttributeName.2=second +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation SendMessageBatch for usage and error information. +// +// Returned Error Codes: +// * ErrCodeTooManyEntriesInBatchRequest "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" +// The batch request contains more entries than permissible. +// +// * ErrCodeEmptyBatchRequest "AWS.SimpleQueueService.EmptyBatchRequest" +// The batch request doesn't contain any entries. +// +// * ErrCodeBatchEntryIdsNotDistinct "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" +// Two or more batch entries in the request have the same Id. +// +// * ErrCodeBatchRequestTooLong "AWS.SimpleQueueService.BatchRequestTooLong" +// The length of all the messages put together is more than the limit. +// +// * ErrCodeInvalidBatchEntryId "AWS.SimpleQueueService.InvalidBatchEntryId" +// The Id of a batch entry in a batch request doesn't abide by the specification. +// +// * ErrCodeUnsupportedOperation "AWS.SimpleQueueService.UnsupportedOperation" +// Error code 400. Unsupported operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageBatch +func (c *SQS) SendMessageBatch(input *SendMessageBatchInput) (*SendMessageBatchOutput, error) { + req, out := c.SendMessageBatchRequest(input) + return out, req.Send() +} + +// SendMessageBatchWithContext is the same as SendMessageBatch with the addition of +// the ability to pass a context and additional request options. +// +// See SendMessageBatch for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) SendMessageBatchWithContext(ctx aws.Context, input *SendMessageBatchInput, opts ...request.Option) (*SendMessageBatchOutput, error) { + req, out := c.SendMessageBatchRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSetQueueAttributes = "SetQueueAttributes" + +// SetQueueAttributesRequest generates a "aws/request.Request" representing the +// client's request for the SetQueueAttributes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SetQueueAttributes for more information on using the SetQueueAttributes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SetQueueAttributesRequest method. +// req, resp := client.SetQueueAttributesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SetQueueAttributes +func (c *SQS) SetQueueAttributesRequest(input *SetQueueAttributesInput) (req *request.Request, output *SetQueueAttributesOutput) { + op := &request.Operation{ + Name: opSetQueueAttributes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SetQueueAttributesInput{} + } + + output = &SetQueueAttributesOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// SetQueueAttributes API operation for Amazon Simple Queue Service. +// +// Sets the value of one or more queue attributes. When you change a queue's +// attributes, the change can take up to 60 seconds for most of the attributes +// to propagate throughout the Amazon SQS system. Changes made to the MessageRetentionPeriod +// attribute can take up to 15 minutes. +// +// * In the future, new attributes might be added. If you write code that +// calls this action, we recommend that you structure your code so that it +// can handle new attributes gracefully. +// +// * Cross-account permissions don't apply to this action. For more information, +// see Grant cross-account permissions to a role and a user name (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// * To remove the ability to change queue permissions, you must deny permission +// to the AddPermission, RemovePermission, and SetQueueAttributes actions +// in your IAM policy. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation SetQueueAttributes for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidAttributeName "InvalidAttributeName" +// The specified attribute doesn't exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SetQueueAttributes +func (c *SQS) SetQueueAttributes(input *SetQueueAttributesInput) (*SetQueueAttributesOutput, error) { + req, out := c.SetQueueAttributesRequest(input) + return out, req.Send() +} + +// SetQueueAttributesWithContext is the same as SetQueueAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See SetQueueAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) SetQueueAttributesWithContext(ctx aws.Context, input *SetQueueAttributesInput, opts ...request.Option) (*SetQueueAttributesOutput, error) { + req, out := c.SetQueueAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTagQueue = "TagQueue" + +// TagQueueRequest generates a "aws/request.Request" representing the +// client's request for the TagQueue operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagQueue for more information on using the TagQueue +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagQueueRequest method. +// req, resp := client.TagQueueRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/TagQueue +func (c *SQS) TagQueueRequest(input *TagQueueInput) (req *request.Request, output *TagQueueOutput) { + op := &request.Operation{ + Name: opTagQueue, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &TagQueueInput{} + } + + output = &TagQueueOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagQueue API operation for Amazon Simple Queue Service. +// +// Add cost allocation tags to the specified Amazon SQS queue. For an overview, +// see Tagging Your Amazon SQS Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// When you use queue tags, keep the following guidelines in mind: +// +// * Adding more than 50 tags to a queue isn't recommended. +// +// * Tags don't have any semantic meaning. Amazon SQS interprets tags as +// character strings. +// +// * Tags are case-sensitive. +// +// * A new tag with a key identical to that of an existing tag overwrites +// the existing tag. +// +// For a full list of tag restrictions, see Limits Related to Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-limits.html#limits-queues) +// in the Amazon Simple Queue Service Developer Guide. +// +// Cross-account permissions don't apply to this action. For more information, +// see Grant cross-account permissions to a role and a user name (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation TagQueue for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/TagQueue +func (c *SQS) TagQueue(input *TagQueueInput) (*TagQueueOutput, error) { + req, out := c.TagQueueRequest(input) + return out, req.Send() +} + +// TagQueueWithContext is the same as TagQueue with the addition of +// the ability to pass a context and additional request options. +// +// See TagQueue for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) TagQueueWithContext(ctx aws.Context, input *TagQueueInput, opts ...request.Option) (*TagQueueOutput, error) { + req, out := c.TagQueueRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagQueue = "UntagQueue" + +// UntagQueueRequest generates a "aws/request.Request" representing the +// client's request for the UntagQueue operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagQueue for more information on using the UntagQueue +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagQueueRequest method. +// req, resp := client.UntagQueueRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/UntagQueue +func (c *SQS) UntagQueueRequest(input *UntagQueueInput) (req *request.Request, output *UntagQueueOutput) { + op := &request.Operation{ + Name: opUntagQueue, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UntagQueueInput{} + } + + output = &UntagQueueOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagQueue API operation for Amazon Simple Queue Service. +// +// Remove cost allocation tags from the specified Amazon SQS queue. For an overview, +// see Tagging Your Amazon SQS Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// Cross-account permissions don't apply to this action. For more information, +// see Grant cross-account permissions to a role and a user name (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) +// in the Amazon Simple Queue Service Developer Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Queue Service's +// API operation UntagQueue for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/UntagQueue +func (c *SQS) UntagQueue(input *UntagQueueInput) (*UntagQueueOutput, error) { + req, out := c.UntagQueueRequest(input) + return out, req.Send() +} + +// UntagQueueWithContext is the same as UntagQueue with the addition of +// the ability to pass a context and additional request options. +// +// See UntagQueue for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SQS) UntagQueueWithContext(ctx aws.Context, input *UntagQueueInput, opts ...request.Option) (*UntagQueueOutput, error) { + req, out := c.UntagQueueRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +type AddPermissionInput struct { + _ struct{} `type:"structure"` + + // The AWS account number of the principal (https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P) + // who is given permission. The principal must have an AWS account, but does + // not need to be signed up for Amazon SQS. For information about locating the + // AWS account identification, see Your AWS Identifiers (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html#sqs-api-request-authentication) + // in the Amazon Simple Queue Service Developer Guide. + // + // AWSAccountIds is a required field + AWSAccountIds []*string `locationNameList:"AWSAccountId" type:"list" flattened:"true" required:"true"` + + // The action the client wants to allow for the specified principal. Valid values: + // the name of any action or *. + // + // For more information about these actions, see Overview of Managing Access + // Permissions to Your Amazon Simple Queue Service Resource (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-overview-of-managing-access.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // Specifying SendMessage, DeleteMessage, or ChangeMessageVisibility for ActionName.n + // also grants permissions for the corresponding batch versions of those actions: + // SendMessageBatch, DeleteMessageBatch, and ChangeMessageVisibilityBatch. + // + // Actions is a required field + Actions []*string `locationNameList:"ActionName" type:"list" flattened:"true" required:"true"` + + // The unique identification of the permission you're setting (for example, + // AliceSendMessage). Maximum 80 characters. Allowed characters include alphanumeric + // characters, hyphens (-), and underscores (_). + // + // Label is a required field + Label *string `type:"string" required:"true"` + + // The URL of the Amazon SQS queue to which permissions are added. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AddPermissionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddPermissionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AddPermissionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AddPermissionInput"} + if s.AWSAccountIds == nil { + invalidParams.Add(request.NewErrParamRequired("AWSAccountIds")) + } + if s.Actions == nil { + invalidParams.Add(request.NewErrParamRequired("Actions")) + } + if s.Label == nil { + invalidParams.Add(request.NewErrParamRequired("Label")) + } + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAWSAccountIds sets the AWSAccountIds field's value. +func (s *AddPermissionInput) SetAWSAccountIds(v []*string) *AddPermissionInput { + s.AWSAccountIds = v + return s +} + +// SetActions sets the Actions field's value. +func (s *AddPermissionInput) SetActions(v []*string) *AddPermissionInput { + s.Actions = v + return s +} + +// SetLabel sets the Label field's value. +func (s *AddPermissionInput) SetLabel(v string) *AddPermissionInput { + s.Label = &v + return s +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *AddPermissionInput) SetQueueUrl(v string) *AddPermissionInput { + s.QueueUrl = &v + return s +} + +type AddPermissionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AddPermissionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddPermissionOutput) GoString() string { + return s.String() +} + +// Gives a detailed description of the result of an action on each entry in +// the request. +type BatchResultErrorEntry struct { + _ struct{} `type:"structure"` + + // An error code representing why the action failed on this entry. + // + // Code is a required field + Code *string `type:"string" required:"true"` + + // The Id of an entry in a batch request. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // A message explaining why the action failed on this entry. + Message *string `type:"string"` + + // Specifies whether the error happened due to the caller of the batch API action. + // + // SenderFault is a required field + SenderFault *bool `type:"boolean" required:"true"` +} + +// String returns the string representation +func (s BatchResultErrorEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchResultErrorEntry) GoString() string { + return s.String() +} + +// SetCode sets the Code field's value. +func (s *BatchResultErrorEntry) SetCode(v string) *BatchResultErrorEntry { + s.Code = &v + return s +} + +// SetId sets the Id field's value. +func (s *BatchResultErrorEntry) SetId(v string) *BatchResultErrorEntry { + s.Id = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *BatchResultErrorEntry) SetMessage(v string) *BatchResultErrorEntry { + s.Message = &v + return s +} + +// SetSenderFault sets the SenderFault field's value. +func (s *BatchResultErrorEntry) SetSenderFault(v bool) *BatchResultErrorEntry { + s.SenderFault = &v + return s +} + +type ChangeMessageVisibilityBatchInput struct { + _ struct{} `type:"structure"` + + // A list of receipt handles of the messages for which the visibility timeout + // must be changed. + // + // Entries is a required field + Entries []*ChangeMessageVisibilityBatchRequestEntry `locationNameList:"ChangeMessageVisibilityBatchRequestEntry" type:"list" flattened:"true" required:"true"` + + // The URL of the Amazon SQS queue whose messages' visibility is changed. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ChangeMessageVisibilityBatchInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeMessageVisibilityBatchInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ChangeMessageVisibilityBatchInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ChangeMessageVisibilityBatchInput"} + if s.Entries == nil { + invalidParams.Add(request.NewErrParamRequired("Entries")) + } + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + if s.Entries != nil { + for i, v := range s.Entries { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEntries sets the Entries field's value. +func (s *ChangeMessageVisibilityBatchInput) SetEntries(v []*ChangeMessageVisibilityBatchRequestEntry) *ChangeMessageVisibilityBatchInput { + s.Entries = v + return s +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *ChangeMessageVisibilityBatchInput) SetQueueUrl(v string) *ChangeMessageVisibilityBatchInput { + s.QueueUrl = &v + return s +} + +// For each message in the batch, the response contains a ChangeMessageVisibilityBatchResultEntry +// tag if the message succeeds or a BatchResultErrorEntry tag if the message +// fails. +type ChangeMessageVisibilityBatchOutput struct { + _ struct{} `type:"structure"` + + // A list of BatchResultErrorEntry items. + // + // Failed is a required field + Failed []*BatchResultErrorEntry `locationNameList:"BatchResultErrorEntry" type:"list" flattened:"true" required:"true"` + + // A list of ChangeMessageVisibilityBatchResultEntry items. + // + // Successful is a required field + Successful []*ChangeMessageVisibilityBatchResultEntry `locationNameList:"ChangeMessageVisibilityBatchResultEntry" type:"list" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s ChangeMessageVisibilityBatchOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeMessageVisibilityBatchOutput) GoString() string { + return s.String() +} + +// SetFailed sets the Failed field's value. +func (s *ChangeMessageVisibilityBatchOutput) SetFailed(v []*BatchResultErrorEntry) *ChangeMessageVisibilityBatchOutput { + s.Failed = v + return s +} + +// SetSuccessful sets the Successful field's value. +func (s *ChangeMessageVisibilityBatchOutput) SetSuccessful(v []*ChangeMessageVisibilityBatchResultEntry) *ChangeMessageVisibilityBatchOutput { + s.Successful = v + return s +} + +// Encloses a receipt handle and an entry id for each message in ChangeMessageVisibilityBatch. +// +// All of the following list parameters must be prefixed with ChangeMessageVisibilityBatchRequestEntry.n, +// where n is an integer value starting with 1. For example, a parameter list +// for this action might look like this: +// +// &ChangeMessageVisibilityBatchRequestEntry.1.Id=change_visibility_msg_2 +// +// &ChangeMessageVisibilityBatchRequestEntry.1.ReceiptHandle=your_receipt_handle +// +// &ChangeMessageVisibilityBatchRequestEntry.1.VisibilityTimeout=45 +type ChangeMessageVisibilityBatchRequestEntry struct { + _ struct{} `type:"structure"` + + // An identifier for this particular receipt handle used to communicate the + // result. + // + // The Ids of a batch request need to be unique within a request. + // + // This identifier can have up to 80 characters. The following characters are + // accepted: alphanumeric characters, hyphens(-), and underscores (_). + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // A receipt handle. + // + // ReceiptHandle is a required field + ReceiptHandle *string `type:"string" required:"true"` + + // The new value (in seconds) for the message's visibility timeout. + VisibilityTimeout *int64 `type:"integer"` +} + +// String returns the string representation +func (s ChangeMessageVisibilityBatchRequestEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeMessageVisibilityBatchRequestEntry) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ChangeMessageVisibilityBatchRequestEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ChangeMessageVisibilityBatchRequestEntry"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.ReceiptHandle == nil { + invalidParams.Add(request.NewErrParamRequired("ReceiptHandle")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *ChangeMessageVisibilityBatchRequestEntry) SetId(v string) *ChangeMessageVisibilityBatchRequestEntry { + s.Id = &v + return s +} + +// SetReceiptHandle sets the ReceiptHandle field's value. +func (s *ChangeMessageVisibilityBatchRequestEntry) SetReceiptHandle(v string) *ChangeMessageVisibilityBatchRequestEntry { + s.ReceiptHandle = &v + return s +} + +// SetVisibilityTimeout sets the VisibilityTimeout field's value. +func (s *ChangeMessageVisibilityBatchRequestEntry) SetVisibilityTimeout(v int64) *ChangeMessageVisibilityBatchRequestEntry { + s.VisibilityTimeout = &v + return s +} + +// Encloses the Id of an entry in ChangeMessageVisibilityBatch. +type ChangeMessageVisibilityBatchResultEntry struct { + _ struct{} `type:"structure"` + + // Represents a message whose visibility timeout has been changed successfully. + // + // Id is a required field + Id *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ChangeMessageVisibilityBatchResultEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeMessageVisibilityBatchResultEntry) GoString() string { + return s.String() +} + +// SetId sets the Id field's value. +func (s *ChangeMessageVisibilityBatchResultEntry) SetId(v string) *ChangeMessageVisibilityBatchResultEntry { + s.Id = &v + return s +} + +type ChangeMessageVisibilityInput struct { + _ struct{} `type:"structure"` + + // The URL of the Amazon SQS queue whose message's visibility is changed. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` + + // The receipt handle associated with the message whose visibility timeout is + // changed. This parameter is returned by the ReceiveMessage action. + // + // ReceiptHandle is a required field + ReceiptHandle *string `type:"string" required:"true"` + + // The new value for the message's visibility timeout (in seconds). Values range: + // 0 to 43200. Maximum: 12 hours. + // + // VisibilityTimeout is a required field + VisibilityTimeout *int64 `type:"integer" required:"true"` +} + +// String returns the string representation +func (s ChangeMessageVisibilityInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeMessageVisibilityInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ChangeMessageVisibilityInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ChangeMessageVisibilityInput"} + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + if s.ReceiptHandle == nil { + invalidParams.Add(request.NewErrParamRequired("ReceiptHandle")) + } + if s.VisibilityTimeout == nil { + invalidParams.Add(request.NewErrParamRequired("VisibilityTimeout")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *ChangeMessageVisibilityInput) SetQueueUrl(v string) *ChangeMessageVisibilityInput { + s.QueueUrl = &v + return s +} + +// SetReceiptHandle sets the ReceiptHandle field's value. +func (s *ChangeMessageVisibilityInput) SetReceiptHandle(v string) *ChangeMessageVisibilityInput { + s.ReceiptHandle = &v + return s +} + +// SetVisibilityTimeout sets the VisibilityTimeout field's value. +func (s *ChangeMessageVisibilityInput) SetVisibilityTimeout(v int64) *ChangeMessageVisibilityInput { + s.VisibilityTimeout = &v + return s +} + +type ChangeMessageVisibilityOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ChangeMessageVisibilityOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeMessageVisibilityOutput) GoString() string { + return s.String() +} + +type CreateQueueInput struct { + _ struct{} `type:"structure"` + + // A map of attributes with their corresponding values. + // + // The following lists the names, descriptions, and values of the special request + // parameters that the CreateQueue action uses: + // + // * DelaySeconds – The length of time, in seconds, for which the delivery + // of all messages in the queue is delayed. Valid values: An integer from + // 0 to 900 seconds (15 minutes). Default: 0. + // + // * MaximumMessageSize – The limit of how many bytes a message can contain + // before Amazon SQS rejects it. Valid values: An integer from 1,024 bytes + // (1 KiB) to 262,144 bytes (256 KiB). Default: 262,144 (256 KiB). + // + // * MessageRetentionPeriod – The length of time, in seconds, for which + // Amazon SQS retains a message. Valid values: An integer from 60 seconds + // (1 minute) to 1,209,600 seconds (14 days). Default: 345,600 (4 days). + // + // * Policy – The queue's policy. A valid AWS policy. For more information + // about policy structure, see Overview of AWS IAM Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html) + // in the Amazon IAM User Guide. + // + // * ReceiveMessageWaitTimeSeconds – The length of time, in seconds, for + // which a ReceiveMessage action waits for a message to arrive. Valid values: + // An integer from 0 to 20 (seconds). Default: 0. + // + // * RedrivePolicy – The string that includes the parameters for the dead-letter + // queue functionality of the source queue as a JSON object. For more information + // about the redrive policy and dead-letter queues, see Using Amazon SQS + // Dead-Letter Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) + // in the Amazon Simple Queue Service Developer Guide. deadLetterTargetArn + // – The Amazon Resource Name (ARN) of the dead-letter queue to which Amazon + // SQS moves messages after the value of maxReceiveCount is exceeded. maxReceiveCount + // – The number of times a message is delivered to the source queue before + // being moved to the dead-letter queue. When the ReceiveCount for a message + // exceeds the maxReceiveCount for a queue, Amazon SQS moves the message + // to the dead-letter-queue. The dead-letter queue of a FIFO queue must also + // be a FIFO queue. Similarly, the dead-letter queue of a standard queue + // must also be a standard queue. + // + // * VisibilityTimeout – The visibility timeout for the queue, in seconds. + // Valid values: An integer from 0 to 43,200 (12 hours). Default: 30. For + // more information about the visibility timeout, see Visibility Timeout + // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // The following attributes apply only to server-side-encryption (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html): + // + // * KmsMasterKeyId – The ID of an AWS-managed customer master key (CMK) + // for Amazon SQS or a custom CMK. For more information, see Key Terms (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms). + // While the alias of the AWS-managed CMK for Amazon SQS is always alias/aws/sqs, + // the alias of a custom CMK can, for example, be alias/MyAlias . For more + // examples, see KeyId (https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) + // in the AWS Key Management Service API Reference. + // + // * KmsDataKeyReusePeriodSeconds – The length of time, in seconds, for + // which Amazon SQS can reuse a data key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys) + // to encrypt or decrypt messages before calling AWS KMS again. An integer + // representing seconds, between 60 seconds (1 minute) and 86,400 seconds + // (24 hours). Default: 300 (5 minutes). A shorter time period provides better + // security but results in more calls to KMS which might incur charges after + // Free Tier. For more information, see How Does the Data Key Reuse Period + // Work? (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work). + // + // The following attributes apply only to FIFO (first-in-first-out) queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): + // + // * FifoQueue – Designates a queue as FIFO. Valid values are true and + // false. If you don't specify the FifoQueue attribute, Amazon SQS creates + // a standard queue. You can provide this attribute only during queue creation. + // You can't change it for an existing queue. When you set this attribute, + // you must also provide the MessageGroupId for your messages explicitly. + // For more information, see FIFO Queue Logic (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-understanding-logic) + // in the Amazon Simple Queue Service Developer Guide. + // + // * ContentBasedDeduplication – Enables content-based deduplication. Valid + // values are true and false. For more information, see Exactly-Once Processing + // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) + // in the Amazon Simple Queue Service Developer Guide. Note the following: + // Every message must have a unique MessageDeduplicationId. You may provide + // a MessageDeduplicationId explicitly. If you aren't able to provide a MessageDeduplicationId + // and you enable ContentBasedDeduplication for your queue, Amazon SQS uses + // a SHA-256 hash to generate the MessageDeduplicationId using the body of + // the message (but not the attributes of the message). If you don't provide + // a MessageDeduplicationId and the queue doesn't have ContentBasedDeduplication + // set, the action fails with an error. If the queue has ContentBasedDeduplication + // set, your MessageDeduplicationId overrides the generated one. When ContentBasedDeduplication + // is in effect, messages with identical content sent within the deduplication + // interval are treated as duplicates and only one copy of the message is + // delivered. If you send one message with ContentBasedDeduplication enabled + // and then another message with a MessageDeduplicationId that is the same + // as the one generated for the first MessageDeduplicationId, the two messages + // are treated as duplicates and only one copy of the message is delivered. + // + // Preview: High throughput for FIFO queues + // + // High throughput for Amazon SQS FIFO queues is in preview release and is subject + // to change. This feature provides a high number of transactions per second + // (TPS) for messages in FIFO queues. For information on throughput quotas, + // see Quotas related to messages (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // This preview includes two new attributes: + // + // * DeduplicationScope – Specifies whether message deduplication occurs + // at the message group or queue level. Valid values are messageGroup and + // queue. + // + // * FifoThroughputLimit – Specifies whether the FIFO queue throughput + // quota applies to the entire queue or per message group. Valid values are + // perQueue and perMessageGroupId. The perMessageGroupId value is allowed + // only when the value for DeduplicationScope is messageGroup. + // + // To enable high throughput for FIFO queues, do the following: + // + // * Set DeduplicationScope to messageGroup. + // + // * Set FifoThroughputLimit to perMessageGroupId. + // + // If you set these attributes to anything other than the values shown for enabling + // high throughput, standard throughput is in effect and deduplication occurs + // as specified. + // + // This preview is available in the following AWS Regions: + // + // * US East (Ohio); us-east-2 + // + // * US East (N. Virginia); us-east-1 + // + // * US West (Oregon); us-west-2 + // + // * Europe (Ireland); eu-west-1 + // + // For more information about high throughput for FIFO queues, see Preview: + // High throughput for FIFO queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html) + // in the Amazon Simple Queue Service Developer Guide. + Attributes map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` + + // The name of the new queue. The following limits apply to this name: + // + // * A queue name can have up to 80 characters. + // + // * Valid values: alphanumeric characters, hyphens (-), and underscores + // (_). + // + // * A FIFO queue name must end with the .fifo suffix. + // + // Queue URLs and names are case-sensitive. + // + // QueueName is a required field + QueueName *string `type:"string" required:"true"` + + // Add cost allocation tags to the specified Amazon SQS queue. For an overview, + // see Tagging Your Amazon SQS Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // When you use queue tags, keep the following guidelines in mind: + // + // * Adding more than 50 tags to a queue isn't recommended. + // + // * Tags don't have any semantic meaning. Amazon SQS interprets tags as + // character strings. + // + // * Tags are case-sensitive. + // + // * A new tag with a key identical to that of an existing tag overwrites + // the existing tag. + // + // For a full list of tag restrictions, see Limits Related to Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-limits.html#limits-queues) + // in the Amazon Simple Queue Service Developer Guide. + // + // To be able to tag a queue on creation, you must have the sqs:CreateQueue + // and sqs:TagQueue permissions. + // + // Cross-account permissions don't apply to this action. For more information, + // see Grant cross-account permissions to a role and a user name (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) + // in the Amazon Simple Queue Service Developer Guide. + Tags map[string]*string `locationName:"Tag" locationNameKey:"Key" locationNameValue:"Value" type:"map" flattened:"true"` +} + +// String returns the string representation +func (s CreateQueueInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateQueueInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateQueueInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateQueueInput"} + if s.QueueName == nil { + invalidParams.Add(request.NewErrParamRequired("QueueName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAttributes sets the Attributes field's value. +func (s *CreateQueueInput) SetAttributes(v map[string]*string) *CreateQueueInput { + s.Attributes = v + return s +} + +// SetQueueName sets the QueueName field's value. +func (s *CreateQueueInput) SetQueueName(v string) *CreateQueueInput { + s.QueueName = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateQueueInput) SetTags(v map[string]*string) *CreateQueueInput { + s.Tags = v + return s +} + +// Returns the QueueUrl attribute of the created queue. +type CreateQueueOutput struct { + _ struct{} `type:"structure"` + + // The URL of the created Amazon SQS queue. + QueueUrl *string `type:"string"` +} + +// String returns the string representation +func (s CreateQueueOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateQueueOutput) GoString() string { + return s.String() +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *CreateQueueOutput) SetQueueUrl(v string) *CreateQueueOutput { + s.QueueUrl = &v + return s +} + +type DeleteMessageBatchInput struct { + _ struct{} `type:"structure"` + + // A list of receipt handles for the messages to be deleted. + // + // Entries is a required field + Entries []*DeleteMessageBatchRequestEntry `locationNameList:"DeleteMessageBatchRequestEntry" type:"list" flattened:"true" required:"true"` + + // The URL of the Amazon SQS queue from which messages are deleted. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteMessageBatchInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMessageBatchInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteMessageBatchInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteMessageBatchInput"} + if s.Entries == nil { + invalidParams.Add(request.NewErrParamRequired("Entries")) + } + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + if s.Entries != nil { + for i, v := range s.Entries { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEntries sets the Entries field's value. +func (s *DeleteMessageBatchInput) SetEntries(v []*DeleteMessageBatchRequestEntry) *DeleteMessageBatchInput { + s.Entries = v + return s +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *DeleteMessageBatchInput) SetQueueUrl(v string) *DeleteMessageBatchInput { + s.QueueUrl = &v + return s +} + +// For each message in the batch, the response contains a DeleteMessageBatchResultEntry +// tag if the message is deleted or a BatchResultErrorEntry tag if the message +// can't be deleted. +type DeleteMessageBatchOutput struct { + _ struct{} `type:"structure"` + + // A list of BatchResultErrorEntry items. + // + // Failed is a required field + Failed []*BatchResultErrorEntry `locationNameList:"BatchResultErrorEntry" type:"list" flattened:"true" required:"true"` + + // A list of DeleteMessageBatchResultEntry items. + // + // Successful is a required field + Successful []*DeleteMessageBatchResultEntry `locationNameList:"DeleteMessageBatchResultEntry" type:"list" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s DeleteMessageBatchOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMessageBatchOutput) GoString() string { + return s.String() +} + +// SetFailed sets the Failed field's value. +func (s *DeleteMessageBatchOutput) SetFailed(v []*BatchResultErrorEntry) *DeleteMessageBatchOutput { + s.Failed = v + return s +} + +// SetSuccessful sets the Successful field's value. +func (s *DeleteMessageBatchOutput) SetSuccessful(v []*DeleteMessageBatchResultEntry) *DeleteMessageBatchOutput { + s.Successful = v + return s +} + +// Encloses a receipt handle and an identifier for it. +type DeleteMessageBatchRequestEntry struct { + _ struct{} `type:"structure"` + + // An identifier for this particular receipt handle. This is used to communicate + // the result. + // + // The Ids of a batch request need to be unique within a request. + // + // This identifier can have up to 80 characters. The following characters are + // accepted: alphanumeric characters, hyphens(-), and underscores (_). + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // A receipt handle. + // + // ReceiptHandle is a required field + ReceiptHandle *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteMessageBatchRequestEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMessageBatchRequestEntry) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteMessageBatchRequestEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteMessageBatchRequestEntry"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.ReceiptHandle == nil { + invalidParams.Add(request.NewErrParamRequired("ReceiptHandle")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *DeleteMessageBatchRequestEntry) SetId(v string) *DeleteMessageBatchRequestEntry { + s.Id = &v + return s +} + +// SetReceiptHandle sets the ReceiptHandle field's value. +func (s *DeleteMessageBatchRequestEntry) SetReceiptHandle(v string) *DeleteMessageBatchRequestEntry { + s.ReceiptHandle = &v + return s +} + +// Encloses the Id of an entry in DeleteMessageBatch. +type DeleteMessageBatchResultEntry struct { + _ struct{} `type:"structure"` + + // Represents a successfully deleted message. + // + // Id is a required field + Id *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteMessageBatchResultEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMessageBatchResultEntry) GoString() string { + return s.String() +} + +// SetId sets the Id field's value. +func (s *DeleteMessageBatchResultEntry) SetId(v string) *DeleteMessageBatchResultEntry { + s.Id = &v + return s +} + +type DeleteMessageInput struct { + _ struct{} `type:"structure"` + + // The URL of the Amazon SQS queue from which messages are deleted. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` + + // The receipt handle associated with the message to delete. + // + // ReceiptHandle is a required field + ReceiptHandle *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteMessageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMessageInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteMessageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteMessageInput"} + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + if s.ReceiptHandle == nil { + invalidParams.Add(request.NewErrParamRequired("ReceiptHandle")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *DeleteMessageInput) SetQueueUrl(v string) *DeleteMessageInput { + s.QueueUrl = &v + return s +} + +// SetReceiptHandle sets the ReceiptHandle field's value. +func (s *DeleteMessageInput) SetReceiptHandle(v string) *DeleteMessageInput { + s.ReceiptHandle = &v + return s +} + +type DeleteMessageOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteMessageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMessageOutput) GoString() string { + return s.String() +} + +type DeleteQueueInput struct { + _ struct{} `type:"structure"` + + // The URL of the Amazon SQS queue to delete. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteQueueInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteQueueInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteQueueInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteQueueInput"} + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *DeleteQueueInput) SetQueueUrl(v string) *DeleteQueueInput { + s.QueueUrl = &v + return s +} + +type DeleteQueueOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteQueueOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteQueueOutput) GoString() string { + return s.String() +} + +type GetQueueAttributesInput struct { + _ struct{} `type:"structure"` + + // A list of attributes for which to retrieve information. + // + // In the future, new attributes might be added. If you write code that calls + // this action, we recommend that you structure your code so that it can handle + // new attributes gracefully. + // + // The following attributes are supported: + // + // The ApproximateNumberOfMessagesDelayed, ApproximateNumberOfMessagesNotVisible, + // and ApproximateNumberOfMessagesVisible metrics may not achieve consistency + // until at least 1 minute after the producers stop sending messages. This period + // is required for the queue metadata to reach eventual consistency. + // + // * All – Returns all values. + // + // * ApproximateNumberOfMessages – Returns the approximate number of messages + // available for retrieval from the queue. + // + // * ApproximateNumberOfMessagesDelayed – Returns the approximate number + // of messages in the queue that are delayed and not available for reading + // immediately. This can happen when the queue is configured as a delay queue + // or when a message has been sent with a delay parameter. + // + // * ApproximateNumberOfMessagesNotVisible – Returns the approximate number + // of messages that are in flight. Messages are considered to be in flight + // if they have been sent to a client but have not yet been deleted or have + // not yet reached the end of their visibility window. + // + // * CreatedTimestamp – Returns the time when the queue was created in + // seconds (epoch time (http://en.wikipedia.org/wiki/Unix_time)). + // + // * DelaySeconds – Returns the default delay on the queue in seconds. + // + // * LastModifiedTimestamp – Returns the time when the queue was last changed + // in seconds (epoch time (http://en.wikipedia.org/wiki/Unix_time)). + // + // * MaximumMessageSize – Returns the limit of how many bytes a message + // can contain before Amazon SQS rejects it. + // + // * MessageRetentionPeriod – Returns the length of time, in seconds, for + // which Amazon SQS retains a message. + // + // * Policy – Returns the policy of the queue. + // + // * QueueArn – Returns the Amazon resource name (ARN) of the queue. + // + // * ReceiveMessageWaitTimeSeconds – Returns the length of time, in seconds, + // for which the ReceiveMessage action waits for a message to arrive. + // + // * RedrivePolicy – The string that includes the parameters for the dead-letter + // queue functionality of the source queue as a JSON object. For more information + // about the redrive policy and dead-letter queues, see Using Amazon SQS + // Dead-Letter Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) + // in the Amazon Simple Queue Service Developer Guide. deadLetterTargetArn + // – The Amazon Resource Name (ARN) of the dead-letter queue to which Amazon + // SQS moves messages after the value of maxReceiveCount is exceeded. maxReceiveCount + // – The number of times a message is delivered to the source queue before + // being moved to the dead-letter queue. When the ReceiveCount for a message + // exceeds the maxReceiveCount for a queue, Amazon SQS moves the message + // to the dead-letter-queue. + // + // * VisibilityTimeout – Returns the visibility timeout for the queue. + // For more information about the visibility timeout, see Visibility Timeout + // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // The following attributes apply only to server-side-encryption (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html): + // + // * KmsMasterKeyId – Returns the ID of an AWS-managed customer master + // key (CMK) for Amazon SQS or a custom CMK. For more information, see Key + // Terms (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms). + // + // * KmsDataKeyReusePeriodSeconds – Returns the length of time, in seconds, + // for which Amazon SQS can reuse a data key to encrypt or decrypt messages + // before calling AWS KMS again. For more information, see How Does the Data + // Key Reuse Period Work? (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work). + // + // The following attributes apply only to FIFO (first-in-first-out) queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): + // + // * FifoQueue – Returns information about whether the queue is FIFO. For + // more information, see FIFO Queue Logic (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-understanding-logic) + // in the Amazon Simple Queue Service Developer Guide. To determine whether + // a queue is FIFO (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html), + // you can check whether QueueName ends with the .fifo suffix. + // + // * ContentBasedDeduplication – Returns whether content-based deduplication + // is enabled for the queue. For more information, see Exactly-Once Processing + // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) + // in the Amazon Simple Queue Service Developer Guide. + // + // Preview: High throughput for FIFO queues + // + // High throughput for Amazon SQS FIFO queues is in preview release and is subject + // to change. This feature provides a high number of transactions per second + // (TPS) for messages in FIFO queues. For information on throughput quotas, + // see Quotas related to messages (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // This preview includes two new attributes: + // + // * DeduplicationScope – Specifies whether message deduplication occurs + // at the message group or queue level. Valid values are messageGroup and + // queue. + // + // * FifoThroughputLimit – Specifies whether the FIFO queue throughput + // quota applies to the entire queue or per message group. Valid values are + // perQueue and perMessageGroupId. The perMessageGroupId value is allowed + // only when the value for DeduplicationScope is messageGroup. + // + // To enable high throughput for FIFO queues, do the following: + // + // * Set DeduplicationScope to messageGroup. + // + // * Set FifoThroughputLimit to perMessageGroupId. + // + // If you set these attributes to anything other than the values shown for enabling + // high throughput, standard throughput is in effect and deduplication occurs + // as specified. + // + // This preview is available in the following AWS Regions: + // + // * US East (Ohio); us-east-2 + // + // * US East (N. Virginia); us-east-1 + // + // * US West (Oregon); us-west-2 + // + // * Europe (Ireland); eu-west-1 + // + // For more information about high throughput for FIFO queues, see Preview: + // High throughput for FIFO queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html) + // in the Amazon Simple Queue Service Developer Guide. + AttributeNames []*string `locationNameList:"AttributeName" type:"list" flattened:"true"` + + // The URL of the Amazon SQS queue whose attribute information is retrieved. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s GetQueueAttributesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetQueueAttributesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetQueueAttributesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetQueueAttributesInput"} + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAttributeNames sets the AttributeNames field's value. +func (s *GetQueueAttributesInput) SetAttributeNames(v []*string) *GetQueueAttributesInput { + s.AttributeNames = v + return s +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *GetQueueAttributesInput) SetQueueUrl(v string) *GetQueueAttributesInput { + s.QueueUrl = &v + return s +} + +// A list of returned queue attributes. +type GetQueueAttributesOutput struct { + _ struct{} `type:"structure"` + + // A map of attributes to their respective values. + Attributes map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` +} + +// String returns the string representation +func (s GetQueueAttributesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetQueueAttributesOutput) GoString() string { + return s.String() +} + +// SetAttributes sets the Attributes field's value. +func (s *GetQueueAttributesOutput) SetAttributes(v map[string]*string) *GetQueueAttributesOutput { + s.Attributes = v + return s +} + +type GetQueueUrlInput struct { + _ struct{} `type:"structure"` + + // The name of the queue whose URL must be fetched. Maximum 80 characters. Valid + // values: alphanumeric characters, hyphens (-), and underscores (_). + // + // Queue URLs and names are case-sensitive. + // + // QueueName is a required field + QueueName *string `type:"string" required:"true"` + + // The AWS account ID of the account that created the queue. + QueueOwnerAWSAccountId *string `type:"string"` +} + +// String returns the string representation +func (s GetQueueUrlInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetQueueUrlInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetQueueUrlInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetQueueUrlInput"} + if s.QueueName == nil { + invalidParams.Add(request.NewErrParamRequired("QueueName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetQueueName sets the QueueName field's value. +func (s *GetQueueUrlInput) SetQueueName(v string) *GetQueueUrlInput { + s.QueueName = &v + return s +} + +// SetQueueOwnerAWSAccountId sets the QueueOwnerAWSAccountId field's value. +func (s *GetQueueUrlInput) SetQueueOwnerAWSAccountId(v string) *GetQueueUrlInput { + s.QueueOwnerAWSAccountId = &v + return s +} + +// For more information, see Interpreting Responses (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-api-responses.html) +// in the Amazon Simple Queue Service Developer Guide. +type GetQueueUrlOutput struct { + _ struct{} `type:"structure"` + + // The URL of the queue. + QueueUrl *string `type:"string"` +} + +// String returns the string representation +func (s GetQueueUrlOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetQueueUrlOutput) GoString() string { + return s.String() +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *GetQueueUrlOutput) SetQueueUrl(v string) *GetQueueUrlOutput { + s.QueueUrl = &v + return s +} + +type ListDeadLetterSourceQueuesInput struct { + _ struct{} `type:"structure"` + + // Maximum number of results to include in the response. Value range is 1 to + // 1000. You must set MaxResults to receive a value for NextToken in the response. + MaxResults *int64 `type:"integer"` + + // Pagination token to request the next set of results. + NextToken *string `type:"string"` + + // The URL of a dead-letter queue. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ListDeadLetterSourceQueuesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDeadLetterSourceQueuesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListDeadLetterSourceQueuesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListDeadLetterSourceQueuesInput"} + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListDeadLetterSourceQueuesInput) SetMaxResults(v int64) *ListDeadLetterSourceQueuesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDeadLetterSourceQueuesInput) SetNextToken(v string) *ListDeadLetterSourceQueuesInput { + s.NextToken = &v + return s +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *ListDeadLetterSourceQueuesInput) SetQueueUrl(v string) *ListDeadLetterSourceQueuesInput { + s.QueueUrl = &v + return s +} + +// A list of your dead letter source queues. +type ListDeadLetterSourceQueuesOutput struct { + _ struct{} `type:"structure"` + + // Pagination token to include in the next request. Token value is null if there + // are no additional results to request, or if you did not set MaxResults in + // the request. + NextToken *string `type:"string"` + + // A list of source queue URLs that have the RedrivePolicy queue attribute configured + // with a dead-letter queue. + // + // QueueUrls is a required field + QueueUrls []*string `locationName:"queueUrls" locationNameList:"QueueUrl" type:"list" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s ListDeadLetterSourceQueuesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDeadLetterSourceQueuesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDeadLetterSourceQueuesOutput) SetNextToken(v string) *ListDeadLetterSourceQueuesOutput { + s.NextToken = &v + return s +} + +// SetQueueUrls sets the QueueUrls field's value. +func (s *ListDeadLetterSourceQueuesOutput) SetQueueUrls(v []*string) *ListDeadLetterSourceQueuesOutput { + s.QueueUrls = v + return s +} + +type ListQueueTagsInput struct { + _ struct{} `type:"structure"` + + // The URL of the queue. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ListQueueTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListQueueTagsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListQueueTagsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListQueueTagsInput"} + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *ListQueueTagsInput) SetQueueUrl(v string) *ListQueueTagsInput { + s.QueueUrl = &v + return s +} + +type ListQueueTagsOutput struct { + _ struct{} `type:"structure"` + + // The list of all tags added to the specified queue. + Tags map[string]*string `locationName:"Tag" locationNameKey:"Key" locationNameValue:"Value" type:"map" flattened:"true"` +} + +// String returns the string representation +func (s ListQueueTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListQueueTagsOutput) GoString() string { + return s.String() +} + +// SetTags sets the Tags field's value. +func (s *ListQueueTagsOutput) SetTags(v map[string]*string) *ListQueueTagsOutput { + s.Tags = v + return s +} + +type ListQueuesInput struct { + _ struct{} `type:"structure"` + + // Maximum number of results to include in the response. Value range is 1 to + // 1000. You must set MaxResults to receive a value for NextToken in the response. + MaxResults *int64 `type:"integer"` + + // Pagination token to request the next set of results. + NextToken *string `type:"string"` + + // A string to use for filtering the list results. Only those queues whose name + // begins with the specified string are returned. + // + // Queue URLs and names are case-sensitive. + QueueNamePrefix *string `type:"string"` +} + +// String returns the string representation +func (s ListQueuesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListQueuesInput) GoString() string { + return s.String() +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListQueuesInput) SetMaxResults(v int64) *ListQueuesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListQueuesInput) SetNextToken(v string) *ListQueuesInput { + s.NextToken = &v + return s +} + +// SetQueueNamePrefix sets the QueueNamePrefix field's value. +func (s *ListQueuesInput) SetQueueNamePrefix(v string) *ListQueuesInput { + s.QueueNamePrefix = &v + return s +} + +// A list of your queues. +type ListQueuesOutput struct { + _ struct{} `type:"structure"` + + // Pagination token to include in the next request. Token value is null if there + // are no additional results to request, or if you did not set MaxResults in + // the request. + NextToken *string `type:"string"` + + // A list of queue URLs, up to 1,000 entries, or the value of MaxResults that + // you sent in the request. + QueueUrls []*string `locationNameList:"QueueUrl" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s ListQueuesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListQueuesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListQueuesOutput) SetNextToken(v string) *ListQueuesOutput { + s.NextToken = &v + return s +} + +// SetQueueUrls sets the QueueUrls field's value. +func (s *ListQueuesOutput) SetQueueUrls(v []*string) *ListQueuesOutput { + s.QueueUrls = v + return s +} + +// An Amazon SQS message. +type Message struct { + _ struct{} `type:"structure"` + + // A map of the attributes requested in ReceiveMessage to their respective values. + // Supported attributes: + // + // * ApproximateReceiveCount + // + // * ApproximateFirstReceiveTimestamp + // + // * MessageDeduplicationId + // + // * MessageGroupId + // + // * SenderId + // + // * SentTimestamp + // + // * SequenceNumber + // + // ApproximateFirstReceiveTimestamp and SentTimestamp are each returned as an + // integer representing the epoch time (http://en.wikipedia.org/wiki/Unix_time) + // in milliseconds. + Attributes map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` + + // The message's contents (not URL-encoded). + Body *string `type:"string"` + + // An MD5 digest of the non-URL-encoded message body string. + MD5OfBody *string `type:"string"` + + // An MD5 digest of the non-URL-encoded message attribute string. You can use + // this attribute to verify that Amazon SQS received the message correctly. + // Amazon SQS URL-decodes the message before creating the MD5 digest. For information + // about MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). + MD5OfMessageAttributes *string `type:"string"` + + // Each message attribute consists of a Name, Type, and Value. For more information, + // see Amazon SQS Message Attributes (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) + // in the Amazon Simple Queue Service Developer Guide. + MessageAttributes map[string]*MessageAttributeValue `locationName:"MessageAttribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` + + // A unique identifier for the message. A MessageIdis considered unique across + // all AWS accounts for an extended period of time. + MessageId *string `type:"string"` + + // An identifier associated with the act of receiving the message. A new receipt + // handle is returned every time you receive a message. When deleting a message, + // you provide the last received receipt handle to delete the message. + ReceiptHandle *string `type:"string"` +} + +// String returns the string representation +func (s Message) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Message) GoString() string { + return s.String() +} + +// SetAttributes sets the Attributes field's value. +func (s *Message) SetAttributes(v map[string]*string) *Message { + s.Attributes = v + return s +} + +// SetBody sets the Body field's value. +func (s *Message) SetBody(v string) *Message { + s.Body = &v + return s +} + +// SetMD5OfBody sets the MD5OfBody field's value. +func (s *Message) SetMD5OfBody(v string) *Message { + s.MD5OfBody = &v + return s +} + +// SetMD5OfMessageAttributes sets the MD5OfMessageAttributes field's value. +func (s *Message) SetMD5OfMessageAttributes(v string) *Message { + s.MD5OfMessageAttributes = &v + return s +} + +// SetMessageAttributes sets the MessageAttributes field's value. +func (s *Message) SetMessageAttributes(v map[string]*MessageAttributeValue) *Message { + s.MessageAttributes = v + return s +} + +// SetMessageId sets the MessageId field's value. +func (s *Message) SetMessageId(v string) *Message { + s.MessageId = &v + return s +} + +// SetReceiptHandle sets the ReceiptHandle field's value. +func (s *Message) SetReceiptHandle(v string) *Message { + s.ReceiptHandle = &v + return s +} + +// The user-specified message attribute value. For string data types, the Value +// attribute has the same restrictions on the content as the message body. For +// more information, see SendMessage. +// +// Name, type, value and the message body must not be empty or null. All parts +// of the message attribute, including Name, Type, and Value, are part of the +// message size restriction (256 KB or 262,144 bytes). +type MessageAttributeValue struct { + _ struct{} `type:"structure"` + + // Not implemented. Reserved for future use. + BinaryListValues [][]byte `locationName:"BinaryListValue" locationNameList:"BinaryListValue" type:"list" flattened:"true"` + + // Binary type attributes can store any binary data, such as compressed data, + // encrypted data, or images. + // + // BinaryValue is automatically base64 encoded/decoded by the SDK. + BinaryValue []byte `type:"blob"` + + // Amazon SQS supports the following logical data types: String, Number, and + // Binary. For the Number data type, you must use StringValue. + // + // You can also append custom labels. For more information, see Amazon SQS Message + // Attributes (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) + // in the Amazon Simple Queue Service Developer Guide. + // + // DataType is a required field + DataType *string `type:"string" required:"true"` + + // Not implemented. Reserved for future use. + StringListValues []*string `locationName:"StringListValue" locationNameList:"StringListValue" type:"list" flattened:"true"` + + // Strings are Unicode with UTF-8 binary encoding. For a list of code values, + // see ASCII Printable Characters (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). + StringValue *string `type:"string"` +} + +// String returns the string representation +func (s MessageAttributeValue) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MessageAttributeValue) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *MessageAttributeValue) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MessageAttributeValue"} + if s.DataType == nil { + invalidParams.Add(request.NewErrParamRequired("DataType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBinaryListValues sets the BinaryListValues field's value. +func (s *MessageAttributeValue) SetBinaryListValues(v [][]byte) *MessageAttributeValue { + s.BinaryListValues = v + return s +} + +// SetBinaryValue sets the BinaryValue field's value. +func (s *MessageAttributeValue) SetBinaryValue(v []byte) *MessageAttributeValue { + s.BinaryValue = v + return s +} + +// SetDataType sets the DataType field's value. +func (s *MessageAttributeValue) SetDataType(v string) *MessageAttributeValue { + s.DataType = &v + return s +} + +// SetStringListValues sets the StringListValues field's value. +func (s *MessageAttributeValue) SetStringListValues(v []*string) *MessageAttributeValue { + s.StringListValues = v + return s +} + +// SetStringValue sets the StringValue field's value. +func (s *MessageAttributeValue) SetStringValue(v string) *MessageAttributeValue { + s.StringValue = &v + return s +} + +// The user-specified message system attribute value. For string data types, +// the Value attribute has the same restrictions on the content as the message +// body. For more information, see SendMessage. +// +// Name, type, value and the message body must not be empty or null. +type MessageSystemAttributeValue struct { + _ struct{} `type:"structure"` + + // Not implemented. Reserved for future use. + BinaryListValues [][]byte `locationName:"BinaryListValue" locationNameList:"BinaryListValue" type:"list" flattened:"true"` + + // Binary type attributes can store any binary data, such as compressed data, + // encrypted data, or images. + // + // BinaryValue is automatically base64 encoded/decoded by the SDK. + BinaryValue []byte `type:"blob"` + + // Amazon SQS supports the following logical data types: String, Number, and + // Binary. For the Number data type, you must use StringValue. + // + // You can also append custom labels. For more information, see Amazon SQS Message + // Attributes (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) + // in the Amazon Simple Queue Service Developer Guide. + // + // DataType is a required field + DataType *string `type:"string" required:"true"` + + // Not implemented. Reserved for future use. + StringListValues []*string `locationName:"StringListValue" locationNameList:"StringListValue" type:"list" flattened:"true"` + + // Strings are Unicode with UTF-8 binary encoding. For a list of code values, + // see ASCII Printable Characters (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). + StringValue *string `type:"string"` +} + +// String returns the string representation +func (s MessageSystemAttributeValue) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MessageSystemAttributeValue) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *MessageSystemAttributeValue) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MessageSystemAttributeValue"} + if s.DataType == nil { + invalidParams.Add(request.NewErrParamRequired("DataType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBinaryListValues sets the BinaryListValues field's value. +func (s *MessageSystemAttributeValue) SetBinaryListValues(v [][]byte) *MessageSystemAttributeValue { + s.BinaryListValues = v + return s +} + +// SetBinaryValue sets the BinaryValue field's value. +func (s *MessageSystemAttributeValue) SetBinaryValue(v []byte) *MessageSystemAttributeValue { + s.BinaryValue = v + return s +} + +// SetDataType sets the DataType field's value. +func (s *MessageSystemAttributeValue) SetDataType(v string) *MessageSystemAttributeValue { + s.DataType = &v + return s +} + +// SetStringListValues sets the StringListValues field's value. +func (s *MessageSystemAttributeValue) SetStringListValues(v []*string) *MessageSystemAttributeValue { + s.StringListValues = v + return s +} + +// SetStringValue sets the StringValue field's value. +func (s *MessageSystemAttributeValue) SetStringValue(v string) *MessageSystemAttributeValue { + s.StringValue = &v + return s +} + +type PurgeQueueInput struct { + _ struct{} `type:"structure"` + + // The URL of the queue from which the PurgeQueue action deletes messages. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s PurgeQueueInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PurgeQueueInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PurgeQueueInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PurgeQueueInput"} + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *PurgeQueueInput) SetQueueUrl(v string) *PurgeQueueInput { + s.QueueUrl = &v + return s +} + +type PurgeQueueOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PurgeQueueOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PurgeQueueOutput) GoString() string { + return s.String() +} + +type ReceiveMessageInput struct { + _ struct{} `type:"structure"` + + // A list of attributes that need to be returned along with each message. These + // attributes include: + // + // * All – Returns all values. + // + // * ApproximateFirstReceiveTimestamp – Returns the time the message was + // first received from the queue (epoch time (http://en.wikipedia.org/wiki/Unix_time) + // in milliseconds). + // + // * ApproximateReceiveCount – Returns the number of times a message has + // been received across all queues but not deleted. + // + // * AWSTraceHeader – Returns the AWS X-Ray trace header string. + // + // * SenderId For an IAM user, returns the IAM user ID, for example ABCDEFGHI1JKLMNOPQ23R. + // For an IAM role, returns the IAM role ID, for example ABCDE1F2GH3I4JK5LMNOP:i-a123b456. + // + // * SentTimestamp – Returns the time the message was sent to the queue + // (epoch time (http://en.wikipedia.org/wiki/Unix_time) in milliseconds). + // + // * MessageDeduplicationId – Returns the value provided by the producer + // that calls the SendMessage action. + // + // * MessageGroupId – Returns the value provided by the producer that calls + // the SendMessage action. Messages with the same MessageGroupId are returned + // in sequence. + // + // * SequenceNumber – Returns the value provided by Amazon SQS. + AttributeNames []*string `locationNameList:"AttributeName" type:"list" flattened:"true"` + + // The maximum number of messages to return. Amazon SQS never returns more messages + // than this value (however, fewer messages might be returned). Valid values: + // 1 to 10. Default: 1. + MaxNumberOfMessages *int64 `type:"integer"` + + // The name of the message attribute, where N is the index. + // + // * The name can contain alphanumeric characters and the underscore (_), + // hyphen (-), and period (.). + // + // * The name is case-sensitive and must be unique among all attribute names + // for the message. + // + // * The name must not start with AWS-reserved prefixes such as AWS. or Amazon. + // (or any casing variants). + // + // * The name must not start or end with a period (.), and it should not + // have periods in succession (..). + // + // * The name can be up to 256 characters long. + // + // When using ReceiveMessage, you can send a list of attribute names to receive, + // or you can return all of the attributes by specifying All or .* in your request. + // You can also use all message attributes starting with a prefix, for example + // bar.*. + MessageAttributeNames []*string `locationNameList:"MessageAttributeName" type:"list" flattened:"true"` + + // The URL of the Amazon SQS queue from which messages are received. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` + + // This parameter applies only to FIFO (first-in-first-out) queues. + // + // The token used for deduplication of ReceiveMessage calls. If a networking + // issue occurs after a ReceiveMessage action, and instead of a response you + // receive a generic error, it is possible to retry the same action with an + // identical ReceiveRequestAttemptId to retrieve the same set of messages, even + // if their visibility timeout has not yet expired. + // + // * You can use ReceiveRequestAttemptId only for 5 minutes after a ReceiveMessage + // action. + // + // * When you set FifoQueue, a caller of the ReceiveMessage action can provide + // a ReceiveRequestAttemptId explicitly. + // + // * If a caller of the ReceiveMessage action doesn't provide a ReceiveRequestAttemptId, + // Amazon SQS generates a ReceiveRequestAttemptId. + // + // * It is possible to retry the ReceiveMessage action with the same ReceiveRequestAttemptId + // if none of the messages have been modified (deleted or had their visibility + // changes). + // + // * During a visibility timeout, subsequent calls with the same ReceiveRequestAttemptId + // return the same messages and receipt handles. If a retry occurs within + // the deduplication interval, it resets the visibility timeout. For more + // information, see Visibility Timeout (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) + // in the Amazon Simple Queue Service Developer Guide. If a caller of the + // ReceiveMessage action still processes messages when the visibility timeout + // expires and messages become visible, another worker consuming from the + // same queue can receive the same messages and therefore process duplicates. + // Also, if a consumer whose message processing time is longer than the visibility + // timeout tries to delete the processed messages, the action fails with + // an error. To mitigate this effect, ensure that your application observes + // a safe threshold before the visibility timeout expires and extend the + // visibility timeout as necessary. + // + // * While messages with a particular MessageGroupId are invisible, no more + // messages belonging to the same MessageGroupId are returned until the visibility + // timeout expires. You can still receive messages with another MessageGroupId + // as long as it is also visible. + // + // * If a caller of ReceiveMessage can't track the ReceiveRequestAttemptId, + // no retries work until the original visibility timeout expires. As a result, + // delays might occur but the messages in the queue remain in a strict order. + // + // The maximum length of ReceiveRequestAttemptId is 128 characters. ReceiveRequestAttemptId + // can contain alphanumeric characters (a-z, A-Z, 0-9) and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). + // + // For best practices of using ReceiveRequestAttemptId, see Using the ReceiveRequestAttemptId + // Request Parameter (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html) + // in the Amazon Simple Queue Service Developer Guide. + ReceiveRequestAttemptId *string `type:"string"` + + // The duration (in seconds) that the received messages are hidden from subsequent + // retrieve requests after being retrieved by a ReceiveMessage request. + VisibilityTimeout *int64 `type:"integer"` + + // The duration (in seconds) for which the call waits for a message to arrive + // in the queue before returning. If a message is available, the call returns + // sooner than WaitTimeSeconds. If no messages are available and the wait time + // expires, the call returns successfully with an empty list of messages. + // + // To avoid HTTP errors, ensure that the HTTP response timeout for ReceiveMessage + // requests is longer than the WaitTimeSeconds parameter. For example, with + // the Java SDK, you can set HTTP transport settings using the NettyNioAsyncHttpClient + // (https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClient.html) + // for asynchronous clients, or the ApacheHttpClient (https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/apache/ApacheHttpClient.html) + // for synchronous clients. + WaitTimeSeconds *int64 `type:"integer"` +} + +// String returns the string representation +func (s ReceiveMessageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReceiveMessageInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReceiveMessageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReceiveMessageInput"} + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAttributeNames sets the AttributeNames field's value. +func (s *ReceiveMessageInput) SetAttributeNames(v []*string) *ReceiveMessageInput { + s.AttributeNames = v + return s +} + +// SetMaxNumberOfMessages sets the MaxNumberOfMessages field's value. +func (s *ReceiveMessageInput) SetMaxNumberOfMessages(v int64) *ReceiveMessageInput { + s.MaxNumberOfMessages = &v + return s +} + +// SetMessageAttributeNames sets the MessageAttributeNames field's value. +func (s *ReceiveMessageInput) SetMessageAttributeNames(v []*string) *ReceiveMessageInput { + s.MessageAttributeNames = v + return s +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *ReceiveMessageInput) SetQueueUrl(v string) *ReceiveMessageInput { + s.QueueUrl = &v + return s +} + +// SetReceiveRequestAttemptId sets the ReceiveRequestAttemptId field's value. +func (s *ReceiveMessageInput) SetReceiveRequestAttemptId(v string) *ReceiveMessageInput { + s.ReceiveRequestAttemptId = &v + return s +} + +// SetVisibilityTimeout sets the VisibilityTimeout field's value. +func (s *ReceiveMessageInput) SetVisibilityTimeout(v int64) *ReceiveMessageInput { + s.VisibilityTimeout = &v + return s +} + +// SetWaitTimeSeconds sets the WaitTimeSeconds field's value. +func (s *ReceiveMessageInput) SetWaitTimeSeconds(v int64) *ReceiveMessageInput { + s.WaitTimeSeconds = &v + return s +} + +// A list of received messages. +type ReceiveMessageOutput struct { + _ struct{} `type:"structure"` + + // A list of messages. + Messages []*Message `locationNameList:"Message" type:"list" flattened:"true"` +} + +// String returns the string representation +func (s ReceiveMessageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReceiveMessageOutput) GoString() string { + return s.String() +} + +// SetMessages sets the Messages field's value. +func (s *ReceiveMessageOutput) SetMessages(v []*Message) *ReceiveMessageOutput { + s.Messages = v + return s +} + +type RemovePermissionInput struct { + _ struct{} `type:"structure"` + + // The identification of the permission to remove. This is the label added using + // the AddPermission action. + // + // Label is a required field + Label *string `type:"string" required:"true"` + + // The URL of the Amazon SQS queue from which permissions are removed. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s RemovePermissionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemovePermissionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RemovePermissionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RemovePermissionInput"} + if s.Label == nil { + invalidParams.Add(request.NewErrParamRequired("Label")) + } + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLabel sets the Label field's value. +func (s *RemovePermissionInput) SetLabel(v string) *RemovePermissionInput { + s.Label = &v + return s +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *RemovePermissionInput) SetQueueUrl(v string) *RemovePermissionInput { + s.QueueUrl = &v + return s +} + +type RemovePermissionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s RemovePermissionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemovePermissionOutput) GoString() string { + return s.String() +} + +type SendMessageBatchInput struct { + _ struct{} `type:"structure"` + + // A list of SendMessageBatchRequestEntry items. + // + // Entries is a required field + Entries []*SendMessageBatchRequestEntry `locationNameList:"SendMessageBatchRequestEntry" type:"list" flattened:"true" required:"true"` + + // The URL of the Amazon SQS queue to which batched messages are sent. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s SendMessageBatchInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SendMessageBatchInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SendMessageBatchInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SendMessageBatchInput"} + if s.Entries == nil { + invalidParams.Add(request.NewErrParamRequired("Entries")) + } + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + if s.Entries != nil { + for i, v := range s.Entries { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEntries sets the Entries field's value. +func (s *SendMessageBatchInput) SetEntries(v []*SendMessageBatchRequestEntry) *SendMessageBatchInput { + s.Entries = v + return s +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *SendMessageBatchInput) SetQueueUrl(v string) *SendMessageBatchInput { + s.QueueUrl = &v + return s +} + +// For each message in the batch, the response contains a SendMessageBatchResultEntry +// tag if the message succeeds or a BatchResultErrorEntry tag if the message +// fails. +type SendMessageBatchOutput struct { + _ struct{} `type:"structure"` + + // A list of BatchResultErrorEntry items with error details about each message + // that can't be enqueued. + // + // Failed is a required field + Failed []*BatchResultErrorEntry `locationNameList:"BatchResultErrorEntry" type:"list" flattened:"true" required:"true"` + + // A list of SendMessageBatchResultEntry items. + // + // Successful is a required field + Successful []*SendMessageBatchResultEntry `locationNameList:"SendMessageBatchResultEntry" type:"list" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s SendMessageBatchOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SendMessageBatchOutput) GoString() string { + return s.String() +} + +// SetFailed sets the Failed field's value. +func (s *SendMessageBatchOutput) SetFailed(v []*BatchResultErrorEntry) *SendMessageBatchOutput { + s.Failed = v + return s +} + +// SetSuccessful sets the Successful field's value. +func (s *SendMessageBatchOutput) SetSuccessful(v []*SendMessageBatchResultEntry) *SendMessageBatchOutput { + s.Successful = v + return s +} + +// Contains the details of a single Amazon SQS message along with an Id. +type SendMessageBatchRequestEntry struct { + _ struct{} `type:"structure"` + + // The length of time, in seconds, for which a specific message is delayed. + // Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive DelaySeconds + // value become available for processing after the delay period is finished. + // If you don't specify a value, the default value for the queue is applied. + // + // When you set FifoQueue, you can't set DelaySeconds per message. You can set + // this parameter only on a queue level. + DelaySeconds *int64 `type:"integer"` + + // An identifier for a message in this batch used to communicate the result. + // + // The Ids of a batch request need to be unique within a request. + // + // This identifier can have up to 80 characters. The following characters are + // accepted: alphanumeric characters, hyphens(-), and underscores (_). + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // Each message attribute consists of a Name, Type, and Value. For more information, + // see Amazon SQS Message Attributes (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) + // in the Amazon Simple Queue Service Developer Guide. + MessageAttributes map[string]*MessageAttributeValue `locationName:"MessageAttribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` + + // The body of the message. + // + // MessageBody is a required field + MessageBody *string `type:"string" required:"true"` + + // This parameter applies only to FIFO (first-in-first-out) queues. + // + // The token used for deduplication of messages within a 5-minute minimum deduplication + // interval. If a message with a particular MessageDeduplicationId is sent successfully, + // subsequent messages with the same MessageDeduplicationId are accepted successfully + // but aren't delivered. For more information, see Exactly-Once Processing (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) + // in the Amazon Simple Queue Service Developer Guide. + // + // * Every message must have a unique MessageDeduplicationId, You may provide + // a MessageDeduplicationId explicitly. If you aren't able to provide a MessageDeduplicationId + // and you enable ContentBasedDeduplication for your queue, Amazon SQS uses + // a SHA-256 hash to generate the MessageDeduplicationId using the body of + // the message (but not the attributes of the message). If you don't provide + // a MessageDeduplicationId and the queue doesn't have ContentBasedDeduplication + // set, the action fails with an error. If the queue has ContentBasedDeduplication + // set, your MessageDeduplicationId overrides the generated one. + // + // * When ContentBasedDeduplication is in effect, messages with identical + // content sent within the deduplication interval are treated as duplicates + // and only one copy of the message is delivered. + // + // * If you send one message with ContentBasedDeduplication enabled and then + // another message with a MessageDeduplicationId that is the same as the + // one generated for the first MessageDeduplicationId, the two messages are + // treated as duplicates and only one copy of the message is delivered. + // + // The MessageDeduplicationId is available to the consumer of the message (this + // can be useful for troubleshooting delivery issues). + // + // If a message is sent successfully but the acknowledgement is lost and the + // message is resent with the same MessageDeduplicationId after the deduplication + // interval, Amazon SQS can't detect duplicate messages. + // + // Amazon SQS continues to keep track of the message deduplication ID even after + // the message is received and deleted. + // + // The length of MessageDeduplicationId is 128 characters. MessageDeduplicationId + // can contain alphanumeric characters (a-z, A-Z, 0-9) and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). + // + // For best practices of using MessageDeduplicationId, see Using the MessageDeduplicationId + // Property (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html) + // in the Amazon Simple Queue Service Developer Guide. + MessageDeduplicationId *string `type:"string"` + + // This parameter applies only to FIFO (first-in-first-out) queues. + // + // The tag that specifies that a message belongs to a specific message group. + // Messages that belong to the same message group are processed in a FIFO manner + // (however, messages in different message groups might be processed out of + // order). To interleave multiple ordered streams within a single queue, use + // MessageGroupId values (for example, session data for multiple users). In + // this scenario, multiple consumers can process the queue, but the session + // data of each user is processed in a FIFO fashion. + // + // * You must associate a non-empty MessageGroupId with a message. If you + // don't provide a MessageGroupId, the action fails. + // + // * ReceiveMessage might return messages with multiple MessageGroupId values. + // For each MessageGroupId, the messages are sorted by time sent. The caller + // can't specify a MessageGroupId. + // + // The length of MessageGroupId is 128 characters. Valid values: alphanumeric + // characters and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). + // + // For best practices of using MessageGroupId, see Using the MessageGroupId + // Property (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // MessageGroupId is required for FIFO queues. You can't use it for Standard + // queues. + MessageGroupId *string `type:"string"` + + // The message system attribute to send Each message system attribute consists + // of a Name, Type, and Value. + // + // * Currently, the only supported message system attribute is AWSTraceHeader. + // Its type must be String and its value must be a correctly formatted AWS + // X-Ray trace header string. + // + // * The size of a message system attribute doesn't count towards the total + // size of a message. + MessageSystemAttributes map[string]*MessageSystemAttributeValue `locationName:"MessageSystemAttribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` +} + +// String returns the string representation +func (s SendMessageBatchRequestEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SendMessageBatchRequestEntry) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SendMessageBatchRequestEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SendMessageBatchRequestEntry"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.MessageBody == nil { + invalidParams.Add(request.NewErrParamRequired("MessageBody")) + } + if s.MessageAttributes != nil { + for i, v := range s.MessageAttributes { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MessageAttributes", i), err.(request.ErrInvalidParams)) + } + } + } + if s.MessageSystemAttributes != nil { + for i, v := range s.MessageSystemAttributes { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MessageSystemAttributes", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDelaySeconds sets the DelaySeconds field's value. +func (s *SendMessageBatchRequestEntry) SetDelaySeconds(v int64) *SendMessageBatchRequestEntry { + s.DelaySeconds = &v + return s +} + +// SetId sets the Id field's value. +func (s *SendMessageBatchRequestEntry) SetId(v string) *SendMessageBatchRequestEntry { + s.Id = &v + return s +} + +// SetMessageAttributes sets the MessageAttributes field's value. +func (s *SendMessageBatchRequestEntry) SetMessageAttributes(v map[string]*MessageAttributeValue) *SendMessageBatchRequestEntry { + s.MessageAttributes = v + return s +} + +// SetMessageBody sets the MessageBody field's value. +func (s *SendMessageBatchRequestEntry) SetMessageBody(v string) *SendMessageBatchRequestEntry { + s.MessageBody = &v + return s +} + +// SetMessageDeduplicationId sets the MessageDeduplicationId field's value. +func (s *SendMessageBatchRequestEntry) SetMessageDeduplicationId(v string) *SendMessageBatchRequestEntry { + s.MessageDeduplicationId = &v + return s +} + +// SetMessageGroupId sets the MessageGroupId field's value. +func (s *SendMessageBatchRequestEntry) SetMessageGroupId(v string) *SendMessageBatchRequestEntry { + s.MessageGroupId = &v + return s +} + +// SetMessageSystemAttributes sets the MessageSystemAttributes field's value. +func (s *SendMessageBatchRequestEntry) SetMessageSystemAttributes(v map[string]*MessageSystemAttributeValue) *SendMessageBatchRequestEntry { + s.MessageSystemAttributes = v + return s +} + +// Encloses a MessageId for a successfully-enqueued message in a SendMessageBatch. +type SendMessageBatchResultEntry struct { + _ struct{} `type:"structure"` + + // An identifier for the message in this batch. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // An MD5 digest of the non-URL-encoded message attribute string. You can use + // this attribute to verify that Amazon SQS received the message correctly. + // Amazon SQS URL-decodes the message before creating the MD5 digest. For information + // about MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). + MD5OfMessageAttributes *string `type:"string"` + + // An MD5 digest of the non-URL-encoded message body string. You can use this + // attribute to verify that Amazon SQS received the message correctly. Amazon + // SQS URL-decodes the message before creating the MD5 digest. For information + // about MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). + // + // MD5OfMessageBody is a required field + MD5OfMessageBody *string `type:"string" required:"true"` + + // An MD5 digest of the non-URL-encoded message system attribute string. You + // can use this attribute to verify that Amazon SQS received the message correctly. + // Amazon SQS URL-decodes the message before creating the MD5 digest. For information + // about MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). + MD5OfMessageSystemAttributes *string `type:"string"` + + // An identifier for the message. + // + // MessageId is a required field + MessageId *string `type:"string" required:"true"` + + // This parameter applies only to FIFO (first-in-first-out) queues. + // + // The large, non-consecutive number that Amazon SQS assigns to each message. + // + // The length of SequenceNumber is 128 bits. As SequenceNumber continues to + // increase for a particular MessageGroupId. + SequenceNumber *string `type:"string"` +} + +// String returns the string representation +func (s SendMessageBatchResultEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SendMessageBatchResultEntry) GoString() string { + return s.String() +} + +// SetId sets the Id field's value. +func (s *SendMessageBatchResultEntry) SetId(v string) *SendMessageBatchResultEntry { + s.Id = &v + return s +} + +// SetMD5OfMessageAttributes sets the MD5OfMessageAttributes field's value. +func (s *SendMessageBatchResultEntry) SetMD5OfMessageAttributes(v string) *SendMessageBatchResultEntry { + s.MD5OfMessageAttributes = &v + return s +} + +// SetMD5OfMessageBody sets the MD5OfMessageBody field's value. +func (s *SendMessageBatchResultEntry) SetMD5OfMessageBody(v string) *SendMessageBatchResultEntry { + s.MD5OfMessageBody = &v + return s +} + +// SetMD5OfMessageSystemAttributes sets the MD5OfMessageSystemAttributes field's value. +func (s *SendMessageBatchResultEntry) SetMD5OfMessageSystemAttributes(v string) *SendMessageBatchResultEntry { + s.MD5OfMessageSystemAttributes = &v + return s +} + +// SetMessageId sets the MessageId field's value. +func (s *SendMessageBatchResultEntry) SetMessageId(v string) *SendMessageBatchResultEntry { + s.MessageId = &v + return s +} + +// SetSequenceNumber sets the SequenceNumber field's value. +func (s *SendMessageBatchResultEntry) SetSequenceNumber(v string) *SendMessageBatchResultEntry { + s.SequenceNumber = &v + return s +} + +type SendMessageInput struct { + _ struct{} `type:"structure"` + + // The length of time, in seconds, for which to delay a specific message. Valid + // values: 0 to 900. Maximum: 15 minutes. Messages with a positive DelaySeconds + // value become available for processing after the delay period is finished. + // If you don't specify a value, the default value for the queue applies. + // + // When you set FifoQueue, you can't set DelaySeconds per message. You can set + // this parameter only on a queue level. + DelaySeconds *int64 `type:"integer"` + + // Each message attribute consists of a Name, Type, and Value. For more information, + // see Amazon SQS Message Attributes (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) + // in the Amazon Simple Queue Service Developer Guide. + MessageAttributes map[string]*MessageAttributeValue `locationName:"MessageAttribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` + + // The message to send. The minimum size is one character. The maximum size + // is 256 KB. + // + // A message can include only XML, JSON, and unformatted text. The following + // Unicode characters are allowed: + // + // #x9 | #xA | #xD | #x20 to #xD7FF | #xE000 to #xFFFD | #x10000 to #x10FFFF + // + // Any characters not included in this list will be rejected. For more information, + // see the W3C specification for characters (http://www.w3.org/TR/REC-xml/#charsets). + // + // MessageBody is a required field + MessageBody *string `type:"string" required:"true"` + + // This parameter applies only to FIFO (first-in-first-out) queues. + // + // The token used for deduplication of sent messages. If a message with a particular + // MessageDeduplicationId is sent successfully, any messages sent with the same + // MessageDeduplicationId are accepted successfully but aren't delivered during + // the 5-minute deduplication interval. For more information, see Exactly-Once + // Processing (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) + // in the Amazon Simple Queue Service Developer Guide. + // + // * Every message must have a unique MessageDeduplicationId, You may provide + // a MessageDeduplicationId explicitly. If you aren't able to provide a MessageDeduplicationId + // and you enable ContentBasedDeduplication for your queue, Amazon SQS uses + // a SHA-256 hash to generate the MessageDeduplicationId using the body of + // the message (but not the attributes of the message). If you don't provide + // a MessageDeduplicationId and the queue doesn't have ContentBasedDeduplication + // set, the action fails with an error. If the queue has ContentBasedDeduplication + // set, your MessageDeduplicationId overrides the generated one. + // + // * When ContentBasedDeduplication is in effect, messages with identical + // content sent within the deduplication interval are treated as duplicates + // and only one copy of the message is delivered. + // + // * If you send one message with ContentBasedDeduplication enabled and then + // another message with a MessageDeduplicationId that is the same as the + // one generated for the first MessageDeduplicationId, the two messages are + // treated as duplicates and only one copy of the message is delivered. + // + // The MessageDeduplicationId is available to the consumer of the message (this + // can be useful for troubleshooting delivery issues). + // + // If a message is sent successfully but the acknowledgement is lost and the + // message is resent with the same MessageDeduplicationId after the deduplication + // interval, Amazon SQS can't detect duplicate messages. + // + // Amazon SQS continues to keep track of the message deduplication ID even after + // the message is received and deleted. + // + // The maximum length of MessageDeduplicationId is 128 characters. MessageDeduplicationId + // can contain alphanumeric characters (a-z, A-Z, 0-9) and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). + // + // For best practices of using MessageDeduplicationId, see Using the MessageDeduplicationId + // Property (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html) + // in the Amazon Simple Queue Service Developer Guide. + MessageDeduplicationId *string `type:"string"` + + // This parameter applies only to FIFO (first-in-first-out) queues. + // + // The tag that specifies that a message belongs to a specific message group. + // Messages that belong to the same message group are processed in a FIFO manner + // (however, messages in different message groups might be processed out of + // order). To interleave multiple ordered streams within a single queue, use + // MessageGroupId values (for example, session data for multiple users). In + // this scenario, multiple consumers can process the queue, but the session + // data of each user is processed in a FIFO fashion. + // + // * You must associate a non-empty MessageGroupId with a message. If you + // don't provide a MessageGroupId, the action fails. + // + // * ReceiveMessage might return messages with multiple MessageGroupId values. + // For each MessageGroupId, the messages are sorted by time sent. The caller + // can't specify a MessageGroupId. + // + // The length of MessageGroupId is 128 characters. Valid values: alphanumeric + // characters and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). + // + // For best practices of using MessageGroupId, see Using the MessageGroupId + // Property (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // MessageGroupId is required for FIFO queues. You can't use it for Standard + // queues. + MessageGroupId *string `type:"string"` + + // The message system attribute to send. Each message system attribute consists + // of a Name, Type, and Value. + // + // * Currently, the only supported message system attribute is AWSTraceHeader. + // Its type must be String and its value must be a correctly formatted AWS + // X-Ray trace header string. + // + // * The size of a message system attribute doesn't count towards the total + // size of a message. + MessageSystemAttributes map[string]*MessageSystemAttributeValue `locationName:"MessageSystemAttribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` + + // The URL of the Amazon SQS queue to which a message is sent. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s SendMessageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SendMessageInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SendMessageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SendMessageInput"} + if s.MessageBody == nil { + invalidParams.Add(request.NewErrParamRequired("MessageBody")) + } + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + if s.MessageAttributes != nil { + for i, v := range s.MessageAttributes { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MessageAttributes", i), err.(request.ErrInvalidParams)) + } + } + } + if s.MessageSystemAttributes != nil { + for i, v := range s.MessageSystemAttributes { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MessageSystemAttributes", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDelaySeconds sets the DelaySeconds field's value. +func (s *SendMessageInput) SetDelaySeconds(v int64) *SendMessageInput { + s.DelaySeconds = &v + return s +} + +// SetMessageAttributes sets the MessageAttributes field's value. +func (s *SendMessageInput) SetMessageAttributes(v map[string]*MessageAttributeValue) *SendMessageInput { + s.MessageAttributes = v + return s +} + +// SetMessageBody sets the MessageBody field's value. +func (s *SendMessageInput) SetMessageBody(v string) *SendMessageInput { + s.MessageBody = &v + return s +} + +// SetMessageDeduplicationId sets the MessageDeduplicationId field's value. +func (s *SendMessageInput) SetMessageDeduplicationId(v string) *SendMessageInput { + s.MessageDeduplicationId = &v + return s +} + +// SetMessageGroupId sets the MessageGroupId field's value. +func (s *SendMessageInput) SetMessageGroupId(v string) *SendMessageInput { + s.MessageGroupId = &v + return s +} + +// SetMessageSystemAttributes sets the MessageSystemAttributes field's value. +func (s *SendMessageInput) SetMessageSystemAttributes(v map[string]*MessageSystemAttributeValue) *SendMessageInput { + s.MessageSystemAttributes = v + return s +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *SendMessageInput) SetQueueUrl(v string) *SendMessageInput { + s.QueueUrl = &v + return s +} + +// The MD5OfMessageBody and MessageId elements. +type SendMessageOutput struct { + _ struct{} `type:"structure"` + + // An MD5 digest of the non-URL-encoded message attribute string. You can use + // this attribute to verify that Amazon SQS received the message correctly. + // Amazon SQS URL-decodes the message before creating the MD5 digest. For information + // about MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). + MD5OfMessageAttributes *string `type:"string"` + + // An MD5 digest of the non-URL-encoded message body string. You can use this + // attribute to verify that Amazon SQS received the message correctly. Amazon + // SQS URL-decodes the message before creating the MD5 digest. For information + // about MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). + MD5OfMessageBody *string `type:"string"` + + // An MD5 digest of the non-URL-encoded message system attribute string. You + // can use this attribute to verify that Amazon SQS received the message correctly. + // Amazon SQS URL-decodes the message before creating the MD5 digest. + MD5OfMessageSystemAttributes *string `type:"string"` + + // An attribute containing the MessageId of the message sent to the queue. For + // more information, see Queue and Message Identifiers (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html) + // in the Amazon Simple Queue Service Developer Guide. + MessageId *string `type:"string"` + + // This parameter applies only to FIFO (first-in-first-out) queues. + // + // The large, non-consecutive number that Amazon SQS assigns to each message. + // + // The length of SequenceNumber is 128 bits. SequenceNumber continues to increase + // for a particular MessageGroupId. + SequenceNumber *string `type:"string"` +} + +// String returns the string representation +func (s SendMessageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SendMessageOutput) GoString() string { + return s.String() +} + +// SetMD5OfMessageAttributes sets the MD5OfMessageAttributes field's value. +func (s *SendMessageOutput) SetMD5OfMessageAttributes(v string) *SendMessageOutput { + s.MD5OfMessageAttributes = &v + return s +} + +// SetMD5OfMessageBody sets the MD5OfMessageBody field's value. +func (s *SendMessageOutput) SetMD5OfMessageBody(v string) *SendMessageOutput { + s.MD5OfMessageBody = &v + return s +} + +// SetMD5OfMessageSystemAttributes sets the MD5OfMessageSystemAttributes field's value. +func (s *SendMessageOutput) SetMD5OfMessageSystemAttributes(v string) *SendMessageOutput { + s.MD5OfMessageSystemAttributes = &v + return s +} + +// SetMessageId sets the MessageId field's value. +func (s *SendMessageOutput) SetMessageId(v string) *SendMessageOutput { + s.MessageId = &v + return s +} + +// SetSequenceNumber sets the SequenceNumber field's value. +func (s *SendMessageOutput) SetSequenceNumber(v string) *SendMessageOutput { + s.SequenceNumber = &v + return s +} + +type SetQueueAttributesInput struct { + _ struct{} `type:"structure"` + + // A map of attributes to set. + // + // The following lists the names, descriptions, and values of the special request + // parameters that the SetQueueAttributes action uses: + // + // * DelaySeconds – The length of time, in seconds, for which the delivery + // of all messages in the queue is delayed. Valid values: An integer from + // 0 to 900 (15 minutes). Default: 0. + // + // * MaximumMessageSize – The limit of how many bytes a message can contain + // before Amazon SQS rejects it. Valid values: An integer from 1,024 bytes + // (1 KiB) up to 262,144 bytes (256 KiB). Default: 262,144 (256 KiB). + // + // * MessageRetentionPeriod – The length of time, in seconds, for which + // Amazon SQS retains a message. Valid values: An integer representing seconds, + // from 60 (1 minute) to 1,209,600 (14 days). Default: 345,600 (4 days). + // + // * Policy – The queue's policy. A valid AWS policy. For more information + // about policy structure, see Overview of AWS IAM Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html) + // in the Amazon IAM User Guide. + // + // * ReceiveMessageWaitTimeSeconds – The length of time, in seconds, for + // which a ReceiveMessage action waits for a message to arrive. Valid values: + // An integer from 0 to 20 (seconds). Default: 0. + // + // * RedrivePolicy – The string that includes the parameters for the dead-letter + // queue functionality of the source queue as a JSON object. For more information + // about the redrive policy and dead-letter queues, see Using Amazon SQS + // Dead-Letter Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) + // in the Amazon Simple Queue Service Developer Guide. deadLetterTargetArn + // – The Amazon Resource Name (ARN) of the dead-letter queue to which Amazon + // SQS moves messages after the value of maxReceiveCount is exceeded. maxReceiveCount + // – The number of times a message is delivered to the source queue before + // being moved to the dead-letter queue. When the ReceiveCount for a message + // exceeds the maxReceiveCount for a queue, Amazon SQS moves the message + // to the dead-letter-queue. The dead-letter queue of a FIFO queue must also + // be a FIFO queue. Similarly, the dead-letter queue of a standard queue + // must also be a standard queue. + // + // * VisibilityTimeout – The visibility timeout for the queue, in seconds. + // Valid values: An integer from 0 to 43,200 (12 hours). Default: 30. For + // more information about the visibility timeout, see Visibility Timeout + // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // The following attributes apply only to server-side-encryption (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html): + // + // * KmsMasterKeyId – The ID of an AWS-managed customer master key (CMK) + // for Amazon SQS or a custom CMK. For more information, see Key Terms (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms). + // While the alias of the AWS-managed CMK for Amazon SQS is always alias/aws/sqs, + // the alias of a custom CMK can, for example, be alias/MyAlias . For more + // examples, see KeyId (https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) + // in the AWS Key Management Service API Reference. + // + // * KmsDataKeyReusePeriodSeconds – The length of time, in seconds, for + // which Amazon SQS can reuse a data key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys) + // to encrypt or decrypt messages before calling AWS KMS again. An integer + // representing seconds, between 60 seconds (1 minute) and 86,400 seconds + // (24 hours). Default: 300 (5 minutes). A shorter time period provides better + // security but results in more calls to KMS which might incur charges after + // Free Tier. For more information, see How Does the Data Key Reuse Period + // Work? (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work). + // + // The following attribute applies only to FIFO (first-in-first-out) queues + // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): + // + // * ContentBasedDeduplication – Enables content-based deduplication. For + // more information, see Exactly-Once Processing (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) + // in the Amazon Simple Queue Service Developer Guide. Note the following: + // Every message must have a unique MessageDeduplicationId. You may provide + // a MessageDeduplicationId explicitly. If you aren't able to provide a MessageDeduplicationId + // and you enable ContentBasedDeduplication for your queue, Amazon SQS uses + // a SHA-256 hash to generate the MessageDeduplicationId using the body of + // the message (but not the attributes of the message). If you don't provide + // a MessageDeduplicationId and the queue doesn't have ContentBasedDeduplication + // set, the action fails with an error. If the queue has ContentBasedDeduplication + // set, your MessageDeduplicationId overrides the generated one. When ContentBasedDeduplication + // is in effect, messages with identical content sent within the deduplication + // interval are treated as duplicates and only one copy of the message is + // delivered. If you send one message with ContentBasedDeduplication enabled + // and then another message with a MessageDeduplicationId that is the same + // as the one generated for the first MessageDeduplicationId, the two messages + // are treated as duplicates and only one copy of the message is delivered. + // + // Preview: High throughput for FIFO queues + // + // High throughput for Amazon SQS FIFO queues is in preview release and is subject + // to change. This feature provides a high number of transactions per second + // (TPS) for messages in FIFO queues. For information on throughput quotas, + // see Quotas related to messages (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // This preview includes two new attributes: + // + // * DeduplicationScope – Specifies whether message deduplication occurs + // at the message group or queue level. Valid values are messageGroup and + // queue. + // + // * FifoThroughputLimit – Specifies whether the FIFO queue throughput + // quota applies to the entire queue or per message group. Valid values are + // perQueue and perMessageGroupId. The perMessageGroupId value is allowed + // only when the value for DeduplicationScope is messageGroup. + // + // To enable high throughput for FIFO queues, do the following: + // + // * Set DeduplicationScope to messageGroup. + // + // * Set FifoThroughputLimit to perMessageGroupId. + // + // If you set these attributes to anything other than the values shown for enabling + // high throughput, standard throughput is in effect and deduplication occurs + // as specified. + // + // This preview is available in the following AWS Regions: + // + // * US East (Ohio); us-east-2 + // + // * US East (N. Virginia); us-east-1 + // + // * US West (Oregon); us-west-2 + // + // * Europe (Ireland); eu-west-1 + // + // For more information about high throughput for FIFO queues, see Preview: + // High throughput for FIFO queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html) + // in the Amazon Simple Queue Service Developer Guide. + // + // Attributes is a required field + Attributes map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true" required:"true"` + + // The URL of the Amazon SQS queue whose attributes are set. + // + // Queue URLs and names are case-sensitive. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s SetQueueAttributesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetQueueAttributesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetQueueAttributesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SetQueueAttributesInput"} + if s.Attributes == nil { + invalidParams.Add(request.NewErrParamRequired("Attributes")) + } + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAttributes sets the Attributes field's value. +func (s *SetQueueAttributesInput) SetAttributes(v map[string]*string) *SetQueueAttributesInput { + s.Attributes = v + return s +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *SetQueueAttributesInput) SetQueueUrl(v string) *SetQueueAttributesInput { + s.QueueUrl = &v + return s +} + +type SetQueueAttributesOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s SetQueueAttributesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetQueueAttributesOutput) GoString() string { + return s.String() +} + +type TagQueueInput struct { + _ struct{} `type:"structure"` + + // The URL of the queue. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` + + // The list of tags to be added to the specified queue. + // + // Tags is a required field + Tags map[string]*string `locationName:"Tag" locationNameKey:"Key" locationNameValue:"Value" type:"map" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s TagQueueInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagQueueInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TagQueueInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TagQueueInput"} + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + if s.Tags == nil { + invalidParams.Add(request.NewErrParamRequired("Tags")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *TagQueueInput) SetQueueUrl(v string) *TagQueueInput { + s.QueueUrl = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *TagQueueInput) SetTags(v map[string]*string) *TagQueueInput { + s.Tags = v + return s +} + +type TagQueueOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s TagQueueOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagQueueOutput) GoString() string { + return s.String() +} + +type UntagQueueInput struct { + _ struct{} `type:"structure"` + + // The URL of the queue. + // + // QueueUrl is a required field + QueueUrl *string `type:"string" required:"true"` + + // The list of tags to be removed from the specified queue. + // + // TagKeys is a required field + TagKeys []*string `locationNameList:"TagKey" type:"list" flattened:"true" required:"true"` +} + +// String returns the string representation +func (s UntagQueueInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UntagQueueInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UntagQueueInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UntagQueueInput"} + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + if s.TagKeys == nil { + invalidParams.Add(request.NewErrParamRequired("TagKeys")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetQueueUrl sets the QueueUrl field's value. +func (s *UntagQueueInput) SetQueueUrl(v string) *UntagQueueInput { + s.QueueUrl = &v + return s +} + +// SetTagKeys sets the TagKeys field's value. +func (s *UntagQueueInput) SetTagKeys(v []*string) *UntagQueueInput { + s.TagKeys = v + return s +} + +type UntagQueueOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UntagQueueOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UntagQueueOutput) GoString() string { + return s.String() +} + +const ( + // MessageSystemAttributeNameSenderId is a MessageSystemAttributeName enum value + MessageSystemAttributeNameSenderId = "SenderId" + + // MessageSystemAttributeNameSentTimestamp is a MessageSystemAttributeName enum value + MessageSystemAttributeNameSentTimestamp = "SentTimestamp" + + // MessageSystemAttributeNameApproximateReceiveCount is a MessageSystemAttributeName enum value + MessageSystemAttributeNameApproximateReceiveCount = "ApproximateReceiveCount" + + // MessageSystemAttributeNameApproximateFirstReceiveTimestamp is a MessageSystemAttributeName enum value + MessageSystemAttributeNameApproximateFirstReceiveTimestamp = "ApproximateFirstReceiveTimestamp" + + // MessageSystemAttributeNameSequenceNumber is a MessageSystemAttributeName enum value + MessageSystemAttributeNameSequenceNumber = "SequenceNumber" + + // MessageSystemAttributeNameMessageDeduplicationId is a MessageSystemAttributeName enum value + MessageSystemAttributeNameMessageDeduplicationId = "MessageDeduplicationId" + + // MessageSystemAttributeNameMessageGroupId is a MessageSystemAttributeName enum value + MessageSystemAttributeNameMessageGroupId = "MessageGroupId" + + // MessageSystemAttributeNameAwstraceHeader is a MessageSystemAttributeName enum value + MessageSystemAttributeNameAwstraceHeader = "AWSTraceHeader" +) + +// MessageSystemAttributeName_Values returns all elements of the MessageSystemAttributeName enum +func MessageSystemAttributeName_Values() []string { + return []string{ + MessageSystemAttributeNameSenderId, + MessageSystemAttributeNameSentTimestamp, + MessageSystemAttributeNameApproximateReceiveCount, + MessageSystemAttributeNameApproximateFirstReceiveTimestamp, + MessageSystemAttributeNameSequenceNumber, + MessageSystemAttributeNameMessageDeduplicationId, + MessageSystemAttributeNameMessageGroupId, + MessageSystemAttributeNameAwstraceHeader, + } +} + +const ( + // MessageSystemAttributeNameForSendsAwstraceHeader is a MessageSystemAttributeNameForSends enum value + MessageSystemAttributeNameForSendsAwstraceHeader = "AWSTraceHeader" +) + +// MessageSystemAttributeNameForSends_Values returns all elements of the MessageSystemAttributeNameForSends enum +func MessageSystemAttributeNameForSends_Values() []string { + return []string{ + MessageSystemAttributeNameForSendsAwstraceHeader, + } +} + +const ( + // QueueAttributeNameAll is a QueueAttributeName enum value + QueueAttributeNameAll = "All" + + // QueueAttributeNamePolicy is a QueueAttributeName enum value + QueueAttributeNamePolicy = "Policy" + + // QueueAttributeNameVisibilityTimeout is a QueueAttributeName enum value + QueueAttributeNameVisibilityTimeout = "VisibilityTimeout" + + // QueueAttributeNameMaximumMessageSize is a QueueAttributeName enum value + QueueAttributeNameMaximumMessageSize = "MaximumMessageSize" + + // QueueAttributeNameMessageRetentionPeriod is a QueueAttributeName enum value + QueueAttributeNameMessageRetentionPeriod = "MessageRetentionPeriod" + + // QueueAttributeNameApproximateNumberOfMessages is a QueueAttributeName enum value + QueueAttributeNameApproximateNumberOfMessages = "ApproximateNumberOfMessages" + + // QueueAttributeNameApproximateNumberOfMessagesNotVisible is a QueueAttributeName enum value + QueueAttributeNameApproximateNumberOfMessagesNotVisible = "ApproximateNumberOfMessagesNotVisible" + + // QueueAttributeNameCreatedTimestamp is a QueueAttributeName enum value + QueueAttributeNameCreatedTimestamp = "CreatedTimestamp" + + // QueueAttributeNameLastModifiedTimestamp is a QueueAttributeName enum value + QueueAttributeNameLastModifiedTimestamp = "LastModifiedTimestamp" + + // QueueAttributeNameQueueArn is a QueueAttributeName enum value + QueueAttributeNameQueueArn = "QueueArn" + + // QueueAttributeNameApproximateNumberOfMessagesDelayed is a QueueAttributeName enum value + QueueAttributeNameApproximateNumberOfMessagesDelayed = "ApproximateNumberOfMessagesDelayed" + + // QueueAttributeNameDelaySeconds is a QueueAttributeName enum value + QueueAttributeNameDelaySeconds = "DelaySeconds" + + // QueueAttributeNameReceiveMessageWaitTimeSeconds is a QueueAttributeName enum value + QueueAttributeNameReceiveMessageWaitTimeSeconds = "ReceiveMessageWaitTimeSeconds" + + // QueueAttributeNameRedrivePolicy is a QueueAttributeName enum value + QueueAttributeNameRedrivePolicy = "RedrivePolicy" + + // QueueAttributeNameFifoQueue is a QueueAttributeName enum value + QueueAttributeNameFifoQueue = "FifoQueue" + + // QueueAttributeNameContentBasedDeduplication is a QueueAttributeName enum value + QueueAttributeNameContentBasedDeduplication = "ContentBasedDeduplication" + + // QueueAttributeNameKmsMasterKeyId is a QueueAttributeName enum value + QueueAttributeNameKmsMasterKeyId = "KmsMasterKeyId" + + // QueueAttributeNameKmsDataKeyReusePeriodSeconds is a QueueAttributeName enum value + QueueAttributeNameKmsDataKeyReusePeriodSeconds = "KmsDataKeyReusePeriodSeconds" + + // QueueAttributeNameDeduplicationScope is a QueueAttributeName enum value + QueueAttributeNameDeduplicationScope = "DeduplicationScope" + + // QueueAttributeNameFifoThroughputLimit is a QueueAttributeName enum value + QueueAttributeNameFifoThroughputLimit = "FifoThroughputLimit" +) + +// QueueAttributeName_Values returns all elements of the QueueAttributeName enum +func QueueAttributeName_Values() []string { + return []string{ + QueueAttributeNameAll, + QueueAttributeNamePolicy, + QueueAttributeNameVisibilityTimeout, + QueueAttributeNameMaximumMessageSize, + QueueAttributeNameMessageRetentionPeriod, + QueueAttributeNameApproximateNumberOfMessages, + QueueAttributeNameApproximateNumberOfMessagesNotVisible, + QueueAttributeNameCreatedTimestamp, + QueueAttributeNameLastModifiedTimestamp, + QueueAttributeNameQueueArn, + QueueAttributeNameApproximateNumberOfMessagesDelayed, + QueueAttributeNameDelaySeconds, + QueueAttributeNameReceiveMessageWaitTimeSeconds, + QueueAttributeNameRedrivePolicy, + QueueAttributeNameFifoQueue, + QueueAttributeNameContentBasedDeduplication, + QueueAttributeNameKmsMasterKeyId, + QueueAttributeNameKmsDataKeyReusePeriodSeconds, + QueueAttributeNameDeduplicationScope, + QueueAttributeNameFifoThroughputLimit, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/checksums.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/checksums.go new file mode 100644 index 0000000000..e85e89a817 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sqs/checksums.go @@ -0,0 +1,114 @@ +package sqs + +import ( + "crypto/md5" + "encoding/hex" + "fmt" + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" +) + +var ( + errChecksumMissingBody = fmt.Errorf("cannot compute checksum. missing body") + errChecksumMissingMD5 = fmt.Errorf("cannot verify checksum. missing response MD5") +) + +func setupChecksumValidation(r *request.Request) { + if aws.BoolValue(r.Config.DisableComputeChecksums) { + return + } + + switch r.Operation.Name { + case opSendMessage: + r.Handlers.Unmarshal.PushBack(verifySendMessage) + case opSendMessageBatch: + r.Handlers.Unmarshal.PushBack(verifySendMessageBatch) + case opReceiveMessage: + r.Handlers.Unmarshal.PushBack(verifyReceiveMessage) + } +} + +func verifySendMessage(r *request.Request) { + if r.DataFilled() && r.ParamsFilled() { + in := r.Params.(*SendMessageInput) + out := r.Data.(*SendMessageOutput) + err := checksumsMatch(in.MessageBody, out.MD5OfMessageBody) + if err != nil { + setChecksumError(r, err.Error()) + } + } +} + +func verifySendMessageBatch(r *request.Request) { + if r.DataFilled() && r.ParamsFilled() { + entries := map[string]*SendMessageBatchResultEntry{} + ids := []string{} + + out := r.Data.(*SendMessageBatchOutput) + for _, entry := range out.Successful { + entries[*entry.Id] = entry + } + + in := r.Params.(*SendMessageBatchInput) + for _, entry := range in.Entries { + if e, ok := entries[*entry.Id]; ok { + if err := checksumsMatch(entry.MessageBody, e.MD5OfMessageBody); err != nil { + ids = append(ids, *e.MessageId) + } + } + } + if len(ids) > 0 { + setChecksumError(r, "invalid messages: %s", strings.Join(ids, ", ")) + } + } +} + +func verifyReceiveMessage(r *request.Request) { + if r.DataFilled() && r.ParamsFilled() { + ids := []string{} + out := r.Data.(*ReceiveMessageOutput) + for i, msg := range out.Messages { + err := checksumsMatch(msg.Body, msg.MD5OfBody) + if err != nil { + if msg.MessageId == nil { + if r.Config.Logger != nil { + r.Config.Logger.Log(fmt.Sprintf( + "WARN: SQS.ReceiveMessage failed checksum request id: %s, message %d has no message ID.", + r.RequestID, i, + )) + } + continue + } + + ids = append(ids, *msg.MessageId) + } + } + if len(ids) > 0 { + setChecksumError(r, "invalid messages: %s", strings.Join(ids, ", ")) + } + } +} + +func checksumsMatch(body, expectedMD5 *string) error { + if body == nil { + return errChecksumMissingBody + } else if expectedMD5 == nil { + return errChecksumMissingMD5 + } + + msum := md5.Sum([]byte(*body)) + sum := hex.EncodeToString(msum[:]) + if sum != *expectedMD5 { + return fmt.Errorf("expected MD5 checksum '%s', got '%s'", *expectedMD5, sum) + } + + return nil +} + +func setChecksumError(r *request.Request, format string, args ...interface{}) { + r.Retryable = aws.Bool(true) + r.Error = awserr.New("InvalidChecksum", fmt.Sprintf(format, args...), nil) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/customizations.go new file mode 100644 index 0000000000..7498363de3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sqs/customizations.go @@ -0,0 +1,9 @@ +package sqs + +import "github.com/aws/aws-sdk-go/aws/request" + +func init() { + initRequest = func(r *request.Request) { + setupChecksumValidation(r) + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/doc.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/doc.go new file mode 100644 index 0000000000..854208bcc6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sqs/doc.go @@ -0,0 +1,59 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package sqs provides the client and types for making API +// requests to Amazon Simple Queue Service. +// +// Welcome to the Amazon Simple Queue Service API Reference. +// +// Amazon Simple Queue Service (Amazon SQS) is a reliable, highly-scalable hosted +// queue for storing messages as they travel between applications or microservices. +// Amazon SQS moves data between distributed application components and helps +// you decouple these components. +// +// For information on the permissions you need to use this API, see Identity +// and access management (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-authentication-and-access-control.html) +// in the Amazon Simple Queue Service Developer Guide. +// +// You can use AWS SDKs (http://aws.amazon.com/tools/#sdk) to access Amazon +// SQS using your favorite programming language. The SDKs perform tasks such +// as the following automatically: +// +// * Cryptographically sign your service requests +// +// * Retry requests +// +// * Handle error responses +// +// Additional information +// +// * Amazon SQS Product Page (http://aws.amazon.com/sqs/) +// +// * Amazon Simple Queue Service Developer Guide Making API Requests (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html) +// Amazon SQS Message Attributes (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) +// Amazon SQS Dead-Letter Queues (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) +// +// * Amazon SQS in the AWS CLI Command Reference (http://docs.aws.amazon.com/cli/latest/reference/sqs/index.html) +// +// * Amazon Web Services General Reference Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#sqs_region) +// +// See https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05 for more information on this service. +// +// See sqs package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/sqs/ +// +// Using the Client +// +// To contact Amazon Simple Queue Service 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 Amazon Simple Queue Service client SQS for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/sqs/#New +package sqs diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/errors.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/errors.go new file mode 100644 index 0000000000..89eb40d7fd --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sqs/errors.go @@ -0,0 +1,110 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package sqs + +const ( + + // ErrCodeBatchEntryIdsNotDistinct for service response error code + // "AWS.SimpleQueueService.BatchEntryIdsNotDistinct". + // + // Two or more batch entries in the request have the same Id. + ErrCodeBatchEntryIdsNotDistinct = "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" + + // ErrCodeBatchRequestTooLong for service response error code + // "AWS.SimpleQueueService.BatchRequestTooLong". + // + // The length of all the messages put together is more than the limit. + ErrCodeBatchRequestTooLong = "AWS.SimpleQueueService.BatchRequestTooLong" + + // ErrCodeEmptyBatchRequest for service response error code + // "AWS.SimpleQueueService.EmptyBatchRequest". + // + // The batch request doesn't contain any entries. + ErrCodeEmptyBatchRequest = "AWS.SimpleQueueService.EmptyBatchRequest" + + // ErrCodeInvalidAttributeName for service response error code + // "InvalidAttributeName". + // + // The specified attribute doesn't exist. + ErrCodeInvalidAttributeName = "InvalidAttributeName" + + // ErrCodeInvalidBatchEntryId for service response error code + // "AWS.SimpleQueueService.InvalidBatchEntryId". + // + // The Id of a batch entry in a batch request doesn't abide by the specification. + ErrCodeInvalidBatchEntryId = "AWS.SimpleQueueService.InvalidBatchEntryId" + + // ErrCodeInvalidIdFormat for service response error code + // "InvalidIdFormat". + // + // The specified receipt handle isn't valid for the current version. + ErrCodeInvalidIdFormat = "InvalidIdFormat" + + // ErrCodeInvalidMessageContents for service response error code + // "InvalidMessageContents". + // + // The message contains characters outside the allowed set. + ErrCodeInvalidMessageContents = "InvalidMessageContents" + + // ErrCodeMessageNotInflight for service response error code + // "AWS.SimpleQueueService.MessageNotInflight". + // + // The specified message isn't in flight. + ErrCodeMessageNotInflight = "AWS.SimpleQueueService.MessageNotInflight" + + // ErrCodeOverLimit for service response error code + // "OverLimit". + // + // The specified action violates a limit. For example, ReceiveMessage returns + // this error if the maximum number of inflight messages is reached and AddPermission + // returns this error if the maximum number of permissions for the queue is + // reached. + ErrCodeOverLimit = "OverLimit" + + // ErrCodePurgeQueueInProgress for service response error code + // "AWS.SimpleQueueService.PurgeQueueInProgress". + // + // Indicates that the specified queue previously received a PurgeQueue request + // within the last 60 seconds (the time it can take to delete the messages in + // the queue). + ErrCodePurgeQueueInProgress = "AWS.SimpleQueueService.PurgeQueueInProgress" + + // ErrCodeQueueDeletedRecently for service response error code + // "AWS.SimpleQueueService.QueueDeletedRecently". + // + // You must wait 60 seconds after deleting a queue before you can create another + // queue with the same name. + ErrCodeQueueDeletedRecently = "AWS.SimpleQueueService.QueueDeletedRecently" + + // ErrCodeQueueDoesNotExist for service response error code + // "AWS.SimpleQueueService.NonExistentQueue". + // + // The specified queue doesn't exist. + ErrCodeQueueDoesNotExist = "AWS.SimpleQueueService.NonExistentQueue" + + // ErrCodeQueueNameExists for service response error code + // "QueueAlreadyExists". + // + // A queue with this name already exists. Amazon SQS returns this error only + // if the request includes attributes whose values differ from those of the + // existing queue. + ErrCodeQueueNameExists = "QueueAlreadyExists" + + // ErrCodeReceiptHandleIsInvalid for service response error code + // "ReceiptHandleIsInvalid". + // + // The specified receipt handle isn't valid. + ErrCodeReceiptHandleIsInvalid = "ReceiptHandleIsInvalid" + + // ErrCodeTooManyEntriesInBatchRequest for service response error code + // "AWS.SimpleQueueService.TooManyEntriesInBatchRequest". + // + // The batch request contains more entries than permissible. + ErrCodeTooManyEntriesInBatchRequest = "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" + + // ErrCodeUnsupportedOperation for service response error code + // "AWS.SimpleQueueService.UnsupportedOperation". + // + // Error code 400. Unsupported operation. + ErrCodeUnsupportedOperation = "AWS.SimpleQueueService.UnsupportedOperation" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/service.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/service.go new file mode 100644 index 0000000000..f4f6142074 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sqs/service.go @@ -0,0 +1,98 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package sqs + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" + "github.com/aws/aws-sdk-go/private/protocol/query" +) + +// SQS provides the API operation methods for making requests to +// Amazon Simple Queue Service. See this package's package overview docs +// for details on the service. +// +// SQS methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type SQS struct { + *client.Client +} + +// Used for custom client initialization logic +var initClient func(*client.Client) + +// Used for custom request initialization logic +var initRequest func(*request.Request) + +// Service information constants +const ( + ServiceName = "sqs" // Name of service. + EndpointsID = ServiceName // ID to lookup a service endpoint with. + ServiceID = "SQS" // ServiceID is a unique identifier of a specific service. +) + +// New creates a new instance of the SQS client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// mySession := session.Must(session.NewSession()) +// +// // Create a SQS client from just a session. +// svc := sqs.New(mySession) +// +// // Create a SQS client with additional configuration +// svc := sqs.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *SQS { + c := p.ClientConfig(EndpointsID, cfgs...) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *SQS { + svc := &SQS{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + PartitionID: partitionID, + Endpoint: endpoint, + APIVersion: "2012-11-05", + }, + handlers, + ), + } + + // 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.Client) + } + + return svc +} + +// newRequest creates a new request for a SQS operation and runs any +// custom request initialization. +func (c *SQS) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + // Run custom request initialization if present + if initRequest != nil { + initRequest(req) + } + + return req +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/sqsiface/BUILD.bazel b/vendor/github.com/aws/aws-sdk-go/service/sqs/sqsiface/BUILD.bazel new file mode 100644 index 0000000000..9bad91a45c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sqs/sqsiface/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["interface.go"], + importmap = "k8s.io/kops/vendor/github.com/aws/aws-sdk-go/service/sqs/sqsiface", + importpath = "github.com/aws/aws-sdk-go/service/sqs/sqsiface", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", + "//vendor/github.com/aws/aws-sdk-go/service/sqs:go_default_library", + ], +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/sqsiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/sqsiface/interface.go new file mode 100644 index 0000000000..da86ebe9bc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sqs/sqsiface/interface.go @@ -0,0 +1,150 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package sqsiface provides an interface to enable mocking the Amazon Simple Queue Service service client +// for testing your code. +// +// It is important to note that this interface will have breaking changes +// when the service model is updated and adds new API operations, paginators, +// and waiters. +package sqsiface + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/sqs" +) + +// SQSAPI provides an interface to enable mocking the +// sqs.SQS service client's API operation, +// paginators, and waiters. This make unit testing your code that calls out +// to the SDK's service client's calls easier. +// +// The best way to use this interface is so the SDK's service client's calls +// can be stubbed out for unit testing your code with the SDK without needing +// to inject custom request handlers into the SDK's request pipeline. +// +// // myFunc uses an SDK service client to make a request to +// // Amazon Simple Queue Service. +// func myFunc(svc sqsiface.SQSAPI) bool { +// // Make svc.AddPermission request +// } +// +// func main() { +// sess := session.New() +// svc := sqs.New(sess) +// +// myFunc(svc) +// } +// +// In your _test.go file: +// +// // Define a mock struct to be used in your unit tests of myFunc. +// type mockSQSClient struct { +// sqsiface.SQSAPI +// } +// func (m *mockSQSClient) AddPermission(input *sqs.AddPermissionInput) (*sqs.AddPermissionOutput, error) { +// // mock response/functionality +// } +// +// func TestMyFunc(t *testing.T) { +// // Setup Test +// mockSvc := &mockSQSClient{} +// +// 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 SQSAPI interface { + AddPermission(*sqs.AddPermissionInput) (*sqs.AddPermissionOutput, error) + AddPermissionWithContext(aws.Context, *sqs.AddPermissionInput, ...request.Option) (*sqs.AddPermissionOutput, error) + AddPermissionRequest(*sqs.AddPermissionInput) (*request.Request, *sqs.AddPermissionOutput) + + ChangeMessageVisibility(*sqs.ChangeMessageVisibilityInput) (*sqs.ChangeMessageVisibilityOutput, error) + ChangeMessageVisibilityWithContext(aws.Context, *sqs.ChangeMessageVisibilityInput, ...request.Option) (*sqs.ChangeMessageVisibilityOutput, error) + ChangeMessageVisibilityRequest(*sqs.ChangeMessageVisibilityInput) (*request.Request, *sqs.ChangeMessageVisibilityOutput) + + ChangeMessageVisibilityBatch(*sqs.ChangeMessageVisibilityBatchInput) (*sqs.ChangeMessageVisibilityBatchOutput, error) + ChangeMessageVisibilityBatchWithContext(aws.Context, *sqs.ChangeMessageVisibilityBatchInput, ...request.Option) (*sqs.ChangeMessageVisibilityBatchOutput, error) + ChangeMessageVisibilityBatchRequest(*sqs.ChangeMessageVisibilityBatchInput) (*request.Request, *sqs.ChangeMessageVisibilityBatchOutput) + + CreateQueue(*sqs.CreateQueueInput) (*sqs.CreateQueueOutput, error) + CreateQueueWithContext(aws.Context, *sqs.CreateQueueInput, ...request.Option) (*sqs.CreateQueueOutput, error) + CreateQueueRequest(*sqs.CreateQueueInput) (*request.Request, *sqs.CreateQueueOutput) + + DeleteMessage(*sqs.DeleteMessageInput) (*sqs.DeleteMessageOutput, error) + DeleteMessageWithContext(aws.Context, *sqs.DeleteMessageInput, ...request.Option) (*sqs.DeleteMessageOutput, error) + DeleteMessageRequest(*sqs.DeleteMessageInput) (*request.Request, *sqs.DeleteMessageOutput) + + DeleteMessageBatch(*sqs.DeleteMessageBatchInput) (*sqs.DeleteMessageBatchOutput, error) + DeleteMessageBatchWithContext(aws.Context, *sqs.DeleteMessageBatchInput, ...request.Option) (*sqs.DeleteMessageBatchOutput, error) + DeleteMessageBatchRequest(*sqs.DeleteMessageBatchInput) (*request.Request, *sqs.DeleteMessageBatchOutput) + + DeleteQueue(*sqs.DeleteQueueInput) (*sqs.DeleteQueueOutput, error) + DeleteQueueWithContext(aws.Context, *sqs.DeleteQueueInput, ...request.Option) (*sqs.DeleteQueueOutput, error) + DeleteQueueRequest(*sqs.DeleteQueueInput) (*request.Request, *sqs.DeleteQueueOutput) + + GetQueueAttributes(*sqs.GetQueueAttributesInput) (*sqs.GetQueueAttributesOutput, error) + GetQueueAttributesWithContext(aws.Context, *sqs.GetQueueAttributesInput, ...request.Option) (*sqs.GetQueueAttributesOutput, error) + GetQueueAttributesRequest(*sqs.GetQueueAttributesInput) (*request.Request, *sqs.GetQueueAttributesOutput) + + GetQueueUrl(*sqs.GetQueueUrlInput) (*sqs.GetQueueUrlOutput, error) + GetQueueUrlWithContext(aws.Context, *sqs.GetQueueUrlInput, ...request.Option) (*sqs.GetQueueUrlOutput, error) + GetQueueUrlRequest(*sqs.GetQueueUrlInput) (*request.Request, *sqs.GetQueueUrlOutput) + + ListDeadLetterSourceQueues(*sqs.ListDeadLetterSourceQueuesInput) (*sqs.ListDeadLetterSourceQueuesOutput, error) + ListDeadLetterSourceQueuesWithContext(aws.Context, *sqs.ListDeadLetterSourceQueuesInput, ...request.Option) (*sqs.ListDeadLetterSourceQueuesOutput, error) + ListDeadLetterSourceQueuesRequest(*sqs.ListDeadLetterSourceQueuesInput) (*request.Request, *sqs.ListDeadLetterSourceQueuesOutput) + + ListDeadLetterSourceQueuesPages(*sqs.ListDeadLetterSourceQueuesInput, func(*sqs.ListDeadLetterSourceQueuesOutput, bool) bool) error + ListDeadLetterSourceQueuesPagesWithContext(aws.Context, *sqs.ListDeadLetterSourceQueuesInput, func(*sqs.ListDeadLetterSourceQueuesOutput, bool) bool, ...request.Option) error + + ListQueueTags(*sqs.ListQueueTagsInput) (*sqs.ListQueueTagsOutput, error) + ListQueueTagsWithContext(aws.Context, *sqs.ListQueueTagsInput, ...request.Option) (*sqs.ListQueueTagsOutput, error) + ListQueueTagsRequest(*sqs.ListQueueTagsInput) (*request.Request, *sqs.ListQueueTagsOutput) + + ListQueues(*sqs.ListQueuesInput) (*sqs.ListQueuesOutput, error) + ListQueuesWithContext(aws.Context, *sqs.ListQueuesInput, ...request.Option) (*sqs.ListQueuesOutput, error) + ListQueuesRequest(*sqs.ListQueuesInput) (*request.Request, *sqs.ListQueuesOutput) + + ListQueuesPages(*sqs.ListQueuesInput, func(*sqs.ListQueuesOutput, bool) bool) error + ListQueuesPagesWithContext(aws.Context, *sqs.ListQueuesInput, func(*sqs.ListQueuesOutput, bool) bool, ...request.Option) error + + PurgeQueue(*sqs.PurgeQueueInput) (*sqs.PurgeQueueOutput, error) + PurgeQueueWithContext(aws.Context, *sqs.PurgeQueueInput, ...request.Option) (*sqs.PurgeQueueOutput, error) + PurgeQueueRequest(*sqs.PurgeQueueInput) (*request.Request, *sqs.PurgeQueueOutput) + + ReceiveMessage(*sqs.ReceiveMessageInput) (*sqs.ReceiveMessageOutput, error) + ReceiveMessageWithContext(aws.Context, *sqs.ReceiveMessageInput, ...request.Option) (*sqs.ReceiveMessageOutput, error) + ReceiveMessageRequest(*sqs.ReceiveMessageInput) (*request.Request, *sqs.ReceiveMessageOutput) + + RemovePermission(*sqs.RemovePermissionInput) (*sqs.RemovePermissionOutput, error) + RemovePermissionWithContext(aws.Context, *sqs.RemovePermissionInput, ...request.Option) (*sqs.RemovePermissionOutput, error) + RemovePermissionRequest(*sqs.RemovePermissionInput) (*request.Request, *sqs.RemovePermissionOutput) + + SendMessage(*sqs.SendMessageInput) (*sqs.SendMessageOutput, error) + SendMessageWithContext(aws.Context, *sqs.SendMessageInput, ...request.Option) (*sqs.SendMessageOutput, error) + SendMessageRequest(*sqs.SendMessageInput) (*request.Request, *sqs.SendMessageOutput) + + SendMessageBatch(*sqs.SendMessageBatchInput) (*sqs.SendMessageBatchOutput, error) + SendMessageBatchWithContext(aws.Context, *sqs.SendMessageBatchInput, ...request.Option) (*sqs.SendMessageBatchOutput, error) + SendMessageBatchRequest(*sqs.SendMessageBatchInput) (*request.Request, *sqs.SendMessageBatchOutput) + + SetQueueAttributes(*sqs.SetQueueAttributesInput) (*sqs.SetQueueAttributesOutput, error) + SetQueueAttributesWithContext(aws.Context, *sqs.SetQueueAttributesInput, ...request.Option) (*sqs.SetQueueAttributesOutput, error) + SetQueueAttributesRequest(*sqs.SetQueueAttributesInput) (*request.Request, *sqs.SetQueueAttributesOutput) + + TagQueue(*sqs.TagQueueInput) (*sqs.TagQueueOutput, error) + TagQueueWithContext(aws.Context, *sqs.TagQueueInput, ...request.Option) (*sqs.TagQueueOutput, error) + TagQueueRequest(*sqs.TagQueueInput) (*request.Request, *sqs.TagQueueOutput) + + UntagQueue(*sqs.UntagQueueInput) (*sqs.UntagQueueOutput, error) + UntagQueueWithContext(aws.Context, *sqs.UntagQueueInput, ...request.Option) (*sqs.UntagQueueOutput, error) + UntagQueueRequest(*sqs.UntagQueueInput) (*request.Request, *sqs.UntagQueueOutput) +} + +var _ SQSAPI = (*sqs.SQS)(nil) diff --git a/vendor/modules.txt b/vendor/modules.txt index aa554d1406..acbe2a4653 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -166,12 +166,16 @@ github.com/aws/aws-sdk-go/service/elb github.com/aws/aws-sdk-go/service/elb/elbiface github.com/aws/aws-sdk-go/service/elbv2 github.com/aws/aws-sdk-go/service/elbv2/elbv2iface +github.com/aws/aws-sdk-go/service/eventbridge +github.com/aws/aws-sdk-go/service/eventbridge/eventbridgeiface github.com/aws/aws-sdk-go/service/iam github.com/aws/aws-sdk-go/service/iam/iamiface github.com/aws/aws-sdk-go/service/kms github.com/aws/aws-sdk-go/service/route53 github.com/aws/aws-sdk-go/service/route53/route53iface github.com/aws/aws-sdk-go/service/s3 +github.com/aws/aws-sdk-go/service/sqs +github.com/aws/aws-sdk-go/service/sqs/sqsiface github.com/aws/aws-sdk-go/service/sso github.com/aws/aws-sdk-go/service/sso/ssoiface github.com/aws/aws-sdk-go/service/sts