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

com.pulumi.azure.mssql.FailoverGroupArgs Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.

There is a newer version: 6.10.0-alpha.1731737215
Show newest version
// *** 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.azure.mssql;

import com.pulumi.azure.mssql.inputs.FailoverGroupPartnerServerArgs;
import com.pulumi.azure.mssql.inputs.FailoverGroupReadWriteEndpointFailoverPolicyArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
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 FailoverGroupArgs extends com.pulumi.resources.ResourceArgs {

    public static final FailoverGroupArgs Empty = new FailoverGroupArgs();

    /**
     * A set of database names to include in the failover group.
     * 
     */
    @Import(name="databases")
    private @Nullable Output> databases;

    /**
     * @return A set of database names to include in the failover group.
     * 
     */
    public Optional>> databases() {
        return Optional.ofNullable(this.databases);
    }

    /**
     * The name of the Failover Group. Changing this forces a new resource to be created.
     * 
     */
    @Import(name="name")
    private @Nullable Output name;

    /**
     * @return The name of the Failover Group. Changing this forces a new resource to be created.
     * 
     */
    public Optional> name() {
        return Optional.ofNullable(this.name);
    }

    /**
     * A `partner_server` block as defined below.
     * 
     */
    @Import(name="partnerServers", required=true)
    private Output> partnerServers;

    /**
     * @return A `partner_server` block as defined below.
     * 
     */
    public Output> partnerServers() {
        return this.partnerServers;
    }

    /**
     * A `read_write_endpoint_failover_policy` block as defined below.
     * 
     */
    @Import(name="readWriteEndpointFailoverPolicy", required=true)
    private Output readWriteEndpointFailoverPolicy;

    /**
     * @return A `read_write_endpoint_failover_policy` block as defined below.
     * 
     */
    public Output readWriteEndpointFailoverPolicy() {
        return this.readWriteEndpointFailoverPolicy;
    }

    /**
     * Whether failover is enabled for the readonly endpoint. Defaults to `false`.
     * 
     */
    @Import(name="readonlyEndpointFailoverPolicyEnabled")
    private @Nullable Output readonlyEndpointFailoverPolicyEnabled;

    /**
     * @return Whether failover is enabled for the readonly endpoint. Defaults to `false`.
     * 
     */
    public Optional> readonlyEndpointFailoverPolicyEnabled() {
        return Optional.ofNullable(this.readonlyEndpointFailoverPolicyEnabled);
    }

    /**
     * The ID of the primary SQL Server on which to create the failover group. Changing this forces a new resource to be created.
     * 
     */
    @Import(name="serverId", required=true)
    private Output serverId;

    /**
     * @return The ID of the primary SQL Server on which to create the failover group. Changing this forces a new resource to be created.
     * 
     */
    public Output serverId() {
        return this.serverId;
    }

    /**
     * A mapping of tags to assign to the resource.
     * 
     */
    @Import(name="tags")
    private @Nullable Output> tags;

    /**
     * @return A mapping of tags to assign to the resource.
     * 
     */
    public Optional>> tags() {
        return Optional.ofNullable(this.tags);
    }

    private FailoverGroupArgs() {}

    private FailoverGroupArgs(FailoverGroupArgs $) {
        this.databases = $.databases;
        this.name = $.name;
        this.partnerServers = $.partnerServers;
        this.readWriteEndpointFailoverPolicy = $.readWriteEndpointFailoverPolicy;
        this.readonlyEndpointFailoverPolicyEnabled = $.readonlyEndpointFailoverPolicyEnabled;
        this.serverId = $.serverId;
        this.tags = $.tags;
    }

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

    public static final class Builder {
        private FailoverGroupArgs $;

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

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

        /**
         * @param databases A set of database names to include in the failover group.
         * 
         * @return builder
         * 
         */
        public Builder databases(@Nullable Output> databases) {
            $.databases = databases;
            return this;
        }

        /**
         * @param databases A set of database names to include in the failover group.
         * 
         * @return builder
         * 
         */
        public Builder databases(List databases) {
            return databases(Output.of(databases));
        }

        /**
         * @param databases A set of database names to include in the failover group.
         * 
         * @return builder
         * 
         */
        public Builder databases(String... databases) {
            return databases(List.of(databases));
        }

        /**
         * @param name The name of the Failover Group. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder name(@Nullable Output name) {
            $.name = name;
            return this;
        }

        /**
         * @param name The name of the Failover Group. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param partnerServers A `partner_server` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder partnerServers(Output> partnerServers) {
            $.partnerServers = partnerServers;
            return this;
        }

        /**
         * @param partnerServers A `partner_server` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder partnerServers(List partnerServers) {
            return partnerServers(Output.of(partnerServers));
        }

        /**
         * @param partnerServers A `partner_server` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder partnerServers(FailoverGroupPartnerServerArgs... partnerServers) {
            return partnerServers(List.of(partnerServers));
        }

        /**
         * @param readWriteEndpointFailoverPolicy A `read_write_endpoint_failover_policy` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder readWriteEndpointFailoverPolicy(Output readWriteEndpointFailoverPolicy) {
            $.readWriteEndpointFailoverPolicy = readWriteEndpointFailoverPolicy;
            return this;
        }

        /**
         * @param readWriteEndpointFailoverPolicy A `read_write_endpoint_failover_policy` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder readWriteEndpointFailoverPolicy(FailoverGroupReadWriteEndpointFailoverPolicyArgs readWriteEndpointFailoverPolicy) {
            return readWriteEndpointFailoverPolicy(Output.of(readWriteEndpointFailoverPolicy));
        }

        /**
         * @param readonlyEndpointFailoverPolicyEnabled Whether failover is enabled for the readonly endpoint. Defaults to `false`.
         * 
         * @return builder
         * 
         */
        public Builder readonlyEndpointFailoverPolicyEnabled(@Nullable Output readonlyEndpointFailoverPolicyEnabled) {
            $.readonlyEndpointFailoverPolicyEnabled = readonlyEndpointFailoverPolicyEnabled;
            return this;
        }

        /**
         * @param readonlyEndpointFailoverPolicyEnabled Whether failover is enabled for the readonly endpoint. Defaults to `false`.
         * 
         * @return builder
         * 
         */
        public Builder readonlyEndpointFailoverPolicyEnabled(Boolean readonlyEndpointFailoverPolicyEnabled) {
            return readonlyEndpointFailoverPolicyEnabled(Output.of(readonlyEndpointFailoverPolicyEnabled));
        }

        /**
         * @param serverId The ID of the primary SQL Server on which to create the failover group. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder serverId(Output serverId) {
            $.serverId = serverId;
            return this;
        }

        /**
         * @param serverId The ID of the primary SQL Server on which to create the failover group. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder serverId(String serverId) {
            return serverId(Output.of(serverId));
        }

        /**
         * @param tags A mapping of tags to assign to the resource.
         * 
         * @return builder
         * 
         */
        public Builder tags(@Nullable Output> tags) {
            $.tags = tags;
            return this;
        }

        /**
         * @param tags A mapping of tags to assign to the resource.
         * 
         * @return builder
         * 
         */
        public Builder tags(Map tags) {
            return tags(Output.of(tags));
        }

        public FailoverGroupArgs build() {
            if ($.partnerServers == null) {
                throw new MissingRequiredPropertyException("FailoverGroupArgs", "partnerServers");
            }
            if ($.readWriteEndpointFailoverPolicy == null) {
                throw new MissingRequiredPropertyException("FailoverGroupArgs", "readWriteEndpointFailoverPolicy");
            }
            if ($.serverId == null) {
                throw new MissingRequiredPropertyException("FailoverGroupArgs", "serverId");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy