
com.pulumi.vault.saml.kotlin.AuthBackendRole.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.saml.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.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
/**
* Builder for [AuthBackendRole].
*/
@PulumiTagMarker
public class AuthBackendRoleResourceBuilder internal constructor() {
public var name: String? = null
public var args: AuthBackendRoleArgs = AuthBackendRoleArgs()
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 AuthBackendRoleArgsBuilder.() -> Unit) {
val builder = AuthBackendRoleArgsBuilder()
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(): AuthBackendRole {
val builtJavaResource = com.pulumi.vault.saml.AuthBackendRole(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return AuthBackendRole(builtJavaResource)
}
}
/**
* Manages an SAML auth backend role in a Vault server. See the [Vault
* documentation](https://www.vaultproject.io/docs/auth/saml.html) for more
* information.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const example = new vault.saml.AuthBackend("example", {
* path: "saml",
* idpMetadataUrl: "https://company.okta.com/app/abc123eb9xnIfzlaf697/sso/saml/metadata",
* entityId: "https://my.vault/v1/auth/saml",
* acsUrls: ["https://my.vault.primary/v1/auth/saml/callback"],
* defaultRole: "default-role",
* });
* const exampleAuthBackendRole = new vault.saml.AuthBackendRole("example", {
* path: example.path,
* name: "my-role",
* groupsAttribute: "groups",
* boundAttributes: {
* group: "admin",
* },
* boundSubjects: ["*example.com"],
* tokenPolicies: ["writer"],
* tokenTtl: 86400,
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* example = vault.saml.AuthBackend("example",
* path="saml",
* idp_metadata_url="https://company.okta.com/app/abc123eb9xnIfzlaf697/sso/saml/metadata",
* entity_id="https://my.vault/v1/auth/saml",
* acs_urls=["https://my.vault.primary/v1/auth/saml/callback"],
* default_role="default-role")
* example_auth_backend_role = vault.saml.AuthBackendRole("example",
* path=example.path,
* name="my-role",
* groups_attribute="groups",
* bound_attributes={
* "group": "admin",
* },
* bound_subjects=["*example.com"],
* token_policies=["writer"],
* token_ttl=86400)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var example = new Vault.Saml.AuthBackend("example", new()
* {
* Path = "saml",
* IdpMetadataUrl = "https://company.okta.com/app/abc123eb9xnIfzlaf697/sso/saml/metadata",
* EntityId = "https://my.vault/v1/auth/saml",
* AcsUrls = new[]
* {
* "https://my.vault.primary/v1/auth/saml/callback",
* },
* DefaultRole = "default-role",
* });
* var exampleAuthBackendRole = new Vault.Saml.AuthBackendRole("example", new()
* {
* Path = example.Path,
* Name = "my-role",
* GroupsAttribute = "groups",
* BoundAttributes =
* {
* { "group", "admin" },
* },
* BoundSubjects = new[]
* {
* "*example.com",
* },
* TokenPolicies = new[]
* {
* "writer",
* },
* TokenTtl = 86400,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault/saml"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := saml.NewAuthBackend(ctx, "example", &saml.AuthBackendArgs{
* Path: pulumi.String("saml"),
* IdpMetadataUrl: pulumi.String("https://company.okta.com/app/abc123eb9xnIfzlaf697/sso/saml/metadata"),
* EntityId: pulumi.String("https://my.vault/v1/auth/saml"),
* AcsUrls: pulumi.StringArray{
* pulumi.String("https://my.vault.primary/v1/auth/saml/callback"),
* },
* DefaultRole: pulumi.String("default-role"),
* })
* if err != nil {
* return err
* }
* _, err = saml.NewAuthBackendRole(ctx, "example", &saml.AuthBackendRoleArgs{
* Path: example.Path,
* Name: pulumi.String("my-role"),
* GroupsAttribute: pulumi.String("groups"),
* BoundAttributes: pulumi.Map{
* "group": pulumi.Any("admin"),
* },
* BoundSubjects: pulumi.StringArray{
* pulumi.String("*example.com"),
* },
* TokenPolicies: pulumi.StringArray{
* pulumi.String("writer"),
* },
* TokenTtl: pulumi.Int(86400),
* })
* 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.saml.AuthBackend;
* import com.pulumi.vault.saml.AuthBackendArgs;
* import com.pulumi.vault.saml.AuthBackendRole;
* import com.pulumi.vault.saml.AuthBackendRoleArgs;
* 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("saml")
* .idpMetadataUrl("https://company.okta.com/app/abc123eb9xnIfzlaf697/sso/saml/metadata")
* .entityId("https://my.vault/v1/auth/saml")
* .acsUrls("https://my.vault.primary/v1/auth/saml/callback")
* .defaultRole("default-role")
* .build());
* var exampleAuthBackendRole = new AuthBackendRole("exampleAuthBackendRole", AuthBackendRoleArgs.builder()
* .path(example.path())
* .name("my-role")
* .groupsAttribute("groups")
* .boundAttributes(Map.of("group", "admin"))
* .boundSubjects("*example.com")
* .tokenPolicies("writer")
* .tokenTtl(86400)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: vault:saml:AuthBackend
* properties:
* path: saml
* idpMetadataUrl: https://company.okta.com/app/abc123eb9xnIfzlaf697/sso/saml/metadata
* entityId: https://my.vault/v1/auth/saml
* acsUrls:
* - https://my.vault.primary/v1/auth/saml/callback
* defaultRole: default-role
* exampleAuthBackendRole:
* type: vault:saml:AuthBackendRole
* name: example
* properties:
* path: ${example.path}
* name: my-role
* groupsAttribute: groups
* boundAttributes:
* group: admin
* boundSubjects:
* - '*example.com'
* tokenPolicies:
* - writer
* tokenTtl: 86400
* ```
*
* ## Import
* SAML authentication backend roles can be imported using the `path`, e.g.
* ```sh
* $ pulumi import vault:saml/authBackendRole:AuthBackendRole example auth/saml/role/my-role
* ```
*/
public class AuthBackendRole internal constructor(
override val javaResource: com.pulumi.vault.saml.AuthBackendRole,
) : KotlinCustomResource(javaResource, AuthBackendRoleMapper) {
/**
* Mapping of attribute names to values that are expected to
* exist in the SAML assertion.
*/
public val boundAttributes: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy