AwsEcr

Service-level AWS ECR component.

Remarks

Naming:

  • Root: type ${namespace}:aws:AwsEcr; capability ecr; identity is the active plain-string args.repository.name, args.lifecyclePolicy.repository, or args.repositoryPolicy.repository. Its target is ${env}-${projectHash}-ecr-${sanitiseNamePart(identity)}. The repository identity is shared with its provider name; standalone policy identities are semantic external repository names.
  • The repository capability creates aws:ecr/repository:Repository, aws:ecr/lifecyclePolicy:LifecyclePolicy, and aws:ecr/repositoryPolicy:RepositoryPolicy under AwsEcr. Each uses the ordered tuple [args.repository.name] and target ${env}-${projectHash}-${sanitiseNamePart(args.repository.name)}. It may also create pulumi:providers:aws children with [args.repository.name, 'deploy'] and [args.repository.name, 'org-lookup'], whose targets append those final discriminators.
  • The standalone lifecycle-policy and repository-policy capabilities respectively create aws:ecr/lifecyclePolicy:LifecyclePolicy and aws:ecr/repositoryPolicy:RepositoryPolicy with tuples [args.lifecyclePolicy.repository] and [args.repositoryPolicy.repository].
  • Exception: repository name uses ${projectHash}-${lowerCasePurpose} from args.repository.name, validated as a lower-case camel-case purpose. The environment is surfaced as an image tag; ECR permits 256 characters, so no local maximum applies. Intentional. Standalone policy repository values are semantic external identifiers forwarded unchanged. ECR validates these external repository names as 2–256 characters matching (?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*; slashes separate path components, and periods, underscores, and hyphens occur only between alphanumeric sequences.

Example

CODE
import { AwsEcr } from '@jobcloud/aws-ecr';

const repository = new AwsEcr({ repository: { name: 'applicationRepository' } });

Constructors

new AwsEcr( args: AwsEcrArgs, options?: ComponentResourceOptions, ): AwsEcr

Parameters

  • args (AwsEcrArgs)
  • options (ComponentResourceOptions, optional)

Returns

AwsEcr

Hierarchy

  • ComponentResource
  • AwsEcr

Properties

lifecyclePolicy: AwsEcrLifecyclePolicy

readonly

Optional standalone lifecycle policy capability created by this component.

repository: AwsEcrRepository

readonly

Optional repository capability created by this component.

repositoryPolicy: AwsEcrRepositoryPolicy

readonly

Optional standalone repository policy capability created by this component.

urn: Output<string>

readonly

Inherited from urn

The stable logical URN used to distinctly address a resource, both before and after deployments.

Methods

getData(): Promise<any>

protectedasync

Inherited from getData

Retrieves the data produces by initialize. The data is immediately available in a derived class's constructor after the super(...) call to ComponentResource.

Returns

  • Promise<any>

getProvider(moduleMember: string): ProviderResource | undefined

Inherited from getProvider

Returns the provider for the given module member, if one exists.

Parameters

  • moduleMember (string)

Returns

  • ProviderResource | undefined

initialize( args: Inputs, opts?: ComponentResourceOptions, name?: string, type?: string, ): Promise<any>

protectedasync

Inherited from initialize

Can be overridden by a subclass to asynchronously initialize data for this component automatically when constructed. The data will be available immediately for subclass constructors to use. To access the data use getData.

Parameters

  • args (Inputs)
  • opts (ComponentResourceOptions, optional)
  • name (string, optional)
  • type (string, optional)

Returns

  • Promise<any>

registerOutputs( outputs?: Inputs | Promise<Inputs> | Output<Inputs>, ): void

protected

Inherited from registerOutputs

Registers synthetic outputs that a component has initialized, usually by allocating other child sub-resources and propagating their resulting property values.

Component resources can call this at the end of their constructor to indicate that they are done creating child resources. This is not strictly necessary as this will automatically be called after the initialize method completes.

Parameters

  • outputs (Inputs | Promise<Inputs> | Output<Inputs>, optional)

Returns

  • void

Static Methods

isInstance(obj: any): obj is ComponentResource<any>

static

Inherited from isInstance

Returns true if the given object is a CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

Parameters

  • obj (any)

Returns

  • obj is ComponentResource<any>