Closed Defozo closed 5 years ago
Terraform v0.11.10
"resource" "spotinst_elastigroup_aws" "default" { "name" = "default" "spot_percentage" = 100 "orientation" = "balanced" "draining_timeout" = 120 "fallback_to_ondemand" = true "lifetime_period" = "days" "desired_capacity" = 2 "min_size" = 0 "max_size" = 4 "capacity_unit" = "instance" "instance_types_ondemand" = "t2.small" "instance_types_spot" = ["t2.small", "t3.small"] "subnet_ids" = ["subnet-5c12345a"] "product" = "Linux/UNIX" "security_groups" = ["sg-12345678"] "enable_monitoring" = false "ebs_optimized" = false "image_id" = "ami-0150b2ec056e3c3c1" "key_name" = "default" "network_interface" = { "device_index" = 0 "associate_public_ip_address" = true "delete_on_termination" = true } "user_data" = "IyEvYmluL2Jhc2gKCm1rZGlyIC9kZXYvbXF1ZXVlCm1vdW50IC10IG1xdWV1ZSBub25lIC9kZXYvbXF1ZXVlCgpkb2NrZXIgcGx1Z2luIGluc3RhbGwgLS1hbGlhcyBjbG91ZHN0b3I6YXdzIC0tZ3JhbnQtYWxsLXBlcm1pc3Npb25zIGRvY2tlcjR4L2Nsb3Vkc3RvcjoxNy4wNi4wLWNlLWF3czIgQ0xPVURfUExBVEZPUk09QVdTIEFXU19SRUdJT049ZXUtd2VzdC0xIEVGU19TVVBQT1JURUQ9MCBERUJVRz0xCnNlcnZpY2UgZG9ja2VyIHJlc3RhcnQ=" "tags" = { "key" = "Spotinst" "value" = "true" } "health_check_type" = "ECS_CLUSTER_INSTANCE" "health_check_grace_period" = 300 "health_check_unhealthy_duration_before_replacement" = 120 "integration_ecs" = { "cluster_name" = "default" "autoscale_is_enabled" = true } "region" = "eu-west-1" }
The Spotinst Elastigroup should be created and after that creation running terraform plan shouldn't point out any changes needed.
terraform plan
The Spotinst Elastigroup is being created successfully but then when I run terraform plan it points out that user_data has been changed.
terraform apply
Similar problem in the AWS provider: https://github.com/terraform-providers/terraform-provider-aws/issues/4954
Similar problem in the Spotinst provider: https://github.com/terraform-providers/terraform-provider-spotinst/issues/23
Pull request probably worth referencing: https://github.com/terraform-providers/terraform-provider-spotinst/pull/39
Thanks for reporting @Defozo. The changes from #39 were released in v1.10.0, which should resolve this issue. If you encounter future trouble with user data (or other base64 encoded strings) please let me know!
Terraform Version
Terraform v0.11.10
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
The Spotinst Elastigroup should be created and after that creation running
terraform plan
shouldn't point out any changes needed.Actual Behavior
The Spotinst Elastigroup is being created successfully but then when I run
terraform plan
it points out that user_data has been changed.Steps to Reproduce
terraform apply
terraform plan
References
Similar problem in the AWS provider: https://github.com/terraform-providers/terraform-provider-aws/issues/4954
Similar problem in the Spotinst provider: https://github.com/terraform-providers/terraform-provider-spotinst/issues/23
Pull request probably worth referencing: https://github.com/terraform-providers/terraform-provider-spotinst/pull/39