Skip to content

Commit 01d6a4b

Browse files
authored
Add SubscriptionFilter support for LogGroups (#20)
Add subscription filters support for logs groups: - Generate subscription filter types - Add `hooks.go` files for comparing and managing subscriptiongroups - Add e2e tests By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 8ab6d1d commit 01d6a4b

17 files changed

+521
-29
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2024-05-02T20:49:26Z"
2+
build_date: "2024-05-31T00:35:04Z"
33
build_hash: 14cef51778d471698018b6c38b604181a6948248
4-
go_version: go1.22.0
4+
go_version: go1.22.3
55
version: v0.34.0
6-
api_directory_checksum: bebd65982ce67b37baa87e15a92a7c5539fa38a9
6+
api_directory_checksum: f283fc10a3b5d15ab90bf4ddf431cb2d4aec573c
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.263
99
generator_config_info:
10-
file_checksum: ad8a73bf74d9e8606bc2db81635b9d58b0a1c851
10+
file_checksum: c534825cfeeb7862fd42f3b265dd2fdb463f66c7
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ ignore:
77
- ExportTask
88
#- LogGroup
99
- LogStream
10+
field_paths:
11+
- PutSubscriptionFilterInput.LogGroupName
1012
resources:
1113
LogGroup:
1214
exceptions:
1315
terminal_codes:
1416
- InvalidParameterException
15-
reconcile:
16-
requeue_on_success_seconds: 60
1717
fields:
1818
Name:
1919
type: string
@@ -23,6 +23,9 @@ resources:
2323
resource: Key
2424
service_name: kms
2525
path: Status.ACKResourceMetadata.ARN
26+
SubscriptionFilters:
27+
custom_field:
28+
list_of: PutSubscriptionFilterInput
2629
RetentionDays:
2730
from:
2831
operation: PutRetentionPolicy

apis/v1alpha1/log_group.go

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/types.go

Lines changed: 35 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/zz_generated.deepcopy.go

Lines changed: 91 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/cloudwatchlogs.services.k8s.aws_loggroups.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,29 @@ spec:
6868
retentionDays:
6969
format: int64
7070
type: integer
71+
subscriptionFilters:
72+
items:
73+
properties:
74+
destinationARN:
75+
type: string
76+
distribution:
77+
description: |-
78+
The method used to distribute log data to the destination, which can be either
79+
random or grouped by log stream.
80+
type: string
81+
filterName:
82+
type: string
83+
filterPattern:
84+
description: |-
85+
A symbolic description of how CloudWatch Logs should interpret the data in
86+
each log event. For example, a log event can contain timestamps, IP addresses,
87+
strings, and so on. You use the filter pattern to specify what to look for
88+
in the log event message.
89+
type: string
90+
roleARN:
91+
type: string
92+
type: object
93+
type: array
7194
tags:
7295
additionalProperties:
7396
type: string

generator.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ ignore:
77
- ExportTask
88
#- LogGroup
99
- LogStream
10+
field_paths:
11+
- PutSubscriptionFilterInput.LogGroupName
1012
resources:
1113
LogGroup:
1214
exceptions:
1315
terminal_codes:
1416
- InvalidParameterException
15-
reconcile:
16-
requeue_on_success_seconds: 60
1717
fields:
1818
Name:
1919
type: string
@@ -23,6 +23,9 @@ resources:
2323
resource: Key
2424
service_name: kms
2525
path: Status.ACKResourceMetadata.ARN
26+
SubscriptionFilters:
27+
custom_field:
28+
list_of: PutSubscriptionFilterInput
2629
RetentionDays:
2730
from:
2831
operation: PutRetentionPolicy

helm/crds/cloudwatchlogs.services.k8s.aws_loggroups.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,29 @@ spec:
6868
retentionDays:
6969
format: int64
7070
type: integer
71+
subscriptionFilters:
72+
items:
73+
properties:
74+
destinationARN:
75+
type: string
76+
distribution:
77+
description: |-
78+
The method used to distribute log data to the destination, which can be either
79+
random or grouped by log stream.
80+
type: string
81+
filterName:
82+
type: string
83+
filterPattern:
84+
description: |-
85+
A symbolic description of how CloudWatch Logs should interpret the data in
86+
each log event. For example, a log event can contain timestamps, IP addresses,
87+
strings, and so on. You use the filter pattern to specify what to look for
88+
in the log event message.
89+
type: string
90+
roleARN:
91+
type: string
92+
type: object
93+
type: array
7194
tags:
7295
additionalProperties:
7396
type: string

pkg/resource/log_group/delta.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)