ApiToken

Provides a resource which manages Cloudflare API tokens.

Read more about permission groups and their applicable scopes in the developer documentation.

Create ApiToken Resource

new ApiToken(name: string, args: ApiTokenArgs, opts?: CustomResourceOptions);
@overload
def ApiToken(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             condition: Optional[ApiTokenConditionArgs] = None,
             expires_on: Optional[str] = None,
             name: Optional[str] = None,
             not_before: Optional[str] = None,
             policies: Optional[Sequence[ApiTokenPolicyArgs]] = None)
@overload
def ApiToken(resource_name: str,
             args: ApiTokenArgs,
             opts: Optional[ResourceOptions] = None)
func NewApiToken(ctx *Context, name string, args ApiTokenArgs, opts ...ResourceOption) (*ApiToken, error)
public ApiToken(string name, ApiTokenArgs args, CustomResourceOptions? opts = null)
public ApiToken(String name, ApiTokenArgs args)
public ApiToken(String name, ApiTokenArgs args, CustomResourceOptions options)
type: cloudflare:ApiToken
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ApiTokenArgs
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 ApiTokenArgs
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 ApiTokenArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ApiTokenArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ApiTokenArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ApiToken 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 ApiToken resource accepts the following input properties:

Name string

Name of the API Token.

Policies List<ApiTokenPolicyArgs>

Permissions policy. Multiple policy blocks can be defined.

Condition ApiTokenConditionArgs

Conditions under which the token should be considered valid.

ExpiresOn string

The expiration time on or after which the token MUST NOT be accepted for processing.

NotBefore string

The time before which the token MUST NOT be accepted for processing.

Name string

Name of the API Token.

Policies []ApiTokenPolicyArgs

Permissions policy. Multiple policy blocks can be defined.

Condition ApiTokenConditionArgs

Conditions under which the token should be considered valid.

ExpiresOn string

The expiration time on or after which the token MUST NOT be accepted for processing.

NotBefore string

The time before which the token MUST NOT be accepted for processing.

name String

Name of the API Token.

policies List<ApiTokenPolicyArgs>

Permissions policy. Multiple policy blocks can be defined.

condition ApiTokenConditionArgs

Conditions under which the token should be considered valid.

expiresOn String

The expiration time on or after which the token MUST NOT be accepted for processing.

notBefore String

The time before which the token MUST NOT be accepted for processing.

name string

Name of the API Token.

policies ApiTokenPolicyArgs[]

Permissions policy. Multiple policy blocks can be defined.

condition ApiTokenConditionArgs

Conditions under which the token should be considered valid.

expiresOn string

The expiration time on or after which the token MUST NOT be accepted for processing.

notBefore string

The time before which the token MUST NOT be accepted for processing.

name str

Name of the API Token.

policies Sequence[ApiTokenPolicyArgs]

Permissions policy. Multiple policy blocks can be defined.

condition ApiTokenConditionArgs

Conditions under which the token should be considered valid.

expires_on str

The expiration time on or after which the token MUST NOT be accepted for processing.

not_before str

The time before which the token MUST NOT be accepted for processing.

name String

Name of the API Token.

policies List<Property Map>

Permissions policy. Multiple policy blocks can be defined.

condition Property Map

Conditions under which the token should be considered valid.

expiresOn String

The expiration time on or after which the token MUST NOT be accepted for processing.

notBefore String

The time before which the token MUST NOT be accepted for processing.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

IssuedOn string

Timestamp of when the token was issued.

ModifiedOn string

Timestamp of when the token was last modified.

Status string
Value string

The value of the API Token.

Id string

The provider-assigned unique ID for this managed resource.

IssuedOn string

Timestamp of when the token was issued.

ModifiedOn string

Timestamp of when the token was last modified.

Status string
Value string

The value of the API Token.

id String

The provider-assigned unique ID for this managed resource.

issuedOn String

Timestamp of when the token was issued.

modifiedOn String

Timestamp of when the token was last modified.

status String
value String

The value of the API Token.

id string

The provider-assigned unique ID for this managed resource.

issuedOn string

Timestamp of when the token was issued.

modifiedOn string

Timestamp of when the token was last modified.

status string
value string

The value of the API Token.

id str

The provider-assigned unique ID for this managed resource.

issued_on str

Timestamp of when the token was issued.

modified_on str

Timestamp of when the token was last modified.

status str
value str

The value of the API Token.

id String

The provider-assigned unique ID for this managed resource.

issuedOn String

Timestamp of when the token was issued.

modifiedOn String

Timestamp of when the token was last modified.

status String
value String

The value of the API Token.

Look up Existing ApiToken Resource

Get an existing ApiToken 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?: ApiTokenState, opts?: CustomResourceOptions): ApiToken
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        condition: Optional[ApiTokenConditionArgs] = None,
        expires_on: Optional[str] = None,
        issued_on: Optional[str] = None,
        modified_on: Optional[str] = None,
        name: Optional[str] = None,
        not_before: Optional[str] = None,
        policies: Optional[Sequence[ApiTokenPolicyArgs]] = None,
        status: Optional[str] = None,
        value: Optional[str] = None) -> ApiToken
func GetApiToken(ctx *Context, name string, id IDInput, state *ApiTokenState, opts ...ResourceOption) (*ApiToken, error)
public static ApiToken Get(string name, Input<string> id, ApiTokenState? state, CustomResourceOptions? opts = null)
public static ApiToken get(String name, Output<String> id, ApiTokenState 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:
Condition ApiTokenConditionArgs

Conditions under which the token should be considered valid.

ExpiresOn string

The expiration time on or after which the token MUST NOT be accepted for processing.

IssuedOn string

Timestamp of when the token was issued.

ModifiedOn string

Timestamp of when the token was last modified.

Name string

Name of the API Token.

NotBefore string

The time before which the token MUST NOT be accepted for processing.

Policies List<ApiTokenPolicyArgs>

Permissions policy. Multiple policy blocks can be defined.

Status string
Value string

The value of the API Token.

Condition ApiTokenConditionArgs

Conditions under which the token should be considered valid.

ExpiresOn string

The expiration time on or after which the token MUST NOT be accepted for processing.

IssuedOn string

Timestamp of when the token was issued.

ModifiedOn string

Timestamp of when the token was last modified.

Name string

Name of the API Token.

NotBefore string

The time before which the token MUST NOT be accepted for processing.

Policies []ApiTokenPolicyArgs

Permissions policy. Multiple policy blocks can be defined.

Status string
Value string

The value of the API Token.

condition ApiTokenConditionArgs

Conditions under which the token should be considered valid.

expiresOn String

The expiration time on or after which the token MUST NOT be accepted for processing.

issuedOn String

Timestamp of when the token was issued.

modifiedOn String

Timestamp of when the token was last modified.

name String

Name of the API Token.

notBefore String

The time before which the token MUST NOT be accepted for processing.

policies List<ApiTokenPolicyArgs>

Permissions policy. Multiple policy blocks can be defined.

status String
value String

The value of the API Token.

condition ApiTokenConditionArgs

Conditions under which the token should be considered valid.

expiresOn string

The expiration time on or after which the token MUST NOT be accepted for processing.

issuedOn string

Timestamp of when the token was issued.

modifiedOn string

Timestamp of when the token was last modified.

name string

Name of the API Token.

notBefore string

The time before which the token MUST NOT be accepted for processing.

policies ApiTokenPolicyArgs[]

Permissions policy. Multiple policy blocks can be defined.

status string
value string

The value of the API Token.

condition ApiTokenConditionArgs

Conditions under which the token should be considered valid.

expires_on str

The expiration time on or after which the token MUST NOT be accepted for processing.

issued_on str

Timestamp of when the token was issued.

modified_on str

Timestamp of when the token was last modified.

name str

Name of the API Token.

not_before str

The time before which the token MUST NOT be accepted for processing.

policies Sequence[ApiTokenPolicyArgs]

Permissions policy. Multiple policy blocks can be defined.

status str
value str

The value of the API Token.

condition Property Map

Conditions under which the token should be considered valid.

expiresOn String

The expiration time on or after which the token MUST NOT be accepted for processing.

issuedOn String

Timestamp of when the token was issued.

modifiedOn String

Timestamp of when the token was last modified.

name String

Name of the API Token.

notBefore String

The time before which the token MUST NOT be accepted for processing.

policies List<Property Map>

Permissions policy. Multiple policy blocks can be defined.

status String
value String

The value of the API Token.

Supporting Types

ApiTokenCondition

RequestIp ApiTokenConditionRequestIp

Request IP related conditions.

RequestIp ApiTokenConditionRequestIp

Request IP related conditions.

requestIp ApiTokenConditionRequestIp

Request IP related conditions.

requestIp ApiTokenConditionRequestIp

Request IP related conditions.

request_ip ApiTokenConditionRequestIp

Request IP related conditions.

requestIp Property Map

Request IP related conditions.

ApiTokenConditionRequestIp

Ins List<string>
NotIns List<string>
Ins []string
NotIns []string
ins List<String>
notIns List<String>
ins string[]
notIns string[]
ins Sequence[str]
not_ins Sequence[str]
ins List<String>
notIns List<String>

ApiTokenPolicy

PermissionGroups List<string>

List of permissions groups IDs. See documentation for more information.

Resources Dictionary<string, string>

Describes what operations against which resources are allowed or denied.

Effect string

Effect of the policy. Available values: allow, deny. Defaults to allow.

PermissionGroups []string

List of permissions groups IDs. See documentation for more information.

Resources map[string]string

Describes what operations against which resources are allowed or denied.

Effect string

Effect of the policy. Available values: allow, deny. Defaults to allow.

permissionGroups List<String>

List of permissions groups IDs. See documentation for more information.

resources Map<String,String>

Describes what operations against which resources are allowed or denied.

effect String

Effect of the policy. Available values: allow, deny. Defaults to allow.

permissionGroups string[]

List of permissions groups IDs. See documentation for more information.

resources {[key: string]: string}

Describes what operations against which resources are allowed or denied.

effect string

Effect of the policy. Available values: allow, deny. Defaults to allow.

permission_groups Sequence[str]

List of permissions groups IDs. See documentation for more information.

resources Mapping[str, str]

Describes what operations against which resources are allowed or denied.

effect str

Effect of the policy. Available values: allow, deny. Defaults to allow.

permissionGroups List<String>

List of permissions groups IDs. See documentation for more information.

resources Map<String>

Describes what operations against which resources are allowed or denied.

effect String

Effect of the policy. Available values: allow, deny. Defaults to allow.

Package Details

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

This Pulumi package is based on the cloudflare Terraform Provider.