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

com.pulumi.awsnative.wafv2.kotlin.Wafv2Functions.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 1.11.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.wafv2.kotlin

import com.pulumi.awsnative.wafv2.Wafv2Functions.getIpSetPlain
import com.pulumi.awsnative.wafv2.Wafv2Functions.getLoggingConfigurationPlain
import com.pulumi.awsnative.wafv2.Wafv2Functions.getRegexPatternSetPlain
import com.pulumi.awsnative.wafv2.Wafv2Functions.getRuleGroupPlain
import com.pulumi.awsnative.wafv2.Wafv2Functions.getWebAclPlain
import com.pulumi.awsnative.wafv2.kotlin.enums.IpSetScope
import com.pulumi.awsnative.wafv2.kotlin.enums.RegexPatternSetScope
import com.pulumi.awsnative.wafv2.kotlin.enums.RuleGroupScope
import com.pulumi.awsnative.wafv2.kotlin.enums.WebAclScope
import com.pulumi.awsnative.wafv2.kotlin.inputs.GetIpSetPlainArgs
import com.pulumi.awsnative.wafv2.kotlin.inputs.GetIpSetPlainArgsBuilder
import com.pulumi.awsnative.wafv2.kotlin.inputs.GetLoggingConfigurationPlainArgs
import com.pulumi.awsnative.wafv2.kotlin.inputs.GetLoggingConfigurationPlainArgsBuilder
import com.pulumi.awsnative.wafv2.kotlin.inputs.GetRegexPatternSetPlainArgs
import com.pulumi.awsnative.wafv2.kotlin.inputs.GetRegexPatternSetPlainArgsBuilder
import com.pulumi.awsnative.wafv2.kotlin.inputs.GetRuleGroupPlainArgs
import com.pulumi.awsnative.wafv2.kotlin.inputs.GetRuleGroupPlainArgsBuilder
import com.pulumi.awsnative.wafv2.kotlin.inputs.GetWebAclPlainArgs
import com.pulumi.awsnative.wafv2.kotlin.inputs.GetWebAclPlainArgsBuilder
import com.pulumi.awsnative.wafv2.kotlin.outputs.GetIpSetResult
import com.pulumi.awsnative.wafv2.kotlin.outputs.GetLoggingConfigurationResult
import com.pulumi.awsnative.wafv2.kotlin.outputs.GetRegexPatternSetResult
import com.pulumi.awsnative.wafv2.kotlin.outputs.GetRuleGroupResult
import com.pulumi.awsnative.wafv2.kotlin.outputs.GetWebAclResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.awsnative.wafv2.kotlin.outputs.GetIpSetResult.Companion.toKotlin as getIpSetResultToKotlin
import com.pulumi.awsnative.wafv2.kotlin.outputs.GetLoggingConfigurationResult.Companion.toKotlin as getLoggingConfigurationResultToKotlin
import com.pulumi.awsnative.wafv2.kotlin.outputs.GetRegexPatternSetResult.Companion.toKotlin as getRegexPatternSetResultToKotlin
import com.pulumi.awsnative.wafv2.kotlin.outputs.GetRuleGroupResult.Companion.toKotlin as getRuleGroupResultToKotlin
import com.pulumi.awsnative.wafv2.kotlin.outputs.GetWebAclResult.Companion.toKotlin as getWebAclResultToKotlin

public object Wafv2Functions {
    /**
     * Contains a list of IP addresses. This can be either IPV4 or IPV6. The list will be mutually
     * @param argument null
     * @return null
     */
    public suspend fun getIpSet(argument: GetIpSetPlainArgs): GetIpSetResult =
        getIpSetResultToKotlin(getIpSetPlain(argument.toJava()).await())

    /**
     * @see [getIpSet].
     * @param id The ID of the IP set.
     * @param name The name of the IP set. You cannot change the name of an `IPSet` after you create it.
     * @param scope Specifies whether this is for an Amazon CloudFront distribution or for a regional application. A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AWS AppSync GraphQL API, an Amazon Cognito user pool, an AWS App Runner service, or an AWS Verified Access instance. Valid Values are `CLOUDFRONT` and `REGIONAL` .
     * > For `CLOUDFRONT` , you must create your WAFv2 resources in the US East (N. Virginia) Region, `us-east-1` .
     * @return null
     */
    public suspend fun getIpSet(
        id: String,
        name: String,
        scope: IpSetScope,
    ): GetIpSetResult {
        val argument = GetIpSetPlainArgs(
            id = id,
            name = name,
            scope = scope,
        )
        return getIpSetResultToKotlin(getIpSetPlain(argument.toJava()).await())
    }

    /**
     * @see [getIpSet].
     * @param argument Builder for [com.pulumi.awsnative.wafv2.kotlin.inputs.GetIpSetPlainArgs].
     * @return null
     */
    public suspend fun getIpSet(argument: suspend GetIpSetPlainArgsBuilder.() -> Unit): GetIpSetResult {
        val builder = GetIpSetPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getIpSetResultToKotlin(getIpSetPlain(builtArgument.toJava()).await())
    }

    /**
     * A WAFv2 Logging Configuration Resource Provider
     * @param argument null
     * @return null
     */
    public suspend fun getLoggingConfiguration(argument: GetLoggingConfigurationPlainArgs): GetLoggingConfigurationResult =
        getLoggingConfigurationResultToKotlin(getLoggingConfigurationPlain(argument.toJava()).await())

    /**
     * @see [getLoggingConfiguration].
     * @param resourceArn The Amazon Resource Name (ARN) of the web ACL that you want to associate with LogDestinationConfigs.
     * @return null
     */
    public suspend fun getLoggingConfiguration(resourceArn: String): GetLoggingConfigurationResult {
        val argument = GetLoggingConfigurationPlainArgs(
            resourceArn = resourceArn,
        )
        return getLoggingConfigurationResultToKotlin(getLoggingConfigurationPlain(argument.toJava()).await())
    }

    /**
     * @see [getLoggingConfiguration].
     * @param argument Builder for [com.pulumi.awsnative.wafv2.kotlin.inputs.GetLoggingConfigurationPlainArgs].
     * @return null
     */
    public suspend fun getLoggingConfiguration(argument: suspend GetLoggingConfigurationPlainArgsBuilder.() -> Unit): GetLoggingConfigurationResult {
        val builder = GetLoggingConfigurationPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getLoggingConfigurationResultToKotlin(getLoggingConfigurationPlain(builtArgument.toJava()).await())
    }

    /**
     * Contains a list of Regular expressions based on the provided inputs. RegexPatternSet can be used with other WAF entities with RegexPatternSetReferenceStatement to perform other actions .
     * @param argument null
     * @return null
     */
    public suspend fun getRegexPatternSet(argument: GetRegexPatternSetPlainArgs): GetRegexPatternSetResult =
        getRegexPatternSetResultToKotlin(getRegexPatternSetPlain(argument.toJava()).await())

    /**
     * @see [getRegexPatternSet].
     * @param id Id of the RegexPatternSet
     * @param name Name of the RegexPatternSet.
     * @param scope Use CLOUDFRONT for CloudFront RegexPatternSet, use REGIONAL for Application Load Balancer and API Gateway.
     * @return null
     */
    public suspend fun getRegexPatternSet(
        id: String,
        name: String,
        scope: RegexPatternSetScope,
    ): GetRegexPatternSetResult {
        val argument = GetRegexPatternSetPlainArgs(
            id = id,
            name = name,
            scope = scope,
        )
        return getRegexPatternSetResultToKotlin(getRegexPatternSetPlain(argument.toJava()).await())
    }

    /**
     * @see [getRegexPatternSet].
     * @param argument Builder for [com.pulumi.awsnative.wafv2.kotlin.inputs.GetRegexPatternSetPlainArgs].
     * @return null
     */
    public suspend fun getRegexPatternSet(argument: suspend GetRegexPatternSetPlainArgsBuilder.() -> Unit): GetRegexPatternSetResult {
        val builder = GetRegexPatternSetPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getRegexPatternSetResultToKotlin(getRegexPatternSetPlain(builtArgument.toJava()).await())
    }

    /**
     * Contains the Rules that identify the requests that you want to allow, block, or count. In a RuleGroup, you also specify a default action (ALLOW or BLOCK), and the action for each Rule that you add to a RuleGroup, for example, block requests from specified IP addresses or block requests from specified referrers. You also associate the RuleGroup with a CloudFront distribution to identify the requests that you want AWS WAF to filter. If you add more than one Rule to a RuleGroup, a request needs to match only one of the specifications to be allowed, blocked, or counted.
     * @param argument null
     * @return null
     */
    public suspend fun getRuleGroup(argument: GetRuleGroupPlainArgs): GetRuleGroupResult =
        getRuleGroupResultToKotlin(getRuleGroupPlain(argument.toJava()).await())

    /**
     * @see [getRuleGroup].
     * @param id The ID of the rule group.
     * @param name The name of the rule group. You cannot change the name of a rule group after you create it.
     * @param scope Specifies whether this is for an Amazon CloudFront distribution or for a regional application. A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AWS AppSync GraphQL API, an Amazon Cognito user pool, an AWS App Runner service, or an AWS Verified Access instance. Valid Values are `CLOUDFRONT` and `REGIONAL` .
     * > For `CLOUDFRONT` , you must create your WAFv2 resources in the US East (N. Virginia) Region, `us-east-1` .
     * @return null
     */
    public suspend fun getRuleGroup(
        id: String,
        name: String,
        scope: RuleGroupScope,
    ): GetRuleGroupResult {
        val argument = GetRuleGroupPlainArgs(
            id = id,
            name = name,
            scope = scope,
        )
        return getRuleGroupResultToKotlin(getRuleGroupPlain(argument.toJava()).await())
    }

    /**
     * @see [getRuleGroup].
     * @param argument Builder for [com.pulumi.awsnative.wafv2.kotlin.inputs.GetRuleGroupPlainArgs].
     * @return null
     */
    public suspend fun getRuleGroup(argument: suspend GetRuleGroupPlainArgsBuilder.() -> Unit): GetRuleGroupResult {
        val builder = GetRuleGroupPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getRuleGroupResultToKotlin(getRuleGroupPlain(builtArgument.toJava()).await())
    }

    /**
     * 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.
     * @param argument null
     * @return null
     */
    public suspend fun getWebAcl(argument: GetWebAclPlainArgs): GetWebAclResult =
        getWebAclResultToKotlin(getWebAclPlain(argument.toJava()).await())

    /**
     * @see [getWebAcl].
     * @param id The ID of the web ACL.
     * @param name The name of the web ACL. You cannot change the name of a web ACL after you create it.
     * @param scope Specifies whether this is for an Amazon CloudFront distribution or for a regional application. A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AWS AppSync GraphQL API, an Amazon Cognito user pool, an AWS App Runner service, or an AWS Verified Access instance. Valid Values are `CLOUDFRONT` and `REGIONAL` .
     * > For `CLOUDFRONT` , you must create your WAFv2 resources in the US East (N. Virginia) Region, `us-east-1` .
     * For information about how to define the association of the web ACL with your resource, see `WebACLAssociation` .
     * @return null
     */
    public suspend fun getWebAcl(
        id: String,
        name: String,
        scope: WebAclScope,
    ): GetWebAclResult {
        val argument = GetWebAclPlainArgs(
            id = id,
            name = name,
            scope = scope,
        )
        return getWebAclResultToKotlin(getWebAclPlain(argument.toJava()).await())
    }

    /**
     * @see [getWebAcl].
     * @param argument Builder for [com.pulumi.awsnative.wafv2.kotlin.inputs.GetWebAclPlainArgs].
     * @return null
     */
    public suspend fun getWebAcl(argument: suspend GetWebAclPlainArgsBuilder.() -> Unit): GetWebAclResult {
        val builder = GetWebAclPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getWebAclResultToKotlin(getWebAclPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy