Skip to content

Commit

Permalink
improve dynamodb permission error msg (#42855)
Browse files Browse the repository at this point in the history
* improve dynamodb permission error msg

* Update lib/backend/dynamo/atomicwrite.go

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
  • Loading branch information
fspmarshall and zmb3 committed Jun 12, 2024
1 parent 5a3719e commit 808d96a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/backend/dynamo/atomicwrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ TxnLoop:
if err != nil {
txnErr := &dynamodb.TransactionCanceledException{}
if !errors.As(err, &txnErr) {
if s := err.Error(); strings.Contains(s, "AccessDenied") && strings.Contains(s, "dynamodb:ConditionCheckItem") {
b.Warnf("AtomicWrite failed with error that may indicate dynamodb is missing the required dynamodb:ConditionCheckItem permission (this permission is now required for teleport v16 and later). Consider updating your IAM policy to include this permission. Original error: %v", err)
return "", trace.Errorf("teleport is missing required AWS permission dynamodb:ConditionCheckItem, please contact your administrator to update permissions")
}
return "", trace.Errorf("unexpected error during atomic write: %v", err)
}

Expand Down

0 comments on commit 808d96a

Please sign in to comment.