1. Packages
  2. Gcore Provider
  3. API Docs
  4. Instancev2
gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core

gcore.Instancev2

Explore with Pulumi AI

gcore logo
gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core

    Gcore Instance offer a flexible, powerful, and scalable solution for hosting applications and services. Designed to meet a wide range of computing needs, our instances ensure optimal performance, reliability, and security for your applications.

    Example Usage

    Prerequisite
    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const project = gcore.getProject({
        name: "Default",
    });
    const region = gcore.getRegion({
        name: "Luxembourg-2",
    });
    const network = new gcore.Network("network", {
        type: "vxlan",
        projectId: project.then(project => project.id),
        regionId: region.then(region => region.id),
    });
    const subnet = new gcore.Subnet("subnet", {
        cidr: "192.168.10.0/24",
        networkId: network.networkId,
        projectId: project.then(project => project.id),
        regionId: region.then(region => region.id),
    });
    const ubuntu = Promise.all([region, project]).then(([region, project]) => gcore.getImage({
        name: "ubuntu-22.04-x64",
        regionId: region.id,
        projectId: project.id,
    }));
    const bootVolume = new gcore.Volume("bootVolume", {
        typeName: "ssd_hiiops",
        size: 5,
        imageId: ubuntu.then(ubuntu => ubuntu.id),
        projectId: project.then(project => project.id),
        regionId: region.then(region => region.id),
    });
    const myKeypair = new gcore.Keypair("myKeypair", {
        projectId: project.then(project => project.id),
        sshkeyName: "my-keypair",
        publicKey: "ssh-ed25519 ...your public key... gcore@gcore.com",
    });
    const _default = Promise.all([project, region]).then(([project, region]) => gcore.getSecuritygroup({
        name: "default",
        projectId: project.id,
        regionId: region.id,
    }));
    const windows = Promise.all([region, project]).then(([region, project]) => gcore.getImage({
        name: "windows-server-2022",
        regionId: region.id,
        projectId: project.id,
    }));
    
    import pulumi
    import pulumi_gcore as gcore
    
    project = gcore.get_project(name="Default")
    region = gcore.get_region(name="Luxembourg-2")
    network = gcore.Network("network",
        type="vxlan",
        project_id=project.id,
        region_id=region.id)
    subnet = gcore.Subnet("subnet",
        cidr="192.168.10.0/24",
        network_id=network.network_id,
        project_id=project.id,
        region_id=region.id)
    ubuntu = gcore.get_image(name="ubuntu-22.04-x64",
        region_id=region.id,
        project_id=project.id)
    boot_volume = gcore.Volume("bootVolume",
        type_name="ssd_hiiops",
        size=5,
        image_id=ubuntu.id,
        project_id=project.id,
        region_id=region.id)
    my_keypair = gcore.Keypair("myKeypair",
        project_id=project.id,
        sshkey_name="my-keypair",
        public_key="ssh-ed25519 ...your public key... gcore@gcore.com")
    default = gcore.get_securitygroup(name="default",
        project_id=project.id,
        region_id=region.id)
    windows = gcore.get_image(name="windows-server-2022",
        region_id=region.id,
        project_id=project.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		project, err := gcore.GetProject(ctx, &gcore.GetProjectArgs{
    			Name: "Default",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		region, err := gcore.GetRegion(ctx, &gcore.GetRegionArgs{
    			Name: "Luxembourg-2",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		network, err := gcore.NewNetwork(ctx, "network", &gcore.NetworkArgs{
    			Type:      pulumi.String("vxlan"),
    			ProjectId: pulumi.String(project.Id),
    			RegionId:  pulumi.String(region.Id),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gcore.NewSubnet(ctx, "subnet", &gcore.SubnetArgs{
    			Cidr:      pulumi.String("192.168.10.0/24"),
    			NetworkId: network.NetworkId,
    			ProjectId: pulumi.String(project.Id),
    			RegionId:  pulumi.String(region.Id),
    		})
    		if err != nil {
    			return err
    		}
    		ubuntu, err := gcore.GetImage(ctx, &gcore.GetImageArgs{
    			Name:      pulumi.StringRef("ubuntu-22.04-x64"),
    			RegionId:  pulumi.Float64Ref(region.Id),
    			ProjectId: pulumi.Float64Ref(project.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = gcore.NewVolume(ctx, "bootVolume", &gcore.VolumeArgs{
    			TypeName:  pulumi.String("ssd_hiiops"),
    			Size:      pulumi.Float64(5),
    			ImageId:   pulumi.String(ubuntu.Id),
    			ProjectId: pulumi.String(project.Id),
    			RegionId:  pulumi.String(region.Id),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gcore.NewKeypair(ctx, "myKeypair", &gcore.KeypairArgs{
    			ProjectId:  pulumi.String(project.Id),
    			SshkeyName: pulumi.String("my-keypair"),
    			PublicKey:  pulumi.String("ssh-ed25519 ...your public key... gcore@gcore.com"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gcore.LookupSecuritygroup(ctx, &gcore.LookupSecuritygroupArgs{
    			Name:      "default",
    			ProjectId: pulumi.Float64Ref(project.Id),
    			RegionId:  pulumi.Float64Ref(region.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = gcore.GetImage(ctx, &gcore.GetImageArgs{
    			Name:      pulumi.StringRef("windows-server-2022"),
    			RegionId:  pulumi.Float64Ref(region.Id),
    			ProjectId: pulumi.Float64Ref(project.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var project = Gcore.GetProject.Invoke(new()
        {
            Name = "Default",
        });
    
        var region = Gcore.GetRegion.Invoke(new()
        {
            Name = "Luxembourg-2",
        });
    
        var network = new Gcore.Network("network", new()
        {
            Type = "vxlan",
            ProjectId = project.Apply(getProjectResult => getProjectResult.Id),
            RegionId = region.Apply(getRegionResult => getRegionResult.Id),
        });
    
        var subnet = new Gcore.Subnet("subnet", new()
        {
            Cidr = "192.168.10.0/24",
            NetworkId = network.NetworkId,
            ProjectId = project.Apply(getProjectResult => getProjectResult.Id),
            RegionId = region.Apply(getRegionResult => getRegionResult.Id),
        });
    
        var ubuntu = Gcore.GetImage.Invoke(new()
        {
            Name = "ubuntu-22.04-x64",
            RegionId = region.Apply(getRegionResult => getRegionResult.Id),
            ProjectId = project.Apply(getProjectResult => getProjectResult.Id),
        });
    
        var bootVolume = new Gcore.Volume("bootVolume", new()
        {
            TypeName = "ssd_hiiops",
            Size = 5,
            ImageId = ubuntu.Apply(getImageResult => getImageResult.Id),
            ProjectId = project.Apply(getProjectResult => getProjectResult.Id),
            RegionId = region.Apply(getRegionResult => getRegionResult.Id),
        });
    
        var myKeypair = new Gcore.Keypair("myKeypair", new()
        {
            ProjectId = project.Apply(getProjectResult => getProjectResult.Id),
            SshkeyName = "my-keypair",
            PublicKey = "ssh-ed25519 ...your public key... gcore@gcore.com",
        });
    
        var @default = Gcore.GetSecuritygroup.Invoke(new()
        {
            Name = "default",
            ProjectId = project.Apply(getProjectResult => getProjectResult.Id),
            RegionId = region.Apply(getRegionResult => getRegionResult.Id),
        });
    
        var windows = Gcore.GetImage.Invoke(new()
        {
            Name = "windows-server-2022",
            RegionId = region.Apply(getRegionResult => getRegionResult.Id),
            ProjectId = project.Apply(getProjectResult => getProjectResult.Id),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.GcoreFunctions;
    import com.pulumi.gcore.inputs.GetProjectArgs;
    import com.pulumi.gcore.inputs.GetRegionArgs;
    import com.pulumi.gcore.Network;
    import com.pulumi.gcore.NetworkArgs;
    import com.pulumi.gcore.Subnet;
    import com.pulumi.gcore.SubnetArgs;
    import com.pulumi.gcore.inputs.GetImageArgs;
    import com.pulumi.gcore.Volume;
    import com.pulumi.gcore.VolumeArgs;
    import com.pulumi.gcore.Keypair;
    import com.pulumi.gcore.KeypairArgs;
    import com.pulumi.gcore.inputs.GetSecuritygroupArgs;
    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 project = GcoreFunctions.getProject(GetProjectArgs.builder()
                .name("Default")
                .build());
    
            final var region = GcoreFunctions.getRegion(GetRegionArgs.builder()
                .name("Luxembourg-2")
                .build());
    
            var network = new Network("network", NetworkArgs.builder()
                .type("vxlan")
                .projectId(project.applyValue(getProjectResult -> getProjectResult.id()))
                .regionId(region.applyValue(getRegionResult -> getRegionResult.id()))
                .build());
    
            var subnet = new Subnet("subnet", SubnetArgs.builder()
                .cidr("192.168.10.0/24")
                .networkId(network.networkId())
                .projectId(project.applyValue(getProjectResult -> getProjectResult.id()))
                .regionId(region.applyValue(getRegionResult -> getRegionResult.id()))
                .build());
    
            final var ubuntu = GcoreFunctions.getImage(GetImageArgs.builder()
                .name("ubuntu-22.04-x64")
                .regionId(region.applyValue(getRegionResult -> getRegionResult.id()))
                .projectId(project.applyValue(getProjectResult -> getProjectResult.id()))
                .build());
    
            var bootVolume = new Volume("bootVolume", VolumeArgs.builder()
                .typeName("ssd_hiiops")
                .size(5)
                .imageId(ubuntu.applyValue(getImageResult -> getImageResult.id()))
                .projectId(project.applyValue(getProjectResult -> getProjectResult.id()))
                .regionId(region.applyValue(getRegionResult -> getRegionResult.id()))
                .build());
    
            var myKeypair = new Keypair("myKeypair", KeypairArgs.builder()
                .projectId(project.applyValue(getProjectResult -> getProjectResult.id()))
                .sshkeyName("my-keypair")
                .publicKey("ssh-ed25519 ...your public key... gcore@gcore.com")
                .build());
    
            final var default = GcoreFunctions.getSecuritygroup(GetSecuritygroupArgs.builder()
                .name("default")
                .projectId(project.applyValue(getProjectResult -> getProjectResult.id()))
                .regionId(region.applyValue(getRegionResult -> getRegionResult.id()))
                .build());
    
            final var windows = GcoreFunctions.getImage(GetImageArgs.builder()
                .name("windows-server-2022")
                .regionId(region.applyValue(getRegionResult -> getRegionResult.id()))
                .projectId(project.applyValue(getProjectResult -> getProjectResult.id()))
                .build());
    
        }
    }
    
    resources:
      network:
        type: gcore:Network
        properties:
          type: vxlan
          projectId: ${project.id}
          regionId: ${region.id}
      subnet:
        type: gcore:Subnet
        properties:
          cidr: 192.168.10.0/24
          networkId: ${network.networkId}
          projectId: ${project.id}
          regionId: ${region.id}
      bootVolume:
        type: gcore:Volume
        properties:
          typeName: ssd_hiiops
          size: 5
          imageId: ${ubuntu.id}
          projectId: ${project.id}
          regionId: ${region.id}
      myKeypair:
        type: gcore:Keypair
        properties:
          projectId: ${project.id}
          sshkeyName: my-keypair
          publicKey: ssh-ed25519 ...your public key... gcore@gcore.com
    variables:
      project:
        fn::invoke:
          function: gcore:getProject
          arguments:
            name: Default
      region:
        fn::invoke:
          function: gcore:getRegion
          arguments:
            name: Luxembourg-2
      ubuntu:
        fn::invoke:
          function: gcore:getImage
          arguments:
            name: ubuntu-22.04-x64
            regionId: ${region.id}
            projectId: ${project.id}
      default:
        fn::invoke:
          function: gcore:getSecuritygroup
          arguments:
            name: default
            projectId: ${project.id}
            regionId: ${region.id}
      windows:
        fn::invoke:
          function: gcore:getImage
          arguments:
            name: windows-server-2022
            regionId: ${region.id}
            projectId: ${project.id}
    

    Basic example

    Creating instance with one public interface

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const instanceWithOneInterface = new gcore.Instancev2("instanceWithOneInterface", {
        flavorId: "g1-standard-2-4",
        keypairName: "my-keypair",
        volumes: [{
            volumeId: gcore_volume.boot_volume.id,
            bootIndex: 0,
        }],
        interfaces: [{
            type: "external",
            name: "my-external-interface",
            securityGroups: [data.gcore_securitygroup["default"].id],
        }],
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    instance_with_one_interface = gcore.Instancev2("instanceWithOneInterface",
        flavor_id="g1-standard-2-4",
        keypair_name="my-keypair",
        volumes=[{
            "volume_id": gcore_volume["boot_volume"]["id"],
            "boot_index": 0,
        }],
        interfaces=[{
            "type": "external",
            "name": "my-external-interface",
            "security_groups": [data["gcore_securitygroup"]["default"]["id"]],
        }],
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := gcore.NewInstancev2(ctx, "instanceWithOneInterface", &gcore.Instancev2Args{
    			FlavorId:    pulumi.String("g1-standard-2-4"),
    			KeypairName: pulumi.String("my-keypair"),
    			Volumes: gcore.Instancev2VolumeArray{
    				&gcore.Instancev2VolumeArgs{
    					VolumeId:  pulumi.Any(gcore_volume.Boot_volume.Id),
    					BootIndex: pulumi.Float64(0),
    				},
    			},
    			Interfaces: gcore.Instancev2InterfaceArray{
    				&gcore.Instancev2InterfaceArgs{
    					Type: pulumi.String("external"),
    					Name: pulumi.String("my-external-interface"),
    					SecurityGroups: pulumi.StringArray{
    						data.Gcore_securitygroup.Default.Id,
    					},
    				},
    			},
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var instanceWithOneInterface = new Gcore.Instancev2("instanceWithOneInterface", new()
        {
            FlavorId = "g1-standard-2-4",
            KeypairName = "my-keypair",
            Volumes = new[]
            {
                new Gcore.Inputs.Instancev2VolumeArgs
                {
                    VolumeId = gcore_volume.Boot_volume.Id,
                    BootIndex = 0,
                },
            },
            Interfaces = new[]
            {
                new Gcore.Inputs.Instancev2InterfaceArgs
                {
                    Type = "external",
                    Name = "my-external-interface",
                    SecurityGroups = new[]
                    {
                        data.Gcore_securitygroup.Default.Id,
                    },
                },
            },
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.Instancev2;
    import com.pulumi.gcore.Instancev2Args;
    import com.pulumi.gcore.inputs.Instancev2VolumeArgs;
    import com.pulumi.gcore.inputs.Instancev2InterfaceArgs;
    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 instanceWithOneInterface = new Instancev2("instanceWithOneInterface", Instancev2Args.builder()
                .flavorId("g1-standard-2-4")
                .keypairName("my-keypair")
                .volumes(Instancev2VolumeArgs.builder()
                    .volumeId(gcore_volume.boot_volume().id())
                    .bootIndex(0)
                    .build())
                .interfaces(Instancev2InterfaceArgs.builder()
                    .type("external")
                    .name("my-external-interface")
                    .securityGroups(data.gcore_securitygroup().default().id())
                    .build())
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .build());
    
        }
    }
    
    resources:
      instanceWithOneInterface:
        type: gcore:Instancev2
        properties:
          flavorId: g1-standard-2-4
          keypairName: my-keypair
          volumes:
            - volumeId: ${gcore_volume.boot_volume.id}
              bootIndex: 0
          interfaces:
            - type: external
              name: my-external-interface
              securityGroups:
                - ${data.gcore_securitygroup.default.id}
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
    

    Creating instance with two interfaces

    This example demonstrates how to create an instance with two network interfaces: one public and one private.

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const instanceWithTwoInterface = new gcore.Instancev2("instanceWithTwoInterface", {
        flavorId: "g1-standard-2-4",
        keypairName: "my-keypair",
        volumes: [{
            volumeId: gcore_volume.boot_volume.id,
            bootIndex: 0,
        }],
        interfaces: [
            {
                type: "external",
                name: "my-external-interface",
                securityGroups: [data.gcore_securitygroup["default"].id],
            },
            {
                type: "subnet",
                name: "my-private-interface",
                securityGroups: [data.gcore_securitygroup["default"].id],
                networkId: gcore_network.network.id,
                subnetId: gcore_subnet.subnet.id,
            },
        ],
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    instance_with_two_interface = gcore.Instancev2("instanceWithTwoInterface",
        flavor_id="g1-standard-2-4",
        keypair_name="my-keypair",
        volumes=[{
            "volume_id": gcore_volume["boot_volume"]["id"],
            "boot_index": 0,
        }],
        interfaces=[
            {
                "type": "external",
                "name": "my-external-interface",
                "security_groups": [data["gcore_securitygroup"]["default"]["id"]],
            },
            {
                "type": "subnet",
                "name": "my-private-interface",
                "security_groups": [data["gcore_securitygroup"]["default"]["id"]],
                "network_id": gcore_network["network"]["id"],
                "subnet_id": gcore_subnet["subnet"]["id"],
            },
        ],
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := gcore.NewInstancev2(ctx, "instanceWithTwoInterface", &gcore.Instancev2Args{
    			FlavorId:    pulumi.String("g1-standard-2-4"),
    			KeypairName: pulumi.String("my-keypair"),
    			Volumes: gcore.Instancev2VolumeArray{
    				&gcore.Instancev2VolumeArgs{
    					VolumeId:  pulumi.Any(gcore_volume.Boot_volume.Id),
    					BootIndex: pulumi.Float64(0),
    				},
    			},
    			Interfaces: gcore.Instancev2InterfaceArray{
    				&gcore.Instancev2InterfaceArgs{
    					Type: pulumi.String("external"),
    					Name: pulumi.String("my-external-interface"),
    					SecurityGroups: pulumi.StringArray{
    						data.Gcore_securitygroup.Default.Id,
    					},
    				},
    				&gcore.Instancev2InterfaceArgs{
    					Type: pulumi.String("subnet"),
    					Name: pulumi.String("my-private-interface"),
    					SecurityGroups: pulumi.StringArray{
    						data.Gcore_securitygroup.Default.Id,
    					},
    					NetworkId: pulumi.Any(gcore_network.Network.Id),
    					SubnetId:  pulumi.Any(gcore_subnet.Subnet.Id),
    				},
    			},
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var instanceWithTwoInterface = new Gcore.Instancev2("instanceWithTwoInterface", new()
        {
            FlavorId = "g1-standard-2-4",
            KeypairName = "my-keypair",
            Volumes = new[]
            {
                new Gcore.Inputs.Instancev2VolumeArgs
                {
                    VolumeId = gcore_volume.Boot_volume.Id,
                    BootIndex = 0,
                },
            },
            Interfaces = new[]
            {
                new Gcore.Inputs.Instancev2InterfaceArgs
                {
                    Type = "external",
                    Name = "my-external-interface",
                    SecurityGroups = new[]
                    {
                        data.Gcore_securitygroup.Default.Id,
                    },
                },
                new Gcore.Inputs.Instancev2InterfaceArgs
                {
                    Type = "subnet",
                    Name = "my-private-interface",
                    SecurityGroups = new[]
                    {
                        data.Gcore_securitygroup.Default.Id,
                    },
                    NetworkId = gcore_network.Network.Id,
                    SubnetId = gcore_subnet.Subnet.Id,
                },
            },
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.Instancev2;
    import com.pulumi.gcore.Instancev2Args;
    import com.pulumi.gcore.inputs.Instancev2VolumeArgs;
    import com.pulumi.gcore.inputs.Instancev2InterfaceArgs;
    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 instanceWithTwoInterface = new Instancev2("instanceWithTwoInterface", Instancev2Args.builder()
                .flavorId("g1-standard-2-4")
                .keypairName("my-keypair")
                .volumes(Instancev2VolumeArgs.builder()
                    .volumeId(gcore_volume.boot_volume().id())
                    .bootIndex(0)
                    .build())
                .interfaces(            
                    Instancev2InterfaceArgs.builder()
                        .type("external")
                        .name("my-external-interface")
                        .securityGroups(data.gcore_securitygroup().default().id())
                        .build(),
                    Instancev2InterfaceArgs.builder()
                        .type("subnet")
                        .name("my-private-interface")
                        .securityGroups(data.gcore_securitygroup().default().id())
                        .networkId(gcore_network.network().id())
                        .subnetId(gcore_subnet.subnet().id())
                        .build())
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .build());
    
        }
    }
    
    resources:
      instanceWithTwoInterface:
        type: gcore:Instancev2
        properties:
          flavorId: g1-standard-2-4
          keypairName: my-keypair
          volumes:
            - volumeId: ${gcore_volume.boot_volume.id}
              bootIndex: 0
          interfaces:
            - type: external
              name: my-external-interface
              securityGroups:
                - ${data.gcore_securitygroup.default.id}
            - type: subnet
              name: my-private-interface
              securityGroups:
                - ${data.gcore_securitygroup.default.id}
              networkId: ${gcore_network.network.id}
              subnetId: ${gcore_subnet.subnet.id}
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
    

    Creating Windows instance with one public interface

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const bootVolumeWindows = new gcore.Volume("bootVolumeWindows", {
        typeName: "ssd_hiiops",
        size: 50,
        imageId: data.gcore_image.windows.id,
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
    });
    const windowsInstance = new gcore.Instancev2("windowsInstance", {
        flavorId: "g1w-standard-4-8",
        password: "my-s3cR3tP@ssw0rd",
        volumes: [{
            volumeId: bootVolumeWindows.volumeId,
            bootIndex: 0,
        }],
        interfaces: [{
            type: "external",
            name: "my-external-interface",
            securityGroups: [data.gcore_securitygroup["default"].id],
        }],
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    boot_volume_windows = gcore.Volume("bootVolumeWindows",
        type_name="ssd_hiiops",
        size=50,
        image_id=data["gcore_image"]["windows"]["id"],
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"])
    windows_instance = gcore.Instancev2("windowsInstance",
        flavor_id="g1w-standard-4-8",
        password="my-s3cR3tP@ssw0rd",
        volumes=[{
            "volume_id": boot_volume_windows.volume_id,
            "boot_index": 0,
        }],
        interfaces=[{
            "type": "external",
            "name": "my-external-interface",
            "security_groups": [data["gcore_securitygroup"]["default"]["id"]],
        }],
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		bootVolumeWindows, err := gcore.NewVolume(ctx, "bootVolumeWindows", &gcore.VolumeArgs{
    			TypeName:  pulumi.String("ssd_hiiops"),
    			Size:      pulumi.Float64(50),
    			ImageId:   pulumi.Any(data.Gcore_image.Windows.Id),
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gcore.NewInstancev2(ctx, "windowsInstance", &gcore.Instancev2Args{
    			FlavorId: pulumi.String("g1w-standard-4-8"),
    			Password: pulumi.String("my-s3cR3tP@ssw0rd"),
    			Volumes: gcore.Instancev2VolumeArray{
    				&gcore.Instancev2VolumeArgs{
    					VolumeId:  bootVolumeWindows.VolumeId,
    					BootIndex: pulumi.Float64(0),
    				},
    			},
    			Interfaces: gcore.Instancev2InterfaceArray{
    				&gcore.Instancev2InterfaceArgs{
    					Type: pulumi.String("external"),
    					Name: pulumi.String("my-external-interface"),
    					SecurityGroups: pulumi.StringArray{
    						data.Gcore_securitygroup.Default.Id,
    					},
    				},
    			},
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var bootVolumeWindows = new Gcore.Volume("bootVolumeWindows", new()
        {
            TypeName = "ssd_hiiops",
            Size = 50,
            ImageId = data.Gcore_image.Windows.Id,
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
        });
    
        var windowsInstance = new Gcore.Instancev2("windowsInstance", new()
        {
            FlavorId = "g1w-standard-4-8",
            Password = "my-s3cR3tP@ssw0rd",
            Volumes = new[]
            {
                new Gcore.Inputs.Instancev2VolumeArgs
                {
                    VolumeId = bootVolumeWindows.VolumeId,
                    BootIndex = 0,
                },
            },
            Interfaces = new[]
            {
                new Gcore.Inputs.Instancev2InterfaceArgs
                {
                    Type = "external",
                    Name = "my-external-interface",
                    SecurityGroups = new[]
                    {
                        data.Gcore_securitygroup.Default.Id,
                    },
                },
            },
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.Volume;
    import com.pulumi.gcore.VolumeArgs;
    import com.pulumi.gcore.Instancev2;
    import com.pulumi.gcore.Instancev2Args;
    import com.pulumi.gcore.inputs.Instancev2VolumeArgs;
    import com.pulumi.gcore.inputs.Instancev2InterfaceArgs;
    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 bootVolumeWindows = new Volume("bootVolumeWindows", VolumeArgs.builder()
                .typeName("ssd_hiiops")
                .size(50)
                .imageId(data.gcore_image().windows().id())
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .build());
    
            var windowsInstance = new Instancev2("windowsInstance", Instancev2Args.builder()
                .flavorId("g1w-standard-4-8")
                .password("my-s3cR3tP@ssw0rd")
                .volumes(Instancev2VolumeArgs.builder()
                    .volumeId(bootVolumeWindows.volumeId())
                    .bootIndex(0)
                    .build())
                .interfaces(Instancev2InterfaceArgs.builder()
                    .type("external")
                    .name("my-external-interface")
                    .securityGroups(data.gcore_securitygroup().default().id())
                    .build())
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .build());
    
        }
    }
    
    resources:
      bootVolumeWindows:
        type: gcore:Volume
        properties:
          typeName: ssd_hiiops
          size: 50
          imageId: ${data.gcore_image.windows.id}
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
      windowsInstance:
        type: gcore:Instancev2
        properties:
          flavorId: g1w-standard-4-8
          password: my-s3cR3tP@ssw0rd
          volumes:
            - volumeId: ${bootVolumeWindows.volumeId}
              bootIndex: 0
          interfaces:
            - type: external
              name: my-external-interface
              securityGroups:
                - ${data.gcore_securitygroup.default.id}
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
    

    Advanced examples

    Creating instance with a dual-stack public interface

    This example demonstrates how to create an instance with a dual-stack public interface. The instance has both an IPv4 and an IPv6 address.

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const instanceWithDualstack = new gcore.Instancev2("instanceWithDualstack", {
        flavorId: "g1-standard-2-4",
        keypairName: "my-keypair",
        volumes: [{
            volumeId: gcore_volume.boot_volume.id,
            bootIndex: 0,
        }],
        interfaces: [{
            type: "external",
            ipFamily: "dual",
            name: "my-external-interface",
            securityGroups: [data.gcore_securitygroup["default"].id],
        }],
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
    });
    export const addresses = instanceWithDualstack.addresses;
    
    import pulumi
    import pulumi_gcore as gcore
    
    instance_with_dualstack = gcore.Instancev2("instanceWithDualstack",
        flavor_id="g1-standard-2-4",
        keypair_name="my-keypair",
        volumes=[{
            "volume_id": gcore_volume["boot_volume"]["id"],
            "boot_index": 0,
        }],
        interfaces=[{
            "type": "external",
            "ip_family": "dual",
            "name": "my-external-interface",
            "security_groups": [data["gcore_securitygroup"]["default"]["id"]],
        }],
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"])
    pulumi.export("addresses", instance_with_dualstack.addresses)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		instanceWithDualstack, err := gcore.NewInstancev2(ctx, "instanceWithDualstack", &gcore.Instancev2Args{
    			FlavorId:    pulumi.String("g1-standard-2-4"),
    			KeypairName: pulumi.String("my-keypair"),
    			Volumes: gcore.Instancev2VolumeArray{
    				&gcore.Instancev2VolumeArgs{
    					VolumeId:  pulumi.Any(gcore_volume.Boot_volume.Id),
    					BootIndex: pulumi.Float64(0),
    				},
    			},
    			Interfaces: gcore.Instancev2InterfaceArray{
    				&gcore.Instancev2InterfaceArgs{
    					Type:     pulumi.String("external"),
    					IpFamily: pulumi.String("dual"),
    					Name:     pulumi.String("my-external-interface"),
    					SecurityGroups: pulumi.StringArray{
    						data.Gcore_securitygroup.Default.Id,
    					},
    				},
    			},
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("addresses", instanceWithDualstack.Addresses)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var instanceWithDualstack = new Gcore.Instancev2("instanceWithDualstack", new()
        {
            FlavorId = "g1-standard-2-4",
            KeypairName = "my-keypair",
            Volumes = new[]
            {
                new Gcore.Inputs.Instancev2VolumeArgs
                {
                    VolumeId = gcore_volume.Boot_volume.Id,
                    BootIndex = 0,
                },
            },
            Interfaces = new[]
            {
                new Gcore.Inputs.Instancev2InterfaceArgs
                {
                    Type = "external",
                    IpFamily = "dual",
                    Name = "my-external-interface",
                    SecurityGroups = new[]
                    {
                        data.Gcore_securitygroup.Default.Id,
                    },
                },
            },
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
        });
    
        return new Dictionary<string, object?>
        {
            ["addresses"] = instanceWithDualstack.Addresses,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.Instancev2;
    import com.pulumi.gcore.Instancev2Args;
    import com.pulumi.gcore.inputs.Instancev2VolumeArgs;
    import com.pulumi.gcore.inputs.Instancev2InterfaceArgs;
    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 instanceWithDualstack = new Instancev2("instanceWithDualstack", Instancev2Args.builder()
                .flavorId("g1-standard-2-4")
                .keypairName("my-keypair")
                .volumes(Instancev2VolumeArgs.builder()
                    .volumeId(gcore_volume.boot_volume().id())
                    .bootIndex(0)
                    .build())
                .interfaces(Instancev2InterfaceArgs.builder()
                    .type("external")
                    .ipFamily("dual")
                    .name("my-external-interface")
                    .securityGroups(data.gcore_securitygroup().default().id())
                    .build())
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .build());
    
            ctx.export("addresses", instanceWithDualstack.addresses());
        }
    }
    
    resources:
      instanceWithDualstack:
        type: gcore:Instancev2
        properties:
          flavorId: g1-standard-2-4
          keypairName: my-keypair
          volumes:
            - volumeId: ${gcore_volume.boot_volume.id}
              bootIndex: 0
          interfaces:
            - type: external
              ipFamily: dual
              name: my-external-interface
              securityGroups:
                - ${data.gcore_securitygroup.default.id}
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
    outputs:
      addresses: ${instanceWithDualstack.addresses}
    

    Creating instance with floating ip

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const fixedIp = new gcore.Reservedfixedip("fixedIp", {
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
        type: "subnet",
        networkId: gcore_network.network.id,
        subnetId: gcore_subnet.subnet.id,
    });
    const floatingIp = new gcore.Floatingip("floatingIp", {
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
        fixedIpAddress: fixedIp.fixedIpAddress,
        portId: fixedIp.portId,
    });
    const instanceWithFloatingIp = new gcore.Instancev2("instanceWithFloatingIp", {
        flavorId: "g1-standard-2-4",
        keypairName: "my-keypair",
        volumes: [{
            volumeId: gcore_volume.boot_volume.id,
            bootIndex: 0,
        }],
        interfaces: [{
            type: "reserved_fixed_ip",
            name: "my-floating-ip-interface",
            portId: fixedIp.portId,
            existingFipId: floatingIp.floatingipId,
            securityGroups: [data.gcore_securitygroup["default"].id],
        }],
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    fixed_ip = gcore.Reservedfixedip("fixedIp",
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"],
        type="subnet",
        network_id=gcore_network["network"]["id"],
        subnet_id=gcore_subnet["subnet"]["id"])
    floating_ip = gcore.Floatingip("floatingIp",
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"],
        fixed_ip_address=fixed_ip.fixed_ip_address,
        port_id=fixed_ip.port_id)
    instance_with_floating_ip = gcore.Instancev2("instanceWithFloatingIp",
        flavor_id="g1-standard-2-4",
        keypair_name="my-keypair",
        volumes=[{
            "volume_id": gcore_volume["boot_volume"]["id"],
            "boot_index": 0,
        }],
        interfaces=[{
            "type": "reserved_fixed_ip",
            "name": "my-floating-ip-interface",
            "port_id": fixed_ip.port_id,
            "existing_fip_id": floating_ip.floatingip_id,
            "security_groups": [data["gcore_securitygroup"]["default"]["id"]],
        }],
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fixedIp, err := gcore.NewReservedfixedip(ctx, "fixedIp", &gcore.ReservedfixedipArgs{
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    			Type:      pulumi.String("subnet"),
    			NetworkId: pulumi.Any(gcore_network.Network.Id),
    			SubnetId:  pulumi.Any(gcore_subnet.Subnet.Id),
    		})
    		if err != nil {
    			return err
    		}
    		floatingIp, err := gcore.NewFloatingip(ctx, "floatingIp", &gcore.FloatingipArgs{
    			ProjectId:      pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:       pulumi.Any(data.Gcore_region.Region.Id),
    			FixedIpAddress: fixedIp.FixedIpAddress,
    			PortId:         fixedIp.PortId,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gcore.NewInstancev2(ctx, "instanceWithFloatingIp", &gcore.Instancev2Args{
    			FlavorId:    pulumi.String("g1-standard-2-4"),
    			KeypairName: pulumi.String("my-keypair"),
    			Volumes: gcore.Instancev2VolumeArray{
    				&gcore.Instancev2VolumeArgs{
    					VolumeId:  pulumi.Any(gcore_volume.Boot_volume.Id),
    					BootIndex: pulumi.Float64(0),
    				},
    			},
    			Interfaces: gcore.Instancev2InterfaceArray{
    				&gcore.Instancev2InterfaceArgs{
    					Type:          pulumi.String("reserved_fixed_ip"),
    					Name:          pulumi.String("my-floating-ip-interface"),
    					PortId:        fixedIp.PortId,
    					ExistingFipId: floatingIp.FloatingipId,
    					SecurityGroups: pulumi.StringArray{
    						data.Gcore_securitygroup.Default.Id,
    					},
    				},
    			},
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var fixedIp = new Gcore.Reservedfixedip("fixedIp", new()
        {
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
            Type = "subnet",
            NetworkId = gcore_network.Network.Id,
            SubnetId = gcore_subnet.Subnet.Id,
        });
    
        var floatingIp = new Gcore.Floatingip("floatingIp", new()
        {
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
            FixedIpAddress = fixedIp.FixedIpAddress,
            PortId = fixedIp.PortId,
        });
    
        var instanceWithFloatingIp = new Gcore.Instancev2("instanceWithFloatingIp", new()
        {
            FlavorId = "g1-standard-2-4",
            KeypairName = "my-keypair",
            Volumes = new[]
            {
                new Gcore.Inputs.Instancev2VolumeArgs
                {
                    VolumeId = gcore_volume.Boot_volume.Id,
                    BootIndex = 0,
                },
            },
            Interfaces = new[]
            {
                new Gcore.Inputs.Instancev2InterfaceArgs
                {
                    Type = "reserved_fixed_ip",
                    Name = "my-floating-ip-interface",
                    PortId = fixedIp.PortId,
                    ExistingFipId = floatingIp.FloatingipId,
                    SecurityGroups = new[]
                    {
                        data.Gcore_securitygroup.Default.Id,
                    },
                },
            },
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.Reservedfixedip;
    import com.pulumi.gcore.ReservedfixedipArgs;
    import com.pulumi.gcore.Floatingip;
    import com.pulumi.gcore.FloatingipArgs;
    import com.pulumi.gcore.Instancev2;
    import com.pulumi.gcore.Instancev2Args;
    import com.pulumi.gcore.inputs.Instancev2VolumeArgs;
    import com.pulumi.gcore.inputs.Instancev2InterfaceArgs;
    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 fixedIp = new Reservedfixedip("fixedIp", ReservedfixedipArgs.builder()
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .type("subnet")
                .networkId(gcore_network.network().id())
                .subnetId(gcore_subnet.subnet().id())
                .build());
    
            var floatingIp = new Floatingip("floatingIp", FloatingipArgs.builder()
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .fixedIpAddress(fixedIp.fixedIpAddress())
                .portId(fixedIp.portId())
                .build());
    
            var instanceWithFloatingIp = new Instancev2("instanceWithFloatingIp", Instancev2Args.builder()
                .flavorId("g1-standard-2-4")
                .keypairName("my-keypair")
                .volumes(Instancev2VolumeArgs.builder()
                    .volumeId(gcore_volume.boot_volume().id())
                    .bootIndex(0)
                    .build())
                .interfaces(Instancev2InterfaceArgs.builder()
                    .type("reserved_fixed_ip")
                    .name("my-floating-ip-interface")
                    .portId(fixedIp.portId())
                    .existingFipId(floatingIp.floatingipId())
                    .securityGroups(data.gcore_securitygroup().default().id())
                    .build())
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .build());
    
        }
    }
    
    resources:
      fixedIp:
        type: gcore:Reservedfixedip
        properties:
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
          type: subnet
          networkId: ${gcore_network.network.id}
          subnetId: ${gcore_subnet.subnet.id}
      floatingIp:
        type: gcore:Floatingip
        properties:
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
          fixedIpAddress: ${fixedIp.fixedIpAddress}
          portId: ${fixedIp.portId}
      instanceWithFloatingIp:
        type: gcore:Instancev2
        properties:
          flavorId: g1-standard-2-4
          keypairName: my-keypair
          volumes:
            - volumeId: ${gcore_volume.boot_volume.id}
              bootIndex: 0
          interfaces:
            - type: reserved_fixed_ip
              name: my-floating-ip-interface
              portId: ${fixedIp.portId}
              existingFipId: ${floatingIp.floatingipId}
              securityGroups:
                - ${data.gcore_securitygroup.default.id}
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
    

    Creating instance with a reserved public interface

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const externalFixedIp = new gcore.Reservedfixedip("externalFixedIp", {
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
        type: "external",
    });
    const instanceWithReservedAddress = new gcore.Instancev2("instanceWithReservedAddress", {
        flavorId: "g1-standard-2-4",
        keypairName: "my-keypair",
        volumes: [{
            volumeId: gcore_volume.boot_volume.id,
            bootIndex: 0,
        }],
        interfaces: [{
            type: "reserved_fixed_ip",
            name: "my-reserved-public-interface",
            portId: externalFixedIp.portId,
            securityGroups: [data.gcore_securitygroup["default"].id],
        }],
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    external_fixed_ip = gcore.Reservedfixedip("externalFixedIp",
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"],
        type="external")
    instance_with_reserved_address = gcore.Instancev2("instanceWithReservedAddress",
        flavor_id="g1-standard-2-4",
        keypair_name="my-keypair",
        volumes=[{
            "volume_id": gcore_volume["boot_volume"]["id"],
            "boot_index": 0,
        }],
        interfaces=[{
            "type": "reserved_fixed_ip",
            "name": "my-reserved-public-interface",
            "port_id": external_fixed_ip.port_id,
            "security_groups": [data["gcore_securitygroup"]["default"]["id"]],
        }],
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		externalFixedIp, err := gcore.NewReservedfixedip(ctx, "externalFixedIp", &gcore.ReservedfixedipArgs{
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    			Type:      pulumi.String("external"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gcore.NewInstancev2(ctx, "instanceWithReservedAddress", &gcore.Instancev2Args{
    			FlavorId:    pulumi.String("g1-standard-2-4"),
    			KeypairName: pulumi.String("my-keypair"),
    			Volumes: gcore.Instancev2VolumeArray{
    				&gcore.Instancev2VolumeArgs{
    					VolumeId:  pulumi.Any(gcore_volume.Boot_volume.Id),
    					BootIndex: pulumi.Float64(0),
    				},
    			},
    			Interfaces: gcore.Instancev2InterfaceArray{
    				&gcore.Instancev2InterfaceArgs{
    					Type:   pulumi.String("reserved_fixed_ip"),
    					Name:   pulumi.String("my-reserved-public-interface"),
    					PortId: externalFixedIp.PortId,
    					SecurityGroups: pulumi.StringArray{
    						data.Gcore_securitygroup.Default.Id,
    					},
    				},
    			},
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var externalFixedIp = new Gcore.Reservedfixedip("externalFixedIp", new()
        {
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
            Type = "external",
        });
    
        var instanceWithReservedAddress = new Gcore.Instancev2("instanceWithReservedAddress", new()
        {
            FlavorId = "g1-standard-2-4",
            KeypairName = "my-keypair",
            Volumes = new[]
            {
                new Gcore.Inputs.Instancev2VolumeArgs
                {
                    VolumeId = gcore_volume.Boot_volume.Id,
                    BootIndex = 0,
                },
            },
            Interfaces = new[]
            {
                new Gcore.Inputs.Instancev2InterfaceArgs
                {
                    Type = "reserved_fixed_ip",
                    Name = "my-reserved-public-interface",
                    PortId = externalFixedIp.PortId,
                    SecurityGroups = new[]
                    {
                        data.Gcore_securitygroup.Default.Id,
                    },
                },
            },
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.Reservedfixedip;
    import com.pulumi.gcore.ReservedfixedipArgs;
    import com.pulumi.gcore.Instancev2;
    import com.pulumi.gcore.Instancev2Args;
    import com.pulumi.gcore.inputs.Instancev2VolumeArgs;
    import com.pulumi.gcore.inputs.Instancev2InterfaceArgs;
    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 externalFixedIp = new Reservedfixedip("externalFixedIp", ReservedfixedipArgs.builder()
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .type("external")
                .build());
    
            var instanceWithReservedAddress = new Instancev2("instanceWithReservedAddress", Instancev2Args.builder()
                .flavorId("g1-standard-2-4")
                .keypairName("my-keypair")
                .volumes(Instancev2VolumeArgs.builder()
                    .volumeId(gcore_volume.boot_volume().id())
                    .bootIndex(0)
                    .build())
                .interfaces(Instancev2InterfaceArgs.builder()
                    .type("reserved_fixed_ip")
                    .name("my-reserved-public-interface")
                    .portId(externalFixedIp.portId())
                    .securityGroups(data.gcore_securitygroup().default().id())
                    .build())
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .build());
    
        }
    }
    
    resources:
      externalFixedIp:
        type: gcore:Reservedfixedip
        properties:
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
          type: external
      instanceWithReservedAddress:
        type: gcore:Instancev2
        properties:
          flavorId: g1-standard-2-4
          keypairName: my-keypair
          volumes:
            - volumeId: ${gcore_volume.boot_volume.id}
              bootIndex: 0
          interfaces:
            - type: reserved_fixed_ip
              name: my-reserved-public-interface
              portId: ${externalFixedIp.portId}
              securityGroups:
                - ${data.gcore_securitygroup.default.id}
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
    

    Creating instance with custom security group

    This example demonstrates how to create an instance with a custom security group. The security group allows all incoming traffic on ports 22, 80, and 443. Outgoing traffic is allowed on all ports, except port 25 for security reasons.

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const webServerSecurityGroup = new gcore.Securitygroup("webServerSecurityGroup", {
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
        securityGroupRules: [
            {
                direction: "egress",
                ethertype: "IPv4",
                protocol: "tcp",
                portRangeMin: 1,
                portRangeMax: 24,
            },
            {
                direction: "egress",
                ethertype: "IPv4",
                protocol: "tcp",
                portRangeMin: 26,
                portRangeMax: 65535,
            },
            {
                direction: "ingress",
                ethertype: "IPv4",
                protocol: "tcp",
                portRangeMin: 22,
                portRangeMax: 22,
            },
            {
                direction: "ingress",
                ethertype: "IPv4",
                protocol: "tcp",
                portRangeMin: 80,
                portRangeMax: 80,
            },
            {
                direction: "ingress",
                ethertype: "IPv4",
                protocol: "tcp",
                portRangeMin: 443,
                portRangeMax: 443,
            },
        ],
    });
    const instanceWithCustomSecurityGroup = new gcore.Instancev2("instanceWithCustomSecurityGroup", {
        flavorId: "g1-standard-2-4",
        keypairName: "my-keypair",
        volumes: [{
            volumeId: gcore_volume.boot_volume.id,
            bootIndex: 0,
        }],
        interfaces: [{
            type: "external",
            name: "my-external-interface",
            securityGroups: [webServerSecurityGroup.securitygroupId],
        }],
        projectId: data.gcore_project.project.id,
        regionId: data.gcore_region.region.id,
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    web_server_security_group = gcore.Securitygroup("webServerSecurityGroup",
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"],
        security_group_rules=[
            {
                "direction": "egress",
                "ethertype": "IPv4",
                "protocol": "tcp",
                "port_range_min": 1,
                "port_range_max": 24,
            },
            {
                "direction": "egress",
                "ethertype": "IPv4",
                "protocol": "tcp",
                "port_range_min": 26,
                "port_range_max": 65535,
            },
            {
                "direction": "ingress",
                "ethertype": "IPv4",
                "protocol": "tcp",
                "port_range_min": 22,
                "port_range_max": 22,
            },
            {
                "direction": "ingress",
                "ethertype": "IPv4",
                "protocol": "tcp",
                "port_range_min": 80,
                "port_range_max": 80,
            },
            {
                "direction": "ingress",
                "ethertype": "IPv4",
                "protocol": "tcp",
                "port_range_min": 443,
                "port_range_max": 443,
            },
        ])
    instance_with_custom_security_group = gcore.Instancev2("instanceWithCustomSecurityGroup",
        flavor_id="g1-standard-2-4",
        keypair_name="my-keypair",
        volumes=[{
            "volume_id": gcore_volume["boot_volume"]["id"],
            "boot_index": 0,
        }],
        interfaces=[{
            "type": "external",
            "name": "my-external-interface",
            "security_groups": [web_server_security_group.securitygroup_id],
        }],
        project_id=data["gcore_project"]["project"]["id"],
        region_id=data["gcore_region"]["region"]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		webServerSecurityGroup, err := gcore.NewSecuritygroup(ctx, "webServerSecurityGroup", &gcore.SecuritygroupArgs{
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    			SecurityGroupRules: gcore.SecuritygroupSecurityGroupRuleArray{
    				&gcore.SecuritygroupSecurityGroupRuleArgs{
    					Direction:    pulumi.String("egress"),
    					Ethertype:    pulumi.String("IPv4"),
    					Protocol:     pulumi.String("tcp"),
    					PortRangeMin: pulumi.Float64(1),
    					PortRangeMax: pulumi.Float64(24),
    				},
    				&gcore.SecuritygroupSecurityGroupRuleArgs{
    					Direction:    pulumi.String("egress"),
    					Ethertype:    pulumi.String("IPv4"),
    					Protocol:     pulumi.String("tcp"),
    					PortRangeMin: pulumi.Float64(26),
    					PortRangeMax: pulumi.Float64(65535),
    				},
    				&gcore.SecuritygroupSecurityGroupRuleArgs{
    					Direction:    pulumi.String("ingress"),
    					Ethertype:    pulumi.String("IPv4"),
    					Protocol:     pulumi.String("tcp"),
    					PortRangeMin: pulumi.Float64(22),
    					PortRangeMax: pulumi.Float64(22),
    				},
    				&gcore.SecuritygroupSecurityGroupRuleArgs{
    					Direction:    pulumi.String("ingress"),
    					Ethertype:    pulumi.String("IPv4"),
    					Protocol:     pulumi.String("tcp"),
    					PortRangeMin: pulumi.Float64(80),
    					PortRangeMax: pulumi.Float64(80),
    				},
    				&gcore.SecuritygroupSecurityGroupRuleArgs{
    					Direction:    pulumi.String("ingress"),
    					Ethertype:    pulumi.String("IPv4"),
    					Protocol:     pulumi.String("tcp"),
    					PortRangeMin: pulumi.Float64(443),
    					PortRangeMax: pulumi.Float64(443),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gcore.NewInstancev2(ctx, "instanceWithCustomSecurityGroup", &gcore.Instancev2Args{
    			FlavorId:    pulumi.String("g1-standard-2-4"),
    			KeypairName: pulumi.String("my-keypair"),
    			Volumes: gcore.Instancev2VolumeArray{
    				&gcore.Instancev2VolumeArgs{
    					VolumeId:  pulumi.Any(gcore_volume.Boot_volume.Id),
    					BootIndex: pulumi.Float64(0),
    				},
    			},
    			Interfaces: gcore.Instancev2InterfaceArray{
    				&gcore.Instancev2InterfaceArgs{
    					Type: pulumi.String("external"),
    					Name: pulumi.String("my-external-interface"),
    					SecurityGroups: pulumi.StringArray{
    						webServerSecurityGroup.SecuritygroupId,
    					},
    				},
    			},
    			ProjectId: pulumi.Any(data.Gcore_project.Project.Id),
    			RegionId:  pulumi.Any(data.Gcore_region.Region.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var webServerSecurityGroup = new Gcore.Securitygroup("webServerSecurityGroup", new()
        {
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
            SecurityGroupRules = new[]
            {
                new Gcore.Inputs.SecuritygroupSecurityGroupRuleArgs
                {
                    Direction = "egress",
                    Ethertype = "IPv4",
                    Protocol = "tcp",
                    PortRangeMin = 1,
                    PortRangeMax = 24,
                },
                new Gcore.Inputs.SecuritygroupSecurityGroupRuleArgs
                {
                    Direction = "egress",
                    Ethertype = "IPv4",
                    Protocol = "tcp",
                    PortRangeMin = 26,
                    PortRangeMax = 65535,
                },
                new Gcore.Inputs.SecuritygroupSecurityGroupRuleArgs
                {
                    Direction = "ingress",
                    Ethertype = "IPv4",
                    Protocol = "tcp",
                    PortRangeMin = 22,
                    PortRangeMax = 22,
                },
                new Gcore.Inputs.SecuritygroupSecurityGroupRuleArgs
                {
                    Direction = "ingress",
                    Ethertype = "IPv4",
                    Protocol = "tcp",
                    PortRangeMin = 80,
                    PortRangeMax = 80,
                },
                new Gcore.Inputs.SecuritygroupSecurityGroupRuleArgs
                {
                    Direction = "ingress",
                    Ethertype = "IPv4",
                    Protocol = "tcp",
                    PortRangeMin = 443,
                    PortRangeMax = 443,
                },
            },
        });
    
        var instanceWithCustomSecurityGroup = new Gcore.Instancev2("instanceWithCustomSecurityGroup", new()
        {
            FlavorId = "g1-standard-2-4",
            KeypairName = "my-keypair",
            Volumes = new[]
            {
                new Gcore.Inputs.Instancev2VolumeArgs
                {
                    VolumeId = gcore_volume.Boot_volume.Id,
                    BootIndex = 0,
                },
            },
            Interfaces = new[]
            {
                new Gcore.Inputs.Instancev2InterfaceArgs
                {
                    Type = "external",
                    Name = "my-external-interface",
                    SecurityGroups = new[]
                    {
                        webServerSecurityGroup.SecuritygroupId,
                    },
                },
            },
            ProjectId = data.Gcore_project.Project.Id,
            RegionId = data.Gcore_region.Region.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.Securitygroup;
    import com.pulumi.gcore.SecuritygroupArgs;
    import com.pulumi.gcore.inputs.SecuritygroupSecurityGroupRuleArgs;
    import com.pulumi.gcore.Instancev2;
    import com.pulumi.gcore.Instancev2Args;
    import com.pulumi.gcore.inputs.Instancev2VolumeArgs;
    import com.pulumi.gcore.inputs.Instancev2InterfaceArgs;
    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 webServerSecurityGroup = new Securitygroup("webServerSecurityGroup", SecuritygroupArgs.builder()
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .securityGroupRules(            
                    SecuritygroupSecurityGroupRuleArgs.builder()
                        .direction("egress")
                        .ethertype("IPv4")
                        .protocol("tcp")
                        .portRangeMin(1)
                        .portRangeMax(24)
                        .build(),
                    SecuritygroupSecurityGroupRuleArgs.builder()
                        .direction("egress")
                        .ethertype("IPv4")
                        .protocol("tcp")
                        .portRangeMin(26)
                        .portRangeMax(65535)
                        .build(),
                    SecuritygroupSecurityGroupRuleArgs.builder()
                        .direction("ingress")
                        .ethertype("IPv4")
                        .protocol("tcp")
                        .portRangeMin(22)
                        .portRangeMax(22)
                        .build(),
                    SecuritygroupSecurityGroupRuleArgs.builder()
                        .direction("ingress")
                        .ethertype("IPv4")
                        .protocol("tcp")
                        .portRangeMin(80)
                        .portRangeMax(80)
                        .build(),
                    SecuritygroupSecurityGroupRuleArgs.builder()
                        .direction("ingress")
                        .ethertype("IPv4")
                        .protocol("tcp")
                        .portRangeMin(443)
                        .portRangeMax(443)
                        .build())
                .build());
    
            var instanceWithCustomSecurityGroup = new Instancev2("instanceWithCustomSecurityGroup", Instancev2Args.builder()
                .flavorId("g1-standard-2-4")
                .keypairName("my-keypair")
                .volumes(Instancev2VolumeArgs.builder()
                    .volumeId(gcore_volume.boot_volume().id())
                    .bootIndex(0)
                    .build())
                .interfaces(Instancev2InterfaceArgs.builder()
                    .type("external")
                    .name("my-external-interface")
                    .securityGroups(webServerSecurityGroup.securitygroupId())
                    .build())
                .projectId(data.gcore_project().project().id())
                .regionId(data.gcore_region().region().id())
                .build());
    
        }
    }
    
    resources:
      webServerSecurityGroup:
        type: gcore:Securitygroup
        properties:
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
          securityGroupRules:
            - direction: egress
              ethertype: IPv4
              protocol: tcp
              portRangeMin: 1
              portRangeMax: 24
            - direction: egress
              ethertype: IPv4
              protocol: tcp
              portRangeMin: 26
              portRangeMax: 65535
            - direction: ingress
              ethertype: IPv4
              protocol: tcp
              portRangeMin: 22
              portRangeMax: 22
            - direction: ingress
              ethertype: IPv4
              protocol: tcp
              portRangeMin: 80
              portRangeMax: 80
            - direction: ingress
              ethertype: IPv4
              protocol: tcp
              portRangeMin: 443
              portRangeMax: 443
      instanceWithCustomSecurityGroup:
        type: gcore:Instancev2
        properties:
          flavorId: g1-standard-2-4
          keypairName: my-keypair
          volumes:
            - volumeId: ${gcore_volume.boot_volume.id}
              bootIndex: 0
          interfaces:
            - type: external
              name: my-external-interface
              securityGroups:
                - ${webServerSecurityGroup.securitygroupId}
          projectId: ${data.gcore_project.project.id}
          regionId: ${data.gcore_region.region.id}
    

    Create Instancev2 Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Instancev2(name: string, args: Instancev2Args, opts?: CustomResourceOptions);
    @overload
    def Instancev2(resource_name: str,
                   args: Instancev2Args,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def Instancev2(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   interfaces: Optional[Sequence[Instancev2InterfaceArgs]] = None,
                   volumes: Optional[Sequence[Instancev2VolumeArgs]] = None,
                   flavor_id: Optional[str] = None,
                   name_template: Optional[str] = None,
                   project_id: Optional[float] = None,
                   keypair_name: Optional[str] = None,
                   metadata_map: Optional[Mapping[str, str]] = None,
                   name: Optional[str] = None,
                   allow_app_ports: Optional[bool] = None,
                   password: Optional[str] = None,
                   instancev2_id: Optional[str] = None,
                   project_name: Optional[str] = None,
                   region_id: Optional[float] = None,
                   region_name: Optional[str] = None,
                   server_group: Optional[str] = None,
                   user_data: Optional[str] = None,
                   username: Optional[str] = None,
                   vm_state: Optional[str] = None,
                   configurations: Optional[Sequence[Instancev2ConfigurationArgs]] = None)
    func NewInstancev2(ctx *Context, name string, args Instancev2Args, opts ...ResourceOption) (*Instancev2, error)
    public Instancev2(string name, Instancev2Args args, CustomResourceOptions? opts = null)
    public Instancev2(String name, Instancev2Args args)
    public Instancev2(String name, Instancev2Args args, CustomResourceOptions options)
    
    type: gcore:Instancev2
    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 Instancev2Args
    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 Instancev2Args
    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 Instancev2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args Instancev2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args Instancev2Args
    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 instancev2Resource = new Gcore.Instancev2("instancev2Resource", new()
    {
        Interfaces = new[]
        {
            new Gcore.Inputs.Instancev2InterfaceArgs
            {
                Name = "string",
                SecurityGroups = new[]
                {
                    "string",
                },
                ExistingFipId = "string",
                IpAddress = "string",
                IpFamily = "string",
                NetworkId = "string",
                Order = 0,
                PortId = "string",
                SubnetId = "string",
                Type = "string",
            },
        },
        Volumes = new[]
        {
            new Gcore.Inputs.Instancev2VolumeArgs
            {
                VolumeId = "string",
                AttachmentTag = "string",
                BootIndex = 0,
                DeleteOnTermination = false,
                Id = "string",
                ImageId = "string",
                Name = "string",
                Size = 0,
                TypeName = "string",
            },
        },
        FlavorId = "string",
        NameTemplate = "string",
        ProjectId = 0,
        KeypairName = "string",
        MetadataMap = 
        {
            { "string", "string" },
        },
        Name = "string",
        AllowAppPorts = false,
        Password = "string",
        Instancev2Id = "string",
        ProjectName = "string",
        RegionId = 0,
        RegionName = "string",
        ServerGroup = "string",
        UserData = "string",
        Username = "string",
        VmState = "string",
        Configurations = new[]
        {
            new Gcore.Inputs.Instancev2ConfigurationArgs
            {
                Key = "string",
                Value = "string",
            },
        },
    });
    
    example, err := gcore.NewInstancev2(ctx, "instancev2Resource", &gcore.Instancev2Args{
    	Interfaces: gcore.Instancev2InterfaceArray{
    		&gcore.Instancev2InterfaceArgs{
    			Name: pulumi.String("string"),
    			SecurityGroups: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			ExistingFipId: pulumi.String("string"),
    			IpAddress:     pulumi.String("string"),
    			IpFamily:      pulumi.String("string"),
    			NetworkId:     pulumi.String("string"),
    			Order:         pulumi.Float64(0),
    			PortId:        pulumi.String("string"),
    			SubnetId:      pulumi.String("string"),
    			Type:          pulumi.String("string"),
    		},
    	},
    	Volumes: gcore.Instancev2VolumeArray{
    		&gcore.Instancev2VolumeArgs{
    			VolumeId:            pulumi.String("string"),
    			AttachmentTag:       pulumi.String("string"),
    			BootIndex:           pulumi.Float64(0),
    			DeleteOnTermination: pulumi.Bool(false),
    			Id:                  pulumi.String("string"),
    			ImageId:             pulumi.String("string"),
    			Name:                pulumi.String("string"),
    			Size:                pulumi.Float64(0),
    			TypeName:            pulumi.String("string"),
    		},
    	},
    	FlavorId:     pulumi.String("string"),
    	NameTemplate: pulumi.String("string"),
    	ProjectId:    pulumi.Float64(0),
    	KeypairName:  pulumi.String("string"),
    	MetadataMap: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Name:          pulumi.String("string"),
    	AllowAppPorts: pulumi.Bool(false),
    	Password:      pulumi.String("string"),
    	Instancev2Id:  pulumi.String("string"),
    	ProjectName:   pulumi.String("string"),
    	RegionId:      pulumi.Float64(0),
    	RegionName:    pulumi.String("string"),
    	ServerGroup:   pulumi.String("string"),
    	UserData:      pulumi.String("string"),
    	Username:      pulumi.String("string"),
    	VmState:       pulumi.String("string"),
    	Configurations: gcore.Instancev2ConfigurationArray{
    		&gcore.Instancev2ConfigurationArgs{
    			Key:   pulumi.String("string"),
    			Value: pulumi.String("string"),
    		},
    	},
    })
    
    var instancev2Resource = new Instancev2("instancev2Resource", Instancev2Args.builder()
        .interfaces(Instancev2InterfaceArgs.builder()
            .name("string")
            .securityGroups("string")
            .existingFipId("string")
            .ipAddress("string")
            .ipFamily("string")
            .networkId("string")
            .order(0)
            .portId("string")
            .subnetId("string")
            .type("string")
            .build())
        .volumes(Instancev2VolumeArgs.builder()
            .volumeId("string")
            .attachmentTag("string")
            .bootIndex(0)
            .deleteOnTermination(false)
            .id("string")
            .imageId("string")
            .name("string")
            .size(0)
            .typeName("string")
            .build())
        .flavorId("string")
        .nameTemplate("string")
        .projectId(0)
        .keypairName("string")
        .metadataMap(Map.of("string", "string"))
        .name("string")
        .allowAppPorts(false)
        .password("string")
        .instancev2Id("string")
        .projectName("string")
        .regionId(0)
        .regionName("string")
        .serverGroup("string")
        .userData("string")
        .username("string")
        .vmState("string")
        .configurations(Instancev2ConfigurationArgs.builder()
            .key("string")
            .value("string")
            .build())
        .build());
    
    instancev2_resource = gcore.Instancev2("instancev2Resource",
        interfaces=[{
            "name": "string",
            "security_groups": ["string"],
            "existing_fip_id": "string",
            "ip_address": "string",
            "ip_family": "string",
            "network_id": "string",
            "order": 0,
            "port_id": "string",
            "subnet_id": "string",
            "type": "string",
        }],
        volumes=[{
            "volume_id": "string",
            "attachment_tag": "string",
            "boot_index": 0,
            "delete_on_termination": False,
            "id": "string",
            "image_id": "string",
            "name": "string",
            "size": 0,
            "type_name": "string",
        }],
        flavor_id="string",
        name_template="string",
        project_id=0,
        keypair_name="string",
        metadata_map={
            "string": "string",
        },
        name="string",
        allow_app_ports=False,
        password="string",
        instancev2_id="string",
        project_name="string",
        region_id=0,
        region_name="string",
        server_group="string",
        user_data="string",
        username="string",
        vm_state="string",
        configurations=[{
            "key": "string",
            "value": "string",
        }])
    
    const instancev2Resource = new gcore.Instancev2("instancev2Resource", {
        interfaces: [{
            name: "string",
            securityGroups: ["string"],
            existingFipId: "string",
            ipAddress: "string",
            ipFamily: "string",
            networkId: "string",
            order: 0,
            portId: "string",
            subnetId: "string",
            type: "string",
        }],
        volumes: [{
            volumeId: "string",
            attachmentTag: "string",
            bootIndex: 0,
            deleteOnTermination: false,
            id: "string",
            imageId: "string",
            name: "string",
            size: 0,
            typeName: "string",
        }],
        flavorId: "string",
        nameTemplate: "string",
        projectId: 0,
        keypairName: "string",
        metadataMap: {
            string: "string",
        },
        name: "string",
        allowAppPorts: false,
        password: "string",
        instancev2Id: "string",
        projectName: "string",
        regionId: 0,
        regionName: "string",
        serverGroup: "string",
        userData: "string",
        username: "string",
        vmState: "string",
        configurations: [{
            key: "string",
            value: "string",
        }],
    });
    
    type: gcore:Instancev2
    properties:
        allowAppPorts: false
        configurations:
            - key: string
              value: string
        flavorId: string
        instancev2Id: string
        interfaces:
            - existingFipId: string
              ipAddress: string
              ipFamily: string
              name: string
              networkId: string
              order: 0
              portId: string
              securityGroups:
                - string
              subnetId: string
              type: string
        keypairName: string
        metadataMap:
            string: string
        name: string
        nameTemplate: string
        password: string
        projectId: 0
        projectName: string
        regionId: 0
        regionName: string
        serverGroup: string
        userData: string
        username: string
        vmState: string
        volumes:
            - attachmentTag: string
              bootIndex: 0
              deleteOnTermination: false
              id: string
              imageId: string
              name: string
              size: 0
              typeName: string
              volumeId: string
    

    Instancev2 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 Instancev2 resource accepts the following input properties:

    FlavorId string
    Flavor ID
    Interfaces List<Instancev2Interface>
    List of interfaces for the instance. You can detach the interface from the instance by removing the interface from the instance resource and attach the interface by adding the interface resource inside an instance resource.
    Volumes List<Instancev2Volume>
    List of volumes for the instance. You can detach the volume from the instance by removing the volume from the instance resource. You cannot detach the boot volume. You can attach a data volume by adding the volume resource inside an instance resource.
    AllowAppPorts bool
    If true, application ports will be allowed in the security group for instances created from the marketplace application template
    Configurations List<Instancev2Configuration>
    Parameters for the application template from the marketplace
    Instancev2Id string
    The ID of this resource.
    KeypairName string
    Name of the keypair to use for the instance
    MetadataMap Dictionary<string, string>
    Create one or more metadata items for the instance
    Name string
    Name of the instance.
    NameTemplate string
    Instance name template. You can use forms 'ipoctets', 'twoipoctets', 'oneip_octet'
    Password string
    For Linux instances, 'username' and 'password' are used to create a new user. When only 'password' is provided, it is set as the password for the default user of the image. 'userdata' is ignored when 'password' is specified. For Windows instances, 'username' cannot be specified. Use the 'password' field to set the password for the 'Admin' user on Windows. Use the 'userdata' field to provide a script to create new users on Windows. The password of the Admin user cannot be updated via 'user_data'
    ProjectId double
    Project ID, only one of projectid or projectname should be set
    ProjectName string
    Project name, only one of projectid or projectname should be set
    RegionId double
    Region ID, only one of regionid or regionname should be set
    RegionName string
    Region name, only one of regionid or regionname should be set
    ServerGroup string
    ID of the server group to use for the instance
    UserData string
    String in base64 format. For Linux instances, 'userdata' is ignored when 'password' field is provided. For Windows instances, Admin user password is set by 'password' field and cannot be updated via 'userdata'
    Username string
    For Linux instances, 'username' and 'password' are used to create a new user. For Windows instances, 'username' cannot be specified. Use 'password' field to set the password for the 'Admin' user on Windows.
    VmState string
    Current vm state, use stopped to stop vm and active to start
    FlavorId string
    Flavor ID
    Interfaces []Instancev2InterfaceArgs
    List of interfaces for the instance. You can detach the interface from the instance by removing the interface from the instance resource and attach the interface by adding the interface resource inside an instance resource.
    Volumes []Instancev2VolumeArgs
    List of volumes for the instance. You can detach the volume from the instance by removing the volume from the instance resource. You cannot detach the boot volume. You can attach a data volume by adding the volume resource inside an instance resource.
    AllowAppPorts bool
    If true, application ports will be allowed in the security group for instances created from the marketplace application template
    Configurations []Instancev2ConfigurationArgs
    Parameters for the application template from the marketplace
    Instancev2Id string
    The ID of this resource.
    KeypairName string
    Name of the keypair to use for the instance
    MetadataMap map[string]string
    Create one or more metadata items for the instance
    Name string
    Name of the instance.
    NameTemplate string
    Instance name template. You can use forms 'ipoctets', 'twoipoctets', 'oneip_octet'
    Password string
    For Linux instances, 'username' and 'password' are used to create a new user. When only 'password' is provided, it is set as the password for the default user of the image. 'userdata' is ignored when 'password' is specified. For Windows instances, 'username' cannot be specified. Use the 'password' field to set the password for the 'Admin' user on Windows. Use the 'userdata' field to provide a script to create new users on Windows. The password of the Admin user cannot be updated via 'user_data'
    ProjectId float64
    Project ID, only one of projectid or projectname should be set
    ProjectName string
    Project name, only one of projectid or projectname should be set
    RegionId float64
    Region ID, only one of regionid or regionname should be set
    RegionName string
    Region name, only one of regionid or regionname should be set
    ServerGroup string
    ID of the server group to use for the instance
    UserData string
    String in base64 format. For Linux instances, 'userdata' is ignored when 'password' field is provided. For Windows instances, Admin user password is set by 'password' field and cannot be updated via 'userdata'
    Username string
    For Linux instances, 'username' and 'password' are used to create a new user. For Windows instances, 'username' cannot be specified. Use 'password' field to set the password for the 'Admin' user on Windows.
    VmState string
    Current vm state, use stopped to stop vm and active to start
    flavorId String
    Flavor ID
    interfaces List<Instancev2Interface>
    List of interfaces for the instance. You can detach the interface from the instance by removing the interface from the instance resource and attach the interface by adding the interface resource inside an instance resource.
    volumes List<Instancev2Volume>
    List of volumes for the instance. You can detach the volume from the instance by removing the volume from the instance resource. You cannot detach the boot volume. You can attach a data volume by adding the volume resource inside an instance resource.
    allowAppPorts Boolean
    If true, application ports will be allowed in the security group for instances created from the marketplace application template
    configurations List<Instancev2Configuration>
    Parameters for the application template from the marketplace
    instancev2Id String
    The ID of this resource.
    keypairName String
    Name of the keypair to use for the instance
    metadataMap Map<String,String>
    Create one or more metadata items for the instance
    name String
    Name of the instance.
    nameTemplate String
    Instance name template. You can use forms 'ipoctets', 'twoipoctets', 'oneip_octet'
    password String
    For Linux instances, 'username' and 'password' are used to create a new user. When only 'password' is provided, it is set as the password for the default user of the image. 'userdata' is ignored when 'password' is specified. For Windows instances, 'username' cannot be specified. Use the 'password' field to set the password for the 'Admin' user on Windows. Use the 'userdata' field to provide a script to create new users on Windows. The password of the Admin user cannot be updated via 'user_data'
    projectId Double
    Project ID, only one of projectid or projectname should be set
    projectName String
    Project name, only one of projectid or projectname should be set
    regionId Double
    Region ID, only one of regionid or regionname should be set
    regionName String
    Region name, only one of regionid or regionname should be set
    serverGroup String
    ID of the server group to use for the instance
    userData String
    String in base64 format. For Linux instances, 'userdata' is ignored when 'password' field is provided. For Windows instances, Admin user password is set by 'password' field and cannot be updated via 'userdata'
    username String
    For Linux instances, 'username' and 'password' are used to create a new user. For Windows instances, 'username' cannot be specified. Use 'password' field to set the password for the 'Admin' user on Windows.
    vmState String
    Current vm state, use stopped to stop vm and active to start
    flavorId string
    Flavor ID
    interfaces Instancev2Interface[]
    List of interfaces for the instance. You can detach the interface from the instance by removing the interface from the instance resource and attach the interface by adding the interface resource inside an instance resource.
    volumes Instancev2Volume[]
    List of volumes for the instance. You can detach the volume from the instance by removing the volume from the instance resource. You cannot detach the boot volume. You can attach a data volume by adding the volume resource inside an instance resource.
    allowAppPorts boolean
    If true, application ports will be allowed in the security group for instances created from the marketplace application template
    configurations Instancev2Configuration[]
    Parameters for the application template from the marketplace
    instancev2Id string
    The ID of this resource.
    keypairName string
    Name of the keypair to use for the instance
    metadataMap {[key: string]: string}
    Create one or more metadata items for the instance
    name string
    Name of the instance.
    nameTemplate string
    Instance name template. You can use forms 'ipoctets', 'twoipoctets', 'oneip_octet'
    password string
    For Linux instances, 'username' and 'password' are used to create a new user. When only 'password' is provided, it is set as the password for the default user of the image. 'userdata' is ignored when 'password' is specified. For Windows instances, 'username' cannot be specified. Use the 'password' field to set the password for the 'Admin' user on Windows. Use the 'userdata' field to provide a script to create new users on Windows. The password of the Admin user cannot be updated via 'user_data'
    projectId number
    Project ID, only one of projectid or projectname should be set
    projectName string
    Project name, only one of projectid or projectname should be set
    regionId number
    Region ID, only one of regionid or regionname should be set
    regionName string
    Region name, only one of regionid or regionname should be set
    serverGroup string
    ID of the server group to use for the instance
    userData string
    String in base64 format. For Linux instances, 'userdata' is ignored when 'password' field is provided. For Windows instances, Admin user password is set by 'password' field and cannot be updated via 'userdata'
    username string
    For Linux instances, 'username' and 'password' are used to create a new user. For Windows instances, 'username' cannot be specified. Use 'password' field to set the password for the 'Admin' user on Windows.
    vmState string
    Current vm state, use stopped to stop vm and active to start
    flavor_id str
    Flavor ID
    interfaces Sequence[Instancev2InterfaceArgs]
    List of interfaces for the instance. You can detach the interface from the instance by removing the interface from the instance resource and attach the interface by adding the interface resource inside an instance resource.
    volumes Sequence[Instancev2VolumeArgs]
    List of volumes for the instance. You can detach the volume from the instance by removing the volume from the instance resource. You cannot detach the boot volume. You can attach a data volume by adding the volume resource inside an instance resource.
    allow_app_ports bool
    If true, application ports will be allowed in the security group for instances created from the marketplace application template
    configurations Sequence[Instancev2ConfigurationArgs]
    Parameters for the application template from the marketplace
    instancev2_id str
    The ID of this resource.
    keypair_name str
    Name of the keypair to use for the instance
    metadata_map Mapping[str, str]
    Create one or more metadata items for the instance
    name str
    Name of the instance.
    name_template str
    Instance name template. You can use forms 'ipoctets', 'twoipoctets', 'oneip_octet'
    password str
    For Linux instances, 'username' and 'password' are used to create a new user. When only 'password' is provided, it is set as the password for the default user of the image. 'userdata' is ignored when 'password' is specified. For Windows instances, 'username' cannot be specified. Use the 'password' field to set the password for the 'Admin' user on Windows. Use the 'userdata' field to provide a script to create new users on Windows. The password of the Admin user cannot be updated via 'user_data'
    project_id float
    Project ID, only one of projectid or projectname should be set
    project_name str
    Project name, only one of projectid or projectname should be set
    region_id float
    Region ID, only one of regionid or regionname should be set
    region_name str
    Region name, only one of regionid or regionname should be set
    server_group str
    ID of the server group to use for the instance
    user_data str
    String in base64 format. For Linux instances, 'userdata' is ignored when 'password' field is provided. For Windows instances, Admin user password is set by 'password' field and cannot be updated via 'userdata'
    username str
    For Linux instances, 'username' and 'password' are used to create a new user. For Windows instances, 'username' cannot be specified. Use 'password' field to set the password for the 'Admin' user on Windows.
    vm_state str
    Current vm state, use stopped to stop vm and active to start
    flavorId String
    Flavor ID
    interfaces List<Property Map>
    List of interfaces for the instance. You can detach the interface from the instance by removing the interface from the instance resource and attach the interface by adding the interface resource inside an instance resource.
    volumes List<Property Map>
    List of volumes for the instance. You can detach the volume from the instance by removing the volume from the instance resource. You cannot detach the boot volume. You can attach a data volume by adding the volume resource inside an instance resource.
    allowAppPorts Boolean
    If true, application ports will be allowed in the security group for instances created from the marketplace application template
    configurations List<Property Map>
    Parameters for the application template from the marketplace
    instancev2Id String
    The ID of this resource.
    keypairName String
    Name of the keypair to use for the instance
    metadataMap Map<String>
    Create one or more metadata items for the instance
    name String
    Name of the instance.
    nameTemplate String
    Instance name template. You can use forms 'ipoctets', 'twoipoctets', 'oneip_octet'
    password String
    For Linux instances, 'username' and 'password' are used to create a new user. When only 'password' is provided, it is set as the password for the default user of the image. 'userdata' is ignored when 'password' is specified. For Windows instances, 'username' cannot be specified. Use the 'password' field to set the password for the 'Admin' user on Windows. Use the 'userdata' field to provide a script to create new users on Windows. The password of the Admin user cannot be updated via 'user_data'
    projectId Number
    Project ID, only one of projectid or projectname should be set
    projectName String
    Project name, only one of projectid or projectname should be set
    regionId Number
    Region ID, only one of regionid or regionname should be set
    regionName String
    Region name, only one of regionid or regionname should be set
    serverGroup String
    ID of the server group to use for the instance
    userData String
    String in base64 format. For Linux instances, 'userdata' is ignored when 'password' field is provided. For Windows instances, Admin user password is set by 'password' field and cannot be updated via 'userdata'
    username String
    For Linux instances, 'username' and 'password' are used to create a new user. For Windows instances, 'username' cannot be specified. Use 'password' field to set the password for the 'Admin' user on Windows.
    vmState String
    Current vm state, use stopped to stop vm and active to start

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Instancev2 resource produces the following output properties:

    Addresses List<Instancev2Address>
    List of instance addresses
    Flavor Dictionary<string, string>
    Flavor details, RAM, vCPU, etc.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    MetadataReadOnlies List<Instancev2MetadataReadOnly>
    Status string
    Status of the instance
    Addresses []Instancev2Address
    List of instance addresses
    Flavor map[string]string
    Flavor details, RAM, vCPU, etc.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    MetadataReadOnlies []Instancev2MetadataReadOnly
    Status string
    Status of the instance
    addresses List<Instancev2Address>
    List of instance addresses
    flavor Map<String,String>
    Flavor details, RAM, vCPU, etc.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String
    metadataReadOnlies List<Instancev2MetadataReadOnly>
    status String
    Status of the instance
    addresses Instancev2Address[]
    List of instance addresses
    flavor {[key: string]: string}
    Flavor details, RAM, vCPU, etc.
    id string
    The provider-assigned unique ID for this managed resource.
    lastUpdated string
    metadataReadOnlies Instancev2MetadataReadOnly[]
    status string
    Status of the instance
    addresses Sequence[Instancev2Address]
    List of instance addresses
    flavor Mapping[str, str]
    Flavor details, RAM, vCPU, etc.
    id str
    The provider-assigned unique ID for this managed resource.
    last_updated str
    metadata_read_onlies Sequence[Instancev2MetadataReadOnly]
    status str
    Status of the instance
    addresses List<Property Map>
    List of instance addresses
    flavor Map<String>
    Flavor details, RAM, vCPU, etc.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String
    metadataReadOnlies List<Property Map>
    status String
    Status of the instance

    Look up Existing Instancev2 Resource

    Get an existing Instancev2 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?: Instancev2State, opts?: CustomResourceOptions): Instancev2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            addresses: Optional[Sequence[Instancev2AddressArgs]] = None,
            allow_app_ports: Optional[bool] = None,
            configurations: Optional[Sequence[Instancev2ConfigurationArgs]] = None,
            flavor: Optional[Mapping[str, str]] = None,
            flavor_id: Optional[str] = None,
            instancev2_id: Optional[str] = None,
            interfaces: Optional[Sequence[Instancev2InterfaceArgs]] = None,
            keypair_name: Optional[str] = None,
            last_updated: Optional[str] = None,
            metadata_map: Optional[Mapping[str, str]] = None,
            metadata_read_onlies: Optional[Sequence[Instancev2MetadataReadOnlyArgs]] = None,
            name: Optional[str] = None,
            name_template: Optional[str] = None,
            password: Optional[str] = None,
            project_id: Optional[float] = None,
            project_name: Optional[str] = None,
            region_id: Optional[float] = None,
            region_name: Optional[str] = None,
            server_group: Optional[str] = None,
            status: Optional[str] = None,
            user_data: Optional[str] = None,
            username: Optional[str] = None,
            vm_state: Optional[str] = None,
            volumes: Optional[Sequence[Instancev2VolumeArgs]] = None) -> Instancev2
    func GetInstancev2(ctx *Context, name string, id IDInput, state *Instancev2State, opts ...ResourceOption) (*Instancev2, error)
    public static Instancev2 Get(string name, Input<string> id, Instancev2State? state, CustomResourceOptions? opts = null)
    public static Instancev2 get(String name, Output<String> id, Instancev2State state, CustomResourceOptions options)
    resources:  _:    type: gcore:Instancev2    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.
    The following state arguments are supported:
    Addresses List<Instancev2Address>
    List of instance addresses
    AllowAppPorts bool
    If true, application ports will be allowed in the security group for instances created from the marketplace application template
    Configurations List<Instancev2Configuration>
    Parameters for the application template from the marketplace
    Flavor Dictionary<string, string>
    Flavor details, RAM, vCPU, etc.
    FlavorId string
    Flavor ID
    Instancev2Id string
    The ID of this resource.
    Interfaces List<Instancev2Interface>
    List of interfaces for the instance. You can detach the interface from the instance by removing the interface from the instance resource and attach the interface by adding the interface resource inside an instance resource.
    KeypairName string
    Name of the keypair to use for the instance
    LastUpdated string
    MetadataMap Dictionary<string, string>
    Create one or more metadata items for the instance
    MetadataReadOnlies List<Instancev2MetadataReadOnly>
    Name string
    Name of the instance.
    NameTemplate string
    Instance name template. You can use forms 'ipoctets', 'twoipoctets', 'oneip_octet'
    Password string
    For Linux instances, 'username' and 'password' are used to create a new user. When only 'password' is provided, it is set as the password for the default user of the image. 'userdata' is ignored when 'password' is specified. For Windows instances, 'username' cannot be specified. Use the 'password' field to set the password for the 'Admin' user on Windows. Use the 'userdata' field to provide a script to create new users on Windows. The password of the Admin user cannot be updated via 'user_data'
    ProjectId double
    Project ID, only one of projectid or projectname should be set
    ProjectName string
    Project name, only one of projectid or projectname should be set
    RegionId double
    Region ID, only one of regionid or regionname should be set
    RegionName string
    Region name, only one of regionid or regionname should be set
    ServerGroup string
    ID of the server group to use for the instance
    Status string
    Status of the instance
    UserData string
    String in base64 format. For Linux instances, 'userdata' is ignored when 'password' field is provided. For Windows instances, Admin user password is set by 'password' field and cannot be updated via 'userdata'
    Username string
    For Linux instances, 'username' and 'password' are used to create a new user. For Windows instances, 'username' cannot be specified. Use 'password' field to set the password for the 'Admin' user on Windows.
    VmState string
    Current vm state, use stopped to stop vm and active to start
    Volumes List<Instancev2Volume>
    List of volumes for the instance. You can detach the volume from the instance by removing the volume from the instance resource. You cannot detach the boot volume. You can attach a data volume by adding the volume resource inside an instance resource.
    Addresses []Instancev2AddressArgs
    List of instance addresses
    AllowAppPorts bool
    If true, application ports will be allowed in the security group for instances created from the marketplace application template
    Configurations []Instancev2ConfigurationArgs
    Parameters for the application template from the marketplace
    Flavor map[string]string
    Flavor details, RAM, vCPU, etc.
    FlavorId string
    Flavor ID
    Instancev2Id string
    The ID of this resource.
    Interfaces []Instancev2InterfaceArgs
    List of interfaces for the instance. You can detach the interface from the instance by removing the interface from the instance resource and attach the interface by adding the interface resource inside an instance resource.
    KeypairName string
    Name of the keypair to use for the instance
    LastUpdated string
    MetadataMap map[string]string
    Create one or more metadata items for the instance
    MetadataReadOnlies []Instancev2MetadataReadOnlyArgs
    Name string
    Name of the instance.
    NameTemplate string
    Instance name template. You can use forms 'ipoctets', 'twoipoctets', 'oneip_octet'
    Password string
    For Linux instances, 'username' and 'password' are used to create a new user. When only 'password' is provided, it is set as the password for the default user of the image. 'userdata' is ignored when 'password' is specified. For Windows instances, 'username' cannot be specified. Use the 'password' field to set the password for the 'Admin' user on Windows. Use the 'userdata' field to provide a script to create new users on Windows. The password of the Admin user cannot be updated via 'user_data'
    ProjectId float64
    Project ID, only one of projectid or projectname should be set
    ProjectName string
    Project name, only one of projectid or projectname should be set
    RegionId float64
    Region ID, only one of regionid or regionname should be set
    RegionName string
    Region name, only one of regionid or regionname should be set
    ServerGroup string
    ID of the server group to use for the instance
    Status string
    Status of the instance
    UserData string
    String in base64 format. For Linux instances, 'userdata' is ignored when 'password' field is provided. For Windows instances, Admin user password is set by 'password' field and cannot be updated via 'userdata'
    Username string
    For Linux instances, 'username' and 'password' are used to create a new user. For Windows instances, 'username' cannot be specified. Use 'password' field to set the password for the 'Admin' user on Windows.
    VmState string
    Current vm state, use stopped to stop vm and active to start
    Volumes []Instancev2VolumeArgs
    List of volumes for the instance. You can detach the volume from the instance by removing the volume from the instance resource. You cannot detach the boot volume. You can attach a data volume by adding the volume resource inside an instance resource.
    addresses List<Instancev2Address>
    List of instance addresses
    allowAppPorts Boolean
    If true, application ports will be allowed in the security group for instances created from the marketplace application template
    configurations List<Instancev2Configuration>
    Parameters for the application template from the marketplace
    flavor Map<String,String>
    Flavor details, RAM, vCPU, etc.
    flavorId String
    Flavor ID
    instancev2Id String
    The ID of this resource.
    interfaces List<Instancev2Interface>
    List of interfaces for the instance. You can detach the interface from the instance by removing the interface from the instance resource and attach the interface by adding the interface resource inside an instance resource.
    keypairName String
    Name of the keypair to use for the instance
    lastUpdated String
    metadataMap Map<String,String>
    Create one or more metadata items for the instance
    metadataReadOnlies List<Instancev2MetadataReadOnly>
    name String
    Name of the instance.
    nameTemplate String
    Instance name template. You can use forms 'ipoctets', 'twoipoctets', 'oneip_octet'
    password String
    For Linux instances, 'username' and 'password' are used to create a new user. When only 'password' is provided, it is set as the password for the default user of the image. 'userdata' is ignored when 'password' is specified. For Windows instances, 'username' cannot be specified. Use the 'password' field to set the password for the 'Admin' user on Windows. Use the 'userdata' field to provide a script to create new users on Windows. The password of the Admin user cannot be updated via 'user_data'
    projectId Double
    Project ID, only one of projectid or projectname should be set
    projectName String
    Project name, only one of projectid or projectname should be set
    regionId Double
    Region ID, only one of regionid or regionname should be set
    regionName String
    Region name, only one of regionid or regionname should be set
    serverGroup String
    ID of the server group to use for the instance
    status String
    Status of the instance
    userData String
    String in base64 format. For Linux instances, 'userdata' is ignored when 'password' field is provided. For Windows instances, Admin user password is set by 'password' field and cannot be updated via 'userdata'
    username String
    For Linux instances, 'username' and 'password' are used to create a new user. For Windows instances, 'username' cannot be specified. Use 'password' field to set the password for the 'Admin' user on Windows.
    vmState String
    Current vm state, use stopped to stop vm and active to start
    volumes List<Instancev2Volume>
    List of volumes for the instance. You can detach the volume from the instance by removing the volume from the instance resource. You cannot detach the boot volume. You can attach a data volume by adding the volume resource inside an instance resource.
    addresses Instancev2Address[]
    List of instance addresses
    allowAppPorts boolean
    If true, application ports will be allowed in the security group for instances created from the marketplace application template
    configurations Instancev2Configuration[]
    Parameters for the application template from the marketplace
    flavor {[key: string]: string}
    Flavor details, RAM, vCPU, etc.
    flavorId string
    Flavor ID
    instancev2Id string
    The ID of this resource.
    interfaces Instancev2Interface[]
    List of interfaces for the instance. You can detach the interface from the instance by removing the interface from the instance resource and attach the interface by adding the interface resource inside an instance resource.
    keypairName string
    Name of the keypair to use for the instance
    lastUpdated string
    metadataMap {[key: string]: string}
    Create one or more metadata items for the instance
    metadataReadOnlies Instancev2MetadataReadOnly[]
    name string
    Name of the instance.
    nameTemplate string
    Instance name template. You can use forms 'ipoctets', 'twoipoctets', 'oneip_octet'
    password string
    For Linux instances, 'username' and 'password' are used to create a new user. When only 'password' is provided, it is set as the password for the default user of the image. 'userdata' is ignored when 'password' is specified. For Windows instances, 'username' cannot be specified. Use the 'password' field to set the password for the 'Admin' user on Windows. Use the 'userdata' field to provide a script to create new users on Windows. The password of the Admin user cannot be updated via 'user_data'
    projectId number
    Project ID, only one of projectid or projectname should be set
    projectName string
    Project name, only one of projectid or projectname should be set
    regionId number
    Region ID, only one of regionid or regionname should be set
    regionName string
    Region name, only one of regionid or regionname should be set
    serverGroup string
    ID of the server group to use for the instance
    status string
    Status of the instance
    userData string
    String in base64 format. For Linux instances, 'userdata' is ignored when 'password' field is provided. For Windows instances, Admin user password is set by 'password' field and cannot be updated via 'userdata'
    username string
    For Linux instances, 'username' and 'password' are used to create a new user. For Windows instances, 'username' cannot be specified. Use 'password' field to set the password for the 'Admin' user on Windows.
    vmState string
    Current vm state, use stopped to stop vm and active to start
    volumes Instancev2Volume[]
    List of volumes for the instance. You can detach the volume from the instance by removing the volume from the instance resource. You cannot detach the boot volume. You can attach a data volume by adding the volume resource inside an instance resource.
    addresses Sequence[Instancev2AddressArgs]
    List of instance addresses
    allow_app_ports bool
    If true, application ports will be allowed in the security group for instances created from the marketplace application template
    configurations Sequence[Instancev2ConfigurationArgs]
    Parameters for the application template from the marketplace
    flavor Mapping[str, str]
    Flavor details, RAM, vCPU, etc.
    flavor_id str
    Flavor ID
    instancev2_id str
    The ID of this resource.
    interfaces Sequence[Instancev2InterfaceArgs]
    List of interfaces for the instance. You can detach the interface from the instance by removing the interface from the instance resource and attach the interface by adding the interface resource inside an instance resource.
    keypair_name str
    Name of the keypair to use for the instance
    last_updated str
    metadata_map Mapping[str, str]
    Create one or more metadata items for the instance
    metadata_read_onlies Sequence[Instancev2MetadataReadOnlyArgs]
    name str
    Name of the instance.
    name_template str
    Instance name template. You can use forms 'ipoctets', 'twoipoctets', 'oneip_octet'
    password str
    For Linux instances, 'username' and 'password' are used to create a new user. When only 'password' is provided, it is set as the password for the default user of the image. 'userdata' is ignored when 'password' is specified. For Windows instances, 'username' cannot be specified. Use the 'password' field to set the password for the 'Admin' user on Windows. Use the 'userdata' field to provide a script to create new users on Windows. The password of the Admin user cannot be updated via 'user_data'
    project_id float
    Project ID, only one of projectid or projectname should be set
    project_name str
    Project name, only one of projectid or projectname should be set
    region_id float
    Region ID, only one of regionid or regionname should be set
    region_name str
    Region name, only one of regionid or regionname should be set
    server_group str
    ID of the server group to use for the instance
    status str
    Status of the instance
    user_data str
    String in base64 format. For Linux instances, 'userdata' is ignored when 'password' field is provided. For Windows instances, Admin user password is set by 'password' field and cannot be updated via 'userdata'
    username str
    For Linux instances, 'username' and 'password' are used to create a new user. For Windows instances, 'username' cannot be specified. Use 'password' field to set the password for the 'Admin' user on Windows.
    vm_state str
    Current vm state, use stopped to stop vm and active to start
    volumes Sequence[Instancev2VolumeArgs]
    List of volumes for the instance. You can detach the volume from the instance by removing the volume from the instance resource. You cannot detach the boot volume. You can attach a data volume by adding the volume resource inside an instance resource.
    addresses List<Property Map>
    List of instance addresses
    allowAppPorts Boolean
    If true, application ports will be allowed in the security group for instances created from the marketplace application template
    configurations List<Property Map>
    Parameters for the application template from the marketplace
    flavor Map<String>
    Flavor details, RAM, vCPU, etc.
    flavorId String
    Flavor ID
    instancev2Id String
    The ID of this resource.
    interfaces List<Property Map>
    List of interfaces for the instance. You can detach the interface from the instance by removing the interface from the instance resource and attach the interface by adding the interface resource inside an instance resource.
    keypairName String
    Name of the keypair to use for the instance
    lastUpdated String
    metadataMap Map<String>
    Create one or more metadata items for the instance
    metadataReadOnlies List<Property Map>
    name String
    Name of the instance.
    nameTemplate String
    Instance name template. You can use forms 'ipoctets', 'twoipoctets', 'oneip_octet'
    password String
    For Linux instances, 'username' and 'password' are used to create a new user. When only 'password' is provided, it is set as the password for the default user of the image. 'userdata' is ignored when 'password' is specified. For Windows instances, 'username' cannot be specified. Use the 'password' field to set the password for the 'Admin' user on Windows. Use the 'userdata' field to provide a script to create new users on Windows. The password of the Admin user cannot be updated via 'user_data'
    projectId Number
    Project ID, only one of projectid or projectname should be set
    projectName String
    Project name, only one of projectid or projectname should be set
    regionId Number
    Region ID, only one of regionid or regionname should be set
    regionName String
    Region name, only one of regionid or regionname should be set
    serverGroup String
    ID of the server group to use for the instance
    status String
    Status of the instance
    userData String
    String in base64 format. For Linux instances, 'userdata' is ignored when 'password' field is provided. For Windows instances, Admin user password is set by 'password' field and cannot be updated via 'userdata'
    username String
    For Linux instances, 'username' and 'password' are used to create a new user. For Windows instances, 'username' cannot be specified. Use 'password' field to set the password for the 'Admin' user on Windows.
    vmState String
    Current vm state, use stopped to stop vm and active to start
    volumes List<Property Map>
    List of volumes for the instance. You can detach the volume from the instance by removing the volume from the instance resource. You cannot detach the boot volume. You can attach a data volume by adding the volume resource inside an instance resource.

    Supporting Types

    Instancev2Address, Instancev2AddressArgs

    Instancev2AddressNet, Instancev2AddressNetArgs

    Addr string
    Type string
    Addr string
    Type string
    addr String
    type String
    addr string
    type string
    addr str
    type str
    addr String
    type String

    Instancev2Configuration, Instancev2ConfigurationArgs

    Key string
    Value string
    Key string
    Value string
    key String
    value String
    key string
    value string
    key str
    value str
    key String
    value String

    Instancev2Interface, Instancev2InterfaceArgs

    Name string
    Name of interface, should be unique for the instance
    SecurityGroups List<string>
    list of security group IDs, they will be attached to exact interface
    ExistingFipId string
    The id of the existing floating IP that will be attached to the interface
    IpAddress string
    IP address for the interface.
    IpFamily string
    IP family for the interface, available values are 'dual', 'ipv4' and 'ipv6'
    NetworkId string
    required if type is 'subnet' or 'any_subnet'
    Order double
    Order of attaching interface
    PortId string
    required if type is 'reservedfixedip'
    SubnetId string
    required if type is 'subnet'
    Type string
    Available value is 'subnet', 'anysubnet', 'external', 'reservedfixed_ip'
    Name string
    Name of interface, should be unique for the instance
    SecurityGroups []string
    list of security group IDs, they will be attached to exact interface
    ExistingFipId string
    The id of the existing floating IP that will be attached to the interface
    IpAddress string
    IP address for the interface.
    IpFamily string
    IP family for the interface, available values are 'dual', 'ipv4' and 'ipv6'
    NetworkId string
    required if type is 'subnet' or 'any_subnet'
    Order float64
    Order of attaching interface
    PortId string
    required if type is 'reservedfixedip'
    SubnetId string
    required if type is 'subnet'
    Type string
    Available value is 'subnet', 'anysubnet', 'external', 'reservedfixed_ip'
    name String
    Name of interface, should be unique for the instance
    securityGroups List<String>
    list of security group IDs, they will be attached to exact interface
    existingFipId String
    The id of the existing floating IP that will be attached to the interface
    ipAddress String
    IP address for the interface.
    ipFamily String
    IP family for the interface, available values are 'dual', 'ipv4' and 'ipv6'
    networkId String
    required if type is 'subnet' or 'any_subnet'
    order Double
    Order of attaching interface
    portId String
    required if type is 'reservedfixedip'
    subnetId String
    required if type is 'subnet'
    type String
    Available value is 'subnet', 'anysubnet', 'external', 'reservedfixed_ip'
    name string
    Name of interface, should be unique for the instance
    securityGroups string[]
    list of security group IDs, they will be attached to exact interface
    existingFipId string
    The id of the existing floating IP that will be attached to the interface
    ipAddress string
    IP address for the interface.
    ipFamily string
    IP family for the interface, available values are 'dual', 'ipv4' and 'ipv6'
    networkId string
    required if type is 'subnet' or 'any_subnet'
    order number
    Order of attaching interface
    portId string
    required if type is 'reservedfixedip'
    subnetId string
    required if type is 'subnet'
    type string
    Available value is 'subnet', 'anysubnet', 'external', 'reservedfixed_ip'
    name str
    Name of interface, should be unique for the instance
    security_groups Sequence[str]
    list of security group IDs, they will be attached to exact interface
    existing_fip_id str
    The id of the existing floating IP that will be attached to the interface
    ip_address str
    IP address for the interface.
    ip_family str
    IP family for the interface, available values are 'dual', 'ipv4' and 'ipv6'
    network_id str
    required if type is 'subnet' or 'any_subnet'
    order float
    Order of attaching interface
    port_id str
    required if type is 'reservedfixedip'
    subnet_id str
    required if type is 'subnet'
    type str
    Available value is 'subnet', 'anysubnet', 'external', 'reservedfixed_ip'
    name String
    Name of interface, should be unique for the instance
    securityGroups List<String>
    list of security group IDs, they will be attached to exact interface
    existingFipId String
    The id of the existing floating IP that will be attached to the interface
    ipAddress String
    IP address for the interface.
    ipFamily String
    IP family for the interface, available values are 'dual', 'ipv4' and 'ipv6'
    networkId String
    required if type is 'subnet' or 'any_subnet'
    order Number
    Order of attaching interface
    portId String
    required if type is 'reservedfixedip'
    subnetId String
    required if type is 'subnet'
    type String
    Available value is 'subnet', 'anysubnet', 'external', 'reservedfixed_ip'

    Instancev2MetadataReadOnly, Instancev2MetadataReadOnlyArgs

    Key string
    ReadOnly bool
    Value string
    Key string
    ReadOnly bool
    Value string
    key String
    readOnly Boolean
    value String
    key string
    readOnly boolean
    value string
    key str
    read_only bool
    value str
    key String
    readOnly Boolean
    value String

    Instancev2Volume, Instancev2VolumeArgs

    VolumeId string
    AttachmentTag string
    Tag for the volume attachment
    BootIndex double
    If boot_index==0 volumes can not detached
    DeleteOnTermination bool
    Delete volume on termination
    Id string
    ImageId string
    Image ID for the volume
    Name string
    Name of the volume
    Size double
    Size of the volume in GiB
    TypeName string
    Volume type name
    VolumeId string
    AttachmentTag string
    Tag for the volume attachment
    BootIndex float64
    If boot_index==0 volumes can not detached
    DeleteOnTermination bool
    Delete volume on termination
    Id string
    ImageId string
    Image ID for the volume
    Name string
    Name of the volume
    Size float64
    Size of the volume in GiB
    TypeName string
    Volume type name
    volumeId String
    attachmentTag String
    Tag for the volume attachment
    bootIndex Double
    If boot_index==0 volumes can not detached
    deleteOnTermination Boolean
    Delete volume on termination
    id String
    imageId String
    Image ID for the volume
    name String
    Name of the volume
    size Double
    Size of the volume in GiB
    typeName String
    Volume type name
    volumeId string
    attachmentTag string
    Tag for the volume attachment
    bootIndex number
    If boot_index==0 volumes can not detached
    deleteOnTermination boolean
    Delete volume on termination
    id string
    imageId string
    Image ID for the volume
    name string
    Name of the volume
    size number
    Size of the volume in GiB
    typeName string
    Volume type name
    volume_id str
    attachment_tag str
    Tag for the volume attachment
    boot_index float
    If boot_index==0 volumes can not detached
    delete_on_termination bool
    Delete volume on termination
    id str
    image_id str
    Image ID for the volume
    name str
    Name of the volume
    size float
    Size of the volume in GiB
    type_name str
    Volume type name
    volumeId String
    attachmentTag String
    Tag for the volume attachment
    bootIndex Number
    If boot_index==0 volumes can not detached
    deleteOnTermination Boolean
    Delete volume on termination
    id String
    imageId String
    Image ID for the volume
    name String
    Name of the volume
    size Number
    Size of the volume in GiB
    typeName String
    Volume type name

    Import

    import using <project_id>:<region_id>:<instance_id> format

    $ pulumi import gcore:index/instancev2:Instancev2 instance1 1:6:447d2959-8ae0-4ca0-8d47-9f050a3637d7
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    gcore g-core/terraform-provider-gcore
    License
    Notes
    This Pulumi package is based on the gcore Terraform Provider.
    gcore logo
    gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core