Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

getOperatingSystem

Use this data source to get Packet Operating System image.

Example Usage

using Pulumi;
using Packet = Pulumi.Packet;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Packet.GetOperatingSystem.InvokeAsync(new Packet.GetOperatingSystemArgs
        {
            Name = "Container Linux",
            Distro = "coreos",
            Version = "alpha",
            ProvisionableOn = "c1.small.x86",
        }));
        var server = new Packet.Device("server", new Packet.DeviceArgs
        {
            Hostname = "tf.coreos2",
            Plan = "c1.small.x86",
            Facilities = 
            {
                "ewr1",
            },
            OperatingSystem = example.Apply(example => example.Id),
            BillingCycle = "hourly",
            ProjectId = local.Project_id,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-packet/sdk/v3/go/packet"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := "Container Linux"
        opt1 := "coreos"
        opt2 := "alpha"
        opt3 := "c1.small.x86"
        example, err := packet.GetOperatingSystem(ctx, &packet.GetOperatingSystemArgs{
            Name:            &opt0,
            Distro:          &opt1,
            Version:         &opt2,
            ProvisionableOn: &opt3,
        }, nil)
        if err != nil {
            return err
        }
        _, err = packet.NewDevice(ctx, "server", &packet.DeviceArgs{
            Hostname: pulumi.String("tf.coreos2"),
            Plan:     pulumi.String("c1.small.x86"),
            Facilities: pulumi.StringArray{
                pulumi.String("ewr1"),
            },
            OperatingSystem: pulumi.String(example.Id),
            BillingCycle:    pulumi.String("hourly"),
            ProjectId:       pulumi.Any(local.Project_id),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_packet as packet

example = packet.get_operating_system(name="Container Linux",
    distro="coreos",
    version="alpha",
    provisionable_on="c1.small.x86")
server = packet.Device("server",
    hostname="tf.coreos2",
    plan="c1.small.x86",
    facilities=["ewr1"],
    operating_system=example.id,
    billing_cycle="hourly",
    project_id=local["project_id"])
import * as pulumi from "@pulumi/pulumi";
import * as packet from "@pulumi/packet";

const example = packet.getOperatingSystem({
    name: "Container Linux",
    distro: "coreos",
    version: "alpha",
    provisionableOn: "c1.small.x86",
});
const server = new packet.Device("server", {
    hostname: "tf.coreos2",
    plan: "c1.small.x86",
    facilities: ["ewr1"],
    operatingSystem: example.then(example => example.id),
    billingCycle: "hourly",
    projectId: local.project_id,
});

Using getOperatingSystem

function getOperatingSystem(args: GetOperatingSystemArgs, opts?: InvokeOptions): Promise<GetOperatingSystemResult>
def get_operating_system(distro: Optional[str] = None, name: Optional[str] = None, provisionable_on: Optional[str] = None, version: Optional[str] = None, opts: Optional[InvokeOptions] = None) -> GetOperatingSystemResult
func GetOperatingSystem(ctx *Context, args *GetOperatingSystemArgs, opts ...InvokeOption) (*GetOperatingSystemResult, error)

Note: This function is named GetOperatingSystem in the Go SDK.

public static class GetOperatingSystem {
    public static Task<GetOperatingSystemResult> InvokeAsync(GetOperatingSystemArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Distro string

Name of the OS distribution.

Name string

Name or part of the name of the distribution. Case insensitive.

ProvisionableOn string

Plan name.

Version string

Version of the distribution

Distro string

Name of the OS distribution.

Name string

Name or part of the name of the distribution. Case insensitive.

ProvisionableOn string

Plan name.

Version string

Version of the distribution

distro string

Name of the OS distribution.

name string

Name or part of the name of the distribution. Case insensitive.

provisionableOn string

Plan name.

version string

Version of the distribution

distro str

Name of the OS distribution.

name str

Name or part of the name of the distribution. Case insensitive.

provisionable_on str

Plan name.

version str

Version of the distribution

getOperatingSystem Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Slug string

Operating system slug (same as id)

Distro string
Name string
ProvisionableOn string
Version string
Id string

The provider-assigned unique ID for this managed resource.

Slug string

Operating system slug (same as id)

Distro string
Name string
ProvisionableOn string
Version string
id string

The provider-assigned unique ID for this managed resource.

slug string

Operating system slug (same as id)

distro string
name string
provisionableOn string
version string
id str

The provider-assigned unique ID for this managed resource.

slug str

Operating system slug (same as id)

distro str
name str
provisionable_on str
version str

Package Details

Repository
https://github.com/pulumi/pulumi-packet
License
Apache-2.0
Notes
This Pulumi package is based on the packet Terraform Provider.