/
getSubscription.go
68 lines (63 loc) · 2.22 KB
/
getSubscription.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package core
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Use this data source to access information about an existing Subscription.
//
// ## Example Usage
//
// ```go
// 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.LookupSubscription(ctx, nil, nil)
// if err != nil {
// return err
// }
// ctx.Export("currentSubscriptionDisplayName", current.DisplayName)
// return nil
// })
// }
// ```
func LookupSubscription(ctx *pulumi.Context, args *LookupSubscriptionArgs, opts ...pulumi.InvokeOption) (*LookupSubscriptionResult, error) {
var rv LookupSubscriptionResult
err := ctx.Invoke("azure:core/getSubscription:getSubscription", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSubscription.
type LookupSubscriptionArgs struct {
// Specifies the ID of the subscription. If this argument is omitted, the subscription ID of the current Azure Resource Manager provider is used.
SubscriptionId *string `pulumi:"subscriptionId"`
}
// A collection of values returned by getSubscription.
type LookupSubscriptionResult struct {
// The subscription display name.
DisplayName string `pulumi:"displayName"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The subscription location placement ID.
LocationPlacementId string `pulumi:"locationPlacementId"`
// The subscription quota ID.
QuotaId string `pulumi:"quotaId"`
// The subscription spending limit.
SpendingLimit string `pulumi:"spendingLimit"`
// The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.
State string `pulumi:"state"`
// The subscription GUID.
SubscriptionId string `pulumi:"subscriptionId"`
// A mapping of tags assigned to the Subscription.
Tags map[string]string `pulumi:"tags"`
// The subscription tenant ID.
TenantId string `pulumi:"tenantId"`
}