GetSubscriptions
Use this data source to access information about all the Subscriptions currently available.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var available = Output.Create(Azure.Core.GetSubscriptions.InvokeAsync());
this.AvailableSubscriptions = available.Apply(available => available.Subscriptions);
this.FirstAvailableSubscriptionDisplayName = available.Apply(available => available.Subscriptions[0].DisplayName);
}
[Output("availableSubscriptions")]
public Output<string> AvailableSubscriptions { get; set; }
[Output("firstAvailableSubscriptionDisplayName")]
public Output<string> FirstAvailableSubscriptionDisplayName { get; set; }
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
available, err := core.GetSubscriptions(ctx, nil, nil)
if err != nil {
return err
}
ctx.Export("availableSubscriptions", available.Subscriptions)
ctx.Export("firstAvailableSubscriptionDisplayName", available.Subscriptions[0].DisplayName)
return nil
})
}import pulumi
import pulumi_azure as azure
available = azure.core.get_subscriptions()
pulumi.export("availableSubscriptions", available.subscriptions)
pulumi.export("firstAvailableSubscriptionDisplayName", available.subscriptions[0]["display_name"])import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const available = azure.core.getSubscriptions({});
export const availableSubscriptions = available.then(available => available.subscriptions);
export const firstAvailableSubscriptionDisplayName = available.then(available => available.subscriptions[0].displayName);Using GetSubscriptions
function getSubscriptions(args: GetSubscriptionsArgs, opts?: InvokeOptions): Promise<GetSubscriptionsResult>function get_subscriptions(display_name_contains=None, display_name_prefix=None, opts=None)func GetSubscriptions(ctx *Context, args *GetSubscriptionsArgs, opts ...InvokeOption) (*GetSubscriptionsResult, error)public static class GetSubscriptions {
public static Task<GetSubscriptionsResult> InvokeAsync(GetSubscriptionsArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Display
Name stringContains A case-insensitive value which must be contained within the
display_namefield, used to filter the results- Display
Name stringPrefix A case-insensitive prefix which can be used to filter on the
display_namefield
- Display
Name stringContains A case-insensitive value which must be contained within the
display_namefield, used to filter the results- Display
Name stringPrefix A case-insensitive prefix which can be used to filter on the
display_namefield
- display
Name stringContains A case-insensitive value which must be contained within the
display_namefield, used to filter the results- display
Name stringPrefix A case-insensitive prefix which can be used to filter on the
display_namefield
- display_
name_ strcontains A case-insensitive value which must be contained within the
display_namefield, used to filter the results- display_
name_ strprefix A case-insensitive prefix which can be used to filter on the
display_namefield
GetSubscriptions Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Subscriptions
List<Get
Subscriptions Subscription> One or more
subscriptionblocks as defined below.- Display
Name stringContains - Display
Name stringPrefix
- Id string
The provider-assigned unique ID for this managed resource.
- Subscriptions
[]Get
Subscriptions Subscription One or more
subscriptionblocks as defined below.- Display
Name stringContains - Display
Name stringPrefix
- id string
The provider-assigned unique ID for this managed resource.
- subscriptions
Get
Subscriptions Subscription[] One or more
subscriptionblocks as defined below.- display
Name stringContains - display
Name stringPrefix
- id str
The provider-assigned unique ID for this managed resource.
- subscriptions
List[Get
Subscriptions Subscription] One or more
subscriptionblocks as defined below.- display_
name_ strcontains - display_
name_ strprefix
Supporting Types
GetSubscriptionsSubscription
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Display
Name string The subscription display name.
- Location
Placement stringId The subscription location placement ID.
- Quota
Id string The subscription quota ID.
- Spending
Limit string The subscription spending limit.
- State string
The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.
- Subscription
Id string The subscription GUID.
- Tenant
Id string The subscription tenant ID.
- Display
Name string The subscription display name.
- Location
Placement stringId The subscription location placement ID.
- Quota
Id string The subscription quota ID.
- Spending
Limit string The subscription spending limit.
- State string
The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.
- Subscription
Id string The subscription GUID.
- Tenant
Id string The subscription tenant ID.
- display
Name string The subscription display name.
- location
Placement stringId The subscription location placement ID.
- quota
Id string The subscription quota ID.
- spending
Limit string The subscription spending limit.
- state string
The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.
- subscription
Id string The subscription GUID.
- tenant
Id string The subscription tenant ID.
- display_
name str The subscription display name.
- location
Placement strId The subscription location placement ID.
- quota
Id str The subscription quota ID.
- spending
Limit str The subscription spending limit.
- state str
The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.
- subscription_
id str The subscription GUID.
- tenant_
id str The subscription tenant ID.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.