Repository: ansible/ansible
Pull request: adding 'version_added' field for environment_variables option in lambda.py
##### ISSUE TYPE
 - Docs Pull Request

##### COMPONENT NAME
lib/ansible/modules/cloud/amazon/lambda.py

##### ANSIBLE VERSION
```
ansible 2.3.0 (lambda-env-var-version-added 73eb575753) last updated 2017/02/15 17:35:53 (GMT -400)
  config file =
  configured module search path = Default w/o overrides
```

##### SUMMARY
Adding a version_added field that was forgotten in the commit 22701806c34bb7787e5337b1814b367af7eab211. Fixes #21455 


Problem statement:
Lambda: unsupported parameter for module: environment_variable
<!---
Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release, and master branch are affected too.
-->

##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Documentation Bug Report

##### COMPONENT NAME
<!--- 
```
Lambda module 
```
-->

##### ANSIBLE VERSION
<!--- Paste verbatim output from “ansible --version” between quotes below -->
```
ansible 2.2.1.0

```

##### CONFIGURATION
<!---
Mention any settings you have changed/added/removed in ansible.cfg
(or using the ANSIBLE_* environment variables).
-->

##### OS / ENVIRONMENT
```
macOS Sierra 10.12.2
boto
boto3
python >= 2.6
```

##### SUMMARY
```
When running task to create lambda function, if I add the environment_variables parameter the task fails with msg:
unsupported parameter for module: environment_variables
When I comment the line out it runs fine.
```

##### STEPS TO REPRODUCE
<!---
For bugs, show exactly how to reproduce the problem, using a minimal test-case.
For new features, show how the feature would be used.
-->

<!--- Paste example playbooks or commands between quotes below -->
```yaml
file lambda-create-function.yml

- name: Create lambda function
  hosts: localhost
  gather_facts: false
  tasks:
  - name: Create lambda function
    lambda:
      name: "{{ lambda_name }}"
      description: "{{ lambda_description }}"
      state: 'present'
      timeout: "{{ lambda_timeout }}"
      zip_file: "{{ lambda_zip_file }}"
      runtime: "{{ lambda_runtime }}"
      memory_size: "{{ lambda_memory_size }}"
      handler: "{{ lambda_handler }}"
      role: "{{ lambda_iam_role_arn }}"
      vpc_subnet_ids: "{{ lambda_vpc_subnet_ids }}"
      vpc_security_group_ids: "{{ lambda_vpc_security_group_ids }}"
      environment_variables: "{{ lambda_environment_variables }}"

ansible-playbook lambda-create-function.yml
```

<!--- You can also paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
```
Play should run without errors as it does without the  environment_variables parameter
```

##### ACTUAL RESULTS
```
TASK [Create lambda function] **************************************************
task path: /Users/kmcnally/git/devops-infrastructure/ansible/tasks/lambda-create-function.yml:21
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "unsupported parameter for module: environment_variables"}
```

Hints from issue discussion:
It looks like the environment_variables parameter was added in 2.3 (we're about to enter feature freeze for 2.3).  I'll change this to a documentation bug to make sure that's noted in the module docs.

Commit message: Adding 'version_added' field for environment_variables option

Patch to review:
diff --git a/lib/ansible/modules/cloud/amazon/lambda.py b/lib/ansible/modules/cloud/amazon/lambda.py
index d42999e009470d..729e2de8ec2d6b 100644
--- a/lib/ansible/modules/cloud/amazon/lambda.py
+++ b/lib/ansible/modules/cloud/amazon/lambda.py
@@ -102,6 +102,7 @@
     required: false
     default: None
     aliases: [ 'environment' ]
+    version_added: 2.3
 author:
     - 'Steyn Huizinga (@steynovich)'
 extends_documentation_fragment:


Code review comments:
diff_hunk: @@ -102,6 +102,7 @@
     required: false
     default: None
     aliases: [ 'environment' ]
+    version_added: 2.3
path: lib/ansible/modules/cloud/amazon/lambda.py
text: @user1:
As it should be handled as string, I would quote the version e.g. `version_added: "2.3"`

@author:
Thanks resmo! Quoted it.