Skip to content

Commit

Permalink
Fix serverless deployment configuration for additional HTML pages
Browse files Browse the repository at this point in the history
  • Loading branch information
romeara committed Jun 5, 2019
1 parent 7c350f9 commit ef1bc89
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ custom:
empty: true
globs:
- '${self:provider.stage}.html'
- 'privacy-policy.html'
- 'terms.html'
- '**/images/**/*'
- '**/styles/**/*'

Expand Down Expand Up @@ -184,6 +186,74 @@ resources:
- "RootResourceId"
RestApiId:
Ref: "ApiGatewayRestApi"
PrivacyPolicy:
Type: "AWS::ApiGateway::Resource"
Properties:
RestApiId:
Ref: "ApiGatewayRestApi"
ParentId:
Fn::GetAtt:
- "ApiGatewayRestApi"
- "RootResourceId"
PathPart: "privacy-policy.html"
TermsOfService:
Type: "AWS::ApiGateway::Resource"
Properties:
RestApiId:
Ref: "ApiGatewayRestApi"
ParentId:
Fn::GetAtt:
- "ApiGatewayRestApi"
- "RootResourceId"
PathPart: "terms.html"
PrivacyPolicyGet:
Type: "AWS::ApiGateway::Method"
Properties:
ResourceId:
Ref: "PrivacyPolicy"
RestApiId:
Ref: "ApiGatewayRestApi"
ApiKeyRequired: false
AuthorizationType: NONE
HttpMethod: GET
MethodResponses:
- StatusCode: 200
ResponseParameters:
method.response.header.Content-Type: "'text/html'"
Integration:
Credentials: arn:aws:iam::#{AWS::AccountId}:role/${self:service}-${self:provider.stage}-us-east-1-readS3Role
IntegrationHttpMethod: GET
IntegrationResponses:
- StatusCode: 200
ResponseParameters:
method.response.header.Content-Type: "'text/html'"
PassthroughBehavior: WHEN_NO_MATCH
Type: AWS
Uri: arn:aws:apigateway:us-east-1:s3:path/${self:service}-${self:provider.stage}-statichomepagebucket/privacy-policy.html
TermsOfServiceGet:
Type: "AWS::ApiGateway::Method"
Properties:
ResourceId:
Ref: "TermsOfService"
RestApiId:
Ref: "ApiGatewayRestApi"
ApiKeyRequired: false
AuthorizationType: NONE
HttpMethod: GET
MethodResponses:
- StatusCode: 200
ResponseParameters:
method.response.header.Content-Type: "'text/html'"
Integration:
Credentials: arn:aws:iam::#{AWS::AccountId}:role/${self:service}-${self:provider.stage}-us-east-1-readS3Role
IntegrationHttpMethod: GET
IntegrationResponses:
- StatusCode: 200
ResponseParameters:
method.response.header.Content-Type: "'text/html'"
PassthroughBehavior: WHEN_NO_MATCH
Type: AWS
Uri: arn:aws:apigateway:us-east-1:s3:path/${self:service}-${self:provider.stage}-statichomepagebucket/terms.html
ImageList:
Type: "AWS::ApiGateway::Resource"
Properties:
Expand Down

0 comments on commit ef1bc89

Please sign in to comment.