1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. eais
  5. Instance
Alibaba Cloud v3.56.0 published on Friday, May 31, 2024 by Pulumi

alicloud.eais.Instance

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.56.0 published on Friday, May 31, 2024 by Pulumi

    Provides a EAIS Instance resource.

    For information about 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") || "tf-example";
    const zoneId = "cn-hangzhou-h";
    const default = alicloud.getZones({
        availableResourceCreation: "VSwitch",
    });
    const defaultNetwork = new alicloud.vpc.Network("default", {
        vpcName: name,
        cidrBlock: "10.0.0.0/8",
    });
    const defaultSwitch = new alicloud.vpc.Switch("default", {
        vswitchName: name,
        cidrBlock: "10.1.0.0/16",
        vpcId: defaultNetwork.id,
        zoneId: zoneId,
    });
    const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("default", {
        name: name,
        vpcId: defaultNetwork.id,
    });
    const defaultInstance = new alicloud.eais.Instance("default", {
        instanceType: "eais.ei-a6.2xlarge",
        instanceName: name,
        securityGroupId: defaultSecurityGroup.id,
        vswitchId: defaultSwitch.id,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    zone_id = "cn-hangzhou-h"
    default = alicloud.get_zones(available_resource_creation="VSwitch")
    default_network = alicloud.vpc.Network("default",
        vpc_name=name,
        cidr_block="10.0.0.0/8")
    default_switch = alicloud.vpc.Switch("default",
        vswitch_name=name,
        cidr_block="10.1.0.0/16",
        vpc_id=default_network.id,
        zone_id=zone_id)
    default_security_group = alicloud.ecs.SecurityGroup("default",
        name=name,
        vpc_id=default_network.id)
    default_instance = alicloud.eais.Instance("default",
        instance_type="eais.ei-a6.2xlarge",
        instance_name=name,
        security_group_id=default_security_group.id,
        vswitch_id=default_switch.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"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 := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		zoneId := "cn-hangzhou-h"
    		_, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
    			AvailableResourceCreation: pulumi.StringRef("VSwitch"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(name),
    			CidrBlock: pulumi.String("10.0.0.0/8"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
    			VswitchName: pulumi.String(name),
    			CidrBlock:   pulumi.String("10.1.0.0/16"),
    			VpcId:       defaultNetwork.ID(),
    			ZoneId:      pulumi.String(zoneId),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSecurityGroup, err := ecs.NewSecurityGroup(ctx, "default", &ecs.SecurityGroupArgs{
    			Name:  pulumi.String(name),
    			VpcId: defaultNetwork.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = eais.NewInstance(ctx, "default", &eais.InstanceArgs{
    			InstanceType:    pulumi.String("eais.ei-a6.2xlarge"),
    			InstanceName:    pulumi.String(name),
    			SecurityGroupId: defaultSecurityGroup.ID(),
    			VswitchId:       defaultSwitch.ID(),
    		})
    		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") ?? "tf-example";
        var zoneId = "cn-hangzhou-h";
    
        var @default = AliCloud.GetZones.Invoke(new()
        {
            AvailableResourceCreation = "VSwitch",
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("default", new()
        {
            VpcName = name,
            CidrBlock = "10.0.0.0/8",
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
        {
            VswitchName = name,
            CidrBlock = "10.1.0.0/16",
            VpcId = defaultNetwork.Id,
            ZoneId = zoneId,
        });
    
        var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("default", new()
        {
            Name = name,
            VpcId = defaultNetwork.Id,
        });
    
        var defaultInstance = new AliCloud.Eais.Instance("default", new()
        {
            InstanceType = "eais.ei-a6.2xlarge",
            InstanceName = name,
            SecurityGroupId = defaultSecurityGroup.Id,
            VswitchId = defaultSwitch.Id,
        });
    
    });
    
    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.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("tf-example");
            final var zoneId = "cn-hangzhou-h";
    
            final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
                .availableResourceCreation("VSwitch")
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
                .vpcName(name)
                .cidrBlock("10.0.0.0/8")
                .build());
    
            var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
                .vswitchName(name)
                .cidrBlock("10.1.0.0/16")
                .vpcId(defaultNetwork.id())
                .zoneId(zoneId)
                .build());
    
            var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
                .name(name)
                .vpcId(defaultNetwork.id())
                .build());
    
            var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
                .instanceType("eais.ei-a6.2xlarge")
                .instanceName(name)
                .securityGroupId(defaultSecurityGroup.id())
                .vswitchId(defaultSwitch.id())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      defaultNetwork:
        type: alicloud:vpc:Network
        name: default
        properties:
          vpcName: ${name}
          cidrBlock: 10.0.0.0/8
      defaultSwitch:
        type: alicloud:vpc:Switch
        name: default
        properties:
          vswitchName: ${name}
          cidrBlock: 10.1.0.0/16
          vpcId: ${defaultNetwork.id}
          zoneId: ${zoneId}
      defaultSecurityGroup:
        type: alicloud:ecs:SecurityGroup
        name: default
        properties:
          name: ${name}
          vpcId: ${defaultNetwork.id}
      defaultInstance:
        type: alicloud:eais:Instance
        name: default
        properties:
          instanceType: eais.ei-a6.2xlarge
          instanceName: ${name}
          securityGroupId: ${defaultSecurityGroup.id}
          vswitchId: ${defaultSwitch.id}
    variables:
      zoneId: cn-hangzhou-h
      default:
        fn::invoke:
          Function: alicloud:getZones
          Arguments:
            availableResourceCreation: VSwitch
    

    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.

    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

    The Instance resource accepts the following input properties:

    InstanceType string
    The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.
    SecurityGroupId string
    The ID of the security group.
    VswitchId string
    The ID of the vswitch.
    Force bool
    Whether to force deletion when the instance status does not meet the deletion conditions. Valid values: true and false.
    InstanceName string
    The name of the instance.
    InstanceType string
    The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.
    SecurityGroupId string
    The ID of the security group.
    VswitchId string
    The ID of the vswitch.
    Force bool
    Whether to force deletion when the instance status does not meet the deletion conditions. Valid values: true and false.
    InstanceName string
    The name of the instance.
    instanceType String
    The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.
    securityGroupId String
    The ID of the security group.
    vswitchId String
    The ID of the vswitch.
    force Boolean
    Whether to force deletion when the instance status does not meet the deletion conditions. Valid values: true and false.
    instanceName String
    The name of the instance.
    instanceType string
    The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.
    securityGroupId string
    The ID of the security group.
    vswitchId string
    The ID of the vswitch.
    force boolean
    Whether to force deletion when the instance status does not meet the deletion conditions. Valid values: true and false.
    instanceName string
    The name of the instance.
    instance_type str
    The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.
    security_group_id str
    The ID of the security group.
    vswitch_id str
    The ID of the vswitch.
    force bool
    Whether to force deletion when the instance status does not meet the deletion conditions. Valid values: true and false.
    instance_name str
    The name of the instance.
    instanceType String
    The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.
    securityGroupId String
    The ID of the security group.
    vswitchId String
    The ID of the vswitch.
    force Boolean
    Whether to force deletion when the instance status does not meet the deletion conditions. Valid values: true and false.
    instanceName 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:

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.

    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.
    The following state arguments are supported:
    Force bool
    Whether to force deletion when the instance status does not meet the deletion conditions. Valid values: true and false.
    InstanceName string
    The name of the instance.
    InstanceType string
    The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.
    SecurityGroupId string
    The ID of the security group.
    Status string
    The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.
    VswitchId string
    The ID of the vswitch.
    Force bool
    Whether to force deletion when the instance status does not meet the deletion conditions. Valid values: true and false.
    InstanceName string
    The name of the instance.
    InstanceType string
    The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.
    SecurityGroupId string
    The ID of the security group.
    Status string
    The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.
    VswitchId string
    The ID of the vswitch.
    force Boolean
    Whether to force deletion when the instance status does not meet the deletion conditions. Valid values: true and false.
    instanceName String
    The name of the instance.
    instanceType String
    The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.
    securityGroupId String
    The ID of the security group.
    status String
    The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.
    vswitchId String
    The ID of the vswitch.
    force boolean
    Whether to force deletion when the instance status does not meet the deletion conditions. Valid values: true and false.
    instanceName string
    The name of the instance.
    instanceType string
    The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.
    securityGroupId string
    The ID of the security group.
    status string
    The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.
    vswitchId string
    The ID of the vswitch.
    force bool
    Whether to force deletion when the instance status does not meet the deletion conditions. Valid values: true and false.
    instance_name str
    The name of the instance.
    instance_type str
    The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.
    security_group_id str
    The ID of the security group.
    status str
    The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.
    vswitch_id str
    The ID of the vswitch.
    force Boolean
    Whether to force deletion when the instance status does not meet the deletion conditions. Valid values: true and false.
    instanceName String
    The name of the instance.
    instanceType String
    The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.
    securityGroupId String
    The ID of the security group.
    status String
    The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.
    vswitchId String
    The ID of the vswitch.

    Import

    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.
    alicloud logo
    Alibaba Cloud v3.56.0 published on Friday, May 31, 2024 by Pulumi