Skip to content

Commit

Permalink
Update return blocks of cloud* modules (#2115) (#2241)
Browse files Browse the repository at this point in the history
This is a backport of PR #2115 as merged into main (3d62e43).
SUMMARY


Refer : https://issues.redhat.com/browse/ACA-1476
This PR updates the module documentation with the correct return values for the following modules
cloudtrail, cloudtrail_info, cloudwatchevent_rule, cloudwatchlogs_log_group
ISSUE TYPE


Bugfix Pull Request
Docs Pull Request
Feature Pull Request
New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Mark Chappell
  • Loading branch information
patchback[bot] authored Aug 27, 2024
1 parent 5848197 commit 08cb8b8
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 7 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/update_return_block_cloud_modules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
trivial:
- Update return block in the module documentation for cloudtrail, cloudtrail_info, cloudwatchevent_rule, cloudwatchlogs_log_group modules.
11 changes: 11 additions & 0 deletions plugins/modules/cloudtrail.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,22 @@
returned: success
type: bool
sample: true
is_organization_trail:
description:
- Specifies whether the trail is created for all accounts in an organization in Organizations, or only for the current Amazon Web Services account.
returned: success
type: bool
sample: true
has_custom_event_selectors:
description: Whether any custom event selectors are used for this trail.
returned: success
type: bool
sample: False
has_insight_selectors:
description: Whether any insight selectors are used for this trail.
returned: success
type: bool
sample: False
home_region:
description: The home region where the trail was originally created and must be edited.
returned: success
Expand Down
12 changes: 12 additions & 0 deletions plugins/modules/cloudtrail_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,21 @@
latest_delivery_error:
description: Displays any Amazon S3 error that CloudTrail encountered when attempting to deliver log files to the designated bucket.
type: str
latest_notification_attempt_time:
description: Specifies the date and time that CloudTrail last attempt to deliver a notification.
type: str
latest_notification_attempt_succeeded:
description: Specifies the date and time that CloudTrail last successful attempt to deliver a notification.
type: str
latest_notification_error:
description: Displays any Amazon SNS error that CloudTrail encountered when attempting to send a notification.
type: str
latest_delivery_attempt_succeeded:
description: Specifies the date and time that CloudTrail last successful attempt to deliver log files to an account's Amazon S3 bucket.
type: str
latest_delivery_attempt_time:
description: Specifies the date and time that CloudTrail last attempt to deliver log files to an account's Amazon S3 bucket.
type: str
latest_delivery_time:
description: Specifies the date and time that CloudTrail last delivered log files to an account's Amazon S3 bucket.
type: str
Expand Down
49 changes: 42 additions & 7 deletions plugins/modules/cloudwatchevent_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,52 @@
description: CloudWatch Event rule data.
returned: success
type: dict
sample:
arn: 'arn:aws:events:us-east-1:123456789012:rule/MyCronTask'
description: 'Run my scheduled task'
name: 'MyCronTask'
schedule_expression: 'cron(0 20 * * ? *)'
state: 'ENABLED'
contains:
name:
description:
- The name of the rule you are creating, updating or deleting.
returned: success
type: str
sample: "MyCronTask"
schedule_expression:
description:
- A cron or rate expression that defines the schedule the rule will trigger on.
returned: success
type: str
sample: 'cron(0 20 * * ? *)'
state:
description:
- Whether the rule is present (and enabled), disabled, or absent.
returned: success
type: str
sample: "enabled"
description:
description:
- A description of the rule.
returned: success
type: str
sample: "Run my scheduled task"
arn:
description: The ARN associated with the rule.
type: str
returned: success
sample: 'arn:aws:events:us-east-1:123456789012:rule/MyCronTask'
targets:
description: CloudWatch Event target(s) assigned to the rule.
returned: success
type: list
sample: "[{ 'arn': 'arn:aws:lambda:us-east-1:123456789012:function:MyFunction', 'id': 'MyTargetId' }]"
elements: dict
contains:
id:
description: The unique target assignment ID.
type: str
returned: success
sample: 'MyTargetId'
arn:
description: The ARN associated with the target.
type: str
returned: success
sample: 'arn:aws:lambda:us-east-1:123456789012:function:MyFunction'
"""

import json
Expand Down
32 changes: 32 additions & 0 deletions plugins/modules/cloudwatchlogs_log_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,38 @@
"""

RETURN = r"""
log_group_name:
description: The name of the log group.
returned: always
type: str
creation_time:
description: The creation time of the log group.
returned: always
type: int
retention_in_days:
description: The number of days to retain the log events in the specified log group.
returned: always
type: int
metric_filter_count:
description: The number of metric filters.
returned: always
type: int
arn:
description: The Amazon Resource Name (ARN) of the log group.
returned: always
type: str
stored_bytes:
description: The number of bytes stored.
returned: always
type: str
kms_key_id:
description: The Amazon Resource Name (ARN) of the CMK to use when encrypting log data.
returned: always
type: str
tags:
description: A dictionary representing the tags on the log group.
returned: always
type: dict
log_groups:
description: Return the list of complex objects representing log groups
returned: success
Expand Down

0 comments on commit 08cb8b8

Please sign in to comment.