1. Packages
  2. Ibm Provider
  3. API Docs
  4. getIamAuthToken
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.getIamAuthToken

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Retrieve information about your IAM access token. You can use this token to authenticate with the IBM Cloud platform. For more information, about IAM and UAA token, see access tokens.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const tokendata = ibm.getIamAuthToken({});
    
    import pulumi
    import pulumi_ibm as ibm
    
    tokendata = ibm.get_iam_auth_token()
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.GetIamAuthToken(ctx, &ibm.GetIamAuthTokenArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var tokendata = Ibm.GetIamAuthToken.Invoke();
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetIamAuthTokenArgs;
    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 tokendata = IbmFunctions.getIamAuthToken();
    
        }
    }
    
    variables:
      tokendata:
        fn::invoke:
          function: ibm:getIamAuthToken
          arguments: {}
    

    Using getIamAuthToken

    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 getIamAuthToken(args: GetIamAuthTokenArgs, opts?: InvokeOptions): Promise<GetIamAuthTokenResult>
    function getIamAuthTokenOutput(args: GetIamAuthTokenOutputArgs, opts?: InvokeOptions): Output<GetIamAuthTokenResult>
    def get_iam_auth_token(id: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetIamAuthTokenResult
    def get_iam_auth_token_output(id: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetIamAuthTokenResult]
    func GetIamAuthToken(ctx *Context, args *GetIamAuthTokenArgs, opts ...InvokeOption) (*GetIamAuthTokenResult, error)
    func GetIamAuthTokenOutput(ctx *Context, args *GetIamAuthTokenOutputArgs, opts ...InvokeOption) GetIamAuthTokenResultOutput

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

    public static class GetIamAuthToken 
    {
        public static Task<GetIamAuthTokenResult> InvokeAsync(GetIamAuthTokenArgs args, InvokeOptions? opts = null)
        public static Output<GetIamAuthTokenResult> Invoke(GetIamAuthTokenInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIamAuthTokenResult> getIamAuthToken(GetIamAuthTokenArgs args, InvokeOptions options)
    public static Output<GetIamAuthTokenResult> getIamAuthToken(GetIamAuthTokenArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getIamAuthToken:getIamAuthToken
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    Id string
    id String
    id string
    id str
    id String

    getIamAuthToken Result

    The following output properties are available:

    IamAccessToken string
    (String) The IAM access token.
    IamRefreshToken string
    (String) The IAM refresh token.
    Id string
    UaaAccessToken string
    (String) The UAA access token.
    UaaRefreshToken string
    (String) The UAA refresh token.
    IamAccessToken string
    (String) The IAM access token.
    IamRefreshToken string
    (String) The IAM refresh token.
    Id string
    UaaAccessToken string
    (String) The UAA access token.
    UaaRefreshToken string
    (String) The UAA refresh token.
    iamAccessToken String
    (String) The IAM access token.
    iamRefreshToken String
    (String) The IAM refresh token.
    id String
    uaaAccessToken String
    (String) The UAA access token.
    uaaRefreshToken String
    (String) The UAA refresh token.
    iamAccessToken string
    (String) The IAM access token.
    iamRefreshToken string
    (String) The IAM refresh token.
    id string
    uaaAccessToken string
    (String) The UAA access token.
    uaaRefreshToken string
    (String) The UAA refresh token.
    iam_access_token str
    (String) The IAM access token.
    iam_refresh_token str
    (String) The IAM refresh token.
    id str
    uaa_access_token str
    (String) The UAA access token.
    uaa_refresh_token str
    (String) The UAA refresh token.
    iamAccessToken String
    (String) The IAM access token.
    iamRefreshToken String
    (String) The IAM refresh token.
    id String
    uaaAccessToken String
    (String) The UAA access token.
    uaaRefreshToken String
    (String) The UAA refresh token.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud