# Copyright 2016-2018, Pulumi Corporation. All rights reserved. import pulumi from pulumi_aws import ec2 from ami import get_linux_ami size = 't2.micro' group = ec2.SecurityGroup('web-secgrp', description='Enable HTTP access', ingress=[{ 'protocol': 'tcp', 'from_port': 80, 'to_port': 80, 'cidr_blocks': ['0.0.0.0/0'] }]) server = ec2.Instance('web-server-www', instance_type=size, security_groups=[group.name], ami=get_linux_ami(size)) pulumi.output('public_ip', server.public_ip) pulumi.output('public_dns', server.public_dns)
vm_size='Standard_A0', delete_data_disks_on_termination=True, delete_os_disk_on_termination=True, os_profile={ 'computer_name': 'hostname', 'admin_username': username, 'admin_password': password, 'custom_data': user_data, }, os_profile_linux_config={ 'disable_password_authentication': False, }, storage_os_disk={ 'create_option': 'FromImage', 'name': 'myosdisk1', }, storage_image_reference={ 'publisher': 'canonical', 'offer': 'UbuntuServer', 'sku': '16.04-LTS', 'version': 'latest', }, boot_diagnostics={ 'enabled': True, 'storage_uri': sa.primary_blob_endpoint, }) # Note - due to a bug in the terraform-provider-azurerm, the public IP address is not yet populated corerctly. pulumi.output('public_ip_address', public_ip.ip_address) pulumi.output('private_ip_address', nic.private_ip_address)
import pulumi from pulumi_aws import s3 # Create an AWS resource (S3 Bucket) bucket = s3.Bucket('my-bucket') # Export the DNS name of the bucket pulumi.output('bucket_name', bucket.bucket_domain_name)
# Copyright 2016-2018, Pulumi Corporation. All rights reserved. import iam import pulumi from pulumi_aws import lambda_, sfn hello_world_fn = lambda_.Function( 'helloWorldFunction', role=iam.lambda_role.arn, runtime="python2.7", handler="hello_step.hello", code=pulumi.AssetArchive({'.': pulumi.FileArchive('./step_hello')})) state_defn = state_machine = sfn.StateMachine('stateMachine', role_arn=iam.sfn_role.arn, definition="""{ "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function", "StartAt": "HelloWorld", "States": { "HelloWorld": { "Type": "Task", "Resource": "%s", "End": true } } }""" % hello_world_fn.arn) pulumi.output('state_machine_arn', state_machine.id)