import * as pulumi from "@pulumi/pulumi"; /** * Manages an Application Insights API key. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * export = async () => { * const example = new azure.core.ResourceGroup("example", { * name: "tf-test", * location: "West Europe", * }); * const exampleInsights = new azure.appinsights.Insights("example", { * name: "tf-test-appinsights", * location: example.location, * resourceGroupName: example.name, * applicationType: "web", * }); * const readTelemetry = new azure.appinsights.ApiKey("read_telemetry", { * name: "tf-test-appinsights-read-telemetry-api-key", * applicationInsightsId: exampleInsights.id, * readPermissions: [ * "aggregate", * "api", * "draft", * "extendqueries", * "search", * ], * }); * const writeAnnotations = new azure.appinsights.ApiKey("write_annotations", { * name: "tf-test-appinsights-write-annotations-api-key", * applicationInsightsId: exampleInsights.id, * writePermissions: ["annotations"], * }); * const authenticateSdkControlChannel = new azure.appinsights.ApiKey("authenticate_sdk_control_channel", { * name: "tf-test-appinsights-authenticate-sdk-control-channel-api-key", * applicationInsightsId: exampleInsights.id, * readPermissions: ["agentconfig"], * }); * const fullPermissions = new azure.appinsights.ApiKey("full_permissions", { * name: "tf-test-appinsights-full-permissions-api-key", * applicationInsightsId: exampleInsights.id, * readPermissions: [ * "agentconfig", * "aggregate", * "api", * "draft", * "extendqueries", * "search", * ], * writePermissions: ["annotations"], * }); * return { * readTelemetryApiKey: readTelemetry.apiKey, * writeAnnotationsApiKey: writeAnnotations.apiKey, * authenticateSdkControlChannel: authenticateSdkControlChannel.apiKey, * fullPermissionsApiKey: fullPermissions.apiKey, * }; * } * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.Insights` - 2015-05-01 * * ## Import * * Application Insights API keys can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:appinsights/apiKey:ApiKey my_key /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Insights/components/instance1/apiKeys/00000000-0000-0000-0000-000000000000 * ``` * * > **Note:** The secret `apiKey` cannot be retrieved during an import. You will need to edit the state by hand to set the secret value if you happen to have it backed up somewhere. */ export declare class ApiKey extends pulumi.CustomResource { /** * Get an existing ApiKey resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: ApiKeyState, opts?: pulumi.CustomResourceOptions): ApiKey; /** * Returns true if the given object is an instance of ApiKey. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is ApiKey; /** * The API Key secret (Sensitive). */ readonly apiKey: pulumi.Output; /** * The ID of the Application Insights component on which the API key operates. Changing this forces a new resource to be created. */ readonly applicationInsightsId: pulumi.Output; /** * Specifies the name of the Application Insights API key. Changing this forces a new resource to be created. */ readonly name: pulumi.Output; /** * Specifies the list of read permissions granted to the API key. Valid values are `agentconfig`, `aggregate`, `api`, `draft`, `extendqueries`, `search`. Please note these values are case sensitive. Changing this forces a new resource to be created. */ readonly readPermissions: pulumi.Output; /** * Specifies the list of write permissions granted to the API key. Valid values are `annotations`. Please note these values are case sensitive. Changing this forces a new resource to be created. * * > **Note:** At least one read or write permission must be defined. */ readonly writePermissions: pulumi.Output; /** * Create a ApiKey resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ApiKeyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ApiKey resources. */ export interface ApiKeyState { /** * The API Key secret (Sensitive). */ apiKey?: pulumi.Input; /** * The ID of the Application Insights component on which the API key operates. Changing this forces a new resource to be created. */ applicationInsightsId?: pulumi.Input; /** * Specifies the name of the Application Insights API key. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * Specifies the list of read permissions granted to the API key. Valid values are `agentconfig`, `aggregate`, `api`, `draft`, `extendqueries`, `search`. Please note these values are case sensitive. Changing this forces a new resource to be created. */ readPermissions?: pulumi.Input[]>; /** * Specifies the list of write permissions granted to the API key. Valid values are `annotations`. Please note these values are case sensitive. Changing this forces a new resource to be created. * * > **Note:** At least one read or write permission must be defined. */ writePermissions?: pulumi.Input[]>; } /** * The set of arguments for constructing a ApiKey resource. */ export interface ApiKeyArgs { /** * The ID of the Application Insights component on which the API key operates. Changing this forces a new resource to be created. */ applicationInsightsId: pulumi.Input; /** * Specifies the name of the Application Insights API key. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * Specifies the list of read permissions granted to the API key. Valid values are `agentconfig`, `aggregate`, `api`, `draft`, `extendqueries`, `search`. Please note these values are case sensitive. Changing this forces a new resource to be created. */ readPermissions?: pulumi.Input[]>; /** * Specifies the list of write permissions granted to the API key. Valid values are `annotations`. Please note these values are case sensitive. Changing this forces a new resource to be created. * * > **Note:** At least one read or write permission must be defined. */ writePermissions?: pulumi.Input[]>; }