Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release: 1.42.0
- Loading branch information
Showing
24 changed files
with
735 additions
and
1 deletion.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
integration/combination/test_api_with_disable_execute_api_endpoint.py
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,30 @@ | ||
from parameterized import parameterized | ||
|
||
from integration.helpers.base_test import BaseTest | ||
|
||
|
||
class TestApiWithDisableExecuteApiEndpoint(BaseTest): | ||
@parameterized.expand( | ||
[ | ||
("combination/api_with_disable_execute_api_endpoint", True), | ||
("combination/api_with_disable_execute_api_endpoint", False), | ||
] | ||
) | ||
def test_end_point_configuration(self, file_name, disable_value): | ||
parameters = [ | ||
{ | ||
"ParameterKey": "DisableExecuteApiEndpointValue", | ||
"ParameterValue": "true" if disable_value else "false", | ||
"UsePreviousValue": False, | ||
"ResolvedValue": "string", | ||
} | ||
] | ||
|
||
self.create_and_verify_stack(file_name, parameters) | ||
|
||
rest_api_id = self.get_physical_id_by_type("AWS::ApiGateway::RestApi") | ||
apigw_client = self.client_provider.api_client | ||
|
||
response = apigw_client.get_rest_api(restApiId=rest_api_id) | ||
api_result = response["disableExecuteApiEndpoint"] | ||
self.assertEqual(api_result, disable_value) |
8 changes: 8 additions & 0 deletions
8
integration/resources/expected/combination/api_with_disable_execute_api_endpoint.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,8 @@ | ||
[ | ||
{"LogicalResourceId": "RestApiGateway", "ResourceType": "AWS::ApiGateway::RestApi"}, | ||
{"LogicalResourceId": "RestApiGatewayDeployment", "ResourceType": "AWS::ApiGateway::Deployment"}, | ||
{"LogicalResourceId": "RestApiGatewayProdStage", "ResourceType": "AWS::ApiGateway::Stage"}, | ||
{"LogicalResourceId": "RestApiFunction", "ResourceType": "AWS::Lambda::Function"}, | ||
{"LogicalResourceId": "RestApiFunctionIamPermissionProd", "ResourceType": "AWS::Lambda::Permission"}, | ||
{"LogicalResourceId": "RestApiFunctionRole", "ResourceType": "AWS::IAM::Role"} | ||
] |
39 changes: 39 additions & 0 deletions
39
integration/resources/templates/combination/api_with_disable_execute_api_endpoint.yaml
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,39 @@ | ||
Parameters: | ||
DisableExecuteApiEndpointValue: | ||
Description: Variable to define if client can access default API endpoint. | ||
Type: String | ||
AllowedValues: [true, false] | ||
|
||
Resources: | ||
RestApiGateway: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: Prod | ||
DisableExecuteApiEndpoint: | ||
Ref: DisableExecuteApiEndpointValue | ||
|
||
RestApiFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
InlineCode: | | ||
exports.handler = async (event) => { | ||
const response = { | ||
statusCode: 200, | ||
body: JSON.stringify('Hello from Lambda!'), | ||
}; | ||
return response; | ||
}; | ||
Handler: index.handler | ||
Runtime: nodejs12.x | ||
Events: | ||
Iam: | ||
Type: Api | ||
Properties: | ||
RestApiId: !Ref RestApiGateway | ||
Method: GET | ||
Path: / | ||
Outputs: | ||
ApiUrl: | ||
Description: "API endpoint URL for Prod environment" | ||
Value: | ||
Fn::Sub: 'https://${RestApiGateway}.execute-api.${AWS::Region}.${AWS::URLSuffix}/Prod/' |
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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "1.41.0" | ||
__version__ = "1.42.0" |
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
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
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,56 @@ | ||
Resources: | ||
WrongFilterName: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://sam-demo-bucket/filtered_events.zip | ||
Handler: index.handler | ||
Runtime: nodejs16.x | ||
Events: | ||
DynamoDBStreamEvent: | ||
Type: DynamoDB | ||
Properties: | ||
Stream: !GetAtt DynamoDBTable.StreamArn | ||
StartingPosition: TRIM_HORIZON | ||
FilterCriteria: | ||
FiltersToUse: | ||
- Pattern: '{"name": "value"}' | ||
|
||
NotSupportedPullEvent: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://sam-demo-bucket/filtered_events.zip | ||
Handler: index.handler | ||
Runtime: nodejs16.x | ||
Events: | ||
KafkaEvent: | ||
Type: MSK | ||
Properties: | ||
StartingPosition: LATEST | ||
Stream: arn:aws:kafka:us-east-1:012345678012:cluster/clusterName/abcdefab-1234-abcd-5678-cdef0123ab01-2 | ||
Topics: | ||
- MyTopic | ||
FilterCriteria: | ||
Filters: | ||
- Pattern: '{"name": "value"}' | ||
|
||
|
||
NotSupportedPushEvent: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://sam-demo-bucket/filtered_events.zip | ||
Handler: index.handler | ||
Runtime: nodejs16.x | ||
Events: | ||
SNSEvent: | ||
Type: SNS | ||
Properties: | ||
Topic: !GetAtt MySnsTopic.Arn | ||
FilterCriteria: | ||
Filters: | ||
- Pattern: '{"name": "value"}' | ||
|
||
DynamoDBTable: | ||
Type: AWS::DynamoDB::Table | ||
|
||
MySnsTopic: | ||
Type: AWS::SNS::Topic |
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,49 @@ | ||
Resources: | ||
FilteredEventsFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://sam-demo-bucket/filtered_events.zip | ||
Handler: index.handler | ||
Runtime: nodejs16.x | ||
Events: | ||
KinesisStream: | ||
Type: Kinesis | ||
Properties: | ||
Stream: !GetAtt KinesisStream.Arn | ||
StartingPosition: LATEST | ||
FilterCriteria: | ||
Filters: | ||
- Pattern: '{"name": "value"}' | ||
- Pattern: '{"name2": "value2"}' | ||
DynamoDBStreamEvent: | ||
Type: DynamoDB | ||
Properties: | ||
Stream: !GetAtt DynamoDBTable.StreamArn | ||
StartingPosition: TRIM_HORIZON | ||
FilterCriteria: | ||
Filters: | ||
- Pattern: '{ | ||
"dynamodb": { | ||
"NewImage": { | ||
"value": { "S": ["test"] } | ||
} | ||
} | ||
}' | ||
MySqsQueue: | ||
Type: SQS | ||
Properties: | ||
Queue: !GetAtt MySqsQueue.Arn | ||
FilterCriteria: | ||
Filters: | ||
- Pattern: '{"name": "value"}' | ||
|
||
KinesisStream: | ||
Type: AWS::Kinesis::Stream | ||
Properties: | ||
ShardCount: 1 | ||
|
||
DynamoDBTable: | ||
Type: AWS::DynamoDB::Table | ||
|
||
MySqsQueue: | ||
Type: AWS::SQS::Queue |
Oops, something went wrong.