toolshed-redirects.yaml
---

Toolshed Redirection Hosts

This CloudFormation template will create a set of redirection rules for a load balancer which will handle a variety of legacy hostnames and URLs.

AWSTemplateFormatVersion: '2010-09-09' Description: Toolshed ECS Reidrection Rules

Parameters

These are the input parameters for this template. All of these parameters must be supplied for this template to be deployed.

Parameters:

Name of the ECS Base CloudFormation Stack.

BaseStackName: Type: String Description: "ECS Base Stack Name" Default: "toolshed-ecs"

Metadata

Metadata is mostly for organizing and presenting Parameters in a better way when using CloudFormation in the AWS Web UI.

Metadata: AWS::CloudFormation::Interface: ParameterGroups: - Label: default: Application Information Parameters: - BaseStackName

Resources

These are all of the actual AWS resources created for this application.

Resources:

Redirection Rule for box.arizona.edu --> arizona.box.com

ListenerRuleBox: Type: AWS::ElasticLoadBalancingV2::ListenerRule Properties: Actions: - Type: redirect RedirectConfig: Host: 'arizona.box.com' Path: '/#{path}' Port: '#{port}' Protocol: HTTPS Query: '#{query}' StatusCode: HTTP_301 Conditions: - Field: host-header Values: - "box.arizona.edu" ListenerArn: Fn::ImportValue: !Sub "${BaseStackName}-alb-listener" Priority: 900

Redirection Rule for catmailoptin.arizona.edu --> account.arizona.edu

ListenerRuleCatmail: Type: AWS::ElasticLoadBalancingV2::ListenerRule Properties: Actions: - Type: redirect RedirectConfig: Host: 'account.arizona.edu' Path: '/#{path}' Port: '#{port}' Protocol: HTTPS Query: '#{query}' StatusCode: HTTP_301 Conditions: - Field: host-header Values: - "catmailoptin.arizona.edu" ListenerArn: Fn::ImportValue: !Sub "${BaseStackName}-alb-listener" Priority: 902

Redirection Rule for netid-request.arizona.edu --> siaapps.uits.arizona.edu/home/?tab=webauthtab

ListenerRuleNetidReq: Type: AWS::ElasticLoadBalancingV2::ListenerRule Properties: Actions: - Type: redirect RedirectConfig: Host: 'siaapps.uits.arizona.edu' Path: '/home/' Port: '#{port}' Protocol: HTTPS Query: 'tab=webauthtab' StatusCode: HTTP_301 Conditions: - Field: host-header Values: - "netid-request.arizona.edu" ListenerArn: Fn::ImportValue: !Sub "${BaseStackName}-alb-listener" Priority: 904

Redirection Rule for migrate.list.arizona.edu --> it.arizona.edu/service/email-lists-sympa

ListenerRuleMigrateList: Type: AWS::ElasticLoadBalancingV2::ListenerRule Properties: Actions: - Type: redirect RedirectConfig: Host: 'it.arizona.edu' Path: '/service/email-lists-sympa' Port: '#{port}' Protocol: HTTPS Query: '#{query}' StatusCode: HTTP_301 Conditions: - Field: host-header Values: - "migrate.list.arizona.edu" ListenerArn: Fn::ImportValue: !Sub "${BaseStackName}-alb-listener" Priority: 906

Redirection Rule for edslookup.uits.arizona.edu --> toolshed.uits.arizona.edu/lookup/eds

ListenerRuleEDSLookup: Type: AWS::ElasticLoadBalancingV2::ListenerRule Properties: Actions: - Type: redirect RedirectConfig: Host: 'toolshed.uits.arizona.edu' Path: '/lookup/eds' Port: '#{port}' Protocol: HTTPS Query: '#{query}' StatusCode: HTTP_301 Conditions: - Field: host-header Values: - "edslookup.uits.arizona.edu" ListenerArn: Fn::ImportValue: !Sub "${BaseStackName}-alb-listener" Priority: 908

Redirection Rule for uaperson.uits.arizona.edu --> account.arizona.edu/uaperson

ListenerRuleUAPerson: Type: AWS::ElasticLoadBalancingV2::ListenerRule Properties: Actions: - Type: redirect RedirectConfig: Host: 'account.arizona.edu' Path: '/uaperson' Port: '#{port}' Protocol: HTTPS Query: '#{query}' StatusCode: HTTP_301 Conditions: - Field: host-header Values: - "uaperson.uits.arizona.edu" ListenerArn: Fn::ImportValue: !Sub "${BaseStackName}-alb-listener" Priority: 910