How to use the stacker.context.Context function in stacker

To help you get started, we’ve selected a few stacker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github remind101 / stacker_blueprints / tests / test_efs.py View on Github external
def setUp(self):
        self.ctx = Context({'namespace': 'test'})
github remind101 / stacker_blueprints / tests / test_sns.py View on Github external
def test_sns(self):
        ctx = Context({'namespace': 'test', 'environment': 'test'})
        blueprint = Topics('topics', ctx)
        blueprint.resolve_variables(self.variables)
        blueprint.create_template()
        self.assertRenderedBlueprint(blueprint)
github remind101 / stacker_blueprints / tests / test_aws_lambda.py View on Github external
def setUp(self):
        self.ctx = Context({'namespace': 'test'})
github remind101 / stacker_blueprints / tests / test_s3.py View on Github external
def test_s3(self):
        ctx = Context(config=Config({'namespace': 'test'}))
        blueprint = Buckets('buckets', ctx)
        blueprint.resolve_variables(self.variables)
        blueprint.create_template()
        self.assertRenderedBlueprint(blueprint)
github remind101 / stacker_blueprints / tests / test_dynamodb.py View on Github external
def test_dynamodb_autoscaling(self):
        ctx = Context({'namespace': 'test', 'environment': 'test'})
        blueprint = stacker_blueprints.dynamodb.AutoScaling('dynamodb_autoscaling', ctx)
        blueprint.resolve_variables(self.dynamodb_autoscaling_variables)
        blueprint.create_template()
        self.assertRenderedBlueprint(blueprint)
github remind101 / stacker_blueprints / tests / test_s3.py View on Github external
def test_s3_static_website(self):
        """Test a static website blog bucket."""
        ctx = Context(config=Config({'namespace': 'test'}))
        blueprint = Buckets('s3_static_website', ctx)

        v = self.variables = [
            Variable('Buckets', {
                'Blog': {
                    'AccessControl': 'PublicRead',
                    'WebsiteConfiguration' : {
                        'IndexDocument': 'index.html'
                    }
                },
            }),
            Variable('ReadRoles', [
                'Role1',
                'Role2',
            ]),
            Variable('ReadWriteRoles', [
github remind101 / stacker_blueprints / tests / test_generic.py View on Github external
def setUp(self):
        self.ctx = Context(config=Config({'namespace': 'test'}))
github remind101 / stacker_blueprints / tests / test_cloudwatch_logs.py View on Github external
def setUp(self):
        self.ctx = Context(config=Config({'namespace': 'test'}))
github remind101 / stacker_blueprints / tests / test_kms.py View on Github external
def setUp(self):
        self.ctx = Context(config=Config({'namespace': 'test'}))
github cloudtools / stacker / stacker / commands / stacker / __init__.py View on Github external
self.config = load_config(
            options.config.read(),
            environment=options.environment,
            validate=True,
        )

        options.provider_builder = default.ProviderBuilder(
            region=options.region,
            interactive=options.interactive,
            replacements_only=options.replacements_only,
            recreate_failed=options.recreate_failed,
            service_role=self.config.service_role,
        )

        options.context = Context(
            environment=options.environment,
            config=self.config,
            # Allow subcommands to provide any specific kwargs to the Context
            # that it wants.
            **options.get_context_kwargs(options)
        )

        super(Stacker, self).configure(options, **kwargs)
        if options.interactive:
            logger.info("Using interactive AWS provider mode.")
        else:
            logger.info("Using default AWS provider mode")