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