
com.pulumi.azure.apimanagement.kotlin.AuthorizationServerArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.apimanagement.kotlin
import com.pulumi.azure.apimanagement.AuthorizationServerArgs.builder
import com.pulumi.azure.apimanagement.kotlin.inputs.AuthorizationServerTokenBodyParameterArgs
import com.pulumi.azure.apimanagement.kotlin.inputs.AuthorizationServerTokenBodyParameterArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Manages an Authorization Server within an API Management Service.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.apimanagement.getService({
* name: "search-api",
* resourceGroupName: "search-service",
* });
* const exampleAuthorizationServer = new azure.apimanagement.AuthorizationServer("example", {
* name: "test-server",
* apiManagementName: example.then(example => example.name),
* resourceGroupName: example.then(example => example.resourceGroupName),
* displayName: "Test Server",
* authorizationEndpoint: "https://example.mydomain.com/client/authorize",
* clientId: "42424242-4242-4242-4242-424242424242",
* clientRegistrationEndpoint: "https://example.mydomain.com/client/register",
* grantTypes: ["authorizationCode"],
* authorizationMethods: ["GET"],
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.apimanagement.get_service(name="search-api",
* resource_group_name="search-service")
* example_authorization_server = azure.apimanagement.AuthorizationServer("example",
* name="test-server",
* api_management_name=example.name,
* resource_group_name=example.resource_group_name,
* display_name="Test Server",
* authorization_endpoint="https://example.mydomain.com/client/authorize",
* client_id="42424242-4242-4242-4242-424242424242",
* client_registration_endpoint="https://example.mydomain.com/client/register",
* grant_types=["authorizationCode"],
* authorization_methods=["GET"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.ApiManagement.GetService.Invoke(new()
* {
* Name = "search-api",
* ResourceGroupName = "search-service",
* });
* var exampleAuthorizationServer = new Azure.ApiManagement.AuthorizationServer("example", new()
* {
* Name = "test-server",
* ApiManagementName = example.Apply(getServiceResult => getServiceResult.Name),
* ResourceGroupName = example.Apply(getServiceResult => getServiceResult.ResourceGroupName),
* DisplayName = "Test Server",
* AuthorizationEndpoint = "https://example.mydomain.com/client/authorize",
* ClientId = "42424242-4242-4242-4242-424242424242",
* ClientRegistrationEndpoint = "https://example.mydomain.com/client/register",
* GrantTypes = new[]
* {
* "authorizationCode",
* },
* AuthorizationMethods = new[]
* {
* "GET",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{
* Name: "search-api",
* ResourceGroupName: "search-service",
* }, nil)
* if err != nil {
* return err
* }
* _, err = apimanagement.NewAuthorizationServer(ctx, "example", &apimanagement.AuthorizationServerArgs{
* Name: pulumi.String("test-server"),
* ApiManagementName: pulumi.String(example.Name),
* ResourceGroupName: pulumi.String(example.ResourceGroupName),
* DisplayName: pulumi.String("Test Server"),
* AuthorizationEndpoint: pulumi.String("https://example.mydomain.com/client/authorize"),
* ClientId: pulumi.String("42424242-4242-4242-4242-424242424242"),
* ClientRegistrationEndpoint: pulumi.String("https://example.mydomain.com/client/register"),
* GrantTypes: pulumi.StringArray{
* pulumi.String("authorizationCode"),
* },
* AuthorizationMethods: pulumi.StringArray{
* pulumi.String("GET"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.apimanagement.ApimanagementFunctions;
* import com.pulumi.azure.apimanagement.inputs.GetServiceArgs;
* import com.pulumi.azure.apimanagement.AuthorizationServer;
* import com.pulumi.azure.apimanagement.AuthorizationServerArgs;
* 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) {
* final var example = ApimanagementFunctions.getService(GetServiceArgs.builder()
* .name("search-api")
* .resourceGroupName("search-service")
* .build());
* var exampleAuthorizationServer = new AuthorizationServer("exampleAuthorizationServer", AuthorizationServerArgs.builder()
* .name("test-server")
* .apiManagementName(example.applyValue(getServiceResult -> getServiceResult.name()))
* .resourceGroupName(example.applyValue(getServiceResult -> getServiceResult.resourceGroupName()))
* .displayName("Test Server")
* .authorizationEndpoint("https://example.mydomain.com/client/authorize")
* .clientId("42424242-4242-4242-4242-424242424242")
* .clientRegistrationEndpoint("https://example.mydomain.com/client/register")
* .grantTypes("authorizationCode")
* .authorizationMethods("GET")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* exampleAuthorizationServer:
* type: azure:apimanagement:AuthorizationServer
* name: example
* properties:
* name: test-server
* apiManagementName: ${example.name}
* resourceGroupName: ${example.resourceGroupName}
* displayName: Test Server
* authorizationEndpoint: https://example.mydomain.com/client/authorize
* clientId: 42424242-4242-4242-4242-424242424242
* clientRegistrationEndpoint: https://example.mydomain.com/client/register
* grantTypes:
* - authorizationCode
* authorizationMethods:
* - GET
* variables:
* example:
* fn::invoke:
* Function: azure:apimanagement:getService
* Arguments:
* name: search-api
* resourceGroupName: search-service
* ```
*
* ## Import
* API Management Authorization Servers can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:apimanagement/authorizationServer:AuthorizationServer example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/authorizationServers/server1
* ```
* @property apiManagementName The name of the API Management Service in which this Authorization Server should be created. Changing this forces a new resource to be created.
* @property authorizationEndpoint The OAUTH Authorization Endpoint.
* @property authorizationMethods The HTTP Verbs supported by the Authorization Endpoint. Possible values are `DELETE`, `GET`, `HEAD`, `OPTIONS`, `PATCH`, `POST`, `PUT` and `TRACE`.
* > **NOTE:** `GET` must always be present.
* @property bearerTokenSendingMethods The mechanism by which Access Tokens are passed to the API. Possible values are `authorizationHeader` and `query`.
* @property clientAuthenticationMethods The Authentication Methods supported by the Token endpoint of this Authorization Server.. Possible values are `Basic` and `Body`.
* @property clientId The Client/App ID registered with this Authorization Server.
* @property clientRegistrationEndpoint The URI of page where Client/App Registration is performed for this Authorization Server.
* @property clientSecret The Client/App Secret registered with this Authorization Server.
* @property defaultScope The Default Scope used when requesting an Access Token, specified as a string containing space-delimited values.
* @property description A description of the Authorization Server, which may contain HTML formatting tags.
* @property displayName The user-friendly name of this Authorization Server.
* @property grantTypes Form of Authorization Grants required when requesting an Access Token. Possible values are `authorizationCode`, `clientCredentials`, `implicit` and `resourceOwnerPassword`.
* @property name The name of this Authorization Server. Changing this forces a new resource to be created.
* @property resourceGroupName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
* @property resourceOwnerPassword The password associated with the Resource Owner.
* > **NOTE:** This can only be specified when `grant_type` includes `resourceOwnerPassword`.
* @property resourceOwnerUsername The username associated with the Resource Owner.
* > **NOTE:** This can only be specified when `grant_type` includes `resourceOwnerPassword`.
* @property supportState Does this Authorization Server support State? If this is set to `true` the client may use the state parameter to raise protocol security.
* @property tokenBodyParameters A `token_body_parameter` block as defined below.
* @property tokenEndpoint The OAUTH Token Endpoint.
*/
public data class AuthorizationServerArgs(
public val apiManagementName: Output? = null,
public val authorizationEndpoint: Output? = null,
public val authorizationMethods: Output>? = null,
public val bearerTokenSendingMethods: Output>? = null,
public val clientAuthenticationMethods: Output>? = null,
public val clientId: Output? = null,
public val clientRegistrationEndpoint: Output? = null,
public val clientSecret: Output? = null,
public val defaultScope: Output? = null,
public val description: Output? = null,
public val displayName: Output? = null,
public val grantTypes: Output>? = null,
public val name: Output? = null,
public val resourceGroupName: Output? = null,
public val resourceOwnerPassword: Output? = null,
public val resourceOwnerUsername: Output? = null,
public val supportState: Output? = null,
public val tokenBodyParameters: Output>? = null,
public val tokenEndpoint: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.apimanagement.AuthorizationServerArgs =
com.pulumi.azure.apimanagement.AuthorizationServerArgs.builder()
.apiManagementName(apiManagementName?.applyValue({ args0 -> args0 }))
.authorizationEndpoint(authorizationEndpoint?.applyValue({ args0 -> args0 }))
.authorizationMethods(authorizationMethods?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.bearerTokenSendingMethods(
bearerTokenSendingMethods?.applyValue({ args0 ->
args0.map({ args0 ->
args0
})
}),
)
.clientAuthenticationMethods(
clientAuthenticationMethods?.applyValue({ args0 ->
args0.map({ args0 ->
args0
})
}),
)
.clientId(clientId?.applyValue({ args0 -> args0 }))
.clientRegistrationEndpoint(clientRegistrationEndpoint?.applyValue({ args0 -> args0 }))
.clientSecret(clientSecret?.applyValue({ args0 -> args0 }))
.defaultScope(defaultScope?.applyValue({ args0 -> args0 }))
.description(description?.applyValue({ args0 -> args0 }))
.displayName(displayName?.applyValue({ args0 -> args0 }))
.grantTypes(grantTypes?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.name(name?.applyValue({ args0 -> args0 }))
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
.resourceOwnerPassword(resourceOwnerPassword?.applyValue({ args0 -> args0 }))
.resourceOwnerUsername(resourceOwnerUsername?.applyValue({ args0 -> args0 }))
.supportState(supportState?.applyValue({ args0 -> args0 }))
.tokenBodyParameters(
tokenBodyParameters?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
)
.tokenEndpoint(tokenEndpoint?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [AuthorizationServerArgs].
*/
@PulumiTagMarker
public class AuthorizationServerArgsBuilder internal constructor() {
private var apiManagementName: Output? = null
private var authorizationEndpoint: Output? = null
private var authorizationMethods: Output>? = null
private var bearerTokenSendingMethods: Output>? = null
private var clientAuthenticationMethods: Output>? = null
private var clientId: Output? = null
private var clientRegistrationEndpoint: Output? = null
private var clientSecret: Output? = null
private var defaultScope: Output? = null
private var description: Output? = null
private var displayName: Output? = null
private var grantTypes: Output>? = null
private var name: Output? = null
private var resourceGroupName: Output? = null
private var resourceOwnerPassword: Output? = null
private var resourceOwnerUsername: Output? = null
private var supportState: Output? = null
private var tokenBodyParameters: Output>? = null
private var tokenEndpoint: Output? = null
/**
* @param value The name of the API Management Service in which this Authorization Server should be created. Changing this forces a new resource to be created.
*/
@JvmName("sgvhskqryyibgkpq")
public suspend fun apiManagementName(`value`: Output) {
this.apiManagementName = value
}
/**
* @param value The OAUTH Authorization Endpoint.
*/
@JvmName("gdxilxmpndmpbutx")
public suspend fun authorizationEndpoint(`value`: Output) {
this.authorizationEndpoint = value
}
/**
* @param value The HTTP Verbs supported by the Authorization Endpoint. Possible values are `DELETE`, `GET`, `HEAD`, `OPTIONS`, `PATCH`, `POST`, `PUT` and `TRACE`.
* > **NOTE:** `GET` must always be present.
*/
@JvmName("vggmubgijowqinxh")
public suspend fun authorizationMethods(`value`: Output>) {
this.authorizationMethods = value
}
@JvmName("vptkvgndeipwjnjb")
public suspend fun authorizationMethods(vararg values: Output) {
this.authorizationMethods = Output.all(values.asList())
}
/**
* @param values The HTTP Verbs supported by the Authorization Endpoint. Possible values are `DELETE`, `GET`, `HEAD`, `OPTIONS`, `PATCH`, `POST`, `PUT` and `TRACE`.
* > **NOTE:** `GET` must always be present.
*/
@JvmName("iivtfqqwstghpopq")
public suspend fun authorizationMethods(values: List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy