com.pulumi.gcp.dataform.kotlin.Repository.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-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.gcp.dataform.kotlin
import com.pulumi.core.Output
import com.pulumi.gcp.dataform.kotlin.outputs.RepositoryGitRemoteSettings
import com.pulumi.gcp.dataform.kotlin.outputs.RepositoryWorkspaceCompilationOverrides
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
import kotlin.collections.Map
import com.pulumi.gcp.dataform.kotlin.outputs.RepositoryGitRemoteSettings.Companion.toKotlin as repositoryGitRemoteSettingsToKotlin
import com.pulumi.gcp.dataform.kotlin.outputs.RepositoryWorkspaceCompilationOverrides.Companion.toKotlin as repositoryWorkspaceCompilationOverridesToKotlin
/**
* Builder for [Repository].
*/
@PulumiTagMarker
public class RepositoryResourceBuilder internal constructor() {
public var name: String? = null
public var args: RepositoryArgs = RepositoryArgs()
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 RepositoryArgsBuilder.() -> Unit) {
val builder = RepositoryArgsBuilder()
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(): Repository {
val builtJavaResource = com.pulumi.gcp.dataform.Repository(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Repository(builtJavaResource)
}
}
/**
* ## Example Usage
* ### Dataform Repository
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const secret = new gcp.secretmanager.Secret("secret", {
* secretId: "my-secret",
* replication: {
* auto: {},
* },
* });
* const secretVersion = new gcp.secretmanager.SecretVersion("secret_version", {
* secret: secret.id,
* secretData: "secret-data",
* });
* const dataformRepository = new gcp.dataform.Repository("dataform_repository", {
* name: "dataform_repository",
* displayName: "dataform_repository",
* npmrcEnvironmentVariablesSecretVersion: secretVersion.id,
* labels: {
* label_foo1: "label-bar1",
* },
* gitRemoteSettings: {
* url: "https://github.com/OWNER/REPOSITORY.git",
* defaultBranch: "main",
* authenticationTokenSecretVersion: secretVersion.id,
* },
* workspaceCompilationOverrides: {
* defaultDatabase: "database",
* schemaSuffix: "_suffix",
* tablePrefix: "prefix_",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* secret = gcp.secretmanager.Secret("secret",
* secret_id="my-secret",
* replication=gcp.secretmanager.SecretReplicationArgs(
* auto=gcp.secretmanager.SecretReplicationAutoArgs(),
* ))
* secret_version = gcp.secretmanager.SecretVersion("secret_version",
* secret=secret.id,
* secret_data="secret-data")
* dataform_repository = gcp.dataform.Repository("dataform_repository",
* name="dataform_repository",
* display_name="dataform_repository",
* npmrc_environment_variables_secret_version=secret_version.id,
* labels={
* "label_foo1": "label-bar1",
* },
* git_remote_settings=gcp.dataform.RepositoryGitRemoteSettingsArgs(
* url="https://github.com/OWNER/REPOSITORY.git",
* default_branch="main",
* authentication_token_secret_version=secret_version.id,
* ),
* workspace_compilation_overrides=gcp.dataform.RepositoryWorkspaceCompilationOverridesArgs(
* default_database="database",
* schema_suffix="_suffix",
* table_prefix="prefix_",
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var secret = new Gcp.SecretManager.Secret("secret", new()
* {
* SecretId = "my-secret",
* Replication = new Gcp.SecretManager.Inputs.SecretReplicationArgs
* {
* Auto = null,
* },
* });
* var secretVersion = new Gcp.SecretManager.SecretVersion("secret_version", new()
* {
* Secret = secret.Id,
* SecretData = "secret-data",
* });
* var dataformRepository = new Gcp.Dataform.Repository("dataform_repository", new()
* {
* Name = "dataform_repository",
* DisplayName = "dataform_repository",
* NpmrcEnvironmentVariablesSecretVersion = secretVersion.Id,
* Labels =
* {
* { "label_foo1", "label-bar1" },
* },
* GitRemoteSettings = new Gcp.Dataform.Inputs.RepositoryGitRemoteSettingsArgs
* {
* Url = "https://github.com/OWNER/REPOSITORY.git",
* DefaultBranch = "main",
* AuthenticationTokenSecretVersion = secretVersion.Id,
* },
* WorkspaceCompilationOverrides = new Gcp.Dataform.Inputs.RepositoryWorkspaceCompilationOverridesArgs
* {
* DefaultDatabase = "database",
* SchemaSuffix = "_suffix",
* TablePrefix = "prefix_",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/dataform"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/secretmanager"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* secret, err := secretmanager.NewSecret(ctx, "secret", &secretmanager.SecretArgs{
* SecretId: pulumi.String("my-secret"),
* Replication: &secretmanager.SecretReplicationArgs{
* Auto: nil,
* },
* })
* if err != nil {
* return err
* }
* secretVersion, err := secretmanager.NewSecretVersion(ctx, "secret_version", &secretmanager.SecretVersionArgs{
* Secret: secret.ID(),
* SecretData: pulumi.String("secret-data"),
* })
* if err != nil {
* return err
* }
* _, err = dataform.NewRepository(ctx, "dataform_repository", &dataform.RepositoryArgs{
* Name: pulumi.String("dataform_repository"),
* DisplayName: pulumi.String("dataform_repository"),
* NpmrcEnvironmentVariablesSecretVersion: secretVersion.ID(),
* Labels: pulumi.StringMap{
* "label_foo1": pulumi.String("label-bar1"),
* },
* GitRemoteSettings: &dataform.RepositoryGitRemoteSettingsArgs{
* Url: pulumi.String("https://github.com/OWNER/REPOSITORY.git"),
* DefaultBranch: pulumi.String("main"),
* AuthenticationTokenSecretVersion: secretVersion.ID(),
* },
* WorkspaceCompilationOverrides: &dataform.RepositoryWorkspaceCompilationOverridesArgs{
* DefaultDatabase: pulumi.String("database"),
* SchemaSuffix: pulumi.String("_suffix"),
* TablePrefix: pulumi.String("prefix_"),
* },
* })
* 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.gcp.secretmanager.Secret;
* import com.pulumi.gcp.secretmanager.SecretArgs;
* import com.pulumi.gcp.secretmanager.inputs.SecretReplicationArgs;
* import com.pulumi.gcp.secretmanager.inputs.SecretReplicationAutoArgs;
* import com.pulumi.gcp.secretmanager.SecretVersion;
* import com.pulumi.gcp.secretmanager.SecretVersionArgs;
* import com.pulumi.gcp.dataform.Repository;
* import com.pulumi.gcp.dataform.RepositoryArgs;
* import com.pulumi.gcp.dataform.inputs.RepositoryGitRemoteSettingsArgs;
* import com.pulumi.gcp.dataform.inputs.RepositoryWorkspaceCompilationOverridesArgs;
* 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 secret = new Secret("secret", SecretArgs.builder()
* .secretId("my-secret")
* .replication(SecretReplicationArgs.builder()
* .auto()
* .build())
* .build());
* var secretVersion = new SecretVersion("secretVersion", SecretVersionArgs.builder()
* .secret(secret.id())
* .secretData("secret-data")
* .build());
* var dataformRepository = new Repository("dataformRepository", RepositoryArgs.builder()
* .name("dataform_repository")
* .displayName("dataform_repository")
* .npmrcEnvironmentVariablesSecretVersion(secretVersion.id())
* .labels(Map.of("label_foo1", "label-bar1"))
* .gitRemoteSettings(RepositoryGitRemoteSettingsArgs.builder()
* .url("https://github.com/OWNER/REPOSITORY.git")
* .defaultBranch("main")
* .authenticationTokenSecretVersion(secretVersion.id())
* .build())
* .workspaceCompilationOverrides(RepositoryWorkspaceCompilationOverridesArgs.builder()
* .defaultDatabase("database")
* .schemaSuffix("_suffix")
* .tablePrefix("prefix_")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* secret:
* type: gcp:secretmanager:Secret
* properties:
* secretId: my-secret
* replication:
* auto: {}
* secretVersion:
* type: gcp:secretmanager:SecretVersion
* name: secret_version
* properties:
* secret: ${secret.id}
* secretData: secret-data
* dataformRepository:
* type: gcp:dataform:Repository
* name: dataform_repository
* properties:
* name: dataform_repository
* displayName: dataform_repository
* npmrcEnvironmentVariablesSecretVersion: ${secretVersion.id}
* labels:
* label_foo1: label-bar1
* gitRemoteSettings:
* url: https://github.com/OWNER/REPOSITORY.git
* defaultBranch: main
* authenticationTokenSecretVersion: ${secretVersion.id}
* workspaceCompilationOverrides:
* defaultDatabase: database
* schemaSuffix: _suffix
* tablePrefix: prefix_
* ```
*
* ## Import
* Repository can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/{{region}}/repositories/{{name}}`
* * `{{project}}/{{region}}/{{name}}`
* * `{{region}}/{{name}}`
* * `{{name}}`
* When using the `pulumi import` command, Repository can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:dataform/repository:Repository default projects/{{project}}/locations/{{region}}/repositories/{{name}}
* ```
* ```sh
* $ pulumi import gcp:dataform/repository:Repository default {{project}}/{{region}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:dataform/repository:Repository default {{region}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:dataform/repository:Repository default {{name}}
* ```
*/
public class Repository internal constructor(
override val javaResource: com.pulumi.gcp.dataform.Repository,
) : KotlinCustomResource(javaResource, RepositoryMapper) {
/**
* Optional. The repository's user-friendly name.
*/
public val displayName: Output?
get() = javaResource.displayName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
public val effectiveLabels: Output
© 2015 - 2024 Weber Informatics LLC | Privacy Policy