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,
});
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)
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
})
}
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,
});
});
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());
}
}
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
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.
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",
});
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=[{
"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
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:
- Image
Cache stringName - The name of the image cache.
- Images List<string>
- The images to be cached. The image name must be versioned.
- Security
Group stringId - The ID of the security group. You do not need to specify the same security group as the container group.
- Vswitch
Id string - The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
- Eip
Instance stringId - 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 intSize - The size of the image cache. Default to
20
. Unit: GiB. - Image
Registry List<Pulumi.Credentials Ali Cloud. Eci. Inputs. Image Cache Image Registry Credential> - The Image Registry parameters about the image to be cached. See
image_registry_credential
below. - Resource
Group stringId - 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 string - The zone id to cache image.
- Image
Cache stringName - The name of the image cache.
- Images []string
- The images to be cached. The image name must be versioned.
- Security
Group stringId - The ID of the security group. You do not need to specify the same security group as the container group.
- Vswitch
Id string - The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
- Eip
Instance stringId - 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 intSize - The size of the image cache. Default to
20
. Unit: GiB. - Image
Registry []ImageCredentials Cache Image Registry Credential Args - The Image Registry parameters about the image to be cached. See
image_registry_credential
below. - Resource
Group stringId - 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 string - The zone id to cache image.
- image
Cache StringName - The name of the image cache.
- images List<String>
- The images to be cached. The image name must be versioned.
- security
Group StringId - The ID of the security group. You do not need to specify the same security group as the container group.
- vswitch
Id String - The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
- eip
Instance StringId - 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 IntegerSize - The size of the image cache. Default to
20
. Unit: GiB. - image
Registry List<ImageCredentials Cache Image Registry Credential> - The Image Registry parameters about the image to be cached. See
image_registry_credential
below. - resource
Group StringId - The ID of the resource group.
- retention
Days 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.
- zone
Id String - The zone id to cache image.
- image
Cache stringName - The name of the image cache.
- images string[]
- The images to be cached. The image name must be versioned.
- security
Group stringId - The ID of the security group. You do not need to specify the same security group as the container group.
- vswitch
Id string - The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
- eip
Instance stringId - 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 numberSize - The size of the image cache. Default to
20
. Unit: GiB. - image
Registry ImageCredentials Cache Image Registry Credential[] - The Image Registry parameters about the image to be cached. See
image_registry_credential
below. - resource
Group stringId - The ID of the resource group.
- retention
Days 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.
- zone
Id string - The zone id to cache image.
- image_
cache_ strname - The name of the image cache.
- images Sequence[str]
- The images to be cached. The image name must be versioned.
- security_
group_ strid - 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_ strid - 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_ intsize - The size of the image cache. Default to
20
. Unit: GiB. - image_
registry_ Sequence[Imagecredentials Cache Image Registry Credential Args] - The Image Registry parameters about the image to be cached. See
image_registry_credential
below. - resource_
group_ strid - 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.
- image
Cache StringName - The name of the image cache.
- images List<String>
- The images to be cached. The image name must be versioned.
- security
Group StringId - The ID of the security group. You do not need to specify the same security group as the container group.
- vswitch
Id String - The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
- eip
Instance StringId - 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 NumberSize - The size of the image cache. Default to
20
. Unit: GiB. - image
Registry List<Property Map>Credentials - The Image Registry parameters about the image to be cached. See
image_registry_credential
below. - resource
Group StringId - The ID of the resource group.
- retention
Days 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.
- zone
Id 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:
- Container
Group stringId - 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 stringId - 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 StringId - 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 stringId - 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_ strid - 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.
- container
Group StringId - 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.
- Container
Group stringId - The ID of the container group job that is used to create the image cache.
- Eip
Instance stringId - 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 stringName - The name of the image cache.
- Image
Cache intSize - The size of the image cache. Default to
20
. Unit: GiB. - Image
Registry List<Pulumi.Credentials Ali Cloud. Eci. Inputs. Image Cache Image Registry Credential> - 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.
- Resource
Group stringId - 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 stringId - 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.
- Vswitch
Id string - The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
- Zone
Id string - The zone id to cache image.
- Container
Group stringId - The ID of the container group job that is used to create the image cache.
- Eip
Instance stringId - 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 stringName - The name of the image cache.
- Image
Cache intSize - The size of the image cache. Default to
20
. Unit: GiB. - Image
Registry []ImageCredentials Cache Image Registry Credential Args - 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.
- Resource
Group stringId - 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 stringId - 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.
- Vswitch
Id string - The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
- Zone
Id string - The zone id to cache image.
- container
Group StringId - The ID of the container group job that is used to create the image cache.
- eip
Instance StringId - 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 StringName - The name of the image cache.
- image
Cache IntegerSize - The size of the image cache. Default to
20
. Unit: GiB. - image
Registry List<ImageCredentials Cache Image Registry Credential> - 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.
- resource
Group StringId - The ID of the resource group.
- retention
Days 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.
- security
Group StringId - 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.
- vswitch
Id String - The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
- zone
Id String - The zone id to cache image.
- container
Group stringId - The ID of the container group job that is used to create the image cache.
- eip
Instance stringId - 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 stringName - The name of the image cache.
- image
Cache numberSize - The size of the image cache. Default to
20
. Unit: GiB. - image
Registry ImageCredentials Cache Image Registry Credential[] - 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.
- resource
Group stringId - The ID of the resource group.
- retention
Days 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.
- security
Group stringId - 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.
- vswitch
Id string - The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
- zone
Id string - The zone id to cache image.
- container_
group_ strid - The ID of the container group job that is used to create the image cache.
- eip_
instance_ strid - 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_ strname - The name of the image cache.
- image_
cache_ intsize - The size of the image cache. Default to
20
. Unit: GiB. - image_
registry_ Sequence[Imagecredentials Cache Image Registry Credential Args] - 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_ strid - 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_ strid - 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.
- container
Group StringId - The ID of the container group job that is used to create the image cache.
- eip
Instance StringId - 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 StringName - The name of the image cache.
- image
Cache NumberSize - The size of the image cache. Default to
20
. Unit: GiB. - image
Registry List<Property Map>Credentials - 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.
- resource
Group StringId - The ID of the resource group.
- retention
Days 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.
- security
Group StringId - 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.
- vswitch
Id String - The ID of the VSwitch. You do not need to specify the same VSwitch as the container group.
- zone
Id String - The zone id to cache image.
Supporting Types
ImageCacheImageRegistryCredential, ImageCacheImageRegistryCredentialArgs
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.