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

com.pulumi.aws.wafregional.RateBasedRuleArgs Maven / Gradle / Ivy

// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.aws.wafregional;

import com.pulumi.aws.wafregional.inputs.RateBasedRulePredicateArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class RateBasedRuleArgs extends com.pulumi.resources.ResourceArgs {

    public static final RateBasedRuleArgs Empty = new RateBasedRuleArgs();

    /**
     * The name or description for the Amazon CloudWatch metric of this rule.
     * 
     */
    @Import(name="metricName", required=true)
    private Output metricName;

    /**
     * @return The name or description for the Amazon CloudWatch metric of this rule.
     * 
     */
    public Output metricName() {
        return this.metricName;
    }

    /**
     * The name or description of the rule.
     * 
     */
    @Import(name="name")
    private @Nullable Output name;

    /**
     * @return The name or description of the rule.
     * 
     */
    public Optional> name() {
        return Optional.ofNullable(this.name);
    }

    /**
     * The objects to include in a rule (documented below).
     * 
     */
    @Import(name="predicates")
    private @Nullable Output> predicates;

    /**
     * @return The objects to include in a rule (documented below).
     * 
     */
    public Optional>> predicates() {
        return Optional.ofNullable(this.predicates);
    }

    /**
     * Valid value is IP.
     * 
     */
    @Import(name="rateKey", required=true)
    private Output rateKey;

    /**
     * @return Valid value is IP.
     * 
     */
    public Output rateKey() {
        return this.rateKey;
    }

    /**
     * The maximum number of requests, which have an identical value in the field specified by the RateKey, allowed in a five-minute period. Minimum value is 100.
     * 
     */
    @Import(name="rateLimit", required=true)
    private Output rateLimit;

    /**
     * @return The maximum number of requests, which have an identical value in the field specified by the RateKey, allowed in a five-minute period. Minimum value is 100.
     * 
     */
    public Output rateLimit() {
        return this.rateLimit;
    }

    /**
     * Key-value map of resource tags. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     * 
     */
    @Import(name="tags")
    private @Nullable Output> tags;

    /**
     * @return Key-value map of resource tags. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     * 
     */
    public Optional>> tags() {
        return Optional.ofNullable(this.tags);
    }

    private RateBasedRuleArgs() {}

    private RateBasedRuleArgs(RateBasedRuleArgs $) {
        this.metricName = $.metricName;
        this.name = $.name;
        this.predicates = $.predicates;
        this.rateKey = $.rateKey;
        this.rateLimit = $.rateLimit;
        this.tags = $.tags;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(RateBasedRuleArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private RateBasedRuleArgs $;

        public Builder() {
            $ = new RateBasedRuleArgs();
        }

        public Builder(RateBasedRuleArgs defaults) {
            $ = new RateBasedRuleArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param metricName The name or description for the Amazon CloudWatch metric of this rule.
         * 
         * @return builder
         * 
         */
        public Builder metricName(Output metricName) {
            $.metricName = metricName;
            return this;
        }

        /**
         * @param metricName The name or description for the Amazon CloudWatch metric of this rule.
         * 
         * @return builder
         * 
         */
        public Builder metricName(String metricName) {
            return metricName(Output.of(metricName));
        }

        /**
         * @param name The name or description of the rule.
         * 
         * @return builder
         * 
         */
        public Builder name(@Nullable Output name) {
            $.name = name;
            return this;
        }

        /**
         * @param name The name or description of the rule.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param predicates The objects to include in a rule (documented below).
         * 
         * @return builder
         * 
         */
        public Builder predicates(@Nullable Output> predicates) {
            $.predicates = predicates;
            return this;
        }

        /**
         * @param predicates The objects to include in a rule (documented below).
         * 
         * @return builder
         * 
         */
        public Builder predicates(List predicates) {
            return predicates(Output.of(predicates));
        }

        /**
         * @param predicates The objects to include in a rule (documented below).
         * 
         * @return builder
         * 
         */
        public Builder predicates(RateBasedRulePredicateArgs... predicates) {
            return predicates(List.of(predicates));
        }

        /**
         * @param rateKey Valid value is IP.
         * 
         * @return builder
         * 
         */
        public Builder rateKey(Output rateKey) {
            $.rateKey = rateKey;
            return this;
        }

        /**
         * @param rateKey Valid value is IP.
         * 
         * @return builder
         * 
         */
        public Builder rateKey(String rateKey) {
            return rateKey(Output.of(rateKey));
        }

        /**
         * @param rateLimit The maximum number of requests, which have an identical value in the field specified by the RateKey, allowed in a five-minute period. Minimum value is 100.
         * 
         * @return builder
         * 
         */
        public Builder rateLimit(Output rateLimit) {
            $.rateLimit = rateLimit;
            return this;
        }

        /**
         * @param rateLimit The maximum number of requests, which have an identical value in the field specified by the RateKey, allowed in a five-minute period. Minimum value is 100.
         * 
         * @return builder
         * 
         */
        public Builder rateLimit(Integer rateLimit) {
            return rateLimit(Output.of(rateLimit));
        }

        /**
         * @param tags Key-value map of resource tags. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
         * 
         * @return builder
         * 
         */
        public Builder tags(@Nullable Output> tags) {
            $.tags = tags;
            return this;
        }

        /**
         * @param tags Key-value map of resource tags. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
         * 
         * @return builder
         * 
         */
        public Builder tags(Map tags) {
            return tags(Output.of(tags));
        }

        public RateBasedRuleArgs build() {
            if ($.metricName == null) {
                throw new MissingRequiredPropertyException("RateBasedRuleArgs", "metricName");
            }
            if ($.rateKey == null) {
                throw new MissingRequiredPropertyException("RateBasedRuleArgs", "rateKey");
            }
            if ($.rateLimit == null) {
                throw new MissingRequiredPropertyException("RateBasedRuleArgs", "rateLimit");
            }
            return $;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy