From 971cf38a5ffa811d6886653902530ffad86af28d Mon Sep 17 00:00:00 2001 From: dcore94 Date: Wed, 3 Mar 2021 18:34:25 +0100 Subject: [PATCH] addition of policies for roles --- templates/group_created.json.j2 | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/templates/group_created.json.j2 b/templates/group_created.json.j2 index 97438da..7089866 100644 --- a/templates/group_created.json.j2 +++ b/templates/group_created.json.j2 @@ -270,15 +270,19 @@ } } }, - { - "name": "LAMBDA_TASK", - "taskReferenceName": "extract_accountimgmanager_role_id", - "type": "LAMBDA", - "inputParameters": { - "role_location" : "${create_role_accountingmanager.output.headers.location}", - "scriptExpression": "var role_id = $.role_location.split('/').pop(); return {'role_id' : role_id}" - } - }, + { + "name" : "pyrest", + "taskReferenceName" : "get_back_role_accountingmanager", + "type" : "SIMPLE", + "inputParameters" : { + "url" : "${create_role_accountingmanager.output.headers.location}", + "method" : "GET", + "headers" : { + "Authorization" : "Bearer ${authorize.output.body.access_token}", + "Accept" : "application/json" + } + } + }, { "name" : "pyrest", "taskReferenceName" : "create_role_policy_accountingmanager", @@ -293,7 +297,7 @@ "decisionStrategy": "UNANIMOUS", "roles" : [ { - "id" : "${extract_accountimgmanager_role_id.output.result.role_id}", + "id" : "${get_back_role_accountingmanager.output.body.id}", "required" : true } ]