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

Can't use spot instances with aws_launch_template #4857

Closed
ghost opened this issue Jun 16, 2018 · 4 comments · Fixed by #4952
Closed

Can't use spot instances with aws_launch_template #4857

ghost opened this issue Jun 16, 2018 · 4 comments · Fixed by #4952
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@ghost
Copy link

ghost commented Jun 16, 2018

This issue was originally opened by @felipe-vvoosh as hashicorp/terraform#18270. It was migrated here as a result of the provider split. The original body of the issue is below.


There's an issue evaluating valid_until...

If you plan and apply, the launch_template is applied correctly but it breaks the terraform.tfstate file... After that, even a terraform refresh will give this error:

Error: aws_launch_template.test (import id: lt-123456): 1 error(s) occurred:

* import aws_launch_template.test result: lt-123456: aws_launch_template.test: instance_market_options.0.spot_options.0.valid_until: '' expected type 'string', got unconvertible type 'time.Time'
Terraform v0.11.7
+ provider.aws v1.22.0
+ provider.template v1.0.0

AWS INSTANCE MARKET OPTIONS OF LAUNCH_TEMPLATE VERSION:

               "InstanceMarketOptions": {
                    "MarketType": "spot",
                    "SpotOptions": {
                        "MaxPrice": "0.05",
                        "SpotInstanceType": "persistent",
                        "ValidUntil": "2020-11-04T20:44:20.000Z",
                        "InstanceInterruptionBehavior": "stop"
                    }
                }

COMMAND

terraform import aws_launch_template.test lt-123456

TF FILE

resource "aws_launch_template" "test" {

}

DEBUG:

2018/06/16 11:53:53 [ERROR] root: eval: *terraform.EvalRefresh, err: aws_launch_template.test: instance_market_options.0.spot_options.0.valid_until: '' expected type 'string', got unconvertible type 'time.Time'
2018/06/16 11:53:53 [ERROR] root: eval: *terraform.EvalSequence, err: aws_launch_template.test: instance_market_options.0.spot_options.0.valid_until: '' expected type 'string', got unconvertible type 'time.Time'

Error: aws_launch_template.test (import id: lt-123456): 1 error(s) occurred:

* import aws_launch_template.test result: lt-123456: aws_launch_template.test: instance_market_options.0.spot_options.0.valid_until: '' expected type 'string', got unconvertible type 'time.Time'
@saravanan30erd
Copy link
Contributor

Submitted PR #4952

bflad added a commit that referenced this issue Jun 22, 2018
issue #4857 Can't use spot instances with aws_launch_template
@bflad bflad added bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. labels Jun 22, 2018
@bflad
Copy link
Contributor

bflad commented Jun 22, 2018

The fix for this has been merged into master and will release with version 1.25.0 of the AWS provider, likely middle of next week.

@bflad bflad added this to the v1.25.0 milestone Jun 22, 2018
@bflad
Copy link
Contributor

bflad commented Jun 27, 2018

This has been released in version 1.25.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link
Author

ghost commented Apr 4, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants