Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ipv6Address count for NetworkInterface #3656

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
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"op": "add",
"path": "/dependentExcluded",
"value": {
"Ipv6AddressCount": [
"Ipv6Addresses"
],
"Ipv6Addresses": [
"Ipv6AddressCount"
]
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@
"type": "object"
}
},
"dependentExcluded": {
"Ipv6AddressCount": [
"Ipv6Addresses"
],
"Ipv6Addresses": [
"Ipv6AddressCount"
]
},
"primaryIdentifier": [
"/properties/Id"
],
Expand Down
60 changes: 60 additions & 0 deletions test/fixtures/results/integration/aws-ec2-networkinterface.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[
{
"Filename": "test/fixtures/templates/integration/aws-ec2-networkinterface.yaml",
"Id": "9d40fd01-0117-1816-b924-0b0c89ee7a5e",
"Level": "Error",
"Location": {
"End": {
"ColumnNumber": 20,
"LineNumber": 15
},
"Path": [
"Resources",
"NetworkInterface",
"Properties",
"Ipv6Addresses"
],
"Start": {
"ColumnNumber": 7,
"LineNumber": 15
}
},
"Message": "'Ipv6Addresses' should not be included with 'Ipv6AddressCount'",
"ParentId": null,
"Rule": {
"Description": "When certain properties are specified other properties should not be included",
"Id": "E3020",
"ShortDescription": "Validate that when a property is specified another property should be excluded",
"Source": "https://github.com/aws-cloudformation/cfn-lint/blob/main/docs/cfn-schema-specification.md#dependentexcluded"
}
},
{
"Filename": "test/fixtures/templates/integration/aws-ec2-networkinterface.yaml",
"Id": "e26370d1-ed25-a14c-9a48-7cabc88945ec",
"Level": "Error",
"Location": {
"End": {
"ColumnNumber": 23,
"LineNumber": 17
},
"Path": [
"Resources",
"NetworkInterface",
"Properties",
"Ipv6AddressCount"
],
"Start": {
"ColumnNumber": 7,
"LineNumber": 17
}
},
"Message": "'Ipv6AddressCount' should not be included with 'Ipv6Addresses'",
"ParentId": null,
"Rule": {
"Description": "When certain properties are specified other properties should not be included",
"Id": "E3020",
"ShortDescription": "Validate that when a property is specified another property should be excluded",
"Source": "https://github.com/aws-cloudformation/cfn-lint/blob/main/docs/cfn-schema-specification.md#dependentexcluded"
}
}
]
17 changes: 17 additions & 0 deletions test/fixtures/templates/integration/aws-ec2-networkinterface.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Parameters:
SubnetId:
Type: AWS::EC2::Subnet::Id
SecurityGroupId:
Type: AWS::EC2::SecurityGroup::Id
Resources:
NetworkInterface:
Type: AWS::EC2::NetworkInterface
Properties:
Description: "a network interface"
GroupSet:
- !Ref SecurityGroupId
SourceDestCheck: false
SubnetId: !Ref SubnetId
Ipv6Addresses:
- Ipv6Address: abc
Ipv6AddressCount: 1
9 changes: 9 additions & 0 deletions test/integration/test_integration_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ class TestQuickStartTemplates(BaseCliTestCase):
),
"exit_code": 2,
},
{
"filename": (
"test/fixtures/templates/integration/aws-ec2-networkinterface.yaml"
),
"results_filename": (
"test/fixtures/results/integration/aws-ec2-networkinterface.json"
),
"exit_code": 2,
},
]

def test_templates(self):
Expand Down
Loading