1. Packages
  2. ArgoCD
  3. API Docs
  4. AccountToken
Argo CD v1.0.1 published on Friday, Feb 21, 2025 by Three141

argocd.AccountToken

Explore with Pulumi AI

Manages ArgoCD account JWT tokens.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as argocd from "@three14/pulumi-argocd";

// Token for account configured on the `provider`
const _this = new argocd.AccountToken("this", {renewAfter: "168h"});
// Token for ac count `foo`
const foo = new argocd.AccountToken("foo", {
    account: "foo",
    expiresIn: "168h",
    renewBefore: "84h",
});
Copy
import pulumi
import pulumi_argocd as argocd

# Token for account configured on the `provider`
this = argocd.AccountToken("this", renew_after="168h")
# Token for ac count `foo`
foo = argocd.AccountToken("foo",
    account="foo",
    expires_in="168h",
    renew_before="84h")
Copy
package main

import (
	"github.com/Three141/pulumi-argocd/sdk/go/argocd"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Token for account configured on the `provider`
		_, err := argocd.NewAccountToken(ctx, "this", &argocd.AccountTokenArgs{
			RenewAfter: pulumi.String("168h"),
		})
		if err != nil {
			return err
		}
		// Token for ac count `foo`
		_, err = argocd.NewAccountToken(ctx, "foo", &argocd.AccountTokenArgs{
			Account:     pulumi.String("foo"),
			ExpiresIn:   pulumi.String("168h"),
			RenewBefore: pulumi.String("84h"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Argocd = Three14.Argocd;

return await Deployment.RunAsync(() => 
{
    // Token for account configured on the `provider`
    var @this = new Argocd.AccountToken("this", new()
    {
        RenewAfter = "168h",
    });

    // Token for ac count `foo`
    var foo = new Argocd.AccountToken("foo", new()
    {
        Account = "foo",
        ExpiresIn = "168h",
        RenewBefore = "84h",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.argocd.AccountToken;
import com.pulumi.argocd.AccountTokenArgs;
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) {
        // Token for account configured on the `provider`
        var this_ = new AccountToken("this", AccountTokenArgs.builder()
            .renewAfter("168h")
            .build());

        // Token for ac count `foo`
        var foo = new AccountToken("foo", AccountTokenArgs.builder()
            .account("foo")
            .expiresIn("168h")
            .renewBefore("84h")
            .build());

    }
}
Copy
resources:
  # Token for account configured on the `provider`
  this:
    type: argocd:AccountToken
    properties:
      renewAfter: 168h
  # Token for ac count `foo`
  foo:
    type: argocd:AccountToken
    properties:
      account: foo
      expiresIn: 168h
      renewBefore: 84h
Copy

Create AccountToken Resource

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

Constructor syntax

new AccountToken(name: string, args?: AccountTokenArgs, opts?: CustomResourceOptions);
@overload
def AccountToken(resource_name: str,
                 args: Optional[AccountTokenArgs] = None,
                 opts: Optional[ResourceOptions] = None)

@overload
def AccountToken(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 account: Optional[str] = None,
                 expires_in: Optional[str] = None,
                 renew_after: Optional[str] = None,
                 renew_before: Optional[str] = None)
func NewAccountToken(ctx *Context, name string, args *AccountTokenArgs, opts ...ResourceOption) (*AccountToken, error)
public AccountToken(string name, AccountTokenArgs? args = null, CustomResourceOptions? opts = null)
public AccountToken(String name, AccountTokenArgs args)
public AccountToken(String name, AccountTokenArgs args, CustomResourceOptions options)
type: argocd:AccountToken
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

Constructor example

The following reference example uses placeholder values for all input properties.

var accountTokenResource = new Argocd.AccountToken("accountTokenResource", new()
{
    Account = "string",
    ExpiresIn = "string",
    RenewAfter = "string",
    RenewBefore = "string",
});
Copy
example, err := argocd.NewAccountToken(ctx, "accountTokenResource", &argocd.AccountTokenArgs{
	Account:     pulumi.String("string"),
	ExpiresIn:   pulumi.String("string"),
	RenewAfter:  pulumi.String("string"),
	RenewBefore: pulumi.String("string"),
})
Copy
var accountTokenResource = new AccountToken("accountTokenResource", AccountTokenArgs.builder()
    .account("string")
    .expiresIn("string")
    .renewAfter("string")
    .renewBefore("string")
    .build());
Copy
account_token_resource = argocd.AccountToken("accountTokenResource",
    account="string",
    expires_in="string",
    renew_after="string",
    renew_before="string")
Copy
const accountTokenResource = new argocd.AccountToken("accountTokenResource", {
    account: "string",
    expiresIn: "string",
    renewAfter: "string",
    renewBefore: "string",
});
Copy
type: argocd:AccountToken
properties:
    account: string
    expiresIn: string
    renewAfter: string
    renewBefore: string
Copy

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

Account Changes to this property will trigger replacement. string
Account name. Defaults to the current account. I.e. the account configured on the provider block.
ExpiresIn Changes to this property will trigger replacement. string
Duration before the token will expire. Valid time units are ns, us (or µs), ms, s, m, h. E.g. 12h, 7d. Default: No expiration.
RenewAfter string
Duration to control token silent regeneration based on token age. Valid time units are ns, us (or µs), ms, s, m, h. If set, then the token will be regenerated if it is older than renew_after. I.e. if currentDate - issued_at > renew_after.
RenewBefore string
Duration to control token silent regeneration based on remaining token lifetime. If expires_in is set, Pulumi will regenerate the token if expires_at - currentDate < renew_before. Valid time units are ns, us (or µs), ms, s, m, h.
Account Changes to this property will trigger replacement. string
Account name. Defaults to the current account. I.e. the account configured on the provider block.
ExpiresIn Changes to this property will trigger replacement. string
Duration before the token will expire. Valid time units are ns, us (or µs), ms, s, m, h. E.g. 12h, 7d. Default: No expiration.
RenewAfter string
Duration to control token silent regeneration based on token age. Valid time units are ns, us (or µs), ms, s, m, h. If set, then the token will be regenerated if it is older than renew_after. I.e. if currentDate - issued_at > renew_after.
RenewBefore string
Duration to control token silent regeneration based on remaining token lifetime. If expires_in is set, Pulumi will regenerate the token if expires_at - currentDate < renew_before. Valid time units are ns, us (or µs), ms, s, m, h.
account Changes to this property will trigger replacement. String
Account name. Defaults to the current account. I.e. the account configured on the provider block.
expiresIn Changes to this property will trigger replacement. String
Duration before the token will expire. Valid time units are ns, us (or µs), ms, s, m, h. E.g. 12h, 7d. Default: No expiration.
renewAfter String
Duration to control token silent regeneration based on token age. Valid time units are ns, us (or µs), ms, s, m, h. If set, then the token will be regenerated if it is older than renew_after. I.e. if currentDate - issued_at > renew_after.
renewBefore String
Duration to control token silent regeneration based on remaining token lifetime. If expires_in is set, Pulumi will regenerate the token if expires_at - currentDate < renew_before. Valid time units are ns, us (or µs), ms, s, m, h.
account Changes to this property will trigger replacement. string
Account name. Defaults to the current account. I.e. the account configured on the provider block.
expiresIn Changes to this property will trigger replacement. string
Duration before the token will expire. Valid time units are ns, us (or µs), ms, s, m, h. E.g. 12h, 7d. Default: No expiration.
renewAfter string
Duration to control token silent regeneration based on token age. Valid time units are ns, us (or µs), ms, s, m, h. If set, then the token will be regenerated if it is older than renew_after. I.e. if currentDate - issued_at > renew_after.
renewBefore string
Duration to control token silent regeneration based on remaining token lifetime. If expires_in is set, Pulumi will regenerate the token if expires_at - currentDate < renew_before. Valid time units are ns, us (or µs), ms, s, m, h.
account Changes to this property will trigger replacement. str
Account name. Defaults to the current account. I.e. the account configured on the provider block.
expires_in Changes to this property will trigger replacement. str
Duration before the token will expire. Valid time units are ns, us (or µs), ms, s, m, h. E.g. 12h, 7d. Default: No expiration.
renew_after str
Duration to control token silent regeneration based on token age. Valid time units are ns, us (or µs), ms, s, m, h. If set, then the token will be regenerated if it is older than renew_after. I.e. if currentDate - issued_at > renew_after.
renew_before str
Duration to control token silent regeneration based on remaining token lifetime. If expires_in is set, Pulumi will regenerate the token if expires_at - currentDate < renew_before. Valid time units are ns, us (or µs), ms, s, m, h.
account Changes to this property will trigger replacement. String
Account name. Defaults to the current account. I.e. the account configured on the provider block.
expiresIn Changes to this property will trigger replacement. String
Duration before the token will expire. Valid time units are ns, us (or µs), ms, s, m, h. E.g. 12h, 7d. Default: No expiration.
renewAfter String
Duration to control token silent regeneration based on token age. Valid time units are ns, us (or µs), ms, s, m, h. If set, then the token will be regenerated if it is older than renew_after. I.e. if currentDate - issued_at > renew_after.
renewBefore String
Duration to control token silent regeneration based on remaining token lifetime. If expires_in is set, Pulumi will regenerate the token if expires_at - currentDate < renew_before. Valid time units are ns, us (or µs), ms, s, m, h.

Outputs

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

ExpiresAt string
If expires_in is set, Unix timestamp upon which the token will expire.
Id string
The provider-assigned unique ID for this managed resource.
IssuedAt string
Unix timestamp at which the token was issued.
Jwt string
The raw JWT.
ExpiresAt string
If expires_in is set, Unix timestamp upon which the token will expire.
Id string
The provider-assigned unique ID for this managed resource.
IssuedAt string
Unix timestamp at which the token was issued.
Jwt string
The raw JWT.
expiresAt String
If expires_in is set, Unix timestamp upon which the token will expire.
id String
The provider-assigned unique ID for this managed resource.
issuedAt String
Unix timestamp at which the token was issued.
jwt String
The raw JWT.
expiresAt string
If expires_in is set, Unix timestamp upon which the token will expire.
id string
The provider-assigned unique ID for this managed resource.
issuedAt string
Unix timestamp at which the token was issued.
jwt string
The raw JWT.
expires_at str
If expires_in is set, Unix timestamp upon which the token will expire.
id str
The provider-assigned unique ID for this managed resource.
issued_at str
Unix timestamp at which the token was issued.
jwt str
The raw JWT.
expiresAt String
If expires_in is set, Unix timestamp upon which the token will expire.
id String
The provider-assigned unique ID for this managed resource.
issuedAt String
Unix timestamp at which the token was issued.
jwt String
The raw JWT.

Look up Existing AccountToken Resource

Get an existing AccountToken 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?: AccountTokenState, opts?: CustomResourceOptions): AccountToken
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account: Optional[str] = None,
        expires_at: Optional[str] = None,
        expires_in: Optional[str] = None,
        issued_at: Optional[str] = None,
        jwt: Optional[str] = None,
        renew_after: Optional[str] = None,
        renew_before: Optional[str] = None) -> AccountToken
func GetAccountToken(ctx *Context, name string, id IDInput, state *AccountTokenState, opts ...ResourceOption) (*AccountToken, error)
public static AccountToken Get(string name, Input<string> id, AccountTokenState? state, CustomResourceOptions? opts = null)
public static AccountToken get(String name, Output<String> id, AccountTokenState state, CustomResourceOptions options)
resources:  _:    type: argocd:AccountToken    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Account Changes to this property will trigger replacement. string
Account name. Defaults to the current account. I.e. the account configured on the provider block.
ExpiresAt Changes to this property will trigger replacement. string
If expires_in is set, Unix timestamp upon which the token will expire.
ExpiresIn Changes to this property will trigger replacement. string
Duration before the token will expire. Valid time units are ns, us (or µs), ms, s, m, h. E.g. 12h, 7d. Default: No expiration.
IssuedAt Changes to this property will trigger replacement. string
Unix timestamp at which the token was issued.
Jwt string
The raw JWT.
RenewAfter string
Duration to control token silent regeneration based on token age. Valid time units are ns, us (or µs), ms, s, m, h. If set, then the token will be regenerated if it is older than renew_after. I.e. if currentDate - issued_at > renew_after.
RenewBefore string
Duration to control token silent regeneration based on remaining token lifetime. If expires_in is set, Pulumi will regenerate the token if expires_at - currentDate < renew_before. Valid time units are ns, us (or µs), ms, s, m, h.
Account Changes to this property will trigger replacement. string
Account name. Defaults to the current account. I.e. the account configured on the provider block.
ExpiresAt Changes to this property will trigger replacement. string
If expires_in is set, Unix timestamp upon which the token will expire.
ExpiresIn Changes to this property will trigger replacement. string
Duration before the token will expire. Valid time units are ns, us (or µs), ms, s, m, h. E.g. 12h, 7d. Default: No expiration.
IssuedAt Changes to this property will trigger replacement. string
Unix timestamp at which the token was issued.
Jwt string
The raw JWT.
RenewAfter string
Duration to control token silent regeneration based on token age. Valid time units are ns, us (or µs), ms, s, m, h. If set, then the token will be regenerated if it is older than renew_after. I.e. if currentDate - issued_at > renew_after.
RenewBefore string
Duration to control token silent regeneration based on remaining token lifetime. If expires_in is set, Pulumi will regenerate the token if expires_at - currentDate < renew_before. Valid time units are ns, us (or µs), ms, s, m, h.
account Changes to this property will trigger replacement. String
Account name. Defaults to the current account. I.e. the account configured on the provider block.
expiresAt Changes to this property will trigger replacement. String
If expires_in is set, Unix timestamp upon which the token will expire.
expiresIn Changes to this property will trigger replacement. String
Duration before the token will expire. Valid time units are ns, us (or µs), ms, s, m, h. E.g. 12h, 7d. Default: No expiration.
issuedAt Changes to this property will trigger replacement. String
Unix timestamp at which the token was issued.
jwt String
The raw JWT.
renewAfter String
Duration to control token silent regeneration based on token age. Valid time units are ns, us (or µs), ms, s, m, h. If set, then the token will be regenerated if it is older than renew_after. I.e. if currentDate - issued_at > renew_after.
renewBefore String
Duration to control token silent regeneration based on remaining token lifetime. If expires_in is set, Pulumi will regenerate the token if expires_at - currentDate < renew_before. Valid time units are ns, us (or µs), ms, s, m, h.
account Changes to this property will trigger replacement. string
Account name. Defaults to the current account. I.e. the account configured on the provider block.
expiresAt Changes to this property will trigger replacement. string
If expires_in is set, Unix timestamp upon which the token will expire.
expiresIn Changes to this property will trigger replacement. string
Duration before the token will expire. Valid time units are ns, us (or µs), ms, s, m, h. E.g. 12h, 7d. Default: No expiration.
issuedAt Changes to this property will trigger replacement. string
Unix timestamp at which the token was issued.
jwt string
The raw JWT.
renewAfter string
Duration to control token silent regeneration based on token age. Valid time units are ns, us (or µs), ms, s, m, h. If set, then the token will be regenerated if it is older than renew_after. I.e. if currentDate - issued_at > renew_after.
renewBefore string
Duration to control token silent regeneration based on remaining token lifetime. If expires_in is set, Pulumi will regenerate the token if expires_at - currentDate < renew_before. Valid time units are ns, us (or µs), ms, s, m, h.
account Changes to this property will trigger replacement. str
Account name. Defaults to the current account. I.e. the account configured on the provider block.
expires_at Changes to this property will trigger replacement. str
If expires_in is set, Unix timestamp upon which the token will expire.
expires_in Changes to this property will trigger replacement. str
Duration before the token will expire. Valid time units are ns, us (or µs), ms, s, m, h. E.g. 12h, 7d. Default: No expiration.
issued_at Changes to this property will trigger replacement. str
Unix timestamp at which the token was issued.
jwt str
The raw JWT.
renew_after str
Duration to control token silent regeneration based on token age. Valid time units are ns, us (or µs), ms, s, m, h. If set, then the token will be regenerated if it is older than renew_after. I.e. if currentDate - issued_at > renew_after.
renew_before str
Duration to control token silent regeneration based on remaining token lifetime. If expires_in is set, Pulumi will regenerate the token if expires_at - currentDate < renew_before. Valid time units are ns, us (or µs), ms, s, m, h.
account Changes to this property will trigger replacement. String
Account name. Defaults to the current account. I.e. the account configured on the provider block.
expiresAt Changes to this property will trigger replacement. String
If expires_in is set, Unix timestamp upon which the token will expire.
expiresIn Changes to this property will trigger replacement. String
Duration before the token will expire. Valid time units are ns, us (or µs), ms, s, m, h. E.g. 12h, 7d. Default: No expiration.
issuedAt Changes to this property will trigger replacement. String
Unix timestamp at which the token was issued.
jwt String
The raw JWT.
renewAfter String
Duration to control token silent regeneration based on token age. Valid time units are ns, us (or µs), ms, s, m, h. If set, then the token will be regenerated if it is older than renew_after. I.e. if currentDate - issued_at > renew_after.
renewBefore String
Duration to control token silent regeneration based on remaining token lifetime. If expires_in is set, Pulumi will regenerate the token if expires_at - currentDate < renew_before. Valid time units are ns, us (or µs), ms, s, m, h.

Package Details

Repository
argocd Three141/pulumi-argocd
License
Apache-2.0
Notes
This Pulumi package is based on the argocd Terraform Provider.