Skip to content

Commit

Permalink
Merge pull request #2410 from TimeIncOSS/f-aws-lc-monitoring
Browse files Browse the repository at this point in the history
provider/aws: Add aws_launch_configuration.enable_monitoring
  • Loading branch information
radeksimko committed Jun 25, 2015
2 parents 7ae5128 + cbddab8 commit dc26f06
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions builtin/providers/aws/resource_aws_launch_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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))
}
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit dc26f06

Please sign in to comment.