File tree Expand file tree Collapse file tree 15 files changed +89
-17
lines changed
modules/ecs-instance-profile Expand file tree Collapse file tree 15 files changed +89
-17
lines changed Original file line number Diff line number Diff line change 1
1
repos :
2
2
- repo : git://github.com/antonbabenko/pre-commit-terraform
3
- rev : v1.31 .0
3
+ rev : v1.43 .0
4
4
hooks :
5
5
- id : terraform_fmt
6
6
- id : terraform_docs
7
+ - id : terraform_tflint
8
+ args :
9
+ - ' --args=--only=terraform_deprecated_interpolation'
10
+ - ' --args=--only=terraform_deprecated_index'
11
+ - ' --args=--only=terraform_unused_declarations'
12
+ - ' --args=--only=terraform_comment_syntax'
13
+ - ' --args=--only=terraform_documented_outputs'
14
+ - ' --args=--only=terraform_documented_variables'
15
+ - ' --args=--only=terraform_typed_variables'
16
+ - ' --args=--only=terraform_module_pinned_source'
17
+ - ' --args=--only=terraform_naming_convention'
18
+ - ' --args=--only=terraform_required_version'
19
+ - ' --args=--only=terraform_required_providers'
20
+ - ' --args=--only=terraform_standard_module_structure'
21
+ - ' --args=--only=terraform_workspace_remote'
7
22
- repo : git://github.com/pre-commit/pre-commit-hooks
8
- rev : v3.1 .0
23
+ rev : v3.2 .0
9
24
hooks :
10
25
- id : check-merge-conflict
Original file line number Diff line number Diff line change @@ -47,13 +47,16 @@ module "ecs" {
47
47
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
48
48
## Requirements
49
49
50
- No requirements.
50
+ | Name | Version |
51
+ | ------| ---------|
52
+ | terraform | >= 0.12.6, < 0.14 |
53
+ | aws | >= 2.0, < 4.0 |
51
54
52
55
## Providers
53
56
54
57
| Name | Version |
55
58
| ------| ---------|
56
- | aws | n/a |
59
+ | aws | >= 2.0, < 4.0 |
57
60
58
61
## Inputs
59
62
@@ -68,8 +71,8 @@ No requirements.
68
71
69
72
| Name | Description |
70
73
| ------| -------------|
71
- | this\_ ecs\_ cluster\_ arn | n/a |
72
- | this\_ ecs\_ cluster\_ id | n/a |
74
+ | this\_ ecs\_ cluster\_ arn | ARN of the ECS Cluster |
75
+ | this\_ ecs\_ cluster\_ id | ID of the ECS Cluster |
73
76
| this\_ ecs\_ cluster\_ name | The name of the ECS cluster |
74
77
75
78
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Original file line number Diff line number Diff line change @@ -41,14 +41,18 @@ Current version creates an high-available VPC with instances that are attached t
41
41
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
42
42
## Requirements
43
43
44
- No requirements.
44
+ | Name | Version |
45
+ | ------| ---------|
46
+ | terraform | >= 0.12.6, < 0.14 |
47
+ | aws | >= 2.0, < 4.0 |
48
+ | template | ~ > 2.0 |
45
49
46
50
## Providers
47
51
48
52
| Name | Version |
49
53
| ------| ---------|
50
- | aws | n/a |
51
- | template | n/a |
54
+ | aws | >= 2.0, < 4.0 |
55
+ | template | ~ > 2.0 |
52
56
53
57
## Inputs
54
58
Original file line number Diff line number Diff line change @@ -37,14 +37,14 @@ module "ecs" {
37
37
container_insights = true
38
38
}
39
39
40
- module "ec2-profile " {
40
+ module "ec2_profile " {
41
41
source = " ../../modules/ecs-instance-profile"
42
42
name = local. name
43
43
}
44
44
45
45
# ----- ECS Services--------
46
46
47
- module "hello-world " {
47
+ module "hello_world " {
48
48
source = " ./service-hello-world"
49
49
cluster_id = module. ecs . this_ecs_cluster_id
50
50
}
@@ -80,16 +80,16 @@ module "this" {
80
80
image_id = data. aws_ami . amazon_linux_ecs . id
81
81
instance_type = " t2.micro"
82
82
security_groups = [module . vpc . default_security_group_id ]
83
- iam_instance_profile = module. ec2-profile . this_iam_instance_profile_id
83
+ iam_instance_profile = module. ec2_profile . this_iam_instance_profile_id
84
84
user_data = data. template_file . user_data . rendered
85
85
86
86
# Auto scaling group
87
87
asg_name = local. ec2_resources_name
88
88
vpc_zone_identifier = module. vpc . private_subnets
89
89
health_check_type = " EC2"
90
- min_size = 1
90
+ min_size = 0
91
91
max_size = 2
92
- desired_capacity = 1
92
+ desired_capacity = 0
93
93
wait_for_capacity_timeout = 0
94
94
95
95
tags = [
Original file line number Diff line number Diff line change
1
+ terraform {
2
+ required_version = " >= 0.12.6, < 0.14"
3
+
4
+ required_providers {
5
+ aws = " >= 2.0, < 4.0"
6
+ }
7
+ }
Original file line number Diff line number Diff line change
1
+ terraform {
2
+ required_version = " >= 0.12.6, < 0.14"
3
+
4
+ required_providers {
5
+ aws = " >= 2.0, < 4.0"
6
+ template = " ~> 2.0"
7
+ }
8
+ }
Original file line number Diff line number Diff line change @@ -28,6 +28,13 @@ resource "aws_iam_role_policy_attachment" "ecs_ec2_role" {
28
28
policy_arn = " arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role"
29
29
}
30
30
31
+ resource "aws_iam_role_policy_attachment" "amazon_ssm_managed_instance_core" {
32
+ count = var. include_ssm ? 1 : 0
33
+
34
+ role = aws_iam_role. this . id
35
+ policy_arn = " arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"
36
+ }
37
+
31
38
resource "aws_iam_role_policy_attachment" "ecs_ec2_cloudwatch_role" {
32
39
role = aws_iam_role. this . id
33
40
policy_arn = " arn:aws:iam::aws:policy/CloudWatchLogsFullAccess"
You can’t perform that action at this time.
0 commit comments