// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "./types"; import * as utilities from "./utilities"; /** * Adds and updates users in the native realm. These users are commonly referred to as native users. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as elasticstack from "@pulumi/elasticstack"; * * const user = new elasticstack.ElasticsearchSecurityUser("user", { * username: "testuser", * passwordHash: `$2a$10$rMZe6TdsUwBX/TA8vRDz0OLwKAZeCzXM4jT3tfCjpSTB8HoFuq8xO`, * roles: ["kibana_user"], * metadata: JSON.stringify({ * env: "testing", * open: false, * number: 49, * }), * elasticsearchConnection: { * endpoints: ["http://localhost:9200"], * username: "elastic", * password: "changeme", * }, * }); * const dev = new elasticstack.ElasticsearchSecurityUser("dev", { * username: "devuser", * password: "1234567890", * roles: ["kibana_user"], * metadata: JSON.stringify({ * env: "testing", * open: false, * number: 49, * }), * }); * ``` * * ## Import * * ```sh * $ pulumi import elasticstack:index/elasticsearchSecurityUser:ElasticsearchSecurityUser user /elastic * ``` */ export class ElasticsearchSecurityUser extends pulumi.CustomResource { /** * Get an existing ElasticsearchSecurityUser resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ public static get(name: string, id: pulumi.Input, state?: ElasticsearchSecurityUserState, opts?: pulumi.CustomResourceOptions): ElasticsearchSecurityUser { return new ElasticsearchSecurityUser(name, state, { ...opts, id: id }); } /** @internal */ public static readonly __pulumiType = 'elasticstack:index/elasticsearchSecurityUser:ElasticsearchSecurityUser'; /** * Returns true if the given object is an instance of ElasticsearchSecurityUser. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ public static isInstance(obj: any): obj is ElasticsearchSecurityUser { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === ElasticsearchSecurityUser.__pulumiType; } /** * Used to establish connection to Elasticsearch server. Overrides environment variables if present. */ public readonly elasticsearchConnection!: pulumi.Output; /** * The email of the user. */ public readonly email!: pulumi.Output; /** * Specifies whether the user is enabled. The default value is true. */ public readonly enabled!: pulumi.Output; /** * The full name of the user. */ public readonly fullName!: pulumi.Output; /** * Internal identifier of the resource */ public /*out*/ readonly id!: pulumi.Output; /** * Arbitrary metadata that you want to associate with the user. */ public readonly metadata!: pulumi.Output; /** * The user’s password. Passwords must be at least 6 characters long. */ public readonly password!: pulumi.Output; /** * A hash of the user’s password. This must be produced using the same hashing algorithm as has been configured for password storage (see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#hashing-settings). */ public readonly passwordHash!: pulumi.Output; /** * A set of roles the user has. The roles determine the user’s access permissions. Default is []. */ public readonly roles!: pulumi.Output; /** * An identifier for the user (see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html#security-api-put-user-path-params). */ public readonly username!: pulumi.Output; /** * Create a ElasticsearchSecurityUser resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ElasticsearchSecurityUserArgs, opts?: pulumi.CustomResourceOptions) constructor(name: string, argsOrState?: ElasticsearchSecurityUserArgs | ElasticsearchSecurityUserState, opts?: pulumi.CustomResourceOptions) { let resourceInputs: pulumi.Inputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState as ElasticsearchSecurityUserState | undefined; resourceInputs["elasticsearchConnection"] = state ? state.elasticsearchConnection : undefined; resourceInputs["email"] = state ? state.email : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["fullName"] = state ? state.fullName : undefined; resourceInputs["id"] = state ? state.id : undefined; resourceInputs["metadata"] = state ? state.metadata : undefined; resourceInputs["password"] = state ? state.password : undefined; resourceInputs["passwordHash"] = state ? state.passwordHash : undefined; resourceInputs["roles"] = state ? state.roles : undefined; resourceInputs["username"] = state ? state.username : undefined; } else { const args = argsOrState as ElasticsearchSecurityUserArgs | undefined; if ((!args || args.roles === undefined) && !opts.urn) { throw new Error("Missing required property 'roles'"); } if ((!args || args.username === undefined) && !opts.urn) { throw new Error("Missing required property 'username'"); } resourceInputs["elasticsearchConnection"] = args ? args.elasticsearchConnection : undefined; resourceInputs["email"] = args ? args.email : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["fullName"] = args ? args.fullName : undefined; resourceInputs["metadata"] = args ? args.metadata : undefined; resourceInputs["password"] = args ? args.password : undefined; resourceInputs["passwordHash"] = args ? args.passwordHash : undefined; resourceInputs["roles"] = args ? args.roles : undefined; resourceInputs["username"] = args ? args.username : undefined; resourceInputs["id"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ElasticsearchSecurityUser.__pulumiType, name, resourceInputs, opts); } } /** * Input properties used for looking up and filtering ElasticsearchSecurityUser resources. */ export interface ElasticsearchSecurityUserState { /** * Used to establish connection to Elasticsearch server. Overrides environment variables if present. */ elasticsearchConnection?: pulumi.Input; /** * The email of the user. */ email?: pulumi.Input; /** * Specifies whether the user is enabled. The default value is true. */ enabled?: pulumi.Input; /** * The full name of the user. */ fullName?: pulumi.Input; /** * Internal identifier of the resource */ id?: pulumi.Input; /** * Arbitrary metadata that you want to associate with the user. */ metadata?: pulumi.Input; /** * The user’s password. Passwords must be at least 6 characters long. */ password?: pulumi.Input; /** * A hash of the user’s password. This must be produced using the same hashing algorithm as has been configured for password storage (see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#hashing-settings). */ passwordHash?: pulumi.Input; /** * A set of roles the user has. The roles determine the user’s access permissions. Default is []. */ roles?: pulumi.Input[]>; /** * An identifier for the user (see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html#security-api-put-user-path-params). */ username?: pulumi.Input; } /** * The set of arguments for constructing a ElasticsearchSecurityUser resource. */ export interface ElasticsearchSecurityUserArgs { /** * Used to establish connection to Elasticsearch server. Overrides environment variables if present. */ elasticsearchConnection?: pulumi.Input; /** * The email of the user. */ email?: pulumi.Input; /** * Specifies whether the user is enabled. The default value is true. */ enabled?: pulumi.Input; /** * The full name of the user. */ fullName?: pulumi.Input; /** * Arbitrary metadata that you want to associate with the user. */ metadata?: pulumi.Input; /** * The user’s password. Passwords must be at least 6 characters long. */ password?: pulumi.Input; /** * A hash of the user’s password. This must be produced using the same hashing algorithm as has been configured for password storage (see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#hashing-settings). */ passwordHash?: pulumi.Input; /** * A set of roles the user has. The roles determine the user’s access permissions. Default is []. */ roles: pulumi.Input[]>; /** * An identifier for the user (see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html#security-api-put-user-path-params). */ username: pulumi.Input; }