Skip to content

Commit de0e8a0

Browse files
authored
Merge pull request #54 from pbs/CAT-24419-v3
CAT-24419
2 parents fa59f45 + 5d3179b commit de0e8a0

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### Using the Repo Source
66

77
```hcl
8-
github.com/pbs/terraform-aws-ecs-task-definition-module?ref=2.0.2
8+
github.com/pbs/terraform-aws-ecs-task-definition-module?ref=x.y.z
99
```
1010

1111
### Alternative Installation Methods
@@ -22,7 +22,7 @@ Integrate this module like so:
2222

2323
```hcl
2424
module "task" {
25-
source = "github.com/pbs/terraform-aws-ecs-task-definition-module?ref=2.0.2"
25+
source = "github.com/pbs/terraform-aws-ecs-task-definition-module?ref=x.y.z"
2626
2727
# Tagging Parameters
2828
organization = var.organization
@@ -40,7 +40,7 @@ module "task" {
4040

4141
If this repo is added as a subtree, then the version of the module should be close to the version shown here:
4242

43-
`2.0.2`
43+
`x.y.z`
4444

4545
Note, however that subtrees can be altered as desired within repositories.
4646

@@ -80,6 +80,7 @@ No modules.
8080
| [aws_iam_role.task_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
8181
| [aws_iam_role_policy.task_execution_role_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |
8282
| [aws_iam_role_policy.task_role_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |
83+
| [aws_iam_role_policy_attachment.cw_agent](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
8384
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
8485
| [aws_default_tags.common_tags](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/default_tags) | data source |
8586
| [aws_iam_policy_document.assume_role_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |

scripts/validate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ IFS=$'\n\t'
77
GIT_ROOT=$(git rev-parse --show-toplevel)
88
pushd "$GIT_ROOT" >/dev/null
99
export AWS_DEFAULT_REGION='us-east-1'
10-
terraform init -backend=false
10+
terraform init -backend=false -upgrade
1111
terraform validate
1212
git add .terraform.lock.hcl

security.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,10 @@ resource "aws_iam_role_policy" "task_execution_role_policy" {
163163

164164
policy = local.task_execution_role_policy_json
165165
}
166+
167+
resource "aws_iam_role_policy_attachment" "cw_agent" {
168+
count = var.use_cwagent_sidecar ? 1 : 0
169+
170+
policy_arn = "arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy"
171+
role = aws_iam_role.task_role.name
172+
}

template.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,10 @@ locals {
204204
"logConfiguration" : {
205205
"logDriver" : "awslogs",
206206
"options" : {
207-
"awslogs-group" : local.log_group_name,
207+
"awslogs-create-group" : "true",
208+
"awslogs-group" : "/ecs/ecs-cwagent",
208209
"awslogs-region" : data.aws_region.current.name,
209-
"awslogs-stream-prefix" : "cwagent"
210+
"awslogs-stream-prefix" : "ecs"
210211
}
211212
}
212213
}

0 commit comments

Comments
 (0)