From cbddab8a69b1dc59252a731e02534c4150e88c8b Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Sat, 20 Jun 2015 23:24:28 +0100 Subject: [PATCH] provider/aws: Add aws_launch_configuration.enable_monitoring --- .../aws/resource_aws_launch_configuration.go | 14 ++++++++++++++ .../aws/r/launch_configuration.html.markdown | 1 + 2 files changed, 15 insertions(+) diff --git a/builtin/providers/aws/resource_aws_launch_configuration.go b/builtin/providers/aws/resource_aws_launch_configuration.go index c5521496e..0eaa73771 100644 --- a/builtin/providers/aws/resource_aws_launch_configuration.go +++ b/builtin/providers/aws/resource_aws_launch_configuration.go @@ -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)) } @@ -423,6 +436,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 { diff --git a/website/source/docs/providers/aws/r/launch_configuration.html.markdown b/website/source/docs/providers/aws/r/launch_configuration.html.markdown index fdac028f1..49201e6f5 100644 --- a/website/source/docs/providers/aws/r/launch_configuration.html.markdown +++ b/website/source/docs/providers/aws/r/launch_configuration.html.markdown @@ -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.