From 3636183e37f4e710118baea63fef2f6911a68a9c Mon Sep 17 00:00:00 2001 From: Aayush Thapa Date: Wed, 11 Sep 2024 11:58:04 -0700 Subject: [PATCH 1/5] update tests --- .../input/all_policy_templates.yaml | 2 +- ...or_with_non_id_source_and_destination.yaml | 2 +- ...ith_alias_and_all_properties_property.yaml | 4 +-- ..._with_sns_event_source_all_parameters.yaml | 2 +- .../graphqlapi_ddb_datasource_connector.yaml | 4 +-- ...raphqlapi_lambda_datasource_connector.yaml | 2 +- .../output/all_policy_templates.json | 2 +- .../output/aws-cn/all_policy_templates.json | 2 +- ...or_with_non_id_source_and_destination.json | 4 ++- ...ith_alias_and_all_properties_property.json | 8 ++--- .../aws-cn/function_with_snapstart.json | 30 +++++++++++++++++-- ..._with_sns_event_source_all_parameters.json | 4 +-- .../graphqlapi_ddb_datasource_connector.json | 16 +++++----- ...raphqlapi_lambda_datasource_connector.json | 6 ++-- .../aws-us-gov/all_policy_templates.json | 2 +- ...or_with_non_id_source_and_destination.json | 4 ++- ...ith_alias_and_all_properties_property.json | 8 ++--- .../aws-us-gov/function_with_snapstart.json | 30 +++++++++++++++++-- ..._with_sns_event_source_all_parameters.json | 4 +-- .../graphqlapi_ddb_datasource_connector.json | 16 +++++----- ...raphqlapi_lambda_datasource_connector.json | 6 ++-- ...or_with_non_id_source_and_destination.json | 4 ++- ...ith_alias_and_all_properties_property.json | 8 ++--- .../output/function_with_snapstart.json | 30 +++++++++++++++++-- ..._with_sns_event_source_all_parameters.json | 4 +-- .../graphqlapi_ddb_datasource_connector.json | 16 +++++----- ...raphqlapi_lambda_datasource_connector.json | 6 ++-- 27 files changed, 152 insertions(+), 74 deletions(-) diff --git a/tests/translator/input/all_policy_templates.yaml b/tests/translator/input/all_policy_templates.yaml index 0bcd0de514..c2666a9c5b 100644 --- a/tests/translator/input/all_policy_templates.yaml +++ b/tests/translator/input/all_policy_templates.yaml @@ -170,7 +170,7 @@ Resources: EventBusName: name - AcmGetCertificatePolicy: - CertificateArn: arn + CertificateArn: arn:aws:acm:us-west-2:987654321098:certificate/dec86919-7219-4e8d-8871-7f1609df2c7f - Route53ChangeResourceRecordSetsPolicy: HostedZoneId: test diff --git a/tests/translator/input/connector_with_non_id_source_and_destination.yaml b/tests/translator/input/connector_with_non_id_source_and_destination.yaml index 10a0fcf109..c91311b9d8 100644 --- a/tests/translator/input/connector_with_non_id_source_and_destination.yaml +++ b/tests/translator/input/connector_with_non_id_source_and_destination.yaml @@ -11,7 +11,7 @@ Resources: Principal: Service: lambda.amazonaws.com ManagedPolicyArns: - - arn:{AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole + - !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole SamFunction: Type: AWS::Serverless::Function diff --git a/tests/translator/input/function_with_alias_and_all_properties_property.yaml b/tests/translator/input/function_with_alias_and_all_properties_property.yaml index dcd9b3e27a..0154aa6030 100644 --- a/tests/translator/input/function_with_alias_and_all_properties_property.yaml +++ b/tests/translator/input/function_with_alias_and_all_properties_property.yaml @@ -42,7 +42,7 @@ Resources: - x86_64 EphemeralStorage: Size: 1024 - Role: !Sub arn:${AWS::Partition}:iam::role + Role: !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/role1 KmsKeyArn: !Sub arn:${AWS::Partition}:key:key FileSystemConfigs: - Arn: !GetAtt AccessPoint.Arn @@ -72,7 +72,7 @@ Resources: - x86_64 EphemeralStorage: Size: 1024 - Role: !Sub arn:${AWS::Partition}:iam::role + Role: !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/role1 KmsKeyArn: !Sub arn:${AWS::Partition}:key:key FileSystemConfigs: - Arn: !GetAtt AccessPoint.Arn diff --git a/tests/translator/input/function_with_sns_event_source_all_parameters.yaml b/tests/translator/input/function_with_sns_event_source_all_parameters.yaml index d4a0c767a9..18be33cec5 100644 --- a/tests/translator/input/function_with_sns_event_source_all_parameters.yaml +++ b/tests/translator/input/function_with_sns_event_source_all_parameters.yaml @@ -9,7 +9,7 @@ Resources: NotificationTopic: Type: SNS Properties: - Topic: topicArn-letsAddMoreSymbols + Topic: arn:aws:sns:us-west-2:987654321098:key/dec86919-7219-4e8d-8871-7f1609df2c7f Region: region FilterPolicy: store: diff --git a/tests/translator/input/graphqlapi_ddb_datasource_connector.yaml b/tests/translator/input/graphqlapi_ddb_datasource_connector.yaml index 1f6567fc17..188845c0f5 100644 --- a/tests/translator/input/graphqlapi_ddb_datasource_connector.yaml +++ b/tests/translator/input/graphqlapi_ddb_datasource_connector.yaml @@ -18,7 +18,7 @@ Resources: DynamoDb: MyDataSource: TableName: some-table - TableArn: big-arn + TableArn: arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f AnotherDataSource: TableName: cool-table - TableArn: table-arn + TableArn: arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f diff --git a/tests/translator/input/graphqlapi_lambda_datasource_connector.yaml b/tests/translator/input/graphqlapi_lambda_datasource_connector.yaml index 0493731a2f..e6525e4ce9 100644 --- a/tests/translator/input/graphqlapi_lambda_datasource_connector.yaml +++ b/tests/translator/input/graphqlapi_lambda_datasource_connector.yaml @@ -17,4 +17,4 @@ Resources: DataSources: Lambda: MyDataSource: - FunctionArn: blah + FunctionArn: arn:aws:lambda:us-west-2:987654321098:function:dec86919-7219-4e8d-8871-7f1609df2c7f diff --git a/tests/translator/output/all_policy_templates.json b/tests/translator/output/all_policy_templates.json index 6c9ee828bd..07507ade07 100644 --- a/tests/translator/output/all_policy_templates.json +++ b/tests/translator/output/all_policy_templates.json @@ -1580,7 +1580,7 @@ "Fn::Sub": [ "${certificateArn}", { - "certificateArn": "arn" + "certificateArn": "arn:aws:acm:us-west-2:987654321098:certificate/dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } diff --git a/tests/translator/output/aws-cn/all_policy_templates.json b/tests/translator/output/aws-cn/all_policy_templates.json index fcda9713ef..8a915b89a4 100644 --- a/tests/translator/output/aws-cn/all_policy_templates.json +++ b/tests/translator/output/aws-cn/all_policy_templates.json @@ -1580,7 +1580,7 @@ "Fn::Sub": [ "${certificateArn}", { - "certificateArn": "arn" + "certificateArn": "arn:aws:acm:us-west-2:987654321098:certificate/dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } diff --git a/tests/translator/output/aws-cn/connector_with_non_id_source_and_destination.json b/tests/translator/output/aws-cn/connector_with_non_id_source_and_destination.json index 26dadfc851..c730b04704 100644 --- a/tests/translator/output/aws-cn/connector_with_non_id_source_and_destination.json +++ b/tests/translator/output/aws-cn/connector_with_non_id_source_and_destination.json @@ -183,7 +183,9 @@ ] }, "ManagedPolicyArns": [ - "arn:{AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + } ] }, "Type": "AWS::IAM::Role" diff --git a/tests/translator/output/aws-cn/function_with_alias_and_all_properties_property.json b/tests/translator/output/aws-cn/function_with_alias_and_all_properties_property.json index 1741d9358e..e1666ffa4c 100644 --- a/tests/translator/output/aws-cn/function_with_alias_and_all_properties_property.json +++ b/tests/translator/output/aws-cn/function_with_alias_and_all_properties_property.json @@ -46,7 +46,7 @@ "PackageType": "Zip", "ReservedConcurrentExecutions": 100, "Role": { - "Fn::Sub": "arn:${AWS::Partition}:iam::role" + "Fn::Sub": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/role1" }, "Runtime": "python2.7", "Tags": [ @@ -74,7 +74,7 @@ }, "FunctionVersion": { "Fn::GetAtt": [ - "HashChangeFunctionVersion17ca83d2bf", + "HashChangeFunctionVersiona1a9d4d1e4", "Version" ] }, @@ -82,7 +82,7 @@ }, "Type": "AWS::Lambda::Alias" }, - "HashChangeFunctionVersion17ca83d2bf": { + "HashChangeFunctionVersiona1a9d4d1e4": { "DeletionPolicy": "Retain", "Properties": { "Description": "sam-testing", @@ -127,7 +127,7 @@ "PackageType": "Zip", "ReservedConcurrentExecutions": 100, "Role": { - "Fn::Sub": "arn:${AWS::Partition}:iam::role" + "Fn::Sub": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/role1" }, "Runtime": "python2.7", "Tags": [ diff --git a/tests/translator/output/aws-cn/function_with_snapstart.json b/tests/translator/output/aws-cn/function_with_snapstart.json index 345a6d3737..fe73f84a57 100644 --- a/tests/translator/output/aws-cn/function_with_snapstart.json +++ b/tests/translator/output/aws-cn/function_with_snapstart.json @@ -19,7 +19,7 @@ "Arn" ] }, - "Runtime": "python3.9", + "Runtime": "java11", "SnapStart": { "ApplyOn": "PublishedVersions" }, @@ -75,7 +75,7 @@ "Arn" ] }, - "Runtime": "python3.9", + "Runtime": "java11", "SnapStart": { "ApplyOn": "PublishedVersions" }, @@ -155,7 +155,7 @@ "Arn" ] }, - "Runtime": "python3.9", + "Runtime": "java11", "SnapStart": { "ApplyOn": { "Ref": "SnapStartParam" @@ -170,6 +170,21 @@ }, "Type": "AWS::Lambda::Function" }, + "SnapStartParameterFunctionAliaslive": { + "Properties": { + "FunctionName": { + "Ref": "SnapStartParameterFunction" + }, + "FunctionVersion": { + "Fn::GetAtt": [ + "SnapStartParameterFunctionVersione3921e07ea", + "Version" + ] + }, + "Name": "live" + }, + "Type": "AWS::Lambda::Alias" + }, "SnapStartParameterFunctionRole": { "Properties": { "AssumeRolePolicyDocument": { @@ -199,6 +214,15 @@ ] }, "Type": "AWS::IAM::Role" + }, + "SnapStartParameterFunctionVersione3921e07ea": { + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "SnapStartParameterFunction" + } + }, + "Type": "AWS::Lambda::Version" } } } diff --git a/tests/translator/output/aws-cn/function_with_sns_event_source_all_parameters.json b/tests/translator/output/aws-cn/function_with_sns_event_source_all_parameters.json index 4245545a5c..b6dc7c98c5 100644 --- a/tests/translator/output/aws-cn/function_with_sns_event_source_all_parameters.json +++ b/tests/translator/output/aws-cn/function_with_sns_event_source_all_parameters.json @@ -62,7 +62,7 @@ "FilterPolicyScope": "MessageAttributes", "Protocol": "lambda", "Region": "region", - "TopicArn": "topicArn-letsAddMoreSymbols" + "TopicArn": "arn:aws:sns:us-west-2:987654321098:key/dec86919-7219-4e8d-8871-7f1609df2c7f" }, "Type": "AWS::SNS::Subscription" }, @@ -73,7 +73,7 @@ "Ref": "MyAwesomeFunction" }, "Principal": "sns.amazonaws.com", - "SourceArn": "topicArn-letsAddMoreSymbols" + "SourceArn": "arn:aws:sns:us-west-2:987654321098:key/dec86919-7219-4e8d-8871-7f1609df2c7f" }, "Type": "AWS::Lambda::Permission" }, diff --git a/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_connector.json b/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_connector.json index 6f452be907..d7ad26baf0 100644 --- a/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_connector.json +++ b/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_connector.json @@ -104,12 +104,12 @@ ], "Effect": "Allow", "Resource": [ - "table-arn", + "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f", { "Fn::Sub": [ "${DestinationArn}/index/*", { - "DestinationArn": "table-arn" + "DestinationArn": "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } @@ -127,12 +127,12 @@ ], "Effect": "Allow", "Resource": [ - "table-arn", + "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f", { "Fn::Sub": [ "${DestinationArn}/index/*", { - "DestinationArn": "table-arn" + "DestinationArn": "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } @@ -248,12 +248,12 @@ ], "Effect": "Allow", "Resource": [ - "big-arn", + "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f", { "Fn::Sub": [ "${DestinationArn}/index/*", { - "DestinationArn": "big-arn" + "DestinationArn": "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } @@ -271,12 +271,12 @@ ], "Effect": "Allow", "Resource": [ - "big-arn", + "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f", { "Fn::Sub": [ "${DestinationArn}/index/*", { - "DestinationArn": "big-arn" + "DestinationArn": "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } diff --git a/tests/translator/output/aws-cn/graphqlapi_lambda_datasource_connector.json b/tests/translator/output/aws-cn/graphqlapi_lambda_datasource_connector.json index 7e7548fa4f..f8e9f3f21b 100644 --- a/tests/translator/output/aws-cn/graphqlapi_lambda_datasource_connector.json +++ b/tests/translator/output/aws-cn/graphqlapi_lambda_datasource_connector.json @@ -66,7 +66,7 @@ ] }, "LambdaConfig": { - "LambdaFunctionArn": "blah" + "LambdaFunctionArn": "arn:aws:lambda:us-west-2:987654321098:function:dec86919-7219-4e8d-8871-7f1609df2c7f" }, "Name": "MyDataSource", "ServiceRoleArn": { @@ -123,12 +123,12 @@ ], "Effect": "Allow", "Resource": [ - "blah", + "arn:aws:lambda:us-west-2:987654321098:function:dec86919-7219-4e8d-8871-7f1609df2c7f", { "Fn::Sub": [ "${DestinationArn}:*", { - "DestinationArn": "blah" + "DestinationArn": "arn:aws:lambda:us-west-2:987654321098:function:dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } diff --git a/tests/translator/output/aws-us-gov/all_policy_templates.json b/tests/translator/output/aws-us-gov/all_policy_templates.json index 7f96aa0b05..3dc4ef5c58 100644 --- a/tests/translator/output/aws-us-gov/all_policy_templates.json +++ b/tests/translator/output/aws-us-gov/all_policy_templates.json @@ -1580,7 +1580,7 @@ "Fn::Sub": [ "${certificateArn}", { - "certificateArn": "arn" + "certificateArn": "arn:aws:acm:us-west-2:987654321098:certificate/dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } diff --git a/tests/translator/output/aws-us-gov/connector_with_non_id_source_and_destination.json b/tests/translator/output/aws-us-gov/connector_with_non_id_source_and_destination.json index 26dadfc851..c730b04704 100644 --- a/tests/translator/output/aws-us-gov/connector_with_non_id_source_and_destination.json +++ b/tests/translator/output/aws-us-gov/connector_with_non_id_source_and_destination.json @@ -183,7 +183,9 @@ ] }, "ManagedPolicyArns": [ - "arn:{AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + } ] }, "Type": "AWS::IAM::Role" diff --git a/tests/translator/output/aws-us-gov/function_with_alias_and_all_properties_property.json b/tests/translator/output/aws-us-gov/function_with_alias_and_all_properties_property.json index fed1deb8d4..4f3db3c19f 100644 --- a/tests/translator/output/aws-us-gov/function_with_alias_and_all_properties_property.json +++ b/tests/translator/output/aws-us-gov/function_with_alias_and_all_properties_property.json @@ -46,7 +46,7 @@ "PackageType": "Zip", "ReservedConcurrentExecutions": 100, "Role": { - "Fn::Sub": "arn:${AWS::Partition}:iam::role" + "Fn::Sub": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/role1" }, "Runtime": "python2.7", "Tags": [ @@ -74,7 +74,7 @@ }, "FunctionVersion": { "Fn::GetAtt": [ - "HashChangeFunctionVersion17ca83d2bf", + "HashChangeFunctionVersiona1a9d4d1e4", "Version" ] }, @@ -82,7 +82,7 @@ }, "Type": "AWS::Lambda::Alias" }, - "HashChangeFunctionVersion17ca83d2bf": { + "HashChangeFunctionVersiona1a9d4d1e4": { "DeletionPolicy": "Retain", "Properties": { "Description": "sam-testing", @@ -127,7 +127,7 @@ "PackageType": "Zip", "ReservedConcurrentExecutions": 100, "Role": { - "Fn::Sub": "arn:${AWS::Partition}:iam::role" + "Fn::Sub": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/role1" }, "Runtime": "python2.7", "Tags": [ diff --git a/tests/translator/output/aws-us-gov/function_with_snapstart.json b/tests/translator/output/aws-us-gov/function_with_snapstart.json index bc5e828c9d..e50ed0d8fb 100644 --- a/tests/translator/output/aws-us-gov/function_with_snapstart.json +++ b/tests/translator/output/aws-us-gov/function_with_snapstart.json @@ -19,7 +19,7 @@ "Arn" ] }, - "Runtime": "python3.9", + "Runtime": "java11", "SnapStart": { "ApplyOn": "PublishedVersions" }, @@ -75,7 +75,7 @@ "Arn" ] }, - "Runtime": "python3.9", + "Runtime": "java11", "SnapStart": { "ApplyOn": "PublishedVersions" }, @@ -155,7 +155,7 @@ "Arn" ] }, - "Runtime": "python3.9", + "Runtime": "java11", "SnapStart": { "ApplyOn": { "Ref": "SnapStartParam" @@ -170,6 +170,21 @@ }, "Type": "AWS::Lambda::Function" }, + "SnapStartParameterFunctionAliaslive": { + "Properties": { + "FunctionName": { + "Ref": "SnapStartParameterFunction" + }, + "FunctionVersion": { + "Fn::GetAtt": [ + "SnapStartParameterFunctionVersione3921e07ea", + "Version" + ] + }, + "Name": "live" + }, + "Type": "AWS::Lambda::Alias" + }, "SnapStartParameterFunctionRole": { "Properties": { "AssumeRolePolicyDocument": { @@ -199,6 +214,15 @@ ] }, "Type": "AWS::IAM::Role" + }, + "SnapStartParameterFunctionVersione3921e07ea": { + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "SnapStartParameterFunction" + } + }, + "Type": "AWS::Lambda::Version" } } } diff --git a/tests/translator/output/aws-us-gov/function_with_sns_event_source_all_parameters.json b/tests/translator/output/aws-us-gov/function_with_sns_event_source_all_parameters.json index 4123e182a8..3012b2a7fb 100644 --- a/tests/translator/output/aws-us-gov/function_with_sns_event_source_all_parameters.json +++ b/tests/translator/output/aws-us-gov/function_with_sns_event_source_all_parameters.json @@ -62,7 +62,7 @@ "FilterPolicyScope": "MessageAttributes", "Protocol": "lambda", "Region": "region", - "TopicArn": "topicArn-letsAddMoreSymbols" + "TopicArn": "arn:aws:sns:us-west-2:987654321098:key/dec86919-7219-4e8d-8871-7f1609df2c7f" }, "Type": "AWS::SNS::Subscription" }, @@ -73,7 +73,7 @@ "Ref": "MyAwesomeFunction" }, "Principal": "sns.amazonaws.com", - "SourceArn": "topicArn-letsAddMoreSymbols" + "SourceArn": "arn:aws:sns:us-west-2:987654321098:key/dec86919-7219-4e8d-8871-7f1609df2c7f" }, "Type": "AWS::Lambda::Permission" }, diff --git a/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_connector.json b/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_connector.json index 6f452be907..d7ad26baf0 100644 --- a/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_connector.json +++ b/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_connector.json @@ -104,12 +104,12 @@ ], "Effect": "Allow", "Resource": [ - "table-arn", + "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f", { "Fn::Sub": [ "${DestinationArn}/index/*", { - "DestinationArn": "table-arn" + "DestinationArn": "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } @@ -127,12 +127,12 @@ ], "Effect": "Allow", "Resource": [ - "table-arn", + "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f", { "Fn::Sub": [ "${DestinationArn}/index/*", { - "DestinationArn": "table-arn" + "DestinationArn": "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } @@ -248,12 +248,12 @@ ], "Effect": "Allow", "Resource": [ - "big-arn", + "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f", { "Fn::Sub": [ "${DestinationArn}/index/*", { - "DestinationArn": "big-arn" + "DestinationArn": "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } @@ -271,12 +271,12 @@ ], "Effect": "Allow", "Resource": [ - "big-arn", + "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f", { "Fn::Sub": [ "${DestinationArn}/index/*", { - "DestinationArn": "big-arn" + "DestinationArn": "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } diff --git a/tests/translator/output/aws-us-gov/graphqlapi_lambda_datasource_connector.json b/tests/translator/output/aws-us-gov/graphqlapi_lambda_datasource_connector.json index 7e7548fa4f..f8e9f3f21b 100644 --- a/tests/translator/output/aws-us-gov/graphqlapi_lambda_datasource_connector.json +++ b/tests/translator/output/aws-us-gov/graphqlapi_lambda_datasource_connector.json @@ -66,7 +66,7 @@ ] }, "LambdaConfig": { - "LambdaFunctionArn": "blah" + "LambdaFunctionArn": "arn:aws:lambda:us-west-2:987654321098:function:dec86919-7219-4e8d-8871-7f1609df2c7f" }, "Name": "MyDataSource", "ServiceRoleArn": { @@ -123,12 +123,12 @@ ], "Effect": "Allow", "Resource": [ - "blah", + "arn:aws:lambda:us-west-2:987654321098:function:dec86919-7219-4e8d-8871-7f1609df2c7f", { "Fn::Sub": [ "${DestinationArn}:*", { - "DestinationArn": "blah" + "DestinationArn": "arn:aws:lambda:us-west-2:987654321098:function:dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } diff --git a/tests/translator/output/connector_with_non_id_source_and_destination.json b/tests/translator/output/connector_with_non_id_source_and_destination.json index c2d8294efd..7fcdef0898 100644 --- a/tests/translator/output/connector_with_non_id_source_and_destination.json +++ b/tests/translator/output/connector_with_non_id_source_and_destination.json @@ -183,7 +183,9 @@ ] }, "ManagedPolicyArns": [ - "arn:{AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + } ] }, "Type": "AWS::IAM::Role" diff --git a/tests/translator/output/function_with_alias_and_all_properties_property.json b/tests/translator/output/function_with_alias_and_all_properties_property.json index 10120e07ed..a932c89cd9 100644 --- a/tests/translator/output/function_with_alias_and_all_properties_property.json +++ b/tests/translator/output/function_with_alias_and_all_properties_property.json @@ -46,7 +46,7 @@ "PackageType": "Zip", "ReservedConcurrentExecutions": 100, "Role": { - "Fn::Sub": "arn:${AWS::Partition}:iam::role" + "Fn::Sub": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/role1" }, "Runtime": "python2.7", "Tags": [ @@ -74,7 +74,7 @@ }, "FunctionVersion": { "Fn::GetAtt": [ - "HashChangeFunctionVersion17ca83d2bf", + "HashChangeFunctionVersiona1a9d4d1e4", "Version" ] }, @@ -82,7 +82,7 @@ }, "Type": "AWS::Lambda::Alias" }, - "HashChangeFunctionVersion17ca83d2bf": { + "HashChangeFunctionVersiona1a9d4d1e4": { "DeletionPolicy": "Retain", "Properties": { "Description": "sam-testing", @@ -127,7 +127,7 @@ "PackageType": "Zip", "ReservedConcurrentExecutions": 100, "Role": { - "Fn::Sub": "arn:${AWS::Partition}:iam::role" + "Fn::Sub": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/role1" }, "Runtime": "python2.7", "Tags": [ diff --git a/tests/translator/output/function_with_snapstart.json b/tests/translator/output/function_with_snapstart.json index 0d8fb81b98..03696eef68 100644 --- a/tests/translator/output/function_with_snapstart.json +++ b/tests/translator/output/function_with_snapstart.json @@ -19,7 +19,7 @@ "Arn" ] }, - "Runtime": "python3.9", + "Runtime": "java11", "SnapStart": { "ApplyOn": "PublishedVersions" }, @@ -75,7 +75,7 @@ "Arn" ] }, - "Runtime": "python3.9", + "Runtime": "java11", "SnapStart": { "ApplyOn": "PublishedVersions" }, @@ -155,7 +155,7 @@ "Arn" ] }, - "Runtime": "python3.9", + "Runtime": "java11", "SnapStart": { "ApplyOn": { "Ref": "SnapStartParam" @@ -170,6 +170,21 @@ }, "Type": "AWS::Lambda::Function" }, + "SnapStartParameterFunctionAliaslive": { + "Properties": { + "FunctionName": { + "Ref": "SnapStartParameterFunction" + }, + "FunctionVersion": { + "Fn::GetAtt": [ + "SnapStartParameterFunctionVersione3921e07ea", + "Version" + ] + }, + "Name": "live" + }, + "Type": "AWS::Lambda::Alias" + }, "SnapStartParameterFunctionRole": { "Properties": { "AssumeRolePolicyDocument": { @@ -199,6 +214,15 @@ ] }, "Type": "AWS::IAM::Role" + }, + "SnapStartParameterFunctionVersione3921e07ea": { + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "SnapStartParameterFunction" + } + }, + "Type": "AWS::Lambda::Version" } } } diff --git a/tests/translator/output/function_with_sns_event_source_all_parameters.json b/tests/translator/output/function_with_sns_event_source_all_parameters.json index ff8c549893..52daff8183 100644 --- a/tests/translator/output/function_with_sns_event_source_all_parameters.json +++ b/tests/translator/output/function_with_sns_event_source_all_parameters.json @@ -62,7 +62,7 @@ "FilterPolicyScope": "MessageAttributes", "Protocol": "lambda", "Region": "region", - "TopicArn": "topicArn-letsAddMoreSymbols" + "TopicArn": "arn:aws:sns:us-west-2:987654321098:key/dec86919-7219-4e8d-8871-7f1609df2c7f" }, "Type": "AWS::SNS::Subscription" }, @@ -73,7 +73,7 @@ "Ref": "MyAwesomeFunction" }, "Principal": "sns.amazonaws.com", - "SourceArn": "topicArn-letsAddMoreSymbols" + "SourceArn": "arn:aws:sns:us-west-2:987654321098:key/dec86919-7219-4e8d-8871-7f1609df2c7f" }, "Type": "AWS::Lambda::Permission" }, diff --git a/tests/translator/output/graphqlapi_ddb_datasource_connector.json b/tests/translator/output/graphqlapi_ddb_datasource_connector.json index 6f452be907..d7ad26baf0 100644 --- a/tests/translator/output/graphqlapi_ddb_datasource_connector.json +++ b/tests/translator/output/graphqlapi_ddb_datasource_connector.json @@ -104,12 +104,12 @@ ], "Effect": "Allow", "Resource": [ - "table-arn", + "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f", { "Fn::Sub": [ "${DestinationArn}/index/*", { - "DestinationArn": "table-arn" + "DestinationArn": "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } @@ -127,12 +127,12 @@ ], "Effect": "Allow", "Resource": [ - "table-arn", + "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f", { "Fn::Sub": [ "${DestinationArn}/index/*", { - "DestinationArn": "table-arn" + "DestinationArn": "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } @@ -248,12 +248,12 @@ ], "Effect": "Allow", "Resource": [ - "big-arn", + "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f", { "Fn::Sub": [ "${DestinationArn}/index/*", { - "DestinationArn": "big-arn" + "DestinationArn": "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } @@ -271,12 +271,12 @@ ], "Effect": "Allow", "Resource": [ - "big-arn", + "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f", { "Fn::Sub": [ "${DestinationArn}/index/*", { - "DestinationArn": "big-arn" + "DestinationArn": "arn:aws:dynamodb:us-west-2:987654321098:table/dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } diff --git a/tests/translator/output/graphqlapi_lambda_datasource_connector.json b/tests/translator/output/graphqlapi_lambda_datasource_connector.json index 7e7548fa4f..f8e9f3f21b 100644 --- a/tests/translator/output/graphqlapi_lambda_datasource_connector.json +++ b/tests/translator/output/graphqlapi_lambda_datasource_connector.json @@ -66,7 +66,7 @@ ] }, "LambdaConfig": { - "LambdaFunctionArn": "blah" + "LambdaFunctionArn": "arn:aws:lambda:us-west-2:987654321098:function:dec86919-7219-4e8d-8871-7f1609df2c7f" }, "Name": "MyDataSource", "ServiceRoleArn": { @@ -123,12 +123,12 @@ ], "Effect": "Allow", "Resource": [ - "blah", + "arn:aws:lambda:us-west-2:987654321098:function:dec86919-7219-4e8d-8871-7f1609df2c7f", { "Fn::Sub": [ "${DestinationArn}:*", { - "DestinationArn": "blah" + "DestinationArn": "arn:aws:lambda:us-west-2:987654321098:function:dec86919-7219-4e8d-8871-7f1609df2c7f" } ] } From 4baa981579a18e9497ce821213db679d52af04f1 Mon Sep 17 00:00:00 2001 From: Aayush Thapa Date: Wed, 11 Sep 2024 11:58:16 -0700 Subject: [PATCH 2/5] update cfn lint config --- .cfnlintrc.yaml | 5 +++++ bin/run_cfn_lint.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.cfnlintrc.yaml b/.cfnlintrc.yaml index a5a54820e7..fd9eb87078 100644 --- a/.cfnlintrc.yaml +++ b/.cfnlintrc.yaml @@ -134,8 +134,13 @@ 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: - E2531 # Deprecated runtime; not relevant for transform tests + - E2533 # Another deprecated runtime; not relevant for transform tests - W2531 # EOL runtime; not relevant for transform tests - E3001 # Invalid or unsupported Type; common in transform tests since they focus on SAM resources - W2001 # Parameter not used + - E3006 # Resource type check; we have some Foo Bar resources diff --git a/bin/run_cfn_lint.sh b/bin/run_cfn_lint.sh index 4157af06e8..5e3137f538 100755 --- a/bin/run_cfn_lint.sh +++ b/bin/run_cfn_lint.sh @@ -9,7 +9,7 @@ if [ ! -d "${VENV}" ]; then python3 -m venv "${VENV}" fi -"${VENV}/bin/python" -m pip install cfn-lint==0.75.0 --upgrade --quiet +"${VENV}/bin/python" -m pip install cfn-lint==1.12.0 --upgrade --quiet # update cfn schema "${VENV}/bin/cfn-lint" -u "${VENV}/bin/cfn-lint" --format parseable From ab6d9998413fa99b5f551b48afaddcee24226296 Mon Sep 17 00:00:00 2001 From: Aayush Thapa Date: Wed, 11 Sep 2024 12:02:32 -0700 Subject: [PATCH 3/5] update cfn lint version --- bin/run_cfn_lint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/run_cfn_lint.sh b/bin/run_cfn_lint.sh index 5e3137f538..eeee7e483e 100755 --- a/bin/run_cfn_lint.sh +++ b/bin/run_cfn_lint.sh @@ -9,7 +9,7 @@ if [ ! -d "${VENV}" ]; then python3 -m venv "${VENV}" fi -"${VENV}/bin/python" -m pip install cfn-lint==1.12.0 --upgrade --quiet +"${VENV}/bin/python" -m pip install cfn-lint --upgrade --quiet # update cfn schema "${VENV}/bin/cfn-lint" -u "${VENV}/bin/cfn-lint" --format parseable From 55a1395a9f62c153fc1dd3e2c5bf2d40a949bb52 Mon Sep 17 00:00:00 2001 From: Aayush Thapa Date: Wed, 11 Sep 2024 12:04:16 -0700 Subject: [PATCH 4/5] update snapstart tests --- .../aws-cn/function_with_snapstart.json | 30 ++----------------- .../aws-us-gov/function_with_snapstart.json | 30 ++----------------- .../output/function_with_snapstart.json | 30 ++----------------- 3 files changed, 9 insertions(+), 81 deletions(-) diff --git a/tests/translator/output/aws-cn/function_with_snapstart.json b/tests/translator/output/aws-cn/function_with_snapstart.json index fe73f84a57..345a6d3737 100644 --- a/tests/translator/output/aws-cn/function_with_snapstart.json +++ b/tests/translator/output/aws-cn/function_with_snapstart.json @@ -19,7 +19,7 @@ "Arn" ] }, - "Runtime": "java11", + "Runtime": "python3.9", "SnapStart": { "ApplyOn": "PublishedVersions" }, @@ -75,7 +75,7 @@ "Arn" ] }, - "Runtime": "java11", + "Runtime": "python3.9", "SnapStart": { "ApplyOn": "PublishedVersions" }, @@ -155,7 +155,7 @@ "Arn" ] }, - "Runtime": "java11", + "Runtime": "python3.9", "SnapStart": { "ApplyOn": { "Ref": "SnapStartParam" @@ -170,21 +170,6 @@ }, "Type": "AWS::Lambda::Function" }, - "SnapStartParameterFunctionAliaslive": { - "Properties": { - "FunctionName": { - "Ref": "SnapStartParameterFunction" - }, - "FunctionVersion": { - "Fn::GetAtt": [ - "SnapStartParameterFunctionVersione3921e07ea", - "Version" - ] - }, - "Name": "live" - }, - "Type": "AWS::Lambda::Alias" - }, "SnapStartParameterFunctionRole": { "Properties": { "AssumeRolePolicyDocument": { @@ -214,15 +199,6 @@ ] }, "Type": "AWS::IAM::Role" - }, - "SnapStartParameterFunctionVersione3921e07ea": { - "DeletionPolicy": "Retain", - "Properties": { - "FunctionName": { - "Ref": "SnapStartParameterFunction" - } - }, - "Type": "AWS::Lambda::Version" } } } diff --git a/tests/translator/output/aws-us-gov/function_with_snapstart.json b/tests/translator/output/aws-us-gov/function_with_snapstart.json index e50ed0d8fb..bc5e828c9d 100644 --- a/tests/translator/output/aws-us-gov/function_with_snapstart.json +++ b/tests/translator/output/aws-us-gov/function_with_snapstart.json @@ -19,7 +19,7 @@ "Arn" ] }, - "Runtime": "java11", + "Runtime": "python3.9", "SnapStart": { "ApplyOn": "PublishedVersions" }, @@ -75,7 +75,7 @@ "Arn" ] }, - "Runtime": "java11", + "Runtime": "python3.9", "SnapStart": { "ApplyOn": "PublishedVersions" }, @@ -155,7 +155,7 @@ "Arn" ] }, - "Runtime": "java11", + "Runtime": "python3.9", "SnapStart": { "ApplyOn": { "Ref": "SnapStartParam" @@ -170,21 +170,6 @@ }, "Type": "AWS::Lambda::Function" }, - "SnapStartParameterFunctionAliaslive": { - "Properties": { - "FunctionName": { - "Ref": "SnapStartParameterFunction" - }, - "FunctionVersion": { - "Fn::GetAtt": [ - "SnapStartParameterFunctionVersione3921e07ea", - "Version" - ] - }, - "Name": "live" - }, - "Type": "AWS::Lambda::Alias" - }, "SnapStartParameterFunctionRole": { "Properties": { "AssumeRolePolicyDocument": { @@ -214,15 +199,6 @@ ] }, "Type": "AWS::IAM::Role" - }, - "SnapStartParameterFunctionVersione3921e07ea": { - "DeletionPolicy": "Retain", - "Properties": { - "FunctionName": { - "Ref": "SnapStartParameterFunction" - } - }, - "Type": "AWS::Lambda::Version" } } } diff --git a/tests/translator/output/function_with_snapstart.json b/tests/translator/output/function_with_snapstart.json index 03696eef68..0d8fb81b98 100644 --- a/tests/translator/output/function_with_snapstart.json +++ b/tests/translator/output/function_with_snapstart.json @@ -19,7 +19,7 @@ "Arn" ] }, - "Runtime": "java11", + "Runtime": "python3.9", "SnapStart": { "ApplyOn": "PublishedVersions" }, @@ -75,7 +75,7 @@ "Arn" ] }, - "Runtime": "java11", + "Runtime": "python3.9", "SnapStart": { "ApplyOn": "PublishedVersions" }, @@ -155,7 +155,7 @@ "Arn" ] }, - "Runtime": "java11", + "Runtime": "python3.9", "SnapStart": { "ApplyOn": { "Ref": "SnapStartParam" @@ -170,21 +170,6 @@ }, "Type": "AWS::Lambda::Function" }, - "SnapStartParameterFunctionAliaslive": { - "Properties": { - "FunctionName": { - "Ref": "SnapStartParameterFunction" - }, - "FunctionVersion": { - "Fn::GetAtt": [ - "SnapStartParameterFunctionVersione3921e07ea", - "Version" - ] - }, - "Name": "live" - }, - "Type": "AWS::Lambda::Alias" - }, "SnapStartParameterFunctionRole": { "Properties": { "AssumeRolePolicyDocument": { @@ -214,15 +199,6 @@ ] }, "Type": "AWS::IAM::Role" - }, - "SnapStartParameterFunctionVersione3921e07ea": { - "DeletionPolicy": "Retain", - "Properties": { - "FunctionName": { - "Ref": "SnapStartParameterFunction" - } - }, - "Type": "AWS::Lambda::Version" } } } From f5cb06d25acf83e51596cbe38093dd1924057d4b Mon Sep 17 00:00:00 2001 From: Aayush Thapa Date: Wed, 11 Sep 2024 13:32:38 -0700 Subject: [PATCH 5/5] fix embedded connectors test --- .cfnlintrc.yaml | 1 - .../embedded_connectors_hardcoded_props.yaml | 15 +++++++++++++++ .../embedded_connectors_hardcoded_props.json | 17 +++++++++++++++++ .../embedded_connectors_hardcoded_props.json | 17 +++++++++++++++++ .../embedded_connectors_hardcoded_props.json | 17 +++++++++++++++++ 5 files changed, 66 insertions(+), 1 deletion(-) diff --git a/.cfnlintrc.yaml b/.cfnlintrc.yaml index fd9eb87078..cda80d6fc4 100644 --- a/.cfnlintrc.yaml +++ b/.cfnlintrc.yaml @@ -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: diff --git a/tests/translator/input/embedded_connectors_hardcoded_props.yaml b/tests/translator/input/embedded_connectors_hardcoded_props.yaml index 5c84285d96..da59bf5eba 100644 --- a/tests/translator/input/embedded_connectors_hardcoded_props.yaml +++ b/tests/translator/input/embedded_connectors_hardcoded_props.yaml @@ -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 @@ -13,6 +22,8 @@ Resources: Arn: !Ref MyTopic Permissions: - Write + Properties: + ScheduleExpression: rate(5 minutes) MyQueue: Type: AWS::SQS::Queue @@ -42,6 +53,8 @@ Resources: Id: MyFunction Permissions: - Write + Properties: + Name: MyApiV1 MyApiV2: Type: AWS::ApiGatewayV2::Api @@ -54,6 +67,8 @@ Resources: Id: MyFunction Permissions: - Write + Properties: + Name: MyApiV2 MySNSTopic: Type: AWS::SNS::Topic diff --git a/tests/translator/output/aws-cn/embedded_connectors_hardcoded_props.json b/tests/translator/output/aws-cn/embedded_connectors_hardcoded_props.json index d767d70954..aef58c6c96 100644 --- a/tests/translator/output/aws-cn/embedded_connectors_hardcoded_props.json +++ b/tests/translator/output/aws-cn/embedded_connectors_hardcoded_props.json @@ -1,6 +1,9 @@ { "Resources": { "MyApiV1": { + "Properties": { + "Name": "MyApiV1" + }, "Type": "AWS::ApiGateway::RestApi" }, "MyApiV1ApiV1ToLambdaWriteLambdaPermission": { @@ -40,6 +43,9 @@ "Type": "AWS::Lambda::Permission" }, "MyApiV2": { + "Properties": { + "Name": "MyApiV2" + }, "Type": "AWS::ApiGatewayV2::Api" }, "MyApiV2ApiV2ToLambdaWriteLambdaPermission": { @@ -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": { @@ -88,6 +102,9 @@ "Type": "AWS::SQS::Queue" }, "MyRule": { + "Properties": { + "ScheduleExpression": "rate(5 minutes)" + }, "Type": "AWS::Events::Rule" }, "MyRuleRuleToTopicTopicPolicy": { diff --git a/tests/translator/output/aws-us-gov/embedded_connectors_hardcoded_props.json b/tests/translator/output/aws-us-gov/embedded_connectors_hardcoded_props.json index d767d70954..aef58c6c96 100644 --- a/tests/translator/output/aws-us-gov/embedded_connectors_hardcoded_props.json +++ b/tests/translator/output/aws-us-gov/embedded_connectors_hardcoded_props.json @@ -1,6 +1,9 @@ { "Resources": { "MyApiV1": { + "Properties": { + "Name": "MyApiV1" + }, "Type": "AWS::ApiGateway::RestApi" }, "MyApiV1ApiV1ToLambdaWriteLambdaPermission": { @@ -40,6 +43,9 @@ "Type": "AWS::Lambda::Permission" }, "MyApiV2": { + "Properties": { + "Name": "MyApiV2" + }, "Type": "AWS::ApiGatewayV2::Api" }, "MyApiV2ApiV2ToLambdaWriteLambdaPermission": { @@ -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": { @@ -88,6 +102,9 @@ "Type": "AWS::SQS::Queue" }, "MyRule": { + "Properties": { + "ScheduleExpression": "rate(5 minutes)" + }, "Type": "AWS::Events::Rule" }, "MyRuleRuleToTopicTopicPolicy": { diff --git a/tests/translator/output/embedded_connectors_hardcoded_props.json b/tests/translator/output/embedded_connectors_hardcoded_props.json index d767d70954..aef58c6c96 100644 --- a/tests/translator/output/embedded_connectors_hardcoded_props.json +++ b/tests/translator/output/embedded_connectors_hardcoded_props.json @@ -1,6 +1,9 @@ { "Resources": { "MyApiV1": { + "Properties": { + "Name": "MyApiV1" + }, "Type": "AWS::ApiGateway::RestApi" }, "MyApiV1ApiV1ToLambdaWriteLambdaPermission": { @@ -40,6 +43,9 @@ "Type": "AWS::Lambda::Permission" }, "MyApiV2": { + "Properties": { + "Name": "MyApiV2" + }, "Type": "AWS::ApiGatewayV2::Api" }, "MyApiV2ApiV2ToLambdaWriteLambdaPermission": { @@ -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": { @@ -88,6 +102,9 @@ "Type": "AWS::SQS::Queue" }, "MyRule": { + "Properties": { + "ScheduleExpression": "rate(5 minutes)" + }, "Type": "AWS::Events::Rule" }, "MyRuleRuleToTopicTopicPolicy": {