Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

ImageCache

An ECI Image Cache can help user to solve the time-consuming problem of image pull. For information about Alicloud ECI Image Cache and how to use it, see What is Resource Alicloud ECI Image Cache.

NOTE: Available in v1.89.0+.

NOTE: Each image cache corresponds to a snapshot, and the user does not delete the snapshot directly, otherwise the cache will fail.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new AliCloud.Eci.ImageCache("example", new AliCloud.Eci.ImageCacheArgs
        {
            EipInstanceId = "eip-uf60c7cqb2pcrkgxhxxxx",
            ImageCacheName = "tf-test",
            Images = 
            {
                "registry.cn-beijing.aliyuncs.com/sceneplatform/sae-image-xxxx:latest",
            },
            SecurityGroupId = "sg-2zeef68b66fxxxx",
            VswitchId = "vsw-2zef9k7ng82xxxx",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/eci"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := eci.NewImageCache(ctx, "example", &eci.ImageCacheArgs{
			EipInstanceId:  pulumi.String("eip-uf60c7cqb2pcrkgxhxxxx"),
			ImageCacheName: pulumi.String("tf-test"),
			Images: pulumi.StringArray{
				pulumi.String("registry.cn-beijing.aliyuncs.com/sceneplatform/sae-image-xxxx:latest"),
			},
			SecurityGroupId: pulumi.String("sg-2zeef68b66fxxxx"),
			VswitchId:       pulumi.String("vsw-2zef9k7ng82xxxx"),
		})
		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.alicloud.eci.ImageCache;
import com.pulumi.alicloud.eci.ImageCacheArgs;
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 example = new ImageCache("example", ImageCacheArgs.builder()        
            .eipInstanceId("eip-uf60c7cqb2pcrkgxhxxxx")
            .imageCacheName("tf-test")
            .images("registry.cn-beijing.aliyuncs.com/sceneplatform/sae-image-xxxx:latest")
            .securityGroupId("sg-2zeef68b66fxxxx")
            .vswitchId("vsw-2zef9k7ng82xxxx")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.eci.ImageCache("example",
    eip_instance_id="eip-uf60c7cqb2pcrkgxhxxxx",
    image_cache_name="tf-test",
    images=["registry.cn-beijing.aliyuncs.com/sceneplatform/sae-image-xxxx:latest"],
    security_group_id="sg-2zeef68b66fxxxx",
    vswitch_id="vsw-2zef9k7ng82xxxx")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = new alicloud.eci.ImageCache("example", {
    eipInstanceId: "eip-uf60c7cqb2pcrkgxhxxxx",
    imageCacheName: "tf-test",
    images: ["registry.cn-beijing.aliyuncs.com/sceneplatform/sae-image-xxxx:latest"],
    securityGroupId: "sg-2zeef68b66fxxxx",
    vswitchId: "vsw-2zef9k7ng82xxxx",
});
resources:
  example:
    type: alicloud:eci:ImageCache
    properties:
      eipInstanceId: eip-uf60c7cqb2pcrkgxhxxxx
      imageCacheName: tf-test
      images:
        - registry.cn-beijing.aliyuncs.com/sceneplatform/sae-image-xxxx:latest
      securityGroupId: sg-2zeef68b66fxxxx
      vswitchId: vsw-2zef9k7ng82xxxx

Create a ImageCache Resource

new ImageCache(name: string, args: ImageCacheArgs, opts?: CustomResourceOptions);
@overload
def ImageCache(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               eip_instance_id: Optional[str] = None,
               image_cache_name: Optional[str] = None,
               image_cache_size: Optional[int] = None,
               image_registry_credentials: Optional[Sequence[ImageCacheImageRegistryCredentialArgs]] = None,
               images: Optional[Sequence[str]] = None,
               resource_group_id: Optional[str] = None,
               retention_days: Optional[int] = None,
               security_group_id: Optional[str] = None,
               vswitch_id: Optional[str] = None,
               zone_id: Optional[str] = None)
@overload
def ImageCache(resource_name: str,
               args: ImageCacheArgs,
               opts: Optional[ResourceOptions] = None)
func NewImageCache(ctx *Context, name string, args ImageCacheArgs, opts ...ResourceOption) (*ImageCache, error)
public ImageCache(string name, ImageCacheArgs args, CustomResourceOptions? opts = null)
public ImageCache(String name, ImageCacheArgs args)
public ImageCache(String name, ImageCacheArgs args, CustomResourceOptions options)
type: alicloud:eci:ImageCache
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ImageCacheArgs
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 ImageCacheArgs
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 ImageCacheArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ImageCacheArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ImageCacheArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

ImageCacheName string

The name of the image cache.

Images List<string>

The images to be cached. The image name must be versioned.

SecurityGroupId string

The ID of the security group. You do not need to specify the same security group as the container group.

VswitchId string

The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.

EipInstanceId string

The instance ID of the Elastic IP Address (EIP). If you want to pull images from the Internet, you must specify an EIP to make sure that the container group can access the Internet. You can also configure the network address translation (NAT) gateway. We recommend that you configure the NAT gateway for the Internet access. Refer to Public Network Access Method

ImageCacheSize int

The size of the image cache. Default to 20. Unit: GiB.

ImageRegistryCredentials List<Pulumi.AliCloud.Eci.Inputs.ImageCacheImageRegistryCredentialArgs>

The Image Registry parameters about the image to be cached.

ResourceGroupId string

The ID of the resource group.

RetentionDays int

The retention days of the image cache. Once the image cache expires, it will be cleared. By default, the image cache never expires. Note: The image cache that fails to be created is retained for only one day.

ZoneId string

The zone id to cache image.

ImageCacheName string

The name of the image cache.

Images []string

The images to be cached. The image name must be versioned.

SecurityGroupId string

The ID of the security group. You do not need to specify the same security group as the container group.

VswitchId string

The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.

EipInstanceId string

The instance ID of the Elastic IP Address (EIP). If you want to pull images from the Internet, you must specify an EIP to make sure that the container group can access the Internet. You can also configure the network address translation (NAT) gateway. We recommend that you configure the NAT gateway for the Internet access. Refer to Public Network Access Method

ImageCacheSize int

The size of the image cache. Default to 20. Unit: GiB.

ImageRegistryCredentials []ImageCacheImageRegistryCredentialArgs

The Image Registry parameters about the image to be cached.

ResourceGroupId string

The ID of the resource group.

RetentionDays int

The retention days of the image cache. Once the image cache expires, it will be cleared. By default, the image cache never expires. Note: The image cache that fails to be created is retained for only one day.

ZoneId string

The zone id to cache image.

imageCacheName String

The name of the image cache.

images List<String>

The images to be cached. The image name must be versioned.

securityGroupId String

The ID of the security group. You do not need to specify the same security group as the container group.

vswitchId String

The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.

eipInstanceId String

The instance ID of the Elastic IP Address (EIP). If you want to pull images from the Internet, you must specify an EIP to make sure that the container group can access the Internet. You can also configure the network address translation (NAT) gateway. We recommend that you configure the NAT gateway for the Internet access. Refer to Public Network Access Method

imageCacheSize Integer

The size of the image cache. Default to 20. Unit: GiB.

imageRegistryCredentials List<ImageCacheImageRegistryCredentialArgs>

The Image Registry parameters about the image to be cached.

resourceGroupId String

The ID of the resource group.

retentionDays Integer

The retention days of the image cache. Once the image cache expires, it will be cleared. By default, the image cache never expires. Note: The image cache that fails to be created is retained for only one day.

zoneId String

The zone id to cache image.

imageCacheName string

The name of the image cache.

images string[]

The images to be cached. The image name must be versioned.

securityGroupId string

The ID of the security group. You do not need to specify the same security group as the container group.

vswitchId string

The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.

eipInstanceId string

The instance ID of the Elastic IP Address (EIP). If you want to pull images from the Internet, you must specify an EIP to make sure that the container group can access the Internet. You can also configure the network address translation (NAT) gateway. We recommend that you configure the NAT gateway for the Internet access. Refer to Public Network Access Method

imageCacheSize number

The size of the image cache. Default to 20. Unit: GiB.

imageRegistryCredentials ImageCacheImageRegistryCredentialArgs[]

The Image Registry parameters about the image to be cached.

resourceGroupId string

The ID of the resource group.

retentionDays number

The retention days of the image cache. Once the image cache expires, it will be cleared. By default, the image cache never expires. Note: The image cache that fails to be created is retained for only one day.

zoneId string

The zone id to cache image.

image_cache_name str

The name of the image cache.

images Sequence[str]

The images to be cached. The image name must be versioned.

security_group_id str

The ID of the security group. You do not need to specify the same security group as the container group.

vswitch_id str

The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.

eip_instance_id str

The instance ID of the Elastic IP Address (EIP). If you want to pull images from the Internet, you must specify an EIP to make sure that the container group can access the Internet. You can also configure the network address translation (NAT) gateway. We recommend that you configure the NAT gateway for the Internet access. Refer to Public Network Access Method

image_cache_size int

The size of the image cache. Default to 20. Unit: GiB.

image_registry_credentials Sequence[ImageCacheImageRegistryCredentialArgs]

The Image Registry parameters about the image to be cached.

resource_group_id str

The ID of the resource group.

retention_days int

The retention days of the image cache. Once the image cache expires, it will be cleared. By default, the image cache never expires. Note: The image cache that fails to be created is retained for only one day.

zone_id str

The zone id to cache image.

imageCacheName String

The name of the image cache.

images List<String>

The images to be cached. The image name must be versioned.

securityGroupId String

The ID of the security group. You do not need to specify the same security group as the container group.

vswitchId String

The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.

eipInstanceId String

The instance ID of the Elastic IP Address (EIP). If you want to pull images from the Internet, you must specify an EIP to make sure that the container group can access the Internet. You can also configure the network address translation (NAT) gateway. We recommend that you configure the NAT gateway for the Internet access. Refer to Public Network Access Method

imageCacheSize Number

The size of the image cache. Default to 20. Unit: GiB.

imageRegistryCredentials List<Property Map>

The Image Registry parameters about the image to be cached.

resourceGroupId String

The ID of the resource group.

retentionDays Number

The retention days of the image cache. Once the image cache expires, it will be cleared. By default, the image cache never expires. Note: The image cache that fails to be created is retained for only one day.

zoneId String

The zone id to cache image.

Outputs

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

ContainerGroupId string

The ID of the container group job that is used to create the image cache.

  • status -The status of the image cache.
Id string

The provider-assigned unique ID for this managed resource.

Status string
ContainerGroupId string

The ID of the container group job that is used to create the image cache.

  • status -The status of the image cache.
Id string

The provider-assigned unique ID for this managed resource.

Status string
containerGroupId String

The ID of the container group job that is used to create the image cache.

  • status -The status of the image cache.
id String

The provider-assigned unique ID for this managed resource.

status String
containerGroupId string

The ID of the container group job that is used to create the image cache.

  • status -The status of the image cache.
id string

The provider-assigned unique ID for this managed resource.

status string
container_group_id str

The ID of the container group job that is used to create the image cache.

  • status -The status of the image cache.
id str

The provider-assigned unique ID for this managed resource.

status str
containerGroupId String

The ID of the container group job that is used to create the image cache.

  • status -The status of the image cache.
id String

The provider-assigned unique ID for this managed resource.

status String

Look up an Existing ImageCache Resource

Get an existing ImageCache 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?: ImageCacheState, opts?: CustomResourceOptions): ImageCache
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        container_group_id: Optional[str] = None,
        eip_instance_id: Optional[str] = None,
        image_cache_name: Optional[str] = None,
        image_cache_size: Optional[int] = None,
        image_registry_credentials: Optional[Sequence[ImageCacheImageRegistryCredentialArgs]] = None,
        images: Optional[Sequence[str]] = None,
        resource_group_id: Optional[str] = None,
        retention_days: Optional[int] = None,
        security_group_id: Optional[str] = None,
        status: Optional[str] = None,
        vswitch_id: Optional[str] = None,
        zone_id: Optional[str] = None) -> ImageCache
func GetImageCache(ctx *Context, name string, id IDInput, state *ImageCacheState, opts ...ResourceOption) (*ImageCache, error)
public static ImageCache Get(string name, Input<string> id, ImageCacheState? state, CustomResourceOptions? opts = null)
public static ImageCache get(String name, Output<String> id, ImageCacheState 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:
ContainerGroupId string

The ID of the container group job that is used to create the image cache.

  • status -The status of the image cache.
EipInstanceId string

The instance ID of the Elastic IP Address (EIP). If you want to pull images from the Internet, you must specify an EIP to make sure that the container group can access the Internet. You can also configure the network address translation (NAT) gateway. We recommend that you configure the NAT gateway for the Internet access. Refer to Public Network Access Method

ImageCacheName string

The name of the image cache.

ImageCacheSize int

The size of the image cache. Default to 20. Unit: GiB.

ImageRegistryCredentials List<Pulumi.AliCloud.Eci.Inputs.ImageCacheImageRegistryCredentialArgs>

The Image Registry parameters about the image to be cached.

Images List<string>

The images to be cached. The image name must be versioned.

ResourceGroupId string

The ID of the resource group.

RetentionDays int

The retention days of the image cache. Once the image cache expires, it will be cleared. By default, the image cache never expires. Note: The image cache that fails to be created is retained for only one day.

SecurityGroupId string

The ID of the security group. You do not need to specify the same security group as the container group.

Status string
VswitchId string

The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.

ZoneId string

The zone id to cache image.

ContainerGroupId string

The ID of the container group job that is used to create the image cache.

  • status -The status of the image cache.
EipInstanceId string

The instance ID of the Elastic IP Address (EIP). If you want to pull images from the Internet, you must specify an EIP to make sure that the container group can access the Internet. You can also configure the network address translation (NAT) gateway. We recommend that you configure the NAT gateway for the Internet access. Refer to Public Network Access Method

ImageCacheName string

The name of the image cache.

ImageCacheSize int

The size of the image cache. Default to 20. Unit: GiB.

ImageRegistryCredentials []ImageCacheImageRegistryCredentialArgs

The Image Registry parameters about the image to be cached.

Images []string

The images to be cached. The image name must be versioned.

ResourceGroupId string

The ID of the resource group.

RetentionDays int

The retention days of the image cache. Once the image cache expires, it will be cleared. By default, the image cache never expires. Note: The image cache that fails to be created is retained for only one day.

SecurityGroupId string

The ID of the security group. You do not need to specify the same security group as the container group.

Status string
VswitchId string

The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.

ZoneId string

The zone id to cache image.

containerGroupId String

The ID of the container group job that is used to create the image cache.

  • status -The status of the image cache.
eipInstanceId String

The instance ID of the Elastic IP Address (EIP). If you want to pull images from the Internet, you must specify an EIP to make sure that the container group can access the Internet. You can also configure the network address translation (NAT) gateway. We recommend that you configure the NAT gateway for the Internet access. Refer to Public Network Access Method

imageCacheName String

The name of the image cache.

imageCacheSize Integer

The size of the image cache. Default to 20. Unit: GiB.

imageRegistryCredentials List<ImageCacheImageRegistryCredentialArgs>

The Image Registry parameters about the image to be cached.

images List<String>

The images to be cached. The image name must be versioned.

resourceGroupId String

The ID of the resource group.

retentionDays Integer

The retention days of the image cache. Once the image cache expires, it will be cleared. By default, the image cache never expires. Note: The image cache that fails to be created is retained for only one day.

securityGroupId String

The ID of the security group. You do not need to specify the same security group as the container group.

status String
vswitchId String

The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.

zoneId String

The zone id to cache image.

containerGroupId string

The ID of the container group job that is used to create the image cache.

  • status -The status of the image cache.
eipInstanceId string

The instance ID of the Elastic IP Address (EIP). If you want to pull images from the Internet, you must specify an EIP to make sure that the container group can access the Internet. You can also configure the network address translation (NAT) gateway. We recommend that you configure the NAT gateway for the Internet access. Refer to Public Network Access Method

imageCacheName string

The name of the image cache.

imageCacheSize number

The size of the image cache. Default to 20. Unit: GiB.

imageRegistryCredentials ImageCacheImageRegistryCredentialArgs[]

The Image Registry parameters about the image to be cached.

images string[]

The images to be cached. The image name must be versioned.

resourceGroupId string

The ID of the resource group.

retentionDays number

The retention days of the image cache. Once the image cache expires, it will be cleared. By default, the image cache never expires. Note: The image cache that fails to be created is retained for only one day.

securityGroupId string

The ID of the security group. You do not need to specify the same security group as the container group.

status string
vswitchId string

The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.

zoneId string

The zone id to cache image.

container_group_id str

The ID of the container group job that is used to create the image cache.

  • status -The status of the image cache.
eip_instance_id str

The instance ID of the Elastic IP Address (EIP). If you want to pull images from the Internet, you must specify an EIP to make sure that the container group can access the Internet. You can also configure the network address translation (NAT) gateway. We recommend that you configure the NAT gateway for the Internet access. Refer to Public Network Access Method

image_cache_name str

The name of the image cache.

image_cache_size int

The size of the image cache. Default to 20. Unit: GiB.

image_registry_credentials Sequence[ImageCacheImageRegistryCredentialArgs]

The Image Registry parameters about the image to be cached.

images Sequence[str]

The images to be cached. The image name must be versioned.

resource_group_id str

The ID of the resource group.

retention_days int

The retention days of the image cache. Once the image cache expires, it will be cleared. By default, the image cache never expires. Note: The image cache that fails to be created is retained for only one day.

security_group_id str

The ID of the security group. You do not need to specify the same security group as the container group.

status str
vswitch_id str

The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.

zone_id str

The zone id to cache image.

containerGroupId String

The ID of the container group job that is used to create the image cache.

  • status -The status of the image cache.
eipInstanceId String

The instance ID of the Elastic IP Address (EIP). If you want to pull images from the Internet, you must specify an EIP to make sure that the container group can access the Internet. You can also configure the network address translation (NAT) gateway. We recommend that you configure the NAT gateway for the Internet access. Refer to Public Network Access Method

imageCacheName String

The name of the image cache.

imageCacheSize Number

The size of the image cache. Default to 20. Unit: GiB.

imageRegistryCredentials List<Property Map>

The Image Registry parameters about the image to be cached.

images List<String>

The images to be cached. The image name must be versioned.

resourceGroupId String

The ID of the resource group.

retentionDays Number

The retention days of the image cache. Once the image cache expires, it will be cleared. By default, the image cache never expires. Note: The image cache that fails to be created is retained for only one day.

securityGroupId String

The ID of the security group. You do not need to specify the same security group as the container group.

status String
vswitchId String

The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.

zoneId String

The zone id to cache image.

Supporting Types

ImageCacheImageRegistryCredential

Password string

The password of the Image Registry.

Server string

The address of Image Registry without http:// or https://.

UserName string

The user name of Image Registry.

Password string

The password of the Image Registry.

Server string

The address of Image Registry without http:// or https://.

UserName string

The user name of Image Registry.

password String

The password of the Image Registry.

server String

The address of Image Registry without http:// or https://.

userName String

The user name of Image Registry.

password string

The password of the Image Registry.

server string

The address of Image Registry without http:// or https://.

userName string

The user name of Image Registry.

password str

The password of the Image Registry.

server str

The address of Image Registry without http:// or https://.

user_name str

The user name of Image Registry.

password String

The password of the Image Registry.

server String

The address of Image Registry without http:// or https://.

userName String

The user name of Image Registry.

Import

ECI Image Cache can be imported using the id, e.g.

 $ pulumi import alicloud:eci/imageCache:ImageCache example abc123456

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.