SubscriptionArgs

data class SubscriptionArgs(val allowTracing: Output<Boolean>? = null, val appType: Output<String>? = null, val displayName: Output<String>? = null, val notify: Output<Boolean>? = null, val ownerId: Output<String>? = null, val primaryKey: Output<String>? = null, val resourceGroupName: Output<String>? = null, val scope: Output<String>? = null, val secondaryKey: Output<String>? = null, val serviceName: Output<String>? = null, val sid: Output<String>? = null, val state: Output<SubscriptionState>? = null) : ConvertibleToJava<SubscriptionArgs>

Subscription details. Uses Azure REST API version 2022-09-01-preview. In version 2.x of the Azure Native provider, it used API version 2022-08-01. Other available API versions: 2021-04-01-preview, 2021-08-01, 2021-12-01-preview, 2022-04-01-preview, 2022-08-01, 2023-03-01-preview, 2023-05-01-preview, 2023-09-01-preview, 2024-05-01, 2024-06-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native apimanagement [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

ApiManagementCreateSubscription

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var subscription = new AzureNative.ApiManagement.Subscription("subscription", new()
{
DisplayName = "testsub",
OwnerId = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57127d485157a511ace86ae7",
ResourceGroupName = "rg1",
Scope = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060002",
ServiceName = "apimService1",
Sid = "testsub",
});
});
package main
import (
apimanagement "github.com/pulumi/pulumi-azure-native-sdk/apimanagement/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := apimanagement.NewSubscription(ctx, "subscription", &apimanagement.SubscriptionArgs{
DisplayName: pulumi.String("testsub"),
OwnerId: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57127d485157a511ace86ae7"),
ResourceGroupName: pulumi.String("rg1"),
Scope: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060002"),
ServiceName: pulumi.String("apimService1"),
Sid: pulumi.String("testsub"),
})
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.azurenative.apimanagement.Subscription;
import com.pulumi.azurenative.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) {
var subscription = new Subscription("subscription", SubscriptionArgs.builder()
.displayName("testsub")
.ownerId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57127d485157a511ace86ae7")
.resourceGroupName("rg1")
.scope("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060002")
.serviceName("apimService1")
.sid("testsub")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:apimanagement:Subscription testsub /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}

Constructors

Link copied to clipboard
constructor(allowTracing: Output<Boolean>? = null, appType: Output<String>? = null, displayName: Output<String>? = null, notify: Output<Boolean>? = null, ownerId: Output<String>? = null, primaryKey: Output<String>? = null, resourceGroupName: Output<String>? = null, scope: Output<String>? = null, secondaryKey: Output<String>? = null, serviceName: Output<String>? = null, sid: Output<String>? = null, state: Output<SubscriptionState>? = null)

Properties

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

Determines whether tracing can be enabled

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

Determines the type of application which send the create user request. Default is legacy publisher portal.

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

Subscription name.

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

Notify change in Subscription State.

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

User (user id path) for whom subscription is being created in form /users/{userId}

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

Primary subscription key. If not specified during request key will be generated automatically.

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

The name of the resource group. The name is case insensitive.

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

Scope like /products/{productId} or /apis or /apis/{apiId}.

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

Secondary subscription key. If not specified during request key will be generated automatically.

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

The name of the API Management service.

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

Subscription entity Identifier. The entity represents the association between a user and a product in API Management.

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

Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.

Functions

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