Subscription

class Subscription : KotlinCustomResource

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

Properties

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

Determines whether tracing can be enabled. Defaults to true.

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

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

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>

The display name of this Subscription.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val primaryKey: Output<String>

The primary subscription key to use for the subscription.

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

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 pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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>

The secondary subscription key to use for the subscription.

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

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>

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 urn: Output<String>
Link copied to clipboard
val userId: Output<String>?

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