GetSubscription
Use this data source to access information about an existing Subscription.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var current = Output.Create(Azure.Core.GetSubscription.InvokeAsync());
this.CurrentSubscriptionDisplayName = current.Apply(current => current.DisplayName);
}
[Output("currentSubscriptionDisplayName")]
public Output<string> CurrentSubscriptionDisplayName { 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 {
current, err := core.GetSubscription(ctx, nil, nil)
if err != nil {
return err
}
ctx.Export("currentSubscriptionDisplayName", current.DisplayName)
return nil
})
}import pulumi
import pulumi_azure as azure
current = azure.core.get_subscription()
pulumi.export("currentSubscriptionDisplayName", current.display_name)import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const current = azure.core.getSubscription({});
export const currentSubscriptionDisplayName = current.then(current => current.displayName);Using GetSubscription
function getSubscription(args: GetSubscriptionArgs, opts?: InvokeOptions): Promise<GetSubscriptionResult>function get_subscription(subscription_id=None, opts=None)func GetSubscription(ctx *Context, args *GetSubscriptionArgs, opts ...InvokeOption) (*GetSubscriptionResult, error)public static class GetSubscription {
public static Task<GetSubscriptionResult> InvokeAsync(GetSubscriptionArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Subscription
Id string Specifies the ID of the subscription. If this argument is omitted, the subscription ID of the current Azure Resource Manager provider is used.
- Subscription
Id string Specifies the ID of the subscription. If this argument is omitted, the subscription ID of the current Azure Resource Manager provider is used.
- subscription
Id string Specifies the ID of the subscription. If this argument is omitted, the subscription ID of the current Azure Resource Manager provider is used.
- subscription_
id str Specifies the ID of the subscription. If this argument is omitted, the subscription ID of the current Azure Resource Manager provider is used.
GetSubscription Result
The following output properties are available:
- Display
Name string The subscription display name.
- Id string
The provider-assigned unique ID for this managed resource.
- 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.
- Id string
The provider-assigned unique ID for this managed resource.
- 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.
- id string
The provider-assigned unique ID for this managed resource.
- 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.
- id str
The provider-assigned unique ID for this managed resource.
- 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.