Skip to content

Commit b1c0326

Browse files
committed
Fix new outputs and test
1 parent 34ecc68 commit b1c0326

File tree

11 files changed

+109
-23
lines changed

11 files changed

+109
-23
lines changed

examples/basic/README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,24 @@ Note that this example may create resources which cost money. Run `terraform des
1919

2020
| Name | Description | Type | Default | Required |
2121
|------|-------------|:----:|:-----:|:-----:|
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 |
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 |
2727

2828
## Outputs
2929

3030
| Name | Description |
3131
|------|-------------|
32-
| container\_json | - |
32+
| cluster\_arn | ECS cluster ARN |
33+
| container\_json | |
3334
| lb\_dns\_name | FQDN of ALB provisioned for service (if present) |
3435
| lb\_zone\_id | Route 53 zone ID of ALB provisioned for service (if present) |
36+
| service\_arn | ECS service ARN |
3537
| service\_iam\_role\_arn | ARN of the IAM Role for the ECS Service |
3638
| service\_iam\_role\_name | Name of the IAM Role for the ECS Task |
39+
| service\_name | ECS service name |
3740
| task\_iam\_role\_arn | ARN of the IAM Role for the ECS Task |
3841
| task\_iam\_role\_name | Name of the IAM Role for the ECS Task |
3942

examples/basic/outputs.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ output "service_iam_role_name" {
2828
value = "${module.basic.service_iam_role_name}"
2929
}
3030

31+
output "cluster_arn" {
32+
description = "ECS cluster ARN"
33+
value = "${module.basic.cluster_arn}"
34+
}
35+
36+
output "service_arn" {
37+
description = "ECS service ARN"
38+
value = "${module.basic.service_arn}"
39+
}
40+
41+
output "service_name" {
42+
description = "ECS service name"
43+
value = "${module.basic.service_name}"
44+
}
45+
3146
output "container_json" {
3247
description = ""
3348
value = "${module.basic.container_json}"

examples/basic/providers.tf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
provider "aws" {
2-
profile = "appzen-admin"
2+
profile = "appzen-test"
33
region = "${var.region}"
44

55
# Make it faster by skipping something
@@ -8,8 +8,4 @@ provider "aws" {
88
skip_region_validation = true
99
skip_credentials_validation = true
1010
skip_requesting_account_id = true
11-
12-
assume_role {
13-
role_arn = "arn:aws:iam::242413444216:role/OrganizationAccountAccessRole"
14-
}
1511
}

examples/disabled/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,23 @@ Note that this example may create resources which cost money. Run `terraform des
2121

2222
| Name | Description | Type | Default | Required |
2323
|------|-------------|:----:|:-----:|:-----:|
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 |
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 |
2828

2929
## Outputs
3030

3131
| Name | Description |
3232
|------|-------------|
33-
| container\_json | - |
33+
| cluster\_arn | ECS cluster ARN |
34+
| container\_json | |
3435
| lb\_dns\_name | FQDN of ALB provisioned for service (if present) |
3536
| lb\_zone\_id | Route 53 zone ID of ALB provisioned for service (if present) |
37+
| service\_arn | ECS service ARN |
3638
| service\_iam\_role\_arn | ARN of the IAM Role for the ECS Service |
3739
| service\_iam\_role\_name | Name of the IAM Role for the ECS Task |
40+
| service\_name | ECS service name |
3841
| task\_iam\_role\_arn | ARN of the IAM Role for the ECS Task |
3942
| task\_iam\_role\_name | Name of the IAM Role for the ECS Task |
4043

examples/disabled/outputs.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ output "service_iam_role_name" {
2828
value = "${module.disabled.service_iam_role_name}"
2929
}
3030

31+
output "cluster_arn" {
32+
description = "ECS cluster ARN"
33+
value = "${module.disabled.cluster_arn}"
34+
}
35+
36+
output "service_arn" {
37+
description = "ECS service ARN"
38+
value = "${module.disabled.service_arn}"
39+
}
40+
41+
output "service_name" {
42+
description = "ECS service name"
43+
value = "${module.disabled.service_name}"
44+
}
45+
3146
output "container_json" {
3247
description = ""
3348
value = "${module.disabled.container_json}"

examples/no_lb/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,29 @@ 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+
| cluster\_arn | ECS cluster ARN |
33+
| container\_json | |
34+
| service\_arn | ECS service ARN |
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+
| service\_name | ECS service name |
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/no_lb/data.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
/*
12
data "aws_vpc" "vpc" {
23
tags {
34
Env = "${var.environment}"
45
}
56
}
7+
/**/
8+
data "aws_vpc" "vpc" {
9+
filter {
10+
name = "tag:Name"
11+
values = ["${var.account_name}-${var.environment}"]
12+
}
13+
}
614

715
data "aws_subnet_ids" "private_subnet_ids" {
816
vpc_id = "${data.aws_vpc.vpc.id}"

examples/no_lb/outputs.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@ output "service_iam_role_name" {
1818
value = "${module.no_lb.service_iam_role_name}"
1919
}
2020

21+
output "cluster_arn" {
22+
description = "ECS cluster ARN"
23+
value = "${module.no_lb.cluster_arn}"
24+
}
25+
26+
output "service_arn" {
27+
description = "ECS service ARN"
28+
value = "${module.no_lb.service_arn}"
29+
}
30+
31+
output "service_name" {
32+
description = "ECS service name"
33+
value = "${module.no_lb.service_name}"
34+
}
35+
2136
output "container_json" {
2237
description = ""
2338
value = "${module.no_lb.container_json}"

examples/no_lb/providers.tf

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

45
# Make it faster by skipping something
56
skip_get_ec2_platforms = true

examples/no_lb/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" {

outputs.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ output "service_iam_role_name" {
3535

3636
output "cluster_arn" {
3737
description = "ECS cluster ARN"
38-
value = "${element(compact(concat(aws_ecs_service.service-no-lb.*.cluster, aws_ecs_service.service.*.cluster, list(""))), 0)}"
38+
value = "${element(concat(aws_ecs_service.service-no-lb.*.cluster, aws_ecs_service.service.*.cluster, list("")), 0)}"
3939
}
4040

4141
output "service_arn" {
4242
description = "ECS service ARN"
43-
value = "${element(compact(concat(aws_ecs_service.service-no-lb.*.id, aws_ecs_service.service.*.id, list(""))), 0)}"
43+
value = "${element(concat(aws_ecs_service.service-no-lb.*.id, aws_ecs_service.service.*.id, list("")), 0)}"
4444
}
4545

4646
output "service_name" {
4747
description = "ECS service name"
48-
value = "${element(compact(concat(aws_ecs_service.service-no-lb.*.name, aws_ecs_service.service.*.name, list(""))), 0)}"
48+
value = "${element(concat(aws_ecs_service.service-no-lb.*.name, aws_ecs_service.service.*.name, list("")), 0)}"
4949
}
5050

5151
output "container_json" {

0 commit comments

Comments
 (0)