Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for FunctionResponseTypes in lambda_event module #1081

Closed
1 task done
sethernet opened this issue Sep 1, 2022 · 2 comments · Fixed by #1209
Closed
1 task done

Add support for FunctionResponseTypes in lambda_event module #1081

sethernet opened this issue Sep 1, 2022 · 2 comments · Fixed by #1209
Assignees
Labels
feature This issue/PR relates to a feature request jira module module plugins plugin (any type) waiting_on_contributor Needs help. Feel free to engage to get things unblocked

Comments

@sethernet
Copy link

Summary

Please add support to set FunctionResponseTypes when creating lambda event source mappings

https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#API_CreateEventSourceMapping_RequestSyntax

Issue Type

Feature Idea

Component Name

lambda_event

Additional Information

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request module module needs_triage plugins plugin (any type) labels Sep 1, 2022
@alinabuzachis alinabuzachis transferred this issue from ansible-collections/community.aws Sep 28, 2022
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Sep 30, 2022
…le-collections#1081)

rds_instance - add snapshot tests, update docs, refactor tests

Depends-On: ansible-collections#776
Depends-On: ansible-collections#1105
SUMMARY

add snapshot tests to test restoring db from snapshot and fix bugs associated
fix some typos in documentation and remove duplicate parameter (added as alias so no breaking change)
remove unused IAM role in tests and add some missing cleanups

ISSUE TYPE

Bugfix Pull Request
Feature Pull Request

COMPONENT NAME
rds_instance
ADDITIONAL INFORMATION
this module had both db_snapshot_identifier and snapshot_identifier as separate params, with the latter being required to restore from snapshot, resulting in some parameter missing errors. moving snapshot_identifier as an alias of db_snapshot_identifier fixes this issue.

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Joseph Torcasso <None>
Reviewed-by: Mark Chappell <None>
Reviewed-by: Sloane Hertel <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@5d5bca9
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Sep 30, 2022
…le-collections#1081)

rds_instance - add snapshot tests, update docs, refactor tests

Depends-On: ansible-collections#776
Depends-On: ansible-collections#1105
SUMMARY

add snapshot tests to test restoring db from snapshot and fix bugs associated
fix some typos in documentation and remove duplicate parameter (added as alias so no breaking change)
remove unused IAM role in tests and add some missing cleanups

ISSUE TYPE

Bugfix Pull Request
Feature Pull Request

COMPONENT NAME
rds_instance
ADDITIONAL INFORMATION
this module had both db_snapshot_identifier and snapshot_identifier as separate params, with the latter being required to restore from snapshot, resulting in some parameter missing errors. moving snapshot_identifier as an alias of db_snapshot_identifier fixes this issue.

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Joseph Torcasso <None>
Reviewed-by: Mark Chappell <None>
Reviewed-by: Sloane Hertel <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@5d5bca9
@goneri goneri added waiting_on_contributor Needs help. Feel free to engage to get things unblocked and removed needs_triage labels Oct 11, 2022
@mandar242 mandar242 self-assigned this Oct 26, 2022
@mandar242 mandar242 added the jira label Oct 26, 2022
softwarefactory-project-zuul bot pushed a commit that referenced this issue Nov 16, 2022
lambda_event: Add support for FunctionResponseTypes

SUMMARY

Resolves #1081
Added support to set FunctionResponseTypes when creating lambda event source mappings

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

lambda_event
ADDITIONAL INFORMATION


Can be tested using below playbook (needs a dynamo db table and lambda function with appropriate access/policy/role)

---
- name: lambda_event
  hosts: localhost
  gather_facts: false
  tasks:
    - name: Create DynamoDB stream event mapping (trigger)
      amazon.aws.lambda_event:
        state: present
        event_source: stream
        function_name: my-test-function
        source_params:
          source_arn: arn:aws:dynamodb:us-east-2:721234567890:table/my-test-table/stream/2022-10-26T17:55:25.232
          enabled: True
          batch_size: 500
          starting_position: LATEST
          function_response_types:
            - ReportBatchItemFailures
      register: event

    - name: Get info on above trigger
      command: 'aws lambda get-event-source-mapping --uuid {{ event.events.uuid }}'
      environment:
        AWS_ACCESS_KEY_ID: "{{ aws_access_key }}"
        AWS_SECRET_ACCESS_KEY: "{{ aws_secret_key }}"
        AWS_SESSION_TOKEN: "{{ security_token | default('') }}"
        AWS_DEFAULT_REGION: "{{ aws_region }}"
      register: my_function_details

    - name: convert it to an object
      set_fact:
        my_function_details_obj: "{{ my_function_details.stdout | from_json }}"

    - assert:
        that:
          - my_function_details_obj.FunctionResponseTypes is defined
          - my_function_details_obj.FunctionResponseTypes | length > 0
          - my_function_details_obj.FunctionResponseTypes[0] == "ReportBatchItemFailures"

Reviewed-by: Bikouo Aubin <None>
Reviewed-by: Mike Graves <[email protected]>
Reviewed-by: Mandar Kulkarni <[email protected]>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Gonéri Le Bouder <[email protected]>
Reviewed-by: GomathiselviS <None>
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this issue Apr 27, 2023
…ons#1209)

lambda_event: Add support for FunctionResponseTypes

SUMMARY

Resolves ansible-collections#1081
Added support to set FunctionResponseTypes when creating lambda event source mappings

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

lambda_event
ADDITIONAL INFORMATION


Can be tested using below playbook (needs a dynamo db table and lambda function with appropriate access/policy/role)

---
- name: lambda_event
  hosts: localhost
  gather_facts: false
  tasks:
    - name: Create DynamoDB stream event mapping (trigger)
      amazon.aws.lambda_event:
        state: present
        event_source: stream
        function_name: my-test-function
        source_params:
          source_arn: arn:aws:dynamodb:us-east-2:721234567890:table/my-test-table/stream/2022-10-26T17:55:25.232
          enabled: True
          batch_size: 500
          starting_position: LATEST
          function_response_types:
            - ReportBatchItemFailures
      register: event

    - name: Get info on above trigger
      command: 'aws lambda get-event-source-mapping --uuid {{ event.events.uuid }}'
      environment:
        AWS_ACCESS_KEY_ID: "{{ aws_access_key }}"
        AWS_SECRET_ACCESS_KEY: "{{ aws_secret_key }}"
        AWS_SESSION_TOKEN: "{{ security_token | default('') }}"
        AWS_DEFAULT_REGION: "{{ aws_region }}"
      register: my_function_details

    - name: convert it to an object
      set_fact:
        my_function_details_obj: "{{ my_function_details.stdout | from_json }}"

    - assert:
        that:
          - my_function_details_obj.FunctionResponseTypes is defined
          - my_function_details_obj.FunctionResponseTypes | length > 0
          - my_function_details_obj.FunctionResponseTypes[0] == "ReportBatchItemFailures"

Reviewed-by: Bikouo Aubin <None>
Reviewed-by: Mike Graves <[email protected]>
Reviewed-by: Mandar Kulkarni <[email protected]>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Gonéri Le Bouder <[email protected]>
Reviewed-by: GomathiselviS <None>
softwarefactory-project-zuul bot pushed a commit that referenced this issue Apr 28, 2023
[manual backport stable-5] lambda_event: Add support for FunctionResponseTypes (#1209)

lambda_event: Add support for FunctionResponseTypes
SUMMARY
Resolves #1081
Added support to set FunctionResponseTypes when creating lambda event source mappings
ISSUE TYPE
Feature Pull Request
COMPONENT NAME
lambda_event
ADDITIONAL INFORMATION
Can be tested using below playbook (needs a dynamo db table and lambda function with appropriate access/policy/role)



name: lambda_event hosts: localhost gather_facts: false tasks: - name: Create DynamoDB stream event mapping (trigger) amazon.aws.lambda_event: state: present event_source: stream function_name: my-test-function source_params: source_arn: arn:aws:dynamodb:us-east-2:721234567890:table/my-test-table/stream/2022-10-26T17:55:25.232 enabled: True batch_size: 500 starting_position: LATEST function_response_types: - ReportBatchItemFailures register: event


name: Get info on above trigger
command: 'aws lambda get-event-source-mapping --uuid {{ event.events.uuid }}'
environment:
AWS_ACCESS_KEY_ID: "{{ aws_access_key }}"
AWS_SECRET_ACCESS_KEY: "{{ aws_secret_key }}"
AWS_SESSION_TOKEN: "{{ security_token | default('') }}"
AWS_DEFAULT_REGION: "{{ aws_region }}"
register: my_function_details


name: convert it to an object
set_fact:
my_function_details_obj: "{{ my_function_details.stdout | from_json }}"


assert:
that:
- my_function_details_obj.FunctionResponseTypes is defined
- my_function_details_obj.FunctionResponseTypes | length > 0 - my_function_details_obj.FunctionResponseTypes[0] == "ReportBatchItemFailures"




Reviewed-by: Bikouo Aubin 
Reviewed-by: Mike Graves [email protected]
Reviewed-by: Mandar Kulkarni [email protected]
Reviewed-by: Alina Buzachis 
Reviewed-by: Gonéri Le Bouder [email protected]
Reviewed-by: GomathiselviS 
SUMMARY


ISSUE TYPE


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

COMPONENT NAME

ADDITIONAL INFORMATION
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Sep 18, 2023
…le-collections#1081)

rds_instance - add snapshot tests, update docs, refactor tests

Depends-On: ansible-collections#776
Depends-On: ansible-collections#1105
SUMMARY

add snapshot tests to test restoring db from snapshot and fix bugs associated
fix some typos in documentation and remove duplicate parameter (added as alias so no breaking change)
remove unused IAM role in tests and add some missing cleanups

ISSUE TYPE

Bugfix Pull Request
Feature Pull Request

COMPONENT NAME
rds_instance
ADDITIONAL INFORMATION
this module had both db_snapshot_identifier and snapshot_identifier as separate params, with the latter being required to restore from snapshot, resulting in some parameter missing errors. moving snapshot_identifier as an alias of db_snapshot_identifier fixes this issue.

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Joseph Torcasso <None>
Reviewed-by: Mark Chappell <None>
Reviewed-by: Sloane Hertel <None>
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Sep 18, 2023
…le-collections#1081)

rds_instance - add snapshot tests, update docs, refactor tests

Depends-On: ansible-collections#776
Depends-On: ansible-collections#1105
SUMMARY

add snapshot tests to test restoring db from snapshot and fix bugs associated
fix some typos in documentation and remove duplicate parameter (added as alias so no breaking change)
remove unused IAM role in tests and add some missing cleanups

ISSUE TYPE

Bugfix Pull Request
Feature Pull Request

COMPONENT NAME
rds_instance
ADDITIONAL INFORMATION
this module had both db_snapshot_identifier and snapshot_identifier as separate params, with the latter being required to restore from snapshot, resulting in some parameter missing errors. moving snapshot_identifier as an alias of db_snapshot_identifier fixes this issue.

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Joseph Torcasso <None>
Reviewed-by: Mark Chappell <None>
Reviewed-by: Sloane Hertel <None>
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Oct 24, 2023
…le-collections#1081)

rds_instance - add snapshot tests, update docs, refactor tests

Depends-On: ansible-collections#776
Depends-On: ansible-collections#1105
SUMMARY

add snapshot tests to test restoring db from snapshot and fix bugs associated
fix some typos in documentation and remove duplicate parameter (added as alias so no breaking change)
remove unused IAM role in tests and add some missing cleanups

ISSUE TYPE

Bugfix Pull Request
Feature Pull Request

COMPONENT NAME
rds_instance
ADDITIONAL INFORMATION
this module had both db_snapshot_identifier and snapshot_identifier as separate params, with the latter being required to restore from snapshot, resulting in some parameter missing errors. moving snapshot_identifier as an alias of db_snapshot_identifier fixes this issue.

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Joseph Torcasso <None>
Reviewed-by: Mark Chappell <None>
Reviewed-by: Sloane Hertel <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request jira module module plugins plugin (any type) waiting_on_contributor Needs help. Feel free to engage to get things unblocked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants