forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
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 (aws#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 aws#1517. Add MethodResponse support for aws-apigateway Remove Dockerfile that was no longer needed Update python base image from 3.6 to 3.6.5 Make the dockerfile work Add MethodResponse support for aws-apigateway Remove Dockerfile that was no longer needed Update python base image from 3.6 to 3.6.5 Make the dockerfile work Add MethodResponse to API Gateway Method. Add some documentation to the MethodResponse properties. Update the test for MethodResponse with response models. Fix some formatting and finish adding code documentation for MethodResponse. Remove Dockerfile from this branch Fix bad merge to methodresponse test. Correct the MethodResponse response models documentation. Add IModel type to reference when configuring a MethodResponse
- Loading branch information
1 parent
33c2a6d
commit bf37f96
Showing
7 changed files
with
169 additions
and
3 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
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
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,25 @@ | ||
import { IModel } from './model'; | ||
|
||
export interface MethodResponse { | ||
|
||
/** | ||
* The method response's status code, which you map to an IntegrationResponse. | ||
*/ | ||
statusCode: string; | ||
|
||
/** | ||
* Response parameters that API Gateway sends to the client that called a method. | ||
* Specify response parameters as key-value pairs (string-to-Boolean maps), with | ||
* a destination as the key and a Boolean as the value. Specify the destination | ||
* using the following pattern: method.response.header.name, where the name is a | ||
* valid, unique header name. The Boolean specifies whether a parameter is required. | ||
*/ | ||
responseParameters?: { [destination: string]: boolean }; | ||
|
||
/** | ||
* The resources used for the response's content type. Specify response models as | ||
* key-value pairs (string-to-string maps), with a content type as the key and a Model | ||
* resource name as the value. | ||
*/ | ||
responseModels?: { [contentType: string]: IModel }; | ||
} |
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,13 @@ | ||
export interface IModel { | ||
readonly modelId: string; | ||
} | ||
|
||
export class EmptyModel implements IModel { | ||
public readonly modelId = 'Empty'; | ||
} | ||
|
||
export class ErrorModel implements IModel { | ||
public readonly modelId = 'Error'; | ||
} | ||
|
||
// TODO: Implement Model, enabling management of custom models |
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
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 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |