Skip to content

Commit 0d43671

Browse files
committed
fix: Re-align example
1 parent 21e8cdf commit 0d43671

File tree

3 files changed

+20
-43
lines changed

3 files changed

+20
-43
lines changed

examples/complete/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ No inputs.
7070
| <a name="output_complete_key_arn"></a> [complete\_key\_arn](#output\_complete\_key\_arn) | The Amazon Resource Name (ARN) of the key |
7171
| <a name="output_complete_key_id"></a> [complete\_key\_id](#output\_complete\_key\_id) | The globally unique identifier for the key |
7272
| <a name="output_complete_key_policy"></a> [complete\_key\_policy](#output\_complete\_key\_policy) | The IAM resource policy set on the key |
73-
| <a name="output_complete_key_region"></a> [complete\_key\_region](#output\_complete\_key\_region) | The region for the key |
7473
| <a name="output_default_aliases"></a> [default\_aliases](#output\_default\_aliases) | A map of aliases created and their attributes |
7574
| <a name="output_default_external_key_expiration_model"></a> [default\_external\_key\_expiration\_model](#output\_default\_external\_key\_expiration\_model) | Whether the key material expires. Empty when pending key material import, otherwise `KEY_MATERIAL_EXPIRES` or `KEY_MATERIAL_DOES_NOT_EXPIRE` |
7675
| <a name="output_default_external_key_state"></a> [default\_external\_key\_state](#output\_default\_external\_key\_state) | The state of the CMK |
@@ -79,7 +78,6 @@ No inputs.
7978
| <a name="output_default_key_arn"></a> [default\_key\_arn](#output\_default\_key\_arn) | The Amazon Resource Name (ARN) of the key |
8079
| <a name="output_default_key_id"></a> [default\_key\_id](#output\_default\_key\_id) | The globally unique identifier for the key |
8180
| <a name="output_default_key_policy"></a> [default\_key\_policy](#output\_default\_key\_policy) | The IAM resource policy set on the key |
82-
| <a name="output_default_key_region"></a> [default\_key\_region](#output\_default\_key\_region) | The region for the key |
8381
| <a name="output_external_aliases"></a> [external\_aliases](#output\_external\_aliases) | A map of aliases created and their attributes |
8482
| <a name="output_external_external_key_expiration_model"></a> [external\_external\_key\_expiration\_model](#output\_external\_external\_key\_expiration\_model) | Whether the key material expires. Empty when pending key material import, otherwise `KEY_MATERIAL_EXPIRES` or `KEY_MATERIAL_DOES_NOT_EXPIRE` |
8583
| <a name="output_external_external_key_state"></a> [external\_external\_key\_state](#output\_external\_external\_key\_state) | The state of the CMK |
@@ -88,23 +86,20 @@ No inputs.
8886
| <a name="output_external_key_arn"></a> [external\_key\_arn](#output\_external\_key\_arn) | The Amazon Resource Name (ARN) of the key |
8987
| <a name="output_external_key_id"></a> [external\_key\_id](#output\_external\_key\_id) | The globally unique identifier for the key |
9088
| <a name="output_external_key_policy"></a> [external\_key\_policy](#output\_external\_key\_policy) | The IAM resource policy set on the key |
91-
| <a name="output_external_key_region"></a> [external\_key\_region](#output\_external\_key\_region) | The region for the key |
9289
| <a name="output_replica_aliases"></a> [replica\_aliases](#output\_replica\_aliases) | A map of aliases created and their attributes |
9390
| <a name="output_replica_external_aliases"></a> [replica\_external\_aliases](#output\_replica\_external\_aliases) | A map of aliases created and their attributes |
9491
| <a name="output_replica_external_arn"></a> [replica\_external\_arn](#output\_replica\_external\_arn) | The Amazon Resource Name (ARN) of the key |
9592
| <a name="output_replica_external_grants"></a> [replica\_external\_grants](#output\_replica\_external\_grants) | A map of grants created and their attributes |
9693
| <a name="output_replica_external_key_expiration_model"></a> [replica\_external\_key\_expiration\_model](#output\_replica\_external\_key\_expiration\_model) | Whether the key material expires. Empty when pending key material import, otherwise `KEY_MATERIAL_EXPIRES` or `KEY_MATERIAL_DOES_NOT_EXPIRE` |
9794
| <a name="output_replica_external_key_id"></a> [replica\_external\_key\_id](#output\_replica\_external\_key\_id) | The globally unique identifier for the key |
9895
| <a name="output_replica_external_key_policy"></a> [replica\_external\_key\_policy](#output\_replica\_external\_key\_policy) | The IAM resource policy set on the key |
99-
| <a name="output_replica_external_key_region"></a> [replica\_external\_key\_region](#output\_replica\_external\_key\_region) | The region for the key |
10096
| <a name="output_replica_external_key_state"></a> [replica\_external\_key\_state](#output\_replica\_external\_key\_state) | The state of the CMK |
10197
| <a name="output_replica_external_key_usage"></a> [replica\_external\_key\_usage](#output\_replica\_external\_key\_usage) | The cryptographic operations for which you can use the CMK |
10298
| <a name="output_replica_grants"></a> [replica\_grants](#output\_replica\_grants) | A map of grants created and their attributes |
10399
| <a name="output_replica_key_arn"></a> [replica\_key\_arn](#output\_replica\_key\_arn) | The Amazon Resource Name (ARN) of the key |
104100
| <a name="output_replica_key_expiration_model"></a> [replica\_key\_expiration\_model](#output\_replica\_key\_expiration\_model) | Whether the key material expires. Empty when pending key material import, otherwise `KEY_MATERIAL_EXPIRES` or `KEY_MATERIAL_DOES_NOT_EXPIRE` |
105101
| <a name="output_replica_key_id"></a> [replica\_key\_id](#output\_replica\_key\_id) | The globally unique identifier for the key |
106102
| <a name="output_replica_key_policy"></a> [replica\_key\_policy](#output\_replica\_key\_policy) | The IAM resource policy set on the key |
107-
| <a name="output_replica_key_region"></a> [replica\_key\_region](#output\_replica\_key\_region) | The region for the key |
108103
| <a name="output_replica_key_state"></a> [replica\_key\_state](#output\_replica\_key\_state) | The state of the CMK |
109104
| <a name="output_replica_key_usage"></a> [replica\_key\_usage](#output\_replica\_key\_usage) | The cryptographic operations for which you can use the CMK |
110105
<!-- END_TF_DOCS -->

examples/complete/main.tf

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ provider "aws" {
55
data "aws_caller_identity" "current" {}
66

77
locals {
8-
region = "us-east-1"
9-
replica_region = "eu-west-1"
10-
name = "kms-ex-${replace(basename(path.cwd), "_", "-")}"
8+
region = "us-east-1"
9+
name = "kms-ex-${basename(path.cwd)}"
1110

1211
account_id = data.aws_caller_identity.current.account_id
1312
current_identity = data.aws_caller_identity.current.arn
@@ -114,7 +113,7 @@ module "kms_external" {
114113
is_enabled = true
115114
key_material_base64 = "Wblj06fduthWggmsT0cLVoIMOkeLbc2kVfMud77i/JY="
116115
multi_region = false
117-
valid_to = "2025-11-21T23:20:50Z"
116+
valid_to = "2023-11-21T23:20:50Z"
118117

119118
tags = local.tags
120119
}
@@ -172,9 +171,18 @@ module "kms_primary" {
172171
tags = local.tags
173172
}
174173

174+
provider "aws" {
175+
region = "eu-west-1"
176+
alias = "replica"
177+
}
178+
175179
module "kms_replica" {
176180
source = "../.."
177181

182+
providers = {
183+
aws = aws.replica
184+
}
185+
178186
deletion_window_in_days = 7
179187
description = "Replica key example showing various configurations available"
180188
create_replica = true
@@ -211,8 +219,6 @@ module "kms_replica" {
211219
}
212220
}
213221

214-
region = local.replica_region
215-
216222
tags = local.tags
217223
}
218224

@@ -229,7 +235,7 @@ module "kms_primary_external" {
229235
create_external = true
230236
key_material_base64 = "Wblj06fduthWggmsT0cLVoIMOkeLbc2kVfMud77i/JY="
231237
multi_region = true
232-
valid_to = "2025-11-21T23:20:50Z"
238+
valid_to = "2023-11-21T23:20:50Z"
233239

234240
aliases = ["primary-external"]
235241

@@ -239,14 +245,18 @@ module "kms_primary_external" {
239245
module "kms_replica_external" {
240246
source = "../.."
241247

248+
providers = {
249+
aws = aws.replica
250+
}
251+
242252
deletion_window_in_days = 7
243253
description = "Replica external key example showing various configurations available"
244254
create_replica_external = true
245255
is_enabled = true
246256
# key material must be the same as the primary's
247257
key_material_base64 = "Wblj06fduthWggmsT0cLVoIMOkeLbc2kVfMud77i/JY="
248258
primary_external_key_arn = module.kms_primary_external.key_arn
249-
valid_to = "2025-11-21T23:20:50Z"
259+
valid_to = "2023-11-21T23:20:50Z"
250260

251261
aliases = ["replica-external"]
252262

@@ -263,8 +273,6 @@ module "kms_replica_external" {
263273
}
264274
}
265275

266-
region = local.replica_region
267-
268276
tags = local.tags
269277
}
270278

examples/complete/outputs.tf

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ output "complete_key_id" {
1212
value = module.kms_complete.key_id
1313
}
1414

15-
output "complete_key_region" {
16-
description = "The region for the key"
17-
value = module.kms_complete.key_region
18-
}
19-
2015
output "complete_key_policy" {
2116
description = "The IAM resource policy set on the key"
2217
value = module.kms_complete.key_policy
@@ -45,7 +40,6 @@ output "complete_aliases" {
4540
output "complete_grants" {
4641
description = "A map of grants created and their attributes"
4742
value = module.kms_complete.grants
48-
sensitive = true
4943
}
5044

5145
################################################################################
@@ -62,11 +56,6 @@ output "external_key_id" {
6256
value = module.kms_external.key_id
6357
}
6458

65-
output "external_key_region" {
66-
description = "The region for the key"
67-
value = module.kms_external.key_region
68-
}
69-
7059
output "external_key_policy" {
7160
description = "The IAM resource policy set on the key"
7261
value = module.kms_external.key_policy
@@ -111,11 +100,6 @@ output "default_key_id" {
111100
value = module.kms_default.key_id
112101
}
113102

114-
output "default_key_region" {
115-
description = "The region for the key"
116-
value = module.kms_default.key_region
117-
}
118-
119103
output "default_key_policy" {
120104
description = "The IAM resource policy set on the key"
121105
value = module.kms_default.key_policy
@@ -146,6 +130,7 @@ output "default_grants" {
146130
value = module.kms_default.grants
147131
}
148132

133+
149134
################################################################################
150135
# Replica
151136
################################################################################
@@ -160,11 +145,6 @@ output "replica_key_id" {
160145
value = module.kms_replica.key_id
161146
}
162147

163-
output "replica_key_region" {
164-
description = "The region for the key"
165-
value = module.kms_replica.key_region
166-
}
167-
168148
output "replica_key_policy" {
169149
description = "The IAM resource policy set on the key"
170150
value = module.kms_replica.key_policy
@@ -193,9 +173,9 @@ output "replica_aliases" {
193173
output "replica_grants" {
194174
description = "A map of grants created and their attributes"
195175
value = module.kms_replica.grants
196-
sensitive = true
197176
}
198177

178+
199179
################################################################################
200180
# Replica External
201181
################################################################################
@@ -210,11 +190,6 @@ output "replica_external_key_id" {
210190
value = module.kms_replica_external.key_id
211191
}
212192

213-
output "replica_external_key_region" {
214-
description = "The region for the key"
215-
value = module.kms_replica_external.key_region
216-
}
217-
218193
output "replica_external_key_policy" {
219194
description = "The IAM resource policy set on the key"
220195
value = module.kms_replica_external.key_policy
@@ -243,5 +218,4 @@ output "replica_external_aliases" {
243218
output "replica_external_grants" {
244219
description = "A map of grants created and their attributes"
245220
value = module.kms_replica_external.grants
246-
sensitive = true
247221
}

0 commit comments

Comments
 (0)