Skip to content

Commit

Permalink
Issue #3 cleanup unused Config params, file
Browse files Browse the repository at this point in the history
  • Loading branch information
cschneider-vertical-relevance committed May 2, 2022
1 parent 592326a commit d348acd
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 52 deletions.
64 changes: 64 additions & 0 deletions .~c9_invoke_uZbt5X.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env python3
import os
from pathlib import Path
from typing import List

import aws_cdk as cdk
from aws_cdk import aws_config, aws_stepfunctions

from stacks.control_broker_stack import (
ControlBrokerStack,
)
from stacks.pipeline_stack import GitHubCDKPipelineStack
from stacks.test_stack import TestStack
from stacks.client_stack import ClientStack

STACK_VERSION = "V0x6x3"

app = cdk.App()
continuously_deployed = app.node.try_get_context(
"control-broker/continuous-deployment/enabled"
)
deploy_stage = None
if continuously_deployed:
deploy_stage = cdk.Stage(app, "Deploy")

env = cdk.Environment(
account=os.getenv("CDK_DEFAULT_ACCOUNT"), region=os.getenv("CDK_DEFAULT_REGION")
)

control_broker_stack = ControlBrokerStack(
deploy_stage or app,
f"ControlBrokerEvalEngineCdkStack{STACK_VERSION}",
env=env,
)

if app.node.try_get_context("control-broker/post-deployment-testing/enabled"):
TestStack(
deploy_stage or app,
f"ControlBrokerTestStack{STACK_VERSION}",
control_broker_outer_state_machine=control_broker_stack.outer_eval_engine_state_machine,
control_broker_roles=control_broker_stack.Input_reader_roles,
env=env
)
if app.node.try_get_context("control-broker/client/enabled"):
ClientStack(
deploy_stage or app,
f"ControlBrokerClientStack{STACK_VERSION}",
control_broker_outer_state_machine=control_broker_stack.outer_eval_engine_state_machine,
control_broker_roles=control_broker_stack.Input_reader_roles,
control_broker_eval_results_bucket=control_broker_stack.eval_results_reports_bucket,
env=env
)

if continuously_deployed:
pipeline_stack = GitHubCDKPipelineStack(
app,
"ControlBrokerCICDDeployment",
env=env,
**app.node.try_get_context(
"control-broker/continuous-deployment/github-config"
),
)
pipeline_stack.pipeline.add_stage(deploy_stage)
app.synth()
5 changes: 0 additions & 5 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
deploy_stage or app,
f"ControlBrokerEvalEngineCdkStack{STACK_VERSION}",
env=env,
config_rule_enabled=app.node.try_get_context("control-broker/config-rule/enabled"),
organization_id_parameter=app.node.try_get_context("control-broker/organization-id-ssm-parameter"),
config_rule_scope=aws_config.RuleScope.from_resources(
resource_types=[aws_config.ResourceType.SQS_QUEUE]
),
)

if app.node.try_get_context("control-broker/post-deployment-testing/enabled"):
Expand Down
43 changes: 0 additions & 43 deletions components/config_rules.py

This file was deleted.

5 changes: 1 addition & 4 deletions stacks/control_broker_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def __init__(
self,
scope: Construct,
construct_id: str,
organization_id_parameter: str,
**kwargs,
) -> None:
"""A full Control Broker installation.
Expand All @@ -52,8 +51,6 @@ def __init__(
"""
super().__init__(scope, construct_id, **kwargs)

self.organization_id_parameter = organization_id_parameter

self.deploy_utils()
self.s3_deploy_local_assets()
self.deploy_inner_sfn_lambdas()
Expand Down Expand Up @@ -129,7 +126,7 @@ def deploy_utils(self):
],
)

# result reports
# results reports

self.bucket_eval_results_reports = aws_s3.Bucket(
self,
Expand Down

0 comments on commit d348acd

Please sign in to comment.