com.pulumi.vault.identity.kotlin.OidcScope.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
/**
* Builder for [OidcScope].
*/
@PulumiTagMarker
public class OidcScopeResourceBuilder internal constructor() {
public var name: String? = null
public var args: OidcScopeArgs = OidcScopeArgs()
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 OidcScopeArgsBuilder.() -> Unit) {
val builder = OidcScopeArgsBuilder()
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(): OidcScope {
val builtJavaResource = com.pulumi.vault.identity.OidcScope(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return OidcScope(builtJavaResource)
}
}
/**
* Manages OIDC Scopes in a Vault server. See the [Vault documentation](https://www.vaultproject.io/api-docs/secret/identity/oidc-provider#create-or-update-a-scope)
* for more information.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const groups = new vault.identity.OidcScope("groups", {
* name: "groups",
* template: "{\"groups\":{{identity.entity.groups.names}}}",
* description: "Vault OIDC Groups Scope",
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* groups = vault.identity.OidcScope("groups",
* name="groups",
* template="{\"groups\":{{identity.entity.groups.names}}}",
* description="Vault OIDC Groups Scope")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var groups = new Vault.Identity.OidcScope("groups", new()
* {
* Name = "groups",
* Template = "{\"groups\":{{identity.entity.groups.names}}}",
* Description = "Vault OIDC Groups Scope",
* });
* });
* ```
* ```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 {
* _, err := identity.NewOidcScope(ctx, "groups", &identity.OidcScopeArgs{
* Name: pulumi.String("groups"),
* Template: pulumi.String("{\"groups\":{{identity.entity.groups.names}}}"),
* Description: pulumi.String("Vault OIDC Groups Scope"),
* })
* 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.OidcScope;
* import com.pulumi.vault.identity.OidcScopeArgs;
* 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 groups = new OidcScope("groups", OidcScopeArgs.builder()
* .name("groups")
* .template("{\"groups\":{{identity.entity.groups.names}}}")
* .description("Vault OIDC Groups Scope")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* groups:
* type: vault:identity:OidcScope
* properties:
* name: groups
* template: '{"groups":{{identity.entity.groups.names}}}'
* description: Vault OIDC Groups Scope
* ```
*
* ## Import
* OIDC Scopes can be imported using the `name`, e.g.
* ```sh
* $ pulumi import vault:identity/oidcScope:OidcScope groups groups
* ```
*/
public class OidcScope internal constructor(
override val javaResource: com.pulumi.vault.identity.OidcScope,
) : KotlinCustomResource(javaResource, OidcScopeMapper) {
/**
* A description of the scope.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the scope. The `openid` scope name is reserved.
*/
public val name: Output
get() = javaResource.name().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 template string for the scope. This may be provided as escaped JSON or base64 encoded JSON.
*/
public val template: Output?
get() = javaResource.template().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}
public object OidcScopeMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.vault.identity.OidcScope::class == javaResource::class
override fun map(javaResource: Resource): OidcScope = OidcScope(
javaResource as
com.pulumi.vault.identity.OidcScope,
)
}
/**
* @see [OidcScope].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [OidcScope].
*/
public suspend fun oidcScope(name: String, block: suspend OidcScopeResourceBuilder.() -> Unit): OidcScope {
val builder = OidcScopeResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [OidcScope].
* @param name The _unique_ name of the resulting resource.
*/
public fun oidcScope(name: String): OidcScope {
val builder = OidcScopeResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy