1. Packages
  2. Openstack Provider
  3. API Docs
  4. images
  5. ImageAccess
OpenStack v5.0.3 published on Wednesday, Feb 12, 2025 by Pulumi

openstack.images.ImageAccess

Explore with Pulumi AI

Manages members for the shared OpenStack Glance V2 Image within the source project, which owns the Image.

Example Usage

Unprivileged user

Create a shared image and propose a membership to the bed6b6cbb86a4e2d8dc2735c2f1000e4 project ID.

import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const rancheros = new openstack.images.Image("rancheros", {
    name: "RancherOS",
    imageSourceUrl: "https://releases.rancher.com/os/latest/rancheros-openstack.img",
    containerFormat: "bare",
    diskFormat: "qcow2",
    visibility: "shared",
    properties: {
        key: "value",
    },
});
const rancherosMember = new openstack.images.ImageAccess("rancheros_member", {
    imageId: rancheros.id,
    memberId: "bed6b6cbb86a4e2d8dc2735c2f1000e4",
});
Copy
import pulumi
import pulumi_openstack as openstack

rancheros = openstack.images.Image("rancheros",
    name="RancherOS",
    image_source_url="https://releases.rancher.com/os/latest/rancheros-openstack.img",
    container_format="bare",
    disk_format="qcow2",
    visibility="shared",
    properties={
        "key": "value",
    })
rancheros_member = openstack.images.ImageAccess("rancheros_member",
    image_id=rancheros.id,
    member_id="bed6b6cbb86a4e2d8dc2735c2f1000e4")
Copy
package main

import (
	"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/images"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		rancheros, err := images.NewImage(ctx, "rancheros", &images.ImageArgs{
			Name:            pulumi.String("RancherOS"),
			ImageSourceUrl:  pulumi.String("https://releases.rancher.com/os/latest/rancheros-openstack.img"),
			ContainerFormat: pulumi.String("bare"),
			DiskFormat:      pulumi.String("qcow2"),
			Visibility:      pulumi.String("shared"),
			Properties: pulumi.StringMap{
				"key": pulumi.String("value"),
			},
		})
		if err != nil {
			return err
		}
		_, err = images.NewImageAccess(ctx, "rancheros_member", &images.ImageAccessArgs{
			ImageId:  rancheros.ID(),
			MemberId: pulumi.String("bed6b6cbb86a4e2d8dc2735c2f1000e4"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using OpenStack = Pulumi.OpenStack;

return await Deployment.RunAsync(() => 
{
    var rancheros = new OpenStack.Images.Image("rancheros", new()
    {
        Name = "RancherOS",
        ImageSourceUrl = "https://releases.rancher.com/os/latest/rancheros-openstack.img",
        ContainerFormat = "bare",
        DiskFormat = "qcow2",
        Visibility = "shared",
        Properties = 
        {
            { "key", "value" },
        },
    });

    var rancherosMember = new OpenStack.Images.ImageAccess("rancheros_member", new()
    {
        ImageId = rancheros.Id,
        MemberId = "bed6b6cbb86a4e2d8dc2735c2f1000e4",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openstack.images.Image;
import com.pulumi.openstack.images.ImageArgs;
import com.pulumi.openstack.images.ImageAccess;
import com.pulumi.openstack.images.ImageAccessArgs;
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 rancheros = new Image("rancheros", ImageArgs.builder()
            .name("RancherOS")
            .imageSourceUrl("https://releases.rancher.com/os/latest/rancheros-openstack.img")
            .containerFormat("bare")
            .diskFormat("qcow2")
            .visibility("shared")
            .properties(Map.of("key", "value"))
            .build());

        var rancherosMember = new ImageAccess("rancherosMember", ImageAccessArgs.builder()
            .imageId(rancheros.id())
            .memberId("bed6b6cbb86a4e2d8dc2735c2f1000e4")
            .build());

    }
}
Copy
resources:
  rancheros:
    type: openstack:images:Image
    properties:
      name: RancherOS
      imageSourceUrl: https://releases.rancher.com/os/latest/rancheros-openstack.img
      containerFormat: bare
      diskFormat: qcow2
      visibility: shared
      properties:
        key: value
  rancherosMember:
    type: openstack:images:ImageAccess
    name: rancheros_member
    properties:
      imageId: ${rancheros.id}
      memberId: bed6b6cbb86a4e2d8dc2735c2f1000e4
Copy

Privileged user

Create a shared image and set a membership to the bed6b6cbb86a4e2d8dc2735c2f1000e4 project ID.

import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const rancheros = new openstack.images.Image("rancheros", {
    name: "RancherOS",
    imageSourceUrl: "https://releases.rancher.com/os/latest/rancheros-openstack.img",
    containerFormat: "bare",
    diskFormat: "qcow2",
    visibility: "shared",
    properties: {
        key: "value",
    },
});
const rancherosMember = new openstack.images.ImageAccess("rancheros_member", {
    imageId: rancheros.id,
    memberId: "bed6b6cbb86a4e2d8dc2735c2f1000e4",
    status: "accepted",
});
Copy
import pulumi
import pulumi_openstack as openstack

rancheros = openstack.images.Image("rancheros",
    name="RancherOS",
    image_source_url="https://releases.rancher.com/os/latest/rancheros-openstack.img",
    container_format="bare",
    disk_format="qcow2",
    visibility="shared",
    properties={
        "key": "value",
    })
rancheros_member = openstack.images.ImageAccess("rancheros_member",
    image_id=rancheros.id,
    member_id="bed6b6cbb86a4e2d8dc2735c2f1000e4",
    status="accepted")
Copy
package main

import (
	"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/images"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		rancheros, err := images.NewImage(ctx, "rancheros", &images.ImageArgs{
			Name:            pulumi.String("RancherOS"),
			ImageSourceUrl:  pulumi.String("https://releases.rancher.com/os/latest/rancheros-openstack.img"),
			ContainerFormat: pulumi.String("bare"),
			DiskFormat:      pulumi.String("qcow2"),
			Visibility:      pulumi.String("shared"),
			Properties: pulumi.StringMap{
				"key": pulumi.String("value"),
			},
		})
		if err != nil {
			return err
		}
		_, err = images.NewImageAccess(ctx, "rancheros_member", &images.ImageAccessArgs{
			ImageId:  rancheros.ID(),
			MemberId: pulumi.String("bed6b6cbb86a4e2d8dc2735c2f1000e4"),
			Status:   pulumi.String("accepted"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using OpenStack = Pulumi.OpenStack;

return await Deployment.RunAsync(() => 
{
    var rancheros = new OpenStack.Images.Image("rancheros", new()
    {
        Name = "RancherOS",
        ImageSourceUrl = "https://releases.rancher.com/os/latest/rancheros-openstack.img",
        ContainerFormat = "bare",
        DiskFormat = "qcow2",
        Visibility = "shared",
        Properties = 
        {
            { "key", "value" },
        },
    });

    var rancherosMember = new OpenStack.Images.ImageAccess("rancheros_member", new()
    {
        ImageId = rancheros.Id,
        MemberId = "bed6b6cbb86a4e2d8dc2735c2f1000e4",
        Status = "accepted",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openstack.images.Image;
import com.pulumi.openstack.images.ImageArgs;
import com.pulumi.openstack.images.ImageAccess;
import com.pulumi.openstack.images.ImageAccessArgs;
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 rancheros = new Image("rancheros", ImageArgs.builder()
            .name("RancherOS")
            .imageSourceUrl("https://releases.rancher.com/os/latest/rancheros-openstack.img")
            .containerFormat("bare")
            .diskFormat("qcow2")
            .visibility("shared")
            .properties(Map.of("key", "value"))
            .build());

        var rancherosMember = new ImageAccess("rancherosMember", ImageAccessArgs.builder()
            .imageId(rancheros.id())
            .memberId("bed6b6cbb86a4e2d8dc2735c2f1000e4")
            .status("accepted")
            .build());

    }
}
Copy
resources:
  rancheros:
    type: openstack:images:Image
    properties:
      name: RancherOS
      imageSourceUrl: https://releases.rancher.com/os/latest/rancheros-openstack.img
      containerFormat: bare
      diskFormat: qcow2
      visibility: shared
      properties:
        key: value
  rancherosMember:
    type: openstack:images:ImageAccess
    name: rancheros_member
    properties:
      imageId: ${rancheros.id}
      memberId: bed6b6cbb86a4e2d8dc2735c2f1000e4
      status: accepted
Copy

Create ImageAccess Resource

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

Constructor syntax

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

@overload
def ImageAccess(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                image_id: Optional[str] = None,
                member_id: Optional[str] = None,
                region: Optional[str] = None,
                status: Optional[str] = None)
func NewImageAccess(ctx *Context, name string, args ImageAccessArgs, opts ...ResourceOption) (*ImageAccess, error)
public ImageAccess(string name, ImageAccessArgs args, CustomResourceOptions? opts = null)
public ImageAccess(String name, ImageAccessArgs args)
public ImageAccess(String name, ImageAccessArgs args, CustomResourceOptions options)
type: openstack:images:ImageAccess
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. ImageAccessArgs
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. ImageAccessArgs
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. ImageAccessArgs
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. ImageAccessArgs
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. ImageAccessArgs
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 imageAccessResource = new OpenStack.Images.ImageAccess("imageAccessResource", new()
{
    ImageId = "string",
    MemberId = "string",
    Region = "string",
    Status = "string",
});
Copy
example, err := images.NewImageAccess(ctx, "imageAccessResource", &images.ImageAccessArgs{
	ImageId:  pulumi.String("string"),
	MemberId: pulumi.String("string"),
	Region:   pulumi.String("string"),
	Status:   pulumi.String("string"),
})
Copy
var imageAccessResource = new ImageAccess("imageAccessResource", ImageAccessArgs.builder()
    .imageId("string")
    .memberId("string")
    .region("string")
    .status("string")
    .build());
Copy
image_access_resource = openstack.images.ImageAccess("imageAccessResource",
    image_id="string",
    member_id="string",
    region="string",
    status="string")
Copy
const imageAccessResource = new openstack.images.ImageAccess("imageAccessResource", {
    imageId: "string",
    memberId: "string",
    region: "string",
    status: "string",
});
Copy
type: openstack:images:ImageAccess
properties:
    imageId: string
    memberId: string
    region: string
    status: string
Copy

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

ImageId
This property is required.
Changes to this property will trigger replacement.
string
The image ID.
MemberId
This property is required.
Changes to this property will trigger replacement.
string
The member ID, e.g. the target project ID.
Region Changes to this property will trigger replacement. string
The region in which to obtain the V2 Glance client. A Glance client is needed to manage Image members. If omitted, the region argument of the provider is used. Changing this creates a new resource.
Status string
The member proposal status. Optional if admin wants to force the member proposal acceptance. Can either be accepted, rejected or pending. Defaults to pending. Foridden for non-admin users.
ImageId
This property is required.
Changes to this property will trigger replacement.
string
The image ID.
MemberId
This property is required.
Changes to this property will trigger replacement.
string
The member ID, e.g. the target project ID.
Region Changes to this property will trigger replacement. string
The region in which to obtain the V2 Glance client. A Glance client is needed to manage Image members. If omitted, the region argument of the provider is used. Changing this creates a new resource.
Status string
The member proposal status. Optional if admin wants to force the member proposal acceptance. Can either be accepted, rejected or pending. Defaults to pending. Foridden for non-admin users.
imageId
This property is required.
Changes to this property will trigger replacement.
String
The image ID.
memberId
This property is required.
Changes to this property will trigger replacement.
String
The member ID, e.g. the target project ID.
region Changes to this property will trigger replacement. String
The region in which to obtain the V2 Glance client. A Glance client is needed to manage Image members. If omitted, the region argument of the provider is used. Changing this creates a new resource.
status String
The member proposal status. Optional if admin wants to force the member proposal acceptance. Can either be accepted, rejected or pending. Defaults to pending. Foridden for non-admin users.
imageId
This property is required.
Changes to this property will trigger replacement.
string
The image ID.
memberId
This property is required.
Changes to this property will trigger replacement.
string
The member ID, e.g. the target project ID.
region Changes to this property will trigger replacement. string
The region in which to obtain the V2 Glance client. A Glance client is needed to manage Image members. If omitted, the region argument of the provider is used. Changing this creates a new resource.
status string
The member proposal status. Optional if admin wants to force the member proposal acceptance. Can either be accepted, rejected or pending. Defaults to pending. Foridden for non-admin users.
image_id
This property is required.
Changes to this property will trigger replacement.
str
The image ID.
member_id
This property is required.
Changes to this property will trigger replacement.
str
The member ID, e.g. the target project ID.
region Changes to this property will trigger replacement. str
The region in which to obtain the V2 Glance client. A Glance client is needed to manage Image members. If omitted, the region argument of the provider is used. Changing this creates a new resource.
status str
The member proposal status. Optional if admin wants to force the member proposal acceptance. Can either be accepted, rejected or pending. Defaults to pending. Foridden for non-admin users.
imageId
This property is required.
Changes to this property will trigger replacement.
String
The image ID.
memberId
This property is required.
Changes to this property will trigger replacement.
String
The member ID, e.g. the target project ID.
region Changes to this property will trigger replacement. String
The region in which to obtain the V2 Glance client. A Glance client is needed to manage Image members. If omitted, the region argument of the provider is used. Changing this creates a new resource.
status String
The member proposal status. Optional if admin wants to force the member proposal acceptance. Can either be accepted, rejected or pending. Defaults to pending. Foridden for non-admin users.

Outputs

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

CreatedAt string
The date the image access was created.
Id string
The provider-assigned unique ID for this managed resource.
Schema string
The member schema.
UpdatedAt string
The date the image access was last updated.
CreatedAt string
The date the image access was created.
Id string
The provider-assigned unique ID for this managed resource.
Schema string
The member schema.
UpdatedAt string
The date the image access was last updated.
createdAt String
The date the image access was created.
id String
The provider-assigned unique ID for this managed resource.
schema String
The member schema.
updatedAt String
The date the image access was last updated.
createdAt string
The date the image access was created.
id string
The provider-assigned unique ID for this managed resource.
schema string
The member schema.
updatedAt string
The date the image access was last updated.
created_at str
The date the image access was created.
id str
The provider-assigned unique ID for this managed resource.
schema str
The member schema.
updated_at str
The date the image access was last updated.
createdAt String
The date the image access was created.
id String
The provider-assigned unique ID for this managed resource.
schema String
The member schema.
updatedAt String
The date the image access was last updated.

Look up Existing ImageAccess Resource

Get an existing ImageAccess 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?: ImageAccessState, opts?: CustomResourceOptions): ImageAccess
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        image_id: Optional[str] = None,
        member_id: Optional[str] = None,
        region: Optional[str] = None,
        schema: Optional[str] = None,
        status: Optional[str] = None,
        updated_at: Optional[str] = None) -> ImageAccess
func GetImageAccess(ctx *Context, name string, id IDInput, state *ImageAccessState, opts ...ResourceOption) (*ImageAccess, error)
public static ImageAccess Get(string name, Input<string> id, ImageAccessState? state, CustomResourceOptions? opts = null)
public static ImageAccess get(String name, Output<String> id, ImageAccessState state, CustomResourceOptions options)
resources:  _:    type: openstack:images:ImageAccess    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
CreatedAt string
The date the image access was created.
ImageId Changes to this property will trigger replacement. string
The image ID.
MemberId Changes to this property will trigger replacement. string
The member ID, e.g. the target project ID.
Region Changes to this property will trigger replacement. string
The region in which to obtain the V2 Glance client. A Glance client is needed to manage Image members. If omitted, the region argument of the provider is used. Changing this creates a new resource.
Schema string
The member schema.
Status string
The member proposal status. Optional if admin wants to force the member proposal acceptance. Can either be accepted, rejected or pending. Defaults to pending. Foridden for non-admin users.
UpdatedAt string
The date the image access was last updated.
CreatedAt string
The date the image access was created.
ImageId Changes to this property will trigger replacement. string
The image ID.
MemberId Changes to this property will trigger replacement. string
The member ID, e.g. the target project ID.
Region Changes to this property will trigger replacement. string
The region in which to obtain the V2 Glance client. A Glance client is needed to manage Image members. If omitted, the region argument of the provider is used. Changing this creates a new resource.
Schema string
The member schema.
Status string
The member proposal status. Optional if admin wants to force the member proposal acceptance. Can either be accepted, rejected or pending. Defaults to pending. Foridden for non-admin users.
UpdatedAt string
The date the image access was last updated.
createdAt String
The date the image access was created.
imageId Changes to this property will trigger replacement. String
The image ID.
memberId Changes to this property will trigger replacement. String
The member ID, e.g. the target project ID.
region Changes to this property will trigger replacement. String
The region in which to obtain the V2 Glance client. A Glance client is needed to manage Image members. If omitted, the region argument of the provider is used. Changing this creates a new resource.
schema String
The member schema.
status String
The member proposal status. Optional if admin wants to force the member proposal acceptance. Can either be accepted, rejected or pending. Defaults to pending. Foridden for non-admin users.
updatedAt String
The date the image access was last updated.
createdAt string
The date the image access was created.
imageId Changes to this property will trigger replacement. string
The image ID.
memberId Changes to this property will trigger replacement. string
The member ID, e.g. the target project ID.
region Changes to this property will trigger replacement. string
The region in which to obtain the V2 Glance client. A Glance client is needed to manage Image members. If omitted, the region argument of the provider is used. Changing this creates a new resource.
schema string
The member schema.
status string
The member proposal status. Optional if admin wants to force the member proposal acceptance. Can either be accepted, rejected or pending. Defaults to pending. Foridden for non-admin users.
updatedAt string
The date the image access was last updated.
created_at str
The date the image access was created.
image_id Changes to this property will trigger replacement. str
The image ID.
member_id Changes to this property will trigger replacement. str
The member ID, e.g. the target project ID.
region Changes to this property will trigger replacement. str
The region in which to obtain the V2 Glance client. A Glance client is needed to manage Image members. If omitted, the region argument of the provider is used. Changing this creates a new resource.
schema str
The member schema.
status str
The member proposal status. Optional if admin wants to force the member proposal acceptance. Can either be accepted, rejected or pending. Defaults to pending. Foridden for non-admin users.
updated_at str
The date the image access was last updated.
createdAt String
The date the image access was created.
imageId Changes to this property will trigger replacement. String
The image ID.
memberId Changes to this property will trigger replacement. String
The member ID, e.g. the target project ID.
region Changes to this property will trigger replacement. String
The region in which to obtain the V2 Glance client. A Glance client is needed to manage Image members. If omitted, the region argument of the provider is used. Changing this creates a new resource.
schema String
The member schema.
status String
The member proposal status. Optional if admin wants to force the member proposal acceptance. Can either be accepted, rejected or pending. Defaults to pending. Foridden for non-admin users.
updatedAt String
The date the image access was last updated.

Import

Image access can be imported using the image_id and the member_id,

separated by a slash, e.g.

$ pulumi import openstack:images/imageAccess:ImageAccess openstack_images_image_access_v2 89c60255-9bd6-460c-822a-e2b959ede9d2/bed6b6cbb86a4e2d8dc2735c2f1000e4
Copy

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.