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

com.pulumi.aws.backup.kotlin.RestoreTestingSelectionArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.aws.backup.kotlin

import com.pulumi.aws.backup.RestoreTestingSelectionArgs.builder
import com.pulumi.aws.backup.kotlin.inputs.RestoreTestingSelectionProtectedResourceConditionsArgs
import com.pulumi.aws.backup.kotlin.inputs.RestoreTestingSelectionProtectedResourceConditionsArgsBuilder
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.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Resource for managing an AWS Backup Restore Testing Selection.
 * ## Example Usage
 * ### Basic Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.backup.RestoreTestingSelection("example", {
 *     name: "ec2_selection",
 *     restoreTestingPlanName: exampleAwsBackupRestoreTestingPlan.name,
 *     protectedResourceType: "EC2",
 *     iamRoleArn: exampleAwsIamRole.arn,
 *     protectedResourceArns: ["*"],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.backup.RestoreTestingSelection("example",
 *     name="ec2_selection",
 *     restore_testing_plan_name=example_aws_backup_restore_testing_plan["name"],
 *     protected_resource_type="EC2",
 *     iam_role_arn=example_aws_iam_role["arn"],
 *     protected_resource_arns=["*"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.Backup.RestoreTestingSelection("example", new()
 *     {
 *         Name = "ec2_selection",
 *         RestoreTestingPlanName = exampleAwsBackupRestoreTestingPlan.Name,
 *         ProtectedResourceType = "EC2",
 *         IamRoleArn = exampleAwsIamRole.Arn,
 *         ProtectedResourceArns = new[]
 *         {
 *             "*",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/backup"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := backup.NewRestoreTestingSelection(ctx, "example", &backup.RestoreTestingSelectionArgs{
 * 			Name:                   pulumi.String("ec2_selection"),
 * 			RestoreTestingPlanName: pulumi.Any(exampleAwsBackupRestoreTestingPlan.Name),
 * 			ProtectedResourceType:  pulumi.String("EC2"),
 * 			IamRoleArn:             pulumi.Any(exampleAwsIamRole.Arn),
 * 			ProtectedResourceArns: pulumi.StringArray{
 * 				pulumi.String("*"),
 * 			},
 * 		})
 * 		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.backup.RestoreTestingSelection;
 * import com.pulumi.aws.backup.RestoreTestingSelectionArgs;
 * 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 RestoreTestingSelection("example", RestoreTestingSelectionArgs.builder()
 *             .name("ec2_selection")
 *             .restoreTestingPlanName(exampleAwsBackupRestoreTestingPlan.name())
 *             .protectedResourceType("EC2")
 *             .iamRoleArn(exampleAwsIamRole.arn())
 *             .protectedResourceArns("*")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:backup:RestoreTestingSelection
 *     properties:
 *       name: ec2_selection
 *       restoreTestingPlanName: ${exampleAwsBackupRestoreTestingPlan.name}
 *       protectedResourceType: EC2
 *       iamRoleArn: ${exampleAwsIamRole.arn}
 *       protectedResourceArns:
 *         - '*'
 * ```
 * 
 * ### Advanced Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.backup.RestoreTestingSelection("example", {
 *     name: "ec2_selection",
 *     restoreTestingPlanName: exampleAwsBackupRestoreTestingPlan.name,
 *     protectedResourceType: "EC2",
 *     iamRoleArn: exampleAwsIamRole.arn,
 *     protectedResourceConditions: {
 *         stringEquals: [{
 *             key: "aws:ResourceTag/backup",
 *             value: "true",
 *         }],
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.backup.RestoreTestingSelection("example",
 *     name="ec2_selection",
 *     restore_testing_plan_name=example_aws_backup_restore_testing_plan["name"],
 *     protected_resource_type="EC2",
 *     iam_role_arn=example_aws_iam_role["arn"],
 *     protected_resource_conditions={
 *         "string_equals": [{
 *             "key": "aws:ResourceTag/backup",
 *             "value": "true",
 *         }],
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.Backup.RestoreTestingSelection("example", new()
 *     {
 *         Name = "ec2_selection",
 *         RestoreTestingPlanName = exampleAwsBackupRestoreTestingPlan.Name,
 *         ProtectedResourceType = "EC2",
 *         IamRoleArn = exampleAwsIamRole.Arn,
 *         ProtectedResourceConditions = new Aws.Backup.Inputs.RestoreTestingSelectionProtectedResourceConditionsArgs
 *         {
 *             StringEquals = new[]
 *             {
 *                 new Aws.Backup.Inputs.RestoreTestingSelectionProtectedResourceConditionsStringEqualArgs
 *                 {
 *                     Key = "aws:ResourceTag/backup",
 *                     Value = "true",
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/backup"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := backup.NewRestoreTestingSelection(ctx, "example", &backup.RestoreTestingSelectionArgs{
 * 			Name:                   pulumi.String("ec2_selection"),
 * 			RestoreTestingPlanName: pulumi.Any(exampleAwsBackupRestoreTestingPlan.Name),
 * 			ProtectedResourceType:  pulumi.String("EC2"),
 * 			IamRoleArn:             pulumi.Any(exampleAwsIamRole.Arn),
 * 			ProtectedResourceConditions: &backup.RestoreTestingSelectionProtectedResourceConditionsArgs{
 * 				StringEquals: backup.RestoreTestingSelectionProtectedResourceConditionsStringEqualArray{
 * 					&backup.RestoreTestingSelectionProtectedResourceConditionsStringEqualArgs{
 * 						Key:   pulumi.String("aws:ResourceTag/backup"),
 * 						Value: pulumi.String("true"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		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.backup.RestoreTestingSelection;
 * import com.pulumi.aws.backup.RestoreTestingSelectionArgs;
 * import com.pulumi.aws.backup.inputs.RestoreTestingSelectionProtectedResourceConditionsArgs;
 * 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 RestoreTestingSelection("example", RestoreTestingSelectionArgs.builder()
 *             .name("ec2_selection")
 *             .restoreTestingPlanName(exampleAwsBackupRestoreTestingPlan.name())
 *             .protectedResourceType("EC2")
 *             .iamRoleArn(exampleAwsIamRole.arn())
 *             .protectedResourceConditions(RestoreTestingSelectionProtectedResourceConditionsArgs.builder()
 *                 .stringEquals(RestoreTestingSelectionProtectedResourceConditionsStringEqualArgs.builder()
 *                     .key("aws:ResourceTag/backup")
 *                     .value(true)
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:backup:RestoreTestingSelection
 *     properties:
 *       name: ec2_selection
 *       restoreTestingPlanName: ${exampleAwsBackupRestoreTestingPlan.name}
 *       protectedResourceType: EC2
 *       iamRoleArn: ${exampleAwsIamRole.arn}
 *       protectedResourceConditions:
 *         stringEquals:
 *           - key: aws:ResourceTag/backup
 *             value: true
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import Backup Restore Testing Selection using `name:restore_testing_plan_name`. For example:
 * ```sh
 * $ pulumi import aws:backup/restoreTestingSelection:RestoreTestingSelection example restore_testing_selection_12345678:restore_testing_plan_12345678
 * ```
 * @property iamRoleArn The ARN of the IAM role.
 * @property name The name of the backup restore testing selection.
 * @property protectedResourceArns The ARNs for the protected resources.
 * @property protectedResourceConditions The conditions for the protected resource.
 * @property protectedResourceType The type of the protected resource.
 * @property restoreMetadataOverrides Override certain restore metadata keys. See the complete list of [restore testing inferred metadata](https://docs.aws.amazon.com/aws-backup/latest/devguide/restore-testing-inferred-metadata.html) .
 * @property restoreTestingPlanName The name of the restore testing plan.
 * @property validationWindowHours The amount of hours available to run a validation script on the data. Valid range is `1` to `168`.
 */
public data class RestoreTestingSelectionArgs(
    public val iamRoleArn: Output? = null,
    public val name: Output? = null,
    public val protectedResourceArns: Output>? = null,
    public val protectedResourceConditions: Output? = null,
    public val protectedResourceType: Output? = null,
    public val restoreMetadataOverrides: Output>? = null,
    public val restoreTestingPlanName: Output? = null,
    public val validationWindowHours: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.backup.RestoreTestingSelectionArgs =
        com.pulumi.aws.backup.RestoreTestingSelectionArgs.builder()
            .iamRoleArn(iamRoleArn?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .protectedResourceArns(protectedResourceArns?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .protectedResourceConditions(
                protectedResourceConditions?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .protectedResourceType(protectedResourceType?.applyValue({ args0 -> args0 }))
            .restoreMetadataOverrides(
                restoreMetadataOverrides?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .restoreTestingPlanName(restoreTestingPlanName?.applyValue({ args0 -> args0 }))
            .validationWindowHours(validationWindowHours?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [RestoreTestingSelectionArgs].
 */
@PulumiTagMarker
public class RestoreTestingSelectionArgsBuilder internal constructor() {
    private var iamRoleArn: Output? = null

    private var name: Output? = null

    private var protectedResourceArns: Output>? = null

    private var protectedResourceConditions:
        Output? = null

    private var protectedResourceType: Output? = null

    private var restoreMetadataOverrides: Output>? = null

    private var restoreTestingPlanName: Output? = null

    private var validationWindowHours: Output? = null

    /**
     * @param value The ARN of the IAM role.
     */
    @JvmName("cnobxyebwuffpnoe")
    public suspend fun iamRoleArn(`value`: Output) {
        this.iamRoleArn = value
    }

    /**
     * @param value The name of the backup restore testing selection.
     */
    @JvmName("ulbkdtofcvxxxyvn")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The ARNs for the protected resources.
     */
    @JvmName("iqkkencqcxwfhkvf")
    public suspend fun protectedResourceArns(`value`: Output>) {
        this.protectedResourceArns = value
    }

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

    /**
     * @param values The ARNs for the protected resources.
     */
    @JvmName("ywbeaumickfimags")
    public suspend fun protectedResourceArns(values: List>) {
        this.protectedResourceArns = Output.all(values)
    }

    /**
     * @param value The conditions for the protected resource.
     */
    @JvmName("cnrtkaiexrsnoqjs")
    public suspend fun protectedResourceConditions(`value`: Output) {
        this.protectedResourceConditions = value
    }

    /**
     * @param value The type of the protected resource.
     */
    @JvmName("eselmvhcaceyedrt")
    public suspend fun protectedResourceType(`value`: Output) {
        this.protectedResourceType = value
    }

    /**
     * @param value Override certain restore metadata keys. See the complete list of [restore testing inferred metadata](https://docs.aws.amazon.com/aws-backup/latest/devguide/restore-testing-inferred-metadata.html) .
     */
    @JvmName("bamjdkesioysthrc")
    public suspend fun restoreMetadataOverrides(`value`: Output>) {
        this.restoreMetadataOverrides = value
    }

    /**
     * @param value The name of the restore testing plan.
     */
    @JvmName("wlqbwetovhsmjvqh")
    public suspend fun restoreTestingPlanName(`value`: Output) {
        this.restoreTestingPlanName = value
    }

    /**
     * @param value The amount of hours available to run a validation script on the data. Valid range is `1` to `168`.
     */
    @JvmName("gamsalbajmamrihs")
    public suspend fun validationWindowHours(`value`: Output) {
        this.validationWindowHours = value
    }

    /**
     * @param value The ARN of the IAM role.
     */
    @JvmName("xksbtlevqymbyyaw")
    public suspend fun iamRoleArn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.iamRoleArn = mapped
    }

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

    /**
     * @param value The ARNs for the protected resources.
     */
    @JvmName("cuytbcygbrwkckoo")
    public suspend fun protectedResourceArns(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.protectedResourceArns = mapped
    }

    /**
     * @param values The ARNs for the protected resources.
     */
    @JvmName("mjductxdartuffrt")
    public suspend fun protectedResourceArns(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.protectedResourceArns = mapped
    }

    /**
     * @param value The conditions for the protected resource.
     */
    @JvmName("cupstclsfaqmbnjk")
    public suspend fun protectedResourceConditions(`value`: RestoreTestingSelectionProtectedResourceConditionsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.protectedResourceConditions = mapped
    }

    /**
     * @param argument The conditions for the protected resource.
     */
    @JvmName("rueibsnhjgarvtuc")
    public suspend fun protectedResourceConditions(argument: suspend RestoreTestingSelectionProtectedResourceConditionsArgsBuilder.() -> Unit) {
        val toBeMapped = RestoreTestingSelectionProtectedResourceConditionsArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.protectedResourceConditions = mapped
    }

    /**
     * @param value The type of the protected resource.
     */
    @JvmName("egkymebvjintajhh")
    public suspend fun protectedResourceType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.protectedResourceType = mapped
    }

    /**
     * @param value Override certain restore metadata keys. See the complete list of [restore testing inferred metadata](https://docs.aws.amazon.com/aws-backup/latest/devguide/restore-testing-inferred-metadata.html) .
     */
    @JvmName("snvdhipgqivcmiej")
    public suspend fun restoreMetadataOverrides(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.restoreMetadataOverrides = mapped
    }

    /**
     * @param values Override certain restore metadata keys. See the complete list of [restore testing inferred metadata](https://docs.aws.amazon.com/aws-backup/latest/devguide/restore-testing-inferred-metadata.html) .
     */
    @JvmName("ivknskfghnkymrup")
    public fun restoreMetadataOverrides(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.restoreMetadataOverrides = mapped
    }

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

    /**
     * @param value The amount of hours available to run a validation script on the data. Valid range is `1` to `168`.
     */
    @JvmName("weqhiblwtbchiciq")
    public suspend fun validationWindowHours(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.validationWindowHours = mapped
    }

    internal fun build(): RestoreTestingSelectionArgs = RestoreTestingSelectionArgs(
        iamRoleArn = iamRoleArn,
        name = name,
        protectedResourceArns = protectedResourceArns,
        protectedResourceConditions = protectedResourceConditions,
        protectedResourceType = protectedResourceType,
        restoreMetadataOverrides = restoreMetadataOverrides,
        restoreTestingPlanName = restoreTestingPlanName,
        validationWindowHours = validationWindowHours,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy