SubscriptionArgs

data class SubscriptionArgs(val allowTracing: Output<Boolean>? = null, val apiId: Output<String>? = null, val apiManagementName: Output<String>? = null, val displayName: Output<String>? = null, val primaryKey: Output<String>? = null, val productId: Output<String>? = null, val resourceGroupName: Output<String>? = null, val secondaryKey: Output<String>? = null, val state: Output<String>? = null, val subscriptionId: Output<String>? = null, val userId: Output<String>? = null) : ConvertibleToJava<SubscriptionArgs>

Manages a Subscription within a API Management Service.

Example Usage

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.inputs.GetProductArgs;
import com.pulumi.azure.apimanagement.inputs.GetUserArgs;
import com.pulumi.azure.apimanagement.Subscription;
import com.pulumi.azure.apimanagement.SubscriptionArgs;
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 exampleService = ApimanagementFunctions.getService(GetServiceArgs.builder()
.name("example-apim")
.resourceGroupName("example-resources")
.build());
final var exampleProduct = ApimanagementFunctions.getProduct(GetProductArgs.builder()
.productId("00000000-0000-0000-0000-000000000000")
.apiManagementName(exampleService.applyValue(getServiceResult -> getServiceResult.name()))
.resourceGroupName(exampleService.applyValue(getServiceResult -> getServiceResult.resourceGroupName()))
.build());
final var exampleUser = ApimanagementFunctions.getUser(GetUserArgs.builder()
.userId("11111111-1111-1111-1111-111111111111")
.apiManagementName(exampleService.applyValue(getServiceResult -> getServiceResult.name()))
.resourceGroupName(exampleService.applyValue(getServiceResult -> getServiceResult.resourceGroupName()))
.build());
var exampleSubscription = new Subscription("exampleSubscription", SubscriptionArgs.builder()
.apiManagementName(exampleService.applyValue(getServiceResult -> getServiceResult.name()))
.resourceGroupName(exampleService.applyValue(getServiceResult -> getServiceResult.resourceGroupName()))
.userId(exampleUser.applyValue(getUserResult -> getUserResult.id()))
.productId(exampleProduct.applyValue(getProductResult -> getProductResult.id()))
.displayName("Parser API")
.build());
}
}

Import

API Management Subscriptions can be imported using the resource id, e.g.

$ pulumi import azure:apimanagement/subscription:Subscription example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-resources/providers/Microsoft.ApiManagement/service/example-apim/subscriptions/subscription-name

Constructors

Link copied to clipboard
fun SubscriptionArgs(allowTracing: Output<Boolean>? = null, apiId: Output<String>? = null, apiManagementName: Output<String>? = null, displayName: Output<String>? = null, primaryKey: Output<String>? = null, productId: Output<String>? = null, resourceGroupName: Output<String>? = null, secondaryKey: Output<String>? = null, state: Output<String>? = null, subscriptionId: Output<String>? = null, userId: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): SubscriptionArgs

Properties

Link copied to clipboard
val allowTracing: Output<Boolean>? = null

Determines whether tracing can be enabled. Defaults to true.

Link copied to clipboard
val apiId: Output<String>? = null

The ID of the API which should be assigned to this Subscription. Changing this forces a new resource to be created.

Link copied to clipboard
val apiManagementName: Output<String>? = null

The name of the API Management Service where this Subscription should be created. Changing this forces a new resource to be created.

Link copied to clipboard
val displayName: Output<String>? = null

The display name of this Subscription.

Link copied to clipboard
val primaryKey: Output<String>? = null

The primary subscription key to use for the subscription.

Link copied to clipboard
val productId: Output<String>? = null

The ID of the Product which should be assigned to this Subscription. Changing this forces a new resource to be created.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

Link copied to clipboard
val secondaryKey: Output<String>? = null

The secondary subscription key to use for the subscription.

Link copied to clipboard
val state: Output<String>? = null

The state of this Subscription. Possible values are active, cancelled, expired, rejected, submitted and suspended. Defaults to submitted.

Link copied to clipboard
val subscriptionId: Output<String>? = null

An Identifier which should used as the ID of this Subscription. If not specified a new Subscription ID will be generated. Changing this forces a new resource to be created.

Link copied to clipboard
val userId: Output<String>? = null

The ID of the User which should be assigned to this Subscription. Changing this forces a new resource to be created.