Skip to content

Commit

Permalink
fix(aws-ec2): CfnNetworkAclEntry.CidrBlock should be optional (#1565)
Browse files Browse the repository at this point in the history
The docs say this property is optional (exactly one of `CidrBlock`
and `ipv6CidrBlock` should be specified) but it's typed as `Required`
in the JSON schema.

Patch the schema until this is fixed upstream.

Fixes #1517.
  • Loading branch information
rix0rrr authored Jan 18, 2019
1 parent 33c2a6d commit 4af7c0d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/@aws-cdk/aws-ec2/test/test.l1.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import cdk = require('@aws-cdk/cdk');
import { Test } from 'nodeunit';
import ec2 = require('../lib');

export = {
'NetworkAclEntry CidrBlock should be optional'(test: Test) {
const stack = new cdk.Stack();

new ec2.CfnNetworkAclEntry(stack, 'ACL', {
// Note the conspicuous absence of cidrBlock
networkAclId: 'asdf',
protocol: 5,
ruleAction: 'action',
ruleNumber: 1
});

test.done();
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"ResourceTypes": {
"AWS::EC2::NetworkAclEntry": {
"patch": {
"description": "https://github.com/awslabs/aws-cdk/issues/1517",
"operations": [
{
"op": "add",
"path": "/Properties/CidrBlock/Required",
"value": false
}
]
}
}
}
}

0 comments on commit 4af7c0d

Please sign in to comment.