alicloud.dataworks.Network
Explore with Pulumi AI
Provides a Data Works Network resource.
Resource Group Network.
For information about Data Works Network and how to use it, see What is Network.
NOTE: Available since v1.241.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as std from "@pulumi/std";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const default5Bia4h = new alicloud.vpc.Network("default5Bia4h", {
description: name,
vpcName: name,
cidrBlock: "10.0.0.0/8",
});
const defaultss7s7F = new alicloud.vpc.Switch("defaultss7s7F", {
description: name,
vpcId: default5Bia4h.id,
zoneId: "cn-beijing-g",
vswitchName: std.format({
input: "%s1",
args: [name],
}).then(invoke => invoke.result),
cidrBlock: "10.0.0.0/24",
});
const defaultVJvKvl = new alicloud.dataworks.DwResourceGroup("defaultVJvKvl", {
paymentDurationUnit: "Month",
paymentType: "PostPaid",
specification: 500,
defaultVswitchId: defaultss7s7F.id,
remark: name,
resourceGroupName: "network_openapi_example01",
defaultVpcId: default5Bia4h.id,
});
const defaulte4zhaL = new alicloud.vpc.Network("defaulte4zhaL", {
description: name,
vpcName: std.format({
input: "%s3",
args: [name],
}).then(invoke => invoke.result),
cidrBlock: "172.16.0.0/12",
});
const default675v38 = new alicloud.vpc.Switch("default675v38", {
description: name,
vpcId: defaulte4zhaL.id,
zoneId: "cn-beijing-g",
vswitchName: std.format({
input: "%s4",
args: [name],
}).then(invoke => invoke.result),
cidrBlock: "172.16.0.0/24",
});
const _default = new alicloud.dataworks.Network("default", {
vpcId: defaulte4zhaL.id,
vswitchId: default675v38.id,
dwResourceGroupId: defaultVJvKvl.id,
});
import pulumi
import pulumi_alicloud as alicloud
import pulumi_std as std
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default5_bia4h = alicloud.vpc.Network("default5Bia4h",
description=name,
vpc_name=name,
cidr_block="10.0.0.0/8")
defaultss7s7_f = alicloud.vpc.Switch("defaultss7s7F",
description=name,
vpc_id=default5_bia4h.id,
zone_id="cn-beijing-g",
vswitch_name=std.format(input="%s1",
args=[name]).result,
cidr_block="10.0.0.0/24")
default_v_jv_kvl = alicloud.dataworks.DwResourceGroup("defaultVJvKvl",
payment_duration_unit="Month",
payment_type="PostPaid",
specification=500,
default_vswitch_id=defaultss7s7_f.id,
remark=name,
resource_group_name="network_openapi_example01",
default_vpc_id=default5_bia4h.id)
defaulte4zha_l = alicloud.vpc.Network("defaulte4zhaL",
description=name,
vpc_name=std.format(input="%s3",
args=[name]).result,
cidr_block="172.16.0.0/12")
default675v38 = alicloud.vpc.Switch("default675v38",
description=name,
vpc_id=defaulte4zha_l.id,
zone_id="cn-beijing-g",
vswitch_name=std.format(input="%s4",
args=[name]).result,
cidr_block="172.16.0.0/24")
default = alicloud.dataworks.Network("default",
vpc_id=defaulte4zha_l.id,
vswitch_id=default675v38.id,
dw_resource_group_id=default_v_jv_kvl.id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dataworks"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi-std/sdk/go/std"
"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 := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
default5Bia4h, err := vpc.NewNetwork(ctx, "default5Bia4h", &vpc.NetworkArgs{
Description: pulumi.String(name),
VpcName: pulumi.String(name),
CidrBlock: pulumi.String("10.0.0.0/8"),
})
if err != nil {
return err
}
invokeFormat, err := std.Format(ctx, &std.FormatArgs{
Input: "%s1",
Args: []string{
name,
},
}, nil)
if err != nil {
return err
}
defaultss7s7F, err := vpc.NewSwitch(ctx, "defaultss7s7F", &vpc.SwitchArgs{
Description: pulumi.String(name),
VpcId: default5Bia4h.ID(),
ZoneId: pulumi.String("cn-beijing-g"),
VswitchName: pulumi.String(invokeFormat.Result),
CidrBlock: pulumi.String("10.0.0.0/24"),
})
if err != nil {
return err
}
defaultVJvKvl, err := dataworks.NewDwResourceGroup(ctx, "defaultVJvKvl", &dataworks.DwResourceGroupArgs{
PaymentDurationUnit: pulumi.String("Month"),
PaymentType: pulumi.String("PostPaid"),
Specification: pulumi.Int(500),
DefaultVswitchId: defaultss7s7F.ID(),
Remark: pulumi.String(name),
ResourceGroupName: pulumi.String("network_openapi_example01"),
DefaultVpcId: default5Bia4h.ID(),
})
if err != nil {
return err
}
invokeFormat1, err := std.Format(ctx, &std.FormatArgs{
Input: "%s3",
Args: []string{
name,
},
}, nil)
if err != nil {
return err
}
defaulte4zhaL, err := vpc.NewNetwork(ctx, "defaulte4zhaL", &vpc.NetworkArgs{
Description: pulumi.String(name),
VpcName: pulumi.String(invokeFormat1.Result),
CidrBlock: pulumi.String("172.16.0.0/12"),
})
if err != nil {
return err
}
invokeFormat2, err := std.Format(ctx, &std.FormatArgs{
Input: "%s4",
Args: []string{
name,
},
}, nil)
if err != nil {
return err
}
default675v38, err := vpc.NewSwitch(ctx, "default675v38", &vpc.SwitchArgs{
Description: pulumi.String(name),
VpcId: defaulte4zhaL.ID(),
ZoneId: pulumi.String("cn-beijing-g"),
VswitchName: pulumi.String(invokeFormat2.Result),
CidrBlock: pulumi.String("172.16.0.0/24"),
})
if err != nil {
return err
}
_, err = dataworks.NewNetwork(ctx, "default", &dataworks.NetworkArgs{
VpcId: defaulte4zhaL.ID(),
VswitchId: default675v38.ID(),
DwResourceGroupId: defaultVJvKvl.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var default5Bia4h = new AliCloud.Vpc.Network("default5Bia4h", new()
{
Description = name,
VpcName = name,
CidrBlock = "10.0.0.0/8",
});
var defaultss7s7F = new AliCloud.Vpc.Switch("defaultss7s7F", new()
{
Description = name,
VpcId = default5Bia4h.Id,
ZoneId = "cn-beijing-g",
VswitchName = Std.Format.Invoke(new()
{
Input = "%s1",
Args = new[]
{
name,
},
}).Apply(invoke => invoke.Result),
CidrBlock = "10.0.0.0/24",
});
var defaultVJvKvl = new AliCloud.DataWorks.DwResourceGroup("defaultVJvKvl", new()
{
PaymentDurationUnit = "Month",
PaymentType = "PostPaid",
Specification = 500,
DefaultVswitchId = defaultss7s7F.Id,
Remark = name,
ResourceGroupName = "network_openapi_example01",
DefaultVpcId = default5Bia4h.Id,
});
var defaulte4zhaL = new AliCloud.Vpc.Network("defaulte4zhaL", new()
{
Description = name,
VpcName = Std.Format.Invoke(new()
{
Input = "%s3",
Args = new[]
{
name,
},
}).Apply(invoke => invoke.Result),
CidrBlock = "172.16.0.0/12",
});
var default675v38 = new AliCloud.Vpc.Switch("default675v38", new()
{
Description = name,
VpcId = defaulte4zhaL.Id,
ZoneId = "cn-beijing-g",
VswitchName = Std.Format.Invoke(new()
{
Input = "%s4",
Args = new[]
{
name,
},
}).Apply(invoke => invoke.Result),
CidrBlock = "172.16.0.0/24",
});
var @default = new AliCloud.DataWorks.Network("default", new()
{
VpcId = defaulte4zhaL.Id,
VswitchId = default675v38.Id,
DwResourceGroupId = defaultVJvKvl.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.std.StdFunctions;
import com.pulumi.std.inputs.FormatArgs;
import com.pulumi.alicloud.dataworks.DwResourceGroup;
import com.pulumi.alicloud.dataworks.DwResourceGroupArgs;
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("terraform-example");
var default5Bia4h = new com.pulumi.alicloud.vpc.Network("default5Bia4h", com.pulumi.alicloud.vpc.NetworkArgs.builder()
.description(name)
.vpcName(name)
.cidrBlock("10.0.0.0/8")
.build());
var defaultss7s7F = new Switch("defaultss7s7F", SwitchArgs.builder()
.description(name)
.vpcId(default5Bia4h.id())
.zoneId("cn-beijing-g")
.vswitchName(StdFunctions.format(FormatArgs.builder()
.input("%s1")
.args(name)
.build()).result())
.cidrBlock("10.0.0.0/24")
.build());
var defaultVJvKvl = new DwResourceGroup("defaultVJvKvl", DwResourceGroupArgs.builder()
.paymentDurationUnit("Month")
.paymentType("PostPaid")
.specification(500)
.defaultVswitchId(defaultss7s7F.id())
.remark(name)
.resourceGroupName("network_openapi_example01")
.defaultVpcId(default5Bia4h.id())
.build());
var defaulte4zhaL = new com.pulumi.alicloud.vpc.Network("defaulte4zhaL", com.pulumi.alicloud.vpc.NetworkArgs.builder()
.description(name)
.vpcName(StdFunctions.format(FormatArgs.builder()
.input("%s3")
.args(name)
.build()).result())
.cidrBlock("172.16.0.0/12")
.build());
var default675v38 = new Switch("default675v38", SwitchArgs.builder()
.description(name)
.vpcId(defaulte4zhaL.id())
.zoneId("cn-beijing-g")
.vswitchName(StdFunctions.format(FormatArgs.builder()
.input("%s4")
.args(name)
.build()).result())
.cidrBlock("172.16.0.0/24")
.build());
var default_ = new com.pulumi.alicloud.dataworks.Network("default", com.pulumi.alicloud.dataworks.NetworkArgs.builder()
.vpcId(defaulte4zhaL.id())
.vswitchId(default675v38.id())
.dwResourceGroupId(defaultVJvKvl.id())
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
default5Bia4h:
type: alicloud:vpc:Network
properties:
description: ${name}
vpcName: ${name}
cidrBlock: 10.0.0.0/8
defaultss7s7F:
type: alicloud:vpc:Switch
properties:
description: ${name}
vpcId: ${default5Bia4h.id}
zoneId: cn-beijing-g
vswitchName:
fn::invoke:
function: std:format
arguments:
input: '%s1'
args:
- ${name}
return: result
cidrBlock: 10.0.0.0/24
defaultVJvKvl:
type: alicloud:dataworks:DwResourceGroup
properties:
paymentDurationUnit: Month
paymentType: PostPaid
specification: '500'
defaultVswitchId: ${defaultss7s7F.id}
remark: ${name}
resourceGroupName: network_openapi_example01
defaultVpcId: ${default5Bia4h.id}
defaulte4zhaL:
type: alicloud:vpc:Network
properties:
description: ${name}
vpcName:
fn::invoke:
function: std:format
arguments:
input: '%s3'
args:
- ${name}
return: result
cidrBlock: 172.16.0.0/12
default675v38:
type: alicloud:vpc:Switch
properties:
description: ${name}
vpcId: ${defaulte4zhaL.id}
zoneId: cn-beijing-g
vswitchName:
fn::invoke:
function: std:format
arguments:
input: '%s4'
args:
- ${name}
return: result
cidrBlock: 172.16.0.0/24
default:
type: alicloud:dataworks:Network
properties:
vpcId: ${defaulte4zhaL.id}
vswitchId: ${default675v38.id}
dwResourceGroupId: ${defaultVJvKvl.id}
Create Network Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Network(name: string, args: NetworkArgs, opts?: CustomResourceOptions);
@overload
def Network(resource_name: str,
args: NetworkArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Network(resource_name: str,
opts: Optional[ResourceOptions] = None,
dw_resource_group_id: Optional[str] = None,
vpc_id: Optional[str] = None,
vswitch_id: Optional[str] = None)
func NewNetwork(ctx *Context, name string, args NetworkArgs, opts ...ResourceOption) (*Network, error)
public Network(string name, NetworkArgs args, CustomResourceOptions? opts = null)
public Network(String name, NetworkArgs args)
public Network(String name, NetworkArgs args, CustomResourceOptions options)
type: alicloud:dataworks:Network
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args NetworkArgs
- 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 NetworkArgs
- 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 NetworkArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var alicloudNetworkResource = new AliCloud.DataWorks.Network("alicloudNetworkResource", new()
{
DwResourceGroupId = "string",
VpcId = "string",
VswitchId = "string",
});
example, err := dataworks.NewNetwork(ctx, "alicloudNetworkResource", &dataworks.NetworkArgs{
DwResourceGroupId: pulumi.String("string"),
VpcId: pulumi.String("string"),
VswitchId: pulumi.String("string"),
})
var alicloudNetworkResource = new com.pulumi.alicloud.dataworks.Network("alicloudNetworkResource", com.pulumi.alicloud.dataworks.NetworkArgs.builder()
.dwResourceGroupId("string")
.vpcId("string")
.vswitchId("string")
.build());
alicloud_network_resource = alicloud.dataworks.Network("alicloudNetworkResource",
dw_resource_group_id="string",
vpc_id="string",
vswitch_id="string")
const alicloudNetworkResource = new alicloud.dataworks.Network("alicloudNetworkResource", {
dwResourceGroupId: "string",
vpcId: "string",
vswitchId: "string",
});
type: alicloud:dataworks:Network
properties:
dwResourceGroupId: string
vpcId: string
vswitchId: string
Network Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Network resource accepts the following input properties:
- Dw
Resource stringGroup Id - The ID of the resource group.
- Vpc
Id string - Virtual Private Cloud ID of network resources
- Vswitch
Id string - The vSwitch ID of the network resource.
- Dw
Resource stringGroup Id - The ID of the resource group.
- Vpc
Id string - Virtual Private Cloud ID of network resources
- Vswitch
Id string - The vSwitch ID of the network resource.
- dw
Resource StringGroup Id - The ID of the resource group.
- vpc
Id String - Virtual Private Cloud ID of network resources
- vswitch
Id String - The vSwitch ID of the network resource.
- dw
Resource stringGroup Id - The ID of the resource group.
- vpc
Id string - Virtual Private Cloud ID of network resources
- vswitch
Id string - The vSwitch ID of the network resource.
- dw_
resource_ strgroup_ id - The ID of the resource group.
- vpc_
id str - Virtual Private Cloud ID of network resources
- vswitch_
id str - The vSwitch ID of the network resource.
- dw
Resource StringGroup Id - The ID of the resource group.
- vpc
Id String - Virtual Private Cloud ID of network resources
- vswitch
Id String - The vSwitch ID of the network resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the Network resource produces the following output properties:
- Create
Time int - Time when the network resource was created
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- Network Resource Status
- Create
Time int - Time when the network resource was created
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- Network Resource Status
- create
Time Integer - Time when the network resource was created
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- Network Resource Status
- create
Time number - Time when the network resource was created
- id string
- The provider-assigned unique ID for this managed resource.
- status string
- Network Resource Status
- create_
time int - Time when the network resource was created
- id str
- The provider-assigned unique ID for this managed resource.
- status str
- Network Resource Status
- create
Time Number - Time when the network resource was created
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- Network Resource Status
Look up Existing Network Resource
Get an existing Network 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?: NetworkState, opts?: CustomResourceOptions): Network
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
create_time: Optional[int] = None,
dw_resource_group_id: Optional[str] = None,
status: Optional[str] = None,
vpc_id: Optional[str] = None,
vswitch_id: Optional[str] = None) -> Network
func GetNetwork(ctx *Context, name string, id IDInput, state *NetworkState, opts ...ResourceOption) (*Network, error)
public static Network Get(string name, Input<string> id, NetworkState? state, CustomResourceOptions? opts = null)
public static Network get(String name, Output<String> id, NetworkState state, CustomResourceOptions options)
resources: _: type: alicloud:dataworks:Network get: id: ${id}
- 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.
- Create
Time int - Time when the network resource was created
- Dw
Resource stringGroup Id - The ID of the resource group.
- Status string
- Network Resource Status
- Vpc
Id string - Virtual Private Cloud ID of network resources
- Vswitch
Id string - The vSwitch ID of the network resource.
- Create
Time int - Time when the network resource was created
- Dw
Resource stringGroup Id - The ID of the resource group.
- Status string
- Network Resource Status
- Vpc
Id string - Virtual Private Cloud ID of network resources
- Vswitch
Id string - The vSwitch ID of the network resource.
- create
Time Integer - Time when the network resource was created
- dw
Resource StringGroup Id - The ID of the resource group.
- status String
- Network Resource Status
- vpc
Id String - Virtual Private Cloud ID of network resources
- vswitch
Id String - The vSwitch ID of the network resource.
- create
Time number - Time when the network resource was created
- dw
Resource stringGroup Id - The ID of the resource group.
- status string
- Network Resource Status
- vpc
Id string - Virtual Private Cloud ID of network resources
- vswitch
Id string - The vSwitch ID of the network resource.
- create_
time int - Time when the network resource was created
- dw_
resource_ strgroup_ id - The ID of the resource group.
- status str
- Network Resource Status
- vpc_
id str - Virtual Private Cloud ID of network resources
- vswitch_
id str - The vSwitch ID of the network resource.
- create
Time Number - Time when the network resource was created
- dw
Resource StringGroup Id - The ID of the resource group.
- status String
- Network Resource Status
- vpc
Id String - Virtual Private Cloud ID of network resources
- vswitch
Id String - The vSwitch ID of the network resource.
Import
Data Works Network can be imported using the id, e.g.
$ pulumi import alicloud:dataworks/network:Network example <id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.