1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. eci
  5. ImageCache
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

alicloud.eci.ImageCache

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

    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 defaultZones = alicloud.eci.getZones({});
    const defaultNetwork = new alicloud.vpc.Network("defaultNetwork", {
        vpcName: name,
        cidrBlock: "10.0.0.0/8",
    });
    const defaultSwitch = new alicloud.vpc.Switch("defaultSwitch", {
        vswitchName: name,
        cidrBlock: "10.1.0.0/16",
        vpcId: defaultNetwork.id,
        zoneId: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.zoneIds?.[0]),
    });
    const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("defaultSecurityGroup", {vpcId: defaultNetwork.id});
    const defaultEipAddress = new alicloud.ecs.EipAddress("defaultEipAddress", {
        isp: "BGP",
        addressName: name,
        netmode: "public",
        bandwidth: "1",
        securityProtectionTypes: ["AntiDDoS_Enhanced"],
        paymentType: "PayAsYouGo",
    });
    const defaultRegions = alicloud.getRegions({
        current: true,
    });
    const defaultImageCache = new alicloud.eci.ImageCache("defaultImageCache", {
        imageCacheName: name,
        images: [defaultRegions.then(defaultRegions => `registry-vpc.${defaultRegions.regions?.[0]?.id}.aliyuncs.com/eci_open/nginx:alpine`)],
        securityGroupId: defaultSecurityGroup.id,
        vswitchId: defaultSwitch.id,
        eipInstanceId: defaultEipAddress.id,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default_zones = alicloud.eci.get_zones()
    default_network = alicloud.vpc.Network("defaultNetwork",
        vpc_name=name,
        cidr_block="10.0.0.0/8")
    default_switch = alicloud.vpc.Switch("defaultSwitch",
        vswitch_name=name,
        cidr_block="10.1.0.0/16",
        vpc_id=default_network.id,
        zone_id=default_zones.zones[0].zone_ids[0])
    default_security_group = alicloud.ecs.SecurityGroup("defaultSecurityGroup", vpc_id=default_network.id)
    default_eip_address = alicloud.ecs.EipAddress("defaultEipAddress",
        isp="BGP",
        address_name=name,
        netmode="public",
        bandwidth="1",
        security_protection_types=["AntiDDoS_Enhanced"],
        payment_type="PayAsYouGo")
    default_regions = alicloud.get_regions(current=True)
    default_image_cache = alicloud.eci.ImageCache("defaultImageCache",
        image_cache_name=name,
        images=[f"registry-vpc.{default_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)
    
    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
    		}
    		defaultZones, err := eci.GetZones(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(name),
    			CidrBlock: pulumi.String("10.0.0.0/8"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSwitch, err := vpc.NewSwitch(ctx, "defaultSwitch", &vpc.SwitchArgs{
    			VswitchName: pulumi.String(name),
    			CidrBlock:   pulumi.String("10.1.0.0/16"),
    			VpcId:       defaultNetwork.ID(),
    			ZoneId:      pulumi.String(defaultZones.Zones[0].ZoneIds[0]),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSecurityGroup, err := ecs.NewSecurityGroup(ctx, "defaultSecurityGroup", &ecs.SecurityGroupArgs{
    			VpcId: defaultNetwork.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		defaultEipAddress, err := ecs.NewEipAddress(ctx, "defaultEipAddress", &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
    		}
    		defaultRegions, err := alicloud.GetRegions(ctx, &alicloud.GetRegionsArgs{
    			Current: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = eci.NewImageCache(ctx, "defaultImageCache", &eci.ImageCacheArgs{
    			ImageCacheName: pulumi.String(name),
    			Images: pulumi.StringArray{
    				pulumi.String(fmt.Sprintf("registry-vpc.%v.aliyuncs.com/eci_open/nginx:alpine", defaultRegions.Regions[0].Id)),
    			},
    			SecurityGroupId: defaultSecurityGroup.ID(),
    			VswitchId:       defaultSwitch.ID(),
    			EipInstanceId:   defaultEipAddress.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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 defaultZones = AliCloud.Eci.GetZones.Invoke();
    
        var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
        {
            VpcName = name,
            CidrBlock = "10.0.0.0/8",
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new()
        {
            VswitchName = name,
            CidrBlock = "10.1.0.0/16",
            VpcId = defaultNetwork.Id,
            ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.ZoneIds[0]),
        });
    
        var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("defaultSecurityGroup", new()
        {
            VpcId = defaultNetwork.Id,
        });
    
        var defaultEipAddress = new AliCloud.Ecs.EipAddress("defaultEipAddress", new()
        {
            Isp = "BGP",
            AddressName = name,
            Netmode = "public",
            Bandwidth = "1",
            SecurityProtectionTypes = new[]
            {
                "AntiDDoS_Enhanced",
            },
            PaymentType = "PayAsYouGo",
        });
    
        var defaultRegions = AliCloud.GetRegions.Invoke(new()
        {
            Current = true,
        });
    
        var defaultImageCache = new AliCloud.Eci.ImageCache("defaultImageCache", new()
        {
            ImageCacheName = name,
            Images = new[]
            {
                $"registry-vpc.{defaultRegions.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)}.aliyuncs.com/eci_open/nginx:alpine",
            },
            SecurityGroupId = defaultSecurityGroup.Id,
            VswitchId = defaultSwitch.Id,
            EipInstanceId = defaultEipAddress.Id,
        });
    
    });
    
    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 defaultZones = 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(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].zoneIds()[0]))
                .build());
    
            var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()        
                .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 defaultRegions = 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", defaultRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].id())))
                .securityGroupId(defaultSecurityGroup.id())
                .vswitchId(defaultSwitch.id())
                .eipInstanceId(defaultEipAddress.id())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      defaultNetwork:
        type: alicloud:vpc:Network
        properties:
          vpcName: ${name}
          cidrBlock: 10.0.0.0/8
      defaultSwitch:
        type: alicloud:vpc:Switch
        properties:
          vswitchName: ${name}
          cidrBlock: 10.1.0.0/16
          vpcId: ${defaultNetwork.id}
          zoneId: ${defaultZones.zones[0].zoneIds[0]}
      defaultSecurityGroup:
        type: alicloud:ecs:SecurityGroup
        properties:
          vpcId: ${defaultNetwork.id}
      defaultEipAddress:
        type: alicloud:ecs:EipAddress
        properties:
          isp: BGP
          addressName: ${name}
          netmode: public
          bandwidth: '1'
          securityProtectionTypes:
            - AntiDDoS_Enhanced
          paymentType: PayAsYouGo
      defaultImageCache:
        type: alicloud:eci:ImageCache
        properties:
          imageCacheName: ${name}
          images:
            - registry-vpc.${defaultRegions.regions[0].id}.aliyuncs.com/eci_open/nginx:alpine
          securityGroupId: ${defaultSecurityGroup.id}
          vswitchId: ${defaultSwitch.id}
          eipInstanceId: ${defaultEipAddress.id}
    variables:
      defaultZones:
        fn::invoke:
          Function: alicloud:eci:getZones
          Arguments: {}
      defaultRegions:
        fn::invoke:
          Function: alicloud:getRegions
          Arguments:
            current: true
    

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

    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",
    });
    
    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"),
    })
    
    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());
    
    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=[alicloud.eci.ImageCacheImageRegistryCredentialArgs(
            password="string",
            server="string",
            user_name="string",
        )],
        resource_group_id="string",
        retention_days=0,
        zone_id="string")
    
    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",
    });
    
    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
    

    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.ImageCacheImageRegistryCredential>
    The Image Registry parameters about the image to be cached. See image_registry_credential below.
    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. See image_registry_credential below.
    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<ImageCacheImageRegistryCredential>
    The Image Registry parameters about the image to be cached. See image_registry_credential below.
    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 ImageCacheImageRegistryCredential[]
    The Image Registry parameters about the image to be cached. See image_registry_credential below.
    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. See image_registry_credential below.
    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. See image_registry_credential below.
    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.
    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)
    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.
    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.ImageCacheImageRegistryCredential>
    The Image Registry parameters about the image to be cached. See image_registry_credential below.
    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
    The status of the image cache.
    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.
    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. See image_registry_credential below.
    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
    The status of the image cache.
    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.
    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<ImageCacheImageRegistryCredential>
    The Image Registry parameters about the image to be cached. See image_registry_credential below.
    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
    The status of the image cache.
    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.
    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 ImageCacheImageRegistryCredential[]
    The Image Registry parameters about the image to be cached. See image_registry_credential below.
    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
    The status of the image cache.
    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.
    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. See image_registry_credential below.
    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
    The status of the image cache.
    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.
    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. See image_registry_credential below.
    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
    The status of the image cache.
    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, 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
    

    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.
    alicloud logo
    Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi