Categorygithub.com/clowa/lambda-golang-redirect
module
0.0.0-20241226081931-8be36b0f8ae6
Repository: https://github.com/clowa/lambda-golang-redirect.git
Documentation: pkg.go.dev

# README

lambda-golang-redirect

Lightweight Configurable Lambda Redirection Service

Manage redirects using AWS Lambda functions.

Requirements

Installation

lambda-golang-redirect has a heavy dependency set listed above.

Once dependencies are met installation is a simple command:

```bash
$ make deploy
```

This will build the Go binaries and deploy everything to AWS Lambda.

Usage

  1. Run yarn install to download dependencies.

  2. Change provider configuration of serverless.yaml as needed.

    provider:
      name: aws
      runtime: go1.x
      region: eu-central-1
      architecture: arm64
      memorySize: 128
      stage: prod
      # Function environment variables
      environment:
        REDIRECT_TO: https://example.org # Change me
        HSTS_ENABLED: false
      # Duration for CloudWatch log retention (default: forever)
      logRetentionInDays: 7
      stackTags:
        app: ${self:service}
        stage: ${self:provider.stage}
        deploymentMethod: serverless
        repository: clowa/lambda-golang-redirect
    
    custom:
      domains:
        # References to 'prod' stage
        prod:
          domainName: clowa.de # Change me
          certificateName: clowa.de # Change me
    
      customCertificate:
        # Route 53 Hosted Zone name
        # don't forget the dot on the end!
        hostedZoneNames: "clowa.de." # Change me
    
  3. Run make deploy

Environment variables

VariableDefaultDescription
REDIRECT_TOhttps://example.orgURI of the redirect target
HSTS_ENABLEDtrueWether or not Strict-Transport-Security should be enabled
HSTS_MAX_AGE300 * 24 * 60 * 60 300 daysThe time, in seconds, that the browser should remember that a site is only to be accessed using HTTPS.
HSTS_INCLUDE_SUBDOMAINSfalseIf this parameter is true, this rule applies to all of the site's subdomains as well.
HSTS_PRELOADfalseSee Preloading Strict Transport Security for details. Not part of the specification.

Deployment

// todo

License

MIT

# Packages

No description provided by the author