1.. _community.aws.lambda_facts_module: 2 3 4************************** 5community.aws.lambda_facts 6************************** 7 8**Gathers AWS Lambda function details as Ansible facts** 9 10 11Version added: 1.0.0 12 13.. contents:: 14 :local: 15 :depth: 1 16 17DEPRECATED 18---------- 19:Removed in collection release after 2021-12-01 20:Why: Deprecated in favour of ``_info`` module. 21:Alternative: Use :ref:`community.aws.lambda_info <community.aws.lambda_info_module>` instead. 22 23 24 25Synopsis 26-------- 27- Gathers various details related to Lambda functions, including aliases, versions and event source mappings. Use module :ref:`community.aws.lambda <community.aws.lambda_module>` to manage the lambda function itself, :ref:`community.aws.lambda_alias <community.aws.lambda_alias_module>` to manage function aliases and :ref:`community.aws.lambda_event <community.aws.lambda_event_module>` to manage lambda event source mappings. 28 29 30 31Requirements 32------------ 33The below requirements are needed on the host that executes this module. 34 35- boto 36- boto3 37- python >= 2.6 38 39 40Parameters 41---------- 42 43.. raw:: html 44 45 <table border=0 cellpadding=0 class="documentation-table"> 46 <tr> 47 <th colspan="1">Parameter</th> 48 <th>Choices/<font color="blue">Defaults</font></th> 49 <th width="100%">Comments</th> 50 </tr> 51 <tr> 52 <td colspan="1"> 53 <div class="ansibleOptionAnchor" id="parameter-"></div> 54 <b>aws_access_key</b> 55 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> 56 <div style="font-size: small"> 57 <span style="color: purple">string</span> 58 </div> 59 </td> 60 <td> 61 </td> 62 <td> 63 <div>AWS access key. If not set then the value of the AWS_ACCESS_KEY_ID, AWS_ACCESS_KEY or EC2_ACCESS_KEY environment variable is used.</div> 64 <div>If <em>profile</em> is set this parameter is ignored.</div> 65 <div>Passing the <em>aws_access_key</em> and <em>profile</em> options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.</div> 66 <div style="font-size: small; color: darkgreen"><br/>aliases: ec2_access_key, access_key</div> 67 </td> 68 </tr> 69 <tr> 70 <td colspan="1"> 71 <div class="ansibleOptionAnchor" id="parameter-"></div> 72 <b>aws_ca_bundle</b> 73 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> 74 <div style="font-size: small"> 75 <span style="color: purple">path</span> 76 </div> 77 </td> 78 <td> 79 </td> 80 <td> 81 <div>The location of a CA Bundle to use when validating SSL certificates.</div> 82 <div>Only used for boto3 based modules.</div> 83 <div>Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally.</div> 84 </td> 85 </tr> 86 <tr> 87 <td colspan="1"> 88 <div class="ansibleOptionAnchor" id="parameter-"></div> 89 <b>aws_config</b> 90 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> 91 <div style="font-size: small"> 92 <span style="color: purple">dictionary</span> 93 </div> 94 </td> 95 <td> 96 </td> 97 <td> 98 <div>A dictionary to modify the botocore configuration.</div> 99 <div>Parameters can be found at <a href='https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config'>https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config</a>.</div> 100 <div>Only the 'user_agent' key is used for boto modules. See <a href='http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto'>http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto</a> for more boto configuration.</div> 101 </td> 102 </tr> 103 <tr> 104 <td colspan="1"> 105 <div class="ansibleOptionAnchor" id="parameter-"></div> 106 <b>aws_secret_key</b> 107 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> 108 <div style="font-size: small"> 109 <span style="color: purple">string</span> 110 </div> 111 </td> 112 <td> 113 </td> 114 <td> 115 <div>AWS secret key. If not set then the value of the AWS_SECRET_ACCESS_KEY, AWS_SECRET_KEY, or EC2_SECRET_KEY environment variable is used.</div> 116 <div>If <em>profile</em> is set this parameter is ignored.</div> 117 <div>Passing the <em>aws_secret_key</em> and <em>profile</em> options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.</div> 118 <div style="font-size: small; color: darkgreen"><br/>aliases: ec2_secret_key, secret_key</div> 119 </td> 120 </tr> 121 <tr> 122 <td colspan="1"> 123 <div class="ansibleOptionAnchor" id="parameter-"></div> 124 <b>debug_botocore_endpoint_logs</b> 125 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> 126 <div style="font-size: small"> 127 <span style="color: purple">boolean</span> 128 </div> 129 </td> 130 <td> 131 <ul style="margin: 0; padding: 0"><b>Choices:</b> 132 <li><div style="color: blue"><b>no</b> ←</div></li> 133 <li>yes</li> 134 </ul> 135 </td> 136 <td> 137 <div>Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource_actions key in the task results. Use the aws_resource_action callback to output to total list made during a playbook. The ANSIBLE_DEBUG_BOTOCORE_LOGS environment variable may also be used.</div> 138 </td> 139 </tr> 140 <tr> 141 <td colspan="1"> 142 <div class="ansibleOptionAnchor" id="parameter-"></div> 143 <b>ec2_url</b> 144 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> 145 <div style="font-size: small"> 146 <span style="color: purple">string</span> 147 </div> 148 </td> 149 <td> 150 </td> 151 <td> 152 <div>Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2_URL environment variable, if any, is used.</div> 153 <div style="font-size: small; color: darkgreen"><br/>aliases: aws_endpoint_url, endpoint_url</div> 154 </td> 155 </tr> 156 <tr> 157 <td colspan="1"> 158 <div class="ansibleOptionAnchor" id="parameter-"></div> 159 <b>event_source_arn</b> 160 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> 161 <div style="font-size: small"> 162 <span style="color: purple">string</span> 163 </div> 164 </td> 165 <td> 166 </td> 167 <td> 168 <div>For query type 'mappings', this is the Amazon Resource Name (ARN) of the Amazon Kinesis or DynamoDB stream.</div> 169 </td> 170 </tr> 171 <tr> 172 <td colspan="1"> 173 <div class="ansibleOptionAnchor" id="parameter-"></div> 174 <b>function_name</b> 175 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> 176 <div style="font-size: small"> 177 <span style="color: purple">string</span> 178 </div> 179 </td> 180 <td> 181 </td> 182 <td> 183 <div>The name of the lambda function for which facts are requested.</div> 184 <div style="font-size: small; color: darkgreen"><br/>aliases: function, name</div> 185 </td> 186 </tr> 187 <tr> 188 <td colspan="1"> 189 <div class="ansibleOptionAnchor" id="parameter-"></div> 190 <b>profile</b> 191 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> 192 <div style="font-size: small"> 193 <span style="color: purple">string</span> 194 </div> 195 </td> 196 <td> 197 </td> 198 <td> 199 <div>Uses a boto profile. Only works with boto >= 2.24.0.</div> 200 <div>Using <em>profile</em> will override <em>aws_access_key</em>, <em>aws_secret_key</em> and <em>security_token</em> and support for passing them at the same time as <em>profile</em> has been deprecated.</div> 201 <div><em>aws_access_key</em>, <em>aws_secret_key</em> and <em>security_token</em> will be made mutually exclusive with <em>profile</em> after 2022-06-01.</div> 202 <div style="font-size: small; color: darkgreen"><br/>aliases: aws_profile</div> 203 </td> 204 </tr> 205 <tr> 206 <td colspan="1"> 207 <div class="ansibleOptionAnchor" id="parameter-"></div> 208 <b>query</b> 209 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> 210 <div style="font-size: small"> 211 <span style="color: purple">string</span> 212 </div> 213 </td> 214 <td> 215 <ul style="margin: 0; padding: 0"><b>Choices:</b> 216 <li>aliases</li> 217 <li><div style="color: blue"><b>all</b> ←</div></li> 218 <li>config</li> 219 <li>mappings</li> 220 <li>policy</li> 221 <li>versions</li> 222 </ul> 223 </td> 224 <td> 225 <div>Specifies the resource type for which to gather facts. Leave blank to retrieve all facts.</div> 226 </td> 227 </tr> 228 <tr> 229 <td colspan="1"> 230 <div class="ansibleOptionAnchor" id="parameter-"></div> 231 <b>region</b> 232 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> 233 <div style="font-size: small"> 234 <span style="color: purple">string</span> 235 </div> 236 </td> 237 <td> 238 </td> 239 <td> 240 <div>The AWS region to use. If not specified then the value of the AWS_REGION or EC2_REGION environment variable, if any, is used. See <a href='http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region'>http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region</a></div> 241 <div style="font-size: small; color: darkgreen"><br/>aliases: aws_region, ec2_region</div> 242 </td> 243 </tr> 244 <tr> 245 <td colspan="1"> 246 <div class="ansibleOptionAnchor" id="parameter-"></div> 247 <b>security_token</b> 248 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> 249 <div style="font-size: small"> 250 <span style="color: purple">string</span> 251 </div> 252 </td> 253 <td> 254 </td> 255 <td> 256 <div>AWS STS security token. If not set then the value of the AWS_SECURITY_TOKEN or EC2_SECURITY_TOKEN environment variable is used.</div> 257 <div>If <em>profile</em> is set this parameter is ignored.</div> 258 <div>Passing the <em>security_token</em> and <em>profile</em> options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.</div> 259 <div style="font-size: small; color: darkgreen"><br/>aliases: aws_security_token, access_token</div> 260 </td> 261 </tr> 262 <tr> 263 <td colspan="1"> 264 <div class="ansibleOptionAnchor" id="parameter-"></div> 265 <b>validate_certs</b> 266 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> 267 <div style="font-size: small"> 268 <span style="color: purple">boolean</span> 269 </div> 270 </td> 271 <td> 272 <ul style="margin: 0; padding: 0"><b>Choices:</b> 273 <li>no</li> 274 <li><div style="color: blue"><b>yes</b> ←</div></li> 275 </ul> 276 </td> 277 <td> 278 <div>When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0.</div> 279 </td> 280 </tr> 281 </table> 282 <br/> 283 284 285Notes 286----- 287 288.. note:: 289 - If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence ``AWS_URL`` or ``EC2_URL``, ``AWS_PROFILE`` or ``AWS_DEFAULT_PROFILE``, ``AWS_ACCESS_KEY_ID`` or ``AWS_ACCESS_KEY`` or ``EC2_ACCESS_KEY``, ``AWS_SECRET_ACCESS_KEY`` or ``AWS_SECRET_KEY`` or ``EC2_SECRET_KEY``, ``AWS_SECURITY_TOKEN`` or ``EC2_SECURITY_TOKEN``, ``AWS_REGION`` or ``EC2_REGION``, ``AWS_CA_BUNDLE`` 290 - Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See https://boto.readthedocs.io/en/latest/boto_config_tut.html 291 - ``AWS_REGION`` or ``EC2_REGION`` can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file 292 293 294 295Examples 296-------- 297 298.. code-block:: yaml 299 300 --- 301 # Simple example of listing all info for a function 302 - name: List all for a specific function 303 community.aws.lambda_facts: 304 query: all 305 function_name: myFunction 306 register: my_function_details 307 308 # List all versions of a function 309 - name: List function versions 310 community.aws.lambda_facts: 311 query: versions 312 function_name: myFunction 313 register: my_function_versions 314 315 # List all lambda function versions 316 - name: List all function 317 community.aws.lambda_facts: 318 query: all 319 max_items: 20 320 - name: show Lambda facts 321 ansible.builtin.debug: 322 var: lambda_facts 323 324 325 326Return Values 327------------- 328Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module: 329 330.. raw:: html 331 332 <table border=0 cellpadding=0 class="documentation-table"> 333 <tr> 334 <th colspan="1">Key</th> 335 <th>Returned</th> 336 <th width="100%">Description</th> 337 </tr> 338 <tr> 339 <td colspan="1"> 340 <div class="ansibleOptionAnchor" id="return-"></div> 341 <b>lambda_facts</b> 342 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> 343 <div style="font-size: small"> 344 <span style="color: purple">dictionary</span> 345 </div> 346 </td> 347 <td>success</td> 348 <td> 349 <div>lambda facts</div> 350 <br/> 351 </td> 352 </tr> 353 <tr> 354 <td colspan="1"> 355 <div class="ansibleOptionAnchor" id="return-"></div> 356 <b>lambda_facts.function</b> 357 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> 358 <div style="font-size: small"> 359 <span style="color: purple">dictionary</span> 360 </div> 361 </td> 362 <td>success</td> 363 <td> 364 <div>lambda function list</div> 365 <br/> 366 </td> 367 </tr> 368 <tr> 369 <td colspan="1"> 370 <div class="ansibleOptionAnchor" id="return-"></div> 371 <b>lambda_facts.function.TheName</b> 372 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> 373 <div style="font-size: small"> 374 <span style="color: purple">dictionary</span> 375 </div> 376 </td> 377 <td>success</td> 378 <td> 379 <div>lambda function information, including event, mapping, and version information</div> 380 <br/> 381 </td> 382 </tr> 383 </table> 384 <br/><br/> 385 386 387Status 388------ 389 390 391- This module will be removed in version . *[deprecated]* 392- For more information see `DEPRECATED`_. 393 394 395Authors 396~~~~~~~ 397 398- Pierre Jodouin (@pjodouin) 399