Skip to content

Commit

Permalink
fix embedded connectors test
Browse files Browse the repository at this point in the history
  • Loading branch information
aaythapa committed Sep 11, 2024
1 parent 55a1395 commit f5cb06d
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 1 deletion.
1 change: 0 additions & 1 deletion .cfnlintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ ignore_templates:
- tests/translator/output/**/function_with_tracing.json # Obsolete DependsOn on resource
- tests/translator/output/**/api_with_propagate_tags.json # TODO: Intentional error transform tests. Will be updated.
- tests/translator/output/**/function_with_intrinsics_resource_attribute.json # CFN now supports intrinsics in DeletionPolicy
- tests/translator/output/**/embedded_connectors_hardcoded_props.json # Only checking if the embedded connectors work
- tests/translator/output/**/function_with_snapstart.json # Snapstart intentionally not attached to a lambda version which causes lint issues
- tests/translator/output/**/managed_policies_everything.json # intentionally contains wrong arns
ignore_checks:
Expand Down
15 changes: 15 additions & 0 deletions tests/translator/input/embedded_connectors_hardcoded_props.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ Transform: AWS::Serverless-2016-10-31
Resources:
MyFunction:
Type: AWS::Lambda::Function
Properties:
Handler: index.handler
Role: arn:aws:iam::111122223333:role/lambda-role
Runtime: nodejs20.x
Code:
ZipFile: |
exports.handler = function(event, context, callback) {
return callback(null, 'success');
}
MyRule:
Type: AWS::Events::Rule
Expand All @@ -13,6 +22,8 @@ Resources:
Arn: !Ref MyTopic
Permissions:
- Write
Properties:
ScheduleExpression: rate(5 minutes)

MyQueue:
Type: AWS::SQS::Queue
Expand Down Expand Up @@ -42,6 +53,8 @@ Resources:
Id: MyFunction
Permissions:
- Write
Properties:
Name: MyApiV1

MyApiV2:
Type: AWS::ApiGatewayV2::Api
Expand All @@ -54,6 +67,8 @@ Resources:
Id: MyFunction
Permissions:
- Write
Properties:
Name: MyApiV2

MySNSTopic:
Type: AWS::SNS::Topic
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"Resources": {
"MyApiV1": {
"Properties": {
"Name": "MyApiV1"
},
"Type": "AWS::ApiGateway::RestApi"
},
"MyApiV1ApiV1ToLambdaWriteLambdaPermission": {
Expand Down Expand Up @@ -40,6 +43,9 @@
"Type": "AWS::Lambda::Permission"
},
"MyApiV2": {
"Properties": {
"Name": "MyApiV2"
},
"Type": "AWS::ApiGatewayV2::Api"
},
"MyApiV2ApiV2ToLambdaWriteLambdaPermission": {
Expand Down Expand Up @@ -79,6 +85,14 @@
"Type": "AWS::Lambda::Permission"
},
"MyFunction": {
"Properties": {
"Code": {
"ZipFile": "exports.handler = function(event, context, callback) {\n return callback(null, 'success');\n}\n"
},
"Handler": "index.handler",
"Role": "arn:aws:iam::111122223333:role/lambda-role",
"Runtime": "nodejs20.x"
},
"Type": "AWS::Lambda::Function"
},
"MyQueue": {
Expand All @@ -88,6 +102,9 @@
"Type": "AWS::SQS::Queue"
},
"MyRule": {
"Properties": {
"ScheduleExpression": "rate(5 minutes)"
},
"Type": "AWS::Events::Rule"
},
"MyRuleRuleToTopicTopicPolicy": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"Resources": {
"MyApiV1": {
"Properties": {
"Name": "MyApiV1"
},
"Type": "AWS::ApiGateway::RestApi"
},
"MyApiV1ApiV1ToLambdaWriteLambdaPermission": {
Expand Down Expand Up @@ -40,6 +43,9 @@
"Type": "AWS::Lambda::Permission"
},
"MyApiV2": {
"Properties": {
"Name": "MyApiV2"
},
"Type": "AWS::ApiGatewayV2::Api"
},
"MyApiV2ApiV2ToLambdaWriteLambdaPermission": {
Expand Down Expand Up @@ -79,6 +85,14 @@
"Type": "AWS::Lambda::Permission"
},
"MyFunction": {
"Properties": {
"Code": {
"ZipFile": "exports.handler = function(event, context, callback) {\n return callback(null, 'success');\n}\n"
},
"Handler": "index.handler",
"Role": "arn:aws:iam::111122223333:role/lambda-role",
"Runtime": "nodejs20.x"
},
"Type": "AWS::Lambda::Function"
},
"MyQueue": {
Expand All @@ -88,6 +102,9 @@
"Type": "AWS::SQS::Queue"
},
"MyRule": {
"Properties": {
"ScheduleExpression": "rate(5 minutes)"
},
"Type": "AWS::Events::Rule"
},
"MyRuleRuleToTopicTopicPolicy": {
Expand Down
17 changes: 17 additions & 0 deletions tests/translator/output/embedded_connectors_hardcoded_props.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"Resources": {
"MyApiV1": {
"Properties": {
"Name": "MyApiV1"
},
"Type": "AWS::ApiGateway::RestApi"
},
"MyApiV1ApiV1ToLambdaWriteLambdaPermission": {
Expand Down Expand Up @@ -40,6 +43,9 @@
"Type": "AWS::Lambda::Permission"
},
"MyApiV2": {
"Properties": {
"Name": "MyApiV2"
},
"Type": "AWS::ApiGatewayV2::Api"
},
"MyApiV2ApiV2ToLambdaWriteLambdaPermission": {
Expand Down Expand Up @@ -79,6 +85,14 @@
"Type": "AWS::Lambda::Permission"
},
"MyFunction": {
"Properties": {
"Code": {
"ZipFile": "exports.handler = function(event, context, callback) {\n return callback(null, 'success');\n}\n"
},
"Handler": "index.handler",
"Role": "arn:aws:iam::111122223333:role/lambda-role",
"Runtime": "nodejs20.x"
},
"Type": "AWS::Lambda::Function"
},
"MyQueue": {
Expand All @@ -88,6 +102,9 @@
"Type": "AWS::SQS::Queue"
},
"MyRule": {
"Properties": {
"ScheduleExpression": "rate(5 minutes)"
},
"Type": "AWS::Events::Rule"
},
"MyRuleRuleToTopicTopicPolicy": {
Expand Down

0 comments on commit f5cb06d

Please sign in to comment.