pulumi-aws icon indicating copy to clipboard operation
pulumi-aws copied to clipboard

Import of SpotInstanceRequest duplicates property instanceInterruptionBehavior

Open chivandikwa opened this issue 2 years ago • 2 comments

Hello!

  • Vote on this issue by adding a 👍 reaction
  • To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already)

Issue details

Importing an existing AWS SpotInstanceRequest duplicates the property instanceInterruptionBehavior

instanceInterruptionBehavior: "stop", instanceInterruptionBehavior: "stop",

A diagnostic warning is also issues for this.

Diagnostics: aws:ec2:SpotInstanceRequest (linux-build2-spot-request): warning: One or more imported inputs failed to validate. This is almost certainly a bug in the aws provider. The import will still proceed, but you will need to edit the generated code after copying it into your program. warning: aws:ec2/spotInstanceRequest:SpotInstanceRequest resource 'linux-build2-spot-request' has a problem: Conflicting configuration arguments: "instance_interruption_behaviour": conflicts with instance_interruption_behavior. Examine values at 'SpotInstanceRequest.InstanceInterruptionBehaviour'. warning: aws:ec2/spotInstanceRequest:SpotInstanceRequest resource 'linux-build2-spot-request' has a problem: Conflicting configuration arguments: "instance_interruption_behavior": conflicts with instance_interruption_behaviour. Examine values at 'SpotInstanceRequest.InstanceInterruptionBehavior'.

Without fixing this on attempt to update the resources Pulumi will now attempt to delete that resource. Manually removing the duplicate however fixes the issues.

Steps to reproduce

  1. Import and existing AWS Spot Instance request with command `pulumi import aws:ec2/spotInstanceRequest:SpotInstanceRequest name id
  2. Notice the diagnostic error
  3. Copy import code to your stack
  4. Run Pulumi preview and notice that it attempts to delete the resource

Expected: The resource to be imported without a diagnostic warning and duplicate field Actual: The resource is imported with a diagnostic warning and duplicate field

chivandikwa avatar Mar 19 '22 09:03 chivandikwa

Hi @chivandikwa - thank you for filing this issue. ❤️

Can you verify the version of Pulumi you're using? We've been shipping a lot of updates to Pulumi Import recently so if you could verify this bug on the most recent version, that would be very helpful!

The error message notwithstanding, this seems like it is an issue with Pulumi itself rather than this specific provider.

guineveresaenger avatar Mar 22 '22 23:03 guineveresaenger

Hi @guineveresaenger I was using version 3.27.0

chivandikwa avatar Apr 02 '22 18:04 chivandikwa