@@ -2,22 +2,22 @@ locals {
2
2
enabled = module. this . enabled
3
3
4
4
count = local. enabled ? 1 : 0
5
- id = local. enabled ? join (" " , aws_codedeploy_app. default . * . id ) : null
6
- name = local. enabled ? join (" " , aws_codedeploy_app. default . * . name ) : null
7
- group_id = local. enabled ? join (" " , aws_codedeploy_deployment_group. default . * . id ) : null
8
- deployment_config_name = local. enabled ? join (" " , aws_codedeploy_deployment_config. default . * . id ) : null
9
- deployment_config_id = local. enabled ? join (" " , aws_codedeploy_deployment_config. default . * . deployment_config_id ) : null
5
+ id = local. enabled ? join (" " , aws_codedeploy_app. default [ * ] . id ) : null
6
+ name = local. enabled ? join (" " , aws_codedeploy_app. default [ * ] . name ) : null
7
+ group_id = local. enabled ? join (" " , aws_codedeploy_deployment_group. default [ * ] . id ) : null
8
+ deployment_config_name = local. enabled ? join (" " , aws_codedeploy_deployment_config. default [ * ] . id ) : null
9
+ deployment_config_id = local. enabled ? join (" " , aws_codedeploy_deployment_config. default [ * ] . deployment_config_id ) : null
10
10
auto_rollback_configuration_enabled = local. enabled && var. auto_rollback_configuration_events != null && length (var. auto_rollback_configuration_events ) > 0
11
11
alarm_configuration_enabled = local. enabled && var. alarm_configuration != null
12
12
default_sns_topic_enabled = local. enabled && var. create_default_sns_topic
13
13
sns_topic_arn = local. default_sns_topic_enabled ? module. sns_topic . sns_topic . arn : var. sns_topic_arn
14
14
default_service_role_enabled = local. enabled && var. create_default_service_role
15
15
default_service_role_count = local. default_service_role_enabled ? 1 : 0
16
- service_role_arn = local. default_service_role_enabled ? join (" " , aws_iam_role. default . * . arn ) : var. service_role_arn
16
+ service_role_arn = local. default_service_role_enabled ? join (" " , aws_iam_role. default [ * ] . arn ) : var. service_role_arn
17
17
default_policy_arn = {
18
- Server = " arn:${ join (" " , data. aws_partition . current . * . partition )} :iam::aws:policy/service-role/AWSCodeDeployRole"
19
- Lambda = " arn:${ join (" " , data. aws_partition . current . * . partition )} :iam::aws:policy/service-role/AWSCodeDeployRoleForLambda"
20
- ECS = " arn:${ join (" " , data. aws_partition . current . * . partition )} :iam::aws:policy/AWSCodeDeployRoleForECS"
18
+ Server = " arn:${ join (" " , data. aws_partition . current [ * ] . partition )} :iam::aws:policy/service-role/AWSCodeDeployRole"
19
+ Lambda = " arn:${ join (" " , data. aws_partition . current [ * ] . partition )} :iam::aws:policy/service-role/AWSCodeDeployRoleForLambda"
20
+ ECS = " arn:${ join (" " , data. aws_partition . current [ * ] . partition )} :iam::aws:policy/AWSCodeDeployRoleForECS"
21
21
}
22
22
}
23
23
@@ -42,14 +42,14 @@ data "aws_partition" "current" {
42
42
resource "aws_iam_role" "default" {
43
43
count = local. default_service_role_count
44
44
name = module. this . id
45
- assume_role_policy = join (" " , data. aws_iam_policy_document . assume_role . * . json )
45
+ assume_role_policy = join (" " , data. aws_iam_policy_document . assume_role [ * ] . json )
46
46
tags = module. this . tags
47
47
}
48
48
49
49
resource "aws_iam_role_policy_attachment" "default" {
50
50
count = local. default_service_role_count
51
51
policy_arn = format (" %s" , lookup (local. default_policy_arn , var. compute_platform ))
52
- role = join (" " , aws_iam_role. default . * . name )
52
+ role = join (" " , aws_iam_role. default [ * ] . name )
53
53
}
54
54
55
55
module "sns_topic" {
0 commit comments