Show / Hide Table of Contents

Class Subscription

Manages a Subscription within a API Management Service.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
public MyStack()
{
    var exampleService = Output.Create(Azure.ApiManagement.GetService.InvokeAsync(new Azure.ApiManagement.GetServiceArgs
    {
        Name = "example-apim",
        ResourceGroupName = "example-resources",
    }));
    var exampleProduct = Output.Tuple(exampleService, exampleService).Apply(values =>
    {
        var exampleService = values.Item1;
        var exampleService1 = values.Item2;
        return Output.Create(Azure.ApiManagement.GetProduct.InvokeAsync(new Azure.ApiManagement.GetProductArgs
        {
            ProductId = "00000000-0000-0000-0000-000000000000",
            ApiManagementName = exampleService.Name,
            ResourceGroupName = exampleService1.ResourceGroupName,
        }));
    });
    var exampleUser = Output.Tuple(exampleService, exampleService).Apply(values =>
    {
        var exampleService = values.Item1;
        var exampleService1 = values.Item2;
        return Output.Create(Azure.ApiManagement.GetUser.InvokeAsync(new Azure.ApiManagement.GetUserArgs
        {
            UserId = "11111111-1111-1111-1111-111111111111",
            ApiManagementName = exampleService.Name,
            ResourceGroupName = exampleService1.ResourceGroupName,
        }));
    });
    var exampleSubscription = new Azure.ApiManagement.Subscription("exampleSubscription", new Azure.ApiManagement.SubscriptionArgs
    {
        ApiManagementName = exampleService.Apply(exampleService => exampleService.Name),
        ResourceGroupName = exampleService.Apply(exampleService => exampleService.ResourceGroupName),
        UserId = exampleUser.Apply(exampleUser => exampleUser.Id),
        ProductId = exampleProduct.Apply(exampleProduct => exampleProduct.Id),
        DisplayName = "Parser API",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Subscription
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Azure.ApiManagement
Assembly: Pulumi.Azure.dll
Syntax
public class Subscription : CustomResource

Constructors

View Source

Subscription(String, SubscriptionArgs, CustomResourceOptions)

Create a Subscription resource with the given unique name, arguments, and options.

Declaration
public Subscription(string name, SubscriptionArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

SubscriptionArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

ApiManagementName

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

Declaration
public Output<string> ApiManagementName { get; }
Property Value
Type Description
Output<System.String>
View Source

DisplayName

The display name of this Subscription.

Declaration
public Output<string> DisplayName { get; }
Property Value
Type Description
Output<System.String>
View Source

PrimaryKey

Declaration
public Output<string> PrimaryKey { get; }
Property Value
Type Description
Output<System.String>
View Source

ProductId

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

Declaration
public Output<string> ProductId { get; }
Property Value
Type Description
Output<System.String>
View Source

ResourceGroupName

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

Declaration
public Output<string> ResourceGroupName { get; }
Property Value
Type Description
Output<System.String>
View Source

SecondaryKey

Declaration
public Output<string> SecondaryKey { get; }
Property Value
Type Description
Output<System.String>
View Source

State

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

Declaration
public Output<string> State { get; }
Property Value
Type Description
Output<System.String>
View Source

SubscriptionId

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.

Declaration
public Output<string> SubscriptionId { get; }
Property Value
Type Description
Output<System.String>
View Source

UserId

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

Declaration
public Output<string> UserId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, SubscriptionState, CustomResourceOptions)

Get an existing Subscription resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static Subscription Get(string name, Input<string> id, SubscriptionState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

SubscriptionState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Subscription
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.