alicloud.gpdb.ExternalDataService
Explore with Pulumi AI
Provides a GPDB External Data Service resource.
External Data Services.
For information about GPDB External Data Service and how to use it, see What is External Data Service.
NOTE: Available since v1.227.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const default = alicloud.getZones({
availableResourceCreation: "VSwitch",
});
const defaultrple4a = new alicloud.vpc.Network("defaultrple4a", {cidrBlock: "192.168.0.0/16"});
const defaultnYWSkl = new alicloud.vpc.Switch("defaultnYWSkl", {
vpcId: defaultrple4a.id,
zoneId: "cn-beijing-h",
cidrBlock: "192.168.1.0/24",
});
const defaultZ7DPgB = new alicloud.gpdb.Instance("defaultZ7DPgB", {
instanceSpec: "2C8G",
description: name,
segNodeNum: 2,
segStorageType: "cloud_essd",
instanceNetworkType: "VPC",
dbInstanceCategory: "Basic",
paymentType: "PayAsYouGo",
sslEnabled: 0,
engineVersion: "6.0",
zoneId: "cn-beijing-h",
vswitchId: defaultnYWSkl.id,
storageSize: 50,
masterCu: 4,
vpcId: defaultrple4a.id,
dbInstanceMode: "StorageElastic",
engine: "gpdb",
});
const defaultExternalDataService = new alicloud.gpdb.ExternalDataService("default", {
serviceName: "example6",
dbInstanceId: defaultZ7DPgB.id,
serviceDescription: "example",
serviceSpec: "8",
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.get_zones(available_resource_creation="VSwitch")
defaultrple4a = alicloud.vpc.Network("defaultrple4a", cidr_block="192.168.0.0/16")
defaultn_yw_skl = alicloud.vpc.Switch("defaultnYWSkl",
vpc_id=defaultrple4a.id,
zone_id="cn-beijing-h",
cidr_block="192.168.1.0/24")
default_z7_d_pg_b = alicloud.gpdb.Instance("defaultZ7DPgB",
instance_spec="2C8G",
description=name,
seg_node_num=2,
seg_storage_type="cloud_essd",
instance_network_type="VPC",
db_instance_category="Basic",
payment_type="PayAsYouGo",
ssl_enabled=0,
engine_version="6.0",
zone_id="cn-beijing-h",
vswitch_id=defaultn_yw_skl.id,
storage_size=50,
master_cu=4,
vpc_id=defaultrple4a.id,
db_instance_mode="StorageElastic",
engine="gpdb")
default_external_data_service = alicloud.gpdb.ExternalDataService("default",
service_name="example6",
db_instance_id=default_z7_d_pg_b.id,
service_description="example",
service_spec="8")
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/gpdb"
"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 := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
AvailableResourceCreation: pulumi.StringRef("VSwitch"),
}, nil)
if err != nil {
return err
}
defaultrple4a, err := vpc.NewNetwork(ctx, "defaultrple4a", &vpc.NetworkArgs{
CidrBlock: pulumi.String("192.168.0.0/16"),
})
if err != nil {
return err
}
defaultnYWSkl, err := vpc.NewSwitch(ctx, "defaultnYWSkl", &vpc.SwitchArgs{
VpcId: defaultrple4a.ID(),
ZoneId: pulumi.String("cn-beijing-h"),
CidrBlock: pulumi.String("192.168.1.0/24"),
})
if err != nil {
return err
}
defaultZ7DPgB, err := gpdb.NewInstance(ctx, "defaultZ7DPgB", &gpdb.InstanceArgs{
InstanceSpec: pulumi.String("2C8G"),
Description: pulumi.String(name),
SegNodeNum: pulumi.Int(2),
SegStorageType: pulumi.String("cloud_essd"),
InstanceNetworkType: pulumi.String("VPC"),
DbInstanceCategory: pulumi.String("Basic"),
PaymentType: pulumi.String("PayAsYouGo"),
SslEnabled: pulumi.Int(0),
EngineVersion: pulumi.String("6.0"),
ZoneId: pulumi.String("cn-beijing-h"),
VswitchId: defaultnYWSkl.ID(),
StorageSize: pulumi.Int(50),
MasterCu: pulumi.Int(4),
VpcId: defaultrple4a.ID(),
DbInstanceMode: pulumi.String("StorageElastic"),
Engine: pulumi.String("gpdb"),
})
if err != nil {
return err
}
_, err = gpdb.NewExternalDataService(ctx, "default", &gpdb.ExternalDataServiceArgs{
ServiceName: pulumi.String("example6"),
DbInstanceId: defaultZ7DPgB.ID(),
ServiceDescription: pulumi.String("example"),
ServiceSpec: pulumi.String("8"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var @default = AliCloud.GetZones.Invoke(new()
{
AvailableResourceCreation = "VSwitch",
});
var defaultrple4a = new AliCloud.Vpc.Network("defaultrple4a", new()
{
CidrBlock = "192.168.0.0/16",
});
var defaultnYWSkl = new AliCloud.Vpc.Switch("defaultnYWSkl", new()
{
VpcId = defaultrple4a.Id,
ZoneId = "cn-beijing-h",
CidrBlock = "192.168.1.0/24",
});
var defaultZ7DPgB = new AliCloud.Gpdb.Instance("defaultZ7DPgB", new()
{
InstanceSpec = "2C8G",
Description = name,
SegNodeNum = 2,
SegStorageType = "cloud_essd",
InstanceNetworkType = "VPC",
DbInstanceCategory = "Basic",
PaymentType = "PayAsYouGo",
SslEnabled = 0,
EngineVersion = "6.0",
ZoneId = "cn-beijing-h",
VswitchId = defaultnYWSkl.Id,
StorageSize = 50,
MasterCu = 4,
VpcId = defaultrple4a.Id,
DbInstanceMode = "StorageElastic",
Engine = "gpdb",
});
var defaultExternalDataService = new AliCloud.Gpdb.ExternalDataService("default", new()
{
ServiceName = "example6",
DbInstanceId = defaultZ7DPgB.Id,
ServiceDescription = "example",
ServiceSpec = "8",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
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.gpdb.Instance;
import com.pulumi.alicloud.gpdb.InstanceArgs;
import com.pulumi.alicloud.gpdb.ExternalDataService;
import com.pulumi.alicloud.gpdb.ExternalDataServiceArgs;
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");
final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var defaultrple4a = new Network("defaultrple4a", NetworkArgs.builder()
.cidrBlock("192.168.0.0/16")
.build());
var defaultnYWSkl = new Switch("defaultnYWSkl", SwitchArgs.builder()
.vpcId(defaultrple4a.id())
.zoneId("cn-beijing-h")
.cidrBlock("192.168.1.0/24")
.build());
var defaultZ7DPgB = new Instance("defaultZ7DPgB", InstanceArgs.builder()
.instanceSpec("2C8G")
.description(name)
.segNodeNum("2")
.segStorageType("cloud_essd")
.instanceNetworkType("VPC")
.dbInstanceCategory("Basic")
.paymentType("PayAsYouGo")
.sslEnabled("0")
.engineVersion("6.0")
.zoneId("cn-beijing-h")
.vswitchId(defaultnYWSkl.id())
.storageSize("50")
.masterCu("4")
.vpcId(defaultrple4a.id())
.dbInstanceMode("StorageElastic")
.engine("gpdb")
.build());
var defaultExternalDataService = new ExternalDataService("defaultExternalDataService", ExternalDataServiceArgs.builder()
.serviceName("example6")
.dbInstanceId(defaultZ7DPgB.id())
.serviceDescription("example")
.serviceSpec("8")
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
defaultrple4a:
type: alicloud:vpc:Network
properties:
cidrBlock: 192.168.0.0/16
defaultnYWSkl:
type: alicloud:vpc:Switch
properties:
vpcId: ${defaultrple4a.id}
zoneId: cn-beijing-h
cidrBlock: 192.168.1.0/24
defaultZ7DPgB:
type: alicloud:gpdb:Instance
properties:
instanceSpec: 2C8G
description: ${name}
segNodeNum: '2'
segStorageType: cloud_essd
instanceNetworkType: VPC
dbInstanceCategory: Basic
paymentType: PayAsYouGo
sslEnabled: '0'
engineVersion: '6.0'
zoneId: cn-beijing-h
vswitchId: ${defaultnYWSkl.id}
storageSize: '50'
masterCu: '4'
vpcId: ${defaultrple4a.id}
dbInstanceMode: StorageElastic
engine: gpdb
defaultExternalDataService:
type: alicloud:gpdb:ExternalDataService
name: default
properties:
serviceName: example6
dbInstanceId: ${defaultZ7DPgB.id}
serviceDescription: example
serviceSpec: '8'
variables:
default:
fn::invoke:
Function: alicloud:getZones
Arguments:
availableResourceCreation: VSwitch
Create ExternalDataService Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ExternalDataService(name: string, args: ExternalDataServiceArgs, opts?: CustomResourceOptions);
@overload
def ExternalDataService(resource_name: str,
args: ExternalDataServiceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ExternalDataService(resource_name: str,
opts: Optional[ResourceOptions] = None,
db_instance_id: Optional[str] = None,
service_name: Optional[str] = None,
service_spec: Optional[str] = None,
service_description: Optional[str] = None)
func NewExternalDataService(ctx *Context, name string, args ExternalDataServiceArgs, opts ...ResourceOption) (*ExternalDataService, error)
public ExternalDataService(string name, ExternalDataServiceArgs args, CustomResourceOptions? opts = null)
public ExternalDataService(String name, ExternalDataServiceArgs args)
public ExternalDataService(String name, ExternalDataServiceArgs args, CustomResourceOptions options)
type: alicloud:gpdb:ExternalDataService
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 ExternalDataServiceArgs
- 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 ExternalDataServiceArgs
- 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 ExternalDataServiceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ExternalDataServiceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ExternalDataServiceArgs
- 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 externalDataServiceResource = new AliCloud.Gpdb.ExternalDataService("externalDataServiceResource", new()
{
DbInstanceId = "string",
ServiceName = "string",
ServiceSpec = "string",
ServiceDescription = "string",
});
example, err := gpdb.NewExternalDataService(ctx, "externalDataServiceResource", &gpdb.ExternalDataServiceArgs{
DbInstanceId: pulumi.String("string"),
ServiceName: pulumi.String("string"),
ServiceSpec: pulumi.String("string"),
ServiceDescription: pulumi.String("string"),
})
var externalDataServiceResource = new ExternalDataService("externalDataServiceResource", ExternalDataServiceArgs.builder()
.dbInstanceId("string")
.serviceName("string")
.serviceSpec("string")
.serviceDescription("string")
.build());
external_data_service_resource = alicloud.gpdb.ExternalDataService("externalDataServiceResource",
db_instance_id="string",
service_name="string",
service_spec="string",
service_description="string")
const externalDataServiceResource = new alicloud.gpdb.ExternalDataService("externalDataServiceResource", {
dbInstanceId: "string",
serviceName: "string",
serviceSpec: "string",
serviceDescription: "string",
});
type: alicloud:gpdb:ExternalDataService
properties:
dbInstanceId: string
serviceDescription: string
serviceName: string
serviceSpec: string
ExternalDataService 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 ExternalDataService resource accepts the following input properties:
- Db
Instance stringId - Instance ID
- Service
Name string - Service Name
- Service
Spec string - Service Specifications
- Service
Description string - Service Description
- Db
Instance stringId - Instance ID
- Service
Name string - Service Name
- Service
Spec string - Service Specifications
- Service
Description string - Service Description
- db
Instance StringId - Instance ID
- service
Name String - Service Name
- service
Spec String - Service Specifications
- service
Description String - Service Description
- db
Instance stringId - Instance ID
- service
Name string - Service Name
- service
Spec string - Service Specifications
- service
Description string - Service Description
- db_
instance_ strid - Instance ID
- service_
name str - Service Name
- service_
spec str - Service Specifications
- service_
description str - Service Description
- db
Instance StringId - Instance ID
- service
Name String - Service Name
- service
Spec String - Service Specifications
- service
Description String - Service Description
Outputs
All input properties are implicitly available as output properties. Additionally, the ExternalDataService resource produces the following output properties:
- Create
Time string - The creation time of the resource
- Id string
- The provider-assigned unique ID for this managed resource.
- Service
Id int - Service ID
- Status string
- The status of the resource
- Create
Time string - The creation time of the resource
- Id string
- The provider-assigned unique ID for this managed resource.
- Service
Id int - Service ID
- Status string
- The status of the resource
- create
Time String - The creation time of the resource
- id String
- The provider-assigned unique ID for this managed resource.
- service
Id Integer - Service ID
- status String
- The status of the resource
- create
Time string - The creation time of the resource
- id string
- The provider-assigned unique ID for this managed resource.
- service
Id number - Service ID
- status string
- The status of the resource
- create_
time str - The creation time of the resource
- id str
- The provider-assigned unique ID for this managed resource.
- service_
id int - Service ID
- status str
- The status of the resource
- create
Time String - The creation time of the resource
- id String
- The provider-assigned unique ID for this managed resource.
- service
Id Number - Service ID
- status String
- The status of the resource
Look up Existing ExternalDataService Resource
Get an existing ExternalDataService 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?: ExternalDataServiceState, opts?: CustomResourceOptions): ExternalDataService
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
create_time: Optional[str] = None,
db_instance_id: Optional[str] = None,
service_description: Optional[str] = None,
service_id: Optional[int] = None,
service_name: Optional[str] = None,
service_spec: Optional[str] = None,
status: Optional[str] = None) -> ExternalDataService
func GetExternalDataService(ctx *Context, name string, id IDInput, state *ExternalDataServiceState, opts ...ResourceOption) (*ExternalDataService, error)
public static ExternalDataService Get(string name, Input<string> id, ExternalDataServiceState? state, CustomResourceOptions? opts = null)
public static ExternalDataService get(String name, Output<String> id, ExternalDataServiceState 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.
- Create
Time string - The creation time of the resource
- Db
Instance stringId - Instance ID
- Service
Description string - Service Description
- Service
Id int - Service ID
- Service
Name string - Service Name
- Service
Spec string - Service Specifications
- Status string
- The status of the resource
- Create
Time string - The creation time of the resource
- Db
Instance stringId - Instance ID
- Service
Description string - Service Description
- Service
Id int - Service ID
- Service
Name string - Service Name
- Service
Spec string - Service Specifications
- Status string
- The status of the resource
- create
Time String - The creation time of the resource
- db
Instance StringId - Instance ID
- service
Description String - Service Description
- service
Id Integer - Service ID
- service
Name String - Service Name
- service
Spec String - Service Specifications
- status String
- The status of the resource
- create
Time string - The creation time of the resource
- db
Instance stringId - Instance ID
- service
Description string - Service Description
- service
Id number - Service ID
- service
Name string - Service Name
- service
Spec string - Service Specifications
- status string
- The status of the resource
- create_
time str - The creation time of the resource
- db_
instance_ strid - Instance ID
- service_
description str - Service Description
- service_
id int - Service ID
- service_
name str - Service Name
- service_
spec str - Service Specifications
- status str
- The status of the resource
- create
Time String - The creation time of the resource
- db
Instance StringId - Instance ID
- service
Description String - Service Description
- service
Id Number - Service ID
- service
Name String - Service Name
- service
Spec String - Service Specifications
- status String
- The status of the resource
Import
GPDB External Data Service can be imported using the id, e.g.
$ pulumi import alicloud:gpdb/externalDataService:ExternalDataService example <db_instance_id>:<service_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.