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

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi

aws.ecr.PullThroughCacheRule

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi

    Provides an Elastic Container Registry Pull Through Cache Rule.

    More information about pull through cache rules, including the set of supported upstream repositories, see Using pull through cache rules.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ecr.PullThroughCacheRule("example", {
        ecrRepositoryPrefix: "ecr-public",
        upstreamRegistryUrl: "public.ecr.aws",
        credentialArn: "arn:aws:secretsmanager:us-east-1:123456789:secret:ecr-pullthroughcache/ecrpublic",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ecr.PullThroughCacheRule("example",
        ecr_repository_prefix="ecr-public",
        upstream_registry_url="public.ecr.aws",
        credential_arn="arn:aws:secretsmanager:us-east-1:123456789:secret:ecr-pullthroughcache/ecrpublic")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecr.NewPullThroughCacheRule(ctx, "example", &ecr.PullThroughCacheRuleArgs{
    			EcrRepositoryPrefix: pulumi.String("ecr-public"),
    			UpstreamRegistryUrl: pulumi.String("public.ecr.aws"),
    			CredentialArn:       pulumi.String("arn:aws:secretsmanager:us-east-1:123456789:secret:ecr-pullthroughcache/ecrpublic"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Ecr.PullThroughCacheRule("example", new()
        {
            EcrRepositoryPrefix = "ecr-public",
            UpstreamRegistryUrl = "public.ecr.aws",
            CredentialArn = "arn:aws:secretsmanager:us-east-1:123456789:secret:ecr-pullthroughcache/ecrpublic",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ecr.PullThroughCacheRule;
    import com.pulumi.aws.ecr.PullThroughCacheRuleArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new PullThroughCacheRule("example", PullThroughCacheRuleArgs.builder()        
                .ecrRepositoryPrefix("ecr-public")
                .upstreamRegistryUrl("public.ecr.aws")
                .credentialArn("arn:aws:secretsmanager:us-east-1:123456789:secret:ecr-pullthroughcache/ecrpublic")
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:ecr:PullThroughCacheRule
        properties:
          ecrRepositoryPrefix: ecr-public
          upstreamRegistryUrl: public.ecr.aws
          credentialArn: arn:aws:secretsmanager:us-east-1:123456789:secret:ecr-pullthroughcache/ecrpublic
    

    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: PullThroughCacheRuleArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def PullThroughCacheRule(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             ecr_repository_prefix: Optional[str] = None,
                             upstream_registry_url: Optional[str] = None,
                             credential_arn: Optional[str] = None)
    func NewPullThroughCacheRule(ctx *Context, name string, args PullThroughCacheRuleArgs, opts ...ResourceOption) (*PullThroughCacheRule, error)
    public PullThroughCacheRule(string name, PullThroughCacheRuleArgs args, CustomResourceOptions? opts = null)
    public PullThroughCacheRule(String name, PullThroughCacheRuleArgs args)
    public PullThroughCacheRule(String name, PullThroughCacheRuleArgs args, CustomResourceOptions options)
    
    type: aws: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.

    Example

    The following reference example uses placeholder values for all input properties.

    var pullThroughCacheRuleResource = new Aws.Ecr.PullThroughCacheRule("pullThroughCacheRuleResource", new()
    {
        EcrRepositoryPrefix = "string",
        UpstreamRegistryUrl = "string",
        CredentialArn = "string",
    });
    
    example, err := ecr.NewPullThroughCacheRule(ctx, "pullThroughCacheRuleResource", &ecr.PullThroughCacheRuleArgs{
    	EcrRepositoryPrefix: pulumi.String("string"),
    	UpstreamRegistryUrl: pulumi.String("string"),
    	CredentialArn:       pulumi.String("string"),
    })
    
    var pullThroughCacheRuleResource = new PullThroughCacheRule("pullThroughCacheRuleResource", PullThroughCacheRuleArgs.builder()        
        .ecrRepositoryPrefix("string")
        .upstreamRegistryUrl("string")
        .credentialArn("string")
        .build());
    
    pull_through_cache_rule_resource = aws.ecr.PullThroughCacheRule("pullThroughCacheRuleResource",
        ecr_repository_prefix="string",
        upstream_registry_url="string",
        credential_arn="string")
    
    const pullThroughCacheRuleResource = new aws.ecr.PullThroughCacheRule("pullThroughCacheRuleResource", {
        ecrRepositoryPrefix: "string",
        upstreamRegistryUrl: "string",
        credentialArn: "string",
    });
    
    type: aws:ecr:PullThroughCacheRule
    properties:
        credentialArn: string
        ecrRepositoryPrefix: string
        upstreamRegistryUrl: string
    

    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

    The PullThroughCacheRule resource accepts the following input properties:

    EcrRepositoryPrefix string
    The repository name prefix to use when caching images from the source registry.
    UpstreamRegistryUrl string
    The registry URL of the upstream public registry to use as the source.
    CredentialArn string
    ARN of the Secret which will be used to authenticate against the registry.
    EcrRepositoryPrefix string
    The repository name prefix to use when caching images from the source registry.
    UpstreamRegistryUrl string
    The registry URL of the upstream public registry to use as the source.
    CredentialArn string
    ARN of the Secret which will be used to authenticate against the registry.
    ecrRepositoryPrefix String
    The repository name prefix to use when caching images from the source registry.
    upstreamRegistryUrl String
    The registry URL of the upstream public registry to use as the source.
    credentialArn String
    ARN of the Secret which will be used to authenticate against the registry.
    ecrRepositoryPrefix string
    The repository name prefix to use when caching images from the source registry.
    upstreamRegistryUrl string
    The registry URL of the upstream public registry to use as the source.
    credentialArn string
    ARN of the Secret which will be used to authenticate against the registry.
    ecr_repository_prefix str
    The repository name prefix to use when caching images from the source registry.
    upstream_registry_url str
    The registry URL of the upstream public registry to use as the source.
    credential_arn str
    ARN of the Secret which will be used to authenticate against the registry.
    ecrRepositoryPrefix String
    The repository name prefix to use when caching images from the source registry.
    upstreamRegistryUrl String
    The registry URL of the upstream public registry to use as the source.
    credentialArn String
    ARN of the Secret which will be used to authenticate against the registry.

    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.
    RegistryId string
    The registry ID where the repository was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegistryId string
    The registry ID where the repository was created.
    id String
    The provider-assigned unique ID for this managed resource.
    registryId String
    The registry ID where the repository was created.
    id string
    The provider-assigned unique ID for this managed resource.
    registryId string
    The registry ID where the repository was created.
    id str
    The provider-assigned unique ID for this managed resource.
    registry_id str
    The registry ID where the repository was created.
    id String
    The provider-assigned unique ID for this managed resource.
    registryId String
    The registry ID where the repository was created.

    Look up Existing PullThroughCacheRule Resource

    Get an existing PullThroughCacheRule 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?: PullThroughCacheRuleState, opts?: CustomResourceOptions): PullThroughCacheRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            credential_arn: Optional[str] = None,
            ecr_repository_prefix: Optional[str] = None,
            registry_id: Optional[str] = None,
            upstream_registry_url: Optional[str] = None) -> PullThroughCacheRule
    func GetPullThroughCacheRule(ctx *Context, name string, id IDInput, state *PullThroughCacheRuleState, opts ...ResourceOption) (*PullThroughCacheRule, error)
    public static PullThroughCacheRule Get(string name, Input<string> id, PullThroughCacheRuleState? state, CustomResourceOptions? opts = null)
    public static PullThroughCacheRule get(String name, Output<String> id, PullThroughCacheRuleState 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:
    CredentialArn string
    ARN of the Secret which will be used to authenticate against the registry.
    EcrRepositoryPrefix string
    The repository name prefix to use when caching images from the source registry.
    RegistryId string
    The registry ID where the repository was created.
    UpstreamRegistryUrl string
    The registry URL of the upstream public registry to use as the source.
    CredentialArn string
    ARN of the Secret which will be used to authenticate against the registry.
    EcrRepositoryPrefix string
    The repository name prefix to use when caching images from the source registry.
    RegistryId string
    The registry ID where the repository was created.
    UpstreamRegistryUrl string
    The registry URL of the upstream public registry to use as the source.
    credentialArn String
    ARN of the Secret which will be used to authenticate against the registry.
    ecrRepositoryPrefix String
    The repository name prefix to use when caching images from the source registry.
    registryId String
    The registry ID where the repository was created.
    upstreamRegistryUrl String
    The registry URL of the upstream public registry to use as the source.
    credentialArn string
    ARN of the Secret which will be used to authenticate against the registry.
    ecrRepositoryPrefix string
    The repository name prefix to use when caching images from the source registry.
    registryId string
    The registry ID where the repository was created.
    upstreamRegistryUrl string
    The registry URL of the upstream public registry to use as the source.
    credential_arn str
    ARN of the Secret which will be used to authenticate against the registry.
    ecr_repository_prefix str
    The repository name prefix to use when caching images from the source registry.
    registry_id str
    The registry ID where the repository was created.
    upstream_registry_url str
    The registry URL of the upstream public registry to use as the source.
    credentialArn String
    ARN of the Secret which will be used to authenticate against the registry.
    ecrRepositoryPrefix String
    The repository name prefix to use when caching images from the source registry.
    registryId String
    The registry ID where the repository was created.
    upstreamRegistryUrl String
    The registry URL of the upstream public registry to use as the source.

    Import

    Using pulumi import, import a pull-through cache rule using the ecr_repository_prefix. For example:

    $ pulumi import aws:ecr/pullThroughCacheRule:PullThroughCacheRule example ecr-public
    

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

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi