ExpressSync

Provides a Cloud Storage Gateway Express Sync resource. For information about Cloud Storage Gateway Express Sync and how to use it, see What is Express Sync.

NOTE: Available in v1.144.0+.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cloudstoragegateway.CloudstoragegatewayFunctions;
import com.pulumi.alicloud.cloudstoragegateway.inputs.GetStocksArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.cloudstoragegateway.StorageBundle;
import com.pulumi.alicloud.cloudstoragegateway.StorageBundleArgs;
import com.pulumi.alicloud.cloudstoragegateway.Gateway;
import com.pulumi.alicloud.cloudstoragegateway.GatewayArgs;
import com.pulumi.alicloud.cloudstoragegateway.GatewayCacheDisk;
import com.pulumi.alicloud.cloudstoragegateway.GatewayCacheDiskArgs;
import com.pulumi.alicloud.oss.Bucket;
import com.pulumi.alicloud.oss.BucketArgs;
import com.pulumi.alicloud.cloudstoragegateway.GatewayFileShare;
import com.pulumi.alicloud.cloudstoragegateway.GatewayFileShareArgs;
import com.pulumi.alicloud.cloudstoragegateway.ExpressSync;
import com.pulumi.alicloud.cloudstoragegateway.ExpressSyncArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var name = config.get("name").orElse("tftest");
final var region = config.get("region").orElse("cn-shanghai");
final var defaultStocks = CloudstoragegatewayFunctions.getStocks(GetStocksArgs.builder()
.gatewayClass("Standard")
.build());
var vpc = new Network("vpc", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("172.16.0.0/12")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vpcId(vpc.id())
.cidrBlock("172.16.0.0/21")
.zoneId(defaultStocks.applyValue(getStocksResult -> getStocksResult.stocks()[0].zoneId()))
.vswitchName(name)
.build());
var defaultStorageBundle = new StorageBundle("defaultStorageBundle", StorageBundleArgs.builder()
.storageBundleName(name)
.build());
var defaultGateway = new Gateway("defaultGateway", GatewayArgs.builder()
.description("tf-acctestDesalone")
.gatewayClass("Standard")
.type("File")
.paymentType("PayAsYouGo")
.vswitchId(defaultSwitch.id())
.releaseAfterExpiration(true)
.publicNetworkBandwidth(10)
.storageBundleId(defaultStorageBundle.id())
.location("Cloud")
.gatewayName(name)
.build());
var defaultGatewayCacheDisk = new GatewayCacheDisk("defaultGatewayCacheDisk", GatewayCacheDiskArgs.builder()
.cacheDiskCategory("cloud_efficiency")
.gatewayId(defaultGateway.id())
.cacheDiskSizeInGb(50)
.build());
var defaultBucket = new Bucket("defaultBucket", BucketArgs.builder()
.bucket(name)
.acl("public-read-write")
.build());
var defaultGatewayFileShare = new GatewayFileShare("defaultGatewayFileShare", GatewayFileShareArgs.builder()
.gatewayFileShareName(name)
.gatewayId(defaultGateway.id())
.localPath(defaultGatewayCacheDisk.localFilePath())
.ossBucketName(defaultBucket.bucket())
.ossEndpoint(defaultBucket.extranetEndpoint())
.protocol("NFS")
.remoteSync(true)
.pollingInterval(4500)
.feLimit(0)
.backendLimit(0)
.cacheMode("Cache")
.squash("none")
.lagPeriod(5)
.build());
var defaultExpressSync = new ExpressSync("defaultExpressSync", ExpressSyncArgs.builder()
.bucketName(defaultGatewayFileShare.ossBucketName())
.bucketRegion(region)
.description(name)
.expressSyncName(name)
.build());
}
}

Import

Cloud Storage Gateway Express Sync can be imported using the id, e.g.

$ pulumi import alicloud:cloudstoragegateway/expressSync:ExpressSync example <id>

Properties

Link copied to clipboard
val bucketName: Output<String>

The name of the OSS Bucket.

Link copied to clipboard
val bucketPrefix: Output<String>?

The prefix of the OSS Bucket.

Link copied to clipboard
val bucketRegion: Output<String>

The region of the OSS Bucket.

Link copied to clipboard
val description: Output<String>?

The description of the Express Sync. The length of the name is limited to 1 to 255 characters.

Link copied to clipboard
val expressSyncName: Output<String>

The name of the ExpressSync. The length of the name is limited to 1 to 128 characters. It can contain uppercase and lowercase letters, Chinese characters, numbers, English periods (.), underscores (_), or hyphens (-), and must start with letters.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val urn: Output<String>