Created
January 15, 2020 04:12
-
-
Save jess-belliveau/7394cb9151840980a4a36de43f42ca93 to your computer and use it in GitHub Desktop.
KMS actions against nsmithuk/local-kms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Show no existing keys | |
➜ aws kms list-keys --endpoint-url http://localhost:8080 | |
{ | |
"Keys": [] | |
} | |
# Create an initial test key, no tags | |
➜ aws kms create-key --endpoint=http://localhost:8080 | |
{ | |
"KeyMetadata": { | |
"Origin": "AWS_KMS", | |
"KeyId": "ca3b5970-1100-4861-b9d9-9c83df257a13", | |
"Description": "", | |
"KeyManager": "CUSTOMER", | |
"Enabled": true, | |
"KeyUsage": "ENCRYPT_DECRYPT", | |
"KeyState": "Enabled", | |
"CreationDate": 1579061465, | |
"Arn": "arn:aws:kms:eu-west-2:111122223333:key/ca3b5970-1100-4861-b9d9-9c83df257a13", | |
"AWSAccountId": "111122223333" | |
} | |
} | |
# List returns single key as expected | |
➜ aws kms list-keys --endpoint-url http://localhost:8080 | |
{ | |
"Keys": [ | |
{ | |
"KeyArn": "arn:aws:kms:eu-west-2:111122223333:key/ca3b5970-1100-4861-b9d9-9c83df257a13", | |
"KeyId": "ca3b5970-1100-4861-b9d9-9c83df257a13" | |
} | |
] | |
} | |
# Create a new key with two tags | |
➜ aws kms create-key --tags TagKey=Tag1,TagValue=Test TagKey=Tag2,TagValue=Two --endpoint=http://localhost:8080 | |
{ | |
"KeyMetadata": { | |
"Origin": "AWS_KMS", | |
"KeyId": "3baeb469-c6f4-4e88-8551-94ce1ff2c159", | |
"Description": "", | |
"KeyManager": "CUSTOMER", | |
"Enabled": true, | |
"KeyUsage": "ENCRYPT_DECRYPT", | |
"KeyState": "Enabled", | |
"CreationDate": 1579061489, | |
"Arn": "arn:aws:kms:eu-west-2:111122223333:key/3baeb469-c6f4-4e88-8551-94ce1ff2c159", | |
"AWSAccountId": "111122223333" | |
} | |
} | |
# List returns two keys as expected | |
➜ aws kms list-keys --endpoint-url http://localhost:8080 | |
{ | |
"Keys": [ | |
{ | |
"KeyArn": "arn:aws:kms:eu-west-2:111122223333:key/3baeb469-c6f4-4e88-8551-94ce1ff2c159", | |
"KeyId": "3baeb469-c6f4-4e88-8551-94ce1ff2c159" | |
}, | |
{ | |
"KeyArn": "arn:aws:kms:eu-west-2:111122223333:key/ca3b5970-1100-4861-b9d9-9c83df257a13", | |
"KeyId": "ca3b5970-1100-4861-b9d9-9c83df257a13" | |
} | |
] | |
} | |
# Confirm two tags are present | |
➜ aws kms list-resource-tags --key-id 3baeb469-c6f4-4e88-8551-94ce1ff2c159 --endpoint-url http://localhost:8080 | |
{ | |
"Truncated": false, | |
"Tags": [ | |
{ | |
"TagKey": "Tag1", | |
"TagValue": "Test" | |
}, | |
{ | |
"TagKey": "Tag2", | |
"TagValue": "Two" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Docker image logs: