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",
});
}
}
Inherited Members
Namespace: Pulumi.Azure.ApiManagement
Assembly: Pulumi.Azure.dll
Syntax
public class Subscription : CustomResource
Constructors
View SourceSubscription(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 SourceApiManagementName
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> |
DisplayName
The display name of this Subscription.
Declaration
public Output<string> DisplayName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PrimaryKey
Declaration
public Output<string> PrimaryKey { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
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> |
SecondaryKey
Declaration
public Output<string> SecondaryKey { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
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> |
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 SourceGet(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 |