1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getApiTokens
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

cloudflare.getApiTokens

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleApiTokens = cloudflare.getApiTokens({
        direction: "desc",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_api_tokens = cloudflare.get_api_tokens(direction="desc")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.LookupApiTokens(ctx, &cloudflare.LookupApiTokensArgs{
    			Direction: pulumi.StringRef("desc"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleApiTokens = Cloudflare.GetApiTokens.Invoke(new()
        {
            Direction = "desc",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.CloudflareFunctions;
    import com.pulumi.cloudflare.inputs.GetApiTokensArgs;
    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 exampleApiTokens = CloudflareFunctions.getApiTokens(GetApiTokensArgs.builder()
                .direction("desc")
                .build());
    
        }
    }
    
    variables:
      exampleApiTokens:
        fn::invoke:
          function: cloudflare:getApiTokens
          arguments:
            direction: desc
    

    Using getApiTokens

    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 getApiTokens(args: GetApiTokensArgs, opts?: InvokeOptions): Promise<GetApiTokensResult>
    function getApiTokensOutput(args: GetApiTokensOutputArgs, opts?: InvokeOptions): Output<GetApiTokensResult>
    def get_api_tokens(direction: Optional[str] = None,
                       max_items: Optional[int] = None,
                       opts: Optional[InvokeOptions] = None) -> GetApiTokensResult
    def get_api_tokens_output(direction: Optional[pulumi.Input[str]] = None,
                       max_items: Optional[pulumi.Input[int]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetApiTokensResult]
    func LookupApiTokens(ctx *Context, args *LookupApiTokensArgs, opts ...InvokeOption) (*LookupApiTokensResult, error)
    func LookupApiTokensOutput(ctx *Context, args *LookupApiTokensOutputArgs, opts ...InvokeOption) LookupApiTokensResultOutput

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

    public static class GetApiTokens 
    {
        public static Task<GetApiTokensResult> InvokeAsync(GetApiTokensArgs args, InvokeOptions? opts = null)
        public static Output<GetApiTokensResult> Invoke(GetApiTokensInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetApiTokensResult> getApiTokens(GetApiTokensArgs args, InvokeOptions options)
    public static Output<GetApiTokensResult> getApiTokens(GetApiTokensArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getApiTokens:getApiTokens
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Direction string
    Direction to order results. Available values: "asc", "desc".
    MaxItems int
    Max items to fetch, default: 1000
    Direction string
    Direction to order results. Available values: "asc", "desc".
    MaxItems int
    Max items to fetch, default: 1000
    direction String
    Direction to order results. Available values: "asc", "desc".
    maxItems Integer
    Max items to fetch, default: 1000
    direction string
    Direction to order results. Available values: "asc", "desc".
    maxItems number
    Max items to fetch, default: 1000
    direction str
    Direction to order results. Available values: "asc", "desc".
    max_items int
    Max items to fetch, default: 1000
    direction String
    Direction to order results. Available values: "asc", "desc".
    maxItems Number
    Max items to fetch, default: 1000

    getApiTokens Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Results List<GetApiTokensResult>
    The items returned by the data source
    Direction string
    Direction to order results. Available values: "asc", "desc".
    MaxItems int
    Max items to fetch, default: 1000
    Id string
    The provider-assigned unique ID for this managed resource.
    Results []GetApiTokensResult
    The items returned by the data source
    Direction string
    Direction to order results. Available values: "asc", "desc".
    MaxItems int
    Max items to fetch, default: 1000
    id String
    The provider-assigned unique ID for this managed resource.
    results List<GetApiTokensResult>
    The items returned by the data source
    direction String
    Direction to order results. Available values: "asc", "desc".
    maxItems Integer
    Max items to fetch, default: 1000
    id string
    The provider-assigned unique ID for this managed resource.
    results GetApiTokensResult[]
    The items returned by the data source
    direction string
    Direction to order results. Available values: "asc", "desc".
    maxItems number
    Max items to fetch, default: 1000
    id str
    The provider-assigned unique ID for this managed resource.
    results Sequence[GetApiTokensResult]
    The items returned by the data source
    direction str
    Direction to order results. Available values: "asc", "desc".
    max_items int
    Max items to fetch, default: 1000
    id String
    The provider-assigned unique ID for this managed resource.
    results List<Property Map>
    The items returned by the data source
    direction String
    Direction to order results. Available values: "asc", "desc".
    maxItems Number
    Max items to fetch, default: 1000

    Supporting Types

    GetApiTokensResult

    Condition GetApiTokensResultCondition
    ExpiresOn string
    The expiration time on or after which the JWT MUST NOT be accepted for processing.
    Id string
    Token identifier tag.
    IssuedOn string
    The time on which the token was created.
    LastUsedOn string
    Last time the token was used.
    ModifiedOn string
    Last time the token was modified.
    Name string
    Token name.
    NotBefore string
    The time before which the token MUST NOT be accepted for processing.
    Policies List<GetApiTokensResultPolicy>
    List of access policies assigned to the token.
    Status string
    Status of the token. Available values: "active", "disabled", "expired".
    Condition GetApiTokensResultCondition
    ExpiresOn string
    The expiration time on or after which the JWT MUST NOT be accepted for processing.
    Id string
    Token identifier tag.
    IssuedOn string
    The time on which the token was created.
    LastUsedOn string
    Last time the token was used.
    ModifiedOn string
    Last time the token was modified.
    Name string
    Token name.
    NotBefore string
    The time before which the token MUST NOT be accepted for processing.
    Policies []GetApiTokensResultPolicy
    List of access policies assigned to the token.
    Status string
    Status of the token. Available values: "active", "disabled", "expired".
    condition GetApiTokensResultCondition
    expiresOn String
    The expiration time on or after which the JWT MUST NOT be accepted for processing.
    id String
    Token identifier tag.
    issuedOn String
    The time on which the token was created.
    lastUsedOn String
    Last time the token was used.
    modifiedOn String
    Last time the token was modified.
    name String
    Token name.
    notBefore String
    The time before which the token MUST NOT be accepted for processing.
    policies List<GetApiTokensResultPolicy>
    List of access policies assigned to the token.
    status String
    Status of the token. Available values: "active", "disabled", "expired".
    condition GetApiTokensResultCondition
    expiresOn string
    The expiration time on or after which the JWT MUST NOT be accepted for processing.
    id string
    Token identifier tag.
    issuedOn string
    The time on which the token was created.
    lastUsedOn string
    Last time the token was used.
    modifiedOn string
    Last time the token was modified.
    name string
    Token name.
    notBefore string
    The time before which the token MUST NOT be accepted for processing.
    policies GetApiTokensResultPolicy[]
    List of access policies assigned to the token.
    status string
    Status of the token. Available values: "active", "disabled", "expired".
    condition GetApiTokensResultCondition
    expires_on str
    The expiration time on or after which the JWT MUST NOT be accepted for processing.
    id str
    Token identifier tag.
    issued_on str
    The time on which the token was created.
    last_used_on str
    Last time the token was used.
    modified_on str
    Last time the token was modified.
    name str
    Token name.
    not_before str
    The time before which the token MUST NOT be accepted for processing.
    policies Sequence[GetApiTokensResultPolicy]
    List of access policies assigned to the token.
    status str
    Status of the token. Available values: "active", "disabled", "expired".
    condition Property Map
    expiresOn String
    The expiration time on or after which the JWT MUST NOT be accepted for processing.
    id String
    Token identifier tag.
    issuedOn String
    The time on which the token was created.
    lastUsedOn String
    Last time the token was used.
    modifiedOn String
    Last time the token was modified.
    name String
    Token name.
    notBefore String
    The time before which the token MUST NOT be accepted for processing.
    policies List<Property Map>
    List of access policies assigned to the token.
    status String
    Status of the token. Available values: "active", "disabled", "expired".

    GetApiTokensResultCondition

    requestIp Property Map
    Client IP restrictions.

    GetApiTokensResultConditionRequestIp

    Ins List<string>
    List of IPv4/IPv6 CIDR addresses.
    NotIns List<string>
    List of IPv4/IPv6 CIDR addresses.
    Ins []string
    List of IPv4/IPv6 CIDR addresses.
    NotIns []string
    List of IPv4/IPv6 CIDR addresses.
    ins List<String>
    List of IPv4/IPv6 CIDR addresses.
    notIns List<String>
    List of IPv4/IPv6 CIDR addresses.
    ins string[]
    List of IPv4/IPv6 CIDR addresses.
    notIns string[]
    List of IPv4/IPv6 CIDR addresses.
    ins Sequence[str]
    List of IPv4/IPv6 CIDR addresses.
    not_ins Sequence[str]
    List of IPv4/IPv6 CIDR addresses.
    ins List<String>
    List of IPv4/IPv6 CIDR addresses.
    notIns List<String>
    List of IPv4/IPv6 CIDR addresses.

    GetApiTokensResultPolicy

    Effect string
    Allow or deny operations against the resources. Available values: "allow", "deny".
    Id string
    Policy identifier.
    PermissionGroups List<GetApiTokensResultPolicyPermissionGroup>
    A set of permission groups that are specified to the policy.
    Resources Dictionary<string, string>
    A list of resource names that the policy applies to.
    Effect string
    Allow or deny operations against the resources. Available values: "allow", "deny".
    Id string
    Policy identifier.
    PermissionGroups []GetApiTokensResultPolicyPermissionGroup
    A set of permission groups that are specified to the policy.
    Resources map[string]string
    A list of resource names that the policy applies to.
    effect String
    Allow or deny operations against the resources. Available values: "allow", "deny".
    id String
    Policy identifier.
    permissionGroups List<GetApiTokensResultPolicyPermissionGroup>
    A set of permission groups that are specified to the policy.
    resources Map<String,String>
    A list of resource names that the policy applies to.
    effect string
    Allow or deny operations against the resources. Available values: "allow", "deny".
    id string
    Policy identifier.
    permissionGroups GetApiTokensResultPolicyPermissionGroup[]
    A set of permission groups that are specified to the policy.
    resources {[key: string]: string}
    A list of resource names that the policy applies to.
    effect str
    Allow or deny operations against the resources. Available values: "allow", "deny".
    id str
    Policy identifier.
    permission_groups Sequence[GetApiTokensResultPolicyPermissionGroup]
    A set of permission groups that are specified to the policy.
    resources Mapping[str, str]
    A list of resource names that the policy applies to.
    effect String
    Allow or deny operations against the resources. Available values: "allow", "deny".
    id String
    Policy identifier.
    permissionGroups List<Property Map>
    A set of permission groups that are specified to the policy.
    resources Map<String>
    A list of resource names that the policy applies to.

    GetApiTokensResultPolicyPermissionGroup

    Id string
    Identifier of the group.
    Meta GetApiTokensResultPolicyPermissionGroupMeta
    Attributes associated to the permission group.
    Name string
    Name of the group.
    Id string
    Identifier of the group.
    Meta GetApiTokensResultPolicyPermissionGroupMeta
    Attributes associated to the permission group.
    Name string
    Name of the group.
    id String
    Identifier of the group.
    meta GetApiTokensResultPolicyPermissionGroupMeta
    Attributes associated to the permission group.
    name String
    Name of the group.
    id string
    Identifier of the group.
    meta GetApiTokensResultPolicyPermissionGroupMeta
    Attributes associated to the permission group.
    name string
    Name of the group.
    id str
    Identifier of the group.
    meta GetApiTokensResultPolicyPermissionGroupMeta
    Attributes associated to the permission group.
    name str
    Name of the group.
    id String
    Identifier of the group.
    meta Property Map
    Attributes associated to the permission group.
    name String
    Name of the group.

    GetApiTokensResultPolicyPermissionGroupMeta

    Key string
    Value string
    Key string
    Value string
    key String
    value String
    key string
    value string
    key str
    value str
    key String
    value String

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi