com.pulumi.awsnative.shield.kotlin.ProtectionGroup.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.shield.kotlin
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.shield.kotlin.enums.ProtectionGroupAggregation
import com.pulumi.awsnative.shield.kotlin.enums.ProtectionGroupPattern
import com.pulumi.awsnative.shield.kotlin.enums.ProtectionGroupResourceType
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.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.shield.kotlin.enums.ProtectionGroupAggregation.Companion.toKotlin as protectionGroupAggregationToKotlin
import com.pulumi.awsnative.shield.kotlin.enums.ProtectionGroupPattern.Companion.toKotlin as protectionGroupPatternToKotlin
import com.pulumi.awsnative.shield.kotlin.enums.ProtectionGroupResourceType.Companion.toKotlin as protectionGroupResourceTypeToKotlin
/**
* Builder for [ProtectionGroup].
*/
@PulumiTagMarker
public class ProtectionGroupResourceBuilder internal constructor() {
public var name: String? = null
public var args: ProtectionGroupArgs = ProtectionGroupArgs()
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 ProtectionGroupArgsBuilder.() -> Unit) {
val builder = ProtectionGroupArgsBuilder()
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(): ProtectionGroup {
val builtJavaResource = com.pulumi.awsnative.shield.ProtectionGroup(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return ProtectionGroup(builtJavaResource)
}
}
/**
* A grouping of protected resources so they can be handled as a collective. This resource grouping improves the accuracy of detection and reduces false positives.
* ## Example Usage
* ### Example
* No Java example available.
* ### Example
* No Java example available.
* ### Example
* No Java example available.
* ### Example
* No Java example available.
*/
public class ProtectionGroup internal constructor(
override val javaResource: com.pulumi.awsnative.shield.ProtectionGroup,
) : KotlinCustomResource(javaResource, ProtectionGroupMapper) {
/**
* Defines how AWS Shield combines resource data for the group in order to detect, mitigate, and report events.
* * Sum - Use the total traffic across the group. This is a good choice for most cases. Examples include Elastic IP addresses for EC2 instances that scale manually or automatically.
* * Mean - Use the average of the traffic across the group. This is a good choice for resources that share traffic uniformly. Examples include accelerators and load balancers.
* * Max - Use the highest traffic from each resource. This is useful for resources that don't share traffic and for resources that share that traffic in a non-uniform way. Examples include Amazon CloudFront and origin resources for CloudFront distributions.
*/
public val aggregation: Output
get() = javaResource.aggregation().applyValue({ args0 ->
args0.let({ args0 ->
protectionGroupAggregationToKotlin(args0)
})
})
/**
* The Amazon Resource Names (ARNs) of the resources to include in the protection group. You must set this when you set `Pattern` to `ARBITRARY` and you must not set it for any other `Pattern` setting.
*/
public val members: Output>?
get() = javaResource.members().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0
})
}).orElse(null)
})
/**
* The criteria to use to choose the protected resources for inclusion in the group. You can include all resources that have protections, provide a list of resource Amazon Resource Names (ARNs), or include all resources of a specified resource type.
*/
public val pattern: Output
get() = javaResource.pattern().applyValue({ args0 ->
args0.let({ args0 ->
protectionGroupPatternToKotlin(args0)
})
})
/**
* The ARN (Amazon Resource Name) of the protection group.
*/
public val protectionGroupArn: Output
get() = javaResource.protectionGroupArn().applyValue({ args0 -> args0 })
/**
* The name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.
*/
public val protectionGroupId: Output
get() = javaResource.protectionGroupId().applyValue({ args0 -> args0 })
/**
* The resource type to include in the protection group. All protected resources of this type are included in the protection group. Newly protected resources of this type are automatically added to the group. You must set this when you set `Pattern` to `BY_RESOURCE_TYPE` and you must not set it for any other `Pattern` setting.
*/
public val resourceType: Output?
get() = javaResource.resourceType().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
protectionGroupResourceTypeToKotlin(args0)
})
}).orElse(null)
})
/**
* One or more tag key-value pairs for the Protection object.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
}
public object ProtectionGroupMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.shield.ProtectionGroup::class == javaResource::class
override fun map(javaResource: Resource): ProtectionGroup = ProtectionGroup(
javaResource as
com.pulumi.awsnative.shield.ProtectionGroup,
)
}
/**
* @see [ProtectionGroup].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [ProtectionGroup].
*/
public suspend fun protectionGroup(
name: String,
block: suspend ProtectionGroupResourceBuilder.() -> Unit,
): ProtectionGroup {
val builder = ProtectionGroupResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [ProtectionGroup].
* @param name The _unique_ name of the resulting resource.
*/
public fun protectionGroup(name: String): ProtectionGroup {
val builder = ProtectionGroupResourceBuilder()
builder.name(name)
return builder.build()
}