Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a new KMS key using AWS CLI.
AWS
aws kms create-key --description [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using --key-id instead of --description
Not enclosing the description in quotes
Using alias instead of description
✗ Incorrect
The --description parameter requires a string describing the key.
2fill in blank
mediumComplete the code to create an alias for an existing KMS key.
AWS
aws kms create-alias --alias-name [1] --target-key-id 1234abcd-12ab-34cd-56ef-1234567890ab
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting 'alias/' prefix
Using 'key/' prefix instead
Not quoting the alias name
✗ Incorrect
Alias names must start with 'alias/' followed by the alias name.
3fill in blank
hardFix the error in the command to enable key rotation for a KMS key.
AWS
aws kms [1]-key-rotation --key-id 1234abcd-12ab-34cd-56ef-1234567890ab
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create-key-rotation' which is invalid
Using 'update-key-rotation' which is invalid
Using 'disable-key-rotation' instead of 'enable-key-rotation'
✗ Incorrect
The correct command to enable key rotation is 'enable-key-rotation'.
4fill in blank
hardFill both blanks to list all KMS keys in a specific region.
AWS
aws kms [1]-keys --region [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'describe-keys' which is invalid
Omitting the region or using wrong region code
Using 'list' without '-keys'
✗ Incorrect
The command 'list-keys' lists all keys; region specifies the AWS region.
5fill in blank
hardFill all three blanks to create a KMS key with a policy that allows encryption.
AWS
aws kms create-key --policy '{{"Version": "2012-10-17", "Statement": [{"Effect": "Allow", "Principal": [1], "Action": [2], "Resource": [3]] }}'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using root ARN instead of specific user
Not using a list for Action
Using a specific resource ARN instead of '*'
✗ Incorrect
The policy principal is a specific user, action is kms:Encrypt in a list, and resource is '*' for all resources.