runway.cfngin.hooks.docker.data_models module

Hook data models.

These are makeshift data models for use until Runway v2 is released and pydantic can be used.

pydantic model runway.cfngin.hooks.docker.data_models.DockerImage[source]

Bases: BaseModel

Wrapper for docker.models.images.Image.

Show JSON schema
{
   "title": "DockerImage",
   "type": "object",
   "properties": {
      "image": {
         "default": null,
         "title": "Image"
      }
   }
}

property id: str

ID of the image.

field image: Image = PydanticUndefined
model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

property repo: str

Repository URI.

property short_id: str

ID of the image truncated to 10 characters plus the sha256: prefix.

property tags: list[str]

List of image tags.

property uri: MutableMap

Return a mapping of tag to image URI.

pydantic model runway.cfngin.hooks.docker.data_models.ElasticContainerRegistry[source]

Bases: BaseModel

AWS Elastic Container Registry.

Show JSON schema
{
   "title": "ElasticContainerRegistry",
   "description": "AWS Elastic Container Registry.",
   "type": "object",
   "properties": {
      "account_id": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Account Id"
      },
      "alias": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Alias"
      },
      "public": {
         "default": true,
         "title": "Public",
         "type": "boolean"
      },
      "aws_region": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Aws Region"
      }
   }
}

PUBLIC_URI_TEMPLATE: ClassVar[str] = 'public.ecr.aws/{registry_alias}/'
URI_TEMPLATE: ClassVar[str] = '{aws_account_id}.dkr.ecr.{aws_region}.amazonaws.com/'
field account_id: str | None = None

AWS account ID that owns the registry being logged into.

field alias: str | None = None

If it is a public repository, the alias of the repository.

property fqn: str

Fully qualified ECR name.

field public: bool = True

Whether the repository is public.

field region: str | None = None (alias 'aws_region')

AWS region where the registry is located.

pydantic model runway.cfngin.hooks.docker.data_models.ElasticContainerRegistryRepository[source]

Bases: BaseModel

AWS Elastic Container Registry (ECR) Repository.

Show JSON schema
{
   "title": "ElasticContainerRegistryRepository",
   "description": "AWS Elastic Container Registry (ECR) Repository.",
   "type": "object",
   "properties": {
      "repo_name": {
         "title": "Repo Name",
         "type": "string"
      },
      "registry": {
         "$ref": "#/$defs/ElasticContainerRegistry"
      }
   },
   "$defs": {
      "ElasticContainerRegistry": {
         "description": "AWS Elastic Container Registry.",
         "properties": {
            "account_id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Account Id"
            },
            "alias": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Alias"
            },
            "public": {
               "default": true,
               "title": "Public",
               "type": "boolean"
            },
            "aws_region": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Aws Region"
            }
         },
         "title": "ElasticContainerRegistry",
         "type": "object"
      }
   },
   "required": [
      "repo_name",
      "registry"
   ]
}

property fqn: str

Fully qualified ECR repo name.

field name: Annotated[str, Field(alias='repo_name')] = PydanticUndefined (alias 'repo_name')

The name of the repository.

field registry: ElasticContainerRegistry = PydanticUndefined

Information about an ECR registry.