Skip to content

Commit

Permalink
Update return block - kms_key, kms_key_info (#2144) (#2235)
Browse files Browse the repository at this point in the history
This is a backport of PR #2144 as merged into main (4ffbda3).
SUMMARY

Updated return block of following modules
- kms_key
- kms_key_info


ISSUE TYPE


Docs Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Mark Chappell
  • Loading branch information
patchback[bot] authored Aug 27, 2024
1 parent c264114 commit 17ba9e3
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
trivial:
- Update return block in the module documentation for kms_key, kms_key_info (https://github.com/ansible-collections/amazon.aws/pull/2144).
45 changes: 33 additions & 12 deletions plugins/modules/kms_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,37 +217,37 @@
description: ID of key.
type: str
returned: always
sample: abcd1234-abcd-1234-5678-ef1234567890
sample: "abcd1234-abcd-1234-5678-ef1234567890"
key_arn:
description: ARN of key.
type: str
returned: always
sample: arn:aws:kms:ap-southeast-2:123456789012:key/abcd1234-abcd-1234-5678-ef1234567890
sample: "arn:aws:kms:ap-southeast-2:123456789012:key/abcd1234-abcd-1234-5678-ef1234567890"
key_state:
description:
- The state of the key.
- Will be one of C('Creating'), C('Enabled'), C('Disabled'), C('PendingDeletion'), C('PendingImport'),
C('PendingReplicaDeletion'), C('Unavailable'), or C('Updating').
type: str
returned: always
sample: PendingDeletion
sample: "PendingDeletion"
key_usage:
description: The cryptographic operations for which you can use the key.
type: str
returned: always
sample: ENCRYPT_DECRYPT
sample: "ENCRYPT_DECRYPT"
origin:
description: The source of the key's key material. When this value is C(AWS_KMS),
AWS KMS created the key material. When this value is C(EXTERNAL), the
key material was imported or the CMK lacks key material.
type: str
returned: always
sample: AWS_KMS
sample: "AWS_KMS"
aws_account_id:
description: The AWS Account ID that the key belongs to.
type: str
returned: always
sample: 1234567890123
sample: "1234567890123"
creation_date:
description: Date and time of creation of the key.
type: str
Expand Down Expand Up @@ -349,27 +349,27 @@
description: The unique ID for the grant.
type: str
returned: always
sample: abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234
sample: "abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234"
grantee_principal:
description: The principal that receives the grant's permissions.
type: str
returned: always
sample: arn:aws:sts::123456789012:assumed-role/lambda_xyz/xyz
sample: "arn:aws:sts::123456789012:assumed-role/lambda_xyz/xyz"
issuing_account:
description: The AWS account under which the grant was issued.
type: str
returned: always
sample: arn:aws:iam::123456789012:root
sample: "arn:aws:iam::123456789012:root"
key_id:
description: The key ARN to which the grant applies.
type: str
returned: always
sample: arn:aws:kms:ap-southeast-2:123456789012:key/abcd1234-abcd-1234-5678-ef1234567890
sample: "arn:aws:kms:ap-southeast-2:123456789012:key/abcd1234-abcd-1234-5678-ef1234567890"
name:
description: The friendly name that identifies the grant.
type: str
returned: always
sample: xyz
sample: "xyz"
operations:
description: The list of operations permitted by the grant.
type: list
Expand All @@ -381,7 +381,7 @@
description: The principal that can retire the grant.
type: str
returned: always
sample: arn:aws:sts::123456789012:assumed-role/lambda_xyz/xyz
sample: "arn:aws:sts::123456789012:assumed-role/lambda_xyz/xyz"
changes_needed:
description: Grant types that would be changed/were changed.
type: dict
Expand All @@ -399,6 +399,27 @@
version_added: 5.5.0
returned: always
sample: False
customer_master_key_spec:
description: Specifies the type of KMS key to create.
type: str
returned: always
sample: "SYMMETRIC_DEFAULT"
encryption_algorithms:
description: The encryption algorithms that the KMS key supports.
type: list
elements: str
returned: always
sample: ["SYMMETRIC_DEFAULT"]
key_manager:
description: The manager of the KMS key.
type: str
returned: always
sample: "AWS"
key_spec:
description: Specifies the type of KMS key to create.
type: str
returned: always
sample: "SYMMETRIC_DEFAULT"
"""

import json
Expand Down
60 changes: 44 additions & 16 deletions plugins/modules/kms_key_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,37 +84,47 @@
description: ID of key.
type: str
returned: always
sample: abcd1234-abcd-1234-5678-ef1234567890
sample: "abcd1234-abcd-1234-5678-ef1234567890"
key_arn:
description: ARN of key.
type: str
returned: always
sample: arn:aws:kms:ap-southeast-2:123456789012:key/abcd1234-abcd-1234-5678-ef1234567890
sample: "arn:aws:kms:ap-southeast-2:123456789012:key/abcd1234-abcd-1234-5678-ef1234567890"
key_manager:
description: The manager of the KMS key.
type: str
returned: always
sample: "AWS"
key_spec:
description: Specifies the type of KMS key to create.
type: str
returned: always
sample: "SYMMETRIC_DEFAULT"
key_state:
description:
- The state of the key.
- Will be one of C('Creating'), C('Enabled'), C('Disabled'), C('PendingDeletion'), C('PendingImport'),
C('PendingReplicaDeletion'), C('Unavailable'), or C('Updating').
type: str
returned: always
sample: PendingDeletion
sample: "PendingDeletion"
key_usage:
description: The cryptographic operations for which you can use the key.
type: str
returned: always
sample: ENCRYPT_DECRYPT
sample: "ENCRYPT_DECRYPT"
origin:
description: The source of the key's key material. When this value is C(AWS_KMS),
AWS KMS created the key material. When this value is C(EXTERNAL), the
key material was imported or the CMK lacks key material.
type: str
returned: always
sample: AWS_KMS
sample: "AWS_KMS"
aws_account_id:
description: The AWS Account ID that the key belongs to.
type: str
returned: always
sample: 123456789012
sample: "123456789012"
creation_date:
description: Date and time of creation of the key.
type: str
Expand Down Expand Up @@ -143,7 +153,7 @@
returned: always
sample: false
aliases:
description: list of aliases associated with the key.
description: List of aliases associated with the key.
type: list
returned: always
sample:
Expand Down Expand Up @@ -216,39 +226,57 @@
description: The unique ID for the grant.
type: str
returned: always
sample: abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234
sample: "abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234"
grantee_principal:
description: The principal that receives the grant's permissions.
type: str
returned: always
sample: arn:aws:sts::123456789012:assumed-role/lambda_xyz/xyz
sample: "arn:aws:sts::123456789012:assumed-role/lambda_xyz/xyz"
issuing_account:
description: The AWS account under which the grant was issued.
type: str
returned: always
sample: arn:aws:iam::123456789012:root
sample: "arn:aws:iam::123456789012:root"
key_id:
description: The key ARN to which the grant applies.
type: str
returned: always
sample: arn:aws:kms:ap-southeast-2:123456789012:key/abcd1234-abcd-1234-5678-ef1234567890
sample: "arn:aws:kms:ap-southeast-2:123456789012:key/abcd1234-abcd-1234-5678-ef1234567890"
name:
description: The friendly name that identifies the grant.
type: str
returned: always
sample: xyz
sample: "xyz"
operations:
description: The list of operations permitted by the grant.
type: list
elements: str
returned: always
sample:
- Decrypt
- RetireGrant
sample: [
"Decrypt",
"GenerateDataKey"
]
retiring_principal:
description: The principal that can retire the grant.
type: str
returned: always
sample: arn:aws:sts::123456789012:assumed-role/lambda_xyz/xyz
sample: "arn:aws:sts::123456789012:assumed-role/lambda_xyz/xyz"
customer_master_key_spec:
description: Describes the type of key material in the KMS key.
type: str
returned: always
sample: "SYMMETRIC_DEFAULT"
encryption_algorithms:
description: The encryption algorithms that the KMS key supports.
type: list
elements: str
returned: always
sample: ["SYMMETRIC_DEFAULT"]
multi_region:
description: Indicates whether the KMS key is a multi-Region (True) or regional (False) key.
type: bool
returned: always
sample: false
"""

import json
Expand Down

0 comments on commit 17ba9e3

Please sign in to comment.