OpenStack v5.0.3 published on Wednesday, Feb 12, 2025 by Pulumi
openstack.compute.getFlavor
Explore with Pulumi AI
Use this data source to get the ID of an available OpenStack flavor.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const small = openstack.compute.getFlavor({
vcpus: 1,
ram: 512,
});
import pulumi
import pulumi_openstack as openstack
small = openstack.compute.get_flavor(vcpus=1,
ram=512)
package main
import (
"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.LookupFlavor(ctx, &compute.LookupFlavorArgs{
Vcpus: pulumi.IntRef(1),
Ram: pulumi.IntRef(512),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using OpenStack = Pulumi.OpenStack;
return await Deployment.RunAsync(() =>
{
var small = OpenStack.Compute.GetFlavor.Invoke(new()
{
Vcpus = 1,
Ram = 512,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openstack.compute.ComputeFunctions;
import com.pulumi.openstack.compute.inputs.GetFlavorArgs;
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 small = ComputeFunctions.getFlavor(GetFlavorArgs.builder()
.vcpus(1)
.ram(512)
.build());
}
}
variables:
small:
fn::invoke:
function: openstack:compute:getFlavor
arguments:
vcpus: 1
ram: 512
Using getFlavor
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getFlavor(args: GetFlavorArgs, opts?: InvokeOptions): Promise<GetFlavorResult>
function getFlavorOutput(args: GetFlavorOutputArgs, opts?: InvokeOptions): Output<GetFlavorResult>
def get_flavor(description: Optional[str] = None,
disk: Optional[int] = None,
flavor_id: Optional[str] = None,
is_public: Optional[bool] = None,
min_disk: Optional[int] = None,
min_ram: Optional[int] = None,
name: Optional[str] = None,
ram: Optional[int] = None,
region: Optional[str] = None,
rx_tx_factor: Optional[float] = None,
swap: Optional[int] = None,
vcpus: Optional[int] = None,
opts: Optional[InvokeOptions] = None) -> GetFlavorResult
def get_flavor_output(description: Optional[pulumi.Input[str]] = None,
disk: Optional[pulumi.Input[int]] = None,
flavor_id: Optional[pulumi.Input[str]] = None,
is_public: Optional[pulumi.Input[bool]] = None,
min_disk: Optional[pulumi.Input[int]] = None,
min_ram: Optional[pulumi.Input[int]] = None,
name: Optional[pulumi.Input[str]] = None,
ram: Optional[pulumi.Input[int]] = None,
region: Optional[pulumi.Input[str]] = None,
rx_tx_factor: Optional[pulumi.Input[float]] = None,
swap: Optional[pulumi.Input[int]] = None,
vcpus: Optional[pulumi.Input[int]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetFlavorResult]
func LookupFlavor(ctx *Context, args *LookupFlavorArgs, opts ...InvokeOption) (*LookupFlavorResult, error)
func LookupFlavorOutput(ctx *Context, args *LookupFlavorOutputArgs, opts ...InvokeOption) LookupFlavorResultOutput
> Note: This function is named LookupFlavor
in the Go SDK.
public static class GetFlavor
{
public static Task<GetFlavorResult> InvokeAsync(GetFlavorArgs args, InvokeOptions? opts = null)
public static Output<GetFlavorResult> Invoke(GetFlavorInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetFlavorResult> getFlavor(GetFlavorArgs args, InvokeOptions options)
public static Output<GetFlavorResult> getFlavor(GetFlavorArgs args, InvokeOptions options)
fn::invoke:
function: openstack:compute/getFlavor:getFlavor
arguments:
# arguments dictionary
The following arguments are supported:
- Description
Changes to this property will trigger replacement.
- The description of the flavor.
- Disk
Changes to this property will trigger replacement.
- The exact amount of disk (in gigabytes).
- Flavor
Id Changes to this property will trigger replacement.
- The ID of the flavor. Conflicts with the
name
,min_ram
andmin_disk
- Is
Public Changes to this property will trigger replacement.
- The flavor visibility.
- Min
Disk Changes to this property will trigger replacement.
- The minimum amount of disk (in gigabytes). Conflicts
with the
flavor_id
. - Min
Ram Changes to this property will trigger replacement.
- The minimum amount of RAM (in megabytes). Conflicts
with the
flavor_id
. - Name
Changes to this property will trigger replacement.
- The name of the flavor. Conflicts with the
flavor_id
. - Ram
Changes to this property will trigger replacement.
- The exact amount of RAM (in megabytes).
- Region
Changes to this property will trigger replacement.
- The region in which to obtain the V2 Compute client.
If omitted, the
region
argument of the provider is used. - Rx
Tx Factor Changes to this property will trigger replacement.
- The
rx_tx_factor
of the flavor. - Swap
Changes to this property will trigger replacement.
- The amount of swap (in gigabytes).
- Vcpus
Changes to this property will trigger replacement.
- The amount of VCPUs.
- Description
Changes to this property will trigger replacement.
- The description of the flavor.
- Disk
Changes to this property will trigger replacement.
- The exact amount of disk (in gigabytes).
- Flavor
Id Changes to this property will trigger replacement.
- The ID of the flavor. Conflicts with the
name
,min_ram
andmin_disk
- Is
Public Changes to this property will trigger replacement.
- The flavor visibility.
- Min
Disk Changes to this property will trigger replacement.
- The minimum amount of disk (in gigabytes). Conflicts
with the
flavor_id
. - Min
Ram Changes to this property will trigger replacement.
- The minimum amount of RAM (in megabytes). Conflicts
with the
flavor_id
. - Name
Changes to this property will trigger replacement.
- The name of the flavor. Conflicts with the
flavor_id
. - Ram
Changes to this property will trigger replacement.
- The exact amount of RAM (in megabytes).
- Region
Changes to this property will trigger replacement.
- The region in which to obtain the V2 Compute client.
If omitted, the
region
argument of the provider is used. - Rx
Tx Factor Changes to this property will trigger replacement.
- The
rx_tx_factor
of the flavor. - Swap
Changes to this property will trigger replacement.
- The amount of swap (in gigabytes).
- Vcpus
Changes to this property will trigger replacement.
- The amount of VCPUs.
- description
Changes to this property will trigger replacement.
- The description of the flavor.
- disk
Changes to this property will trigger replacement.
- The exact amount of disk (in gigabytes).
- flavor
Id Changes to this property will trigger replacement.
- The ID of the flavor. Conflicts with the
name
,min_ram
andmin_disk
- is
Public Changes to this property will trigger replacement.
- The flavor visibility.
- min
Disk Changes to this property will trigger replacement.
- The minimum amount of disk (in gigabytes). Conflicts
with the
flavor_id
. - min
Ram Changes to this property will trigger replacement.
- The minimum amount of RAM (in megabytes). Conflicts
with the
flavor_id
. - name
Changes to this property will trigger replacement.
- The name of the flavor. Conflicts with the
flavor_id
. - ram
Changes to this property will trigger replacement.
- The exact amount of RAM (in megabytes).
- region
Changes to this property will trigger replacement.
- The region in which to obtain the V2 Compute client.
If omitted, the
region
argument of the provider is used. - rx
Tx Factor Changes to this property will trigger replacement.
- The
rx_tx_factor
of the flavor. - swap
Changes to this property will trigger replacement.
- The amount of swap (in gigabytes).
- vcpus
Changes to this property will trigger replacement.
- The amount of VCPUs.
- description
Changes to this property will trigger replacement.
- The description of the flavor.
- disk
Changes to this property will trigger replacement.
- The exact amount of disk (in gigabytes).
- flavor
Id Changes to this property will trigger replacement.
- The ID of the flavor. Conflicts with the
name
,min_ram
andmin_disk
- is
Public Changes to this property will trigger replacement.
- The flavor visibility.
- min
Disk Changes to this property will trigger replacement.
- The minimum amount of disk (in gigabytes). Conflicts
with the
flavor_id
. - min
Ram Changes to this property will trigger replacement.
- The minimum amount of RAM (in megabytes). Conflicts
with the
flavor_id
. - name
Changes to this property will trigger replacement.
- The name of the flavor. Conflicts with the
flavor_id
. - ram
Changes to this property will trigger replacement.
- The exact amount of RAM (in megabytes).
- region
Changes to this property will trigger replacement.
- The region in which to obtain the V2 Compute client.
If omitted, the
region
argument of the provider is used. - rx
Tx Factor Changes to this property will trigger replacement.
- The
rx_tx_factor
of the flavor. - swap
Changes to this property will trigger replacement.
- The amount of swap (in gigabytes).
- vcpus
Changes to this property will trigger replacement.
- The amount of VCPUs.
- description
Changes to this property will trigger replacement.
- The description of the flavor.
- disk
Changes to this property will trigger replacement.
- The exact amount of disk (in gigabytes).
- flavor_
id Changes to this property will trigger replacement.
- The ID of the flavor. Conflicts with the
name
,min_ram
andmin_disk
- is_
public Changes to this property will trigger replacement.
- The flavor visibility.
- min_
disk Changes to this property will trigger replacement.
- The minimum amount of disk (in gigabytes). Conflicts
with the
flavor_id
. - min_
ram Changes to this property will trigger replacement.
- The minimum amount of RAM (in megabytes). Conflicts
with the
flavor_id
. - name
Changes to this property will trigger replacement.
- The name of the flavor. Conflicts with the
flavor_id
. - ram
Changes to this property will trigger replacement.
- The exact amount of RAM (in megabytes).
- region
Changes to this property will trigger replacement.
- The region in which to obtain the V2 Compute client.
If omitted, the
region
argument of the provider is used. - rx_
tx_ factor Changes to this property will trigger replacement.
- The
rx_tx_factor
of the flavor. - swap
Changes to this property will trigger replacement.
- The amount of swap (in gigabytes).
- vcpus
Changes to this property will trigger replacement.
- The amount of VCPUs.
- description
Changes to this property will trigger replacement.
- The description of the flavor.
- disk
Changes to this property will trigger replacement.
- The exact amount of disk (in gigabytes).
- flavor
Id Changes to this property will trigger replacement.
- The ID of the flavor. Conflicts with the
name
,min_ram
andmin_disk
- is
Public Changes to this property will trigger replacement.
- The flavor visibility.
- min
Disk Changes to this property will trigger replacement.
- The minimum amount of disk (in gigabytes). Conflicts
with the
flavor_id
. - min
Ram Changes to this property will trigger replacement.
- The minimum amount of RAM (in megabytes). Conflicts
with the
flavor_id
. - name
Changes to this property will trigger replacement.
- The name of the flavor. Conflicts with the
flavor_id
. - ram
Changes to this property will trigger replacement.
- The exact amount of RAM (in megabytes).
- region
Changes to this property will trigger replacement.
- The region in which to obtain the V2 Compute client.
If omitted, the
region
argument of the provider is used. - rx
Tx Factor Changes to this property will trigger replacement.
- The
rx_tx_factor
of the flavor. - swap
Changes to this property will trigger replacement.
- The amount of swap (in gigabytes).
- vcpus
Changes to this property will trigger replacement.
- The amount of VCPUs.
getFlavor Result
The following output properties are available:
- Extra
Specs Dictionary<string, string> - Key/Value pairs of metadata for the flavor.
- Id string
- The provider-assigned unique ID for this managed resource.
- Region string
- Description string
- Disk int
- Flavor
Id string - Is
Public bool - Min
Disk int - Min
Ram int - Name string
- Ram int
- Rx
Tx doubleFactor - Swap int
- Vcpus int
- Extra
Specs map[string]string - Key/Value pairs of metadata for the flavor.
- Id string
- The provider-assigned unique ID for this managed resource.
- Region string
- Description string
- Disk int
- Flavor
Id string - Is
Public bool - Min
Disk int - Min
Ram int - Name string
- Ram int
- Rx
Tx float64Factor - Swap int
- Vcpus int
- extra
Specs Map<String,String> - Key/Value pairs of metadata for the flavor.
- id String
- The provider-assigned unique ID for this managed resource.
- region String
- description String
- disk Integer
- flavor
Id String - is
Public Boolean - min
Disk Integer - min
Ram Integer - name String
- ram Integer
- rx
Tx DoubleFactor - swap Integer
- vcpus Integer
- extra
Specs {[key: string]: string} - Key/Value pairs of metadata for the flavor.
- id string
- The provider-assigned unique ID for this managed resource.
- region string
- description string
- disk number
- flavor
Id string - is
Public boolean - min
Disk number - min
Ram number - name string
- ram number
- rx
Tx numberFactor - swap number
- vcpus number
- extra_
specs Mapping[str, str] - Key/Value pairs of metadata for the flavor.
- id str
- The provider-assigned unique ID for this managed resource.
- region str
- description str
- disk int
- flavor_
id str - is_
public bool - min_
disk int - min_
ram int - name str
- ram int
- rx_
tx_ floatfactor - swap int
- vcpus int
- extra
Specs Map<String> - Key/Value pairs of metadata for the flavor.
- id String
- The provider-assigned unique ID for this managed resource.
- region String
- description String
- disk Number
- flavor
Id String - is
Public Boolean - min
Disk Number - min
Ram Number - name String
- ram Number
- rx
Tx NumberFactor - swap Number
- vcpus Number
Package Details
- Repository
- OpenStack pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
openstack
Terraform Provider.