Azure Native

Pulumi Official
Package maintained by Pulumi
v1.64.0 published on Wednesday, May 4, 2022 by Pulumi

Subscription

Subscription details. API Version: 2020-12-01.

Example Usage

ApiManagementCreateSubscription

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var subscription = new AzureNative.ApiManagement.Subscription("subscription", new AzureNative.ApiManagement.SubscriptionArgs
        {
            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/go/azure/apimanagement"
	"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 java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

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 pulumi
import pulumi_azure_native as azure_native

subscription = azure_native.apimanagement.Subscription("subscription",
    display_name="testsub",
    owner_id="/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57127d485157a511ace86ae7",
    resource_group_name="rg1",
    scope="/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060002",
    service_name="apimService1",
    sid="testsub")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const subscription = new azure_native.apimanagement.Subscription("subscription", {
    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",
});
resources:
  subscription:
    type: azure-native:apimanagement:Subscription
    properties:
      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

Create a Subscription Resource

new Subscription(name: string, args: SubscriptionArgs, opts?: CustomResourceOptions);
@overload
def Subscription(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 allow_tracing: Optional[bool] = None,
                 app_type: Optional[str] = None,
                 display_name: Optional[str] = None,
                 notify: Optional[bool] = None,
                 owner_id: Optional[str] = None,
                 primary_key: Optional[str] = None,
                 resource_group_name: Optional[str] = None,
                 scope: Optional[str] = None,
                 secondary_key: Optional[str] = None,
                 service_name: Optional[str] = None,
                 sid: Optional[str] = None,
                 state: Optional[SubscriptionState] = None)
@overload
def Subscription(resource_name: str,
                 args: SubscriptionArgs,
                 opts: Optional[ResourceOptions] = None)
func NewSubscription(ctx *Context, name string, args SubscriptionArgs, opts ...ResourceOption) (*Subscription, error)
public Subscription(string name, SubscriptionArgs args, CustomResourceOptions? opts = null)
public Subscription(String name, SubscriptionArgs args)
public Subscription(String name, SubscriptionArgs args, CustomResourceOptions options)
type: azure-native:apimanagement:Subscription
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args SubscriptionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args SubscriptionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SubscriptionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SubscriptionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args SubscriptionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Subscription Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Subscription resource accepts the following input properties:

DisplayName string

Subscription name.

ResourceGroupName string

The name of the resource group.

Scope string

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

ServiceName string

The name of the API Management service.

AllowTracing bool

Determines whether tracing can be enabled

AppType string

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

Notify bool

Notify change in Subscription State.

  • If false, do not send any email notification for change of state of subscription
  • If true, send email notification of change of state of subscription
OwnerId string

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

PrimaryKey string

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

SecondaryKey string

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

Sid string

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

State Pulumi.AzureNative.ApiManagement.SubscriptionState

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.

DisplayName string

Subscription name.

ResourceGroupName string

The name of the resource group.

Scope string

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

ServiceName string

The name of the API Management service.

AllowTracing bool

Determines whether tracing can be enabled

AppType string

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

Notify bool

Notify change in Subscription State.

  • If false, do not send any email notification for change of state of subscription
  • If true, send email notification of change of state of subscription
OwnerId string

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

PrimaryKey string

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

SecondaryKey string

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

Sid string

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

State SubscriptionStateEnum

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.

displayName String

Subscription name.

resourceGroupName String

The name of the resource group.

scope String

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

serviceName String

The name of the API Management service.

allowTracing Boolean

Determines whether tracing can be enabled

appType String

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

notify_ Boolean

Notify change in Subscription State.

  • If false, do not send any email notification for change of state of subscription
  • If true, send email notification of change of state of subscription
ownerId String

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

primaryKey String

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

secondaryKey String

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

sid String

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

state SubscriptionState

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.

displayName string

Subscription name.

resourceGroupName string

The name of the resource group.

scope string

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

serviceName string

The name of the API Management service.

allowTracing boolean

Determines whether tracing can be enabled

appType string

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

notify boolean

Notify change in Subscription State.

  • If false, do not send any email notification for change of state of subscription
  • If true, send email notification of change of state of subscription
ownerId string

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

primaryKey string

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

secondaryKey string

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

sid string

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

state SubscriptionState

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.

display_name str

Subscription name.

resource_group_name str

The name of the resource group.

scope str

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

service_name str

The name of the API Management service.

allow_tracing bool

Determines whether tracing can be enabled

app_type str

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

notify bool

Notify change in Subscription State.

  • If false, do not send any email notification for change of state of subscription
  • If true, send email notification of change of state of subscription
owner_id str

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

primary_key str

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

secondary_key str

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

sid str

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

state SubscriptionState

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.

displayName String

Subscription name.

resourceGroupName String

The name of the resource group.

scope String

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

serviceName String

The name of the API Management service.

allowTracing Boolean

Determines whether tracing can be enabled

appType String

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

notify Boolean

Notify change in Subscription State.

  • If false, do not send any email notification for change of state of subscription
  • If true, send email notification of change of state of subscription
ownerId String

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

primaryKey String

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

secondaryKey String

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

sid String

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

state "suspended" | "active" | "expired" | "submitted" | "rejected" | "cancelled"

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.

Outputs

All input properties are implicitly available as output properties. Additionally, the Subscription resource produces the following output properties:

CreatedDate string

Subscription creation date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

Id string

The provider-assigned unique ID for this managed resource.

Name string

Resource name.

Type string

Resource type for API Management resource.

EndDate string

Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

ExpirationDate string

Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

NotificationDate string

Upcoming subscription expiration notification date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

StartDate string

Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

StateComment string

Optional subscription comment added by an administrator when the state is changed to the 'rejected'.

CreatedDate string

Subscription creation date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

Id string

The provider-assigned unique ID for this managed resource.

Name string

Resource name.

Type string

Resource type for API Management resource.

EndDate string

Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

ExpirationDate string

Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

NotificationDate string

Upcoming subscription expiration notification date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

StartDate string

Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

StateComment string

Optional subscription comment added by an administrator when the state is changed to the 'rejected'.

createdDate String

Subscription creation date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

id String

The provider-assigned unique ID for this managed resource.

name String

Resource name.

type String

Resource type for API Management resource.

endDate String

Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

expirationDate String

Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

notificationDate String

Upcoming subscription expiration notification date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

startDate String

Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

stateComment String

Optional subscription comment added by an administrator when the state is changed to the 'rejected'.

createdDate string

Subscription creation date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

id string

The provider-assigned unique ID for this managed resource.

name string

Resource name.

type string

Resource type for API Management resource.

endDate string

Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

expirationDate string

Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

notificationDate string

Upcoming subscription expiration notification date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

startDate string

Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

stateComment string

Optional subscription comment added by an administrator when the state is changed to the 'rejected'.

created_date str

Subscription creation date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

id str

The provider-assigned unique ID for this managed resource.

name str

Resource name.

type str

Resource type for API Management resource.

end_date str

Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

expiration_date str

Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

notification_date str

Upcoming subscription expiration notification date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

start_date str

Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

state_comment str

Optional subscription comment added by an administrator when the state is changed to the 'rejected'.

createdDate String

Subscription creation date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

id String

The provider-assigned unique ID for this managed resource.

name String

Resource name.

type String

Resource type for API Management resource.

endDate String

Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

expirationDate String

Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

notificationDate String

Upcoming subscription expiration notification date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

startDate String

Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

stateComment String

Optional subscription comment added by an administrator when the state is changed to the 'rejected'.

Supporting Types

SubscriptionState

Suspended
suspended
Active
active
Expired
expired
Submitted
submitted
Rejected
rejected
Cancelled
cancelled
SubscriptionStateSuspended
suspended
SubscriptionStateActive
active
SubscriptionStateExpired
expired
SubscriptionStateSubmitted
submitted
SubscriptionStateRejected
rejected
SubscriptionStateCancelled
cancelled
Suspended
suspended
Active
active
Expired
expired
Submitted
submitted
Rejected
rejected
Cancelled
cancelled
Suspended
suspended
Active
active
Expired
expired
Submitted
submitted
Rejected
rejected
Cancelled
cancelled
SUSPENDED
suspended
ACTIVE
active
EXPIRED
expired
SUBMITTED
submitted
REJECTED
rejected
CANCELLED
cancelled
"suspended"
suspended
"active"
active
"expired"
expired
"submitted"
submitted
"rejected"
rejected
"cancelled"
cancelled

Import

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

$ pulumi import azure-native:apimanagement:Subscription testsub /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/subscriptions/testsub 

Package Details

Repository
https://github.com/pulumi/pulumi-azure-native
License
Apache-2.0