示例#1
0
import pulumi
import pulumi_random as random

random_pet = random.RandomPet("random-pet", prefix="doggo")
示例#2
0
import pulumi
import pulumi_random as random
import pulumi_azuredevops as ado

project_name = random.RandomPet("demo-project-name")

project = ado.Project("demo-project", name=project_name)

pulumi.export("project_name", project.name)
示例#3
0
import pulumi_packet as packet
import pulumi_random as random
from pulumi import export

random_host_name = random.RandomPet("hostname")

project = packet.get_project(
    name="ci-project"
)

vm = packet.Device(
    "vm",
    billing_cycle="hourly",
	facilities=["ewr1"],
    hostname=random_host_name.id,
    operating_system="coreos_stable",
    plan="baremetal_0",
    project_id=project.id,
    ip_address_types=["public_ipv4", "private_ipv4"],
)

export('ip', vm.access_public_ipv4)
export('name', vm.hostname)
示例#4
0
import pulumi
import pulumi_aws as aws
import pulumi_tls as tls
import pulumi_random as random
from pulumi_vars import *

pet = random.RandomPet("key")
#pet.id.apply(lambda id: f"{id}"))
key = tls.PrivateKey(id + '_pkey', algorithm="RSA", ecdsa_curve="2048")

pulumi.export('public_key', key.public_key_openssh)
pulumi.export('private_key', key.private_key_pem)
pulumi.Output.all([key.private_key_pem]).apply(lambda key: f'key')
key.private_key_pem.apply(lambda key: f'key')

#private_key_pem_file = open(id + '_pkey.pem', 'w')
#private_key_pem_file.write(pulumi.Output.all([key.private_key_pem]).apply(lambda key: f'key'))
#private_key_pem_file.close()

keypair = aws.ec2.KeyPair(id + '_keypair', public_key=key.public_key_openssh)
示例#5
0
import pulumi_packet as packet
import pulumi_random as random
from pulumi import export

random_host_name = random.RandomPet("hostname")
random_project_name = random.RandomPet("projectname")

project = packet.Project(
    "project",
    name=random_project_name.id,
)

vm = packet.Device(
    "vm",
    billing_cycle="hourly",
    facility="ewr1",
    hostname=random_host_name.id,
    operating_system="coreos_stable",
    plan="baremetal_0",
    project_id=project.id,
    ip_address_types=["public_ipv4"],
)

export('ip', vm.access_public_ipv4)
export('name', vm.hostname)
示例#6
0
import pulumi
import pulumi_random as random

resource_lexical_name = random.RandomPet("aA-Alpha_alpha.🤯⁉️")
pulumi.export("bB-Beta_beta.💜⁉", resource_lexical_name.id)