1. Packages
  2. Etcd Provider
  3. API Docs
  4. User
etcd 0.10.0 published on Tuesday, Apr 15, 2025 by ferlab-ste-justine

etcd.User

Explore with Pulumi AI

etcd logo
etcd 0.10.0 published on Tuesday, Apr 15, 2025 by ferlab-ste-justine

    User that can access etcd.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as etcd from "@pulumi/etcd";
    
    const summaryReader = new etcd.Role("summaryReader", {permissions: [{
        permission: "read",
        key: "/summary.txt",
        rangeEnd: "/summary.txt",
    }]});
    const bob = new etcd.User("bob", {
        username: "bob",
        password: "1234",
        roles: [summaryReader.name],
    });
    
    import pulumi
    import pulumi_etcd as etcd
    
    summary_reader = etcd.Role("summaryReader", permissions=[{
        "permission": "read",
        "key": "/summary.txt",
        "range_end": "/summary.txt",
    }])
    bob = etcd.User("bob",
        username="bob",
        password="1234",
        roles=[summary_reader.name])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/etcd/etcd"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		summaryReader, err := etcd.NewRole(ctx, "summaryReader", &etcd.RoleArgs{
    			Permissions: etcd.RolePermissionArray{
    				&etcd.RolePermissionArgs{
    					Permission: pulumi.String("read"),
    					Key:        pulumi.String("/summary.txt"),
    					RangeEnd:   pulumi.String("/summary.txt"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = etcd.NewUser(ctx, "bob", &etcd.UserArgs{
    			Username: pulumi.String("bob"),
    			Password: pulumi.String("1234"),
    			Roles: pulumi.StringArray{
    				summaryReader.Name,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Etcd = Pulumi.Etcd;
    
    return await Deployment.RunAsync(() => 
    {
        var summaryReader = new Etcd.Role("summaryReader", new()
        {
            Permissions = new[]
            {
                new Etcd.Inputs.RolePermissionArgs
                {
                    Permission = "read",
                    Key = "/summary.txt",
                    RangeEnd = "/summary.txt",
                },
            },
        });
    
        var bob = new Etcd.User("bob", new()
        {
            Username = "bob",
            Password = "1234",
            Roles = new[]
            {
                summaryReader.Name,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.etcd.Role;
    import com.pulumi.etcd.RoleArgs;
    import com.pulumi.etcd.inputs.RolePermissionArgs;
    import com.pulumi.etcd.User;
    import com.pulumi.etcd.UserArgs;
    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 summaryReader = new Role("summaryReader", RoleArgs.builder()
                .permissions(RolePermissionArgs.builder()
                    .permission("read")
                    .key("/summary.txt")
                    .rangeEnd("/summary.txt")
                    .build())
                .build());
    
            var bob = new User("bob", UserArgs.builder()
                .username("bob")
                .password("1234")
                .roles(summaryReader.name())
                .build());
    
        }
    }
    
    resources:
      summaryReader:
        type: etcd:Role
        properties:
          permissions:
            - permission: read
              key: /summary.txt
              rangeEnd: /summary.txt
      bob:
        type: etcd:User
        properties:
          username: bob
          password: '1234'
          roles:
            - ${summaryReader.name}
    

    Create User Resource

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

    Constructor syntax

    new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
    @overload
    def User(resource_name: str,
             args: UserArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def User(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             username: Optional[str] = None,
             password: Optional[str] = None,
             roles: Optional[Sequence[str]] = None,
             user_id: Optional[str] = None)
    func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
    public User(string name, UserArgs args, CustomResourceOptions? opts = null)
    public User(String name, UserArgs args)
    public User(String name, UserArgs args, CustomResourceOptions options)
    
    type: etcd:User
    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 UserArgs
    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 UserArgs
    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 UserArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserArgs
    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 userResource = new Etcd.User("userResource", new()
    {
        Username = "string",
        Password = "string",
        Roles = new[]
        {
            "string",
        },
        UserId = "string",
    });
    
    example, err := etcd.NewUser(ctx, "userResource", &etcd.UserArgs{
    	Username: pulumi.String("string"),
    	Password: pulumi.String("string"),
    	Roles: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	UserId: pulumi.String("string"),
    })
    
    var userResource = new User("userResource", UserArgs.builder()
        .username("string")
        .password("string")
        .roles("string")
        .userId("string")
        .build());
    
    user_resource = etcd.User("userResource",
        username="string",
        password="string",
        roles=["string"],
        user_id="string")
    
    const userResource = new etcd.User("userResource", {
        username: "string",
        password: "string",
        roles: ["string"],
        userId: "string",
    });
    
    type: etcd:User
    properties:
        password: string
        roles:
            - string
        userId: string
        username: string
    

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

    Username string
    Name of the user. Changing this will delete the user and create a new one.
    Password string
    Password of the user. Can be omitted for a user that you wish to authenticate strictly with tls certificate authentication.
    Roles List<string>
    Roles of the user, to define his access.
    UserId string
    The ID of this resource.
    Username string
    Name of the user. Changing this will delete the user and create a new one.
    Password string
    Password of the user. Can be omitted for a user that you wish to authenticate strictly with tls certificate authentication.
    Roles []string
    Roles of the user, to define his access.
    UserId string
    The ID of this resource.
    username String
    Name of the user. Changing this will delete the user and create a new one.
    password String
    Password of the user. Can be omitted for a user that you wish to authenticate strictly with tls certificate authentication.
    roles List<String>
    Roles of the user, to define his access.
    userId String
    The ID of this resource.
    username string
    Name of the user. Changing this will delete the user and create a new one.
    password string
    Password of the user. Can be omitted for a user that you wish to authenticate strictly with tls certificate authentication.
    roles string[]
    Roles of the user, to define his access.
    userId string
    The ID of this resource.
    username str
    Name of the user. Changing this will delete the user and create a new one.
    password str
    Password of the user. Can be omitted for a user that you wish to authenticate strictly with tls certificate authentication.
    roles Sequence[str]
    Roles of the user, to define his access.
    user_id str
    The ID of this resource.
    username String
    Name of the user. Changing this will delete the user and create a new one.
    password String
    Password of the user. Can be omitted for a user that you wish to authenticate strictly with tls certificate authentication.
    roles List<String>
    Roles of the user, to define his access.
    userId String
    The ID of this resource.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing User Resource

    Get an existing User 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?: UserState, opts?: CustomResourceOptions): User
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            password: Optional[str] = None,
            roles: Optional[Sequence[str]] = None,
            user_id: Optional[str] = None,
            username: Optional[str] = None) -> User
    func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
    public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
    public static User get(String name, Output<String> id, UserState state, CustomResourceOptions options)
    resources:  _:    type: etcd:User    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:
    Password string
    Password of the user. Can be omitted for a user that you wish to authenticate strictly with tls certificate authentication.
    Roles List<string>
    Roles of the user, to define his access.
    UserId string
    The ID of this resource.
    Username string
    Name of the user. Changing this will delete the user and create a new one.
    Password string
    Password of the user. Can be omitted for a user that you wish to authenticate strictly with tls certificate authentication.
    Roles []string
    Roles of the user, to define his access.
    UserId string
    The ID of this resource.
    Username string
    Name of the user. Changing this will delete the user and create a new one.
    password String
    Password of the user. Can be omitted for a user that you wish to authenticate strictly with tls certificate authentication.
    roles List<String>
    Roles of the user, to define his access.
    userId String
    The ID of this resource.
    username String
    Name of the user. Changing this will delete the user and create a new one.
    password string
    Password of the user. Can be omitted for a user that you wish to authenticate strictly with tls certificate authentication.
    roles string[]
    Roles of the user, to define his access.
    userId string
    The ID of this resource.
    username string
    Name of the user. Changing this will delete the user and create a new one.
    password str
    Password of the user. Can be omitted for a user that you wish to authenticate strictly with tls certificate authentication.
    roles Sequence[str]
    Roles of the user, to define his access.
    user_id str
    The ID of this resource.
    username str
    Name of the user. Changing this will delete the user and create a new one.
    password String
    Password of the user. Can be omitted for a user that you wish to authenticate strictly with tls certificate authentication.
    roles List<String>
    Roles of the user, to define his access.
    userId String
    The ID of this resource.
    username String
    Name of the user. Changing this will delete the user and create a new one.

    Package Details

    Repository
    etcd ferlab-ste-justine/terraform-provider-etcd
    License
    Notes
    This Pulumi package is based on the etcd Terraform Provider.
    etcd logo
    etcd 0.10.0 published on Tuesday, Apr 15, 2025 by ferlab-ste-justine