Skip to content

Commit c7614aa

Browse files
authored
feat: Shorten outputs (removing this_) (#39)
1 parent 85b7b21 commit c7614aa

File tree

7 files changed

+24
-25
lines changed

7 files changed

+24
-25
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: git://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.48.0
3+
rev: v1.50.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ No modules.
9797

9898
| Name | Description |
9999
|------|-------------|
100-
| <a name="output_this_ecs_cluster_arn"></a> [this\_ecs\_cluster\_arn](#output\_this\_ecs\_cluster\_arn) | ARN of the ECS Cluster |
101-
| <a name="output_this_ecs_cluster_id"></a> [this\_ecs\_cluster\_id](#output\_this\_ecs\_cluster\_id) | ID of the ECS Cluster |
102-
| <a name="output_this_ecs_cluster_name"></a> [this\_ecs\_cluster\_name](#output\_this\_ecs\_cluster\_name) | The name of the ECS cluster |
100+
| <a name="output_ecs_cluster_arn"></a> [ecs\_cluster\_arn](#output\_ecs\_cluster\_arn) | ARN of the ECS Cluster |
101+
| <a name="output_ecs_cluster_id"></a> [ecs\_cluster\_id](#output\_ecs\_cluster\_id) | ID of the ECS Cluster |
102+
| <a name="output_ecs_cluster_name"></a> [ecs\_cluster\_name](#output\_ecs\_cluster\_name) | The name of the ECS cluster |
103103
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
104104

105105
## Authors

examples/complete-ecs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ Current version creates an high-available VPC with instances that are attached t
5858

5959
| Name | Source | Version |
6060
|------|--------|---------|
61-
| <a name="module_asg"></a> [asg](#module\_asg) | terraform-aws-modules/autoscaling/aws | ~> 3.0 |
61+
| <a name="module_asg"></a> [asg](#module\_asg) | terraform-aws-modules/autoscaling/aws | ~> 4.0 |
6262
| <a name="module_disabled_ecs"></a> [disabled\_ecs](#module\_disabled\_ecs) | ../../ | |
6363
| <a name="module_ec2_profile"></a> [ec2\_profile](#module\_ec2\_profile) | ../../modules/ecs-instance-profile | |
6464
| <a name="module_ecs"></a> [ecs](#module\_ecs) | ../../ | |
6565
| <a name="module_hello_world"></a> [hello\_world](#module\_hello\_world) | ./service-hello-world | |
66-
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2.0 |
66+
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 3.0 |
6767

6868
## Resources
6969

examples/complete-ecs/main.tf

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ data "aws_availability_zones" "available" {
1212

1313
module "vpc" {
1414
source = "terraform-aws-modules/vpc/aws"
15-
version = "~> 2.0"
15+
version = "~> 3.0"
1616

1717
name = local.name
1818

@@ -63,7 +63,7 @@ resource "aws_ecs_capacity_provider" "prov1" {
6363
name = "prov1"
6464

6565
auto_scaling_group_provider {
66-
auto_scaling_group_arn = module.asg.this_autoscaling_group_arn
66+
auto_scaling_group_arn = module.asg.autoscaling_group_arn
6767
}
6868

6969
}
@@ -72,7 +72,7 @@ resource "aws_ecs_capacity_provider" "prov1" {
7272
module "hello_world" {
7373
source = "./service-hello-world"
7474

75-
cluster_id = module.ecs.this_ecs_cluster_id
75+
cluster_id = module.ecs.ecs_cluster_id
7676
}
7777

7878
#----- ECS Resources--------
@@ -96,21 +96,20 @@ data "aws_ami" "amazon_linux_ecs" {
9696

9797
module "asg" {
9898
source = "terraform-aws-modules/autoscaling/aws"
99-
version = "~> 3.0"
99+
version = "~> 4.0"
100100

101101
name = local.ec2_resources_name
102102

103103
# Launch configuration
104104
lc_name = local.ec2_resources_name
105105

106-
image_id = data.aws_ami.amazon_linux_ecs.id
107-
instance_type = "t2.micro"
108-
security_groups = [module.vpc.default_security_group_id]
109-
iam_instance_profile = module.ec2_profile.this_iam_instance_profile_id
110-
user_data = data.template_file.user_data.rendered
106+
image_id = data.aws_ami.amazon_linux_ecs.id
107+
instance_type = "t2.micro"
108+
security_groups = [module.vpc.default_security_group_id]
109+
iam_instance_profile_arn = module.ec2_profile.iam_instance_profile_arn
110+
user_data = data.template_file.user_data.rendered
111111

112112
# Auto scaling group
113-
asg_name = local.ec2_resources_name
114113
vpc_zone_identifier = module.vpc.private_subnets
115114
health_check_type = "EC2"
116115
min_size = 0

modules/ecs-instance-profile/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ No modules.
4646

4747
| Name | Description |
4848
|------|-------------|
49-
| <a name="output_this_iam_instance_profile_arn"></a> [this\_iam\_instance\_profile\_arn](#output\_this\_iam\_instance\_profile\_arn) | ARN of the IAM instance profile |
50-
| <a name="output_this_iam_instance_profile_id"></a> [this\_iam\_instance\_profile\_id](#output\_this\_iam\_instance\_profile\_id) | ID of the IAM instance profile |
51-
| <a name="output_this_iam_role_id"></a> [this\_iam\_role\_id](#output\_this\_iam\_role\_id) | ID of the IAM role |
49+
| <a name="output_iam_instance_profile_arn"></a> [iam\_instance\_profile\_arn](#output\_iam\_instance\_profile\_arn) | ARN of the IAM instance profile |
50+
| <a name="output_iam_instance_profile_id"></a> [iam\_instance\_profile\_id](#output\_iam\_instance\_profile\_id) | ID of the IAM instance profile |
51+
| <a name="output_iam_role_id"></a> [iam\_role\_id](#output\_iam\_role\_id) | ID of the IAM role |
5252
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
output "this_iam_instance_profile_id" {
1+
output "iam_instance_profile_id" {
22
description = "ID of the IAM instance profile"
33
value = aws_iam_instance_profile.this.id
44
}
55

6-
output "this_iam_instance_profile_arn" {
6+
output "iam_instance_profile_arn" {
77
description = "ARN of the IAM instance profile"
88
value = aws_iam_instance_profile.this.arn
99
}
1010

11-
output "this_iam_role_id" {
11+
output "iam_role_id" {
1212
description = "ID of the IAM role"
1313
value = aws_iam_role.this.id
1414
}

outputs.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
output "this_ecs_cluster_id" {
1+
output "ecs_cluster_id" {
22
description = "ID of the ECS Cluster"
33
value = concat(aws_ecs_cluster.this.*.id, [""])[0]
44
}
55

6-
output "this_ecs_cluster_arn" {
6+
output "ecs_cluster_arn" {
77
description = "ARN of the ECS Cluster"
88
value = concat(aws_ecs_cluster.this.*.arn, [""])[0]
99
}
1010

11-
output "this_ecs_cluster_name" {
11+
output "ecs_cluster_name" {
1212
description = "The name of the ECS cluster"
1313
value = var.name
1414
}

0 commit comments

Comments
 (0)