1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getAccountToken
Cloudflare v6.0.1 published on Wednesday, Apr 16, 2025 by Pulumi

cloudflare.getAccountToken

Explore with Pulumi AI

Cloudflare v6.0.1 published on Wednesday, Apr 16, 2025 by Pulumi

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const exampleAccountToken = cloudflare.getAccountToken({
    accountId: "eb78d65290b24279ba6f44721b3ea3c4",
    tokenId: "ed17574386854bf78a67040be0a770b0",
});
Copy
import pulumi
import pulumi_cloudflare as cloudflare

example_account_token = cloudflare.get_account_token(account_id="eb78d65290b24279ba6f44721b3ea3c4",
    token_id="ed17574386854bf78a67040be0a770b0")
Copy
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.LookupAccountToken(ctx, &cloudflare.LookupAccountTokenArgs{
			AccountId: "eb78d65290b24279ba6f44721b3ea3c4",
			TokenId:   pulumi.StringRef("ed17574386854bf78a67040be0a770b0"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    var exampleAccountToken = Cloudflare.GetAccountToken.Invoke(new()
    {
        AccountId = "eb78d65290b24279ba6f44721b3ea3c4",
        TokenId = "ed17574386854bf78a67040be0a770b0",
    });

});
Copy
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.GetAccountTokenArgs;
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 exampleAccountToken = CloudflareFunctions.getAccountToken(GetAccountTokenArgs.builder()
            .accountId("eb78d65290b24279ba6f44721b3ea3c4")
            .tokenId("ed17574386854bf78a67040be0a770b0")
            .build());

    }
}
Copy
variables:
  exampleAccountToken:
    fn::invoke:
      function: cloudflare:getAccountToken
      arguments:
        accountId: eb78d65290b24279ba6f44721b3ea3c4
        tokenId: ed17574386854bf78a67040be0a770b0
Copy

Using getAccountToken

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 getAccountToken(args: GetAccountTokenArgs, opts?: InvokeOptions): Promise<GetAccountTokenResult>
function getAccountTokenOutput(args: GetAccountTokenOutputArgs, opts?: InvokeOptions): Output<GetAccountTokenResult>
Copy
def get_account_token(account_id: Optional[str] = None,
                      filter: Optional[GetAccountTokenFilter] = None,
                      token_id: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetAccountTokenResult
def get_account_token_output(account_id: Optional[pulumi.Input[str]] = None,
                      filter: Optional[pulumi.Input[GetAccountTokenFilterArgs]] = None,
                      token_id: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetAccountTokenResult]
Copy
func LookupAccountToken(ctx *Context, args *LookupAccountTokenArgs, opts ...InvokeOption) (*LookupAccountTokenResult, error)
func LookupAccountTokenOutput(ctx *Context, args *LookupAccountTokenOutputArgs, opts ...InvokeOption) LookupAccountTokenResultOutput
Copy

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

public static class GetAccountToken 
{
    public static Task<GetAccountTokenResult> InvokeAsync(GetAccountTokenArgs args, InvokeOptions? opts = null)
    public static Output<GetAccountTokenResult> Invoke(GetAccountTokenInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAccountTokenResult> getAccountToken(GetAccountTokenArgs args, InvokeOptions options)
public static Output<GetAccountTokenResult> getAccountToken(GetAccountTokenArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: cloudflare:index/getAccountToken:getAccountToken
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AccountId This property is required. string
Account identifier tag.
Filter GetAccountTokenFilter
TokenId string
Token identifier tag.
AccountId This property is required. string
Account identifier tag.
Filter GetAccountTokenFilter
TokenId string
Token identifier tag.
accountId This property is required. String
Account identifier tag.
filter GetAccountTokenFilter
tokenId String
Token identifier tag.
accountId This property is required. string
Account identifier tag.
filter GetAccountTokenFilter
tokenId string
Token identifier tag.
account_id This property is required. str
Account identifier tag.
filter GetAccountTokenFilter
token_id str
Token identifier tag.
accountId This property is required. String
Account identifier tag.
filter Property Map
tokenId String
Token identifier tag.

getAccountToken Result

The following output properties are available:

AccountId string
Account identifier tag.
Condition GetAccountTokenCondition
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<GetAccountTokenPolicy>
List of access policies assigned to the token.
Status string
Status of the token. Available values: "active", "disabled", "expired".
Filter GetAccountTokenFilter
TokenId string
Token identifier tag.
AccountId string
Account identifier tag.
Condition GetAccountTokenCondition
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 []GetAccountTokenPolicy
List of access policies assigned to the token.
Status string
Status of the token. Available values: "active", "disabled", "expired".
Filter GetAccountTokenFilter
TokenId string
Token identifier tag.
accountId String
Account identifier tag.
condition GetAccountTokenCondition
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<GetAccountTokenPolicy>
List of access policies assigned to the token.
status String
Status of the token. Available values: "active", "disabled", "expired".
filter GetAccountTokenFilter
tokenId String
Token identifier tag.
accountId string
Account identifier tag.
condition GetAccountTokenCondition
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 GetAccountTokenPolicy[]
List of access policies assigned to the token.
status string
Status of the token. Available values: "active", "disabled", "expired".
filter GetAccountTokenFilter
tokenId string
Token identifier tag.
account_id str
Account identifier tag.
condition GetAccountTokenCondition
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[GetAccountTokenPolicy]
List of access policies assigned to the token.
status str
Status of the token. Available values: "active", "disabled", "expired".
filter GetAccountTokenFilter
token_id str
Token identifier tag.
accountId String
Account identifier tag.
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".
filter Property Map
tokenId String
Token identifier tag.

Supporting Types

GetAccountTokenCondition

RequestIp This property is required. GetAccountTokenConditionRequestIp
Client IP restrictions.
RequestIp This property is required. GetAccountTokenConditionRequestIp
Client IP restrictions.
requestIp This property is required. GetAccountTokenConditionRequestIp
Client IP restrictions.
requestIp This property is required. GetAccountTokenConditionRequestIp
Client IP restrictions.
request_ip This property is required. GetAccountTokenConditionRequestIp
Client IP restrictions.
requestIp This property is required. Property Map
Client IP restrictions.

GetAccountTokenConditionRequestIp

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

GetAccountTokenFilter

Direction string
Direction to order results. Available values: "asc", "desc".
Direction string
Direction to order results. Available values: "asc", "desc".
direction String
Direction to order results. Available values: "asc", "desc".
direction string
Direction to order results. Available values: "asc", "desc".
direction str
Direction to order results. Available values: "asc", "desc".
direction String
Direction to order results. Available values: "asc", "desc".

GetAccountTokenPolicy

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

GetAccountTokenPolicyPermissionGroup

Id This property is required. string
Identifier of the group.
Meta This property is required. GetAccountTokenPolicyPermissionGroupMeta
Attributes associated to the permission group.
Name This property is required. string
Name of the group.
Id This property is required. string
Identifier of the group.
Meta This property is required. GetAccountTokenPolicyPermissionGroupMeta
Attributes associated to the permission group.
Name This property is required. string
Name of the group.
id This property is required. String
Identifier of the group.
meta This property is required. GetAccountTokenPolicyPermissionGroupMeta
Attributes associated to the permission group.
name This property is required. String
Name of the group.
id This property is required. string
Identifier of the group.
meta This property is required. GetAccountTokenPolicyPermissionGroupMeta
Attributes associated to the permission group.
name This property is required. string
Name of the group.
id This property is required. str
Identifier of the group.
meta This property is required. GetAccountTokenPolicyPermissionGroupMeta
Attributes associated to the permission group.
name This property is required. str
Name of the group.
id This property is required. String
Identifier of the group.
meta This property is required. Property Map
Attributes associated to the permission group.
name This property is required. String
Name of the group.

GetAccountTokenPolicyPermissionGroupMeta

Key This property is required. string
Value This property is required. string
Key This property is required. string
Value This property is required. string
key This property is required. String
value This property is required. String
key This property is required. string
value This property is required. string
key This property is required. str
value This property is required. str
key This property is required. String
value This property is required. String

Package Details

Repository
Cloudflare pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.
Cloudflare v6.0.1 published on Wednesday, Apr 16, 2025 by Pulumi