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

com.pulumi.aws.batch.kotlin.SchedulingPolicyArgs.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: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.batch.kotlin

import com.pulumi.aws.batch.SchedulingPolicyArgs.builder
import com.pulumi.aws.batch.kotlin.inputs.SchedulingPolicyFairSharePolicyArgs
import com.pulumi.aws.batch.kotlin.inputs.SchedulingPolicyFairSharePolicyArgsBuilder
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Provides a Batch Scheduling Policy resource.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.batch.SchedulingPolicy("example", {
 *     name: "example",
 *     fairSharePolicy: {
 *         computeReservation: 1,
 *         shareDecaySeconds: 3600,
 *         shareDistributions: [
 *             {
 *                 shareIdentifier: "A1*",
 *                 weightFactor: 0.1,
 *             },
 *             {
 *                 shareIdentifier: "A2",
 *                 weightFactor: 0.2,
 *             },
 *         ],
 *     },
 *     tags: {
 *         Name: "Example Batch Scheduling Policy",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.batch.SchedulingPolicy("example",
 *     name="example",
 *     fair_share_policy={
 *         "compute_reservation": 1,
 *         "share_decay_seconds": 3600,
 *         "share_distributions": [
 *             {
 *                 "share_identifier": "A1*",
 *                 "weight_factor": 0.1,
 *             },
 *             {
 *                 "share_identifier": "A2",
 *                 "weight_factor": 0.2,
 *             },
 *         ],
 *     },
 *     tags={
 *         "Name": "Example Batch Scheduling Policy",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.Batch.SchedulingPolicy("example", new()
 *     {
 *         Name = "example",
 *         FairSharePolicy = new Aws.Batch.Inputs.SchedulingPolicyFairSharePolicyArgs
 *         {
 *             ComputeReservation = 1,
 *             ShareDecaySeconds = 3600,
 *             ShareDistributions = new[]
 *             {
 *                 new Aws.Batch.Inputs.SchedulingPolicyFairSharePolicyShareDistributionArgs
 *                 {
 *                     ShareIdentifier = "A1*",
 *                     WeightFactor = 0.1,
 *                 },
 *                 new Aws.Batch.Inputs.SchedulingPolicyFairSharePolicyShareDistributionArgs
 *                 {
 *                     ShareIdentifier = "A2",
 *                     WeightFactor = 0.2,
 *                 },
 *             },
 *         },
 *         Tags =
 *         {
 *             { "Name", "Example Batch Scheduling Policy" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/batch"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := batch.NewSchedulingPolicy(ctx, "example", &batch.SchedulingPolicyArgs{
 * 			Name: pulumi.String("example"),
 * 			FairSharePolicy: &batch.SchedulingPolicyFairSharePolicyArgs{
 * 				ComputeReservation: pulumi.Int(1),
 * 				ShareDecaySeconds:  pulumi.Int(3600),
 * 				ShareDistributions: batch.SchedulingPolicyFairSharePolicyShareDistributionArray{
 * 					&batch.SchedulingPolicyFairSharePolicyShareDistributionArgs{
 * 						ShareIdentifier: pulumi.String("A1*"),
 * 						WeightFactor:    pulumi.Float64(0.1),
 * 					},
 * 					&batch.SchedulingPolicyFairSharePolicyShareDistributionArgs{
 * 						ShareIdentifier: pulumi.String("A2"),
 * 						WeightFactor:    pulumi.Float64(0.2),
 * 					},
 * 				},
 * 			},
 * 			Tags: pulumi.StringMap{
 * 				"Name": pulumi.String("Example Batch Scheduling Policy"),
 * 			},
 * 		})
 * 		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.aws.batch.SchedulingPolicy;
 * import com.pulumi.aws.batch.SchedulingPolicyArgs;
 * import com.pulumi.aws.batch.inputs.SchedulingPolicyFairSharePolicyArgs;
 * 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 example = new SchedulingPolicy("example", SchedulingPolicyArgs.builder()
 *             .name("example")
 *             .fairSharePolicy(SchedulingPolicyFairSharePolicyArgs.builder()
 *                 .computeReservation(1)
 *                 .shareDecaySeconds(3600)
 *                 .shareDistributions(
 *                     SchedulingPolicyFairSharePolicyShareDistributionArgs.builder()
 *                         .shareIdentifier("A1*")
 *                         .weightFactor(0.1)
 *                         .build(),
 *                     SchedulingPolicyFairSharePolicyShareDistributionArgs.builder()
 *                         .shareIdentifier("A2")
 *                         .weightFactor(0.2)
 *                         .build())
 *                 .build())
 *             .tags(Map.of("Name", "Example Batch Scheduling Policy"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:batch:SchedulingPolicy
 *     properties:
 *       name: example
 *       fairSharePolicy:
 *         computeReservation: 1
 *         shareDecaySeconds: 3600
 *         shareDistributions:
 *           - shareIdentifier: A1*
 *             weightFactor: 0.1
 *           - shareIdentifier: A2
 *             weightFactor: 0.2
 *       tags:
 *         Name: Example Batch Scheduling Policy
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import Batch Scheduling Policy using the `arn`. For example:
 * ```sh
 * $ pulumi import aws:batch/schedulingPolicy:SchedulingPolicy test_policy arn:aws:batch:us-east-1:123456789012:scheduling-policy/sample
 * ```
 * @property fairSharePolicy
 * @property name Specifies the name of the scheduling policy.
 * @property tags Key-value map of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
 */
public data class SchedulingPolicyArgs(
    public val fairSharePolicy: Output? = null,
    public val name: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.batch.SchedulingPolicyArgs =
        com.pulumi.aws.batch.SchedulingPolicyArgs.builder()
            .fairSharePolicy(fairSharePolicy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .name(name?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [SchedulingPolicyArgs].
 */
@PulumiTagMarker
public class SchedulingPolicyArgsBuilder internal constructor() {
    private var fairSharePolicy: Output? = null

    private var name: Output? = null

    private var tags: Output>? = null

    /**
     * @param value
     */
    @JvmName("iutpbdiaocvhsgbm")
    public suspend fun fairSharePolicy(`value`: Output) {
        this.fairSharePolicy = value
    }

    /**
     * @param value Specifies the name of the scheduling policy.
     */
    @JvmName("lfpiodleygdsxssm")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Key-value map of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("flxmdbmebxxxnesn")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value
     */
    @JvmName("rapyjnssulpacqqp")
    public suspend fun fairSharePolicy(`value`: SchedulingPolicyFairSharePolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.fairSharePolicy = mapped
    }

    /**
     * @param argument
     */
    @JvmName("sqojtpedokgugijj")
    public suspend fun fairSharePolicy(argument: suspend SchedulingPolicyFairSharePolicyArgsBuilder.() -> Unit) {
        val toBeMapped = SchedulingPolicyFairSharePolicyArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.fairSharePolicy = mapped
    }

    /**
     * @param value Specifies the name of the scheduling policy.
     */
    @JvmName("obqflhpxmnrrycpx")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Key-value map of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("svivlxddlyfmipee")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Key-value map of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("qyymgvfqiwgtregk")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): SchedulingPolicyArgs = SchedulingPolicyArgs(
        fairSharePolicy = fairSharePolicy,
        name = name,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy