Skip to content

Commit

Permalink
Fix tflint
Browse files Browse the repository at this point in the history
  • Loading branch information
oanhnn committed Sep 19, 2024
1 parent 51553c2 commit 04c81df
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .tflint.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugin "aws" {
enabled = true
preset = "recommended"
version = "0.33.0"
source = "github.com/terraform-linters/tflint-ruleset-aws"
}
6 changes: 3 additions & 3 deletions modules/ecs-task-role/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# - sends application logs to CloudWatch Logs

locals {
s3_arns = compact(distinct(concat(var.writable_s3_arns, var.readable_s3_arns)))
aws_ssm_managed_instance_core_arn = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"
s3_arns = compact(distinct(concat(var.writable_s3_arns, var.readable_s3_arns)))
ssm_managed_instance_core_arn = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"
}

data "aws_iam_policy_document" "policy" {
Expand Down Expand Up @@ -117,7 +117,7 @@ module "this" {
]

custom_role_policy_arns = compact([
var.enable_ssm_core_policy ? locals.ssm_managed_instance_core_arn : "",
var.enable_ssm_core_policy ? local.ssm_managed_instance_core_arn : "",
module.policy.arn,
])

Expand Down
3 changes: 0 additions & 3 deletions modules/execution-role/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,8 @@ No modules.
| [aws_iam_role.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role_policy.custom](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |
| [aws_iam_role_policy_attachment.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
| [aws_iam_policy_document.assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.custom](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_partition.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition) | data source |
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |

## Inputs

Expand Down
7 changes: 0 additions & 7 deletions modules/execution-role/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@
# https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html
################################################################################

data "aws_region" "current" {}
data "aws_partition" "current" {}
data "aws_caller_identity" "current" {}

locals {
account_id = data.aws_caller_identity.current.account_id
partition = data.aws_partition.current.partition
region = data.aws_region.current.name
name_prefix = "${trimsuffix(var.name)}-"

create_custom_policy = var.create && length(var.statements) > 0
Expand Down

0 comments on commit 04c81df

Please sign in to comment.