From 6f89d9da6ff454d9cd229733d44e3be8eed61dc7 Mon Sep 17 00:00:00 2001 From: AWS Controllers for Kubernetes Bot <82905295+ack-bot@users.noreply.github.com> Date: Sat, 16 Dec 2023 02:44:32 -0600 Subject: [PATCH] Update to ACK runtime `v0.28.0`, code-generator `v0.28.0` (#33) ### Update to ACK runtime `v0.28.0`, code-generator `v0.28.0` ---------- * ACK code-generator `v0.28.0` [release notes](https://github.com/aws-controllers-k8s/code-generator/releases/tag/v0.28.0) * ACK runtime `v0.28.0` [release notes](https://github.com/aws-controllers-k8s/runtime/releases/tag/v0.28.0) ---------- NOTE: This PR increments the release version of service controller from `v1.0.4` to `v1.0.5` Once this PR is merged, release `v1.0.5` will be automatically created for `eventbridge-controller` **Please close this PR, if you do not want the new patch release for `eventbridge-controller`** ---------- #### stdout for `make build-controller`: ``` building ack-generate ... ok. ==== building eventbridge-controller ==== Copying common custom resource definitions into eventbridge Building Kubernetes API objects for eventbridge Generating deepcopy code for eventbridge Generating custom resource definitions for eventbridge Building service controller for eventbridge Generating RBAC manifests for eventbridge Running gofmt against generated code for eventbridge Updating additional GitHub repository maintenance files ==== building eventbridge-controller release artifacts ==== Building release artifacts for eventbridge-v1.0.5 Generating common custom resource definitions Generating custom resource definitions for eventbridge Generating RBAC manifests for eventbridge ``` ---------- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --- apis/v1alpha1/ack-generate-metadata.yaml | 12 ++-- apis/v1alpha1/endpoint.go | 8 ++- apis/v1alpha1/enums.go | 5 +- apis/v1alpha1/event_bus.go | 24 ++++---- apis/v1alpha1/rule.go | 27 ++++++++- apis/v1alpha1/types.go | 57 ++++++++++--------- apis/v1alpha1/zz_generated.deepcopy.go | 26 ++++----- config/controller/kustomization.yaml | 2 +- ...ventbridge.services.k8s.aws_endpoints.yaml | 9 ++- ...entbridge.services.k8s.aws_eventbuses.yaml | 18 +++--- .../eventbridge.services.k8s.aws_rules.yaml | 36 ++++++++++-- go.mod | 12 ++-- go.sum | 24 ++++---- helm/Chart.yaml | 4 +- ...ventbridge.services.k8s.aws_endpoints.yaml | 9 ++- ...entbridge.services.k8s.aws_eventbuses.yaml | 18 +++--- .../eventbridge.services.k8s.aws_rules.yaml | 36 ++++++++++-- helm/templates/NOTES.txt | 2 +- helm/templates/deployment.yaml | 6 +- helm/values.yaml | 2 +- pkg/resource/rule/sdk.go | 18 ++++++ 21 files changed, 234 insertions(+), 121 deletions(-) diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index eb4ade7..ada6a5e 100755 --- a/apis/v1alpha1/ack-generate-metadata.yaml +++ b/apis/v1alpha1/ack-generate-metadata.yaml @@ -1,11 +1,11 @@ ack_generate_info: - build_date: "2023-09-14T23:57:10Z" - build_hash: 892f29d00a4c4ad21a2fa32919921de18190979d - go_version: go1.21.0 - version: v0.27.1 -api_directory_checksum: 78a16efc096b59b35f740f7801e951a876fa59ae + build_date: "2023-12-14T22:11:53Z" + build_hash: 1f16813c807af6889060b4ce7ded2a69dc027d8c + go_version: go1.21.5 + version: v0.28.0 +api_directory_checksum: f2ea779a9586cae6475b6c0f33f8638e30007ce4 api_version: v1alpha1 -aws_sdk_go_version: v1.44.97 +aws_sdk_go_version: v1.49.0 generator_config_info: file_checksum: 1e393269192ff28c7ea35bcb56a289a9edf8e0db original_file_name: generator.yaml diff --git a/apis/v1alpha1/endpoint.go b/apis/v1alpha1/endpoint.go index 9e75093..229cc93 100644 --- a/apis/v1alpha1/endpoint.go +++ b/apis/v1alpha1/endpoint.go @@ -22,11 +22,11 @@ import ( // EndpointSpec defines the desired state of Endpoint. // -// An global endpoint used to improve your application's availability by making +// A global endpoint used to improve your application's availability by making // it regional-fault tolerant. For more information about global endpoints, // see Making applications Regional-fault tolerant with global endpoints and // event replication (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-global-endpoints.html) -// in the Amazon EventBridge User Guide.. +// in the Amazon EventBridge User Guide. type EndpointSpec struct { // A description of the global endpoint. @@ -39,7 +39,9 @@ type EndpointSpec struct { // The name of the global endpoint. For example, "Name":"us-east-2-custom_bus_A-endpoint". // +kubebuilder:validation:Required Name *string `json:"name"` - // Enable or disable event replication. + // Enable or disable event replication. The default state is ENABLED which means + // you must supply a RoleArn. If you don't have a RoleArn or you don't want + // event replication enabled, set the state to DISABLED. ReplicationConfig *ReplicationConfig `json:"replicationConfig,omitempty"` // The ARN of the role used for replication. RoleARN *string `json:"roleARN,omitempty"` diff --git a/apis/v1alpha1/enums.go b/apis/v1alpha1/enums.go index 87a64a2..5d0d1a3 100644 --- a/apis/v1alpha1/enums.go +++ b/apis/v1alpha1/enums.go @@ -150,6 +150,7 @@ const ( type RuleState string const ( - RuleState_ENABLED RuleState = "ENABLED" - RuleState_DISABLED RuleState = "DISABLED" + RuleState_ENABLED RuleState = "ENABLED" + RuleState_DISABLED RuleState = "DISABLED" + RuleState_ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS RuleState = "ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS" ) diff --git a/apis/v1alpha1/event_bus.go b/apis/v1alpha1/event_bus.go index f91271e..947aef5 100644 --- a/apis/v1alpha1/event_bus.go +++ b/apis/v1alpha1/event_bus.go @@ -22,12 +22,13 @@ import ( // EventBusSpec defines the desired state of EventBus. // -// 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 events from -// Amazon Web Services services. A custom event bus can receive events from -// 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. +// An event bus receives events from a source, uses rules to evaluate them, +// applies any configured input transformation, and routes them to the appropriate +// target(s). Your account's default event bus receives events from Amazon Web +// Services services. A custom event bus can receive events from 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 EventBusSpec struct { // If you are creating a partner event bus, this specifies the partner event @@ -35,12 +36,13 @@ type EventBusSpec struct { EventSourceName *string `json:"eventSourceName,omitempty"` // 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. + // Custom event bus names can't contain the / character, but you can use the + // / character in partner event bus names. In addition, for partner event buses, + // the name must exactly match the name of the partner event source that this + // event bus is matched to. // - // 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. + // 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. // +kubebuilder:validation:Required Name *string `json:"name"` // Tags to associate with the event bus. diff --git a/apis/v1alpha1/rule.go b/apis/v1alpha1/rule.go index 7db688c..bf88c4e 100644 --- a/apis/v1alpha1/rule.go +++ b/apis/v1alpha1/rule.go @@ -31,7 +31,8 @@ type RuleSpec struct { // this, the default event bus is used. EventBusName *string `json:"eventBusName,omitempty"` EventBusRef *ackv1alpha1.AWSResourceReferenceWrapper `json:"eventBusRef,omitempty"` - // The event pattern. For more information, see EventBridge event patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html.html) + // The event pattern. For more information, see Amazon EventBridge event patterns + // (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html) // in the Amazon EventBridge User Guide. EventPattern *string `json:"eventPattern,omitempty"` // The name of the rule that you are creating or updating. @@ -46,7 +47,29 @@ type RuleSpec struct { RoleARN *string `json:"roleARN,omitempty"` // The scheduling expression. For example, "cron(0 20 * * ? *)" or "rate(5 minutes)". ScheduleExpression *string `json:"scheduleExpression,omitempty"` - // Indicates whether the rule is enabled or disabled. + // The state of the rule. + // + // Valid values include: + // + // - DISABLED: The rule is disabled. EventBridge does not match any events + // against the rule. + // + // - ENABLED: The rule is enabled. EventBridge matches events against the + // rule, except for Amazon Web Services management events delivered through + // CloudTrail. + // + // - ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS: The rule is enabled for + // all events, including Amazon Web Services management events delivered + // through CloudTrail. Management events provide visibility into management + // operations that are performed on resources in your Amazon Web Services + // account. These are also known as control plane operations. For more information, + // see Logging management events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html#logging-management-events) + // in the CloudTrail User Guide, and Filtering management events from Amazon + // Web Services services (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-cloudtrail) + // in the Amazon EventBridge User Guide. This value is only valid for rules + // on the default (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is-how-it-works-concepts.html#eb-bus-concepts-buses) + // event bus or custom event buses (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-event-bus.html). + // It does not apply to partner event buses (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-saas.html). State *string `json:"state,omitempty"` // The list of key-value pairs to associate with the rule. Tags []*Tag `json:"tags,omitempty"` diff --git a/apis/v1alpha1/types.go b/apis/v1alpha1/types.go index 111ad10..701decd 100644 --- a/apis/v1alpha1/types.go +++ b/apis/v1alpha1/types.go @@ -120,22 +120,19 @@ type Connection struct { type ConnectionBodyParameter struct { IsValueSecret *bool `json:"isValueSecret,omitempty"` Key *string `json:"key,omitempty"` - Value *string `json:"value,omitempty"` } // 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 { - IsValueSecret *bool `json:"isValueSecret,omitempty"` - Value *string `json:"value,omitempty"` + IsValueSecret *bool `json:"isValueSecret,omitempty"` } // 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 { - IsValueSecret *bool `json:"isValueSecret,omitempty"` - Value *string `json:"value,omitempty"` + IsValueSecret *bool `json:"isValueSecret,omitempty"` } // A DeadLetterConfig object that contains information about a dead-letter queue @@ -168,11 +165,11 @@ type EndpointEventBus struct { EventBusARN *string `json:"eventBusARN,omitempty"` } -// An global endpoint used to improve your application's availability by making +// A global endpoint used to improve your application's availability by making // it regional-fault tolerant. For more information about global endpoints, // see Making applications Regional-fault tolerant with global endpoints and // event replication (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-global-endpoints.html) -// in the Amazon EventBridge User Guide.. +// in the Amazon EventBridge User Guide. type Endpoint_SDK struct { ARN *string `json:"arn,omitempty"` CreationTime *metav1.Time `json:"creationTime,omitempty"` @@ -191,12 +188,13 @@ type Endpoint_SDK struct { StateReason *string `json:"stateReason,omitempty"` } -// 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 events from -// Amazon Web Services services. A custom event bus can receive events from -// 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. +// An event bus receives events from a source, uses rules to evaluate them, +// applies any configured input transformation, and routes them to the appropriate +// target(s). Your account's default event bus receives events from Amazon Web +// Services services. A custom event bus can receive events from 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_SDK struct { ARN *string `json:"arn,omitempty"` Name *string `json:"name,omitempty"` @@ -224,10 +222,10 @@ type FailoverConfig struct { Secondary *Secondary `json:"secondary,omitempty"` } -// 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. +// These are custom parameter to be used when the target is an API Gateway 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 { HeaderParameters map[string]*string `json:"headerParameters,omitempty"` PathParameterValues []*string `json:"pathParameterValues,omitempty"` @@ -316,12 +314,19 @@ type PutTargetsResultEntry struct { // cluster to invoke the Amazon Redshift Data API ExecuteStatement based on // EventBridge events. type RedshiftDataParameters struct { - Database *string `json:"database,omitempty"` - DBUser *string `json:"dbUser,omitempty"` + // Redshift Database + Database *string `json:"database,omitempty"` + // Database user name + DBUser *string `json:"dbUser,omitempty"` + // Optional SecretManager ARN which stores the database credentials SecretManagerARN *string `json:"secretManagerARN,omitempty"` - SQL *string `json:"sql,omitempty"` - StatementName *string `json:"statementName,omitempty"` - WithEvent *bool `json:"withEvent,omitempty"` + // A single Redshift SQL + SQL *string `json:"sql,omitempty"` + // A list of SQLs. + SQLs []*string `json:"sqls,omitempty"` + // A name for Redshift DataAPI statement which can be used as filter of ListStatement. + StatementName *string `json:"statementName,omitempty"` + WithEvent *bool `json:"withEvent,omitempty"` } // Represents a target that failed to be removed from a rule. @@ -440,10 +445,10 @@ type Target struct { DeadLetterConfig *DeadLetterConfig `json:"deadLetterConfig,omitempty"` // The custom parameters to be used when the target is an Amazon ECS task. ECSParameters *ECSParameters `json:"ecsParameters,omitempty"` - // 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. + // These are custom parameter to be used when the target is an API Gateway 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. HTTPParameters *HTTPParameters `json:"httpParameters,omitempty"` ID *string `json:"id,omitempty"` Input *string `json:"input,omitempty"` diff --git a/apis/v1alpha1/zz_generated.deepcopy.go b/apis/v1alpha1/zz_generated.deepcopy.go index cdd3ad7..5a4cd6c 100644 --- a/apis/v1alpha1/zz_generated.deepcopy.go +++ b/apis/v1alpha1/zz_generated.deepcopy.go @@ -468,11 +468,6 @@ func (in *ConnectionBodyParameter) DeepCopyInto(out *ConnectionBodyParameter) { *out = new(string) **out = **in } - if in.Value != nil { - in, out := &in.Value, &out.Value - *out = new(string) - **out = **in - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionBodyParameter. @@ -493,11 +488,6 @@ func (in *ConnectionHeaderParameter) DeepCopyInto(out *ConnectionHeaderParameter *out = new(bool) **out = **in } - if in.Value != nil { - in, out := &in.Value, &out.Value - *out = new(string) - **out = **in - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionHeaderParameter. @@ -518,11 +508,6 @@ func (in *ConnectionQueryStringParameter) DeepCopyInto(out *ConnectionQueryStrin *out = new(bool) **out = **in } - if in.Value != nil { - in, out := &in.Value, &out.Value - *out = new(string) - **out = **in - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionQueryStringParameter. @@ -1490,6 +1475,17 @@ func (in *RedshiftDataParameters) DeepCopyInto(out *RedshiftDataParameters) { *out = new(string) **out = **in } + if in.SQLs != nil { + in, out := &in.SQLs, &out.SQLs + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } if in.StatementName != nil { in, out := &in.StatementName, &out.StatementName *out = new(string) diff --git a/config/controller/kustomization.yaml b/config/controller/kustomization.yaml index a8fd0e4..964d7b8 100644 --- a/config/controller/kustomization.yaml +++ b/config/controller/kustomization.yaml @@ -6,4 +6,4 @@ kind: Kustomization images: - name: controller newName: public.ecr.aws/aws-controllers-k8s/eventbridge-controller - newTag: 1.0.4 + newTag: 1.0.5 diff --git a/config/crd/bases/eventbridge.services.k8s.aws_endpoints.yaml b/config/crd/bases/eventbridge.services.k8s.aws_endpoints.yaml index 9b1e8a3..3aede27 100644 --- a/config/crd/bases/eventbridge.services.k8s.aws_endpoints.yaml +++ b/config/crd/bases/eventbridge.services.k8s.aws_endpoints.yaml @@ -47,12 +47,12 @@ spec: metadata: type: object spec: - description: "EndpointSpec defines the desired state of Endpoint. \n An + description: "EndpointSpec defines the desired state of Endpoint. \n A global endpoint used to improve your application's availability by making it regional-fault tolerant. For more information about global endpoints, see Making applications Regional-fault tolerant with global endpoints and event replication (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-global-endpoints.html) - in the Amazon EventBridge User Guide.." + in the Amazon EventBridge User Guide." properties: description: description: A description of the global endpoint. @@ -71,7 +71,10 @@ spec: description: The name of the global endpoint. For example, "Name":"us-east-2-custom_bus_A-endpoint". type: string replicationConfig: - description: Enable or disable event replication. + description: Enable or disable event replication. The default state + is ENABLED which means you must supply a RoleArn. If you don't have + a RoleArn or you don't want event replication enabled, set the state + to DISABLED. properties: state: type: string diff --git a/config/crd/bases/eventbridge.services.k8s.aws_eventbuses.yaml b/config/crd/bases/eventbridge.services.k8s.aws_eventbuses.yaml index a23d9bf..6fc514e 100644 --- a/config/crd/bases/eventbridge.services.k8s.aws_eventbuses.yaml +++ b/config/crd/bases/eventbridge.services.k8s.aws_eventbuses.yaml @@ -48,8 +48,9 @@ spec: type: object spec: description: "EventBusSpec defines the desired state of EventBus. \n 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 events + event bus receives events from a source, uses rules to evaluate them, + applies any configured input transformation, and routes them to the + appropriate target(s). Your account's default event bus receives events from Amazon Web Services services. A custom event bus can receive events from your custom applications and services. A partner event bus receives events from an event source created by an SaaS partner. These events @@ -61,12 +62,13 @@ spec: with. type: string name: - description: "The name of the new event bus. \n 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. \n 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." + description: "The name of the new event bus. \n Custom event bus names + can't contain the / character, but you can use the / character in + partner event bus names. In addition, for partner event buses, the + name must exactly match the name of the partner event source that + this event bus is matched to. \n 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." type: string tags: description: Tags to associate with the event bus. diff --git a/config/crd/bases/eventbridge.services.k8s.aws_rules.yaml b/config/crd/bases/eventbridge.services.k8s.aws_rules.yaml index 695bda1..5233297 100644 --- a/config/crd/bases/eventbridge.services.k8s.aws_rules.yaml +++ b/config/crd/bases/eventbridge.services.k8s.aws_rules.yaml @@ -70,8 +70,8 @@ spec: type: object type: object eventPattern: - description: The event pattern. For more information, see EventBridge - event patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html.html) + description: The event pattern. For more information, see Amazon EventBridge + event patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html) in the Amazon EventBridge User Guide. type: string name: @@ -90,7 +90,23 @@ spec: * ? *)" or "rate(5 minutes)". type: string state: - description: Indicates whether the rule is enabled or disabled. + description: "The state of the rule. \n Valid values include: \n * + DISABLED: The rule is disabled. EventBridge does not match any events + against the rule. \n * ENABLED: The rule is enabled. EventBridge + matches events against the rule, except for Amazon Web Services + management events delivered through CloudTrail. \n * ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS: + The rule is enabled for all events, including Amazon Web Services + management events delivered through CloudTrail. Management events + provide visibility into management operations that are performed + on resources in your Amazon Web Services account. These are also + known as control plane operations. For more information, see Logging + management events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html#logging-management-events) + in the CloudTrail User Guide, and Filtering management events from + Amazon Web Services services (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-cloudtrail) + in the Amazon EventBridge User Guide. This value is only valid for + rules on the default (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is-how-it-works-concepts.html#eb-bus-concepts-buses) + event bus or custom event buses (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-event-bus.html). + It does not apply to partner event buses (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-saas.html)." type: string tags: description: The list of key-value pairs to associate with the rule. @@ -259,7 +275,7 @@ spec: type: object httpParameters: description: These are custom parameter to be used when the - target is an API Gateway REST APIs or EventBridge ApiDestinations. + target is an API Gateway 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. @@ -312,14 +328,26 @@ spec: Data API ExecuteStatement based on EventBridge events. properties: database: + description: Redshift Database type: string dbUser: + description: Database user name type: string secretManagerARN: + description: Optional SecretManager ARN which stores the + database credentials type: string sql: + description: A single Redshift SQL type: string + sqls: + description: A list of SQLs. + items: + type: string + type: array statementName: + description: A name for Redshift DataAPI statement which + can be used as filter of ListStatement. type: string withEvent: type: boolean diff --git a/go.mod b/go.mod index b191f09..97e21d9 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/aws-controllers-k8s/eventbridge-controller go 1.19 require ( - github.com/aws-controllers-k8s/runtime v0.27.1 - github.com/aws/aws-sdk-go v1.44.97 + github.com/aws-controllers-k8s/runtime v0.28.0 + github.com/aws/aws-sdk-go v1.49.0 github.com/go-logr/logr v1.2.3 github.com/spf13/pflag v1.0.5 golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 @@ -55,11 +55,11 @@ require ( go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.24.0 // indirect - golang.org/x/net v0.8.0 // indirect + golang.org/x/net v0.17.0 // indirect golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect - golang.org/x/sys v0.6.0 // indirect - golang.org/x/term v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/term v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index c3e8b9a..1ece506 100644 --- a/go.sum +++ b/go.sum @@ -38,10 +38,10 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/aws-controllers-k8s/runtime v0.27.1 h1:tvJRQDioBFkob0kF4DwgS7MsoXZKwkG5QCHWxFEh+2o= -github.com/aws-controllers-k8s/runtime v0.27.1/go.mod h1:oSCqCzbzJLUrzv+cx4TIxCuSUvL75ABJmhxBc87IRqc= -github.com/aws/aws-sdk-go v1.44.97 h1:lxgxp7d6uuGsP7jHKIX3GHd7ExFigCIF04VuKf8XUII= -github.com/aws/aws-sdk-go v1.44.97/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws-controllers-k8s/runtime v0.28.0 h1:QhtZDwF4TId5rBW924FMMKWFb0PGTtclVj+Cyj3bRaI= +github.com/aws-controllers-k8s/runtime v0.28.0/go.mod h1:OYbm782YcAQDN1M5k3lttI16FcLoiRqrIQL0DvU3+Lg= +github.com/aws/aws-sdk-go v1.49.0 h1:g9BkW1fo9GqKfwg2+zCD+TW/D36Ux+vtfJ8guF4AYmY= +github.com/aws/aws-sdk-go v1.49.0/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -370,8 +370,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -432,12 +432,12 @@ golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -445,8 +445,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/helm/Chart.yaml b/helm/Chart.yaml index c233358..b093283 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 name: eventbridge-chart description: A Helm chart for the ACK service controller for Amazon EventBridge (EventBridge) -version: 1.0.4 -appVersion: 1.0.4 +version: 1.0.5 +appVersion: 1.0.5 home: https://github.com/aws-controllers-k8s/eventbridge-controller icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png sources: diff --git a/helm/crds/eventbridge.services.k8s.aws_endpoints.yaml b/helm/crds/eventbridge.services.k8s.aws_endpoints.yaml index 9b1e8a3..3aede27 100644 --- a/helm/crds/eventbridge.services.k8s.aws_endpoints.yaml +++ b/helm/crds/eventbridge.services.k8s.aws_endpoints.yaml @@ -47,12 +47,12 @@ spec: metadata: type: object spec: - description: "EndpointSpec defines the desired state of Endpoint. \n An + description: "EndpointSpec defines the desired state of Endpoint. \n A global endpoint used to improve your application's availability by making it regional-fault tolerant. For more information about global endpoints, see Making applications Regional-fault tolerant with global endpoints and event replication (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-global-endpoints.html) - in the Amazon EventBridge User Guide.." + in the Amazon EventBridge User Guide." properties: description: description: A description of the global endpoint. @@ -71,7 +71,10 @@ spec: description: The name of the global endpoint. For example, "Name":"us-east-2-custom_bus_A-endpoint". type: string replicationConfig: - description: Enable or disable event replication. + description: Enable or disable event replication. The default state + is ENABLED which means you must supply a RoleArn. If you don't have + a RoleArn or you don't want event replication enabled, set the state + to DISABLED. properties: state: type: string diff --git a/helm/crds/eventbridge.services.k8s.aws_eventbuses.yaml b/helm/crds/eventbridge.services.k8s.aws_eventbuses.yaml index a23d9bf..6fc514e 100644 --- a/helm/crds/eventbridge.services.k8s.aws_eventbuses.yaml +++ b/helm/crds/eventbridge.services.k8s.aws_eventbuses.yaml @@ -48,8 +48,9 @@ spec: type: object spec: description: "EventBusSpec defines the desired state of EventBus. \n 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 events + event bus receives events from a source, uses rules to evaluate them, + applies any configured input transformation, and routes them to the + appropriate target(s). Your account's default event bus receives events from Amazon Web Services services. A custom event bus can receive events from your custom applications and services. A partner event bus receives events from an event source created by an SaaS partner. These events @@ -61,12 +62,13 @@ spec: with. type: string name: - description: "The name of the new event bus. \n 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. \n 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." + description: "The name of the new event bus. \n Custom event bus names + can't contain the / character, but you can use the / character in + partner event bus names. In addition, for partner event buses, the + name must exactly match the name of the partner event source that + this event bus is matched to. \n 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." type: string tags: description: Tags to associate with the event bus. diff --git a/helm/crds/eventbridge.services.k8s.aws_rules.yaml b/helm/crds/eventbridge.services.k8s.aws_rules.yaml index 695bda1..a9a1496 100644 --- a/helm/crds/eventbridge.services.k8s.aws_rules.yaml +++ b/helm/crds/eventbridge.services.k8s.aws_rules.yaml @@ -70,8 +70,8 @@ spec: type: object type: object eventPattern: - description: The event pattern. For more information, see EventBridge - event patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html.html) + description: The event pattern. For more information, see Amazon EventBridge + event patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html) in the Amazon EventBridge User Guide. type: string name: @@ -90,7 +90,23 @@ spec: * ? *)" or "rate(5 minutes)". type: string state: - description: Indicates whether the rule is enabled or disabled. + description: "The state of the rule. \n Valid values include: \n - + DISABLED: The rule is disabled. EventBridge does not match any events + against the rule. \n - ENABLED: The rule is enabled. EventBridge + matches events against the rule, except for Amazon Web Services + management events delivered through CloudTrail. \n - ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS: + The rule is enabled for all events, including Amazon Web Services + management events delivered through CloudTrail. Management events + provide visibility into management operations that are performed + on resources in your Amazon Web Services account. These are also + known as control plane operations. For more information, see Logging + management events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html#logging-management-events) + in the CloudTrail User Guide, and Filtering management events from + Amazon Web Services services (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-cloudtrail) + in the Amazon EventBridge User Guide. This value is only valid for + rules on the default (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is-how-it-works-concepts.html#eb-bus-concepts-buses) + event bus or custom event buses (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-event-bus.html). + It does not apply to partner event buses (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-saas.html)." type: string tags: description: The list of key-value pairs to associate with the rule. @@ -259,7 +275,7 @@ spec: type: object httpParameters: description: These are custom parameter to be used when the - target is an API Gateway REST APIs or EventBridge ApiDestinations. + target is an API Gateway 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. @@ -312,14 +328,26 @@ spec: Data API ExecuteStatement based on EventBridge events. properties: database: + description: Redshift Database type: string dbUser: + description: Database user name type: string secretManagerARN: + description: Optional SecretManager ARN which stores the + database credentials type: string sql: + description: A single Redshift SQL type: string + sqls: + description: A list of SQLs. + items: + type: string + type: array statementName: + description: A name for Redshift DataAPI statement which + can be used as filter of ListStatement. type: string withEvent: type: boolean diff --git a/helm/templates/NOTES.txt b/helm/templates/NOTES.txt index 03a90d9..14ddd32 100644 --- a/helm/templates/NOTES.txt +++ b/helm/templates/NOTES.txt @@ -1,5 +1,5 @@ {{ .Chart.Name }} has been installed. -This chart deploys "public.ecr.aws/aws-controllers-k8s/eventbridge-controller:1.0.4". +This chart deploys "public.ecr.aws/aws-controllers-k8s/eventbridge-controller:1.0.5". Check its status by running: kubectl --namespace {{ .Release.Namespace }} get pods -l "app.kubernetes.io/instance={{ .Release.Name }}" diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index f40b5f2..cea38ec 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -123,7 +123,7 @@ spec: readOnly: true {{- end }} {{- if .Values.deployment.extraVolumeMounts -}} - {{ toYaml .Values.deployment.extraVolumeMounts | nindent 12 }} + {{ toYaml .Values.deployment.extraVolumeMounts | nindent 10 }} {{- end }} securityContext: allowPrivilegeEscalation: false @@ -151,11 +151,11 @@ spec: hostNetwork: {{ .Values.deployment.hostNetwork }} dnsPolicy: {{ .Values.deployment.dnsPolicy }} volumes: - {{- if .Values.aws.credentials.secretName -}} + {{- if .Values.aws.credentials.secretName }} - name: {{ .Values.aws.credentials.secretName }} secret: secretName: {{ .Values.aws.credentials.secretName }} - {{ end -}} + {{- end }} {{- if .Values.deployment.extraVolumes }} {{ toYaml .Values.deployment.extraVolumes | indent 8}} {{- end }} diff --git a/helm/values.yaml b/helm/values.yaml index 278f8a9..24b14e7 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -4,7 +4,7 @@ image: repository: public.ecr.aws/aws-controllers-k8s/eventbridge-controller - tag: 1.0.4 + tag: 1.0.5 pullPolicy: IfNotPresent pullSecrets: [] diff --git a/pkg/resource/rule/sdk.go b/pkg/resource/rule/sdk.go index 8079213..13618a8 100644 --- a/pkg/resource/rule/sdk.go +++ b/pkg/resource/rule/sdk.go @@ -800,6 +800,15 @@ func sdkTargetsFromResourceTargets( if krTarget.RedshiftDataParameters.SQL != nil { tf10.SetSql(*krTarget.RedshiftDataParameters.SQL) } + if krTarget.RedshiftDataParameters.SQLs != nil { + tf10f4 := []*string{} + for _, tf10f4iter := range krTarget.RedshiftDataParameters.SQLs { + var tf10f4elem string + tf10f4elem = *tf10f4iter + tf10f4 = append(tf10f4, &tf10f4elem) + } + tf10.SetSqls(tf10f4) + } if krTarget.RedshiftDataParameters.StatementName != nil { tf10.SetStatementName(*krTarget.RedshiftDataParameters.StatementName) } @@ -1114,6 +1123,15 @@ func resourceTargetsFromSDKTargets( if sdkTarget.RedshiftDataParameters.Sql != nil { tf10.SQL = sdkTarget.RedshiftDataParameters.Sql } + if sdkTarget.RedshiftDataParameters.Sqls != nil { + tf10f4 := []*string{} + for _, tf10f4iter := range sdkTarget.RedshiftDataParameters.Sqls { + var tf10f4elem string + tf10f4elem = *tf10f4iter + tf10f4 = append(tf10f4, &tf10f4elem) + } + tf10.SQLs = tf10f4 + } if sdkTarget.RedshiftDataParameters.StatementName != nil { tf10.StatementName = sdkTarget.RedshiftDataParameters.StatementName }