diff --git a/src/docgen/transpile/transpile.ts b/src/docgen/transpile/transpile.ts
index 834297e5..4c47780f 100644
--- a/src/docgen/transpile/transpile.ts
+++ b/src/docgen/transpile/transpile.ts
@@ -178,11 +178,11 @@ export interface TranspiledTypeReferenceToStringOptions {
/**
* Type formatter.
*/
- typeFormatter?: (t: TranspiledType) => string;
+ typeFormatter?: (type: TranspiledType) => string;
/**
* String formatter.
*/
- stringFormatter?: (formatter: string) => string;
+ stringFormatter?: (typeName: string) => string;
}
/**
@@ -421,6 +421,13 @@ export interface Transpile {
*/
readonly language: Language;
+ /**
+ * How links to types should be formatted.
+ *
+ * @default '#{fqn}'
+ */
+ readonly linkFormatter?: (type: TranspiledType) => string;
+
/**
* Transpile a module like object (Assembly | Submodule)
*/
diff --git a/src/docgen/view/api-reference.ts b/src/docgen/view/api-reference.ts
index 7ac8f744..56f025d0 100644
--- a/src/docgen/view/api-reference.ts
+++ b/src/docgen/view/api-reference.ts
@@ -1,6 +1,6 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile } from '../transpile/transpile';
+import { Transpile, TranspiledType } from '../transpile/transpile';
import { Classes } from './classes';
import { Constructs } from './constructs';
import { Enums } from './enums';
@@ -19,6 +19,7 @@ export class ApiReference {
constructor(
transpile: Transpile,
assembly: reflect.Assembly,
+ linkFormatter: (type: TranspiledType) => string,
submodule?: reflect.Submodule,
) {
const classes = this.sortByName(
@@ -29,10 +30,10 @@ export class ApiReference {
);
const enums = this.sortByName(submodule ? submodule.enums : assembly.enums);
- this.constructs = new Constructs(transpile, classes);
- this.classes = new Classes(transpile, classes);
- this.structs = new Structs(transpile, interfaces);
- this.interfaces = new Interfaces(transpile, interfaces);
+ this.constructs = new Constructs(transpile, classes, linkFormatter);
+ this.classes = new Classes(transpile, classes, linkFormatter);
+ this.structs = new Structs(transpile, interfaces, linkFormatter);
+ this.interfaces = new Interfaces(transpile, interfaces, linkFormatter);
this.enums = new Enums(transpile, enums);
}
diff --git a/src/docgen/view/class.ts b/src/docgen/view/class.ts
index 6fe8c4f6..39eca5f7 100644
--- a/src/docgen/view/class.ts
+++ b/src/docgen/view/class.ts
@@ -1,6 +1,6 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile, TranspiledClass } from '../transpile/transpile';
+import { Transpile, TranspiledClass, TranspiledType } from '../transpile/transpile';
import { Constants } from './constants';
import { Initializer } from './initializer';
import { InstanceMethods } from './instance-methods';
@@ -31,14 +31,15 @@ export class Class {
constructor(
private readonly transpile: Transpile,
private readonly klass: reflect.ClassType,
+ private readonly linkFormatter: (type: TranspiledType) => string,
) {
if (klass.initializer) {
- this.initializer = new Initializer(transpile, klass.initializer);
+ this.initializer = new Initializer(transpile, klass.initializer, linkFormatter);
}
- this.instanceMethods = new InstanceMethods(transpile, klass.ownMethods);
- this.staticFunctions = new StaticFunctions(transpile, klass.ownMethods);
- this.constants = new Constants(transpile, klass.ownProperties);
- this.properties = new Properties(transpile, klass.ownProperties);
+ this.instanceMethods = new InstanceMethods(transpile, klass.ownMethods, linkFormatter);
+ this.staticFunctions = new StaticFunctions(transpile, klass.ownMethods, linkFormatter);
+ this.constants = new Constants(transpile, klass.ownProperties, linkFormatter);
+ this.properties = new Properties(transpile, klass.ownProperties, linkFormatter);
this.transpiled = transpile.class(klass);
}
@@ -52,7 +53,7 @@ export class Class {
const ifaces = [];
for (const iface of this.klass.interfaces) {
const transpiled = this.transpile.type(iface);
- ifaces.push(`[${Markdown.pre(transpiled.fqn)}](#${transpiled.fqn})`);
+ ifaces.push(`[${Markdown.pre(transpiled.fqn)}](${this.linkFormatter(transpiled)})`);
}
md.bullet(`${Markdown.italic('Implements:')} ${ifaces.join(', ')}`);
md.lines('');
diff --git a/src/docgen/view/classes.ts b/src/docgen/view/classes.ts
index ef5f88ed..49398d64 100644
--- a/src/docgen/view/classes.ts
+++ b/src/docgen/view/classes.ts
@@ -1,14 +1,14 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile } from '../transpile/transpile';
+import { Transpile, TranspiledType } from '../transpile/transpile';
import { Class } from './class';
export class Classes {
private readonly classes: Class[];
- constructor(transpile: Transpile, classes: reflect.ClassType[]) {
+ constructor(transpile: Transpile, classes: reflect.ClassType[], linkFormatter: (type: TranspiledType) => string) {
this.classes = classes
.filter((c) => !Class.isConstruct(c))
- .map((c) => new Class(transpile, c));
+ .map((c) => new Class(transpile, c, linkFormatter));
}
public render(): Markdown {
diff --git a/src/docgen/view/constant.ts b/src/docgen/view/constant.ts
index f3a6883c..bbee5540 100644
--- a/src/docgen/view/constant.ts
+++ b/src/docgen/view/constant.ts
@@ -1,12 +1,12 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile } from '../transpile/transpile';
+import { Transpile, TranspiledType } from '../transpile/transpile';
import { Property } from './property';
export class Constant {
private readonly constant: Property;
- constructor(transpile: Transpile, property: reflect.Property) {
- this.constant = new Property(transpile, property);
+ constructor(transpile: Transpile, property: reflect.Property, linkFormatter: (type: TranspiledType) => string) {
+ this.constant = new Property(transpile, property, linkFormatter);
}
public render(): Markdown {
return this.constant.render();
diff --git a/src/docgen/view/constants.ts b/src/docgen/view/constants.ts
index db91f30c..7a16f5f8 100644
--- a/src/docgen/view/constants.ts
+++ b/src/docgen/view/constants.ts
@@ -1,14 +1,14 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile } from '../transpile/transpile';
+import { Transpile, TranspiledType } from '../transpile/transpile';
import { Constant } from './constant';
export class Constants {
private readonly constants: Constant[];
- constructor(transpile: Transpile, properties: reflect.Property[]) {
+ constructor(transpile: Transpile, properties: reflect.Property[], linkFormatter: (type: TranspiledType) => string) {
this.constants = properties
.filter((p) => !p.protected && p.const)
- .map((p) => new Constant(transpile, p));
+ .map((p) => new Constant(transpile, p, linkFormatter));
}
public render(): Markdown {
diff --git a/src/docgen/view/construct.ts b/src/docgen/view/construct.ts
index b83d17bc..2ddc7754 100644
--- a/src/docgen/view/construct.ts
+++ b/src/docgen/view/construct.ts
@@ -1,12 +1,12 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile } from '../transpile/transpile';
+import { Transpile, TranspiledType } from '../transpile/transpile';
import { Class } from './class';
export class Construct {
private readonly construct: Class;
- constructor(transpile: Transpile, klass: reflect.ClassType) {
- this.construct = new Class(transpile, klass);
+ constructor(transpile: Transpile, klass: reflect.ClassType, linkFormatter: (type: TranspiledType) => string) {
+ this.construct = new Class(transpile, klass, linkFormatter);
}
public render(): Markdown {
return this.construct.render();
diff --git a/src/docgen/view/constructs.ts b/src/docgen/view/constructs.ts
index fb4b3848..3d6aeb90 100644
--- a/src/docgen/view/constructs.ts
+++ b/src/docgen/view/constructs.ts
@@ -1,15 +1,15 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile } from '../transpile/transpile';
+import { Transpile, TranspiledType } from '../transpile/transpile';
import { Class } from './class';
import { Construct } from './construct';
export class Constructs {
private readonly constructs: Construct[];
- constructor(transpile: Transpile, classes: reflect.ClassType[]) {
+ constructor(transpile: Transpile, classes: reflect.ClassType[], linkFormatter: (type: TranspiledType) => string) {
this.constructs = classes
.filter((c) => Class.isConstruct(c))
- .map((c) => new Construct(transpile, c));
+ .map((c) => new Construct(transpile, c, linkFormatter));
}
public render(): Markdown {
diff --git a/src/docgen/view/documentation.ts b/src/docgen/view/documentation.ts
index 8249a070..ad239084 100644
--- a/src/docgen/view/documentation.ts
+++ b/src/docgen/view/documentation.ts
@@ -8,7 +8,7 @@ import { TargetLanguage } from 'jsii-rosetta';
import { transliterateAssembly } from 'jsii-rosetta/lib/commands/transliterate';
import { Markdown } from '../render/markdown';
import { PythonTranspile } from '../transpile/python';
-import { Transpile, Language } from '../transpile/transpile';
+import { Transpile, Language, TranspiledType } from '../transpile/transpile';
import { TypeScriptTranspile } from '../transpile/typescript';
import { ApiReference } from './api-reference';
import { Readme } from './readme';
@@ -39,6 +39,13 @@ export interface RenderOptions {
*/
readonly submodule?: string;
+ /**
+ * How should links to types be rendered.
+ *
+ * @default '#{fqn}'
+ */
+ readonly linkFormatter?: (type: TranspiledType) => string;
+
}
/**
@@ -199,7 +206,7 @@ export class Documentation {
}
private constructor(
- private readonly assembly: reflect.Assembly,
+ public readonly assembly: reflect.Assembly,
private readonly transpile: Transpile,
) {
}
@@ -217,7 +224,7 @@ export class Documentation {
}
if (options?.apiReference ?? true) {
- const apiReference = new ApiReference(this.transpile, this.assembly, submodule);
+ const apiReference = new ApiReference(this.transpile, this.assembly, options?.linkFormatter ?? ((t: TranspiledType) => `#${t.fqn}`), submodule);
documentation.section(apiReference.render());
}
diff --git a/src/docgen/view/initializer.ts b/src/docgen/view/initializer.ts
index eb0d42c6..32a3a4f7 100644
--- a/src/docgen/view/initializer.ts
+++ b/src/docgen/view/initializer.ts
@@ -1,6 +1,6 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile, TranspiledCallable } from '../transpile/transpile';
+import { Transpile, TranspiledCallable, TranspiledType } from '../transpile/transpile';
import { Parameter } from './parameter';
export class Initializer {
@@ -9,10 +9,11 @@ export class Initializer {
constructor(
private readonly transpile: Transpile,
initializer: reflect.Initializer,
+ linkFormatter: (type: TranspiledType) => string,
) {
this.transpiled = transpile.callable(initializer);
this.parameters = this.transpiled.parameters.map(
- (p) => new Parameter(this.transpile, p),
+ (p) => new Parameter(this.transpile, p, linkFormatter),
);
}
diff --git a/src/docgen/view/instance-method.ts b/src/docgen/view/instance-method.ts
index 0ae528aa..670d24c4 100644
--- a/src/docgen/view/instance-method.ts
+++ b/src/docgen/view/instance-method.ts
@@ -1,6 +1,6 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile, TranspiledCallable } from '../transpile/transpile';
+import { Transpile, TranspiledCallable, TranspiledType } from '../transpile/transpile';
import { Parameter } from './parameter';
export class InstanceMethod {
@@ -9,10 +9,11 @@ export class InstanceMethod {
constructor(
private readonly transpile: Transpile,
private readonly method: reflect.Method,
+ linkFormatter: (type: TranspiledType) => string,
) {
this.transpiled = transpile.callable(method);
this.parameters = this.transpiled.parameters.map(
- (p) => new Parameter(this.transpile, p),
+ (p) => new Parameter(this.transpile, p, linkFormatter),
);
}
diff --git a/src/docgen/view/instance-methods.ts b/src/docgen/view/instance-methods.ts
index 225ff5cc..4d09896b 100644
--- a/src/docgen/view/instance-methods.ts
+++ b/src/docgen/view/instance-methods.ts
@@ -1,14 +1,14 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile } from '../transpile/transpile';
+import { Transpile, TranspiledType } from '../transpile/transpile';
import { InstanceMethod } from './instance-method';
export class InstanceMethods {
private readonly instanceMethods: InstanceMethod[];
- constructor(transpile: Transpile, methods: reflect.Method[]) {
+ constructor(transpile: Transpile, methods: reflect.Method[], linkFormatter: (type: TranspiledType) => string) {
this.instanceMethods = methods
.filter((m) => !m.protected && !m.static)
- .map((m) => new InstanceMethod(transpile, m));
+ .map((m) => new InstanceMethod(transpile, m, linkFormatter));
}
public render(): Markdown {
diff --git a/src/docgen/view/interface.ts b/src/docgen/view/interface.ts
index cc1d12c5..d2cd7e7c 100644
--- a/src/docgen/view/interface.ts
+++ b/src/docgen/view/interface.ts
@@ -1,6 +1,6 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile, TranspiledInterface } from '../transpile/transpile';
+import { Transpile, TranspiledInterface, TranspiledType } from '../transpile/transpile';
import { InstanceMethods } from './instance-methods';
import { Properties } from './properties';
@@ -17,10 +17,11 @@ export class Interface {
constructor(
private readonly transpile: Transpile,
private readonly iface: reflect.InterfaceType,
+ private readonly linkFormatter: (type: TranspiledType) => string,
) {
this.transpiled = transpile.interface(iface);
- this.instanceMethods = new InstanceMethods(transpile, iface.ownMethods);
- this.properties = new Properties(transpile, iface.allProperties);
+ this.instanceMethods = new InstanceMethods(transpile, iface.ownMethods, linkFormatter);
+ this.properties = new Properties(transpile, iface.allProperties, linkFormatter);
}
public render(): Markdown {
@@ -33,7 +34,7 @@ export class Interface {
const ifaces = [];
for (const iface of this.iface.interfaces) {
const transpiled = this.transpile.type(iface);
- ifaces.push(`[${Markdown.pre(transpiled.fqn)}](#${transpiled.fqn})`);
+ ifaces.push(`[${Markdown.pre(transpiled.fqn)}](${this.linkFormatter(transpiled)})`);
}
md.bullet(`${Markdown.italic('Extends:')} ${ifaces.join(', ')}`);
md.lines('');
@@ -43,7 +44,7 @@ export class Interface {
const impls = [];
for (const impl of this.iface.allImplementations) {
const transpiled = this.transpile.type(impl);
- impls.push(`[${Markdown.pre(transpiled.fqn)}](#${transpiled.fqn})`);
+ impls.push(`[${Markdown.pre(transpiled.fqn)}](${this.linkFormatter(transpiled)})`);
}
md.bullet(`${Markdown.italic('Implemented By:')} ${impls.join(', ')}`);
md.lines('');
diff --git a/src/docgen/view/interfaces.ts b/src/docgen/view/interfaces.ts
index e6c1ef70..07619356 100644
--- a/src/docgen/view/interfaces.ts
+++ b/src/docgen/view/interfaces.ts
@@ -1,15 +1,15 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile } from '../transpile/transpile';
+import { Transpile, TranspiledType } from '../transpile/transpile';
import { Interface } from './interface';
export class Interfaces {
private readonly interfaces: Interface[];
- constructor(transpile: Transpile, interfaces: reflect.InterfaceType[]) {
+ constructor(transpile: Transpile, interfaces: reflect.InterfaceType[], linkFormatter: (type: TranspiledType) => string) {
this.interfaces = interfaces
.filter((i) => !Interface.isStruct(i))
- .map((i) => new Interface(transpile, i));
+ .map((i) => new Interface(transpile, i, linkFormatter));
}
public render(): Markdown {
if (this.interfaces.length === 0) {
diff --git a/src/docgen/view/parameter.ts b/src/docgen/view/parameter.ts
index 1732b239..9c605734 100644
--- a/src/docgen/view/parameter.ts
+++ b/src/docgen/view/parameter.ts
@@ -1,12 +1,13 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile, TranspiledParameter } from '../transpile/transpile';
+import { Transpile, TranspiledParameter, TranspiledType } from '../transpile/transpile';
export class Parameter {
private readonly transpiled: TranspiledParameter;
constructor(
transpile: Transpile,
private readonly parameter: reflect.Parameter,
+ private readonly linkFormatter: (type: TranspiledType) => string,
) {
this.transpiled = transpile.parameter(parameter);
}
@@ -35,7 +36,7 @@ export class Parameter {
const metadata: any = {
Type: this.transpiled.typeReference.toString({
- typeFormatter: (t) => `[${Markdown.pre(t.fqn)}](#${t.fqn})`,
+ typeFormatter: (t) => `[${Markdown.pre(t.fqn)}](${this.linkFormatter(t)})`,
stringFormatter: Markdown.pre,
}),
};
diff --git a/src/docgen/view/properties.ts b/src/docgen/view/properties.ts
index 6a685f97..8ac3320c 100644
--- a/src/docgen/view/properties.ts
+++ b/src/docgen/view/properties.ts
@@ -1,14 +1,14 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile } from '../transpile/transpile';
+import { Transpile, TranspiledType } from '../transpile/transpile';
import { Property } from './property';
export class Properties {
private readonly properties: Property[];
- constructor(transpile: Transpile, properties: reflect.Property[]) {
+ constructor(transpile: Transpile, properties: reflect.Property[], linkFormatter: (type: TranspiledType) => string) {
this.properties = properties
.filter((p) => !p.protected && !p.const)
- .map((p) => new Property(transpile, p));
+ .map((p) => new Property(transpile, p, linkFormatter));
}
public render(): Markdown {
diff --git a/src/docgen/view/property.ts b/src/docgen/view/property.ts
index f105af76..d5131a5a 100644
--- a/src/docgen/view/property.ts
+++ b/src/docgen/view/property.ts
@@ -1,12 +1,13 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile, TranspiledProperty } from '../transpile/transpile';
+import { Transpile, TranspiledProperty, TranspiledType } from '../transpile/transpile';
export class Property {
private readonly transpiled: TranspiledProperty;
constructor(
transpile: Transpile,
private readonly property: reflect.Property,
+ private readonly linkFormatter: (type: TranspiledType) => string,
) {
this.transpiled = transpile.property(property);
}
@@ -39,7 +40,7 @@ export class Property {
const metadata: any = {
Type: this.transpiled.typeReference.toString({
- typeFormatter: (t) => `[${Markdown.pre(t.fqn)}](#${t.fqn})`,
+ typeFormatter: (t) => `[${Markdown.pre(t.fqn)}](${this.linkFormatter(t)})`,
stringFormatter: Markdown.pre,
}),
};
diff --git a/src/docgen/view/static-function.ts b/src/docgen/view/static-function.ts
index d938c7bc..f739664a 100644
--- a/src/docgen/view/static-function.ts
+++ b/src/docgen/view/static-function.ts
@@ -1,6 +1,6 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile, TranspiledCallable } from '../transpile/transpile';
+import { Transpile, TranspiledCallable, TranspiledType } from '../transpile/transpile';
import { Parameter } from './parameter';
export class StaticFunction {
@@ -9,10 +9,11 @@ export class StaticFunction {
constructor(
private readonly transpile: Transpile,
private readonly method: reflect.Method,
+ linkFormatter: (type: TranspiledType) => string,
) {
this.transpiled = transpile.callable(method);
this.parameters = this.transpiled.parameters.map(
- (p) => new Parameter(this.transpile, p),
+ (p) => new Parameter(this.transpile, p, linkFormatter),
);
}
diff --git a/src/docgen/view/static-functions.ts b/src/docgen/view/static-functions.ts
index dbfacd13..9cb7658d 100644
--- a/src/docgen/view/static-functions.ts
+++ b/src/docgen/view/static-functions.ts
@@ -1,14 +1,14 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile } from '../transpile/transpile';
+import { Transpile, TranspiledType } from '../transpile/transpile';
import { StaticFunction } from './static-function';
export class StaticFunctions {
private readonly staticFunctions: StaticFunction[];
- constructor(transpile: Transpile, methods: reflect.Method[]) {
+ constructor(transpile: Transpile, methods: reflect.Method[], linkFormatter: (type: TranspiledType) => string) {
this.staticFunctions = methods
.filter((m) => !m.protected && m.static)
- .map((m) => new StaticFunction(transpile, m));
+ .map((m) => new StaticFunction(transpile, m, linkFormatter));
}
public render(): Markdown {
diff --git a/src/docgen/view/struct.ts b/src/docgen/view/struct.ts
index 587c0c14..76e28ae9 100644
--- a/src/docgen/view/struct.ts
+++ b/src/docgen/view/struct.ts
@@ -1,6 +1,6 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile, TranspiledStruct } from '../transpile/transpile';
+import { Transpile, TranspiledStruct, TranspiledType } from '../transpile/transpile';
import { Property } from './property';
export class Struct {
@@ -9,10 +9,11 @@ export class Struct {
constructor(
private readonly transpile: Transpile,
private readonly iface: reflect.InterfaceType,
+ linkFormatter: (type: TranspiledType) => string,
) {
this.transpiled = transpile.struct(iface);
for (const property of this.iface.allProperties) {
- this.properties.push(new Property(this.transpile, property));
+ this.properties.push(new Property(this.transpile, property, linkFormatter));
}
}
diff --git a/src/docgen/view/structs.ts b/src/docgen/view/structs.ts
index bf4bb861..fbae5412 100644
--- a/src/docgen/view/structs.ts
+++ b/src/docgen/view/structs.ts
@@ -1,15 +1,15 @@
import * as reflect from 'jsii-reflect';
import { Markdown } from '../render/markdown';
-import { Transpile } from '../transpile/transpile';
+import { Transpile, TranspiledType } from '../transpile/transpile';
import { Interface } from './interface';
import { Struct } from './struct';
export class Structs {
private readonly structs: Struct[];
- constructor(transpile: Transpile, interfaces: reflect.InterfaceType[]) {
+ constructor(transpile: Transpile, interfaces: reflect.InterfaceType[], linkFormatter: (type: TranspiledType) => string) {
this.structs = interfaces
.filter((i) => Interface.isStruct(i))
- .map((i) => new Struct(transpile, i));
+ .map((i) => new Struct(transpile, i, linkFormatter));
}
public render(): Markdown {
diff --git a/src/index.ts b/src/index.ts
index 745cdbd6..aeea89d7 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,3 +1,4 @@
export { Documentation } from './docgen/view/documentation';
export { Language } from './docgen/transpile/transpile';
-export { UnsupportedLanguageError } from './docgen/transpile/transpile';
\ No newline at end of file
+export { UnsupportedLanguageError } from './docgen/transpile/transpile';
+export { TranspiledType } from './docgen/transpile/transpile';
\ No newline at end of file
diff --git a/test/docgen/view/__snapshots__/documentation.test.ts.snap b/test/docgen/view/__snapshots__/documentation.test.ts.snap
index 6a1cc043..e648a901 100644
--- a/test/docgen/view/__snapshots__/documentation.test.ts.snap
+++ b/test/docgen/view/__snapshots__/documentation.test.ts.snap
@@ -1,5 +1,2578 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
+exports[`custom link formatter 1`] = `
+"# Amazon ECR Construct Library
+
+---
+
+
+![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge)
+
+![cdk-constructs: Stable](https://img.shields.io/badge/cdk--constructs-stable-success.svg?style=for-the-badge)
+
+---
+
+
+This package contains constructs for working with Amazon Elastic Container Registry.
+
+## Repositories
+
+Define a repository by creating a new instance of \`Repository\`. A repository
+holds multiple verions of a single container image.
+
+\`\`\`python
+# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
+repository = ecr.Repository(self, \\"Repository\\")
+\`\`\`
+
+## Image scanning
+
+Amazon ECR image scanning helps in identifying software vulnerabilities in your container images. You can manually scan container images stored in Amazon ECR, or you can configure your repositories to scan images when you push them to a repository. To create a new repository to scan on push, simply enable \`imageScanOnPush\` in the properties
+
+\`\`\`python
+# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
+repository = ecr.Repository(stack, \\"Repo\\",
+ image_scan_on_push=True
+)
+\`\`\`
+
+To create an \`onImageScanCompleted\` event rule and trigger the event target
+
+\`\`\`python
+# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
+repository.on_image_scan_completed(\\"ImageScanComplete\\").add_target(...)
+\`\`\`
+
+### Authorization Token
+
+Besides the Amazon ECR APIs, ECR also allows the Docker CLI or a language-specific Docker library to push and pull
+images from an ECR repository. However, the Docker CLI does not support native IAM authentication methods and
+additional steps must be taken so that Amazon ECR can authenticate and authorize Docker push and pull requests.
+More information can be found at at [Registry Authentication](https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html#registry_auth).
+
+A Docker authorization token can be obtained using the \`GetAuthorizationToken\` ECR API. The following code snippets
+grants an IAM user access to call this API.
+
+\`\`\`python
+# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
+import aws_cdk.aws_iam as iam
+import aws_cdk.aws_ecr as ecr
+
+user = iam.User(self, \\"User\\", ...)
+ecr.AuthorizationToken.grant_read(user)
+\`\`\`
+
+If you access images in the [Public ECR Gallery](https://gallery.ecr.aws/) as well, it is recommended you authenticate to the registry to benefit from
+higher rate and bandwidth limits.
+
+> See \`Pricing\` in https://aws.amazon.com/blogs/aws/amazon-ecr-public-a-new-public-container-registry/ and [Service quotas](https://docs.aws.amazon.com/AmazonECR/latest/public/public-service-quotas.html).
+
+The following code snippet grants an IAM user access to retrieve an authorization token for the public gallery.
+
+\`\`\`python
+# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
+import aws_cdk.aws_iam as iam
+import aws_cdk.aws_ecr as ecr
+
+user = iam.User(self, \\"User\\", ...)
+ecr.PublicGalleryAuthorizationToken.grant_read(user)
+\`\`\`
+
+This user can then proceed to login to the registry using one of the [authentication methods](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth).
+
+### Image tag immutability
+
+You can set tag immutability on images in our repository using the \`imageTagMutability\` construct prop.
+
+\`\`\`python
+# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
+ecr.Repository(stack, \\"Repo\\", image_tag_mutability=ecr.TagMutability.IMMUTABLE)
+\`\`\`
+
+## Automatically clean up repositories
+
+You can set life cycle rules to automatically clean up old images from your
+repository. The first life cycle rule that matches an image will be applied
+against that image. For example, the following deletes images older than
+30 days, while keeping all images tagged with prod (note that the order
+is important here):
+
+\`\`\`python
+# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
+repository.add_lifecycle_rule(tag_prefix_list=[\\"prod\\"], max_image_count=9999)
+repository.add_lifecycle_rule(max_image_age=cdk.Duration.days(30))
+\`\`\`
+# API Reference
+
+## Constructs
+
+### CfnPublicRepository
+
+- *Implements:* [\`aws_cdk.core.IInspectable\`](#custom-aws_cdk.core.IInspectable)
+
+A CloudFormation \`AWS::ECR::PublicRepository\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.CfnPublicRepository(scope: Construct,
+ id: str,
+ repository_catalog_data: typing.Any = None,
+ repository_name: str = None,
+ repository_policy_text: typing.Any = None,
+ tags: typing.List[CfnTag] = None)
+\`\`\`
+
+##### \`scope\`Required
+
+- *Type:* [\`aws_cdk.core.Construct\`](#custom-aws_cdk.core.Construct)
+
+scope in which this resource is defined.
+
+---
+
+##### \`id\`Required
+
+- *Type:* \`str\`
+
+scoped id of the resource.
+
+---
+
+##### \`repository_catalog_data\`Optional
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
+
+---
+
+##### \`repository_name\`Optional
+
+- *Type:* \`str\`
+
+\`AWS::ECR::PublicRepository.RepositoryName\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
+
+---
+
+##### \`repository_policy_text\`Optional
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
+
+---
+
+##### \`tags\`Optional
+
+- *Type:* typing.List[[\`aws_cdk.core.CfnTag\`](#custom-aws_cdk.core.CfnTag)]
+
+\`AWS::ECR::PublicRepository.Tags\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
+
+---
+
+#### Methods
+
+##### \`inspect\`
+
+\`\`\`python
+def inspect(inspector: TreeInspector)
+\`\`\`
+
+###### \`inspector\`Required
+
+- *Type:* [\`aws_cdk.core.TreeInspector\`](#custom-aws_cdk.core.TreeInspector)
+
+tree inspector to collect and process attributes.
+
+---
+
+
+#### Properties
+
+##### \`attr_arn\`Required
+
+- *Type:* \`str\`
+
+---
+
+##### \`tags\`Required
+
+- *Type:* [\`aws_cdk.core.TagManager\`](#custom-aws_cdk.core.TagManager)
+
+\`AWS::ECR::PublicRepository.Tags\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
+
+---
+
+##### \`repository_catalog_data\`Required
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
+
+---
+
+##### \`repository_policy_text\`Required
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
+
+---
+
+##### \`repository_name\`Optional
+
+- *Type:* \`str\`
+
+\`AWS::ECR::PublicRepository.RepositoryName\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
+
+---
+
+#### Constants
+
+##### \`CFN_RESOURCE_TYPE_NAME\`
+
+- *Type:* \`str\`
+
+The CloudFormation resource type name for this resource class.
+
+---
+
+### CfnRegistryPolicy
+
+- *Implements:* [\`aws_cdk.core.IInspectable\`](#custom-aws_cdk.core.IInspectable)
+
+A CloudFormation \`AWS::ECR::RegistryPolicy\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html)
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.CfnRegistryPolicy(scope: Construct,
+ id: str,
+ policy_text: typing.Any)
+\`\`\`
+
+##### \`scope\`Required
+
+- *Type:* [\`aws_cdk.core.Construct\`](#custom-aws_cdk.core.Construct)
+
+scope in which this resource is defined.
+
+---
+
+##### \`id\`Required
+
+- *Type:* \`str\`
+
+scoped id of the resource.
+
+---
+
+##### \`policy_text\`Required
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::RegistryPolicy.PolicyText\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
+
+---
+
+#### Methods
+
+##### \`inspect\`
+
+\`\`\`python
+def inspect(inspector: TreeInspector)
+\`\`\`
+
+###### \`inspector\`Required
+
+- *Type:* [\`aws_cdk.core.TreeInspector\`](#custom-aws_cdk.core.TreeInspector)
+
+tree inspector to collect and process attributes.
+
+---
+
+
+#### Properties
+
+##### \`attr_registry_id\`Required
+
+- *Type:* \`str\`
+
+---
+
+##### \`policy_text\`Required
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::RegistryPolicy.PolicyText\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
+
+---
+
+#### Constants
+
+##### \`CFN_RESOURCE_TYPE_NAME\`
+
+- *Type:* \`str\`
+
+The CloudFormation resource type name for this resource class.
+
+---
+
+### CfnReplicationConfiguration
+
+- *Implements:* [\`aws_cdk.core.IInspectable\`](#custom-aws_cdk.core.IInspectable)
+
+A CloudFormation \`AWS::ECR::ReplicationConfiguration\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.CfnReplicationConfiguration(scope: Construct,
+ id: str,
+ replication_configuration: typing.Union[IResolvable, ReplicationConfigurationProperty])
+\`\`\`
+
+##### \`scope\`Required
+
+- *Type:* [\`aws_cdk.core.Construct\`](#custom-aws_cdk.core.Construct)
+
+scope in which this resource is defined.
+
+---
+
+##### \`id\`Required
+
+- *Type:* \`str\`
+
+scoped id of the resource.
+
+---
+
+##### \`replication_configuration\`Required
+
+- *Type:* typing.Union[[\`aws_cdk.core.IResolvable\`](#custom-aws_cdk.core.IResolvable), [\`aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationConfigurationProperty\`](#custom-aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationConfigurationProperty)]
+
+\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
+
+---
+
+#### Methods
+
+##### \`inspect\`
+
+\`\`\`python
+def inspect(inspector: TreeInspector)
+\`\`\`
+
+###### \`inspector\`Required
+
+- *Type:* [\`aws_cdk.core.TreeInspector\`](#custom-aws_cdk.core.TreeInspector)
+
+tree inspector to collect and process attributes.
+
+---
+
+
+#### Properties
+
+##### \`attr_registry_id\`Required
+
+- *Type:* \`str\`
+
+---
+
+##### \`replication_configuration\`Required
+
+- *Type:* typing.Union[[\`aws_cdk.core.IResolvable\`](#custom-aws_cdk.core.IResolvable), [\`aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationConfigurationProperty\`](#custom-aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationConfigurationProperty)]
+
+\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
+
+---
+
+#### Constants
+
+##### \`CFN_RESOURCE_TYPE_NAME\`
+
+- *Type:* \`str\`
+
+The CloudFormation resource type name for this resource class.
+
+---
+
+### CfnRepository
+
+- *Implements:* [\`aws_cdk.core.IInspectable\`](#custom-aws_cdk.core.IInspectable)
+
+A CloudFormation \`AWS::ECR::Repository\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.CfnRepository(scope: Construct,
+ id: str,
+ encryption_configuration: typing.Any = None,
+ image_scanning_configuration: typing.Any = None,
+ image_tag_mutability: str = None,
+ lifecycle_policy: typing.Union[IResolvable, LifecyclePolicyProperty] = None,
+ repository_name: str = None,
+ repository_policy_text: typing.Any = None,
+ tags: typing.List[CfnTag] = None)
+\`\`\`
+
+##### \`scope\`Required
+
+- *Type:* [\`aws_cdk.core.Construct\`](#custom-aws_cdk.core.Construct)
+
+scope in which this resource is defined.
+
+---
+
+##### \`id\`Required
+
+- *Type:* \`str\`
+
+scoped id of the resource.
+
+---
+
+##### \`encryption_configuration\`Optional
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::Repository.EncryptionConfiguration\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
+
+---
+
+##### \`image_scanning_configuration\`Optional
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::Repository.ImageScanningConfiguration\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
+
+---
+
+##### \`image_tag_mutability\`Optional
+
+- *Type:* \`str\`
+
+\`AWS::ECR::Repository.ImageTagMutability\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
+
+---
+
+##### \`lifecycle_policy\`Optional
+
+- *Type:* typing.Union[[\`aws_cdk.core.IResolvable\`](#custom-aws_cdk.core.IResolvable), [\`aws_cdk.aws_ecr.CfnRepository.LifecyclePolicyProperty\`](#custom-aws_cdk.aws_ecr.CfnRepository.LifecyclePolicyProperty)]
+
+\`AWS::ECR::Repository.LifecyclePolicy\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
+
+---
+
+##### \`repository_name\`Optional
+
+- *Type:* \`str\`
+
+\`AWS::ECR::Repository.RepositoryName\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
+
+---
+
+##### \`repository_policy_text\`Optional
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::Repository.RepositoryPolicyText\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
+
+---
+
+##### \`tags\`Optional
+
+- *Type:* typing.List[[\`aws_cdk.core.CfnTag\`](#custom-aws_cdk.core.CfnTag)]
+
+\`AWS::ECR::Repository.Tags\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
+
+---
+
+#### Methods
+
+##### \`inspect\`
+
+\`\`\`python
+def inspect(inspector: TreeInspector)
+\`\`\`
+
+###### \`inspector\`Required
+
+- *Type:* [\`aws_cdk.core.TreeInspector\`](#custom-aws_cdk.core.TreeInspector)
+
+tree inspector to collect and process attributes.
+
+---
+
+
+#### Properties
+
+##### \`attr_arn\`Required
+
+- *Type:* \`str\`
+
+---
+
+##### \`attr_repository_uri\`Required
+
+- *Type:* \`str\`
+
+---
+
+##### \`tags\`Required
+
+- *Type:* [\`aws_cdk.core.TagManager\`](#custom-aws_cdk.core.TagManager)
+
+\`AWS::ECR::Repository.Tags\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
+
+---
+
+##### \`encryption_configuration\`Required
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::Repository.EncryptionConfiguration\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
+
+---
+
+##### \`image_scanning_configuration\`Required
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::Repository.ImageScanningConfiguration\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
+
+---
+
+##### \`repository_policy_text\`Required
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::Repository.RepositoryPolicyText\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
+
+---
+
+##### \`image_tag_mutability\`Optional
+
+- *Type:* \`str\`
+
+\`AWS::ECR::Repository.ImageTagMutability\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
+
+---
+
+##### \`lifecycle_policy\`Optional
+
+- *Type:* typing.Union[[\`aws_cdk.core.IResolvable\`](#custom-aws_cdk.core.IResolvable), [\`aws_cdk.aws_ecr.CfnRepository.LifecyclePolicyProperty\`](#custom-aws_cdk.aws_ecr.CfnRepository.LifecyclePolicyProperty)]
+
+\`AWS::ECR::Repository.LifecyclePolicy\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
+
+---
+
+##### \`repository_name\`Optional
+
+- *Type:* \`str\`
+
+\`AWS::ECR::Repository.RepositoryName\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
+
+---
+
+#### Constants
+
+##### \`CFN_RESOURCE_TYPE_NAME\`
+
+- *Type:* \`str\`
+
+The CloudFormation resource type name for this resource class.
+
+---
+
+### Repository
+
+Define an ECR repository.
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.Repository(scope: Construct,
+ id: str,
+ image_scan_on_push: bool = None,
+ image_tag_mutability: TagMutability = None,
+ lifecycle_registry_id: str = None,
+ lifecycle_rules: typing.List[LifecycleRule] = None,
+ removal_policy: RemovalPolicy = None,
+ repository_name: str = None)
+\`\`\`
+
+##### \`scope\`Required
+
+- *Type:* [\`constructs.Construct\`](#custom-constructs.Construct)
+
+---
+
+##### \`id\`Required
+
+- *Type:* \`str\`
+
+---
+
+##### \`image_scan_on_push\`Optional
+
+- *Type:* \`bool\`
+- *Default:* false
+
+Enable the scan on push when creating the repository.
+
+---
+
+##### \`image_tag_mutability\`Optional
+
+- *Type:* [\`aws_cdk.aws_ecr.TagMutability\`](#custom-aws_cdk.aws_ecr.TagMutability)
+- *Default:* TagMutability.MUTABLE
+
+The tag mutability setting for the repository.
+
+If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten.
+
+---
+
+##### \`lifecycle_registry_id\`Optional
+
+- *Type:* \`str\`
+- *Default:* The default registry is assumed.
+
+The AWS account ID associated with the registry that contains the repository.
+
+> https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html
+
+---
+
+##### \`lifecycle_rules\`Optional
+
+- *Type:* typing.List[[\`aws_cdk.aws_ecr.LifecycleRule\`](#custom-aws_cdk.aws_ecr.LifecycleRule)]
+- *Default:* No life cycle rules
+
+Life cycle rules to apply to this registry.
+
+---
+
+##### \`removal_policy\`Optional
+
+- *Type:* [\`aws_cdk.core.RemovalPolicy\`](#custom-aws_cdk.core.RemovalPolicy)
+- *Default:* RemovalPolicy.Retain
+
+Determine what happens to the repository when the resource/stack is deleted.
+
+---
+
+##### \`repository_name\`Optional
+
+- *Type:* \`str\`
+- *Default:* Automatically generated name.
+
+Name for this repository.
+
+---
+
+#### Methods
+
+##### \`add_lifecycle_rule\`
+
+\`\`\`python
+def add_lifecycle_rule(description: str = None,
+ max_image_age: Duration = None,
+ max_image_count: typing.Union[int, float] = None,
+ rule_priority: typing.Union[int, float] = None,
+ tag_prefix_list: typing.List[str] = None,
+ tag_status: TagStatus = None)
+\`\`\`
+
+###### \`description\`Optional
+
+- *Type:* \`str\`
+- *Default:* No description
+
+Describes the purpose of the rule.
+
+---
+
+###### \`max_image_age\`Optional
+
+- *Type:* [\`aws_cdk.core.Duration\`](#custom-aws_cdk.core.Duration)
+
+The maximum age of images to retain. The value must represent a number of days.
+
+Specify exactly one of maxImageCount and maxImageAge.
+
+---
+
+###### \`max_image_count\`Optional
+
+- *Type:* \`typing.Union[int, float]\`
+
+The maximum number of images to retain.
+
+Specify exactly one of maxImageCount and maxImageAge.
+
+---
+
+###### \`rule_priority\`Optional
+
+- *Type:* \`typing.Union[int, float]\`
+- *Default:* Automatically assigned
+
+Controls the order in which rules are evaluated (low to high).
+
+All rules must have a unique priority, where lower numbers have
+higher precedence. The first rule that matches is applied to an image.
+
+There can only be one rule with a tagStatus of Any, and it must have
+the highest rulePriority.
+
+All rules without a specified priority will have incrementing priorities
+automatically assigned to them, higher than any rules that DO have priorities.
+
+---
+
+###### \`tag_prefix_list\`Optional
+
+- *Type:* typing.List[\`str\`]
+
+Select images that have ALL the given prefixes in their tag.
+
+Only if tagStatus == TagStatus.Tagged
+
+---
+
+###### \`tag_status\`Optional
+
+- *Type:* [\`aws_cdk.aws_ecr.TagStatus\`](#custom-aws_cdk.aws_ecr.TagStatus)
+- *Default:* TagStatus.Tagged if tagPrefixList is given, TagStatus.Any otherwise
+
+Select images based on tags.
+
+Only one rule is allowed to select untagged images, and it must
+have the highest rulePriority.
+
+---
+
+##### \`add_to_resource_policy\`
+
+\`\`\`python
+def add_to_resource_policy(statement: PolicyStatement)
+\`\`\`
+
+###### \`statement\`Required
+
+- *Type:* [\`aws_cdk.aws_iam.PolicyStatement\`](#custom-aws_cdk.aws_iam.PolicyStatement)
+
+---
+
+#### Static Functions
+
+##### \`arn_for_local_repository\`
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.Repository.arn_for_local_repository(repository_name: str,
+ scope: IConstruct,
+ account: str = None)
+\`\`\`
+
+###### \`repository_name\`Required
+
+- *Type:* \`str\`
+
+---
+
+###### \`scope\`Required
+
+- *Type:* [\`constructs.IConstruct\`](#custom-constructs.IConstruct)
+
+---
+
+###### \`account\`Optional
+
+- *Type:* \`str\`
+
+---
+
+##### \`from_repository_arn\`
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.Repository.from_repository_arn(scope: Construct,
+ id: str,
+ repository_arn: str)
+\`\`\`
+
+###### \`scope\`Required
+
+- *Type:* [\`constructs.Construct\`](#custom-constructs.Construct)
+
+---
+
+###### \`id\`Required
+
+- *Type:* \`str\`
+
+---
+
+###### \`repository_arn\`Required
+
+- *Type:* \`str\`
+
+---
+
+##### \`from_repository_attributes\`
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.Repository.from_repository_attributes(scope: Construct,
+ id: str,
+ repository_arn: str,
+ repository_name: str)
+\`\`\`
+
+###### \`scope\`Required
+
+- *Type:* [\`constructs.Construct\`](#custom-constructs.Construct)
+
+---
+
+###### \`id\`Required
+
+- *Type:* \`str\`
+
+---
+
+###### \`repository_arn\`Required
+
+- *Type:* \`str\`
+
+---
+
+###### \`repository_name\`Required
+
+- *Type:* \`str\`
+
+---
+
+##### \`from_repository_name\`
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.Repository.from_repository_name(scope: Construct,
+ id: str,
+ repository_name: str)
+\`\`\`
+
+###### \`scope\`Required
+
+- *Type:* [\`constructs.Construct\`](#custom-constructs.Construct)
+
+---
+
+###### \`id\`Required
+
+- *Type:* \`str\`
+
+---
+
+###### \`repository_name\`Required
+
+- *Type:* \`str\`
+
+---
+
+#### Properties
+
+##### \`repository_arn\`Required
+
+- *Type:* \`str\`
+
+The ARN of the repository.
+
+---
+
+##### \`repository_name\`Required
+
+- *Type:* \`str\`
+
+The name of the repository.
+
+---
+
+
+### RepositoryBase
+
+- *Implements:* [\`aws_cdk.aws_ecr.IRepository\`](#custom-aws_cdk.aws_ecr.IRepository)
+
+Base class for ECR repository.
+
+Reused between imported repositories and owned repositories.
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.RepositoryBase(scope: Construct,
+ id: str,
+ account: str = None,
+ environment_from_arn: str = None,
+ physical_name: str = None,
+ region: str = None)
+\`\`\`
+
+##### \`scope\`Required
+
+- *Type:* [\`constructs.Construct\`](#custom-constructs.Construct)
+
+---
+
+##### \`id\`Required
+
+- *Type:* \`str\`
+
+---
+
+##### \`account\`Optional
+
+- *Type:* \`str\`
+- *Default:* the resource is in the same account as the stack it belongs to
+
+The AWS account ID this resource belongs to.
+
+---
+
+##### \`environment_from_arn\`Optional
+
+- *Type:* \`str\`
+- *Default:* take environment from \`account\`, \`region\` parameters, or use Stack environment.
+
+ARN to deduce region and account from.
+
+The ARN is parsed and the account and region are taken from the ARN.
+This should be used for imported resources.
+
+Cannot be supplied together with either \`account\` or \`region\`.
+
+---
+
+##### \`physical_name\`Optional
+
+- *Type:* \`str\`
+- *Default:* The physical name will be allocated by CloudFormation at deployment time
+
+The value passed in by users to the physical name prop of the resource.
+
+\`undefined\` implies that a physical name will be allocated by
+ CloudFormation during deployment.
+- a concrete value implies a specific physical name
+- \`PhysicalName.GENERATE_IF_NEEDED\` is a marker that indicates that a physical will only be generated
+ by the CDK if it is needed for cross-environment references. Otherwise, it will be allocated by CloudFormation.
+
+---
+
+##### \`region\`Optional
+
+- *Type:* \`str\`
+- *Default:* the resource is in the same region as the stack it belongs to
+
+The AWS region this resource belongs to.
+
+---
+
+#### Methods
+
+##### \`add_to_resource_policy\`
+
+\`\`\`python
+def add_to_resource_policy(statement: PolicyStatement)
+\`\`\`
+
+###### \`statement\`Required
+
+- *Type:* [\`aws_cdk.aws_iam.PolicyStatement\`](#custom-aws_cdk.aws_iam.PolicyStatement)
+
+---
+
+##### \`grant\`
+
+\`\`\`python
+def grant(grantee: IGrantable,
+ actions: str)
+\`\`\`
+
+###### \`grantee\`Required
+
+- *Type:* [\`aws_cdk.aws_iam.IGrantable\`](#custom-aws_cdk.aws_iam.IGrantable)
+
+---
+
+###### \`actions\`Required
+
+- *Type:* \`str\`
+
+---
+
+##### \`grant_pull\`
+
+\`\`\`python
+def grant_pull(grantee: IGrantable)
+\`\`\`
+
+###### \`grantee\`Required
+
+- *Type:* [\`aws_cdk.aws_iam.IGrantable\`](#custom-aws_cdk.aws_iam.IGrantable)
+
+---
+
+##### \`grant_pull_push\`
+
+\`\`\`python
+def grant_pull_push(grantee: IGrantable)
+\`\`\`
+
+###### \`grantee\`Required
+
+- *Type:* [\`aws_cdk.aws_iam.IGrantable\`](#custom-aws_cdk.aws_iam.IGrantable)
+
+---
+
+##### \`on_cloud_trail_event\`
+
+\`\`\`python
+def on_cloud_trail_event(id: str,
+ description: str = None,
+ event_pattern: EventPattern = None,
+ rule_name: str = None,
+ target: IRuleTarget = None)
+\`\`\`
+
+###### \`id\`Required
+
+- *Type:* \`str\`
+
+The id of the rule.
+
+---
+
+###### \`description\`Optional
+
+- *Type:* \`str\`
+- *Default:* No description
+
+A description of the rule's purpose.
+
+---
+
+###### \`event_pattern\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.EventPattern\`](#custom-aws_cdk.aws_events.EventPattern)
+- *Default:* No additional filtering based on an event pattern.
+
+Additional restrictions for the event to route to the specified target.
+
+The method that generates the rule probably imposes some type of event
+filtering. The filtering implied by what you pass here is added
+on top of that filtering.
+
+> https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
+
+---
+
+###### \`rule_name\`Optional
+
+- *Type:* \`str\`
+- *Default:* AWS CloudFormation generates a unique physical ID.
+
+A name for the rule.
+
+---
+
+###### \`target\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.IRuleTarget\`](#custom-aws_cdk.aws_events.IRuleTarget)
+- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
+
+The target to register for the event.
+
+---
+
+##### \`on_cloud_trail_image_pushed\`
+
+\`\`\`python
+def on_cloud_trail_image_pushed(id: str,
+ description: str = None,
+ event_pattern: EventPattern = None,
+ rule_name: str = None,
+ target: IRuleTarget = None,
+ image_tag: str = None)
+\`\`\`
+
+###### \`id\`Required
+
+- *Type:* \`str\`
+
+The id of the rule.
+
+---
+
+###### \`description\`Optional
+
+- *Type:* \`str\`
+- *Default:* No description
+
+A description of the rule's purpose.
+
+---
+
+###### \`event_pattern\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.EventPattern\`](#custom-aws_cdk.aws_events.EventPattern)
+- *Default:* No additional filtering based on an event pattern.
+
+Additional restrictions for the event to route to the specified target.
+
+The method that generates the rule probably imposes some type of event
+filtering. The filtering implied by what you pass here is added
+on top of that filtering.
+
+> https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
+
+---
+
+###### \`rule_name\`Optional
+
+- *Type:* \`str\`
+- *Default:* AWS CloudFormation generates a unique physical ID.
+
+A name for the rule.
+
+---
+
+###### \`target\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.IRuleTarget\`](#custom-aws_cdk.aws_events.IRuleTarget)
+- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
+
+The target to register for the event.
+
+---
+
+###### \`image_tag\`Optional
+
+- *Type:* \`str\`
+- *Default:* Watch changes to all tags
+
+Only watch changes to this image tag.
+
+---
+
+##### \`on_event\`
+
+\`\`\`python
+def on_event(id: str,
+ description: str = None,
+ event_pattern: EventPattern = None,
+ rule_name: str = None,
+ target: IRuleTarget = None)
+\`\`\`
+
+###### \`id\`Required
+
+- *Type:* \`str\`
+
+---
+
+###### \`description\`Optional
+
+- *Type:* \`str\`
+- *Default:* No description
+
+A description of the rule's purpose.
+
+---
+
+###### \`event_pattern\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.EventPattern\`](#custom-aws_cdk.aws_events.EventPattern)
+- *Default:* No additional filtering based on an event pattern.
+
+Additional restrictions for the event to route to the specified target.
+
+The method that generates the rule probably imposes some type of event
+filtering. The filtering implied by what you pass here is added
+on top of that filtering.
+
+> https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
+
+---
+
+###### \`rule_name\`Optional
+
+- *Type:* \`str\`
+- *Default:* AWS CloudFormation generates a unique physical ID.
+
+A name for the rule.
+
+---
+
+###### \`target\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.IRuleTarget\`](#custom-aws_cdk.aws_events.IRuleTarget)
+- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
+
+The target to register for the event.
+
+---
+
+##### \`on_image_scan_completed\`
+
+\`\`\`python
+def on_image_scan_completed(id: str,
+ description: str = None,
+ event_pattern: EventPattern = None,
+ rule_name: str = None,
+ target: IRuleTarget = None,
+ image_tags: typing.List[str] = None)
+\`\`\`
+
+###### \`id\`Required
+
+- *Type:* \`str\`
+
+The id of the rule.
+
+---
+
+###### \`description\`Optional
+
+- *Type:* \`str\`
+- *Default:* No description
+
+A description of the rule's purpose.
+
+---
+
+###### \`event_pattern\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.EventPattern\`](#custom-aws_cdk.aws_events.EventPattern)
+- *Default:* No additional filtering based on an event pattern.
+
+Additional restrictions for the event to route to the specified target.
+
+The method that generates the rule probably imposes some type of event
+filtering. The filtering implied by what you pass here is added
+on top of that filtering.
+
+> https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
+
+---
+
+###### \`rule_name\`Optional
+
+- *Type:* \`str\`
+- *Default:* AWS CloudFormation generates a unique physical ID.
+
+A name for the rule.
+
+---
+
+###### \`target\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.IRuleTarget\`](#custom-aws_cdk.aws_events.IRuleTarget)
+- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
+
+The target to register for the event.
+
+---
+
+###### \`image_tags\`Optional
+
+- *Type:* typing.List[\`str\`]
+- *Default:* Watch the changes to the repository with all image tags
+
+Only watch changes to the image tags spedified.
+
+Leave it undefined to watch the full repository.
+
+---
+
+##### \`repository_uri_for_digest\`
+
+\`\`\`python
+def repository_uri_for_digest(digest: str = None)
+\`\`\`
+
+###### \`digest\`Optional
+
+- *Type:* \`str\`
+
+Optional image digest.
+
+---
+
+##### \`repository_uri_for_tag\`
+
+\`\`\`python
+def repository_uri_for_tag(tag: str = None)
+\`\`\`
+
+###### \`tag\`Optional
+
+- *Type:* \`str\`
+
+Optional image tag.
+
+---
+
+
+#### Properties
+
+##### \`repository_arn\`Required
+
+- *Type:* \`str\`
+
+The ARN of the repository.
+
+---
+
+##### \`repository_name\`Required
+
+- *Type:* \`str\`
+
+The name of the repository.
+
+---
+
+##### \`repository_uri\`Required
+
+- *Type:* \`str\`
+
+The URI of this repository (represents the latest image):.
+
+ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
+
+---
+
+
+## Structs
+
+### CfnPublicRepositoryProps
+
+Properties for defining a \`AWS::ECR::PublicRepository\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.CfnPublicRepositoryProps(repository_catalog_data: typing.Any = None,
+ repository_name: str = None,
+ repository_policy_text: typing.Any = None,
+ tags: typing.List[CfnTag] = None)
+\`\`\`
+
+##### \`repository_catalog_data\`Optional
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
+
+---
+
+##### \`repository_name\`Optional
+
+- *Type:* \`str\`
+
+\`AWS::ECR::PublicRepository.RepositoryName\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
+
+---
+
+##### \`repository_policy_text\`Optional
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
+
+---
+
+##### \`tags\`Optional
+
+- *Type:* typing.List[[\`aws_cdk.core.CfnTag\`](#custom-aws_cdk.core.CfnTag)]
+
+\`AWS::ECR::PublicRepository.Tags\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
+
+---
+
+### CfnRegistryPolicyProps
+
+Properties for defining a \`AWS::ECR::RegistryPolicy\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html)
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.CfnRegistryPolicyProps(policy_text: typing.Any)
+\`\`\`
+
+##### \`policy_text\`Required
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::RegistryPolicy.PolicyText\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
+
+---
+
+### CfnReplicationConfigurationProps
+
+Properties for defining a \`AWS::ECR::ReplicationConfiguration\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.CfnReplicationConfigurationProps(replication_configuration: typing.Union[IResolvable, ReplicationConfigurationProperty])
+\`\`\`
+
+##### \`replication_configuration\`Required
+
+- *Type:* typing.Union[[\`aws_cdk.core.IResolvable\`](#custom-aws_cdk.core.IResolvable), [\`aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationConfigurationProperty\`](#custom-aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationConfigurationProperty)]
+
+\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
+
+---
+
+### CfnRepositoryProps
+
+Properties for defining a \`AWS::ECR::Repository\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.CfnRepositoryProps(encryption_configuration: typing.Any = None,
+ image_scanning_configuration: typing.Any = None,
+ image_tag_mutability: str = None,
+ lifecycle_policy: typing.Union[IResolvable, LifecyclePolicyProperty] = None,
+ repository_name: str = None,
+ repository_policy_text: typing.Any = None,
+ tags: typing.List[CfnTag] = None)
+\`\`\`
+
+##### \`encryption_configuration\`Optional
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::Repository.EncryptionConfiguration\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
+
+---
+
+##### \`image_scanning_configuration\`Optional
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::Repository.ImageScanningConfiguration\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
+
+---
+
+##### \`image_tag_mutability\`Optional
+
+- *Type:* \`str\`
+
+\`AWS::ECR::Repository.ImageTagMutability\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
+
+---
+
+##### \`lifecycle_policy\`Optional
+
+- *Type:* typing.Union[[\`aws_cdk.core.IResolvable\`](#custom-aws_cdk.core.IResolvable), [\`aws_cdk.aws_ecr.CfnRepository.LifecyclePolicyProperty\`](#custom-aws_cdk.aws_ecr.CfnRepository.LifecyclePolicyProperty)]
+
+\`AWS::ECR::Repository.LifecyclePolicy\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
+
+---
+
+##### \`repository_name\`Optional
+
+- *Type:* \`str\`
+
+\`AWS::ECR::Repository.RepositoryName\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
+
+---
+
+##### \`repository_policy_text\`Optional
+
+- *Type:* \`typing.Any\`
+
+\`AWS::ECR::Repository.RepositoryPolicyText\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
+
+---
+
+##### \`tags\`Optional
+
+- *Type:* typing.List[[\`aws_cdk.core.CfnTag\`](#custom-aws_cdk.core.CfnTag)]
+
+\`AWS::ECR::Repository.Tags\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
+
+---
+
+### LifecyclePolicyProperty
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html)
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.CfnRepository.LifecyclePolicyProperty(lifecycle_policy_text: str = None,
+ registry_id: str = None)
+\`\`\`
+
+##### \`lifecycle_policy_text\`Optional
+
+- *Type:* \`str\`
+
+\`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext)
+
+---
+
+##### \`registry_id\`Optional
+
+- *Type:* \`str\`
+
+\`CfnRepository.LifecyclePolicyProperty.RegistryId\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid)
+
+---
+
+### LifecycleRule
+
+An ECR life cycle rule.
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.LifecycleRule(description: str = None,
+ max_image_age: Duration = None,
+ max_image_count: typing.Union[int, float] = None,
+ rule_priority: typing.Union[int, float] = None,
+ tag_prefix_list: typing.List[str] = None,
+ tag_status: TagStatus = None)
+\`\`\`
+
+##### \`description\`Optional
+
+- *Type:* \`str\`
+- *Default:* No description
+
+Describes the purpose of the rule.
+
+---
+
+##### \`max_image_age\`Optional
+
+- *Type:* [\`aws_cdk.core.Duration\`](#custom-aws_cdk.core.Duration)
+
+The maximum age of images to retain. The value must represent a number of days.
+
+Specify exactly one of maxImageCount and maxImageAge.
+
+---
+
+##### \`max_image_count\`Optional
+
+- *Type:* \`typing.Union[int, float]\`
+
+The maximum number of images to retain.
+
+Specify exactly one of maxImageCount and maxImageAge.
+
+---
+
+##### \`rule_priority\`Optional
+
+- *Type:* \`typing.Union[int, float]\`
+- *Default:* Automatically assigned
+
+Controls the order in which rules are evaluated (low to high).
+
+All rules must have a unique priority, where lower numbers have
+higher precedence. The first rule that matches is applied to an image.
+
+There can only be one rule with a tagStatus of Any, and it must have
+the highest rulePriority.
+
+All rules without a specified priority will have incrementing priorities
+automatically assigned to them, higher than any rules that DO have priorities.
+
+---
+
+##### \`tag_prefix_list\`Optional
+
+- *Type:* typing.List[\`str\`]
+
+Select images that have ALL the given prefixes in their tag.
+
+Only if tagStatus == TagStatus.Tagged
+
+---
+
+##### \`tag_status\`Optional
+
+- *Type:* [\`aws_cdk.aws_ecr.TagStatus\`](#custom-aws_cdk.aws_ecr.TagStatus)
+- *Default:* TagStatus.Tagged if tagPrefixList is given, TagStatus.Any otherwise
+
+Select images based on tags.
+
+Only one rule is allowed to select untagged images, and it must
+have the highest rulePriority.
+
+---
+
+### OnCloudTrailImagePushedOptions
+
+Options for the onCloudTrailImagePushed method.
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.OnCloudTrailImagePushedOptions(description: str = None,
+ event_pattern: EventPattern = None,
+ rule_name: str = None,
+ target: IRuleTarget = None,
+ image_tag: str = None)
+\`\`\`
+
+##### \`description\`Optional
+
+- *Type:* \`str\`
+- *Default:* No description
+
+A description of the rule's purpose.
+
+---
+
+##### \`event_pattern\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.EventPattern\`](#custom-aws_cdk.aws_events.EventPattern)
+- *Default:* No additional filtering based on an event pattern.
+
+Additional restrictions for the event to route to the specified target.
+
+The method that generates the rule probably imposes some type of event
+filtering. The filtering implied by what you pass here is added
+on top of that filtering.
+
+> https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
+
+---
+
+##### \`rule_name\`Optional
+
+- *Type:* \`str\`
+- *Default:* AWS CloudFormation generates a unique physical ID.
+
+A name for the rule.
+
+---
+
+##### \`target\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.IRuleTarget\`](#custom-aws_cdk.aws_events.IRuleTarget)
+- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
+
+The target to register for the event.
+
+---
+
+##### \`image_tag\`Optional
+
+- *Type:* \`str\`
+- *Default:* Watch changes to all tags
+
+Only watch changes to this image tag.
+
+---
+
+### OnImageScanCompletedOptions
+
+Options for the OnImageScanCompleted method.
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.OnImageScanCompletedOptions(description: str = None,
+ event_pattern: EventPattern = None,
+ rule_name: str = None,
+ target: IRuleTarget = None,
+ image_tags: typing.List[str] = None)
+\`\`\`
+
+##### \`description\`Optional
+
+- *Type:* \`str\`
+- *Default:* No description
+
+A description of the rule's purpose.
+
+---
+
+##### \`event_pattern\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.EventPattern\`](#custom-aws_cdk.aws_events.EventPattern)
+- *Default:* No additional filtering based on an event pattern.
+
+Additional restrictions for the event to route to the specified target.
+
+The method that generates the rule probably imposes some type of event
+filtering. The filtering implied by what you pass here is added
+on top of that filtering.
+
+> https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
+
+---
+
+##### \`rule_name\`Optional
+
+- *Type:* \`str\`
+- *Default:* AWS CloudFormation generates a unique physical ID.
+
+A name for the rule.
+
+---
+
+##### \`target\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.IRuleTarget\`](#custom-aws_cdk.aws_events.IRuleTarget)
+- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
+
+The target to register for the event.
+
+---
+
+##### \`image_tags\`Optional
+
+- *Type:* typing.List[\`str\`]
+- *Default:* Watch the changes to the repository with all image tags
+
+Only watch changes to the image tags spedified.
+
+Leave it undefined to watch the full repository.
+
+---
+
+### ReplicationConfigurationProperty
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html)
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationConfigurationProperty(rules: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationRuleProperty]]])
+\`\`\`
+
+##### \`rules\`Required
+
+- *Type:* typing.Union[[\`aws_cdk.core.IResolvable\`](#custom-aws_cdk.core.IResolvable), typing.List[typing.Union[[\`aws_cdk.core.IResolvable\`](#custom-aws_cdk.core.IResolvable), [\`aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationRuleProperty\`](#custom-aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationRuleProperty)]]]
+
+\`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules)
+
+---
+
+### ReplicationDestinationProperty
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html)
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationDestinationProperty(region: str,
+ registry_id: str)
+\`\`\`
+
+##### \`region\`Required
+
+- *Type:* \`str\`
+
+\`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region)
+
+---
+
+##### \`registry_id\`Required
+
+- *Type:* \`str\`
+
+\`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid)
+
+---
+
+### ReplicationRuleProperty
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html)
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationRuleProperty(destinations: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationDestinationProperty]]])
+\`\`\`
+
+##### \`destinations\`Required
+
+- *Type:* typing.Union[[\`aws_cdk.core.IResolvable\`](#custom-aws_cdk.core.IResolvable), typing.List[typing.Union[[\`aws_cdk.core.IResolvable\`](#custom-aws_cdk.core.IResolvable), [\`aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationDestinationProperty\`](#custom-aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationDestinationProperty)]]]
+
+\`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`.
+
+> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations)
+
+---
+
+### RepositoryAttributes
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.RepositoryAttributes(repository_arn: str,
+ repository_name: str)
+\`\`\`
+
+##### \`repository_arn\`Required
+
+- *Type:* \`str\`
+
+---
+
+##### \`repository_name\`Required
+
+- *Type:* \`str\`
+
+---
+
+### RepositoryProps
+
+#### Initializer
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.RepositoryProps(image_scan_on_push: bool = None,
+ image_tag_mutability: TagMutability = None,
+ lifecycle_registry_id: str = None,
+ lifecycle_rules: typing.List[LifecycleRule] = None,
+ removal_policy: RemovalPolicy = None,
+ repository_name: str = None)
+\`\`\`
+
+##### \`image_scan_on_push\`Optional
+
+- *Type:* \`bool\`
+- *Default:* false
+
+Enable the scan on push when creating the repository.
+
+---
+
+##### \`image_tag_mutability\`Optional
+
+- *Type:* [\`aws_cdk.aws_ecr.TagMutability\`](#custom-aws_cdk.aws_ecr.TagMutability)
+- *Default:* TagMutability.MUTABLE
+
+The tag mutability setting for the repository.
+
+If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten.
+
+---
+
+##### \`lifecycle_registry_id\`Optional
+
+- *Type:* \`str\`
+- *Default:* The default registry is assumed.
+
+The AWS account ID associated with the registry that contains the repository.
+
+> https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html
+
+---
+
+##### \`lifecycle_rules\`Optional
+
+- *Type:* typing.List[[\`aws_cdk.aws_ecr.LifecycleRule\`](#custom-aws_cdk.aws_ecr.LifecycleRule)]
+- *Default:* No life cycle rules
+
+Life cycle rules to apply to this registry.
+
+---
+
+##### \`removal_policy\`Optional
+
+- *Type:* [\`aws_cdk.core.RemovalPolicy\`](#custom-aws_cdk.core.RemovalPolicy)
+- *Default:* RemovalPolicy.Retain
+
+Determine what happens to the repository when the resource/stack is deleted.
+
+---
+
+##### \`repository_name\`Optional
+
+- *Type:* \`str\`
+- *Default:* Automatically generated name.
+
+Name for this repository.
+
+---
+
+## Classes
+
+### AuthorizationToken
+
+Authorization token to access private ECR repositories in the current environment via Docker CLI.
+
+> https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html
+
+
+#### Static Functions
+
+##### \`grant_read\`
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.AuthorizationToken.grant_read(grantee: IGrantable)
+\`\`\`
+
+###### \`grantee\`Required
+
+- *Type:* [\`aws_cdk.aws_iam.IGrantable\`](#custom-aws_cdk.aws_iam.IGrantable)
+
+---
+
+
+
+### PublicGalleryAuthorizationToken
+
+Authorization token to access the global public ECR Gallery via Docker CLI.
+
+> https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth
+
+
+#### Static Functions
+
+##### \`grant_read\`
+
+\`\`\`python
+import aws_cdk.aws_ecr
+
+aws_cdk.aws_ecr.PublicGalleryAuthorizationToken.grant_read(grantee: IGrantable)
+\`\`\`
+
+###### \`grantee\`Required
+
+- *Type:* [\`aws_cdk.aws_iam.IGrantable\`](#custom-aws_cdk.aws_iam.IGrantable)
+
+---
+
+
+
+## Protocols
+
+### IRepository
+
+- *Extends:* [\`aws_cdk.core.IResource\`](#custom-aws_cdk.core.IResource)
+
+- *Implemented By:* [\`aws_cdk.aws_ecr.Repository\`](#custom-aws_cdk.aws_ecr.Repository), [\`aws_cdk.aws_ecr.RepositoryBase\`](#custom-aws_cdk.aws_ecr.RepositoryBase), [\`aws_cdk.aws_ecr.IRepository\`](#custom-aws_cdk.aws_ecr.IRepository)
+
+Represents an ECR repository.
+
+#### Methods
+
+##### \`add_to_resource_policy\`
+
+\`\`\`python
+def add_to_resource_policy(statement: PolicyStatement)
+\`\`\`
+
+###### \`statement\`Required
+
+- *Type:* [\`aws_cdk.aws_iam.PolicyStatement\`](#custom-aws_cdk.aws_iam.PolicyStatement)
+
+---
+
+##### \`grant\`
+
+\`\`\`python
+def grant(grantee: IGrantable,
+ actions: str)
+\`\`\`
+
+###### \`grantee\`Required
+
+- *Type:* [\`aws_cdk.aws_iam.IGrantable\`](#custom-aws_cdk.aws_iam.IGrantable)
+
+---
+
+###### \`actions\`Required
+
+- *Type:* \`str\`
+
+---
+
+##### \`grant_pull\`
+
+\`\`\`python
+def grant_pull(grantee: IGrantable)
+\`\`\`
+
+###### \`grantee\`Required
+
+- *Type:* [\`aws_cdk.aws_iam.IGrantable\`](#custom-aws_cdk.aws_iam.IGrantable)
+
+---
+
+##### \`grant_pull_push\`
+
+\`\`\`python
+def grant_pull_push(grantee: IGrantable)
+\`\`\`
+
+###### \`grantee\`Required
+
+- *Type:* [\`aws_cdk.aws_iam.IGrantable\`](#custom-aws_cdk.aws_iam.IGrantable)
+
+---
+
+##### \`on_cloud_trail_event\`
+
+\`\`\`python
+def on_cloud_trail_event(id: str,
+ description: str = None,
+ event_pattern: EventPattern = None,
+ rule_name: str = None,
+ target: IRuleTarget = None)
+\`\`\`
+
+###### \`id\`Required
+
+- *Type:* \`str\`
+
+The id of the rule.
+
+---
+
+###### \`description\`Optional
+
+- *Type:* \`str\`
+- *Default:* No description
+
+A description of the rule's purpose.
+
+---
+
+###### \`event_pattern\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.EventPattern\`](#custom-aws_cdk.aws_events.EventPattern)
+- *Default:* No additional filtering based on an event pattern.
+
+Additional restrictions for the event to route to the specified target.
+
+The method that generates the rule probably imposes some type of event
+filtering. The filtering implied by what you pass here is added
+on top of that filtering.
+
+> https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
+
+---
+
+###### \`rule_name\`Optional
+
+- *Type:* \`str\`
+- *Default:* AWS CloudFormation generates a unique physical ID.
+
+A name for the rule.
+
+---
+
+###### \`target\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.IRuleTarget\`](#custom-aws_cdk.aws_events.IRuleTarget)
+- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
+
+The target to register for the event.
+
+---
+
+##### \`on_cloud_trail_image_pushed\`
+
+\`\`\`python
+def on_cloud_trail_image_pushed(id: str,
+ description: str = None,
+ event_pattern: EventPattern = None,
+ rule_name: str = None,
+ target: IRuleTarget = None,
+ image_tag: str = None)
+\`\`\`
+
+###### \`id\`Required
+
+- *Type:* \`str\`
+
+The id of the rule.
+
+---
+
+###### \`description\`Optional
+
+- *Type:* \`str\`
+- *Default:* No description
+
+A description of the rule's purpose.
+
+---
+
+###### \`event_pattern\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.EventPattern\`](#custom-aws_cdk.aws_events.EventPattern)
+- *Default:* No additional filtering based on an event pattern.
+
+Additional restrictions for the event to route to the specified target.
+
+The method that generates the rule probably imposes some type of event
+filtering. The filtering implied by what you pass here is added
+on top of that filtering.
+
+> https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
+
+---
+
+###### \`rule_name\`Optional
+
+- *Type:* \`str\`
+- *Default:* AWS CloudFormation generates a unique physical ID.
+
+A name for the rule.
+
+---
+
+###### \`target\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.IRuleTarget\`](#custom-aws_cdk.aws_events.IRuleTarget)
+- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
+
+The target to register for the event.
+
+---
+
+###### \`image_tag\`Optional
+
+- *Type:* \`str\`
+- *Default:* Watch changes to all tags
+
+Only watch changes to this image tag.
+
+---
+
+##### \`on_event\`
+
+\`\`\`python
+def on_event(id: str,
+ description: str = None,
+ event_pattern: EventPattern = None,
+ rule_name: str = None,
+ target: IRuleTarget = None)
+\`\`\`
+
+###### \`id\`Required
+
+- *Type:* \`str\`
+
+---
+
+###### \`description\`Optional
+
+- *Type:* \`str\`
+- *Default:* No description
+
+A description of the rule's purpose.
+
+---
+
+###### \`event_pattern\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.EventPattern\`](#custom-aws_cdk.aws_events.EventPattern)
+- *Default:* No additional filtering based on an event pattern.
+
+Additional restrictions for the event to route to the specified target.
+
+The method that generates the rule probably imposes some type of event
+filtering. The filtering implied by what you pass here is added
+on top of that filtering.
+
+> https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
+
+---
+
+###### \`rule_name\`Optional
+
+- *Type:* \`str\`
+- *Default:* AWS CloudFormation generates a unique physical ID.
+
+A name for the rule.
+
+---
+
+###### \`target\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.IRuleTarget\`](#custom-aws_cdk.aws_events.IRuleTarget)
+- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
+
+The target to register for the event.
+
+---
+
+##### \`on_image_scan_completed\`
+
+\`\`\`python
+def on_image_scan_completed(id: str,
+ description: str = None,
+ event_pattern: EventPattern = None,
+ rule_name: str = None,
+ target: IRuleTarget = None,
+ image_tags: typing.List[str] = None)
+\`\`\`
+
+###### \`id\`Required
+
+- *Type:* \`str\`
+
+The id of the rule.
+
+---
+
+###### \`description\`Optional
+
+- *Type:* \`str\`
+- *Default:* No description
+
+A description of the rule's purpose.
+
+---
+
+###### \`event_pattern\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.EventPattern\`](#custom-aws_cdk.aws_events.EventPattern)
+- *Default:* No additional filtering based on an event pattern.
+
+Additional restrictions for the event to route to the specified target.
+
+The method that generates the rule probably imposes some type of event
+filtering. The filtering implied by what you pass here is added
+on top of that filtering.
+
+> https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
+
+---
+
+###### \`rule_name\`Optional
+
+- *Type:* \`str\`
+- *Default:* AWS CloudFormation generates a unique physical ID.
+
+A name for the rule.
+
+---
+
+###### \`target\`Optional
+
+- *Type:* [\`aws_cdk.aws_events.IRuleTarget\`](#custom-aws_cdk.aws_events.IRuleTarget)
+- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
+
+The target to register for the event.
+
+---
+
+###### \`image_tags\`Optional
+
+- *Type:* typing.List[\`str\`]
+- *Default:* Watch the changes to the repository with all image tags
+
+Only watch changes to the image tags spedified.
+
+Leave it undefined to watch the full repository.
+
+---
+
+##### \`repository_uri_for_digest\`
+
+\`\`\`python
+def repository_uri_for_digest(digest: str = None)
+\`\`\`
+
+###### \`digest\`Optional
+
+- *Type:* \`str\`
+
+Image digest to use (tools usually default to the image with the \\"latest\\" tag if omitted).
+
+---
+
+##### \`repository_uri_for_tag\`
+
+\`\`\`python
+def repository_uri_for_tag(tag: str = None)
+\`\`\`
+
+###### \`tag\`Optional
+
+- *Type:* \`str\`
+
+Image tag to use (tools usually default to \\"latest\\" if omitted).
+
+---
+
+#### Properties
+
+##### \`node\`Required
+
+- *Type:* [\`aws_cdk.core.ConstructNode\`](#custom-aws_cdk.core.ConstructNode)
+
+The construct tree node for this construct.
+
+---
+
+##### \`env\`Required
+
+- *Type:* [\`aws_cdk.core.ResourceEnvironment\`](#custom-aws_cdk.core.ResourceEnvironment)
+
+The environment this resource belongs to.
+
+For resources that are created and managed by the CDK
+(generally, those created by creating new class instances like Role, Bucket, etc.),
+this is always the same as the environment of the stack they belong to;
+however, for imported resources
+(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
+that might be different than the stack they were imported into.
+
+---
+
+##### \`stack\`Required
+
+- *Type:* [\`aws_cdk.core.Stack\`](#custom-aws_cdk.core.Stack)
+
+The stack in which this resource is defined.
+
+---
+
+##### \`repository_arn\`Required
+
+- *Type:* \`str\`
+
+The ARN of the repository.
+
+---
+
+##### \`repository_name\`Required
+
+- *Type:* \`str\`
+
+The name of the repository.
+
+---
+
+##### \`repository_uri\`Required
+
+- *Type:* \`str\`
+
+The URI of this repository (represents the latest image):.
+
+ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
+
+---
+
+## Enums
+
+### TagMutability
+
+The tag mutability setting for your repository.
+
+#### \`MUTABLE\`
+
+allow image tags to be overwritten.
+
+---
+
+
+#### \`IMMUTABLE\`
+
+all image tags within the repository will be immutable which will prevent them from being overwritten.
+
+---
+
+
+### TagStatus
+
+Select images based on tags.
+
+#### \`ANY\`
+
+Rule applies to all images.
+
+---
+
+
+#### \`TAGGED\`
+
+Rule applies to tagged images.
+
+---
+
+
+#### \`UNTAGGED\`
+
+Rule applies to untagged images.
+
+---
+
+"
+`;
+
exports[`package installation does not run lifecycle hooks 1`] = `
"# construct-library
diff --git a/test/docgen/view/class.test.ts b/test/docgen/view/class.test.ts
index a1f3eec7..c1dfcf67 100644
--- a/test/docgen/view/class.test.ts
+++ b/test/docgen/view/class.test.ts
@@ -1,5 +1,6 @@
import * as reflect from 'jsii-reflect';
import { PythonTranspile } from '../../../src/docgen/transpile/python';
+import { TranspiledType } from '../../../src/docgen/transpile/transpile';
import { TypeScriptTranspile } from '../../../src/docgen/transpile/typescript';
import { Class } from '../../../src/docgen/view/class';
import { Assemblies } from '../assemblies';
@@ -9,7 +10,7 @@ const assembly: reflect.Assembly = Assemblies.instance.withoutSubmodules;
describe('python', () => {
const transpile = new PythonTranspile();
test('snapshot', () => {
- const klass = new Class(transpile, assembly.classes[0]);
+ const klass = new Class(transpile, assembly.classes[0], (t: TranspiledType) => `#${t.fqn}`);
expect(klass.render().render()).toMatchSnapshot();
});
});
@@ -17,7 +18,7 @@ describe('python', () => {
describe('typescript', () => {
const transpile = new TypeScriptTranspile();
test('snapshot', () => {
- const klass = new Class(transpile, assembly.classes[0]);
+ const klass = new Class(transpile, assembly.classes[0], (t: TranspiledType) => `#${t.fqn}`);
expect(klass.render().render()).toMatchSnapshot();
});
});
diff --git a/test/docgen/view/documentation.test.ts b/test/docgen/view/documentation.test.ts
index 11951215..25be11c3 100644
--- a/test/docgen/view/documentation.test.ts
+++ b/test/docgen/view/documentation.test.ts
@@ -2,8 +2,7 @@ import * as child from 'child_process';
import * as os from 'os';
import * as path from 'path';
import * as fs from 'fs-extra';
-import { Documentation } from '../../../src';
-import { Language } from '../../../src/docgen/transpile/transpile';
+import { Language, Documentation, TranspiledType } from '../../../src';
import { extractPackageName } from '../../../src/docgen/view/documentation';
const ASSEMBLIES = `${__dirname}/../../__fixtures__/assemblies`;
@@ -34,6 +33,14 @@ describe('extractPackageName', () => {
});
+test('custom link formatter', async () => {
+ const docs = await Documentation.forPackage('@aws-cdk/aws-ecr@1.106.0', {
+ language: Language.PYTHON,
+ });
+ const markdown = docs.render({ linkFormatter: (t: TranspiledType) => `#custom-${t.fqn}` });
+ expect(markdown.render()).toMatchSnapshot();
+});
+
test('package installation does not run lifecycle hooks', async () => {
const workdir = await fs.mkdtemp(path.join(os.tmpdir(), path.sep));
diff --git a/test/docgen/view/initializer.test.ts b/test/docgen/view/initializer.test.ts
index fcf1bf33..f4aa1954 100644
--- a/test/docgen/view/initializer.test.ts
+++ b/test/docgen/view/initializer.test.ts
@@ -1,5 +1,6 @@
import * as reflect from 'jsii-reflect';
import { PythonTranspile } from '../../../src/docgen/transpile/python';
+import { TranspiledType } from '../../../src/docgen/transpile/transpile';
import { TypeScriptTranspile } from '../../../src/docgen/transpile/typescript';
import { Initializer } from '../../../src/docgen/view/initializer';
import { Assemblies } from '../assemblies';
@@ -18,7 +19,7 @@ const findInitializer = (): reflect.Initializer => {
describe('python', () => {
const transpile = new PythonTranspile();
test('snapshot', () => {
- const initializer = new Initializer(transpile, findInitializer());
+ const initializer = new Initializer(transpile, findInitializer(), (t: TranspiledType) => `#${t.fqn}`);
expect(initializer.render().render()).toMatchSnapshot();
});
});
@@ -26,7 +27,7 @@ describe('python', () => {
describe('typescript', () => {
const transpile = new TypeScriptTranspile();
test('snapshot', () => {
- const initializer = new Initializer(transpile, findInitializer());
+ const initializer = new Initializer(transpile, findInitializer(), (t: TranspiledType) => `#${t.fqn}`);
expect(initializer.render().render()).toMatchSnapshot();
});
});
diff --git a/test/docgen/view/instance-method.test.ts b/test/docgen/view/instance-method.test.ts
index 66290e83..a84847bc 100644
--- a/test/docgen/view/instance-method.test.ts
+++ b/test/docgen/view/instance-method.test.ts
@@ -1,5 +1,6 @@
import * as reflect from 'jsii-reflect';
import { PythonTranspile } from '../../../src/docgen/transpile/python';
+import { TranspiledType } from '../../../src/docgen/transpile/transpile';
import { TypeScriptTranspile } from '../../../src/docgen/transpile/typescript';
import { InstanceMethod } from '../../../src/docgen/view/instance-method';
import { Assemblies } from '../assemblies';
@@ -20,7 +21,7 @@ const findInstanceMethod = (): reflect.Method => {
describe('python', () => {
const transpile = new PythonTranspile();
test('snapshot', () => {
- const instanceMethod = new InstanceMethod(transpile, findInstanceMethod());
+ const instanceMethod = new InstanceMethod(transpile, findInstanceMethod(), (t: TranspiledType) => `#${t.fqn}`);
expect(instanceMethod.render().render()).toMatchSnapshot();
});
});
@@ -28,7 +29,7 @@ describe('python', () => {
describe('typescript', () => {
const transpile = new TypeScriptTranspile();
test('snapshot', () => {
- const instanceMethod = new InstanceMethod(transpile, findInstanceMethod());
+ const instanceMethod = new InstanceMethod(transpile, findInstanceMethod(), (t: TranspiledType) => `#${t.fqn}`);
expect(instanceMethod.render().render()).toMatchSnapshot();
});
});
diff --git a/test/docgen/view/interface.test.ts b/test/docgen/view/interface.test.ts
index 9ecc28b1..b1b36d12 100644
--- a/test/docgen/view/interface.test.ts
+++ b/test/docgen/view/interface.test.ts
@@ -1,5 +1,6 @@
import * as reflect from 'jsii-reflect';
import { PythonTranspile } from '../../../src/docgen/transpile/python';
+import { TranspiledType } from '../../../src/docgen/transpile/transpile';
import { TypeScriptTranspile } from '../../../src/docgen/transpile/typescript';
import { Interface } from '../../../src/docgen/view/interface';
import { Assemblies } from '../assemblies';
@@ -18,7 +19,7 @@ const findInterface = () => {
describe('python', () => {
const transpile = new PythonTranspile();
test('snapshot', () => {
- const klass = new Interface(transpile, findInterface());
+ const klass = new Interface(transpile, findInterface(), (t: TranspiledType) => `#${t.fqn}`);
expect(klass.render().render()).toMatchSnapshot();
});
});
@@ -26,7 +27,7 @@ describe('python', () => {
describe('typescript', () => {
const transpile = new TypeScriptTranspile();
test('snapshot', () => {
- const klass = new Interface(transpile, findInterface());
+ const klass = new Interface(transpile, findInterface(), (t: TranspiledType) => `#${t.fqn}`);
expect(klass.render().render()).toMatchSnapshot();
});
});
diff --git a/test/docgen/view/parameter.test.ts b/test/docgen/view/parameter.test.ts
index f122bf5a..1063e648 100644
--- a/test/docgen/view/parameter.test.ts
+++ b/test/docgen/view/parameter.test.ts
@@ -1,5 +1,6 @@
import * as reflect from 'jsii-reflect';
import { PythonTranspile } from '../../../src/docgen/transpile/python';
+import { TranspiledType } from '../../../src/docgen/transpile/transpile';
import { TypeScriptTranspile } from '../../../src/docgen/transpile/typescript';
import { Parameter } from '../../../src/docgen/view/parameter';
import { Assemblies } from '../assemblies';
@@ -20,7 +21,7 @@ const findParameter = (): reflect.Parameter => {
describe('python', () => {
const transpile = new PythonTranspile();
test('snapshot', () => {
- const parameter = new Parameter(transpile, findParameter());
+ const parameter = new Parameter(transpile, findParameter(), (t: TranspiledType) => `#${t.fqn}`);
expect(parameter.render().render()).toMatchSnapshot();
});
});
@@ -28,7 +29,7 @@ describe('python', () => {
describe('typescript', () => {
const transpile = new TypeScriptTranspile();
test('snapshot', () => {
- const parameter = new Parameter(transpile, findParameter());
+ const parameter = new Parameter(transpile, findParameter(), (t: TranspiledType) => `#${t.fqn}`);
expect(parameter.render().render()).toMatchSnapshot();
});
});
diff --git a/test/docgen/view/property.test.ts b/test/docgen/view/property.test.ts
index ae971298..25e70eaf 100644
--- a/test/docgen/view/property.test.ts
+++ b/test/docgen/view/property.test.ts
@@ -1,5 +1,6 @@
import * as reflect from 'jsii-reflect';
import { PythonTranspile } from '../../../src/docgen/transpile/python';
+import { TranspiledType } from '../../../src/docgen/transpile/transpile';
import { TypeScriptTranspile } from '../../../src/docgen/transpile/typescript';
import { Property } from '../../../src/docgen/view/property';
import { Assemblies } from '../assemblies';
@@ -12,6 +13,7 @@ describe('python', () => {
const parameter = new Property(
transpile,
assembly.system.interfaces[0].allProperties[0],
+ (t: TranspiledType) => `#${t.fqn}`,
);
expect(parameter.render().render()).toMatchSnapshot();
});
@@ -23,6 +25,7 @@ describe('typescript', () => {
const parameter = new Property(
transpile,
assembly.system.interfaces[0].allProperties[0],
+ (t: TranspiledType) => `#${t.fqn}`,
);
expect(parameter.render().render()).toMatchSnapshot();
});
diff --git a/test/docgen/view/static-function.test.ts b/test/docgen/view/static-function.test.ts
index 63481f1a..92202df6 100644
--- a/test/docgen/view/static-function.test.ts
+++ b/test/docgen/view/static-function.test.ts
@@ -1,5 +1,6 @@
import * as reflect from 'jsii-reflect';
import { PythonTranspile } from '../../../src/docgen/transpile/python';
+import { TranspiledType } from '../../../src/docgen/transpile/transpile';
import { TypeScriptTranspile } from '../../../src/docgen/transpile/typescript';
import { StaticFunction } from '../../../src/docgen/view/static-function';
import { Assemblies } from '../assemblies';
@@ -20,7 +21,7 @@ const findStaticFunction = (): reflect.Method => {
describe('python', () => {
const transpile = new PythonTranspile();
test('snapshot', () => {
- const staticFunction = new StaticFunction(transpile, findStaticFunction());
+ const staticFunction = new StaticFunction(transpile, findStaticFunction(), (t: TranspiledType) => `#${t.fqn}`);
expect(staticFunction.render().render()).toMatchSnapshot();
});
});
@@ -28,7 +29,7 @@ describe('python', () => {
describe('typescript', () => {
const transpile = new TypeScriptTranspile();
test('snapshot', () => {
- const staticFunction = new StaticFunction(transpile, findStaticFunction());
+ const staticFunction = new StaticFunction(transpile, findStaticFunction(), (t: TranspiledType) => `#${t.fqn}`);
expect(staticFunction.render().render()).toMatchSnapshot();
});
});
diff --git a/test/docgen/view/struct.test.ts b/test/docgen/view/struct.test.ts
index 8211ea45..7eda8548 100644
--- a/test/docgen/view/struct.test.ts
+++ b/test/docgen/view/struct.test.ts
@@ -1,5 +1,6 @@
import * as reflect from 'jsii-reflect';
import { PythonTranspile } from '../../../src/docgen/transpile/python';
+import { TranspiledType } from '../../../src/docgen/transpile/transpile';
import { TypeScriptTranspile } from '../../../src/docgen/transpile/typescript';
import { Struct } from '../../../src/docgen/view/struct';
import { Assemblies } from '../assemblies';
@@ -12,6 +13,7 @@ describe('python', () => {
const struct = new Struct(
transpile,
assembly.system.interfaces.filter((i) => i.datatype)[0],
+ (t: TranspiledType) => `#${t.fqn}`,
);
expect(struct.render().render()).toMatchSnapshot();
});
@@ -23,6 +25,7 @@ describe('typescript', () => {
const struct = new Struct(
transpile,
assembly.system.interfaces.filter((i) => i.datatype)[0],
+ (t: TranspiledType) => `#${t.fqn}`,
);
expect(struct.render().render()).toMatchSnapshot();
});