cdk-preflight 1.28.0 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.jsii CHANGED
@@ -9890,7 +9890,7 @@
9890
9890
  },
9891
9891
  "name": "cdk-preflight",
9892
9892
  "readme": {
9893
- "markdown": "<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/badmintoncryer/cdk-preflight/main/assets/logo.png\" alt=\"cdk-preflight\" width=\"104\" height=\"104\">\n</p>\n\n<h1 align=\"center\">cdk-preflight</h1>\n\n<p align=\"center\">\n <strong>Catch deploy-time CloudFormation failures at <code>cdk synth</code> time.</strong>\n</p>\n\n<p align=\"center\">\n <a href=\"https://github.com/badmintoncryer/cdk-preflight/actions/workflows/monthly-verify.yml\"><img src=\"https://github.com/badmintoncryer/cdk-preflight/actions/workflows/monthly-verify.yml/badge.svg\" alt=\"monthly real-deploy verification\"></a>\n <a href=\"https://www.npmjs.com/package/cdk-preflight\"><img src=\"https://img.shields.io/npm/v/cdk-preflight.svg\" alt=\"npm version\"></a>\n <a href=\"https://www.npmjs.com/package/cdk-preflight\"><img src=\"https://img.shields.io/npm/dt/cdk-preflight.svg\" alt=\"npm total downloads\"></a>\n <a href=\"docs/rules.md\"><img src=\"https://img.shields.io/badge/rules-3412-blue\" alt=\"3412 bundled rules\"></a>\n</p>\n\nSome CloudFormation constraints are not expressed in resource provider schemas — they live only in documentation, in service API validation, or across multiple properties. Templates that violate them pass `cdk synth`, pass CloudFormation pre-deployment validation, and then fail minutes into a deployment, burning a rollback cycle.\n\ncdk-preflight is a curated [Rego rule pack](docs/rules.md) for exactly those constraints, evaluated with the CloudFormation validation engine that ships inside `aws-cdk-lib` (>= 2.267.0). By default a violation **fails `cdk synth`** — a template that is known to fail at deploy time never leaves your machine.\n\nThe pack aims at **every deploy-time failure, and every post-deploy run that is certain to fail, that no existing CDK mechanism already catches** — nothing narrower. Every bundled rule is backed by a `fail`/`pass` template pair, and the failure has been reproduced against real AWS. The handful of rules that could not be reproduced are marked `doc-only` and report as **warnings**, as does a rule whose remaining false positives cannot be told from the template (a cross-account Lambda layer the owner may have shared): they show up in the validation report but never fail synth. Rules that the built-in validation engine already covers are deliberately **not** duplicated — a test suite enforces this, and a rule the engine catches up with later is skipped on engines that cover it (see [Scope and rule lifecycle](#scope-and-rule-lifecycle)).\n\n> **Requires `aws-cdk-lib` >= 2.267.0** (released 2026-08-27) — the first release that bundles\n> the CloudFormation validation engine. On older versions the rules cannot run at all.\n\n## Quick start\n\n```bash\nnpm i -D cdk-preflight\nnpx cdkpf init # inserts Preflight.apply(app) into your CDK app\n # (`npx cdkpf init` is the same command, shorter)\n```\n\nor add one line yourself:\n\n```ts\nimport { Preflight } from 'cdk-preflight';\n\nconst app = new App();\nPreflight.apply(app);\n```\n\nOn violation, `cdk synth` fails with one error per finding, including the construct trace:\n\n```text\nERROR idle_timeout.timeout_seconds is 5000 but must be between 1 and 4000 seconds (cdk-preflight)\n MyStack/Alb/Resource (Alb16C2F182) aws-cdk-lib.aws_elasticloadbalancingv2.CfnLoadBalancer\n\nSynthesis finished with errors\n```\n\n## What it catches\n\nFour ordinary-looking snippets. All of them pass `cdk synth` and CloudFormation\npre-deployment validation, and all of them fail minutes into a deployment:\n\n```ts\n// 1) pf-iam-inline-policy-size — enumerate buckets, grant each one, blow past 10,240 chars\n// \"Maximum policy size of 10240 bytes exceeded for role IngestRole\"\n// (via role.addToPolicy the CDK auto-splits into managed policies instead,\n// and you hit the 6,144-char limit as pf-iam-managed-policy-size)\nnew iam.Policy(this, 'IngestPolicy', {\n roles: [role],\n statements: [new iam.PolicyStatement({\n actions: ['s3:GetObject', 's3:ListBucket'],\n resources: Array.from({ length: 200 },\n (_, i) => `arn:aws:s3:::data-lake-landing-zone-${i}/year=*/month=*/*`),\n })],\n});\n\n// 2) pf-lambda-env-size — a config blob in the environment, over the 4KB total\n// \"Lambda was unable to configure your environment variables because the\n// environment variables you have provided exceeded the 4KB limit\"\nnew lambda.Function(this, 'Fn', {\n runtime: lambda.Runtime.NODEJS_22_X,\n handler: 'index.handler',\n code: lambda.Code.fromInline('exports.handler = async () => {};'),\n environment: { FEATURE_FLAGS: JSON.stringify(bigFeatureFlagMap) },\n});\n\n// 3) pf-sfn-asl-missing-state (+ pf-sfn-asl-unreachable-state) — a typo in a state name\n// \"Invalid State Machine Definition: 'MISSING_TRANSITION_TARGET: ...'\"\nnew sfn.StateMachine(this, 'Pipeline', {\n definitionBody: sfn.DefinitionBody.fromString(JSON.stringify({\n StartAt: 'Validate',\n States: {\n Validate: { Type: 'Pass', Next: 'Transform' },\n Trasform: { Type: 'Pass', End: true }, // typo: Transform\n },\n })),\n});\n\n// 4) pf-logs-filter-pattern-bracket — a filter pattern opened with '[' and never closed\n// \"If a filter pattern starts with '[' it must end with ']'\"\nnew logs.MetricFilter(this, 'ErrorFilter', {\n logGroup,\n metricNamespace: 'Pipeline',\n metricName: 'Errors',\n filterPattern: logs.FilterPattern.literal('[time, level=ERROR, msg'),\n});\n```\n\nNone of these are type errors, so the L2 constructs accept them; none of them are\nexpressible in a resource schema, so CloudFormation accepts the template. With\n`Preflight.apply(app)` in place they fail `cdk synth` instead.\n\n## Observe-only mode\n\nTo roll the rules out gradually, start with `enforce: false`: findings then surface as synth **warnings** through the CDK built-in validator, with construct traces and per-finding acknowledgement:\n\n```ts\nPreflight.apply(app, { enforce: false });\n```\n\n```text\nWARNING idle_timeout.timeout_seconds is 5000 but must be between 1 and 4000 seconds (CloudFormation Validate)\n MyStack/Alb (Alb) aws-cdk-lib.aws_elasticloadbalancingv2.CfnLoadBalancer\n Acknowledge with 'CloudFormation-Validate::pf-elbv2-lb-idle-timeout-range'\n```\n\n> **Known limitation with stages.** The AWS CDK CLI drops validation findings for stacks nested in a `Stage`\n> before printing them, so in observe-only mode those findings appear **only** in `cdk.out/validation-report.json`\n> and never on the console. Enforce mode is not affected: cdk-preflight reports such findings itself and fails\n> synthesis. This is a CLI-side bug (present since aws-cdk 2.1128.1), not a rule evaluation problem.\n\n> **If the rules cannot run, the build stops.** When the evaluation engine fails on a template (a rule pack that\n> does not compile, an engine bug), enforce mode reports it as a violation named `pf-engine-error` and fails\n> synthesis for that stack instead of passing green with no rule having run. The other stacks keep their rules.\n> `pf-engine-error` is not a bundled rule and cannot be `exclude`d; `enforce: false` unblocks the build if you\n> need one. A rule that errors at run time on a template (a bug in that rule, not a problem in the template)\n> costs only the rules of its service: they are skipped for that template, every other rule still runs, and\n> `pf-engine-error` is reported as a warning naming the skipped service.\n\n| Option | Default | Effect |\n|---|---|---|\n| `enforce` | `true` | Violations of bundled rules fail synthesis; set to `false` to only warn |\n| `strict` | `false` | With `enforce`: also fail on error-class findings (`ERROR`/`FATAL`, e.g. `F3034`) of the built-in validation engine itself, which the CDK currently downgrades to warnings |\n| `exclude` | `[]` | Rule ids to disable |\n| `includeUpstreamPending` | `true` | Include rules already proposed to the upstream engine but not yet merged |\n| `checkQuotas` | `false` | Also check the target account's Service Quotas and current usage (calls AWS at synth time, see below) |\n| `quotaCacheTtl` | 5 minutes | How long `checkQuotas` reuses the usage and deployed-stack state it fetched |\n\nTo opt out of a single rule everywhere, pass its id in `exclude`. To suppress a\nsingle *finding* on one construct, acknowledge it — this works in both modes (in enforce\nmode with aws-cdk-lib 2.271.0 or later), the id prefix just differs (`cdk-preflight::` when\nenforcing, `CloudFormation-Validate::` in observe-only, as printed in the warning text):\n\n```ts\ncdk.Validations.of(errorFilter).acknowledge({\n id: 'cdk-preflight::pf-logs-filter-pattern-bracket',\n reason: 'log group is written by a legacy producer; pattern is fixed upstream',\n});\n```\n\n## Service quota check (opt-in)\n\nThe rules only read the template, so they never assert a limit an account can raise. `checkQuotas: true` covers that\ngap for the quotas a CDK app runs into most: it adds up what every stack in the app (nested stacks included) is about\nto create in each account and Region, and compares that against the account's applied quota and current usage.\n\n```ts\nPreflight.apply(app, { checkQuotas: true });\n```\n\n| Check | Counts | Against |\n|---|---|---|\n| `pf-quota-vpcs-per-region` | new `AWS::EC2::VPC` | VPCs per Region (`vpc/L-F678F1CE`) |\n| `pf-quota-internet-gateways-per-region` | new `AWS::EC2::InternetGateway` | Internet gateways per Region (`vpc/L-A4707A72`) |\n| `pf-quota-elastic-ips-per-region` | new `AWS::EC2::EIP` (one per NAT gateway in a default `ec2.Vpc`) | EC2-VPC Elastic IPs (`ec2/L-0263D0A3`) |\n| `pf-quota-lambda-unreserved-concurrency` | increase in `ReservedConcurrentExecutions` | Lambda keeps at least 100 concurrent executions unreserved |\n\n- **Only new resources count.** The deployed template of each stack is read with `GetTemplate`; a resource whose\n logical id and type are already deployed is not counted again, so redeploying an unchanged app never trips the\n check. Resources behind a `Condition` and the brief overlap during a replacement are not counted.\n- **A finding fails synth** in enforce mode and is a warning with `enforce: false`. Acknowledge one like any other\n finding (`cdk-preflight::pf-quota-...`; `cdk-preflight-quotas::pf-quota-...` with `enforce: false`). The ids also work in `exclude`, including `pf-quota-check-skipped` to silence the skip warning.\n- **It needs credentials in the app process.** The CDK CLI does not pass `--profile` on to the app, so set\n `AWS_PROFILE` (or `AWS_*` variables) instead. When the credentials are missing, lack permissions, or belong to a\n different account than the stack's, the check is skipped with a `pf-quota-check-skipped` warning and synth goes on.\n- **Permissions:** `servicequotas:GetServiceQuota`, `servicequotas:GetAWSDefaultServiceQuota`, `ec2:DescribeVpcs`,\n `ec2:DescribeInternetGateways`, `ec2:DescribeAddresses`, `lambda:GetAccountSettings`, `cloudformation:GetTemplate`,\n `cloudformation:DescribeStackResource`. All read-only (`ReadOnlyAccess` covers them). The check also calls\n `sts:GetCallerIdentity`, which IAM never denies.\n- **Results are cached** in `cdk.out/.cdk-preflight/quota-cache.json`: usage and deployed templates for\n `quotaCacheTtl` (5 minutes), quota values for 24 hours. Delete the file to force a refetch.\n- Usage can change between synth and deploy (another team deploying to the same account), so a clean check is not a\n guarantee. The reverse also happens: EC2 does not always enforce the Elastic IP quota when CloudFormation\n creates several addresses in parallel (measured 2026-10-16: with 4 of 5 in use, two parallel `AWS::EC2::EIP` both\n succeeded), so a template the check stops may occasionally deploy. The check follows the quota, not the race.\n- **CloudFormation's own quota warning is a different check.** Since June 2026, creating a change set (and\n `cdk validate` with `--online`, below) warns when a stack would exceed a service quota. That warning runs per stack,\n after the template is uploaded, and never stops the deploy. `checkQuotas` adds up every stack of the app that\n targets the same account and Region, and fails `cdk synth` before anything is uploaded. Both can be on.\n\n## Across stacks\n\nTwo checks read every stack of the app at once, because a single template cannot show the problem. They report\n**warnings** (they have not been reproduced on the bench yet, see [Scope](#scope-and-rule-lifecycle)) and never fail\nsynth, in either mode:\n\n| Check | Finds | Deploy error it predicts |\n|---|---|---|\n| `pf-cfn-export-name-conflict` | two stacks that deploy to the same account and Region export the same name (Stages included) | `Export with name X is already exported by stack Y` |\n| `pf-cfn-import-value-missing-export` | `Fn::ImportValue` of a name that starts with the name of a stack of the app (`Producer:...`, CDK's naming) that this stack, in the same account and Region, does not export | `No export named X found` |\n\nImports of names that do not start with a stack name of the app are left alone, since another app may export them.\nAcknowledge a finding with `cdk-preflight-exports::<rule-id>`, or turn a check off with `exclude`.\n\n## With `cdk validate`\n\nThe CDK CLI's experimental `cdk validate` (`cdk --unstable=validate validate`) synthesizes the app and runs its\nvalidation plugins without deploying, so cdk-preflight runs there exactly as in `cdk synth`: in enforce mode a finding\nfails the command, with `enforce: false` it is a warning (checked with CLI 2.1147.0). `--watch` re-runs it on each\nchange. `--online` (the default) also submits the templates to CloudFormation's pre-deployment validation, which\nneeds credentials and adds the server-side checks (resource name conflicts, the quota warning above); `--no-online`\nkeeps it offline.\n\n```sh\nnpx cdk --unstable=validate validate --no-online --watch\n```\n\n## With a CloudFormation template\n\nTemplates written without CDK (JSON or YAML) are checked with `check`. It needs no CDK app and no AWS credentials;\n`aws-cdk-lib` only has to be installed next to cdk-preflight:\n\n```sh\nnpm i -D cdk-preflight aws-cdk-lib constructs\nnpx cdkpf check template.yaml\n```\n\n```text\nERROR idle_timeout.timeout_seconds is 5000 but must be between 1 and 4000 seconds (cdk-preflight)\n template/Template/Alb (Alb) aws-cdk-lib.aws_elasticloadbalancingv2.CfnLoadBalancer\n Acknowledge with 'cdk-preflight::pf-elbv2-lb-idle-timeout-range'\n```\n\nEach template is loaded into its own stack with\n[`cloudformation-include`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.cloudformation_include-readme.html)\nand synthesized with `Preflight.apply`, so the rules and the output are the same as in `cdk synth`. Findings name the\ntemplate's file (`template`) and logical ID (`Alb`). The exit code is `0` when nothing fails, `1` on findings, and `2`\nwhen a template cannot be read, so the command works as a CI step as it is.\n\n| Flag | What it does |\n|---|---|\n| `--exclude <id,...>` | Rule ids to skip, as `exclude` |\n| `--warn` | Report findings as warnings and exit `0`, as `enforce: false` |\n| `--region <r>`, `--account <id>` | The environment the template deploys to. Rules that depend on the Region or account only run when it is given |\n| `--output <dir>` | Where to write the synthesized assembly and `validation-report.json`. Default: a temporary directory |\n\nSeveral templates can be checked at once: `npx cdkpf check network.yaml app.yaml`.\n`cfn-idle-cost` and `cfn-exec-policy` read template files directly as well.\n\n## Bundled rules\n\nSee [docs/rules.md](docs/rules.md) for the generated rule table.\n\n<!-- supported-resources:start -->\n<details>\n<summary><b>444 resource types across 83 services</b> — click to expand</summary>\n\nResource names are relative to `AWS::<Service>::`; the number in parentheses is how many rules target that type.\n\n| Service | Resource types |\n|---|---|\n| **(any resource type)** | `*` (14) |\n| **ApiGateway** | `ApiKey` (1), `Authorizer` (5), `Deployment` (1), `DocumentationPart` (1), `DomainName` (4), `GatewayResponse` (1), `Method` (14), `Model` (3), `Resource` (1), `RestApi` (5), `Stage` (9), `UsagePlan` (5), `VpcLink` (1) |\n| **ApiGatewayV2** | `Api` (5), `Authorizer` (11), `DomainName` (3), `Integration` (15), `IntegrationResponse` (1), `Model` (2), `Route` (6), `RouteResponse` (2), `Stage` (4), `VpcLink` (1) |\n| **ApplicationAutoScaling** | `ScalableTarget` (19), `ScalingPolicy` (30) |\n| **AppSync** | `Api` (7), `ApiCache` (4), `ApiKey` (2), `ChannelNamespace` (5), `DataSource` (15), `DomainName` (1), `FunctionConfiguration` (24), `GraphQLApi` (16), `GraphQLSchema` (12), `Resolver` (32), `SourceApiAssociation` (3) |\n| **APS** | `AnomalyDetector` (9), `ResourcePolicy` (5), `RuleGroupsNamespace` (10), `Workspace` (12) |\n| **Athena** | `DataCatalog` (6), `WorkGroup` (8) |\n| **AutoScaling** | `AutoScalingGroup` (39), `LifecycleHook` (8), `ScalingPolicy` (41), `ScheduledAction` (13), `WarmPool` (4) |\n| **Backup** | `BackupPlan` (12), `BackupSelection` (5), `BackupVault` (3), `Framework` (3), `LogicallyAirGappedBackupVault` (2), `ReportPlan` (2), `RestoreTestingPlan` (5), `RestoreTestingSelection` (3) |\n| **Batch** | `ComputeEnvironment` (40), `ConsumableResource` (2), `JobDefinition` (109), `JobQueue` (18), `SchedulingPolicy` (8), `ServiceEnvironment` (6) |\n| **Bedrock** | `ApplicationInferenceProfile` (2), `AutomatedReasoningPolicy` (3), `Blueprint` (3), `DataAutomationProject` (8), `DataSource` (12), `Flow` (14), `Guardrail` (19), `IntelligentPromptRouter` (5), `KnowledgeBase` (18), `Prompt` (4) |\n| **BedrockAgentCore** | `ApiKeyCredentialProvider` (1), `BrowserCustom` (1), `BrowserProfile` (1), `CapacityProvider` (8), `CodeInterpreterCustom` (1), `ConfigurationBundle` (3), `Dataset` (2), `Evaluator` (3), `Gateway` (16), `GatewayRateLimit` (5), `GatewayRule` (5), `GatewayTarget` (11), `Harness` (3), `HarnessEndpoint` (2), `Memory` (14), `OAuth2CredentialProvider` (5), `OnlineEvaluationConfig` (3), `PaymentCredentialProvider` (1), `PaymentManager` (1), `Policy` (3), `ResourcePolicy` (1), `Runtime` (16), `RuntimeEndpoint` (1) |\n| **Cassandra** | `Keyspace` (2), `Table` (21), `Type` (12) |\n| **CertificateManager** | `Certificate` (4) |\n| **CloudFormation** | `GuardHook` (1), `Stack` (2), `StackSet` (6) |\n| **CloudFront** | `AnycastIpList` (1), `CachePolicy` (7), `ContinuousDeploymentPolicy` (5), `Distribution` (54), `Function` (4), `KeyGroup` (1), `KeyValueStore` (2), `OriginRequestPolicy` (5), `PublicKey` (1), `RealtimeLogConfig` (3), `ResponseHeadersPolicy` (8), `VpcOrigin` (2) |\n| **CloudTrail** | `EventDataStore` (1), `Trail` (19) |\n| **CloudWatch** | `Alarm` (23), `AnomalyDetector` (6), `CompositeAlarm` (7), `Dashboard` (14), `InsightRule` (7), `LogAlarm` (2), `MetricStream` (6) |\n| **CodeBuild** | `Project` (37), `ReportGroup` (2), `SourceCredential` (4) |\n| **CodeCommit** | `Repository` (11) |\n| **CodeDeploy** | `Application` (7), `DeploymentConfig` (12), `DeploymentGroup` (23) |\n| **CodePipeline** | `CustomActionType` (3), `Pipeline` (25), `Webhook` (2) |\n| **Cognito** | `IdentityPool` (3), `IdentityPoolRoleAttachment` (7), `LogDeliveryConfiguration` (3), `ManagedLoginBranding` (2), `UserPool` (52), `UserPoolClient` (21), `UserPoolDomain` (7), `UserPoolGroup` (1), `UserPoolIdentityProvider` (11), `UserPoolResourceServer` (4), `UserPoolRiskConfigurationAttachment` (6), `UserPoolUICustomizationAttachment` (2) |\n| **Config** | `ConfigRule` (6), `ConfigurationAggregator` (2), `ConfigurationRecorder` (7), `ConformancePack` (1), `RemediationConfiguration` (2) |\n| **DirectoryService** | `MicrosoftAD` (10) |\n| **DocDB** | `DBCluster` (14), `DBInstance` (1), `DBSubnetGroup` (2), `EventSubscription` (1) |\n| **DocDBElastic** | `Cluster` (7) |\n| **DynamoDB** | `GlobalTable` (25), `Table` (28) |\n| **EC2** | `ClientVpnAuthorizationRule` (1), `ClientVpnEndpoint` (6), `DHCPOptions` (2), `EIPAssociation` (1), `FlowLog` (4), `Instance` (10), `KeyPair` (1), `LaunchTemplate` (12), `NatGateway` (2), `NetworkAclEntry` (1), `NetworkInterface` (2), `PlacementGroup` (3), `PrefixList` (3), `Route` (1), `SecurityGroup` (8), `SecurityGroupEgress` (5), `SecurityGroupIngress` (5), `Subnet` (16), `SubnetCidrReservation` (1), `TrafficMirrorTarget` (1), `TransitGateway` (2), `TransitGatewayRoute` (1), `Volume` (6), `VPC` (2), `VPCCidrBlock` (1), `VPCEndpoint` (4), `VPCGatewayAttachment` (1), `VPNConnection` (5) |\n| **ECR** | `PullThroughCacheRule` (3), `RegistryScanningConfiguration` (1), `ReplicationConfiguration` (1), `Repository` (7), `RepositoryCreationTemplate` (8), `SigningConfiguration` (1) |\n| **ECS** | `CapacityProvider` (3), `Cluster` (5), `Service` (39), `TaskDefinition` (70), `TaskSet` (2) |\n| **EFS** | `AccessPoint` (1), `FileSystem` (7), `MountTarget` (4) |\n| **EKS** | `AccessEntry` (14), `Addon` (5), `Cluster` (26), `FargateProfile` (5), `IdentityProviderConfig` (3), `Nodegroup` (21), `PodIdentityAssociation` (5) |\n| **ElastiCache** | `CacheCluster` (9), `ReplicationGroup` (14), `ServerlessCache` (2), `User` (2), `UserGroup` (1) |\n| **ElasticBeanstalk** | `Application` (2), `ConfigurationTemplate` (36), `Environment` (34) |\n| **ElasticLoadBalancingV2** | `Listener` (57), `ListenerCertificate` (2), `ListenerRule` (38), `LoadBalancer` (37), `TargetGroup` (58), `TrustStore` (1), `TrustStoreRevocation` (1) |\n| **Events** | `ApiDestination` (1), `Archive` (5), `Connection` (1), `Endpoint` (2), `EventBus` (2), `Rule` (27) |\n| **EventSchemas** | `Discoverer` (1), `Registry` (1), `RegistryPolicy` (1), `Schema` (1) |\n| **EventsV2** | `Subscriber` (3) |\n| **FSx** | `FileSystem` (1) |\n| **GlobalAccelerator** | `Accelerator` (1), `EndpointGroup` (5), `Listener` (2) |\n| **Glue** | `Classifier` (6), `Connection` (5), `Crawler` (10), `CustomEntityType` (1), `Database` (1), `DataQualityRuleset` (1), `Job` (15), `MLTransform` (4), `Partition` (1), `Schema` (3), `SecurityConfiguration` (1), `Table` (1), `Trigger` (10), `UserDefinedFunction` (2), `Workflow` (1) |\n| **Grafana** | `Workspace` (7) |\n| **IAM** | `Group` (23), `GroupPolicy` (19), `InstanceProfile` (2), `ManagedPolicy` (31), `OIDCProvider` (2), `Policy` (30), `Role` (45), `RolePolicy` (20), `ServiceLinkedRole` (1), `User` (24), `UserPolicy` (19) |\n| **IoT** | `Authorizer` (3), `Certificate` (1), `CertificateProvider` (1), `Command` (1), `DomainConfiguration` (3), `Job` (2), `JobTemplate` (3), `MitigationAction` (1), `Policy` (4), `PolicyPrincipalAttachment` (1), `ProvisioningTemplate` (3), `RoleAlias` (1), `ScheduledAudit` (1), `Thing` (1), `ThingGroup` (2), `TopicRule` (5), `TopicRuleDestination` (2) |\n| **Kinesis** | `Channel` (3), `ResourcePolicy` (4), `Stream` (6), `StreamConsumer` (2) |\n| **KinesisAnalyticsV2** | `Application` (20), `ApplicationCloudWatchLoggingOption` (1), `ApplicationOutput` (1), `ApplicationReferenceDataSource` (1) |\n| **KinesisFirehose** | `DeliveryStream` (68) |\n| **KMS** | `Alias` (2), `Key` (12), `ReplicaKey` (4) |\n| **Lambda** | `Alias` (7), `CodeSigningConfig` (1), `EventInvokeConfig` (5), `EventSourceMapping` (54), `Function` (49), `LayerVersion` (6), `LayerVersionPermission` (3), `NetworkConnector` (2), `Permission` (8), `Url` (8), `Version` (1) |\n| **Logs** | `AccountPolicy` (6), `DeliveryDestination` (3), `Destination` (1), `LogAnomalyDetector` (2), `LogGroup` (10), `MetricFilter` (7), `QueryDefinition` (1), `ResourcePolicy` (1), `SubscriptionFilter` (6), `Transformer` (3) |\n| **MediaConvert** | `JobTemplate` (9), `Preset` (32), `Queue` (2) |\n| **MemoryDB** | `Cluster` (8), `User` (1) |\n| **MSK** | `BatchScramSecret` (2), `Cluster` (31), `ClusterPolicy` (1), `Configuration` (4), `Replicator` (10), `ServerlessCluster` (4) |\n| **Neptune** | `DBCluster` (11), `DBClusterParameterGroup` (1), `DBInstance` (3), `DBSubnetGroup` (1), `GlobalCluster` (1) |\n| **NeptuneGraph** | `Graph` (2), `PrivateGraphEndpoint` (1) |\n| **NetworkFirewall** | `ContainerAssociation` (1), `FirewallPolicy` (18), `RuleGroup` (34), `TLSInspectionConfiguration` (7) |\n| **OpenSearchServerless** | `AccessPolicy` (7), `Collection` (2), `CollectionGroup` (3), `LifecyclePolicy` (4), `SecurityConfig` (5), `SecurityPolicy` (14) |\n| **OpenSearchService** | `Domain` (65) |\n| **Pipes** | `Pipe` (9) |\n| **RDS** | `DBCluster` (21), `DBInstance` (38), `DBParameterGroup` (2), `DBProxy` (4), `DBProxyTargetGroup` (2), `DBShardGroup` (1), `DBSubnetGroup` (3), `EventSubscription` (3), `OptionGroup` (1) |\n| **Redshift** | `Cluster` (21), `EventSubscription` (1), `ScheduledAction` (2) |\n| **RedshiftServerless** | `Namespace` (5), `Workgroup` (6) |\n| **Route53** | `CidrCollection` (11), `DNSSEC` (3), `HealthCheck` (30), `HostedZone` (15), `KeySigningKey` (9), `QueryLoggingConfig` (3), `RecordSet` (74), `RecordSetGroup` (76) |\n| **Route53Profiles** | `ProfileAssociation` (1), `ProfileResourceAssociation` (6) |\n| **Route53Resolver** | `FirewallDomainList` (3), `FirewallRuleGroup` (18), `FirewallRuleGroupAssociation` (4), `ResolverDNSSECConfig` (1), `ResolverEndpoint` (18), `ResolverQueryLoggingConfig` (1), `ResolverQueryLoggingConfigAssociation` (1), `ResolverRule` (15), `ResolverRuleAssociation` (1) |\n| **S3** | `AccessPoint` (1), `Bucket` (54), `BucketPolicy` (4), `StorageLens` (5), `StorageLensGroup` (3) |\n| **S3Express** | `AccessPoint` (3), `DirectoryBucket` (11) |\n| **Scheduler** | `Schedule` (12), `ScheduleGroup` (1) |\n| **SecretsManager** | `RotationSchedule` (4), `Secret` (5), `SecretTargetAttachment` (1) |\n| **ServiceDiscovery** | `HttpNamespace` (3), `Instance` (19), `PrivateDnsNamespace` (4), `PublicDnsNamespace` (4), `Service` (14) |\n| **SES** | `ConfigurationSetEventDestination` (8), `ContactList` (1), `EmailIdentity` (6), `ReceiptRule` (6), `ReceiptRuleSet` (1), `Template` (1) |\n| **SNS** | `Subscription` (11), `Topic` (15), `TopicPolicy` (2) |\n| **SQS** | `Queue` (10), `QueuePolicy` (1) |\n| **SSM** | `Association` (4), `Document` (3), `MaintenanceWindow` (2), `MaintenanceWindowTarget` (1), `MaintenanceWindowTask` (1), `Parameter` (5) |\n| **StepFunctions** | `Activity` (3), `StateMachine` (26) |\n| **Synthetics** | `Canary` (16) |\n| **Transcribe** | `Vocabulary` (2) |\n| **Transfer** | `Server` (2) |\n| **VerifiedPermissions** | `IdentitySource` (3), `Policy` (26), `PolicyStore` (23), `PolicyStoreAlias` (1), `PolicyTemplate` (29) |\n| **VpcLattice** | `AccessLogSubscription` (3), `AuthPolicy` (3), `DomainVerification` (1), `Listener` (12), `ResourceConfiguration` (30), `ResourceGateway` (6), `ResourcePolicy` (1), `Rule` (7), `Service` (2), `ServiceNetwork` (1), `ServiceNetworkResourceAssociation` (3), `ServiceNetworkServiceAssociation` (3), `ServiceNetworkVpcAssociation` (8), `TargetGroup` (14) |\n| **WAFv2** | `IPSet` (3), `LoggingConfiguration` (3), `RegexPatternSet` (3), `RuleGroup` (18), `WebACL` (23), `WebACLAssociation` (2) |\n| **XRay** | `Group` (1), `ResourcePolicy` (3), `SamplingRule` (6) |\n\n</details>\n<!-- supported-resources:end -->\n\nHighlights:\n\n- **ELBv2**: `idle_timeout` / `deregistration_delay` / `slow_start` attribute ranges (stringly-typed Key/Value attributes are invisible to schema validation)\n- **IAM**: managed (6,144 chars) and inline (role/group/user) policy document size limits\n- **CloudFront**: `MinTTL <= DefaultTTL <= MaxTTL` ordering, ACM certificates must live in `us-east-1`\n- **Step Functions**: `Next`/`Default`/`Choices` must reference defined states (a dangling `StartAt` is already caught by the engine's built-in `E3601`)\n- **EC2**: security group TCP/UDP port ranges and `FromPort <= ToPort`\n\n## Pull request report (GitHub Action)\n\nThe repository is also a GitHub Action that synthesizes the app on both sides of a pull request and posts **one comment** with:\n\n- the cdk-preflight findings of the pull request, `enforce: false` warnings included (from `cdk.out/validation-report.json`, or the synth log),\n- the idle cost change, from [cfn-idle-cost](https://github.com/badmintoncryer/cfn-idle-cost) (what the stacks cost a month with zero traffic),\n- the CloudFormation execution role permission change, from [cfn-exec-policy](https://github.com/badmintoncryer/cfn-exec-policy).\n\n```yaml\nname: cdk-report\non: pull_request\npermissions: { contents: read, pull-requests: write }\njobs:\n report:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: actions/setup-node@v7\n with: { node-version: 22 }\n - uses: badmintoncryer/cdk-preflight@main # pin a commit SHA to keep the report from changing under you\n with:\n idle-cost-args: --region us-east-1 --max-increase 50\n exec-policy-args: --fail-on wildcard,unknown\n```\n\nThe base branch is fetched and synthesized in a separate worktree, so neither side needs AWS credentials (unless the app's synth does lookups that are not in `cdk.context.json`). The comment is updated on each push and also written to the job summary. The job fails when the pull request has cdk-preflight errors, does not synthesize, or goes over a budget or `--fail-on` given to the other two tools; the `failed` output says which.\n\n| Input | What it does |\n|---|---|\n| `working-directory` | Directory of the CDK app (where `cdk.json` is). Default `.` |\n| `install` | Install command, run on both sides. Default `npm ci`; empty to skip |\n| `synth` | Synth command, run on both sides. It must write `cdk.out` in the app directory. Default `npx cdk synth -q` |\n| `base-ref` | Branch to compare against. Default: the pull request's base branch |\n| `idle-cost`, `idle-cost-args`, `idle-cost-version` | `false` to leave the idle cost out; more `cfn-idle-cost` flags (`--region` is needed for env-agnostic stacks); the `cfn-idle-cost` version to run (pinned by default) |\n| `exec-policy`, `exec-policy-args`, `exec-policy-version` | `false` to leave the permissions out; more `cfn-exec-policy diff` flags; the `cfn-exec-policy` version to run (pinned by default) |\n| `comment` | `false` to only write the job summary. Default `true` |\n| `github-token` | Token used to comment. Default `github.token` |\n\nWhen the base branch does not synthesize, the idle cost is shown for the whole app instead of the change, and the permission change is left out.\n\n## For AI agents\n\nTo add cdk-preflight to a CDK app:\n\n1. `npm i -D cdk-preflight`\n2. `npx cdk-preflight init` — or the shorter alias `npx cdkpf init` (finds the entry point via `cdk.json` and inserts `Preflight.apply(app)`; use `--dry-run` to preview)\n3. Run `cdk synth`. Violations fail the synth with a validation report; each finding carries a rule id, the actual value, and a suggested fix\n4. To fix a finding, prefer correcting the resource. To opt out instead: `exclude: ['<rule-id>']` disables one rule, `enforce: false` switches to warn-only reporting\n\nThe machine-readable findings are written to `cdk.out/validation-report.json` when synthesizing with `-c @aws-cdk/core:validationReportJson=true`.\n\nFor a CloudFormation template written without CDK, run `npx cdkpf check <template...>` instead (exit `1` on findings; `--output <dir>` keeps `validation-report.json`).\n\nThe two sibling tools also run as MCP servers, so an agent can check the same `cdk.out` for what it costs idle and\nwhat it asks of the CloudFormation execution role:\n\n```sh\nclaude mcp add idle-cost -- npx -y cfn-idle-cost mcp # idle_cost\nclaude mcp add exec-policy -- npx -y cfn-exec-policy mcp # exec_policy_explain / _generate / _diff / _doctor\n```\n\n### Report missed deploy errors\n\ncdk-preflight only knows the failure modes it has benched. When a deploy fails on a constraint the pack should have caught, that report is how new rules get added — but at that moment cdk-preflight is out of the loop (it passed the synth), so the instruction has to already sit in your agent's context. Paste this into your repository's `AGENTS.md` (or `CLAUDE.md`):\n\n```markdown\n## cdk-preflight: report missed deploy errors\n\nIf `cdk deploy` fails even though `cdk synth` (with cdk-preflight enabled) passed,\nand the failure is a service-side validation rejection — CREATE_FAILED/UPDATE_FAILED\nwith a 400-class message such as \"Invalid request provided: ...\" — cdk-preflight is\nmissing a rule. Report it:\n\n1. Qualify first. NOT reportable: AccessDenied / permissions, service quotas\n (those belong to the opt-in `checkQuotas`; open a regular issue if it missed one),\n throttling, name conflicts with existing resources, stabilization timeouts.\n2. Redact account-specific data (account IDs -> 123456789012, real ARNs/domains\n -> placeholders).\n3. Search existing issues: https://github.com/badmintoncryer/cdk-preflight/issues\n4. With your user's approval, open a \"Missed deploy error\" issue with the verbatim\n error message, the resource type, a minimal template snippet, and your\n aws-cdk-lib / cdk-preflight versions.\n```\n\n### Report false positives\n\nA finding on a template that deploys is a bug in the rule. `exclude` or an acknowledgement unblocks your build, but only a report fixes it for everyone: each fixed report is kept as a regression fixture, so the same shape cannot come back. Paste this into your repository's `AGENTS.md` (or `CLAUDE.md`) next to the section above:\n\n```markdown\n## cdk-preflight: report false positives\n\nIf cdk-preflight reports a finding on a resource that deploys fine — the same\ntemplate (or the same resource with the same property values) reached\nCREATE_COMPLETE / UPDATE_COMPLETE, or is already running — the rule is wrong.\nUnblock the build with an acknowledgement or `exclude`, then report it:\n\n1. Reduce it to the smallest synthesized template (`Resources` only) on which\n the rule still fires; run `npx cdkpf check <template> --region <deploy Region>`\n to confirm.\n2. Redact account-specific data (account IDs -> 123456789012, real ARNs/domains\n -> placeholders).\n3. Search existing issues: https://github.com/badmintoncryer/cdk-preflight/issues\n4. With your user's approval, open a \"False positive\" issue with the rule id,\n the finding text, the minimal template, how you know it deploys, the deploy\n Region, and your aws-cdk-lib / cdk-preflight versions.\n```\n\n## Scope and rule lifecycle\n\nA constraint belongs in the pack when violating it makes a real deployment fail, or lets the deployment succeed and then makes every run of the deployed resource fail (an SSM Automation association that targets several tags, for example), *and* no layer that sees the same synthesized template already blocks it. There is no further \"is this worth a rule\" question — if the gap is real, it gets a rule.\n\nCDK L2 construct validation is deliberately **not** one of those layers. `CfnXxx` usage, escape hatches, `addPropertyOverride`, `cloudformation-include` and migrated templates all bypass L2, so an L2 guard covering the same mistake neither disqualifies a rule nor retires one.\n\nThat makes growth the normal state, and it has a consequence worth knowing before you upgrade: **new rules land in minor releases, so a minor upgrade can newly fail a `cdk synth` that passed yesterday.** That is intended, not a regression. If you need a frozen rule set, pin the version; to drop a single rule, `exclude: ['<rule-id>']`; to see everything without failing the build, `enforce: false`.\n\nRules move the other way too. Once the validation engine bundled in `aws-cdk-lib` starts blocking a constraint, the rule records the engine version that covers it and stops being evaluated on that engine or later — but only where that changes nothing about whether synth fails: with `enforce: false`, with `strict: true`, or when your app sets the context `@aws-cdk/core:validateAgainstDefaultRules: true`. In the default enforce mode the CDK reports its own engine's errors as warnings, so the rule keeps running and you may see both. Users on an older `aws-cdk-lib` keep the rule either way; it is deleted only once the minimum supported `aws-cdk-lib` bundles an engine that covers it.\n\n## How it works\n\n`Preflight.apply()` evaluates the rules with the [cloudformation-validate](https://github.com/aws-cloudformation/cloudformation-validate) Rust/WASM engine that ships inside `aws-cdk-lib` — no extra binaries, and no network access at synth time unless you opt in to `checkQuotas`, which calls AWS from a child process. In the default enforce mode the engine is invoked through a dedicated CDK validation plugin so that violations fail synthesis; with `enforce: false` the rules are instead injected into the CDK built-in `CloudFormationValidatePlugin` and reported as warnings.\n\nConstraints that *can* be expressed in schemas or generic engine rules also make good upstream PRs to that engine, but nothing here waits on one — the upstream release cycle is deliberately slower than this pack's. Each rule's `meta.yaml` tracks its upstream status so that retirement stays bookkeeping.\n\n## Requirements\n\n- `aws-cdk-lib` >= 2.267.0, released 2026-08-27 (the first release that bundles the built-in CloudFormation validator). This is a recent release — an existing CDK app may need an upgrade before cdk-preflight can run.\n\n## Contributing\n\nRule authoring, the verification gates (including real-deploy reproduction), and the test layout are documented in [AGENTS.md](AGENTS.md) — written for AI coding agents and humans alike.\n\n## License\n\nApache-2.0\n"
9893
+ "markdown": "<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/badmintoncryer/cdk-preflight/main/assets/logo.png\" alt=\"cdk-preflight\" width=\"104\" height=\"104\">\n</p>\n\n<h1 align=\"center\">cdk-preflight</h1>\n\n<p align=\"center\">\n <strong>Catch deploy-time CloudFormation failures at <code>cdk synth</code> time.</strong>\n</p>\n\n<p align=\"center\">\n <a href=\"https://github.com/badmintoncryer/cdk-preflight/actions/workflows/monthly-verify.yml\"><img src=\"https://github.com/badmintoncryer/cdk-preflight/actions/workflows/monthly-verify.yml/badge.svg\" alt=\"monthly real-deploy verification\"></a>\n <a href=\"https://www.npmjs.com/package/cdk-preflight\"><img src=\"https://img.shields.io/npm/v/cdk-preflight.svg\" alt=\"npm version\"></a>\n <a href=\"https://www.npmjs.com/package/cdk-preflight\"><img src=\"https://img.shields.io/npm/dt/cdk-preflight.svg\" alt=\"npm total downloads\"></a>\n <a href=\"docs/rules.md\"><img src=\"https://img.shields.io/badge/rules-3442-blue\" alt=\"3442 bundled rules\"></a>\n</p>\n\nSome CloudFormation constraints are not expressed in resource provider schemas — they live only in documentation, in service API validation, or across multiple properties. Templates that violate them pass `cdk synth`, pass CloudFormation pre-deployment validation, and then fail minutes into a deployment, burning a rollback cycle.\n\ncdk-preflight is a curated [Rego rule pack](docs/rules.md) for exactly those constraints, evaluated with the CloudFormation validation engine that ships inside `aws-cdk-lib` (>= 2.267.0). By default a violation **fails `cdk synth`** — a template that is known to fail at deploy time never leaves your machine.\n\nThe pack aims at **every deploy-time failure, and every post-deploy run that is certain to fail, that no existing CDK mechanism already catches** — nothing narrower. Every bundled rule is backed by a `fail`/`pass` template pair, and the failure has been reproduced against real AWS. The handful of rules that could not be reproduced are marked `doc-only` and report as **warnings**, as does a rule whose remaining false positives cannot be told from the template (a cross-account Lambda layer the owner may have shared): they show up in the validation report but never fail synth. Rules that the built-in validation engine already covers are deliberately **not** duplicated — a test suite enforces this, and a rule the engine catches up with later is skipped on engines that cover it (see [Scope and rule lifecycle](#scope-and-rule-lifecycle)).\n\n> **Requires `aws-cdk-lib` >= 2.267.0** (released 2026-08-27) — the first release that bundles\n> the CloudFormation validation engine. On older versions the rules cannot run at all.\n\n## Quick start\n\n```bash\nnpm i -D cdk-preflight\nnpx cdkpf init # inserts Preflight.apply(app) into your CDK app\n # (`npx cdkpf init` is the same command, shorter)\n```\n\nor add one line yourself:\n\n```ts\nimport { Preflight } from 'cdk-preflight';\n\nconst app = new App();\nPreflight.apply(app);\n```\n\nOn violation, `cdk synth` fails with one error per finding, including the construct trace:\n\n```text\nERROR idle_timeout.timeout_seconds is 5000 but must be between 1 and 4000 seconds (cdk-preflight)\n MyStack/Alb/Resource (Alb16C2F182) aws-cdk-lib.aws_elasticloadbalancingv2.CfnLoadBalancer\n\nSynthesis finished with errors\n```\n\n## What it catches\n\nFour ordinary-looking snippets. All of them pass `cdk synth` and CloudFormation\npre-deployment validation, and all of them fail minutes into a deployment:\n\n```ts\n// 1) pf-iam-inline-policy-size — enumerate buckets, grant each one, blow past 10,240 chars\n// \"Maximum policy size of 10240 bytes exceeded for role IngestRole\"\n// (via role.addToPolicy the CDK auto-splits into managed policies instead,\n// and you hit the 6,144-char limit as pf-iam-managed-policy-size)\nnew iam.Policy(this, 'IngestPolicy', {\n roles: [role],\n statements: [new iam.PolicyStatement({\n actions: ['s3:GetObject', 's3:ListBucket'],\n resources: Array.from({ length: 200 },\n (_, i) => `arn:aws:s3:::data-lake-landing-zone-${i}/year=*/month=*/*`),\n })],\n});\n\n// 2) pf-lambda-env-size — a config blob in the environment, over the 4KB total\n// \"Lambda was unable to configure your environment variables because the\n// environment variables you have provided exceeded the 4KB limit\"\nnew lambda.Function(this, 'Fn', {\n runtime: lambda.Runtime.NODEJS_22_X,\n handler: 'index.handler',\n code: lambda.Code.fromInline('exports.handler = async () => {};'),\n environment: { FEATURE_FLAGS: JSON.stringify(bigFeatureFlagMap) },\n});\n\n// 3) pf-sfn-asl-missing-state (+ pf-sfn-asl-unreachable-state) — a typo in a state name\n// \"Invalid State Machine Definition: 'MISSING_TRANSITION_TARGET: ...'\"\nnew sfn.StateMachine(this, 'Pipeline', {\n definitionBody: sfn.DefinitionBody.fromString(JSON.stringify({\n StartAt: 'Validate',\n States: {\n Validate: { Type: 'Pass', Next: 'Transform' },\n Trasform: { Type: 'Pass', End: true }, // typo: Transform\n },\n })),\n});\n\n// 4) pf-logs-filter-pattern-bracket — a filter pattern opened with '[' and never closed\n// \"If a filter pattern starts with '[' it must end with ']'\"\nnew logs.MetricFilter(this, 'ErrorFilter', {\n logGroup,\n metricNamespace: 'Pipeline',\n metricName: 'Errors',\n filterPattern: logs.FilterPattern.literal('[time, level=ERROR, msg'),\n});\n```\n\nNone of these are type errors, so the L2 constructs accept them; none of them are\nexpressible in a resource schema, so CloudFormation accepts the template. With\n`Preflight.apply(app)` in place they fail `cdk synth` instead.\n\n## Observe-only mode\n\nTo roll the rules out gradually, start with `enforce: false`: findings then surface as synth **warnings** through the CDK built-in validator, with construct traces and per-finding acknowledgement:\n\n```ts\nPreflight.apply(app, { enforce: false });\n```\n\n```text\nWARNING idle_timeout.timeout_seconds is 5000 but must be between 1 and 4000 seconds (CloudFormation Validate)\n MyStack/Alb (Alb) aws-cdk-lib.aws_elasticloadbalancingv2.CfnLoadBalancer\n Acknowledge with 'CloudFormation-Validate::pf-elbv2-lb-idle-timeout-range'\n```\n\n> **Known limitation with stages.** The AWS CDK CLI drops validation findings for stacks nested in a `Stage`\n> before printing them, so in observe-only mode those findings appear **only** in `cdk.out/validation-report.json`\n> and never on the console. Enforce mode is not affected: cdk-preflight reports such findings itself and fails\n> synthesis. This is a CLI-side bug (present since aws-cdk 2.1128.1), not a rule evaluation problem.\n\n> **If the rules cannot run, the build stops.** When the evaluation engine fails on a template (a rule pack that\n> does not compile, an engine bug), enforce mode reports it as a violation named `pf-engine-error` and fails\n> synthesis for that stack instead of passing green with no rule having run. The other stacks keep their rules.\n> `pf-engine-error` is not a bundled rule and cannot be `exclude`d; `enforce: false` unblocks the build if you\n> need one. A rule that errors at run time on a template (a bug in that rule, not a problem in the template)\n> costs only the rules of its service: they are skipped for that template, every other rule still runs, and\n> `pf-engine-error` is reported as a warning naming the skipped service.\n\n| Option | Default | Effect |\n|---|---|---|\n| `enforce` | `true` | Violations of bundled rules fail synthesis; set to `false` to only warn |\n| `strict` | `false` | With `enforce`: also fail on error-class findings (`ERROR`/`FATAL`, e.g. `F3034`) of the built-in validation engine itself, which the CDK currently downgrades to warnings |\n| `exclude` | `[]` | Rule ids to disable |\n| `includeUpstreamPending` | `true` | Include rules already proposed to the upstream engine but not yet merged |\n| `checkQuotas` | `false` | Also check the target account's Service Quotas and current usage (calls AWS at synth time, see below) |\n| `quotaCacheTtl` | 5 minutes | How long `checkQuotas` reuses the usage and deployed-stack state it fetched |\n\nTo opt out of a single rule everywhere, pass its id in `exclude`. To suppress a\nsingle *finding* on one construct, acknowledge it — this works in both modes (in enforce\nmode with aws-cdk-lib 2.271.0 or later), the id prefix just differs (`cdk-preflight::` when\nenforcing, `CloudFormation-Validate::` in observe-only, as printed in the warning text):\n\n```ts\ncdk.Validations.of(errorFilter).acknowledge({\n id: 'cdk-preflight::pf-logs-filter-pattern-bracket',\n reason: 'log group is written by a legacy producer; pattern is fixed upstream',\n});\n```\n\n## Service quota check (opt-in)\n\nThe rules only read the template, so they never assert a limit an account can raise. `checkQuotas: true` covers that\ngap for the quotas a CDK app runs into most: it adds up what every stack in the app (nested stacks included) is about\nto create in each account and Region, and compares that against the account's applied quota and current usage.\n\n```ts\nPreflight.apply(app, { checkQuotas: true });\n```\n\n| Check | Counts | Against |\n|---|---|---|\n| `pf-quota-vpcs-per-region` | new `AWS::EC2::VPC` | VPCs per Region (`vpc/L-F678F1CE`) |\n| `pf-quota-internet-gateways-per-region` | new `AWS::EC2::InternetGateway` | Internet gateways per Region (`vpc/L-A4707A72`) |\n| `pf-quota-elastic-ips-per-region` | new `AWS::EC2::EIP` (one per NAT gateway in a default `ec2.Vpc`) | EC2-VPC Elastic IPs (`ec2/L-0263D0A3`) |\n| `pf-quota-lambda-unreserved-concurrency` | increase in `ReservedConcurrentExecutions` | Lambda keeps at least 100 concurrent executions unreserved |\n\n- **Only new resources count.** The deployed template of each stack is read with `GetTemplate`; a resource whose\n logical id and type are already deployed is not counted again, so redeploying an unchanged app never trips the\n check. Resources behind a `Condition` and the brief overlap during a replacement are not counted.\n- **A finding fails synth** in enforce mode and is a warning with `enforce: false`. Acknowledge one like any other\n finding (`cdk-preflight::pf-quota-...`; `cdk-preflight-quotas::pf-quota-...` with `enforce: false`). The ids also work in `exclude`, including `pf-quota-check-skipped` to silence the skip warning.\n- **It needs credentials in the app process.** The CDK CLI does not pass `--profile` on to the app, so set\n `AWS_PROFILE` (or `AWS_*` variables) instead. When the credentials are missing, lack permissions, or belong to a\n different account than the stack's, the check is skipped with a `pf-quota-check-skipped` warning and synth goes on.\n- **Permissions:** `servicequotas:GetServiceQuota`, `servicequotas:GetAWSDefaultServiceQuota`, `ec2:DescribeVpcs`,\n `ec2:DescribeInternetGateways`, `ec2:DescribeAddresses`, `lambda:GetAccountSettings`, `cloudformation:GetTemplate`,\n `cloudformation:DescribeStackResource`. All read-only (`ReadOnlyAccess` covers them). The check also calls\n `sts:GetCallerIdentity`, which IAM never denies.\n- **Results are cached** in `cdk.out/.cdk-preflight/quota-cache.json`: usage and deployed templates for\n `quotaCacheTtl` (5 minutes), quota values for 24 hours. Delete the file to force a refetch.\n- Usage can change between synth and deploy (another team deploying to the same account), so a clean check is not a\n guarantee. The reverse also happens: EC2 does not always enforce the Elastic IP quota when CloudFormation\n creates several addresses in parallel (measured 2026-10-16: with 4 of 5 in use, two parallel `AWS::EC2::EIP` both\n succeeded), so a template the check stops may occasionally deploy. The check follows the quota, not the race.\n- **CloudFormation's own quota warning is a different check.** Since June 2026, creating a change set (and\n `cdk validate` with `--online`, below) warns when a stack would exceed a service quota. That warning runs per stack,\n after the template is uploaded, and never stops the deploy. `checkQuotas` adds up every stack of the app that\n targets the same account and Region, and fails `cdk synth` before anything is uploaded. Both can be on.\n\n## Across stacks\n\nTwo checks read every stack of the app at once, because a single template cannot show the problem. They report\n**warnings** (they have not been reproduced on the bench yet, see [Scope](#scope-and-rule-lifecycle)) and never fail\nsynth, in either mode:\n\n| Check | Finds | Deploy error it predicts |\n|---|---|---|\n| `pf-cfn-export-name-conflict` | two stacks that deploy to the same account and Region export the same name (Stages included) | `Export with name X is already exported by stack Y` |\n| `pf-cfn-import-value-missing-export` | `Fn::ImportValue` of a name that starts with the name of a stack of the app (`Producer:...`, CDK's naming) that this stack, in the same account and Region, does not export | `No export named X found` |\n\nImports of names that do not start with a stack name of the app are left alone, since another app may export them.\nAcknowledge a finding with `cdk-preflight-exports::<rule-id>`, or turn a check off with `exclude`.\n\n## With `cdk validate`\n\nThe CDK CLI's experimental `cdk validate` (`cdk --unstable=validate validate`) synthesizes the app and runs its\nvalidation plugins without deploying, so cdk-preflight runs there exactly as in `cdk synth`: in enforce mode a finding\nfails the command, with `enforce: false` it is a warning (checked with CLI 2.1147.0). `--watch` re-runs it on each\nchange. `--online` (the default) also submits the templates to CloudFormation's pre-deployment validation, which\nneeds credentials and adds the server-side checks (resource name conflicts, the quota warning above); `--no-online`\nkeeps it offline.\n\n```sh\nnpx cdk --unstable=validate validate --no-online --watch\n```\n\n## With a CloudFormation template\n\nTemplates written without CDK (JSON or YAML) are checked with `check`. It needs no CDK app and no AWS credentials;\n`aws-cdk-lib` only has to be installed next to cdk-preflight:\n\n```sh\nnpm i -D cdk-preflight aws-cdk-lib constructs\nnpx cdkpf check template.yaml\n```\n\n```text\nERROR idle_timeout.timeout_seconds is 5000 but must be between 1 and 4000 seconds (cdk-preflight)\n template/Template/Alb (Alb) aws-cdk-lib.aws_elasticloadbalancingv2.CfnLoadBalancer\n Acknowledge with 'cdk-preflight::pf-elbv2-lb-idle-timeout-range'\n```\n\nEach template is loaded into its own stack with\n[`cloudformation-include`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.cloudformation_include-readme.html)\nand synthesized with `Preflight.apply`, so the rules and the output are the same as in `cdk synth`. Findings name the\ntemplate's file (`template`) and logical ID (`Alb`). The exit code is `0` when nothing fails, `1` on findings, and `2`\nwhen a template cannot be read, so the command works as a CI step as it is.\n\n| Flag | What it does |\n|---|---|\n| `--exclude <id,...>` | Rule ids to skip, as `exclude` |\n| `--warn` | Report findings as warnings and exit `0`, as `enforce: false` |\n| `--region <r>`, `--account <id>` | The environment the template deploys to. Rules that depend on the Region or account only run when it is given |\n| `--output <dir>` | Where to write the synthesized assembly and `validation-report.json`. Default: a temporary directory |\n\nSeveral templates can be checked at once: `npx cdkpf check network.yaml app.yaml`.\n`cfn-idle-cost` and `cfn-exec-policy` read template files directly as well.\n\n## Bundled rules\n\nSee [docs/rules.md](docs/rules.md) for the generated rule table.\n\n<!-- supported-resources:start -->\n<details>\n<summary><b>453 resource types across 85 services</b> — click to expand</summary>\n\nResource names are relative to `AWS::<Service>::`; the number in parentheses is how many rules target that type.\n\n| Service | Resource types |\n|---|---|\n| **(any resource type)** | `*` (14) |\n| **ApiGateway** | `ApiKey` (1), `Authorizer` (5), `Deployment` (1), `DocumentationPart` (1), `DomainName` (4), `GatewayResponse` (1), `Method` (15), `Model` (3), `Resource` (1), `RestApi` (5), `Stage` (9), `UsagePlan` (5), `VpcLink` (1) |\n| **ApiGatewayV2** | `Api` (5), `Authorizer` (11), `DomainName` (3), `Integration` (16), `IntegrationResponse` (1), `Model` (2), `Route` (6), `RouteResponse` (2), `Stage` (4), `VpcLink` (1) |\n| **ApplicationAutoScaling** | `ScalableTarget` (19), `ScalingPolicy` (30) |\n| **AppSync** | `Api` (7), `ApiCache` (4), `ApiKey` (2), `ChannelNamespace` (5), `DataSource` (15), `DomainName` (1), `FunctionConfiguration` (24), `GraphQLApi` (16), `GraphQLSchema` (12), `Resolver` (32), `SourceApiAssociation` (3) |\n| **APS** | `AnomalyDetector` (9), `ResourcePolicy` (5), `RuleGroupsNamespace` (10), `Workspace` (12) |\n| **Athena** | `DataCatalog` (6), `WorkGroup` (8) |\n| **AutoScaling** | `AutoScalingGroup` (39), `LifecycleHook` (8), `ScalingPolicy` (41), `ScheduledAction` (13), `WarmPool` (4) |\n| **Backup** | `BackupPlan` (12), `BackupSelection` (5), `BackupVault` (4), `Framework` (3), `LogicallyAirGappedBackupVault` (2), `ReportPlan` (2), `RestoreTestingPlan` (5), `RestoreTestingSelection` (3) |\n| **Batch** | `ComputeEnvironment` (40), `ConsumableResource` (2), `JobDefinition` (109), `JobQueue` (18), `SchedulingPolicy` (8), `ServiceEnvironment` (6) |\n| **BCM** | `ScheduledReport` (1) |\n| **Bedrock** | `ApplicationInferenceProfile` (2), `AutomatedReasoningPolicy` (3), `Blueprint` (3), `DataAutomationProject` (8), `DataSource` (12), `Flow` (14), `Guardrail` (19), `IntelligentPromptRouter` (5), `KnowledgeBase` (18), `Prompt` (4) |\n| **BedrockAgentCore** | `ApiKeyCredentialProvider` (1), `BrowserCustom` (1), `BrowserProfile` (1), `CapacityProvider` (8), `CodeInterpreterCustom` (1), `ConfigurationBundle` (3), `Dataset` (2), `Evaluator` (3), `Gateway` (16), `GatewayRateLimit` (5), `GatewayRule` (5), `GatewayTarget` (11), `Harness` (3), `HarnessEndpoint` (2), `Memory` (14), `OAuth2CredentialProvider` (5), `OnlineEvaluationConfig` (3), `PaymentCredentialProvider` (1), `PaymentManager` (1), `Policy` (3), `ResourcePolicy` (1), `Runtime` (16), `RuntimeEndpoint` (1) |\n| **Cassandra** | `Keyspace` (2), `Table` (21), `Type` (12) |\n| **CertificateManager** | `Certificate` (4) |\n| **CloudFormation** | `GuardHook` (1), `Stack` (2), `StackSet` (6) |\n| **CloudFront** | `AnycastIpList` (1), `CachePolicy` (7), `ContinuousDeploymentPolicy` (5), `Distribution` (54), `Function` (4), `KeyGroup` (1), `KeyValueStore` (2), `OriginRequestPolicy` (5), `PublicKey` (1), `RealtimeLogConfig` (3), `ResponseHeadersPolicy` (8), `VpcOrigin` (2) |\n| **CloudTrail** | `EventDataStore` (1), `Trail` (20) |\n| **CloudWatch** | `Alarm` (24), `AnomalyDetector` (6), `CompositeAlarm` (7), `Dashboard` (14), `InsightRule` (7), `LogAlarm` (2), `MetricStream` (6), `Space` (1) |\n| **CodeBuild** | `Project` (37), `ReportGroup` (2), `SourceCredential` (4) |\n| **CodeCommit** | `Repository` (11) |\n| **CodeDeploy** | `Application` (7), `DeploymentConfig` (12), `DeploymentGroup` (23) |\n| **CodePipeline** | `CustomActionType` (3), `Pipeline` (25), `Webhook` (2) |\n| **Cognito** | `IdentityPool` (3), `IdentityPoolRoleAttachment` (7), `LogDeliveryConfiguration` (3), `ManagedLoginBranding` (2), `UserPool` (53), `UserPoolClient` (21), `UserPoolDomain` (7), `UserPoolGroup` (1), `UserPoolIdentityProvider` (11), `UserPoolResourceServer` (4), `UserPoolRiskConfigurationAttachment` (6), `UserPoolUICustomizationAttachment` (2) |\n| **Config** | `ConfigRule` (6), `ConfigurationAggregator` (2), `ConfigurationRecorder` (7), `ConformancePack` (1), `RemediationConfiguration` (2) |\n| **DirectoryService** | `MicrosoftAD` (10) |\n| **DocDB** | `DBCluster` (14), `DBInstance` (1), `DBSubnetGroup` (2), `EventSubscription` (1) |\n| **DocDBElastic** | `Cluster` (7) |\n| **DynamoDB** | `GlobalTable` (25), `Table` (28) |\n| **EC2** | `ClientVpnAuthorizationRule` (1), `ClientVpnEndpoint` (6), `DHCPOptions` (2), `EIPAssociation` (1), `FlowLog` (4), `Instance` (10), `InstanceEventWindow` (2), `KeyPair` (1), `LaunchTemplate` (12), `NatGateway` (2), `NetworkAclEntry` (1), `NetworkInterface` (2), `PlacementGroup` (3), `PrefixList` (3), `Route` (1), `SecondaryNetwork` (1), `SecurityGroup` (8), `SecurityGroupEgress` (5), `SecurityGroupIngress` (5), `Subnet` (16), `SubnetCidrReservation` (1), `TrafficMirrorTarget` (1), `TransitGateway` (2), `TransitGatewayRoute` (1), `Volume` (6), `VPC` (2), `VPCCidrBlock` (1), `VPCEndpoint` (4), `VPCGatewayAttachment` (1), `VPNConnection` (5) |\n| **ECR** | `PullThroughCacheRule` (3), `RegistryScanningConfiguration` (1), `ReplicationConfiguration` (1), `Repository` (7), `RepositoryCreationTemplate` (8), `SigningConfiguration` (1) |\n| **ECS** | `CapacityProvider` (3), `Cluster` (5), `Service` (39), `TaskDefinition` (70), `TaskSet` (2) |\n| **EFS** | `AccessPoint` (1), `FileSystem` (7), `MountTarget` (4) |\n| **EKS** | `AccessEntry` (14), `Addon` (5), `Cluster` (26), `FargateProfile` (5), `IdentityProviderConfig` (3), `Nodegroup` (21), `PodIdentityAssociation` (5) |\n| **ElastiCache** | `CacheCluster` (9), `ReplicationGroup` (14), `ServerlessCache` (2), `User` (2), `UserGroup` (1) |\n| **ElasticBeanstalk** | `Application` (2), `ConfigurationTemplate` (36), `Environment` (34) |\n| **ElasticLoadBalancingV2** | `Listener` (57), `ListenerCertificate` (2), `ListenerRule` (38), `LoadBalancer` (37), `TargetGroup` (58), `TrustStore` (1), `TrustStoreRevocation` (1) |\n| **Events** | `ApiDestination` (1), `Archive` (5), `Connection` (1), `Endpoint` (2), `EventBus` (2), `Rule` (28) |\n| **EventSchemas** | `Discoverer` (1), `Registry` (1), `RegistryPolicy` (1), `Schema` (1) |\n| **EventsV2** | `Subscriber` (5) |\n| **FSx** | `FileSystem` (1) |\n| **GlobalAccelerator** | `Accelerator` (1), `EndpointGroup` (5), `Listener` (2) |\n| **Glue** | `Classifier` (6), `Connection` (5), `Crawler` (10), `CustomEntityType` (1), `Database` (1), `DataQualityRuleset` (1), `Job` (15), `MLTransform` (4), `Partition` (1), `Schema` (3), `SecurityConfiguration` (1), `Session` (1), `Table` (1), `Trigger` (10), `UserDefinedFunction` (2), `Workflow` (1) |\n| **Grafana** | `Workspace` (7) |\n| **IAM** | `Group` (23), `GroupPolicy` (19), `InstanceProfile` (2), `ManagedPolicy` (31), `OIDCProvider` (2), `Policy` (30), `Role` (46), `RolePolicy` (20), `ServiceLinkedRole` (1), `User` (24), `UserPolicy` (19) |\n| **IoT** | `Authorizer` (3), `Certificate` (1), `CertificateProvider` (1), `Command` (1), `DomainConfiguration` (3), `Job` (2), `JobTemplate` (3), `MitigationAction` (1), `Policy` (4), `PolicyPrincipalAttachment` (1), `ProvisioningTemplate` (3), `RoleAlias` (1), `ScheduledAudit` (1), `Thing` (1), `ThingGroup` (2), `TopicRule` (6), `TopicRuleDestination` (2) |\n| **Kinesis** | `Channel` (3), `ResourcePolicy` (4), `Stream` (6), `StreamConsumer` (2) |\n| **KinesisAnalyticsV2** | `Application` (20), `ApplicationCloudWatchLoggingOption` (1), `ApplicationOutput` (1), `ApplicationReferenceDataSource` (1) |\n| **KinesisFirehose** | `DeliveryStream` (68) |\n| **KMS** | `Alias` (2), `Key` (12), `ReplicaKey` (4) |\n| **Lambda** | `Alias` (7), `CodeSigningConfig` (1), `EventInvokeConfig` (5), `EventSourceMapping` (54), `Function` (57), `LayerVersion` (6), `LayerVersionPermission` (3), `NetworkConnector` (2), `Permission` (15), `Url` (9), `Version` (1), `WebFunctionEndpoint` (2) |\n| **Logs** | `AccountPolicy` (6), `DeliveryDestination` (3), `Destination` (1), `LogAnomalyDetector` (2), `LogGroup` (10), `MetricFilter` (7), `QueryDefinition` (1), `ResourcePolicy` (1), `SubscriptionFilter` (6), `Transformer` (3) |\n| **MediaConvert** | `JobTemplate` (9), `Preset` (32), `Queue` (2) |\n| **MediaTailor** | `Function` (4) |\n| **MemoryDB** | `Cluster` (8), `User` (1) |\n| **MSK** | `BatchScramSecret` (2), `Cluster` (31), `ClusterPolicy` (1), `Configuration` (4), `Replicator` (10), `ServerlessCluster` (4) |\n| **Neptune** | `DBCluster` (11), `DBClusterParameterGroup` (1), `DBInstance` (3), `DBSubnetGroup` (1), `GlobalCluster` (1) |\n| **NeptuneGraph** | `Graph` (2), `PrivateGraphEndpoint` (1) |\n| **NetworkFirewall** | `ContainerAssociation` (1), `FirewallPolicy` (18), `RuleGroup` (34), `TLSInspectionConfiguration` (7) |\n| **OpenSearchServerless** | `AccessPolicy` (7), `Collection` (2), `CollectionGroup` (3), `LifecyclePolicy` (4), `SecurityConfig` (5), `SecurityPolicy` (14) |\n| **OpenSearchService** | `Domain` (65) |\n| **Pipes** | `Pipe` (9) |\n| **RDS** | `DBCluster` (21), `DBInstance` (38), `DBParameterGroup` (2), `DBProxy` (4), `DBProxyTargetGroup` (2), `DBShardGroup` (1), `DBSubnetGroup` (3), `EventSubscription` (3), `OptionGroup` (1) |\n| **Redshift** | `Cluster` (21), `EventSubscription` (2), `ScheduledAction` (2), `Snapshot` (1), `UsageLimit` (2) |\n| **RedshiftServerless** | `Namespace` (5), `Workgroup` (6) |\n| **Route53** | `CidrCollection` (11), `DNSSEC` (3), `HealthCheck` (30), `HostedZone` (15), `KeySigningKey` (9), `QueryLoggingConfig` (3), `RecordSet` (74), `RecordSetGroup` (76) |\n| **Route53Profiles** | `ProfileAssociation` (1), `ProfileResourceAssociation` (6) |\n| **Route53Resolver** | `FirewallDomainList` (3), `FirewallRuleGroup` (18), `FirewallRuleGroupAssociation` (4), `ResolverDNSSECConfig` (1), `ResolverEndpoint` (18), `ResolverQueryLoggingConfig` (1), `ResolverQueryLoggingConfigAssociation` (1), `ResolverRule` (15), `ResolverRuleAssociation` (1) |\n| **S3** | `AccessPoint` (1), `Bucket` (55), `BucketPolicy` (4), `StorageLens` (5), `StorageLensGroup` (3) |\n| **S3Express** | `AccessPoint` (3), `DirectoryBucket` (11) |\n| **Scheduler** | `Schedule` (12), `ScheduleGroup` (1) |\n| **SecretsManager** | `RotationSchedule` (4), `Secret` (5), `SecretTargetAttachment` (1) |\n| **ServiceDiscovery** | `HttpNamespace` (3), `Instance` (19), `PrivateDnsNamespace` (4), `PublicDnsNamespace` (4), `Service` (14) |\n| **SES** | `ConfigurationSetEventDestination` (8), `ContactList` (1), `EmailIdentity` (6), `ReceiptRule` (6), `ReceiptRuleSet` (1), `Template` (1) |\n| **SNS** | `Subscription` (12), `Topic` (19), `TopicPolicy` (2) |\n| **SQS** | `Queue` (10), `QueuePolicy` (1) |\n| **SSM** | `Association` (4), `Document` (3), `MaintenanceWindow` (2), `MaintenanceWindowTarget` (1), `MaintenanceWindowTask` (1), `Parameter` (5) |\n| **StepFunctions** | `Activity` (3), `StateMachine` (26) |\n| **Synthetics** | `Canary` (16) |\n| **Transcribe** | `Vocabulary` (2) |\n| **Transfer** | `Server` (2) |\n| **VerifiedPermissions** | `IdentitySource` (3), `Policy` (26), `PolicyStore` (23), `PolicyStoreAlias` (1), `PolicyTemplate` (29) |\n| **VpcLattice** | `AccessLogSubscription` (3), `AuthPolicy` (3), `DomainVerification` (1), `Listener` (12), `ResourceConfiguration` (30), `ResourceGateway` (6), `ResourcePolicy` (1), `Rule` (7), `Service` (2), `ServiceNetwork` (1), `ServiceNetworkResourceAssociation` (3), `ServiceNetworkServiceAssociation` (3), `ServiceNetworkVpcAssociation` (8), `TargetGroup` (14) |\n| **WAFv2** | `IPSet` (3), `LoggingConfiguration` (3), `RegexPatternSet` (3), `RuleGroup` (18), `WebACL` (23), `WebACLAssociation` (2) |\n| **XRay** | `Group` (1), `ResourcePolicy` (3), `SamplingRule` (6) |\n\n</details>\n<!-- supported-resources:end -->\n\nHighlights:\n\n- **ELBv2**: `idle_timeout` / `deregistration_delay` / `slow_start` attribute ranges (stringly-typed Key/Value attributes are invisible to schema validation)\n- **IAM**: managed (6,144 chars) and inline (role/group/user) policy document size limits\n- **CloudFront**: `MinTTL <= DefaultTTL <= MaxTTL` ordering, ACM certificates must live in `us-east-1`\n- **Step Functions**: `Next`/`Default`/`Choices` must reference defined states (a dangling `StartAt` is already caught by the engine's built-in `E3601`)\n- **EC2**: security group TCP/UDP port ranges and `FromPort <= ToPort`\n\n## Pull request report (GitHub Action)\n\nThe repository is also a GitHub Action that synthesizes the app on both sides of a pull request and posts **one comment** with:\n\n- the cdk-preflight findings of the pull request, `enforce: false` warnings included (from `cdk.out/validation-report.json`, or the synth log),\n- the idle cost change, from [cfn-idle-cost](https://github.com/badmintoncryer/cfn-idle-cost) (what the stacks cost a month with zero traffic),\n- the CloudFormation execution role permission change, from [cfn-exec-policy](https://github.com/badmintoncryer/cfn-exec-policy).\n\n```yaml\nname: cdk-report\non: pull_request\npermissions: { contents: read, pull-requests: write }\njobs:\n report:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v7\n - uses: actions/setup-node@v7\n with: { node-version: 22 }\n - uses: badmintoncryer/cdk-preflight@main # pin a commit SHA to keep the report from changing under you\n with:\n idle-cost-args: --region us-east-1 --max-increase 50\n exec-policy-args: --fail-on wildcard,unknown\n```\n\nThe base branch is fetched and synthesized in a separate worktree, so neither side needs AWS credentials (unless the app's synth does lookups that are not in `cdk.context.json`). The comment is updated on each push and also written to the job summary. The job fails when the pull request has cdk-preflight errors, does not synthesize, or goes over a budget or `--fail-on` given to the other two tools; the `failed` output says which.\n\n| Input | What it does |\n|---|---|\n| `working-directory` | Directory of the CDK app (where `cdk.json` is). Default `.` |\n| `install` | Install command, run on both sides. Default `npm ci`; empty to skip |\n| `synth` | Synth command, run on both sides. It must write `cdk.out` in the app directory. Default `npx cdk synth -q` |\n| `base-ref` | Branch to compare against. Default: the pull request's base branch |\n| `idle-cost`, `idle-cost-args`, `idle-cost-version` | `false` to leave the idle cost out; more `cfn-idle-cost` flags (`--region` is needed for env-agnostic stacks); the `cfn-idle-cost` version to run (pinned by default) |\n| `exec-policy`, `exec-policy-args`, `exec-policy-version` | `false` to leave the permissions out; more `cfn-exec-policy diff` flags; the `cfn-exec-policy` version to run (pinned by default) |\n| `comment` | `false` to only write the job summary. Default `true` |\n| `github-token` | Token used to comment. Default `github.token` |\n\nWhen the base branch does not synthesize, the idle cost is shown for the whole app instead of the change, and the permission change is left out.\n\n## For AI agents\n\nTo add cdk-preflight to a CDK app:\n\n1. `npm i -D cdk-preflight`\n2. `npx cdk-preflight init` — or the shorter alias `npx cdkpf init` (finds the entry point via `cdk.json` and inserts `Preflight.apply(app)`; use `--dry-run` to preview)\n3. Run `cdk synth`. Violations fail the synth with a validation report; each finding carries a rule id, the actual value, and a suggested fix\n4. To fix a finding, prefer correcting the resource. To opt out instead: `exclude: ['<rule-id>']` disables one rule, `enforce: false` switches to warn-only reporting\n\nThe machine-readable findings are written to `cdk.out/validation-report.json` when synthesizing with `-c @aws-cdk/core:validationReportJson=true`.\n\nFor a CloudFormation template written without CDK, run `npx cdkpf check <template...>` instead (exit `1` on findings; `--output <dir>` keeps `validation-report.json`).\n\nThe two sibling tools also run as MCP servers, so an agent can check the same `cdk.out` for what it costs idle and\nwhat it asks of the CloudFormation execution role:\n\n```sh\nclaude mcp add idle-cost -- npx -y cfn-idle-cost mcp # idle_cost\nclaude mcp add exec-policy -- npx -y cfn-exec-policy mcp # exec_policy_explain / _generate / _diff / _doctor\n```\n\n### Report missed deploy errors\n\ncdk-preflight only knows the failure modes it has benched. When a deploy fails on a constraint the pack should have caught, that report is how new rules get added — but at that moment cdk-preflight is out of the loop (it passed the synth), so the instruction has to already sit in your agent's context. Paste this into your repository's `AGENTS.md` (or `CLAUDE.md`):\n\n```markdown\n## cdk-preflight: report missed deploy errors\n\nIf `cdk deploy` fails even though `cdk synth` (with cdk-preflight enabled) passed,\nand the failure is a service-side validation rejection — CREATE_FAILED/UPDATE_FAILED\nwith a 400-class message such as \"Invalid request provided: ...\" — cdk-preflight is\nmissing a rule. Report it:\n\n1. Qualify first. NOT reportable: AccessDenied / permissions, service quotas\n (those belong to the opt-in `checkQuotas`; open a regular issue if it missed one),\n throttling, name conflicts with existing resources, stabilization timeouts.\n2. Redact account-specific data (account IDs -> 123456789012, real ARNs/domains\n -> placeholders).\n3. Search existing issues: https://github.com/badmintoncryer/cdk-preflight/issues\n4. With your user's approval, open a \"Missed deploy error\" issue with the verbatim\n error message, the resource type, a minimal template snippet, and your\n aws-cdk-lib / cdk-preflight versions.\n```\n\n### Report false positives\n\nA finding on a template that deploys is a bug in the rule. `exclude` or an acknowledgement unblocks your build, but only a report fixes it for everyone: each fixed report is kept as a regression fixture, so the same shape cannot come back. Paste this into your repository's `AGENTS.md` (or `CLAUDE.md`) next to the section above:\n\n```markdown\n## cdk-preflight: report false positives\n\nIf cdk-preflight reports a finding on a resource that deploys fine — the same\ntemplate (or the same resource with the same property values) reached\nCREATE_COMPLETE / UPDATE_COMPLETE, or is already running — the rule is wrong.\nUnblock the build with an acknowledgement or `exclude`, then report it:\n\n1. Reduce it to the smallest synthesized template (`Resources` only) on which\n the rule still fires; run `npx cdkpf check <template> --region <deploy Region>`\n to confirm.\n2. Redact account-specific data (account IDs -> 123456789012, real ARNs/domains\n -> placeholders).\n3. Search existing issues: https://github.com/badmintoncryer/cdk-preflight/issues\n4. With your user's approval, open a \"False positive\" issue with the rule id,\n the finding text, the minimal template, how you know it deploys, the deploy\n Region, and your aws-cdk-lib / cdk-preflight versions.\n```\n\n## Scope and rule lifecycle\n\nA constraint belongs in the pack when violating it makes a real deployment fail, or lets the deployment succeed and then makes every run of the deployed resource fail (an SSM Automation association that targets several tags, for example), *and* no layer that sees the same synthesized template already blocks it. There is no further \"is this worth a rule\" question — if the gap is real, it gets a rule.\n\nCDK L2 construct validation is deliberately **not** one of those layers. `CfnXxx` usage, escape hatches, `addPropertyOverride`, `cloudformation-include` and migrated templates all bypass L2, so an L2 guard covering the same mistake neither disqualifies a rule nor retires one.\n\nThat makes growth the normal state, and it has a consequence worth knowing before you upgrade: **new rules land in minor releases, so a minor upgrade can newly fail a `cdk synth` that passed yesterday.** That is intended, not a regression. If you need a frozen rule set, pin the version; to drop a single rule, `exclude: ['<rule-id>']`; to see everything without failing the build, `enforce: false`.\n\nRules move the other way too. Once the validation engine bundled in `aws-cdk-lib` starts blocking a constraint, the rule records the engine version that covers it and stops being evaluated on that engine or later — but only where that changes nothing about whether synth fails: with `enforce: false`, with `strict: true`, or when your app sets the context `@aws-cdk/core:validateAgainstDefaultRules: true`. In the default enforce mode the CDK reports its own engine's errors as warnings, so the rule keeps running and you may see both. Users on an older `aws-cdk-lib` keep the rule either way; it is deleted only once the minimum supported `aws-cdk-lib` bundles an engine that covers it.\n\n## How it works\n\n`Preflight.apply()` evaluates the rules with the [cloudformation-validate](https://github.com/aws-cloudformation/cloudformation-validate) Rust/WASM engine that ships inside `aws-cdk-lib` — no extra binaries, and no network access at synth time unless you opt in to `checkQuotas`, which calls AWS from a child process. In the default enforce mode the engine is invoked through a dedicated CDK validation plugin so that violations fail synthesis; with `enforce: false` the rules are instead injected into the CDK built-in `CloudFormationValidatePlugin` and reported as warnings.\n\nConstraints that *can* be expressed in schemas or generic engine rules also make good upstream PRs to that engine, but nothing here waits on one — the upstream release cycle is deliberately slower than this pack's. Each rule's `meta.yaml` tracks its upstream status so that retirement stays bookkeeping.\n\n## Requirements\n\n- `aws-cdk-lib` >= 2.267.0, released 2026-08-27 (the first release that bundles the built-in CloudFormation validator). This is a recent release — an existing CDK app may need an upgrade before cdk-preflight can run.\n\n## Contributing\n\nRule authoring, the verification gates (including real-deploy reproduction), and the test layout are documented in [AGENTS.md](AGENTS.md) — written for AI coding agents and humans alike.\n\n## License\n\nApache-2.0\n"
9894
9894
  },
9895
9895
  "repository": {
9896
9896
  "type": "git",
@@ -10111,6 +10111,6 @@
10111
10111
  "symbolId": "src/index:PreflightOptions"
10112
10112
  }
10113
10113
  },
10114
- "version": "1.28.0",
10115
- "fingerprint": "gIlcUV0VwBuGxjs3ZogARKWLOk2jGuik7qT9X4llHeI="
10114
+ "version": "1.30.0",
10115
+ "fingerprint": "AGkigZMSu3jdZnTB2A3G06wB8a/B3etYZ3CI5Dj5rhA="
10116
10116
  }
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  <a href="https://github.com/badmintoncryer/cdk-preflight/actions/workflows/monthly-verify.yml"><img src="https://github.com/badmintoncryer/cdk-preflight/actions/workflows/monthly-verify.yml/badge.svg" alt="monthly real-deploy verification"></a>
13
13
  <a href="https://www.npmjs.com/package/cdk-preflight"><img src="https://img.shields.io/npm/v/cdk-preflight.svg" alt="npm version"></a>
14
14
  <a href="https://www.npmjs.com/package/cdk-preflight"><img src="https://img.shields.io/npm/dt/cdk-preflight.svg" alt="npm total downloads"></a>
15
- <a href="docs/rules.md"><img src="https://img.shields.io/badge/rules-3412-blue" alt="3412 bundled rules"></a>
15
+ <a href="docs/rules.md"><img src="https://img.shields.io/badge/rules-3442-blue" alt="3442 bundled rules"></a>
16
16
  </p>
17
17
 
18
18
  Some CloudFormation constraints are not expressed in resource provider schemas — they live only in documentation, in service API validation, or across multiple properties. Templates that violate them pass `cdk synth`, pass CloudFormation pre-deployment validation, and then fail minutes into a deployment, burning a rollback cycle.
@@ -258,41 +258,42 @@ See [docs/rules.md](docs/rules.md) for the generated rule table.
258
258
 
259
259
  <!-- supported-resources:start -->
260
260
  <details>
261
- <summary><b>444 resource types across 83 services</b> — click to expand</summary>
261
+ <summary><b>453 resource types across 85 services</b> — click to expand</summary>
262
262
 
263
263
  Resource names are relative to `AWS::<Service>::`; the number in parentheses is how many rules target that type.
264
264
 
265
265
  | Service | Resource types |
266
266
  |---|---|
267
267
  | **(any resource type)** | `*` (14) |
268
- | **ApiGateway** | `ApiKey` (1), `Authorizer` (5), `Deployment` (1), `DocumentationPart` (1), `DomainName` (4), `GatewayResponse` (1), `Method` (14), `Model` (3), `Resource` (1), `RestApi` (5), `Stage` (9), `UsagePlan` (5), `VpcLink` (1) |
269
- | **ApiGatewayV2** | `Api` (5), `Authorizer` (11), `DomainName` (3), `Integration` (15), `IntegrationResponse` (1), `Model` (2), `Route` (6), `RouteResponse` (2), `Stage` (4), `VpcLink` (1) |
268
+ | **ApiGateway** | `ApiKey` (1), `Authorizer` (5), `Deployment` (1), `DocumentationPart` (1), `DomainName` (4), `GatewayResponse` (1), `Method` (15), `Model` (3), `Resource` (1), `RestApi` (5), `Stage` (9), `UsagePlan` (5), `VpcLink` (1) |
269
+ | **ApiGatewayV2** | `Api` (5), `Authorizer` (11), `DomainName` (3), `Integration` (16), `IntegrationResponse` (1), `Model` (2), `Route` (6), `RouteResponse` (2), `Stage` (4), `VpcLink` (1) |
270
270
  | **ApplicationAutoScaling** | `ScalableTarget` (19), `ScalingPolicy` (30) |
271
271
  | **AppSync** | `Api` (7), `ApiCache` (4), `ApiKey` (2), `ChannelNamespace` (5), `DataSource` (15), `DomainName` (1), `FunctionConfiguration` (24), `GraphQLApi` (16), `GraphQLSchema` (12), `Resolver` (32), `SourceApiAssociation` (3) |
272
272
  | **APS** | `AnomalyDetector` (9), `ResourcePolicy` (5), `RuleGroupsNamespace` (10), `Workspace` (12) |
273
273
  | **Athena** | `DataCatalog` (6), `WorkGroup` (8) |
274
274
  | **AutoScaling** | `AutoScalingGroup` (39), `LifecycleHook` (8), `ScalingPolicy` (41), `ScheduledAction` (13), `WarmPool` (4) |
275
- | **Backup** | `BackupPlan` (12), `BackupSelection` (5), `BackupVault` (3), `Framework` (3), `LogicallyAirGappedBackupVault` (2), `ReportPlan` (2), `RestoreTestingPlan` (5), `RestoreTestingSelection` (3) |
275
+ | **Backup** | `BackupPlan` (12), `BackupSelection` (5), `BackupVault` (4), `Framework` (3), `LogicallyAirGappedBackupVault` (2), `ReportPlan` (2), `RestoreTestingPlan` (5), `RestoreTestingSelection` (3) |
276
276
  | **Batch** | `ComputeEnvironment` (40), `ConsumableResource` (2), `JobDefinition` (109), `JobQueue` (18), `SchedulingPolicy` (8), `ServiceEnvironment` (6) |
277
+ | **BCM** | `ScheduledReport` (1) |
277
278
  | **Bedrock** | `ApplicationInferenceProfile` (2), `AutomatedReasoningPolicy` (3), `Blueprint` (3), `DataAutomationProject` (8), `DataSource` (12), `Flow` (14), `Guardrail` (19), `IntelligentPromptRouter` (5), `KnowledgeBase` (18), `Prompt` (4) |
278
279
  | **BedrockAgentCore** | `ApiKeyCredentialProvider` (1), `BrowserCustom` (1), `BrowserProfile` (1), `CapacityProvider` (8), `CodeInterpreterCustom` (1), `ConfigurationBundle` (3), `Dataset` (2), `Evaluator` (3), `Gateway` (16), `GatewayRateLimit` (5), `GatewayRule` (5), `GatewayTarget` (11), `Harness` (3), `HarnessEndpoint` (2), `Memory` (14), `OAuth2CredentialProvider` (5), `OnlineEvaluationConfig` (3), `PaymentCredentialProvider` (1), `PaymentManager` (1), `Policy` (3), `ResourcePolicy` (1), `Runtime` (16), `RuntimeEndpoint` (1) |
279
280
  | **Cassandra** | `Keyspace` (2), `Table` (21), `Type` (12) |
280
281
  | **CertificateManager** | `Certificate` (4) |
281
282
  | **CloudFormation** | `GuardHook` (1), `Stack` (2), `StackSet` (6) |
282
283
  | **CloudFront** | `AnycastIpList` (1), `CachePolicy` (7), `ContinuousDeploymentPolicy` (5), `Distribution` (54), `Function` (4), `KeyGroup` (1), `KeyValueStore` (2), `OriginRequestPolicy` (5), `PublicKey` (1), `RealtimeLogConfig` (3), `ResponseHeadersPolicy` (8), `VpcOrigin` (2) |
283
- | **CloudTrail** | `EventDataStore` (1), `Trail` (19) |
284
- | **CloudWatch** | `Alarm` (23), `AnomalyDetector` (6), `CompositeAlarm` (7), `Dashboard` (14), `InsightRule` (7), `LogAlarm` (2), `MetricStream` (6) |
284
+ | **CloudTrail** | `EventDataStore` (1), `Trail` (20) |
285
+ | **CloudWatch** | `Alarm` (24), `AnomalyDetector` (6), `CompositeAlarm` (7), `Dashboard` (14), `InsightRule` (7), `LogAlarm` (2), `MetricStream` (6), `Space` (1) |
285
286
  | **CodeBuild** | `Project` (37), `ReportGroup` (2), `SourceCredential` (4) |
286
287
  | **CodeCommit** | `Repository` (11) |
287
288
  | **CodeDeploy** | `Application` (7), `DeploymentConfig` (12), `DeploymentGroup` (23) |
288
289
  | **CodePipeline** | `CustomActionType` (3), `Pipeline` (25), `Webhook` (2) |
289
- | **Cognito** | `IdentityPool` (3), `IdentityPoolRoleAttachment` (7), `LogDeliveryConfiguration` (3), `ManagedLoginBranding` (2), `UserPool` (52), `UserPoolClient` (21), `UserPoolDomain` (7), `UserPoolGroup` (1), `UserPoolIdentityProvider` (11), `UserPoolResourceServer` (4), `UserPoolRiskConfigurationAttachment` (6), `UserPoolUICustomizationAttachment` (2) |
290
+ | **Cognito** | `IdentityPool` (3), `IdentityPoolRoleAttachment` (7), `LogDeliveryConfiguration` (3), `ManagedLoginBranding` (2), `UserPool` (53), `UserPoolClient` (21), `UserPoolDomain` (7), `UserPoolGroup` (1), `UserPoolIdentityProvider` (11), `UserPoolResourceServer` (4), `UserPoolRiskConfigurationAttachment` (6), `UserPoolUICustomizationAttachment` (2) |
290
291
  | **Config** | `ConfigRule` (6), `ConfigurationAggregator` (2), `ConfigurationRecorder` (7), `ConformancePack` (1), `RemediationConfiguration` (2) |
291
292
  | **DirectoryService** | `MicrosoftAD` (10) |
292
293
  | **DocDB** | `DBCluster` (14), `DBInstance` (1), `DBSubnetGroup` (2), `EventSubscription` (1) |
293
294
  | **DocDBElastic** | `Cluster` (7) |
294
295
  | **DynamoDB** | `GlobalTable` (25), `Table` (28) |
295
- | **EC2** | `ClientVpnAuthorizationRule` (1), `ClientVpnEndpoint` (6), `DHCPOptions` (2), `EIPAssociation` (1), `FlowLog` (4), `Instance` (10), `KeyPair` (1), `LaunchTemplate` (12), `NatGateway` (2), `NetworkAclEntry` (1), `NetworkInterface` (2), `PlacementGroup` (3), `PrefixList` (3), `Route` (1), `SecurityGroup` (8), `SecurityGroupEgress` (5), `SecurityGroupIngress` (5), `Subnet` (16), `SubnetCidrReservation` (1), `TrafficMirrorTarget` (1), `TransitGateway` (2), `TransitGatewayRoute` (1), `Volume` (6), `VPC` (2), `VPCCidrBlock` (1), `VPCEndpoint` (4), `VPCGatewayAttachment` (1), `VPNConnection` (5) |
296
+ | **EC2** | `ClientVpnAuthorizationRule` (1), `ClientVpnEndpoint` (6), `DHCPOptions` (2), `EIPAssociation` (1), `FlowLog` (4), `Instance` (10), `InstanceEventWindow` (2), `KeyPair` (1), `LaunchTemplate` (12), `NatGateway` (2), `NetworkAclEntry` (1), `NetworkInterface` (2), `PlacementGroup` (3), `PrefixList` (3), `Route` (1), `SecondaryNetwork` (1), `SecurityGroup` (8), `SecurityGroupEgress` (5), `SecurityGroupIngress` (5), `Subnet` (16), `SubnetCidrReservation` (1), `TrafficMirrorTarget` (1), `TransitGateway` (2), `TransitGatewayRoute` (1), `Volume` (6), `VPC` (2), `VPCCidrBlock` (1), `VPCEndpoint` (4), `VPCGatewayAttachment` (1), `VPNConnection` (5) |
296
297
  | **ECR** | `PullThroughCacheRule` (3), `RegistryScanningConfiguration` (1), `ReplicationConfiguration` (1), `Repository` (7), `RepositoryCreationTemplate` (8), `SigningConfiguration` (1) |
297
298
  | **ECS** | `CapacityProvider` (3), `Cluster` (5), `Service` (39), `TaskDefinition` (70), `TaskSet` (2) |
298
299
  | **EFS** | `AccessPoint` (1), `FileSystem` (7), `MountTarget` (4) |
@@ -300,22 +301,23 @@ Resource names are relative to `AWS::<Service>::`; the number in parentheses is
300
301
  | **ElastiCache** | `CacheCluster` (9), `ReplicationGroup` (14), `ServerlessCache` (2), `User` (2), `UserGroup` (1) |
301
302
  | **ElasticBeanstalk** | `Application` (2), `ConfigurationTemplate` (36), `Environment` (34) |
302
303
  | **ElasticLoadBalancingV2** | `Listener` (57), `ListenerCertificate` (2), `ListenerRule` (38), `LoadBalancer` (37), `TargetGroup` (58), `TrustStore` (1), `TrustStoreRevocation` (1) |
303
- | **Events** | `ApiDestination` (1), `Archive` (5), `Connection` (1), `Endpoint` (2), `EventBus` (2), `Rule` (27) |
304
+ | **Events** | `ApiDestination` (1), `Archive` (5), `Connection` (1), `Endpoint` (2), `EventBus` (2), `Rule` (28) |
304
305
  | **EventSchemas** | `Discoverer` (1), `Registry` (1), `RegistryPolicy` (1), `Schema` (1) |
305
- | **EventsV2** | `Subscriber` (3) |
306
+ | **EventsV2** | `Subscriber` (5) |
306
307
  | **FSx** | `FileSystem` (1) |
307
308
  | **GlobalAccelerator** | `Accelerator` (1), `EndpointGroup` (5), `Listener` (2) |
308
- | **Glue** | `Classifier` (6), `Connection` (5), `Crawler` (10), `CustomEntityType` (1), `Database` (1), `DataQualityRuleset` (1), `Job` (15), `MLTransform` (4), `Partition` (1), `Schema` (3), `SecurityConfiguration` (1), `Table` (1), `Trigger` (10), `UserDefinedFunction` (2), `Workflow` (1) |
309
+ | **Glue** | `Classifier` (6), `Connection` (5), `Crawler` (10), `CustomEntityType` (1), `Database` (1), `DataQualityRuleset` (1), `Job` (15), `MLTransform` (4), `Partition` (1), `Schema` (3), `SecurityConfiguration` (1), `Session` (1), `Table` (1), `Trigger` (10), `UserDefinedFunction` (2), `Workflow` (1) |
309
310
  | **Grafana** | `Workspace` (7) |
310
- | **IAM** | `Group` (23), `GroupPolicy` (19), `InstanceProfile` (2), `ManagedPolicy` (31), `OIDCProvider` (2), `Policy` (30), `Role` (45), `RolePolicy` (20), `ServiceLinkedRole` (1), `User` (24), `UserPolicy` (19) |
311
- | **IoT** | `Authorizer` (3), `Certificate` (1), `CertificateProvider` (1), `Command` (1), `DomainConfiguration` (3), `Job` (2), `JobTemplate` (3), `MitigationAction` (1), `Policy` (4), `PolicyPrincipalAttachment` (1), `ProvisioningTemplate` (3), `RoleAlias` (1), `ScheduledAudit` (1), `Thing` (1), `ThingGroup` (2), `TopicRule` (5), `TopicRuleDestination` (2) |
311
+ | **IAM** | `Group` (23), `GroupPolicy` (19), `InstanceProfile` (2), `ManagedPolicy` (31), `OIDCProvider` (2), `Policy` (30), `Role` (46), `RolePolicy` (20), `ServiceLinkedRole` (1), `User` (24), `UserPolicy` (19) |
312
+ | **IoT** | `Authorizer` (3), `Certificate` (1), `CertificateProvider` (1), `Command` (1), `DomainConfiguration` (3), `Job` (2), `JobTemplate` (3), `MitigationAction` (1), `Policy` (4), `PolicyPrincipalAttachment` (1), `ProvisioningTemplate` (3), `RoleAlias` (1), `ScheduledAudit` (1), `Thing` (1), `ThingGroup` (2), `TopicRule` (6), `TopicRuleDestination` (2) |
312
313
  | **Kinesis** | `Channel` (3), `ResourcePolicy` (4), `Stream` (6), `StreamConsumer` (2) |
313
314
  | **KinesisAnalyticsV2** | `Application` (20), `ApplicationCloudWatchLoggingOption` (1), `ApplicationOutput` (1), `ApplicationReferenceDataSource` (1) |
314
315
  | **KinesisFirehose** | `DeliveryStream` (68) |
315
316
  | **KMS** | `Alias` (2), `Key` (12), `ReplicaKey` (4) |
316
- | **Lambda** | `Alias` (7), `CodeSigningConfig` (1), `EventInvokeConfig` (5), `EventSourceMapping` (54), `Function` (49), `LayerVersion` (6), `LayerVersionPermission` (3), `NetworkConnector` (2), `Permission` (8), `Url` (8), `Version` (1) |
317
+ | **Lambda** | `Alias` (7), `CodeSigningConfig` (1), `EventInvokeConfig` (5), `EventSourceMapping` (54), `Function` (57), `LayerVersion` (6), `LayerVersionPermission` (3), `NetworkConnector` (2), `Permission` (15), `Url` (9), `Version` (1), `WebFunctionEndpoint` (2) |
317
318
  | **Logs** | `AccountPolicy` (6), `DeliveryDestination` (3), `Destination` (1), `LogAnomalyDetector` (2), `LogGroup` (10), `MetricFilter` (7), `QueryDefinition` (1), `ResourcePolicy` (1), `SubscriptionFilter` (6), `Transformer` (3) |
318
319
  | **MediaConvert** | `JobTemplate` (9), `Preset` (32), `Queue` (2) |
320
+ | **MediaTailor** | `Function` (4) |
319
321
  | **MemoryDB** | `Cluster` (8), `User` (1) |
320
322
  | **MSK** | `BatchScramSecret` (2), `Cluster` (31), `ClusterPolicy` (1), `Configuration` (4), `Replicator` (10), `ServerlessCluster` (4) |
321
323
  | **Neptune** | `DBCluster` (11), `DBClusterParameterGroup` (1), `DBInstance` (3), `DBSubnetGroup` (1), `GlobalCluster` (1) |
@@ -325,18 +327,18 @@ Resource names are relative to `AWS::<Service>::`; the number in parentheses is
325
327
  | **OpenSearchService** | `Domain` (65) |
326
328
  | **Pipes** | `Pipe` (9) |
327
329
  | **RDS** | `DBCluster` (21), `DBInstance` (38), `DBParameterGroup` (2), `DBProxy` (4), `DBProxyTargetGroup` (2), `DBShardGroup` (1), `DBSubnetGroup` (3), `EventSubscription` (3), `OptionGroup` (1) |
328
- | **Redshift** | `Cluster` (21), `EventSubscription` (1), `ScheduledAction` (2) |
330
+ | **Redshift** | `Cluster` (21), `EventSubscription` (2), `ScheduledAction` (2), `Snapshot` (1), `UsageLimit` (2) |
329
331
  | **RedshiftServerless** | `Namespace` (5), `Workgroup` (6) |
330
332
  | **Route53** | `CidrCollection` (11), `DNSSEC` (3), `HealthCheck` (30), `HostedZone` (15), `KeySigningKey` (9), `QueryLoggingConfig` (3), `RecordSet` (74), `RecordSetGroup` (76) |
331
333
  | **Route53Profiles** | `ProfileAssociation` (1), `ProfileResourceAssociation` (6) |
332
334
  | **Route53Resolver** | `FirewallDomainList` (3), `FirewallRuleGroup` (18), `FirewallRuleGroupAssociation` (4), `ResolverDNSSECConfig` (1), `ResolverEndpoint` (18), `ResolverQueryLoggingConfig` (1), `ResolverQueryLoggingConfigAssociation` (1), `ResolverRule` (15), `ResolverRuleAssociation` (1) |
333
- | **S3** | `AccessPoint` (1), `Bucket` (54), `BucketPolicy` (4), `StorageLens` (5), `StorageLensGroup` (3) |
335
+ | **S3** | `AccessPoint` (1), `Bucket` (55), `BucketPolicy` (4), `StorageLens` (5), `StorageLensGroup` (3) |
334
336
  | **S3Express** | `AccessPoint` (3), `DirectoryBucket` (11) |
335
337
  | **Scheduler** | `Schedule` (12), `ScheduleGroup` (1) |
336
338
  | **SecretsManager** | `RotationSchedule` (4), `Secret` (5), `SecretTargetAttachment` (1) |
337
339
  | **ServiceDiscovery** | `HttpNamespace` (3), `Instance` (19), `PrivateDnsNamespace` (4), `PublicDnsNamespace` (4), `Service` (14) |
338
340
  | **SES** | `ConfigurationSetEventDestination` (8), `ContactList` (1), `EmailIdentity` (6), `ReceiptRule` (6), `ReceiptRuleSet` (1), `Template` (1) |
339
- | **SNS** | `Subscription` (11), `Topic` (15), `TopicPolicy` (2) |
341
+ | **SNS** | `Subscription` (12), `Topic` (19), `TopicPolicy` (2) |
340
342
  | **SQS** | `Queue` (10), `QueuePolicy` (1) |
341
343
  | **SSM** | `Association` (4), `Document` (3), `MaintenanceWindow` (2), `MaintenanceWindowTarget` (1), `MaintenanceWindowTask` (1), `Parameter` (5) |
342
344
  | **StepFunctions** | `Activity` (3), `StateMachine` (26) |
package/docs/rules.md CHANGED
@@ -60,6 +60,7 @@
60
60
  | `pf-apigw-integration-request-parameter-value` | AWS::ApiGateway::Method | Static integration request parameters must be single-quoted | ERROR | none |
61
61
  | `pf-apigw-integration-response-selection-pattern` | AWS::ApiGateway::Method | SelectionPattern must be a valid regular expression | ERROR | none |
62
62
  | `pf-apigw-integration-vpc-link-connection-id` | AWS::ApiGateway::Method | A VPC_LINK integration needs a ConnectionId | ERROR | none |
63
+ | `pf-apigw-lambda-integration-permission` | AWS::ApiGateway::Method<br>AWS::Lambda::Function<br>AWS::Lambda::Permission | A REST API Lambda integration needs a permission that lets apigateway.amazonaws.com invoke the function | WARN | none |
63
64
  | `pf-apigw-lambda-integration-post` | AWS::ApiGateway::Method | A Lambda integration's IntegrationHttpMethod must be POST | ERROR | none |
64
65
  | `pf-apigw-method-authorization-scopes-cognito` | AWS::ApiGateway::Method | AuthorizationScopes needs COGNITO_USER_POOLS or JWT authorization | ERROR | none |
65
66
  | `pf-apigw-method-authorizer-id` | AWS::ApiGateway::Method | CUSTOM and COGNITO_USER_POOLS authorization need AuthorizerId | ERROR | none |
@@ -117,6 +118,7 @@
117
118
  | `pf-apigwv2-jwt-audience-required` | AWS::ApiGatewayV2::Authorizer | A JWT authorizer needs at least one audience | ERROR | none |
118
119
  | `pf-apigwv2-jwt-authorizer-config` | AWS::ApiGatewayV2::Authorizer | JWT authorizers need JwtConfiguration | ERROR | none |
119
120
  | `pf-apigwv2-jwt-issuer-https` | AWS::ApiGatewayV2::Authorizer | A JWT issuer is an https URL | ERROR | none |
121
+ | `pf-apigwv2-lambda-integration-permission` | AWS::ApiGatewayV2::Integration<br>AWS::Lambda::Function<br>AWS::Lambda::Permission | An HTTP API Lambda integration needs a permission that lets apigateway.amazonaws.com invoke the function | WARN | none |
120
122
  | `pf-apigwv2-model-name-alphanumeric` | AWS::ApiGatewayV2::Model | Model names are alphanumeric | ERROR | none |
121
123
  | `pf-apigwv2-model-websocket-only` | AWS::ApiGatewayV2::Model | Models exist on WebSocket APIs only | ERROR | none |
122
124
  | `pf-apigwv2-request-authorizer-payload-version` | AWS::ApiGatewayV2::Authorizer | REQUEST authorizers on HTTP APIs need AuthorizerPayloadFormatVersion | ERROR | none |
@@ -486,6 +488,7 @@
486
488
  | `pf-backup-vault-encryption-key-region` | AWS::Backup::BackupVault | A backup vault encryption key must live in the deploy region | ERROR | none |
487
489
  | `pf-backup-vault-lock-changeable-for-days-min` | AWS::Backup::BackupVault | A compliance-mode vault lock needs a cooling-off period of at least 3 days | ERROR | none |
488
490
  | `pf-backup-vault-lock-min-le-max-retention` | AWS::Backup::BackupVault | A vault lock MinRetentionDays may not exceed MaxRetentionDays | ERROR | none |
491
+ | `pf-backup-vault-notification-aws-managed-key` | AWS::Backup::BackupVault<br>AWS::SNS::Topic | AWS Backup cannot publish vault events to a topic encrypted with the AWS managed key alias/aws/sns | ERROR | none |
489
492
  | `pf-batch-ce-allocation-strategy-compute-type` | AWS::Batch::ComputeEnvironment | The allocation strategy must match the compute resource type | ERROR | none |
490
493
  | `pf-batch-ce-bid-percentage-range` | AWS::Batch::ComputeEnvironment | BidPercentage must be between 0 and 100 | ERROR | none |
491
494
  | `pf-batch-ce-desired-vcpus-range` | AWS::Batch::ComputeEnvironment | DesiredvCpus must sit between MinvCpus and MaxvCpus | ERROR | none |
@@ -669,6 +672,7 @@
669
672
  | `pf-batch-sp-weight-factor-range` | AWS::Batch::SchedulingPolicy | WeightFactor must be between 0.0001 and 999.9999 | ERROR | none |
670
673
  | `pf-batch-timeout-minimum` | AWS::Batch::JobDefinition | Timeout.AttemptDurationSeconds must be at least 60 | ERROR | none |
671
674
  | `pf-batch-unmanaged-fargate` | AWS::Batch::ComputeEnvironment | UNMANAGED compute environments cannot be Fargate | ERROR | none |
675
+ | `pf-bcm-scheduled-report-cron-fields` | AWS::BCM::ScheduledReport | A scheduled report's ScheduleExpression is a six-field cron expression | ERROR | none |
672
676
  | `pf-bedrock-automated-reasoning-policy-names-unique` | AWS::Bedrock::AutomatedReasoningPolicy | Names and ids inside a policy definition must be unique | ERROR | none |
673
677
  | `pf-bedrock-automated-reasoning-policy-variable-type` | AWS::Bedrock::AutomatedReasoningPolicy | Policy variables must use a type declared in PolicyDefinition.Types | ERROR | none |
674
678
  | `pf-bedrock-automated-reasoning-policy-version` | AWS::Bedrock::AutomatedReasoningPolicy | PolicyDefinition.Version must be 1.0 | ERROR | none |
@@ -978,6 +982,7 @@
978
982
  | `pf-cloudfront-vpc-origin-port-range` | AWS::CloudFront::VpcOrigin | VPC origin ports must be 80, 443 or 1024-65535 | ERROR | none |
979
983
  | `pf-cloudfront-wafv2-webacl-scope` | AWS::CloudFront::Distribution | A WAFv2 web ACL attached to CloudFront must be globally scoped | ERROR | none |
980
984
  | `pf-cloudtrail-eds-context-key-requires-large-event-size` | AWS::CloudTrail::EventDataStore | Context key selectors require MaxEventSize Large | ERROR | none |
985
+ | `pf-cloudtrail-sns-aws-managed-key` | AWS::CloudTrail::Trail<br>AWS::SNS::Topic | CloudTrail cannot publish log file notifications to a topic encrypted with the AWS managed key alias/aws/sns | ERROR | none |
981
986
  | `pf-cloudtrail-trail-aes-conditions-max` | AWS::CloudTrail::Trail | A trail holds at most 500 advanced event selector condition values | ERROR | none |
982
987
  | `pf-cloudtrail-trail-aes-data-requires-resources-type` | AWS::CloudTrail::Trail | A Data event selector needs a resources.type field | ERROR | none |
983
988
  | `pf-cloudtrail-trail-aes-error-code-value` | AWS::CloudTrail::Trail | VpceAccessDenied is the only errorCode a selector can filter on | ERROR | none |
@@ -1000,6 +1005,7 @@
1000
1005
  | `pf-cloudwatch-alarm-action-vendor` | AWS::CloudWatch::Alarm | Alarm actions accept only the CloudWatch action vendors | ERROR | none |
1001
1006
  | `pf-cloudwatch-alarm-actions-max` | AWS::CloudWatch::Alarm | Each alarm action list holds at most 5 ARNs | ERROR | none |
1002
1007
  | `pf-cloudwatch-alarm-anomaly-autoscaling-action` | AWS::CloudWatch::Alarm | An anomaly-detection alarm cannot carry an Auto Scaling action | ERROR | none |
1008
+ | `pf-cloudwatch-alarm-ec2-action-instance-id` | AWS::CloudWatch::Alarm | An alarm with an EC2 action must watch a metric with the InstanceId dimension | ERROR | none |
1003
1009
  | `pf-cloudwatch-alarm-ec2-action-region` | AWS::CloudWatch::Alarm | An EC2 automate action must name the stack's own region | ERROR | none |
1004
1010
  | `pf-cloudwatch-alarm-evaluation-window` | AWS::CloudWatch::Alarm | The evaluation window caps at 7 days (Period >= 3600) or 1 day (Period < 3600) | ERROR | none |
1005
1011
  | `pf-cloudwatch-alarm-expressions-max` | AWS::CloudWatch::Alarm | An alarm takes at most 10 math expressions | ERROR | none |
@@ -1056,6 +1062,7 @@
1056
1062
  | `pf-cloudwatch-metric-stream-include-metrics` | AWS::CloudWatch::MetricStream | A statistics configuration needs at least one IncludeMetrics entry | ERROR | none |
1057
1063
  | `pf-cloudwatch-metric-stream-role-account` | AWS::CloudWatch::MetricStream | RoleArn must be in the stack's own account | ERROR | none |
1058
1064
  | `pf-cloudwatch-metricstat-stat-syntax` | AWS::CloudWatch::Alarm | MetricStat.Stat must be a CloudWatch statistic | ERROR | none |
1065
+ | `pf-cloudwatch-space-kms-region` | AWS::CloudWatch::Space | A space's KmsKeyArn names the deploy Region | ERROR | none |
1059
1066
  | `pf-cloudwatch-threshold-metric-id` | AWS::CloudWatch::Alarm | ThresholdMetricId must match a metric query that returns data | ERROR | none |
1060
1067
  | `pf-codebuild-artifacts-encryption-disabled-s3-only` | AWS::CodeBuild::Project | Artifacts.EncryptionDisabled cannot be set on NO_ARTIFACTS | ERROR | none |
1061
1068
  | `pf-codebuild-artifacts-no-artifacts-no-location` | AWS::CodeBuild::Project | NO_ARTIFACTS carries no Location | ERROR | none |
@@ -1276,6 +1283,7 @@
1276
1283
  | `pf-cognito-temporary-password-validity-range` | AWS::Cognito::UserPool | TemporaryPasswordValidityDays must be between 0 and 365 | ERROR | retired: engine F3034 covers it from aws-cdk-lib 2.268.0 |
1277
1284
  | `pf-cognito-token-expiration-order` | AWS::Cognito::UserPoolClient | Access and id tokens cannot outlive the refresh token | ERROR | none |
1278
1285
  | `pf-cognito-token-validity-range` | AWS::Cognito::UserPoolClient | Token validity ranges depend on token type and unit | ERROR | none |
1286
+ | `pf-cognito-trigger-lambda-permission` | AWS::Cognito::UserPool<br>AWS::Lambda::Function<br>AWS::Lambda::Permission | A user pool Lambda trigger needs a permission that lets cognito-idp.amazonaws.com invoke the function | WARN | none |
1279
1287
  | `pf-cognito-ui-customization-css-properties` | AWS::Cognito::UserPoolUICustomizationAttachment | Hosted UI CSS only styles the -customizable classes | ERROR | none |
1280
1288
  | `pf-cognito-ui-customization-requires-domain` | AWS::Cognito::UserPoolUICustomizationAttachment<br>AWS::Cognito::UserPoolDomain | Hosted UI customization requires a domain on the pool | ERROR | none |
1281
1289
  | `pf-cognito-unused-account-validity-exclusive` | AWS::Cognito::UserPool | UnusedAccountValidityDays and TemporaryPasswordValidityDays are exclusive | ERROR | none |
@@ -1417,6 +1425,8 @@
1417
1425
  | `pf-ec2-host-resource-group-tenancy` | AWS::EC2::Instance | HostResourceGroupArn requires Tenancy host | ERROR | none |
1418
1426
  | `pf-ec2-instance-ami-arch` | AWS::EC2::Instance | Instance type architecture must match the SSM public-parameter AMI architecture | ERROR | none |
1419
1427
  | `pf-ec2-instance-eni-exclusive` | AWS::EC2::Instance | An instance cannot mix NetworkInterfaces with instance-level security groups | ERROR | none |
1428
+ | `pf-ec2-instance-event-window-time-or-cron` | AWS::EC2::InstanceEventWindow | An instance event window takes exactly one of TimeRanges and CronExpression | ERROR | none |
1429
+ | `pf-ec2-instance-event-window-time-range-length` | AWS::EC2::InstanceEventWindow | Each time range of an instance event window lasts at least 4 hours | ERROR | none |
1420
1430
  | `pf-ec2-instance-ipv6-exclusive` | AWS::EC2::Instance | Ipv6AddressCount and Ipv6Addresses are mutually exclusive | ERROR | none |
1421
1431
  | `pf-ec2-instance-requirements-exclusive` | AWS::EC2::LaunchTemplate | A launch template takes either InstanceType or InstanceRequirements | ERROR | none |
1422
1432
  | `pf-ec2-key-pair-name-whitespace` | AWS::EC2::KeyPair | A key pair name cannot have leading or trailing whitespace | ERROR | none |
@@ -1431,6 +1441,7 @@
1431
1441
  | `pf-ec2-prefix-list-max-entries` | AWS::EC2::PrefixList | A managed prefix list cannot hold more entries than MaxEntries | ERROR | none |
1432
1442
  | `pf-ec2-prefix-list-name-reserved` | AWS::EC2::PrefixList | A managed prefix list name cannot use an AWS-reserved prefix | ERROR | none |
1433
1443
  | `pf-ec2-route-target-exactly-one` | AWS::EC2::Route | A route must name exactly one target | ERROR | none |
1444
+ | `pf-ec2-secondary-network-cidr-size` | AWS::EC2::SecondaryNetwork | A secondary network's Ipv4CidrBlock is between /12 and /28 | ERROR | none |
1434
1445
  | `pf-ec2-sg-cidr-valid` | AWS::EC2::SecurityGroup<br>AWS::EC2::SecurityGroupIngress<br>AWS::EC2::SecurityGroupEgress | Security group rule CidrIp must be a well-formed IPv4 CIDR | ERROR | none |
1435
1446
  | `pf-ec2-sg-group-name` | AWS::EC2::SecurityGroup | Security group names may not start with sg- | ERROR | none |
1436
1447
  | `pf-ec2-sg-group-name-default` | AWS::EC2::SecurityGroup | A security group cannot be named default | ERROR | none |
@@ -1931,14 +1942,17 @@
1931
1942
  | `pf-events-target-id-duplicate` | AWS::Events::Rule | Target ids must be unique within a rule | ERROR | none |
1932
1943
  | `pf-events-target-input-exclusive` | AWS::Events::Rule | Input, InputPath and InputTransformer are mutually exclusive | ERROR | none |
1933
1944
  | `pf-events-target-input-json` | AWS::Events::Rule | Target Input must be valid JSON | ERROR | none |
1945
+ | `pf-events-target-lambda-permission` | AWS::Events::Rule<br>AWS::Lambda::Function<br>AWS::Lambda::Permission | A Lambda target of an EventBridge rule needs a permission that lets events.amazonaws.com invoke it | WARN | none |
1934
1946
  | `pf-events-target-parameters-mismatch` | AWS::Events::Rule | Target parameter blocks must match the target's resource type | ERROR | none |
1935
1947
  | `pf-events-target-parameters-required` | AWS::Events::Rule | ECS, Batch and FIFO queue targets require their parameter block | ERROR | none |
1936
1948
  | `pf-events-target-redshift-parameters` | AWS::Events::Rule | RedshiftDataParameters takes one statement form and one credential form | ERROR | none |
1937
1949
  | `pf-events-target-role-required` | AWS::Events::Rule | Targets other than Lambda, SNS, SQS and CloudWatch Logs require RoleArn | ERROR | none |
1938
1950
  | `pf-events-target-role-trust` | AWS::Events::Rule<br>AWS::IAM::Role | A target's RoleArn must be a role that trusts events.amazonaws.com | ERROR | none |
1939
1951
  | `pf-eventsv2-subscriber-batch-size-target` | AWS::EventsV2::Subscriber | An EventsV2 subscriber's MaxBatchSize is capped by its target's service | ERROR | none |
1952
+ | `pf-eventsv2-subscriber-invocation-timeout` | AWS::EventsV2::Subscriber | A universal target's InvocationTimeoutSeconds is 1 to 30 | ERROR | none |
1940
1953
  | `pf-eventsv2-subscriber-jsonata-config` | AWS::EventsV2::Subscriber | An EventsV2 subscriber's JSONATA transformer needs JsonataConfiguration | ERROR | none |
1941
1954
  | `pf-eventsv2-subscriber-pit-timestamp-starting-point` | AWS::EventsV2::Subscriber | An EventsV2 subscriber starting at a TIMESTAMP needs StartingPoint | ERROR | none |
1955
+ | `pf-eventsv2-subscriber-usi-batch-config` | AWS::EventsV2::Subscriber | An EventsV2 subscriber with a universal service integration target needs BatchConfiguration | ERROR | none |
1942
1956
  | `pf-eventschemas-discoverer-source` | AWS::EventSchemas::Discoverer | A discoverer source must be an event bus in the discoverer's Region | ERROR | none |
1943
1957
  | `pf-eventschemas-registry-name-reserved` | AWS::EventSchemas::Registry | A registry name may not use the reserved aws. prefix | ERROR | none |
1944
1958
  | `pf-eventschemas-registry-policy` | AWS::EventSchemas::RegistryPolicy | A registry policy must declare a Version | ERROR | none |
@@ -2068,6 +2082,7 @@
2068
2082
  | `pf-glue-schema-definition-format` | AWS::Glue::Schema | SchemaDefinition must parse as the declared DataFormat | ERROR | none |
2069
2083
  | `pf-glue-schema-name-charset` | AWS::Glue::Schema | A schema name is limited to letters, digits and - _ $ | ERROR | pending-engine |
2070
2084
  | `pf-glue-security-configuration-kms-key` | AWS::Glue::SecurityConfiguration | KMS encryption modes need a KmsKeyArn | ERROR | none |
2085
+ | `pf-glue-session-version` | AWS::Glue::Session | A Glue interactive session needs GlueVersion above 2.0 | ERROR | none |
2071
2086
  | `pf-glue-table-iceberg-metadata-operation` | AWS::Glue::Table | An Iceberg table needs MetadataOperation in IcebergInput | ERROR | pending-engine |
2072
2087
  | `pf-glue-trigger-action-job-or-crawler` | AWS::Glue::Trigger | A trigger action names either a job or a crawler, not both | ERROR | none |
2073
2088
  | `pf-glue-trigger-condition-crawl-state` | AWS::Glue::Trigger | A crawler condition can only watch SUCCEEDED, FAILED or CANCELLED | ERROR | pending-engine |
@@ -2160,6 +2175,7 @@
2160
2175
  | `pf-iot-provisioningtemplate-hook-region` | AWS::IoT::ProvisioningTemplate | A pre-provisioning hook's Lambda must live in the template's region | ERROR | none |
2161
2176
  | `pf-iot-provisioningtemplate-policy-exclusive` | AWS::IoT::ProvisioningTemplate | A policy inside TemplateBody takes PolicyName or PolicyDocument, not both | ERROR | none |
2162
2177
  | `pf-iot-rolealias-name-charset` | AWS::IoT::RoleAlias | RoleAlias accepts only [A-Za-z0-9_=,@-] | ERROR | none |
2178
+ | `pf-iot-rule-lambda-permission` | AWS::IoT::TopicRule<br>AWS::Lambda::Function<br>AWS::Lambda::Permission | An IoT rule's Lambda action needs a permission that lets iot.amazonaws.com invoke the function | WARN | none |
2163
2179
  | `pf-iot-scheduledaudit-frequency-day` | AWS::IoT::ScheduledAudit | Frequency decides which day property is required | ERROR | none |
2164
2180
  | `pf-iot-sql-from-topic-filter` | AWS::IoT::TopicRule | A rule's FROM topic filter must use # only as the last level and + alone in its level | ERROR | none |
2165
2181
  | `pf-iot-sql-version-functions` | AWS::IoT::TopicRule | encode() needs AwsIotSqlVersion 2016-03-23 | ERROR | none |
@@ -2335,6 +2351,7 @@
2335
2351
  | `pf-lambda-provisioned-concurrency-not-latest` | AWS::Lambda::Alias | Provisioned concurrency cannot sit on $LATEST | ERROR | none |
2336
2352
  | `pf-lambda-provisioned-sum-not-exceed-reserved` | AWS::Lambda::Function | Provisioned concurrency fits inside the reserved concurrency | ERROR | none |
2337
2353
  | `pf-lambda-recursive-loop-enum` | AWS::Lambda::Function | RecursiveLoop takes Allow or Terminate | ERROR | pending-engine |
2354
+ | `pf-lambda-reserved-concurrency-zero` | AWS::Lambda::Function | ReservedConcurrentExecutions 0 throttles every invocation | WARN | none |
2338
2355
  | `pf-lambda-runtime-arn-manual-only` | AWS::Lambda::Function | A pinned runtime version needs UpdateRuntimeOn: Manual | ERROR | none |
2339
2356
  | `pf-lambda-runtime-manual-requires-arn` | AWS::Lambda::Function | Manual runtime updates need a runtime version ARN | ERROR | none |
2340
2357
  | `pf-lambda-runtime-version-arn-region` | AWS::Lambda::Function | A runtime version ARN names the deploy region | ERROR | none |
@@ -2350,6 +2367,7 @@
2350
2367
  | `pf-lambda-url-cors-allow-methods-wildcard-mix` | AWS::Lambda::Url | CORS methods are a wildcard or a list, not both | ERROR | none |
2351
2368
  | `pf-lambda-url-cors-allow-origins-wildcard-mix` | AWS::Lambda::Url | CORS origins are a wildcard or a list, not both | ERROR | none |
2352
2369
  | `pf-lambda-url-invoke-mode-enum` | AWS::Lambda::Url | InvokeMode is BUFFERED or RESPONSE_STREAM | ERROR | pending-engine |
2370
+ | `pf-lambda-url-none-invoke-function-permission` | AWS::Lambda::Url<br>AWS::Lambda::Function<br>AWS::Lambda::Permission | A function URL with AuthType NONE also needs a lambda:InvokeFunction permission | WARN | none |
2353
2371
  | `pf-lambda-url-qualifier-latest-literal` | AWS::Lambda::Url | A URL qualifier cannot be $LATEST | ERROR | none |
2354
2372
  | `pf-lambda-url-qualifier-permission-match` | AWS::Lambda::Url | A qualified URL needs a qualified permission | ERROR | none |
2355
2373
  | `pf-lambda-url-target-arn-and-qualifier` | AWS::Lambda::Url | The qualifier goes in TargetFunctionArn or Qualifier, not both | ERROR | none |
@@ -2358,6 +2376,8 @@
2358
2376
  | `pf-lambda-vpc-no-dedicated-tenancy` | AWS::Lambda::Function | A VPC function cannot sit in a dedicated-tenancy VPC | ERROR | none |
2359
2377
  | `pf-lambda-vpc-non-empty` | AWS::Lambda::Function | VpcConfig needs at least one subnet and one security group | ERROR | none |
2360
2378
  | `pf-lambda-vpc-same-vpc` | AWS::Lambda::Function | Subnets and security groups belong to one VPC | ERROR | none |
2379
+ | `pf-lambda-webfunction-endpoint-revision-unique` | AWS::Lambda::WebFunctionEndpoint | A web function endpoint lists each revision once in RevisionWeights | ERROR | none |
2380
+ | `pf-lambda-webfunction-endpoint-weights` | AWS::Lambda::WebFunctionEndpoint | A web function endpoint's revision weights add up to 100 | ERROR | none |
2361
2381
  | `pf-lambda-zip-no-imageuri` | AWS::Lambda::Function | A .zip function cannot carry Code.ImageUri | ERROR | none |
2362
2382
  | `pf-lambda-zipfile-handler-missing` | AWS::Lambda::Function | An inline (Code.ZipFile) function's Handler must name a function the inline code defines | ERROR | none |
2363
2383
  | `pf-lambda-zipfile-handler-module` | AWS::Lambda::Function | An inline (Code.ZipFile) function's Handler must load the module index | ERROR | none |
@@ -2439,6 +2459,10 @@
2439
2459
  | `pf-mediaconvert-rc-slowpal-framerate` | AWS::MediaConvert::Preset | SlowPal needs a specified 25 fps framerate | ERROR | none |
2440
2460
  | `pf-mediaconvert-sj-enum-value` | AWS::MediaConvert::Preset | The video codec and the container must be values the service lists | WARN | none |
2441
2461
  | `pf-mediaconvert-sj-string-format` | AWS::MediaConvert::JobTemplate | An HLS output group Destination must be an s3:// URL | ERROR | none |
2462
+ | `pf-mediatailor-function-cache-ttl` | AWS::MediaTailor::Function | A MediaTailor function's cache TtlMaximumSeconds is at least TtlMinimumSeconds | ERROR | none |
2463
+ | `pf-mediatailor-function-http-output` | AWS::MediaTailor::Function | A MediaTailor HTTP_REQUEST function needs HttpRequestConfiguration.Output | ERROR | none |
2464
+ | `pf-mediatailor-function-http-timeout` | AWS::MediaTailor::Function | A MediaTailor HTTP_REQUEST function's RequestTimeoutMilliseconds is at most 2000 | ERROR | none |
2465
+ | `pf-mediatailor-function-id-charset` | AWS::MediaTailor::Function | A MediaTailor function's FunctionId has only letters, digits and underscores | ERROR | none |
2442
2466
  | `pf-memorydb-data-tiering-node-type` | AWS::MemoryDB::Cluster | DataTiering only works on r6gd node types | ERROR | none |
2443
2467
  | `pf-memorydb-engine` | AWS::MemoryDB::Cluster | MemoryDB runs Valkey or Redis, not Memcached | ERROR | none |
2444
2468
  | `pf-memorydb-kms-key-region` | AWS::MemoryDB::Cluster | KmsKeyId must name a key in the deploy region | ERROR | none |
@@ -2725,6 +2749,7 @@
2725
2749
  | `pf-redshift-defer-maintenance-duration-endtime` | AWS::Redshift::Cluster | DeferMaintenanceDuration and DeferMaintenanceEndTime are mutually exclusive | ERROR | none |
2726
2750
  | `pf-redshift-defer-maintenance-duration-max` | AWS::Redshift::Cluster | DeferMaintenanceDuration must be at most 60 days | ERROR | none |
2727
2751
  | `pf-redshift-elastic-ip-publicly-accessible` | AWS::Redshift::Cluster | ElasticIp requires PubliclyAccessible true | ERROR | none |
2752
+ | `pf-redshift-event-subscription-aws-managed-key` | AWS::Redshift::EventSubscription<br>AWS::SNS::Topic | Redshift cannot publish events to a topic encrypted with the AWS managed key alias/aws/sns | ERROR | none |
2728
2753
  | `pf-redshift-eventsub-sourceids-need-sourcetype` | AWS::Redshift::EventSubscription | EventSubscription SourceIds requires SourceType | ERROR | none |
2729
2754
  | `pf-redshift-hsm-identifier-pair` | AWS::Redshift::Cluster | HsmClientCertificateIdentifier and HsmConfigurationIdentifier must be set together | ERROR | none |
2730
2755
  | `pf-redshift-manage-master-password-exclusive` | AWS::Redshift::Cluster | ManageMasterPassword and MasterUserPassword are mutually exclusive | ERROR | none |
@@ -2741,6 +2766,9 @@
2741
2766
  | `pf-redshift-scheduled-action-schedule-format` | AWS::Redshift::ScheduledAction | ScheduledAction Schedule must be an at(...) or cron(...) expression | ERROR | none |
2742
2767
  | `pf-redshift-scheduled-action-start-before-end` | AWS::Redshift::ScheduledAction | ScheduledAction StartTime must be earlier than EndTime | ERROR | none |
2743
2768
  | `pf-redshift-single-node-node-count` | AWS::Redshift::Cluster | single-node clusters must not declare more than one node | ERROR | none |
2769
+ | `pf-redshift-snapshot-retention-not-zero` | AWS::Redshift::Snapshot | A Redshift snapshot's ManualSnapshotRetentionPeriod is -1 or 1 to 3653, never 0 | ERROR | none |
2770
+ | `pf-redshift-usage-limit-amount` | AWS::Redshift::UsageLimit | A Redshift usage limit's Amount is positive | ERROR | none |
2771
+ | `pf-redshift-usage-limit-feature-limit-type` | AWS::Redshift::UsageLimit | A Redshift usage limit's LimitType matches its FeatureType | ERROR | none |
2744
2772
  | `pf-redshiftserverless-admin-password-exclusive` | AWS::RedshiftServerless::Namespace | ManageAdminPassword cannot be combined with AdminUserPassword | ERROR | none |
2745
2773
  | `pf-redshiftserverless-admin-secret-kms-requires-manage` | AWS::RedshiftServerless::Namespace | AdminPasswordSecretKmsKeyId requires ManageAdminPassword | ERROR | none |
2746
2774
  | `pf-redshiftserverless-base-capacity-floor` | AWS::RedshiftServerless::Workgroup | Workgroup BaseCapacity must be at least 4 RPUs | ERROR | none |
@@ -3019,6 +3047,7 @@
3019
3047
  | `pf-s3-replication-filter-requires-delete-marker` | AWS::S3::Bucket | A V2 replication rule with a Filter must also set Priority and DeleteMarkerReplication | ERROR | none |
3020
3048
  | `pf-s3-replication-priority-duplicate` | AWS::S3::Bucket | Replication rule priorities must be unique | ERROR | none |
3021
3049
  | `pf-s3-replication-requires-versioning` | AWS::S3::Bucket | ReplicationConfiguration requires versioning to be enabled on the source bucket | ERROR | none |
3050
+ | `pf-s3-replication-role-trust` | AWS::S3::Bucket<br>AWS::IAM::Role | The replication role of a bucket must trust s3.amazonaws.com | ERROR | none |
3022
3051
  | `pf-s3-replication-rtc-minutes-15` | AWS::S3::Bucket | Replication Time Control accepts only 15 minutes | ERROR | none |
3023
3052
  | `pf-s3-replication-rtc-needs-metrics` | AWS::S3::Bucket | Replication Time Control (ReplicationTime) needs Metrics | ERROR | none |
3024
3053
  | `pf-s3-replication-sse-kms-needs-replica-key` | AWS::S3::Bucket | Replicating SSE-KMS objects requires a replica KMS key | ERROR | none |
@@ -3149,6 +3178,7 @@
3149
3178
  | `pf-sns-large-message-subscription-protocol` | AWS::SNS::Topic<br>AWS::SNS::Subscription | Topics above 256 KiB accept only sqs, lambda and firehose subscriptions | ERROR | none |
3150
3179
  | `pf-sns-raw-message-delivery` | AWS::SNS::Subscription<br>AWS::SNS::Topic | RawMessageDelivery is only supported for sqs, http, https and firehose subscriptions | ERROR | none |
3151
3180
  | `pf-sns-subscription-endpoint` | AWS::SNS::Subscription<br>AWS::SNS::Topic | Subscription Protocol is one of the nine SNS protocols and the Endpoint matches it: an ARN of the right service for sqs/lambda/firehose/application, an email address, a URL with the same scheme for http/https, a phone number for sms | ERROR | none |
3181
+ | `pf-sns-subscription-lambda-permission` | AWS::SNS::Subscription<br>AWS::SNS::Topic<br>AWS::Lambda::Function<br>AWS::Lambda::Permission | A lambda subscription needs a permission that lets sns.amazonaws.com invoke the function | WARN | none |
3152
3182
  | `pf-sns-subscription-redrive` | AWS::SNS::Subscription<br>AWS::SNS::Topic | Subscription RedrivePolicy needs deadLetterTargetArn, which must be an SQS queue ARN in the deploy region | ERROR | none |
3153
3183
  | `pf-sns-subscription-region` | AWS::SNS::Subscription | Subscription.Region must be the topic's region (the region in a literal TopicArn, or the deploy region for a topic in this template) | ERROR | none |
3154
3184
  | `pf-sns-topic-attribute-values` | AWS::SNS::Topic | Topic DisplayName is at most 100 characters, SignatureVersion is 1 or 2, and TracingConfig is PassThrough or Active | ERROR | none |
package/lib/index.js CHANGED
@@ -19,7 +19,7 @@ const rules_generated_1 = require("./rules.generated");
19
19
  * Preflight.apply(app);
20
20
  */
21
21
  class Preflight {
22
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-preflight.Preflight", version: "1.28.0" };
22
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-preflight.Preflight", version: "1.30.0" };
23
23
  /**
24
24
  * Register the cdk-preflight rules on an App or Stage.
25
25
  */