Skip to content

Commit

Permalink
update documentation to reflect module changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mandar242 committed Apr 21, 2023
1 parent 54bf720 commit c71fa35
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
56 changes: 56 additions & 0 deletions plugins/modules/ec2_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,40 @@
required: false
default: 0
type: int
reset_create_volume_permission:
description:
- If set to I(true), ec2 snapshot's createVolumePermissions is set to 'private'.
- Mutually exclusive with I(modify_create_volume_permission).
required: false
default: false
type: bool
modify_create_volume_permission:
description:
- If set to I(true), ec2 snapshot's createVolumePermissions is can be modified.
- Mutually exclusive with I(reset_create_volume_permission).
- Must specify I(permission_operation_type) to add or remove createVolumePermissions.
required: false
default: false
type: bool
permission_operation_type:
description:
- Whether to add or remove createVolumePermission.
- Set to I(add) to add permissions and set to I(remove) to remove permissions.
- Must specify either I(user_ids) or I(group_names) to add or remove permissions.
required: false
type: str
group_names:
description:
- The group to be added or removed. The possible value is all.
- Mutually exclusive with I(user_ids).
required: false
type: str
user_ids:
description:
- The account user IDs to be added or removed. The possible value is all.
- Mutually exclusive with I(group_names).
required: false
type: str
author: "Will Thames (@willthames)"
extends_documentation_fragment:
- amazon.aws.common.modules
Expand Down Expand Up @@ -106,6 +140,28 @@
- amazon.aws.ec2_snapshot:
volume_id: vol-abcdef12
last_snapshot_min_age: 60
- name: Reset snapshot createVolumePermission
amazon.aws.ec2_snapshot:
snapshot_id: snap-06a6f641234567890
reset_create_volume_permission: true
- name: Modify snapshot createVolmePermission to add user IDs
amazon.aws.ec2_snapshot:
snapshot_id: snap-06a6f641234567890
modify_create_volume_permission: true
permission_operation_type: add
user_ids:
- '123456789012'
- '098765432109'
- name: Modify snapshot createVolmePermission to remove user ID
amazon.aws.ec2_snapshot:
snapshot_id: snap-06a6f641234567890
modify_create_volume_permission: true
permission_operation_type: remove
user_ids:
- '123456789012'
"""

RETURN = r"""
Expand Down
9 changes: 8 additions & 1 deletion plugins/modules/ec2_snapshot_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@
type: str
returned: always
sample: "arn:aws:kms:ap-southeast-2:123456789012:key/74c9742a-a1b2-45cb-b3fe-abcdef123456"
create_volume_permissions:
description:
- The users and groups that have the permissions for creating volumes from the snapshot.
- The module will return empty list if the create volume permissions on snapshot are 'private'.
type: list
elements: dict
sample: [{"group": "all"}]
next_token_id:
description:
- Contains the value returned from a previous paginated request where C(max_results) was used and the results exceeded the value of that parameter.
Expand Down Expand Up @@ -233,7 +240,7 @@ def build_request_args(snapshot_ids, owner_ids, restorable_by_user_ids, filters,


def get_snapshots(connection, module, request_args):
snapshot_ids = request_args.get("snapshot_ids")
snapshot_ids = request_args.get("SnapshotIds")
try:
snapshots = connection.describe_snapshots(aws_retry=True, **request_args)
except is_boto3_error_code('InvalidSnapshot.NotFound') as e:
Expand Down

0 comments on commit c71fa35

Please sign in to comment.