diff --git a/requirements/base.txt b/requirements/base.txt index 6e060043b9..5d6c01573b 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -6,7 +6,7 @@ boto3>=1.19.5,==1.* jmespath~=0.10.0 PyYAML~=5.3 cookiecutter~=2.1.1 -aws-sam-translator==1.47.0 +aws-sam-translator==1.48.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 499abaa629..12e2bcc7cc 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -17,10 +17,10 @@ aws-lambda-builders==1.18.0 \ --hash=sha256:c0bd4b4288f0aa9cba27493065f5fb986425b5b49620b93a391620403eeb97e0 \ --hash=sha256:c5235699d36b8edda7e649fbc3a23ed868eda1e15c4a83528df33939bdb75754 # via aws-sam-cli (setup.py) -aws-sam-translator==1.47.0 \ - --hash=sha256:7bf8e8564cbbdcb1a3a71e6bd8551b4f8488014c5a4d67af5e92d0966c3b1ef8 \ - --hash=sha256:d2fe471a126f58a28ef505d03ea2d37a2f282312ce592a3250f4d8c8efca6946 \ - --hash=sha256:e42f33d736fdfccd0b38e70a550e2f7eaebbad75dabe697dd40ad16380d11699 +aws-sam-translator==1.48.0 \ + --hash=sha256:7171037323dfa30f8f73e9bccb9210e4c384a585e087219a9518a5204f0a2c44 \ + --hash=sha256:be18dfa3dfe7ab291d281667c5f73ac62dbe6bfe86df7d122e4258b906b736f0 \ + --hash=sha256:ca4f8f9910d7713aeaba59346775bfb3198f6acb47c6704572f9bd3fc0fb5bf0 # via aws-sam-cli (setup.py) backports-zoneinfo==0.2.1 \ --hash=sha256:17746bd546106fa389c51dbea67c8b7c8f0d14b5526a579ca6ccf5ed72c526cf \ 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 new file mode 100644 index 0000000000..6bfe59c91e --- /dev/null +++ b/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_multiple.yaml @@ -0,0 +1,67 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: AWS::Serverless-2016-10-31 +Description: > + apigateway-2402 + + Sample SAM Template for apigateway-2402 + +Resources: + + ApiGatewayAdminOne: + Type: AWS::Serverless::Api + Properties: + Name: App-Prod-Web + StageName: Prod + TracingEnabled: true + MethodSettings: + - LoggingLevel: Info + ResourcePath: '/*' + HttpMethod: '*' + Domain: + DomainName: admin.one.amazon.com + CertificateArn: arn::cert::abc + EndpointConfiguration: REGIONAL + Route53: + HostedZoneId: "abc123456" + EndpointConfiguration: + Type: REGIONAL + + + ApiGatewayAdminTwo: + Type: AWS::Serverless::Api + Properties: + Name: App-Prod-Web + StageName: Prod + TracingEnabled: true + MethodSettings: + - LoggingLevel: Info + ResourcePath: '/*' + HttpMethod: '*' + Domain: + DomainName: admin.two.amazon.com + CertificateArn: arn::cert::abc + EndpointConfiguration: REGIONAL + Route53: + HostedZoneId: "abc123456" + EndpointConfiguration: + Type: REGIONAL + + + ApiGatewayAdminThree: + Type: AWS::Serverless::Api + Properties: + Name: App-Prod-Web + StageName: Prod + TracingEnabled: true + MethodSettings: + - LoggingLevel: Info + ResourcePath: '/*' + HttpMethod: '*' + Domain: + DomainName: admin.three.amazon.com + CertificateArn: arn::cert::abc + EndpointConfiguration: REGIONAL + Route53: + HostedZoneId: "abc123456" + EndpointConfiguration: + Type: REGIONAL 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 new file mode 100644 index 0000000000..bb0eaf6b27 --- /dev/null +++ b/tests/functional/commands/validate/lib/models/api_with_custom_domain_route53_multiple_intrinsic_hostedzoneid.yaml @@ -0,0 +1,71 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: AWS::Serverless-2016-10-31 +Description: > + apigateway-2402 + + Sample SAM Template for apigateway-2402 + +Parameters: + MyHostedZoneId: + Type: String + +Resources: + + ApiGatewayAdminOne: + Type: AWS::Serverless::Api + Properties: + Name: App-Prod-Web + StageName: Prod + TracingEnabled: true + MethodSettings: + - LoggingLevel: Info + ResourcePath: '/*' + HttpMethod: '*' + Domain: + DomainName: admin.one.amazon.com + CertificateArn: arn::cert::abc + EndpointConfiguration: REGIONAL + Route53: + HostedZoneId: !Ref MyHostedZoneId + EndpointConfiguration: + Type: REGIONAL + + + ApiGatewayAdminTwo: + Type: AWS::Serverless::Api + Properties: + Name: App-Prod-Web + StageName: Prod + TracingEnabled: true + MethodSettings: + - LoggingLevel: Info + ResourcePath: '/*' + HttpMethod: '*' + Domain: + DomainName: admin.two.amazon.com + CertificateArn: arn::cert::abc + EndpointConfiguration: REGIONAL + Route53: + HostedZoneId: !Sub "{{MyHostedZoneId}}" + EndpointConfiguration: + Type: REGIONAL + + + ApiGatewayAdminThree: + Type: AWS::Serverless::Api + Properties: + Name: App-Prod-Web + StageName: Prod + TracingEnabled: true + MethodSettings: + - LoggingLevel: Info + ResourcePath: '/*' + HttpMethod: '*' + Domain: + DomainName: admin.three.amazon.com + CertificateArn: arn::cert::abc + EndpointConfiguration: REGIONAL + Route53: + HostedZoneId: !Ref MyHostedZoneId + EndpointConfiguration: + Type: REGIONAL 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 new file mode 100644 index 0000000000..354eeaf761 --- /dev/null +++ b/tests/functional/commands/validate/lib/models/api_with_fail_on_warnings.yaml @@ -0,0 +1,22 @@ +Resources: + ApiGatewayApi: + Type: AWS::Serverless::Api + Properties: + StageName: prod + FailOnWarnings: true + ApiFunction: # Adds a GET api endpoint at "/" to the ApiGatewayApi via an Api event + Type: AWS::Serverless::Function + Properties: + Events: + ApiEvent: + Type: Api + Properties: + Path: / + Method: get + RestApiId: + Ref: ApiGatewayApi + Runtime: python3.7 + Handler: index.handler + InlineCode: | + def handler(event, context): + return {'body': 'Hello World!', 'statusCode': 200} 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 new file mode 100644 index 0000000000..21832b61dd --- /dev/null +++ b/tests/functional/commands/validate/lib/models/http_api_with_custom_domain_route53_multiple.yaml @@ -0,0 +1,30 @@ +Resources: + MyApi1: + Type: AWS::Serverless::HttpApi + Properties: + Domain: + DomainName: admin.one.amazon.com + CertificateArn: arn::cert::abc + EndpointConfiguration: REGIONAL + Route53: + HostedZoneId: "abc123456" + + MyApi2: + Type: AWS::Serverless::HttpApi + Properties: + Domain: + DomainName: admin.two.amazon.com + CertificateArn: arn::cert::abc + EndpointConfiguration: REGIONAL + Route53: + HostedZoneId: "abc123456" + + MyApi3: + Type: AWS::Serverless::HttpApi + Properties: + Domain: + DomainName: admin.three.amazon.com + CertificateArn: arn::cert::abc + EndpointConfiguration: REGIONAL + Route53: + HostedZoneId: "abc123456" \ No newline at end of file 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 new file mode 100644 index 0000000000..7461e530cb --- /dev/null +++ b/tests/functional/commands/validate/lib/models/mixed_api_with_custom_domain_route53_multiple.yaml @@ -0,0 +1,36 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: AWS::Serverless-2016-10-31 +Description: > + apigateway-2402 + + Sample SAM Template for apigateway-2402 + +Resources: + MyHttpApi: + Type: AWS::Serverless::HttpApi + Properties: + Domain: + DomainName: admin.one.amazon.com + CertificateArn: arn::cert::abc + EndpointConfiguration: REGIONAL + Route53: + HostedZoneId: "abc123456" + + MyRestApi: + Type: AWS::Serverless::Api + Properties: + Name: App-Prod-Web + StageName: Prod + TracingEnabled: true + MethodSettings: + - LoggingLevel: Info + ResourcePath: '/*' + HttpMethod: '*' + Domain: + DomainName: admin.two.amazon.com + CertificateArn: arn::cert::abc + EndpointConfiguration: REGIONAL + Route53: + HostedZoneId: "abc123456" + EndpointConfiguration: + Type: REGIONAL