-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.tf
58 lines (52 loc) · 1.25 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* # aws-terraform-route53_internal_zone
*
* This module creates an internal Route53 zone.
*
* ## Basic Usage
*
* ```HCL
* module "internal_zone" {
* source = "[email protected]:rackspace-infrastructure-automation/aws-terraform-route53_internal_zone//?ref=v0.12.0"
*
* name = "customer.local"
* vpc_id = "vpc-12345678901234567"
* }
*
* ```
*
* Full working references are available at [examples](examples)
*
* ## Terraform 0.12 upgrade
*
* Several changes were required while adding terraform 0.12 compatibility. The following changes should be
* made when upgrading from a previous release to version 0.12.0 or higher.
*
* ### Module variables
*
* The following module variables were updated to better meet current Rackspace style guides:
*
* - `custom_tags` -> `tags`
* - `target_vpc_id` -> `vpc_id`
* - `zone_name` -> `name`
*/
terraform {
required_version = ">= 0.12"
required_providers {
aws = ">= 2.7.0"
}
}
locals {
module_tags = {
Environment = var.environment
ServiceProvider = "Rackspace"
}
}
resource "aws_route53_zone" "internal_zone" {
comment = "Hosted zone for ${var.environment}"
name = lower(var.name)
tags = merge(var.tags, local.module_tags)
vpc {
vpc_id = var.vpc_id
}
}