alicloud.eais.Instance
Explore with Pulumi AI
Provides a Elastic Accelerated Computing Instances (EAIS) Instance resource.
For information about Elastic Accelerated Computing Instances (EAIS) Instance and how to use it, see What is Instance.
NOTE: Available since v1.137.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 zoneId = "cn-hangzhou-h";
const _default = new alicloud.vpc.Network("default", {
vpcName: name,
cidrBlock: "192.168.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
vswitchName: name,
vpcId: _default.id,
cidrBlock: "192.168.192.0/24",
zoneId: zoneId,
});
const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("default", {
name: name,
vpcId: _default.id,
});
const defaultInstance = new alicloud.eais.Instance("default", {
instanceType: "eais.ei-a6.2xlarge",
vswitchId: defaultSwitch.id,
securityGroupId: defaultSecurityGroup.id,
instanceName: name,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
zone_id = "cn-hangzhou-h"
default = alicloud.vpc.Network("default",
vpc_name=name,
cidr_block="192.168.0.0/16")
default_switch = alicloud.vpc.Switch("default",
vswitch_name=name,
vpc_id=default.id,
cidr_block="192.168.192.0/24",
zone_id=zone_id)
default_security_group = alicloud.ecs.SecurityGroup("default",
name=name,
vpc_id=default.id)
default_instance = alicloud.eais.Instance("default",
instance_type="eais.ei-a6.2xlarge",
vswitch_id=default_switch.id,
security_group_id=default_security_group.id,
instance_name=name)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/eais"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"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
}
zoneId := "cn-hangzhou-h"
_, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
VpcName: pulumi.String(name),
CidrBlock: pulumi.String("192.168.0.0/16"),
})
if err != nil {
return err
}
defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
VswitchName: pulumi.String(name),
VpcId: _default.ID(),
CidrBlock: pulumi.String("192.168.192.0/24"),
ZoneId: pulumi.String(zoneId),
})
if err != nil {
return err
}
defaultSecurityGroup, err := ecs.NewSecurityGroup(ctx, "default", &ecs.SecurityGroupArgs{
Name: pulumi.String(name),
VpcId: _default.ID(),
})
if err != nil {
return err
}
_, err = eais.NewInstance(ctx, "default", &eais.InstanceArgs{
InstanceType: pulumi.String("eais.ei-a6.2xlarge"),
VswitchId: defaultSwitch.ID(),
SecurityGroupId: defaultSecurityGroup.ID(),
InstanceName: pulumi.String(name),
})
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 zoneId = "cn-hangzhou-h";
var @default = new AliCloud.Vpc.Network("default", new()
{
VpcName = name,
CidrBlock = "192.168.0.0/16",
});
var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
{
VswitchName = name,
VpcId = @default.Id,
CidrBlock = "192.168.192.0/24",
ZoneId = zoneId,
});
var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("default", new()
{
Name = name,
VpcId = @default.Id,
});
var defaultInstance = new AliCloud.Eais.Instance("default", new()
{
InstanceType = "eais.ei-a6.2xlarge",
VswitchId = defaultSwitch.Id,
SecurityGroupId = defaultSecurityGroup.Id,
InstanceName = name,
});
});
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.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.eais.Instance;
import com.pulumi.alicloud.eais.InstanceArgs;
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 zoneId = "cn-hangzhou-h";
var default_ = new Network("default", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("192.168.0.0/16")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName(name)
.vpcId(default_.id())
.cidrBlock("192.168.192.0/24")
.zoneId(zoneId)
.build());
var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
.name(name)
.vpcId(default_.id())
.build());
var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
.instanceType("eais.ei-a6.2xlarge")
.vswitchId(defaultSwitch.id())
.securityGroupId(defaultSecurityGroup.id())
.instanceName(name)
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
default:
type: alicloud:vpc:Network
properties:
vpcName: ${name}
cidrBlock: 192.168.0.0/16
defaultSwitch:
type: alicloud:vpc:Switch
name: default
properties:
vswitchName: ${name}
vpcId: ${default.id}
cidrBlock: 192.168.192.0/24
zoneId: ${zoneId}
defaultSecurityGroup:
type: alicloud:ecs:SecurityGroup
name: default
properties:
name: ${name}
vpcId: ${default.id}
defaultInstance:
type: alicloud:eais:Instance
name: default
properties:
instanceType: eais.ei-a6.2xlarge
vswitchId: ${defaultSwitch.id}
securityGroupId: ${defaultSecurityGroup.id}
instanceName: ${name}
variables:
zoneId: cn-hangzhou-h
Create Instance Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Instance(name: string, args: InstanceArgs, opts?: CustomResourceOptions);
@overload
def Instance(resource_name: str,
args: InstanceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Instance(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_type: Optional[str] = None,
security_group_id: Optional[str] = None,
vswitch_id: Optional[str] = None,
force: Optional[bool] = None,
instance_name: Optional[str] = None)
func NewInstance(ctx *Context, name string, args InstanceArgs, opts ...ResourceOption) (*Instance, error)
public Instance(string name, InstanceArgs args, CustomResourceOptions? opts = null)
public Instance(String name, InstanceArgs args)
public Instance(String name, InstanceArgs args, CustomResourceOptions options)
type: alicloud:eais:Instance
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 InstanceArgs
- 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 InstanceArgs
- 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 InstanceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args InstanceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args InstanceArgs
- 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 exampleinstanceResourceResourceFromEaisinstance = new AliCloud.Eais.Instance("exampleinstanceResourceResourceFromEaisinstance", new()
{
InstanceType = "string",
SecurityGroupId = "string",
VswitchId = "string",
Force = false,
InstanceName = "string",
});
example, err := eais.NewInstance(ctx, "exampleinstanceResourceResourceFromEaisinstance", &eais.InstanceArgs{
InstanceType: pulumi.String("string"),
SecurityGroupId: pulumi.String("string"),
VswitchId: pulumi.String("string"),
Force: pulumi.Bool(false),
InstanceName: pulumi.String("string"),
})
var exampleinstanceResourceResourceFromEaisinstance = new Instance("exampleinstanceResourceResourceFromEaisinstance", InstanceArgs.builder()
.instanceType("string")
.securityGroupId("string")
.vswitchId("string")
.force(false)
.instanceName("string")
.build());
exampleinstance_resource_resource_from_eaisinstance = alicloud.eais.Instance("exampleinstanceResourceResourceFromEaisinstance",
instance_type="string",
security_group_id="string",
vswitch_id="string",
force=False,
instance_name="string")
const exampleinstanceResourceResourceFromEaisinstance = new alicloud.eais.Instance("exampleinstanceResourceResourceFromEaisinstance", {
instanceType: "string",
securityGroupId: "string",
vswitchId: "string",
force: false,
instanceName: "string",
});
type: alicloud:eais:Instance
properties:
force: false
instanceName: string
instanceType: string
securityGroupId: string
vswitchId: string
Instance 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 Instance resource accepts the following input properties:
- Instance
Type string - The type of the Instance. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
. - Security
Group stringId - The ID of the security group.
- Vswitch
Id string - The ID of the vSwitch.
- Force bool
- Specifies whether to force delete the Instance. Default value:
false
. Valid values: - Instance
Name string - The name of the Instance.
- Instance
Type string - The type of the Instance. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
. - Security
Group stringId - The ID of the security group.
- Vswitch
Id string - The ID of the vSwitch.
- Force bool
- Specifies whether to force delete the Instance. Default value:
false
. Valid values: - Instance
Name string - The name of the Instance.
- instance
Type String - The type of the Instance. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
. - security
Group StringId - The ID of the security group.
- vswitch
Id String - The ID of the vSwitch.
- force Boolean
- Specifies whether to force delete the Instance. Default value:
false
. Valid values: - instance
Name String - The name of the Instance.
- instance
Type string - The type of the Instance. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
. - security
Group stringId - The ID of the security group.
- vswitch
Id string - The ID of the vSwitch.
- force boolean
- Specifies whether to force delete the Instance. Default value:
false
. Valid values: - instance
Name string - The name of the Instance.
- instance_
type str - The type of the Instance. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
. - security_
group_ strid - The ID of the security group.
- vswitch_
id str - The ID of the vSwitch.
- force bool
- Specifies whether to force delete the Instance. Default value:
false
. Valid values: - instance_
name str - The name of the Instance.
- instance
Type String - The type of the Instance. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
. - security
Group StringId - The ID of the security group.
- vswitch
Id String - The ID of the vSwitch.
- force Boolean
- Specifies whether to force delete the Instance. Default value:
false
. Valid values: - instance
Name String - The name of the Instance.
Outputs
All input properties are implicitly available as output properties. Additionally, the Instance resource produces the following output properties:
Look up Existing Instance Resource
Get an existing Instance 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?: InstanceState, opts?: CustomResourceOptions): Instance
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
force: Optional[bool] = None,
instance_name: Optional[str] = None,
instance_type: Optional[str] = None,
security_group_id: Optional[str] = None,
status: Optional[str] = None,
vswitch_id: Optional[str] = None) -> Instance
func GetInstance(ctx *Context, name string, id IDInput, state *InstanceState, opts ...ResourceOption) (*Instance, error)
public static Instance Get(string name, Input<string> id, InstanceState? state, CustomResourceOptions? opts = null)
public static Instance get(String name, Output<String> id, InstanceState 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.
- Force bool
- Specifies whether to force delete the Instance. Default value:
false
. Valid values: - Instance
Name string - The name of the Instance.
- Instance
Type string - The type of the Instance. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
. - Security
Group stringId - The ID of the security group.
- Status string
- The status of the Instance.
- Vswitch
Id string - The ID of the vSwitch.
- Force bool
- Specifies whether to force delete the Instance. Default value:
false
. Valid values: - Instance
Name string - The name of the Instance.
- Instance
Type string - The type of the Instance. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
. - Security
Group stringId - The ID of the security group.
- Status string
- The status of the Instance.
- Vswitch
Id string - The ID of the vSwitch.
- force Boolean
- Specifies whether to force delete the Instance. Default value:
false
. Valid values: - instance
Name String - The name of the Instance.
- instance
Type String - The type of the Instance. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
. - security
Group StringId - The ID of the security group.
- status String
- The status of the Instance.
- vswitch
Id String - The ID of the vSwitch.
- force boolean
- Specifies whether to force delete the Instance. Default value:
false
. Valid values: - instance
Name string - The name of the Instance.
- instance
Type string - The type of the Instance. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
. - security
Group stringId - The ID of the security group.
- status string
- The status of the Instance.
- vswitch
Id string - The ID of the vSwitch.
- force bool
- Specifies whether to force delete the Instance. Default value:
false
. Valid values: - instance_
name str - The name of the Instance.
- instance_
type str - The type of the Instance. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
. - security_
group_ strid - The ID of the security group.
- status str
- The status of the Instance.
- vswitch_
id str - The ID of the vSwitch.
- force Boolean
- Specifies whether to force delete the Instance. Default value:
false
. Valid values: - instance
Name String - The name of the Instance.
- instance
Type String - The type of the Instance. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
. - security
Group StringId - The ID of the security group.
- status String
- The status of the Instance.
- vswitch
Id String - The ID of the vSwitch.
Import
Elastic Accelerated Computing Instances (EAIS) Instance can be imported using the id, e.g.
$ pulumi import alicloud:eais/instance:Instance 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.