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

azurerm_application_insights - add disable_ip_masking property #6354

Merged
merged 3 commits into from
Apr 10, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ func resourceArmApplicationInsights() *schema.Resource {
ValidateFunc: validation.FloatBetween(0, 100),
},

"disable_ip_masking": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},

"tags": tags.Schema(),

"daily_data_cap_in_gb": {
Expand Down Expand Up @@ -141,13 +147,15 @@ func resourceArmApplicationInsightsCreateUpdate(d *schema.ResourceData, meta int

applicationType := d.Get("application_type").(string)
samplingPercentage := utils.Float(d.Get("sampling_percentage").(float64))
disableIpMasking := d.Get("disable_ip_masking").(bool)
location := azure.NormalizeLocation(d.Get("location").(string))
t := d.Get("tags").(map[string]interface{})

applicationInsightsComponentProperties := insights.ApplicationInsightsComponentProperties{
ApplicationID: &name,
ApplicationType: insights.ApplicationType(applicationType),
SamplingPercentage: samplingPercentage,
DisableIPMasking: utils.Bool(disableIpMasking),
}

if v, ok := d.GetOk("retention_in_days"); ok {
Expand Down Expand Up @@ -243,6 +251,7 @@ func resourceArmApplicationInsightsRead(d *schema.ResourceData, meta interface{}
d.Set("app_id", props.AppID)
d.Set("instrumentation_key", props.InstrumentationKey)
d.Set("sampling_percentage", props.SamplingPercentage)
d.Set("disable_ip_masking", props.DisableIPMasking)
if v := props.RetentionInDays; v != nil {
d.Set("retention_in_days", v)
}
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/application_insights.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ The following arguments are supported:

* `sampling_percentage` - (Optional) Specifies the percentage of the data produced by the monitored application that is sampled for Application Insights telemetry.

* `disable_ip_masking` - (Optional) In order to enable IP collection and storage this property must be set to true. Defaults to `false`.

* `tags` - (Optional) A mapping of tags to assign to the resource.

## Attributes Reference
Expand Down