com.pulumi.mongodbatlas.outputs.ClusterReplicationSpec 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.mongodbatlas.outputs;
import com.pulumi.core.annotations.CustomType;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import com.pulumi.mongodbatlas.outputs.ClusterReplicationSpecRegionsConfig;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
@CustomType
public final class ClusterReplicationSpec {
/**
* @return Unique identifer of the replication document for a zone in a Global Cluster.
*
*/
private @Nullable String id;
/**
* @return Selects whether the cluster is a replica set or a sharded cluster. If you use the replicationSpecs parameter, you must set num_shards.
*
*/
private Integer numShards;
/**
* @return Physical location of the region. Each regionsConfig document describes the region’s priority in elections and the number and type of MongoDB nodes Atlas deploys to the region. You must order each regionsConfigs document by regionsConfig.priority, descending. See Region Config below for more details.
*
*/
private @Nullable List regionsConfigs;
/**
* @return Name for the zone in a Global Cluster.
*
* **Region Config**
*
*/
private @Nullable String zoneName;
private ClusterReplicationSpec() {}
/**
* @return Unique identifer of the replication document for a zone in a Global Cluster.
*
*/
public Optional id() {
return Optional.ofNullable(this.id);
}
/**
* @return Selects whether the cluster is a replica set or a sharded cluster. If you use the replicationSpecs parameter, you must set num_shards.
*
*/
public Integer numShards() {
return this.numShards;
}
/**
* @return Physical location of the region. Each regionsConfig document describes the region’s priority in elections and the number and type of MongoDB nodes Atlas deploys to the region. You must order each regionsConfigs document by regionsConfig.priority, descending. See Region Config below for more details.
*
*/
public List regionsConfigs() {
return this.regionsConfigs == null ? List.of() : this.regionsConfigs;
}
/**
* @return Name for the zone in a Global Cluster.
*
* **Region Config**
*
*/
public Optional zoneName() {
return Optional.ofNullable(this.zoneName);
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(ClusterReplicationSpec defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private @Nullable String id;
private Integer numShards;
private @Nullable List regionsConfigs;
private @Nullable String zoneName;
public Builder() {}
public Builder(ClusterReplicationSpec defaults) {
Objects.requireNonNull(defaults);
this.id = defaults.id;
this.numShards = defaults.numShards;
this.regionsConfigs = defaults.regionsConfigs;
this.zoneName = defaults.zoneName;
}
@CustomType.Setter
public Builder id(@Nullable String id) {
this.id = id;
return this;
}
@CustomType.Setter
public Builder numShards(Integer numShards) {
if (numShards == null) {
throw new MissingRequiredPropertyException("ClusterReplicationSpec", "numShards");
}
this.numShards = numShards;
return this;
}
@CustomType.Setter
public Builder regionsConfigs(@Nullable List regionsConfigs) {
this.regionsConfigs = regionsConfigs;
return this;
}
public Builder regionsConfigs(ClusterReplicationSpecRegionsConfig... regionsConfigs) {
return regionsConfigs(List.of(regionsConfigs));
}
@CustomType.Setter
public Builder zoneName(@Nullable String zoneName) {
this.zoneName = zoneName;
return this;
}
public ClusterReplicationSpec build() {
final var _resultValue = new ClusterReplicationSpec();
_resultValue.id = id;
_resultValue.numShards = numShards;
_resultValue.regionsConfigs = regionsConfigs;
_resultValue.zoneName = zoneName;
return _resultValue;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy