Skip to content

Commit

Permalink
Merge branch 'main' into fix_no_matching_templates
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong authored Sep 9, 2024
2 parents 66a59a8 + 26a64dc commit a2ff656
Show file tree
Hide file tree
Showing 1,730 changed files with 280,563 additions and 117,242 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci-pr-data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "[CI] Test PR Data"

on:
pull_request:
paths:
- "src/cfnlint/data/**"

jobs:
data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Tox and any other packages
run: pip install tox
- name: Run Tox
run: |
tox -e py -- -m "data"
28 changes: 7 additions & 21 deletions .github/workflows/ci-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,6 @@ jobs:
with:
name: coverage-${{ matrix.python }}
path: coverage-${{ matrix.python }}.xml
- name: Save PR number
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v2
with:
name: pr
path: pr/
data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Tox and any other packages
run: pip install tox
- name: Run Tox
run: |
tox -e py -- -m "data"
integration:
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -89,6 +68,13 @@ jobs:
pip3 install -e .
pip install --upgrade pip
pip install --upgrade setuptools
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v4
with:
name: pr
path: pr/
overwrite: true
- uses: pypa/gh-action-pip-audit@v1.0.8
with:
ignore-vulns: |
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### v1.12.4
## What's Changed
* Return Symbol instead of None on Fn::Equals logic by @kddejong in https://github.com/aws-cloudformation/cfn-lint/pull/3663
* Remove handlers and tagging/permissions from specs by @kddejong in https://github.com/aws-cloudformation/cfn-lint/pull/3661

**Full Changelog**: https://github.com/aws-cloudformation/cfn-lint/compare/v1.12.3...v1.12.4

### v1.12.3
## What's Changed
* Allow for patch in place by @kddejong in https://github.com/aws-cloudformation/cfn-lint/pull/3649
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ If you'd like cfn-lint to be run automatically when making changes to files in y
```yaml
repos:
- repo: https://github.com/aws-cloudformation/cfn-lint
rev: v1.12.3 # The version of cfn-lint to use
rev: v1.12.4 # The version of cfn-lint to use
hooks:
- id: cfn-lint
files: path/to/cfn/dir/.*\.(json|yml|yaml)$
Expand All @@ -353,7 +353,7 @@ If you are using a `.cfnlintrc` and specifying the `templates` or `ignore_templa
```yaml
repos:
- repo: https://github.com/aws-cloudformation/cfn-lint
rev: v1.12.3 # The version of cfn-lint to use
rev: v1.12.4 # The version of cfn-lint to use
hooks:
- id: cfn-lint-rc
```
Expand Down
14 changes: 14 additions & 0 deletions scripts/update_schemas_manually.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,20 @@
),
],
),
ResourcePatch(
resource_type="AWS::EC2::NetworkInterface",
patches=[
Patch(
values={
"dependentExcluded": {
"Ipv6AddressCount": ["Ipv6Addresses"],
"Ipv6Addresses": ["Ipv6AddressCount"],
},
},
path="/",
),
],
),
ResourcePatch(
resource_type="AWS::EC2::SecurityGroup",
patches=[
Expand Down
1 change: 1 addition & 0 deletions scripts/update_snapshot_results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cfn-lint test/fixtures/templates/integration/dynamic-references.yaml -e -c I --f
cfn-lint test/fixtures/templates/integration/resources-cloudformation-init.yaml -e -c I --format json > test/fixtures/results/integration/resources-cloudformation-init.json
cfn-lint test/fixtures/templates/integration/ref-no-value.yaml -e -c I --format json > test/fixtures/results/integration/ref-no-value.json
cfn-lint test/fixtures/templates/integration/availability-zones.yaml -e -c I --format json > test/fixtures/results/integration/availability-zones.json
cfn-lint test/fixtures/templates/integration/aws-ec2-networkinterface.yaml -e -c I --format json > test/fixtures/results/integration/aws-ec2-networkinterface.json

# public/
cfn-lint test/fixtures/templates/public/lambda-poller.yaml -e -c I --format json > test/fixtures/results/public/lambda-poller.json
Expand Down
5 changes: 4 additions & 1 deletion src/cfnlint/conditions/_equals.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ def build_cnf(self, params: dict[str, Symbol]) -> BooleanFunction:
return BooleanTrue()
return BooleanFalse()

return params.get(self.hash)
if self.hash in params:
return params.get(self.hash)

return Symbol(self.hash)

def test(self, scenarios: Mapping[str, str]) -> bool:
"""Do an equals based on the provided scenario"""
Expand Down
6 changes: 5 additions & 1 deletion src/cfnlint/conditions/_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ def build_cnf(self, params: dict[str, Symbol]) -> BooleanFunction | Symbol | Non
for assertion in self._assertions:
assertions.append(assertion.build_cnf(params))

return And(*assertions)
try:
return And(*assertions)
except Exception as e:
LOGGER.debug(f"Error building conditions: {e}")
return BooleanTrue()

@property
def equals(self) -> list[Equal]:
Expand Down
2 changes: 2 additions & 0 deletions src/cfnlint/data/AdditionalSpecs/Policies.json
Original file line number Diff line number Diff line change
Expand Up @@ -4651,6 +4651,7 @@
"GetExperiment",
"GetExperimentTargetAccountConfiguration",
"GetExperimentTemplate",
"GetSafetyLever",
"GetTargetAccountConfiguration",
"GetTargetResourceType",
"InjectApiInternalError",
Expand All @@ -4669,6 +4670,7 @@
"TagResource",
"UntagResource",
"UpdateExperimentTemplate",
"UpdateSafetyLeverState",
"UpdateTargetAccountConfiguration"
],
"HasResource": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"149d3ccf3741bcbeac7b5f6f4db029ba\"", "url": "https://schema.cloudformation.eu-south-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"f6edd82515a16676926f5f3a12d52efb\"", "url": "https://schema.cloudformation.eu-south-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"ab6ecda9df4503f4bc08fa38313692d0\"", "url": "https://schema.cloudformation.cn-north-1.amazonaws.com.cn/CloudformationSchema.zip"}
{"etag": "\"972c9c66abd3c137d444e53ebdd3f145\"", "url": "https://schema.cloudformation.cn-north-1.amazonaws.com.cn/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"e1299c388df8386110a7b6ff36768f83\"", "url": "https://schema.cloudformation.us-gov-east-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"77b7d56615ac52645e5a806c8856ce9e\"", "url": "https://schema.cloudformation.us-gov-east-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"ae3cfdea6b21f35aadead9d81b516e64\"", "url": "https://schema.cloudformation.me-south-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"8f79f8805b7537d546dc63450fd56a1b\"", "url": "https://schema.cloudformation.me-south-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"dae8a22d27f93924a6c0f1107c15c1d0\"", "url": "https://schema.cloudformation.us-gov-west-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"0bcc71a73165ccfb58eb513536a7184e\"", "url": "https://schema.cloudformation.us-gov-west-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"34aa8f2646197181cb9a5d939e086ad8\"", "url": "https://schema.cloudformation.me-central-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"2dbd8e8abff7e7518cb07bdbb155d843\"", "url": "https://schema.cloudformation.me-central-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"2d233206c73a576ff185df8b6eda11f9\"", "url": "https://schema.cloudformation.eu-west-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"3423c7fa487a9b0388b872d6f066a055\"", "url": "https://schema.cloudformation.eu-west-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"379f8faec922d6179523dbb35658db99\"", "url": "https://schema.cloudformation.cn-northwest-1.amazonaws.com.cn/CloudformationSchema.zip"}
{"etag": "\"c07546067edbe91211f62c41893f72f1\"", "url": "https://schema.cloudformation.cn-northwest-1.amazonaws.com.cn/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"06f7b01112a71d8a61803e9819db4c12\"", "url": "https://schema.cloudformation.af-south-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"48566226bdcbff3cb167c745d575e48d\"", "url": "https://schema.cloudformation.af-south-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"46abb24012deca7f7cdee909373e4247\"", "url": "https://schema.cloudformation.us-west-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"92cfd52881d5c4374a41db95c11d7626\"", "url": "https://schema.cloudformation.us-west-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"4231ba3180ec4cb9c5bbba05b4931c22\"", "url": "https://schema.cloudformation.ap-southeast-5.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"3bb396a27ad97f604ecf96040fc830d4\"", "url": "https://schema.cloudformation.ap-southeast-5.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"f46c8a99f6924c350ac96de522d08d8f\"", "url": "https://schema.cloudformation.eu-central-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"6268d8d9cd7faa977e4c2f0af2566842\"", "url": "https://schema.cloudformation.eu-central-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"c46eeff4384ef7ad8a1ca47beb0bab54\"", "url": "https://schema.cloudformation.ap-south-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"3e29e9eb6036e382722aa92e8580522b\"", "url": "https://schema.cloudformation.ap-south-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"c2044314a90a8c25db278f6dae78867d\"", "url": "https://schema.cloudformation.ap-southeast-4.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"2263b6d2d3f0dda9e2ad8b4c54418d9a\"", "url": "https://schema.cloudformation.ap-southeast-4.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"c0c2f57abe3236e7cc810087ea8be945\"", "url": "https://schema.cloudformation.us-east-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"1c96f13a91d978e3048312e23d455dc1\"", "url": "https://schema.cloudformation.us-east-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"342dc56ad5e833f9fb46f5d9b7532c3a\"", "url": "https://schema.cloudformation.ap-southeast-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"3afc18e8a24023c135450afd0583a3bc\"", "url": "https://schema.cloudformation.ap-southeast-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"010617485b30b705e5df3b3f74b70f77\"", "url": "https://schema.cloudformation.ap-northeast-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"744db39255294103901edbad31facc38\"", "url": "https://schema.cloudformation.ap-northeast-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"5cb20cc9753c895f35fb35242ce31fca\"", "url": "https://schema.cloudformation.ap-southeast-3.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"5f5fe6d158de32b33d16c80ec3b72ade\"", "url": "https://schema.cloudformation.ap-southeast-3.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"666b6426119d343cdc2d619838351da0\"", "url": "https://schema.cloudformation.ap-east-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"5c6f48dc3f473c2b7af7f356078f3fd2\"", "url": "https://schema.cloudformation.ap-east-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"038c8cfb262e2c73955d6034ade0ef42\"", "url": "https://schema.cloudformation.sa-east-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"89f22231bd8b106a62265463f761fcf3\"", "url": "https://schema.cloudformation.sa-east-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"7498a9ec294bbbf427052f8c28cd99f2\"", "url": "https://schema.cloudformation.ap-southeast-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"ec259eb7a6f7496076f46086c91acfd8\"", "url": "https://schema.cloudformation.ap-southeast-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"65b6e8a463c9be1ec20a6c602fe21e38\"", "url": "https://schema.cloudformation.ca-west-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"7927f7ebb5c0dfd9313f22a2d240bd74\"", "url": "https://schema.cloudformation.ca-west-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"e3a0980aa806433319a6a0e72f14afe5\"", "url": "https://schema.cloudformation.eu-central-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"5a11cb559d1827e7d8f0b6111b351e1b\"", "url": "https://schema.cloudformation.eu-central-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"54e849c8265eec335296026732f2e064\"", "url": "https://schema.cloudformation.eu-north-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"7e87a681c6240323d9f3e9a7e6ac803c\"", "url": "https://schema.cloudformation.eu-north-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"fbce99d2320c72760f9afd9882a91efc\"", "url": "https://schema.cloudformation.eu-south-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"0e31bd91f7eee4f1b06a9f9ddda1f647\"", "url": "https://schema.cloudformation.eu-south-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"de6b730dc197002d0194d095ace63096\"", "url": "https://schema.cloudformation.ca-central-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"be1cc0dbd7ce3e2bdd96ad4a734a10e9\"", "url": "https://schema.cloudformation.ca-central-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"8e6d442bd013f225ddf1035aff892013\"", "url": "https://schema.cloudformation.eu-west-3.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"4a35c7ef670a698a55ba78b50e906242\"", "url": "https://schema.cloudformation.eu-west-3.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"777290e6b190993453f9e1874bfa4b8c\"", "url": "https://schema.cloudformation.ap-northeast-3.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"47562e9ed66c66b2baf8dae4f86a7989\"", "url": "https://schema.cloudformation.ap-northeast-3.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"456a8d202e60cfaaa1eeede1e580d66a\"", "url": "https://schema.cloudformation.us-west-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"b268207858e42d7024f936637d5ab988\"", "url": "https://schema.cloudformation.us-west-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"1ff2d895b4ddc56a50c8f0040d74fc73\"", "url": "https://schema.cloudformation.ap-south-2.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"d77596d53b45228fbdaf16b1816d31c5\"", "url": "https://schema.cloudformation.ap-south-2.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"ab5ac309e70e155456fd8c136faba1d0\"", "url": "https://schema.cloudformation.us-east-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"37ebcddf2652190b0ba29e20693737ba\"", "url": "https://schema.cloudformation.us-east-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"a0438711c8ee597ec50a4908cb9baac6\"", "url": "https://schema.cloudformation.il-central-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"daee1afdf99b2fa685719c9928e313ce\"", "url": "https://schema.cloudformation.il-central-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"a36dd6914c9ec1e9937dba7bf3b14c4c\"", "url": "https://schema.cloudformation.eu-west-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"a285a8bf2f364aa1a7b588d3a2a575c2\"", "url": "https://schema.cloudformation.eu-west-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"etag": "\"6d7bf81725555153eba880a79178c257\"", "url": "https://schema.cloudformation.ap-northeast-1.amazonaws.com/CloudformationSchema.zip"}
{"etag": "\"318bdb4d630dec177bba9ce86174bbb0\"", "url": "https://schema.cloudformation.ap-northeast-1.amazonaws.com/CloudformationSchema.zip"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"if": {
"required": [
"PrivateIpAddress"
]
},
"then": {
"properties": {
"NetworkInterfaces": {
"items": {
"properties": {
"PrivateIpAddress": false,
"PrivateIpAddresses": {
"items": {
"properties": {
"Primary": {
"enum": [
false
]
}
}
},
"type": "array"
}
}
},
"type": "array"
},
"PrivateIpAddresses": {
"items": {
"properties": {
"Primary": {
"enum": [
false
]
}
}
},
"type": "array"
}
}
}
}
54 changes: 41 additions & 13 deletions src/cfnlint/data/schemas/extensions/aws_ecs_service/fargate.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,48 @@
{
"if": {
"properties": {
"LaunchType": {
"enum": [
"FARGATE",
"EXTERNAL"
]
"anyOf": [
{
"properties": {
"LaunchType": {
"enum": [
"FARGATE"
]
},
"SchedulingStrategy": {
"type": "string"
}
},
"required": [
"LaunchType"
],
"type": "object"
},
"SchedulingStrategy": {
"type": "string"
{
"properties": {
"DeploymentController": {
"properties": {
"Type": {
"enum": [
"CODE_DEPLOY",
"EXTERNAL"
]
}
},
"required": [
"Type"
],
"type": "object"
},
"SchedulingStrategy": {
"type": "string"
}
},
"required": [
"DeploymentController"
],
"type": "object"
}
},
"required": [
"LaunchType"
],
"type": "object"
]
},
"then": {
"properties": {
Expand Down
Loading

0 comments on commit a2ff656

Please sign in to comment.