1. Packages
  2. Zitadel
  3. API Docs
  4. PersonalAccessToken
zitadel v0.1.8 published on Thursday, May 30, 2024 by pulumiverse

zitadel.PersonalAccessToken

Explore with Pulumi AI

zitadel logo
zitadel v0.1.8 published on Thursday, May 30, 2024 by pulumiverse

    Resource representing a personal access token of a user

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Zitadel = Pulumiverse.Zitadel;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new Zitadel.PersonalAccessToken("default", new()
        {
            OrgId = data.Zitadel_org.Default.Id,
            UserId = data.Zitadel_machine_user.Default.Id,
            ExpirationDate = "2519-04-01T08:45:00Z",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-zitadel/sdk/go/zitadel"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := zitadel.NewPersonalAccessToken(ctx, "default", &zitadel.PersonalAccessTokenArgs{
    			OrgId:          pulumi.Any(data.Zitadel_org.Default.Id),
    			UserId:         pulumi.Any(data.Zitadel_machine_user.Default.Id),
    			ExpirationDate: pulumi.String("2519-04-01T08:45:00Z"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.zitadel.PersonalAccessToken;
    import com.pulumi.zitadel.PersonalAccessTokenArgs;
    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 default_ = new PersonalAccessToken("default", PersonalAccessTokenArgs.builder()        
                .orgId(data.zitadel_org().default().id())
                .userId(data.zitadel_machine_user().default().id())
                .expirationDate("2519-04-01T08:45:00Z")
                .build());
    
        }
    }
    
    import pulumi
    import pulumiverse_zitadel as zitadel
    
    default = zitadel.PersonalAccessToken("default",
        org_id=data["zitadel_org"]["default"]["id"],
        user_id=data["zitadel_machine_user"]["default"]["id"],
        expiration_date="2519-04-01T08:45:00Z")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as zitadel from "@pulumiverse/zitadel";
    
    const _default = new zitadel.PersonalAccessToken("default", {
        orgId: data.zitadel_org["default"].id,
        userId: data.zitadel_machine_user["default"].id,
        expirationDate: "2519-04-01T08:45:00Z",
    });
    
    resources:
      default:
        type: zitadel:PersonalAccessToken
        properties:
          orgId: ${data.zitadel_org.default.id}
          userId: ${data.zitadel_machine_user.default.id}
          expirationDate: 2519-04-01T08:45:00Z
    

    Create PersonalAccessToken Resource

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

    Constructor syntax

    new PersonalAccessToken(name: string, args: PersonalAccessTokenArgs, opts?: CustomResourceOptions);
    @overload
    def PersonalAccessToken(resource_name: str,
                            args: PersonalAccessTokenArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def PersonalAccessToken(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            user_id: Optional[str] = None,
                            expiration_date: Optional[str] = None,
                            org_id: Optional[str] = None)
    func NewPersonalAccessToken(ctx *Context, name string, args PersonalAccessTokenArgs, opts ...ResourceOption) (*PersonalAccessToken, error)
    public PersonalAccessToken(string name, PersonalAccessTokenArgs args, CustomResourceOptions? opts = null)
    public PersonalAccessToken(String name, PersonalAccessTokenArgs args)
    public PersonalAccessToken(String name, PersonalAccessTokenArgs args, CustomResourceOptions options)
    
    type: zitadel:PersonalAccessToken
    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 PersonalAccessTokenArgs
    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 PersonalAccessTokenArgs
    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 PersonalAccessTokenArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PersonalAccessTokenArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PersonalAccessTokenArgs
    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 personalAccessTokenResource = new Zitadel.PersonalAccessToken("personalAccessTokenResource", new()
    {
        UserId = "string",
        ExpirationDate = "string",
        OrgId = "string",
    });
    
    example, err := zitadel.NewPersonalAccessToken(ctx, "personalAccessTokenResource", &zitadel.PersonalAccessTokenArgs{
    	UserId:         pulumi.String("string"),
    	ExpirationDate: pulumi.String("string"),
    	OrgId:          pulumi.String("string"),
    })
    
    var personalAccessTokenResource = new PersonalAccessToken("personalAccessTokenResource", PersonalAccessTokenArgs.builder()
        .userId("string")
        .expirationDate("string")
        .orgId("string")
        .build());
    
    personal_access_token_resource = zitadel.PersonalAccessToken("personalAccessTokenResource",
        user_id="string",
        expiration_date="string",
        org_id="string")
    
    const personalAccessTokenResource = new zitadel.PersonalAccessToken("personalAccessTokenResource", {
        userId: "string",
        expirationDate: "string",
        orgId: "string",
    });
    
    type: zitadel:PersonalAccessToken
    properties:
        expirationDate: string
        orgId: string
        userId: string
    

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

    UserId string
    ID of the user
    ExpirationDate string
    Expiration date of the token in the RFC3339 format
    OrgId string
    ID of the organization
    UserId string
    ID of the user
    ExpirationDate string
    Expiration date of the token in the RFC3339 format
    OrgId string
    ID of the organization
    userId String
    ID of the user
    expirationDate String
    Expiration date of the token in the RFC3339 format
    orgId String
    ID of the organization
    userId string
    ID of the user
    expirationDate string
    Expiration date of the token in the RFC3339 format
    orgId string
    ID of the organization
    user_id str
    ID of the user
    expiration_date str
    Expiration date of the token in the RFC3339 format
    org_id str
    ID of the organization
    userId String
    ID of the user
    expirationDate String
    Expiration date of the token in the RFC3339 format
    orgId String
    ID of the organization

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Token string
    Value of the token
    Id string
    The provider-assigned unique ID for this managed resource.
    Token string
    Value of the token
    id String
    The provider-assigned unique ID for this managed resource.
    token String
    Value of the token
    id string
    The provider-assigned unique ID for this managed resource.
    token string
    Value of the token
    id str
    The provider-assigned unique ID for this managed resource.
    token str
    Value of the token
    id String
    The provider-assigned unique ID for this managed resource.
    token String
    Value of the token

    Look up Existing PersonalAccessToken Resource

    Get an existing PersonalAccessToken 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?: PersonalAccessTokenState, opts?: CustomResourceOptions): PersonalAccessToken
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            expiration_date: Optional[str] = None,
            org_id: Optional[str] = None,
            token: Optional[str] = None,
            user_id: Optional[str] = None) -> PersonalAccessToken
    func GetPersonalAccessToken(ctx *Context, name string, id IDInput, state *PersonalAccessTokenState, opts ...ResourceOption) (*PersonalAccessToken, error)
    public static PersonalAccessToken Get(string name, Input<string> id, PersonalAccessTokenState? state, CustomResourceOptions? opts = null)
    public static PersonalAccessToken get(String name, Output<String> id, PersonalAccessTokenState 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:
    ExpirationDate string
    Expiration date of the token in the RFC3339 format
    OrgId string
    ID of the organization
    Token string
    Value of the token
    UserId string
    ID of the user
    ExpirationDate string
    Expiration date of the token in the RFC3339 format
    OrgId string
    ID of the organization
    Token string
    Value of the token
    UserId string
    ID of the user
    expirationDate String
    Expiration date of the token in the RFC3339 format
    orgId String
    ID of the organization
    token String
    Value of the token
    userId String
    ID of the user
    expirationDate string
    Expiration date of the token in the RFC3339 format
    orgId string
    ID of the organization
    token string
    Value of the token
    userId string
    ID of the user
    expiration_date str
    Expiration date of the token in the RFC3339 format
    org_id str
    ID of the organization
    token str
    Value of the token
    user_id str
    ID of the user
    expirationDate String
    Expiration date of the token in the RFC3339 format
    orgId String
    ID of the organization
    token String
    Value of the token
    userId String
    ID of the user

    Import

    terraform The resource can be imported using the ID format <id:user_id[:org_id][:token]>, e.g.

     $ pulumi import zitadel:index/personalAccessToken:PersonalAccessToken imported '123456789012345678:123456789012345678:123456789012345678:LHt79...'
    

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

    Package Details

    Repository
    zitadel pulumiverse/pulumi-zitadel
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the zitadel Terraform Provider.
    zitadel logo
    zitadel v0.1.8 published on Thursday, May 30, 2024 by pulumiverse