Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r/kms_alias: Retry creation on NotFoundException #1896

Merged
merged 1 commit into from
Oct 16, 2017

Conversation

radeksimko
Copy link
Member

This is to address the following test failure:

=== RUN   TestAccAWSKmsAlias_name_prefix
--- FAIL: TestAccAWSKmsAlias_name_prefix (24.56s)
    testing.go:434: Step 0 error: Error applying: 1 error(s) occurred:
        
        * aws_kms_alias.name_prefix: 1 error(s) occurred:
        
        * aws_kms_alias.name_prefix: NotFoundException: Key 'arn:aws:kms:us-west-2:*******:key/d009dff4-27f4-4e10-ac07-aef1b74204e0' does not exist
            status code: 400, request id: 5334f913-b106-11e7-9f19-a3bd400081f8

Snippet from the log:

2017/10/14 17:37:17 [DEBUG] [aws-sdk-go] DEBUG: Response kms/DescribeKey Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 200 OK
Connection: close
Content-Length: 387
Content-Type: application/x-amz-json-1.1
X-Amzn-Requestid: 531d2abb-b106-11e7-9b02-a5418d0385e7


-----------------------------------------------------
2017/10/14 17:37:17 [DEBUG] [aws-sdk-go] {"KeyMetadata":{"AWSAccountId":"*REDACTED*","Arn":"arn:aws:kms:us-west-2:*REDACTED*:key/d009dff4-27f4-4e10-ac07-aef1b74204e0","CreationDate":1.508002637976E9,"Description":"Terraform acc test One Sat, 14 Oct 2017 17:37:14 UTC","Enabled":true,"KeyId":"d009dff4-27f4-4e10-ac07-aef1b74204e0","KeyManager":"CUSTOMER","KeyState":"Enabled","KeyUsage":"ENCRYPT_DECRYPT","Origin":"AWS_KMS"}}

-----------------------------------------------------
2017/10/14 17:37:18 [DEBUG] [aws-sdk-go] DEBUG: Request kms/CreateAlias Details:
---[ REQUEST POST-SIGN ]-----------------------------
POST / HTTP/1.1
Host: kms.us-west-2.amazonaws.com
User-Agent: aws-sdk-go/1.12.8 (go1.9; linux; amd64) APN/1.0 HashiCorp/1.0 Terraform/0.10.0-dev
Content-Length: 101
Authorization: AWS4-HMAC-SHA256 Credential=*REDACTED*/20171014/us-west-2/kms/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-target, Signature=*REDACTED*
Content-Type: application/x-amz-json-1.1
X-Amz-Date: 20171014T173718Z
X-Amz-Target: TrentService.CreateAlias
Accept-Encoding: gzip

{"AliasName":"alias/20171014173718010800000001","TargetKeyId":"d009dff4-27f4-4e10-ac07-aef1b74204e0"}
-----------------------------------------------------

-----------------------------------------------------
2017/10/14 17:37:18 [DEBUG] [aws-sdk-go] DEBUG: Response kms/CreateAlias Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 400 Bad Request
Connection: close
Content-Length: 139
Content-Type: application/x-amz-json-1.1
X-Amzn-Requestid: 5334f913-b106-11e7-9f19-a3bd400081f8


-----------------------------------------------------
2017/10/14 17:37:18 [DEBUG] [aws-sdk-go] {"__type":"NotFoundException","message":"Key 'arn:aws:kms:us-west-2:187416307283:key/d009dff4-27f4-4e10-ac07-aef1b74204e0' does not exist"}

@radeksimko radeksimko added the bug Addresses a defect in current functionality. label Oct 14, 2017
Copy link
Contributor

@Ninir Ninir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@radeksimko radeksimko merged commit 8a3c35a into master Oct 16, 2017
@radeksimko radeksimko deleted the b-kms-alias-retry-creation branch October 16, 2017 12:33
@ghost
Copy link

ghost commented Apr 10, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants