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

com.pulumi.gcp.netapp.kotlin.ActiveDirectory.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.netapp.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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map

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

    public var args: ActiveDirectoryArgs = ActiveDirectoryArgs()

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

/**
 * ActiveDirectory is the public representation of the active directory config.
 * To get more information about activeDirectory, see:
 * * [API documentation](https://cloud.google.com/netapp/volumes/docs/reference/rest/v1/projects.locations.activeDirectories)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/netapp/volumes/docs/configure-and-use/active-directory/about-ad)
 * ## Example Usage
 * ### Netapp Active Directory Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const testActiveDirectoryFull = new gcp.netapp.ActiveDirectory("test_active_directory_full", {
 *     name: "test-active-directory-full",
 *     location: "us-central1",
 *     domain: "ad.internal",
 *     dns: "172.30.64.3",
 *     netBiosPrefix: "smbserver",
 *     username: "user",
 *     password: "pass",
 *     aesEncryption: false,
 *     backupOperators: [
 *         "test1",
 *         "test2",
 *     ],
 *     administrators: [
 *         "test1",
 *         "test2",
 *     ],
 *     description: "ActiveDirectory is the public representation of the active directory config.",
 *     encryptDcConnections: false,
 *     kdcHostname: "hostname",
 *     kdcIp: "10.10.0.11",
 *     labels: {
 *         foo: "bar",
 *     },
 *     ldapSigning: false,
 *     nfsUsersWithLdap: false,
 *     organizationalUnit: "CN=Computers",
 *     securityOperators: [
 *         "test1",
 *         "test2",
 *     ],
 *     site: "test-site",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * test_active_directory_full = gcp.netapp.ActiveDirectory("test_active_directory_full",
 *     name="test-active-directory-full",
 *     location="us-central1",
 *     domain="ad.internal",
 *     dns="172.30.64.3",
 *     net_bios_prefix="smbserver",
 *     username="user",
 *     password="pass",
 *     aes_encryption=False,
 *     backup_operators=[
 *         "test1",
 *         "test2",
 *     ],
 *     administrators=[
 *         "test1",
 *         "test2",
 *     ],
 *     description="ActiveDirectory is the public representation of the active directory config.",
 *     encrypt_dc_connections=False,
 *     kdc_hostname="hostname",
 *     kdc_ip="10.10.0.11",
 *     labels={
 *         "foo": "bar",
 *     },
 *     ldap_signing=False,
 *     nfs_users_with_ldap=False,
 *     organizational_unit="CN=Computers",
 *     security_operators=[
 *         "test1",
 *         "test2",
 *     ],
 *     site="test-site")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var testActiveDirectoryFull = new Gcp.Netapp.ActiveDirectory("test_active_directory_full", new()
 *     {
 *         Name = "test-active-directory-full",
 *         Location = "us-central1",
 *         Domain = "ad.internal",
 *         Dns = "172.30.64.3",
 *         NetBiosPrefix = "smbserver",
 *         Username = "user",
 *         Password = "pass",
 *         AesEncryption = false,
 *         BackupOperators = new[]
 *         {
 *             "test1",
 *             "test2",
 *         },
 *         Administrators = new[]
 *         {
 *             "test1",
 *             "test2",
 *         },
 *         Description = "ActiveDirectory is the public representation of the active directory config.",
 *         EncryptDcConnections = false,
 *         KdcHostname = "hostname",
 *         KdcIp = "10.10.0.11",
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *         LdapSigning = false,
 *         NfsUsersWithLdap = false,
 *         OrganizationalUnit = "CN=Computers",
 *         SecurityOperators = new[]
 *         {
 *             "test1",
 *             "test2",
 *         },
 *         Site = "test-site",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/netapp"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := netapp.NewActiveDirectory(ctx, "test_active_directory_full", &netapp.ActiveDirectoryArgs{
 * 			Name:          pulumi.String("test-active-directory-full"),
 * 			Location:      pulumi.String("us-central1"),
 * 			Domain:        pulumi.String("ad.internal"),
 * 			Dns:           pulumi.String("172.30.64.3"),
 * 			NetBiosPrefix: pulumi.String("smbserver"),
 * 			Username:      pulumi.String("user"),
 * 			Password:      pulumi.String("pass"),
 * 			AesEncryption: pulumi.Bool(false),
 * 			BackupOperators: pulumi.StringArray{
 * 				pulumi.String("test1"),
 * 				pulumi.String("test2"),
 * 			},
 * 			Administrators: pulumi.StringArray{
 * 				pulumi.String("test1"),
 * 				pulumi.String("test2"),
 * 			},
 * 			Description:          pulumi.String("ActiveDirectory is the public representation of the active directory config."),
 * 			EncryptDcConnections: pulumi.Bool(false),
 * 			KdcHostname:          pulumi.String("hostname"),
 * 			KdcIp:                pulumi.String("10.10.0.11"),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 			LdapSigning:        pulumi.Bool(false),
 * 			NfsUsersWithLdap:   pulumi.Bool(false),
 * 			OrganizationalUnit: pulumi.String("CN=Computers"),
 * 			SecurityOperators: pulumi.StringArray{
 * 				pulumi.String("test1"),
 * 				pulumi.String("test2"),
 * 			},
 * 			Site: pulumi.String("test-site"),
 * 		})
 * 		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.netapp.ActiveDirectory;
 * import com.pulumi.gcp.netapp.ActiveDirectoryArgs;
 * 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 testActiveDirectoryFull = new ActiveDirectory("testActiveDirectoryFull", ActiveDirectoryArgs.builder()
 *             .name("test-active-directory-full")
 *             .location("us-central1")
 *             .domain("ad.internal")
 *             .dns("172.30.64.3")
 *             .netBiosPrefix("smbserver")
 *             .username("user")
 *             .password("pass")
 *             .aesEncryption(false)
 *             .backupOperators(
 *                 "test1",
 *                 "test2")
 *             .administrators(
 *                 "test1",
 *                 "test2")
 *             .description("ActiveDirectory is the public representation of the active directory config.")
 *             .encryptDcConnections(false)
 *             .kdcHostname("hostname")
 *             .kdcIp("10.10.0.11")
 *             .labels(Map.of("foo", "bar"))
 *             .ldapSigning(false)
 *             .nfsUsersWithLdap(false)
 *             .organizationalUnit("CN=Computers")
 *             .securityOperators(
 *                 "test1",
 *                 "test2")
 *             .site("test-site")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   testActiveDirectoryFull:
 *     type: gcp:netapp:ActiveDirectory
 *     name: test_active_directory_full
 *     properties:
 *       name: test-active-directory-full
 *       location: us-central1
 *       domain: ad.internal
 *       dns: 172.30.64.3
 *       netBiosPrefix: smbserver
 *       username: user
 *       password: pass
 *       aesEncryption: false
 *       backupOperators:
 *         - test1
 *         - test2
 *       administrators:
 *         - test1
 *         - test2
 *       description: ActiveDirectory is the public representation of the active directory config.
 *       encryptDcConnections: false
 *       kdcHostname: hostname
 *       kdcIp: 10.10.0.11
 *       labels:
 *         foo: bar
 *       ldapSigning: false
 *       nfsUsersWithLdap: false
 *       organizationalUnit: CN=Computers
 *       securityOperators:
 *         - test1
 *         - test2
 *       site: test-site
 * ```
 * 
 * ## Import
 * activeDirectory can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/activeDirectories/{{name}}`
 * * `{{project}}/{{location}}/{{name}}`
 * * `{{location}}/{{name}}`
 * When using the `pulumi import` command, activeDirectory can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:netapp/activeDirectory:ActiveDirectory default projects/{{project}}/locations/{{location}}/activeDirectories/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:netapp/activeDirectory:ActiveDirectory default {{project}}/{{location}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:netapp/activeDirectory:ActiveDirectory default {{location}}/{{name}}
 * ```
 */
public class ActiveDirectory internal constructor(
    override val javaResource: com.pulumi.gcp.netapp.ActiveDirectory,
) : KotlinCustomResource(javaResource, ActiveDirectoryMapper) {
    /**
     * Domain user accounts to be added to the local Administrators group of the SMB service. Comma-separated list of domain users or groups. The Domain Admin group is automatically added when the service joins your domain as a hidden group.
     */
    public val administrators: Output>?
        get() = javaResource.administrators().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Enables AES-128 and AES-256 encryption for Kerberos-based communication with Active Directory.
     */
    public val aesEncryption: Output?
        get() = javaResource.aesEncryption().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Domain user/group accounts to be added to the Backup Operators group of the SMB service. The Backup Operators group allows members to backup and restore files regardless of whether they have read or write access to the files. Comma-separated list.
     */
    public val backupOperators: Output>?
        get() = javaResource.backupOperators().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Create time of the active directory. A timestamp in RFC3339 UTC "Zulu" format. Examples: "2023-06-22T09:13:01.617Z".
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * An optional description of this resource.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Comma separated list of DNS server IP addresses for the Active Directory domain.
     */
    public val dns: Output
        get() = javaResource.dns().applyValue({ args0 -> args0 })

    /**
     * Fully qualified domain name for the Active Directory domain.
     */
    public val domain: Output
        get() = javaResource.domain().applyValue({ args0 -> args0 })

    /**
     * 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>
        get() = javaResource.effectiveLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * If enabled, traffic between the SMB server to Domain Controller (DC) will be encrypted.
     */
    public val encryptDcConnections: Output?
        get() = javaResource.encryptDcConnections().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Hostname of the Active Directory server used as Kerberos Key Distribution Center. Only requried for volumes using kerberized NFSv4.1
     */
    public val kdcHostname: Output?
        get() = javaResource.kdcHostname().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * IP address of the Active Directory server used as Kerberos Key Distribution Center.
     */
    public val kdcIp: Output?
        get() = javaResource.kdcIp().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Labels as key value pairs. Example: `{ "owner": "Bob", "department": "finance", "purpose": "testing" }`.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    public val labels: Output>?
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * Specifies whether or not the LDAP traffic needs to be signed.
     */
    public val ldapSigning: Output?
        get() = javaResource.ldapSigning().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Name of the region for the policy to apply to.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * The resource name of the Active Directory pool. Needs to be unique per location.
     * - - -
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * NetBIOS name prefix of the server to be created.
     * A five-character random ID is generated automatically, for example, -6f9a, and appended to the prefix. The full UNC share path will have the following format:
     * `\\NetBIOS_PREFIX-ABCD.DOMAIN_NAME\SHARE_NAME`
     */
    public val netBiosPrefix: Output
        get() = javaResource.netBiosPrefix().applyValue({ args0 -> args0 })

    /**
     * Local UNIX users on clients without valid user information in Active Directory are blocked from access to LDAP enabled volumes.
     * This option can be used to temporarily switch such volumes to AUTH_SYS authentication (user ID + 1-16 groups).
     */
    public val nfsUsersWithLdap: Output?
        get() = javaResource.nfsUsersWithLdap().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Name of the Organizational Unit where you intend to create the computer account for NetApp Volumes.
     * Defaults to `CN=Computers` if left empty.
     */
    public val organizationalUnit: Output
        get() = javaResource.organizationalUnit().applyValue({ args0 -> args0 })

    public val password: Output
        get() = javaResource.password().applyValue({ args0 -> args0 })

    /**
     * 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 combination of labels configured directly on the resource
     * and default labels configured on the provider.
     */
    public val pulumiLabels: Output>
        get() = javaResource.pulumiLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Domain accounts that require elevated privileges such as `SeSecurityPrivilege` to manage security logs. Comma-separated list.
     */
    public val securityOperators: Output>?
        get() = javaResource.securityOperators().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Specifies an Active Directory site to manage domain controller selection.
     * Use when Active Directory domain controllers in multiple regions are configured. Defaults to `Default-First-Site-Name` if left empty.
     */
    public val site: Output?
        get() = javaResource.site().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The state of the Active Directory policy (not the Active Directory itself).
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 -> args0 })

    /**
     * The state details of the Active Directory.
     */
    public val stateDetails: Output
        get() = javaResource.stateDetails().applyValue({ args0 -> args0 })

    /**
     * Username for the Active Directory account with permissions to create the compute account within the specified organizational unit.
     */
    public val username: Output
        get() = javaResource.username().applyValue({ args0 -> args0 })
}

public object ActiveDirectoryMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.netapp.ActiveDirectory::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy