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

issue #4857 Can't use spot instances with aws_launch_template #4952

Merged
merged 1 commit into from
Jun 22, 2018

Conversation

saravanan30erd
Copy link
Contributor

Fixes #4857

Changes proposed in this pull request:

  • Change 1:

By default, if we didn't mention the valid_until option in config then the default end date is 7 days from the current date.
But I was getting the below error if I didn't mention the valid_until option.

  • aws_launch_template.foo: Error Parsing Launch Template Spot Options valid until: parsing time "" as "2006-01-02T15:04:05Z07:00": cannot parse "" as "2006"

Implemented the value validation before referencing the value.

  • Change 2:

If I mention the valid_until to some valid value 2020-11-04T20:44:20.000Z, then I was getting the below error(state)

  • aws_launch_template.foo: instance_market_options.0.spot_options.0.valid_until: '' expected type 'string', got unconvertible type 'time.Time'

Formatting the value before setting it to state.

@ghost ghost added the size/S Managed by automation to categorize the size of a PR. label Jun 22, 2018
@felipe-vvoosh
Copy link
Contributor

Nice one!

@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 bflad added this to the v1.25.0 milestone Jun 22, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @saravanan30erd! 🚀

In this case Computed: true seems appropriate.

7 tests passed (all tests)
=== RUN   TestAccAWSLaunchTemplate_data
--- PASS: TestAccAWSLaunchTemplate_data (7.02s)
=== RUN   TestAccAWSLaunchTemplate_basic
--- PASS: TestAccAWSLaunchTemplate_basic (7.16s)
=== RUN   TestAccAWSLaunchTemplate_importData
--- PASS: TestAccAWSLaunchTemplate_importData (7.84s)
=== RUN   TestAccAWSLaunchTemplate_importBasic
--- PASS: TestAccAWSLaunchTemplate_importBasic (7.86s)
=== RUN   TestAccAWSLaunchTemplate_BlockDeviceMappings_EBS
--- PASS: TestAccAWSLaunchTemplate_BlockDeviceMappings_EBS (8.77s)
=== RUN   TestAccAWSLaunchTemplate_update
--- PASS: TestAccAWSLaunchTemplate_update (11.77s)
=== RUN   TestAccAWSLaunchTemplate_tags
--- PASS: TestAccAWSLaunchTemplate_tags (12.21s)

@bflad bflad merged commit 6585df6 into hashicorp:master Jun 22, 2018
bflad added a commit that referenced this pull request 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

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. size/S Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't use spot instances with aws_launch_template
3 participants