Code Monkey home page Code Monkey logo

terraform-aws-http-redirect's Introduction

Neovops

Terraform AWS HTTP Redirect

Terraform module to create http 302 redirection.

This module creates:

  • a CloudFront distribution for all redirections
  • a CloudFront function for all redirections
  • an ACM certificate for all redirections
  • route53 record for each domain

Terraform registry

This module is available on terraform registry.

Requirements

The Route53 zone must already exists.

Providers

This module needs 3 providers:

  • aws - default provider for resources
  • aws.route53 - Where route53 zones already exist
  • aws.us-east-1 same account as aws, for acm certificate

This handle the use case where multiple aws accounts are used but it can be the same provider.

Examples

Simple

provider "aws" {
  region = "eu-west-1"
}

provider "aws" {
  alias  = "us-east-1"
  region = "us-east-1"
}

resource "aws_route53_zone" "neovops_io" {
  name = "neovops.io"
}

module "http-redirect" {
  source = "neovops/http-redirect/aws"

  redirect_mapping = {
     "www.neovops.io" = "neovops.io",
     "docs.neovops.io" = "neovops.io/docs"
  }

  dns_zone = aws_route53_zone.neovops_io.name

  providers = {
    aws           = aws
    aws.route53   = aws
    aws.us-east-1 = aws.us-east-1
  }
}

Requirements

Name Version
terraform >= 1.2.2
aws ~> 5.15

Providers

Name Version
aws ~> 5.15
aws.route53 ~> 5.15
aws.us-east-1 ~> 5.15

Modules

No modules.

Resources

Name Type
aws_acm_certificate.cert resource
aws_acm_certificate_validation.cert resource
aws_cloudfront_distribution.distribution resource
aws_cloudfront_function.redirect resource
aws_route53_record.cert_validation resource
aws_route53_record.main resource
aws_route53_zone.zone data source

Inputs

Name Description Type Default Required
custom_certificate_domains Custom certificate domains list(string) [] no
dns_zone Route53 DNS zone name string n/a yes
redirect_mapping Redirect mapping map(string) n/a yes
resources_name Resources name. Necessary for multiple instances of this module string "http-redirect" no

Outputs

No outputs.

terraform-aws-http-redirect's People

Contributors

nicolas-geniteau avatar

Watchers

 avatar

terraform-aws-http-redirect's Issues

Redirects indefinitely

I have setup your module in the following way

module "http-redirect" {
  source  = "neovops/http-redirect/aws"
  version = "0.3.0"

  redirect_mapping = {
    "www.oskar.com.pl" = "oskar.com.pl",
  }

  dns_zone = aws_route53_zone.oskar.name

  providers = {
    aws           = aws
    aws.route53   = aws
    aws.us-east-1 = aws.virginia
  }
}

Please visit website www.oskar.com.pl it will redirect indefinitely to the wrong address (https://www.oskar.com.pl/oskar.com.pl)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.