com.pulumi.vault.secrets.kotlin.SyncGcpDestination.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.secrets.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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
/**
* Builder for [SyncGcpDestination].
*/
@PulumiTagMarker
public class SyncGcpDestinationResourceBuilder internal constructor() {
public var name: String? = null
public var args: SyncGcpDestinationArgs = SyncGcpDestinationArgs()
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 SyncGcpDestinationArgsBuilder.() -> Unit) {
val builder = SyncGcpDestinationArgsBuilder()
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(): SyncGcpDestination {
val builtJavaResource = com.pulumi.vault.secrets.SyncGcpDestination(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return SyncGcpDestination(builtJavaResource)
}
}
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as std from "@pulumi/std";
* import * as vault from "@pulumi/vault";
* const gcp = new vault.secrets.SyncGcpDestination("gcp", {
* name: "gcp-dest",
* projectId: "gcp-project-id",
* credentials: std.file({
* input: credentialsFile,
* }).then(invoke => invoke.result),
* secretNameTemplate: "vault_{{ .MountAccessor | lowercase }}_{{ .SecretPath | lowercase }}",
* customTags: {
* foo: "bar",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_std as std
* import pulumi_vault as vault
* gcp = vault.secrets.SyncGcpDestination("gcp",
* name="gcp-dest",
* project_id="gcp-project-id",
* credentials=std.file(input=credentials_file).result,
* secret_name_template="vault_{{ .MountAccessor | lowercase }}_{{ .SecretPath | lowercase }}",
* custom_tags={
* "foo": "bar",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Std = Pulumi.Std;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var gcp = new Vault.Secrets.SyncGcpDestination("gcp", new()
* {
* Name = "gcp-dest",
* ProjectId = "gcp-project-id",
* Credentials = Std.File.Invoke(new()
* {
* Input = credentialsFile,
* }).Apply(invoke => invoke.Result),
* SecretNameTemplate = "vault_{{ .MountAccessor | lowercase }}_{{ .SecretPath | lowercase }}",
* CustomTags =
* {
* { "foo", "bar" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-std/sdk/go/std"
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault/secrets"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* invokeFile, err := std.File(ctx, &std.FileArgs{
* Input: credentialsFile,
* }, nil)
* if err != nil {
* return err
* }
* _, err = secrets.NewSyncGcpDestination(ctx, "gcp", &secrets.SyncGcpDestinationArgs{
* Name: pulumi.String("gcp-dest"),
* ProjectId: pulumi.String("gcp-project-id"),
* Credentials: pulumi.String(invokeFile.Result),
* SecretNameTemplate: pulumi.String("vault_{{ .MountAccessor | lowercase }}_{{ .SecretPath | lowercase }}"),
* CustomTags: pulumi.Map{
* "foo": pulumi.Any("bar"),
* },
* })
* 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.secrets.SyncGcpDestination;
* import com.pulumi.vault.secrets.SyncGcpDestinationArgs;
* 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 gcp = new SyncGcpDestination("gcp", SyncGcpDestinationArgs.builder()
* .name("gcp-dest")
* .projectId("gcp-project-id")
* .credentials(StdFunctions.file(FileArgs.builder()
* .input(credentialsFile)
* .build()).result())
* .secretNameTemplate("vault_{{ .MountAccessor | lowercase }}_{{ .SecretPath | lowercase }}")
* .customTags(Map.of("foo", "bar"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* gcp:
* type: vault:secrets:SyncGcpDestination
* properties:
* name: gcp-dest
* projectId: gcp-project-id
* credentials:
* fn::invoke:
* Function: std:file
* Arguments:
* input: ${credentialsFile}
* Return: result
* secretNameTemplate: vault_{{ .MountAccessor | lowercase }}_{{ .SecretPath | lowercase }}
* customTags:
* foo: bar
* ```
*
* ## Import
* GCP Secrets sync destinations can be imported using the `name`, e.g.
* ```sh
* $ pulumi import vault:secrets/syncGcpDestination:SyncGcpDestination gcp gcp-dest
* ```
*/
public class SyncGcpDestination internal constructor(
override val javaResource: com.pulumi.vault.secrets.SyncGcpDestination,
) : KotlinCustomResource(javaResource, SyncGcpDestinationMapper) {
/**
* JSON-encoded credentials to use to connect to GCP.
* Can be omitted and directly provided to Vault using the `GOOGLE_APPLICATION_CREDENTIALS` environment
* variable.
*/
public val credentials: Output?
get() = javaResource.credentials().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Custom tags to set on the secret managed at the destination.
*/
public val customTags: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy