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

com.pulumi.awsnative.ec2.kotlin.FlowLogArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.ec2.kotlin

import com.pulumi.awsnative.ec2.FlowLogArgs.builder
import com.pulumi.awsnative.ec2.kotlin.enums.FlowLogLogDestinationType
import com.pulumi.awsnative.ec2.kotlin.enums.FlowLogResourceType
import com.pulumi.awsnative.ec2.kotlin.enums.FlowLogTrafficType
import com.pulumi.awsnative.ec2.kotlin.inputs.DestinationOptionsPropertiesArgs
import com.pulumi.awsnative.ec2.kotlin.inputs.DestinationOptionsPropertiesArgsBuilder
import com.pulumi.awsnative.kotlin.inputs.TagArgs
import com.pulumi.awsnative.kotlin.inputs.TagArgsBuilder
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Specifies a VPC flow log, which enables you to capture IP traffic for a specific network interface, subnet, or VPC.
 * @property deliverCrossAccountRole The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts.
 * @property deliverLogsPermissionArn The ARN for the IAM role that permits Amazon EC2 to publish flow logs to a CloudWatch Logs log group in your account. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify DeliverLogsPermissionArn or LogGroupName.
 * @property destinationOptions The destination options.
 * @property logDestination Specifies the destination to which the flow log data is to be published. Flow log data can be published to a CloudWatch Logs log group, an Amazon S3 bucket, or a Kinesis Firehose stream. The value specified for this parameter depends on the value specified for LogDestinationType.
 * @property logDestinationType Specifies the type of destination to which the flow log data is to be published. Flow log data can be published to CloudWatch Logs or Amazon S3.
 * @property logFormat The fields to include in the flow log record, in the order in which they should appear.
 * @property logGroupName The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify DeliverLogsPermissionArn or LogGroupName.
 * @property maxAggregationInterval The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. You can specify 60 seconds (1 minute) or 600 seconds (10 minutes).
 * @property resourceId The ID of the subnet, network interface, or VPC for which you want to create a flow log.
 * @property resourceType The type of resource for which to create the flow log. For example, if you specified a VPC ID for the ResourceId property, specify VPC for this property.
 * @property tags The tags to apply to the flow logs.
 * @property trafficType The type of traffic to log. You can log traffic that the resource accepts or rejects, or all traffic.
 */
public data class FlowLogArgs(
    public val deliverCrossAccountRole: Output? = null,
    public val deliverLogsPermissionArn: Output? = null,
    public val destinationOptions: Output? = null,
    public val logDestination: Output? = null,
    public val logDestinationType: Output? = null,
    public val logFormat: Output? = null,
    public val logGroupName: Output? = null,
    public val maxAggregationInterval: Output? = null,
    public val resourceId: Output? = null,
    public val resourceType: Output? = null,
    public val tags: Output>? = null,
    public val trafficType: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.ec2.FlowLogArgs =
        com.pulumi.awsnative.ec2.FlowLogArgs.builder()
            .deliverCrossAccountRole(deliverCrossAccountRole?.applyValue({ args0 -> args0 }))
            .deliverLogsPermissionArn(deliverLogsPermissionArn?.applyValue({ args0 -> args0 }))
            .destinationOptions(
                destinationOptions?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .logDestination(logDestination?.applyValue({ args0 -> args0 }))
            .logDestinationType(
                logDestinationType?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .logFormat(logFormat?.applyValue({ args0 -> args0 }))
            .logGroupName(logGroupName?.applyValue({ args0 -> args0 }))
            .maxAggregationInterval(maxAggregationInterval?.applyValue({ args0 -> args0 }))
            .resourceId(resourceId?.applyValue({ args0 -> args0 }))
            .resourceType(resourceType?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .trafficType(trafficType?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [FlowLogArgs].
 */
@PulumiTagMarker
public class FlowLogArgsBuilder internal constructor() {
    private var deliverCrossAccountRole: Output? = null

    private var deliverLogsPermissionArn: Output? = null

    private var destinationOptions: Output? = null

    private var logDestination: Output? = null

    private var logDestinationType: Output? = null

    private var logFormat: Output? = null

    private var logGroupName: Output? = null

    private var maxAggregationInterval: Output? = null

    private var resourceId: Output? = null

    private var resourceType: Output? = null

    private var tags: Output>? = null

    private var trafficType: Output? = null

    /**
     * @param value The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts.
     */
    @JvmName("waoyncqgqqbkbbtg")
    public suspend fun deliverCrossAccountRole(`value`: Output) {
        this.deliverCrossAccountRole = value
    }

    /**
     * @param value The ARN for the IAM role that permits Amazon EC2 to publish flow logs to a CloudWatch Logs log group in your account. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify DeliverLogsPermissionArn or LogGroupName.
     */
    @JvmName("rqqhfechghsylwrk")
    public suspend fun deliverLogsPermissionArn(`value`: Output) {
        this.deliverLogsPermissionArn = value
    }

    /**
     * @param value The destination options.
     */
    @JvmName("qagfxcngeduygvre")
    public suspend fun destinationOptions(`value`: Output) {
        this.destinationOptions = value
    }

    /**
     * @param value Specifies the destination to which the flow log data is to be published. Flow log data can be published to a CloudWatch Logs log group, an Amazon S3 bucket, or a Kinesis Firehose stream. The value specified for this parameter depends on the value specified for LogDestinationType.
     */
    @JvmName("yfqbfdoucdctqrmv")
    public suspend fun logDestination(`value`: Output) {
        this.logDestination = value
    }

    /**
     * @param value Specifies the type of destination to which the flow log data is to be published. Flow log data can be published to CloudWatch Logs or Amazon S3.
     */
    @JvmName("qqotlnqvcvddefqs")
    public suspend fun logDestinationType(`value`: Output) {
        this.logDestinationType = value
    }

    /**
     * @param value The fields to include in the flow log record, in the order in which they should appear.
     */
    @JvmName("regwnletxekjcimw")
    public suspend fun logFormat(`value`: Output) {
        this.logFormat = value
    }

    /**
     * @param value The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify DeliverLogsPermissionArn or LogGroupName.
     */
    @JvmName("pgulghnsabsfvshe")
    public suspend fun logGroupName(`value`: Output) {
        this.logGroupName = value
    }

    /**
     * @param value The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. You can specify 60 seconds (1 minute) or 600 seconds (10 minutes).
     */
    @JvmName("nnfjxvqvvnuuvglv")
    public suspend fun maxAggregationInterval(`value`: Output) {
        this.maxAggregationInterval = value
    }

    /**
     * @param value The ID of the subnet, network interface, or VPC for which you want to create a flow log.
     */
    @JvmName("vxatknedlkhjavmn")
    public suspend fun resourceId(`value`: Output) {
        this.resourceId = value
    }

    /**
     * @param value The type of resource for which to create the flow log. For example, if you specified a VPC ID for the ResourceId property, specify VPC for this property.
     */
    @JvmName("cwvqugnnnbyroela")
    public suspend fun resourceType(`value`: Output) {
        this.resourceType = value
    }

    /**
     * @param value The tags to apply to the flow logs.
     */
    @JvmName("huaivvirdxckoapt")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

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

    /**
     * @param values The tags to apply to the flow logs.
     */
    @JvmName("jotgciwshumgqekl")
    public suspend fun tags(values: List>) {
        this.tags = Output.all(values)
    }

    /**
     * @param value The type of traffic to log. You can log traffic that the resource accepts or rejects, or all traffic.
     */
    @JvmName("kdotcopgmlvaewgr")
    public suspend fun trafficType(`value`: Output) {
        this.trafficType = value
    }

    /**
     * @param value The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts.
     */
    @JvmName("aevnefunagtlgsbv")
    public suspend fun deliverCrossAccountRole(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.deliverCrossAccountRole = mapped
    }

    /**
     * @param value The ARN for the IAM role that permits Amazon EC2 to publish flow logs to a CloudWatch Logs log group in your account. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify DeliverLogsPermissionArn or LogGroupName.
     */
    @JvmName("bvdvrfmxemkbxslm")
    public suspend fun deliverLogsPermissionArn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.deliverLogsPermissionArn = mapped
    }

    /**
     * @param value The destination options.
     */
    @JvmName("rtdiagkpiawdufpm")
    public suspend fun destinationOptions(`value`: DestinationOptionsPropertiesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationOptions = mapped
    }

    /**
     * @param argument The destination options.
     */
    @JvmName("yosbxlvbvjabooue")
    public suspend fun destinationOptions(argument: suspend DestinationOptionsPropertiesArgsBuilder.() -> Unit) {
        val toBeMapped = DestinationOptionsPropertiesArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.destinationOptions = mapped
    }

    /**
     * @param value Specifies the destination to which the flow log data is to be published. Flow log data can be published to a CloudWatch Logs log group, an Amazon S3 bucket, or a Kinesis Firehose stream. The value specified for this parameter depends on the value specified for LogDestinationType.
     */
    @JvmName("ggnksmtqkwmsuiat")
    public suspend fun logDestination(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.logDestination = mapped
    }

    /**
     * @param value Specifies the type of destination to which the flow log data is to be published. Flow log data can be published to CloudWatch Logs or Amazon S3.
     */
    @JvmName("tbeailwdcrrxokfv")
    public suspend fun logDestinationType(`value`: FlowLogLogDestinationType?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.logDestinationType = mapped
    }

    /**
     * @param value The fields to include in the flow log record, in the order in which they should appear.
     */
    @JvmName("vtomghbqdopfxeon")
    public suspend fun logFormat(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.logFormat = mapped
    }

    /**
     * @param value The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify DeliverLogsPermissionArn or LogGroupName.
     */
    @JvmName("lsasxdkejfrcertn")
    public suspend fun logGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.logGroupName = mapped
    }

    /**
     * @param value The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. You can specify 60 seconds (1 minute) or 600 seconds (10 minutes).
     */
    @JvmName("hkhjuixxaidbpsuv")
    public suspend fun maxAggregationInterval(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxAggregationInterval = mapped
    }

    /**
     * @param value The ID of the subnet, network interface, or VPC for which you want to create a flow log.
     */
    @JvmName("jkjvdhrfvenhveko")
    public suspend fun resourceId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceId = mapped
    }

    /**
     * @param value The type of resource for which to create the flow log. For example, if you specified a VPC ID for the ResourceId property, specify VPC for this property.
     */
    @JvmName("rusbxypyeywcjljc")
    public suspend fun resourceType(`value`: FlowLogResourceType?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceType = mapped
    }

    /**
     * @param value The tags to apply to the flow logs.
     */
    @JvmName("yuhdfqtkafuolbfe")
    public suspend fun tags(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param argument The tags to apply to the flow logs.
     */
    @JvmName("mqtuarosulhruhxx")
    public suspend fun tags(argument: List Unit>) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument The tags to apply to the flow logs.
     */
    @JvmName("agfuypipshahmoxq")
    public suspend fun tags(vararg argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument The tags to apply to the flow logs.
     */
    @JvmName("ufemggeyvqsxcvvm")
    public suspend fun tags(argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TagArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param values The tags to apply to the flow logs.
     */
    @JvmName("lxelugotrankbiay")
    public suspend fun tags(vararg values: TagArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value The type of traffic to log. You can log traffic that the resource accepts or rejects, or all traffic.
     */
    @JvmName("noypesqxuhjdlfco")
    public suspend fun trafficType(`value`: FlowLogTrafficType?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.trafficType = mapped
    }

    internal fun build(): FlowLogArgs = FlowLogArgs(
        deliverCrossAccountRole = deliverCrossAccountRole,
        deliverLogsPermissionArn = deliverLogsPermissionArn,
        destinationOptions = destinationOptions,
        logDestination = logDestination,
        logDestinationType = logDestinationType,
        logFormat = logFormat,
        logGroupName = logGroupName,
        maxAggregationInterval = maxAggregationInterval,
        resourceId = resourceId,
        resourceType = resourceType,
        tags = tags,
        trafficType = trafficType,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy