Skip to content

Commit 57d7304

Browse files
committed
feat: Made it clear that we stand with Ukraine
1 parent e3196eb commit 57d7304

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Terraform module which creates ACM certificates and validates them using Route53 DNS (recommended) or e-mail.
44

5+
[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)
6+
57
## Usage with Route53 DNS validation (recommended)
68

79
```hcl
@@ -149,6 +151,7 @@ No modules.
149151
| <a name="input_create_route53_records"></a> [create\_route53\_records](#input\_create\_route53\_records) | When validation is set to DNS, define whether to create the DNS records internally via Route53 or externally using any DNS provider | `bool` | `true` | no |
150152
| <a name="input_dns_ttl"></a> [dns\_ttl](#input\_dns\_ttl) | The TTL of DNS recursive resolvers to cache information about this record. | `number` | `60` | no |
151153
| <a name="input_domain_name"></a> [domain\_name](#input\_domain\_name) | A domain name for which the certificate should be issued | `string` | `""` | no |
154+
| <a name="input_putin_khuylo"></a> [putin\_khuylo](#input\_putin\_khuylo) | Do you agree that Putin doesn't respect Ukrainian sovereignty and territorial integrity? More info: https://en.wikipedia.org/wiki/Putin_khuylo! | `bool` | `true` | no |
152155
| <a name="input_subject_alternative_names"></a> [subject\_alternative\_names](#input\_subject\_alternative\_names) | A list of domains that should be SANs in the issued certificate | `list(string)` | `[]` | no |
153156
| <a name="input_tags"></a> [tags](#input\_tags) | A mapping of tags to assign to the resource | `map(string)` | `{}` | no |
154157
| <a name="input_validate_certificate"></a> [validate\_certificate](#input\_validate\_certificate) | Whether to validate certificate by creating Route53 record | `bool` | `true` | no |
@@ -177,3 +180,10 @@ Module is maintained by [Anton Babenko](https://github.com/antonbabenko) with he
177180
## License
178181

179182
Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-acm/tree/master/LICENSE) for full details.
183+
184+
## Additional terms of use for users from Russia and Belarus
185+
186+
By using the code provided in this repository you agree with the following:
187+
* Russia has [illegally annexed Crimea in 2014](https://en.wikipedia.org/wiki/Annexation_of_Crimea_by_the_Russian_Federation) and [brought the war in Donbas](https://en.wikipedia.org/wiki/War_in_Donbas) followed by [full-scale invasion of Ukraine in 2022](https://en.wikipedia.org/wiki/2022_Russian_invasion_of_Ukraine).
188+
* Russia has brought sorrow and devastations to millions of Ukrainians, killed hundreds of innocent people, damaged thousands of buildings, and forced several million people to flee.
189+
* [Putin khuylo!](https://en.wikipedia.org/wiki/Putin_khuylo!)

main.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
locals {
2+
create_certificate = var.create_certificate && var.putin_khuylo
3+
24
# Get distinct list of domains and SANs
35
distinct_domain_names = distinct(
46
[for s in concat([var.domain_name], var.subject_alternative_names) : replace(s, "*.", "")]
57
)
68

79
# Get the list of distinct domain_validation_options, with wildcard
810
# domain names replaced by the domain name
9-
validation_domains = var.create_certificate ? distinct(
11+
validation_domains = local.create_certificate ? distinct(
1012
[for k, v in aws_acm_certificate.this[0].domain_validation_options : merge(
1113
tomap(v), { domain_name = replace(v.domain_name, "*.", "") }
1214
)]
1315
) : []
1416
}
1517

1618
resource "aws_acm_certificate" "this" {
17-
count = var.create_certificate ? 1 : 0
19+
count = local.create_certificate ? 1 : 0
1820

1921
domain_name = var.domain_name
2022
subject_alternative_names = var.subject_alternative_names
@@ -32,7 +34,7 @@ resource "aws_acm_certificate" "this" {
3234
}
3335

3436
resource "aws_route53_record" "validation" {
35-
count = var.create_certificate && var.validation_method == "DNS" && var.create_route53_records && var.validate_certificate ? length(local.distinct_domain_names) : 0
37+
count = local.create_certificate && var.validation_method == "DNS" && var.create_route53_records && var.validate_certificate ? length(local.distinct_domain_names) : 0
3638

3739
zone_id = var.zone_id
3840
name = element(local.validation_domains, count.index)["resource_record_name"]
@@ -49,7 +51,7 @@ resource "aws_route53_record" "validation" {
4951
}
5052

5153
resource "aws_acm_certificate_validation" "this" {
52-
count = var.create_certificate && var.validation_method == "DNS" && var.validate_certificate && var.wait_for_validation ? 1 : 0
54+
count = local.create_certificate && var.validation_method == "DNS" && var.validate_certificate && var.wait_for_validation ? 1 : 0
5355

5456
certificate_arn = aws_acm_certificate.this[0].arn
5557

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,9 @@ variable "dns_ttl" {
8080
type = number
8181
default = 60
8282
}
83+
84+
variable "putin_khuylo" {
85+
description = "Do you agree that Putin doesn't respect Ukrainian sovereignty and territorial integrity? More info: https://en.wikipedia.org/wiki/Putin_khuylo!"
86+
type = bool
87+
default = true
88+
}

0 commit comments

Comments
 (0)