AWS v7.11.0 published on Wednesday, Nov 5, 2025 by Pulumi
aws.ecr.getPullThroughCacheRule
Start a Neo task
Explain and create an aws.ecr.getPullThroughCacheRule resource
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
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const ecrPublic = aws.ecr.getPullThroughCacheRule({
ecrRepositoryPrefix: "ecr-public",
});
import pulumi
import pulumi_aws as aws
ecr_public = aws.ecr.get_pull_through_cache_rule(ecr_repository_prefix="ecr-public")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/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
})
}
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 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());
}
}
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,
region: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetPullThroughCacheRuleResult
def get_pull_through_cache_rule_output(ecr_repository_prefix: Optional[pulumi.Input[str]] = None,
region: 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)
public static Output<GetPullThroughCacheRuleResult> getPullThroughCacheRule(GetPullThroughCacheRuleArgs args, InvokeOptions options)
fn::invoke:
function: aws:ecr/getPullThroughCacheRule:getPullThroughCacheRule
arguments:
# arguments dictionaryThe following arguments are supported:
- Ecr
Repository stringPrefix - The repository name prefix to use when caching images from the source registry.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Ecr
Repository stringPrefix - The repository name prefix to use when caching images from the source registry.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- ecr
Repository StringPrefix - The repository name prefix to use when caching images from the source registry.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- ecr
Repository stringPrefix - The repository name prefix to use when caching images from the source registry.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- ecr_
repository_ strprefix - The repository name prefix to use when caching images from the source registry.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- ecr
Repository StringPrefix - The repository name prefix to use when caching images from the source registry.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
getPullThroughCacheRule Result
The following output properties are available:
- Credential
Arn string - ARN of the Secret which will be used to authenticate against the registry.
- Custom
Role stringArn - The ARN of the IAM role associated with the pull through cache rule. Used if the upstream registry is a cross-account ECR private registry.
- Ecr
Repository stringPrefix - Id string
- The provider-assigned unique ID for this managed resource.
- Region string
- Registry
Id string - The registry ID where the repository was created.
- Upstream
Registry stringUrl - The registry URL of the upstream registry to use as the source.
- Upstream
Repository stringPrefix - The upstream repository prefix associated with the pull through cache rule.
- Credential
Arn string - ARN of the Secret which will be used to authenticate against the registry.
- Custom
Role stringArn - The ARN of the IAM role associated with the pull through cache rule. Used if the upstream registry is a cross-account ECR private registry.
- Ecr
Repository stringPrefix - Id string
- The provider-assigned unique ID for this managed resource.
- Region string
- Registry
Id string - The registry ID where the repository was created.
- Upstream
Registry stringUrl - The registry URL of the upstream registry to use as the source.
- Upstream
Repository stringPrefix - The upstream repository prefix associated with the pull through cache rule.
- credential
Arn String - ARN of the Secret which will be used to authenticate against the registry.
- custom
Role StringArn - The ARN of the IAM role associated with the pull through cache rule. Used if the upstream registry is a cross-account ECR private registry.
- ecr
Repository StringPrefix - id String
- The provider-assigned unique ID for this managed resource.
- region String
- registry
Id String - The registry ID where the repository was created.
- upstream
Registry StringUrl - The registry URL of the upstream registry to use as the source.
- upstream
Repository StringPrefix - The upstream repository prefix associated with the pull through cache rule.
- credential
Arn string - ARN of the Secret which will be used to authenticate against the registry.
- custom
Role stringArn - The ARN of the IAM role associated with the pull through cache rule. Used if the upstream registry is a cross-account ECR private registry.
- ecr
Repository stringPrefix - id string
- The provider-assigned unique ID for this managed resource.
- region string
- registry
Id string - The registry ID where the repository was created.
- upstream
Registry stringUrl - The registry URL of the upstream registry to use as the source.
- upstream
Repository stringPrefix - The upstream repository prefix associated with the pull through cache rule.
- credential_
arn str - ARN of the Secret which will be used to authenticate against the registry.
- custom_
role_ strarn - The ARN of the IAM role associated with the pull through cache rule. Used if the upstream registry is a cross-account ECR private registry.
- ecr_
repository_ strprefix - id str
- The provider-assigned unique ID for this managed resource.
- region str
- registry_
id str - The registry ID where the repository was created.
- upstream_
registry_ strurl - The registry URL of the upstream registry to use as the source.
- upstream_
repository_ strprefix - The upstream repository prefix associated with the pull through cache rule.
- credential
Arn String - ARN of the Secret which will be used to authenticate against the registry.
- custom
Role StringArn - The ARN of the IAM role associated with the pull through cache rule. Used if the upstream registry is a cross-account ECR private registry.
- ecr
Repository StringPrefix - id String
- The provider-assigned unique ID for this managed resource.
- region String
- registry
Id String - The registry ID where the repository was created.
- upstream
Registry StringUrl - The registry URL of the upstream registry to use as the source.
- upstream
Repository StringPrefix - The upstream repository prefix associated with the pull through cache rule.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.
