Skip to content

Commit 9f3a8e0

Browse files
authored
Merge pull request #44532 from Nawazxam/main
fix: update kms_key_id validation to accept all AWS-supported formats
2 parents 4cbd8ed + 79797d7 commit 9f3a8e0

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.changelog/44505.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
resource/aws_launch_template: `kms_key_id` validation now accepts key ID, alias, and alias ARN in addition to key ARN
3+
```

internal/service/ec2/ec2_launch_template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func resourceLaunchTemplate() *schema.Resource {
8484
names.AttrKMSKeyID: {
8585
Type: schema.TypeString,
8686
Optional: true,
87-
ValidateFunc: verify.ValidARN,
87+
ValidateFunc: verify.ValidKMSKeyID,
8888
},
8989
names.AttrSnapshotID: {
9090
Type: schema.TypeString,

website/docs/r/launch_template.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ The `ebs` block supports the following:
173173
Cannot be used with `snapshot_id`.
174174
* `iops` - (Optional) The amount of provisioned [IOPS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html).
175175
This must be set with a `volume_type` of `"io1/io2/gp3"`.
176-
* `kms_key_id` - (Optional) The ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume.
176+
* `kms_key_id` - (Optional) Identifier (key ID, key alias, key ARN, or alias ARN) of the customer managed KMS key to use for EBS encryption.
177177
`encrypted` must be set to `true` when this is set.
178178
* `snapshot_id` - (Optional) The Snapshot ID to mount.
179179
* `throughput` - (Optional) The throughput to provision for a `gp3` volume in MiB/s (specified as an integer, e.g., 500), with a maximum of 1,000 MiB/s.

0 commit comments

Comments
 (0)