Skip to content

Commit

Permalink
client event query expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Belodedenko committed Feb 20, 2019
1 parent a6691c0 commit fbc7072
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -493,7 +493,7 @@ aws s3api put-bucket-policy\
\"AgentType\": \"client\",
\"AgentService\": \"ssm\",
\"AgentCreateMethod\": \"get_parameter\",
\"AgentResourceId\": \"Value\",
\"AgentWaitQueryExpr\": \"$.Parameter.Value\",
\"AgentCreateArgs\": {
\"Name\": \"/foo/bar\",
\"WithDecryption\": true
Expand Down
7 changes: 6 additions & 1 deletion generic_provider/generic_provider.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python

import cfnresponse
import botocore
import boto3
import json
import os
Expand Down Expand Up @@ -176,6 +177,10 @@ def handle_client_event(agent, event, create=False, update=False, delete=False):
agent_kwargs[agent_resource_id] = event[resource_key][args_key][agent_resource_id]
except:
pass
try:
agent_query_expr = event[resource_key]['AgentWaitQueryExpr']
except:
agent_query_expr = None
try:
agent_exceptions = []
for ex in event[resource_key][exceptions_key]:
Expand Down Expand Up @@ -219,7 +224,7 @@ def handle_client_event(agent, event, create=False, update=False, delete=False):
PhysicalResourceId = response[agent_resource_id]
except:
try:
PhysicalResourceId = jsonpath(response, '$..{}'.format(agent_resource_id))
PhysicalResourceId = jsonpath(response, agent_query_expr)
assert PhysicalResourceId
PhysicalResourceId = ''.join(PhysicalResourceId)
except:
Expand Down

0 comments on commit fbc7072

Please sign in to comment.