2016/05/05 - AWS Key Management Service - 2 updated api methods
Changes Update kms client to latest version
{'BypassPolicyLockoutSafetyCheck': 'boolean'}
Creates a customer master key (CMK).
You can use a CMK to encrypt small amounts of data (4 KiB or less) directly, but CMKs are more commonly used to encrypt data encryption keys (DEKs), which are used to encrypt raw data. For more information about DEKs and the difference between CMKs and DEKs, see the following:
The GenerateDataKey operation
AWS Key Management Service Concepts in the AWS Key Management Service Developer Guide
Request Syntax
client.create_key( Policy='string', Description='string', KeyUsage='ENCRYPT_DECRYPT', BypassPolicyLockoutSafetyCheck=True|False )
string
The key policy to attach to the CMK.
If you specify a key policy, it must meet the following criteria:
It must allow the principal making the CreateKey request to make a subsequent PutKeyPolicy request on the CMK. This reduces the likelihood that the CMK becomes unmanageable. For more information, refer to the scenario in the Default Key Policy section in the AWS Key Management Service Developer Guide.
The principal(s) specified in the key policy must exist and be visible to AWS KMS. When you create a new AWS principal (for example, an IAM user or role), you might need to enforce a delay before specifying the new principal in a key policy because the new principal might not immediately be visible to AWS KMS. For more information, see Changes that I make are not always immediately visible in the IAM User Guide.
If you do not specify a policy, AWS KMS attaches a default key policy to the CMK. For more information, see Default Key Policy in the AWS Key Management Service Developer Guide.
The policy size limit is 32 KiB (32768 bytes).
string
A description of the CMK.
Use a description that helps you decide whether the CMK is appropriate for a task.
string
The intended use of the CMK.
You can use CMKs only for symmetric encryption and decryption.
boolean
A flag to indicate whether to bypass the key policy lockout safety check.
Use this parameter only when you include a policy in the request and you intend to prevent the principal making the request from making a subsequent PutKeyPolicy request on the CMK.
The default value is false.
dict
Response Syntax
{ 'KeyMetadata': { 'AWSAccountId': 'string', 'KeyId': 'string', 'Arn': 'string', 'CreationDate': datetime(2015, 1, 1), 'Enabled': True|False, 'Description': 'string', 'KeyUsage': 'ENCRYPT_DECRYPT', 'KeyState': 'Enabled'|'Disabled'|'PendingDeletion', 'DeletionDate': datetime(2015, 1, 1) } }
Response Structure
(dict) --
KeyMetadata (dict) --
Metadata associated with the CMK.
AWSAccountId (string) --
The twelve-digit account ID of the AWS account that owns the key.
KeyId (string) --
The globally unique identifier for the key.
Arn (string) --
The Amazon Resource Name (ARN) of the key. For examples, see AWS Key Management Service (AWS KMS) in the Example ARNs section of the AWS General Reference.
CreationDate (datetime) --
The date and time when the key was created.
Enabled (boolean) --
Specifies whether the key is enabled. When KeyState is Enabled this value is true, otherwise it is false.
Description (string) --
The friendly description of the key.
KeyUsage (string) --
The cryptographic operations for which you can use the key. Currently the only allowed value is ENCRYPT_DECRYPT, which means you can use the key for the Encrypt and Decrypt operations.
KeyState (string) --
The state of the customer master key (CMK).
For more information about how key state affects the use of a CMK, see How Key State Affects the Use of a Customer Master Key in the AWS Key Management Service Developer Guide.
DeletionDate (datetime) --
The date and time after which AWS KMS deletes the customer master key (CMK). This value is present only when KeyState is PendingDeletion, otherwise this value is null.
{'BypassPolicyLockoutSafetyCheck': 'boolean'}
Attaches a key policy to the specified customer master key (CMK).
For more information about key policies, see Key Policies in the AWS Key Management Service Developer Guide.
Request Syntax
client.put_key_policy( KeyId='string', PolicyName='string', Policy='string', BypassPolicyLockoutSafetyCheck=True|False )
string
[REQUIRED]
A unique identifier for the CMK.
Use the CMK's unique identifier or its Amazon Resource Name (ARN). For example:
Unique ID: 1234abcd-12ab-34cd-56ef-1234567890ab
ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
string
[REQUIRED]
The name of the key policy.
This value must be default.
string
[REQUIRED]
The key policy to attach to the CMK.
The key policy must meet the following criteria:
It must allow the principal making the PutKeyPolicy request to make a subsequent PutKeyPolicy request on the CMK. This reduces the likelihood that the CMK becomes unmanageable. For more information, refer to the scenario in the Default Key Policy section in the AWS Key Management Service Developer Guide.
The principal(s) specified in the key policy must exist and be visible to AWS KMS. When you create a new AWS principal (for example, an IAM user or role), you might need to enforce a delay before specifying the new principal in a key policy because the new principal might not immediately be visible to AWS KMS. For more information, see Changes that I make are not always immediately visible in the IAM User Guide.
The policy size limit is 32 KiB (32768 bytes).
boolean
A flag to indicate whether to bypass the key policy lockout safety check.
Use this parameter only when you intend to prevent the principal making the request from making a subsequent PutKeyPolicy request on the CMK.
The default value is false.
None