For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/ansible-aws-lambda-functions-without-x-ray-tracing.md.
A documentation index is available at /llms.txt.
Lambda functions should have active AWS X-Ray tracing enabled to provide end-to-end request visibility and help detect performance problems and security incidents. For Ansible amazon.aws.lambda or lambda module tasks, the tracing_mode property must be defined and set to Active. Tasks that omit tracing_mode or set it to any value other than Active are flagged.
Secure Ansible example:
- name:Create Lambda with active X-Ray tracingamazon.aws.lambda:name:my_lambda_functionstate:presentruntime:python3.9handler:app.handlertracing_mode:Active