25 lines
658 B
Python
25 lines
658 B
Python
"""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,
|
|
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)
|