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

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

AWS Classic v6.24.0 published on Tuesday, Feb 27, 2024 by Pulumi

aws.ecr.getPullThroughCacheRule

Explore with Pulumi AI

aws logo

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

AWS Classic v6.24.0 published on Tuesday, Feb 27, 2024 by Pulumi

    The ECR Pull Through Cache Rule data source allows the upstream registry URL and registry ID to be retrieved for a Pull Through Cache Rule.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var ecrPublic = Aws.Ecr.GetPullThroughCacheRule.Invoke(new()
        {
            EcrRepositoryPrefix = "ecr-public",
        });
    
    });
    
    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.LookupPullThroughCacheRule(ctx, &ecr.LookupPullThroughCacheRuleArgs{
    			EcrRepositoryPrefix: "ecr-public",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ecr.EcrFunctions;
    import com.pulumi.aws.ecr.inputs.GetPullThroughCacheRuleArgs;
    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 ecrPublic = EcrFunctions.getPullThroughCacheRule(GetPullThroughCacheRuleArgs.builder()
                .ecrRepositoryPrefix("ecr-public")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    ecr_public = aws.ecr.get_pull_through_cache_rule(ecr_repository_prefix="ecr-public")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const ecrPublic = aws.ecr.getPullThroughCacheRule({
        ecrRepositoryPrefix: "ecr-public",
    });
    
    variables:
      ecrPublic:
        fn::invoke:
          Function: aws:ecr:getPullThroughCacheRule
          Arguments:
            ecrRepositoryPrefix: ecr-public
    

    Using getPullThroughCacheRule

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getPullThroughCacheRule(args: GetPullThroughCacheRuleArgs, opts?: InvokeOptions): Promise<GetPullThroughCacheRuleResult>
    function getPullThroughCacheRuleOutput(args: GetPullThroughCacheRuleOutputArgs, opts?: InvokeOptions): Output<GetPullThroughCacheRuleResult>
    def get_pull_through_cache_rule(ecr_repository_prefix: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetPullThroughCacheRuleResult
    def get_pull_through_cache_rule_output(ecr_repository_prefix: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetPullThroughCacheRuleResult]
    func LookupPullThroughCacheRule(ctx *Context, args *LookupPullThroughCacheRuleArgs, opts ...InvokeOption) (*LookupPullThroughCacheRuleResult, error)
    func LookupPullThroughCacheRuleOutput(ctx *Context, args *LookupPullThroughCacheRuleOutputArgs, opts ...InvokeOption) LookupPullThroughCacheRuleResultOutput

    > Note: This function is named LookupPullThroughCacheRule in the Go SDK.

    public static class GetPullThroughCacheRule 
    {
        public static Task<GetPullThroughCacheRuleResult> InvokeAsync(GetPullThroughCacheRuleArgs args, InvokeOptions? opts = null)
        public static Output<GetPullThroughCacheRuleResult> Invoke(GetPullThroughCacheRuleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPullThroughCacheRuleResult> getPullThroughCacheRule(GetPullThroughCacheRuleArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ecr/getPullThroughCacheRule:getPullThroughCacheRule
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EcrRepositoryPrefix string
    The repository name prefix to use when caching images from the source registry.
    EcrRepositoryPrefix string
    The repository name prefix to use when caching images from the source registry.
    ecrRepositoryPrefix String
    The repository name prefix to use when caching images from the source registry.
    ecrRepositoryPrefix string
    The repository name prefix to use when caching images from the source registry.
    ecr_repository_prefix str
    The repository name prefix to use when caching images from the source registry.
    ecrRepositoryPrefix String
    The repository name prefix to use when caching images from the source registry.

    getPullThroughCacheRule Result

    The following output properties are available:

    CredentialArn string
    ARN of the Secret which will be used to authenticate against the registry.
    EcrRepositoryPrefix string
    Id string
    The provider-assigned unique ID for this managed resource.
    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
    Id string
    The provider-assigned unique ID for this managed resource.
    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
    id String
    The provider-assigned unique ID for this managed resource.
    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
    id string
    The provider-assigned unique ID for this managed resource.
    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
    id str
    The provider-assigned unique ID for this managed resource.
    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
    id String
    The provider-assigned unique ID for this managed resource.
    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.

    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.24.0 published on Tuesday, Feb 27, 2024 by Pulumi