docs: AWS launch configuration

* Spot instance documentation
This commit is contained in:
Chavez 2015-09-16 11:50:19 -07:00
parent 25bba59676
commit ac42432690
1 changed files with 35 additions and 4 deletions

View File

@ -53,6 +53,35 @@ With this setup Terraform generates a unique name for your Launch
Configuration and can then update the AutoScaling Group without conflict before Configuration and can then update the AutoScaling Group without conflict before
destroying the previous Launch Configuration. destroying the previous Launch Configuration.
## Using with Spot Instances
Launch configurations can set the spot instance pricing to be used for the
Auto Scaling Group to reserve instances. Simply specifying the `spot_price`
parameter will set the price on the Launch Configuration which will attempt to
reserve your instances at this price. See the [AWS Spot Instance
documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html)
for more information or how to launch [Spot Instances][3] with Terraform.
```
resource "aws_launch_configuration" "as_conf" {
image_id = "ami-1234"
instance_type = "m1.small"
spot_price = "0.001"
lifecycle {
create_before_destroy = true
}
}
resource "aws_autoscaling_group" "bar" {
name = "terraform-asg-example"
launch_configuration = "${aws_launch_configuration.as_conf.name}"
lifecycle {
create_before_destroy = true
}
}
```
## Argument Reference ## Argument Reference
The following arguments are supported: The following arguments are supported:
@ -70,6 +99,7 @@ The following arguments are supported:
* `enable_monitoring` - (Optional) Enables/disables detailed monitoring. This is enabled by default. * `enable_monitoring` - (Optional) Enables/disables detailed monitoring. This is enabled by default.
* `ebs_optimized` - (Optional) If true, the launched EC2 instance will be EBS-optimized. * `ebs_optimized` - (Optional) If true, the launched EC2 instance will be EBS-optimized.
* `block_device_mapping` - (Optional) A list of block devices to add. Their keys are documented below. * `block_device_mapping` - (Optional) A list of block devices to add. Their keys are documented below.
* `spot_price` - (Optional) The price to use for reserving spot instances.
<a id="block-devices"></a> <a id="block-devices"></a>
## Block devices ## Block devices
@ -134,3 +164,4 @@ The following attributes are exported:
[1]: /docs/providers/aws/r/autoscaling_group.html [1]: /docs/providers/aws/r/autoscaling_group.html
[2]: /docs/configuration/resources.html#lifecycle [2]: /docs/configuration/resources.html#lifecycle
[3]: /docs/providers/aws/r/spot_instance_request.html