1. Packages
  2. Openstack Provider
  3. API Docs
  4. compute
  5. FlavorAccess
OpenStack v5.0.0 published on Friday, Sep 27, 2024 by Pulumi

openstack.compute.FlavorAccess

Explore with Pulumi AI

openstack logo
OpenStack v5.0.0 published on Friday, Sep 27, 2024 by Pulumi

    Manages a project access for flavor V2 resource within OpenStack.

    Note: You must have admin privileges in your OpenStack cloud to use this resource.


    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as openstack from "@pulumi/openstack";
    
    const project1 = new openstack.identity.Project("project_1", {name: "my-project"});
    const flavor1 = new openstack.compute.Flavor("flavor_1", {
        name: "my-flavor",
        ram: 8096,
        vcpus: 2,
        disk: 20,
        isPublic: false,
    });
    const access1 = new openstack.compute.FlavorAccess("access_1", {
        tenantId: project1.id,
        flavorId: flavor1.id,
    });
    
    import pulumi
    import pulumi_openstack as openstack
    
    project1 = openstack.identity.Project("project_1", name="my-project")
    flavor1 = openstack.compute.Flavor("flavor_1",
        name="my-flavor",
        ram=8096,
        vcpus=2,
        disk=20,
        is_public=False)
    access1 = openstack.compute.FlavorAccess("access_1",
        tenant_id=project1.id,
        flavor_id=flavor1.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/compute"
    	"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/identity"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		project1, err := identity.NewProject(ctx, "project_1", &identity.ProjectArgs{
    			Name: pulumi.String("my-project"),
    		})
    		if err != nil {
    			return err
    		}
    		flavor1, err := compute.NewFlavor(ctx, "flavor_1", &compute.FlavorArgs{
    			Name:     pulumi.String("my-flavor"),
    			Ram:      pulumi.Int(8096),
    			Vcpus:    pulumi.Int(2),
    			Disk:     pulumi.Int(20),
    			IsPublic: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewFlavorAccess(ctx, "access_1", &compute.FlavorAccessArgs{
    			TenantId: project1.ID(),
    			FlavorId: flavor1.ID(),
    		})
    		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 project1 = new OpenStack.Identity.Project("project_1", new()
        {
            Name = "my-project",
        });
    
        var flavor1 = new OpenStack.Compute.Flavor("flavor_1", new()
        {
            Name = "my-flavor",
            Ram = 8096,
            Vcpus = 2,
            Disk = 20,
            IsPublic = false,
        });
    
        var access1 = new OpenStack.Compute.FlavorAccess("access_1", new()
        {
            TenantId = project1.Id,
            FlavorId = flavor1.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.openstack.identity.Project;
    import com.pulumi.openstack.identity.ProjectArgs;
    import com.pulumi.openstack.compute.Flavor;
    import com.pulumi.openstack.compute.FlavorArgs;
    import com.pulumi.openstack.compute.FlavorAccess;
    import com.pulumi.openstack.compute.FlavorAccessArgs;
    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 project1 = new Project("project1", ProjectArgs.builder()
                .name("my-project")
                .build());
    
            var flavor1 = new Flavor("flavor1", FlavorArgs.builder()
                .name("my-flavor")
                .ram("8096")
                .vcpus("2")
                .disk("20")
                .isPublic(false)
                .build());
    
            var access1 = new FlavorAccess("access1", FlavorAccessArgs.builder()
                .tenantId(project1.id())
                .flavorId(flavor1.id())
                .build());
    
        }
    }
    
    resources:
      project1:
        type: openstack:identity:Project
        name: project_1
        properties:
          name: my-project
      flavor1:
        type: openstack:compute:Flavor
        name: flavor_1
        properties:
          name: my-flavor
          ram: '8096'
          vcpus: '2'
          disk: '20'
          isPublic: false
      access1:
        type: openstack:compute:FlavorAccess
        name: access_1
        properties:
          tenantId: ${project1.id}
          flavorId: ${flavor1.id}
    

    Create FlavorAccess Resource

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

    Constructor syntax

    new FlavorAccess(name: string, args: FlavorAccessArgs, opts?: CustomResourceOptions);
    @overload
    def FlavorAccess(resource_name: str,
                     args: FlavorAccessArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def FlavorAccess(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     flavor_id: Optional[str] = None,
                     tenant_id: Optional[str] = None,
                     region: Optional[str] = None)
    func NewFlavorAccess(ctx *Context, name string, args FlavorAccessArgs, opts ...ResourceOption) (*FlavorAccess, error)
    public FlavorAccess(string name, FlavorAccessArgs args, CustomResourceOptions? opts = null)
    public FlavorAccess(String name, FlavorAccessArgs args)
    public FlavorAccess(String name, FlavorAccessArgs args, CustomResourceOptions options)
    
    type: openstack:compute:FlavorAccess
    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 FlavorAccessArgs
    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 FlavorAccessArgs
    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 FlavorAccessArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args FlavorAccessArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args FlavorAccessArgs
    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 flavorAccessResource = new OpenStack.Compute.FlavorAccess("flavorAccessResource", new()
    {
        FlavorId = "string",
        TenantId = "string",
        Region = "string",
    });
    
    example, err := compute.NewFlavorAccess(ctx, "flavorAccessResource", &compute.FlavorAccessArgs{
    	FlavorId: pulumi.String("string"),
    	TenantId: pulumi.String("string"),
    	Region:   pulumi.String("string"),
    })
    
    var flavorAccessResource = new FlavorAccess("flavorAccessResource", FlavorAccessArgs.builder()
        .flavorId("string")
        .tenantId("string")
        .region("string")
        .build());
    
    flavor_access_resource = openstack.compute.FlavorAccess("flavorAccessResource",
        flavor_id="string",
        tenant_id="string",
        region="string")
    
    const flavorAccessResource = new openstack.compute.FlavorAccess("flavorAccessResource", {
        flavorId: "string",
        tenantId: "string",
        region: "string",
    });
    
    type: openstack:compute:FlavorAccess
    properties:
        flavorId: string
        region: string
        tenantId: string
    

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

    FlavorId string
    The UUID of flavor to use. Changing this creates a new flavor access.
    TenantId string
    The UUID of tenant which is allowed to use the flavor. Changing this creates a new flavor access.
    Region string
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new flavor access.
    FlavorId string
    The UUID of flavor to use. Changing this creates a new flavor access.
    TenantId string
    The UUID of tenant which is allowed to use the flavor. Changing this creates a new flavor access.
    Region string
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new flavor access.
    flavorId String
    The UUID of flavor to use. Changing this creates a new flavor access.
    tenantId String
    The UUID of tenant which is allowed to use the flavor. Changing this creates a new flavor access.
    region String
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new flavor access.
    flavorId string
    The UUID of flavor to use. Changing this creates a new flavor access.
    tenantId string
    The UUID of tenant which is allowed to use the flavor. Changing this creates a new flavor access.
    region string
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new flavor access.
    flavor_id str
    The UUID of flavor to use. Changing this creates a new flavor access.
    tenant_id str
    The UUID of tenant which is allowed to use the flavor. Changing this creates a new flavor access.
    region str
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new flavor access.
    flavorId String
    The UUID of flavor to use. Changing this creates a new flavor access.
    tenantId String
    The UUID of tenant which is allowed to use the flavor. Changing this creates a new flavor access.
    region String
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new flavor access.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing FlavorAccess Resource

    Get an existing FlavorAccess 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?: FlavorAccessState, opts?: CustomResourceOptions): FlavorAccess
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            flavor_id: Optional[str] = None,
            region: Optional[str] = None,
            tenant_id: Optional[str] = None) -> FlavorAccess
    func GetFlavorAccess(ctx *Context, name string, id IDInput, state *FlavorAccessState, opts ...ResourceOption) (*FlavorAccess, error)
    public static FlavorAccess Get(string name, Input<string> id, FlavorAccessState? state, CustomResourceOptions? opts = null)
    public static FlavorAccess get(String name, Output<String> id, FlavorAccessState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    FlavorId string
    The UUID of flavor to use. Changing this creates a new flavor access.
    Region string
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new flavor access.
    TenantId string
    The UUID of tenant which is allowed to use the flavor. Changing this creates a new flavor access.
    FlavorId string
    The UUID of flavor to use. Changing this creates a new flavor access.
    Region string
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new flavor access.
    TenantId string
    The UUID of tenant which is allowed to use the flavor. Changing this creates a new flavor access.
    flavorId String
    The UUID of flavor to use. Changing this creates a new flavor access.
    region String
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new flavor access.
    tenantId String
    The UUID of tenant which is allowed to use the flavor. Changing this creates a new flavor access.
    flavorId string
    The UUID of flavor to use. Changing this creates a new flavor access.
    region string
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new flavor access.
    tenantId string
    The UUID of tenant which is allowed to use the flavor. Changing this creates a new flavor access.
    flavor_id str
    The UUID of flavor to use. Changing this creates a new flavor access.
    region str
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new flavor access.
    tenant_id str
    The UUID of tenant which is allowed to use the flavor. Changing this creates a new flavor access.
    flavorId String
    The UUID of flavor to use. Changing this creates a new flavor access.
    region String
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used. Changing this creates a new flavor access.
    tenantId String
    The UUID of tenant which is allowed to use the flavor. Changing this creates a new flavor access.

    Import

    This resource can be imported by specifying all two arguments, separated by a forward slash:

    $ pulumi import openstack:compute/flavorAccess:FlavorAccess access_1 flavor_id/tenant_id
    

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

    Package Details

    Repository
    OpenStack pulumi/pulumi-openstack
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the openstack Terraform Provider.
    openstack logo
    OpenStack v5.0.0 published on Friday, Sep 27, 2024 by Pulumi