Alibaba Cloud
ExpressSyncShareAttachment
Provides a Cloud Storage Gateway Express Sync Share Attachment resource.
For information about Cloud Storage Gateway Express Sync Share Attachment and how to use it, see What is Express Sync Share Attachment.
NOTE: Available in v1.144.0+.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var name = config.Get("name") ?? "tftest";
var region = config.Get("region") ?? "cn-shanghai";
var defaultStocks = Output.Create(AliCloud.CloudStorageGateway.GetStocks.InvokeAsync(new AliCloud.CloudStorageGateway.GetStocksArgs
{
GatewayClass = "Standard",
}));
var vpc = new AliCloud.Vpc.Network("vpc", new AliCloud.Vpc.NetworkArgs
{
VpcName = name,
CidrBlock = "192.16.0.0/12",
});
var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new AliCloud.Vpc.SwitchArgs
{
VpcId = vpc.Id,
CidrBlock = "192.16.0.0/21",
ZoneId = defaultStocks.Apply(defaultStocks => defaultStocks.Stocks?[0]?.ZoneId),
VswitchName = name,
});
var defaultStorageBundle = new AliCloud.CloudStorageGateway.StorageBundle("defaultStorageBundle", new AliCloud.CloudStorageGateway.StorageBundleArgs
{
StorageBundleName = name,
});
var defaultGateway = new AliCloud.CloudStorageGateway.Gateway("defaultGateway", new AliCloud.CloudStorageGateway.GatewayArgs
{
Description = "tf-acctestDesalone",
GatewayClass = "Standard",
Type = "File",
PaymentType = "PayAsYouGo",
VswitchId = defaultSwitch.Id,
ReleaseAfterExpiration = true,
PublicNetworkBandwidth = 10,
StorageBundleId = defaultStorageBundle.Id,
Location = "Cloud",
GatewayName = name,
});
var defaultGatewayCacheDisk = new AliCloud.CloudStorageGateway.GatewayCacheDisk("defaultGatewayCacheDisk", new AliCloud.CloudStorageGateway.GatewayCacheDiskArgs
{
CacheDiskCategory = "cloud_efficiency",
GatewayId = defaultGateway.Id,
CacheDiskSizeInGb = 50,
});
var defaultBucket = new AliCloud.Oss.Bucket("defaultBucket", new AliCloud.Oss.BucketArgs
{
Bucket = name,
});
var defaultGatewayFileShare = new AliCloud.CloudStorageGateway.GatewayFileShare("defaultGatewayFileShare", new AliCloud.CloudStorageGateway.GatewayFileShareArgs
{
GatewayFileShareName = name,
GatewayId = defaultGateway.Id,
LocalPath = defaultGatewayCacheDisk.LocalFilePath,
OssBucketName = defaultBucket.BucketName,
OssEndpoint = defaultBucket.ExtranetEndpoint,
Protocol = "NFS",
RemoteSync = false,
FeLimit = 0,
BackendLimit = 0,
CacheMode = "Cache",
Squash = "none",
LagPeriod = 5,
});
var defaultExpressSync = new AliCloud.CloudStorageGateway.ExpressSync("defaultExpressSync", new AliCloud.CloudStorageGateway.ExpressSyncArgs
{
BucketName = defaultGatewayFileShare.OssBucketName,
BucketRegion = region,
Description = name,
ExpressSyncName = name,
});
var defaultExpressSyncShareAttachment = new AliCloud.CloudStorageGateway.ExpressSyncShareAttachment("defaultExpressSyncShareAttachment", new AliCloud.CloudStorageGateway.ExpressSyncShareAttachmentArgs
{
ExpressSyncId = defaultExpressSync.Id,
GatewayId = defaultGateway.Id,
ShareName = defaultGatewayFileShare.GatewayFileShareName,
});
}
}
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudstoragegateway"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/oss"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "tftest"
if param := cfg.Get("name"); param != "" {
name = param
}
region := "cn-shanghai"
if param := cfg.Get("region"); param != "" {
region = param
}
defaultStocks, err := cloudstoragegateway.GetStocks(ctx, &cloudstoragegateway.GetStocksArgs{
GatewayClass: pulumi.StringRef("Standard"),
}, nil)
if err != nil {
return err
}
vpc, err := vpc.NewNetwork(ctx, "vpc", &vpc.NetworkArgs{
VpcName: pulumi.String(name),
CidrBlock: pulumi.String("192.16.0.0/12"),
})
if err != nil {
return err
}
defaultSwitch, err := vpc.NewSwitch(ctx, "defaultSwitch", &vpc.SwitchArgs{
VpcId: vpc.ID(),
CidrBlock: pulumi.String("192.16.0.0/21"),
ZoneId: pulumi.String(defaultStocks.Stocks[0].ZoneId),
VswitchName: pulumi.String(name),
})
if err != nil {
return err
}
defaultStorageBundle, err := cloudstoragegateway.NewStorageBundle(ctx, "defaultStorageBundle", &cloudstoragegateway.StorageBundleArgs{
StorageBundleName: pulumi.String(name),
})
if err != nil {
return err
}
defaultGateway, err := cloudstoragegateway.NewGateway(ctx, "defaultGateway", &cloudstoragegateway.GatewayArgs{
Description: pulumi.String("tf-acctestDesalone"),
GatewayClass: pulumi.String("Standard"),
Type: pulumi.String("File"),
PaymentType: pulumi.String("PayAsYouGo"),
VswitchId: defaultSwitch.ID(),
ReleaseAfterExpiration: pulumi.Bool(true),
PublicNetworkBandwidth: pulumi.Int(10),
StorageBundleId: defaultStorageBundle.ID(),
Location: pulumi.String("Cloud"),
GatewayName: pulumi.String(name),
})
if err != nil {
return err
}
defaultGatewayCacheDisk, err := cloudstoragegateway.NewGatewayCacheDisk(ctx, "defaultGatewayCacheDisk", &cloudstoragegateway.GatewayCacheDiskArgs{
CacheDiskCategory: pulumi.String("cloud_efficiency"),
GatewayId: defaultGateway.ID(),
CacheDiskSizeInGb: pulumi.Int(50),
})
if err != nil {
return err
}
defaultBucket, err := oss.NewBucket(ctx, "defaultBucket", &oss.BucketArgs{
Bucket: pulumi.String(name),
})
if err != nil {
return err
}
defaultGatewayFileShare, err := cloudstoragegateway.NewGatewayFileShare(ctx, "defaultGatewayFileShare", &cloudstoragegateway.GatewayFileShareArgs{
GatewayFileShareName: pulumi.String(name),
GatewayId: defaultGateway.ID(),
LocalPath: defaultGatewayCacheDisk.LocalFilePath,
OssBucketName: defaultBucket.Bucket,
OssEndpoint: defaultBucket.ExtranetEndpoint,
Protocol: pulumi.String("NFS"),
RemoteSync: pulumi.Bool(false),
FeLimit: pulumi.Int(0),
BackendLimit: pulumi.Int(0),
CacheMode: pulumi.String("Cache"),
Squash: pulumi.String("none"),
LagPeriod: pulumi.Int(5),
})
if err != nil {
return err
}
defaultExpressSync, err := cloudstoragegateway.NewExpressSync(ctx, "defaultExpressSync", &cloudstoragegateway.ExpressSyncArgs{
BucketName: defaultGatewayFileShare.OssBucketName,
BucketRegion: pulumi.String(region),
Description: pulumi.String(name),
ExpressSyncName: pulumi.String(name),
})
if err != nil {
return err
}
_, err = cloudstoragegateway.NewExpressSyncShareAttachment(ctx, "defaultExpressSyncShareAttachment", &cloudstoragegateway.ExpressSyncShareAttachmentArgs{
ExpressSyncId: defaultExpressSync.ID(),
GatewayId: defaultGateway.ID(),
ShareName: defaultGatewayFileShare.GatewayFileShareName,
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tftest"
region = config.get("region")
if region is None:
region = "cn-shanghai"
default_stocks = alicloud.cloudstoragegateway.get_stocks(gateway_class="Standard")
vpc = alicloud.vpc.Network("vpc",
vpc_name=name,
cidr_block="192.16.0.0/12")
default_switch = alicloud.vpc.Switch("defaultSwitch",
vpc_id=vpc.id,
cidr_block="192.16.0.0/21",
zone_id=default_stocks.stocks[0].zone_id,
vswitch_name=name)
default_storage_bundle = alicloud.cloudstoragegateway.StorageBundle("defaultStorageBundle", storage_bundle_name=name)
default_gateway = alicloud.cloudstoragegateway.Gateway("defaultGateway",
description="tf-acctestDesalone",
gateway_class="Standard",
type="File",
payment_type="PayAsYouGo",
vswitch_id=default_switch.id,
release_after_expiration=True,
public_network_bandwidth=10,
storage_bundle_id=default_storage_bundle.id,
location="Cloud",
gateway_name=name)
default_gateway_cache_disk = alicloud.cloudstoragegateway.GatewayCacheDisk("defaultGatewayCacheDisk",
cache_disk_category="cloud_efficiency",
gateway_id=default_gateway.id,
cache_disk_size_in_gb=50)
default_bucket = alicloud.oss.Bucket("defaultBucket", bucket=name)
default_gateway_file_share = alicloud.cloudstoragegateway.GatewayFileShare("defaultGatewayFileShare",
gateway_file_share_name=name,
gateway_id=default_gateway.id,
local_path=default_gateway_cache_disk.local_file_path,
oss_bucket_name=default_bucket.bucket,
oss_endpoint=default_bucket.extranet_endpoint,
protocol="NFS",
remote_sync=False,
fe_limit=0,
backend_limit=0,
cache_mode="Cache",
squash="none",
lag_period=5)
default_express_sync = alicloud.cloudstoragegateway.ExpressSync("defaultExpressSync",
bucket_name=default_gateway_file_share.oss_bucket_name,
bucket_region=region,
description=name,
express_sync_name=name)
default_express_sync_share_attachment = alicloud.cloudstoragegateway.ExpressSyncShareAttachment("defaultExpressSyncShareAttachment",
express_sync_id=default_express_sync.id,
gateway_id=default_gateway.id,
share_name=default_gateway_file_share.gateway_file_share_name)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tftest";
const region = config.get("region") || "cn-shanghai";
const defaultStocks = alicloud.cloudstoragegateway.getStocks({
gatewayClass: "Standard",
});
const vpc = new alicloud.vpc.Network("vpc", {
vpcName: name,
cidrBlock: "192.16.0.0/12",
});
const defaultSwitch = new alicloud.vpc.Switch("defaultSwitch", {
vpcId: vpc.id,
cidrBlock: "192.16.0.0/21",
zoneId: defaultStocks.then(defaultStocks => defaultStocks.stocks?[0]?.zoneId),
vswitchName: name,
});
const defaultStorageBundle = new alicloud.cloudstoragegateway.StorageBundle("defaultStorageBundle", {storageBundleName: name});
const defaultGateway = new alicloud.cloudstoragegateway.Gateway("defaultGateway", {
description: "tf-acctestDesalone",
gatewayClass: "Standard",
type: "File",
paymentType: "PayAsYouGo",
vswitchId: defaultSwitch.id,
releaseAfterExpiration: true,
publicNetworkBandwidth: 10,
storageBundleId: defaultStorageBundle.id,
location: "Cloud",
gatewayName: name,
});
const defaultGatewayCacheDisk = new alicloud.cloudstoragegateway.GatewayCacheDisk("defaultGatewayCacheDisk", {
cacheDiskCategory: "cloud_efficiency",
gatewayId: defaultGateway.id,
cacheDiskSizeInGb: 50,
});
const defaultBucket = new alicloud.oss.Bucket("defaultBucket", {bucket: name});
const defaultGatewayFileShare = new alicloud.cloudstoragegateway.GatewayFileShare("defaultGatewayFileShare", {
gatewayFileShareName: name,
gatewayId: defaultGateway.id,
localPath: defaultGatewayCacheDisk.localFilePath,
ossBucketName: defaultBucket.bucket,
ossEndpoint: defaultBucket.extranetEndpoint,
protocol: "NFS",
remoteSync: false,
feLimit: 0,
backendLimit: 0,
cacheMode: "Cache",
squash: "none",
lagPeriod: 5,
});
const defaultExpressSync = new alicloud.cloudstoragegateway.ExpressSync("defaultExpressSync", {
bucketName: defaultGatewayFileShare.ossBucketName,
bucketRegion: region,
description: name,
expressSyncName: name,
});
const defaultExpressSyncShareAttachment = new alicloud.cloudstoragegateway.ExpressSyncShareAttachment("defaultExpressSyncShareAttachment", {
expressSyncId: defaultExpressSync.id,
gatewayId: defaultGateway.id,
shareName: defaultGatewayFileShare.gatewayFileShareName,
});
Coming soon!
Create a ExpressSyncShareAttachment Resource
new ExpressSyncShareAttachment(name: string, args: ExpressSyncShareAttachmentArgs, opts?: CustomResourceOptions);
@overload
def ExpressSyncShareAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
express_sync_id: Optional[str] = None,
gateway_id: Optional[str] = None,
share_name: Optional[str] = None)
@overload
def ExpressSyncShareAttachment(resource_name: str,
args: ExpressSyncShareAttachmentArgs,
opts: Optional[ResourceOptions] = None)
func NewExpressSyncShareAttachment(ctx *Context, name string, args ExpressSyncShareAttachmentArgs, opts ...ResourceOption) (*ExpressSyncShareAttachment, error)
public ExpressSyncShareAttachment(string name, ExpressSyncShareAttachmentArgs args, CustomResourceOptions? opts = null)
public ExpressSyncShareAttachment(String name, ExpressSyncShareAttachmentArgs args)
public ExpressSyncShareAttachment(String name, ExpressSyncShareAttachmentArgs args, CustomResourceOptions options)
type: alicloud:cloudstoragegateway:ExpressSyncShareAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ExpressSyncShareAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ExpressSyncShareAttachmentArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ExpressSyncShareAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ExpressSyncShareAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ExpressSyncShareAttachmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ExpressSyncShareAttachment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ExpressSyncShareAttachment resource accepts the following input properties:
- Express
Sync stringId The ID of the ExpressSync.
- Gateway
Id string The ID of the Gateway.
- string
The name of the GatewayFileShare. NOTE: When GatewayFileShare is associated with a speed sync group, its reverse synchronization function will be turned off by default.
- Express
Sync stringId The ID of the ExpressSync.
- Gateway
Id string The ID of the Gateway.
- string
The name of the GatewayFileShare. NOTE: When GatewayFileShare is associated with a speed sync group, its reverse synchronization function will be turned off by default.
- express
Sync StringId The ID of the ExpressSync.
- gateway
Id String The ID of the Gateway.
- String
The name of the GatewayFileShare. NOTE: When GatewayFileShare is associated with a speed sync group, its reverse synchronization function will be turned off by default.
- express
Sync stringId The ID of the ExpressSync.
- gateway
Id string The ID of the Gateway.
- string
The name of the GatewayFileShare. NOTE: When GatewayFileShare is associated with a speed sync group, its reverse synchronization function will be turned off by default.
- express_
sync_ strid The ID of the ExpressSync.
- gateway_
id str The ID of the Gateway.
- str
The name of the GatewayFileShare. NOTE: When GatewayFileShare is associated with a speed sync group, its reverse synchronization function will be turned off by default.
- express
Sync StringId The ID of the ExpressSync.
- gateway
Id String The ID of the Gateway.
- String
The name of the GatewayFileShare. NOTE: When GatewayFileShare is associated with a speed sync group, its reverse synchronization function will be turned off by default.
Outputs
All input properties are implicitly available as output properties. Additionally, the ExpressSyncShareAttachment resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Id string
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
- id string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up an Existing ExpressSyncShareAttachment Resource
Get an existing ExpressSyncShareAttachment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ExpressSyncShareAttachmentState, opts?: CustomResourceOptions): ExpressSyncShareAttachment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
express_sync_id: Optional[str] = None,
gateway_id: Optional[str] = None,
share_name: Optional[str] = None) -> ExpressSyncShareAttachment
func GetExpressSyncShareAttachment(ctx *Context, name string, id IDInput, state *ExpressSyncShareAttachmentState, opts ...ResourceOption) (*ExpressSyncShareAttachment, error)
public static ExpressSyncShareAttachment Get(string name, Input<string> id, ExpressSyncShareAttachmentState? state, CustomResourceOptions? opts = null)
public static ExpressSyncShareAttachment get(String name, Output<String> id, ExpressSyncShareAttachmentState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Express
Sync stringId The ID of the ExpressSync.
- Gateway
Id string The ID of the Gateway.
- string
The name of the GatewayFileShare. NOTE: When GatewayFileShare is associated with a speed sync group, its reverse synchronization function will be turned off by default.
- Express
Sync stringId The ID of the ExpressSync.
- Gateway
Id string The ID of the Gateway.
- string
The name of the GatewayFileShare. NOTE: When GatewayFileShare is associated with a speed sync group, its reverse synchronization function will be turned off by default.
- express
Sync StringId The ID of the ExpressSync.
- gateway
Id String The ID of the Gateway.
- String
The name of the GatewayFileShare. NOTE: When GatewayFileShare is associated with a speed sync group, its reverse synchronization function will be turned off by default.
- express
Sync stringId The ID of the ExpressSync.
- gateway
Id string The ID of the Gateway.
- string
The name of the GatewayFileShare. NOTE: When GatewayFileShare is associated with a speed sync group, its reverse synchronization function will be turned off by default.
- express_
sync_ strid The ID of the ExpressSync.
- gateway_
id str The ID of the Gateway.
- str
The name of the GatewayFileShare. NOTE: When GatewayFileShare is associated with a speed sync group, its reverse synchronization function will be turned off by default.
- express
Sync StringId The ID of the ExpressSync.
- gateway
Id String The ID of the Gateway.
- String
The name of the GatewayFileShare. NOTE: When GatewayFileShare is associated with a speed sync group, its reverse synchronization function will be turned off by default.
Import
Cloud Storage Gateway Express Sync Share Attachment can be imported using the id, e.g.
$ pulumi import alicloud:cloudstoragegateway/expressSyncShareAttachment:ExpressSyncShareAttachment example <express_sync_id>:<gateway_id>:<share_name>
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.