Skip to content

Commit 58dc7b4

Browse files
authored
Generate ACM reference for DistributionConfig.ViewerCertificate (#29)
Description of changes: - Adding a new reference for ACM certificate ARN - Fix `acmCertificateARN` camel case name By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent f51fc67 commit 58dc7b4

File tree

13 files changed

+207
-15
lines changed

13 files changed

+207
-15
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: "2024-02-14T04:03:15Z"
3-
build_hash: 947081ffebdeefcf2c61c4ca6d7e68810bdf9d08
2+
build_date: "2024-02-19T19:45:25Z"
3+
build_hash: 9c8a01fdcb2bcf7448cd9f9549c8b480e424e927
44
go_version: go1.22.0
5-
version: v0.30.0
6-
api_directory_checksum: 0772737bbcb79c3ab3ac8aa6b8d0e723ee28c401
5+
version: v0.30.0-6-g9c8a01f-dirty
6+
api_directory_checksum: 86a18c0bfcc849ad234f64249fd8951ce418dd14
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.214
99
generator_config_info:
10-
file_checksum: b865d43d27deaab5980043ea80d2fc0c34f779fc
10+
file_checksum: 4faafc515699468a833ad70b7cbc8d2260477ea1
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ resources:
193193
CallerReference:
194194
type: string
195195
is_read_only: true
196+
DistributionConfig.ViewerCertificate.ACMCertificateARN:
197+
references:
198+
service_name: acm
199+
resource: Certificate
200+
path: Status.ACKResourceMetadata.ARN
196201
Function:
197202
tags:
198203
ignore: true

apis/v1alpha1/types.go

Lines changed: 9 additions & 7 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: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/controller/main.go

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

config/crd/bases/cloudfront.services.k8s.aws_distributions.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,8 +885,20 @@ spec:
885885
and Using Alternate Domain Names and HTTPS (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-alternate-domain-names.html)
886886
in the Amazon CloudFront Developer Guide.
887887
properties:
888-
aCMCertificateARN:
888+
acmCertificateARN:
889889
type: string
890+
acmCertificateRef:
891+
description: Reference field for ACMCertificateARN
892+
properties:
893+
from:
894+
description: |-
895+
AWSResourceReference provides all the values necessary to reference another
896+
k8s resource for finding the identifier(Id/ARN/Name)
897+
properties:
898+
name:
899+
type: string
900+
type: object
901+
type: object
890902
certificate:
891903
type: string
892904
certificateSource:

config/rbac/cluster-role-controller.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ rules:
3030
- list
3131
- patch
3232
- watch
33+
- apiGroups:
34+
- acm.services.k8s.aws
35+
resources:
36+
- certificates
37+
verbs:
38+
- get
39+
- list
40+
- apiGroups:
41+
- acm.services.k8s.aws
42+
resources:
43+
- certificates/status
44+
verbs:
45+
- get
46+
- list
3347
- apiGroups:
3448
- cloudfront.services.k8s.aws
3549
resources:

generator.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ resources:
193193
CallerReference:
194194
type: string
195195
is_read_only: true
196+
DistributionConfig.ViewerCertificate.ACMCertificateARN:
197+
references:
198+
service_name: acm
199+
resource: Certificate
200+
path: Status.ACKResourceMetadata.ARN
196201
Function:
197202
tags:
198203
ignore: true

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.21
55
toolchain go1.21.5
66

77
require (
8+
github.com/aws-controllers-k8s/acm-controller v0.0.13
89
github.com/aws-controllers-k8s/runtime v0.30.0
910
github.com/aws/aws-sdk-go v1.49.0
1011
github.com/go-logr/logr v1.4.1

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
github.com/aws-controllers-k8s/acm-controller v0.0.13 h1:MweVMF9lAV9PpimS6L5NWVsoFfkmAfHUgoC/Msl887w=
2+
github.com/aws-controllers-k8s/acm-controller v0.0.13/go.mod h1:hUc8oa8RtxUk49svAoegfscFzhgmJvRCh2FklskrEwg=
13
github.com/aws-controllers-k8s/runtime v0.30.0 h1:AibYRdi/7xUA3t8BA0u8g+J+OioaTAT6R4Vq8hxLiYw=
24
github.com/aws-controllers-k8s/runtime v0.30.0/go.mod h1:Pv1ozlUaO11KO2mwPN/HzhAtZ70ZDE9UP24mjsbkul0=
35
github.com/aws/aws-sdk-go v1.49.0 h1:g9BkW1fo9GqKfwg2+zCD+TW/D36Ux+vtfJ8guF4AYmY=

0 commit comments

Comments
 (0)