pulumi-templates/linode/__main__.py

25 lines
658 B
Python
Raw Normal View History

"""A Linode Python Pulumi program"""
import pulumi
import pulumi_linode
import yaml
from dotmap import DotMap
config = DotMap(yaml.safe_load(open("input.yaml").read()))
# Create a Linode resource (Linode Instance)
instance = pulumi_linode.Instance(config.vm.name,
type=config.linode.type,
region=config.linode.region,
image=config.linode.image,
label=config.vm.name,
root_pass=config.vm.root_password,
2024-04-19 01:09:07 +02:00
authorized_keys=config.vm.sshkeys,
opts=pulumi.ResourceOptions(
custom_timeouts=pulumi.CustomTimeouts(create="2m")
)
)
# Export the Instance label of the instance
pulumi.export('ip_address', instance.ip_address)