Skip to content

Commit

Permalink
add .
Browse files Browse the repository at this point in the history
  • Loading branch information
cschneider-vertical-relevance committed May 3, 2022
1 parent 0e51b7a commit 682e39f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 28 deletions.
41 changes: 21 additions & 20 deletions stacks/control_broker_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def deploy_inner_sfn(self):
"Default": "NoValidRoute",
"Choices": [
{
"Variable": "$.PaCEvaluationRouter.Routing",
"Variable": "$.PaCEvaluationRouter.Routing.InvokingSfnNextState",
"StringEquals": "EvaluateCloudFormationTemplateByOPA",
"Next": "EvaluateCloudFormationTemplateByOPA",
}
Expand All @@ -446,26 +446,27 @@ def deploy_inner_sfn(self):
"Type": "Fail",
},
"EvaluateCloudFormationTemplateByOPA": {
"Type": "Succeed",
"Type": "Task",
# "Next": "GatherInfractions",
"End": True,
"ResultPath": "$.EvaluateCloudFormationTemplateByOPA",
"Resource": "arn:aws:states:::lambda:invoke",
"Parameters": {
"FunctionName": self.lambda_evaluate_cloudformation_by_opa.function_name,
"Payload": {
"JsonInput": {
"Bucket.$":"$.PaCEvaluationRouter.Routing.ModifiedInput.Bucket",
"Key.$":"$.PaCEvaluationRouter.Routing.ModifiedInput.Key",
},
"OpaPolicies": {
"Bucket.$": "$.PaCEvaluationRouter.Routing.PaC.Bucket"
},
},
},
"ResultSelector": {
"Results.$": "$.Payload.EvaluateCloudFormationTemplateByOPAResults"
},
},
# "EvaluateCloudFormationTemplateByOPA": {
# "Type": "Task",
# "Next": "GatherInfractions",
# "ResultPath": "$.EvaluateCloudFormationTemplateByOPA",
# "Resource": "arn:aws:states:::lambda:invoke",
# "Parameters": {
# "FunctionName": self.lambda_evaluate_cloudformation_by_opa.function_name,
# "Payload": {
# "JsonInput.$": "$.JsonInput",
# "OpaPolicies": {
# "Bucket": self.bucket_opa_policies.bucket_name
# },
# },
# },
# "ResultSelector": {
# "Results.$": "$.Payload.EvaluateCloudFormationTemplateByOPAResults"
# },
# },
# "GatherInfractions": {
# "Type": "Task",
# "Next": "ChoiceInfractionsExist",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,23 +157,24 @@ def get_converted_cloudformation(self):

def put_converted_cloudformation(self):

self.converted_s3_path = {
'Bucket' : os.environ['ConvertedInputsBucket'],
'Key' : self.config_event_s3_path['Key'],
}

put_object(
bucket = os.environ['ConvertedInputsBucket'],
key = self.config_event_s3_path['Key'],
bucket = self.converted_s3_path['Bucket'],
key = self.converted_s3_path['Key'],
object_ = self.cfn
)

def get_converted_s3_path(self):

self.parse_config_event()
self.get_converted_cloudformation()
self.put_converted_cloudformation()



return {
"Bucket":"CONVERTED-BUCKET",
"Key":"CONVERTED-KEY",
}
return self.converted_s3_path

class PacEvaluationRouter():
def __init__(
Expand Down

0 comments on commit 682e39f

Please sign in to comment.