Documentation ¶
Index ¶
- func PkgVersion() (semver.Version, error)
- type Image
- type ImageArgs
- type ImageArray
- type ImageArrayInput
- type ImageArrayOutput
- type ImageInput
- type ImageMap
- type ImageMapInput
- type ImageMapOutput
- type ImageOutput
- func (o ImageOutput) BackupId() pulumi.StringOutput
- func (o ImageOutput) Checksum() pulumi.StringOutput
- func (o ImageOutput) CmkId() pulumi.StringPtrOutput
- func (o ImageOutput) DataOrigin() pulumi.StringOutput
- func (o ImageOutput) Description() pulumi.StringPtrOutput
- func (o ImageOutput) DiskFormat() pulumi.StringOutput
- func (ImageOutput) ElementType() reflect.Type
- func (o ImageOutput) EnterpriseProjectId() pulumi.StringOutput
- func (o ImageOutput) ImageSize() pulumi.StringOutput
- func (o ImageOutput) ImageUrl() pulumi.StringPtrOutput
- func (o ImageOutput) InstanceId() pulumi.StringOutput
- func (o ImageOutput) IsConfig() pulumi.BoolPtrOutput
- func (o ImageOutput) MaxRam() pulumi.IntOutput
- func (o ImageOutput) MinDisk() pulumi.IntPtrOutput
- func (o ImageOutput) MinRam() pulumi.IntOutput
- func (o ImageOutput) Name() pulumi.StringOutput
- func (o ImageOutput) OsVersion() pulumi.StringOutput
- func (o ImageOutput) Status() pulumi.StringOutput
- func (o ImageOutput) Tags() pulumi.StringMapOutput
- func (o ImageOutput) ToImageOutput() ImageOutput
- func (o ImageOutput) ToImageOutputWithContext(ctx context.Context) ImageOutput
- func (o ImageOutput) Type() pulumi.StringPtrOutput
- func (o ImageOutput) VaultId() pulumi.StringPtrOutput
- func (o ImageOutput) Visibility() pulumi.StringOutput
- type ImageState
- type LookupImageArgs
- type LookupImageOutputArgs
- type LookupImageResult
- type LookupImageResultOutput
- func (o LookupImageResultOutput) Architecture() pulumi.StringPtrOutput
- func (o LookupImageResultOutput) BackupId() pulumi.StringOutput
- func (o LookupImageResultOutput) Checksum() pulumi.StringOutput
- func (o LookupImageResultOutput) ContainerFormat() pulumi.StringOutput
- func (o LookupImageResultOutput) CreatedAt() pulumi.StringOutput
- func (o LookupImageResultOutput) DiskFormat() pulumi.StringOutput
- func (LookupImageResultOutput) ElementType() reflect.Type
- func (o LookupImageResultOutput) EnterpriseProjectId() pulumi.StringOutput
- func (o LookupImageResultOutput) File() pulumi.StringOutput
- func (o LookupImageResultOutput) FlavorId() pulumi.StringOutput
- func (o LookupImageResultOutput) Id() pulumi.StringOutput
- func (o LookupImageResultOutput) ImageType() pulumi.StringOutput
- func (o LookupImageResultOutput) Metadata() pulumi.StringMapOutput
- func (o LookupImageResultOutput) MinDiskGb() pulumi.IntOutput
- func (o LookupImageResultOutput) MinRamMb() pulumi.IntOutput
- func (o LookupImageResultOutput) MostRecent() pulumi.BoolPtrOutput
- func (o LookupImageResultOutput) Name() pulumi.StringOutput
- func (o LookupImageResultOutput) NameRegex() pulumi.StringPtrOutput
- func (o LookupImageResultOutput) Os() pulumi.StringOutput
- func (o LookupImageResultOutput) OsVersion() pulumi.StringOutput
- func (o LookupImageResultOutput) Owner() pulumi.StringOutput
- func (o LookupImageResultOutput) Protected() pulumi.BoolOutput
- func (o LookupImageResultOutput) Region() pulumi.StringOutput
- func (o LookupImageResultOutput) Schema() pulumi.StringOutput
- func (o LookupImageResultOutput) SizeBytes() pulumi.IntOutput
- func (o LookupImageResultOutput) SizeMax() pulumi.IntPtrOutputdeprecated
- func (o LookupImageResultOutput) SizeMin() pulumi.IntPtrOutputdeprecated
- func (o LookupImageResultOutput) SortDirection() pulumi.StringPtrOutput
- func (o LookupImageResultOutput) SortKey() pulumi.StringPtrOutput
- func (o LookupImageResultOutput) Status() pulumi.StringOutput
- func (o LookupImageResultOutput) Tag() pulumi.StringPtrOutput
- func (o LookupImageResultOutput) ToLookupImageResultOutput() LookupImageResultOutput
- func (o LookupImageResultOutput) ToLookupImageResultOutputWithContext(ctx context.Context) LookupImageResultOutput
- func (o LookupImageResultOutput) UpdatedAt() pulumi.StringOutput
- func (o LookupImageResultOutput) Visibility() pulumi.StringOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PkgVersion ¶ added in v0.0.2
PkgVersion uses reflection to determine the version of the current package. If a version cannot be determined, v1 will be assumed. The second return value is always nil.
Types ¶
type Image ¶
type Image struct { pulumi.CustomResourceState // The ID of the CBR backup that needs to be converted into an image. This // parameter is mandatory when you create a private whole image from a CBR backup. BackupId pulumi.StringOutput `pulumi:"backupId"` // The checksum of the data associated with the image. Checksum pulumi.StringOutput `pulumi:"checksum"` // The master key used for encrypting an image. CmkId pulumi.StringPtrOutput `pulumi:"cmkId"` // The image resource. The pattern can be 'instance,*instance_id*', 'file,*image_url*' // or 'server_backup,*backup_id*'. DataOrigin pulumi.StringOutput `pulumi:"dataOrigin"` // A description of the image. Description pulumi.StringPtrOutput `pulumi:"description"` // The image file format. The value can be `vhd`, `zvhd`, `raw`, `zvhd2`, or `qcow2`. DiskFormat pulumi.StringOutput `pulumi:"diskFormat"` // The enterprise project id of the image. Changing this creates a // new image. EnterpriseProjectId pulumi.StringOutput `pulumi:"enterpriseProjectId"` // The size(bytes) of the image file format. ImageSize pulumi.StringOutput `pulumi:"imageSize"` // The URL of the external image file in the OBS bucket. This parameter is // mandatory when you create a private image from an external file uploaded to an OBS bucket. The format is *OBS bucket // name:Image file name*. ImageUrl pulumi.StringPtrOutput `pulumi:"imageUrl"` // The ID of the ECS that needs to be converted into an image. This // parameter is mandatory when you create a private image or a private whole image from an ECS. // If the value of `vaultId` is not empty, then a whole image will be created. InstanceId pulumi.StringOutput `pulumi:"instanceId"` // If automatic configuration is required, set the value to true. Otherwise, set // the value to false. IsConfig pulumi.BoolPtrOutput `pulumi:"isConfig"` // The maximum memory of the image in the unit of MB. MaxRam pulumi.IntOutput `pulumi:"maxRam"` // The minimum size of the system disk in the unit of GB. This parameter is // mandatory when you create a private image from an external file uploaded to an OBS bucket. The value ranges from 1 GB // to 1024 GB. MinDisk pulumi.IntPtrOutput `pulumi:"minDisk"` // The minimum memory of the image in the unit of MB. The default value is 0, // indicating that the memory is not restricted. MinRam pulumi.IntOutput `pulumi:"minRam"` // The name of the image. Name pulumi.StringOutput `pulumi:"name"` // The OS version. This parameter is valid when you create a private image // from an external file uploaded to an OBS bucket. OsVersion pulumi.StringOutput `pulumi:"osVersion"` // The status of the image. Status pulumi.StringOutput `pulumi:"status"` // The tags of the image. Tags pulumi.StringMapOutput `pulumi:"tags"` // The image type. Must be one of `ECS`, `FusionCompute`, `BMS`, or `Ironic`. Type pulumi.StringPtrOutput `pulumi:"type"` // The ID of the vault to which an ECS is to be added or has been added. // This parameter is mandatory when you create a private whole image from an ECS. VaultId pulumi.StringPtrOutput `pulumi:"vaultId"` // Whether the image is visible to other tenants. Visibility pulumi.StringOutput `pulumi:"visibility"` }
Manages an Image resource within HuaweiCloud IMS.
## Example Usage ### Creating an image from OBS bucket
```go package main
import (
"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Ims" "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := Ims.NewImage(ctx, "imsTestFile", &Ims.ImageArgs{ Description: pulumi.String("Create an image from the OBS bucket."), ImageUrl: pulumi.String("ims-image:centos70.qcow2"), MinDisk: pulumi.Int(40), Tags: pulumi.StringMap{ "foo": pulumi.String("bar1"), "key": pulumi.String("value"), }, }) if err != nil { return err } return nil }) }
``` ### Creating a whole image from an existing ECS
```go package main
import (
"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Ims" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { cfg := config.New(ctx, "") vaultId := cfg.RequireObject("vaultId") instanceId := cfg.RequireObject("instanceId") _, err := Ims.NewImage(ctx, "test", &Ims.ImageArgs{ InstanceId: pulumi.Any(instanceId), VaultId: pulumi.Any(vaultId), Tags: pulumi.StringMap{ "foo": pulumi.String("bar2"), "key": pulumi.String("value"), }, }) if err != nil { return err } return nil }) }
``` ### Creating a whole image from CBR backup
```go package main
import (
"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Ims" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { cfg := config.New(ctx, "") backupId := cfg.RequireObject("backupId") _, err := Ims.NewImage(ctx, "test", &Ims.ImageArgs{ BackupId: pulumi.Any(backupId), Tags: pulumi.StringMap{ "foo": pulumi.String("bar1"), "key": pulumi.String("value"), }, }) if err != nil { return err } return nil }) }
```
## Import
Images can be imported using the `id`, e.g. bash
```sh
$ pulumi import huaweicloud:Ims/image:Image my_image <id>
```
Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response. The missing attributes include`vault_id`. It is generally recommended running `terraform plan` after importing the image. You can then decide if changes should be applied to the image, or the resource definition should be updated to align with the image. Also you can ignore changes as below. resource "huaweicloud_images_image" "test" { ... lifecycle { ignore_changes = [ vault_id, ] } }
func GetImage ¶
func GetImage(ctx *pulumi.Context, name string, id pulumi.IDInput, state *ImageState, opts ...pulumi.ResourceOption) (*Image, error)
GetImage gets an existing Image resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).
func NewImage ¶
func NewImage(ctx *pulumi.Context, name string, args *ImageArgs, opts ...pulumi.ResourceOption) (*Image, error)
NewImage registers a new resource with the given unique name, arguments, and options.
func (*Image) ElementType ¶
func (*Image) ToImageOutput ¶
func (i *Image) ToImageOutput() ImageOutput
func (*Image) ToImageOutputWithContext ¶
func (i *Image) ToImageOutputWithContext(ctx context.Context) ImageOutput
type ImageArgs ¶
type ImageArgs struct { // The ID of the CBR backup that needs to be converted into an image. This // parameter is mandatory when you create a private whole image from a CBR backup. BackupId pulumi.StringPtrInput // The master key used for encrypting an image. CmkId pulumi.StringPtrInput // A description of the image. Description pulumi.StringPtrInput // The enterprise project id of the image. Changing this creates a // new image. EnterpriseProjectId pulumi.StringPtrInput // The URL of the external image file in the OBS bucket. This parameter is // mandatory when you create a private image from an external file uploaded to an OBS bucket. The format is *OBS bucket // name:Image file name*. ImageUrl pulumi.StringPtrInput // The ID of the ECS that needs to be converted into an image. This // parameter is mandatory when you create a private image or a private whole image from an ECS. // If the value of `vaultId` is not empty, then a whole image will be created. InstanceId pulumi.StringPtrInput // If automatic configuration is required, set the value to true. Otherwise, set // the value to false. IsConfig pulumi.BoolPtrInput // The maximum memory of the image in the unit of MB. MaxRam pulumi.IntPtrInput // The minimum size of the system disk in the unit of GB. This parameter is // mandatory when you create a private image from an external file uploaded to an OBS bucket. The value ranges from 1 GB // to 1024 GB. MinDisk pulumi.IntPtrInput // The minimum memory of the image in the unit of MB. The default value is 0, // indicating that the memory is not restricted. MinRam pulumi.IntPtrInput // The name of the image. Name pulumi.StringPtrInput // The OS version. This parameter is valid when you create a private image // from an external file uploaded to an OBS bucket. OsVersion pulumi.StringPtrInput // The tags of the image. Tags pulumi.StringMapInput // The image type. Must be one of `ECS`, `FusionCompute`, `BMS`, or `Ironic`. Type pulumi.StringPtrInput // The ID of the vault to which an ECS is to be added or has been added. // This parameter is mandatory when you create a private whole image from an ECS. VaultId pulumi.StringPtrInput }
The set of arguments for constructing a Image resource.
func (ImageArgs) ElementType ¶
type ImageArray ¶
type ImageArray []ImageInput
func (ImageArray) ElementType ¶
func (ImageArray) ElementType() reflect.Type
func (ImageArray) ToImageArrayOutput ¶
func (i ImageArray) ToImageArrayOutput() ImageArrayOutput
func (ImageArray) ToImageArrayOutputWithContext ¶
func (i ImageArray) ToImageArrayOutputWithContext(ctx context.Context) ImageArrayOutput
type ImageArrayInput ¶
type ImageArrayInput interface { pulumi.Input ToImageArrayOutput() ImageArrayOutput ToImageArrayOutputWithContext(context.Context) ImageArrayOutput }
ImageArrayInput is an input type that accepts ImageArray and ImageArrayOutput values. You can construct a concrete instance of `ImageArrayInput` via:
ImageArray{ ImageArgs{...} }
type ImageArrayOutput ¶
type ImageArrayOutput struct{ *pulumi.OutputState }
func (ImageArrayOutput) ElementType ¶
func (ImageArrayOutput) ElementType() reflect.Type
func (ImageArrayOutput) Index ¶
func (o ImageArrayOutput) Index(i pulumi.IntInput) ImageOutput
func (ImageArrayOutput) ToImageArrayOutput ¶
func (o ImageArrayOutput) ToImageArrayOutput() ImageArrayOutput
func (ImageArrayOutput) ToImageArrayOutputWithContext ¶
func (o ImageArrayOutput) ToImageArrayOutputWithContext(ctx context.Context) ImageArrayOutput
type ImageInput ¶
type ImageInput interface { pulumi.Input ToImageOutput() ImageOutput ToImageOutputWithContext(ctx context.Context) ImageOutput }
type ImageMap ¶
type ImageMap map[string]ImageInput
func (ImageMap) ElementType ¶
func (ImageMap) ToImageMapOutput ¶
func (i ImageMap) ToImageMapOutput() ImageMapOutput
func (ImageMap) ToImageMapOutputWithContext ¶
func (i ImageMap) ToImageMapOutputWithContext(ctx context.Context) ImageMapOutput
type ImageMapInput ¶
type ImageMapInput interface { pulumi.Input ToImageMapOutput() ImageMapOutput ToImageMapOutputWithContext(context.Context) ImageMapOutput }
ImageMapInput is an input type that accepts ImageMap and ImageMapOutput values. You can construct a concrete instance of `ImageMapInput` via:
ImageMap{ "key": ImageArgs{...} }
type ImageMapOutput ¶
type ImageMapOutput struct{ *pulumi.OutputState }
func (ImageMapOutput) ElementType ¶
func (ImageMapOutput) ElementType() reflect.Type
func (ImageMapOutput) MapIndex ¶
func (o ImageMapOutput) MapIndex(k pulumi.StringInput) ImageOutput
func (ImageMapOutput) ToImageMapOutput ¶
func (o ImageMapOutput) ToImageMapOutput() ImageMapOutput
func (ImageMapOutput) ToImageMapOutputWithContext ¶
func (o ImageMapOutput) ToImageMapOutputWithContext(ctx context.Context) ImageMapOutput
type ImageOutput ¶
type ImageOutput struct{ *pulumi.OutputState }
func (ImageOutput) BackupId ¶ added in v0.0.8
func (o ImageOutput) BackupId() pulumi.StringOutput
The ID of the CBR backup that needs to be converted into an image. This parameter is mandatory when you create a private whole image from a CBR backup.
func (ImageOutput) Checksum ¶
func (o ImageOutput) Checksum() pulumi.StringOutput
The checksum of the data associated with the image.
func (ImageOutput) CmkId ¶
func (o ImageOutput) CmkId() pulumi.StringPtrOutput
The master key used for encrypting an image.
func (ImageOutput) DataOrigin ¶
func (o ImageOutput) DataOrigin() pulumi.StringOutput
The image resource. The pattern can be 'instance,*instance_id*', 'file,*image_url*' or 'server_backup,*backup_id*'.
func (ImageOutput) Description ¶
func (o ImageOutput) Description() pulumi.StringPtrOutput
A description of the image.
func (ImageOutput) DiskFormat ¶
func (o ImageOutput) DiskFormat() pulumi.StringOutput
The image file format. The value can be `vhd`, `zvhd`, `raw`, `zvhd2`, or `qcow2`.
func (ImageOutput) ElementType ¶
func (ImageOutput) ElementType() reflect.Type
func (ImageOutput) EnterpriseProjectId ¶
func (o ImageOutput) EnterpriseProjectId() pulumi.StringOutput
The enterprise project id of the image. Changing this creates a new image.
func (ImageOutput) ImageSize ¶
func (o ImageOutput) ImageSize() pulumi.StringOutput
The size(bytes) of the image file format.
func (ImageOutput) ImageUrl ¶
func (o ImageOutput) ImageUrl() pulumi.StringPtrOutput
The URL of the external image file in the OBS bucket. This parameter is mandatory when you create a private image from an external file uploaded to an OBS bucket. The format is *OBS bucket name:Image file name*.
func (ImageOutput) InstanceId ¶
func (o ImageOutput) InstanceId() pulumi.StringOutput
The ID of the ECS that needs to be converted into an image. This parameter is mandatory when you create a private image or a private whole image from an ECS. If the value of `vaultId` is not empty, then a whole image will be created.
func (ImageOutput) IsConfig ¶
func (o ImageOutput) IsConfig() pulumi.BoolPtrOutput
If automatic configuration is required, set the value to true. Otherwise, set the value to false.
func (ImageOutput) MaxRam ¶
func (o ImageOutput) MaxRam() pulumi.IntOutput
The maximum memory of the image in the unit of MB.
func (ImageOutput) MinDisk ¶
func (o ImageOutput) MinDisk() pulumi.IntPtrOutput
The minimum size of the system disk in the unit of GB. This parameter is mandatory when you create a private image from an external file uploaded to an OBS bucket. The value ranges from 1 GB to 1024 GB.
func (ImageOutput) MinRam ¶
func (o ImageOutput) MinRam() pulumi.IntOutput
The minimum memory of the image in the unit of MB. The default value is 0, indicating that the memory is not restricted.
func (ImageOutput) OsVersion ¶
func (o ImageOutput) OsVersion() pulumi.StringOutput
The OS version. This parameter is valid when you create a private image from an external file uploaded to an OBS bucket.
func (ImageOutput) Status ¶
func (o ImageOutput) Status() pulumi.StringOutput
The status of the image.
func (ImageOutput) ToImageOutput ¶
func (o ImageOutput) ToImageOutput() ImageOutput
func (ImageOutput) ToImageOutputWithContext ¶
func (o ImageOutput) ToImageOutputWithContext(ctx context.Context) ImageOutput
func (ImageOutput) Type ¶
func (o ImageOutput) Type() pulumi.StringPtrOutput
The image type. Must be one of `ECS`, `FusionCompute`, `BMS`, or `Ironic`.
func (ImageOutput) VaultId ¶ added in v0.0.8
func (o ImageOutput) VaultId() pulumi.StringPtrOutput
The ID of the vault to which an ECS is to be added or has been added. This parameter is mandatory when you create a private whole image from an ECS.
func (ImageOutput) Visibility ¶
func (o ImageOutput) Visibility() pulumi.StringOutput
Whether the image is visible to other tenants.
type ImageState ¶
type ImageState struct { // The ID of the CBR backup that needs to be converted into an image. This // parameter is mandatory when you create a private whole image from a CBR backup. BackupId pulumi.StringPtrInput // The checksum of the data associated with the image. Checksum pulumi.StringPtrInput // The master key used for encrypting an image. CmkId pulumi.StringPtrInput // The image resource. The pattern can be 'instance,*instance_id*', 'file,*image_url*' // or 'server_backup,*backup_id*'. DataOrigin pulumi.StringPtrInput // A description of the image. Description pulumi.StringPtrInput // The image file format. The value can be `vhd`, `zvhd`, `raw`, `zvhd2`, or `qcow2`. DiskFormat pulumi.StringPtrInput // The enterprise project id of the image. Changing this creates a // new image. EnterpriseProjectId pulumi.StringPtrInput // The size(bytes) of the image file format. ImageSize pulumi.StringPtrInput // The URL of the external image file in the OBS bucket. This parameter is // mandatory when you create a private image from an external file uploaded to an OBS bucket. The format is *OBS bucket // name:Image file name*. ImageUrl pulumi.StringPtrInput // The ID of the ECS that needs to be converted into an image. This // parameter is mandatory when you create a private image or a private whole image from an ECS. // If the value of `vaultId` is not empty, then a whole image will be created. InstanceId pulumi.StringPtrInput // If automatic configuration is required, set the value to true. Otherwise, set // the value to false. IsConfig pulumi.BoolPtrInput // The maximum memory of the image in the unit of MB. MaxRam pulumi.IntPtrInput // The minimum size of the system disk in the unit of GB. This parameter is // mandatory when you create a private image from an external file uploaded to an OBS bucket. The value ranges from 1 GB // to 1024 GB. MinDisk pulumi.IntPtrInput // The minimum memory of the image in the unit of MB. The default value is 0, // indicating that the memory is not restricted. MinRam pulumi.IntPtrInput // The name of the image. Name pulumi.StringPtrInput // The OS version. This parameter is valid when you create a private image // from an external file uploaded to an OBS bucket. OsVersion pulumi.StringPtrInput // The status of the image. Status pulumi.StringPtrInput // The tags of the image. Tags pulumi.StringMapInput // The image type. Must be one of `ECS`, `FusionCompute`, `BMS`, or `Ironic`. Type pulumi.StringPtrInput // The ID of the vault to which an ECS is to be added or has been added. // This parameter is mandatory when you create a private whole image from an ECS. VaultId pulumi.StringPtrInput // Whether the image is visible to other tenants. Visibility pulumi.StringPtrInput }
func (ImageState) ElementType ¶
func (ImageState) ElementType() reflect.Type
type LookupImageArgs ¶
type LookupImageArgs struct { // Specifies the image architecture type. The value can be **x86** and **arm**. Architecture *string `pulumi:"architecture"` // Specifies the enterprise project ID of the image. EnterpriseProjectId *string `pulumi:"enterpriseProjectId"` // Specifies the ECS flavor ID used to filter out available images. // You can specify only one flavor ID and only ECS flavor ID is valid, BMS flavor is not supported. FlavorId *string `pulumi:"flavorId"` // Specifies the environment where the image is used. For a BMS image, the value is **Ironic**. ImageType *string `pulumi:"imageType"` // If more than one result is returned, use the latest updated image. MostRecent *bool `pulumi:"mostRecent"` // The name of the image. Cannot be used simultaneously with `nameRegex`. Name *string `pulumi:"name"` // The regular expressian of the name of the image. // Cannot be used simultaneously with `name`. NameRegex *string `pulumi:"nameRegex"` // Specifies the image OS type. The value can be **Windows**, **Ubuntu**, // **RedHat**, **SUSE**, **CentOS**, **Debian**, **OpenSUSE**, **Oracle Linux**, **Fedora**, **Other**, // **CoreOS**, or **EulerOS**. Os *string `pulumi:"os"` // Specifies the OS version. For example, *CentOS 7.4 64bit* or *Ubuntu 18.04 server 64bit*. OsVersion *string `pulumi:"osVersion"` // The owner (UUID) of the image. Owner *string `pulumi:"owner"` // The region in which to obtain the images. If omitted, the provider-level region will be // used. Region *string `pulumi:"region"` // Deprecated: size_max is deprecated SizeMax *int `pulumi:"sizeMax"` // Deprecated: size_min is deprecated SizeMin *int `pulumi:"sizeMin"` // Order the results in either `asc` or `desc`. SortDirection *string `pulumi:"sortDirection"` // Sort images based on a certain key. Must be one of // "name", "containerFormat", "diskFormat", "status", "id" or "size". Defaults to `name`. SortKey *string `pulumi:"sortKey"` // Search for images with a specific tag in "Key=Value" format. Tag *string `pulumi:"tag"` // The visibility of the image. Must be one of // **public**, **private**, **market** or **shared**. Visibility *string `pulumi:"visibility"` }
A collection of arguments for invoking getImage.
type LookupImageOutputArgs ¶
type LookupImageOutputArgs struct { // Specifies the image architecture type. The value can be **x86** and **arm**. Architecture pulumi.StringPtrInput `pulumi:"architecture"` // Specifies the enterprise project ID of the image. EnterpriseProjectId pulumi.StringPtrInput `pulumi:"enterpriseProjectId"` // Specifies the ECS flavor ID used to filter out available images. // You can specify only one flavor ID and only ECS flavor ID is valid, BMS flavor is not supported. FlavorId pulumi.StringPtrInput `pulumi:"flavorId"` // Specifies the environment where the image is used. For a BMS image, the value is **Ironic**. ImageType pulumi.StringPtrInput `pulumi:"imageType"` // If more than one result is returned, use the latest updated image. MostRecent pulumi.BoolPtrInput `pulumi:"mostRecent"` // The name of the image. Cannot be used simultaneously with `nameRegex`. Name pulumi.StringPtrInput `pulumi:"name"` // The regular expressian of the name of the image. // Cannot be used simultaneously with `name`. NameRegex pulumi.StringPtrInput `pulumi:"nameRegex"` // Specifies the image OS type. The value can be **Windows**, **Ubuntu**, // **RedHat**, **SUSE**, **CentOS**, **Debian**, **OpenSUSE**, **Oracle Linux**, **Fedora**, **Other**, // **CoreOS**, or **EulerOS**. Os pulumi.StringPtrInput `pulumi:"os"` // Specifies the OS version. For example, *CentOS 7.4 64bit* or *Ubuntu 18.04 server 64bit*. OsVersion pulumi.StringPtrInput `pulumi:"osVersion"` // The owner (UUID) of the image. Owner pulumi.StringPtrInput `pulumi:"owner"` // The region in which to obtain the images. If omitted, the provider-level region will be // used. Region pulumi.StringPtrInput `pulumi:"region"` // Deprecated: size_max is deprecated SizeMax pulumi.IntPtrInput `pulumi:"sizeMax"` // Deprecated: size_min is deprecated SizeMin pulumi.IntPtrInput `pulumi:"sizeMin"` // Order the results in either `asc` or `desc`. SortDirection pulumi.StringPtrInput `pulumi:"sortDirection"` // Sort images based on a certain key. Must be one of // "name", "containerFormat", "diskFormat", "status", "id" or "size". Defaults to `name`. SortKey pulumi.StringPtrInput `pulumi:"sortKey"` // Search for images with a specific tag in "Key=Value" format. Tag pulumi.StringPtrInput `pulumi:"tag"` // The visibility of the image. Must be one of // **public**, **private**, **market** or **shared**. Visibility pulumi.StringPtrInput `pulumi:"visibility"` }
A collection of arguments for invoking getImage.
func (LookupImageOutputArgs) ElementType ¶
func (LookupImageOutputArgs) ElementType() reflect.Type
type LookupImageResult ¶
type LookupImageResult struct { Architecture *string `pulumi:"architecture"` // The backup ID of the whole image in the CBR vault. BackupId string `pulumi:"backupId"` // The checksum of the data associated with the image. Checksum string `pulumi:"checksum"` // The format of the image's container. ContainerFormat string `pulumi:"containerFormat"` // The date when the image was created. CreatedAt string `pulumi:"createdAt"` // The format of the image's disk. DiskFormat string `pulumi:"diskFormat"` EnterpriseProjectId string `pulumi:"enterpriseProjectId"` // the trailing path after the glance endpoint that represent the location of the image or the path to retrieve // it. File string `pulumi:"file"` FlavorId string `pulumi:"flavorId"` // The provider-assigned unique ID for this managed resource. Id string `pulumi:"id"` ImageType string `pulumi:"imageType"` // The metadata associated with the image. Image metadata allow for meaningfully define the image properties // and tags. Metadata map[string]string `pulumi:"metadata"` // The minimum amount of disk space required to use the image. MinDiskGb int `pulumi:"minDiskGb"` // The minimum amount of ram required to use the image. MinRamMb int `pulumi:"minRamMb"` MostRecent *bool `pulumi:"mostRecent"` Name string `pulumi:"name"` NameRegex *string `pulumi:"nameRegex"` Os string `pulumi:"os"` OsVersion string `pulumi:"osVersion"` Owner string `pulumi:"owner"` // Whether or not the image is protected. Protected bool `pulumi:"protected"` Region string `pulumi:"region"` // The path to the JSON-schema that represent the image or image. Schema string `pulumi:"schema"` // The size of the image (in bytes). SizeBytes int `pulumi:"sizeBytes"` // Deprecated: size_max is deprecated SizeMax *int `pulumi:"sizeMax"` // Deprecated: size_min is deprecated SizeMin *int `pulumi:"sizeMin"` SortDirection *string `pulumi:"sortDirection"` SortKey *string `pulumi:"sortKey"` // The status of the image. Status string `pulumi:"status"` Tag *string `pulumi:"tag"` // The date when the image was last updated. UpdatedAt string `pulumi:"updatedAt"` Visibility string `pulumi:"visibility"` }
A collection of values returned by getImage.
func LookupImage ¶
func LookupImage(ctx *pulumi.Context, args *LookupImageArgs, opts ...pulumi.InvokeOption) (*LookupImageResult, error)
Use this data source to get the ID of an available HuaweiCloud image.
## Example Usage
```go package main
import (
"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Ims" "github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Ims" "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := Ims.GetImage(ctx, &ims.GetImageArgs{ MostRecent: pulumi.BoolRef(true), Name: pulumi.StringRef("Ubuntu 18.04 server 64bit"), Visibility: pulumi.StringRef("public"), }, nil) if err != nil { return err } _, err = Ims.GetImage(ctx, &ims.GetImageArgs{ Architecture: pulumi.StringRef("x86"), MostRecent: pulumi.BoolRef(true), OsVersion: pulumi.StringRef("CentOS 7.4 64bit"), Visibility: pulumi.StringRef("public"), }, nil) if err != nil { return err } _, err = Ims.GetImage(ctx, &ims.GetImageArgs{ Architecture: pulumi.StringRef("x86"), MostRecent: pulumi.BoolRef(true), NameRegex: pulumi.StringRef("^CentOS 7.4"), Visibility: pulumi.StringRef("public"), }, nil) if err != nil { return err } _, err = Ims.GetImage(ctx, &ims.GetImageArgs{ Architecture: pulumi.StringRef("x86"), ImageType: pulumi.StringRef("Ironic"), MostRecent: pulumi.BoolRef(true), OsVersion: pulumi.StringRef("CentOS 7.4 64bit"), Visibility: pulumi.StringRef("public"), }, nil) if err != nil { return err } return nil }) }
```
type LookupImageResultOutput ¶
type LookupImageResultOutput struct{ *pulumi.OutputState }
A collection of values returned by getImage.
func LookupImageOutput ¶
func LookupImageOutput(ctx *pulumi.Context, args LookupImageOutputArgs, opts ...pulumi.InvokeOption) LookupImageResultOutput
func (LookupImageResultOutput) Architecture ¶
func (o LookupImageResultOutput) Architecture() pulumi.StringPtrOutput
func (LookupImageResultOutput) BackupId ¶ added in v0.0.8
func (o LookupImageResultOutput) BackupId() pulumi.StringOutput
The backup ID of the whole image in the CBR vault.
func (LookupImageResultOutput) Checksum ¶
func (o LookupImageResultOutput) Checksum() pulumi.StringOutput
The checksum of the data associated with the image.
func (LookupImageResultOutput) ContainerFormat ¶
func (o LookupImageResultOutput) ContainerFormat() pulumi.StringOutput
The format of the image's container.
func (LookupImageResultOutput) CreatedAt ¶
func (o LookupImageResultOutput) CreatedAt() pulumi.StringOutput
The date when the image was created.
func (LookupImageResultOutput) DiskFormat ¶
func (o LookupImageResultOutput) DiskFormat() pulumi.StringOutput
The format of the image's disk.
func (LookupImageResultOutput) ElementType ¶
func (LookupImageResultOutput) ElementType() reflect.Type
func (LookupImageResultOutput) EnterpriseProjectId ¶
func (o LookupImageResultOutput) EnterpriseProjectId() pulumi.StringOutput
func (LookupImageResultOutput) File ¶
func (o LookupImageResultOutput) File() pulumi.StringOutput
the trailing path after the glance endpoint that represent the location of the image or the path to retrieve it.
func (LookupImageResultOutput) FlavorId ¶ added in v0.0.8
func (o LookupImageResultOutput) FlavorId() pulumi.StringOutput
func (LookupImageResultOutput) Id ¶
func (o LookupImageResultOutput) Id() pulumi.StringOutput
The provider-assigned unique ID for this managed resource.
func (LookupImageResultOutput) ImageType ¶
func (o LookupImageResultOutput) ImageType() pulumi.StringOutput
func (LookupImageResultOutput) Metadata ¶
func (o LookupImageResultOutput) Metadata() pulumi.StringMapOutput
The metadata associated with the image. Image metadata allow for meaningfully define the image properties and tags.
func (LookupImageResultOutput) MinDiskGb ¶
func (o LookupImageResultOutput) MinDiskGb() pulumi.IntOutput
The minimum amount of disk space required to use the image.
func (LookupImageResultOutput) MinRamMb ¶
func (o LookupImageResultOutput) MinRamMb() pulumi.IntOutput
The minimum amount of ram required to use the image.
func (LookupImageResultOutput) MostRecent ¶
func (o LookupImageResultOutput) MostRecent() pulumi.BoolPtrOutput
func (LookupImageResultOutput) Name ¶
func (o LookupImageResultOutput) Name() pulumi.StringOutput
func (LookupImageResultOutput) NameRegex ¶
func (o LookupImageResultOutput) NameRegex() pulumi.StringPtrOutput
func (LookupImageResultOutput) Os ¶
func (o LookupImageResultOutput) Os() pulumi.StringOutput
func (LookupImageResultOutput) OsVersion ¶
func (o LookupImageResultOutput) OsVersion() pulumi.StringOutput
func (LookupImageResultOutput) Owner ¶
func (o LookupImageResultOutput) Owner() pulumi.StringOutput
func (LookupImageResultOutput) Protected ¶
func (o LookupImageResultOutput) Protected() pulumi.BoolOutput
Whether or not the image is protected.
func (LookupImageResultOutput) Region ¶
func (o LookupImageResultOutput) Region() pulumi.StringOutput
func (LookupImageResultOutput) Schema ¶
func (o LookupImageResultOutput) Schema() pulumi.StringOutput
The path to the JSON-schema that represent the image or image.
func (LookupImageResultOutput) SizeBytes ¶
func (o LookupImageResultOutput) SizeBytes() pulumi.IntOutput
The size of the image (in bytes).
func (LookupImageResultOutput) SizeMax
deprecated
func (o LookupImageResultOutput) SizeMax() pulumi.IntPtrOutput
Deprecated: size_max is deprecated
func (LookupImageResultOutput) SizeMin
deprecated
func (o LookupImageResultOutput) SizeMin() pulumi.IntPtrOutput
Deprecated: size_min is deprecated
func (LookupImageResultOutput) SortDirection ¶
func (o LookupImageResultOutput) SortDirection() pulumi.StringPtrOutput
func (LookupImageResultOutput) SortKey ¶
func (o LookupImageResultOutput) SortKey() pulumi.StringPtrOutput
func (LookupImageResultOutput) Status ¶
func (o LookupImageResultOutput) Status() pulumi.StringOutput
The status of the image.
func (LookupImageResultOutput) Tag ¶
func (o LookupImageResultOutput) Tag() pulumi.StringPtrOutput
func (LookupImageResultOutput) ToLookupImageResultOutput ¶
func (o LookupImageResultOutput) ToLookupImageResultOutput() LookupImageResultOutput
func (LookupImageResultOutput) ToLookupImageResultOutputWithContext ¶
func (o LookupImageResultOutput) ToLookupImageResultOutputWithContext(ctx context.Context) LookupImageResultOutput
func (LookupImageResultOutput) UpdatedAt ¶
func (o LookupImageResultOutput) UpdatedAt() pulumi.StringOutput
The date when the image was last updated.
func (LookupImageResultOutput) Visibility ¶
func (o LookupImageResultOutput) Visibility() pulumi.StringOutput