Skip to content

Commit

Permalink
Merge pull request #28 from UKHomeOffice/ca_arn
Browse files Browse the repository at this point in the history
fix ca_arn variable
  • Loading branch information
jim5252 authored Nov 18, 2021
2 parents 05c8445 + 024ec75 commit 74d4e63
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Module usage:

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_CertificateauthorityarnList"></a> [CertificateauthorityarnList](#input_CertificateauthorityarnList) | ARN of the AWS managed CA to attach to the MSK cluster | `list(string)` | `[]` | no |
| <a name="input_ca_arn"></a> [ca_arn](#input_ca_arn) | ARN of the AWS managed CA to attach to the MSK cluster | `list(string)` | `[]` | no |
| <a name="input_acmpca_iam_user_name"></a> [acmpca_iam_user_name](#input_acmpca_iam_user_name) | The name of the IAM user assigned to the created AWS Private CA | `string` | `""` | no |
| <a name="input_certificateauthority"></a> [certificateauthority](#input_certificateauthority) | Should a CA be created with the MSK cluster? | `bool` | `false` | no |
| <a name="input_cidr_blocks"></a> [cidr_blocks](#input_cidr_blocks) | The CIDR blocks that the MSK cluster allows ingress connections from | `list` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
Expand Down
6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
*/

locals {
aws_acmpca_certificate_authority_arn = coalesce(element(concat(aws_acmpca_certificate_authority.msk_kafka_with_ca.*.arn, list("")), 0), element(concat(aws_acmpca_certificate_authority.msk_kafka_ca_with_config.*.arn, list("")), 0), element(concat(var.CertificateauthorityarnList, list("")), 0))
aws_acmpca_certificate_authority_arn = coalesce(element(concat(aws_acmpca_certificate_authority.msk_kafka_with_ca.*.arn, list("")), 0), element(concat(aws_acmpca_certificate_authority.msk_kafka_ca_with_config.*.arn, list("")), 0), element(concat(var.ca_arn, list("")), 0))
msk_cluster_arn = coalesce(element(concat(aws_msk_cluster.msk_kafka.*.arn, list("")), 0), element(concat(aws_msk_cluster.msk_kafka_with_config.*.arn, list("")), 0))
email_tags = { for i, email in var.email_addresses : "email${i}" => email }
}
Expand Down Expand Up @@ -136,7 +136,7 @@ resource "aws_msk_cluster" "msk_kafka" {

client_authentication {
tls {
certificate_authority_arns = length(var.CertificateauthorityarnList) != 0 ? var.CertificateauthorityarnList : [aws_acmpca_certificate_authority.msk_kafka_with_ca[count.index].arn]
certificate_authority_arns = length(var.ca_arn) != 0 ? var.ca_arn : [aws_acmpca_certificate_authority.msk_kafka_with_ca[count.index].arn]
}
}

Expand Down Expand Up @@ -187,7 +187,7 @@ resource "aws_msk_cluster" "msk_kafka_with_config" {

client_authentication {
tls {
certificate_authority_arns = length(var.CertificateauthorityarnList) != 0 ? var.CertificateauthorityarnList : [aws_acmpca_certificate_authority.msk_kafka_ca_with_config[count.index].arn]
certificate_authority_arns = length(var.ca_arn) != 0 ? var.ca_arn : [aws_acmpca_certificate_authority.msk_kafka_ca_with_config[count.index].arn]
}
}

Expand Down
2 changes: 1 addition & 1 deletion variable.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ variable "certificateauthority" {
default = false
}

variable "CertificateauthorityarnList" {
variable "ca_arn" {
description = "ARN of the AWS managed CA to attach to the MSK cluster"
default = []
type = list(string)
Expand Down

0 comments on commit 74d4e63

Please sign in to comment.