Skip to content

Commit

Permalink
Update return block for lambda modules (ansible-collections#2132)
Browse files Browse the repository at this point in the history
SUMMARY


This  PR updates the return blocks for lambda modules.
Refer:  https://issues.redhat.com/browse/ACA-1478
ISSUE TYPE


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

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis
Reviewed-by: Bikouo Aubin
Reviewed-by: Mike Graves <[email protected]>
Reviewed-by: Mark Chappell
  • Loading branch information
GomathiselviS authored and alinabuzachis committed Jun 26, 2024
1 parent 005e3b6 commit 7edc0ef
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 8 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/update_return_block_lambda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
trivial:
- Update return block in the module documentation for lambda_event, lambda_info, lambda_layer, lambda_policy
105 changes: 102 additions & 3 deletions plugins/modules/lambda_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,109 @@

RETURN = r"""
---
lambda_stream_events:
description: list of dictionaries returned by the API describing stream event mappings
events:
description: Dictionary returned by the API describing stream event mappings
returned: success
type: list
type: dict
contains:
batch_size:
description: The maximum number of records in each batch that Lambda pulls.
type: int
returned: always
bisect_batch_on_function_error:
description: If the function returns an error, split the batch in two and retry.
type: bool
returned: for Kinesis and DynamoDB Streams only
sample: false
destination_config:
description: Configuration object that specifies the destination of an event after Lambda processes it.
type: dict
returned: For Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Kafka only
contains:
on_failure:
description: The destination configuration for failed invocations.
type: dict
contains:
destination:
description: Destination resource ARN.
type: str
on_success:
description: The destination configuration for failed invocations.
type: dict
contains:
destination:
description: Destination resource ARN.
type: str
event_source_arn:
description: The Amazon Resource Name (ARN) of the event source.
type: str
returned: always
sample: "arn:aws:dynamodb:us-west-2:123456789012:table/yyyy/stream/2024-06-06T07:03:58.956"
function_arn:
description: The ARN of the Lambda function.
type: str
returned: always
sample: "arn:aws:lambda:us-west-2:123456789012:function:test-lambda-3a0a29d0dbb5:1"
function_response_types:
description: A list of current response type enums applied to the event source mapping.
type: list
returned: For Kinesis, DynamoDB Streams, and Amazon SQS
sample: ["ReportBatchItemFailures"]
last_modified:
description: The date that the event source mapping was last updated or that its state changed.
type: str
returned: always
sample: "2024-06-06T12:34:21.990000+05:30"
last_processing_result:
description: The result of the last Lambda invocation of your function.
type: str
returned: always
sample: "No records processed"
maximum_batching_window_in_seconds:
description: The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.
type: int
returned: always
sample: 1
maximum_record_age_in_seconds:
description: Discard records older than the specified age. The default value is infinite (-1).
type: int
returned: For Kinesis and DynamoDB Streams only
sample: -1
maximum_retry_attempts:
description: Discard records after the specified number of retries.
type: int
returned: For Kinesis and DynamoDB Streams only
sample: -1
parallelization_factor:
description: The number of batches to process concurrently from each shard.
type: int
returned: For Kinesis and DynamoDB Streams only
sample: 1
starting_position:
description: The position in a stream from which to start reading.
type: str
returned: For Kinesis and DynamoDB Streams only
sample: "LATEST"
state:
description: The state of the event source mapping.
type: str
returned: always
sample: "deleting"
state_transition_reason:
description: Indicates whether a user or Lambda made the last change to the event source mapping.
type: str
returned: always
sample: "USER_INITIATED"
tumbling_window_in_seconds:
description: The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources.
type: int
returned: For Kinesis and DynamoDB Streams only
sample: 1
uuid:
description: The identifier of the event source mapping.
type: str
returned: always
sample: "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE"
"""

import copy
Expand Down
37 changes: 37 additions & 0 deletions plugins/modules/lambda_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,15 @@
returned: success
type: str
sample: 'My function'
ephermal_storage:
description: The size of the function /tmp directory in MB.
type: dict
contains:
size:
description: The size of the function /tmp directory.
type: int
returned: always
sample: 512
environment:
description: The function's environment variables.
returned: when environment variables exist
Expand Down Expand Up @@ -211,6 +220,11 @@
returned: on success
type: int
sample: 128
package_type:
description: The type of deployment package.
type: str
returned: always
sample: "Zip"
policy:
description: The policy associated with the function.
returned: when C(query) is I(all) or I(policy)
Expand All @@ -230,6 +244,29 @@
returned: on success
type: str
sample: 'nodejs6.10'
runtime_version_config:
description: The ARN of the runtime and any errors that occured.
type: dict
contains:
runtime_version_arn:
description: The ARN of the runtime version you want the function to use.
type: str
returned: always
sample: "arn:aws:lambda:us-west-2::runtime:123456789012"
snap_start:
description: Snapshot of the initialized execution environment when you publish a function version.
type: dict
contains:
apply_on:
description: When set to V(PublishedVersions), Lambda creates a snapshot of the execution environment when you publish a function version.
type: str
sample: "None"
returned: always
optimization_status:
description: This element indicates whether SnapStart is activated for the specified function version.
type: str
returned: always
sample: "Off"
tracing_config:
description: The function's AWS X-Ray tracing configuration.
returned: on success
Expand Down
10 changes: 5 additions & 5 deletions plugins/modules/lambda_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@
description: The description of the version.
returned: I(state=present)
type: str
compatible_runtimes:
description: A list of compatible runtimes.
returned: if it was defined for the layer version.
type: list
sample: ["python3.7"]
created_date:
description: The date that the layer version was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
returned: if the layer version exists or has been created
Expand All @@ -203,11 +208,6 @@
returned: if the layer version exists or has been created
type: int
sample: 1
compatible_runtimes:
description: A list of compatible runtimes.
returned: if it was defined for the layer version.
type: list
sample: ["python3.7"]
license_info:
description: The layer's software license.
returned: if it was defined for the layer version.
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/lambda_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
description: describes what action was taken
returned: success
type: str
sample: "added"
"""

import json
Expand Down

0 comments on commit 7edc0ef

Please sign in to comment.