Cloudflare

Pulumi Official
Package maintained by Pulumi
v4.9.0 published on Monday, Jul 18, 2022 by Pulumi

AccessServiceToken

Access Service Tokens are used for service-to-service communication when an application is behind Cloudflare Access.

Example Usage

using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

class MyStack : Stack
{
    public MyStack()
    {
        // Generate a service token that will renew if terraform is ran within 30 days of expiration
        var myApp = new Cloudflare.AccessServiceToken("myApp", new Cloudflare.AccessServiceTokenArgs
        {
            AccountId = "d41d8cd98f00b204e9800998ecf8427e",
            MinDaysForRenewal = 30,
            Name = "CI/CD app renewed",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-cloudflare/sdk/v4/go/cloudflare"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudflare.NewAccessServiceToken(ctx, "myApp", &cloudflare.AccessServiceTokenArgs{
			AccountId:         pulumi.String("d41d8cd98f00b204e9800998ecf8427e"),
			MinDaysForRenewal: pulumi.Int(30),
			Name:              pulumi.String("CI/CD app renewed"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var myApp = new AccessServiceToken("myApp", AccessServiceTokenArgs.builder()        
            .accountId("d41d8cd98f00b204e9800998ecf8427e")
            .minDaysForRenewal(30)
            .name("CI/CD app renewed")
            .build());

    }
}
import pulumi
import pulumi_cloudflare as cloudflare

# Generate a service token that will renew if terraform is ran within 30 days of expiration
my_app = cloudflare.AccessServiceToken("myApp",
    account_id="d41d8cd98f00b204e9800998ecf8427e",
    min_days_for_renewal=30,
    name="CI/CD app renewed")
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

// Generate a service token that will renew if terraform is ran within 30 days of expiration
const myApp = new cloudflare.AccessServiceToken("my_app", {
    accountId: "d41d8cd98f00b204e9800998ecf8427e",
    minDaysForRenewal: 30,
    name: "CI/CD app renewed",
});
resources:
  myApp:
    type: cloudflare:AccessServiceToken
    properties:
      accountId: d41d8cd98f00b204e9800998ecf8427e
      minDaysForRenewal: 30
      name: CI/CD app renewed

Create a AccessServiceToken Resource

new AccessServiceToken(name: string, args: AccessServiceTokenArgs, opts?: CustomResourceOptions);
@overload
def AccessServiceToken(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       account_id: Optional[str] = None,
                       min_days_for_renewal: Optional[int] = None,
                       name: Optional[str] = None,
                       zone_id: Optional[str] = None)
@overload
def AccessServiceToken(resource_name: str,
                       args: AccessServiceTokenArgs,
                       opts: Optional[ResourceOptions] = 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.

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

The AccessServiceToken resource accepts the following input properties:

Name string

Friendly name of the token's intent.

AccountId string

The account identifier to target for the resource.

MinDaysForRenewal int

Regenerates the token if terraform is run within the specified amount of days before expiration

ZoneId string

The zone identifier to target for the resource.

Name string

Friendly name of the token's intent.

AccountId string

The account identifier to target for the resource.

MinDaysForRenewal int

Regenerates the token if terraform is run within the specified amount of days before expiration

ZoneId string

The zone identifier to target for the resource.

name String

Friendly name of the token's intent.

accountId String

The account identifier to target for the resource.

minDaysForRenewal Integer

Regenerates the token if terraform is run within the specified amount of days before expiration

zoneId String

The zone identifier to target for the resource.

name string

Friendly name of the token's intent.

accountId string

The account identifier to target for the resource.

minDaysForRenewal number

Regenerates the token if terraform is run within the specified amount of days before expiration

zoneId string

The zone identifier to target for the resource.

name str

Friendly name of the token's intent.

account_id str

The account identifier to target for the resource.

min_days_for_renewal int

Regenerates the token if terraform is run within the specified amount of days before expiration

zone_id str

The zone identifier to target for the resource.

name String

Friendly name of the token's intent.

accountId String

The account identifier to target for the resource.

minDaysForRenewal Number

Regenerates the token if terraform is run within the specified amount of days before expiration

zoneId String

The zone identifier to target for the resource.

Outputs

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

ClientId string

UUID client ID associated with the Service Token.

ClientSecret string

A secret for interacting with Access protocols.

ExpiresAt string

Date when the token expires

Id string

The provider-assigned unique ID for this managed resource.

ClientId string

UUID client ID associated with the Service Token.

ClientSecret string

A secret for interacting with Access protocols.

ExpiresAt string

Date when the token expires

Id string

The provider-assigned unique ID for this managed resource.

clientId String

UUID client ID associated with the Service Token.

clientSecret String

A secret for interacting with Access protocols.

expiresAt String

Date when the token expires

id String

The provider-assigned unique ID for this managed resource.

clientId string

UUID client ID associated with the Service Token.

clientSecret string

A secret for interacting with Access protocols.

expiresAt string

Date when the token expires

id string

The provider-assigned unique ID for this managed resource.

client_id str

UUID client ID associated with the Service Token.

client_secret str

A secret for interacting with Access protocols.

expires_at str

Date when the token expires

id str

The provider-assigned unique ID for this managed resource.

clientId String

UUID client ID associated with the Service Token.

clientSecret String

A secret for interacting with Access protocols.

expiresAt String

Date when the token expires

id String

The provider-assigned unique ID for this managed resource.

Look up an 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,
        expires_at: Optional[str] = None,
        min_days_for_renewal: Optional[int] = None,
        name: 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)
Resource lookup is not supported in YAML
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 identifier to target for the resource.

ClientId string

UUID client ID associated with the Service Token.

ClientSecret string

A secret for interacting with Access protocols.

ExpiresAt string

Date when the token expires

MinDaysForRenewal int

Regenerates the token if terraform is run within the specified amount of days before expiration

Name string

Friendly name of the token's intent.

ZoneId string

The zone identifier to target for the resource.

AccountId string

The account identifier to target for the resource.

ClientId string

UUID client ID associated with the Service Token.

ClientSecret string

A secret for interacting with Access protocols.

ExpiresAt string

Date when the token expires

MinDaysForRenewal int

Regenerates the token if terraform is run within the specified amount of days before expiration

Name string

Friendly name of the token's intent.

ZoneId string

The zone identifier to target for the resource.

accountId String

The account identifier to target for the resource.

clientId String

UUID client ID associated with the Service Token.

clientSecret String

A secret for interacting with Access protocols.

expiresAt String

Date when the token expires

minDaysForRenewal Integer

Regenerates the token if terraform is run within the specified amount of days before expiration

name String

Friendly name of the token's intent.

zoneId String

The zone identifier to target for the resource.

accountId string

The account identifier to target for the resource.

clientId string

UUID client ID associated with the Service Token.

clientSecret string

A secret for interacting with Access protocols.

expiresAt string

Date when the token expires

minDaysForRenewal number

Regenerates the token if terraform is run within the specified amount of days before expiration

name string

Friendly name of the token's intent.

zoneId string

The zone identifier to target for the resource.

account_id str

The account identifier to target for the resource.

client_id str

UUID client ID associated with the Service Token.

client_secret str

A secret for interacting with Access protocols.

expires_at str

Date when the token expires

min_days_for_renewal int

Regenerates the token if terraform is run within the specified amount of days before expiration

name str

Friendly name of the token's intent.

zone_id str

The zone identifier to target for the resource.

accountId String

The account identifier to target for the resource.

clientId String

UUID client ID associated with the Service Token.

clientSecret String

A secret for interacting with Access protocols.

expiresAt String

Date when the token expires

minDaysForRenewal Number

Regenerates the token if terraform is run within the specified amount of days before expiration

name String

Friendly name of the token's intent.

zoneId String

The zone identifier to target for the resource.

Import

If you are importing an Access Service Token you will not have the # client_secret available in the state for use. The client_secret is only # available once, at creation. In most cases, it is better to just create a new # resource should you need to reference it in other resources.

 $ pulumi import cloudflare:index/accessServiceToken:AccessServiceToken example <account_id>/<service_token_id>

Package Details

Repository
https://github.com/pulumi/pulumi-cloudflare
License
Apache-2.0
Notes

This Pulumi package is based on the cloudflare Terraform Provider.