We recommend using Azure Native.
azure.apimanagement.Logger
Explore with Pulumi AI
Manages a Logger within an API Management Service.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
{
Location = "West Europe",
});
var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new()
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
ApplicationType = "other",
});
var exampleService = new Azure.ApiManagement.Service("exampleService", new()
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
PublisherName = "My Company",
PublisherEmail = "company@exmaple.com",
SkuName = "Developer_1",
});
var exampleLogger = new Azure.ApiManagement.Logger("exampleLogger", new()
{
ApiManagementName = exampleService.Name,
ResourceGroupName = exampleResourceGroup.Name,
ResourceId = exampleInsights.Id,
ApplicationInsights = new Azure.ApiManagement.Inputs.LoggerApplicationInsightsArgs
{
InstrumentationKey = exampleInsights.InstrumentationKey,
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
ApplicationType: pulumi.String("other"),
})
if err != nil {
return err
}
exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
PublisherName: pulumi.String("My Company"),
PublisherEmail: pulumi.String("company@exmaple.com"),
SkuName: pulumi.String("Developer_1"),
})
if err != nil {
return err
}
_, err = apimanagement.NewLogger(ctx, "exampleLogger", &apimanagement.LoggerArgs{
ApiManagementName: exampleService.Name,
ResourceGroupName: exampleResourceGroup.Name,
ResourceId: exampleInsights.ID(),
ApplicationInsights: &apimanagement.LoggerApplicationInsightsArgs{
InstrumentationKey: exampleInsights.InstrumentationKey,
},
})
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.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.appinsights.Insights;
import com.pulumi.azure.appinsights.InsightsArgs;
import com.pulumi.azure.apimanagement.Service;
import com.pulumi.azure.apimanagement.ServiceArgs;
import com.pulumi.azure.apimanagement.Logger;
import com.pulumi.azure.apimanagement.LoggerArgs;
import com.pulumi.azure.apimanagement.inputs.LoggerApplicationInsightsArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.applicationType("other")
.build());
var exampleService = new Service("exampleService", ServiceArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.publisherName("My Company")
.publisherEmail("company@exmaple.com")
.skuName("Developer_1")
.build());
var exampleLogger = new Logger("exampleLogger", LoggerArgs.builder()
.apiManagementName(exampleService.name())
.resourceGroupName(exampleResourceGroup.name())
.resourceId(exampleInsights.id())
.applicationInsights(LoggerApplicationInsightsArgs.builder()
.instrumentationKey(exampleInsights.instrumentationKey())
.build())
.build());
}
}
import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_insights = azure.appinsights.Insights("exampleInsights",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
application_type="other")
example_service = azure.apimanagement.Service("exampleService",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
publisher_name="My Company",
publisher_email="company@exmaple.com",
sku_name="Developer_1")
example_logger = azure.apimanagement.Logger("exampleLogger",
api_management_name=example_service.name,
resource_group_name=example_resource_group.name,
resource_id=example_insights.id,
application_insights=azure.apimanagement.LoggerApplicationInsightsArgs(
instrumentation_key=example_insights.instrumentation_key,
))
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleInsights = new azure.appinsights.Insights("exampleInsights", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
applicationType: "other",
});
const exampleService = new azure.apimanagement.Service("exampleService", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
publisherName: "My Company",
publisherEmail: "company@exmaple.com",
skuName: "Developer_1",
});
const exampleLogger = new azure.apimanagement.Logger("exampleLogger", {
apiManagementName: exampleService.name,
resourceGroupName: exampleResourceGroup.name,
resourceId: exampleInsights.id,
applicationInsights: {
instrumentationKey: exampleInsights.instrumentationKey,
},
});
resources:
exampleResourceGroup:
type: azure:core:ResourceGroup
properties:
location: West Europe
exampleInsights:
type: azure:appinsights:Insights
properties:
location: ${exampleResourceGroup.location}
resourceGroupName: ${exampleResourceGroup.name}
applicationType: other
exampleService:
type: azure:apimanagement:Service
properties:
location: ${exampleResourceGroup.location}
resourceGroupName: ${exampleResourceGroup.name}
publisherName: My Company
publisherEmail: company@exmaple.com
skuName: Developer_1
exampleLogger:
type: azure:apimanagement:Logger
properties:
apiManagementName: ${exampleService.name}
resourceGroupName: ${exampleResourceGroup.name}
resourceId: ${exampleInsights.id}
applicationInsights:
instrumentationKey: ${exampleInsights.instrumentationKey}
Create Logger Resource
new Logger(name: string, args: LoggerArgs, opts?: CustomResourceOptions);
@overload
def Logger(resource_name: str,
opts: Optional[ResourceOptions] = None,
api_management_name: Optional[str] = None,
application_insights: Optional[LoggerApplicationInsightsArgs] = None,
buffered: Optional[bool] = None,
description: Optional[str] = None,
eventhub: Optional[LoggerEventhubArgs] = None,
name: Optional[str] = None,
resource_group_name: Optional[str] = None,
resource_id: Optional[str] = None)
@overload
def Logger(resource_name: str,
args: LoggerArgs,
opts: Optional[ResourceOptions] = None)
func NewLogger(ctx *Context, name string, args LoggerArgs, opts ...ResourceOption) (*Logger, error)
public Logger(string name, LoggerArgs args, CustomResourceOptions? opts = null)
public Logger(String name, LoggerArgs args)
public Logger(String name, LoggerArgs args, CustomResourceOptions options)
type: azure:apimanagement:Logger
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LoggerArgs
- 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 LoggerArgs
- 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 LoggerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LoggerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LoggerArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Logger 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 Logger resource accepts the following input properties:
- Api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- Application
Insights LoggerApplication Insights An
application_insights
block as documented below. Changing this forces a new resource to be created.- Buffered bool
Specifies whether records should be buffered in the Logger prior to publishing. Defaults to
true
.- Description string
A description of this Logger.
- Eventhub
Logger
Eventhub An
eventhub
block as documented below. Changing this forces a new resource to be created.- Name string
The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
- Resource
Id string The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
- Api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- Application
Insights LoggerApplication Insights Args An
application_insights
block as documented below. Changing this forces a new resource to be created.- Buffered bool
Specifies whether records should be buffered in the Logger prior to publishing. Defaults to
true
.- Description string
A description of this Logger.
- Eventhub
Logger
Eventhub Args An
eventhub
block as documented below. Changing this forces a new resource to be created.- Name string
The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
- Resource
Id string The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
- api
Management StringName The name of the API Management Service. Changing this forces a new resource to be created.
- resource
Group StringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- application
Insights LoggerApplication Insights An
application_insights
block as documented below. Changing this forces a new resource to be created.- buffered Boolean
Specifies whether records should be buffered in the Logger prior to publishing. Defaults to
true
.- description String
A description of this Logger.
- eventhub
Logger
Eventhub An
eventhub
block as documented below. Changing this forces a new resource to be created.- name String
The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
- resource
Id String The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
- api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- application
Insights LoggerApplication Insights An
application_insights
block as documented below. Changing this forces a new resource to be created.- buffered boolean
Specifies whether records should be buffered in the Logger prior to publishing. Defaults to
true
.- description string
A description of this Logger.
- eventhub
Logger
Eventhub An
eventhub
block as documented below. Changing this forces a new resource to be created.- name string
The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
- resource
Id string The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
- api_
management_ strname The name of the API Management Service. Changing this forces a new resource to be created.
- resource_
group_ strname The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- application_
insights LoggerApplication Insights Args An
application_insights
block as documented below. Changing this forces a new resource to be created.- buffered bool
Specifies whether records should be buffered in the Logger prior to publishing. Defaults to
true
.- description str
A description of this Logger.
- eventhub
Logger
Eventhub Args An
eventhub
block as documented below. Changing this forces a new resource to be created.- name str
The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
- resource_
id str The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
- api
Management StringName The name of the API Management Service. Changing this forces a new resource to be created.
- resource
Group StringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- application
Insights Property Map An
application_insights
block as documented below. Changing this forces a new resource to be created.- buffered Boolean
Specifies whether records should be buffered in the Logger prior to publishing. Defaults to
true
.- description String
A description of this Logger.
- eventhub Property Map
An
eventhub
block as documented below. Changing this forces a new resource to be created.- name String
The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
- resource
Id String The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the Logger resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Id string
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
- id string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing Logger Resource
Get an existing Logger resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: LoggerState, opts?: CustomResourceOptions): Logger
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
api_management_name: Optional[str] = None,
application_insights: Optional[LoggerApplicationInsightsArgs] = None,
buffered: Optional[bool] = None,
description: Optional[str] = None,
eventhub: Optional[LoggerEventhubArgs] = None,
name: Optional[str] = None,
resource_group_name: Optional[str] = None,
resource_id: Optional[str] = None) -> Logger
func GetLogger(ctx *Context, name string, id IDInput, state *LoggerState, opts ...ResourceOption) (*Logger, error)
public static Logger Get(string name, Input<string> id, LoggerState? state, CustomResourceOptions? opts = null)
public static Logger get(String name, Output<String> id, LoggerState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- Application
Insights LoggerApplication Insights An
application_insights
block as documented below. Changing this forces a new resource to be created.- Buffered bool
Specifies whether records should be buffered in the Logger prior to publishing. Defaults to
true
.- Description string
A description of this Logger.
- Eventhub
Logger
Eventhub An
eventhub
block as documented below. Changing this forces a new resource to be created.- Name string
The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- Resource
Id string The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
- Api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- Application
Insights LoggerApplication Insights Args An
application_insights
block as documented below. Changing this forces a new resource to be created.- Buffered bool
Specifies whether records should be buffered in the Logger prior to publishing. Defaults to
true
.- Description string
A description of this Logger.
- Eventhub
Logger
Eventhub Args An
eventhub
block as documented below. Changing this forces a new resource to be created.- Name string
The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- Resource
Id string The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
- api
Management StringName The name of the API Management Service. Changing this forces a new resource to be created.
- application
Insights LoggerApplication Insights An
application_insights
block as documented below. Changing this forces a new resource to be created.- buffered Boolean
Specifies whether records should be buffered in the Logger prior to publishing. Defaults to
true
.- description String
A description of this Logger.
- eventhub
Logger
Eventhub An
eventhub
block as documented below. Changing this forces a new resource to be created.- name String
The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
- resource
Group StringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- resource
Id String The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
- api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- application
Insights LoggerApplication Insights An
application_insights
block as documented below. Changing this forces a new resource to be created.- buffered boolean
Specifies whether records should be buffered in the Logger prior to publishing. Defaults to
true
.- description string
A description of this Logger.
- eventhub
Logger
Eventhub An
eventhub
block as documented below. Changing this forces a new resource to be created.- name string
The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
- resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- resource
Id string The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
- api_
management_ strname The name of the API Management Service. Changing this forces a new resource to be created.
- application_
insights LoggerApplication Insights Args An
application_insights
block as documented below. Changing this forces a new resource to be created.- buffered bool
Specifies whether records should be buffered in the Logger prior to publishing. Defaults to
true
.- description str
A description of this Logger.
- eventhub
Logger
Eventhub Args An
eventhub
block as documented below. Changing this forces a new resource to be created.- name str
The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
- resource_
group_ strname The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- resource_
id str The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
- api
Management StringName The name of the API Management Service. Changing this forces a new resource to be created.
- application
Insights Property Map An
application_insights
block as documented below. Changing this forces a new resource to be created.- buffered Boolean
Specifies whether records should be buffered in the Logger prior to publishing. Defaults to
true
.- description String
A description of this Logger.
- eventhub Property Map
An
eventhub
block as documented below. Changing this forces a new resource to be created.- name String
The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.
- resource
Group StringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- resource
Id String The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.
Supporting Types
LoggerApplicationInsights, LoggerApplicationInsightsArgs
- Instrumentation
Key string The instrumentation key used to push data to Application Insights.
- Instrumentation
Key string The instrumentation key used to push data to Application Insights.
- instrumentation
Key String The instrumentation key used to push data to Application Insights.
- instrumentation
Key string The instrumentation key used to push data to Application Insights.
- instrumentation_
key str The instrumentation key used to push data to Application Insights.
- instrumentation
Key String The instrumentation key used to push data to Application Insights.
LoggerEventhub, LoggerEventhubArgs
- Name string
The name of an EventHub.
- Connection
String string The connection string of an EventHub Namespace.
Note: At least one of
connection_string
orendpoint_uri
must be specified- Endpoint
Uri string The endpoint address of an EventHub Namespace. Required when
client_id
is set.- User
Assigned stringIdentity Client Id The Client Id of the User Assigned Identity with the "Azure Event Hubs Data Sender" role to the target EventHub Namespace. Required when
endpoint_uri
is set. If not specified the System Assigned Identity will be used.
- Name string
The name of an EventHub.
- Connection
String string The connection string of an EventHub Namespace.
Note: At least one of
connection_string
orendpoint_uri
must be specified- Endpoint
Uri string The endpoint address of an EventHub Namespace. Required when
client_id
is set.- User
Assigned stringIdentity Client Id The Client Id of the User Assigned Identity with the "Azure Event Hubs Data Sender" role to the target EventHub Namespace. Required when
endpoint_uri
is set. If not specified the System Assigned Identity will be used.
- name String
The name of an EventHub.
- connection
String String The connection string of an EventHub Namespace.
Note: At least one of
connection_string
orendpoint_uri
must be specified- endpoint
Uri String The endpoint address of an EventHub Namespace. Required when
client_id
is set.- user
Assigned StringIdentity Client Id The Client Id of the User Assigned Identity with the "Azure Event Hubs Data Sender" role to the target EventHub Namespace. Required when
endpoint_uri
is set. If not specified the System Assigned Identity will be used.
- name string
The name of an EventHub.
- connection
String string The connection string of an EventHub Namespace.
Note: At least one of
connection_string
orendpoint_uri
must be specified- endpoint
Uri string The endpoint address of an EventHub Namespace. Required when
client_id
is set.- user
Assigned stringIdentity Client Id The Client Id of the User Assigned Identity with the "Azure Event Hubs Data Sender" role to the target EventHub Namespace. Required when
endpoint_uri
is set. If not specified the System Assigned Identity will be used.
- name str
The name of an EventHub.
- connection_
string str The connection string of an EventHub Namespace.
Note: At least one of
connection_string
orendpoint_uri
must be specified- endpoint_
uri str The endpoint address of an EventHub Namespace. Required when
client_id
is set.- user_
assigned_ stridentity_ client_ id The Client Id of the User Assigned Identity with the "Azure Event Hubs Data Sender" role to the target EventHub Namespace. Required when
endpoint_uri
is set. If not specified the System Assigned Identity will be used.
- name String
The name of an EventHub.
- connection
String String The connection string of an EventHub Namespace.
Note: At least one of
connection_string
orendpoint_uri
must be specified- endpoint
Uri String The endpoint address of an EventHub Namespace. Required when
client_id
is set.- user
Assigned StringIdentity Client Id The Client Id of the User Assigned Identity with the "Azure Event Hubs Data Sender" role to the target EventHub Namespace. Required when
endpoint_uri
is set. If not specified the System Assigned Identity will be used.
Import
API Management Loggers can be imported using the resource id
, e.g.
$ pulumi import azure:apimanagement/logger:Logger example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.ApiManagement/service/example-apim/loggers/example-logger
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.