1. Packages
  2. OVH
  3. API Docs
  4. Me
  5. IdentityUserToken
Viewing docs for OVHCloud v2.12.0
published on Thursday, Mar 12, 2026 by OVHcloud
ovh logo
Viewing docs for OVHCloud v2.12.0
published on Thursday, Mar 12, 2026 by OVHcloud

    Creates a token for an identity user.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    
    const user = new ovh.me.IdentityUser("user", {
        description: "User description",
        email: "user.email@example.com",
        group: "DEFAULT",
        login: "user_login",
        password: "SecretPassword123",
    });
    const token = new ovh.me.IdentityUserToken("token", {
        userLogin: user.login,
        name: "token_name",
        description: "Token description",
        expiresAt: "2030-01-01T00:00:00Z",
    });
    
    import pulumi
    import pulumi_ovh as ovh
    
    user = ovh.me.IdentityUser("user",
        description="User description",
        email="user.email@example.com",
        group="DEFAULT",
        login="user_login",
        password="SecretPassword123")
    token = ovh.me.IdentityUserToken("token",
        user_login=user.login,
        name="token_name",
        description="Token description",
        expires_at="2030-01-01T00:00:00Z")
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh/me"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		user, err := me.NewIdentityUser(ctx, "user", &me.IdentityUserArgs{
    			Description: pulumi.String("User description"),
    			Email:       pulumi.String("user.email@example.com"),
    			Group:       pulumi.String("DEFAULT"),
    			Login:       pulumi.String("user_login"),
    			Password:    pulumi.String("SecretPassword123"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = me.NewIdentityUserToken(ctx, "token", &me.IdentityUserTokenArgs{
    			UserLogin:   user.Login,
    			Name:        pulumi.String("token_name"),
    			Description: pulumi.String("Token description"),
    			ExpiresAt:   pulumi.String("2030-01-01T00:00:00Z"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var user = new Ovh.Me.IdentityUser("user", new()
        {
            Description = "User description",
            Email = "user.email@example.com",
            Group = "DEFAULT",
            Login = "user_login",
            Password = "SecretPassword123",
        });
    
        var token = new Ovh.Me.IdentityUserToken("token", new()
        {
            UserLogin = user.Login,
            Name = "token_name",
            Description = "Token description",
            ExpiresAt = "2030-01-01T00:00:00Z",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.ovhcloud.pulumi.ovh.Me.IdentityUser;
    import com.ovhcloud.pulumi.ovh.Me.IdentityUserArgs;
    import com.ovhcloud.pulumi.ovh.Me.IdentityUserToken;
    import com.ovhcloud.pulumi.ovh.Me.IdentityUserTokenArgs;
    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 user = new IdentityUser("user", IdentityUserArgs.builder()
                .description("User description")
                .email("user.email@example.com")
                .group("DEFAULT")
                .login("user_login")
                .password("SecretPassword123")
                .build());
    
            var token = new IdentityUserToken("token", IdentityUserTokenArgs.builder()
                .userLogin(user.login())
                .name("token_name")
                .description("Token description")
                .expiresAt("2030-01-01T00:00:00Z")
                .build());
    
        }
    }
    
    resources:
      user:
        type: ovh:Me:IdentityUser
        properties:
          description: User description
          email: user.email@example.com
          group: DEFAULT
          login: user_login
          password: SecretPassword123
      token:
        type: ovh:Me:IdentityUserToken
        properties:
          userLogin: ${user.login}
          name: token_name
          description: Token description
          expiresAt: 2030-01-01T00:00:00Z
    

    Create IdentityUserToken Resource

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

    Constructor syntax

    new IdentityUserToken(name: string, args: IdentityUserTokenArgs, opts?: CustomResourceOptions);
    @overload
    def IdentityUserToken(resource_name: str,
                          args: IdentityUserTokenArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def IdentityUserToken(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          description: Optional[str] = None,
                          user_login: Optional[str] = None,
                          expires_at: Optional[str] = None,
                          expires_in: Optional[int] = None,
                          name: Optional[str] = None)
    func NewIdentityUserToken(ctx *Context, name string, args IdentityUserTokenArgs, opts ...ResourceOption) (*IdentityUserToken, error)
    public IdentityUserToken(string name, IdentityUserTokenArgs args, CustomResourceOptions? opts = null)
    public IdentityUserToken(String name, IdentityUserTokenArgs args)
    public IdentityUserToken(String name, IdentityUserTokenArgs args, CustomResourceOptions options)
    
    type: ovh:Me:IdentityUserToken
    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 IdentityUserTokenArgs
    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 IdentityUserTokenArgs
    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 IdentityUserTokenArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IdentityUserTokenArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IdentityUserTokenArgs
    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 identityUserTokenResource = new Ovh.Me.IdentityUserToken("identityUserTokenResource", new()
    {
        Description = "string",
        UserLogin = "string",
        ExpiresAt = "string",
        ExpiresIn = 0,
        Name = "string",
    });
    
    example, err := me.NewIdentityUserToken(ctx, "identityUserTokenResource", &me.IdentityUserTokenArgs{
    	Description: pulumi.String("string"),
    	UserLogin:   pulumi.String("string"),
    	ExpiresAt:   pulumi.String("string"),
    	ExpiresIn:   pulumi.Int(0),
    	Name:        pulumi.String("string"),
    })
    
    var identityUserTokenResource = new IdentityUserToken("identityUserTokenResource", IdentityUserTokenArgs.builder()
        .description("string")
        .userLogin("string")
        .expiresAt("string")
        .expiresIn(0)
        .name("string")
        .build());
    
    identity_user_token_resource = ovh.me.IdentityUserToken("identityUserTokenResource",
        description="string",
        user_login="string",
        expires_at="string",
        expires_in=0,
        name="string")
    
    const identityUserTokenResource = new ovh.me.IdentityUserToken("identityUserTokenResource", {
        description: "string",
        userLogin: "string",
        expiresAt: "string",
        expiresIn: 0,
        name: "string",
    });
    
    type: ovh:Me:IdentityUserToken
    properties:
        description: string
        expiresAt: string
        expiresIn: 0
        name: string
        userLogin: string
    

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

    Description string
    Token description.
    UserLogin string
    User's login suffix.
    ExpiresAt string
    Token expiration date.
    ExpiresIn int
    Token validity duration in seconds.
    Name string
    Token name.
    Description string
    Token description.
    UserLogin string
    User's login suffix.
    ExpiresAt string
    Token expiration date.
    ExpiresIn int
    Token validity duration in seconds.
    Name string
    Token name.
    description String
    Token description.
    userLogin String
    User's login suffix.
    expiresAt String
    Token expiration date.
    expiresIn Integer
    Token validity duration in seconds.
    name String
    Token name.
    description string
    Token description.
    userLogin string
    User's login suffix.
    expiresAt string
    Token expiration date.
    expiresIn number
    Token validity duration in seconds.
    name string
    Token name.
    description str
    Token description.
    user_login str
    User's login suffix.
    expires_at str
    Token expiration date.
    expires_in int
    Token validity duration in seconds.
    name str
    Token name.
    description String
    Token description.
    userLogin String
    User's login suffix.
    expiresAt String
    Token expiration date.
    expiresIn Number
    Token validity duration in seconds.
    name String
    Token name.

    Outputs

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

    Creation string
    Creation date of this token.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUsed string
    Last use of this token.
    Token string
    The token value.
    Creation string
    Creation date of this token.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUsed string
    Last use of this token.
    Token string
    The token value.
    creation String
    Creation date of this token.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUsed String
    Last use of this token.
    token String
    The token value.
    creation string
    Creation date of this token.
    id string
    The provider-assigned unique ID for this managed resource.
    lastUsed string
    Last use of this token.
    token string
    The token value.
    creation str
    Creation date of this token.
    id str
    The provider-assigned unique ID for this managed resource.
    last_used str
    Last use of this token.
    token str
    The token value.
    creation String
    Creation date of this token.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUsed String
    Last use of this token.
    token String
    The token value.

    Look up Existing IdentityUserToken Resource

    Get an existing IdentityUserToken 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?: IdentityUserTokenState, opts?: CustomResourceOptions): IdentityUserToken
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            creation: Optional[str] = None,
            description: Optional[str] = None,
            expires_at: Optional[str] = None,
            expires_in: Optional[int] = None,
            last_used: Optional[str] = None,
            name: Optional[str] = None,
            token: Optional[str] = None,
            user_login: Optional[str] = None) -> IdentityUserToken
    func GetIdentityUserToken(ctx *Context, name string, id IDInput, state *IdentityUserTokenState, opts ...ResourceOption) (*IdentityUserToken, error)
    public static IdentityUserToken Get(string name, Input<string> id, IdentityUserTokenState? state, CustomResourceOptions? opts = null)
    public static IdentityUserToken get(String name, Output<String> id, IdentityUserTokenState state, CustomResourceOptions options)
    resources:  _:    type: ovh:Me:IdentityUserToken    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.
    The following state arguments are supported:
    Creation string
    Creation date of this token.
    Description string
    Token description.
    ExpiresAt string
    Token expiration date.
    ExpiresIn int
    Token validity duration in seconds.
    LastUsed string
    Last use of this token.
    Name string
    Token name.
    Token string
    The token value.
    UserLogin string
    User's login suffix.
    Creation string
    Creation date of this token.
    Description string
    Token description.
    ExpiresAt string
    Token expiration date.
    ExpiresIn int
    Token validity duration in seconds.
    LastUsed string
    Last use of this token.
    Name string
    Token name.
    Token string
    The token value.
    UserLogin string
    User's login suffix.
    creation String
    Creation date of this token.
    description String
    Token description.
    expiresAt String
    Token expiration date.
    expiresIn Integer
    Token validity duration in seconds.
    lastUsed String
    Last use of this token.
    name String
    Token name.
    token String
    The token value.
    userLogin String
    User's login suffix.
    creation string
    Creation date of this token.
    description string
    Token description.
    expiresAt string
    Token expiration date.
    expiresIn number
    Token validity duration in seconds.
    lastUsed string
    Last use of this token.
    name string
    Token name.
    token string
    The token value.
    userLogin string
    User's login suffix.
    creation str
    Creation date of this token.
    description str
    Token description.
    expires_at str
    Token expiration date.
    expires_in int
    Token validity duration in seconds.
    last_used str
    Last use of this token.
    name str
    Token name.
    token str
    The token value.
    user_login str
    User's login suffix.
    creation String
    Creation date of this token.
    description String
    Token description.
    expiresAt String
    Token expiration date.
    expiresIn Number
    Token validity duration in seconds.
    lastUsed String
    Last use of this token.
    name String
    Token name.
    token String
    The token value.
    userLogin String
    User's login suffix.

    Import

    A user identity token can be imported using the user_login and name, separated by “/” E.g.,

    bash

    $ pulumi import ovh:Me/identityUserToken:IdentityUserToken token user_login/token_name
    

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

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    Viewing docs for OVHCloud v2.12.0
    published on Thursday, Mar 12, 2026 by OVHcloud
      Try Pulumi Cloud free. Your team will thank you.