tencentcloud.getImage
Explore with Pulumi AI
Provides an available image for the user.
The Images data source fetch proper image, which could be one of the private images of the user and images of system resources provided by TencentCloud, as well as other public images and those available on the image market.
NOTE: This data source will be deprecated, please use
tencentcloud.getImages
instead.
Example Usage
Query image
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = tencentcloud.getImage({});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.get_image()
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.LookupImage(ctx, &tencentcloud.LookupImageArgs{}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = Tencentcloud.GetImage.Invoke();
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetImageArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = TencentcloudFunctions.getImage();
}
}
variables:
example:
fn::invoke:
function: tencentcloud:getImage
arguments: {}
Query image by filter
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = tencentcloud.getImage({
filters: [{
name: "image-type",
values: ["PUBLIC_IMAGE"],
}],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.get_image(filters=[{
"name": "image-type",
"values": ["PUBLIC_IMAGE"],
}])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.LookupImage(ctx, &tencentcloud.LookupImageArgs{
Filters: []tencentcloud.GetImageFilter{
{
Name: "image-type",
Values: []string{
"PUBLIC_IMAGE",
},
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = Tencentcloud.GetImage.Invoke(new()
{
Filters = new[]
{
new Tencentcloud.Inputs.GetImageFilterInputArgs
{
Name = "image-type",
Values = new[]
{
"PUBLIC_IMAGE",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetImageArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = TencentcloudFunctions.getImage(GetImageArgs.builder()
.filters(GetImageFilterArgs.builder()
.name("image-type")
.values("PUBLIC_IMAGE")
.build())
.build());
}
}
variables:
example:
fn::invoke:
function: tencentcloud:getImage
arguments:
filters:
- name: image-type
values:
- PUBLIC_IMAGE
Query image by os name
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = tencentcloud.getImage({
osName: "centos",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.get_image(os_name="centos")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.LookupImage(ctx, &tencentcloud.LookupImageArgs{
OsName: pulumi.StringRef("centos"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = Tencentcloud.GetImage.Invoke(new()
{
OsName = "centos",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetImageArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = TencentcloudFunctions.getImage(GetImageArgs.builder()
.osName("centos")
.build());
}
}
variables:
example:
fn::invoke:
function: tencentcloud:getImage
arguments:
osName: centos
Query image by image name regex
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = tencentcloud.getImage({
imageNameRegex: "^Windows\\s.*$",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.get_image(image_name_regex="^Windows\\s.*$")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.LookupImage(ctx, &tencentcloud.LookupImageArgs{
ImageNameRegex: pulumi.StringRef("^Windows\\s.*$"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = Tencentcloud.GetImage.Invoke(new()
{
ImageNameRegex = "^Windows\\s.*$",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetImageArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = TencentcloudFunctions.getImage(GetImageArgs.builder()
.imageNameRegex("^Windows\\s.*$")
.build());
}
}
variables:
example:
fn::invoke:
function: tencentcloud:getImage
arguments:
imageNameRegex: ^Windows\s.*$
Using getImage
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getImage(args: GetImageArgs, opts?: InvokeOptions): Promise<GetImageResult>
function getImageOutput(args: GetImageOutputArgs, opts?: InvokeOptions): Output<GetImageResult>
def get_image(filters: Optional[Sequence[GetImageFilter]] = None,
id: Optional[str] = None,
image_name_regex: Optional[str] = None,
os_name: Optional[str] = None,
result_output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetImageResult
def get_image_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetImageFilterArgs]]]] = None,
id: Optional[pulumi.Input[str]] = None,
image_name_regex: Optional[pulumi.Input[str]] = None,
os_name: Optional[pulumi.Input[str]] = None,
result_output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetImageResult]
func LookupImage(ctx *Context, args *LookupImageArgs, opts ...InvokeOption) (*LookupImageResult, error)
func LookupImageOutput(ctx *Context, args *LookupImageOutputArgs, opts ...InvokeOption) LookupImageResultOutput
> Note: This function is named LookupImage
in the Go SDK.
public static class GetImage
{
public static Task<GetImageResult> InvokeAsync(GetImageArgs args, InvokeOptions? opts = null)
public static Output<GetImageResult> Invoke(GetImageInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetImageResult> getImage(GetImageArgs args, InvokeOptions options)
public static Output<GetImageResult> getImage(GetImageArgs args, InvokeOptions options)
fn::invoke:
function: tencentcloud:index/getImage:getImage
arguments:
# arguments dictionary
The following arguments are supported:
- Filters
List<Get
Image Filter> - One or more name/value pairs to filter.
- Id string
- Image
Name stringRegex - A regex string to apply to the image list returned by TencentCloud. NOTE: it is not wildcard, should look like
image_name_regex = "^CentOS\s+6\.8\s+64\w*"
. - Os
Name string - A string to apply with fuzzy match to the os_name attribute on the image list returned by TencentCloud. NOTE: when os_name is provided, highest priority is applied in this field instead of
image_name_regex
. - Result
Output stringFile - Used to save results.
- Filters
[]Get
Image Filter - One or more name/value pairs to filter.
- Id string
- Image
Name stringRegex - A regex string to apply to the image list returned by TencentCloud. NOTE: it is not wildcard, should look like
image_name_regex = "^CentOS\s+6\.8\s+64\w*"
. - Os
Name string - A string to apply with fuzzy match to the os_name attribute on the image list returned by TencentCloud. NOTE: when os_name is provided, highest priority is applied in this field instead of
image_name_regex
. - Result
Output stringFile - Used to save results.
- filters
List<Get
Image Filter> - One or more name/value pairs to filter.
- id String
- image
Name StringRegex - A regex string to apply to the image list returned by TencentCloud. NOTE: it is not wildcard, should look like
image_name_regex = "^CentOS\s+6\.8\s+64\w*"
. - os
Name String - A string to apply with fuzzy match to the os_name attribute on the image list returned by TencentCloud. NOTE: when os_name is provided, highest priority is applied in this field instead of
image_name_regex
. - result
Output StringFile - Used to save results.
- filters
Get
Image Filter[] - One or more name/value pairs to filter.
- id string
- image
Name stringRegex - A regex string to apply to the image list returned by TencentCloud. NOTE: it is not wildcard, should look like
image_name_regex = "^CentOS\s+6\.8\s+64\w*"
. - os
Name string - A string to apply with fuzzy match to the os_name attribute on the image list returned by TencentCloud. NOTE: when os_name is provided, highest priority is applied in this field instead of
image_name_regex
. - result
Output stringFile - Used to save results.
- filters
Sequence[Get
Image Filter] - One or more name/value pairs to filter.
- id str
- image_
name_ strregex - A regex string to apply to the image list returned by TencentCloud. NOTE: it is not wildcard, should look like
image_name_regex = "^CentOS\s+6\.8\s+64\w*"
. - os_
name str - A string to apply with fuzzy match to the os_name attribute on the image list returned by TencentCloud. NOTE: when os_name is provided, highest priority is applied in this field instead of
image_name_regex
. - result_
output_ strfile - Used to save results.
- filters List<Property Map>
- One or more name/value pairs to filter.
- id String
- image
Name StringRegex - A regex string to apply to the image list returned by TencentCloud. NOTE: it is not wildcard, should look like
image_name_regex = "^CentOS\s+6\.8\s+64\w*"
. - os
Name String - A string to apply with fuzzy match to the os_name attribute on the image list returned by TencentCloud. NOTE: when os_name is provided, highest priority is applied in this field instead of
image_name_regex
. - result
Output StringFile - Used to save results.
getImage Result
The following output properties are available:
- Id string
- Image
Id string - An image id indicate the uniqueness of a certain image, which can be used for instance creation or resetting.
- Image
Name string - Name of this image.
- Filters
List<Get
Image Filter> - Image
Name stringRegex - Os
Name string - Result
Output stringFile
- Id string
- Image
Id string - An image id indicate the uniqueness of a certain image, which can be used for instance creation or resetting.
- Image
Name string - Name of this image.
- Filters
[]Get
Image Filter - Image
Name stringRegex - Os
Name string - Result
Output stringFile
- id String
- image
Id String - An image id indicate the uniqueness of a certain image, which can be used for instance creation or resetting.
- image
Name String - Name of this image.
- filters
List<Get
Image Filter> - image
Name StringRegex - os
Name String - result
Output StringFile
- id string
- image
Id string - An image id indicate the uniqueness of a certain image, which can be used for instance creation or resetting.
- image
Name string - Name of this image.
- filters
Get
Image Filter[] - image
Name stringRegex - os
Name string - result
Output stringFile
- id str
- image_
id str - An image id indicate the uniqueness of a certain image, which can be used for instance creation or resetting.
- image_
name str - Name of this image.
- filters
Sequence[Get
Image Filter] - image_
name_ strregex - os_
name str - result_
output_ strfile
- id String
- image
Id String - An image id indicate the uniqueness of a certain image, which can be used for instance creation or resetting.
- image
Name String - Name of this image.
- filters List<Property Map>
- image
Name StringRegex - os
Name String - result
Output StringFile
Supporting Types
GetImageFilter
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.