Skip to content

Commit 3dcc80c

Browse files
authored
add LogGroup status fields (#3)
Adds support for a number of LogGroup status fields: * creationTime * dataProtectionStatus * metricFilterCount * retentionInDays * storedBytes Also sets the requeue_on_success_seconds to 60 since LogGroup status is probably fairly frequently requested. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent b99c907 commit 3dcc80c

File tree

12 files changed

+212
-6
lines changed

12 files changed

+212
-6
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2023-05-17T17:54:16Z"
3-
build_hash: dbc9ad5612781ebcf7b44f4eb3e7e68adf33be7e
2+
build_date: "2023-05-24T17:19:40Z"
3+
build_hash: 6542e04cc357215c91df94e747e3d412fb26df97
44
go_version: go1.19.4
5-
version: v0.26.1-1-gdbc9ad5
6-
api_directory_checksum: 3ff9a19363bdb135f3328c6c7e803d6eaa8eea44
5+
version: v0.26.1-3-g6542e04
6+
api_directory_checksum: 399f9b6fb5675139a83fc87a26271448ad5d9584
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.263
99
generator_config_info:
10-
file_checksum: 14f5a4f533d7c8a4142d63046eda2f044f42fed7
10+
file_checksum: c92ac565fa72636728117afcc963ee28a6ebd4e4
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,31 @@ resources:
2121
resource: Key
2222
service_name: kms
2323
path: Status.ACKResourceMetadata.ARN
24+
CreationTime:
25+
is_read_only: true
26+
from:
27+
operation: DescribeLogGroups
28+
path: LogGroups.CreationTime
29+
DataProtectionStatus:
30+
is_read_only: true
31+
from:
32+
operation: DescribeLogGroups
33+
path: LogGroups.DataProtectionStatus
34+
MetricFilterCount:
35+
is_read_only: true
36+
from:
37+
operation: DescribeLogGroups
38+
path: LogGroups.MetricFilterCount
39+
RetentionInDays:
40+
is_read_only: true
41+
from:
42+
operation: DescribeLogGroups
43+
path: LogGroups.RetentionInDays
44+
StoredBytes:
45+
is_read_only: true
46+
from:
47+
operation: DescribeLogGroups
48+
path: LogGroups.StoredBytes
2449
renames:
2550
operations:
2651
DescribeLogGroups:

apis/v1alpha1/log_group.go

Lines changed: 16 additions & 0 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: 25 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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,27 @@ spec:
136136
- type
137137
type: object
138138
type: array
139+
creationTime:
140+
description: The creation time of the log group, expressed as the
141+
number of milliseconds after Jan 1, 1970 00:00:00 UTC.
142+
format: int64
143+
type: integer
144+
dataProtectionStatus:
145+
description: Displays whether this log group has a protection policy,
146+
or whether it had one in the past. For more information, see PutDataProtectionPolicy
147+
(https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDataProtectionPolicy.html).
148+
type: string
149+
metricFilterCount:
150+
description: The number of metric filters.
151+
format: int64
152+
type: integer
153+
retentionInDays:
154+
format: int64
155+
type: integer
156+
storedBytes:
157+
description: The number of bytes stored.
158+
format: int64
159+
type: integer
139160
type: object
140161
type: object
141162
served: true

generator.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ resources:
1212
exceptions:
1313
terminal_codes:
1414
- InvalidParameterException
15+
reconcile:
16+
requeue_on_success_seconds: 60
1517
fields:
1618
Name:
1719
type: string
@@ -21,6 +23,31 @@ resources:
2123
resource: Key
2224
service_name: kms
2325
path: Status.ACKResourceMetadata.ARN
26+
CreationTime:
27+
is_read_only: true
28+
from:
29+
operation: DescribeLogGroups
30+
path: LogGroups.CreationTime
31+
DataProtectionStatus:
32+
is_read_only: true
33+
from:
34+
operation: DescribeLogGroups
35+
path: LogGroups.DataProtectionStatus
36+
MetricFilterCount:
37+
is_read_only: true
38+
from:
39+
operation: DescribeLogGroups
40+
path: LogGroups.MetricFilterCount
41+
RetentionInDays:
42+
is_read_only: true
43+
from:
44+
operation: DescribeLogGroups
45+
path: LogGroups.RetentionInDays
46+
StoredBytes:
47+
is_read_only: true
48+
from:
49+
operation: DescribeLogGroups
50+
path: LogGroups.StoredBytes
2451
renames:
2552
operations:
2653
DescribeLogGroups:

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,27 @@ spec:
136136
- type
137137
type: object
138138
type: array
139+
creationTime:
140+
description: The creation time of the log group, expressed as the
141+
number of milliseconds after Jan 1, 1970 00:00:00 UTC.
142+
format: int64
143+
type: integer
144+
dataProtectionStatus:
145+
description: Displays whether this log group has a protection policy,
146+
or whether it had one in the past. For more information, see PutDataProtectionPolicy
147+
(https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDataProtectionPolicy.html).
148+
type: string
149+
metricFilterCount:
150+
description: The number of metric filters.
151+
format: int64
152+
type: integer
153+
retentionInDays:
154+
format: int64
155+
type: integer
156+
storedBytes:
157+
description: The number of bytes stored.
158+
format: int64
159+
type: integer
139160
type: object
140161
type: object
141162
served: true

helm/templates/deployment.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ spec:
1818
app.kubernetes.io/instance: {{ .Release.Name }}
1919
template:
2020
metadata:
21+
{{- if .Values.deployment.annotations }}
2122
annotations:
2223
{{- range $key, $value := .Values.deployment.annotations }}
2324
{{ $key }}: {{ $value | quote }}
2425
{{- end }}
26+
{{- end }}
2527
labels:
2628
app.kubernetes.io/name: {{ include "app.name" . }}
2729
app.kubernetes.io/instance: {{ .Release.Name }}
@@ -104,11 +106,19 @@ spec:
104106
value: {{ include "aws.credentials.path" . }}
105107
- name: AWS_PROFILE
106108
value: {{ .Values.aws.credentials.profile }}
109+
{{- end }}
110+
{{- if .Values.deployment.extraEnvVars -}}
111+
{{ toYaml .Values.deployment.extraEnvVars | nindent 8 }}
112+
{{- end }}
107113
volumeMounts:
114+
{{- if .Values.aws.credentials.secretName }}
108115
- name: {{ .Values.aws.credentials.secretName }}
109116
mountPath: {{ include "aws.credentials.secret_mount_path" . }}
110117
readOnly: true
111118
{{- end }}
119+
{{- if .Values.deployment.extraVolumeMounts -}}
120+
{{ toYaml .Values.deployment.extraVolumeMounts | nindent 12 }}
121+
{{- end }}
112122
securityContext:
113123
allowPrivilegeEscalation: false
114124
privileged: false
@@ -133,9 +143,12 @@ spec:
133143
hostIPC: false
134144
hostNetwork: false
135145
hostPID: false
136-
{{ if .Values.aws.credentials.secretName -}}
137146
volumes:
147+
{{- if .Values.aws.credentials.secretName -}}
138148
- name: {{ .Values.aws.credentials.secretName }}
139149
secret:
140150
secretName: {{ .Values.aws.credentials.secretName }}
141151
{{ end -}}
152+
{{- if .Values.deployment.extraVolumes }}
153+
{{ toYaml .Values.deployment.extraVolumes | indent 8}}
154+
{{- end }}

helm/values.schema.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@
5858
},
5959
"priorityClassName": {
6060
"type": "string"
61+
},
62+
"extraVolumeMounts": {
63+
"type": "array"
64+
},
65+
"extraVolumes": {
66+
"type": "array"
67+
},
68+
"extraEnvVars": {
69+
"type": "array"
6170
}
6271
},
6372
"required": [

helm/values.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,26 @@ deployment:
2828
# Which priorityClassName to set?
2929
# See: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#pod-priority
3030
priorityClassName: ""
31+
extraVolumes: []
32+
extraVolumeMounts: []
33+
34+
# Additional server container environment variables
35+
#
36+
# You specify this manually like you would a raw deployment manifest.
37+
# This means you can bind in environment variables from secrets.
38+
#
39+
# e.g. static environment variable:
40+
# - name: DEMO_GREETING
41+
# value: "Hello from the environment"
42+
#
43+
# e.g. secret environment variable:
44+
# - name: USERNAME
45+
# valueFrom:
46+
# secretKeyRef:
47+
# name: mysecret
48+
# key: username
49+
extraEnvVars: []
50+
3151

3252
# If "installScope: cluster" then these labels will be applied to ClusterRole
3353
role:

0 commit comments

Comments
 (0)