com.pulumi.vault.terraformcloud.kotlin.SecretBackend.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.terraformcloud.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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [SecretBackend].
*/
@PulumiTagMarker
public class SecretBackendResourceBuilder internal constructor() {
public var name: String? = null
public var args: SecretBackendArgs = SecretBackendArgs()
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 SecretBackendArgsBuilder.() -> Unit) {
val builder = SecretBackendArgsBuilder()
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(): SecretBackend {
val builtJavaResource = com.pulumi.vault.terraformcloud.SecretBackend(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return SecretBackend(builtJavaResource)
}
}
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const test = new vault.terraformcloud.SecretBackend("test", {
* backend: "terraform",
* description: "Manages the Terraform Cloud backend",
* token: "V0idfhi2iksSDU234ucdbi2nidsi...",
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* test = vault.terraformcloud.SecretBackend("test",
* backend="terraform",
* description="Manages the Terraform Cloud backend",
* token="V0idfhi2iksSDU234ucdbi2nidsi...")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var test = new Vault.TerraformCloud.SecretBackend("test", new()
* {
* Backend = "terraform",
* Description = "Manages the Terraform Cloud backend",
* Token = "V0idfhi2iksSDU234ucdbi2nidsi...",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault/terraformcloud"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := terraformcloud.NewSecretBackend(ctx, "test", &terraformcloud.SecretBackendArgs{
* Backend: pulumi.String("terraform"),
* Description: pulumi.String("Manages the Terraform Cloud backend"),
* Token: pulumi.String("V0idfhi2iksSDU234ucdbi2nidsi..."),
* })
* 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.terraformcloud.SecretBackend;
* import com.pulumi.vault.terraformcloud.SecretBackendArgs;
* 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 test = new SecretBackend("test", SecretBackendArgs.builder()
* .backend("terraform")
* .description("Manages the Terraform Cloud backend")
* .token("V0idfhi2iksSDU234ucdbi2nidsi...")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* test:
* type: vault:terraformcloud:SecretBackend
* properties:
* backend: terraform
* description: Manages the Terraform Cloud backend
* token: V0idfhi2iksSDU234ucdbi2nidsi...
* ```
*
* ## Import
* Terraform Cloud secret backends can be imported using the `backend`, e.g.
* ```sh
* $ pulumi import vault:terraformcloud/secretBackend:SecretBackend example terraform
* ```
*/
public class SecretBackend internal constructor(
override val javaResource: com.pulumi.vault.terraformcloud.SecretBackend,
) : KotlinCustomResource(javaResource, SecretBackendMapper) {
public val address: Output?
get() = javaResource.address().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
public val backend: Output?
get() = javaResource.backend().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
public val basePath: Output?
get() = javaResource.basePath().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The default TTL for credentials issued by this backend.
*/
public val defaultLeaseTtlSeconds: Output?
get() = javaResource.defaultLeaseTtlSeconds().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* A human-friendly description for this backend.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* If set, opts out of mount migration on path updates.
* See here for more info on [Mount Migration](https://www.vaultproject.io/docs/concepts/mount-migration)
*/
public val disableRemount: Output?
get() = javaResource.disableRemount().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The maximum TTL that can be requested
* for credentials issued by this backend.
*/
public val maxLeaseTtlSeconds: Output?
get() = javaResource.maxLeaseTtlSeconds().applyValue({ 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.
* *Available only for Vault Enterprise*.
*/
public val namespace: Output?
get() = javaResource.namespace().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
public val token: Output?
get() = javaResource.token().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}
public object SecretBackendMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.vault.terraformcloud.SecretBackend::class == javaResource::class
override fun map(javaResource: Resource): SecretBackend = SecretBackend(
javaResource as
com.pulumi.vault.terraformcloud.SecretBackend,
)
}
/**
* @see [SecretBackend].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [SecretBackend].
*/
public suspend fun secretBackend(
name: String,
block: suspend SecretBackendResourceBuilder.() -> Unit,
): SecretBackend {
val builder = SecretBackendResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [SecretBackend].
* @param name The _unique_ name of the resulting resource.
*/
public fun secretBackend(name: String): SecretBackend {
val builder = SecretBackendResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy