diff --git a/requirements/base.txt b/requirements/base.txt index 98ccf142a3..af78458252 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -9,7 +9,7 @@ jmespath~=0.10.0 ruamel_yaml==0.17.21 PyYAML>=5.4.1,==5.* cookiecutter~=2.1.1 -aws-sam-translator==1.56.0 +aws-sam-translator==1.57.0 #docker minor version updates can include breaking changes. Auto update micro version only. docker~=4.2.0 dateparser~=1.0 diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index b50bee9fd5..b91e1a7ec9 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -19,10 +19,10 @@ aws-lambda-builders==1.24.0 \ --hash=sha256:6e46ce9365edb20259acae4a21f41fa46c701aaa58d2fb681022e4f0998de2d1 \ --hash=sha256:fd7277e01a3c280c5a2a5ca5eb7888594ecddbc8355d1f519ea48a1f07f9d2d8 # via aws-sam-cli (setup.py) -aws-sam-translator==1.56.0 \ - --hash=sha256:71b1ef33ec6892b77481d14b2673880f6ef0907508e949cf643963d5decaf8ce \ - --hash=sha256:ba97287f5ffc8bc55759f3a416230a27ce26d8c0118e77b9737fa700781bd816 \ - --hash=sha256:cf3c200d7048f4cd8b401c1dad35fc876667152fbead21e186ebe0a04ea7f2d1 +aws-sam-translator==1.57.0 \ + --hash=sha256:5953b973468f72c11ce6fe3ae4c5bea11fb774bf46c91970e3ab4460c5e1798e \ + --hash=sha256:8bfdb6dd8cdc9b777e54de1924e60eddc6f068218016e28f629db2bd41af953e \ + --hash=sha256:b7fd46bf28d94d5d5174883534469358edb4612b64a6eff1db884d267a45a6e3 # via # aws-sam-cli (setup.py) # cfn-lint diff --git a/samcli/__init__.py b/samcli/__init__.py index 6f44aa4290..147a0d37b8 100644 --- a/samcli/__init__.py +++ b/samcli/__init__.py @@ -2,4 +2,4 @@ SAM CLI version """ -__version__ = "1.69.0" +__version__ = "1.70.0" diff --git a/tests/functional/commands/validate/lib/models/alexa_skill.yaml b/tests/functional/commands/validate/lib/models/alexa_skill.yaml index f7de0a474d..0f6194c73c 100644 --- a/tests/functional/commands/validate/lib/models/alexa_skill.yaml +++ b/tests/functional/commands/validate/lib/models/alexa_skill.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- # File: sam.yml # Version: 0.9 diff --git a/tests/functional/commands/validate/lib/models/alexa_skill_with_skill_id.yaml b/tests/functional/commands/validate/lib/models/alexa_skill_with_skill_id.yaml index c097d295d5..cf6f00889b 100644 --- a/tests/functional/commands/validate/lib/models/alexa_skill_with_skill_id.yaml +++ b/tests/functional/commands/validate/lib/models/alexa_skill_with_skill_id.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- # File: sam.yml # Version: 0.9 diff --git a/tests/functional/commands/validate/lib/models/all_policy_templates.yaml b/tests/functional/commands/validate/lib/models/all_policy_templates.yaml index 611a1bbaba..05595dd715 100644 --- a/tests/functional/commands/validate/lib/models/all_policy_templates.yaml +++ b/tests/functional/commands/validate/lib/models/all_policy_templates.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- # "Kitchen Sink" test containing all supported policy templates. The idea is to know every one of them is # transformable and fail on any changes in the policy template definition without updating the test # Since this not about testing the transformation logic, we will keep the policy template parameter values as literal diff --git a/tests/functional/commands/validate/lib/models/api_cache.yaml b/tests/functional/commands/validate/lib/models/api_cache.yaml index 789bec67e4..24d8a660b7 100644 --- a/tests/functional/commands/validate/lib/models/api_cache.yaml +++ b/tests/functional/commands/validate/lib/models/api_cache.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HtmlFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_description.yaml b/tests/functional/commands/validate/lib/models/api_description.yaml index ed6355f5d8..c660e785e6 100644 --- a/tests/functional/commands/validate/lib/models/api_description.yaml +++ b/tests/functional/commands/validate/lib/models/api_description.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: Function: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_endpoint_configuration.yaml b/tests/functional/commands/validate/lib/models/api_endpoint_configuration.yaml index baca5a90d8..484c24a2c7 100644 --- a/tests/functional/commands/validate/lib/models/api_endpoint_configuration.yaml +++ b/tests/functional/commands/validate/lib/models/api_endpoint_configuration.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: EndpointConfig: Type: String diff --git a/tests/functional/commands/validate/lib/models/api_endpoint_configuration_with_vpcendpoint.yaml b/tests/functional/commands/validate/lib/models/api_endpoint_configuration_with_vpcendpoint.yaml index a9e1ea7bcf..cd392257b0 100644 --- a/tests/functional/commands/validate/lib/models/api_endpoint_configuration_with_vpcendpoint.yaml +++ b/tests/functional/commands/validate/lib/models/api_endpoint_configuration_with_vpcendpoint.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: EndpointConfigType: Type: String diff --git a/tests/functional/commands/validate/lib/models/api_http_paths_with_if_condition.yaml b/tests/functional/commands/validate/lib/models/api_http_paths_with_if_condition.yaml index e8f5c1bded..d0105d39d7 100644 --- a/tests/functional/commands/validate/lib/models/api_http_paths_with_if_condition.yaml +++ b/tests/functional/commands/validate/lib/models/api_http_paths_with_if_condition.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > diff --git a/tests/functional/commands/validate/lib/models/api_http_paths_with_if_condition_no_value_else_case.yaml b/tests/functional/commands/validate/lib/models/api_http_paths_with_if_condition_no_value_else_case.yaml index ba5c6d2d0a..ec177e921e 100644 --- a/tests/functional/commands/validate/lib/models/api_http_paths_with_if_condition_no_value_else_case.yaml +++ b/tests/functional/commands/validate/lib/models/api_http_paths_with_if_condition_no_value_else_case.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > diff --git a/tests/functional/commands/validate/lib/models/api_http_paths_with_if_condition_no_value_then_case.yaml b/tests/functional/commands/validate/lib/models/api_http_paths_with_if_condition_no_value_then_case.yaml index 13d618720d..7131e9d7a7 100644 --- a/tests/functional/commands/validate/lib/models/api_http_paths_with_if_condition_no_value_then_case.yaml +++ b/tests/functional/commands/validate/lib/models/api_http_paths_with_if_condition_no_value_then_case.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > diff --git a/tests/functional/commands/validate/lib/models/api_http_with_default_iam_authorizer.yaml b/tests/functional/commands/validate/lib/models/api_http_with_default_iam_authorizer.yaml new file mode 100644 index 0000000000..a2bfabbb2b --- /dev/null +++ b/tests/functional/commands/validate/lib/models/api_http_with_default_iam_authorizer.yaml @@ -0,0 +1,101 @@ +Resources: + HelloWorldFunction: + Type: AWS::Serverless::Function + Properties: + CodeUri: s3://bucket/key + Handler: app.lambda_handler + Runtime: python3.8 + Role: + Fn::GetAtt: + - HelloWorldFunctionRole + - Arn + Architectures: + - x86_64 + Events: + HelloWorld: + Type: HttpApi + Properties: + ApiId: + Ref: HttpApi + Path: /{proxy+} + Method: ANY + Preflight: + Type: HttpApi + Properties: + ApiId: + Ref: HttpApi + Path: /{proxy+} + Method: OPTIONS + HelloWorldFunctionRole: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Version: '2012-10-17' + Statement: + - Effect: Allow + Principal: + Service: lambda.amazonaws.com + Action: sts:AssumeRole + Policies: + - PolicyName: HelloWorldFunctionPolicy + PolicyDocument: + Version: '2012-10-17' + Statement: + - Effect: Allow + Action: + - logs:CreateLogGroup + - logs:CreateLogStream + - logs:PutLogEvents + - cognito-idp:List* + - cognito-idp:AdminListGroupsForUser + - sts:AssumeRole + Resource: '*' + Metadata: + SamResourceId: HelloWorldFunctionRole + + HttpApi: + Type: AWS::Serverless::HttpApi + Properties: + StageName: + Fn::Sub: ${StageName} + DefinitionBody: + openapi: 3.0.1 + info: + title: + Ref: AWS::StackName + paths: {} + CorsConfiguration: + AllowOrigins: + - '*' + AllowCredentials: false + AllowHeaders: + - Content-Type + - X-CSRF-TOKEN + - X-Amz-Date + - Authorization + - X-Requested-With + - X-Requested-By + - X-Api-Key + - X-Forwarded-For + - X-Amz-Security-Token + AllowMethods: + - '*' + Auth: + EnableIamAuthorizer: true + DefaultAuthorizer: AWS_IAM + Authorizers: + MyAuthorizer: + IdentitySource: $request.header.Authorization + JwtConfiguration: + audience: + - Ref: UserPoolClient + - Ref: UserPoolClientApp + issuer: + Fn::Join: + - '' + - - https://cognito-idp. + - Fn::Sub: ${AWS::Region} + - .amazonaws.com/ + - Ref: UserPool + Metadata: + SamResourceId: HttpApi diff --git a/tests/functional/commands/validate/lib/models/api_model_without_properties.yaml b/tests/functional/commands/validate/lib/models/api_model_without_properties.yaml new file mode 100644 index 0000000000..94de0e2f77 --- /dev/null +++ b/tests/functional/commands/validate/lib/models/api_model_without_properties.yaml @@ -0,0 +1,11 @@ +Resources: + MyApi: + Type: AWS::Serverless::Api + Properties: + StageName: Prod + Models: + MyModel: + items: + type: integer + type: array + title: MyModel diff --git a/tests/functional/commands/validate/lib/models/api_request_model.yaml b/tests/functional/commands/validate/lib/models/api_request_model.yaml index ebc05600f4..b9ea91c7f2 100644 --- a/tests/functional/commands/validate/lib/models/api_request_model.yaml +++ b/tests/functional/commands/validate/lib/models/api_request_model.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HtmlFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_request_model_openapi_3.yaml b/tests/functional/commands/validate/lib/models/api_request_model_openapi_3.yaml index b27f842e03..7cec68d148 100644 --- a/tests/functional/commands/validate/lib/models/api_request_model_openapi_3.yaml +++ b/tests/functional/commands/validate/lib/models/api_request_model_openapi_3.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HtmlFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_request_model_with_validator.yaml b/tests/functional/commands/validate/lib/models/api_request_model_with_validator.yaml index ad1b8299e6..6fd37ad621 100644 --- a/tests/functional/commands/validate/lib/models/api_request_model_with_validator.yaml +++ b/tests/functional/commands/validate/lib/models/api_request_model_with_validator.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HtmlFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_request_model_with_validator_openapi_3.yaml b/tests/functional/commands/validate/lib/models/api_request_model_with_validator_openapi_3.yaml index 0439c14276..06c1e169d5 100644 --- a/tests/functional/commands/validate/lib/models/api_request_model_with_validator_openapi_3.yaml +++ b/tests/functional/commands/validate/lib/models/api_request_model_with_validator_openapi_3.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HtmlFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_openapi.yaml b/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_openapi.yaml index 3f837995f2..0c41964443 100644 --- a/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_openapi.yaml +++ b/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_openapi.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > diff --git a/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_openapi_no_value_else_case.yaml b/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_openapi_no_value_else_case.yaml index 6399b678d0..da86f915dd 100644 --- a/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_openapi_no_value_else_case.yaml +++ b/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_openapi_no_value_else_case.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > diff --git a/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_openapi_no_value_then_case.yaml b/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_openapi_no_value_then_case.yaml index 6444faf01f..5589e057c7 100644 --- a/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_openapi_no_value_then_case.yaml +++ b/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_openapi_no_value_then_case.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > diff --git a/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_swagger.yaml b/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_swagger.yaml index 54f9fbc432..2365fdc573 100644 --- a/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_swagger.yaml +++ b/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_swagger.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > diff --git a/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_swagger_no_value_else_case.yaml b/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_swagger_no_value_else_case.yaml index f271ba24cf..f0e32832b7 100644 --- a/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_swagger_no_value_else_case.yaml +++ b/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_swagger_no_value_else_case.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > diff --git a/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_swagger_no_value_then_case.yaml b/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_swagger_no_value_then_case.yaml index db5822ea37..1fd45d3bf0 100644 --- a/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_swagger_no_value_then_case.yaml +++ b/tests/functional/commands/validate/lib/models/api_rest_paths_with_if_condition_swagger_no_value_then_case.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > diff --git a/tests/functional/commands/validate/lib/models/api_swagger_integration_with_ref_intrinsic_api_id.yaml b/tests/functional/commands/validate/lib/models/api_swagger_integration_with_ref_intrinsic_api_id.yaml index 6558ee2dcf..502aefdabf 100644 --- a/tests/functional/commands/validate/lib/models/api_swagger_integration_with_ref_intrinsic_api_id.yaml +++ b/tests/functional/commands/validate/lib/models/api_swagger_integration_with_ref_intrinsic_api_id.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HtmlFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_swagger_integration_with_string_api_id.yaml b/tests/functional/commands/validate/lib/models/api_swagger_integration_with_string_api_id.yaml index 553b3337cc..5afbc7d28f 100644 --- a/tests/functional/commands/validate/lib/models/api_swagger_integration_with_string_api_id.yaml +++ b/tests/functional/commands/validate/lib/models/api_swagger_integration_with_string_api_id.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HtmlFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_with_access_log_setting.yaml b/tests/functional/commands/validate/lib/models/api_with_access_log_setting.yaml index 4580310066..2fb25b770c 100644 --- a/tests/functional/commands/validate/lib/models/api_with_access_log_setting.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_access_log_setting.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: AccessLogSetting: diff --git a/tests/functional/commands/validate/lib/models/api_with_any_method_in_swagger.yaml b/tests/functional/commands/validate/lib/models/api_with_any_method_in_swagger.yaml index ae0b7b6639..41ae90f481 100644 --- a/tests/functional/commands/validate/lib/models/api_with_any_method_in_swagger.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_any_method_in_swagger.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HttpApiFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_with_apikey_default_override.yaml b/tests/functional/commands/validate/lib/models/api_with_apikey_default_override.yaml index 9a4ce8f715..15ff82b098 100644 --- a/tests/functional/commands/validate/lib/models/api_with_apikey_default_override.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_apikey_default_override.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApiWithAuth: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_apikey_required.yaml b/tests/functional/commands/validate/lib/models/api_with_apikey_required.yaml index 188e0d2e9b..5c2a4945cc 100644 --- a/tests/functional/commands/validate/lib/models/api_with_apikey_required.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_apikey_required.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApiWithoutAuth: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_apikey_required_openapi_3.yaml b/tests/functional/commands/validate/lib/models/api_with_apikey_required_openapi_3.yaml index 16dfb82c20..451890cc68 100644 --- a/tests/functional/commands/validate/lib/models/api_with_apikey_required_openapi_3.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_apikey_required_openapi_3.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApiWithoutAuth: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_apikey_source.yaml b/tests/functional/commands/validate/lib/models/api_with_apikey_source.yaml index cbdd00d72e..a025bd2530 100644 --- a/tests/functional/commands/validate/lib/models/api_with_apikey_source.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_apikey_source.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApiWithAuthSource: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_auth_all_maximum.yaml b/tests/functional/commands/validate/lib/models/api_with_auth_all_maximum.yaml index cd9d1febab..f8c9c4e2c2 100644 --- a/tests/functional/commands/validate/lib/models/api_with_auth_all_maximum.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_auth_all_maximum.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApi: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_auth_all_maximum_openapi_3.yaml b/tests/functional/commands/validate/lib/models/api_with_auth_all_maximum_openapi_3.yaml index 0ac139a921..5d322f5f72 100644 --- a/tests/functional/commands/validate/lib/models/api_with_auth_all_maximum_openapi_3.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_auth_all_maximum_openapi_3.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApi: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_auth_all_minimum.yaml b/tests/functional/commands/validate/lib/models/api_with_auth_all_minimum.yaml index e5e2e59038..88121402ab 100644 --- a/tests/functional/commands/validate/lib/models/api_with_auth_all_minimum.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_auth_all_minimum.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApiWithCognitoAuth: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_auth_all_minimum_openapi.yaml b/tests/functional/commands/validate/lib/models/api_with_auth_all_minimum_openapi.yaml index 3b8018eef5..931734d506 100644 --- a/tests/functional/commands/validate/lib/models/api_with_auth_all_minimum_openapi.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_auth_all_minimum_openapi.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: OpenApiVersion: 3.0.1 diff --git a/tests/functional/commands/validate/lib/models/api_with_auth_and_conditions_all_max.yaml b/tests/functional/commands/validate/lib/models/api_with_auth_and_conditions_all_max.yaml index 2fe9a4e1a3..eb4e2a58b5 100644 --- a/tests/functional/commands/validate/lib/models/api_with_auth_and_conditions_all_max.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_auth_and_conditions_all_max.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: PathCondition: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/api_with_auth_no_default.yaml b/tests/functional/commands/validate/lib/models/api_with_auth_no_default.yaml index 0125ab5bc8..c9879adf72 100644 --- a/tests/functional/commands/validate/lib/models/api_with_auth_no_default.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_auth_no_default.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApiWithCognitoAuth: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_auth_with_default_scopes.yaml b/tests/functional/commands/validate/lib/models/api_with_auth_with_default_scopes.yaml index cdf19eb83f..d3eb10e7ad 100644 --- a/tests/functional/commands/validate/lib/models/api_with_auth_with_default_scopes.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_auth_with_default_scopes.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApiWithCognitoAuth: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_auth_with_default_scopes_openapi.yaml b/tests/functional/commands/validate/lib/models/api_with_auth_with_default_scopes_openapi.yaml index e7ce488c50..1e86a8c566 100644 --- a/tests/functional/commands/validate/lib/models/api_with_auth_with_default_scopes_openapi.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_auth_with_default_scopes_openapi.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApiWithCognitoAuth: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_aws_account_blacklist.yaml b/tests/functional/commands/validate/lib/models/api_with_aws_account_blacklist.yaml index 4078afb896..684f141e15 100644 --- a/tests/functional/commands/validate/lib/models/api_with_aws_account_blacklist.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_aws_account_blacklist.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Auth: diff --git a/tests/functional/commands/validate/lib/models/api_with_aws_account_whitelist.yaml b/tests/functional/commands/validate/lib/models/api_with_aws_account_whitelist.yaml index 5870f0c7e1..5528346a33 100644 --- a/tests/functional/commands/validate/lib/models/api_with_aws_account_whitelist.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_aws_account_whitelist.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_with_aws_iam_auth_overrides.yaml b/tests/functional/commands/validate/lib/models/api_with_aws_iam_auth_overrides.yaml index 1e5ab4e886..ff1f205056 100644 --- a/tests/functional/commands/validate/lib/models/api_with_aws_iam_auth_overrides.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_aws_iam_auth_overrides.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApiWithAwsIamAuthNoCallerCredentials: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_basic_custom_domain.yaml b/tests/functional/commands/validate/lib/models/api_with_basic_custom_domain.yaml index 9a244450ad..8e1340ffc7 100644 --- a/tests/functional/commands/validate/lib/models/api_with_basic_custom_domain.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_basic_custom_domain.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: MyDomainName: Type: String diff --git a/tests/functional/commands/validate/lib/models/api_with_basic_custom_domain_http.yaml b/tests/functional/commands/validate/lib/models/api_with_basic_custom_domain_http.yaml index a80c516109..a792d536c3 100644 --- a/tests/functional/commands/validate/lib/models/api_with_basic_custom_domain_http.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_basic_custom_domain_http.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: MyDomainName: Type: String diff --git a/tests/functional/commands/validate/lib/models/api_with_basic_custom_domain_intrinsics.yaml b/tests/functional/commands/validate/lib/models/api_with_basic_custom_domain_intrinsics.yaml index 90f466dccf..f2350ea834 100644 --- a/tests/functional/commands/validate/lib/models/api_with_basic_custom_domain_intrinsics.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_basic_custom_domain_intrinsics.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: C1: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/api_with_basic_custom_domain_intrinsics_http.yaml b/tests/functional/commands/validate/lib/models/api_with_basic_custom_domain_intrinsics_http.yaml index fce95a622b..74016870db 100644 --- a/tests/functional/commands/validate/lib/models/api_with_basic_custom_domain_intrinsics_http.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_basic_custom_domain_intrinsics_http.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: C1: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/api_with_binary_media_types.yaml b/tests/functional/commands/validate/lib/models/api_with_binary_media_types.yaml index 90c6303210..1f710f46bd 100644 --- a/tests/functional/commands/validate/lib/models/api_with_binary_media_types.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_binary_media_types.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: BMT: Type: String diff --git a/tests/functional/commands/validate/lib/models/api_with_binary_media_types_definition_body.yaml b/tests/functional/commands/validate/lib/models/api_with_binary_media_types_definition_body.yaml index 8351354ab2..8b054b0dab 100644 --- a/tests/functional/commands/validate/lib/models/api_with_binary_media_types_definition_body.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_binary_media_types_definition_body.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: BMT: Type: String diff --git a/tests/functional/commands/validate/lib/models/api_with_canary_setting.yaml b/tests/functional/commands/validate/lib/models/api_with_canary_setting.yaml index 7185e42a8a..4f7dd5b80f 100644 --- a/tests/functional/commands/validate/lib/models/api_with_canary_setting.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_canary_setting.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: CanarySetting: diff --git a/tests/functional/commands/validate/lib/models/api_with_cors.yaml b/tests/functional/commands/validate/lib/models/api_with_cors.yaml index 99f76837b4..d4ee9b1d8c 100644 --- a/tests/functional/commands/validate/lib/models/api_with_cors.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_cors.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Cors: {Fn::Join: [',', [www.amazon.com, www.google.com]]} diff --git a/tests/functional/commands/validate/lib/models/api_with_cors_and_auth_no_preflight_auth.yaml b/tests/functional/commands/validate/lib/models/api_with_cors_and_auth_no_preflight_auth.yaml index 9039fc893e..d303e3645c 100644 --- a/tests/functional/commands/validate/lib/models/api_with_cors_and_auth_no_preflight_auth.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_cors_and_auth_no_preflight_auth.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Cors: origins diff --git a/tests/functional/commands/validate/lib/models/api_with_cors_and_auth_preflight_auth.yaml b/tests/functional/commands/validate/lib/models/api_with_cors_and_auth_preflight_auth.yaml index 449a52e13a..1ff0541472 100644 --- a/tests/functional/commands/validate/lib/models/api_with_cors_and_auth_preflight_auth.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_cors_and_auth_preflight_auth.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Cors: origins diff --git a/tests/functional/commands/validate/lib/models/api_with_cors_and_conditions_no_definitionbody.yaml b/tests/functional/commands/validate/lib/models/api_with_cors_and_conditions_no_definitionbody.yaml index ca9d804534..6ccb17459a 100644 --- a/tests/functional/commands/validate/lib/models/api_with_cors_and_conditions_no_definitionbody.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_cors_and_conditions_no_definitionbody.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Conditions: diff --git a/tests/functional/commands/validate/lib/models/api_with_cors_and_only_credentials_false.yaml b/tests/functional/commands/validate/lib/models/api_with_cors_and_only_credentials_false.yaml index 0a29f7d156..291083fc82 100644 --- a/tests/functional/commands/validate/lib/models/api_with_cors_and_only_credentials_false.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_cors_and_only_credentials_false.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Cors: diff --git a/tests/functional/commands/validate/lib/models/api_with_cors_and_only_headers.yaml b/tests/functional/commands/validate/lib/models/api_with_cors_and_only_headers.yaml index 768013cafa..579c2f2d28 100644 --- a/tests/functional/commands/validate/lib/models/api_with_cors_and_only_headers.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_cors_and_only_headers.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Cors: diff --git a/tests/functional/commands/validate/lib/models/api_with_cors_and_only_maxage.yaml b/tests/functional/commands/validate/lib/models/api_with_cors_and_only_maxage.yaml index 0cc4cc8470..908b76bddf 100644 --- a/tests/functional/commands/validate/lib/models/api_with_cors_and_only_maxage.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_cors_and_only_maxage.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Cors: diff --git a/tests/functional/commands/validate/lib/models/api_with_cors_and_only_methods.yaml b/tests/functional/commands/validate/lib/models/api_with_cors_and_only_methods.yaml index 83117a5b9e..57fe6494ee 100644 --- a/tests/functional/commands/validate/lib/models/api_with_cors_and_only_methods.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_cors_and_only_methods.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Cors: diff --git a/tests/functional/commands/validate/lib/models/api_with_cors_and_only_origins.yaml b/tests/functional/commands/validate/lib/models/api_with_cors_and_only_origins.yaml index fc6fd28886..46a18dd143 100644 --- a/tests/functional/commands/validate/lib/models/api_with_cors_and_only_origins.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_cors_and_only_origins.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: # If we skip AllowMethods, then SAM will auto generate a list of methods scoped to each path diff --git a/tests/functional/commands/validate/lib/models/api_with_cors_no_definitionbody.yaml b/tests/functional/commands/validate/lib/models/api_with_cors_no_definitionbody.yaml index da4f2347ce..9ae7c2eb4f 100644 --- a/tests/functional/commands/validate/lib/models/api_with_cors_no_definitionbody.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_cors_no_definitionbody.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Globals: diff --git a/tests/functional/commands/validate/lib/models/api_with_cors_openapi_3.yaml b/tests/functional/commands/validate/lib/models/api_with_cors_openapi_3.yaml index 389448525a..62ed496861 100644 --- a/tests/functional/commands/validate/lib/models/api_with_cors_openapi_3.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_cors_openapi_3.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Cors: {Fn::Join: [',', [www.amazon.com, www.google.com]]} diff --git a/tests/functional/commands/validate/lib/models/api_with_custom_base_path.yaml b/tests/functional/commands/validate/lib/models/api_with_custom_base_path.yaml new file mode 100644 index 0000000000..ae56f866ec --- /dev/null +++ b/tests/functional/commands/validate/lib/models/api_with_custom_base_path.yaml @@ -0,0 +1,66 @@ +Globals: + Api: + Domain: + BasePath: foo-bar +Resources: + MyApi: + Type: AWS::Serverless::Api + Properties: + OpenApiVersion: 3.0.1 + StageName: Prod + Domain: + DomainName: MyEdgeDomainName + CertificateArn: MyEdgeDomainCert + EndpointConfiguration: EDGE + BasePath: + - foo-too + Route53: + HostedZoneId: + Ref: HostedZoneId + IpV6: true + + MyApi2: + Type: AWS::Serverless::Api + Properties: + OpenApiVersion: 3.0.1 + StageName: Prod + Domain: + DomainName: MyEdgeDomainName + CertificateArn: MyEdgeDomainCert + EndpointConfiguration: EDGE + Route53: + HostedZoneId: + Ref: HostedZoneId + IpV6: true + + MyApiWithoutNormalizedBasePath: + Type: AWS::Serverless::Api + Properties: + OpenApiVersion: 3.0.1 + StageName: Prod + Domain: + DomainName: MyEdgeDomainName + CertificateArn: MyEdgeDomainCert + EndpointConfiguration: EDGE + NormalizeBasePath: false + Route53: + HostedZoneId: + Ref: HostedZoneId + IpV6: true + + MyApiWithoutNormalizedBasePathWithHyphen: + Type: AWS::Serverless::Api + Properties: + OpenApiVersion: 3.0.1 + StageName: Prod + Domain: + DomainName: MyEdgeDomainName + CertificateArn: MyEdgeDomainCert + EndpointConfiguration: EDGE + NormalizeBasePath: false + BasePath: + - /foo-too + Route53: + HostedZoneId: + Ref: HostedZoneId + IpV6: true diff --git a/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53.yaml b/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53.yaml index 54312990c0..4bd307e3ea 100644 --- a/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: DomainName: Type: String diff --git a/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_hosted_zone_name.yaml b/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_hosted_zone_name.yaml index 20344d7830..ac40c144fe 100644 --- a/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_hosted_zone_name.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_hosted_zone_name.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: DomainName: Type: String diff --git a/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_hosted_zone_name_http.yaml b/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_hosted_zone_name_http.yaml index d5c20d0b97..acd14c7307 100644 --- a/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_hosted_zone_name_http.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_hosted_zone_name_http.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: DomainName: Type: String diff --git a/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_http.yaml b/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_http.yaml index 8388309bd4..f8fbe58aaa 100644 --- a/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_http.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_http.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: DomainName: Type: String diff --git a/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_multiple.yaml b/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_multiple.yaml index 5d641bd51f..87f22d6cb1 100644 --- a/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_multiple.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_multiple.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > diff --git a/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_multiple_intrinsic_hostedzoneid.yaml b/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_multiple_intrinsic_hostedzoneid.yaml index 0835d87b01..9333ec49b3 100644 --- a/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_multiple_intrinsic_hostedzoneid.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_multiple_intrinsic_hostedzoneid.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > diff --git a/tests/functional/commands/validate/lib/models/api_with_default_aws_iam_auth.yaml b/tests/functional/commands/validate/lib/models/api_with_default_aws_iam_auth.yaml index d13ddc52e6..024db34439 100644 --- a/tests/functional/commands/validate/lib/models/api_with_default_aws_iam_auth.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_default_aws_iam_auth.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApiWithAwsIamAuthAndDefaultInvokeRole: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_default_aws_iam_auth_and_no_auth_route.yaml b/tests/functional/commands/validate/lib/models/api_with_default_aws_iam_auth_and_no_auth_route.yaml index 663dddaf96..4028002819 100644 --- a/tests/functional/commands/validate/lib/models/api_with_default_aws_iam_auth_and_no_auth_route.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_default_aws_iam_auth_and_no_auth_route.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApiWithAwsIamAuth: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_disable_api_execute_endpoint.yaml b/tests/functional/commands/validate/lib/models/api_with_disable_api_execute_endpoint.yaml index dedcbd6760..230311846b 100644 --- a/tests/functional/commands/validate/lib/models/api_with_disable_api_execute_endpoint.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_disable_api_execute_endpoint.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ApiGatewayApi: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_disable_api_execute_endpoint_openapi_3.yaml b/tests/functional/commands/validate/lib/models/api_with_disable_api_execute_endpoint_openapi_3.yaml index bd9867b9a3..8d4d18a9ba 100644 --- a/tests/functional/commands/validate/lib/models/api_with_disable_api_execute_endpoint_openapi_3.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_disable_api_execute_endpoint_openapi_3.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ApiGatewayApi: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_fail_on_warnings.yaml b/tests/functional/commands/validate/lib/models/api_with_fail_on_warnings.yaml index 99f6b7ca40..354eeaf761 100644 --- a/tests/functional/commands/validate/lib/models/api_with_fail_on_warnings.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_fail_on_warnings.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ApiGatewayApi: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_gateway_responses.yaml b/tests/functional/commands/validate/lib/models/api_with_gateway_responses.yaml index 7213c7a3c2..fe90cfaa34 100644 --- a/tests/functional/commands/validate/lib/models/api_with_gateway_responses.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_gateway_responses.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: Function: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_with_gateway_responses_all.yaml b/tests/functional/commands/validate/lib/models/api_with_gateway_responses_all.yaml index cd3b7781c3..1ae216968d 100644 --- a/tests/functional/commands/validate/lib/models/api_with_gateway_responses_all.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_gateway_responses_all.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: Function: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_with_gateway_responses_all_openapi_3.yaml b/tests/functional/commands/validate/lib/models/api_with_gateway_responses_all_openapi_3.yaml index 6d71de6bff..9b32bf2d94 100644 --- a/tests/functional/commands/validate/lib/models/api_with_gateway_responses_all_openapi_3.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_gateway_responses_all_openapi_3.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: Function: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_with_gateway_responses_implicit.yaml b/tests/functional/commands/validate/lib/models/api_with_gateway_responses_implicit.yaml index b65976ae9d..b8893544a5 100644 --- a/tests/functional/commands/validate/lib/models/api_with_gateway_responses_implicit.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_gateway_responses_implicit.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Name: some api diff --git a/tests/functional/commands/validate/lib/models/api_with_gateway_responses_minimal.yaml b/tests/functional/commands/validate/lib/models/api_with_gateway_responses_minimal.yaml index 8cafe732fa..77879bf424 100644 --- a/tests/functional/commands/validate/lib/models/api_with_gateway_responses_minimal.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_gateway_responses_minimal.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: Function: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_with_gateway_responses_string_status_code.yaml b/tests/functional/commands/validate/lib/models/api_with_gateway_responses_string_status_code.yaml index 95b0f0d278..b37f6d446c 100644 --- a/tests/functional/commands/validate/lib/models/api_with_gateway_responses_string_status_code.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_gateway_responses_string_status_code.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: Function: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_with_identity_intrinsic.yaml b/tests/functional/commands/validate/lib/models/api_with_identity_intrinsic.yaml index 62d4611c6e..f0f37d36a6 100644 --- a/tests/functional/commands/validate/lib/models/api_with_identity_intrinsic.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_identity_intrinsic.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 diff --git a/tests/functional/commands/validate/lib/models/api_with_if_conditional_with_resource_policy.yaml b/tests/functional/commands/validate/lib/models/api_with_if_conditional_with_resource_policy.yaml index be46c3ab13..20cd8f419a 100644 --- a/tests/functional/commands/validate/lib/models/api_with_if_conditional_with_resource_policy.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_if_conditional_with_resource_policy.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: C1: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/api_with_incompatible_stage_name.yaml b/tests/functional/commands/validate/lib/models/api_with_incompatible_stage_name.yaml index a8ad428490..60cfcd02a4 100644 --- a/tests/functional/commands/validate/lib/models/api_with_incompatible_stage_name.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_incompatible_stage_name.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HyphenFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_with_ip_range_blacklist.yaml b/tests/functional/commands/validate/lib/models/api_with_ip_range_blacklist.yaml index 35142f565f..a4f167e20d 100644 --- a/tests/functional/commands/validate/lib/models/api_with_ip_range_blacklist.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_ip_range_blacklist.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Auth: diff --git a/tests/functional/commands/validate/lib/models/api_with_ip_range_whitelist.yaml b/tests/functional/commands/validate/lib/models/api_with_ip_range_whitelist.yaml index a2451dd1f3..5729edd14c 100644 --- a/tests/functional/commands/validate/lib/models/api_with_ip_range_whitelist.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_ip_range_whitelist.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Auth: diff --git a/tests/functional/commands/validate/lib/models/api_with_method_aws_iam_auth.yaml b/tests/functional/commands/validate/lib/models/api_with_method_aws_iam_auth.yaml index 0c6e30aae0..eac22ae7e7 100644 --- a/tests/functional/commands/validate/lib/models/api_with_method_aws_iam_auth.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_method_aws_iam_auth.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApiWithoutAuth: Type: AWS::Serverless::Api @@ -29,7 +27,7 @@ Resources: Method: post Auth: Authorizer: AWS_IAM - InvokeRole: rn:aws:iam::123:role/AUTH_AWS_IAM + InvokeRole: !Sub arn:${AWS::Partition}:iam::123:role/AUTH_AWS_IAM MyApiWithAwsIamAuthAndDefaultInvokeRole: Type: Api Properties: @@ -47,21 +45,21 @@ Resources: Method: any Auth: Authorizer: AWS_IAM - MyApiWithAwsIamAuthAndCustomInvokeRoleAnyMethod: - Type: Api - Properties: - RestApiId: !Ref MyApiWithoutAuth - Path: /any/two - Method: any - Auth: - Authorizer: AWS_IAM - InvokeRole: rn:aws:iam::123:role/AUTH_AWS_IAM - MyApiWithAwsIamAuthAndDefaultInvokeRoleAnyMethod: - Type: Api - Properties: - RestApiId: !Ref MyApiWithoutAuth - Path: /any/three - Method: any - Auth: - Authorizer: AWS_IAM - InvokeRole: CALLER_CREDENTIALS + MyApiWithAwsIamAuthAndCustomInvokeRoleAnyMethod: + Type: Api + Properties: + RestApiId: !Ref MyApiWithoutAuth + Path: /any/two + Method: any + Auth: + Authorizer: AWS_IAM + InvokeRole: !Sub arn:${AWS::Partition}:iam::123:role/AUTH_AWS_IAM + MyApiWithAwsIamAuthAndDefaultInvokeRoleAnyMethod: + Type: Api + Properties: + RestApiId: !Ref MyApiWithoutAuth + Path: /any/three + Method: any + Auth: + Authorizer: AWS_IAM + InvokeRole: CALLER_CREDENTIALS diff --git a/tests/functional/commands/validate/lib/models/api_with_method_settings.yaml b/tests/functional/commands/validate/lib/models/api_with_method_settings.yaml index f139fc0c8c..accf3e91ea 100644 --- a/tests/functional/commands/validate/lib/models/api_with_method_settings.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_method_settings.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: MethodSettings: [{LoggingLevel: INFO, MetricsEnabled: true, DataTraceEnabled: true, diff --git a/tests/functional/commands/validate/lib/models/api_with_minimum_compression_size.yaml b/tests/functional/commands/validate/lib/models/api_with_minimum_compression_size.yaml index 1ff6e0951f..cb2ea975c5 100644 --- a/tests/functional/commands/validate/lib/models/api_with_minimum_compression_size.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_minimum_compression_size.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: MinimumCompressionSize: 1024 diff --git a/tests/functional/commands/validate/lib/models/api_with_mode.yaml b/tests/functional/commands/validate/lib/models/api_with_mode.yaml index ea8b8feaa4..8df0693af4 100644 --- a/tests/functional/commands/validate/lib/models/api_with_mode.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_mode.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: Function: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_with_no_properties.yaml b/tests/functional/commands/validate/lib/models/api_with_no_properties.yaml index 38f2b2c855..5a963a3e9f 100644 --- a/tests/functional/commands/validate/lib/models/api_with_no_properties.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_no_properties.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HtmlFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_with_open_api_version.yaml b/tests/functional/commands/validate/lib/models/api_with_open_api_version.yaml index 73e88f0590..7efa33f629 100644 --- a/tests/functional/commands/validate/lib/models/api_with_open_api_version.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_open_api_version.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: OpenApiVersion: 3.0.1 diff --git a/tests/functional/commands/validate/lib/models/api_with_open_api_version_2.yaml b/tests/functional/commands/validate/lib/models/api_with_open_api_version_2.yaml index 3efe1c162f..52e6530326 100644 --- a/tests/functional/commands/validate/lib/models/api_with_open_api_version_2.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_open_api_version_2.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: OpenApiVersion: '2.0' diff --git a/tests/functional/commands/validate/lib/models/api_with_openapi_definition_body_no_flag.yaml b/tests/functional/commands/validate/lib/models/api_with_openapi_definition_body_no_flag.yaml index 235983eb14..a777df42c4 100644 --- a/tests/functional/commands/validate/lib/models/api_with_openapi_definition_body_no_flag.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_openapi_definition_body_no_flag.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Name: some api diff --git a/tests/functional/commands/validate/lib/models/api_with_path_parameters.yaml b/tests/functional/commands/validate/lib/models/api_with_path_parameters.yaml index 09d4085c85..e1799d3e70 100644 --- a/tests/functional/commands/validate/lib/models/api_with_path_parameters.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_path_parameters.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HtmlFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_with_resource_policy.yaml b/tests/functional/commands/validate/lib/models/api_with_resource_policy.yaml index 55d2b2952c..bd7d4c24ef 100644 --- a/tests/functional/commands/validate/lib/models/api_with_resource_policy.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_resource_policy.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ExplicitApi: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_resource_policy_global.yaml b/tests/functional/commands/validate/lib/models/api_with_resource_policy_global.yaml index 7f0ba75b32..be0440f3b4 100644 --- a/tests/functional/commands/validate/lib/models/api_with_resource_policy_global.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_resource_policy_global.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: StageName: Type: String diff --git a/tests/functional/commands/validate/lib/models/api_with_resource_policy_global_implicit.yaml b/tests/functional/commands/validate/lib/models/api_with_resource_policy_global_implicit.yaml index ccf383f284..fff8fc428a 100644 --- a/tests/functional/commands/validate/lib/models/api_with_resource_policy_global_implicit.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_resource_policy_global_implicit.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MinimalFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_with_resource_refs.yaml b/tests/functional/commands/validate/lib/models/api_with_resource_refs.yaml index f8e40923fd..b44cf04bc7 100644 --- a/tests/functional/commands/validate/lib/models/api_with_resource_refs.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_resource_refs.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- # Test if resource references work for both Explicit API & Implicit API resources Resources: diff --git a/tests/functional/commands/validate/lib/models/api_with_security_definition_and_components.yaml b/tests/functional/commands/validate/lib/models/api_with_security_definition_and_components.yaml index 6dc937ff48..bbc27ab54a 100644 --- a/tests/functional/commands/validate/lib/models/api_with_security_definition_and_components.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_security_definition_and_components.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: GetHtmlFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_with_security_definition_and_no_components.yaml b/tests/functional/commands/validate/lib/models/api_with_security_definition_and_no_components.yaml index c9506c7fe4..d2bcc267f6 100644 --- a/tests/functional/commands/validate/lib/models/api_with_security_definition_and_no_components.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_security_definition_and_no_components.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: GetHtmlFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_with_security_definition_and_none_components.yaml b/tests/functional/commands/validate/lib/models/api_with_security_definition_and_none_components.yaml index 5afcd76881..90db77be0f 100644 --- a/tests/functional/commands/validate/lib/models/api_with_security_definition_and_none_components.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_security_definition_and_none_components.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: GetHtmlFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/api_with_source_vpc_blacklist.yaml b/tests/functional/commands/validate/lib/models/api_with_source_vpc_blacklist.yaml index f8989d927d..d6d927b261 100644 --- a/tests/functional/commands/validate/lib/models/api_with_source_vpc_blacklist.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_source_vpc_blacklist.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Auth: diff --git a/tests/functional/commands/validate/lib/models/api_with_source_vpc_whitelist.yaml b/tests/functional/commands/validate/lib/models/api_with_source_vpc_whitelist.yaml index 7a95209e98..75e1f187d2 100644 --- a/tests/functional/commands/validate/lib/models/api_with_source_vpc_whitelist.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_source_vpc_whitelist.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: Vpc1: Type: String diff --git a/tests/functional/commands/validate/lib/models/api_with_stage_tags.yaml b/tests/functional/commands/validate/lib/models/api_with_stage_tags.yaml index 2a7f447a86..051b70d3b5 100644 --- a/tests/functional/commands/validate/lib/models/api_with_stage_tags.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_stage_tags.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: TagValueParam: Type: String diff --git a/tests/functional/commands/validate/lib/models/api_with_swagger_and_openapi_with_auth.yaml b/tests/functional/commands/validate/lib/models/api_with_swagger_and_openapi_with_auth.yaml index 75fa753e3e..4f21240a50 100644 --- a/tests/functional/commands/validate/lib/models/api_with_swagger_and_openapi_with_auth.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_swagger_and_openapi_with_auth.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Name: some api diff --git a/tests/functional/commands/validate/lib/models/api_with_swagger_authorizer_none.yaml b/tests/functional/commands/validate/lib/models/api_with_swagger_authorizer_none.yaml index e06f4e46ca..059df043be 100644 --- a/tests/functional/commands/validate/lib/models/api_with_swagger_authorizer_none.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_swagger_authorizer_none.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApiWithCognitoAuth: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/api_with_usageplans.yaml b/tests/functional/commands/validate/lib/models/api_with_usageplans.yaml index 6d53943475..ec0e146c71 100644 --- a/tests/functional/commands/validate/lib/models/api_with_usageplans.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_usageplans.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Auth: diff --git a/tests/functional/commands/validate/lib/models/api_with_usageplans_intrinsics.yaml b/tests/functional/commands/validate/lib/models/api_with_usageplans_intrinsics.yaml index 7a4190013a..6b518956f6 100644 --- a/tests/functional/commands/validate/lib/models/api_with_usageplans_intrinsics.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_usageplans_intrinsics.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: C1: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/api_with_usageplans_shared_attributes_three.yaml b/tests/functional/commands/validate/lib/models/api_with_usageplans_shared_attributes_three.yaml index aad4a0739d..9fbdf96c04 100644 --- a/tests/functional/commands/validate/lib/models/api_with_usageplans_shared_attributes_three.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_usageplans_shared_attributes_three.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Auth: diff --git a/tests/functional/commands/validate/lib/models/api_with_usageplans_shared_attributes_two.yaml b/tests/functional/commands/validate/lib/models/api_with_usageplans_shared_attributes_two.yaml index fc084c974c..aea41df26e 100644 --- a/tests/functional/commands/validate/lib/models/api_with_usageplans_shared_attributes_two.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_usageplans_shared_attributes_two.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Auth: diff --git a/tests/functional/commands/validate/lib/models/api_with_usageplans_shared_no_side_effect_1.yaml b/tests/functional/commands/validate/lib/models/api_with_usageplans_shared_no_side_effect_1.yaml index f1a25c19b2..f05fe7511b 100644 --- a/tests/functional/commands/validate/lib/models/api_with_usageplans_shared_no_side_effect_1.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_usageplans_shared_no_side_effect_1.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Auth: diff --git a/tests/functional/commands/validate/lib/models/api_with_usageplans_shared_no_side_effect_2.yaml b/tests/functional/commands/validate/lib/models/api_with_usageplans_shared_no_side_effect_2.yaml index 103be9c802..857e387692 100644 --- a/tests/functional/commands/validate/lib/models/api_with_usageplans_shared_no_side_effect_2.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_usageplans_shared_no_side_effect_2.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Auth: diff --git a/tests/functional/commands/validate/lib/models/api_with_xray_tracing.yaml b/tests/functional/commands/validate/lib/models/api_with_xray_tracing.yaml index 48e26405e2..8d54a9afc6 100644 --- a/tests/functional/commands/validate/lib/models/api_with_xray_tracing.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_xray_tracing.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HtmlFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/basic_function.yaml b/tests/functional/commands/validate/lib/models/basic_function.yaml index 6fdd559225..98a0fc1a97 100644 --- a/tests/functional/commands/validate/lib/models/basic_function.yaml +++ b/tests/functional/commands/validate/lib/models/basic_function.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: SomeParameter: Type: String diff --git a/tests/functional/commands/validate/lib/models/basic_function_with_tags.yaml b/tests/functional/commands/validate/lib/models/basic_function_with_tags.yaml index 20c1692071..f8eb1cffa2 100644 --- a/tests/functional/commands/validate/lib/models/basic_function_with_tags.yaml +++ b/tests/functional/commands/validate/lib/models/basic_function_with_tags.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- # File: sam.yml # Version: 0.9 diff --git a/tests/functional/commands/validate/lib/models/basic_function_withimageuri.yaml b/tests/functional/commands/validate/lib/models/basic_function_withimageuri.yaml index 2a40b5fc96..2f55127ce5 100644 --- a/tests/functional/commands/validate/lib/models/basic_function_withimageuri.yaml +++ b/tests/functional/commands/validate/lib/models/basic_function_withimageuri.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: SomeParameter: Type: String diff --git a/tests/functional/commands/validate/lib/models/basic_layer.yaml b/tests/functional/commands/validate/lib/models/basic_layer.yaml index 42f9bd93bb..5ed84d426d 100644 --- a/tests/functional/commands/validate/lib/models/basic_layer.yaml +++ b/tests/functional/commands/validate/lib/models/basic_layer.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: TestCondition: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/cloudwatch_logs_with_ref.yaml b/tests/functional/commands/validate/lib/models/cloudwatch_logs_with_ref.yaml index c9a355981e..1fb54740a2 100644 --- a/tests/functional/commands/validate/lib/models/cloudwatch_logs_with_ref.yaml +++ b/tests/functional/commands/validate/lib/models/cloudwatch_logs_with_ref.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: Example CloudWatch Logs + Lambda diff --git a/tests/functional/commands/validate/lib/models/cloudwatchevent.yaml b/tests/functional/commands/validate/lib/models/cloudwatchevent.yaml index c260907280..286df45996 100644 --- a/tests/functional/commands/validate/lib/models/cloudwatchevent.yaml +++ b/tests/functional/commands/validate/lib/models/cloudwatchevent.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ScheduledFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/cloudwatchevent_intrinsics.yaml b/tests/functional/commands/validate/lib/models/cloudwatchevent_intrinsics.yaml index 59789f5234..fe3dfb8cee 100644 --- a/tests/functional/commands/validate/lib/models/cloudwatchevent_intrinsics.yaml +++ b/tests/functional/commands/validate/lib/models/cloudwatchevent_intrinsics.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: PathA: Type: String diff --git a/tests/functional/commands/validate/lib/models/cloudwatchlog.yaml b/tests/functional/commands/validate/lib/models/cloudwatchlog.yaml index d85febfa5b..f1f0edc745 100644 --- a/tests/functional/commands/validate/lib/models/cloudwatchlog.yaml +++ b/tests/functional/commands/validate/lib/models/cloudwatchlog.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: TriggeredFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/cognito_userpool_with_event.yaml b/tests/functional/commands/validate/lib/models/cognito_userpool_with_event.yaml index 3b8a39a929..698ab9d154 100644 --- a/tests/functional/commands/validate/lib/models/cognito_userpool_with_event.yaml +++ b/tests/functional/commands/validate/lib/models/cognito_userpool_with_event.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: UserPool: Type: AWS::Cognito::UserPool diff --git a/tests/functional/commands/validate/lib/models/congito_userpool_with_sms_configuration.yaml b/tests/functional/commands/validate/lib/models/congito_userpool_with_sms_configuration.yaml index 6265d3a1fd..7a3c5d1b45 100644 --- a/tests/functional/commands/validate/lib/models/congito_userpool_with_sms_configuration.yaml +++ b/tests/functional/commands/validate/lib/models/congito_userpool_with_sms_configuration.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HelloWorldFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/connector_api_to_function.yaml b/tests/functional/commands/validate/lib/models/connector_api_to_function.yaml index aad57975c1..a9ab7244d3 100644 --- a/tests/functional/commands/validate/lib/models/connector_api_to_function.yaml +++ b/tests/functional/commands/validate/lib/models/connector_api_to_function.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyServerlessApi: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/connector_bucket_to_function.yaml b/tests/functional/commands/validate/lib/models/connector_bucket_to_function.yaml index bf8bee626d..19dd070ff4 100644 --- a/tests/functional/commands/validate/lib/models/connector_bucket_to_function.yaml +++ b/tests/functional/commands/validate/lib/models/connector_bucket_to_function.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: Function: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/connector_dependson_replace.yaml b/tests/functional/commands/validate/lib/models/connector_dependson_replace.yaml index 4bac727840..4245a23156 100644 --- a/tests/functional/commands/validate/lib/models/connector_dependson_replace.yaml +++ b/tests/functional/commands/validate/lib/models/connector_dependson_replace.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Transform: AWS::Serverless-2016-10-31 Resources: # Stub resources diff --git a/tests/functional/commands/validate/lib/models/connector_esm_dependson.yaml b/tests/functional/commands/validate/lib/models/connector_esm_dependson.yaml index 76e5d83bd0..e1c293beb1 100644 --- a/tests/functional/commands/validate/lib/models/connector_esm_dependson.yaml +++ b/tests/functional/commands/validate/lib/models/connector_esm_dependson.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Transform: AWS::Serverless-2016-10-31-test Resources: MyFunction: diff --git a/tests/functional/commands/validate/lib/models/connector_function_to_s3.yaml b/tests/functional/commands/validate/lib/models/connector_function_to_s3.yaml index 637dfe99b6..297f5bcc71 100644 --- a/tests/functional/commands/validate/lib/models/connector_function_to_s3.yaml +++ b/tests/functional/commands/validate/lib/models/connector_function_to_s3.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/connector_function_to_sqs.yaml b/tests/functional/commands/validate/lib/models/connector_function_to_sqs.yaml index 3007387115..64be5167d3 100644 --- a/tests/functional/commands/validate/lib/models/connector_function_to_sqs.yaml +++ b/tests/functional/commands/validate/lib/models/connector_function_to_sqs.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyRole: Type: AWS::IAM::Role diff --git a/tests/functional/commands/validate/lib/models/connector_function_to_table.yaml b/tests/functional/commands/validate/lib/models/connector_function_to_table.yaml index 461defb06b..30f7ebc3ba 100644 --- a/tests/functional/commands/validate/lib/models/connector_function_to_table.yaml +++ b/tests/functional/commands/validate/lib/models/connector_function_to_table.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyRole: Type: AWS::IAM::Role diff --git a/tests/functional/commands/validate/lib/models/connector_hardcoded_lambda_arn.yaml b/tests/functional/commands/validate/lib/models/connector_hardcoded_lambda_arn.yaml index 5aab02a22e..d63c260c7f 100644 --- a/tests/functional/commands/validate/lib/models/connector_hardcoded_lambda_arn.yaml +++ b/tests/functional/commands/validate/lib/models/connector_hardcoded_lambda_arn.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyTopic: Type: AWS::SNS::Topic diff --git a/tests/functional/commands/validate/lib/models/connector_hardcoded_props.yaml b/tests/functional/commands/validate/lib/models/connector_hardcoded_props.yaml index ccedcec5cb..cd595a4afa 100644 --- a/tests/functional/commands/validate/lib/models/connector_hardcoded_props.yaml +++ b/tests/functional/commands/validate/lib/models/connector_hardcoded_props.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Transform: AWS::Serverless-2016-10-31 Resources: # Intentionally not complete diff --git a/tests/functional/commands/validate/lib/models/connector_hardcoded_rolename.yaml b/tests/functional/commands/validate/lib/models/connector_hardcoded_rolename.yaml index 5ee22d766d..e16f307b7a 100644 --- a/tests/functional/commands/validate/lib/models/connector_hardcoded_rolename.yaml +++ b/tests/functional/commands/validate/lib/models/connector_hardcoded_rolename.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Transform: AWS::Serverless-2016-10-31 Resources: MyFunction: diff --git a/tests/functional/commands/validate/lib/models/connector_rule_to_eventbus.yaml b/tests/functional/commands/validate/lib/models/connector_rule_to_eventbus.yaml index df11a58b8b..0c864a35e1 100644 --- a/tests/functional/commands/validate/lib/models/connector_rule_to_eventbus.yaml +++ b/tests/functional/commands/validate/lib/models/connector_rule_to_eventbus.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: EventBus: Type: AWS::Events::EventBus diff --git a/tests/functional/commands/validate/lib/models/connector_rule_to_sfn.yaml b/tests/functional/commands/validate/lib/models/connector_rule_to_sfn.yaml index b87e9dbadb..ae5212ae7c 100644 --- a/tests/functional/commands/validate/lib/models/connector_rule_to_sfn.yaml +++ b/tests/functional/commands/validate/lib/models/connector_rule_to_sfn.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyNewEventsRule: Type: AWS::Events::Rule diff --git a/tests/functional/commands/validate/lib/models/connector_rule_to_sns.yaml b/tests/functional/commands/validate/lib/models/connector_rule_to_sns.yaml index c1a3d27d8d..745adbfbd1 100644 --- a/tests/functional/commands/validate/lib/models/connector_rule_to_sns.yaml +++ b/tests/functional/commands/validate/lib/models/connector_rule_to_sns.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyNewEventsRule: Type: AWS::Events::Rule diff --git a/tests/functional/commands/validate/lib/models/connector_sfn_to_function.yaml b/tests/functional/commands/validate/lib/models/connector_sfn_to_function.yaml index 7b18bbca5e..47b1852ee6 100644 --- a/tests/functional/commands/validate/lib/models/connector_sfn_to_function.yaml +++ b/tests/functional/commands/validate/lib/models/connector_sfn_to_function.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyStateMachine: Type: AWS::Serverless::StateMachine diff --git a/tests/functional/commands/validate/lib/models/connector_sfn_to_function_without_policy.yaml b/tests/functional/commands/validate/lib/models/connector_sfn_to_function_without_policy.yaml new file mode 100644 index 0000000000..a011a40d38 --- /dev/null +++ b/tests/functional/commands/validate/lib/models/connector_sfn_to_function_without_policy.yaml @@ -0,0 +1,36 @@ +Resources: + TriggerStateMachine: + Type: AWS::Serverless::StateMachine + Properties: + Type: EXPRESS + Definition: + StartAt: TryDoSomething + States: + TryDoSomething: + Type: Task + Resource: !Sub arn:${AWS::Partition}:states:::lambda:invoke + Parameters: + FunctionName: !Ref MyFunction + End: true + + MyFunction: + Type: AWS::Serverless::Function + Properties: + Runtime: nodejs14.x + Handler: index.handler + InlineCode: | + exports.handler = async (event) => { + console.log(JSON.stringify(event)); + }; + + MyConnector: + Type: AWS::Serverless::Connector + Properties: + Source: + Id: TriggerStateMachine + Destination: + Id: MyFunction + Permissions: + - Write +Metadata: + SamTransformTest: true diff --git a/tests/functional/commands/validate/lib/models/connector_sfn_to_sfn.yaml b/tests/functional/commands/validate/lib/models/connector_sfn_to_sfn.yaml index 289a0c9f23..f2e6e5e589 100644 --- a/tests/functional/commands/validate/lib/models/connector_sfn_to_sfn.yaml +++ b/tests/functional/commands/validate/lib/models/connector_sfn_to_sfn.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: TriggerStateMachine: Type: AWS::Serverless::StateMachine diff --git a/tests/functional/commands/validate/lib/models/connector_sns_to_function.yaml b/tests/functional/commands/validate/lib/models/connector_sns_to_function.yaml index 154698cd15..42616cb06d 100644 --- a/tests/functional/commands/validate/lib/models/connector_sns_to_function.yaml +++ b/tests/functional/commands/validate/lib/models/connector_sns_to_function.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MySNSTopic: Type: AWS::SNS::Topic diff --git a/tests/functional/commands/validate/lib/models/connector_sns_to_sqs.yaml b/tests/functional/commands/validate/lib/models/connector_sns_to_sqs.yaml index f6ceab5c0d..2b59a8349e 100644 --- a/tests/functional/commands/validate/lib/models/connector_sns_to_sqs.yaml +++ b/tests/functional/commands/validate/lib/models/connector_sns_to_sqs.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MySNSTopic: Type: AWS::SNS::Topic diff --git a/tests/functional/commands/validate/lib/models/connector_sqs_to_function.yaml b/tests/functional/commands/validate/lib/models/connector_sqs_to_function.yaml index e267d443f0..20bd33aabd 100644 --- a/tests/functional/commands/validate/lib/models/connector_sqs_to_function.yaml +++ b/tests/functional/commands/validate/lib/models/connector_sqs_to_function.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: Queue: Type: AWS::SQS::Queue diff --git a/tests/functional/commands/validate/lib/models/connector_table_to_function.yaml b/tests/functional/commands/validate/lib/models/connector_table_to_function.yaml index 8c91f2eed7..183e284a91 100644 --- a/tests/functional/commands/validate/lib/models/connector_table_to_function.yaml +++ b/tests/functional/commands/validate/lib/models/connector_table_to_function.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyRole: Type: AWS::IAM::Role diff --git a/tests/functional/commands/validate/lib/models/connector_table_to_function_read.yaml b/tests/functional/commands/validate/lib/models/connector_table_to_function_read.yaml index 18ad1647cb..a4eb58b986 100644 --- a/tests/functional/commands/validate/lib/models/connector_table_to_function_read.yaml +++ b/tests/functional/commands/validate/lib/models/connector_table_to_function_read.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: TriggerFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/definition_body_intrinsics_support.yaml b/tests/functional/commands/validate/lib/models/definition_body_intrinsics_support.yaml index 65063a7b13..d9f8614837 100644 --- a/tests/functional/commands/validate/lib/models/definition_body_intrinsics_support.yaml +++ b/tests/functional/commands/validate/lib/models/definition_body_intrinsics_support.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > diff --git a/tests/functional/commands/validate/lib/models/depends_on.yaml b/tests/functional/commands/validate/lib/models/depends_on.yaml index f97e011c9e..428938f342 100644 --- a/tests/functional/commands/validate/lib/models/depends_on.yaml +++ b/tests/functional/commands/validate/lib/models/depends_on.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- # SAM template containing DependsOn property on resources. Output resources should # also have this property set Resources: diff --git a/tests/functional/commands/validate/lib/models/eventbridgerule.yaml b/tests/functional/commands/validate/lib/models/eventbridgerule.yaml index 6ca8660569..73f981a9ef 100644 --- a/tests/functional/commands/validate/lib/models/eventbridgerule.yaml +++ b/tests/functional/commands/validate/lib/models/eventbridgerule.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ScheduledFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/eventbridgerule_schedule_properties.yaml b/tests/functional/commands/validate/lib/models/eventbridgerule_schedule_properties.yaml index d6d28919fa..275a2b47df 100644 --- a/tests/functional/commands/validate/lib/models/eventbridgerule_schedule_properties.yaml +++ b/tests/functional/commands/validate/lib/models/eventbridgerule_schedule_properties.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ScheduledFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/eventbridgerule_with_dlq.yaml b/tests/functional/commands/validate/lib/models/eventbridgerule_with_dlq.yaml index e4cbd8e981..7d582aedad 100644 --- a/tests/functional/commands/validate/lib/models/eventbridgerule_with_dlq.yaml +++ b/tests/functional/commands/validate/lib/models/eventbridgerule_with_dlq.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ScheduledFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/eventbridgerule_with_retry_policy.yaml b/tests/functional/commands/validate/lib/models/eventbridgerule_with_retry_policy.yaml index 93d1d878de..9bee6265c2 100644 --- a/tests/functional/commands/validate/lib/models/eventbridgerule_with_retry_policy.yaml +++ b/tests/functional/commands/validate/lib/models/eventbridgerule_with_retry_policy.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ScheduledFunction: Type: AWS::Serverless::Function @@ -12,8 +10,8 @@ Resources: Type: Schedule Properties: Schedule: rate(1 minute) - RetryPolicy: - MaximumRetryAttempts: 3 + RetryPolicy: + MaximumRetryAttempts: 3 TriggeredFunction: Type: AWS::Serverless::Function Properties: diff --git a/tests/functional/commands/validate/lib/models/explicit_api.yaml b/tests/functional/commands/validate/lib/models/explicit_api.yaml index 34ff9bf54d..20e0e0b3eb 100644 --- a/tests/functional/commands/validate/lib/models/explicit_api.yaml +++ b/tests/functional/commands/validate/lib/models/explicit_api.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: MyStageName: Type: String diff --git a/tests/functional/commands/validate/lib/models/explicit_api_openapi_3.yaml b/tests/functional/commands/validate/lib/models/explicit_api_openapi_3.yaml index 87ebeb8f20..574b7ab2bf 100644 --- a/tests/functional/commands/validate/lib/models/explicit_api_openapi_3.yaml +++ b/tests/functional/commands/validate/lib/models/explicit_api_openapi_3.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: MyStageName: Type: String diff --git a/tests/functional/commands/validate/lib/models/explicit_api_with_invalid_events_config.yaml b/tests/functional/commands/validate/lib/models/explicit_api_with_invalid_events_config.yaml index 33d6f94a90..9c086a9f88 100644 --- a/tests/functional/commands/validate/lib/models/explicit_api_with_invalid_events_config.yaml +++ b/tests/functional/commands/validate/lib/models/explicit_api_with_invalid_events_config.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- # This is specifically testing a invalid SAM template, that is currently accepted by SAM, and some customers rely on this behavior. # We will eventually change the behavior to error on this invalid template, but until then, this test will guard against # inadvertently changing this behavior. diff --git a/tests/functional/commands/validate/lib/models/explicit_http_api.yaml b/tests/functional/commands/validate/lib/models/explicit_http_api.yaml index f1bb943784..4cc0011f1b 100644 --- a/tests/functional/commands/validate/lib/models/explicit_http_api.yaml +++ b/tests/functional/commands/validate/lib/models/explicit_http_api.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HttpApiFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/explicit_http_api_default_path.yaml b/tests/functional/commands/validate/lib/models/explicit_http_api_default_path.yaml index db2f780f0f..ad44d20d14 100644 --- a/tests/functional/commands/validate/lib/models/explicit_http_api_default_path.yaml +++ b/tests/functional/commands/validate/lib/models/explicit_http_api_default_path.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Transform: AWS::Serverless-2016-10-31 Resources: Function: diff --git a/tests/functional/commands/validate/lib/models/explicit_http_api_minimum.yaml b/tests/functional/commands/validate/lib/models/explicit_http_api_minimum.yaml index 8aa07e5a75..7c69c7a573 100644 --- a/tests/functional/commands/validate/lib/models/explicit_http_api_minimum.yaml +++ b/tests/functional/commands/validate/lib/models/explicit_http_api_minimum.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: Api: Type: AWS::Serverless::HttpApi diff --git a/tests/functional/commands/validate/lib/models/explicit_http_api_with_name.yaml b/tests/functional/commands/validate/lib/models/explicit_http_api_with_name.yaml new file mode 100644 index 0000000000..e4b15ff100 --- /dev/null +++ b/tests/functional/commands/validate/lib/models/explicit_http_api_with_name.yaml @@ -0,0 +1,26 @@ +Resources: + HttpApiFunction: + Type: AWS::Serverless::Function + Properties: + CodeUri: s3://sam-demo-bucket/todo_list.zip + Handler: index.restapi + Runtime: python3.7 + Events: + SimpleCase: + Type: HttpApi + Properties: + ApiId: !Ref MyApi + SimpleCase2: + Type: HttpApi + Properties: + ApiId: !Ref MyApiWithIntrinsicName + + MyApi: + Type: AWS::Serverless::HttpApi + Properties: + Name: MyHttpApi + + MyApiWithIntrinsicName: + Type: AWS::Serverless::HttpApi + Properties: + Name: !Sub "${HttpApiFunction}-HttpApi" diff --git a/tests/functional/commands/validate/lib/models/function_concurrency.yaml b/tests/functional/commands/validate/lib/models/function_concurrency.yaml index b7343a25b9..024be3c4b1 100644 --- a/tests/functional/commands/validate/lib/models/function_concurrency.yaml +++ b/tests/functional/commands/validate/lib/models/function_concurrency.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: Concurrency: Type: Number diff --git a/tests/functional/commands/validate/lib/models/function_event_conditions.yaml b/tests/functional/commands/validate/lib/models/function_event_conditions.yaml index b070c16881..601ee8b334 100644 --- a/tests/functional/commands/validate/lib/models/function_event_conditions.yaml +++ b/tests/functional/commands/validate/lib/models/function_event_conditions.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: MyCondition: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/function_managed_inline_policy.yaml b/tests/functional/commands/validate/lib/models/function_managed_inline_policy.yaml index fd2e45daac..3bb09d1d6e 100644 --- a/tests/functional/commands/validate/lib/models/function_managed_inline_policy.yaml +++ b/tests/functional/commands/validate/lib/models/function_managed_inline_policy.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: SomeManagedPolicyArn: Type: String diff --git a/tests/functional/commands/validate/lib/models/function_with_alias.yaml b/tests/functional/commands/validate/lib/models/function_with_alias.yaml index 0844df591b..80bed6853b 100644 --- a/tests/functional/commands/validate/lib/models/function_with_alias.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_alias.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MinimalFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/function_with_alias_and_code_sha256.yaml b/tests/functional/commands/validate/lib/models/function_with_alias_and_code_sha256.yaml index b8aa662ccb..f167cd8382 100644 --- a/tests/functional/commands/validate/lib/models/function_with_alias_and_code_sha256.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_alias_and_code_sha256.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: AutoPublishCodeSha256: Type: String diff --git a/tests/functional/commands/validate/lib/models/function_with_alias_and_event_sources.yaml b/tests/functional/commands/validate/lib/models/function_with_alias_and_event_sources.yaml index 7dff9c56f5..6e49c60857 100644 --- a/tests/functional/commands/validate/lib/models/function_with_alias_and_event_sources.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_alias_and_event_sources.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- # Testing Alias Invoke with ALL event sources supported by Lambda # We are looking to check if the event sources and their associated Lambda::Permission resources are # connect to the Alias and *not* the function diff --git a/tests/functional/commands/validate/lib/models/function_with_alias_intrinsics.yaml b/tests/functional/commands/validate/lib/models/function_with_alias_intrinsics.yaml index b2b582f097..90badfd4d5 100644 --- a/tests/functional/commands/validate/lib/models/function_with_alias_intrinsics.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_alias_intrinsics.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: AliasName: Type: String diff --git a/tests/functional/commands/validate/lib/models/function_with_amq.yaml b/tests/functional/commands/validate/lib/models/function_with_amq.yaml index ea9767a73d..c23dad8b8c 100644 --- a/tests/functional/commands/validate/lib/models/function_with_amq.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_amq.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MQFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/function_with_amq_kms.yaml b/tests/functional/commands/validate/lib/models/function_with_amq_kms.yaml index 6a5bc2c6cc..b5721a04d4 100644 --- a/tests/functional/commands/validate/lib/models/function_with_amq_kms.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_amq_kms.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MQFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/function_with_architectures.yaml b/tests/functional/commands/validate/lib/models/function_with_architectures.yaml index 4d8af0cd37..d3fca4ae59 100644 --- a/tests/functional/commands/validate/lib/models/function_with_architectures.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_architectures.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- # File: sam.yml # Version: 0.9 diff --git a/tests/functional/commands/validate/lib/models/function_with_auth_mechanism_for_self_managed_kafka.yaml b/tests/functional/commands/validate/lib/models/function_with_auth_mechanism_for_self_managed_kafka.yaml index 9ba58b738e..d673ed23f8 100644 --- a/tests/functional/commands/validate/lib/models/function_with_auth_mechanism_for_self_managed_kafka.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_auth_mechanism_for_self_managed_kafka.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Parameters: {} Resources: diff --git a/tests/functional/commands/validate/lib/models/function_with_condition.yaml b/tests/functional/commands/validate/lib/models/function_with_condition.yaml index 15842b5418..04a348b525 100644 --- a/tests/functional/commands/validate/lib/models/function_with_condition.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_condition.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: TestCondition: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/function_with_conditional_managed_policy.yaml b/tests/functional/commands/validate/lib/models/function_with_conditional_managed_policy.yaml index 02bfab1335..5d971c537e 100644 --- a/tests/functional/commands/validate/lib/models/function_with_conditional_managed_policy.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_conditional_managed_policy.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: DummyCondition: !Equals ['', ''] diff --git a/tests/functional/commands/validate/lib/models/function_with_conditional_managed_policy_and_ref_no_value.yaml b/tests/functional/commands/validate/lib/models/function_with_conditional_managed_policy_and_ref_no_value.yaml index 30f1db3153..4f0465bb54 100644 --- a/tests/functional/commands/validate/lib/models/function_with_conditional_managed_policy_and_ref_no_value.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_conditional_managed_policy_and_ref_no_value.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: DummyCondition: !Equals ['', ''] diff --git a/tests/functional/commands/validate/lib/models/function_with_conditional_policy_template.yaml b/tests/functional/commands/validate/lib/models/function_with_conditional_policy_template.yaml index eda349a65c..5e2fca91b8 100644 --- a/tests/functional/commands/validate/lib/models/function_with_conditional_policy_template.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_conditional_policy_template.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: DummyCondition: !Equals ['', ''] diff --git a/tests/functional/commands/validate/lib/models/function_with_conditional_policy_template_and_ref_no_value.yaml b/tests/functional/commands/validate/lib/models/function_with_conditional_policy_template_and_ref_no_value.yaml index 28d169e3dd..640444fa63 100644 --- a/tests/functional/commands/validate/lib/models/function_with_conditional_policy_template_and_ref_no_value.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_conditional_policy_template_and_ref_no_value.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: DummyCondition: !Equals ['', ''] diff --git a/tests/functional/commands/validate/lib/models/function_with_custom_codedeploy_deployment_preference.yaml b/tests/functional/commands/validate/lib/models/function_with_custom_codedeploy_deployment_preference.yaml index b3a46b34df..464786b048 100644 --- a/tests/functional/commands/validate/lib/models/function_with_custom_codedeploy_deployment_preference.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_custom_codedeploy_deployment_preference.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Mappings: DeploymentPreferenceMap: prod: diff --git a/tests/functional/commands/validate/lib/models/function_with_custom_conditional_codedeploy_deployment_preference.yaml b/tests/functional/commands/validate/lib/models/function_with_custom_conditional_codedeploy_deployment_preference.yaml index d4a8cccdfd..d90597ef67 100644 --- a/tests/functional/commands/validate/lib/models/function_with_custom_conditional_codedeploy_deployment_preference.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_custom_conditional_codedeploy_deployment_preference.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Parameters: diff --git a/tests/functional/commands/validate/lib/models/function_with_deployment_and_custom_role.yaml b/tests/functional/commands/validate/lib/models/function_with_deployment_and_custom_role.yaml index fe05e2dcce..f5347cd38b 100644 --- a/tests/functional/commands/validate/lib/models/function_with_deployment_and_custom_role.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_deployment_and_custom_role.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Function: AutoPublishAlias: live diff --git a/tests/functional/commands/validate/lib/models/function_with_deployment_no_service_role_with_passthrough.yaml b/tests/functional/commands/validate/lib/models/function_with_deployment_no_service_role_with_passthrough.yaml index 402af06f8e..2e03a8d950 100644 --- a/tests/functional/commands/validate/lib/models/function_with_deployment_no_service_role_with_passthrough.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_deployment_no_service_role_with_passthrough.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: Condition1: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/function_with_deployment_no_service_role_without_passthrough.yaml b/tests/functional/commands/validate/lib/models/function_with_deployment_no_service_role_without_passthrough.yaml index 5216220895..015cdf2835 100644 --- a/tests/functional/commands/validate/lib/models/function_with_deployment_no_service_role_without_passthrough.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_deployment_no_service_role_without_passthrough.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: Condition1: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/function_with_deployment_preference.yaml b/tests/functional/commands/validate/lib/models/function_with_deployment_preference.yaml index 7550f4316a..5aaafb7445 100644 --- a/tests/functional/commands/validate/lib/models/function_with_deployment_preference.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_deployment_preference.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: FnName: Type: String diff --git a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_alarms_intrinsic_if.yaml b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_alarms_intrinsic_if.yaml index a63e9bc3a8..0519c75bea 100644 --- a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_alarms_intrinsic_if.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_alarms_intrinsic_if.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: MyCondition: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_all_parameters.yaml b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_all_parameters.yaml index 8bd803ffcb..8c0d9bead0 100644 --- a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_all_parameters.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_all_parameters.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MinimalFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_condition_with_passthrough.yaml b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_condition_with_passthrough.yaml index 3f36716080..601246c6d5 100644 --- a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_condition_with_passthrough.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_condition_with_passthrough.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: FnName: Type: String diff --git a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_condition_without_passthrough.yaml b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_condition_without_passthrough.yaml index 9ecf17ceec..334d914168 100644 --- a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_condition_without_passthrough.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_condition_without_passthrough.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: FnName: Type: String diff --git a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_from_parameters.yaml b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_from_parameters.yaml index 788709cfbe..45bb13261e 100644 --- a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_from_parameters.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_from_parameters.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: MyTrueParameter: Default: 'True' diff --git a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_multiple_combinations.yaml b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_multiple_combinations.yaml index 66093db147..ee5c061e73 100644 --- a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_multiple_combinations.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_multiple_combinations.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MinimalFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_multiple_combinations_conditions_with_passthrough.yaml b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_multiple_combinations_conditions_with_passthrough.yaml index 9d98ad8de6..44ac48aef1 100644 --- a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_multiple_combinations_conditions_with_passthrough.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_multiple_combinations_conditions_with_passthrough.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: Condition1: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_multiple_combinations_conditions_without_passthrough.yaml b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_multiple_combinations_conditions_without_passthrough.yaml index 6e4bcf1204..48b3298343 100644 --- a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_multiple_combinations_conditions_without_passthrough.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_multiple_combinations_conditions_without_passthrough.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: Condition1: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_passthrough_condition_with_supported_intrinsics.yaml b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_passthrough_condition_with_supported_intrinsics.yaml index b1efee4b48..89f4279280 100644 --- a/tests/functional/commands/validate/lib/models/function_with_deployment_preference_passthrough_condition_with_supported_intrinsics.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_deployment_preference_passthrough_condition_with_supported_intrinsics.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- # Tests supported intrinsics in the PassthroughCondition property Mappings: diff --git a/tests/functional/commands/validate/lib/models/function_with_disabled_deployment_preference.yaml b/tests/functional/commands/validate/lib/models/function_with_disabled_deployment_preference.yaml index 07f8335f22..13705cd9d2 100644 --- a/tests/functional/commands/validate/lib/models/function_with_disabled_deployment_preference.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_disabled_deployment_preference.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MinimalFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/function_with_disabled_traffic_hook.yaml b/tests/functional/commands/validate/lib/models/function_with_disabled_traffic_hook.yaml index 65a9281f48..d8efbc4b45 100644 --- a/tests/functional/commands/validate/lib/models/function_with_disabled_traffic_hook.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_disabled_traffic_hook.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: Template with preference that does not require a new CodeDeploy Service @@ -23,12 +21,12 @@ Resources: Hooks: PreTraffic: Ref: preTrafficHook - Events: - Api: - Type: Api - Properties: - Path: /test - Method: get + Events: + Api: + Type: Api + Properties: + Path: /test + Method: get preTrafficHook: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/function_with_dlq.yaml b/tests/functional/commands/validate/lib/models/function_with_dlq.yaml index 5567d4935c..b25267b53f 100644 --- a/tests/functional/commands/validate/lib/models/function_with_dlq.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_dlq.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Transform: AWS::Serverless-2016-10-31 Resources: MySnsDlqLambdaFunction: diff --git a/tests/functional/commands/validate/lib/models/function_with_ephemeral_storage.yaml b/tests/functional/commands/validate/lib/models/function_with_ephemeral_storage.yaml index beae97b5e2..207aebfac7 100644 --- a/tests/functional/commands/validate/lib/models/function_with_ephemeral_storage.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_ephemeral_storage.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: EphemeralStorageSizeRef: Type: Number diff --git a/tests/functional/commands/validate/lib/models/function_with_event_bridge_rule_state.yaml b/tests/functional/commands/validate/lib/models/function_with_event_bridge_rule_state.yaml index 221a8962f2..35e45a94c5 100644 --- a/tests/functional/commands/validate/lib/models/function_with_event_bridge_rule_state.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_event_bridge_rule_state.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Transform: AWS::Serverless-2016-10-31 Resources: diff --git a/tests/functional/commands/validate/lib/models/function_with_event_dest.yaml b/tests/functional/commands/validate/lib/models/function_with_event_dest.yaml index 3c58d6c04a..531f236646 100644 --- a/tests/functional/commands/validate/lib/models/function_with_event_dest.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_event_dest.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: SQSArn: Type: String diff --git a/tests/functional/commands/validate/lib/models/function_with_event_dest_basic.yaml b/tests/functional/commands/validate/lib/models/function_with_event_dest_basic.yaml index 6e6f7bb892..b8a434a8bf 100644 --- a/tests/functional/commands/validate/lib/models/function_with_event_dest_basic.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_event_dest_basic.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: SNSArn: Type: String diff --git a/tests/functional/commands/validate/lib/models/function_with_event_dest_conditional.yaml b/tests/functional/commands/validate/lib/models/function_with_event_dest_conditional.yaml index 22a4d73c1c..d6fcd56317 100644 --- a/tests/functional/commands/validate/lib/models/function_with_event_dest_conditional.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_event_dest_conditional.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: SQSArn: Type: String diff --git a/tests/functional/commands/validate/lib/models/function_with_event_filtering.yaml b/tests/functional/commands/validate/lib/models/function_with_event_filtering.yaml index b54390fa60..98a5f56de8 100644 --- a/tests/functional/commands/validate/lib/models/function_with_event_filtering.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_event_filtering.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: FilteredEventsFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/function_with_event_schedule_state.yaml b/tests/functional/commands/validate/lib/models/function_with_event_schedule_state.yaml index 4c1562766d..f92e055813 100644 --- a/tests/functional/commands/validate/lib/models/function_with_event_schedule_state.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_event_schedule_state.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Transform: AWS::Serverless-2016-10-31 Parameters: ScheduleState: diff --git a/tests/functional/commands/validate/lib/models/function_with_event_source_mapping.yaml b/tests/functional/commands/validate/lib/models/function_with_event_source_mapping.yaml index d04ec98243..ec81a472ce 100644 --- a/tests/functional/commands/validate/lib/models/function_with_event_source_mapping.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_event_source_mapping.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 diff --git a/tests/functional/commands/validate/lib/models/function_with_file_system_config.yaml b/tests/functional/commands/validate/lib/models/function_with_file_system_config.yaml index a7e4d49a2c..647ea9a410 100644 --- a/tests/functional/commands/validate/lib/models/function_with_file_system_config.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_file_system_config.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Description: SAM + Lambda + EFS Parameters: diff --git a/tests/functional/commands/validate/lib/models/function_with_function_url_config.yaml b/tests/functional/commands/validate/lib/models/function_with_function_url_config.yaml index 68345913ab..b2b69b8f2f 100644 --- a/tests/functional/commands/validate/lib/models/function_with_function_url_config.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_function_url_config.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Parameters: {} Resources: diff --git a/tests/functional/commands/validate/lib/models/function_with_function_url_config_and_autopublishalias.yaml b/tests/functional/commands/validate/lib/models/function_with_function_url_config_and_autopublishalias.yaml index 04a64f4df6..2a3726f45d 100644 --- a/tests/functional/commands/validate/lib/models/function_with_function_url_config_and_autopublishalias.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_function_url_config_and_autopublishalias.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Parameters: {} Resources: diff --git a/tests/functional/commands/validate/lib/models/function_with_function_url_config_conditions.yaml b/tests/functional/commands/validate/lib/models/function_with_function_url_config_conditions.yaml index 9af4a7122b..4af4a43745 100644 --- a/tests/functional/commands/validate/lib/models/function_with_function_url_config_conditions.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_function_url_config_conditions.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Conditions: MyCondition: diff --git a/tests/functional/commands/validate/lib/models/function_with_function_url_config_with_iam_authorization_type.yaml b/tests/functional/commands/validate/lib/models/function_with_function_url_config_with_iam_authorization_type.yaml index 1b5f983658..e9c20dea86 100644 --- a/tests/functional/commands/validate/lib/models/function_with_function_url_config_with_iam_authorization_type.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_function_url_config_with_iam_authorization_type.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Parameters: {} Resources: diff --git a/tests/functional/commands/validate/lib/models/function_with_function_url_config_with_intrinsics.yaml b/tests/functional/commands/validate/lib/models/function_with_function_url_config_with_intrinsics.yaml index 314f883ad4..9d1ed50d90 100644 --- a/tests/functional/commands/validate/lib/models/function_with_function_url_config_with_intrinsics.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_function_url_config_with_intrinsics.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Parameters: AuthorizationTypeRef: diff --git a/tests/functional/commands/validate/lib/models/function_with_function_url_config_without_cors_config.yaml b/tests/functional/commands/validate/lib/models/function_with_function_url_config_without_cors_config.yaml index 09f1d50a2e..19ebb3739a 100644 --- a/tests/functional/commands/validate/lib/models/function_with_function_url_config_without_cors_config.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_function_url_config_without_cors_config.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Parameters: {} Resources: diff --git a/tests/functional/commands/validate/lib/models/function_with_global_layers.yaml b/tests/functional/commands/validate/lib/models/function_with_global_layers.yaml index bc02edd911..a0989ea37a 100644 --- a/tests/functional/commands/validate/lib/models/function_with_global_layers.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_global_layers.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Function: Layers: diff --git a/tests/functional/commands/validate/lib/models/function_with_globals_role_path.yaml b/tests/functional/commands/validate/lib/models/function_with_globals_role_path.yaml new file mode 100644 index 0000000000..2f5cd975c4 --- /dev/null +++ b/tests/functional/commands/validate/lib/models/function_with_globals_role_path.yaml @@ -0,0 +1,20 @@ +Globals: + Function: + RolePath: /foo/bar + +Resources: + Function1: + Type: AWS::Serverless::Function + Properties: + CodeUri: s3://sam-demo-bucket/hello.zip + Handler: hello.handler + Runtime: python2.7 + RolePath: /foo/bar + + Function2: + Type: AWS::Serverless::Function + Properties: + CodeUri: s3://sam-demo-bucket/hello.zip + Handler: hello.world + Runtime: python3.7 + RolePath: /foo/bar diff --git a/tests/functional/commands/validate/lib/models/function_with_intrinsic_architecture.yaml b/tests/functional/commands/validate/lib/models/function_with_intrinsic_architecture.yaml index 975fcfb929..df6c6645a3 100644 --- a/tests/functional/commands/validate/lib/models/function_with_intrinsic_architecture.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_intrinsic_architecture.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: ArchitectureRef: Type: String diff --git a/tests/functional/commands/validate/lib/models/function_with_kmskeyarn.yaml b/tests/functional/commands/validate/lib/models/function_with_kmskeyarn.yaml index aab86a67a1..345921ba4b 100644 --- a/tests/functional/commands/validate/lib/models/function_with_kmskeyarn.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_kmskeyarn.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: FunctionWithKeyArn: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/function_with_layers.yaml b/tests/functional/commands/validate/lib/models/function_with_layers.yaml index d5a165cb60..72b3ac09df 100644 --- a/tests/functional/commands/validate/lib/models/function_with_layers.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_layers.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MinimalLayerFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/function_with_many_layers.yaml b/tests/functional/commands/validate/lib/models/function_with_many_layers.yaml index a7ae76b153..bac2ff9312 100644 --- a/tests/functional/commands/validate/lib/models/function_with_many_layers.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_many_layers.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ManyLayersFunc: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/function_with_mq_virtual_host.yaml b/tests/functional/commands/validate/lib/models/function_with_mq_virtual_host.yaml index bf9d322cee..0005670482 100644 --- a/tests/functional/commands/validate/lib/models/function_with_mq_virtual_host.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_mq_virtual_host.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MQFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/function_with_msk.yaml b/tests/functional/commands/validate/lib/models/function_with_msk.yaml index cb5f2d631f..0a2eeb7538 100644 --- a/tests/functional/commands/validate/lib/models/function_with_msk.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_msk.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Parameters: {} diff --git a/tests/functional/commands/validate/lib/models/function_with_msk_with_intrinsics.yaml b/tests/functional/commands/validate/lib/models/function_with_msk_with_intrinsics.yaml index a77ff9044a..39659bd9b1 100644 --- a/tests/functional/commands/validate/lib/models/function_with_msk_with_intrinsics.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_msk_with_intrinsics.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Parameters: StartingPositionValue: diff --git a/tests/functional/commands/validate/lib/models/function_with_null_events.yaml b/tests/functional/commands/validate/lib/models/function_with_null_events.yaml index cdf01e02c5..5dc591caa2 100644 --- a/tests/functional/commands/validate/lib/models/function_with_null_events.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_null_events.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: FunctionWithNullEvents: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/function_with_permissions_boundary.yaml b/tests/functional/commands/validate/lib/models/function_with_permissions_boundary.yaml index e03766c4eb..20a25e1928 100644 --- a/tests/functional/commands/validate/lib/models/function_with_permissions_boundary.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_permissions_boundary.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MinimalFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/function_with_policy_templates.yaml b/tests/functional/commands/validate/lib/models/function_with_policy_templates.yaml index c3d16421aa..036611983e 100644 --- a/tests/functional/commands/validate/lib/models/function_with_policy_templates.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_policy_templates.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: FunctionNameParam: Type: String diff --git a/tests/functional/commands/validate/lib/models/function_with_request_parameters.yaml b/tests/functional/commands/validate/lib/models/function_with_request_parameters.yaml index 1bd5a5aa7b..7eb4525bcb 100644 --- a/tests/functional/commands/validate/lib/models/function_with_request_parameters.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_request_parameters.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: Api: diff --git a/tests/functional/commands/validate/lib/models/function_with_resource_refs.yaml b/tests/functional/commands/validate/lib/models/function_with_resource_refs.yaml index 88e417d1ed..79c567e04e 100644 --- a/tests/functional/commands/validate/lib/models/function_with_resource_refs.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_resource_refs.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- # Test to verify that resource references available on the Function are properly resolved # Currently supported references are: # - Alias diff --git a/tests/functional/commands/validate/lib/models/function_with_role_and_role_path.yaml b/tests/functional/commands/validate/lib/models/function_with_role_and_role_path.yaml new file mode 100644 index 0000000000..55127a4b53 --- /dev/null +++ b/tests/functional/commands/validate/lib/models/function_with_role_and_role_path.yaml @@ -0,0 +1,21 @@ +Resources: + MyFunction: + Type: AWS::Serverless::Function + Properties: + CodeUri: s3://sam-demo-bucket/hello.zip + Handler: hello.handler + Runtime: python2.7 + Role: !Ref MyRole + RolePath: /foo/bar + + MyRole: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Statement: + - Effect: Allow + Action: sts:AssumeRole + Principal: + Service: lambda.amazonaws.com + ManagedPolicyArns: + - arn:{AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole diff --git a/tests/functional/commands/validate/lib/models/function_with_role_path.yaml b/tests/functional/commands/validate/lib/models/function_with_role_path.yaml new file mode 100644 index 0000000000..d0a426b31a --- /dev/null +++ b/tests/functional/commands/validate/lib/models/function_with_role_path.yaml @@ -0,0 +1,8 @@ +Resources: + MinimalFunction: + Type: AWS::Serverless::Function + Properties: + CodeUri: s3://sam-demo-bucket/hello.zip + Handler: hello.handler + Runtime: python2.7 + RolePath: /foo/bar diff --git a/tests/functional/commands/validate/lib/models/function_with_self_managed_kafka.yaml b/tests/functional/commands/validate/lib/models/function_with_self_managed_kafka.yaml index c3050737b1..b155b23ec1 100644 --- a/tests/functional/commands/validate/lib/models/function_with_self_managed_kafka.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_self_managed_kafka.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Parameters: {} Resources: diff --git a/tests/functional/commands/validate/lib/models/function_with_signing_profile.yaml b/tests/functional/commands/validate/lib/models/function_with_signing_profile.yaml index 48b9f06541..219ba595a9 100644 --- a/tests/functional/commands/validate/lib/models/function_with_signing_profile.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_signing_profile.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: FunctionWithSigningProfile: diff --git a/tests/functional/commands/validate/lib/models/function_with_sns_event_source_all_parameters.yaml b/tests/functional/commands/validate/lib/models/function_with_sns_event_source_all_parameters.yaml index 7e57bf64ae..51285790dc 100644 --- a/tests/functional/commands/validate/lib/models/function_with_sns_event_source_all_parameters.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_sns_event_source_all_parameters.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyAwesomeFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/function_with_vpc_permission_for_self_managed_kafka.yaml b/tests/functional/commands/validate/lib/models/function_with_vpc_permission_for_self_managed_kafka.yaml index 555f0b2389..b1ef4d3229 100644 --- a/tests/functional/commands/validate/lib/models/function_with_vpc_permission_for_self_managed_kafka.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_vpc_permission_for_self_managed_kafka.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Parameters: {} Resources: diff --git a/tests/functional/commands/validate/lib/models/global_handle_path_level_parameter.yaml b/tests/functional/commands/validate/lib/models/global_handle_path_level_parameter.yaml index b8386b4139..d9f09ea1c9 100644 --- a/tests/functional/commands/validate/lib/models/global_handle_path_level_parameter.yaml +++ b/tests/functional/commands/validate/lib/models/global_handle_path_level_parameter.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Name: some api diff --git a/tests/functional/commands/validate/lib/models/globals_for_api.yaml b/tests/functional/commands/validate/lib/models/globals_for_api.yaml index 3d3aed422d..1ae64264a7 100644 --- a/tests/functional/commands/validate/lib/models/globals_for_api.yaml +++ b/tests/functional/commands/validate/lib/models/globals_for_api.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Name: some api diff --git a/tests/functional/commands/validate/lib/models/globals_for_function.yaml b/tests/functional/commands/validate/lib/models/globals_for_function.yaml index e9adecd42c..eb7b1e6deb 100644 --- a/tests/functional/commands/validate/lib/models/globals_for_function.yaml +++ b/tests/functional/commands/validate/lib/models/globals_for_function.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Function: CodeUri: s3://global-bucket/global.zip diff --git a/tests/functional/commands/validate/lib/models/globals_for_simpletable.yaml b/tests/functional/commands/validate/lib/models/globals_for_simpletable.yaml index fa1c90da4a..8f6402fe34 100644 --- a/tests/functional/commands/validate/lib/models/globals_for_simpletable.yaml +++ b/tests/functional/commands/validate/lib/models/globals_for_simpletable.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: SimpleTable: SSESpecification: diff --git a/tests/functional/commands/validate/lib/models/http_api_custom_iam_auth.yaml b/tests/functional/commands/validate/lib/models/http_api_custom_iam_auth.yaml index 08e78d8517..ca8d513c7d 100644 --- a/tests/functional/commands/validate/lib/models/http_api_custom_iam_auth.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_custom_iam_auth.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- # This test-case tests what happens when an AWS_IAM authorizer is defined on an HttpApi but not enabled anywhere else. # While the defined authorizer isn't really a true Iam authorizer (it's just a poorly-named OAuth authorizer) this shouldn't cause an error. Resources: diff --git a/tests/functional/commands/validate/lib/models/http_api_def_uri.yaml b/tests/functional/commands/validate/lib/models/http_api_def_uri.yaml index 5e3d69613d..42902c2748 100644 --- a/tests/functional/commands/validate/lib/models/http_api_def_uri.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_def_uri.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: HttpApi: DefaultRouteSettings: diff --git a/tests/functional/commands/validate/lib/models/http_api_description.yaml b/tests/functional/commands/validate/lib/models/http_api_description.yaml index a5677e1732..6497698da1 100644 --- a/tests/functional/commands/validate/lib/models/http_api_description.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_description.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HttpApi: Type: AWS::Serverless::HttpApi diff --git a/tests/functional/commands/validate/lib/models/http_api_existing_openapi.yaml b/tests/functional/commands/validate/lib/models/http_api_existing_openapi.yaml index c9876ef27b..02d0be9eb7 100644 --- a/tests/functional/commands/validate/lib/models/http_api_existing_openapi.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_existing_openapi.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: Timeout: Default: 15000 diff --git a/tests/functional/commands/validate/lib/models/http_api_existing_openapi_conditions.yaml b/tests/functional/commands/validate/lib/models/http_api_existing_openapi_conditions.yaml index 23907d9c9b..8eef0385c0 100644 --- a/tests/functional/commands/validate/lib/models/http_api_existing_openapi_conditions.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_existing_openapi_conditions.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: condition: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/http_api_explicit_stage.yaml b/tests/functional/commands/validate/lib/models/http_api_explicit_stage.yaml index dc7834d3f8..18299fc964 100644 --- a/tests/functional/commands/validate/lib/models/http_api_explicit_stage.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_explicit_stage.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: CorsParam: Type: String diff --git a/tests/functional/commands/validate/lib/models/http_api_global_iam_auth_enabled.yaml b/tests/functional/commands/validate/lib/models/http_api_global_iam_auth_enabled.yaml index 5b08e451a0..84092f5eea 100644 --- a/tests/functional/commands/validate/lib/models/http_api_global_iam_auth_enabled.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_global_iam_auth_enabled.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: HttpApi: Auth: diff --git a/tests/functional/commands/validate/lib/models/http_api_global_iam_auth_enabled_with_existing_conflicting_authorizer.yaml b/tests/functional/commands/validate/lib/models/http_api_global_iam_auth_enabled_with_existing_conflicting_authorizer.yaml index 7ad47c88a1..a2dabcd412 100644 --- a/tests/functional/commands/validate/lib/models/http_api_global_iam_auth_enabled_with_existing_conflicting_authorizer.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_global_iam_auth_enabled_with_existing_conflicting_authorizer.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- # This test-case tests what happens when an AWS_IAM authorizer is defined on an HttpApi and also enabled globally. # In this case the defined authorizer should NOT be overwritten. Globals: diff --git a/tests/functional/commands/validate/lib/models/http_api_lambda_auth.yaml b/tests/functional/commands/validate/lib/models/http_api_lambda_auth.yaml index cb94bd87de..4c2db4306e 100644 --- a/tests/functional/commands/validate/lib/models/http_api_lambda_auth.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_lambda_auth.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HttpApiFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/http_api_lambda_auth_full.yaml b/tests/functional/commands/validate/lib/models/http_api_lambda_auth_full.yaml index 5bf3279ce3..46c7150129 100644 --- a/tests/functional/commands/validate/lib/models/http_api_lambda_auth_full.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_lambda_auth_full.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HttpApiFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/http_api_local_iam_auth_enabled.yaml b/tests/functional/commands/validate/lib/models/http_api_local_iam_auth_enabled.yaml index ef339c1644..1daba52881 100644 --- a/tests/functional/commands/validate/lib/models/http_api_local_iam_auth_enabled.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_local_iam_auth_enabled.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: HttpApi: Auth: diff --git a/tests/functional/commands/validate/lib/models/http_api_local_iam_auth_enabled_with_existing_conflicting_authorizer.yaml b/tests/functional/commands/validate/lib/models/http_api_local_iam_auth_enabled_with_existing_conflicting_authorizer.yaml index ee04e04e04..4fb00c0887 100644 --- a/tests/functional/commands/validate/lib/models/http_api_local_iam_auth_enabled_with_existing_conflicting_authorizer.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_local_iam_auth_enabled_with_existing_conflicting_authorizer.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- # This test-case tests what happens when an AWS_IAM authorizer is defined on an HttpApi and also enabled locally. # In this case the defined authorizer should NOT be overwritten. Resources: diff --git a/tests/functional/commands/validate/lib/models/http_api_multiple_authorizers.yaml b/tests/functional/commands/validate/lib/models/http_api_multiple_authorizers.yaml index 3c39007f93..00f6c6cf9c 100644 --- a/tests/functional/commands/validate/lib/models/http_api_multiple_authorizers.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_multiple_authorizers.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HttpApiFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/http_api_with_cors.yaml b/tests/functional/commands/validate/lib/models/http_api_with_cors.yaml index 76d9797834..c3a1fe751e 100644 --- a/tests/functional/commands/validate/lib/models/http_api_with_cors.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_with_cors.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: C1: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/http_api_with_custom_domain_route53_multiple.yaml b/tests/functional/commands/validate/lib/models/http_api_with_custom_domain_route53_multiple.yaml index 256d8f171d..299e0ef83a 100644 --- a/tests/functional/commands/validate/lib/models/http_api_with_custom_domain_route53_multiple.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_with_custom_domain_route53_multiple.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApi1: Type: AWS::Serverless::HttpApi diff --git a/tests/functional/commands/validate/lib/models/http_api_with_default_stage_name_and_fail_on_warnings.yaml b/tests/functional/commands/validate/lib/models/http_api_with_default_stage_name_and_fail_on_warnings.yaml new file mode 100644 index 0000000000..b95f9042d2 --- /dev/null +++ b/tests/functional/commands/validate/lib/models/http_api_with_default_stage_name_and_fail_on_warnings.yaml @@ -0,0 +1,17 @@ +Resources: + AppApi: + Type: AWS::Serverless::HttpApi + Properties: + FailOnWarnings: true + StageName: $default + AppFunction: + Type: AWS::Serverless::Function + Properties: + InlineCode: foo + Handler: bar + Runtime: nodejs14.x + Events: + AppHandler: + Type: HttpApi + Properties: + ApiId: !Ref AppApi diff --git a/tests/functional/commands/validate/lib/models/http_api_with_null_path.yaml b/tests/functional/commands/validate/lib/models/http_api_with_null_path.yaml index 9665be77c8..d2d36731d7 100644 --- a/tests/functional/commands/validate/lib/models/http_api_with_null_path.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_with_null_path.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: A template to test for API condition handling with a mix of explicit diff --git a/tests/functional/commands/validate/lib/models/implicit_and_explicit_api_with_conditions.yaml b/tests/functional/commands/validate/lib/models/implicit_and_explicit_api_with_conditions.yaml index 2063e4039c..82a6177e04 100644 --- a/tests/functional/commands/validate/lib/models/implicit_and_explicit_api_with_conditions.yaml +++ b/tests/functional/commands/validate/lib/models/implicit_and_explicit_api_with_conditions.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: A template to test for API condition handling with a mix of explicit diff --git a/tests/functional/commands/validate/lib/models/implicit_api.yaml b/tests/functional/commands/validate/lib/models/implicit_api.yaml index 55d8f8120f..3b9f63b35f 100644 --- a/tests/functional/commands/validate/lib/models/implicit_api.yaml +++ b/tests/functional/commands/validate/lib/models/implicit_api.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: RestApiFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/implicit_api_deletion_policy_precedence.yaml b/tests/functional/commands/validate/lib/models/implicit_api_deletion_policy_precedence.yaml index 862c9b4780..3e92966a2c 100644 --- a/tests/functional/commands/validate/lib/models/implicit_api_deletion_policy_precedence.yaml +++ b/tests/functional/commands/validate/lib/models/implicit_api_deletion_policy_precedence.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: RestApiFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/implicit_api_with_auth_and_conditions_max.yaml b/tests/functional/commands/validate/lib/models/implicit_api_with_auth_and_conditions_max.yaml index cb7c039135..ae73cddf43 100644 --- a/tests/functional/commands/validate/lib/models/implicit_api_with_auth_and_conditions_max.yaml +++ b/tests/functional/commands/validate/lib/models/implicit_api_with_auth_and_conditions_max.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Auth: diff --git a/tests/functional/commands/validate/lib/models/implicit_api_with_many_conditions.yaml b/tests/functional/commands/validate/lib/models/implicit_api_with_many_conditions.yaml index 14bae0537a..a4e1fc8599 100644 --- a/tests/functional/commands/validate/lib/models/implicit_api_with_many_conditions.yaml +++ b/tests/functional/commands/validate/lib/models/implicit_api_with_many_conditions.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: A template to test for implicit API condition handling. diff --git a/tests/functional/commands/validate/lib/models/implicit_api_with_serverless_rest_api_resource.yaml b/tests/functional/commands/validate/lib/models/implicit_api_with_serverless_rest_api_resource.yaml index 9addfa3a94..444a8447c0 100644 --- a/tests/functional/commands/validate/lib/models/implicit_api_with_serverless_rest_api_resource.yaml +++ b/tests/functional/commands/validate/lib/models/implicit_api_with_serverless_rest_api_resource.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: RestApiFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/implicit_http_api.yaml b/tests/functional/commands/validate/lib/models/implicit_http_api.yaml index 4f8047964a..0e726a8987 100644 --- a/tests/functional/commands/validate/lib/models/implicit_http_api.yaml +++ b/tests/functional/commands/validate/lib/models/implicit_http_api.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HttpApiFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/implicit_http_api_auth_and_simple_case.yaml b/tests/functional/commands/validate/lib/models/implicit_http_api_auth_and_simple_case.yaml index 75104c05eb..71fea93120 100644 --- a/tests/functional/commands/validate/lib/models/implicit_http_api_auth_and_simple_case.yaml +++ b/tests/functional/commands/validate/lib/models/implicit_http_api_auth_and_simple_case.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: RestApiFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/implicit_http_api_with_many_conditions.yaml b/tests/functional/commands/validate/lib/models/implicit_http_api_with_many_conditions.yaml index eaaa26bade..acf0ef7180 100644 --- a/tests/functional/commands/validate/lib/models/implicit_http_api_with_many_conditions.yaml +++ b/tests/functional/commands/validate/lib/models/implicit_http_api_with_many_conditions.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: A template to test for implicit HttpApi condition handling. diff --git a/tests/functional/commands/validate/lib/models/inline_precedence.yaml b/tests/functional/commands/validate/lib/models/inline_precedence.yaml index 3f2e192a40..6b96bab623 100644 --- a/tests/functional/commands/validate/lib/models/inline_precedence.yaml +++ b/tests/functional/commands/validate/lib/models/inline_precedence.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: HelloWorldFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/intrinsic_functions.yaml b/tests/functional/commands/validate/lib/models/intrinsic_functions.yaml index e331765df1..e8fd54b79b 100644 --- a/tests/functional/commands/validate/lib/models/intrinsic_functions.yaml +++ b/tests/functional/commands/validate/lib/models/intrinsic_functions.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- # SAM template using intrinsic function on every property that supports it. # Translator should handle it properly Parameters: diff --git a/tests/functional/commands/validate/lib/models/iot_rule.yaml b/tests/functional/commands/validate/lib/models/iot_rule.yaml index c4a45ed0e2..7dd167e0ea 100644 --- a/tests/functional/commands/validate/lib/models/iot_rule.yaml +++ b/tests/functional/commands/validate/lib/models/iot_rule.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- # File: sam.yml # Version: 0.9 diff --git a/tests/functional/commands/validate/lib/models/kinesis_intrinsics.yaml b/tests/functional/commands/validate/lib/models/kinesis_intrinsics.yaml index ebd97f6f8c..b013e24ef8 100644 --- a/tests/functional/commands/validate/lib/models/kinesis_intrinsics.yaml +++ b/tests/functional/commands/validate/lib/models/kinesis_intrinsics.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: IntValue: Type: Number diff --git a/tests/functional/commands/validate/lib/models/layer_deletion_policy_precedence.yaml b/tests/functional/commands/validate/lib/models/layer_deletion_policy_precedence.yaml index adfbce1ad2..1a57f038a5 100644 --- a/tests/functional/commands/validate/lib/models/layer_deletion_policy_precedence.yaml +++ b/tests/functional/commands/validate/lib/models/layer_deletion_policy_precedence.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MinimalLayer: Type: AWS::Serverless::LayerVersion diff --git a/tests/functional/commands/validate/lib/models/layers_all_properties.yaml b/tests/functional/commands/validate/lib/models/layers_all_properties.yaml index 89d692a70f..68364f10f8 100644 --- a/tests/functional/commands/validate/lib/models/layers_all_properties.yaml +++ b/tests/functional/commands/validate/lib/models/layers_all_properties.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: LayerDeleteParam: Type: String diff --git a/tests/functional/commands/validate/lib/models/layers_with_intrinsics.yaml b/tests/functional/commands/validate/lib/models/layers_with_intrinsics.yaml index 3e7945d0e2..7a08853575 100644 --- a/tests/functional/commands/validate/lib/models/layers_with_intrinsics.yaml +++ b/tests/functional/commands/validate/lib/models/layers_with_intrinsics.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: CompatibleArchitecturesList: Type: CommaDelimitedList diff --git a/tests/functional/commands/validate/lib/models/mixed_api_with_custom_domain_route53_multiple.yaml b/tests/functional/commands/validate/lib/models/mixed_api_with_custom_domain_route53_multiple.yaml index 6fdc6bf24d..84feb1efa9 100644 --- a/tests/functional/commands/validate/lib/models/mixed_api_with_custom_domain_route53_multiple.yaml +++ b/tests/functional/commands/validate/lib/models/mixed_api_with_custom_domain_route53_multiple.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > diff --git a/tests/functional/commands/validate/lib/models/no_implicit_api_with_serverless_rest_api_resource.yaml b/tests/functional/commands/validate/lib/models/no_implicit_api_with_serverless_rest_api_resource.yaml index bfb5ce4cf6..bba67de242 100644 --- a/tests/functional/commands/validate/lib/models/no_implicit_api_with_serverless_rest_api_resource.yaml +++ b/tests/functional/commands/validate/lib/models/no_implicit_api_with_serverless_rest_api_resource.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ThumbnailFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/resource_with_invalid_type.yaml b/tests/functional/commands/validate/lib/models/resource_with_invalid_type.yaml index 0e8c08087e..46ace54610 100644 --- a/tests/functional/commands/validate/lib/models/resource_with_invalid_type.yaml +++ b/tests/functional/commands/validate/lib/models/resource_with_invalid_type.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: FunctionInvalid: Type: diff --git a/tests/functional/commands/validate/lib/models/s3.yaml b/tests/functional/commands/validate/lib/models/s3.yaml index 14dfc02455..69e100da5f 100644 --- a/tests/functional/commands/validate/lib/models/s3.yaml +++ b/tests/functional/commands/validate/lib/models/s3.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ThumbnailFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/s3_create_remove.yaml b/tests/functional/commands/validate/lib/models/s3_create_remove.yaml index 90dec53581..c364b63bb1 100644 --- a/tests/functional/commands/validate/lib/models/s3_create_remove.yaml +++ b/tests/functional/commands/validate/lib/models/s3_create_remove.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ThumbnailFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/s3_existing_lambda_notification_configuration.yaml b/tests/functional/commands/validate/lib/models/s3_existing_lambda_notification_configuration.yaml index aa1b8c9304..045381426b 100644 --- a/tests/functional/commands/validate/lib/models/s3_existing_lambda_notification_configuration.yaml +++ b/tests/functional/commands/validate/lib/models/s3_existing_lambda_notification_configuration.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ThumbnailFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/s3_existing_other_notification_configuration.yaml b/tests/functional/commands/validate/lib/models/s3_existing_other_notification_configuration.yaml index 24e7c89ec0..a4bd945a6a 100644 --- a/tests/functional/commands/validate/lib/models/s3_existing_other_notification_configuration.yaml +++ b/tests/functional/commands/validate/lib/models/s3_existing_other_notification_configuration.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ThumbnailFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/s3_filter.yaml b/tests/functional/commands/validate/lib/models/s3_filter.yaml index 2fa0750ccc..0f6acefd5a 100644 --- a/tests/functional/commands/validate/lib/models/s3_filter.yaml +++ b/tests/functional/commands/validate/lib/models/s3_filter.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ThumbnailFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/s3_intrinsics.yaml b/tests/functional/commands/validate/lib/models/s3_intrinsics.yaml index 189bd63971..e3bda1c79e 100644 --- a/tests/functional/commands/validate/lib/models/s3_intrinsics.yaml +++ b/tests/functional/commands/validate/lib/models/s3_intrinsics.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: EventsParam: Type: String diff --git a/tests/functional/commands/validate/lib/models/s3_multiple_events_same_bucket.yaml b/tests/functional/commands/validate/lib/models/s3_multiple_events_same_bucket.yaml index fa47e2fdf2..63c396d624 100644 --- a/tests/functional/commands/validate/lib/models/s3_multiple_events_same_bucket.yaml +++ b/tests/functional/commands/validate/lib/models/s3_multiple_events_same_bucket.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ThumbnailFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/s3_multiple_functions.yaml b/tests/functional/commands/validate/lib/models/s3_multiple_functions.yaml index a987f804dc..75c3569758 100644 --- a/tests/functional/commands/validate/lib/models/s3_multiple_functions.yaml +++ b/tests/functional/commands/validate/lib/models/s3_multiple_functions.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: FunctionOne: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/s3_with_condition.yaml b/tests/functional/commands/validate/lib/models/s3_with_condition.yaml index 9ac944ce3e..648dab5777 100644 --- a/tests/functional/commands/validate/lib/models/s3_with_condition.yaml +++ b/tests/functional/commands/validate/lib/models/s3_with_condition.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: MyCondition: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/s3_with_dependsOn.yaml b/tests/functional/commands/validate/lib/models/s3_with_dependsOn.yaml index eabd25a085..6d41122b49 100644 --- a/tests/functional/commands/validate/lib/models/s3_with_dependsOn.yaml +++ b/tests/functional/commands/validate/lib/models/s3_with_dependsOn.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: Topic: Type: AWS::SNS::Topic diff --git a/tests/functional/commands/validate/lib/models/schema_validation_1.yaml b/tests/functional/commands/validate/lib/models/schema_validation_1.yaml new file mode 100644 index 0000000000..4652810945 --- /dev/null +++ b/tests/functional/commands/validate/lib/models/schema_validation_1.yaml @@ -0,0 +1,67 @@ +AWSTemplateFormatVersion: '2010-09-09' +Description: lambda-dynamodb +Transform: AWS::Serverless-2016-10-31 +Resources: + StateMachine: + Type: AWS::Serverless::StateMachine + Properties: + Name: !Sub ${AWS::StackName}-StateMachine + Definition: + StartAt: Start + States: + Start: + Type: Pass + Next: TaskState + TaskState: + Comment: Stackery creates an attachment point for each 'Task' state + Type: Task + Next: Done + Resource: someresource + Parameters: + FunctionName: ${FunctionArn} + Payload.$: $ + Done: + Type: Pass + End: true + Logging: + Level: ALL + IncludeExecutionData: true + Destinations: + - CloudWatchLogsLogGroup: + LogGroupArn: !GetAtt StateMachineLogGroup.Arn + Policies: + - AWSXrayWriteOnlyAccess + - Statement: + - Effect: Allow + Action: + - logs:CreateLogDelivery + - logs:GetLogDelivery + - logs:UpdateLogDelivery + - logs:DeleteLogDelivery + - logs:ListLogDeliveries + - logs:PutResourcePolicy + - logs:DescribeResourcePolicies + - logs:DescribeLogGroups + Resource: '*' + - LambdaInvokePolicy: + FunctionName: !Ref Function + Tracing: + Enabled: true + Type: STANDARD + DefinitionSubstitutions: + FunctionArn: !GetAtt Function.Arn + Function: + Type: AWS::Serverless::Function + Properties: + FunctionName: !Sub ${AWS::StackName}-Function + Description: !Sub + - Stack ${StackTagName} Environment ${EnvironmentTagName} Function ${ResourceName} + - ResourceName: Function + CodeUri: s3://src/Function + Handler: index.handler + Runtime: nodejs14.x + MemorySize: 3008 + Timeout: 30 + Tracing: Active + Policies: + - AWSXrayWriteOnlyAccess diff --git a/tests/functional/commands/validate/lib/models/schema_validation_2.yaml b/tests/functional/commands/validate/lib/models/schema_validation_2.yaml new file mode 100644 index 0000000000..f8f5241680 --- /dev/null +++ b/tests/functional/commands/validate/lib/models/schema_validation_2.yaml @@ -0,0 +1,72 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: AWS::Serverless-2016-10-31 +Description: > + A Step Functions Standard Workflow sending payloads to an SQS queue. This pattern + will not wait for a callback + from SQS + +Resources: + +########################################################################## +# SQS # +########################################################################## + MyQueue: + Type: AWS::SQS::Queue + +########################################################################## +# STEP FUNCTION # +########################################################################## + + StateMachinetoSQS: + Type: AWS::Serverless::StateMachine + Properties: + Definition: + StartAt: SendToMyQueue + States: + SendToMyQueue: + Type: Task + Resource: someresource + Parameters: + QueueUrl: !Ref MyQueue + MessageBody.$: $.message + End: true + Role: !GetAtt [MyStateMachineExecutionRole, Arn] + +########################################################################## +# Roles # +########################################################################## + + MyStateMachineExecutionRole: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Version: '2012-10-17' + Statement: + - Effect: Allow + Principal: + Service: + - !Sub states.${AWS::Region}.amazonaws.com + Action: sts:AssumeRole + Path: / + + + SFNToSQS: + Type: AWS::Serverless::Connector + Properties: + Source: + Id: StateMachinetoSQS + Destination: + Id: MyQueue + Permissions: + - Write + +########################################################################## +# Outputs # +########################################################################## +Outputs: + StateMachinetoSQSArn: + Value: !Ref StateMachinetoSQS + Description: StateMachinetoSQS Arn + MyQueueURL: + Value: !Ref MyQueue + Description: MyQueue URL diff --git a/tests/functional/commands/validate/lib/models/schema_validation_3.yaml b/tests/functional/commands/validate/lib/models/schema_validation_3.yaml new file mode 100644 index 0000000000..6a4cd0a5e6 --- /dev/null +++ b/tests/functional/commands/validate/lib/models/schema_validation_3.yaml @@ -0,0 +1,19 @@ +Resources: + UnknownType1: + Type: AWS::Foo::Bar + + UnknownType2: + Type: AWS::Foo::Bar + Properties: + Turtle: Train + + UnknownType3: + Type: Foo::Bar::Egg + Properties: + Turtle: Train + + UnknownType4: + Type: Foo::Bar::Egg + + UnknownType5: + Type: Foo::Serverless::Egg diff --git a/tests/functional/commands/validate/lib/models/self_managed_kafka_with_intrinsics.yaml b/tests/functional/commands/validate/lib/models/self_managed_kafka_with_intrinsics.yaml index 4d4c4276d6..5389f12ec1 100644 --- a/tests/functional/commands/validate/lib/models/self_managed_kafka_with_intrinsics.yaml +++ b/tests/functional/commands/validate/lib/models/self_managed_kafka_with_intrinsics.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: BatchSizeValue: Type: Number diff --git a/tests/functional/commands/validate/lib/models/simple_table_ref_parameter_intrinsic.yaml b/tests/functional/commands/validate/lib/models/simple_table_ref_parameter_intrinsic.yaml index ae572553bb..7289514103 100644 --- a/tests/functional/commands/validate/lib/models/simple_table_ref_parameter_intrinsic.yaml +++ b/tests/functional/commands/validate/lib/models/simple_table_ref_parameter_intrinsic.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: ReadCapacity: Type: Number diff --git a/tests/functional/commands/validate/lib/models/simple_table_with_extra_tags.yaml b/tests/functional/commands/validate/lib/models/simple_table_with_extra_tags.yaml index 6a24b02867..ecb2acb396 100644 --- a/tests/functional/commands/validate/lib/models/simple_table_with_extra_tags.yaml +++ b/tests/functional/commands/validate/lib/models/simple_table_with_extra_tags.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: TagValueParam: Type: String diff --git a/tests/functional/commands/validate/lib/models/simple_table_with_table_name.yaml b/tests/functional/commands/validate/lib/models/simple_table_with_table_name.yaml index 56ae21a34d..900ac62b54 100644 --- a/tests/functional/commands/validate/lib/models/simple_table_with_table_name.yaml +++ b/tests/functional/commands/validate/lib/models/simple_table_with_table_name.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: MySimpleTableParameter: Type: String diff --git a/tests/functional/commands/validate/lib/models/simpletable.yaml b/tests/functional/commands/validate/lib/models/simpletable.yaml index b220e1bfba..a1c298971b 100644 --- a/tests/functional/commands/validate/lib/models/simpletable.yaml +++ b/tests/functional/commands/validate/lib/models/simpletable.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MinimalTable: Type: AWS::Serverless::SimpleTable diff --git a/tests/functional/commands/validate/lib/models/simpletable_with_sse.yaml b/tests/functional/commands/validate/lib/models/simpletable_with_sse.yaml index dfdd8a9784..3bc25d63d5 100644 --- a/tests/functional/commands/validate/lib/models/simpletable_with_sse.yaml +++ b/tests/functional/commands/validate/lib/models/simpletable_with_sse.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: TableWithSSE: Type: AWS::Serverless::SimpleTable diff --git a/tests/functional/commands/validate/lib/models/sns.yaml b/tests/functional/commands/validate/lib/models/sns.yaml index a52ab60fca..510e607869 100644 --- a/tests/functional/commands/validate/lib/models/sns.yaml +++ b/tests/functional/commands/validate/lib/models/sns.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: SaveNotificationFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/sns_existing_other_subscription.yaml b/tests/functional/commands/validate/lib/models/sns_existing_other_subscription.yaml index 3949653e4f..0555028eb2 100644 --- a/tests/functional/commands/validate/lib/models/sns_existing_other_subscription.yaml +++ b/tests/functional/commands/validate/lib/models/sns_existing_other_subscription.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: SaveNotificationFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/sns_existing_sqs.yaml b/tests/functional/commands/validate/lib/models/sns_existing_sqs.yaml index a1357dee32..c4b5cca4a7 100644 --- a/tests/functional/commands/validate/lib/models/sns_existing_sqs.yaml +++ b/tests/functional/commands/validate/lib/models/sns_existing_sqs.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: SaveNotificationFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/sns_intrinsics.yaml b/tests/functional/commands/validate/lib/models/sns_intrinsics.yaml index 80466769b5..103922db4e 100644 --- a/tests/functional/commands/validate/lib/models/sns_intrinsics.yaml +++ b/tests/functional/commands/validate/lib/models/sns_intrinsics.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: SnsRegion: Type: String diff --git a/tests/functional/commands/validate/lib/models/sns_outside_sqs.yaml b/tests/functional/commands/validate/lib/models/sns_outside_sqs.yaml index 37c6f64c29..e0d1b8c57f 100644 --- a/tests/functional/commands/validate/lib/models/sns_outside_sqs.yaml +++ b/tests/functional/commands/validate/lib/models/sns_outside_sqs.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: SaveNotificationFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/sns_sqs.yaml b/tests/functional/commands/validate/lib/models/sns_sqs.yaml index d15086dc67..768b6c0880 100644 --- a/tests/functional/commands/validate/lib/models/sns_sqs.yaml +++ b/tests/functional/commands/validate/lib/models/sns_sqs.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: SaveNotificationFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/sns_topic_outside_template.yaml b/tests/functional/commands/validate/lib/models/sns_topic_outside_template.yaml index ada018f412..539a2357fd 100644 --- a/tests/functional/commands/validate/lib/models/sns_topic_outside_template.yaml +++ b/tests/functional/commands/validate/lib/models/sns_topic_outside_template.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Parameters: SNSTopicArn: Type: String diff --git a/tests/functional/commands/validate/lib/models/sqs.yaml b/tests/functional/commands/validate/lib/models/sqs.yaml index 8476c90e51..cb91f8759f 100644 --- a/tests/functional/commands/validate/lib/models/sqs.yaml +++ b/tests/functional/commands/validate/lib/models/sqs.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: SQSFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/sqs_with_scaling_config.yaml b/tests/functional/commands/validate/lib/models/sqs_with_scaling_config.yaml new file mode 100644 index 0000000000..1f52b013d1 --- /dev/null +++ b/tests/functional/commands/validate/lib/models/sqs_with_scaling_config.yaml @@ -0,0 +1,16 @@ +Resources: + SQSFunction: + Type: AWS::Serverless::Function + Properties: + CodeUri: s3://sam-demo-bucket/queues.zip + Handler: queue.sqs_handler + Runtime: python2.7 + Events: + MySqsQueue: + Type: SQS + Properties: + Queue: arn:aws:sqs:us-west-2:012345678901:my-queue + BatchSize: 10 + Enabled: false + ScalingConfig: + MaximumConcurrency: 500 diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_api.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_api.yaml new file mode 100644 index 0000000000..0869955742 --- /dev/null +++ b/tests/functional/commands/validate/lib/models/state_machine_with_api.yaml @@ -0,0 +1,35 @@ +Transform: AWS::Serverless-2016-10-31 +Resources: + MyApi: + Type: AWS::Serverless::Api + Properties: + StageName: Prod + HelloWorldFunction: + Type: AWS::Serverless::Function + Properties: + InlineCode: | + def handler(event, context): + print(event) + return "do nothing" + Handler: index.handler + Runtime: python3.8 + Post: + Type: AWS::Serverless::StateMachine + Properties: + Policies: + - arn:aws:iam::aws:policy/AWSLambda_FullAccess + Definition: + StartAt: One + States: + One: + Type: Task + Resource: !GetAtt HelloWorldFunction.Arn + End: true + Events: + PostEcho: + Type: Api + Properties: + RestApiId: !Ref MyApi + Path: /echo + Method: POST + UnescapeMappingTemplate: true diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_api_auth_default_scopes.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_api_auth_default_scopes.yaml index 26ba5a5e53..c2fa27ea70 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_api_auth_default_scopes.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_api_auth_default_scopes.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApiWithCognitoAuth: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_api_authorizer.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_api_authorizer.yaml index 79b5ab5dce..ca26e8fd0d 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_api_authorizer.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_api_authorizer.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApi: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_api_authorizer_maximum.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_api_authorizer_maximum.yaml index 96d3d48f1d..50e9ed5b0c 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_api_authorizer_maximum.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_api_authorizer_maximum.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApi: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_api_resource_policy.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_api_resource_policy.yaml index 38ec5aa3cb..3fbd6a2167 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_api_resource_policy.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_api_resource_policy.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ExplicitApi: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_condition.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_condition.yaml index d5b49f51cc..dbba21a395 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_condition.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_condition.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: TestCondition: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_condition_and_events.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_condition_and_events.yaml index 86906ca075..8282292c7e 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_condition_and_events.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_condition_and_events.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Conditions: TestCondition: Fn::Equals: diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_cwe.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_cwe.yaml index 05d1d25165..c63210df47 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_cwe.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_cwe.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: StateMachine: Type: AWS::Serverless::StateMachine diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_definition_S3_object.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_definition_S3_object.yaml index b4cb79066c..3945c8d66b 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_definition_S3_object.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_definition_S3_object.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_definition_S3_string.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_definition_S3_string.yaml index 3532420c68..706c37f40c 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_definition_S3_string.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_definition_S3_string.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_definition_substitutions.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_definition_substitutions.yaml index 95f3df1b18..360fec7caf 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_definition_substitutions.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_definition_substitutions.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_eb_dlq.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_eb_dlq.yaml index 24d699a58e..aeaa564076 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_eb_dlq.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_eb_dlq.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: StateMachine: Type: AWS::Serverless::StateMachine diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_eb_dlq_generated.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_eb_dlq_generated.yaml index 9636ab416b..0779d8409b 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_eb_dlq_generated.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_eb_dlq_generated.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: StateMachine: Type: AWS::Serverless::StateMachine diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_eb_dlq_target_id.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_eb_dlq_target_id.yaml new file mode 100644 index 0000000000..77dd3dbc1a --- /dev/null +++ b/tests/functional/commands/validate/lib/models/state_machine_with_eb_dlq_target_id.yaml @@ -0,0 +1,18 @@ +Resources: + StateMachine: + Type: AWS::Serverless::StateMachine + Properties: + DefinitionUri: s3://sam-demo-bucket/my_state_machine.asl.json + Role: arn:${AWS::Partition}:iam::123456123456:role/service-role/SampleRole + Events: + CWEvent: + Type: EventBridgeRule + Properties: + Pattern: + detail: + state: + - terminated + DeadLetterConfig: + Arn: TestDlqArn + Target: + Id: MyTargetID diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_eb_retry_policy.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_eb_retry_policy.yaml index 4284fe5104..707c0ab48c 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_eb_retry_policy.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_eb_retry_policy.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: StateMachine: Type: AWS::Serverless::StateMachine diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_event_schedule_state.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_event_schedule_state.yaml index 9434753d4b..cf438eddee 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_event_schedule_state.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_event_schedule_state.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Transform: AWS::Serverless-2016-10-31 Resources: diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_explicit_api.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_explicit_api.yaml index 52fab2e4d7..f6fb38047b 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_explicit_api.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_explicit_api.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyApi: Type: AWS::Serverless::Api diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_express_logging.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_express_logging.yaml index 6c68a9f1ec..34a304c234 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_express_logging.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_express_logging.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_implicit_api.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_implicit_api.yaml index a232a10486..393e83e732 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_implicit_api.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_implicit_api.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: StateMachine: Type: AWS::Serverless::StateMachine diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_implicit_api_globals.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_implicit_api_globals.yaml index b4b8512e45..20ae85499e 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_implicit_api_globals.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_implicit_api_globals.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Globals: Api: Auth: diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_inline_definition.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_inline_definition.yaml index 81f6aae134..de21cd0c1f 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_inline_definition.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_inline_definition.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: StateMachine: Type: AWS::Serverless::StateMachine diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_inline_definition_intrinsics.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_inline_definition_intrinsics.yaml index 2b421b2288..2397572a58 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_inline_definition_intrinsics.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_inline_definition_intrinsics.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_inline_policies.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_inline_policies.yaml index 2b421b2288..2397572a58 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_inline_policies.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_inline_policies.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_managed_policy.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_managed_policy.yaml index 34748f53f7..d8ff0361fd 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_managed_policy.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_managed_policy.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: StateMachine: Type: AWS::Serverless::StateMachine diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_null_events.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_null_events.yaml index 7998fcab88..44fa9d2fd6 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_null_events.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_null_events.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: StateMachine: Type: AWS::Serverless::StateMachine diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_permissions_boundary.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_permissions_boundary.yaml index 97a232adf9..9e00dd1a4c 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_permissions_boundary.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_permissions_boundary.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_role.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_role.yaml index e1cd40ba5f..1d0885f5f0 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_role.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_role.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: StateMachine: Type: AWS::Serverless::StateMachine diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_role_path.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_role_path.yaml new file mode 100644 index 0000000000..784c17cf83 --- /dev/null +++ b/tests/functional/commands/validate/lib/models/state_machine_with_role_path.yaml @@ -0,0 +1,20 @@ +Resources: + MyBasicStateMachine: + Type: AWS::Serverless::StateMachine + Properties: + Type: STANDARD + Definition: + Comment: A Hello World example of the Amazon States Language using Pass states + StartAt: Hello + States: + Hello: + Type: Pass + Result: Hello + Next: World + World: + Type: Pass + Result: World + End: true + RolePath: /foo/bar/ +Metadata: + SamTransformTest: true diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_sam_policy_templates.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_sam_policy_templates.yaml index 89dbfb08a0..388ddea304 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_sam_policy_templates.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_sam_policy_templates.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: StarterLambda: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_schedule.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_schedule.yaml index b5608f1658..52ab2f0575 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_schedule.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_schedule.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: StateMachine: Type: AWS::Serverless::StateMachine diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_schedule_dlq_retry_policy.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_schedule_dlq_retry_policy.yaml index 98031f5c90..7d57b3d9dc 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_schedule_dlq_retry_policy.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_schedule_dlq_retry_policy.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: StateMachine: Type: AWS::Serverless::StateMachine diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_schedule_target_id.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_schedule_target_id.yaml new file mode 100644 index 0000000000..8c3d25dd29 --- /dev/null +++ b/tests/functional/commands/validate/lib/models/state_machine_with_schedule_target_id.yaml @@ -0,0 +1,35 @@ +Resources: + StateMachineFunction: + Type: AWS::Serverless::Function + Properties: + InlineCode: | + exports.handler = async (event) => { + console.log("Hello world!") + }; + Handler: index.handler + Runtime: nodejs14.x + + StateMachineIdWith30Characters: + Type: AWS::Serverless::StateMachine + Properties: + Type: STANDARD + Definition: + StartAt: MyLambdaState + States: + MyLambdaState: + Type: Task + Resource: !GetAtt StateMachineFunction.Arn + End: true + Policies: + - LambdaInvokePolicy: + FunctionName: !Ref StateMachineFunction + Events: + EventIdWith23Characters: + Type: Schedule + Properties: + Schedule: rate(1 minute) + Name: TestSchedule + Description: test schedule + Enabled: false + Target: + Id: MyTargetID diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_standard_logging.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_standard_logging.yaml index f2246a498e..abb0196d11 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_standard_logging.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_standard_logging.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_tags.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_tags.yaml index b86b3b1494..53eb533abd 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_tags.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_tags.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: StateMachine: Type: AWS::Serverless::StateMachine diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_xray_policies.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_xray_policies.yaml index be5b681cdd..0c64144d56 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_xray_policies.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_xray_policies.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MyFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_xray_role.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_xray_role.yaml index 3d03acdc43..f5e56e7294 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_xray_role.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_xray_role.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: StateMachine: Type: AWS::Serverless::StateMachine diff --git a/tests/functional/commands/validate/lib/models/streams.yaml b/tests/functional/commands/validate/lib/models/streams.yaml index 7420d82719..a362fa4943 100644 --- a/tests/functional/commands/validate/lib/models/streams.yaml +++ b/tests/functional/commands/validate/lib/models/streams.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: KinesisFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/translate_convert_metadata.yaml b/tests/functional/commands/validate/lib/models/translate_convert_metadata.yaml index 871539ea0e..0043cba6cf 100644 --- a/tests/functional/commands/validate/lib/models/translate_convert_metadata.yaml +++ b/tests/functional/commands/validate/lib/models/translate_convert_metadata.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: ThumbnailFunction: Type: AWS::Serverless::Function diff --git a/tests/functional/commands/validate/lib/models/unsupported_resources.yaml b/tests/functional/commands/validate/lib/models/unsupported_resources.yaml index f47abc949c..690b9994e3 100644 --- a/tests/functional/commands/validate/lib/models/unsupported_resources.yaml +++ b/tests/functional/commands/validate/lib/models/unsupported_resources.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: # These resources are NOT errors from the eye of translator. # Translator will simply ignore resources with unknown type in order to accept non-SAM resources diff --git a/tests/functional/commands/validate/lib/models/version_deletion_policy_precedence.yaml b/tests/functional/commands/validate/lib/models/version_deletion_policy_precedence.yaml index ca5b1434e7..0720b6999f 100644 --- a/tests/functional/commands/validate/lib/models/version_deletion_policy_precedence.yaml +++ b/tests/functional/commands/validate/lib/models/version_deletion_policy_precedence.yaml @@ -1,5 +1,3 @@ -%YAML 1.1 ---- Resources: MinimalFunction: Type: AWS::Serverless::Function diff --git a/tests/integration/validate/test_validate_command.py b/tests/integration/validate/test_validate_command.py index 6f6eef8586..2c931e4be7 100644 --- a/tests/integration/validate/test_validate_command.py +++ b/tests/integration/validate/test_validate_command.py @@ -152,7 +152,7 @@ def test_lint_invalid_template(self): command_result = run_command(self.command_list(lint=True, template_file=template_path)) output = command_result.stdout.decode("utf-8") # Remove Windows Line Endings for comparison. - output.replace("\r", "") + output = output.replace("\r", "") warning_message = ( 'E0000 Duplicate found "HelloWorldFunction" (line 5)\n'