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

com.pulumi.awsnative.datasync.kotlin.LocationS3.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.datasync.kotlin

import com.pulumi.awsnative.datasync.kotlin.enums.LocationS3S3StorageClass
import com.pulumi.awsnative.datasync.kotlin.outputs.LocationS3s3Config
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.LocationS3S3StorageClass.Companion.toKotlin as locationS3S3StorageClassToKotlin
import com.pulumi.awsnative.datasync.kotlin.outputs.LocationS3s3Config.Companion.toKotlin as locationS3s3ConfigToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: LocationS3Args = LocationS3Args()

    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 LocationS3ArgsBuilder.() -> Unit) {
        val builder = LocationS3ArgsBuilder()
        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(): LocationS3 {
        val builtJavaResource = com.pulumi.awsnative.datasync.LocationS3(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return LocationS3(builtJavaResource)
    }
}

/**
 * Resource schema for AWS::DataSync::LocationS3
 * ## Example Usage
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 */
public class LocationS3 internal constructor(
    override val javaResource: com.pulumi.awsnative.datasync.LocationS3,
) : KotlinCustomResource(javaResource, LocationS3Mapper) {
    /**
     * The Amazon Resource Name (ARN) of the Amazon S3 bucket location.
     */
    public val locationArn: Output
        get() = javaResource.locationArn().applyValue({ args0 -> args0 })

    /**
     * The URL of the S3 location that was described.
     */
    public val locationUri: Output
        get() = javaResource.locationUri().applyValue({ args0 -> args0 })

    /**
     * The Amazon Resource Name (ARN) of the Amazon S3 bucket.
     */
    public val s3BucketArn: Output?
        get() = javaResource.s3BucketArn().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that is used to access an Amazon S3 bucket.
     * For detailed information about using such a role, see [Creating a Location for Amazon S3](https://docs.aws.amazon.com/datasync/latest/userguide/working-with-locations.html#create-s3-location) in the *AWS DataSync User Guide* .
     */
    public val s3Config: Output
        get() = javaResource.s3Config().applyValue({ args0 ->
            args0.let({ args0 ->
                locationS3s3ConfigToKotlin(args0)
            })
        })

    /**
     * The Amazon S3 storage class you want to store your files in when this location is used as a task destination.
     */
    public val s3StorageClass: Output?
        get() = javaResource.s3StorageClass().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> locationS3S3StorageClassToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * A subdirectory in the Amazon S3 bucket. This subdirectory in Amazon S3 is used to read data from the S3 source location or write data to the S3 destination.
     */
    public val subdirectory: Output?
        get() = javaResource.subdirectory().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * 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)
        })
}

public object LocationS3Mapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.datasync.LocationS3::class == javaResource::class

    override fun map(javaResource: Resource): LocationS3 = LocationS3(
        javaResource as
            com.pulumi.awsnative.datasync.LocationS3,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy