From ef3d7402de9468618131bc32a2df24914f12cb9d Mon Sep 17 00:00:00 2001 From: Sumita Canopas Date: Thu, 15 Feb 2024 14:32:31 +0530 Subject: [PATCH] Add routes in api gateway --- .github/workflows/deploy-frontend-dev.yml | 3 ++- .github/workflows/deploy-frontend-prod.yml | 3 ++- infrastructure/frontend.yml | 26 ++++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-frontend-dev.yml b/.github/workflows/deploy-frontend-dev.yml index 46bfe9d46..73d9885d7 100644 --- a/.github/workflows/deploy-frontend-dev.yml +++ b/.github/workflows/deploy-frontend-dev.yml @@ -47,4 +47,5 @@ jobs: no-fail-on-empty-changeset: "1" parameter-overrides: >- EnvName=dev, - ZipFileName=canopas_website_SSR_dev_${{ github.sha }}-${{ github.run_attempt }}.zip + ZipFileName=canopas_website_SSR_dev_${{ github.sha }}-${{ github.run_attempt }}.zip, + CloudfrontURL=${{ secrets.CLOUDFRONT_URL_VALUE_DEV }} diff --git a/.github/workflows/deploy-frontend-prod.yml b/.github/workflows/deploy-frontend-prod.yml index 39f3871df..ec60bbe44 100644 --- a/.github/workflows/deploy-frontend-prod.yml +++ b/.github/workflows/deploy-frontend-prod.yml @@ -53,4 +53,5 @@ jobs: no-fail-on-empty-changeset: "1" parameter-overrides: >- EnvName=prod, - ZipFileName=canopas_website_SSR_prod_${{ github.sha }}-${{ github.run_attempt }}.zip + ZipFileName=canopas_website_SSR_prod_${{ github.sha }}-${{ github.run_attempt }}.zip, + CloudfrontURL=${{ secrets.CLOUDFRONT_URL_VALUE_PROD }} diff --git a/infrastructure/frontend.yml b/infrastructure/frontend.yml index adfb80e28..43fcb184d 100644 --- a/infrastructure/frontend.yml +++ b/infrastructure/frontend.yml @@ -17,6 +17,9 @@ Parameters: ZipFileName: Type: String Description: Name of the zip file. + CloudfrontURL: + Type: String + Description: Cloudfront URL. Resources: HttpApi: @@ -27,6 +30,29 @@ Resources: Fn::Sub: canopas-website-ssr-frontend-${EnvName} Description: Fn::Sub: Canopas Website SSR Frontend API ${EnvName} + DefinitionBody: + openapi: "3.0.1" + info: + title: + Fn::Sub: canopas-website-ssr-frontend-${EnvName} + version: "1.0" + paths: + /sitemap.xml: + any: + x-amazon-apigateway-integration: + uri: + Fn::Sub: "${CloudfrontURL}/sitemap.xml" + httpMethod: "ANY" + /robots.txt: + any: + x-amazon-apigateway-integration: + uri: "${CloudfrontURL}/robots.txt" + httpMethod: "ANY" + /apple-touch-icon.png: + any: + x-amazon-apigateway-integration: + uri: "${CloudfrontURL}/apple-touch-icon.png" + httpMethod: "ANY" HttpApiFunction: Type: AWS::Serverless::Function