1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. eci
  5. ImageCache
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.eci.ImageCache

Explore with Pulumi AI

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 since 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

Basic Usage

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

const config = new pulumi.Config();
const name = config.get("name") || "tf-example";
const _default = alicloud.eci.getZones({});
const defaultNetwork = new alicloud.vpc.Network("default", {
    vpcName: name,
    cidrBlock: "10.0.0.0/8",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
    vswitchName: name,
    cidrBlock: "10.1.0.0/16",
    vpcId: defaultNetwork.id,
    zoneId: _default.then(_default => _default.zones?.[0]?.zoneIds?.[0]),
});
const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("default", {
    name: name,
    vpcId: defaultNetwork.id,
});
const defaultEipAddress = new alicloud.ecs.EipAddress("default", {
    isp: "BGP",
    addressName: name,
    netmode: "public",
    bandwidth: "1",
    securityProtectionTypes: ["AntiDDoS_Enhanced"],
    paymentType: "PayAsYouGo",
});
const defaultGetRegions = alicloud.getRegions({
    current: true,
});
const defaultImageCache = new alicloud.eci.ImageCache("default", {
    imageCacheName: name,
    images: [defaultGetRegions.then(defaultGetRegions => `registry-vpc.${defaultGetRegions.regions?.[0]?.id}.aliyuncs.com/eci_open/nginx:alpine`)],
    securityGroupId: defaultSecurityGroup.id,
    vswitchId: defaultSwitch.id,
    eipInstanceId: defaultEipAddress.id,
});
Copy
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "tf-example"
default = alicloud.eci.get_zones()
default_network = alicloud.vpc.Network("default",
    vpc_name=name,
    cidr_block="10.0.0.0/8")
default_switch = alicloud.vpc.Switch("default",
    vswitch_name=name,
    cidr_block="10.1.0.0/16",
    vpc_id=default_network.id,
    zone_id=default.zones[0].zone_ids[0])
default_security_group = alicloud.ecs.SecurityGroup("default",
    name=name,
    vpc_id=default_network.id)
default_eip_address = alicloud.ecs.EipAddress("default",
    isp="BGP",
    address_name=name,
    netmode="public",
    bandwidth="1",
    security_protection_types=["AntiDDoS_Enhanced"],
    payment_type="PayAsYouGo")
default_get_regions = alicloud.get_regions(current=True)
default_image_cache = alicloud.eci.ImageCache("default",
    image_cache_name=name,
    images=[f"registry-vpc.{default_get_regions.regions[0].id}.aliyuncs.com/eci_open/nginx:alpine"],
    security_group_id=default_security_group.id,
    vswitch_id=default_switch.id,
    eip_instance_id=default_eip_address.id)
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/eci"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
	"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, "")
		name := "tf-example"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		_default, err := eci.GetZones(ctx, &eci.GetZonesArgs{}, nil)
		if err != nil {
			return err
		}
		defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
			VpcName:   pulumi.String(name),
			CidrBlock: pulumi.String("10.0.0.0/8"),
		})
		if err != nil {
			return err
		}
		defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
			VswitchName: pulumi.String(name),
			CidrBlock:   pulumi.String("10.1.0.0/16"),
			VpcId:       defaultNetwork.ID(),
			ZoneId:      pulumi.String(_default.Zones[0].ZoneIds[0]),
		})
		if err != nil {
			return err
		}
		defaultSecurityGroup, err := ecs.NewSecurityGroup(ctx, "default", &ecs.SecurityGroupArgs{
			Name:  pulumi.String(name),
			VpcId: defaultNetwork.ID(),
		})
		if err != nil {
			return err
		}
		defaultEipAddress, err := ecs.NewEipAddress(ctx, "default", &ecs.EipAddressArgs{
			Isp:         pulumi.String("BGP"),
			AddressName: pulumi.String(name),
			Netmode:     pulumi.String("public"),
			Bandwidth:   pulumi.String("1"),
			SecurityProtectionTypes: pulumi.StringArray{
				pulumi.String("AntiDDoS_Enhanced"),
			},
			PaymentType: pulumi.String("PayAsYouGo"),
		})
		if err != nil {
			return err
		}
		defaultGetRegions, err := alicloud.GetRegions(ctx, &alicloud.GetRegionsArgs{
			Current: pulumi.BoolRef(true),
		}, nil)
		if err != nil {
			return err
		}
		_, err = eci.NewImageCache(ctx, "default", &eci.ImageCacheArgs{
			ImageCacheName: pulumi.String(name),
			Images: pulumi.StringArray{
				pulumi.Sprintf("registry-vpc.%v.aliyuncs.com/eci_open/nginx:alpine", defaultGetRegions.Regions[0].Id),
			},
			SecurityGroupId: defaultSecurityGroup.ID(),
			VswitchId:       defaultSwitch.ID(),
			EipInstanceId:   defaultEipAddress.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var name = config.Get("name") ?? "tf-example";
    var @default = AliCloud.Eci.GetZones.Invoke();

    var defaultNetwork = new AliCloud.Vpc.Network("default", new()
    {
        VpcName = name,
        CidrBlock = "10.0.0.0/8",
    });

    var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
    {
        VswitchName = name,
        CidrBlock = "10.1.0.0/16",
        VpcId = defaultNetwork.Id,
        ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.ZoneIds[0])),
    });

    var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("default", new()
    {
        Name = name,
        VpcId = defaultNetwork.Id,
    });

    var defaultEipAddress = new AliCloud.Ecs.EipAddress("default", new()
    {
        Isp = "BGP",
        AddressName = name,
        Netmode = "public",
        Bandwidth = "1",
        SecurityProtectionTypes = new[]
        {
            "AntiDDoS_Enhanced",
        },
        PaymentType = "PayAsYouGo",
    });

    var defaultGetRegions = AliCloud.GetRegions.Invoke(new()
    {
        Current = true,
    });

    var defaultImageCache = new AliCloud.Eci.ImageCache("default", new()
    {
        ImageCacheName = name,
        Images = new[]
        {
            $"registry-vpc.{defaultGetRegions.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)}.aliyuncs.com/eci_open/nginx:alpine",
        },
        SecurityGroupId = defaultSecurityGroup.Id,
        VswitchId = defaultSwitch.Id,
        EipInstanceId = defaultEipAddress.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.eci.EciFunctions;
import com.pulumi.alicloud.eci.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.ecs.EipAddress;
import com.pulumi.alicloud.ecs.EipAddressArgs;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetRegionsArgs;
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) {
        final var config = ctx.config();
        final var name = config.get("name").orElse("tf-example");
        final var default = EciFunctions.getZones();

        var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
            .vpcName(name)
            .cidrBlock("10.0.0.0/8")
            .build());

        var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
            .vswitchName(name)
            .cidrBlock("10.1.0.0/16")
            .vpcId(defaultNetwork.id())
            .zoneId(default_.zones()[0].zoneIds()[0])
            .build());

        var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
            .name(name)
            .vpcId(defaultNetwork.id())
            .build());

        var defaultEipAddress = new EipAddress("defaultEipAddress", EipAddressArgs.builder()
            .isp("BGP")
            .addressName(name)
            .netmode("public")
            .bandwidth("1")
            .securityProtectionTypes("AntiDDoS_Enhanced")
            .paymentType("PayAsYouGo")
            .build());

        final var defaultGetRegions = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
            .current(true)
            .build());

        var defaultImageCache = new ImageCache("defaultImageCache", ImageCacheArgs.builder()
            .imageCacheName(name)
            .images(String.format("registry-vpc.%s.aliyuncs.com/eci_open/nginx:alpine", defaultGetRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].id())))
            .securityGroupId(defaultSecurityGroup.id())
            .vswitchId(defaultSwitch.id())
            .eipInstanceId(defaultEipAddress.id())
            .build());

    }
}
Copy
configuration:
  name:
    type: string
    default: tf-example
resources:
  defaultNetwork:
    type: alicloud:vpc:Network
    name: default
    properties:
      vpcName: ${name}
      cidrBlock: 10.0.0.0/8
  defaultSwitch:
    type: alicloud:vpc:Switch
    name: default
    properties:
      vswitchName: ${name}
      cidrBlock: 10.1.0.0/16
      vpcId: ${defaultNetwork.id}
      zoneId: ${default.zones[0].zoneIds[0]}
  defaultSecurityGroup:
    type: alicloud:ecs:SecurityGroup
    name: default
    properties:
      name: ${name}
      vpcId: ${defaultNetwork.id}
  defaultEipAddress:
    type: alicloud:ecs:EipAddress
    name: default
    properties:
      isp: BGP
      addressName: ${name}
      netmode: public
      bandwidth: '1'
      securityProtectionTypes:
        - AntiDDoS_Enhanced
      paymentType: PayAsYouGo
  defaultImageCache:
    type: alicloud:eci:ImageCache
    name: default
    properties:
      imageCacheName: ${name}
      images:
        - registry-vpc.${defaultGetRegions.regions[0].id}.aliyuncs.com/eci_open/nginx:alpine
      securityGroupId: ${defaultSecurityGroup.id}
      vswitchId: ${defaultSwitch.id}
      eipInstanceId: ${defaultEipAddress.id}
variables:
  default:
    fn::invoke:
      function: alicloud:eci:getZones
      arguments: {}
  defaultGetRegions:
    fn::invoke:
      function: alicloud:getRegions
      arguments:
        current: true
Copy

Create ImageCache Resource

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

Constructor syntax

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

@overload
def ImageCache(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               image_cache_name: Optional[str] = None,
               images: Optional[Sequence[str]] = None,
               security_group_id: Optional[str] = None,
               vswitch_id: Optional[str] = None,
               eip_instance_id: Optional[str] = None,
               image_cache_size: Optional[int] = None,
               image_registry_credentials: Optional[Sequence[ImageCacheImageRegistryCredentialArgs]] = None,
               resource_group_id: Optional[str] = None,
               retention_days: Optional[int] = None,
               zone_id: Optional[str] = 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.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ImageCacheArgs
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. 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 This property is required. string
The unique name of the resource.
args This property is required. ImageCacheArgs
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. ImageCacheArgs
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. ImageCacheArgs
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 imageCacheResource = new AliCloud.Eci.ImageCache("imageCacheResource", new()
{
    ImageCacheName = "string",
    Images = new[]
    {
        "string",
    },
    SecurityGroupId = "string",
    VswitchId = "string",
    EipInstanceId = "string",
    ImageCacheSize = 0,
    ImageRegistryCredentials = new[]
    {
        new AliCloud.Eci.Inputs.ImageCacheImageRegistryCredentialArgs
        {
            Password = "string",
            Server = "string",
            UserName = "string",
        },
    },
    ResourceGroupId = "string",
    RetentionDays = 0,
    ZoneId = "string",
});
Copy
example, err := eci.NewImageCache(ctx, "imageCacheResource", &eci.ImageCacheArgs{
	ImageCacheName: pulumi.String("string"),
	Images: pulumi.StringArray{
		pulumi.String("string"),
	},
	SecurityGroupId: pulumi.String("string"),
	VswitchId:       pulumi.String("string"),
	EipInstanceId:   pulumi.String("string"),
	ImageCacheSize:  pulumi.Int(0),
	ImageRegistryCredentials: eci.ImageCacheImageRegistryCredentialArray{
		&eci.ImageCacheImageRegistryCredentialArgs{
			Password: pulumi.String("string"),
			Server:   pulumi.String("string"),
			UserName: pulumi.String("string"),
		},
	},
	ResourceGroupId: pulumi.String("string"),
	RetentionDays:   pulumi.Int(0),
	ZoneId:          pulumi.String("string"),
})
Copy
var imageCacheResource = new ImageCache("imageCacheResource", ImageCacheArgs.builder()
    .imageCacheName("string")
    .images("string")
    .securityGroupId("string")
    .vswitchId("string")
    .eipInstanceId("string")
    .imageCacheSize(0)
    .imageRegistryCredentials(ImageCacheImageRegistryCredentialArgs.builder()
        .password("string")
        .server("string")
        .userName("string")
        .build())
    .resourceGroupId("string")
    .retentionDays(0)
    .zoneId("string")
    .build());
Copy
image_cache_resource = alicloud.eci.ImageCache("imageCacheResource",
    image_cache_name="string",
    images=["string"],
    security_group_id="string",
    vswitch_id="string",
    eip_instance_id="string",
    image_cache_size=0,
    image_registry_credentials=[{
        "password": "string",
        "server": "string",
        "user_name": "string",
    }],
    resource_group_id="string",
    retention_days=0,
    zone_id="string")
Copy
const imageCacheResource = new alicloud.eci.ImageCache("imageCacheResource", {
    imageCacheName: "string",
    images: ["string"],
    securityGroupId: "string",
    vswitchId: "string",
    eipInstanceId: "string",
    imageCacheSize: 0,
    imageRegistryCredentials: [{
        password: "string",
        server: "string",
        userName: "string",
    }],
    resourceGroupId: "string",
    retentionDays: 0,
    zoneId: "string",
});
Copy
type: alicloud:eci:ImageCache
properties:
    eipInstanceId: string
    imageCacheName: string
    imageCacheSize: 0
    imageRegistryCredentials:
        - password: string
          server: string
          userName: string
    images:
        - string
    resourceGroupId: string
    retentionDays: 0
    securityGroupId: string
    vswitchId: string
    zoneId: string
Copy

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

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ImageCache resource accepts the following input properties:

ImageCacheName
This property is required.
Changes to this property will trigger replacement.
string
The name of the image cache.
Images
This property is required.
Changes to this property will trigger replacement.
List<string>
The images to be cached. The image name must be versioned.
SecurityGroupId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the security group. You do not need to specify the same security group as the container group.
VswitchId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
EipInstanceId Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. int
The size of the image cache. Default to 20. Unit: GiB.
ImageRegistryCredentials Changes to this property will trigger replacement. List<Pulumi.AliCloud.Eci.Inputs.ImageCacheImageRegistryCredential>
The Image Registry parameters about the image to be cached. See image_registry_credential below.
ResourceGroupId Changes to this property will trigger replacement. string
The ID of the resource group.
RetentionDays Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The zone id to cache image.
ImageCacheName
This property is required.
Changes to this property will trigger replacement.
string
The name of the image cache.
Images
This property is required.
Changes to this property will trigger replacement.
[]string
The images to be cached. The image name must be versioned.
SecurityGroupId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the security group. You do not need to specify the same security group as the container group.
VswitchId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
EipInstanceId Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. int
The size of the image cache. Default to 20. Unit: GiB.
ImageRegistryCredentials Changes to this property will trigger replacement. []ImageCacheImageRegistryCredentialArgs
The Image Registry parameters about the image to be cached. See image_registry_credential below.
ResourceGroupId Changes to this property will trigger replacement. string
The ID of the resource group.
RetentionDays Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The zone id to cache image.
imageCacheName
This property is required.
Changes to this property will trigger replacement.
String
The name of the image cache.
images
This property is required.
Changes to this property will trigger replacement.
List<String>
The images to be cached. The image name must be versioned.
securityGroupId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the security group. You do not need to specify the same security group as the container group.
vswitchId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
eipInstanceId Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. Integer
The size of the image cache. Default to 20. Unit: GiB.
imageRegistryCredentials Changes to this property will trigger replacement. List<ImageCacheImageRegistryCredential>
The Image Registry parameters about the image to be cached. See image_registry_credential below.
resourceGroupId Changes to this property will trigger replacement. String
The ID of the resource group.
retentionDays Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The zone id to cache image.
imageCacheName
This property is required.
Changes to this property will trigger replacement.
string
The name of the image cache.
images
This property is required.
Changes to this property will trigger replacement.
string[]
The images to be cached. The image name must be versioned.
securityGroupId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the security group. You do not need to specify the same security group as the container group.
vswitchId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
eipInstanceId Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. number
The size of the image cache. Default to 20. Unit: GiB.
imageRegistryCredentials Changes to this property will trigger replacement. ImageCacheImageRegistryCredential[]
The Image Registry parameters about the image to be cached. See image_registry_credential below.
resourceGroupId Changes to this property will trigger replacement. string
The ID of the resource group.
retentionDays Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The zone id to cache image.
image_cache_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the image cache.
images
This property is required.
Changes to this property will trigger replacement.
Sequence[str]
The images to be cached. The image name must be versioned.
security_group_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the security group. You do not need to specify the same security group as the container group.
vswitch_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
eip_instance_id Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. int
The size of the image cache. Default to 20. Unit: GiB.
image_registry_credentials Changes to this property will trigger replacement. Sequence[ImageCacheImageRegistryCredentialArgs]
The Image Registry parameters about the image to be cached. See image_registry_credential below.
resource_group_id Changes to this property will trigger replacement. str
The ID of the resource group.
retention_days Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
The zone id to cache image.
imageCacheName
This property is required.
Changes to this property will trigger replacement.
String
The name of the image cache.
images
This property is required.
Changes to this property will trigger replacement.
List<String>
The images to be cached. The image name must be versioned.
securityGroupId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the security group. You do not need to specify the same security group as the container group.
vswitchId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
eipInstanceId Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. Number
The size of the image cache. Default to 20. Unit: GiB.
imageRegistryCredentials Changes to this property will trigger replacement. List<Property Map>
The Image Registry parameters about the image to be cached. See image_registry_credential below.
resourceGroupId Changes to this property will trigger replacement. String
The ID of the resource group.
retentionDays Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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.
Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the image cache.
ContainerGroupId string
The ID of the container group job that is used to create the image cache.
Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the image cache.
containerGroupId String
The ID of the container group job that is used to create the image cache.
id String
The provider-assigned unique ID for this managed resource.
status String
The status of the image cache.
containerGroupId string
The ID of the container group job that is used to create the image cache.
id string
The provider-assigned unique ID for this managed resource.
status string
The status of the image cache.
container_group_id str
The ID of the container group job that is used to create the image cache.
id str
The provider-assigned unique ID for this managed resource.
status str
The status of the image cache.
containerGroupId String
The ID of the container group job that is used to create the image cache.
id String
The provider-assigned unique ID for this managed resource.
status String
The status of the image cache.

Look up 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)
resources:  _:    type: alicloud:eci:ImageCache    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:
ContainerGroupId string
The ID of the container group job that is used to create the image cache.
EipInstanceId Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The name of the image cache.
ImageCacheSize Changes to this property will trigger replacement. int
The size of the image cache. Default to 20. Unit: GiB.
ImageRegistryCredentials Changes to this property will trigger replacement. List<Pulumi.AliCloud.Eci.Inputs.ImageCacheImageRegistryCredential>
The Image Registry parameters about the image to be cached. See image_registry_credential below.
Images Changes to this property will trigger replacement. List<string>
The images to be cached. The image name must be versioned.
ResourceGroupId Changes to this property will trigger replacement. string
The ID of the resource group.
RetentionDays Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The ID of the security group. You do not need to specify the same security group as the container group.
Status string
The status of the image cache.
VswitchId Changes to this property will trigger replacement. string
The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
ZoneId Changes to this property will trigger replacement. string
The zone id to cache image.
ContainerGroupId string
The ID of the container group job that is used to create the image cache.
EipInstanceId Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The name of the image cache.
ImageCacheSize Changes to this property will trigger replacement. int
The size of the image cache. Default to 20. Unit: GiB.
ImageRegistryCredentials Changes to this property will trigger replacement. []ImageCacheImageRegistryCredentialArgs
The Image Registry parameters about the image to be cached. See image_registry_credential below.
Images Changes to this property will trigger replacement. []string
The images to be cached. The image name must be versioned.
ResourceGroupId Changes to this property will trigger replacement. string
The ID of the resource group.
RetentionDays Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The ID of the security group. You do not need to specify the same security group as the container group.
Status string
The status of the image cache.
VswitchId Changes to this property will trigger replacement. string
The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
ZoneId Changes to this property will trigger replacement. string
The zone id to cache image.
containerGroupId String
The ID of the container group job that is used to create the image cache.
eipInstanceId Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The name of the image cache.
imageCacheSize Changes to this property will trigger replacement. Integer
The size of the image cache. Default to 20. Unit: GiB.
imageRegistryCredentials Changes to this property will trigger replacement. List<ImageCacheImageRegistryCredential>
The Image Registry parameters about the image to be cached. See image_registry_credential below.
images Changes to this property will trigger replacement. List<String>
The images to be cached. The image name must be versioned.
resourceGroupId Changes to this property will trigger replacement. String
The ID of the resource group.
retentionDays Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The ID of the security group. You do not need to specify the same security group as the container group.
status String
The status of the image cache.
vswitchId Changes to this property will trigger replacement. String
The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
zoneId Changes to this property will trigger replacement. String
The zone id to cache image.
containerGroupId string
The ID of the container group job that is used to create the image cache.
eipInstanceId Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The name of the image cache.
imageCacheSize Changes to this property will trigger replacement. number
The size of the image cache. Default to 20. Unit: GiB.
imageRegistryCredentials Changes to this property will trigger replacement. ImageCacheImageRegistryCredential[]
The Image Registry parameters about the image to be cached. See image_registry_credential below.
images Changes to this property will trigger replacement. string[]
The images to be cached. The image name must be versioned.
resourceGroupId Changes to this property will trigger replacement. string
The ID of the resource group.
retentionDays Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The ID of the security group. You do not need to specify the same security group as the container group.
status string
The status of the image cache.
vswitchId Changes to this property will trigger replacement. string
The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
zoneId Changes to this property will trigger replacement. 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.
eip_instance_id Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
The name of the image cache.
image_cache_size Changes to this property will trigger replacement. int
The size of the image cache. Default to 20. Unit: GiB.
image_registry_credentials Changes to this property will trigger replacement. Sequence[ImageCacheImageRegistryCredentialArgs]
The Image Registry parameters about the image to be cached. See image_registry_credential below.
images Changes to this property will trigger replacement. Sequence[str]
The images to be cached. The image name must be versioned.
resource_group_id Changes to this property will trigger replacement. str
The ID of the resource group.
retention_days Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
The ID of the security group. You do not need to specify the same security group as the container group.
status str
The status of the image cache.
vswitch_id Changes to this property will trigger replacement. str
The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
zone_id Changes to this property will trigger replacement. str
The zone id to cache image.
containerGroupId String
The ID of the container group job that is used to create the image cache.
eipInstanceId Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The name of the image cache.
imageCacheSize Changes to this property will trigger replacement. Number
The size of the image cache. Default to 20. Unit: GiB.
imageRegistryCredentials Changes to this property will trigger replacement. List<Property Map>
The Image Registry parameters about the image to be cached. See image_registry_credential below.
images Changes to this property will trigger replacement. List<String>
The images to be cached. The image name must be versioned.
resourceGroupId Changes to this property will trigger replacement. String
The ID of the resource group.
retentionDays Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The ID of the security group. You do not need to specify the same security group as the container group.
status String
The status of the image cache.
vswitchId Changes to this property will trigger replacement. String
The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
zoneId Changes to this property will trigger replacement. String
The zone id to cache image.

Supporting Types

ImageCacheImageRegistryCredential
, ImageCacheImageRegistryCredentialArgs

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
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.