File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
modules/ecs-instance-profile Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 2121 - ' --args=--only=terraform_standard_module_structure'
2222 - ' --args=--only=terraform_workspace_remote'
2323 - repo : git://github.com/pre-commit/pre-commit-hooks
24- rev : v3.4.0
24+ rev : v4.0.1
2525 hooks :
2626 - id : check-merge-conflict
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ No modules.
3333| [ aws_iam_role_policy_attachment.amazon_ssm_managed_instance_core] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment ) | resource |
3434| [ aws_iam_role_policy_attachment.ecs_ec2_cloudwatch_role] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment ) | resource |
3535| [ aws_iam_role_policy_attachment.ecs_ec2_role] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment ) | resource |
36+ | [ aws_partition.current] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition ) | data source |
3637
3738## Inputs
3839
Original file line number Diff line number Diff line change 1+ data "aws_partition" "current" {}
2+
13resource "aws_iam_role" "this" {
24 name = " ${ var . name } _ecs_instance_role"
35 path = " /ecs/"
@@ -27,17 +29,17 @@ resource "aws_iam_instance_profile" "this" {
2729
2830resource "aws_iam_role_policy_attachment" "ecs_ec2_role" {
2931 role = aws_iam_role. this . id
30- policy_arn = " arn:aws :iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role"
32+ policy_arn = " arn:${ data . aws_partition . current . partition } :iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role"
3133}
3234
3335resource "aws_iam_role_policy_attachment" "amazon_ssm_managed_instance_core" {
3436 count = var. include_ssm ? 1 : 0
3537
3638 role = aws_iam_role. this . id
37- policy_arn = " arn:aws :iam::aws:policy/AmazonSSMManagedInstanceCore"
39+ policy_arn = " arn:${ data . aws_partition . current . partition } :iam::aws:policy/AmazonSSMManagedInstanceCore"
3840}
3941
4042resource "aws_iam_role_policy_attachment" "ecs_ec2_cloudwatch_role" {
4143 role = aws_iam_role. this . id
42- policy_arn = " arn:aws :iam::aws:policy/CloudWatchLogsFullAccess"
44+ policy_arn = " arn:${ data . aws_partition . current . partition } :iam::aws:policy/CloudWatchLogsFullAccess"
4345}
You can’t perform that action at this time.
0 commit comments