Skip to content

Commit ebd64e3

Browse files
committed
Add dns outputs. Fix so can be disabled. Update tests
1 parent f4091dd commit ebd64e3

File tree

16 files changed

+132
-33
lines changed

16 files changed

+132
-33
lines changed

.tflint.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
config {
2-
terraform_version = "0.11.10"
2+
terraform_version = "0.11.11"
33
deep_check = true
44
ignore_module = {
55
"devops-workflow/boolean/local" = true

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ This software is released under the MIT License (see `LICENSE`).
120120
| Name | Description |
121121
|------|-------------|
122122
| container\_json | - |
123+
| lb\_dns\_name | FQDN of ALB provisioned for service (if present) |
124+
| lb\_zone\_id | Route 53 zone ID of ALB provisioned for service (if present) |
123125
| service\_iam\_role\_arn | ARN of the IAM Role for the ECS Service |
124126
| service\_iam\_role\_name | Name of the IAM Role for the ECS Task |
125127
| task\_iam\_role\_arn | ARN of the IAM Role for the ECS Task |

examples/basic/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,28 @@ terraform apply
1313
```
1414

1515
Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources.
16+
17+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
18+
## Inputs
19+
20+
| Name | Description | Type | Default | Required |
21+
|------|-------------|:----:|:-----:|:-----:|
22+
| account\_name | - | string | `appzen-test` | no |
23+
| environment | - | string | `mgmt` | no |
24+
| instance\_type | AWS Instance type, if you change, make sure it is compatible with AMI, not all AMIs allow all instance types | string | `m5.large` | no |
25+
| key\_name | SSH key name to use | string | `devops-2018-12-19` | no |
26+
| region | - | string | `us-east-1` | no |
27+
28+
## Outputs
29+
30+
| Name | Description |
31+
|------|-------------|
32+
| container\_json | - |
33+
| lb\_dns\_name | FQDN of ALB provisioned for service (if present) |
34+
| lb\_zone\_id | Route 53 zone ID of ALB provisioned for service (if present) |
35+
| service\_iam\_role\_arn | ARN of the IAM Role for the ECS Service |
36+
| service\_iam\_role\_name | Name of the IAM Role for the ECS Task |
37+
| task\_iam\_role\_arn | ARN of the IAM Role for the ECS Task |
38+
| task\_iam\_role\_name | Name of the IAM Role for the ECS Task |
39+
40+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/basic/data.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
data "aws_vpc" "vpc" {
2-
tags {
3-
Env = "${var.environment}"
2+
filter {
3+
name = "tag:Name"
4+
values = ["${var.account_name}-${var.environment}"]
45
}
56
}
67

examples/basic/main.tf

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module "ecs-cluster" {
22
source = "git::https://github.com/devops-workflow/terraform-aws-ecs-cluster.git"
33
name = "ecs-1"
4-
environment = "one"
4+
environment = "${var.environment}"
55
instance_type = "${var.instance_type}"
66
key_name = "${var.key_name}"
77
subnet_id = ["${data.aws_subnet_ids.private_subnet_ids.ids}"]
@@ -13,17 +13,18 @@ module "basic" {
1313
name = "basic"
1414
ecs_cluster_arn = "${module.ecs-cluster.cluster_id}"
1515
ecs_security_group_id = "${module.ecs-cluster.cluster_security_group_id}"
16-
environment = "one"
17-
organization = "wiser"
16+
environment = "${var.environment}"
17+
organization = "appzen"
1818

1919
#docker_registry = "105667981759.dkr.ecr.us-west-2.amazonaws.com/wiser"
2020
#docker_image = "map-application:latest"
2121
docker_image = "infrastructureascode/hello-world:latest"
2222

23-
app_port = 8080 # target group & container port
24-
lb_enable_http = true
25-
lb_internal = true
26-
lb_subnet_ids = ["${data.aws_subnet_ids.private_subnet_ids.ids}"]
27-
region = "${var.region}"
28-
vpc_id = "${data.aws_vpc.vpc.id}"
23+
app_port = 8080
24+
dns_parent_zone_name = "test.appzen.com" # target group & container port
25+
lb_enable_http = true
26+
lb_internal = true
27+
lb_subnet_ids = ["${data.aws_subnet_ids.private_subnet_ids.ids}"]
28+
region = "${var.region}"
29+
vpc_id = "${data.aws_vpc.vpc.id}"
2930
}

examples/basic/outputs.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
output "lb_dns_name" {
2+
description = "FQDN of ALB provisioned for service (if present)"
3+
value = "${module.basic.lb_dns_name}"
4+
}
5+
6+
output "lb_zone_id" {
7+
description = "Route 53 zone ID of ALB provisioned for service (if present)"
8+
value = "${module.basic.lb_zone_id}"
9+
}
10+
111
output "task_iam_role_arn" {
212
description = "ARN of the IAM Role for the ECS Task"
313
value = "${module.basic.task_iam_role_arn}"

examples/basic/providers.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
provider "aws" {
2-
region = "${var.region}"
2+
profile = "appzen-admin"
3+
region = "${var.region}"
34

45
# Make it faster by skipping something
56
skip_get_ec2_platforms = true
67
skip_metadata_api_check = true
78
skip_region_validation = true
89
skip_credentials_validation = true
910
skip_requesting_account_id = true
11+
12+
assume_role {
13+
role_arn = "arn:aws:iam::242413444216:role/OrganizationAccountAccessRole"
14+
}
1015
}

examples/basic/variables.tf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
variable "account_name" {
2+
default = "appzen-test"
3+
}
4+
15
variable "environment" {
2-
default = "one"
6+
default = "mgmt"
37
}
48

59
variable "key_name" {
610
description = "SSH key name to use"
7-
default = "devops20170606"
11+
default = "devops-2018-12-19"
812
}
913

1014
variable "region" {
11-
default = "us-west-2"
15+
default = "us-east-1"
1216
}
1317

1418
variable "instance_type" {

examples/disabled/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,27 @@ terraform apply
1515
```
1616

1717
Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources.
18+
19+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
20+
## Inputs
21+
22+
| Name | Description | Type | Default | Required |
23+
|------|-------------|:----:|:-----:|:-----:|
24+
| environment | - | string | `MGMT` | no |
25+
| instance\_type | AWS Instance type, if you change, make sure it is compatible with AMI, not all AMIs allow all instance types | string | `m5.large` | no |
26+
| key\_name | SSH key name to use | string | `devops20170606` | no |
27+
| region | - | string | `us-west-2` | no |
28+
29+
## Outputs
30+
31+
| Name | Description |
32+
|------|-------------|
33+
| container\_json | - |
34+
| lb\_dns\_name | FQDN of ALB provisioned for service (if present) |
35+
| lb\_zone\_id | Route 53 zone ID of ALB provisioned for service (if present) |
36+
| service\_iam\_role\_arn | ARN of the IAM Role for the ECS Service |
37+
| service\_iam\_role\_name | Name of the IAM Role for the ECS Task |
38+
| task\_iam\_role\_arn | ARN of the IAM Role for the ECS Task |
39+
| task\_iam\_role\_name | Name of the IAM Role for the ECS Task |
40+
41+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/disabled/data.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/*
12
data "aws_vpc" "vpc" {
23
tags {
34
Env = "${var.environment}"
@@ -16,3 +17,5 @@ data "aws_subnet" "private_subnets" {
1617
count = "${length(data.aws_subnet_ids.private_subnet_ids.ids)}"
1718
id = "${data.aws_subnet_ids.private_subnet_ids.ids[count.index]}"
1819
}
20+
/**/
21+

0 commit comments

Comments
 (0)