From e6bfb02382675b6adc5027d0286f66274287004a Mon Sep 17 00:00:00 2001 From: GomathiselviS Date: Tue, 28 May 2024 13:41:53 -0400 Subject: [PATCH] Update return blocks of cloud* modules --- .../update_return_block_cloud_modules.yml | 3 ++ plugins/modules/cloudtrail.py | 11 ++++ plugins/modules/cloudtrail_info.py | 14 +++++ plugins/modules/cloudwatchevent_rule.py | 51 +++++++++++++++---- plugins/modules/cloudwatchlogs_log_group.py | 32 ++++++++++++ 5 files changed, 102 insertions(+), 9 deletions(-) create mode 100644 changelogs/fragments/update_return_block_cloud_modules.yml diff --git a/changelogs/fragments/update_return_block_cloud_modules.yml b/changelogs/fragments/update_return_block_cloud_modules.yml new file mode 100644 index 00000000000..3bd6806bf0d --- /dev/null +++ b/changelogs/fragments/update_return_block_cloud_modules.yml @@ -0,0 +1,3 @@ +--- +trivial: + - Update return block in the module documentation for cloudtrail, cloudtrail_info, cloudwatchevent_rule, cloudwatchlogs_log_group modules. diff --git a/plugins/modules/cloudtrail.py b/plugins/modules/cloudtrail.py index c39c7f711e1..45c97cc8abd 100644 --- a/plugins/modules/cloudtrail.py +++ b/plugins/modules/cloudtrail.py @@ -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 diff --git a/plugins/modules/cloudtrail_info.py b/plugins/modules/cloudtrail_info.py index 5badea7ebdc..1433aab34fb 100644 --- a/plugins/modules/cloudtrail_info.py +++ b/plugins/modules/cloudtrail_info.py @@ -116,9 +116,23 @@ 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_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. + 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 diff --git a/plugins/modules/cloudwatchevent_rule.py b/plugins/modules/cloudwatchevent_rule.py index 0f516647c8c..1f1bae0aacb 100644 --- a/plugins/modules/cloudwatchevent_rule.py +++ b/plugins/modules/cloudwatchevent_rule.py @@ -166,19 +166,52 @@ RETURN = r""" rule: 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 diff --git a/plugins/modules/cloudwatchlogs_log_group.py b/plugins/modules/cloudwatchlogs_log_group.py index 8fdb3975794..f47fa95ff69 100644 --- a/plugins/modules/cloudwatchlogs_log_group.py +++ b/plugins/modules/cloudwatchlogs_log_group.py @@ -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