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

com.pulumi.awsnative.s3.kotlin.AccessGrant.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.s3.kotlin

import com.pulumi.awsnative.kotlin.outputs.CreateOnlyTag
import com.pulumi.awsnative.s3.kotlin.enums.AccessGrantPermission
import com.pulumi.awsnative.s3.kotlin.enums.AccessGrantS3PrefixType
import com.pulumi.awsnative.s3.kotlin.outputs.AccessGrantGrantee
import com.pulumi.awsnative.s3.kotlin.outputs.AccessGrantsLocationConfiguration
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.kotlin.outputs.CreateOnlyTag.Companion.toKotlin as createOnlyTagToKotlin
import com.pulumi.awsnative.s3.kotlin.enums.AccessGrantPermission.Companion.toKotlin as accessGrantPermissionToKotlin
import com.pulumi.awsnative.s3.kotlin.enums.AccessGrantS3PrefixType.Companion.toKotlin as accessGrantS3PrefixTypeToKotlin
import com.pulumi.awsnative.s3.kotlin.outputs.AccessGrantGrantee.Companion.toKotlin as accessGrantGranteeToKotlin
import com.pulumi.awsnative.s3.kotlin.outputs.AccessGrantsLocationConfiguration.Companion.toKotlin as accessGrantsLocationConfigurationToKotlin

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

    public var args: AccessGrantArgs = AccessGrantArgs()

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

/**
 * The AWS::S3::AccessGrant resource is an Amazon S3 resource type representing permissions to a specific S3 bucket or prefix hosted in an S3 Access Grants instance.
 */
public class AccessGrant internal constructor(
    override val javaResource: com.pulumi.awsnative.s3.AccessGrant,
) : KotlinCustomResource(javaResource, AccessGrantMapper) {
    /**
     * The Amazon Resource Name (ARN) of the specified access grant.
     */
    public val accessGrantArn: Output
        get() = javaResource.accessGrantArn().applyValue({ args0 -> args0 })

    /**
     * The ID assigned to this access grant.
     */
    public val accessGrantId: Output
        get() = javaResource.accessGrantId().applyValue({ args0 -> args0 })

    /**
     * The configuration options of the grant location, which is the S3 path to the data to which you are granting access.
     */
    public val accessGrantsLocationConfiguration: Output?
        get() = javaResource.accessGrantsLocationConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    accessGrantsLocationConfigurationToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The custom S3 location to be accessed by the grantee
     */
    public val accessGrantsLocationId: Output
        get() = javaResource.accessGrantsLocationId().applyValue({ args0 -> args0 })

    /**
     * The ARN of the application grantees will use to access the location
     */
    public val applicationArn: Output?
        get() = javaResource.applicationArn().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The S3 path of the data to which you are granting access. It is a combination of the S3 path of the registered location and the subprefix.
     */
    public val grantScope: Output
        get() = javaResource.grantScope().applyValue({ args0 -> args0 })

    /**
     * The principal who will be granted permission to access S3.
     */
    public val grantee: Output
        get() = javaResource.grantee().applyValue({ args0 ->
            args0.let({ args0 ->
                accessGrantGranteeToKotlin(args0)
            })
        })

    /**
     * The level of access to be afforded to the grantee
     */
    public val permission: Output
        get() = javaResource.permission().applyValue({ args0 ->
            args0.let({ args0 ->
                accessGrantPermissionToKotlin(args0)
            })
        })

    /**
     * The type of S3SubPrefix.
     */
    public val s3PrefixType: Output?
        get() = javaResource.s3PrefixType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    accessGrantS3PrefixTypeToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The AWS resource tags that you are adding to the access grant. Each tag is a label consisting of a user-defined key and value. Tags can help you manage, identify, organize, search for, and filter resources.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> createOnlyTagToKotlin(args0) })
                })
            }).orElse(null)
        })
}

public object AccessGrantMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.s3.AccessGrant::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy