Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/compare_cfnlint.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def _load_cfnlint_result_file(f, prefix, results):

def load_cfnlint_results_from_files():
results = {}
for subdir in ["bad", "cdk", "good", "integration", "issues", "lsp", "public", "quickstart"]:
for subdir in ["bad", "cdk", "good", "gh-issues", "integration", "issues", "lsp", "public", "quickstart"]:
d = CFN_LINT_RESULTS / subdir
if not d.exists():
continue
Expand Down
467 changes: 414 additions & 53 deletions scripts/report_cel_detailed.md

Large diffs are not rendered by default.

467 changes: 414 additions & 53 deletions scripts/report_rego_detailed.md

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resolver = "2"
name = "cloudformation-validate"

[workspace.package]
version = "1.2.0"
version = "1.3.0"
edition = "2024"
license = "Apache-2.0"
description = "AWS CloudFormation Validate"
Expand Down
2 changes: 1 addition & 1 deletion src/bindings-jvm/tests/kotlin/src/test/kotlin/SmokeTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SmokeTest {
private val EXPECTED_TEMPLATES: List<String>
private val COMBINED_GOLDEN: Map<String, Any?>

private val GOLDEN_DIRS = listOf("bad", "cdk", "good", "integration", "issues", "lsp", "public", "quickstart")
private val GOLDEN_DIRS = listOf("bad", "cdk", "good", "gh-issues", "integration", "issues", "lsp", "public", "quickstart")

init {
val goldenFile = File(expectedDir, "all_templates.json")
Expand Down
2 changes: 1 addition & 1 deletion src/bindings-wasm/tests/smoke.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
fs.readFileSync(path.join(EXPECTED_DIR, "all_templates.json"), "utf-8")
);

const GOLDEN_DIRS = ['bad', 'cdk', 'good', 'integration', 'issues', 'lsp', 'public', 'quickstart'];
const GOLDEN_DIRS = ['bad', 'cdk', 'good', 'gh-issues', 'integration', 'issues', 'lsp', 'public', 'quickstart'];

function discoverAllTemplates(): string[] {
const templates: string[] = [];
Expand Down Expand Up @@ -96,7 +96,7 @@

describe("version", () => {
it("returns the crate version from workspace Cargo.toml", () => {
expect(version()).toBe(readWorkspaceVersion());

Check failure on line 99 in src/bindings-wasm/tests/smoke.test.ts

View workflow job for this annotation

GitHub Actions / validate / test-wasm

smoke.test.ts > version > returns the crate version from workspace Cargo.toml

AssertionError: expected '1.2.0' to be '1.3.0' // Object.is equality Expected: "1.3.0" Received: "1.2.0" ❯ smoke.test.ts:99:23
});
});

Expand Down Expand Up @@ -388,7 +388,7 @@
for (const rel of EXPECTED_TEMPLATES) {
it(rel, () => {
const actual = engine.validateDetailed(loadTemplate(rel), { severityLevel: "DEBUG" });
expect(zeroPerformanceDurations(actual, rel)).toEqual(zeroPerformanceDurations(loadGolden(rel)));

Check failure on line 391 in src/bindings-wasm/tests/smoke.test.ts

View workflow job for this annotation

GitHub Actions / validate / test-wasm

smoke.test.ts > golden file validation > rego detailed matches golden > bad/conditions/equals.yaml

AssertionError: expected { …(5) } to deeply equal { …(5) } - Expected + Received @@ -2,74 +2,74 @@ "diagnostics": [ { "category": "Intrinsic Function", "message": "Fn::Equals: 'Value' is not of type 'array'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::Equals: argument 0: [{'Ref': 'AWS::Region'}] is not of type 'string'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::Equals: argument 0: {'Ref': 'AWS::Region', 'Fn::Select': ['Environments', 0]} is not of type 'string'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::Equals: argument 1: ['Not a List'] is not of type 'string'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::Equals: argument 1: {'Bad': 'Value'} is not of type 'string'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::Equals: expected maximum item count: 2, found: 3", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::Equals: expected minimum item count: 2, found: 1", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::Equals: null is not of type 'array'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { ❯ smoke.test.ts:391:57

Check failure on line 391 in src/bindings-wasm/tests/smoke.test.ts

View workflow job for this annotation

GitHub Actions / validate / test-wasm

smoke.test.ts > golden file validation > rego detailed matches golden > bad/conditions/condition_functions.json

AssertionError: expected { …(5) } to deeply equal { …(5) } - Expected + Received @@ -20,137 +20,137 @@ }, { "category": "Intrinsic Function", "message": "Fn::And: 'And' is not of type 'array'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::And: element 0: 'Test' is not of type 'boolean'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", - "message": "Fn::And: element 0: {'Condition': 'TestAndString', 'Extra': 'ThisIsBad'} is not of type 'boolean'", + "message": "Fn::And: element 0: {\"Condition\":\"TestAndString\",\"Extra\":\"ThisIsBad\"} is not of type 'boolean'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::And: element 1: 'Test2' is not of type 'boolean'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", - "message": "Fn::And: element 1: {'Bad': 'TestAndString'} is not of type 'boolean'", + "message": "Fn::And: element 1: {\"Bad\":\"TestAndString\"} is not of type 'boolean'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::And: expected minimum item count: 2, found: 1", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::And: null is not of type 'array'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::Equals: 'Value' is not of type 'array'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", - "message": "Fn::Equals: argument 0: [{'Ref': 'AWS::Region'}] is not of type 'string'", + "message": "Fn::Equals: argument 0: [{\"Ref\":\"AWS::Region\"}] is not of type 'string'", "phase": "PARSE", - "ruleDescription": "Boolean cond

Check failure on line 391 in src/bindings-wasm/tests/smoke.test.ts

View workflow job for this annotation

GitHub Actions / validate / test-wasm

smoke.test.ts > golden file validation > rego detailed matches golden > bad/conditions/and.yaml

AssertionError: expected { …(5) } to deeply equal { …(5) } - Expected + Received @@ -2,74 +2,74 @@ "diagnostics": [ { "category": "Intrinsic Function", "message": "Fn::And: 'And' is not of type 'array'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::And: element 0: 'Test' is not of type 'boolean'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::And: element 0: {'Condition': 'TestAndToMany', 'Extra': 'ThisIsBad'} is not of type 'boolean'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::And: element 1: 'Test2' is not of type 'boolean'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::And: element 1: {'Bad': 'TestAndToMany'} is not of type 'boolean'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::And: expected maximum item count: 10, found: 11", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::And: expected minimum item count: 2, found: 1", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { "category": "Intrinsic Function", "message": "Fn::And: null is not of type 'array'", "phase": "PARSE", - "ruleDescription": "Boolean condition function (Fn::Equals/Fn::And/Fn::Or/Fn::Not) has invalid structure", + "ruleDescription": "Fn::Equals must have exactly 2 elements", "ruleId": "F0014", "severity": "FATAL", "source": "SCHEMA", }, { @@ -117,10 +117,38 @@ { "category": "Best Practice", "endColumn": 11, "endLine": 4, "message": "Condition 'TestAndString' is not used by any resource or Fn::If", + "phase": "LINT", + "ruleDescription": "Check if Conditions are Used", + "ruleId": "W8001", + "section": "Conditions", + "severity": "WARN", + "source": "CFN_LINT", + "startColumn": 1, + "startLine": 4, + }, + { + "category": "Best Practice"

Check failure on line 391 in src/bindings-wasm/tests/smoke.test.ts

View workflow job for this annotation

GitHub Actions / validate / test-wasm

smoke.test.ts > golden file validation > rego detailed matches golden > bad/conditions.yaml

AssertionError: expected { …(5) } to deeply equal { …(5) } - Expected + Received @@ -370,10 +370,28 @@ "source": "ENGINE", "startColumn": 3, "startLine": 70, }, { + "category": "Intrinsic Function", + "endColumn": 12, + "endLine": 77, + "message": "'AvailabilityZone' is not one of [\"InstanceId\", \"PrivateDnsName\", \"PrivateIp\", \"PublicDnsName\", \"PublicIp\", \"State\", \"VpcId\"]", + "phase": "LINT", + "propertyPath": "Properties.AvailabilityZone", + "resourceId": "NewVolume", + "resourceType": "AWS::EC2::Volume", + "ruleDescription": "GetAtt attribute must exist on target resource type", + "ruleId": "E9004", + "section": "Resources", + "severity": "ERROR", + "source": "CFN_LINT", + "startColumn": 3, + "startLine": 77, + "suggestedFix": "Check the resource type documentation for valid GetAtt attributes", + }, + { "category": "Best Practice", "endColumn": 12, "endLine": 77, "message": "'DeletionPolicy' is a required property (The default action when replacing/removing a resource is to delete it. Set explicit values for stateful resource)", "phase": "LINT", @@ -524,10 +542,27 @@ "source": "SCHEMA", "startColumn": 3, "startLine": 83, }, { + "category": "Best Practice", + "endColumn": 25, + "endLine": 83, + "message": "['Fn::If', 2] is not reachable. When setting condition 'EnableGeoBlocking' to False from current status True", + "phase": "LINT", + "propertyPath": "Properties.DistributionConfig.Restrictions.GeoRestriction.Fn::If.1.RestrictionType.Fn::If.2", + "resourceId": "CloudFrontDistribution", + "resourceType": "AWS::CloudFront::Distribution", + "ruleDescription": "Check Fn::If has a path that cannot be reached", + "ruleId": "W1028", + "section": "Resources", + "severity": "WARN", + "source": "CFN_LINT", + "startColumn": 3, + "startLine": 83, + }, + { "category": "Deprecation", "context": { "lifecycle": "deprecated", }, "endColumn": 25, @@ -566,14 +601,14 @@ ], "filePath": "bad/conditions.yaml", "metadata": { "counts": { "debug": 0, - "errors": 0, + "errors": 1, "fatal": 10, "informational": 8, - "warnings": 7, + "warnings": 8, }, "resourcesScanned": 4, "rulesEvaluated": 273, "severityLevel": "DEBUG", "strict": false, ❯ smoke.test.ts:391:57

Check failure on line 391 in src/bindings-wasm/tests/smoke.test.ts

View workflow job for this annotation

GitHub Actions / validate / test-wasm

smoke.test.ts > golden file validation > rego detailed matches golden > bad/codepipeline_bad_artifacts.yaml

AssertionError: expected { …(5) } to deeply equal { …(5) } - Expected + Received @@ -51,10 +51,26 @@ }, { "category": "Best Practice", "endColumn": 11, "endLine": 4, + "message": "Hardcoded partition 'aws' in ARN — use AWS::Partition pseudo-parameter for portability", + "phase": "LINT", + "resourceId": "Pipeline", + "resourceType": "AWS::CodePipeline::Pipeline", + "ruleDescription": "ARNs should use correctly placed Pseudo Parameters", + "ruleId": "I3042", + "section": "Resources", + "severity": "INFO", + "source": "CFN_LINT", + "startColumn": 3, + "startLine": 4, + }, + { + "category": "Best Practice", + "endColumn": 11, + "endLine": 4, "message": "Resource 'Pipeline' of type 'AWS::CodePipeline::Pipeline' supports Tags but none are configured", "phase": "LINT", "propertyPath": "Properties.Tags", "resourceId": "Pipeline", "resourceType": "AWS::CodePipeline::Pipeline", @@ -90,11 +106,11 @@ "metadata": { "counts": { "debug": 0, "errors": 1, "fatal": 1, - "informational": 1, + "informational": 2, "warnings": 2, }, "resourcesScanned": 1, "rulesEvaluated": 273, "severityLevel": "DEBUG", ❯ smoke.test.ts:391:57

Check failure on line 391 in src/bindings-wasm/tests/smoke.test.ts

View workflow job for this annotation

GitHub Actions / validate / test-wasm

smoke.test.ts > golden file validation > rego detailed matches golden > bad/codepipeline_bad_artifact_counts.yaml

AssertionError: expected { …(5) } to deeply equal { …(5) } - Expected + Received @@ -51,10 +51,26 @@ }, { "category": "Best Practice", "endColumn": 11, "endLine": 4, + "message": "Hardcoded partition 'aws' in ARN — use AWS::Partition pseudo-parameter for portability", + "phase": "LINT", + "resourceId": "Pipeline", + "resourceType": "AWS::CodePipeline::Pipeline", + "ruleDescription": "ARNs should use correctly placed Pseudo Parameters", + "ruleId": "I3042", + "section": "Resources", + "severity": "INFO", + "source": "CFN_LINT", + "startColumn": 3, + "startLine": 4, + }, + { + "category": "Best Practice", + "endColumn": 11, + "endLine": 4, "message": "Resource 'Pipeline' of type 'AWS::CodePipeline::Pipeline' supports Tags but none are configured", "phase": "LINT", "propertyPath": "Properties.Tags", "resourceId": "Pipeline", "resourceType": "AWS::CodePipeline::Pipeline", @@ -90,11 +106,11 @@ "metadata": { "counts": { "debug": 0, "errors": 1, "fatal": 1, - "informational": 1, + "informational": 2, "warnings": 2, }, "resourcesScanned": 1, "rulesEvaluated": 273, "severityLevel": "DEBUG", ❯ smoke.test.ts:391:57

Check failure on line 391 in src/bindings-wasm/tests/smoke.test.ts

View workflow job for this annotation

GitHub Actions / validate / test-wasm

smoke.test.ts > golden file validation > rego detailed matches golden > bad/aurora_with_allocated_storage.yaml

AssertionError: expected { …(5) } to deeply equal { …(5) } - Expected + Received @@ -67,10 +67,27 @@ "startColumn": 3, "startLine": 4, }, { "category": "Best Practice", + "endColumn": 11, + "endLine": 4, + "message": "'BackupRetentionPeriod' is a required property (The default retention period will delete the data after a pre-defined time. Set an explicit values to avoid data loss on resource)", + "phase": "LINT", + "propertyPath": "Properties.BackupRetentionPeriod", + "resourceId": "AuroraDB", + "resourceType": "AWS::RDS::DBInstance", + "ruleDescription": "Check resources with auto expiring content have explicit retention period", + "ruleId": "I3013", + "section": "Resources", + "severity": "INFO", + "source": "CFN_LINT", + "startColumn": 3, + "startLine": 4, + }, + { + "category": "Best Practice", "context": { "lifecycle": "create-only", }, "documentationUrl": "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git", "endColumn": 11, @@ -111,11 +128,11 @@ "metadata": { "counts": { "debug": 0, "errors": 0, "fatal": 0, - "informational": 4, + "informational": 5, "warnings": 2, }, "resourcesScanned": 1, "rulesEvaluated": 273, "severityLevel": "DEBUG", ❯ smoke.test.ts:391:57

Check failure on line 391 in src/bindings-wasm/tests/smoke.test.ts

View workflow job for this annotation

GitHub Actions / validate / test-wasm

smoke.test.ts > golden file validation > rego detailed matches golden > bad/W1028_allowedvalues_excludes_literal.yaml

AssertionError: expected { …(5) } to deeply equal { …(5) } - Expected + Received @@ -1,9 +1,26 @@ { "diagnostics": [ { "category": "Best Practice", + "endColumn": 9, + "endLine": 25, + "message": "['Fn::If', 1] is not reachable. When setting condition 'IsProd' to True", + "phase": "LINT", + "propertyPath": "Properties.BucketName.Fn::If.1", + "resourceId": "Bucket", + "resourceType": "AWS::S3::Bucket", + "ruleDescription": "Check Fn::If has a path that cannot be reached", + "ruleId": "W1028", + "section": "Resources", + "severity": "WARN", + "source": "CFN_LINT", + "startColumn": 3, + "startLine": 25, + }, + { + "category": "Best Practice", "context": { "lifecycle": "create-only", "resolutionSource": "Fn::If on condition 'IsProd'", }, "endColumn": 9, @@ -45,11 +62,11 @@ "counts": { "debug": 0, "errors": 0, "fatal": 0, "informational": 2, - "warnings": 0, + "warnings": 1, }, "resourcesScanned": 1, "rulesEvaluated": 273, "severityLevel": "DEBUG", "strict": false, ❯ smoke.test.ts:391:57

Check failure on line 391 in src/bindings-wasm/tests/smoke.test.ts

View workflow job for this annotation

GitHub Actions / validate / test-wasm

smoke.test.ts > golden file validation > rego detailed matches golden > bad/E1150_network_interfaces_groupset_multi.yaml

AssertionError: expected { …(5) } to deeply equal { …(5) } - Expected + Received @@ -41,10 +41,44 @@ "source": "CFN_LINT", "startColumn": 3, "startLine": 7, }, { + "category": "Intrinsic Function", + "endColumn": 11, + "endLine": 7, + "message": "'sg-BADBAD1' is not a 'AWS::EC2::SecurityGroup.Id' with pattern '^sg-([a-fA-F0-9]{8}|[a-fA-F0-9]{17})$'", + "phase": "LINT", + "propertyPath": "Properties.NetworkInterfaces.GroupSet", + "resourceId": "Instance", + "resourceType": "AWS::EC2::Instance", + "ruleDescription": "Validate security group format", + "ruleId": "E1150", + "section": "Resources", + "severity": "ERROR", + "source": "CFN_LINT", + "startColumn": 3, + "startLine": 7, + }, + { + "category": "Intrinsic Function", + "endColumn": 11, + "endLine": 7, + "message": "'sg-BADBAD2' is not a 'AWS::EC2::SecurityGroup.Id' with pattern '^sg-([a-fA-F0-9]{8}|[a-fA-F0-9]{17})$'", + "phase": "LINT", + "propertyPath": "Properties.NetworkInterfaces.GroupSet", + "resourceId": "Instance", + "resourceType": "AWS::EC2::Instance", + "ruleDescription": "Validate security group format", + "ruleId": "E1150", + "section": "Resources", + "severity": "ERROR", + "source": "CFN_LINT", + "startColumn": 3, + "startLine": 7, + }, + { "category": "Security", "endColumn": 11, "endLine": 7, "message": "Hardcoded AMI ID — use a parameter or mapping for portability", "phase": "LINT", @@ -122,11 +156,11 @@ ], "filePath": "bad/E1150_network_interfaces_groupset_multi.yaml", "metadata": { "counts": { "debug": 0, - "errors": 2, + "errors": 4, "fatal": 0, "informational": 3, "warnings": 1, }, "resourcesScanned": 1, ❯ smoke.test.ts:391:57
});
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/cfn-validate/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub fn load_security_rule(filename: &str) -> String {
}

/// All template directories covered by golden-file tests.
const GOLDEN_DIRS: &[&str] = &["good", "bad", "integration", "issues", "lsp", "quickstart", "public"];
const GOLDEN_DIRS: &[&str] = &["good", "bad", "integration", "issues", "gh-issues", "lsp", "quickstart", "public"];

/// Discover all templates under the given subdirectories of templates_dir().
pub fn discover_all_templates() -> Vec<String> {
Expand Down
Loading
Loading