def setup(self) -> None:
        # Prompt required variables
        questions = [
            {
                "type": "input",
                "name": "webhook_url",
                "message": "Please enter your Slack Webhook URL: ",
                "validate": SlackWebhookValidator,
            },
            {
                "type": "input",
                "name": "notify_email",
                "message": "Please enter your SNS Topic Subscription Email Address: ",
                "validate": EmailValidator,
            },
            {
                "type": "input",
                "name": "white_list_group",
                "message": "Please enter name of whitelist CloudWatch Access IAM Group",
            },
        ]

        answers = prompt(questions)

        # Save variables to config
        if (
                answers
                and answers["notify_email"]
                and answers["webhook_url"]
                and answers["white_list_group"]
        ):
            self.config.set(self.name, "notify_email", answers["notify_email"])
            self.config.set(self.name, "webhook_url", answers["webhook_url"])
            self.config.set(self.name, "white_list_group", answers["white_list_group"])
            Config.save_config(self.config)
Esempio n. 2
0
    def setup(self) -> None:
        # Prompt required variables
        questions = [
            {
                "type": "input",
                "name": "cluster_name",
                "message": "Please enter the name of the Aurora Cluster",
                "validate": AwsAuroraClusterNameValidator,
            },
            {
                "type": "input",
                "name": "notify_email",
                "message": "Please enter your notification email",
                "validate": EmailValidator,
            },
            {
                "type": "input",
                "name": "webhook_url",
                "message": "Please enter your Slack Webhook URL",
                "validate": SlackWebhookValidator,
            },
        ]

        answers = prompt(questions)

        # Save variables to config
        if (answers and answers["cluster_name"] and answers["notify_email"]
                and answers["webhook_url"]):
            self.config.set(self.name, "cluster_name", answers["cluster_name"])
            self.config.set(self.name, "notify_email", answers["notify_email"])
            self.config.set(self.name, "webhook_url", answers["webhook_url"])
            Config.save_config(self.config)
Esempio n. 3
0
    def setup(self) -> None:
        # Prompt required variables
        questions = [
            {
                "type": "input",
                "name": "invoke_url",
                "message":
                "Please enter your Amazon API Gateway Stage invoke url",
            },
            {
                "type": "input",
                "name": "rate",
                "message":
                "Enter the amount of requests that you want to send.\nNote that this should be higher than the rate set while deploying EXT-06 however if the rate is too high, not enough requests will be sent in the 5 minute period.\nNote 50 additional requests are sent to allow for time for the rule to trigger\n",
                "validate": RateValidator,
            },
        ]

        answers = prompt(questions)

        # Save variables to config
        if answers and answers["invoke_url"] and answers["rate"]:
            self.config.set(self.name, "invoke_url", answers["invoke_url"])
            self.config.set(self.name, "rate", answers["rate"])
            Config.save_config(self.config)
Esempio n. 4
0
    def setup(self) -> None:
        # Prompt required variables
        questions = [
            {
                "type": "input",
                "name": "cluster",
                "message": "Please enter the ID of the Aurora cluster",
            },
        ]

        answers = prompt(questions)

        # Save variables to config
        if answers and answers["cluster"]:
            self.config.set(self.name, "cluster", answers["cluster"])
            Config.save_config(self.config)
    def setup(self) -> None:
        # Prompt required variables
        questions = [
            {
                "type": "input",
                "name": "webhook_url",
                "message": "Please enter your Slack Webhook URL",
                "validate": SlackWebhookValidator,
            },
        ]

        answers = prompt(questions)

        # Save variables to config
        if (answers and answers["webhook_url"]):
            self.config.set(self.name, "webhook_url", answers["webhook_url"])
            Config.save_config(self.config)
Esempio n. 6
0
    def setup(self):
        # Prompt required variables
        questions = [
            {
                "type": "input",
                "name": "api_arn",
                "message":
                "Please enter the arn of your API gateway or Elastic Load Balancer",
                "validate": ApiArnValidator,
            },
        ]

        answers = prompt(questions)

        # Save variables to config
        if answers and answers["api_arn"]:
            self.config.set(self.name, "api_arn", answers["api_arn"])
            Config.save_config(self.config)
Esempio n. 7
0
    def setup(self) -> None:
        # Prompt required variables
        questions = [
            {
                "type": "input",
                "name": "account",
                "message": "Please enter your AWS Account ID",
                "validate": AwsAccountIdValidator,
            },
            {
                "type": "list",
                "name": "region",
                "message": "Please enter the region you want to deploy your IR stack to",
                "choices": [
                    "us-east-2",
                    "us-east-1",
                    "us-west-1",
                    "us-west-2",
                    "ap-east-1",
                    "ap-south-1",
                    "ap-northeast-3",
                    "ap-northeast-2",
                    "ap-southeast-1",
                    "ap-southeast-2",
                    "ap-northeast-1",
                    "ca-central-1",
                    "eu-central-1",
                    "eu-west-1",
                    "eu-west-2",
                    "eu-west-3",
                    "eu-north-1",
                    "me-south-1",
                    "sa-east-1",
                ],
            },
        ]

        answers = prompt(questions)

        # Save variables to config
        if answers and answers["account"] and answers["region"]:
            self.config.set(self.name, "account", answers["account"])
            self.config.set(self.name, "region", answers["region"])
            Config.save_config(self.config)
Esempio n. 8
0
    def __init__(self, name: str, required_variables: list = []):
        if not name:
            raise ValueError("'name' argument is required")

        if not required_variables and required_variables != []:
            raise ValueError("'required_variables' argument is required")

        self.name = name
        self.required_variables = required_variables
        self.config = Config.get_config()
        if name not in self.config:
            self.config.add_section(name)
    def setup(self) -> None:
        # Prompt required variables
        questions = [
            {
                "type": "input",
                "name": "host",
                "message": "Please enter the host for the Aurora Instance",
            },
            {
                "type": "input",
                "name": "port",
                "message": "Please enter the port for the Aurora Instance",
            },
        ]

        answers = prompt(questions)

        # Save variables to config
        if answers and answers["host"] and answers["port"]:
            self.config.set(self.name, "host", answers["host"])
            self.config.set(self.name, "port", answers["port"])
            Config.save_config(self.config)
Esempio n. 10
0
from ir_cdk_stacks.ir_cdk_stacks_stack import IrCdkStacksStack
from ir_cdk_stacks.in_aur_01_stack import InAur01Stack
from ir_cdk_stacks.in_aur_02_stack import InAur02Stack
from ir_cdk_stacks.in_lam_01_stack import InLam01Stack
from ir_cdk_stacks.ext_01_stack import Ext01Stack
from ir_cdk_stacks.ext_06_stack import Ext06Stack
from ir_cdk_stacks.in_clt_01_stack import InClt01Stack

from ir_cdk_stacks.In_S3_01_Prod_Stack import InS301StackProd
from ir_cdk_stacks.In_S3_01_Preprod_Stack import InS301PreprodStack
from ir_cdk_stacks.In_S3_01_Dev_Stack import InS301DevStack

from socialist_ir.config import Config

config = Config.get_config()

ACCOUNT = config.get("main", "account")
REGION = config.get("main", "region")

env_US = core.Environment(account=ACCOUNT, region=REGION)

app = core.App()
IrCdkStacksStack(app, "ir-cdk-stacks", env=env_US)
InAur01Stack(app, "in-aur-01-stack", env=env_US)

InAur02Stack(app, "in-aur-02-stack", env=env_US)
InLam01Stack(app, "in-lam-01-stack", env=env_US)
Ext01Stack(app, "ext-01-stack", env=env_US)
Ext06Stack(app, "ext-06-stack", env=env_US)
InClt01Stack(app, "in-clt-01-stack", env=env_US)