1. Packages
  2. Selectel Provider
  3. API Docs
  4. CraasTokenV1
selectel 6.4.0 published on Monday, Apr 14, 2025 by selectel

selectel.CraasTokenV1

Explore with Pulumi AI

selectel logo
selectel 6.4.0 published on Monday, Apr 14, 2025 by selectel

    Creates and manages tokens in Container Registry using public API v1. For more information about Container Registry, see the official Selectel documentation.

    Basic usage example

    import * as pulumi from "@pulumi/pulumi";
    import * as selectel from "@pulumi/selectel";
    
    const token1 = new selectel.CraasTokenV1("token1", {projectId: selectel_vpc_project_v2.project_1.id});
    
    import pulumi
    import pulumi_selectel as selectel
    
    token1 = selectel.CraasTokenV1("token1", project_id=selectel_vpc_project_v2["project_1"]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/selectel/v6/selectel"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := selectel.NewCraasTokenV1(ctx, "token1", &selectel.CraasTokenV1Args{
    			ProjectId: pulumi.Any(selectel_vpc_project_v2.Project_1.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Selectel = Pulumi.Selectel;
    
    return await Deployment.RunAsync(() => 
    {
        var token1 = new Selectel.CraasTokenV1("token1", new()
        {
            ProjectId = selectel_vpc_project_v2.Project_1.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.selectel.CraasTokenV1;
    import com.pulumi.selectel.CraasTokenV1Args;
    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 token1 = new CraasTokenV1("token1", CraasTokenV1Args.builder()
                .projectId(selectel_vpc_project_v2.project_1().id())
                .build());
    
        }
    }
    
    resources:
      token1:
        type: selectel:CraasTokenV1
        properties:
          projectId: ${selectel_vpc_project_v2.project_1.id}
    

    Docker CLI login example

    import * as pulumi from "@pulumi/pulumi";
    import * as selectel from "@pulumi/selectel";
    
    const token1 = new selectel.CraasTokenV1("token1", {projectId: selectel_vpc_project_v2.project_1.id});
    export const registryUsername = token1.username;
    export const registryToken = token1.token;
    
    import pulumi
    import pulumi_selectel as selectel
    
    token1 = selectel.CraasTokenV1("token1", project_id=selectel_vpc_project_v2["project_1"]["id"])
    pulumi.export("registryUsername", token1.username)
    pulumi.export("registryToken", token1.token)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/selectel/v6/selectel"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		token1, err := selectel.NewCraasTokenV1(ctx, "token1", &selectel.CraasTokenV1Args{
    			ProjectId: pulumi.Any(selectel_vpc_project_v2.Project_1.Id),
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("registryUsername", token1.Username)
    		ctx.Export("registryToken", token1.Token)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Selectel = Pulumi.Selectel;
    
    return await Deployment.RunAsync(() => 
    {
        var token1 = new Selectel.CraasTokenV1("token1", new()
        {
            ProjectId = selectel_vpc_project_v2.Project_1.Id,
        });
    
        return new Dictionary<string, object?>
        {
            ["registryUsername"] = token1.Username,
            ["registryToken"] = token1.Token,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.selectel.CraasTokenV1;
    import com.pulumi.selectel.CraasTokenV1Args;
    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 token1 = new CraasTokenV1("token1", CraasTokenV1Args.builder()
                .projectId(selectel_vpc_project_v2.project_1().id())
                .build());
    
            ctx.export("registryUsername", token1.username());
            ctx.export("registryToken", token1.token());
        }
    }
    
    resources:
      token1:
        type: selectel:CraasTokenV1
        properties:
          projectId: ${selectel_vpc_project_v2.project_1.id}
    outputs:
      registryUsername: ${token1.username}
      registryToken: ${token1.token}
    
    REGISTRY_USERNAME=$(terraform output -raw registry_username)
    REGISTRY_TOKEN=$(terraform output -raw registry_token)
    echo $REGISTRY_TOKEN | docker login cr.selcloud.ru --username $REGISTRY_USERNAME --password-stdin
    

    Create CraasTokenV1 Resource

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

    Constructor syntax

    new CraasTokenV1(name: string, args: CraasTokenV1Args, opts?: CustomResourceOptions);
    @overload
    def CraasTokenV1(resource_name: str,
                     args: CraasTokenV1Args,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def CraasTokenV1(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     project_id: Optional[str] = None,
                     craas_token_v1_id: Optional[str] = None,
                     token_ttl: Optional[str] = None)
    func NewCraasTokenV1(ctx *Context, name string, args CraasTokenV1Args, opts ...ResourceOption) (*CraasTokenV1, error)
    public CraasTokenV1(string name, CraasTokenV1Args args, CustomResourceOptions? opts = null)
    public CraasTokenV1(String name, CraasTokenV1Args args)
    public CraasTokenV1(String name, CraasTokenV1Args args, CustomResourceOptions options)
    
    type: selectel:CraasTokenV1
    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 CraasTokenV1Args
    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 CraasTokenV1Args
    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 CraasTokenV1Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CraasTokenV1Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CraasTokenV1Args
    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 craasTokenV1Resource = new Selectel.CraasTokenV1("craasTokenV1Resource", new()
    {
        ProjectId = "string",
        CraasTokenV1Id = "string",
        TokenTtl = "string",
    });
    
    example, err := selectel.NewCraasTokenV1(ctx, "craasTokenV1Resource", &selectel.CraasTokenV1Args{
    	ProjectId:      pulumi.String("string"),
    	CraasTokenV1Id: pulumi.String("string"),
    	TokenTtl:       pulumi.String("string"),
    })
    
    var craasTokenV1Resource = new CraasTokenV1("craasTokenV1Resource", CraasTokenV1Args.builder()
        .projectId("string")
        .craasTokenV1Id("string")
        .tokenTtl("string")
        .build());
    
    craas_token_v1_resource = selectel.CraasTokenV1("craasTokenV1Resource",
        project_id="string",
        craas_token_v1_id="string",
        token_ttl="string")
    
    const craasTokenV1Resource = new selectel.CraasTokenV1("craasTokenV1Resource", {
        projectId: "string",
        craasTokenV1Id: "string",
        tokenTtl: "string",
    });
    
    type: selectel:CraasTokenV1
    properties:
        craasTokenV1Id: string
        projectId: string
        tokenTtl: string
    

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

    ProjectId string
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    CraasTokenV1Id string
    TokenTtl string
    Token lifetime. Changing this creates a new token. Available values are 1y for a year and 12h for 12 hours. The default value is 1y.
    ProjectId string
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    CraasTokenV1Id string
    TokenTtl string
    Token lifetime. Changing this creates a new token. Available values are 1y for a year and 12h for 12 hours. The default value is 1y.
    projectId String
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    craasTokenV1Id String
    tokenTtl String
    Token lifetime. Changing this creates a new token. Available values are 1y for a year and 12h for 12 hours. The default value is 1y.
    projectId string
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    craasTokenV1Id string
    tokenTtl string
    Token lifetime. Changing this creates a new token. Available values are 1y for a year and 12h for 12 hours. The default value is 1y.
    project_id str
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    craas_token_v1_id str
    token_ttl str
    Token lifetime. Changing this creates a new token. Available values are 1y for a year and 12h for 12 hours. The default value is 1y.
    projectId String
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    craasTokenV1Id String
    tokenTtl String
    Token lifetime. Changing this creates a new token. Available values are 1y for a year and 12h for 12 hours. The default value is 1y.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Token string
    (Sensitive) Token to access Container Registry.
    Username string
    (Sensitive) Username to access Container Registry.
    Id string
    The provider-assigned unique ID for this managed resource.
    Token string
    (Sensitive) Token to access Container Registry.
    Username string
    (Sensitive) Username to access Container Registry.
    id String
    The provider-assigned unique ID for this managed resource.
    token String
    (Sensitive) Token to access Container Registry.
    username String
    (Sensitive) Username to access Container Registry.
    id string
    The provider-assigned unique ID for this managed resource.
    token string
    (Sensitive) Token to access Container Registry.
    username string
    (Sensitive) Username to access Container Registry.
    id str
    The provider-assigned unique ID for this managed resource.
    token str
    (Sensitive) Token to access Container Registry.
    username str
    (Sensitive) Username to access Container Registry.
    id String
    The provider-assigned unique ID for this managed resource.
    token String
    (Sensitive) Token to access Container Registry.
    username String
    (Sensitive) Username to access Container Registry.

    Look up Existing CraasTokenV1 Resource

    Get an existing CraasTokenV1 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?: CraasTokenV1State, opts?: CustomResourceOptions): CraasTokenV1
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            craas_token_v1_id: Optional[str] = None,
            project_id: Optional[str] = None,
            token: Optional[str] = None,
            token_ttl: Optional[str] = None,
            username: Optional[str] = None) -> CraasTokenV1
    func GetCraasTokenV1(ctx *Context, name string, id IDInput, state *CraasTokenV1State, opts ...ResourceOption) (*CraasTokenV1, error)
    public static CraasTokenV1 Get(string name, Input<string> id, CraasTokenV1State? state, CustomResourceOptions? opts = null)
    public static CraasTokenV1 get(String name, Output<String> id, CraasTokenV1State state, CustomResourceOptions options)
    resources:  _:    type: selectel:CraasTokenV1    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:
    CraasTokenV1Id string
    ProjectId string
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    Token string
    (Sensitive) Token to access Container Registry.
    TokenTtl string
    Token lifetime. Changing this creates a new token. Available values are 1y for a year and 12h for 12 hours. The default value is 1y.
    Username string
    (Sensitive) Username to access Container Registry.
    CraasTokenV1Id string
    ProjectId string
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    Token string
    (Sensitive) Token to access Container Registry.
    TokenTtl string
    Token lifetime. Changing this creates a new token. Available values are 1y for a year and 12h for 12 hours. The default value is 1y.
    Username string
    (Sensitive) Username to access Container Registry.
    craasTokenV1Id String
    projectId String
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    token String
    (Sensitive) Token to access Container Registry.
    tokenTtl String
    Token lifetime. Changing this creates a new token. Available values are 1y for a year and 12h for 12 hours. The default value is 1y.
    username String
    (Sensitive) Username to access Container Registry.
    craasTokenV1Id string
    projectId string
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    token string
    (Sensitive) Token to access Container Registry.
    tokenTtl string
    Token lifetime. Changing this creates a new token. Available values are 1y for a year and 12h for 12 hours. The default value is 1y.
    username string
    (Sensitive) Username to access Container Registry.
    craas_token_v1_id str
    project_id str
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    token str
    (Sensitive) Token to access Container Registry.
    token_ttl str
    Token lifetime. Changing this creates a new token. Available values are 1y for a year and 12h for 12 hours. The default value is 1y.
    username str
    (Sensitive) Username to access Container Registry.
    craasTokenV1Id String
    projectId String
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    token String
    (Sensitive) Token to access Container Registry.
    tokenTtl String
    Token lifetime. Changing this creates a new token. Available values are 1y for a year and 12h for 12 hours. The default value is 1y.
    username String
    (Sensitive) Username to access Container Registry.

    Package Details

    Repository
    selectel selectel/terraform-provider-selectel
    License
    Notes
    This Pulumi package is based on the selectel Terraform Provider.
    selectel logo
    selectel 6.4.0 published on Monday, Apr 14, 2025 by selectel