# aws-sqs-unencrypted-queue

Rule `sonarjs/aws-sqs-unencrypted-queue`. SQS queues should be encrypted

- Source: sonarjs
- Technologies: JavaScript
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 6.2M weekly downloads of presets that enable it
- Trend: +62.1% last quarter
- Rank: #1186 by reach, #487 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `sonarjs/aws-sqs-unencrypted-queue` | yes | no | package `eslint-plugin-sonarjs` | [docs](https://rules.sonarsource.com/javascript/RSPEC-6330/) |

## Code examples

### Correct: the rule accepts this

```js
import { Queue } from 'aws-cdk-lib/aws-sqs';

new Queue(this, 'example', {
    encryption: QueueEncryption.KMS_MANAGED
});
```

```js
import { CfnQueue } from 'aws-cdk-lib/aws-sqs';

const encryptionKey = new Key(this, 'example', {
    enableKeyRotation: true,
});

new CfnQueue(this, 'example', {
    kmsMasterKeyId: encryptionKey.keyId
});
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "sonarjs/aws-sqs-unencrypted-queue": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [SonarJS recommended](https://lintradar.dev/presets/sonarjs-recommended.md) | ESLint | `eslint-plugin-sonarjs` | 230 | 6.2M | +62.1% |

## Related rules

- [sonarjs/aws-sns-unencrypted-topics](https://lintradar.dev/rules/sonarjs/aws-sns-unencrypted-topics.md): Amazon SNS topics should be encrypted at rest
- [sonarjs/bitwise-operators](https://lintradar.dev/rules/sonarjs/bitwise-operators.md): Bitwise operators should not be used in boolean contexts
- [sonarjs/aws-sagemaker-unencrypted-notebook](https://lintradar.dev/rules/sonarjs/aws-sagemaker-unencrypted-notebook.md): SageMaker notebook instances should be encrypted at rest
- [sonarjs/block-scoped-var](https://lintradar.dev/rules/sonarjs/block-scoped-var.md): Variables should be used in the blocks where they are declared
- [sonarjs/aws-s3-bucket-versioning](https://lintradar.dev/rules/sonarjs/aws-s3-bucket-versioning.md): Amazon S3 buckets should have versioning enabled
- [sonarjs/call-argument-line](https://lintradar.dev/rules/sonarjs/call-argument-line.md): Function call arguments should not start on new lines

---

Web page: https://lintradar.dev/rules/sonarjs/aws-sqs-unencrypted-queue. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
