1. Packages
  2. Azure Native
  3. API Docs
  4. serialconsole
  5. SerialPort
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.1.0 published on Tuesday, Apr 8, 2025 by Pulumi

azure-native.serialconsole.SerialPort

Explore with Pulumi AI

This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.1.0 published on Tuesday, Apr 8, 2025 by Pulumi

Represents the serial port of the parent resource.

Uses Azure REST API version 2018-05-01. In version 2.x of the Azure Native provider, it used API version 2018-05-01.

Example Usage

Create a new serial port resource.

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var serialPort = new AzureNative.SerialConsole.SerialPort("serialPort", new()
    {
        ParentResource = "myVM",
        ParentResourceType = "virtualMachines",
        ResourceGroupName = "myResourceGroup",
        ResourceProviderNamespace = "Microsoft.Compute",
        SerialPort = "0",
        State = AzureNative.SerialConsole.SerialPortState.Enabled,
    });

});
Copy
package main

import (
	serialconsole "github.com/pulumi/pulumi-azure-native-sdk/serialconsole/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := serialconsole.NewSerialPort(ctx, "serialPort", &serialconsole.SerialPortArgs{
			ParentResource:            pulumi.String("myVM"),
			ParentResourceType:        pulumi.String("virtualMachines"),
			ResourceGroupName:         pulumi.String("myResourceGroup"),
			ResourceProviderNamespace: pulumi.String("Microsoft.Compute"),
			SerialPort:                pulumi.String("0"),
			State:                     serialconsole.SerialPortStateEnabled,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.serialconsole.SerialPort;
import com.pulumi.azurenative.serialconsole.SerialPortArgs;
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 serialPort = new SerialPort("serialPort", SerialPortArgs.builder()
            .parentResource("myVM")
            .parentResourceType("virtualMachines")
            .resourceGroupName("myResourceGroup")
            .resourceProviderNamespace("Microsoft.Compute")
            .serialPort("0")
            .state("enabled")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const serialPort = new azure_native.serialconsole.SerialPort("serialPort", {
    parentResource: "myVM",
    parentResourceType: "virtualMachines",
    resourceGroupName: "myResourceGroup",
    resourceProviderNamespace: "Microsoft.Compute",
    serialPort: "0",
    state: azure_native.serialconsole.SerialPortState.Enabled,
});
Copy
import pulumi
import pulumi_azure_native as azure_native

serial_port = azure_native.serialconsole.SerialPort("serialPort",
    parent_resource="myVM",
    parent_resource_type="virtualMachines",
    resource_group_name="myResourceGroup",
    resource_provider_namespace="Microsoft.Compute",
    serial_port="0",
    state=azure_native.serialconsole.SerialPortState.ENABLED)
Copy
resources:
  serialPort:
    type: azure-native:serialconsole:SerialPort
    properties:
      parentResource: myVM
      parentResourceType: virtualMachines
      resourceGroupName: myResourceGroup
      resourceProviderNamespace: Microsoft.Compute
      serialPort: '0'
      state: enabled
Copy

Create SerialPort Resource

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

Constructor syntax

new SerialPort(name: string, args: SerialPortArgs, opts?: CustomResourceOptions);
@overload
def SerialPort(resource_name: str,
               args: SerialPortArgs,
               opts: Optional[ResourceOptions] = None)

@overload
def SerialPort(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               parent_resource: Optional[str] = None,
               parent_resource_type: Optional[str] = None,
               resource_group_name: Optional[str] = None,
               resource_provider_namespace: Optional[str] = None,
               serial_port: Optional[str] = None,
               state: Optional[SerialPortState] = None)
func NewSerialPort(ctx *Context, name string, args SerialPortArgs, opts ...ResourceOption) (*SerialPort, error)
public SerialPort(string name, SerialPortArgs args, CustomResourceOptions? opts = null)
public SerialPort(String name, SerialPortArgs args)
public SerialPort(String name, SerialPortArgs args, CustomResourceOptions options)
type: azure-native:serialconsole:SerialPort
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. SerialPortArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. SerialPortArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. SerialPortArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. SerialPortArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SerialPortArgs
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 serialPortResource = new AzureNative.SerialConsole.SerialPort("serialPortResource", new()
{
    ParentResource = "string",
    ParentResourceType = "string",
    ResourceGroupName = "string",
    ResourceProviderNamespace = "string",
    SerialPort = "string",
    State = AzureNative.SerialConsole.SerialPortState.Enabled,
});
Copy
example, err := serialconsole.NewSerialPort(ctx, "serialPortResource", &serialconsole.SerialPortArgs{
	ParentResource:            pulumi.String("string"),
	ParentResourceType:        pulumi.String("string"),
	ResourceGroupName:         pulumi.String("string"),
	ResourceProviderNamespace: pulumi.String("string"),
	SerialPort:                pulumi.String("string"),
	State:                     serialconsole.SerialPortStateEnabled,
})
Copy
var serialPortResource = new SerialPort("serialPortResource", SerialPortArgs.builder()
    .parentResource("string")
    .parentResourceType("string")
    .resourceGroupName("string")
    .resourceProviderNamespace("string")
    .serialPort("string")
    .state("enabled")
    .build());
Copy
serial_port_resource = azure_native.serialconsole.SerialPort("serialPortResource",
    parent_resource="string",
    parent_resource_type="string",
    resource_group_name="string",
    resource_provider_namespace="string",
    serial_port="string",
    state=azure_native.serialconsole.SerialPortState.ENABLED)
Copy
const serialPortResource = new azure_native.serialconsole.SerialPort("serialPortResource", {
    parentResource: "string",
    parentResourceType: "string",
    resourceGroupName: "string",
    resourceProviderNamespace: "string",
    serialPort: "string",
    state: azure_native.serialconsole.SerialPortState.Enabled,
});
Copy
type: azure-native:serialconsole:SerialPort
properties:
    parentResource: string
    parentResourceType: string
    resourceGroupName: string
    resourceProviderNamespace: string
    serialPort: string
    state: enabled
Copy

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

ParentResource
This property is required.
Changes to this property will trigger replacement.
string
The resource name, or subordinate path, for the parent of the serial port. For example: the name of the virtual machine.
ParentResourceType
This property is required.
Changes to this property will trigger replacement.
string
The resource type of the parent resource. For example: 'virtualMachines' or 'virtualMachineScaleSets'
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
ResourceProviderNamespace
This property is required.
Changes to this property will trigger replacement.
string
The namespace of the resource provider.
SerialPort Changes to this property will trigger replacement. string
The name of the serial port to create.
State Pulumi.AzureNative.SerialConsole.SerialPortState
Specifies whether the port is enabled for a serial console connection.
ParentResource
This property is required.
Changes to this property will trigger replacement.
string
The resource name, or subordinate path, for the parent of the serial port. For example: the name of the virtual machine.
ParentResourceType
This property is required.
Changes to this property will trigger replacement.
string
The resource type of the parent resource. For example: 'virtualMachines' or 'virtualMachineScaleSets'
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
ResourceProviderNamespace
This property is required.
Changes to this property will trigger replacement.
string
The namespace of the resource provider.
SerialPort Changes to this property will trigger replacement. string
The name of the serial port to create.
State SerialPortStateEnum
Specifies whether the port is enabled for a serial console connection.
parentResource
This property is required.
Changes to this property will trigger replacement.
String
The resource name, or subordinate path, for the parent of the serial port. For example: the name of the virtual machine.
parentResourceType
This property is required.
Changes to this property will trigger replacement.
String
The resource type of the parent resource. For example: 'virtualMachines' or 'virtualMachineScaleSets'
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group.
resourceProviderNamespace
This property is required.
Changes to this property will trigger replacement.
String
The namespace of the resource provider.
serialPort Changes to this property will trigger replacement. String
The name of the serial port to create.
state SerialPortState
Specifies whether the port is enabled for a serial console connection.
parentResource
This property is required.
Changes to this property will trigger replacement.
string
The resource name, or subordinate path, for the parent of the serial port. For example: the name of the virtual machine.
parentResourceType
This property is required.
Changes to this property will trigger replacement.
string
The resource type of the parent resource. For example: 'virtualMachines' or 'virtualMachineScaleSets'
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
resourceProviderNamespace
This property is required.
Changes to this property will trigger replacement.
string
The namespace of the resource provider.
serialPort Changes to this property will trigger replacement. string
The name of the serial port to create.
state SerialPortState
Specifies whether the port is enabled for a serial console connection.
parent_resource
This property is required.
Changes to this property will trigger replacement.
str
The resource name, or subordinate path, for the parent of the serial port. For example: the name of the virtual machine.
parent_resource_type
This property is required.
Changes to this property will trigger replacement.
str
The resource type of the parent resource. For example: 'virtualMachines' or 'virtualMachineScaleSets'
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group.
resource_provider_namespace
This property is required.
Changes to this property will trigger replacement.
str
The namespace of the resource provider.
serial_port Changes to this property will trigger replacement. str
The name of the serial port to create.
state SerialPortState
Specifies whether the port is enabled for a serial console connection.
parentResource
This property is required.
Changes to this property will trigger replacement.
String
The resource name, or subordinate path, for the parent of the serial port. For example: the name of the virtual machine.
parentResourceType
This property is required.
Changes to this property will trigger replacement.
String
The resource type of the parent resource. For example: 'virtualMachines' or 'virtualMachineScaleSets'
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group.
resourceProviderNamespace
This property is required.
Changes to this property will trigger replacement.
String
The namespace of the resource provider.
serialPort Changes to this property will trigger replacement. String
The name of the serial port to create.
state "enabled" | "disabled"
Specifies whether the port is enabled for a serial console connection.

Outputs

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

AzureApiVersion string
The Azure API version of the resource.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Resource name
Type string
Resource type
AzureApiVersion string
The Azure API version of the resource.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Resource name
Type string
Resource type
azureApiVersion String
The Azure API version of the resource.
id String
The provider-assigned unique ID for this managed resource.
name String
Resource name
type String
Resource type
azureApiVersion string
The Azure API version of the resource.
id string
The provider-assigned unique ID for this managed resource.
name string
Resource name
type string
Resource type
azure_api_version str
The Azure API version of the resource.
id str
The provider-assigned unique ID for this managed resource.
name str
Resource name
type str
Resource type
azureApiVersion String
The Azure API version of the resource.
id String
The provider-assigned unique ID for this managed resource.
name String
Resource name
type String
Resource type

Supporting Types

SerialPortState
, SerialPortStateArgs

Enabled
enabled
Disabled
disabled
SerialPortStateEnabled
enabled
SerialPortStateDisabled
disabled
Enabled
enabled
Disabled
disabled
Enabled
enabled
Disabled
disabled
ENABLED
enabled
DISABLED
disabled
"enabled"
enabled
"disabled"
disabled

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:serialconsole:SerialPort 0 /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourceType}/{parentResource}/providers/Microsoft.SerialConsole/serialPorts/{serialPort} 
Copy

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

Package Details

Repository
Azure Native pulumi/pulumi-azure-native
License
Apache-2.0
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.1.0 published on Tuesday, Apr 8, 2025 by Pulumi