forked from thunderbird/pulumi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__main__.py.example
More file actions
23 lines (18 loc) · 994 Bytes
/
__main__.py.example
File metadata and controls
23 lines (18 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/env python3
import tb_pulumi
import tb_pulumi.network
# Create a project to aggregate resources. This will allow consistent tagging, resource protection,
# etc. The naming is derived from the currently selected Pulumi project/stack. A configuration file
# called `config.$stack.yaml` is loaded from the current directory. See config.stack.yaml.example.
project = tb_pulumi.ThunderbirdPulumiProject()
# Pull the "resources" config mapping
resources = project.config.get('resources')
# Let's say we want to build a VPC with some private IP space. We can do this with a `MultiCidrVpc`.
vpc_opts = resources['tb:network:MultiCidrVpc']['vpc']
vpc = tb_pulumi.network.MultiCidrVpc(
# project.name_prefix combines the Pulumi project and stack name to create a unique prefix
f'{project.name_prefix}-vpc',
# Add this module's resources to the project
project,
# Map the rest of the config file directly into this function call, separating code from config
**vpc_opts)