1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. oci
  5. getSelfSubscriptionToken
Viewing docs for Oracle Cloud Infrastructure v4.7.0
published on Thursday, Apr 16, 2026 by Pulumi
oci logo
Viewing docs for Oracle Cloud Infrastructure v4.7.0
published on Thursday, Apr 16, 2026 by Pulumi

    This data source provides details about a specific Subscription Token resource in Oracle Cloud Infrastructure Self service.

    Gets a token of Subscriptions.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testSubscriptionToken = oci.oci.getSelfSubscriptionToken({
        subscriptionId: testSubscription.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_subscription_token = oci.oci.get_self_subscription_token(subscription_id=test_subscription["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v4/go/oci/oci"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := oci.GetSelfSubscriptionToken(ctx, &oci.GetSelfSubscriptionTokenArgs{
    			SubscriptionId: testSubscription.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testSubscriptionToken = Oci.Oci.GetSelfSubscriptionToken.Invoke(new()
        {
            SubscriptionId = testSubscription.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.oci.OciFunctions;
    import com.pulumi.oci.oci.inputs.GetSelfSubscriptionTokenArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var testSubscriptionToken = OciFunctions.getSelfSubscriptionToken(GetSelfSubscriptionTokenArgs.builder()
                .subscriptionId(testSubscription.id())
                .build());
    
        }
    }
    
    variables:
      testSubscriptionToken:
        fn::invoke:
          function: oci:oci:getSelfSubscriptionToken
          arguments:
            subscriptionId: ${testSubscription.id}
    

    Using getSelfSubscriptionToken

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getSelfSubscriptionToken(args: GetSelfSubscriptionTokenArgs, opts?: InvokeOptions): Promise<GetSelfSubscriptionTokenResult>
    function getSelfSubscriptionTokenOutput(args: GetSelfSubscriptionTokenOutputArgs, opts?: InvokeOptions): Output<GetSelfSubscriptionTokenResult>
    def get_self_subscription_token(subscription_id: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetSelfSubscriptionTokenResult
    def get_self_subscription_token_output(subscription_id: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetSelfSubscriptionTokenResult]
    func GetSelfSubscriptionToken(ctx *Context, args *GetSelfSubscriptionTokenArgs, opts ...InvokeOption) (*GetSelfSubscriptionTokenResult, error)
    func GetSelfSubscriptionTokenOutput(ctx *Context, args *GetSelfSubscriptionTokenOutputArgs, opts ...InvokeOption) GetSelfSubscriptionTokenResultOutput

    > Note: This function is named GetSelfSubscriptionToken in the Go SDK.

    public static class GetSelfSubscriptionToken 
    {
        public static Task<GetSelfSubscriptionTokenResult> InvokeAsync(GetSelfSubscriptionTokenArgs args, InvokeOptions? opts = null)
        public static Output<GetSelfSubscriptionTokenResult> Invoke(GetSelfSubscriptionTokenInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSelfSubscriptionTokenResult> getSelfSubscriptionToken(GetSelfSubscriptionTokenArgs args, InvokeOptions options)
    public static Output<GetSelfSubscriptionTokenResult> getSelfSubscriptionToken(GetSelfSubscriptionTokenArgs args, InvokeOptions options)
    
    fn::invoke:
      function: oci:oci/getSelfSubscriptionToken:getSelfSubscriptionToken
      arguments:
        # arguments dictionary

    The following arguments are supported:

    SubscriptionId string
    The unique identifier for the subscription.
    SubscriptionId string
    The unique identifier for the subscription.
    subscriptionId String
    The unique identifier for the subscription.
    subscriptionId string
    The unique identifier for the subscription.
    subscription_id str
    The unique identifier for the subscription.
    subscriptionId String
    The unique identifier for the subscription.

    getSelfSubscriptionToken Result

    The following output properties are available:

    DefinedTags Dictionary<string, string>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    FreeformTags Dictionary<string, string>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Id string
    The provider-assigned unique ID for this managed resource.
    SubscriptionId string
    The unique identifier for the subscription within a specific compartment.
    SystemTags Dictionary<string, string>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    Token string
    JWT token of subscriptions.
    DefinedTags map[string]string
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    FreeformTags map[string]string
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Id string
    The provider-assigned unique ID for this managed resource.
    SubscriptionId string
    The unique identifier for the subscription within a specific compartment.
    SystemTags map[string]string
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    Token string
    JWT token of subscriptions.
    definedTags Map<String,String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    freeformTags Map<String,String>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id String
    The provider-assigned unique ID for this managed resource.
    subscriptionId String
    The unique identifier for the subscription within a specific compartment.
    systemTags Map<String,String>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    token String
    JWT token of subscriptions.
    definedTags {[key: string]: string}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    freeformTags {[key: string]: string}
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id string
    The provider-assigned unique ID for this managed resource.
    subscriptionId string
    The unique identifier for the subscription within a specific compartment.
    systemTags {[key: string]: string}
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    token string
    JWT token of subscriptions.
    defined_tags Mapping[str, str]
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    freeform_tags Mapping[str, str]
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id str
    The provider-assigned unique ID for this managed resource.
    subscription_id str
    The unique identifier for the subscription within a specific compartment.
    system_tags Mapping[str, str]
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    token str
    JWT token of subscriptions.
    definedTags Map<String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    freeformTags Map<String>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id String
    The provider-assigned unique ID for this managed resource.
    subscriptionId String
    The unique identifier for the subscription within a specific compartment.
    systemTags Map<String>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    token String
    JWT token of subscriptions.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Viewing docs for Oracle Cloud Infrastructure v4.7.0
    published on Thursday, Apr 16, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.