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

cloudflare.AccessServiceToken

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi
    Deprecated: cloudflare.index/accessservicetoken.AccessServiceToken has been deprecated in favor of cloudflare.index/zerotrustaccessservicetoken.ZeroTrustAccessServiceToken

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleZeroTrustAccessServiceToken = new cloudflare.ZeroTrustAccessServiceToken("example_zero_trust_access_service_token", {
        name: "CI/CD token",
        zoneId: "zone_id",
        duration: "60m",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_zero_trust_access_service_token = cloudflare.ZeroTrustAccessServiceToken("example_zero_trust_access_service_token",
        name="CI/CD token",
        zone_id="zone_id",
        duration="60m")
    
    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.NewZeroTrustAccessServiceToken(ctx, "example_zero_trust_access_service_token", &cloudflare.ZeroTrustAccessServiceTokenArgs{
    			Name:     pulumi.String("CI/CD token"),
    			ZoneId:   pulumi.String("zone_id"),
    			Duration: pulumi.String("60m"),
    		})
    		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 exampleZeroTrustAccessServiceToken = new Cloudflare.ZeroTrustAccessServiceToken("example_zero_trust_access_service_token", new()
        {
            Name = "CI/CD token",
            ZoneId = "zone_id",
            Duration = "60m",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.ZeroTrustAccessServiceToken;
    import com.pulumi.cloudflare.ZeroTrustAccessServiceTokenArgs;
    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) {
            var exampleZeroTrustAccessServiceToken = new ZeroTrustAccessServiceToken("exampleZeroTrustAccessServiceToken", ZeroTrustAccessServiceTokenArgs.builder()
                .name("CI/CD token")
                .zoneId("zone_id")
                .duration("60m")
                .build());
    
        }
    }
    
    resources:
      exampleZeroTrustAccessServiceToken:
        type: cloudflare:ZeroTrustAccessServiceToken
        name: example_zero_trust_access_service_token
        properties:
          name: CI/CD token
          zoneId: zone_id
          duration: 60m
    

    Create AccessServiceToken Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AccessServiceToken(name: string, args: AccessServiceTokenArgs, opts?: CustomResourceOptions);
    @overload
    def AccessServiceToken(resource_name: str,
                           args: AccessServiceTokenArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def AccessServiceToken(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           account_id: Optional[str] = None,
                           duration: Optional[str] = None,
                           name: Optional[str] = None,
                           zone_id: Optional[str] = None)
    func NewAccessServiceToken(ctx *Context, name string, args AccessServiceTokenArgs, opts ...ResourceOption) (*AccessServiceToken, error)
    public AccessServiceToken(string name, AccessServiceTokenArgs args, CustomResourceOptions? opts = null)
    public AccessServiceToken(String name, AccessServiceTokenArgs args)
    public AccessServiceToken(String name, AccessServiceTokenArgs args, CustomResourceOptions options)
    
    type: cloudflare:AccessServiceToken
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args AccessServiceTokenArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args AccessServiceTokenArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args AccessServiceTokenArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AccessServiceTokenArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AccessServiceTokenArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    AccessServiceToken Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The AccessServiceToken resource accepts the following input properties:

    Name string
    The name of the service token.
    AccountId string
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    Duration string
    The duration for how long the service token will be valid. Must be in the format 300ms or 2h45m. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h).
    ZoneId string
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    Name string
    The name of the service token.
    AccountId string
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    Duration string
    The duration for how long the service token will be valid. Must be in the format 300ms or 2h45m. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h).
    ZoneId string
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    name String
    The name of the service token.
    accountId String
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    duration String
    The duration for how long the service token will be valid. Must be in the format 300ms or 2h45m. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h).
    zoneId String
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    name string
    The name of the service token.
    accountId string
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    duration string
    The duration for how long the service token will be valid. Must be in the format 300ms or 2h45m. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h).
    zoneId string
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    name str
    The name of the service token.
    account_id str
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    duration str
    The duration for how long the service token will be valid. Must be in the format 300ms or 2h45m. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h).
    zone_id str
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    name String
    The name of the service token.
    accountId String
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    duration String
    The duration for how long the service token will be valid. Must be in the format 300ms or 2h45m. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h).
    zoneId String
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AccessServiceToken resource produces the following output properties:

    ClientId string
    The Client ID for the service token. Access will check for this value in the CF-Access-Client-ID request header.
    ClientSecret string
    The Client Secret for the service token. Access will check for this value in the CF-Access-Client-Secret request header.
    CreatedAt string
    ExpiresAt string
    Id string
    The provider-assigned unique ID for this managed resource.
    LastSeenAt string
    UpdatedAt string
    ClientId string
    The Client ID for the service token. Access will check for this value in the CF-Access-Client-ID request header.
    ClientSecret string
    The Client Secret for the service token. Access will check for this value in the CF-Access-Client-Secret request header.
    CreatedAt string
    ExpiresAt string
    Id string
    The provider-assigned unique ID for this managed resource.
    LastSeenAt string
    UpdatedAt string
    clientId String
    The Client ID for the service token. Access will check for this value in the CF-Access-Client-ID request header.
    clientSecret String
    The Client Secret for the service token. Access will check for this value in the CF-Access-Client-Secret request header.
    createdAt String
    expiresAt String
    id String
    The provider-assigned unique ID for this managed resource.
    lastSeenAt String
    updatedAt String
    clientId string
    The Client ID for the service token. Access will check for this value in the CF-Access-Client-ID request header.
    clientSecret string
    The Client Secret for the service token. Access will check for this value in the CF-Access-Client-Secret request header.
    createdAt string
    expiresAt string
    id string
    The provider-assigned unique ID for this managed resource.
    lastSeenAt string
    updatedAt string
    client_id str
    The Client ID for the service token. Access will check for this value in the CF-Access-Client-ID request header.
    client_secret str
    The Client Secret for the service token. Access will check for this value in the CF-Access-Client-Secret request header.
    created_at str
    expires_at str
    id str
    The provider-assigned unique ID for this managed resource.
    last_seen_at str
    updated_at str
    clientId String
    The Client ID for the service token. Access will check for this value in the CF-Access-Client-ID request header.
    clientSecret String
    The Client Secret for the service token. Access will check for this value in the CF-Access-Client-Secret request header.
    createdAt String
    expiresAt String
    id String
    The provider-assigned unique ID for this managed resource.
    lastSeenAt String
    updatedAt String

    Look up Existing AccessServiceToken Resource

    Get an existing AccessServiceToken resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: AccessServiceTokenState, opts?: CustomResourceOptions): AccessServiceToken
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            client_id: Optional[str] = None,
            client_secret: Optional[str] = None,
            created_at: Optional[str] = None,
            duration: Optional[str] = None,
            expires_at: Optional[str] = None,
            last_seen_at: Optional[str] = None,
            name: Optional[str] = None,
            updated_at: Optional[str] = None,
            zone_id: Optional[str] = None) -> AccessServiceToken
    func GetAccessServiceToken(ctx *Context, name string, id IDInput, state *AccessServiceTokenState, opts ...ResourceOption) (*AccessServiceToken, error)
    public static AccessServiceToken Get(string name, Input<string> id, AccessServiceTokenState? state, CustomResourceOptions? opts = null)
    public static AccessServiceToken get(String name, Output<String> id, AccessServiceTokenState state, CustomResourceOptions options)
    resources:  _:    type: cloudflare:AccessServiceToken    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AccountId string
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    ClientId string
    The Client ID for the service token. Access will check for this value in the CF-Access-Client-ID request header.
    ClientSecret string
    The Client Secret for the service token. Access will check for this value in the CF-Access-Client-Secret request header.
    CreatedAt string
    Duration string
    The duration for how long the service token will be valid. Must be in the format 300ms or 2h45m. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h).
    ExpiresAt string
    LastSeenAt string
    Name string
    The name of the service token.
    UpdatedAt string
    ZoneId string
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    AccountId string
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    ClientId string
    The Client ID for the service token. Access will check for this value in the CF-Access-Client-ID request header.
    ClientSecret string
    The Client Secret for the service token. Access will check for this value in the CF-Access-Client-Secret request header.
    CreatedAt string
    Duration string
    The duration for how long the service token will be valid. Must be in the format 300ms or 2h45m. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h).
    ExpiresAt string
    LastSeenAt string
    Name string
    The name of the service token.
    UpdatedAt string
    ZoneId string
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    accountId String
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    clientId String
    The Client ID for the service token. Access will check for this value in the CF-Access-Client-ID request header.
    clientSecret String
    The Client Secret for the service token. Access will check for this value in the CF-Access-Client-Secret request header.
    createdAt String
    duration String
    The duration for how long the service token will be valid. Must be in the format 300ms or 2h45m. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h).
    expiresAt String
    lastSeenAt String
    name String
    The name of the service token.
    updatedAt String
    zoneId String
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    accountId string
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    clientId string
    The Client ID for the service token. Access will check for this value in the CF-Access-Client-ID request header.
    clientSecret string
    The Client Secret for the service token. Access will check for this value in the CF-Access-Client-Secret request header.
    createdAt string
    duration string
    The duration for how long the service token will be valid. Must be in the format 300ms or 2h45m. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h).
    expiresAt string
    lastSeenAt string
    name string
    The name of the service token.
    updatedAt string
    zoneId string
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    account_id str
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    client_id str
    The Client ID for the service token. Access will check for this value in the CF-Access-Client-ID request header.
    client_secret str
    The Client Secret for the service token. Access will check for this value in the CF-Access-Client-Secret request header.
    created_at str
    duration str
    The duration for how long the service token will be valid. Must be in the format 300ms or 2h45m. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h).
    expires_at str
    last_seen_at str
    name str
    The name of the service token.
    updated_at str
    zone_id str
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    accountId String
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    clientId String
    The Client ID for the service token. Access will check for this value in the CF-Access-Client-ID request header.
    clientSecret String
    The Client Secret for the service token. Access will check for this value in the CF-Access-Client-Secret request header.
    createdAt String
    duration String
    The duration for how long the service token will be valid. Must be in the format 300ms or 2h45m. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h).
    expiresAt String
    lastSeenAt String
    name String
    The name of the service token.
    updatedAt String
    zoneId String
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.

    Import

    $ pulumi import cloudflare:index/accessServiceToken:AccessServiceToken example '<{accounts|zones}/{account_id|zone_id}>/<service_token_id>'
    

    To learn more about importing existing cloud resources, see Importing resources.

    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