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

com.pulumi.azurenative.sql.kotlin.JobTargetGroupArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.sql.kotlin

import com.pulumi.azurenative.sql.JobTargetGroupArgs.builder
import com.pulumi.azurenative.sql.kotlin.inputs.JobTargetArgs
import com.pulumi.azurenative.sql.kotlin.inputs.JobTargetArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * A group of job targets.
 * Azure REST API version: 2021-11-01. Prior API version in Azure Native 1.x: 2020-11-01-preview.
 * Other available API versions: 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview.
 * ## Example Usage
 * ### Create or update a target group with all properties.
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var jobTargetGroup = new AzureNative.Sql.JobTargetGroup("jobTargetGroup", new()
 *     {
 *         JobAgentName = "agent1",
 *         Members = new[]
 *         {
 *             new AzureNative.Sql.Inputs.JobTargetArgs
 *             {
 *                 DatabaseName = "database1",
 *                 MembershipType = AzureNative.Sql.JobTargetGroupMembershipType.Exclude,
 *                 ServerName = "server1",
 *                 Type = AzureNative.Sql.JobTargetType.SqlDatabase,
 *             },
 *             new AzureNative.Sql.Inputs.JobTargetArgs
 *             {
 *                 MembershipType = AzureNative.Sql.JobTargetGroupMembershipType.Include,
 *                 RefreshCredential = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential",
 *                 ServerName = "server1",
 *                 Type = AzureNative.Sql.JobTargetType.SqlServer,
 *             },
 *             new AzureNative.Sql.Inputs.JobTargetArgs
 *             {
 *                 ElasticPoolName = "pool1",
 *                 MembershipType = AzureNative.Sql.JobTargetGroupMembershipType.Include,
 *                 RefreshCredential = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential",
 *                 ServerName = "server2",
 *                 Type = AzureNative.Sql.JobTargetType.SqlElasticPool,
 *             },
 *             new AzureNative.Sql.Inputs.JobTargetArgs
 *             {
 *                 MembershipType = AzureNative.Sql.JobTargetGroupMembershipType.Include,
 *                 RefreshCredential = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential",
 *                 ServerName = "server3",
 *                 ShardMapName = "shardMap1",
 *                 Type = AzureNative.Sql.JobTargetType.SqlShardMap,
 *             },
 *         },
 *         ResourceGroupName = "group1",
 *         ServerName = "server1",
 *         TargetGroupName = "targetGroup1",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := sql.NewJobTargetGroup(ctx, "jobTargetGroup", &sql.JobTargetGroupArgs{
 * 			JobAgentName: pulumi.String("agent1"),
 * 			Members: sql.JobTargetArray{
 * 				&sql.JobTargetArgs{
 * 					DatabaseName:   pulumi.String("database1"),
 * 					MembershipType: sql.JobTargetGroupMembershipTypeExclude,
 * 					ServerName:     pulumi.String("server1"),
 * 					Type:           pulumi.String(sql.JobTargetTypeSqlDatabase),
 * 				},
 * 				&sql.JobTargetArgs{
 * 					MembershipType:    sql.JobTargetGroupMembershipTypeInclude,
 * 					RefreshCredential: pulumi.String("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"),
 * 					ServerName:        pulumi.String("server1"),
 * 					Type:              pulumi.String(sql.JobTargetTypeSqlServer),
 * 				},
 * 				&sql.JobTargetArgs{
 * 					ElasticPoolName:   pulumi.String("pool1"),
 * 					MembershipType:    sql.JobTargetGroupMembershipTypeInclude,
 * 					RefreshCredential: pulumi.String("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"),
 * 					ServerName:        pulumi.String("server2"),
 * 					Type:              pulumi.String(sql.JobTargetTypeSqlElasticPool),
 * 				},
 * 				&sql.JobTargetArgs{
 * 					MembershipType:    sql.JobTargetGroupMembershipTypeInclude,
 * 					RefreshCredential: pulumi.String("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"),
 * 					ServerName:        pulumi.String("server3"),
 * 					ShardMapName:      pulumi.String("shardMap1"),
 * 					Type:              pulumi.String(sql.JobTargetTypeSqlShardMap),
 * 				},
 * 			},
 * 			ResourceGroupName: pulumi.String("group1"),
 * 			ServerName:        pulumi.String("server1"),
 * 			TargetGroupName:   pulumi.String("targetGroup1"),
 * 		})
 * 		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.azurenative.sql.JobTargetGroup;
 * import com.pulumi.azurenative.sql.JobTargetGroupArgs;
 * import com.pulumi.azurenative.sql.inputs.JobTargetArgs;
 * 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 jobTargetGroup = new JobTargetGroup("jobTargetGroup", JobTargetGroupArgs.builder()
 *             .jobAgentName("agent1")
 *             .members(
 *                 JobTargetArgs.builder()
 *                     .databaseName("database1")
 *                     .membershipType("Exclude")
 *                     .serverName("server1")
 *                     .type("SqlDatabase")
 *                     .build(),
 *                 JobTargetArgs.builder()
 *                     .membershipType("Include")
 *                     .refreshCredential("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential")
 *                     .serverName("server1")
 *                     .type("SqlServer")
 *                     .build(),
 *                 JobTargetArgs.builder()
 *                     .elasticPoolName("pool1")
 *                     .membershipType("Include")
 *                     .refreshCredential("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential")
 *                     .serverName("server2")
 *                     .type("SqlElasticPool")
 *                     .build(),
 *                 JobTargetArgs.builder()
 *                     .membershipType("Include")
 *                     .refreshCredential("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential")
 *                     .serverName("server3")
 *                     .shardMapName("shardMap1")
 *                     .type("SqlShardMap")
 *                     .build())
 *             .resourceGroupName("group1")
 *             .serverName("server1")
 *             .targetGroupName("targetGroup1")
 *             .build());
 *     }
 * }
 * ```
 * ### Create or update a target group with minimal properties.
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var jobTargetGroup = new AzureNative.Sql.JobTargetGroup("jobTargetGroup", new()
 *     {
 *         JobAgentName = "agent1",
 *         Members = new[] {},
 *         ResourceGroupName = "group1",
 *         ServerName = "server1",
 *         TargetGroupName = "targetGroup1",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := sql.NewJobTargetGroup(ctx, "jobTargetGroup", &sql.JobTargetGroupArgs{
 * 			JobAgentName:      pulumi.String("agent1"),
 * 			Members:           sql.JobTargetArray{},
 * 			ResourceGroupName: pulumi.String("group1"),
 * 			ServerName:        pulumi.String("server1"),
 * 			TargetGroupName:   pulumi.String("targetGroup1"),
 * 		})
 * 		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.azurenative.sql.JobTargetGroup;
 * import com.pulumi.azurenative.sql.JobTargetGroupArgs;
 * 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 jobTargetGroup = new JobTargetGroup("jobTargetGroup", JobTargetGroupArgs.builder()
 *             .jobAgentName("agent1")
 *             .members()
 *             .resourceGroupName("group1")
 *             .serverName("server1")
 *             .targetGroupName("targetGroup1")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:sql:JobTargetGroup targetGroup1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}
 * ```
 * @property jobAgentName The name of the job agent.
 * @property members Members of the target group.
 * @property resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
 * @property serverName The name of the server.
 * @property targetGroupName The name of the target group.
 */
public data class JobTargetGroupArgs(
    public val jobAgentName: Output? = null,
    public val members: Output>? = null,
    public val resourceGroupName: Output? = null,
    public val serverName: Output? = null,
    public val targetGroupName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.sql.JobTargetGroupArgs =
        com.pulumi.azurenative.sql.JobTargetGroupArgs.builder()
            .jobAgentName(jobAgentName?.applyValue({ args0 -> args0 }))
            .members(
                members?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .serverName(serverName?.applyValue({ args0 -> args0 }))
            .targetGroupName(targetGroupName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [JobTargetGroupArgs].
 */
@PulumiTagMarker
public class JobTargetGroupArgsBuilder internal constructor() {
    private var jobAgentName: Output? = null

    private var members: Output>? = null

    private var resourceGroupName: Output? = null

    private var serverName: Output? = null

    private var targetGroupName: Output? = null

    /**
     * @param value The name of the job agent.
     */
    @JvmName("ucntigyfsxcijdds")
    public suspend fun jobAgentName(`value`: Output) {
        this.jobAgentName = value
    }

    /**
     * @param value Members of the target group.
     */
    @JvmName("lovpnsdrefdfdjdy")
    public suspend fun members(`value`: Output>) {
        this.members = value
    }

    @JvmName("ijdpsrumedbupmbh")
    public suspend fun members(vararg values: Output) {
        this.members = Output.all(values.asList())
    }

    /**
     * @param values Members of the target group.
     */
    @JvmName("evwkyeilqoeurccv")
    public suspend fun members(values: List>) {
        this.members = Output.all(values)
    }

    /**
     * @param value The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
     */
    @JvmName("piuowdcrepyqwpds")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The name of the server.
     */
    @JvmName("hyjffxobrtjxrwpv")
    public suspend fun serverName(`value`: Output) {
        this.serverName = value
    }

    /**
     * @param value The name of the target group.
     */
    @JvmName("bbstaxriomwhndek")
    public suspend fun targetGroupName(`value`: Output) {
        this.targetGroupName = value
    }

    /**
     * @param value The name of the job agent.
     */
    @JvmName("rrutrrfcnigoesju")
    public suspend fun jobAgentName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.jobAgentName = mapped
    }

    /**
     * @param value Members of the target group.
     */
    @JvmName("gpknkuswojobusqh")
    public suspend fun members(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.members = mapped
    }

    /**
     * @param argument Members of the target group.
     */
    @JvmName("dnsplhcglqrwilla")
    public suspend fun members(argument: List Unit>) {
        val toBeMapped = argument.toList().map { JobTargetArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.members = mapped
    }

    /**
     * @param argument Members of the target group.
     */
    @JvmName("hkpmolowtjjksrnu")
    public suspend fun members(vararg argument: suspend JobTargetArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { JobTargetArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.members = mapped
    }

    /**
     * @param argument Members of the target group.
     */
    @JvmName("fnlbepwfqosfvlxx")
    public suspend fun members(argument: suspend JobTargetArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(JobTargetArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.members = mapped
    }

    /**
     * @param values Members of the target group.
     */
    @JvmName("vkrjwsibbopcrdiu")
    public suspend fun members(vararg values: JobTargetArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.members = mapped
    }

    /**
     * @param value The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
     */
    @JvmName("javjwuywkojlvvgf")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The name of the server.
     */
    @JvmName("qrglxqdynemlbnlc")
    public suspend fun serverName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serverName = mapped
    }

    /**
     * @param value The name of the target group.
     */
    @JvmName("oxnpernskrdrqbua")
    public suspend fun targetGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targetGroupName = mapped
    }

    internal fun build(): JobTargetGroupArgs = JobTargetGroupArgs(
        jobAgentName = jobAgentName,
        members = members,
        resourceGroupName = resourceGroupName,
        serverName = serverName,
        targetGroupName = targetGroupName,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy