
com.pulumi.vault.secrets.kotlin.SyncAwsDestination.kt Maven / Gradle / Ivy
@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 [SyncAwsDestination].
*/
@PulumiTagMarker
public class SyncAwsDestinationResourceBuilder internal constructor() {
public var name: String? = null
public var args: SyncAwsDestinationArgs = SyncAwsDestinationArgs()
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 SyncAwsDestinationArgsBuilder.() -> Unit) {
val builder = SyncAwsDestinationArgsBuilder()
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(): SyncAwsDestination {
val builtJavaResource = com.pulumi.vault.secrets.SyncAwsDestination(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return SyncAwsDestination(builtJavaResource)
}
}
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const aws = new vault.secrets.SyncAwsDestination("aws", {
* name: "aws-dest",
* accessKeyId: accessKeyId,
* secretAccessKey: secretAccessKey,
* region: "us-east-1",
* roleArn: "role-arn",
* externalId: "external-id",
* secretNameTemplate: "vault_{{ .MountAccessor | lowercase }}_{{ .SecretPath | lowercase }}",
* customTags: {
* foo: "bar",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* aws = vault.secrets.SyncAwsDestination("aws",
* name="aws-dest",
* access_key_id=access_key_id,
* secret_access_key=secret_access_key,
* region="us-east-1",
* role_arn="role-arn",
* external_id="external-id",
* secret_name_template="vault_{{ .MountAccessor | lowercase }}_{{ .SecretPath | lowercase }}",
* custom_tags={
* "foo": "bar",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var aws = new Vault.Secrets.SyncAwsDestination("aws", new()
* {
* Name = "aws-dest",
* AccessKeyId = accessKeyId,
* SecretAccessKey = secretAccessKey,
* Region = "us-east-1",
* RoleArn = "role-arn",
* ExternalId = "external-id",
* SecretNameTemplate = "vault_{{ .MountAccessor | lowercase }}_{{ .SecretPath | lowercase }}",
* CustomTags =
* {
* { "foo", "bar" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "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 {
* _, err := secrets.NewSyncAwsDestination(ctx, "aws", &secrets.SyncAwsDestinationArgs{
* Name: pulumi.String("aws-dest"),
* AccessKeyId: pulumi.Any(accessKeyId),
* SecretAccessKey: pulumi.Any(secretAccessKey),
* Region: pulumi.String("us-east-1"),
* RoleArn: pulumi.String("role-arn"),
* ExternalId: pulumi.String("external-id"),
* 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.SyncAwsDestination;
* import com.pulumi.vault.secrets.SyncAwsDestinationArgs;
* 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 aws = new SyncAwsDestination("aws", SyncAwsDestinationArgs.builder()
* .name("aws-dest")
* .accessKeyId(accessKeyId)
* .secretAccessKey(secretAccessKey)
* .region("us-east-1")
* .roleArn("role-arn")
* .externalId("external-id")
* .secretNameTemplate("vault_{{ .MountAccessor | lowercase }}_{{ .SecretPath | lowercase }}")
* .customTags(Map.of("foo", "bar"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* aws:
* type: vault:secrets:SyncAwsDestination
* properties:
* name: aws-dest
* accessKeyId: ${accessKeyId}
* secretAccessKey: ${secretAccessKey}
* region: us-east-1
* roleArn: role-arn
* externalId: external-id
* secretNameTemplate: vault_{{ .MountAccessor | lowercase }}_{{ .SecretPath | lowercase }}
* customTags:
* foo: bar
* ```
*
* ## Import
* AWS Secrets sync destinations can be imported using the `name`, e.g.
* ```sh
* $ pulumi import vault:secrets/syncAwsDestination:SyncAwsDestination aws aws-dest
* ```
*/
public class SyncAwsDestination internal constructor(
override val javaResource: com.pulumi.vault.secrets.SyncAwsDestination,
) : KotlinCustomResource(javaResource, SyncAwsDestinationMapper) {
/**
* Access key id to authenticate against the AWS secrets manager.
* Can be omitted and directly provided to Vault using the `AWS_ACCESS_KEY_ID` environment
* variable.
*/
public val accessKeyId: Output?
get() = javaResource.accessKeyId().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