https://pulumi.com logo
b

brash-scientist-65555

10/15/2020, 9:26 PM
Hello, I'm new to pulumi and trying to create my first EC2 instance. I've attached an ebsBlockDevice to the instance and for some reason, every time I run pulumi up, I receive a notice that the ebs device needs to be replaced. Any idea why this might be occurring? Declared in this manner: rootBlockDevice: { volumeSize: 150, deleteOnTermination: false, }, ebsBlockDevices: [{ deviceName: "/dev/sdb", volumeType: "gp2", volumeSize: 2048, deleteOnTermination: false, }] Receive message that deleteOnTermination and deviceName have changed based on my understanding of what I'm seeing... ~ ebsBlockDevices: [ ~ [0]: { ~ deleteOnTermination: false => false ~ deviceName : "/dev/sdb" => "/dev/sdb" + volumeSize : 2048 + volumeType : "gp2" } ]
l

little-cartoon-10569

10/15/2020, 9:39 PM
There's a big note on the terraform page documenting the feature on which it's based.
Currently, changes to the ebs_block_device configuration of existing resources cannot be automatically detected by Terraform. To manage changes and attachments of an EBS block to an instance, use the aws_ebs_volume and aws_volume_attachment resources instead. If you use ebs_block_device on an aws_instance, Terraform will assume management over the full set of non-root EBS block devices for the instance, treating additional block devices as drift. For this reason, ebs_block_device cannot be mixed with external aws_ebs_volume and aws_volume_attachment resources for a given instance.
I infer from that, that you might be better off omitting ebsBlockDevices, or else being very generous with your
ignoreChanges
opts.
b

brash-scientist-65555

10/15/2020, 10:11 PM
I suppose I can do it that way. It is odd behavior since nothing is changing. I even read where others have managed to get this working before (https://github.com/pulumi/pulumi-aws/issues/999). Since I am only adding a single non-root EBS device and getting this issue, I think is why I am confused.
l

little-cartoon-10569

10/15/2020, 10:14 PM
The
ignoreChanges
option will get you over the problem so long as you don't plan on, y'know, making any changes...
b

brash-scientist-65555

10/15/2020, 10:17 PM
Gotcha. Thank you.
👍 1