Merge pull request #2410 from TimeIncOSS/f-aws-lc-monitoring

provider/aws: Add aws_launch_configuration.enable_monitoring
This commit is contained in:
Radek Simko 2015-06-25 07:02:56 +01:00
commit dc26f06b5f
2 changed files with 15 additions and 0 deletions

View File

@ -106,6 +106,13 @@ func resourceAwsLaunchConfiguration() *schema.Resource {
ForceNew: true,
},
"enable_monitoring": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Computed: true,
ForceNew: true,
},
"ebs_block_device": &schema.Schema{
Type: schema.TypeSet,
Optional: true,
@ -256,6 +263,12 @@ func resourceAwsLaunchConfigurationCreate(d *schema.ResourceData, meta interface
createLaunchConfigurationOpts.UserData = aws.String(userData)
}
if v, ok := d.GetOk("enable_monitoring"); ok {
createLaunchConfigurationOpts.InstanceMonitoring = &autoscaling.InstanceMonitoring{
Enabled: aws.Boolean(v.(bool)),
}
}
if v, ok := d.GetOk("iam_instance_profile"); ok {
createLaunchConfigurationOpts.IAMInstanceProfile = aws.String(v.(string))
}
@ -440,6 +453,7 @@ func resourceAwsLaunchConfigurationRead(d *schema.ResourceData, meta interface{}
d.Set("iam_instance_profile", lc.IAMInstanceProfile)
d.Set("ebs_optimized", lc.EBSOptimized)
d.Set("spot_price", lc.SpotPrice)
d.Set("enable_monitoring", lc.InstanceMonitoring.Enabled)
d.Set("security_groups", lc.SecurityGroups)
if err := readLCBlockDevices(d, lc, ec2conn); err != nil {

View File

@ -34,6 +34,7 @@ The following arguments are supported:
* `security_groups` - (Optional) A list of associated security group IDS.
* `associate_public_ip_address` - (Optional) Associate a public ip address with an instance in a VPC.
* `user_data` - (Optional) The user data to provide when launching the instance.
* `enable_monitoring` - (Optional) Enables/disables detailed monitoring. This is enabled by default.
* `block_device_mapping` - (Optional) A list of block devices to add. Their keys are documented below.
<a id="block-devices"></a>