alicloud.cloudstoragegateway.Gateway
Explore with Pulumi AI
Provides a Cloud Storage Gateway: Gateway resource.
For information about Cloud Storage Gateway Gateway and how to use it, see What is Gateway.
NOTE: Available in v1.132.0+.
Example Usage
Basic Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var vpc = new AliCloud.Vpc.Network("vpc", new()
{
VpcName = "tf_test_foo",
CidrBlock = "172.16.0.0/12",
});
var defaultZones = AliCloud.GetZones.Invoke(new()
{
AvailableResourceCreation = "VSwitch",
});
var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new()
{
VpcId = vpc.Id,
CidrBlock = "172.16.0.0/21",
ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
VswitchName = "tf-testAccCsgName",
});
var example = new AliCloud.CloudStorageGateway.StorageBundle("example", new()
{
StorageBundleName = "example_value",
});
var defaultGateway = new AliCloud.CloudStorageGateway.Gateway("defaultGateway", new()
{
Description = "tf-acctestDesalone",
GatewayClass = "Standard",
Type = "File",
PaymentType = "PayAsYouGo",
VswitchId = defaultSwitch.Id,
ReleaseAfterExpiration = false,
PublicNetworkBandwidth = 40,
StorageBundleId = example.Id,
Location = "Cloud",
GatewayName = "tf-acctestGatewayName",
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudstoragegateway"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
vpc, err := vpc.NewNetwork(ctx, "vpc", &vpc.NetworkArgs{
VpcName: pulumi.String("tf_test_foo"),
CidrBlock: pulumi.String("172.16.0.0/12"),
})
if err != nil {
return err
}
defaultZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
AvailableResourceCreation: pulumi.StringRef("VSwitch"),
}, nil)
if err != nil {
return err
}
defaultSwitch, err := vpc.NewSwitch(ctx, "defaultSwitch", &vpc.SwitchArgs{
VpcId: vpc.ID(),
CidrBlock: pulumi.String("172.16.0.0/21"),
ZoneId: *pulumi.String(defaultZones.Zones[0].Id),
VswitchName: pulumi.String("tf-testAccCsgName"),
})
if err != nil {
return err
}
example, err := cloudstoragegateway.NewStorageBundle(ctx, "example", &cloudstoragegateway.StorageBundleArgs{
StorageBundleName: pulumi.String("example_value"),
})
if err != nil {
return err
}
_, 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(false),
PublicNetworkBandwidth: pulumi.Int(40),
StorageBundleId: example.ID(),
Location: pulumi.String("Cloud"),
GatewayName: pulumi.String("tf-acctestGatewayName"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
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 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) {
var vpc = new Network("vpc", NetworkArgs.builder()
.vpcName("tf_test_foo")
.cidrBlock("172.16.0.0/12")
.build());
final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vpcId(vpc.id())
.cidrBlock("172.16.0.0/21")
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.vswitchName("tf-testAccCsgName")
.build());
var example = new StorageBundle("example", StorageBundleArgs.builder()
.storageBundleName("example_value")
.build());
var defaultGateway = new Gateway("defaultGateway", GatewayArgs.builder()
.description("tf-acctestDesalone")
.gatewayClass("Standard")
.type("File")
.paymentType("PayAsYouGo")
.vswitchId(defaultSwitch.id())
.releaseAfterExpiration(false)
.publicNetworkBandwidth(40)
.storageBundleId(example.id())
.location("Cloud")
.gatewayName("tf-acctestGatewayName")
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
vpc = alicloud.vpc.Network("vpc",
vpc_name="tf_test_foo",
cidr_block="172.16.0.0/12")
default_zones = alicloud.get_zones(available_resource_creation="VSwitch")
default_switch = alicloud.vpc.Switch("defaultSwitch",
vpc_id=vpc.id,
cidr_block="172.16.0.0/21",
zone_id=default_zones.zones[0].id,
vswitch_name="tf-testAccCsgName")
example = alicloud.cloudstoragegateway.StorageBundle("example", storage_bundle_name="example_value")
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=False,
public_network_bandwidth=40,
storage_bundle_id=example.id,
location="Cloud",
gateway_name="tf-acctestGatewayName")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const vpc = new alicloud.vpc.Network("vpc", {
vpcName: "tf_test_foo",
cidrBlock: "172.16.0.0/12",
});
const defaultZones = alicloud.getZones({
availableResourceCreation: "VSwitch",
});
const defaultSwitch = new alicloud.vpc.Switch("defaultSwitch", {
vpcId: vpc.id,
cidrBlock: "172.16.0.0/21",
zoneId: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.id),
vswitchName: "tf-testAccCsgName",
});
const example = new alicloud.cloudstoragegateway.StorageBundle("example", {storageBundleName: "example_value"});
const defaultGateway = new alicloud.cloudstoragegateway.Gateway("defaultGateway", {
description: "tf-acctestDesalone",
gatewayClass: "Standard",
type: "File",
paymentType: "PayAsYouGo",
vswitchId: defaultSwitch.id,
releaseAfterExpiration: false,
publicNetworkBandwidth: 40,
storageBundleId: example.id,
location: "Cloud",
gatewayName: "tf-acctestGatewayName",
});
resources:
vpc:
type: alicloud:vpc:Network
properties:
vpcName: tf_test_foo
cidrBlock: 172.16.0.0/12
defaultSwitch:
type: alicloud:vpc:Switch
properties:
vpcId: ${vpc.id}
cidrBlock: 172.16.0.0/21
zoneId: ${defaultZones.zones[0].id}
vswitchName: tf-testAccCsgName
example:
type: alicloud:cloudstoragegateway:StorageBundle
properties:
storageBundleName: example_value
defaultGateway:
type: alicloud:cloudstoragegateway:Gateway
properties:
description: tf-acctestDesalone
gatewayClass: Standard
type: File
paymentType: PayAsYouGo
vswitchId: ${defaultSwitch.id}
releaseAfterExpiration: false
publicNetworkBandwidth: 40
storageBundleId: ${example.id}
location: Cloud
gatewayName: tf-acctestGatewayName
variables:
defaultZones:
fn::invoke:
Function: alicloud:getZones
Arguments:
availableResourceCreation: VSwitch
Create Gateway Resource
new Gateway(name: string, args: GatewayArgs, opts?: CustomResourceOptions);
@overload
def Gateway(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
gateway_class: Optional[str] = None,
gateway_name: Optional[str] = None,
location: Optional[str] = None,
payment_type: Optional[str] = None,
public_network_bandwidth: Optional[int] = None,
reason_detail: Optional[str] = None,
reason_type: Optional[str] = None,
release_after_expiration: Optional[bool] = None,
storage_bundle_id: Optional[str] = None,
type: Optional[str] = None,
vswitch_id: Optional[str] = None)
@overload
def Gateway(resource_name: str,
args: GatewayArgs,
opts: Optional[ResourceOptions] = None)
func NewGateway(ctx *Context, name string, args GatewayArgs, opts ...ResourceOption) (*Gateway, error)
public Gateway(string name, GatewayArgs args, CustomResourceOptions? opts = null)
public Gateway(String name, GatewayArgs args)
public Gateway(String name, GatewayArgs args, CustomResourceOptions options)
type: alicloud:cloudstoragegateway:Gateway
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GatewayArgs
- 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 GatewayArgs
- 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 GatewayArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GatewayArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GatewayArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Gateway 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 Gateway resource accepts the following input properties:
- Gateway
Name string the name of gateway.
- Location string
gateway location. the valid values:
Cloud
,On_Premise
.- Storage
Bundle stringId storage bundle id.
- Type string
gateway type. the valid values:
Type
,Iscsi
.- Description string
the description of gateway.
- Gateway
Class string the gateway class. the valid values:
Basic
,Standard
,Enhanced
,Advanced
- Payment
Type string The Payment type of gateway. The valid value:
PayAsYouGo
.- Public
Network intBandwidth The public network bandwidth of gateway. Valid values between
5
and200
. Defaults to5
.- Reason
Detail string The reason detail of gateway.
- Reason
Type string The reason type when user deletes the gateway.
- Release
After boolExpiration Whether to release the gateway due to expiration.
- Vswitch
Id string The vswitch id of gateway.
- Gateway
Name string the name of gateway.
- Location string
gateway location. the valid values:
Cloud
,On_Premise
.- Storage
Bundle stringId storage bundle id.
- Type string
gateway type. the valid values:
Type
,Iscsi
.- Description string
the description of gateway.
- Gateway
Class string the gateway class. the valid values:
Basic
,Standard
,Enhanced
,Advanced
- Payment
Type string The Payment type of gateway. The valid value:
PayAsYouGo
.- Public
Network intBandwidth The public network bandwidth of gateway. Valid values between
5
and200
. Defaults to5
.- Reason
Detail string The reason detail of gateway.
- Reason
Type string The reason type when user deletes the gateway.
- Release
After boolExpiration Whether to release the gateway due to expiration.
- Vswitch
Id string The vswitch id of gateway.
- gateway
Name String the name of gateway.
- location String
gateway location. the valid values:
Cloud
,On_Premise
.- storage
Bundle StringId storage bundle id.
- type String
gateway type. the valid values:
Type
,Iscsi
.- description String
the description of gateway.
- gateway
Class String the gateway class. the valid values:
Basic
,Standard
,Enhanced
,Advanced
- payment
Type String The Payment type of gateway. The valid value:
PayAsYouGo
.- public
Network IntegerBandwidth The public network bandwidth of gateway. Valid values between
5
and200
. Defaults to5
.- reason
Detail String The reason detail of gateway.
- reason
Type String The reason type when user deletes the gateway.
- release
After BooleanExpiration Whether to release the gateway due to expiration.
- vswitch
Id String The vswitch id of gateway.
- gateway
Name string the name of gateway.
- location string
gateway location. the valid values:
Cloud
,On_Premise
.- storage
Bundle stringId storage bundle id.
- type string
gateway type. the valid values:
Type
,Iscsi
.- description string
the description of gateway.
- gateway
Class string the gateway class. the valid values:
Basic
,Standard
,Enhanced
,Advanced
- payment
Type string The Payment type of gateway. The valid value:
PayAsYouGo
.- public
Network numberBandwidth The public network bandwidth of gateway. Valid values between
5
and200
. Defaults to5
.- reason
Detail string The reason detail of gateway.
- reason
Type string The reason type when user deletes the gateway.
- release
After booleanExpiration Whether to release the gateway due to expiration.
- vswitch
Id string The vswitch id of gateway.
- gateway_
name str the name of gateway.
- location str
gateway location. the valid values:
Cloud
,On_Premise
.- storage_
bundle_ strid storage bundle id.
- type str
gateway type. the valid values:
Type
,Iscsi
.- description str
the description of gateway.
- gateway_
class str the gateway class. the valid values:
Basic
,Standard
,Enhanced
,Advanced
- payment_
type str The Payment type of gateway. The valid value:
PayAsYouGo
.- public_
network_ intbandwidth The public network bandwidth of gateway. Valid values between
5
and200
. Defaults to5
.- reason_
detail str The reason detail of gateway.
- reason_
type str The reason type when user deletes the gateway.
- release_
after_ boolexpiration Whether to release the gateway due to expiration.
- vswitch_
id str The vswitch id of gateway.
- gateway
Name String the name of gateway.
- location String
gateway location. the valid values:
Cloud
,On_Premise
.- storage
Bundle StringId storage bundle id.
- type String
gateway type. the valid values:
Type
,Iscsi
.- description String
the description of gateway.
- gateway
Class String the gateway class. the valid values:
Basic
,Standard
,Enhanced
,Advanced
- payment
Type String The Payment type of gateway. The valid value:
PayAsYouGo
.- public
Network NumberBandwidth The public network bandwidth of gateway. Valid values between
5
and200
. Defaults to5
.- reason
Detail String The reason detail of gateway.
- reason
Type String The reason type when user deletes the gateway.
- release
After BooleanExpiration Whether to release the gateway due to expiration.
- vswitch
Id String The vswitch id of gateway.
Outputs
All input properties are implicitly available as output properties. Additionally, the Gateway resource produces the following output properties:
Look up Existing Gateway Resource
Get an existing Gateway 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?: GatewayState, opts?: CustomResourceOptions): Gateway
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
gateway_class: Optional[str] = None,
gateway_name: Optional[str] = None,
location: Optional[str] = None,
payment_type: Optional[str] = None,
public_network_bandwidth: Optional[int] = None,
reason_detail: Optional[str] = None,
reason_type: Optional[str] = None,
release_after_expiration: Optional[bool] = None,
status: Optional[str] = None,
storage_bundle_id: Optional[str] = None,
type: Optional[str] = None,
vswitch_id: Optional[str] = None) -> Gateway
func GetGateway(ctx *Context, name string, id IDInput, state *GatewayState, opts ...ResourceOption) (*Gateway, error)
public static Gateway Get(string name, Input<string> id, GatewayState? state, CustomResourceOptions? opts = null)
public static Gateway get(String name, Output<String> id, GatewayState 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.
- Description string
the description of gateway.
- Gateway
Class string the gateway class. the valid values:
Basic
,Standard
,Enhanced
,Advanced
- Gateway
Name string the name of gateway.
- Location string
gateway location. the valid values:
Cloud
,On_Premise
.- Payment
Type string The Payment type of gateway. The valid value:
PayAsYouGo
.- Public
Network intBandwidth The public network bandwidth of gateway. Valid values between
5
and200
. Defaults to5
.- Reason
Detail string The reason detail of gateway.
- Reason
Type string The reason type when user deletes the gateway.
- Release
After boolExpiration Whether to release the gateway due to expiration.
- Status string
gateway status.
- Storage
Bundle stringId storage bundle id.
- Type string
gateway type. the valid values:
Type
,Iscsi
.- Vswitch
Id string The vswitch id of gateway.
- Description string
the description of gateway.
- Gateway
Class string the gateway class. the valid values:
Basic
,Standard
,Enhanced
,Advanced
- Gateway
Name string the name of gateway.
- Location string
gateway location. the valid values:
Cloud
,On_Premise
.- Payment
Type string The Payment type of gateway. The valid value:
PayAsYouGo
.- Public
Network intBandwidth The public network bandwidth of gateway. Valid values between
5
and200
. Defaults to5
.- Reason
Detail string The reason detail of gateway.
- Reason
Type string The reason type when user deletes the gateway.
- Release
After boolExpiration Whether to release the gateway due to expiration.
- Status string
gateway status.
- Storage
Bundle stringId storage bundle id.
- Type string
gateway type. the valid values:
Type
,Iscsi
.- Vswitch
Id string The vswitch id of gateway.
- description String
the description of gateway.
- gateway
Class String the gateway class. the valid values:
Basic
,Standard
,Enhanced
,Advanced
- gateway
Name String the name of gateway.
- location String
gateway location. the valid values:
Cloud
,On_Premise
.- payment
Type String The Payment type of gateway. The valid value:
PayAsYouGo
.- public
Network IntegerBandwidth The public network bandwidth of gateway. Valid values between
5
and200
. Defaults to5
.- reason
Detail String The reason detail of gateway.
- reason
Type String The reason type when user deletes the gateway.
- release
After BooleanExpiration Whether to release the gateway due to expiration.
- status String
gateway status.
- storage
Bundle StringId storage bundle id.
- type String
gateway type. the valid values:
Type
,Iscsi
.- vswitch
Id String The vswitch id of gateway.
- description string
the description of gateway.
- gateway
Class string the gateway class. the valid values:
Basic
,Standard
,Enhanced
,Advanced
- gateway
Name string the name of gateway.
- location string
gateway location. the valid values:
Cloud
,On_Premise
.- payment
Type string The Payment type of gateway. The valid value:
PayAsYouGo
.- public
Network numberBandwidth The public network bandwidth of gateway. Valid values between
5
and200
. Defaults to5
.- reason
Detail string The reason detail of gateway.
- reason
Type string The reason type when user deletes the gateway.
- release
After booleanExpiration Whether to release the gateway due to expiration.
- status string
gateway status.
- storage
Bundle stringId storage bundle id.
- type string
gateway type. the valid values:
Type
,Iscsi
.- vswitch
Id string The vswitch id of gateway.
- description str
the description of gateway.
- gateway_
class str the gateway class. the valid values:
Basic
,Standard
,Enhanced
,Advanced
- gateway_
name str the name of gateway.
- location str
gateway location. the valid values:
Cloud
,On_Premise
.- payment_
type str The Payment type of gateway. The valid value:
PayAsYouGo
.- public_
network_ intbandwidth The public network bandwidth of gateway. Valid values between
5
and200
. Defaults to5
.- reason_
detail str The reason detail of gateway.
- reason_
type str The reason type when user deletes the gateway.
- release_
after_ boolexpiration Whether to release the gateway due to expiration.
- status str
gateway status.
- storage_
bundle_ strid storage bundle id.
- type str
gateway type. the valid values:
Type
,Iscsi
.- vswitch_
id str The vswitch id of gateway.
- description String
the description of gateway.
- gateway
Class String the gateway class. the valid values:
Basic
,Standard
,Enhanced
,Advanced
- gateway
Name String the name of gateway.
- location String
gateway location. the valid values:
Cloud
,On_Premise
.- payment
Type String The Payment type of gateway. The valid value:
PayAsYouGo
.- public
Network NumberBandwidth The public network bandwidth of gateway. Valid values between
5
and200
. Defaults to5
.- reason
Detail String The reason detail of gateway.
- reason
Type String The reason type when user deletes the gateway.
- release
After BooleanExpiration Whether to release the gateway due to expiration.
- status String
gateway status.
- storage
Bundle StringId storage bundle id.
- type String
gateway type. the valid values:
Type
,Iscsi
.- vswitch
Id String The vswitch id of gateway.
Import
Cloud Storage Gateway Gateway can be imported using the id, e.g.
$ pulumi import alicloud:cloudstoragegateway/gateway:Gateway example <id>
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.