Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Azure Native

v1.42.0 published on Monday, Oct 25, 2021 by Pulumi

LogProfile

The log profile resource. API Version: 2016-03-01.

Example Usage

Create or update a log profile

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var logProfile = new AzureNative.Insights.LogProfile("logProfile", new AzureNative.Insights.LogProfileArgs
        {
            Categories = 
            {
                "Write",
                "Delete",
                "Action",
            },
            Location = "",
            Locations = 
            {
                "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 = ,
        });
    }

}

package main

import (
	insights "github.com/pulumi/pulumi-azure-native/sdk/go/azure/insights"
	"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
	})
}

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: {},
});

Create a LogProfile Resource

new LogProfile(name: string, args: LogProfileArgs, opts?: CustomResourceOptions);
@overload
def LogProfile(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               categories: Optional[Sequence[str]] = None,
               location: Optional[str] = None,
               locations: Optional[Sequence[str]] = None,
               log_profile_name: Optional[str] = None,
               retention_policy: Optional[RetentionPolicyArgs] = None,
               service_bus_rule_id: Optional[str] = None,
               storage_account_id: Optional[str] = None,
               tags: Optional[Mapping[str, str]] = None)
@overload
def LogProfile(resource_name: str,
               args: LogProfileArgs,
               opts: Optional[ResourceOptions] = None)
func NewLogProfile(ctx *Context, name string, args LogProfileArgs, opts ...ResourceOption) (*LogProfile, error)
public LogProfile(string name, LogProfileArgs args, CustomResourceOptions? opts = null)
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.

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.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 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 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 {[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

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 str
The provider-assigned unique ID for this managed resource.
name str
Azure resource name
type str
Azure resource type

Supporting Types

RetentionPolicy

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 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.

RetentionPolicyResponse

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 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.

Import

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

$ pulumi import azure-native:insights:LogProfile default /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/providers/microsoft.insights/logprofiles/default 

Package Details

Repository
https://github.com/pulumi/pulumi-azure-native
License
Apache-2.0