com.pulumi.awsnative.datasync.kotlin.Task.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.datasync.kotlin
import com.pulumi.awsnative.datasync.kotlin.enums.TaskStatus
import com.pulumi.awsnative.datasync.kotlin.outputs.TaskFilterRule
import com.pulumi.awsnative.datasync.kotlin.outputs.TaskManifestConfig
import com.pulumi.awsnative.datasync.kotlin.outputs.TaskOptions
import com.pulumi.awsnative.datasync.kotlin.outputs.TaskReportConfig
import com.pulumi.awsnative.datasync.kotlin.outputs.TaskSchedule
import com.pulumi.awsnative.kotlin.outputs.Tag
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 com.pulumi.awsnative.datasync.kotlin.enums.TaskStatus.Companion.toKotlin as taskStatusToKotlin
import com.pulumi.awsnative.datasync.kotlin.outputs.TaskFilterRule.Companion.toKotlin as taskFilterRuleToKotlin
import com.pulumi.awsnative.datasync.kotlin.outputs.TaskManifestConfig.Companion.toKotlin as taskManifestConfigToKotlin
import com.pulumi.awsnative.datasync.kotlin.outputs.TaskOptions.Companion.toKotlin as taskOptionsToKotlin
import com.pulumi.awsnative.datasync.kotlin.outputs.TaskReportConfig.Companion.toKotlin as taskReportConfigToKotlin
import com.pulumi.awsnative.datasync.kotlin.outputs.TaskSchedule.Companion.toKotlin as taskScheduleToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [Task].
*/
@PulumiTagMarker
public class TaskResourceBuilder internal constructor() {
public var name: String? = null
public var args: TaskArgs = TaskArgs()
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 TaskArgsBuilder.() -> Unit) {
val builder = TaskArgsBuilder()
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(): Task {
val builtJavaResource = com.pulumi.awsnative.datasync.Task(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Task(builtJavaResource)
}
}
/**
* Resource schema for AWS::DataSync::Task.
* ## Example Usage
* ### Example
* No Java example available.
* ### Example
* No Java example available.
*/
public class Task internal constructor(
override val javaResource: com.pulumi.awsnative.datasync.Task,
) : KotlinCustomResource(javaResource, TaskMapper) {
/**
* The ARN of the Amazon CloudWatch log group that is used to monitor and log events in the task.
*/
public val cloudWatchLogGroupArn: Output?
get() = javaResource.cloudWatchLogGroupArn().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The ARN of an AWS storage resource's location.
*/
public val destinationLocationArn: Output
get() = javaResource.destinationLocationArn().applyValue({ args0 -> args0 })
/**
* The ARNs of the destination elastic network interfaces (ENIs) that were created for your subnet.
*/
public val destinationNetworkInterfaceArns: Output>
get() = javaResource.destinationNetworkInterfaceArns().applyValue({ args0 ->
args0.map({ args0 ->
args0
})
})
/**
* Specifies exclude filters that define the files, objects, and folders in your source location that you don't want DataSync to transfer. For more information and examples, see [Specifying what DataSync transfers by using filters](https://docs.aws.amazon.com/datasync/latest/userguide/filtering.html) .
*/
public val excludes: Output>?
get() = javaResource.excludes().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> taskFilterRuleToKotlin(args0) })
})
}).orElse(null)
})
/**
* Specifies include filters define the files, objects, and folders in your source location that you want DataSync to transfer. For more information and examples, see [Specifying what DataSync transfers by using filters](https://docs.aws.amazon.com/datasync/latest/userguide/filtering.html) .
*/
public val includes: Output>?
get() = javaResource.includes().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> taskFilterRuleToKotlin(args0) })
})
}).orElse(null)
})
/**
* The configuration of the manifest that lists the files or objects that you want DataSync to transfer. For more information, see [Specifying what DataSync transfers by using a manifest](https://docs.aws.amazon.com/datasync/latest/userguide/transferring-with-manifest.html) .
*/
public val manifestConfig: Output?
get() = javaResource.manifestConfig().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> taskManifestConfigToKotlin(args0) })
}).orElse(null)
})
/**
* The name of a task. This value is a text reference that is used to identify the task in the console.
*/
public val name: Output?
get() = javaResource.name().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Specifies your task's settings, such as preserving file metadata, verifying data integrity, among other options.
*/
public val options: Output?
get() = javaResource.options().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
taskOptionsToKotlin(args0)
})
}).orElse(null)
})
/**
* Specifies a schedule for when you want your task to run. For more information, see [Scheduling your task](https://docs.aws.amazon.com/datasync/latest/userguide/task-scheduling.html) .
*/
public val schedule: Output?
get() = javaResource.schedule().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
taskScheduleToKotlin(args0)
})
}).orElse(null)
})
/**
* The ARN of the source location for the task.
*/
public val sourceLocationArn: Output
get() = javaResource.sourceLocationArn().applyValue({ args0 -> args0 })
/**
* The ARNs of the source ENIs that were created for your subnet.
*/
public val sourceNetworkInterfaceArns: Output>
get() = javaResource.sourceNetworkInterfaceArns().applyValue({ args0 ->
args0.map({ args0 ->
args0
})
})
/**
* The status of the task that was described.
*/
public val status: Output
get() = javaResource.status().applyValue({ args0 ->
args0.let({ args0 ->
taskStatusToKotlin(args0)
})
})
/**
* An array of key-value pairs to apply to this resource.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
/**
* The ARN of the task.
*/
public val taskArn: Output
get() = javaResource.taskArn().applyValue({ args0 -> args0 })
/**
* Specifies how you want to configure a task report, which provides detailed information about your DataSync transfer. For more information, see [Monitoring your DataSync transfers with task reports](https://docs.aws.amazon.com/datasync/latest/userguide/task-reports.html) .
* When using this parameter, your caller identity (the role that you're using DataSync with) must have the `iam:PassRole` permission. The [AWSDataSyncFullAccess](https://docs.aws.amazon.com/datasync/latest/userguide/security-iam-awsmanpol.html#security-iam-awsmanpol-awsdatasyncfullaccess) policy includes this permission.
*/
public val taskReportConfig: Output?
get() = javaResource.taskReportConfig().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> taskReportConfigToKotlin(args0) })
}).orElse(null)
})
}
public object TaskMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.datasync.Task::class == javaResource::class
override fun map(javaResource: Resource): Task = Task(
javaResource as
com.pulumi.awsnative.datasync.Task,
)
}
/**
* @see [Task].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Task].
*/
public suspend fun task(name: String, block: suspend TaskResourceBuilder.() -> Unit): Task {
val builder = TaskResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Task].
* @param name The _unique_ name of the resulting resource.
*/
public fun task(name: String): Task {
val builder = TaskResourceBuilder()
builder.name(name)
return builder.build()
}