com.pulumi.aws.wafv2.kotlin.WebAclAssociation.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-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.aws.wafv2.kotlin
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
/**
* Builder for [WebAclAssociation].
*/
@PulumiTagMarker
public class WebAclAssociationResourceBuilder internal constructor() {
public var name: String? = null
public var args: WebAclAssociationArgs = WebAclAssociationArgs()
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 WebAclAssociationArgsBuilder.() -> Unit) {
val builder = WebAclAssociationArgsBuilder()
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(): WebAclAssociation {
val builtJavaResource = com.pulumi.aws.wafv2.WebAclAssociation(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return WebAclAssociation(builtJavaResource)
}
}
/**
* Creates a WAFv2 Web ACL Association.
* > **NOTE on associating a WAFv2 Web ACL with a Cloudfront distribution:** Do not use this resource to associate a WAFv2 Web ACL with a Cloudfront Distribution. The [AWS API call backing this resource](https://docs.aws.amazon.com/waf/latest/APIReference/API_AssociateWebACL.html) notes that you should use the `web_acl_id` property on the `cloudfront_distribution` instead.
* [1]: https://docs.aws.amazon.com/waf/latest/APIReference/API_AssociateWebACL.html
* ## Import
* Using `pulumi import`, import WAFv2 Web ACL Association using `WEB_ACL_ARN,RESOURCE_ARN`. For example:
* ```sh
* $ pulumi import aws:wafv2/webAclAssociation:WebAclAssociation example arn:aws:wafv2:...7ce849ea,arn:aws:apigateway:...ages/name
* ```
*/
public class WebAclAssociation internal constructor(
override val javaResource: com.pulumi.aws.wafv2.WebAclAssociation,
) : KotlinCustomResource(javaResource, WebAclAssociationMapper) {
/**
* The Amazon Resource Name (ARN) of the resource to associate with the web ACL. This must be an ARN of an Application Load Balancer, an Amazon API Gateway stage (REST only, HTTP is unsupported), an Amazon Cognito User Pool, an Amazon AppSync GraphQL API, an Amazon App Runner service, or an Amazon Verified Access instance.
*/
public val resourceArn: Output
get() = javaResource.resourceArn().applyValue({ args0 -> args0 })
/**
* The Amazon Resource Name (ARN) of the Web ACL that you want to associate with the resource.
*/
public val webAclArn: Output
get() = javaResource.webAclArn().applyValue({ args0 -> args0 })
}
public object WebAclAssociationMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.aws.wafv2.WebAclAssociation::class == javaResource::class
override fun map(javaResource: Resource): WebAclAssociation = WebAclAssociation(
javaResource as
com.pulumi.aws.wafv2.WebAclAssociation,
)
}
/**
* @see [WebAclAssociation].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [WebAclAssociation].
*/
public suspend fun webAclAssociation(
name: String,
block: suspend WebAclAssociationResourceBuilder.() -> Unit,
): WebAclAssociation {
val builder = WebAclAssociationResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [WebAclAssociation].
* @param name The _unique_ name of the resulting resource.
*/
public fun webAclAssociation(name: String): WebAclAssociation {
val builder = WebAclAssociationResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy