The ECR Repository data source allows the ARN, Repository URI and Registry ID to be retrieved for an ECR repository.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const service = aws.ecr.getRepository({
name: "ecr-repository",
});
import pulumi
import pulumi_aws as aws
service = aws.ecr.get_repository(name="ecr-repository")
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.LookupRepository(ctx, &ecr.LookupRepositoryArgs{
Name: "ecr-repository",
}, 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 service = Aws.Ecr.GetRepository.Invoke(new()
{
Name = "ecr-repository",
});
});
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.GetRepositoryArgs;
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 service = EcrFunctions.getRepository(GetRepositoryArgs.builder()
.name("ecr-repository")
.build());
}
}
variables:
service:
fn::invoke:
function: aws:ecr:getRepository
arguments:
name: ecr-repository
Using getRepository
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 getRepository(args: GetRepositoryArgs, opts?: InvokeOptions): Promise<GetRepositoryResult>
function getRepositoryOutput(args: GetRepositoryOutputArgs, opts?: InvokeOptions): Output<GetRepositoryResult>def get_repository(name: Optional[str] = None,
region: Optional[str] = None,
registry_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
opts: Optional[InvokeOptions] = None) -> GetRepositoryResult
def get_repository_output(name: Optional[pulumi.Input[str]] = None,
region: Optional[pulumi.Input[str]] = None,
registry_id: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryResult]func LookupRepository(ctx *Context, args *LookupRepositoryArgs, opts ...InvokeOption) (*LookupRepositoryResult, error)
func LookupRepositoryOutput(ctx *Context, args *LookupRepositoryOutputArgs, opts ...InvokeOption) LookupRepositoryResultOutput> Note: This function is named LookupRepository in the Go SDK.
public static class GetRepository
{
public static Task<GetRepositoryResult> InvokeAsync(GetRepositoryArgs args, InvokeOptions? opts = null)
public static Output<GetRepositoryResult> Invoke(GetRepositoryInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetRepositoryResult> getRepository(GetRepositoryArgs args, InvokeOptions options)
public static Output<GetRepositoryResult> getRepository(GetRepositoryArgs args, InvokeOptions options)
fn::invoke:
function: aws:ecr/getRepository:getRepository
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- Name of the ECR Repository.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Registry
Id string - Registry ID where the repository was created.
- Dictionary<string, string>
- Map of tags assigned to the resource.
- Name string
- Name of the ECR Repository.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Registry
Id string - Registry ID where the repository was created.
- map[string]string
- Map of tags assigned to the resource.
- name String
- Name of the ECR Repository.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- registry
Id String - Registry ID where the repository was created.
- Map<String,String>
- Map of tags assigned to the resource.
- name string
- Name of the ECR Repository.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- registry
Id string - Registry ID where the repository was created.
- {[key: string]: string}
- Map of tags assigned to the resource.
- name str
- Name of the ECR Repository.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- registry_
id str - Registry ID where the repository was created.
- Mapping[str, str]
- Map of tags assigned to the resource.
- name String
- Name of the ECR Repository.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- registry
Id String - Registry ID where the repository was created.
- Map<String>
- Map of tags assigned to the resource.
getRepository Result
The following output properties are available:
- Arn string
- Full ARN of the repository.
- Encryption
Configurations List<GetRepository Encryption Configuration> - Encryption configuration for the repository. See Encryption Configuration below.
- Id string
- The provider-assigned unique ID for this managed resource.
- Image
Scanning List<GetConfigurations Repository Image Scanning Configuration> - Configuration block that defines image scanning configuration for the repository. See Image Scanning Configuration below.
- Image
Tag stringMutability - The tag mutability setting for the repository.
- Image
Tag List<GetMutability Exclusion Filters Repository Image Tag Mutability Exclusion Filter> - Block that defines filters to specify which image tags can override the default tag mutability setting.
- List<string>
- List of image tags associated with the most recently pushed image in the repository.
- Name string
- Region string
- Registry
Id string - Repository
Url string - URL of the repository (in the form
aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName). - Dictionary<string, string>
- Map of tags assigned to the resource.
- Arn string
- Full ARN of the repository.
- Encryption
Configurations []GetRepository Encryption Configuration - Encryption configuration for the repository. See Encryption Configuration below.
- Id string
- The provider-assigned unique ID for this managed resource.
- Image
Scanning []GetConfigurations Repository Image Scanning Configuration - Configuration block that defines image scanning configuration for the repository. See Image Scanning Configuration below.
- Image
Tag stringMutability - The tag mutability setting for the repository.
- Image
Tag []GetMutability Exclusion Filters Repository Image Tag Mutability Exclusion Filter - Block that defines filters to specify which image tags can override the default tag mutability setting.
- []string
- List of image tags associated with the most recently pushed image in the repository.
- Name string
- Region string
- Registry
Id string - Repository
Url string - URL of the repository (in the form
aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName). - map[string]string
- Map of tags assigned to the resource.
- arn String
- Full ARN of the repository.
- encryption
Configurations List<GetRepository Encryption Configuration> - Encryption configuration for the repository. See Encryption Configuration below.
- id String
- The provider-assigned unique ID for this managed resource.
- image
Scanning List<GetConfigurations Repository Image Scanning Configuration> - Configuration block that defines image scanning configuration for the repository. See Image Scanning Configuration below.
- image
Tag StringMutability - The tag mutability setting for the repository.
- image
Tag List<GetMutability Exclusion Filters Repository Image Tag Mutability Exclusion Filter> - Block that defines filters to specify which image tags can override the default tag mutability setting.
- List<String>
- List of image tags associated with the most recently pushed image in the repository.
- name String
- region String
- registry
Id String - repository
Url String - URL of the repository (in the form
aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName). - Map<String,String>
- Map of tags assigned to the resource.
- arn string
- Full ARN of the repository.
- encryption
Configurations GetRepository Encryption Configuration[] - Encryption configuration for the repository. See Encryption Configuration below.
- id string
- The provider-assigned unique ID for this managed resource.
- image
Scanning GetConfigurations Repository Image Scanning Configuration[] - Configuration block that defines image scanning configuration for the repository. See Image Scanning Configuration below.
- image
Tag stringMutability - The tag mutability setting for the repository.
- image
Tag GetMutability Exclusion Filters Repository Image Tag Mutability Exclusion Filter[] - Block that defines filters to specify which image tags can override the default tag mutability setting.
- string[]
- List of image tags associated with the most recently pushed image in the repository.
- name string
- region string
- registry
Id string - repository
Url string - URL of the repository (in the form
aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName). - {[key: string]: string}
- Map of tags assigned to the resource.
- arn str
- Full ARN of the repository.
- encryption_
configurations Sequence[GetRepository Encryption Configuration] - Encryption configuration for the repository. See Encryption Configuration below.
- id str
- The provider-assigned unique ID for this managed resource.
- image_
scanning_ Sequence[Getconfigurations Repository Image Scanning Configuration] - Configuration block that defines image scanning configuration for the repository. See Image Scanning Configuration below.
- image_
tag_ strmutability - The tag mutability setting for the repository.
- image_
tag_ Sequence[Getmutability_ exclusion_ filters Repository Image Tag Mutability Exclusion Filter] - Block that defines filters to specify which image tags can override the default tag mutability setting.
- Sequence[str]
- List of image tags associated with the most recently pushed image in the repository.
- name str
- region str
- registry_
id str - repository_
url str - URL of the repository (in the form
aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName). - Mapping[str, str]
- Map of tags assigned to the resource.
- arn String
- Full ARN of the repository.
- encryption
Configurations List<Property Map> - Encryption configuration for the repository. See Encryption Configuration below.
- id String
- The provider-assigned unique ID for this managed resource.
- image
Scanning List<Property Map>Configurations - Configuration block that defines image scanning configuration for the repository. See Image Scanning Configuration below.
- image
Tag StringMutability - The tag mutability setting for the repository.
- image
Tag List<Property Map>Mutability Exclusion Filters - Block that defines filters to specify which image tags can override the default tag mutability setting.
- List<String>
- List of image tags associated with the most recently pushed image in the repository.
- name String
- region String
- registry
Id String - repository
Url String - URL of the repository (in the form
aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName). - Map<String>
- Map of tags assigned to the resource.
Supporting Types
GetRepositoryEncryptionConfiguration
- Encryption
Type string - Encryption type to use for the repository, either
AES256orKMS. - Kms
Key string - If
encryption_typeisKMS, the ARN of the KMS key used.
- Encryption
Type string - Encryption type to use for the repository, either
AES256orKMS. - Kms
Key string - If
encryption_typeisKMS, the ARN of the KMS key used.
- encryption
Type String - Encryption type to use for the repository, either
AES256orKMS. - kms
Key String - If
encryption_typeisKMS, the ARN of the KMS key used.
- encryption
Type string - Encryption type to use for the repository, either
AES256orKMS. - kms
Key string - If
encryption_typeisKMS, the ARN of the KMS key used.
- encryption_
type str - Encryption type to use for the repository, either
AES256orKMS. - kms_
key str - If
encryption_typeisKMS, the ARN of the KMS key used.
- encryption
Type String - Encryption type to use for the repository, either
AES256orKMS. - kms
Key String - If
encryption_typeisKMS, the ARN of the KMS key used.
GetRepositoryImageScanningConfiguration
- Scan
On boolPush - Whether images are scanned after being pushed to the repository.
- Scan
On boolPush - Whether images are scanned after being pushed to the repository.
- scan
On BooleanPush - Whether images are scanned after being pushed to the repository.
- scan
On booleanPush - Whether images are scanned after being pushed to the repository.
- scan_
on_ boolpush - Whether images are scanned after being pushed to the repository.
- scan
On BooleanPush - Whether images are scanned after being pushed to the repository.
GetRepositoryImageTagMutabilityExclusionFilter
- Filter string
- The filter pattern to use for excluding image tags from the mutability setting.
- Filter
Type string - The type of filter to use.
- Filter string
- The filter pattern to use for excluding image tags from the mutability setting.
- Filter
Type string - The type of filter to use.
- filter String
- The filter pattern to use for excluding image tags from the mutability setting.
- filter
Type String - The type of filter to use.
- filter string
- The filter pattern to use for excluding image tags from the mutability setting.
- filter
Type string - The type of filter to use.
- filter str
- The filter pattern to use for excluding image tags from the mutability setting.
- filter_
type str - The type of filter to use.
- filter String
- The filter pattern to use for excluding image tags from the mutability setting.
- filter
Type String - The type of filter to use.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.
