openstack.compute.FlavorAccess
Explore with Pulumi AI
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
using System.Collections.Generic;
using Pulumi;
using OpenStack = Pulumi.OpenStack;
return await Deployment.RunAsync(() =>
{
var project1 = new OpenStack.Identity.Project("project1");
var flavor1 = new OpenStack.Compute.Flavor("flavor1", new()
{
Disk = 20,
IsPublic = false,
Ram = 8096,
Vcpus = 2,
});
var access1 = new OpenStack.Compute.FlavorAccess("access1", new()
{
FlavorId = flavor1.Id,
TenantId = project1.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/compute"
"github.com/pulumi/pulumi-openstack/sdk/v3/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, "project1", nil)
if err != nil {
return err
}
flavor1, err := compute.NewFlavor(ctx, "flavor1", &compute.FlavorArgs{
Disk: pulumi.Int(20),
IsPublic: pulumi.Bool(false),
Ram: pulumi.Int(8096),
Vcpus: pulumi.Int(2),
})
if err != nil {
return err
}
_, err = compute.NewFlavorAccess(ctx, "access1", &compute.FlavorAccessArgs{
FlavorId: flavor1.ID(),
TenantId: project1.ID(),
})
if err != nil {
return err
}
return nil
})
}
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.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");
var flavor1 = new Flavor("flavor1", FlavorArgs.builder()
.disk("20")
.isPublic(false)
.ram("8096")
.vcpus("2")
.build());
var access1 = new FlavorAccess("access1", FlavorAccessArgs.builder()
.flavorId(flavor1.id())
.tenantId(project1.id())
.build());
}
}
import pulumi
import pulumi_openstack as openstack
project1 = openstack.identity.Project("project1")
flavor1 = openstack.compute.Flavor("flavor1",
disk=20,
is_public=False,
ram=8096,
vcpus=2)
access1 = openstack.compute.FlavorAccess("access1",
flavor_id=flavor1.id,
tenant_id=project1.id)
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const project1 = new openstack.identity.Project("project1", {});
const flavor1 = new openstack.compute.Flavor("flavor1", {
disk: 20,
isPublic: false,
ram: 8096,
vcpus: 2,
});
const access1 = new openstack.compute.FlavorAccess("access1", {
flavorId: flavor1.id,
tenantId: project1.id,
});
resources:
project1:
type: openstack:identity:Project
flavor1:
type: openstack:compute:Flavor
properties:
disk: '20'
isPublic: false
ram: '8096'
vcpus: '2'
access1:
type: openstack:compute:FlavorAccess
properties:
flavorId: ${flavor1.id}
tenantId: ${project1.id}
Create FlavorAccess Resource
new FlavorAccess(name: string, args: FlavorAccessArgs, opts?: CustomResourceOptions);
@overload
def FlavorAccess(resource_name: str,
opts: Optional[ResourceOptions] = None,
flavor_id: Optional[str] = None,
region: Optional[str] = None,
tenant_id: Optional[str] = None)
@overload
def FlavorAccess(resource_name: str,
args: FlavorAccessArgs,
opts: Optional[ResourceOptions] = 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.
- 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.
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
The FlavorAccess resource accepts the following input properties:
- Flavor
Id string The UUID of flavor to use. Changing this creates a new flavor access.
- Tenant
Id 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 string The UUID of flavor to use. Changing this creates a new flavor access.
- Tenant
Id 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 String The UUID of flavor to use. Changing this creates a new flavor access.
- tenant
Id 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 string The UUID of flavor to use. Changing this creates a new flavor access.
- tenant
Id 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.
- flavor
Id String The UUID of flavor to use. Changing this creates a new flavor access.
- tenant
Id 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.
- Flavor
Id 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.- Tenant
Id string The UUID of tenant which is allowed to use the flavor. Changing this creates a new flavor access.
- Flavor
Id 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.- Tenant
Id string The UUID of tenant which is allowed to use the flavor. Changing this creates a new flavor access.
- flavor
Id 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.- tenant
Id String The UUID of tenant which is allowed to use the flavor. Changing this creates a new flavor access.
- flavor
Id 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.- tenant
Id 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.
- flavor
Id 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.- tenant
Id 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>
Package Details
- Repository
- OpenStack pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
openstack
Terraform Provider.