|
1 |
| -> START INSTRUCTION FOR TECHNATIVE ENGINEERS |
| 1 | +# terraform-aws-route53-s3-http-redirect  |
2 | 2 |
|
3 |
| -# terraform-aws-module-template |
| 3 | +Implements creates a simple http url forwarding redirect using a route 53 alias |
| 4 | +records and a s3 bucket. |
4 | 5 |
|
5 |
| -Template for creating a new TerraForm AWS Module. For TechNative Engineers. |
| 6 | +This is the most simple method to create a HTTP redirect within AWS. |
6 | 7 |
|
7 |
| -## Instructions |
8 |
| - |
9 |
| -### Your Module Name |
10 |
| - |
11 |
| -Think hard and come up with the shortest descriptive name for your module. |
12 |
| -Look at competition in the [terraform |
13 |
| -registry](https://registry.terraform.io/). |
14 |
| - |
15 |
| -Your module name should be max. three words seperated by dashes. E.g. |
16 |
| - |
17 |
| -- html-form-action |
18 |
| -- new-account-notifier |
19 |
| -- budget-alarms |
20 |
| -- fix-missing-tags |
21 |
| - |
22 |
| -### Setup Github Project |
23 |
| - |
24 |
| -1. Click the template button on the top right... |
25 |
| -2. Name github project `terraform-aws-[your-module-name]` |
26 |
| -3. Make project private untill ready for publication |
27 |
| -2. Install `pre-commit` |
28 |
| - |
29 |
| -### Develop your module |
30 |
| - |
31 |
| -1. Develop your module |
32 |
| -2. Try to use the [best practices for TerraForm |
33 |
| - development](https://www.terraform-best-practices.com/) and [TerraForm AWS |
34 |
| - Development](https://github.com/ozbillwang/terraform-best-practices). |
35 |
| - |
36 |
| -## Finish project documentation |
| 8 | +[](https://www.technative.nl) |
37 | 9 |
|
38 |
| -1. Set well written title |
39 |
| -2. Add one or more shields |
40 |
| -3. Start readme with a short and complete as possible module description. This |
41 |
| - is the part where you sell your module. |
42 |
| -4. Complete README with well written documentation. Try to think as a someone |
43 |
| - with three months of Terraform experience. |
44 |
| -5. Check if pre-commit correctly generates the standard Terraform documentation. |
| 10 | +## How does it work |
45 | 11 |
|
46 |
| -## Publish module |
| 12 | +This module creates a S3 bucket and a Route 53 A record. |
47 | 13 |
|
48 |
| -If your module is in a state that it could be useful for others and ready for |
49 |
| -publication, you can publish a first version. |
| 14 | +The S3 bucket is empty and has a website configuration which redirects all |
| 15 | +traffic to the target url. |
50 | 16 |
|
51 |
| -1. Create a [Github |
52 |
| - Release](https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases) |
53 |
| -2. Publish in the TerraForm Registry under the Technative Namespace (the GitHub |
54 |
| - Repo must be in the TechNative Organization) |
| 17 | +The Route 53 A record will alias to the S3 endpoint. |
55 | 18 |
|
56 |
| ---- |
| 19 | +## Usage |
57 | 20 |
|
58 |
| -> END INSTRUCTION FOR TECHNATIVE ENGINEERS |
| 21 | +``` |
| 22 | +module "redirect_technative_nl_techdd" { |
| 23 | + source = "Technative-B-V/terraform-aws-route53-s3-http-redirect/aws" |
| 24 | + version = "0.1.0" |
59 | 25 |
|
| 26 | + zone_name = "example.com" # THIS ZONE SHOULD EXIST IN ROUTE53 |
| 27 | + domain_name = "sample-google-form.example.com" |
| 28 | + redirect_target_url = "https://docs.google.com/forms/d/e/1FAIpQLSeI8_vYyaJgM7SJM4Y9AWfLq-tglWZh6yt7bEXEOJr_L-hV1A/viewform?formkey=dGx0b1ZrTnoyZDgtYXItMWVBdVlQQWc6MQ" |
| 29 | +} |
| 30 | +``` |
60 | 31 |
|
61 |
| -# Terraform AWS [Module Name]  |
| 32 | +<!-- BEGIN_TF_DOCS --> |
| 33 | +## Providers |
62 | 34 |
|
63 |
| -<!-- SHIELDS --> |
| 35 | +| Name | Version | |
| 36 | +|------|---------| |
| 37 | +| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0.0 | |
64 | 38 |
|
65 |
| -This module implements ... |
| 39 | +## Modules |
66 | 40 |
|
67 |
| -[](https://www.technative.nl) |
| 41 | +| Name | Source | Version | |
| 42 | +|------|--------|---------| |
| 43 | +| <a name="module_route53_http_redirect_target_url"></a> [route53\_http\_redirect\_target\_url](#module\_route53\_http\_redirect\_target\_url) | TechNative-B-V/url-parser/null | 0.1.1 | |
68 | 44 |
|
69 |
| -## How does it work |
| 45 | +## Resources |
70 | 46 |
|
71 |
| -... |
| 47 | +| Name | Type | |
| 48 | +|------|------| |
| 49 | +| [aws_route53_record.domains](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource | |
| 50 | +| [aws_s3_bucket.route53_http_redirect_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource | |
| 51 | +| [aws_s3_bucket_website_configuration.route53_http_redirect_webconf](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration) | resource | |
| 52 | +| [aws_route53_zone.route53_http_redirect_zone](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source | |
72 | 53 |
|
73 |
| -## Usage |
| 54 | +## Inputs |
74 | 55 |
|
75 |
| -To use this module ... |
| 56 | +| Name | Description | Type | Default | Required | |
| 57 | +|------|-------------|------|---------|:--------:| |
| 58 | +| <a name="input_domain_name"></a> [domain\_name](#input\_domain\_name) | Domain to provide the redirect including subdomain if applicable | `string` | n/a | yes | |
| 59 | +| <a name="input_redirect_target_url"></a> [redirect\_target\_url](#input\_redirect\_target\_url) | Redirect target - should be a full URL. If http:// or https:// is excluded, the scheme of the request will be used | `string` | n/a | yes | |
| 60 | +| <a name="input_zone_name"></a> [zone\_name](#input\_zone\_name) | Domain name of the Route53 hosted zone | `string` | n/a | yes | |
76 | 61 |
|
77 |
| -```json |
78 |
| -{ |
79 |
| - "some_conf": "might need explanation" |
80 |
| -} |
81 |
| -``` |
| 62 | +## Outputs |
82 | 63 |
|
83 |
| -<!-- BEGIN_TF_DOCS --> |
| 64 | +No outputs. |
84 | 65 | <!-- END_TF_DOCS -->
|
0 commit comments