https://pulumi.com logo
#aws
Title
# aws
b

broad-hairdresser-1495

03/30/2021, 6:08 PM
Hi, need help with
pulumi import
when storing this in local file after this command
pulumi import aws:ec2/instance:Instance myInstanceName i-0ba17989210ad396a
i get this output (and a .pulumi/aws_test.json file with whole EC2 instance):
Copy code
import pulumi
import pulumi_aws as aws

eu1tst_rhtestloadgen002 = aws.ec2.Instance("eu1tst-rhtestloadgen002",
    ami="ami-04c89a19fea29f1f0",
    ebs_optimized=True,
    get_password_data=False,
    instance_type="c4.2xlarge",
    source_dest_check=True,
    tags={
        "Name": "eu1tst-rhtestloadgen002"
    },
    opts=pulumi.ResourceOptions(protect=True))
this works fine when running
pulumi up
and i get no changes. but how do i make volume changes on existing AWS EC2 instance after import?
b

billowy-army-68599

03/30/2021, 6:15 PM
you should just be able to modify the code. When you run
pulumi up
it'll show you the changes
b

broad-hairdresser-1495

03/30/2021, 6:34 PM
yes, that works, if i want to change
instance_type
but how do i change IOPS on a ebs_block_devices
b

billowy-army-68599

03/30/2021, 6:52 PM
b

broad-hairdresser-1495

03/31/2021, 9:26 AM
Thanks that helped me some. I noticed that when changing
ebs_block_devices
pulumi wants to destroy that disk and create a new one 🙂 but i dont want to do that.
b

billowy-army-68599

03/31/2021, 3:41 PM
If Pulumi wants to destroy when you modify the instance that’s likely because the upstream api doesn’t support attaching the volume without recreating
3 Views