diff --git a/ecs/cloudformation.go b/ecs/cloudformation.go index a28c48f9..0c52fba2 100644 --- a/ecs/cloudformation.go +++ b/ecs/cloudformation.go @@ -385,13 +385,13 @@ func (b *ecsAPIService) createTaskRole(project *types.Project, service types.Ser rolePolicies := []iam.Role_Policy{} if roles, ok := service.Extensions[extensionRole]; ok { rolePolicies = append(rolePolicies, iam.Role_Policy{ - PolicyName: fmt.Sprintf("%s%sPolicy", normalizeResourceName(project.Name), normalizeResourceName(service.Name)), + PolicyName: fmt.Sprintf("%sPolicy", normalizeResourceName(service.Name)), PolicyDocument: roles, }) } for _, vol := range service.Volumes { rolePolicies = append(rolePolicies, iam.Role_Policy{ - PolicyName: fmt.Sprintf("%s%sVolumeMountPolicy", normalizeResourceName(project.Name), normalizeResourceName(service.Name)), + PolicyName: fmt.Sprintf("%s%sVolumeMountPolicy", normalizeResourceName(service.Name), normalizeResourceName(vol.Source)), PolicyDocument: volumeMountPolicyDocument(vol.Source, resources.filesystems[vol.Source].ARN()), }) }