예제 #1
0
    def __init__(
        self, name, project_code, template_path, region, template_bucket_name=None,
        template_key_prefix=None, required_version=None, parameters=None,
        sceptre_user_data=None, hooks=None, s3_details=None,
        dependencies=None, role_arn=None, protected=False, tags=None,
        external_name=None, notifications=None, on_failure=None, profile=None,
        stack_timeout=0, stack_group_config={}
    ):
        self.logger = logging.getLogger(__name__)

        self.name = name
        self.project_code = project_code
        self.region = region
        self.template_bucket_name = template_bucket_name
        self.template_key_prefix = template_key_prefix
        self.required_version = required_version
        self.external_name = external_name or \
            get_external_stack_name(self.project_code, self.name)

        self.template_path = template_path
        self.s3_details = s3_details
        self._template = None

        self.protected = protected
        self.role_arn = role_arn
        self.on_failure = on_failure
        self.dependencies = dependencies or []
        self.tags = tags or {}
        self.stack_timeout = stack_timeout
        self.profile = profile
        self.hooks = hooks or {}
        self.parameters = parameters or {}
        self.sceptre_user_data = sceptre_user_data or {}
        self.notifications = notifications or []
        self.stack_group_config = stack_group_config or {}
예제 #2
0
    def __init__(
        self, name, project_code, region, template_path=None, template_handler_config=None,
        template_bucket_name=None, template_key_prefix=None, required_version=None,
        parameters=None, sceptre_user_data=None, hooks=None, s3_details=None,
        iam_role=None, dependencies=None, role_arn=None, protected=False, tags=None,
        external_name=None, notifications=None, on_failure=None, profile=None,
        stack_timeout=0, stack_group_config={}
    ):
        self.logger = logging.getLogger(__name__)

        if template_path and template_handler_config:
            raise InvalidConfigFileError("Both 'template_path' and 'template' are set, specify one or the other")

        if not template_path and not template_handler_config:
            raise InvalidConfigFileError("Neither 'template_path' nor 'template' is set")

        self.name = sceptreise_path(name)
        self.project_code = project_code
        self.region = region
        self.template_bucket_name = template_bucket_name
        self.template_key_prefix = template_key_prefix
        self.required_version = required_version
        self.external_name = external_name or get_external_stack_name(self.project_code, self.name)
        self.template_path = template_path
        self.template_handler_config = template_handler_config
        self.s3_details = s3_details
        self._template = None
        self._connection_manager = None

        self.protected = protected
        self.role_arn = role_arn
        self.on_failure = on_failure
        self.dependencies = dependencies or []
        self.tags = tags or {}
        self.stack_timeout = stack_timeout
        self.iam_role = iam_role
        self.profile = profile
        self.hooks = hooks or {}
        self.parameters = parameters or {}
        self._sceptre_user_data = sceptre_user_data or {}
        self._sceptre_user_data_is_resolved = False
        self.notifications = notifications or []
        self.stack_group_config = stack_group_config or {}
예제 #3
0
 def test_get_external_stack_name(self):
     result = get_external_stack_name("prj", "dev/ew1/jump-host")
     assert result == "prj-dev-ew1-jump-host"