Skip to content

Commit

Permalink
fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gidsg committed Feb 3, 2025
1 parent e8129dc commit 3693fb0
Showing 1 changed file with 31 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,35 @@ Parameters:
Type: String
Description: The environment name your service, job, or workflow is being deployed to.

Resources:
CommunitiesRedirect:
Type: AWS::CloudFront::Function
Properties:
Name: CommunitiesRedirect
AutoPublish: false
FunctionCode: |
function handler(event) {
const host = event.request.headers.host.value;
const uri = event.request.uri;
var newUrl;
if (host == 'frontend.dev.access-funding.test.levellingup.gov.uk')
newUrl = `https://example.com${uri}`;
var response = {
statusCode: 302,
statusDescription: "Moved Temporarily",
headers: {
"location": {
value: newUrl,
},
},
};
return response;
}
Resources:
CommunitiesRedirect:
Type: AWS::CloudFront::Function
Properties:
Name: CommunitiesRedirect
AutoPublish: false
FunctionCode: |
function handler(event) {
const host = event.request.headers.host.value;
const uri = event.request.uri;
FunctionConfig:
Comment: Redirects to the communities.gov.uk domains
Runtime: cloudfront-js-2.0
Outputs:
CommunitiesRedirectArn:
Description: The ARN of the CloudFront function.
Value: !GetAtt CommunitiesRedirect.FunctionARN
var newUrl;
if (host == 'frontend.dev.access-funding.test.levellingup.gov.uk')
newUrl = `https://example.com${uri}`;
var response = {
statusCode: 302,
statusDescription: "Moved Temporarily",
headers: {
"location": {
value: newUrl,
},
},
};
return response;
}
FunctionConfig:
Comment: Redirects to the communities.gov.uk domains
Runtime: cloudfront-js-2.0
Outputs:
CommunitiesRedirectArn:
Description: The ARN of the CloudFront function.
Value: !GetAtt CommunitiesRedirect.FunctionARN

0 comments on commit 3693fb0

Please sign in to comment.