Skip to content

Commit 7eec7e2

Browse files
committed
chore: don't disable acc test KMS keys
When applying acceptance test terraform for AWS KMS key resources, we often see errors of the form: `Failed to set KMS key ... status to false: "NotFoundException: Key '...' does not exist"`. Our current theory is that setting is_enabled=false (as we currently do) is causing terraform to have to perform 2 API operations: create the key, then disable it. Due to the "eventualy consistency" of this API we see this flaking quite often. We don't actually need to disable the keys, so let's not, in an attempt to improve the reliability of this test.
1 parent 7f729dc commit 7eec7e2

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

pkg/resource/aws/testdata/acc/aws_kms_alias/terraform.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ terraform {
1010

1111
resource "aws_kms_key" "key" {
1212
deletion_window_in_days = 7
13-
is_enabled = false
1413
}
1514

1615
resource "aws_kms_alias" "foo" {
@@ -19,6 +18,6 @@ resource "aws_kms_alias" "foo" {
1918
}
2019

2120
resource "aws_kms_alias" "baz" {
22-
name_prefix = "alias/baz"
21+
name_prefix = "alias/baz"
2322
target_key_id = aws_kms_key.key.key_id
2423
}

pkg/resource/aws/testdata/acc/aws_kms_key/terraform.tf

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,20 @@ terraform {
1010

1111
resource "aws_kms_key" "foo" {
1212
description = "Foo"
13-
deletion_window_in_days = 7
14-
is_enabled = false
13+
deletion_window_in_days = 7
1514
customer_master_key_spec = "RSA_4096"
1615
}
1716

1817
resource "aws_kms_key" "bar" {
1918
description = "Bar"
20-
deletion_window_in_days = 7
21-
is_enabled = false
19+
deletion_window_in_days = 7
2220
customer_master_key_spec = "RSA_2048"
23-
key_usage = "SIGN_VERIFY"
21+
key_usage = "SIGN_VERIFY"
2422
}
2523

2624
resource "aws_kms_key" "baz" {
2725
description = "Baz"
2826
deletion_window_in_days = 7
29-
is_enabled = false
3027
tags = {
3128
"Foo" = "true"
3229
}

0 commit comments

Comments
 (0)