aws.ecr.PullThroughCacheRule
Explore with Pulumi AI
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.
Constructor 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:
- Ecr
Repository stringPrefix - The repository name prefix to use when caching images from the source registry.
- Upstream
Registry stringUrl - The registry URL of the upstream public registry to use as the source.
- Credential
Arn string - ARN of the Secret which will be used to authenticate against the registry.
- Ecr
Repository stringPrefix - The repository name prefix to use when caching images from the source registry.
- Upstream
Registry stringUrl - The registry URL of the upstream public registry to use as the source.
- Credential
Arn string - ARN of the Secret which will be used to authenticate against the registry.
- ecr
Repository StringPrefix - The repository name prefix to use when caching images from the source registry.
- upstream
Registry StringUrl - The registry URL of the upstream public registry to use as the source.
- credential
Arn String - ARN of the Secret which will be used to authenticate against the registry.
- ecr
Repository stringPrefix - The repository name prefix to use when caching images from the source registry.
- upstream
Registry stringUrl - The registry URL of the upstream public registry to use as the source.
- credential
Arn string - ARN of the Secret which will be used to authenticate against the registry.
- ecr_
repository_ strprefix - The repository name prefix to use when caching images from the source registry.
- upstream_
registry_ strurl - 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 StringPrefix - The repository name prefix to use when caching images from the source registry.
- upstream
Registry StringUrl - The registry URL of the upstream public registry to use as the source.
- credential
Arn 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.
- Registry
Id string - The registry ID where the repository was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Registry
Id string - The registry ID where the repository was created.
- id String
- The provider-assigned unique ID for this managed resource.
- registry
Id String - The registry ID where the repository was created.
- id string
- The provider-assigned unique ID for this managed resource.
- registry
Id 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.
- registry
Id 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.
- Credential
Arn string - ARN of the Secret which will be used to authenticate against the registry.
- Ecr
Repository stringPrefix - The repository name prefix to use when caching images from the source registry.
- Registry
Id string - The registry ID where the repository was created.
- Upstream
Registry stringUrl - The registry URL of the upstream public registry to use as the source.
- Credential
Arn string - ARN of the Secret which will be used to authenticate against the registry.
- Ecr
Repository stringPrefix - The repository name prefix to use when caching images from the source registry.
- Registry
Id string - The registry ID where the repository was created.
- Upstream
Registry stringUrl - The registry URL of the upstream public registry to use as the source.
- credential
Arn String - ARN of the Secret which will be used to authenticate against the registry.
- ecr
Repository StringPrefix - The repository name prefix to use when caching images from the source registry.
- registry
Id String - The registry ID where the repository was created.
- upstream
Registry StringUrl - The registry URL of the upstream public registry to use as the source.
- credential
Arn string - ARN of the Secret which will be used to authenticate against the registry.
- ecr
Repository stringPrefix - The repository name prefix to use when caching images from the source registry.
- registry
Id string - The registry ID where the repository was created.
- upstream
Registry stringUrl - 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_ strprefix - 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_ strurl - The registry URL of the upstream public registry to use as the source.
- credential
Arn String - ARN of the Secret which will be used to authenticate against the registry.
- ecr
Repository StringPrefix - The repository name prefix to use when caching images from the source registry.
- registry
Id String - The registry ID where the repository was created.
- upstream
Registry StringUrl - 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.