Skip to content

Commit 82f2dbc

Browse files
rankin-trgoruha
andauthored
chore: Add certificate export option (#92)
* chore: Add certificate export option * chore: pin `aws` version `>= 6.4.0` * chore: add output descriptions * fix: correct formatting * Update fixtures.us-west-1.tfvars * Update examples_complete_test.go * Update examples_complete_test.go --------- Co-authored-by: Igor Rodionov <[email protected]>
1 parent 1b76b4a commit 82f2dbc

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
lines changed

examples/complete/fixtures.us-west-1.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ stage = "test"
66

77
name = "test-zone-2"
88

9-
parent_zone_name = "testing.cloudposse.co"
9+
parent_zone_name = "modules.cptest.test-automation.app"
1010

1111
validation_method = "DNS"
1212

examples/complete/outputs.tf

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
output "parent_zone_id" {
2-
value = module.zone.parent_zone_id
2+
value = module.zone.parent_zone_id
3+
description = "The zone id of the parent Route53 Hosted Zone"
34
}
45

56
output "parent_zone_name" {
6-
value = module.zone.parent_zone_name
7+
value = module.zone.parent_zone_name
8+
description = "The name of the parent Route53 Hosted Zone"
79
}
810

911
output "zone_id" {
10-
value = module.zone.zone_id
12+
value = module.zone.zone_id
13+
description = "The zone id of the Route53 Hosted Zone"
1114
}
1215

1316
output "zone_name" {
14-
value = module.zone.zone_name
17+
value = module.zone.zone_name
18+
description = "The name of the desired Route53 Hosted Zone"
1519
}
1620

1721
output "zone_fqdn" {
18-
value = module.zone.fqdn
22+
value = module.zone.fqdn
23+
description = "The FQDN of the desired Route53 Hosted Zone"
1924
}
2025

2126
output "certificate_id" {

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ resource "aws_acm_certificate" "default" {
1818

1919
options {
2020
certificate_transparency_logging_preference = var.certificate_transparency_logging_preference ? "ENABLED" : "DISABLED"
21+
export = var.certificate_export ? "ENABLED" : "DISABLED"
2122
}
2223

2324
tags = module.this.tags

test/src/examples_complete_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ func TestExamplesComplete(t *testing.T) {
5656
// Run `terraform output` to get the value of an output variable
5757
zoneName := terraform.Output(t, terraformOptions, "zone_name")
5858

59-
expectedZoneName := "test-zone-2.testing.cloudposse.co"
59+
expectedZoneName := "test-zone-2.modules.cptest.test-automation.app"
6060
// Verify we're getting back the outputs we expect
6161
assert.Equal(t, expectedZoneName, zoneName)
6262

6363
// Run `terraform output` to get the value of an output variable
6464
certificateArn := terraform.Output(t, terraformOptions, "certificate_arn")
6565

6666
// Verify we're getting back the outputs we expect
67-
assert.Contains(t, certificateArn, "arn:aws:acm:us-west-1:126450723953:certificate/")
67+
assert.Contains(t, certificateArn, "arn:aws:acm:us-west-1:799847381734:certificate/")
6868
}
6969

7070
func TestExamplesCompleteDisabled(t *testing.T) {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ variable "zone_id" {
5555
description = "The zone id of the Route53 Hosted Zone which can be used instead of `var.zone_name`."
5656
}
5757

58+
variable "certificate_export" {
59+
type = bool
60+
default = false
61+
description = "Specifies whether the certificate can be exported"
62+
}
63+
5864
variable "certificate_transparency_logging_preference" {
5965
type = bool
6066
default = true

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.40"
7+
version = ">= 6.4.0"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)