generated from Sceptre/sceptre-template-handler-template
-
Notifications
You must be signed in to change notification settings - Fork 4
/
lambda-stack-bootstrapped.yaml
58 lines (53 loc) · 3.51 KB
/
lambda-stack-bootstrapped.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# This is an example of deploying the CDK using the "bootstrapped" deployment_type, which means
# using the resources from the CDK boostrap stack for things such as the asset bucket, asset ECR
# repo, as well as the roles used to push those assets to the cloud. You can use either a Bootstrap
# stack deployed via Sceptre or an existing one deployed to your account via CDK. All you need to
# do to reference a given bootstrap stack in that environment is to use the bootstrap stack's
# qualifier as the "bootstrap_qualifier". If you don't use a bootstrap_qualifier, CDK will default
# to the default qualifier and try to use a bootstrap stack deployed in your account that has that
# qualifier.
#
# Regardless of how the bootstrap stack is deployed, it should be generated by `cdk bootstrap
# --show-template` to ensure maximum compatibility.
#
# IMPORTANT: Even when using the "bootstrapped" deployment_type, Sceptre WILL NOT use the actual
# bootstrapped deployment role to deploy the CloudFormation stack; It will use its own configured
# deployment environment, profile, and/or iam_role.
template:
type: cdk
# The path is always within your project's templates/ directory.
path: lambda_stack.py
deployment_type: bootstrapped
# bootstrap_qualifier is optional, but it's better to be explicit about it, even if you do
# want to use the "default" bootstrap stack in your account. Using !stack_output here ensures that
# we have a dependency between this stack and the bootstrap stack within Sceptre. If you don't
# add that output to the bootstrap stack, you can just pass the qualifier as a string here, but
# then you'll want to add an explicit dependency via `dependencies`. See note below on that.
bootstrap_qualifier: !stack_output cdk-bootstrap.yaml::Qualifier
# You can also pass CDK context key/value pairs. If you don't specify a context, the default
# context will be used (as determined by CDK). If you specify the context on the StackGroup config
# you can reference it via Jinja2 syntax like below.
context: {{cdk_context}}
# You can explicitly define your stack name
class_name: MyLambdaStack
# Parameters are DEPLOY-TIME values passed to the CloudFormation template. Your CDK stack construct
# needs to have CfnParameters in order to support this, though.
parameters:
SpecialEnv: "This is my Sceptre test"
# sceptre_user_data is passed to your Stack Class's constructor for supplying values at COMPILE-TIME.
sceptre_user_data:
special_variable: "use this directly at compile_time"
# If you deploy the bootstrap stack via Sceptre but DON'T add outputs for the qualifier to reference
# via !stack_output, you'll need to explicitly add a dependency this way so Sceptre knows to deploy
# the bootstrap stack FIRST, before deploying this stack.
#dependencies:
# cdk-bootstrap.yaml
# If you want to use the bootstrapped deployment action role, you'll need to set that as the iam_role
# But be careful if you do, since by default, the DeploymentActionRole doesn't actually have the
# right permissions to deploy most things. Setting the iam_role means you'll assume the deployment
# role to execute the cloudformation actions
# iam_role: !stack_output cdk-bootstrap.yaml::DeployRoleArn
# To work the way CDK bootstrap generally operates will mean you need to assign the cloudformation
# execution role to the stack from the bootstrap stack. This will be assumed by CloudFormation to
# actually deploy the infrastructure, permanently binding this role to the stack.
#role_arn: !stack_output cdk-bootstrap.yaml::CloudformationExecutionRoleArn