All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.vault.okta.kotlin.AuthBackendGroup.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.4.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.vault.okta.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 [AuthBackendGroup].
 */
@PulumiTagMarker
public class AuthBackendGroupResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: AuthBackendGroupArgs = AuthBackendGroupArgs()

    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 AuthBackendGroupArgsBuilder.() -> Unit) {
        val builder = AuthBackendGroupArgsBuilder()
        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(): AuthBackendGroup {
        val builtJavaResource = com.pulumi.vault.okta.AuthBackendGroup(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return AuthBackendGroup(builtJavaResource)
    }
}

/**
 * Provides a resource to create a group in an
 * [Okta auth backend within Vault](https://www.vaultproject.io/docs/auth/okta.html).
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as vault from "@pulumi/vault";
 * const example = new vault.okta.AuthBackend("example", {
 *     path: "group_okta",
 *     organization: "dummy",
 * });
 * const foo = new vault.okta.AuthBackendGroup("foo", {
 *     path: example.path,
 *     groupName: "foo",
 *     policies: [
 *         "one",
 *         "two",
 *     ],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_vault as vault
 * example = vault.okta.AuthBackend("example",
 *     path="group_okta",
 *     organization="dummy")
 * foo = vault.okta.AuthBackendGroup("foo",
 *     path=example.path,
 *     group_name="foo",
 *     policies=[
 *         "one",
 *         "two",
 *     ])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Vault = Pulumi.Vault;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Vault.Okta.AuthBackend("example", new()
 *     {
 *         Path = "group_okta",
 *         Organization = "dummy",
 *     });
 *     var foo = new Vault.Okta.AuthBackendGroup("foo", new()
 *     {
 *         Path = example.Path,
 *         GroupName = "foo",
 *         Policies = new[]
 *         {
 *             "one",
 *             "two",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/okta"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := okta.NewAuthBackend(ctx, "example", &okta.AuthBackendArgs{
 * 			Path:         pulumi.String("group_okta"),
 * 			Organization: pulumi.String("dummy"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = okta.NewAuthBackendGroup(ctx, "foo", &okta.AuthBackendGroupArgs{
 * 			Path:      example.Path,
 * 			GroupName: pulumi.String("foo"),
 * 			Policies: pulumi.StringArray{
 * 				pulumi.String("one"),
 * 				pulumi.String("two"),
 * 			},
 * 		})
 * 		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.okta.AuthBackend;
 * import com.pulumi.vault.okta.AuthBackendArgs;
 * import com.pulumi.vault.okta.AuthBackendGroup;
 * import com.pulumi.vault.okta.AuthBackendGroupArgs;
 * 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 example = new AuthBackend("example", AuthBackendArgs.builder()
 *             .path("group_okta")
 *             .organization("dummy")
 *             .build());
 *         var foo = new AuthBackendGroup("foo", AuthBackendGroupArgs.builder()
 *             .path(example.path())
 *             .groupName("foo")
 *             .policies(
 *                 "one",
 *                 "two")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: vault:okta:AuthBackend
 *     properties:
 *       path: group_okta
 *       organization: dummy
 *   foo:
 *     type: vault:okta:AuthBackendGroup
 *     properties:
 *       path: ${example.path}
 *       groupName: foo
 *       policies:
 *         - one
 *         - two
 * ```
 * 
 * ## Import
 * Okta authentication backend groups can be imported using the format `backend/groupName` e.g.
 * ```sh
 * $ pulumi import vault:okta/authBackendGroup:AuthBackendGroup foo okta/foo
 * ```
 */
public class AuthBackendGroup internal constructor(
    override val javaResource: com.pulumi.vault.okta.AuthBackendGroup,
) : KotlinCustomResource(javaResource, AuthBackendGroupMapper) {
    /**
     * Name of the group within the Okta
     */
    public val groupName: Output
        get() = javaResource.groupName().applyValue({ args0 -> args0 })

    /**
     * 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) })

    /**
     * The path where the Okta auth backend is mounted
     */
    public val path: Output
        get() = javaResource.path().applyValue({ args0 -> args0 })

    /**
     * Vault policies to associate with this group
     */
    public val policies: Output>?
        get() = javaResource.policies().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })
}

public object AuthBackendGroupMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.vault.okta.AuthBackendGroup::class == javaResource::class

    override fun map(javaResource: Resource): AuthBackendGroup = AuthBackendGroup(
        javaResource as
            com.pulumi.vault.okta.AuthBackendGroup,
    )
}

/**
 * @see [AuthBackendGroup].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [AuthBackendGroup].
 */
public suspend fun authBackendGroup(
    name: String,
    block: suspend AuthBackendGroupResourceBuilder.() -> Unit,
): AuthBackendGroup {
    val builder = AuthBackendGroupResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [AuthBackendGroup].
 * @param name The _unique_ name of the resulting resource.
 */
public fun authBackendGroup(name: String): AuthBackendGroup {
    val builder = AuthBackendGroupResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy