azure-native.insights.LogProfile
Explore with Pulumi AI
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: pulumi.StringMap{},
})
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={
"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={
"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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
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.
- Retention
Policy Pulumi.Azure Native. Insights. Inputs. Retention Policy - the retention policy for the events in the log.
- Location string
- Resource location
- Log
Profile stringName - The name of the log profile.
- Service
Bus stringRule Id - 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 stringId - the resource id of the storage account to which you would like to send the Activity Log.
- 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.
- Retention
Policy RetentionPolicy Args - the retention policy for the events in the log.
- Location string
- Resource location
- Log
Profile stringName - The name of the log profile.
- Service
Bus stringRule Id - 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 stringId - the resource id of the storage account to which you would like to send the Activity Log.
- 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.
- retention
Policy RetentionPolicy - the retention policy for the events in the log.
- location String
- Resource location
- log
Profile StringName - The name of the log profile.
- service
Bus StringRule Id - 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 StringId - the resource id of the storage account to which you would like to send the Activity Log.
- 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.
- retention
Policy RetentionPolicy - the retention policy for the events in the log.
- location string
- Resource location
- log
Profile stringName - The name of the log profile.
- service
Bus stringRule Id - 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 stringId - the resource id of the storage account to which you would like to send the Activity Log.
- {[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 RetentionPolicy Args - the retention policy for the events in the log.
- location str
- Resource location
- log_
profile_ strname - The name of the log profile.
- service_
bus_ strrule_ id - 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_ strid - the resource id of the storage account to which you would like to send the Activity Log.
- 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.
- retention
Policy Property Map - the retention policy for the events in the log.
- location String
- Resource location
- log
Profile StringName - The name of the log profile.
- service
Bus StringRule Id - 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 StringId - the resource id of the storage account to which you would like to send the Activity Log.
- Map<String>
- Resource tags
Outputs
All input properties are implicitly available as output properties. Additionally, the LogProfile resource produces the following output properties:
Supporting Types
RetentionPolicy, RetentionPolicyArgs
RetentionPolicyResponse, RetentionPolicyResponseArgs
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