argocd.ProjectToken
Explore with Pulumi AI
Manages ArgoCD project role JWT tokens. See Project Roles for more info.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as argocd from "@three14/pulumi-argocd";
const secret = new argocd.ProjectToken("secret", {
    project: "someproject",
    role: "foobar",
    description: "short lived token",
    expiresIn: "1h",
    renewBefore: "30m",
});
import pulumi
import pulumi_argocd as argocd
secret = argocd.ProjectToken("secret",
    project="someproject",
    role="foobar",
    description="short lived token",
    expires_in="1h",
    renew_before="30m")
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 {
		_, err := argocd.NewProjectToken(ctx, "secret", &argocd.ProjectTokenArgs{
			Project:     pulumi.String("someproject"),
			Role:        pulumi.String("foobar"),
			Description: pulumi.String("short lived token"),
			ExpiresIn:   pulumi.String("1h"),
			RenewBefore: pulumi.String("30m"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Argocd = Three14.Argocd;
return await Deployment.RunAsync(() => 
{
    var secret = new Argocd.ProjectToken("secret", new()
    {
        Project = "someproject",
        Role = "foobar",
        Description = "short lived token",
        ExpiresIn = "1h",
        RenewBefore = "30m",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.argocd.ProjectToken;
import com.pulumi.argocd.ProjectTokenArgs;
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 secret = new ProjectToken("secret", ProjectTokenArgs.builder()
            .project("someproject")
            .role("foobar")
            .description("short lived token")
            .expiresIn("1h")
            .renewBefore("30m")
            .build());
    }
}
resources:
  secret:
    type: argocd:ProjectToken
    properties:
      project: someproject
      role: foobar
      description: short lived token
      expiresIn: 1h
      renewBefore: 30m
Create ProjectToken Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProjectToken(name: string, args: ProjectTokenArgs, opts?: CustomResourceOptions);@overload
def ProjectToken(resource_name: str,
                 args: ProjectTokenArgs,
                 opts: Optional[ResourceOptions] = None)
@overload
def ProjectToken(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 project: Optional[str] = None,
                 role: Optional[str] = None,
                 description: Optional[str] = None,
                 expires_in: Optional[str] = None,
                 renew_after: Optional[str] = None,
                 renew_before: Optional[str] = None)func NewProjectToken(ctx *Context, name string, args ProjectTokenArgs, opts ...ResourceOption) (*ProjectToken, error)public ProjectToken(string name, ProjectTokenArgs args, CustomResourceOptions? opts = null)
public ProjectToken(String name, ProjectTokenArgs args)
public ProjectToken(String name, ProjectTokenArgs args, CustomResourceOptions options)
type: argocd:ProjectToken
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 ProjectTokenArgs
- 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 ProjectTokenArgs
- 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 ProjectTokenArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectTokenArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProjectTokenArgs
- 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 projectTokenResource = new Argocd.ProjectToken("projectTokenResource", new()
{
    Project = "string",
    Role = "string",
    Description = "string",
    ExpiresIn = "string",
    RenewAfter = "string",
    RenewBefore = "string",
});
example, err := argocd.NewProjectToken(ctx, "projectTokenResource", &argocd.ProjectTokenArgs{
	Project:     pulumi.String("string"),
	Role:        pulumi.String("string"),
	Description: pulumi.String("string"),
	ExpiresIn:   pulumi.String("string"),
	RenewAfter:  pulumi.String("string"),
	RenewBefore: pulumi.String("string"),
})
var projectTokenResource = new ProjectToken("projectTokenResource", ProjectTokenArgs.builder()
    .project("string")
    .role("string")
    .description("string")
    .expiresIn("string")
    .renewAfter("string")
    .renewBefore("string")
    .build());
project_token_resource = argocd.ProjectToken("projectTokenResource",
    project="string",
    role="string",
    description="string",
    expires_in="string",
    renew_after="string",
    renew_before="string")
const projectTokenResource = new argocd.ProjectToken("projectTokenResource", {
    project: "string",
    role: "string",
    description: "string",
    expiresIn: "string",
    renewAfter: "string",
    renewBefore: "string",
});
type: argocd:ProjectToken
properties:
    description: string
    expiresIn: string
    project: string
    renewAfter: string
    renewBefore: string
    role: string
ProjectToken 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 ProjectToken resource accepts the following input properties:
- Project string
- The project associated with the token.
- Role string
- The name of the role in the project associated with the token.
- Description string
- Description of the token.
- ExpiresIn 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 thanrenew_after. I.e. ifcurrentDate - issued_at > renew_after.
- RenewBefore string
- Duration to control token silent regeneration based on remaining token lifetime. If expires_inis set, the provider will regenerate the token ifexpires_at - currentDate < renew_before. Valid time units arens,us(orµs),ms,s,m,h.
- Project string
- The project associated with the token.
- Role string
- The name of the role in the project associated with the token.
- Description string
- Description of the token.
- ExpiresIn 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 thanrenew_after. I.e. ifcurrentDate - issued_at > renew_after.
- RenewBefore string
- Duration to control token silent regeneration based on remaining token lifetime. If expires_inis set, the provider will regenerate the token ifexpires_at - currentDate < renew_before. Valid time units arens,us(orµs),ms,s,m,h.
- project String
- The project associated with the token.
- role String
- The name of the role in the project associated with the token.
- description String
- Description of the token.
- expiresIn 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 thanrenew_after. I.e. ifcurrentDate - issued_at > renew_after.
- renewBefore String
- Duration to control token silent regeneration based on remaining token lifetime. If expires_inis set, the provider will regenerate the token ifexpires_at - currentDate < renew_before. Valid time units arens,us(orµs),ms,s,m,h.
- project string
- The project associated with the token.
- role string
- The name of the role in the project associated with the token.
- description string
- Description of the token.
- expiresIn 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 thanrenew_after. I.e. ifcurrentDate - issued_at > renew_after.
- renewBefore string
- Duration to control token silent regeneration based on remaining token lifetime. If expires_inis set, the provider will regenerate the token ifexpires_at - currentDate < renew_before. Valid time units arens,us(orµs),ms,s,m,h.
- project str
- The project associated with the token.
- role str
- The name of the role in the project associated with the token.
- description str
- Description of the token.
- expires_in 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 thanrenew_after. I.e. ifcurrentDate - issued_at > renew_after.
- renew_before str
- Duration to control token silent regeneration based on remaining token lifetime. If expires_inis set, the provider will regenerate the token ifexpires_at - currentDate < renew_before. Valid time units arens,us(orµs),ms,s,m,h.
- project String
- The project associated with the token.
- role String
- The name of the role in the project associated with the token.
- description String
- Description of the token.
- expiresIn 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 thanrenew_after. I.e. ifcurrentDate - issued_at > renew_after.
- renewBefore String
- Duration to control token silent regeneration based on remaining token lifetime. If expires_inis set, the provider will regenerate the token ifexpires_at - currentDate < renew_before. Valid time units arens,us(orµs),ms,s,m,h.
Outputs
All input properties are implicitly available as output properties. Additionally, the ProjectToken resource produces the following output properties:
- expires_at str
- If expires_inis 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.
Look up Existing ProjectToken Resource
Get an existing ProjectToken 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?: ProjectTokenState, opts?: CustomResourceOptions): ProjectToken@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        expires_at: Optional[str] = None,
        expires_in: Optional[str] = None,
        issued_at: Optional[str] = None,
        jwt: Optional[str] = None,
        project: Optional[str] = None,
        renew_after: Optional[str] = None,
        renew_before: Optional[str] = None,
        role: Optional[str] = None) -> ProjectTokenfunc GetProjectToken(ctx *Context, name string, id IDInput, state *ProjectTokenState, opts ...ResourceOption) (*ProjectToken, error)public static ProjectToken Get(string name, Input<string> id, ProjectTokenState? state, CustomResourceOptions? opts = null)public static ProjectToken get(String name, Output<String> id, ProjectTokenState state, CustomResourceOptions options)resources:  _:    type: argocd:ProjectToken    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.
- Description string
- Description of the token.
- ExpiresAt string
- If expires_inis set, Unix timestamp upon which the token will expire.
- ExpiresIn 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 string
- Unix timestamp at which the token was issued.
- Jwt string
- The raw JWT.
- Project string
- The project associated with the token.
- 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 thanrenew_after. I.e. ifcurrentDate - issued_at > renew_after.
- RenewBefore string
- Duration to control token silent regeneration based on remaining token lifetime. If expires_inis set, the provider will regenerate the token ifexpires_at - currentDate < renew_before. Valid time units arens,us(orµs),ms,s,m,h.
- Role string
- The name of the role in the project associated with the token.
- Description string
- Description of the token.
- ExpiresAt string
- If expires_inis set, Unix timestamp upon which the token will expire.
- ExpiresIn 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 string
- Unix timestamp at which the token was issued.
- Jwt string
- The raw JWT.
- Project string
- The project associated with the token.
- 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 thanrenew_after. I.e. ifcurrentDate - issued_at > renew_after.
- RenewBefore string
- Duration to control token silent regeneration based on remaining token lifetime. If expires_inis set, the provider will regenerate the token ifexpires_at - currentDate < renew_before. Valid time units arens,us(orµs),ms,s,m,h.
- Role string
- The name of the role in the project associated with the token.
- description String
- Description of the token.
- expiresAt String
- If expires_inis set, Unix timestamp upon which the token will expire.
- expiresIn 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 String
- Unix timestamp at which the token was issued.
- jwt String
- The raw JWT.
- project String
- The project associated with the token.
- 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 thanrenew_after. I.e. ifcurrentDate - issued_at > renew_after.
- renewBefore String
- Duration to control token silent regeneration based on remaining token lifetime. If expires_inis set, the provider will regenerate the token ifexpires_at - currentDate < renew_before. Valid time units arens,us(orµs),ms,s,m,h.
- role String
- The name of the role in the project associated with the token.
- description string
- Description of the token.
- expiresAt string
- If expires_inis set, Unix timestamp upon which the token will expire.
- expiresIn 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 string
- Unix timestamp at which the token was issued.
- jwt string
- The raw JWT.
- project string
- The project associated with the token.
- 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 thanrenew_after. I.e. ifcurrentDate - issued_at > renew_after.
- renewBefore string
- Duration to control token silent regeneration based on remaining token lifetime. If expires_inis set, the provider will regenerate the token ifexpires_at - currentDate < renew_before. Valid time units arens,us(orµs),ms,s,m,h.
- role string
- The name of the role in the project associated with the token.
- description str
- Description of the token.
- expires_at str
- If expires_inis set, Unix timestamp upon which the token will expire.
- expires_in 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 str
- Unix timestamp at which the token was issued.
- jwt str
- The raw JWT.
- project str
- The project associated with the token.
- 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 thanrenew_after. I.e. ifcurrentDate - issued_at > renew_after.
- renew_before str
- Duration to control token silent regeneration based on remaining token lifetime. If expires_inis set, the provider will regenerate the token ifexpires_at - currentDate < renew_before. Valid time units arens,us(orµs),ms,s,m,h.
- role str
- The name of the role in the project associated with the token.
- description String
- Description of the token.
- expiresAt String
- If expires_inis set, Unix timestamp upon which the token will expire.
- expiresIn 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 String
- Unix timestamp at which the token was issued.
- jwt String
- The raw JWT.
- project String
- The project associated with the token.
- 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 thanrenew_after. I.e. ifcurrentDate - issued_at > renew_after.
- renewBefore String
- Duration to control token silent regeneration based on remaining token lifetime. If expires_inis set, the provider will regenerate the token ifexpires_at - currentDate < renew_before. Valid time units arens,us(orµs),ms,s,m,h.
- role String
- The name of the role in the project associated with the token.
Package Details
- Repository
- argocd Three141/pulumi-argocd
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the argocdTerraform Provider.
