com.pulumi.vault.identity.kotlin.GroupMemberEntityIds.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-vault-kotlin Show documentation
Show all versions of pulumi-vault-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.vault.identity.kotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
/**
* Builder for [GroupMemberEntityIds].
*/
@PulumiTagMarker
public class GroupMemberEntityIdsResourceBuilder internal constructor() {
public var name: String? = null
public var args: GroupMemberEntityIdsArgs = GroupMemberEntityIdsArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend GroupMemberEntityIdsArgsBuilder.() -> Unit) {
val builder = GroupMemberEntityIdsArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): GroupMemberEntityIds {
val builtJavaResource = com.pulumi.vault.identity.GroupMemberEntityIds(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return GroupMemberEntityIds(builtJavaResource)
}
}
/**
* Manages member entities for an Identity Group for Vault. The [Identity secrets engine](https://www.vaultproject.io/docs/secrets/identity/index.html) is the identity management solution for Vault.
* ## Example Usage
* ### Exclusive Member Entities
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const internal = new vault.identity.Group("internal", {
* name: "internal",
* type: "internal",
* externalMemberEntityIds: true,
* metadata: {
* version: "2",
* },
* });
* const user = new vault.identity.Entity("user", {name: "user"});
* const members = new vault.identity.GroupMemberEntityIds("members", {
* exclusive: true,
* memberEntityIds: [user.id],
* groupId: internal.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* internal = vault.identity.Group("internal",
* name="internal",
* type="internal",
* external_member_entity_ids=True,
* metadata={
* "version": "2",
* })
* user = vault.identity.Entity("user", name="user")
* members = vault.identity.GroupMemberEntityIds("members",
* exclusive=True,
* member_entity_ids=[user.id],
* group_id=internal.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var @internal = new Vault.Identity.Group("internal", new()
* {
* Name = "internal",
* Type = "internal",
* ExternalMemberEntityIds = true,
* Metadata =
* {
* { "version", "2" },
* },
* });
* var user = new Vault.Identity.Entity("user", new()
* {
* Name = "user",
* });
* var members = new Vault.Identity.GroupMemberEntityIds("members", new()
* {
* Exclusive = true,
* MemberEntityIds = new[]
* {
* user.Id,
* },
* GroupId = @internal.Id,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault/identity"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* internal, err := identity.NewGroup(ctx, "internal", &identity.GroupArgs{
* Name: pulumi.String("internal"),
* Type: pulumi.String("internal"),
* ExternalMemberEntityIds: pulumi.Bool(true),
* Metadata: pulumi.StringMap{
* "version": pulumi.String("2"),
* },
* })
* if err != nil {
* return err
* }
* user, err := identity.NewEntity(ctx, "user", &identity.EntityArgs{
* Name: pulumi.String("user"),
* })
* if err != nil {
* return err
* }
* _, err = identity.NewGroupMemberEntityIds(ctx, "members", &identity.GroupMemberEntityIdsArgs{
* Exclusive: pulumi.Bool(true),
* MemberEntityIds: pulumi.StringArray{
* user.ID(),
* },
* GroupId: internal.ID(),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.vault.identity.Group;
* import com.pulumi.vault.identity.GroupArgs;
* import com.pulumi.vault.identity.Entity;
* import com.pulumi.vault.identity.EntityArgs;
* import com.pulumi.vault.identity.GroupMemberEntityIds;
* import com.pulumi.vault.identity.GroupMemberEntityIdsArgs;
* 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 internal = new Group("internal", GroupArgs.builder()
* .name("internal")
* .type("internal")
* .externalMemberEntityIds(true)
* .metadata(Map.of("version", "2"))
* .build());
* var user = new Entity("user", EntityArgs.builder()
* .name("user")
* .build());
* var members = new GroupMemberEntityIds("members", GroupMemberEntityIdsArgs.builder()
* .exclusive(true)
* .memberEntityIds(user.id())
* .groupId(internal.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* internal:
* type: vault:identity:Group
* properties:
* name: internal
* type: internal
* externalMemberEntityIds: true
* metadata:
* version: '2'
* user:
* type: vault:identity:Entity
* properties:
* name: user
* members:
* type: vault:identity:GroupMemberEntityIds
* properties:
* exclusive: true
* memberEntityIds:
* - ${user.id}
* groupId: ${internal.id}
* ```
*
* ### Non-exclusive Member Entities
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const internal = new vault.identity.Group("internal", {
* name: "internal",
* type: "internal",
* externalMemberEntityIds: true,
* metadata: {
* version: "2",
* },
* });
* const testUser = new vault.identity.Entity("test_user", {name: "test"});
* const secondTestUser = new vault.identity.Entity("second_test_user", {name: "second_test"});
* const devUser = new vault.identity.Entity("dev_user", {name: "dev"});
* const test = new vault.identity.GroupMemberEntityIds("test", {
* memberEntityIds: [
* testUser.id,
* secondTestUser.id,
* ],
* exclusive: false,
* groupId: internal.id,
* });
* const others = new vault.identity.GroupMemberEntityIds("others", {
* memberEntityIds: [devUser.id],
* exclusive: false,
* groupId: internal.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* internal = vault.identity.Group("internal",
* name="internal",
* type="internal",
* external_member_entity_ids=True,
* metadata={
* "version": "2",
* })
* test_user = vault.identity.Entity("test_user", name="test")
* second_test_user = vault.identity.Entity("second_test_user", name="second_test")
* dev_user = vault.identity.Entity("dev_user", name="dev")
* test = vault.identity.GroupMemberEntityIds("test",
* member_entity_ids=[
* test_user.id,
* second_test_user.id,
* ],
* exclusive=False,
* group_id=internal.id)
* others = vault.identity.GroupMemberEntityIds("others",
* member_entity_ids=[dev_user.id],
* exclusive=False,
* group_id=internal.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var @internal = new Vault.Identity.Group("internal", new()
* {
* Name = "internal",
* Type = "internal",
* ExternalMemberEntityIds = true,
* Metadata =
* {
* { "version", "2" },
* },
* });
* var testUser = new Vault.Identity.Entity("test_user", new()
* {
* Name = "test",
* });
* var secondTestUser = new Vault.Identity.Entity("second_test_user", new()
* {
* Name = "second_test",
* });
* var devUser = new Vault.Identity.Entity("dev_user", new()
* {
* Name = "dev",
* });
* var test = new Vault.Identity.GroupMemberEntityIds("test", new()
* {
* MemberEntityIds = new[]
* {
* testUser.Id,
* secondTestUser.Id,
* },
* Exclusive = false,
* GroupId = @internal.Id,
* });
* var others = new Vault.Identity.GroupMemberEntityIds("others", new()
* {
* MemberEntityIds = new[]
* {
* devUser.Id,
* },
* Exclusive = false,
* GroupId = @internal.Id,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault/identity"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* internal, err := identity.NewGroup(ctx, "internal", &identity.GroupArgs{
* Name: pulumi.String("internal"),
* Type: pulumi.String("internal"),
* ExternalMemberEntityIds: pulumi.Bool(true),
* Metadata: pulumi.StringMap{
* "version": pulumi.String("2"),
* },
* })
* if err != nil {
* return err
* }
* testUser, err := identity.NewEntity(ctx, "test_user", &identity.EntityArgs{
* Name: pulumi.String("test"),
* })
* if err != nil {
* return err
* }
* secondTestUser, err := identity.NewEntity(ctx, "second_test_user", &identity.EntityArgs{
* Name: pulumi.String("second_test"),
* })
* if err != nil {
* return err
* }
* devUser, err := identity.NewEntity(ctx, "dev_user", &identity.EntityArgs{
* Name: pulumi.String("dev"),
* })
* if err != nil {
* return err
* }
* _, err = identity.NewGroupMemberEntityIds(ctx, "test", &identity.GroupMemberEntityIdsArgs{
* MemberEntityIds: pulumi.StringArray{
* testUser.ID(),
* secondTestUser.ID(),
* },
* Exclusive: pulumi.Bool(false),
* GroupId: internal.ID(),
* })
* if err != nil {
* return err
* }
* _, err = identity.NewGroupMemberEntityIds(ctx, "others", &identity.GroupMemberEntityIdsArgs{
* MemberEntityIds: pulumi.StringArray{
* devUser.ID(),
* },
* Exclusive: pulumi.Bool(false),
* GroupId: internal.ID(),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.vault.identity.Group;
* import com.pulumi.vault.identity.GroupArgs;
* import com.pulumi.vault.identity.Entity;
* import com.pulumi.vault.identity.EntityArgs;
* import com.pulumi.vault.identity.GroupMemberEntityIds;
* import com.pulumi.vault.identity.GroupMemberEntityIdsArgs;
* 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 internal = new Group("internal", GroupArgs.builder()
* .name("internal")
* .type("internal")
* .externalMemberEntityIds(true)
* .metadata(Map.of("version", "2"))
* .build());
* var testUser = new Entity("testUser", EntityArgs.builder()
* .name("test")
* .build());
* var secondTestUser = new Entity("secondTestUser", EntityArgs.builder()
* .name("second_test")
* .build());
* var devUser = new Entity("devUser", EntityArgs.builder()
* .name("dev")
* .build());
* var test = new GroupMemberEntityIds("test", GroupMemberEntityIdsArgs.builder()
* .memberEntityIds(
* testUser.id(),
* secondTestUser.id())
* .exclusive(false)
* .groupId(internal.id())
* .build());
* var others = new GroupMemberEntityIds("others", GroupMemberEntityIdsArgs.builder()
* .memberEntityIds(devUser.id())
* .exclusive(false)
* .groupId(internal.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* internal:
* type: vault:identity:Group
* properties:
* name: internal
* type: internal
* externalMemberEntityIds: true
* metadata:
* version: '2'
* testUser:
* type: vault:identity:Entity
* name: test_user
* properties:
* name: test
* secondTestUser:
* type: vault:identity:Entity
* name: second_test_user
* properties:
* name: second_test
* devUser:
* type: vault:identity:Entity
* name: dev_user
* properties:
* name: dev
* test:
* type: vault:identity:GroupMemberEntityIds
* properties:
* memberEntityIds:
* - ${testUser.id}
* - ${secondTestUser.id}
* exclusive: false
* groupId: ${internal.id}
* others:
* type: vault:identity:GroupMemberEntityIds
* properties:
* memberEntityIds:
* - ${devUser.id}
* exclusive: false
* groupId: ${internal.id}
* ```
*
*/
public class GroupMemberEntityIds internal constructor(
override val javaResource: com.pulumi.vault.identity.GroupMemberEntityIds,
) : KotlinCustomResource(javaResource, GroupMemberEntityIdsMapper) {
/**
* Defaults to `true`.
* If `true`, this resource will take exclusive control of the member entities that belong to the group and will set it equal to what is specified in the resource.
* If set to `false`, this resource will simply ensure that the member entities specified in the resource are present in the group. When destroying the resource, the resource will ensure that the member entities specified in the resource are removed.
*/
public val exclusive: Output?
get() = javaResource.exclusive().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Group ID to assign member entities to.
*/
public val groupId: Output
get() = javaResource.groupId().applyValue({ args0 -> args0 })
/**
* List of member entities that belong to the group
*/
public val memberEntityIds: Output>?
get() = javaResource.memberEntityIds().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* The namespace to provision the resource in.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
* *Available only for Vault Enterprise*.
*/
public val namespace: Output?
get() = javaResource.namespace().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}
public object GroupMemberEntityIdsMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.vault.identity.GroupMemberEntityIds::class == javaResource::class
override fun map(javaResource: Resource): GroupMemberEntityIds = GroupMemberEntityIds(
javaResource
as com.pulumi.vault.identity.GroupMemberEntityIds,
)
}
/**
* @see [GroupMemberEntityIds].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [GroupMemberEntityIds].
*/
public suspend fun groupMemberEntityIds(
name: String,
block: suspend GroupMemberEntityIdsResourceBuilder.() -> Unit,
): GroupMemberEntityIds {
val builder = GroupMemberEntityIdsResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [GroupMemberEntityIds].
* @param name The _unique_ name of the resulting resource.
*/
public fun groupMemberEntityIds(name: String): GroupMemberEntityIds {
val builder = GroupMemberEntityIdsResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy