Skip to content

Commit c26cda8

Browse files
authored
Adds support for Certificate resources (#2)
Initial support for Certificate resources. Items to note: We hardcode `ValidationMethod` to "DNS" because the "EMAIL" validation method means cert renewal is not automateable. See https://docs.aws.amazon.com/acm/latest/userguide/email-validation.html We have some custom validation of the number of domain validation options. When requesting a public certificate with DNS validation, you can only submit a max of 5 subdomains/CNAME records for use in DNS validation, and since we hardcode DNS validation method, we need to check for this and put the Certificate into a Terminal state if there are more than 5 CNAME records listed in the DomainValidationOptions field. Finally, we add a simple sleep of 5 seconds after successful creation since https://docs.aws.amazon.com/acm/latest/APIReference/API_RequestCertificate.html warns us that DescribeCertificate calls will not succeed for several seconds after a RequestCertificate call has returned the CertificateArn... Issue aws-controllers-k8s/community#482 Signed-off-by: Jay Pipes <jaypipes@gmail.com> By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent f5e3cd4 commit c26cda8

32 files changed

+3149
-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: "2023-01-11T16:22:56Z"
3-
build_hash: e661ce95afc39b380653ca655503daebf1e1831b
2+
build_date: "2023-01-11T19:39:12Z"
3+
build_hash: cfce82dfeed4e658da394699720394b1f7d23ff6
44
go_version: go1.19.4
5-
version: v0.21.0-5-ge661ce9
6-
api_directory_checksum: fa2a0bb3ebeac0ca69a199dff2946d06133f2ac6
5+
version: v0.22.0-1-gcfce82d
6+
api_directory_checksum: 090c67b92b4d0ddb4b58db94aa4b07b8c69dd530
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.177
99
generator_config_info:
10-
file_checksum: 3911a939c7b2b7678e6ae86ff6e59678d19ab019
10+
file_checksum: aa72a600b2490b566fcd54554ee64e386a001799
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/certificate.go

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

apis/v1alpha1/enums.go

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

apis/v1alpha1/generator.yaml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,33 @@
11
ignore:
2-
resource_names:
2+
field_paths:
3+
- "RequestCertificateInput.IdempotencyToken"
4+
operations:
5+
RequestCertificate:
6+
resource_name: Certificate
7+
operation_type: CREATE
8+
override_values:
9+
# NOTE(jaypipes): We only support DNS-based validation, because
10+
# certificate renewal is not really automatable when email verification
11+
# is used.
12+
#
13+
# See discussion here:
14+
# https://docs.aws.amazon.com/acm/latest/userguide/email-validation.html
15+
ValidationMethod: DNS
16+
# NOTE(jaypipes): There is a GetCertificate API call, but that returns the
17+
# actual cert bytes, not the attributes of the certificate request
18+
DescribeCertificate:
19+
resource_name: Certificate
20+
operation_type: READ_ONE
21+
UpdateCertificateOptions:
22+
resource_name: Certificate
23+
operation_type: UPDATE
24+
resources:
25+
Certificate:
26+
hooks:
27+
sdk_create_pre_build_request:
28+
template_path: hooks/certificate/sdk_create_pre_build_request.go.tpl
29+
sdk_create_post_set_output:
30+
template_path: hooks/certificate/sdk_create_post_set_output.go.tpl
31+
fields:
32+
KeyAlgorithm:
33+
late_initialize: {}

apis/v1alpha1/types.go

Lines changed: 139 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)