Skip to content

bug: KMS get-key-rotation-status output not consistent with official AWS cli #12080

@dnlopes

Description

@dnlopes

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The KMS get-key-rotation-status output returns a JSON like

{
    "KeyRotationEnabled": true
}

Expected Behavior

According to the official documentation, the output structure is as follows:

{
    "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
    "KeyRotationEnabled": true,
    "NextRotationDate": "2024-02-14T18:14:33.587000+00:00",
    "RotationPeriodInDays": 365
}

The impact is a perpetual drift on my Terraform configuration, because the rotation period is not present on the output, making Terrafrom reconciling that setting in loop.

How are you starting LocalStack?

With the localstack script

Steps To Reproduce

With localstack running on another shell, run the script below:

export AWS_ACCESS_KEY_ID="test"
export AWS_SECRET_ACCESS_KEY="test"
export AWS_REGION="us-east-1"
export AWS_ENDPOINT_URL="http://localhost:4566"

keyId=$(aws --endpoint-url="$AWS_ENDPOINT_URL" kms create-key --description "test" --query KeyMetadata.KeyId --output text)
aws --endpoint-url="$AWS_ENDPOINT_URL" kms enable-key-rotation --key-id "$keyId" --rotation-period-in-days 120 --output json --no-cli-pager
aws --endpoint-url="$AWS_ENDPOINT_URL" kms get-key-rotation-status --key-id "$keyId" --output json --no-cli-pager

Environment

- OS: macOS
- LocalStack:
    version: 3.6.1.dev
    build date: 2024-08-16
    build git hash: 1fafd6da1

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    aws:kmsAWS Key Management Servicegood first issueGood item to work on for newcomersstatus: backlogTriaged but not yet being worked ontype: bugBug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions