1. Packages
  2. AWS Cloud Control
  3. API Docs
  4. ecr
  5. PullThroughCacheRule

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.26.0 published on Wednesday, Mar 12, 2025 by Pulumi

aws-native.ecr.PullThroughCacheRule

Explore with Pulumi AI

aws-native logo

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.26.0 published on Wednesday, Mar 12, 2025 by Pulumi

    The AWS::ECR::PullThroughCacheRule resource creates or updates a pull through cache rule. A pull through cache rule provides a way to cache images from an upstream registry in your Amazon ECR private registry.

    Example Usage

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var myECRPullThroughCacheRule = new AwsNative.Ecr.PullThroughCacheRule("myECRPullThroughCacheRule", new()
        {
            EcrRepositoryPrefix = "my-ecr",
            UpstreamRegistryUrl = "public.ecr.aws",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/ecr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecr.NewPullThroughCacheRule(ctx, "myECRPullThroughCacheRule", &ecr.PullThroughCacheRuleArgs{
    			EcrRepositoryPrefix: pulumi.String("my-ecr"),
    			UpstreamRegistryUrl: pulumi.String("public.ecr.aws"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const myECRPullThroughCacheRule = new aws_native.ecr.PullThroughCacheRule("myECRPullThroughCacheRule", {
        ecrRepositoryPrefix: "my-ecr",
        upstreamRegistryUrl: "public.ecr.aws",
    });
    
    import pulumi
    import pulumi_aws_native as aws_native
    
    my_ecr_pull_through_cache_rule = aws_native.ecr.PullThroughCacheRule("myECRPullThroughCacheRule",
        ecr_repository_prefix="my-ecr",
        upstream_registry_url="public.ecr.aws")
    

    Coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var myECRPullThroughCacheRule = new AwsNative.Ecr.PullThroughCacheRule("myECRPullThroughCacheRule", new()
        {
            EcrRepositoryPrefix = "my-ecr",
            UpstreamRegistryUrl = "public.ecr.aws",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/ecr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecr.NewPullThroughCacheRule(ctx, "myECRPullThroughCacheRule", &ecr.PullThroughCacheRuleArgs{
    			EcrRepositoryPrefix: pulumi.String("my-ecr"),
    			UpstreamRegistryUrl: pulumi.String("public.ecr.aws"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const myECRPullThroughCacheRule = new aws_native.ecr.PullThroughCacheRule("myECRPullThroughCacheRule", {
        ecrRepositoryPrefix: "my-ecr",
        upstreamRegistryUrl: "public.ecr.aws",
    });
    
    import pulumi
    import pulumi_aws_native as aws_native
    
    my_ecr_pull_through_cache_rule = aws_native.ecr.PullThroughCacheRule("myECRPullThroughCacheRule",
        ecr_repository_prefix="my-ecr",
        upstream_registry_url="public.ecr.aws")
    

    Coming soon!

    Create PullThroughCacheRule Resource

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

    Constructor syntax

    new PullThroughCacheRule(name: string, args?: PullThroughCacheRuleArgs, opts?: CustomResourceOptions);
    @overload
    def PullThroughCacheRule(resource_name: str,
                             args: Optional[PullThroughCacheRuleArgs] = None,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def PullThroughCacheRule(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             credential_arn: Optional[str] = None,
                             custom_role_arn: Optional[str] = None,
                             ecr_repository_prefix: Optional[str] = None,
                             upstream_registry: Optional[str] = None,
                             upstream_registry_url: Optional[str] = None,
                             upstream_repository_prefix: Optional[str] = None)
    func NewPullThroughCacheRule(ctx *Context, name string, args *PullThroughCacheRuleArgs, opts ...ResourceOption) (*PullThroughCacheRule, error)
    public PullThroughCacheRule(string name, PullThroughCacheRuleArgs? args = null, CustomResourceOptions? opts = null)
    public PullThroughCacheRule(String name, PullThroughCacheRuleArgs args)
    public PullThroughCacheRule(String name, PullThroughCacheRuleArgs args, CustomResourceOptions options)
    
    type: aws-native:ecr:PullThroughCacheRule
    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 PullThroughCacheRuleArgs
    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 PullThroughCacheRuleArgs
    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 PullThroughCacheRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PullThroughCacheRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PullThroughCacheRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    CredentialArn string
    The ARN of the Secrets Manager secret associated with the pull through cache rule.
    CustomRoleArn string
    EcrRepositoryPrefix string
    The Amazon ECR repository prefix associated with the pull through cache rule.
    UpstreamRegistry string
    The name of the upstream source registry associated with the pull through cache rule.
    UpstreamRegistryUrl string
    The upstream registry URL associated with the pull through cache rule.
    UpstreamRepositoryPrefix string
    CredentialArn string
    The ARN of the Secrets Manager secret associated with the pull through cache rule.
    CustomRoleArn string
    EcrRepositoryPrefix string
    The Amazon ECR repository prefix associated with the pull through cache rule.
    UpstreamRegistry string
    The name of the upstream source registry associated with the pull through cache rule.
    UpstreamRegistryUrl string
    The upstream registry URL associated with the pull through cache rule.
    UpstreamRepositoryPrefix string
    credentialArn String
    The ARN of the Secrets Manager secret associated with the pull through cache rule.
    customRoleArn String
    ecrRepositoryPrefix String
    The Amazon ECR repository prefix associated with the pull through cache rule.
    upstreamRegistry String
    The name of the upstream source registry associated with the pull through cache rule.
    upstreamRegistryUrl String
    The upstream registry URL associated with the pull through cache rule.
    upstreamRepositoryPrefix String
    credentialArn string
    The ARN of the Secrets Manager secret associated with the pull through cache rule.
    customRoleArn string
    ecrRepositoryPrefix string
    The Amazon ECR repository prefix associated with the pull through cache rule.
    upstreamRegistry string
    The name of the upstream source registry associated with the pull through cache rule.
    upstreamRegistryUrl string
    The upstream registry URL associated with the pull through cache rule.
    upstreamRepositoryPrefix string
    credential_arn str
    The ARN of the Secrets Manager secret associated with the pull through cache rule.
    custom_role_arn str
    ecr_repository_prefix str
    The Amazon ECR repository prefix associated with the pull through cache rule.
    upstream_registry str
    The name of the upstream source registry associated with the pull through cache rule.
    upstream_registry_url str
    The upstream registry URL associated with the pull through cache rule.
    upstream_repository_prefix str
    credentialArn String
    The ARN of the Secrets Manager secret associated with the pull through cache rule.
    customRoleArn String
    ecrRepositoryPrefix String
    The Amazon ECR repository prefix associated with the pull through cache rule.
    upstreamRegistry String
    The name of the upstream source registry associated with the pull through cache rule.
    upstreamRegistryUrl String
    The upstream registry URL associated with the pull through cache rule.
    upstreamRepositoryPrefix String

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo

    We recommend new projects start with resources from the AWS provider.

    AWS Cloud Control v1.26.0 published on Wednesday, Mar 12, 2025 by Pulumi