nlpsandbox / nlpsandbox-infra

AWS CloudFormation templates for deploying the NLP Sandbox infrastructure
Apache License 2.0
0 stars 1 forks source link

Add URL redirections setup to CloudFormation template #21

Closed tschaffter closed 3 years ago

tschaffter commented 3 years ago

About redirections, the final solution uses a single S3 bucket named nlpsandbox.io. Route 53 has two A records, nlpsandbox.io and www.nlpsandbox.io that both redirect to the CloudFront distribution connected to the S3 bucket.

tschaffter commented 3 years ago

Just noticed the description of the repo:

AWS CloudFormation template for deploying the NLP Sandbox benchmarking infrastructure

Since the redirections are not needed for the benchmarking infra, should this configuration live somewhere else?

thomasyu888 commented 3 years ago

I updated the description @tschaffter - the templates should definitely live in this repository. That being said, since the S3 bucket has been created already, the templates can't be added since it will cause a "s3 bucket already exists error".

tschaffter commented 3 years ago

@thomasyu888 Feel free to delete the bucket if needed. It's preferable to do this before the launch. For reference, the current redirection rules are listed below.

[
    {
        "Condition": {
            "KeyPrefixEquals": "tools/date-annotator/leaderboard"
        },
        "Redirect": {
            "HostName": "www.synapse.org",
            "HttpRedirectCode": "307",
            "Protocol": "https",
            "ReplaceKeyWith": "#!Synapse:syn22277123/wiki/608544"
        }
    },
    {
        "Condition": {
            "KeyPrefixEquals": "tools/person-name-annotator/leaderboard"
        },
        "Redirect": {
            "HostName": "www.synapse.org",
            "HttpRedirectCode": "307",
            "Protocol": "https",
            "ReplaceKeyWith": "#!Synapse:syn22277123/wiki/608545"
        }
    },
    {
        "Condition": {
            "KeyPrefixEquals": "tools/physical-address-annotator/leaderboard"
        },
        "Redirect": {
            "HostName": "www.synapse.org",
            "HttpRedirectCode": "307",
            "Protocol": "https",
            "ReplaceKeyWith": "#!Synapse:syn22277123/wiki/608546"
        }
    },
    {
        "Condition": {
            "KeyPrefixEquals": "discord"
        },
        "Redirect": {
            "HostName": "discord.gg",
            "HttpRedirectCode": "307",
            "Protocol": "https",
            "ReplaceKeyWith": "Zb4ymtF"
        }
    },
    {
        "Redirect": {
            "HostName": "www.synapse.org",
            "HttpRedirectCode": "307",
            "Protocol": "https",
            "ReplaceKeyWith": "nlpsandbox"
        }
    }
]
thomasyu888 commented 3 years ago

Cloudfront Distribution CNAMEs is not supported: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html. So will resort to the manual creation of the cloudfront resource.

tschaffter commented 3 years ago

@thomasyu888 The URL redirections are currently broken. I guess I may expect this as long as this ticket is open. I looked at the AWS account and so all the resources (R53 records, CF distribution, S3 buckets) and everything is there so I'm not sure why the redirections are broken.

thomasyu888 commented 3 years ago

@tschaffter The redirections are working again. The Cloudfront distribution was disabled - I thought I enabled it again, but my internet must have cut out.