Hi, need help with `pulumi import` when storing th...
# aws
b
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
you should just be able to modify the code. When you run
pulumi up
it'll show you the changes
b
yes, that works, if i want to change
instance_type
but how do i change IOPS on a ebs_block_devices
b
b
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
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