All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.applicationintegration.kotlin.AuthConfig.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.applicationintegration.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.applicationintegration.kotlin.outputs.AuthConfigClientCertificate
import com.pulumi.gcp.applicationintegration.kotlin.outputs.AuthConfigDecryptedCredential
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.List
import com.pulumi.gcp.applicationintegration.kotlin.outputs.AuthConfigClientCertificate.Companion.toKotlin as authConfigClientCertificateToKotlin
import com.pulumi.gcp.applicationintegration.kotlin.outputs.AuthConfigDecryptedCredential.Companion.toKotlin as authConfigDecryptedCredentialToKotlin

/**
 * Builder for [AuthConfig].
 */
@PulumiTagMarker
public class AuthConfigResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: AuthConfigArgs = AuthConfigArgs()

    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 AuthConfigArgsBuilder.() -> Unit) {
        val builder = AuthConfigArgsBuilder()
        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(): AuthConfig {
        val builtJavaResource =
            com.pulumi.gcp.applicationintegration.AuthConfig(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return AuthConfig(builtJavaResource)
    }
}

/**
 * The AuthConfig resource use to hold channels and connection config data.
 * To get more information about AuthConfig, see:
 * * [API documentation](https://cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.authConfigs)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/application-integration/docs/overview)
 *     * [Manage authentication profiles](https://cloud.google.com/application-integration/docs/configure-authentication-profiles)
 * ## Example Usage
 * ### Integrations Auth Config Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const client = new gcp.applicationintegration.Client("client", {location: "us-west1"});
 * const basicExample = new gcp.applicationintegration.AuthConfig("basic_example", {
 *     location: "us-west1",
 *     displayName: "test-authconfig",
 *     description: "Test auth config created via terraform",
 *     decryptedCredential: {
 *         credentialType: "USERNAME_AND_PASSWORD",
 *         usernameAndPassword: {
 *             username: "test-username",
 *             password: "test-password",
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * client = gcp.applicationintegration.Client("client", location="us-west1")
 * basic_example = gcp.applicationintegration.AuthConfig("basic_example",
 *     location="us-west1",
 *     display_name="test-authconfig",
 *     description="Test auth config created via terraform",
 *     decrypted_credential=gcp.applicationintegration.AuthConfigDecryptedCredentialArgs(
 *         credential_type="USERNAME_AND_PASSWORD",
 *         username_and_password=gcp.applicationintegration.AuthConfigDecryptedCredentialUsernameAndPasswordArgs(
 *             username="test-username",
 *             password="test-password",
 *         ),
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var client = new Gcp.ApplicationIntegration.Client("client", new()
 *     {
 *         Location = "us-west1",
 *     });
 *     var basicExample = new Gcp.ApplicationIntegration.AuthConfig("basic_example", new()
 *     {
 *         Location = "us-west1",
 *         DisplayName = "test-authconfig",
 *         Description = "Test auth config created via terraform",
 *         DecryptedCredential = new Gcp.ApplicationIntegration.Inputs.AuthConfigDecryptedCredentialArgs
 *         {
 *             CredentialType = "USERNAME_AND_PASSWORD",
 *             UsernameAndPassword = new Gcp.ApplicationIntegration.Inputs.AuthConfigDecryptedCredentialUsernameAndPasswordArgs
 *             {
 *                 Username = "test-username",
 *                 Password = "test-password",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/applicationintegration"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := applicationintegration.NewClient(ctx, "client", &applicationintegration.ClientArgs{
 * 			Location: pulumi.String("us-west1"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = applicationintegration.NewAuthConfig(ctx, "basic_example", &applicationintegration.AuthConfigArgs{
 * 			Location:    pulumi.String("us-west1"),
 * 			DisplayName: pulumi.String("test-authconfig"),
 * 			Description: pulumi.String("Test auth config created via terraform"),
 * 			DecryptedCredential: &applicationintegration.AuthConfigDecryptedCredentialArgs{
 * 				CredentialType: pulumi.String("USERNAME_AND_PASSWORD"),
 * 				UsernameAndPassword: &applicationintegration.AuthConfigDecryptedCredentialUsernameAndPasswordArgs{
 * 					Username: pulumi.String("test-username"),
 * 					Password: pulumi.String("test-password"),
 * 				},
 * 			},
 * 		})
 * 		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.applicationintegration.Client;
 * import com.pulumi.gcp.applicationintegration.ClientArgs;
 * import com.pulumi.gcp.applicationintegration.AuthConfig;
 * import com.pulumi.gcp.applicationintegration.AuthConfigArgs;
 * import com.pulumi.gcp.applicationintegration.inputs.AuthConfigDecryptedCredentialArgs;
 * import com.pulumi.gcp.applicationintegration.inputs.AuthConfigDecryptedCredentialUsernameAndPasswordArgs;
 * 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 client = new Client("client", ClientArgs.builder()
 *             .location("us-west1")
 *             .build());
 *         var basicExample = new AuthConfig("basicExample", AuthConfigArgs.builder()
 *             .location("us-west1")
 *             .displayName("test-authconfig")
 *             .description("Test auth config created via terraform")
 *             .decryptedCredential(AuthConfigDecryptedCredentialArgs.builder()
 *                 .credentialType("USERNAME_AND_PASSWORD")
 *                 .usernameAndPassword(AuthConfigDecryptedCredentialUsernameAndPasswordArgs.builder()
 *                     .username("test-username")
 *                     .password("test-password")
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   client:
 *     type: gcp:applicationintegration:Client
 *     properties:
 *       location: us-west1
 *   basicExample:
 *     type: gcp:applicationintegration:AuthConfig
 *     name: basic_example
 *     properties:
 *       location: us-west1
 *       displayName: test-authconfig
 *       description: Test auth config created via terraform
 *       decryptedCredential:
 *         credentialType: USERNAME_AND_PASSWORD
 *         usernameAndPassword:
 *           username: test-username
 *           password: test-password
 * ```
 * 
 * ## Import
 * AuthConfig can be imported using any of these accepted formats:
 * * `{{name}}`
 * When using the `pulumi import` command, AuthConfig can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:applicationintegration/authConfig:AuthConfig default {{name}}
 * ```
 */
public class AuthConfig internal constructor(
    override val javaResource: com.pulumi.gcp.applicationintegration.AuthConfig,
) : KotlinCustomResource(javaResource, AuthConfigMapper) {
    /**
     * Certificate id for client certificate.
     */
    public val certificateId: Output
        get() = javaResource.certificateId().applyValue({ args0 -> args0 })

    /**
     * Raw client certificate
     * Structure is documented below.
     */
    public val clientCertificate: Output?
        get() = javaResource.clientCertificate().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> authConfigClientCertificateToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The timestamp when the auth config is created.
     * A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * The creator's email address. Generated based on the End User Credentials/LOAS role of the user making the call.
     */
    public val creatorEmail: Output
        get() = javaResource.creatorEmail().applyValue({ args0 -> args0 })

    /**
     * Credential type of the encrypted credential.
     */
    public val credentialType: Output
        get() = javaResource.credentialType().applyValue({ args0 -> args0 })

    /**
     * Raw auth credentials.
     * Structure is documented below.
     */
    public val decryptedCredential: Output?
        get() = javaResource.decryptedCredential().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> authConfigDecryptedCredentialToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * A description of the auth config.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the auth config.
     */
    public val displayName: Output
        get() = javaResource.displayName().applyValue({ args0 -> args0 })

    /**
     * Auth credential encrypted by Cloud KMS. Can be decrypted as Credential with proper KMS key.
     * A base64-encoded string.
     */
    public val encryptedCredential: Output
        get() = javaResource.encryptedCredential().applyValue({ args0 -> args0 })

    /**
     * User can define the time to receive notification after which the auth config becomes invalid. Support up to 30 days. Support granularity in hours.
     * A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
     */
    public val expiryNotificationDurations: Output>?
        get() = javaResource.expiryNotificationDurations().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * The last modifier's email address. Generated based on the End User Credentials/LOAS role of the user making the call.
     */
    public val lastModifierEmail: Output
        get() = javaResource.lastModifierEmail().applyValue({ args0 -> args0 })

    /**
     * Location in which client needs to be provisioned.
     * - - -
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Resource name of the auth config.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * User provided expiry time to override. For the example of Salesforce, username/password credentials can be valid for 6 months depending on the instance settings.
     * A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
     */
    public val overrideValidTime: Output?
        get() = javaResource.overrideValidTime().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The reason / details of the current status.
     */
    public val reason: Output
        get() = javaResource.reason().applyValue({ args0 -> args0 })

    /**
     * The status of the auth config.
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 -> args0 })

    /**
     * The timestamp when the auth config is modified.
     * A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })

    /**
     * The time until the auth config is valid. Empty or max value is considered the auth config won't expire.
     * A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
     */
    public val validTime: Output
        get() = javaResource.validTime().applyValue({ args0 -> args0 })

    /**
     * The visibility of the auth config.
     * Possible values are: `PRIVATE`, `CLIENT_VISIBLE`.
     */
    public val visibility: Output?
        get() = javaResource.visibility().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object AuthConfigMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.applicationintegration.AuthConfig::class == javaResource::class

    override fun map(javaResource: Resource): AuthConfig = AuthConfig(
        javaResource as
            com.pulumi.gcp.applicationintegration.AuthConfig,
    )
}

/**
 * @see [AuthConfig].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [AuthConfig].
 */
public suspend fun authConfig(name: String, block: suspend AuthConfigResourceBuilder.() -> Unit): AuthConfig {
    val builder = AuthConfigResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [AuthConfig].
 * @param name The _unique_ name of the resulting resource.
 */
public fun authConfig(name: String): AuthConfig {
    val builder = AuthConfigResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy