1. Packages
  2. AWS
  3. API Docs
  4. ecr
  5. getPullThroughCacheRule
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.ecr.getPullThroughCacheRule

Explore with Pulumi AI

AWS v6.77.0 published on Wednesday, Apr 9, 2025 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

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const ecrPublic = aws.ecr.getPullThroughCacheRule({
    ecrRepositoryPrefix: "ecr-public",
});
Copy
import pulumi
import pulumi_aws as aws

ecr_public = aws.ecr.get_pull_through_cache_rule(ecr_repository_prefix="ecr-public")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  ecrPublic:
    fn::invoke:
      function: aws:ecr:getPullThroughCacheRule
      arguments:
        ecrRepositoryPrefix: ecr-public
Copy

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>
Copy
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]
Copy
func LookupPullThroughCacheRule(ctx *Context, args *LookupPullThroughCacheRuleArgs, opts ...InvokeOption) (*LookupPullThroughCacheRuleResult, error)
func LookupPullThroughCacheRuleOutput(ctx *Context, args *LookupPullThroughCacheRuleOutputArgs, opts ...InvokeOption) LookupPullThroughCacheRuleResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetPullThroughCacheRuleResult> getPullThroughCacheRule(GetPullThroughCacheRuleArgs args, InvokeOptions options)
public static Output<GetPullThroughCacheRuleResult> getPullThroughCacheRule(GetPullThroughCacheRuleArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws:ecr/getPullThroughCacheRule:getPullThroughCacheRule
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

EcrRepositoryPrefix
This property is required.
Changes to this property will trigger replacement.
string
The repository name prefix to use when caching images from the source registry.
EcrRepositoryPrefix
This property is required.
Changes to this property will trigger replacement.
string
The repository name prefix to use when caching images from the source registry.
ecrRepositoryPrefix
This property is required.
Changes to this property will trigger replacement.
String
The repository name prefix to use when caching images from the source registry.
ecrRepositoryPrefix
This property is required.
Changes to this property will trigger replacement.
string
The repository name prefix to use when caching images from the source registry.
ecr_repository_prefix
This property is required.
Changes to this property will trigger replacement.
str
The repository name prefix to use when caching images from the source registry.
ecrRepositoryPrefix
This property is required.
Changes to this property will trigger replacement.
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.
CustomRoleArn string
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.
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 registry to use as the source.
UpstreamRepositoryPrefix string
The upstream repository prefix associated with the pull through cache rule.
CredentialArn string
ARN of the Secret which will be used to authenticate against the registry.
CustomRoleArn string
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.
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 registry to use as the source.
UpstreamRepositoryPrefix string
The upstream repository prefix associated with the pull through cache rule.
credentialArn String
ARN of the Secret which will be used to authenticate against the registry.
customRoleArn String
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.
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 registry to use as the source.
upstreamRepositoryPrefix String
The upstream repository prefix associated with the pull through cache rule.
credentialArn string
ARN of the Secret which will be used to authenticate against the registry.
customRoleArn string
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.
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 registry to use as the source.
upstreamRepositoryPrefix string
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_arn str
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_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 registry to use as the source.
upstream_repository_prefix str
The upstream repository prefix associated with the pull through cache rule.
credentialArn String
ARN of the Secret which will be used to authenticate against the registry.
customRoleArn String
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.
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 registry to use as the source.
upstreamRepositoryPrefix String
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 aws Terraform Provider.
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi