// *** 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 roles in the native realm. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as elasticstack from "@pulumi/elasticstack"; * * const roleElasticsearchSecurityRole = new elasticstack.ElasticsearchSecurityRole("roleElasticsearchSecurityRole", { * clusters: ["all"], * indices: [{ * names: [ * "index1", * "index2", * ], * privileges: ["all"], * }], * applications: [{ * application: "myapp", * privileges: [ * "admin", * "read", * ], * resources: ["*"], * }], * runAs: ["other_user"], * metadata: JSON.stringify({ * version: 1, * }), * }); * export const role = roleElasticsearchSecurityRole; * ``` * * ## Import * * ```sh * $ pulumi import elasticstack:index/elasticsearchSecurityRole:ElasticsearchSecurityRole elasticstack_elasticsearch_security_role / * ``` */ export class ElasticsearchSecurityRole extends pulumi.CustomResource { /** * Get an existing ElasticsearchSecurityRole 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?: ElasticsearchSecurityRoleState, opts?: pulumi.CustomResourceOptions): ElasticsearchSecurityRole { return new ElasticsearchSecurityRole(name, state, { ...opts, id: id }); } /** @internal */ public static readonly __pulumiType = 'elasticstack:index/elasticsearchSecurityRole:ElasticsearchSecurityRole'; /** * Returns true if the given object is an instance of ElasticsearchSecurityRole. 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 ElasticsearchSecurityRole { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === ElasticsearchSecurityRole.__pulumiType; } /** * A list of application privilege entries. */ public readonly applications!: pulumi.Output; /** * A list of cluster privileges. These privileges define the cluster level actions that users with this role are able to execute. */ public readonly clusters!: pulumi.Output; /** * Used to establish connection to Elasticsearch server. Overrides environment variables if present. */ public readonly elasticsearchConnection!: pulumi.Output; /** * An object defining global privileges. */ public readonly global!: pulumi.Output; /** * Internal identifier of the resource */ public /*out*/ readonly id!: pulumi.Output; /** * A list of indices permissions entries. */ public readonly indices!: pulumi.Output; /** * Optional meta-data. */ public readonly metadata!: pulumi.Output; /** * The name of the role. */ public readonly name!: pulumi.Output; /** * A list of users that the owners of this role can impersonate. */ public readonly runAs!: pulumi.Output; /** * Create a ElasticsearchSecurityRole 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?: ElasticsearchSecurityRoleArgs, opts?: pulumi.CustomResourceOptions) constructor(name: string, argsOrState?: ElasticsearchSecurityRoleArgs | ElasticsearchSecurityRoleState, opts?: pulumi.CustomResourceOptions) { let resourceInputs: pulumi.Inputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState as ElasticsearchSecurityRoleState | undefined; resourceInputs["applications"] = state ? state.applications : undefined; resourceInputs["clusters"] = state ? state.clusters : undefined; resourceInputs["elasticsearchConnection"] = state ? state.elasticsearchConnection : undefined; resourceInputs["global"] = state ? state.global : undefined; resourceInputs["id"] = state ? state.id : undefined; resourceInputs["indices"] = state ? state.indices : undefined; resourceInputs["metadata"] = state ? state.metadata : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["runAs"] = state ? state.runAs : undefined; } else { const args = argsOrState as ElasticsearchSecurityRoleArgs | undefined; resourceInputs["applications"] = args ? args.applications : undefined; resourceInputs["clusters"] = args ? args.clusters : undefined; resourceInputs["elasticsearchConnection"] = args ? args.elasticsearchConnection : undefined; resourceInputs["global"] = args ? args.global : undefined; resourceInputs["indices"] = args ? args.indices : undefined; resourceInputs["metadata"] = args ? args.metadata : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["runAs"] = args ? args.runAs : undefined; resourceInputs["id"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ElasticsearchSecurityRole.__pulumiType, name, resourceInputs, opts); } } /** * Input properties used for looking up and filtering ElasticsearchSecurityRole resources. */ export interface ElasticsearchSecurityRoleState { /** * A list of application privilege entries. */ applications?: pulumi.Input[]>; /** * A list of cluster privileges. These privileges define the cluster level actions that users with this role are able to execute. */ clusters?: pulumi.Input[]>; /** * Used to establish connection to Elasticsearch server. Overrides environment variables if present. */ elasticsearchConnection?: pulumi.Input; /** * An object defining global privileges. */ global?: pulumi.Input; /** * Internal identifier of the resource */ id?: pulumi.Input; /** * A list of indices permissions entries. */ indices?: pulumi.Input[]>; /** * Optional meta-data. */ metadata?: pulumi.Input; /** * The name of the role. */ name?: pulumi.Input; /** * A list of users that the owners of this role can impersonate. */ runAs?: pulumi.Input[]>; } /** * The set of arguments for constructing a ElasticsearchSecurityRole resource. */ export interface ElasticsearchSecurityRoleArgs { /** * A list of application privilege entries. */ applications?: pulumi.Input[]>; /** * A list of cluster privileges. These privileges define the cluster level actions that users with this role are able to execute. */ clusters?: pulumi.Input[]>; /** * Used to establish connection to Elasticsearch server. Overrides environment variables if present. */ elasticsearchConnection?: pulumi.Input; /** * An object defining global privileges. */ global?: pulumi.Input; /** * A list of indices permissions entries. */ indices?: pulumi.Input[]>; /** * Optional meta-data. */ metadata?: pulumi.Input; /** * The name of the role. */ name?: pulumi.Input; /** * A list of users that the owners of this role can impersonate. */ runAs?: pulumi.Input[]>; }