com.pulumi.awsnative.wafv2.kotlin.WebAcl.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.wafv2.kotlin
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.wafv2.kotlin.enums.WebAclScope
import com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclAssociationConfig
import com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclCaptchaConfig
import com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclChallengeConfig
import com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclCustomResponseBody
import com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclDefaultAction
import com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclRule
import com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclVisibilityConfig
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.wafv2.kotlin.enums.WebAclScope.Companion.toKotlin as webAclScopeToKotlin
import com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclAssociationConfig.Companion.toKotlin as webAclAssociationConfigToKotlin
import com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclCaptchaConfig.Companion.toKotlin as webAclCaptchaConfigToKotlin
import com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclChallengeConfig.Companion.toKotlin as webAclChallengeConfigToKotlin
import com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclCustomResponseBody.Companion.toKotlin as webAclCustomResponseBodyToKotlin
import com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclDefaultAction.Companion.toKotlin as webAclDefaultActionToKotlin
import com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclRule.Companion.toKotlin as webAclRuleToKotlin
import com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclVisibilityConfig.Companion.toKotlin as webAclVisibilityConfigToKotlin
/**
* Builder for [WebAcl].
*/
@PulumiTagMarker
public class WebAclResourceBuilder internal constructor() {
public var name: String? = null
public var args: WebAclArgs = WebAclArgs()
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 WebAclArgsBuilder.() -> Unit) {
val builder = WebAclArgsBuilder()
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(): WebAcl {
val builtJavaResource = com.pulumi.awsnative.wafv2.WebAcl(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return WebAcl(builtJavaResource)
}
}
/**
* Contains the Rules that identify the requests that you want to allow, block, or count. In a WebACL, you also specify a default action (ALLOW or BLOCK), and the action for each Rule that you add to a WebACL, for example, block requests from specified IP addresses or block requests from specified referrers. You also associate the WebACL with a CloudFront distribution to identify the requests that you want AWS WAF to filter. If you add more than one Rule to a WebACL, a request needs to match only one of the specifications to be allowed, blocked, or counted.
*/
public class WebAcl internal constructor(
override val javaResource: com.pulumi.awsnative.wafv2.WebAcl,
) : KotlinCustomResource(javaResource, WebAclMapper) {
/**
* The Amazon Resource Name (ARN) of the web ACL.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* Specifies custom configurations for the associations between the web ACL and protected resources.
* Use this to customize the maximum size of the request body that your protected resources forward to AWS WAF for inspection. You can customize this setting for CloudFront, API Gateway, Amazon Cognito, App Runner, or Verified Access resources. The default setting is 16 KB (16,384 bytes).
* > You are charged additional fees when your protected resources forward body sizes that are larger than the default. For more information, see [AWS WAF Pricing](https://docs.aws.amazon.com/waf/pricing/) .
* For Application Load Balancer and AWS AppSync , the limit is fixed at 8 KB (8,192 bytes).
*/
public val associationConfig: Output?
get() = javaResource.associationConfig().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> webAclAssociationConfigToKotlin(args0) })
}).orElse(null)
})
/**
* The ID of the web ACL.
*/
public val awsId: Output
get() = javaResource.awsId().applyValue({ args0 -> args0 })
/**
* The web ACL capacity units (WCUs) currently being used by this web ACL.
* AWS WAF uses WCUs to calculate and control the operating resources that are used to run your rules, rule groups, and web ACLs. AWS WAF calculates capacity differently for each rule type, to reflect the relative cost of each rule. Simple rules that cost little to run use fewer WCUs than more complex rules that use more processing power. Rule group capacity is fixed at creation, which helps users plan their web ACL WCU usage when they use a rule group. The WCU limit for web ACLs is 1,500.
*/
public val capacity: Output
get() = javaResource.capacity().applyValue({ args0 -> args0 })
/**
* Specifies how AWS WAF should handle `CAPTCHA` evaluations for rules that don't have their own `CaptchaConfig` settings. If you don't specify this, AWS WAF uses its default settings for `CaptchaConfig` .
*/
public val captchaConfig: Output?
get() = javaResource.captchaConfig().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> webAclCaptchaConfigToKotlin(args0) })
}).orElse(null)
})
/**
* Specifies how AWS WAF should handle challenge evaluations for rules that don't have their own `ChallengeConfig` settings. If you don't specify this, AWS WAF uses its default settings for `ChallengeConfig` .
*/
public val challengeConfig: Output?
get() = javaResource.challengeConfig().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> webAclChallengeConfigToKotlin(args0) })
}).orElse(null)
})
/**
* A map of custom response keys and content bodies. When you create a rule with a block action, you can send a custom response to the web request. You define these for the web ACL, and then use them in the rules and default actions that you define in the web ACL.
* For information about customizing web requests and responses, see [Customizing web requests and responses in AWS WAF](https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html) in the *AWS WAF Developer Guide* .
* For information about the limits on count and size for custom request and response settings, see [AWS WAF quotas](https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the *AWS WAF Developer Guide* .
*/
public val customResponseBodies: Output