Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing elastigroup_aws.product should force a new resource #79

Open
marcosdiez opened this issue Mar 3, 2020 · 0 comments
Open

Changing elastigroup_aws.product should force a new resource #79

marcosdiez opened this issue Mar 3, 2020 · 0 comments
Assignees

Comments

@marcosdiez
Copy link

Terraform Version

Terraform v0.12.21
+ provider.aws v2.48.0
+ provider.null v2.1.2
+ provider.spotinst v1.14.2
+ provider.template v2.1.2

Affected Resource(s)

  • spotinst_elastigroup_aws.product

Terraform Configuration Files

the problem happens whenever I change the product value in spotinst_elastigroup_aws.
It complains that property is immutable, hence terraform should destroy and recreate the resource for me.

resource "spotinst_elastigroup_aws" "default-elastigroup" {
    # redacted
    product     = "Linux/UNIX"
}

to

resource "spotinst_elastigroup_aws" "default-elastigroup" {
    # redacted
    product     = "Linux/UNIX (Amazon VPC)"
}

Debug Output

Error: field [product] is immutable, cannot be changed post creation

  on ../modules_tf12/ec2_spotinst/ec2_spotinst.tf line 423, in resource "spotinst_elastigroup_aws" "default-elastigroup":
 423: resource "spotinst_elastigroup_aws" "default-elastigroup" {

Expected Behavior

Terraform should destroy and create the resource for me again

Actual Behavior

I receive an error

Steps to Reproduce

  1. create a resource with the product value being "Linux/UNIX"
  2. terraform apply
  3. change it to "Linux/UNIX (Amazon VPC)"
  4. terraform apply

Important Factoids

Yes, I know a workaround is to taint my resources, and I am doing exactly that.

That being said, I messed up because the documentation is also misleading:

https://www.terraform.io/docs/providers/spotinst/r/elastigroup_aws.html#product

product - (Required) Operation system type. Valid values: "Linux/UNIX", "SUSE Linux", "Windows". For EC2 Classic instances: "Linux/UNIX (Amazon VPC)", "SUSE Linux (Amazon VPC)", "Windows (Amazon VPC)".

I would write:

product - (Required) Operation system type. Valid values for EC2 Instances in Amazon VPC: "Linux/UNIX (Amazon VPC)", "SUSE Linux (Amazon VPC)", "Windows (Amazon VPC)". For the old EC2 Classic instances, use "Linux/UNIX", "SUSE Linux", "Windows".

And since I read somewhere that this setting affects your algorithm of getting the cheapest instances, which is your core business, this bug might be important.

@marcosdiez marcosdiez changed the title a change in spotinst_elastigroup_aws.product should force a new resource Changing elastigroup_aws.product should force a new resource Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants