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-sqs-with-sse-disabled.md.
A documentation index is available at /llms.txt.
SQS queues must have server-side encryption (SSE) enabled to protect message contents at rest and in backups. This reduces the risk of exposing sensitive data if someone accesses the underlying storage or compromises credentials.
In Ansible, tasks using the community.aws.sqs_queue or sqs_queue modules must define the kms_master_key_id property and set it to a valid KMS key identifier (for example, a KMS ARN, key ID, or alias) to enable KMS-backed SSE. Resources missing this property or with it undefined/empty are flagged. Using a customer-managed KMS key (ARN or key ID) is recommended for granular access control and auditability, though the AWS-managed alias (alias/aws/sqs) can be used if customer-managed keys are not required.
- name:Configure Encryption, automatically uses a new data key every hourcommunity.aws.sqs_queue:name:fifo-queueregion:ap-southeast-2kms_master_key_id:alias/MyQueueKeykms_data_key_reuse_period_seconds:3600- name:Delete SQS queuecommunity.aws.sqs_queue:name:my-queueregion:ap-southeast-2state:absent