1. Packages
  2. Azure Native
  3. API Docs
  4. insights
  5. LogProfile
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.47.1 published on Monday, Jun 24, 2024 by Pulumi

azure-native.insights.LogProfile

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.47.1 published on Monday, Jun 24, 2024 by Pulumi

    The log profile resource. Azure REST API version: 2016-03-01. Prior API version in Azure Native 1.x: 2016-03-01.

    Example Usage

    Create or update a log profile

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var logProfile = new AzureNative.Insights.LogProfile("logProfile", new()
        {
            Categories = new[]
            {
                "Write",
                "Delete",
                "Action",
            },
            Location = "",
            Locations = new[]
            {
                "global",
            },
            LogProfileName = "Rac46PostSwapRG",
            RetentionPolicy = new AzureNative.Insights.Inputs.RetentionPolicyArgs
            {
                Days = 3,
                Enabled = true,
            },
            ServiceBusRuleId = "",
            StorageAccountId = "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162",
            Tags = null,
        });
    
    });
    
    package main
    
    import (
    	insights "github.com/pulumi/pulumi-azure-native-sdk/insights/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := insights.NewLogProfile(ctx, "logProfile", &insights.LogProfileArgs{
    			Categories: pulumi.StringArray{
    				pulumi.String("Write"),
    				pulumi.String("Delete"),
    				pulumi.String("Action"),
    			},
    			Location: pulumi.String(""),
    			Locations: pulumi.StringArray{
    				pulumi.String("global"),
    			},
    			LogProfileName: pulumi.String("Rac46PostSwapRG"),
    			RetentionPolicy: &insights.RetentionPolicyArgs{
    				Days:    pulumi.Int(3),
    				Enabled: pulumi.Bool(true),
    			},
    			ServiceBusRuleId: pulumi.String(""),
    			StorageAccountId: pulumi.String("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162"),
    			Tags:             nil,
    		})
    		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.insights.LogProfile;
    import com.pulumi.azurenative.insights.LogProfileArgs;
    import com.pulumi.azurenative.insights.inputs.RetentionPolicyArgs;
    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 logProfile = new LogProfile("logProfile", LogProfileArgs.builder()
                .categories(            
                    "Write",
                    "Delete",
                    "Action")
                .location("")
                .locations("global")
                .logProfileName("Rac46PostSwapRG")
                .retentionPolicy(RetentionPolicyArgs.builder()
                    .days(3)
                    .enabled(true)
                    .build())
                .serviceBusRuleId("")
                .storageAccountId("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162")
                .tags()
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    log_profile = azure_native.insights.LogProfile("logProfile",
        categories=[
            "Write",
            "Delete",
            "Action",
        ],
        location="",
        locations=["global"],
        log_profile_name="Rac46PostSwapRG",
        retention_policy=azure_native.insights.RetentionPolicyArgs(
            days=3,
            enabled=True,
        ),
        service_bus_rule_id="",
        storage_account_id="/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162",
        tags={})
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const logProfile = new azure_native.insights.LogProfile("logProfile", {
        categories: [
            "Write",
            "Delete",
            "Action",
        ],
        location: "",
        locations: ["global"],
        logProfileName: "Rac46PostSwapRG",
        retentionPolicy: {
            days: 3,
            enabled: true,
        },
        serviceBusRuleId: "",
        storageAccountId: "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162",
        tags: {},
    });
    
    resources:
      logProfile:
        type: azure-native:insights:LogProfile
        properties:
          categories:
            - Write
            - Delete
            - Action
          location:
          locations:
            - global
          logProfileName: Rac46PostSwapRG
          retentionPolicy:
            days: 3
            enabled: true
          serviceBusRuleId:
          storageAccountId: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162
          tags: {}
    

    Create LogProfile Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new LogProfile(name: string, args: LogProfileArgs, opts?: CustomResourceOptions);
    @overload
    def LogProfile(resource_name: str,
                   args: LogProfileArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def LogProfile(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   categories: Optional[Sequence[str]] = None,
                   locations: Optional[Sequence[str]] = None,
                   retention_policy: Optional[RetentionPolicyArgs] = None,
                   location: Optional[str] = None,
                   log_profile_name: Optional[str] = None,
                   service_bus_rule_id: Optional[str] = None,
                   storage_account_id: Optional[str] = None,
                   tags: Optional[Mapping[str, str]] = None)
    func NewLogProfile(ctx *Context, name string, args LogProfileArgs, opts ...ResourceOption) (*LogProfile, error)
    public LogProfile(string name, LogProfileArgs args, CustomResourceOptions? opts = null)
    public LogProfile(String name, LogProfileArgs args)
    public LogProfile(String name, LogProfileArgs args, CustomResourceOptions options)
    
    type: azure-native:insights:LogProfile
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args LogProfileArgs
    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 LogProfileArgs
    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 LogProfileArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LogProfileArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LogProfileArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var logProfileResource = new AzureNative.Insights.LogProfile("logProfileResource", new()
    {
        Categories = new[]
        {
            "string",
        },
        Locations = new[]
        {
            "string",
        },
        RetentionPolicy = new AzureNative.Insights.Inputs.RetentionPolicyArgs
        {
            Days = 0,
            Enabled = false,
        },
        Location = "string",
        LogProfileName = "string",
        ServiceBusRuleId = "string",
        StorageAccountId = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := insights.NewLogProfile(ctx, "logProfileResource", &insights.LogProfileArgs{
    Categories: pulumi.StringArray{
    pulumi.String("string"),
    },
    Locations: pulumi.StringArray{
    pulumi.String("string"),
    },
    RetentionPolicy: &insights.RetentionPolicyArgs{
    Days: pulumi.Int(0),
    Enabled: pulumi.Bool(false),
    },
    Location: pulumi.String("string"),
    LogProfileName: pulumi.String("string"),
    ServiceBusRuleId: pulumi.String("string"),
    StorageAccountId: pulumi.String("string"),
    Tags: pulumi.StringMap{
    "string": pulumi.String("string"),
    },
    })
    
    var logProfileResource = new LogProfile("logProfileResource", LogProfileArgs.builder()
        .categories("string")
        .locations("string")
        .retentionPolicy(RetentionPolicyArgs.builder()
            .days(0)
            .enabled(false)
            .build())
        .location("string")
        .logProfileName("string")
        .serviceBusRuleId("string")
        .storageAccountId("string")
        .tags(Map.of("string", "string"))
        .build());
    
    log_profile_resource = azure_native.insights.LogProfile("logProfileResource",
        categories=["string"],
        locations=["string"],
        retention_policy=azure_native.insights.RetentionPolicyArgs(
            days=0,
            enabled=False,
        ),
        location="string",
        log_profile_name="string",
        service_bus_rule_id="string",
        storage_account_id="string",
        tags={
            "string": "string",
        })
    
    const logProfileResource = new azure_native.insights.LogProfile("logProfileResource", {
        categories: ["string"],
        locations: ["string"],
        retentionPolicy: {
            days: 0,
            enabled: false,
        },
        location: "string",
        logProfileName: "string",
        serviceBusRuleId: "string",
        storageAccountId: "string",
        tags: {
            string: "string",
        },
    });
    
    type: azure-native:insights:LogProfile
    properties:
        categories:
            - string
        location: string
        locations:
            - string
        logProfileName: string
        retentionPolicy:
            days: 0
            enabled: false
        serviceBusRuleId: string
        storageAccountId: string
        tags:
            string: string
    

    LogProfile 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 LogProfile resource accepts the following input properties:

    Categories List<string>
    the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'
    Locations List<string>
    List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location.
    RetentionPolicy Pulumi.AzureNative.Insights.Inputs.RetentionPolicy
    the retention policy for the events in the log.
    Location string
    Resource location
    LogProfileName string
    The name of the log profile.
    ServiceBusRuleId string
    The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'.
    StorageAccountId string
    the resource id of the storage account to which you would like to send the Activity Log.
    Tags Dictionary<string, string>
    Resource tags
    Categories []string
    the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'
    Locations []string
    List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location.
    RetentionPolicy RetentionPolicyArgs
    the retention policy for the events in the log.
    Location string
    Resource location
    LogProfileName string
    The name of the log profile.
    ServiceBusRuleId string
    The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'.
    StorageAccountId string
    the resource id of the storage account to which you would like to send the Activity Log.
    Tags map[string]string
    Resource tags
    categories List<String>
    the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'
    locations List<String>
    List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location.
    retentionPolicy RetentionPolicy
    the retention policy for the events in the log.
    location String
    Resource location
    logProfileName String
    The name of the log profile.
    serviceBusRuleId String
    The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'.
    storageAccountId String
    the resource id of the storage account to which you would like to send the Activity Log.
    tags Map<String,String>
    Resource tags
    categories string[]
    the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'
    locations string[]
    List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location.
    retentionPolicy RetentionPolicy
    the retention policy for the events in the log.
    location string
    Resource location
    logProfileName string
    The name of the log profile.
    serviceBusRuleId string
    The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'.
    storageAccountId string
    the resource id of the storage account to which you would like to send the Activity Log.
    tags {[key: string]: string}
    Resource tags
    categories Sequence[str]
    the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'
    locations Sequence[str]
    List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location.
    retention_policy RetentionPolicyArgs
    the retention policy for the events in the log.
    location str
    Resource location
    log_profile_name str
    The name of the log profile.
    service_bus_rule_id str
    The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'.
    storage_account_id str
    the resource id of the storage account to which you would like to send the Activity Log.
    tags Mapping[str, str]
    Resource tags
    categories List<String>
    the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'
    locations List<String>
    List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location.
    retentionPolicy Property Map
    the retention policy for the events in the log.
    location String
    Resource location
    logProfileName String
    The name of the log profile.
    serviceBusRuleId String
    The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'.
    storageAccountId String
    the resource id of the storage account to which you would like to send the Activity Log.
    tags Map<String>
    Resource tags

    Outputs

    All input properties are implicitly available as output properties. Additionally, the LogProfile resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Azure resource name
    Type string
    Azure resource type
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Azure resource name
    Type string
    Azure resource type
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Azure resource name
    type String
    Azure resource type
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    Azure resource name
    type string
    Azure resource type
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    Azure resource name
    type str
    Azure resource type
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Azure resource name
    type String
    Azure resource type

    Supporting Types

    RetentionPolicy, RetentionPolicyArgs

    Days int
    the number of days for the retention in days. A value of 0 will retain the events indefinitely.
    Enabled bool
    a value indicating whether the retention policy is enabled.
    Days int
    the number of days for the retention in days. A value of 0 will retain the events indefinitely.
    Enabled bool
    a value indicating whether the retention policy is enabled.
    days Integer
    the number of days for the retention in days. A value of 0 will retain the events indefinitely.
    enabled Boolean
    a value indicating whether the retention policy is enabled.
    days number
    the number of days for the retention in days. A value of 0 will retain the events indefinitely.
    enabled boolean
    a value indicating whether the retention policy is enabled.
    days int
    the number of days for the retention in days. A value of 0 will retain the events indefinitely.
    enabled bool
    a value indicating whether the retention policy is enabled.
    days Number
    the number of days for the retention in days. A value of 0 will retain the events indefinitely.
    enabled Boolean
    a value indicating whether the retention policy is enabled.

    RetentionPolicyResponse, RetentionPolicyResponseArgs

    Days int
    the number of days for the retention in days. A value of 0 will retain the events indefinitely.
    Enabled bool
    a value indicating whether the retention policy is enabled.
    Days int
    the number of days for the retention in days. A value of 0 will retain the events indefinitely.
    Enabled bool
    a value indicating whether the retention policy is enabled.
    days Integer
    the number of days for the retention in days. A value of 0 will retain the events indefinitely.
    enabled Boolean
    a value indicating whether the retention policy is enabled.
    days number
    the number of days for the retention in days. A value of 0 will retain the events indefinitely.
    enabled boolean
    a value indicating whether the retention policy is enabled.
    days int
    the number of days for the retention in days. A value of 0 will retain the events indefinitely.
    enabled bool
    a value indicating whether the retention policy is enabled.
    days Number
    the number of days for the retention in days. A value of 0 will retain the events indefinitely.
    enabled Boolean
    a value indicating whether the retention policy is enabled.

    Import

    An existing resource can be imported using its type token, name, and identifier, e.g.

    $ pulumi import azure-native:insights:LogProfile default /subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName} 
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
    Azure Native v2.47.1 published on Monday, Jun 24, 2024 by Pulumi