-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(aws-ec2): CfnNetworkAclEntry.CidrBlock should be optional (#1565)
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
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}, | ||
}; |
16 changes: 16 additions & 0 deletions
16
packages/@aws-cdk/cfnspec/spec-source/500_NetworkAclEntry_patch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |