azure-native.aadiam.DiagnosticSetting
Explore with Pulumi AI
The diagnostic setting resource. API Version: 2017-04-01.
Example Usage
BatchAccountDelete
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var diagnosticSetting = new AzureNative.AadIam.DiagnosticSetting("diagnosticSetting", new()
{
EventHubAuthorizationRuleId = "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule",
EventHubName = "myeventhub",
Logs = new[]
{
new AzureNative.AadIam.Inputs.LogSettingsArgs
{
Category = "AuditLogs",
Enabled = true,
RetentionPolicy = new AzureNative.AadIam.Inputs.RetentionPolicyArgs
{
Days = 0,
Enabled = false,
},
},
},
Name = "mysetting",
StorageAccountId = "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1",
WorkspaceId = "",
});
});
package main
import (
aadiam "github.com/pulumi/pulumi-azure-native-sdk/aadiam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := aadiam.NewDiagnosticSetting(ctx, "diagnosticSetting", &aadiam.DiagnosticSettingArgs{
EventHubAuthorizationRuleId: pulumi.String("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule"),
EventHubName: pulumi.String("myeventhub"),
Logs: []aadiam.LogSettingsArgs{
{
Category: pulumi.String("AuditLogs"),
Enabled: pulumi.Bool(true),
RetentionPolicy: {
Days: pulumi.Int(0),
Enabled: pulumi.Bool(false),
},
},
},
Name: pulumi.String("mysetting"),
StorageAccountId: pulumi.String("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1"),
WorkspaceId: pulumi.String(""),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.aadiam.DiagnosticSetting;
import com.pulumi.azurenative.aadiam.DiagnosticSettingArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var diagnosticSetting = new DiagnosticSetting("diagnosticSetting", DiagnosticSettingArgs.builder()
.eventHubAuthorizationRuleId("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule")
.eventHubName("myeventhub")
.logs(Map.ofEntries(
Map.entry("category", "AuditLogs"),
Map.entry("enabled", true),
Map.entry("retentionPolicy", Map.ofEntries(
Map.entry("days", 0),
Map.entry("enabled", false)
))
))
.name("mysetting")
.storageAccountId("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1")
.workspaceId("")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
diagnostic_setting = azure_native.aadiam.DiagnosticSetting("diagnosticSetting",
event_hub_authorization_rule_id="/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule",
event_hub_name="myeventhub",
logs=[{
"category": "AuditLogs",
"enabled": True,
"retentionPolicy": azure_native.aadiam.RetentionPolicyArgs(
days=0,
enabled=False,
),
}],
name="mysetting",
storage_account_id="/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1",
workspace_id="")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const diagnosticSetting = new azure_native.aadiam.DiagnosticSetting("diagnosticSetting", {
eventHubAuthorizationRuleId: "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule",
eventHubName: "myeventhub",
logs: [{
category: "AuditLogs",
enabled: true,
retentionPolicy: {
days: 0,
enabled: false,
},
}],
name: "mysetting",
storageAccountId: "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1",
workspaceId: "",
});
resources:
diagnosticSetting:
type: azure-native:aadiam:DiagnosticSetting
properties:
eventHubAuthorizationRuleId: /subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule
eventHubName: myeventhub
logs:
- category: AuditLogs
enabled: true
retentionPolicy:
days: 0
enabled: false
name: mysetting
storageAccountId: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1
workspaceId:
Create DiagnosticSetting Resource
new DiagnosticSetting(name: string, args?: DiagnosticSettingArgs, opts?: CustomResourceOptions);
@overload
def DiagnosticSetting(resource_name: str,
opts: Optional[ResourceOptions] = None,
event_hub_authorization_rule_id: Optional[str] = None,
event_hub_name: Optional[str] = None,
logs: Optional[Sequence[LogSettingsArgs]] = None,
name: Optional[str] = None,
service_bus_rule_id: Optional[str] = None,
storage_account_id: Optional[str] = None,
workspace_id: Optional[str] = None)
@overload
def DiagnosticSetting(resource_name: str,
args: Optional[DiagnosticSettingArgs] = None,
opts: Optional[ResourceOptions] = None)
func NewDiagnosticSetting(ctx *Context, name string, args *DiagnosticSettingArgs, opts ...ResourceOption) (*DiagnosticSetting, error)
public DiagnosticSetting(string name, DiagnosticSettingArgs? args = null, CustomResourceOptions? opts = null)
public DiagnosticSetting(String name, DiagnosticSettingArgs args)
public DiagnosticSetting(String name, DiagnosticSettingArgs args, CustomResourceOptions options)
type: azure-native:aadiam:DiagnosticSetting
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DiagnosticSettingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args DiagnosticSettingArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DiagnosticSettingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DiagnosticSettingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DiagnosticSettingArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
DiagnosticSetting Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The DiagnosticSetting resource accepts the following input properties:
- string
The resource Id for the event hub authorization rule.
- Event
Hub stringName The name of the event hub. If none is specified, the default event hub will be selected.
- Logs
List<Pulumi.
Azure Native. Aad Iam. Inputs. Log Settings Args> The list of logs settings.
- Name string
The name of the diagnostic setting.
- Service
Bus stringRule Id The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.
- Storage
Account stringId The resource ID of the storage account to which you would like to send Diagnostic Logs.
- Workspace
Id string The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2
- string
The resource Id for the event hub authorization rule.
- Event
Hub stringName The name of the event hub. If none is specified, the default event hub will be selected.
- Logs
[]Log
Settings Args The list of logs settings.
- Name string
The name of the diagnostic setting.
- Service
Bus stringRule Id The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.
- Storage
Account stringId The resource ID of the storage account to which you would like to send Diagnostic Logs.
- Workspace
Id string The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2
- String
The resource Id for the event hub authorization rule.
- event
Hub StringName The name of the event hub. If none is specified, the default event hub will be selected.
- logs
List<Log
Settings Args> The list of logs settings.
- name String
The name of the diagnostic setting.
- service
Bus StringRule Id The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.
- storage
Account StringId The resource ID of the storage account to which you would like to send Diagnostic Logs.
- workspace
Id String The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2
- string
The resource Id for the event hub authorization rule.
- event
Hub stringName The name of the event hub. If none is specified, the default event hub will be selected.
- logs
Log
Settings Args[] The list of logs settings.
- name string
The name of the diagnostic setting.
- service
Bus stringRule Id The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.
- storage
Account stringId The resource ID of the storage account to which you would like to send Diagnostic Logs.
- workspace
Id string The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2
- str
The resource Id for the event hub authorization rule.
- event_
hub_ strname The name of the event hub. If none is specified, the default event hub will be selected.
- logs
Sequence[Log
Settings Args] The list of logs settings.
- name str
The name of the diagnostic setting.
- service_
bus_ strrule_ id The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.
- storage_
account_ strid The resource ID of the storage account to which you would like to send Diagnostic Logs.
- workspace_
id str The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2
- String
The resource Id for the event hub authorization rule.
- event
Hub StringName The name of the event hub. If none is specified, the default event hub will be selected.
- logs List<Property Map>
The list of logs settings.
- name String
The name of the diagnostic setting.
- service
Bus StringRule Id The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.
- storage
Account StringId The resource ID of the storage account to which you would like to send Diagnostic Logs.
- workspace
Id String The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2
Outputs
All input properties are implicitly available as output properties. Additionally, the DiagnosticSetting resource produces the following output properties:
Supporting Types
Category
- Audit
Logs - AuditLogs
- Sign
In Logs - SignInLogs
- Category
Audit Logs - AuditLogs
- Category
Sign In Logs - SignInLogs
- Audit
Logs - AuditLogs
- Sign
In Logs - SignInLogs
- Audit
Logs - AuditLogs
- Sign
In Logs - SignInLogs
- AUDIT_LOGS
- AuditLogs
- SIGN_IN_LOGS
- SignInLogs
- "Audit
Logs" - AuditLogs
- "Sign
In Logs" - SignInLogs
LogSettings
- Enabled bool
A value indicating whether this log is enabled.
- Category
string | Pulumi.
Azure Native. Aad Iam. Category Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
- Retention
Policy Pulumi.Azure Native. Aad Iam. Inputs. Retention Policy The retention policy for this log.
- Enabled bool
A value indicating whether this log is enabled.
- Category string | Category
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
- Retention
Policy RetentionPolicy The retention policy for this log.
- enabled Boolean
A value indicating whether this log is enabled.
- category String | Category
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
- retention
Policy RetentionPolicy The retention policy for this log.
- enabled boolean
A value indicating whether this log is enabled.
- category string | Category
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
- retention
Policy RetentionPolicy The retention policy for this log.
- enabled bool
A value indicating whether this log is enabled.
- category str | Category
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
- retention_
policy RetentionPolicy The retention policy for this log.
- enabled Boolean
A value indicating whether this log is enabled.
- category
String | "Audit
Logs" | "Sign In Logs" Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
- retention
Policy Property Map The retention policy for this log.
LogSettingsResponse
- Enabled bool
A value indicating whether this log is enabled.
- Category string
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
- Retention
Policy Pulumi.Azure Native. Aad Iam. Inputs. Retention Policy Response The retention policy for this log.
- Enabled bool
A value indicating whether this log is enabled.
- Category string
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
- Retention
Policy RetentionPolicy Response The retention policy for this log.
- enabled Boolean
A value indicating whether this log is enabled.
- category String
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
- retention
Policy RetentionPolicy Response The retention policy for this log.
- enabled boolean
A value indicating whether this log is enabled.
- category string
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
- retention
Policy RetentionPolicy Response The retention policy for this log.
- enabled bool
A value indicating whether this log is enabled.
- category str
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
- retention_
policy RetentionPolicy Response The retention policy for this log.
- enabled Boolean
A value indicating whether this log is enabled.
- category String
Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
- retention
Policy Property Map The retention policy for this log.
RetentionPolicy
RetentionPolicyResponse
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:aadiam:DiagnosticSetting mysetting providers/microsoft.aadiam/diagnosticSettings/mysetting
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0