These are the input parameters for this template. All of these parameters must be supplied for this template to be deployed.
RedirectURL is the URL that the site will redirect all non-login requests to
EmailForSNSSubscription is the email address to use for the SNS subscription
S3BucketName name of the S3 bucket (created in template 1 of 2)
WebServerInstanceType is the instance type to use for EC2 instance
AMI to use for the Windows EC2 instance
Key Pair to be used on the EC2 instance (for retrieving the Windows administrator password)
VPCID is the ID of the VPC where this template will be deployed.
PublicSubnetA is the public Subnet ID for us-west-2a
PublicSubnetB is the public Subnet ID for us-west-2b
PrivateSubnetA is the private Subnet ID for us-west-2a
PrivateSubnetB is the private Subnet ID for us-west-2b
HostedDNSZoneName is the named of the DNS hosted zone
SSLCertARN is the ARN of the SSL certificate to use for the ELB
Tags
Metadata is mostly for organizing and presenting Parameters in a better way when using CloudFormation in the AWS Web UI.
EC2 Security Group for the Elastic Load Balancer (ELB)
EC2 Security Group for the web server
- includes ASG, Scaling Policy, Launch Config & CW Alarms
Launch Configuration
$environmentName = "tst" #~~~ swap when in the CloudFormation template
$redirectURL = "https://it.arizona.edu/service/ua-computer-based-training" #~~~ swap when in the CloudFormation template
$s3bucket = "edu-arizona-pilots-uacbt-tst" #~~~ swap when in CloudFormation template
Install Windows features
Download and install MSIs
Testing revealed just how subject to change vendor URLs are so we'll maintain the MSIs ourselves in our S3 bucket (New-Object System.Net.WebClient).DownloadFile($msiInstalls.Item($msi), (Join-Path -Path $rootBootstrap -ChildPath "$($msi).msi"))
Make folders for web content
Create the web site, app pool & enable 32-bit apps on the app pool NOTE: forcing sort to get a consistent IIS site Id for use with Shibboleth SP
Create a separate web application at /login for UACBT authentication code
Set default IIS logging folder
Download zipped apps from S3
Unzip zipped app & delete zip when done
Download Shibboleth configuration from S3
Override lock & set config for an ISAPI filter on UACBT site for Shibboleth
Override lock & set config for an ISAPI & CGI Restrictions for Shibboleth
Add a Handler Mapping for Shibboleth
Add a default document to the "login" application
Create UrlRewrite rules to redirect HTTP>HTTPS
Redirect all traffic to the UACBT service page on the IT website
Disable redirect for the "login" application
Create a default document on the Default Web Site for the ELB health check (lest you end up with 403.14 errors)
Restart Shibboleth service (so that config changes take effect)
Perform an IISReset (else the Shibboleth ISAPI filter won't load)
Download PowerShell scripts and schedule a task to cleanup the IIS logs
Download CloudWatch Logs JSON configuration file, modify to update target Log Group, restart SSM Agent to take effect
Get the instanceId & availiability zone
Assign a "Name" tag to the instance to be friendly to the console UI
Auto Scaling Group
- Includes ELB, target group & listeners
ELB itself
ELB Target Group
ELB Listeners
SNS Topic
- Includes Log Group & SSM Document
CloudWatch Log Group
IAM Roles
IAM Instance Profiles
IAM Policies
Route53 Record Set Group
Output values that can be viewed from the AWS CloudFormation console.
CloudFormation template for UACBT (Computer-Based Training) authentication server (2 of 2)