ECR (ecr)

Primary Models

Primary models are models that you can act on directly. They are the models that represent resources in the AWS service, and are acted on by the managers.

pydantic model botocraft.services.ecr.ECRImage[source]

Bases: ECRImageMixin, ReadonlyPrimaryBoto3Model

An object representing an Amazon ECR image.

Show JSON schema
{
   "title": "ECRImage",
   "description": "An object representing an Amazon ECR image.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "repositoryName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Repositoryname"
      },
      "imageId": {
         "$ref": "#/$defs/ImageIdentifier",
         "default": null
      },
      "registryId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Registryid"
      },
      "imageManifest": {
         "default": null,
         "title": "Imagemanifest",
         "type": "string"
      },
      "imageManifestMediaType": {
         "default": null,
         "title": "Imagemanifestmediatype",
         "type": "string"
      }
   },
   "$defs": {
      "ImageIdentifier": {
         "description": "An object with identifying information for an image in an Amazon ECR repository.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "imageDigest": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imagedigest"
            },
            "imageTag": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imagetag"
            }
         },
         "title": "ImageIdentifier",
         "type": "object"
      }
   },
   "additionalProperties": true
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

  • frozen: bool = True

  • extra: str = allow

Fields:
field imageId: ImageIdentifier = None

An object containing the image tag and image digest associated with an image.

field imageManifest: str = None

The image manifest associated with the image.

field imageManifestMediaType: str = None

The manifest media type of the image.

field registryId: str | None = None

The Amazon Web Services account ID associated with the registry containing the image.

field repositoryName: str | None = None

The name of the repository associated with the image.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

manager_class

alias of ECRImageManager

clean() None

Remove the image from our local docker storage, if it exists.

Raises:

RuntimeError – If the docker daemon is not running.

clean_other_versions() None

Remove the all images for this repository except for the one with our version.

Raises:

RuntimeError – If the docker daemon is not running.

delete()

Delete the model.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

replication_status() DescribeImageReplicationStatusResponse[source]

Return the replication status for the image.

save(**kwargs)

Save the model.

scan_findings() list[botocraft.services.ecr.DescribeImageScanFindingsResponse][source]

Return the scan results for the image.

services(status: Literal['ACTIVE', 'INACTIVE', 'ALL'] | None = 'ACTIVE', tags: dict[str, str] | None = None, verbose: bool = False) PrimaryBoto3ModelQuerySet

Return a list of ECS Services that use this image.

Warning

This will be quite slow if you have a lot of families and revisions, because the only way to deal with this is to get all the task definition families, and then look at each revision to see if one of its containers uses this image. Then look through all our services to see if there is a service that uses that task definition.

Parameters:
  • status – The status of the task definition to filter by. Valid values are ACTIVE, INACTIVE, or ALL. The default is ACTIVE.

  • tags – A dictionary of tags to filter task definitions and services by. The default is an empty dictionary.

  • verbose – If True, print out status messages as we work.

Returns:

A list of ECS Services that use this image.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

task_definitions(status: Literal['ACTIVE', 'INACTIVE', 'ALL'] | None = 'ACTIVE', tags: dict[str, str] | None = None, verbose: bool = False) PrimaryBoto3ModelQuerySet

Return a list of ECS task definitions that use this image.

Warning

This will be quite slow if you have a lot of families and revisions, because the only way to deal with this is to get all the task definition families, and then look at each revision to see if one of its containers uses this image. There is no way to filter the task definitions by image.

Parameters:
  • status – The status of the task definition to filter by. Valid values are ACTIVE, INACTIVE, or ALL. The default is ACTIVE.

  • tags – A dictionary of tags to filter by. The default is an empty dictionary.

  • verbose – If True, print out the task definition family and revision that uses this image. The default is False.

Returns:

A list of ECS task definitions that use this image.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

property arn: str | None

Get the ARN of the model instance.

Returns:

The ARN of the model instance.

Raises:

ValueError – If the model has no ARN identity field.

property docker_client: ECRDockerClient

Return a docker client, logged into our ECR registry.

Raises:

RuntimeError – If the docker daemon is not running.

Returns:

A botocraft.mixins.ecr.ECRDockerClient object, which has a docker client, username, password, and registry.

property docker_image: Image

Return the docker.models.images.Image object for this image.

Raises:

RuntimeError – If the docker daemon is not running.

property dockerd_is_running: bool

Check if the docker daemon is running.

We need dockerd to be running to perform these operations:

property history: list[dict[str, Any]]

Return the build history for this image. You can use this to reconstruct most of the Dockerfile that was used to build the image. You won’t have the FROM line, but you can get most of the rest of it.

Raises:

RuntimeError – If the docker daemon is not running.

property image_name: str

Return just the image name, excluding the registry.

property info: ImageInfo

Return information about the image. We’re doing this by pulling the image from the repository and inspecting it.

Note

I’d love to get the base image for this image, but there is no direct way to do it. You would to look up the layers for the image, get the sha256 hash of the first layer (which is the base image), then look in in various repositories to find the image that has the same layer, then get that image’s name. That seems stupid hard to do, especially if the base image is in the ECR registry of another AWS account.

Raises:

RuntimeError – If the docker daemon is not running.

Returns:

A botocraft.services.ecr.ImageInfo object.

property is_pulled: bool

Check if the image is pulled.

Returns:

True if the image is pulled, False otherwise.

property name: str

Get the name of the image.

objects: ClassVar['ECRImageManager']

Get the manager for this model, and set it as a class property

property pk: OrderedDict[str, Any]

Get the primary key of the model instance.

Returns:

The primary key of the model instance.

property repository: Repository | None

Return the Repository object that this image belongs to.

Note

The output of this property is cached on the model instance, so calling this multiple times will not result in multiple calls to the AWS API. If you need a fresh copy of the data, you can re-get the model instance from the manager.

property version: str

Get the version of the image.

property vulnerabilities: PrimaryBoto3ModelQuerySet

Return a list of vulnerabilities for this image. This is done by using the AWS Inspector2 service to scan the image and return the vulnerabilities.

Note

The AWS Inspector service is not instantaneous, but runs occasionally. This doesn’t matter much for us, because we are using the ECR immutable images, so we can just get the vulnerabilities for the image we are using.

Warning

If this image was just pushed, then the scan may not have run yet. In that case, you will need to wait for the scan to run before you can get the vulnerabilities.

Returns:

A list of vulnerabilities for this image.

pydantic model botocraft.services.ecr.Repository[source]

Bases: TagsDictMixin, RepositoryMixin, PrimaryBoto3Model

An object representing a repository.

Show JSON schema
{
   "title": "Repository",
   "description": "An object representing a repository.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "repositoryName": {
         "title": "Repositoryname",
         "type": "string"
      },
      "imageTagMutability": {
         "enum": [
            "MUTABLE",
            "IMMUTABLE",
            "IMMUTABLE_WITH_EXCLUSION",
            "MUTABLE_WITH_EXCLUSION"
         ],
         "title": "Imagetagmutability",
         "type": "string"
      },
      "imageScanningConfiguration": {
         "$ref": "#/$defs/ImageScanningConfiguration"
      },
      "repositoryArn": {
         "default": null,
         "title": "Repositoryarn",
         "type": "string"
      },
      "registryId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Registryid"
      },
      "repositoryUri": {
         "default": null,
         "title": "Repositoryuri",
         "type": "string"
      },
      "createdAt": {
         "default": null,
         "format": "date-time",
         "title": "Createdat",
         "type": "string"
      },
      "imageTagMutabilityExclusionFilters": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ImageTagMutabilityExclusionFilter"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Imagetagmutabilityexclusionfilters"
      },
      "encryptionConfiguration": {
         "anyOf": [
            {
               "$ref": "#/$defs/EncryptionConfiguration"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "Tags": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Tag"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Tags"
      }
   },
   "$defs": {
      "EncryptionConfiguration": {
         "description": "The encryption configuration for the repository. This determines how the contents of\nyour repository are encrypted at rest.\n\nBy default, when no encryption configuration is set or the ``AES256`` encryption type is used, Amazon ECR uses server-\nside encryption with Amazon S3-managed encryption keys which encrypts your data at rest using an AES256 encryption\nalgorithm. This does not require any action on your part.\n\nFor more control over the encryption of the contents of your repository, you can use server-side encryption with Key\nManagement Service key stored in Key Management Service (KMS) to encrypt your images. For more information, see `Amazon\nECR encryption at rest <https://docs.aws.amazon.com/AmazonECR/latest/userguide/encryption-at-rest.html>`_ in the *Amazon\nElastic Container Registry User Guide*.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "encryptionType": {
               "enum": [
                  "AES256",
                  "KMS",
                  "KMS_DSSE"
               ],
               "title": "Encryptiontype",
               "type": "string"
            },
            "kmsKey": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Kmskey"
            }
         },
         "required": [
            "encryptionType"
         ],
         "title": "EncryptionConfiguration",
         "type": "object"
      },
      "ImageScanningConfiguration": {
         "description": "The image scanning configuration for a repository.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "scanOnPush": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Scanonpush"
            }
         },
         "title": "ImageScanningConfiguration",
         "type": "object"
      },
      "ImageTagMutabilityExclusionFilter": {
         "description": "A filter that specifies which image tags should be excluded from the repository's\nimage tag mutability setting.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "filterType": {
               "const": "WILDCARD",
               "title": "Filtertype",
               "type": "string"
            },
            "filter": {
               "title": "Filter",
               "type": "string"
            }
         },
         "required": [
            "filterType",
            "filter"
         ],
         "title": "ImageTagMutabilityExclusionFilter",
         "type": "object"
      },
      "Tag": {
         "description": "The metadata that you apply to a resource to help you categorize and\norganize them. Each tag consists of a key and an optional value. You define\nthem.\n\nThe following basic restrictions apply to tags:\n\n* Maximum number of tags per resource - 50\n* For each resource, each tag key must be unique, and each tag key can have\n  only one value.\n* Maximum key length - 128 Unicode characters in UTF-8\n* Maximum value length - 256 Unicode characters in UTF-8\n* If your tagging schema is used across multiple services and resources,\n  remember that other services may have restrictions on allowed characters.\n  Generally allowed characters are: letters, numbers, and spaces representable in\n  UTF-8, and the following characters: + - = . _ : / @.\n* Tag keys and values are case-sensitive.\n* Do not use ``aws:``, ``AWS:``, or any upper or lowercase combination of such\n  as a prefix for either keys or values as it is reserved for Amazon Web Services\n  use. You cannot edit or delete tag keys or values with this prefix. Tags with\n  this prefix do not count against your tags per resource limit.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "Key": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Key"
            },
            "Value": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Value"
            }
         },
         "title": "Tag",
         "type": "object"
      }
   },
   "required": [
      "repositoryName",
      "imageTagMutability",
      "imageScanningConfiguration"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field Tags: builtins.list[Tag] | None [Optional]

The AWS tags associated with the repository.

field createdAt: datetime = None

The date and time, in JavaScript date format, when the repository was created.

field encryptionConfiguration: EncryptionConfiguration | None = None

The encryption configuration for the repository.

This determines how the contents of your repository are encrypted at rest.

field imageScanningConfiguration: ImageScanningConfiguration [Required]

The image scanning configuration for a repository.

field imageTagMutability: Literal['MUTABLE', 'IMMUTABLE', 'IMMUTABLE_WITH_EXCLUSION', 'MUTABLE_WITH_EXCLUSION'] [Required]

The tag mutability setting for the repository.

field imageTagMutabilityExclusionFilters: builtins.list[ImageTagMutabilityExclusionFilter] | None [Optional]

A list of filters that specify which image tags are excluded from the repository’s image tag mutability setting.

field registryId: str | None = None

The Amazon Web Services account ID associated with the registry that contains the repository.

field repositoryArn: str = None

The Amazon Resource Name (ARN) that identifies the repository.

The ARN contains the arn:aws:ecr namespace, followed by the region of the repository, Amazon Web Services account ID of the repository owner, repository namespace, and repository name. For example, arn:aws:ecr:region:012345678910:repository-namespace/repository-name.

field repositoryName: str [Required]

The name of the repository.

field repositoryUri: str = None

The URI for the repository.

You can use this URI for container image push and pull operations.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

manager_class

alias of RepositoryManager

tag_class

alias of Tag

delete()

Delete the model.

get_image(imageId: ImageIdentifier) ECRImage | None

Get an image object for a given repository and image identifier.

Parameters:

imageId – The image ID or tag to describe. The format of the imageId reference is imageTag=tag or imageDigest=digest

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

save(**kwargs)

Save the model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

property arn: str | None

Return the ARN of the model. This is the value of the repositoryArn attribute.

Returns:

The ARN of the model instance.

property images: PrimaryBoto3ModelQuerySet

Get a list of images for a given repository.

property name: str | None

Return the name of the model. This is the value of the repositoryName attribute.

Returns:

The name of the model instance.

objects: ClassVar['RepositoryManager']

Get the manager for this model, and set it as a class property

property pk: str | None

Return the primary key of the model. This is the value of the repositoryName attribute.

Returns:

The primary key of the model instance.

property tags: TagsDict

Get the tags for the model instance.

Returns:

The tags for the model instance.

Managers

Managers work with the primary models to provide a high-level interface to the AWS service. They are responsible for creating, updating, and deleting the resources in the service, as well as any additional operations that are available for those models.

class botocraft.services.ecr.ECRImageManager[source]

Bases: ECRImageManagerMixin, Boto3ModelManager

delete(repositoryName: str, imageId: ImageIdentifier) BatchDeleteImageResponse[source]

Deletes a list of specified images within a repository. Images are specified with either an imageTag or imageDigest.

Parameters:
  • repositoryName – The repository that contains the image to delete.

  • imageId – The image ID or tag to delete. The format of the imageId reference is ``imageTag=tag`` or ``imageDigest=digest``

get(repositoryName: str, imageId: ImageIdentifier, *, acceptedMediaTypes: list[str] = ['application/vnd.docker.distribution.manifest.v2+json']) ECRImage | None[source]

Gets detailed information for an image. Images are specified with either an imageTag or imageDigest.

Parameters:
  • repositoryName – The repository that contains the images to describe.

  • imageId – The image ID or tag to describe. The format of the imageId reference is ``imageTag=tag`` or ``imageDigest=digest``

Keyword Arguments:

acceptedMediaTypes – The accepted media types for the request.

get_many(repositoryName: str, imageIds: list[botocraft.services.ecr.ImageIdentifier], *, acceptedMediaTypes: list[str] = ['application/vnd.docker.distribution.manifest.v2+json']) BatchGetImageResponse[source]

Gets detailed information for an image. Images are specified with either an imageTag or imageDigest.

Parameters:
  • repositoryName – The repository that contains the images to describe.

  • imageIds – A list of image ID references that correspond to images to describe. The format of the imageIds reference is imageTag=tag or imageDigest=digest.

Keyword Arguments:

acceptedMediaTypes – The accepted media types for the request.

list(repositoryName: str, *, filter: ListImagesFilter | None = None) PrimaryBoto3ModelQuerySet[source]

Lists all the image IDs for the specified repository.

Parameters:

repositoryName – The repository with image IDs to be listed.

Keyword Arguments:

filter – The filter key and value with which to filter your ListImages results.

replication_status(repositoryName: str, imageId: ImageIdentifier) DescribeImageReplicationStatusResponse[source]

Returns the replication status for a specified image.

Parameters:
  • repositoryName – The name of the repository that the image is in.

  • imageId – An object with identifying information for an image in an Amazon ECR repository.

scan_findings(repositoryName: str, imageId: ImageIdentifier, *, nextToken: str | None = None, maxResults: int | None = None) list[botocraft.services.ecr.DescribeImageScanFindingsResponse][source]

Returns the scan findings for the specified image.

Parameters:
  • repositoryName – The repository for the image for which to describe the scan findings.

  • imageId – An object with identifying information for an image in an Amazon ECR repository.

Keyword Arguments:
  • nextToken – The nextToken value returned from a previous paginated DescribeImageScanFindings request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.

  • maxResults – The maximum number of image scan results returned by DescribeImageScanFindings in paginated output. When this parameter is used, DescribeImageScanFindings only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeImageScanFindings request with the returned nextToken value. This value can be between 1 and 1000. If this parameter is not used, then DescribeImageScanFindings returns up to 100 results and a nextToken value, if applicable.

service_name: str = 'ecr'

ec2, s3, etc.

Type:

The name of the boto3 service. Example

class botocraft.services.ecr.RepositoryManager[source]

Bases: Boto3ModelManager

create(model: Repository) Repository[source]

Create an ECR repository.

Parameters:

model – The Repository to create.

delete(repositoryName: str, *, registryId: str | None = None, force: bool | None = None) Repository[source]

Delete an ECR repository.

Parameters:

repositoryName – The name of the repository to delete.

Keyword Arguments:
  • registryId – The Amazon Web Services account ID associated with the registry that contains the repository to delete. If you do not specify a registry, the default registry is assumed.

  • force – If true, deleting the repository force deletes the contents of the repository. If false, the repository must be empty before attempting to delete it.

get(repositoryName: str, *, registryId: str | None = None, include: list[Literal['TAGS']] | None = None) Repository | None[source]

Describes image repositories in a registry.

Parameters:

repositoryName – The name of the ECR repository to describe.

Keyword Arguments:
  • registryId – The Amazon Web Services account ID associated with the registry that contains the repositories to be described. If you do not specify a registry, the default registry is assumed.

  • include – Extra things to include in the response. Tags are expensive to retrieve because they need a second, slow API call, so you have to request them specifically. This is used only by the ``@repo_get_add_tags`` decorator, which is why you don’t see it in the function body.

get_image(repositoryName: str, imageId: ImageIdentifier, *, acceptedMediaTypes: list[str] = ['application/vnd.docker.distribution.manifest.v2+json']) ECRImage[source]

Gets detailed information for an image. Images are specified with either an imageTag or imageDigest.

Parameters:
  • repositoryName – The repository that contains the images to describe.

  • imageId – The image ID or tag to describe. The format of the imageId reference is ``imageTag=tag`` or ``imageDigest=digest``

Keyword Arguments:

acceptedMediaTypes – The accepted media types for the request.

get_images(repositoryName: str, imageIds: list[botocraft.services.ecr.ImageIdentifier], *, acceptedMediaTypes: list[str] = ['application/vnd.docker.distribution.manifest.v2+json']) list[botocraft.services.ecr.ECRImage] | None[source]

Use this method when you want to get just a few images from the repository. If you want to get all images, use the ``list_images`` method.

Parameters:
  • repositoryName – The repository that contains the images to describe.

  • imageIds – A list of image ID references that correspond to images to describe. The format of the imageIds reference is imageTag=tag or imageDigest=digest.

Keyword Arguments:

acceptedMediaTypes – The accepted media types for the request.

get_tags(resourceArn: str) list[botocraft.services.common.Tag][source]

List the tags for an Amazon ECR resource.

Parameters:

resourceArn – The Amazon Resource Name (ARN) that identifies the resource for which to list the tags. Currently, the only supported resource is an Amazon ECR repository.

list(*, registryId: str | None = None, repositoryNames: list[str] | None = None, include: list[Literal['TAGS']] | None = None) PrimaryBoto3ModelQuerySet[source]

Describes image repositories in a registry.

Keyword Arguments:
  • registryId – The Amazon Web Services account ID associated with the registry that contains the repositories to be described. If you do not specify a registry, the default registry is assumed.

  • repositoryNames – A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.

  • include – Extra things to include in the response. Tags are expensive to retrieve because they need a second, slow API call, so you have to request them specifically.

list_images(repositoryName: str, *, registryId: str | None = None, filter: ListImagesFilter | None = None) list[botocraft.services.ecr.ImageIdentifier][source]

Lists all the image IDs for the specified repository.

Parameters:

repositoryName – The repository with image IDs to be listed.

Keyword Arguments:
  • registryId – The Amazon Web Services account ID associated with the registry that contains the repository in which to list images. If you do not specify a registry, the default registry is assumed.

  • filter – The filter key and value with which to filter your ListImages results.

service_name: str = 'ecr'

ec2, s3, etc.

Type:

The name of the boto3 service. Example

Secondary Models

Secondary models are models that are used by the primary models to organize their data. They are not acted on directly, but are used to describe the structure of the fields in the primary models or other secondary models.

pydantic model botocraft.services.ecr.EncryptionConfiguration[source]

Bases: Boto3Model

The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.

By default, when no encryption configuration is set or the AES256 encryption type is used, Amazon ECR uses server- side encryption with Amazon S3-managed encryption keys which encrypts your data at rest using an AES256 encryption algorithm. This does not require any action on your part.

For more control over the encryption of the contents of your repository, you can use server-side encryption with Key Management Service key stored in Key Management Service (KMS) to encrypt your images. For more information, see Amazon ECR encryption at rest in the Amazon Elastic Container Registry User Guide.

Show JSON schema
{
   "title": "EncryptionConfiguration",
   "description": "The encryption configuration for the repository. This determines how the contents of\nyour repository are encrypted at rest.\n\nBy default, when no encryption configuration is set or the ``AES256`` encryption type is used, Amazon ECR uses server-\nside encryption with Amazon S3-managed encryption keys which encrypts your data at rest using an AES256 encryption\nalgorithm. This does not require any action on your part.\n\nFor more control over the encryption of the contents of your repository, you can use server-side encryption with Key\nManagement Service key stored in Key Management Service (KMS) to encrypt your images. For more information, see `Amazon\nECR encryption at rest <https://docs.aws.amazon.com/AmazonECR/latest/userguide/encryption-at-rest.html>`_ in the *Amazon\nElastic Container Registry User Guide*.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "encryptionType": {
         "enum": [
            "AES256",
            "KMS",
            "KMS_DSSE"
         ],
         "title": "Encryptiontype",
         "type": "string"
      },
      "kmsKey": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Kmskey"
      }
   },
   "required": [
      "encryptionType"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field encryptionType: Literal['AES256', 'KMS', 'KMS_DSSE'] [Required]

The encryption type to use.

field kmsKey: str | None = None

If you use the KMS encryption type, specify the KMS key to use for encryption.

The alias, key ID, or full ARN of the KMS key can be specified. The key must exist in the same Region as the repository. If no key is specified, the default Amazon Web Services managed KMS key for Amazon ECR will be used.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.ImageIdentifier[source]

Bases: Boto3Model

An object with identifying information for an image in an Amazon ECR repository.

Show JSON schema
{
   "title": "ImageIdentifier",
   "description": "An object with identifying information for an image in an Amazon ECR repository.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "imageDigest": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Imagedigest"
      },
      "imageTag": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Imagetag"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field imageDigest: str | None = None

The sha256 digest of the image manifest.

field imageTag: str | None = None

The tag used for the image.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.ImageScanningConfiguration[source]

Bases: Boto3Model

The image scanning configuration for a repository.

Show JSON schema
{
   "title": "ImageScanningConfiguration",
   "description": "The image scanning configuration for a repository.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "scanOnPush": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Scanonpush"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field scanOnPush: bool | None = None

The setting that determines whether images are scanned after being pushed to a repository.

If set to true, images will be scanned after being pushed. If this parameter is not specified, it will default to false and images will not be scanned unless a scan is manually started with the API_StartImageScan API.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.ImageTagMutabilityExclusionFilter[source]

Bases: Boto3Model

A filter that specifies which image tags should be excluded from the repository’s image tag mutability setting.

Show JSON schema
{
   "title": "ImageTagMutabilityExclusionFilter",
   "description": "A filter that specifies which image tags should be excluded from the repository's\nimage tag mutability setting.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "filterType": {
         "const": "WILDCARD",
         "title": "Filtertype",
         "type": "string"
      },
      "filter": {
         "title": "Filter",
         "type": "string"
      }
   },
   "required": [
      "filterType",
      "filter"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field filter: str [Required]

The filter value used to match image tags for exclusion from mutability settings.

field filterType: Literal['WILDCARD'] [Required]

The type of filter to apply for excluding image tags from mutability settings.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

Request/Response Models

Request/response models are models that are used to describe the structure of the data that is sent to and received from the AWS service. They are used by the managers to send requests to the service and to parse the responses that are received.

You will not often use them directly – typically they are used by the managers internally to send requests and parse responses – but they are included here for completeness, and because occasionally we return them directly to you because they have some useful additional information.

pydantic model botocraft.services.ecr.BatchDeleteImageResponse[source]

Bases: Boto3Model

Show JSON schema
{
   "title": "BatchDeleteImageResponse",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "imageIds": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ImageIdentifier"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Imageids"
      },
      "failures": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ImageFailure"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Failures"
      }
   },
   "$defs": {
      "ImageFailure": {
         "description": "An object representing an Amazon ECR image failure.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "imageId": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ImageIdentifier"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "failureCode": {
               "anyOf": [
                  {
                     "enum": [
                        "InvalidImageDigest",
                        "InvalidImageTag",
                        "ImageTagDoesNotMatchDigest",
                        "ImageNotFound",
                        "MissingDigestAndTag",
                        "ImageReferencedByManifestList",
                        "KmsError",
                        "UpstreamAccessDenied",
                        "UpstreamTooManyRequests",
                        "UpstreamUnavailable",
                        "ImageInaccessible"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Failurecode"
            },
            "failureReason": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Failurereason"
            }
         },
         "title": "ImageFailure",
         "type": "object"
      },
      "ImageIdentifier": {
         "description": "An object with identifying information for an image in an Amazon ECR repository.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "imageDigest": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imagedigest"
            },
            "imageTag": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imagetag"
            }
         },
         "title": "ImageIdentifier",
         "type": "object"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field failures: builtins.list[ImageFailure] | None [Optional]

Any failures associated with the call.

field imageIds: builtins.list[ImageIdentifier] | None [Optional]

The image IDs of the deleted images.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.BatchGetImageResponse[source]

Bases: Boto3Model

Show JSON schema
{
   "title": "BatchGetImageResponse",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "images": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ECRImage"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Images"
      },
      "failures": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ImageFailure"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Failures"
      }
   },
   "$defs": {
      "ECRImage": {
         "additionalProperties": true,
         "description": "An object representing an Amazon ECR image.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "repositoryName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Repositoryname"
            },
            "imageId": {
               "$ref": "#/$defs/ImageIdentifier",
               "default": null
            },
            "registryId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Registryid"
            },
            "imageManifest": {
               "default": null,
               "title": "Imagemanifest",
               "type": "string"
            },
            "imageManifestMediaType": {
               "default": null,
               "title": "Imagemanifestmediatype",
               "type": "string"
            }
         },
         "title": "ECRImage",
         "type": "object"
      },
      "ImageFailure": {
         "description": "An object representing an Amazon ECR image failure.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "imageId": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ImageIdentifier"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "failureCode": {
               "anyOf": [
                  {
                     "enum": [
                        "InvalidImageDigest",
                        "InvalidImageTag",
                        "ImageTagDoesNotMatchDigest",
                        "ImageNotFound",
                        "MissingDigestAndTag",
                        "ImageReferencedByManifestList",
                        "KmsError",
                        "UpstreamAccessDenied",
                        "UpstreamTooManyRequests",
                        "UpstreamUnavailable",
                        "ImageInaccessible"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Failurecode"
            },
            "failureReason": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Failurereason"
            }
         },
         "title": "ImageFailure",
         "type": "object"
      },
      "ImageIdentifier": {
         "description": "An object with identifying information for an image in an Amazon ECR repository.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "imageDigest": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imagedigest"
            },
            "imageTag": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imagetag"
            }
         },
         "title": "ImageIdentifier",
         "type": "object"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field failures: builtins.list[ImageFailure] | None [Optional]

Any failures associated with the call.

field images: builtins.list[ECRImage] | None [Optional]

A list of image objects corresponding to the image references in the request.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.CreateRepositoryResponse[source]

Bases: Boto3Model

Show JSON schema
{
   "title": "CreateRepositoryResponse",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "repository": {
         "anyOf": [
            {
               "$ref": "#/$defs/Repository"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      }
   },
   "$defs": {
      "EncryptionConfiguration": {
         "description": "The encryption configuration for the repository. This determines how the contents of\nyour repository are encrypted at rest.\n\nBy default, when no encryption configuration is set or the ``AES256`` encryption type is used, Amazon ECR uses server-\nside encryption with Amazon S3-managed encryption keys which encrypts your data at rest using an AES256 encryption\nalgorithm. This does not require any action on your part.\n\nFor more control over the encryption of the contents of your repository, you can use server-side encryption with Key\nManagement Service key stored in Key Management Service (KMS) to encrypt your images. For more information, see `Amazon\nECR encryption at rest <https://docs.aws.amazon.com/AmazonECR/latest/userguide/encryption-at-rest.html>`_ in the *Amazon\nElastic Container Registry User Guide*.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "encryptionType": {
               "enum": [
                  "AES256",
                  "KMS",
                  "KMS_DSSE"
               ],
               "title": "Encryptiontype",
               "type": "string"
            },
            "kmsKey": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Kmskey"
            }
         },
         "required": [
            "encryptionType"
         ],
         "title": "EncryptionConfiguration",
         "type": "object"
      },
      "ImageScanningConfiguration": {
         "description": "The image scanning configuration for a repository.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "scanOnPush": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Scanonpush"
            }
         },
         "title": "ImageScanningConfiguration",
         "type": "object"
      },
      "ImageTagMutabilityExclusionFilter": {
         "description": "A filter that specifies which image tags should be excluded from the repository's\nimage tag mutability setting.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "filterType": {
               "const": "WILDCARD",
               "title": "Filtertype",
               "type": "string"
            },
            "filter": {
               "title": "Filter",
               "type": "string"
            }
         },
         "required": [
            "filterType",
            "filter"
         ],
         "title": "ImageTagMutabilityExclusionFilter",
         "type": "object"
      },
      "Repository": {
         "description": "An object representing a repository.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "repositoryName": {
               "title": "Repositoryname",
               "type": "string"
            },
            "imageTagMutability": {
               "enum": [
                  "MUTABLE",
                  "IMMUTABLE",
                  "IMMUTABLE_WITH_EXCLUSION",
                  "MUTABLE_WITH_EXCLUSION"
               ],
               "title": "Imagetagmutability",
               "type": "string"
            },
            "imageScanningConfiguration": {
               "$ref": "#/$defs/ImageScanningConfiguration"
            },
            "repositoryArn": {
               "default": null,
               "title": "Repositoryarn",
               "type": "string"
            },
            "registryId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Registryid"
            },
            "repositoryUri": {
               "default": null,
               "title": "Repositoryuri",
               "type": "string"
            },
            "createdAt": {
               "default": null,
               "format": "date-time",
               "title": "Createdat",
               "type": "string"
            },
            "imageTagMutabilityExclusionFilters": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ImageTagMutabilityExclusionFilter"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Imagetagmutabilityexclusionfilters"
            },
            "encryptionConfiguration": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EncryptionConfiguration"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "Tags": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Tag"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Tags"
            }
         },
         "required": [
            "repositoryName",
            "imageTagMutability",
            "imageScanningConfiguration"
         ],
         "title": "Repository",
         "type": "object"
      },
      "Tag": {
         "description": "The metadata that you apply to a resource to help you categorize and\norganize them. Each tag consists of a key and an optional value. You define\nthem.\n\nThe following basic restrictions apply to tags:\n\n* Maximum number of tags per resource - 50\n* For each resource, each tag key must be unique, and each tag key can have\n  only one value.\n* Maximum key length - 128 Unicode characters in UTF-8\n* Maximum value length - 256 Unicode characters in UTF-8\n* If your tagging schema is used across multiple services and resources,\n  remember that other services may have restrictions on allowed characters.\n  Generally allowed characters are: letters, numbers, and spaces representable in\n  UTF-8, and the following characters: + - = . _ : / @.\n* Tag keys and values are case-sensitive.\n* Do not use ``aws:``, ``AWS:``, or any upper or lowercase combination of such\n  as a prefix for either keys or values as it is reserved for Amazon Web Services\n  use. You cannot edit or delete tag keys or values with this prefix. Tags with\n  this prefix do not count against your tags per resource limit.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "Key": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Key"
            },
            "Value": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Value"
            }
         },
         "title": "Tag",
         "type": "object"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field repository: Repository | None = None

The repository that was created.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.DeleteRepositoryResponse[source]

Bases: Boto3Model

Show JSON schema
{
   "title": "DeleteRepositoryResponse",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "repository": {
         "anyOf": [
            {
               "$ref": "#/$defs/Repository"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      }
   },
   "$defs": {
      "EncryptionConfiguration": {
         "description": "The encryption configuration for the repository. This determines how the contents of\nyour repository are encrypted at rest.\n\nBy default, when no encryption configuration is set or the ``AES256`` encryption type is used, Amazon ECR uses server-\nside encryption with Amazon S3-managed encryption keys which encrypts your data at rest using an AES256 encryption\nalgorithm. This does not require any action on your part.\n\nFor more control over the encryption of the contents of your repository, you can use server-side encryption with Key\nManagement Service key stored in Key Management Service (KMS) to encrypt your images. For more information, see `Amazon\nECR encryption at rest <https://docs.aws.amazon.com/AmazonECR/latest/userguide/encryption-at-rest.html>`_ in the *Amazon\nElastic Container Registry User Guide*.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "encryptionType": {
               "enum": [
                  "AES256",
                  "KMS",
                  "KMS_DSSE"
               ],
               "title": "Encryptiontype",
               "type": "string"
            },
            "kmsKey": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Kmskey"
            }
         },
         "required": [
            "encryptionType"
         ],
         "title": "EncryptionConfiguration",
         "type": "object"
      },
      "ImageScanningConfiguration": {
         "description": "The image scanning configuration for a repository.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "scanOnPush": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Scanonpush"
            }
         },
         "title": "ImageScanningConfiguration",
         "type": "object"
      },
      "ImageTagMutabilityExclusionFilter": {
         "description": "A filter that specifies which image tags should be excluded from the repository's\nimage tag mutability setting.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "filterType": {
               "const": "WILDCARD",
               "title": "Filtertype",
               "type": "string"
            },
            "filter": {
               "title": "Filter",
               "type": "string"
            }
         },
         "required": [
            "filterType",
            "filter"
         ],
         "title": "ImageTagMutabilityExclusionFilter",
         "type": "object"
      },
      "Repository": {
         "description": "An object representing a repository.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "repositoryName": {
               "title": "Repositoryname",
               "type": "string"
            },
            "imageTagMutability": {
               "enum": [
                  "MUTABLE",
                  "IMMUTABLE",
                  "IMMUTABLE_WITH_EXCLUSION",
                  "MUTABLE_WITH_EXCLUSION"
               ],
               "title": "Imagetagmutability",
               "type": "string"
            },
            "imageScanningConfiguration": {
               "$ref": "#/$defs/ImageScanningConfiguration"
            },
            "repositoryArn": {
               "default": null,
               "title": "Repositoryarn",
               "type": "string"
            },
            "registryId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Registryid"
            },
            "repositoryUri": {
               "default": null,
               "title": "Repositoryuri",
               "type": "string"
            },
            "createdAt": {
               "default": null,
               "format": "date-time",
               "title": "Createdat",
               "type": "string"
            },
            "imageTagMutabilityExclusionFilters": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ImageTagMutabilityExclusionFilter"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Imagetagmutabilityexclusionfilters"
            },
            "encryptionConfiguration": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EncryptionConfiguration"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "Tags": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Tag"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Tags"
            }
         },
         "required": [
            "repositoryName",
            "imageTagMutability",
            "imageScanningConfiguration"
         ],
         "title": "Repository",
         "type": "object"
      },
      "Tag": {
         "description": "The metadata that you apply to a resource to help you categorize and\norganize them. Each tag consists of a key and an optional value. You define\nthem.\n\nThe following basic restrictions apply to tags:\n\n* Maximum number of tags per resource - 50\n* For each resource, each tag key must be unique, and each tag key can have\n  only one value.\n* Maximum key length - 128 Unicode characters in UTF-8\n* Maximum value length - 256 Unicode characters in UTF-8\n* If your tagging schema is used across multiple services and resources,\n  remember that other services may have restrictions on allowed characters.\n  Generally allowed characters are: letters, numbers, and spaces representable in\n  UTF-8, and the following characters: + - = . _ : / @.\n* Tag keys and values are case-sensitive.\n* Do not use ``aws:``, ``AWS:``, or any upper or lowercase combination of such\n  as a prefix for either keys or values as it is reserved for Amazon Web Services\n  use. You cannot edit or delete tag keys or values with this prefix. Tags with\n  this prefix do not count against your tags per resource limit.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "Key": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Key"
            },
            "Value": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Value"
            }
         },
         "title": "Tag",
         "type": "object"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field repository: Repository | None = None

The repository that was deleted.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.DescribeImageReplicationStatusResponse[source]

Bases: Boto3Model

Show JSON schema
{
   "title": "DescribeImageReplicationStatusResponse",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "repositoryName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Repositoryname"
      },
      "imageId": {
         "anyOf": [
            {
               "$ref": "#/$defs/ImageIdentifier"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "replicationStatuses": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ImageReplicationStatus"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Replicationstatuses"
      }
   },
   "$defs": {
      "ImageIdentifier": {
         "description": "An object with identifying information for an image in an Amazon ECR repository.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "imageDigest": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imagedigest"
            },
            "imageTag": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imagetag"
            }
         },
         "title": "ImageIdentifier",
         "type": "object"
      },
      "ImageReplicationStatus": {
         "description": "The status of the replication process for an image.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "region": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Region"
            },
            "registryId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Registryid"
            },
            "status": {
               "anyOf": [
                  {
                     "enum": [
                        "IN_PROGRESS",
                        "COMPLETE",
                        "FAILED"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Status"
            },
            "failureCode": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Failurecode"
            }
         },
         "title": "ImageReplicationStatus",
         "type": "object"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field imageId: ImageIdentifier | None = None

An object with identifying information for an image in an Amazon ECR repository.

field replicationStatuses: builtins.list[ImageReplicationStatus] | None [Optional]

The replication status details for the images in the specified repository.

field repositoryName: str | None = None

The repository name associated with the request.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.DescribeImageScanFindingsResponse[source]

Bases: Boto3Model

Show JSON schema
{
   "title": "DescribeImageScanFindingsResponse",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "registryId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Registryid"
      },
      "repositoryName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Repositoryname"
      },
      "imageId": {
         "anyOf": [
            {
               "$ref": "#/$defs/ImageIdentifier"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "imageScanStatus": {
         "anyOf": [
            {
               "$ref": "#/$defs/ImageScanStatus"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "imageScanFindings": {
         "anyOf": [
            {
               "$ref": "#/$defs/ImageScanFindings"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "nextToken": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Nexttoken"
      }
   },
   "$defs": {
      "AwsEc2InstanceDetails": {
         "description": "Details of the Amazon EC2 instance involved in a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "type": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Type"
            },
            "imageId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imageid"
            },
            "ipV4Addresses": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Ipv4Addresses"
            },
            "ipV6Addresses": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Ipv6Addresses"
            },
            "keyName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Keyname"
            },
            "iamInstanceProfileArn": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Iaminstanceprofilearn"
            },
            "vpcId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vpcid"
            },
            "subnetId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Subnetid"
            },
            "launchedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Launchedat"
            },
            "platform": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Platform"
            }
         },
         "title": "AwsEc2InstanceDetails",
         "type": "object"
      },
      "AwsEcrContainerImageDetails": {
         "description": "The image details of the Amazon ECR container image.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "repositoryName": {
               "title": "Repositoryname",
               "type": "string"
            },
            "imageTags": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Imagetags"
            },
            "pushedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Pushedat"
            },
            "author": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Author"
            },
            "architecture": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Architecture"
            },
            "imageHash": {
               "title": "Imagehash",
               "type": "string"
            },
            "registry": {
               "title": "Registry",
               "type": "string"
            },
            "platform": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Platform"
            },
            "lastInUseAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Lastinuseat"
            },
            "inUseCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Inusecount"
            }
         },
         "required": [
            "repositoryName",
            "imageHash",
            "registry"
         ],
         "title": "AwsEcrContainerImageDetails",
         "type": "object"
      },
      "AwsLambdaFunctionDetails": {
         "description": "A summary of information about the Amazon Web Services Lambda function.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "functionName": {
               "title": "Functionname",
               "type": "string"
            },
            "runtime": {
               "enum": [
                  "NODEJS",
                  "NODEJS_12_X",
                  "NODEJS_14_X",
                  "NODEJS_16_X",
                  "JAVA_8",
                  "JAVA_8_AL2",
                  "JAVA_11",
                  "PYTHON_3_7",
                  "PYTHON_3_8",
                  "PYTHON_3_9",
                  "UNSUPPORTED",
                  "NODEJS_18_X",
                  "GO_1_X",
                  "JAVA_17",
                  "PYTHON_3_10",
                  "PYTHON_3_11",
                  "DOTNETCORE_3_1",
                  "DOTNET_6",
                  "DOTNET_7",
                  "RUBY_2_7",
                  "RUBY_3_2",
                  "DOTNET_10",
                  "NODEJS_24_X"
               ],
               "title": "Runtime",
               "type": "string"
            },
            "codeSha256": {
               "title": "Codesha256",
               "type": "string"
            },
            "version": {
               "title": "Version",
               "type": "string"
            },
            "executionRoleArn": {
               "title": "Executionrolearn",
               "type": "string"
            },
            "layers": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Layers"
            },
            "vpcConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LambdaVpcConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "packageType": {
               "anyOf": [
                  {
                     "enum": [
                        "IMAGE",
                        "ZIP"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Packagetype"
            },
            "architectures": {
               "anyOf": [
                  {
                     "items": {
                        "enum": [
                           "X86_64",
                           "ARM64"
                        ],
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Architectures"
            },
            "lastModifiedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Lastmodifiedat"
            }
         },
         "required": [
            "functionName",
            "runtime",
            "codeSha256",
            "version",
            "executionRoleArn"
         ],
         "title": "AwsLambdaFunctionDetails",
         "type": "object"
      },
      "CodeRepositoryDetails": {
         "description": "Contains details about a code repository associated with a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "projectName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Projectname"
            },
            "integrationArn": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Integrationarn"
            },
            "providerType": {
               "anyOf": [
                  {
                     "enum": [
                        "GITHUB",
                        "GITLAB_SELF_MANAGED"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Providertype"
            }
         },
         "title": "CodeRepositoryDetails",
         "type": "object"
      },
      "CvssScore": {
         "description": "The CVSS score for a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "baseScore": {
               "title": "Basescore",
               "type": "number"
            },
            "scoringVector": {
               "title": "Scoringvector",
               "type": "string"
            },
            "version": {
               "title": "Version",
               "type": "string"
            },
            "source": {
               "title": "Source",
               "type": "string"
            }
         },
         "required": [
            "baseScore",
            "scoringVector",
            "version",
            "source"
         ],
         "title": "CvssScore",
         "type": "object"
      },
      "CvssScoreAdjustment": {
         "description": "Details on adjustments Amazon Inspector made to the CVSS score for a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "metric": {
               "title": "Metric",
               "type": "string"
            },
            "reason": {
               "title": "Reason",
               "type": "string"
            }
         },
         "required": [
            "metric",
            "reason"
         ],
         "title": "CvssScoreAdjustment",
         "type": "object"
      },
      "CvssScoreDetails": {
         "description": "Information about the CVSS score.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "scoreSource": {
               "title": "Scoresource",
               "type": "string"
            },
            "cvssSource": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Cvsssource"
            },
            "version": {
               "title": "Version",
               "type": "string"
            },
            "score": {
               "title": "Score",
               "type": "number"
            },
            "scoringVector": {
               "title": "Scoringvector",
               "type": "string"
            },
            "adjustments": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/CvssScoreAdjustment"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Adjustments"
            }
         },
         "required": [
            "scoreSource",
            "version",
            "score",
            "scoringVector"
         ],
         "title": "CvssScoreDetails",
         "type": "object"
      },
      "ECRAttribute": {
         "description": "This data type is used in the ImageScanFinding data type.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "key": {
               "title": "Key",
               "type": "string"
            },
            "value": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Value"
            }
         },
         "required": [
            "key"
         ],
         "title": "ECRAttribute",
         "type": "object"
      },
      "EnhancedImageScanFinding": {
         "description": "The details of an enhanced image scan.\n\nThis is returned when enhanced scanning is enabled for your private registry.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "awsAccountId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Awsaccountid"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Description"
            },
            "findingArn": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Findingarn"
            },
            "firstObservedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Firstobservedat"
            },
            "lastObservedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Lastobservedat"
            },
            "packageVulnerabilityDetails": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/PackageVulnerabilityDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "remediation": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Remediation"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "resources": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Resource"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Resources"
            },
            "score": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Score"
            },
            "scoreDetails": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ScoreDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "severity": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Severity"
            },
            "status": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Status"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Title"
            },
            "type": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Type"
            },
            "updatedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Updatedat"
            },
            "fixAvailable": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Fixavailable"
            },
            "exploitAvailable": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Exploitavailable"
            }
         },
         "title": "EnhancedImageScanFinding",
         "type": "object"
      },
      "ImageIdentifier": {
         "description": "An object with identifying information for an image in an Amazon ECR repository.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "imageDigest": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imagedigest"
            },
            "imageTag": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imagetag"
            }
         },
         "title": "ImageIdentifier",
         "type": "object"
      },
      "ImageScanFinding": {
         "description": "Contains information about an image scan finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Name"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Description"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Uri"
            },
            "severity": {
               "anyOf": [
                  {
                     "enum": [
                        "INFORMATIONAL",
                        "LOW",
                        "MEDIUM",
                        "HIGH",
                        "CRITICAL",
                        "UNDEFINED"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Severity"
            },
            "attributes": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ECRAttribute"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Attributes"
            }
         },
         "title": "ImageScanFinding",
         "type": "object"
      },
      "ImageScanFindings": {
         "additionalProperties": true,
         "description": "The details of an image scan.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "findingSeverityCounts": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "integer"
                     },
                     "propertyNames": {
                        "enum": [
                           "INFORMATIONAL",
                           "LOW",
                           "MEDIUM",
                           "HIGH",
                           "CRITICAL",
                           "UNDEFINED",
                           "UNTRIAGED"
                        ]
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Findingseveritycounts"
            },
            "imageScanCompletedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imagescancompletedat"
            },
            "vulnerabilitySourceUpdatedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vulnerabilitysourceupdatedat"
            },
            "findings": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ImageScanFinding"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Findings"
            },
            "enhancedFindings": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/EnhancedImageScanFinding"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Enhancedfindings"
            }
         },
         "title": "ImageScanFindings",
         "type": "object"
      },
      "ImageScanStatus": {
         "description": "The current status of an image scan.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "status": {
               "anyOf": [
                  {
                     "enum": [
                        "IN_PROGRESS",
                        "COMPLETE",
                        "FAILED",
                        "UNSUPPORTED_IMAGE",
                        "ACTIVE",
                        "PENDING",
                        "SCAN_ELIGIBILITY_EXPIRED",
                        "FINDINGS_UNAVAILABLE",
                        "LIMIT_EXCEEDED",
                        "IMAGE_ARCHIVED"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Status"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Description"
            }
         },
         "title": "ImageScanStatus",
         "type": "object"
      },
      "LambdaVpcConfig": {
         "description": "The VPC security groups and subnets that are attached to an Amazon Web Services\nLambda function.\n\nFor more information, see\n`VPC Settings <https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html>`_.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "subnetIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Subnetids"
            },
            "securityGroupIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Securitygroupids"
            },
            "vpcId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vpcid"
            }
         },
         "title": "LambdaVpcConfig",
         "type": "object"
      },
      "PackageVulnerabilityDetails": {
         "description": "Information about a package vulnerability finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "vulnerabilityId": {
               "title": "Vulnerabilityid",
               "type": "string"
            },
            "vulnerablePackages": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/VulnerablePackage"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Vulnerablepackages"
            },
            "source": {
               "title": "Source",
               "type": "string"
            },
            "cvss": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/CvssScore"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Cvss"
            },
            "relatedVulnerabilities": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Relatedvulnerabilities"
            },
            "sourceUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Sourceurl"
            },
            "vendorSeverity": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vendorseverity"
            },
            "vendorCreatedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vendorcreatedat"
            },
            "vendorUpdatedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vendorupdatedat"
            },
            "referenceUrls": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Referenceurls"
            }
         },
         "required": [
            "vulnerabilityId",
            "source"
         ],
         "title": "PackageVulnerabilityDetails",
         "type": "object"
      },
      "Recommendation": {
         "description": "Details about the recommended course of action to remediate the finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Text"
            },
            "Url": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Url"
            }
         },
         "title": "Recommendation",
         "type": "object"
      },
      "Remediation": {
         "description": "Information on how to remediate a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "recommendation": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Recommendation"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "title": "Remediation",
         "type": "object"
      },
      "Resource": {
         "description": "Details about the resource involved in a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "tags": {
               "additionalProperties": {
                  "type": "string"
               },
               "title": "Tags",
               "type": "object"
            },
            "details": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ResourceDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Id"
            },
            "type": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Type"
            }
         },
         "title": "Resource",
         "type": "object"
      },
      "ResourceDetails": {
         "description": "Contains details about the resource involved in the finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "awsEc2Instance": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AwsEc2InstanceDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "awsEcrContainerImage": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AwsEcrContainerImageDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "awsLambdaFunction": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AwsLambdaFunctionDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "codeRepository": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeRepositoryDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "title": "ResourceDetails",
         "type": "object"
      },
      "ScoreDetails": {
         "description": "Information about the Amazon Inspector score given to a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "cvss": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CvssScoreDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "title": "ScoreDetails",
         "type": "object"
      },
      "VulnerablePackage": {
         "description": "Information on the vulnerable package identified by a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "packageManager": {
               "anyOf": [
                  {
                     "enum": [
                        "BUNDLER",
                        "CARGO",
                        "COMPOSER",
                        "NPM",
                        "NUGET",
                        "PIPENV",
                        "POETRY",
                        "YARN",
                        "GOBINARY",
                        "GOMOD",
                        "JAR",
                        "OS",
                        "PIP",
                        "PYTHONPKG",
                        "NODEPKG",
                        "POM",
                        "GEMSPEC",
                        "DOTNET_CORE",
                        "PYTHON",
                        "RUST",
                        "RUBY",
                        "GOLANG",
                        "JAVA",
                        "NODEJS",
                        "PHP",
                        "DOTNET",
                        "DOTNET5",
                        "DOTNET6",
                        "DOTNET7",
                        "GENERIC"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Packagemanager"
            },
            "name": {
               "title": "Name",
               "type": "string"
            },
            "version": {
               "title": "Version",
               "type": "string"
            },
            "sourceLayerHash": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Sourcelayerhash"
            },
            "epoch": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Epoch"
            },
            "release": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Release"
            },
            "arch": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Arch"
            },
            "filePath": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Filepath"
            },
            "fixedInVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Fixedinversion"
            },
            "remediation": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Remediation"
            },
            "sourceLambdaLayerArn": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Sourcelambdalayerarn"
            }
         },
         "required": [
            "name",
            "version"
         ],
         "title": "VulnerablePackage",
         "type": "object"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field imageId: ImageIdentifier | None = None

An object with identifying information for an image in an Amazon ECR repository.

field imageScanFindings: ImageScanFindings | None = None

The information contained in the image scan findings.

field imageScanStatus: ImageScanStatus | None = None

The current state of the scan.

field nextToken: str | None = None

The nextToken value to include in a future DescribeImageScanFindings request.

When the results of a DescribeImageScanFindings request exceed maxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.

field registryId: str | None = None

The registry ID associated with the request.

field repositoryName: str | None = None

The repository name associated with the request.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.DescribeRepositoriesResponse[source]

Bases: Boto3Model

Show JSON schema
{
   "title": "DescribeRepositoriesResponse",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "repositories": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Repository"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Repositories"
      },
      "nextToken": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Nexttoken"
      }
   },
   "$defs": {
      "EncryptionConfiguration": {
         "description": "The encryption configuration for the repository. This determines how the contents of\nyour repository are encrypted at rest.\n\nBy default, when no encryption configuration is set or the ``AES256`` encryption type is used, Amazon ECR uses server-\nside encryption with Amazon S3-managed encryption keys which encrypts your data at rest using an AES256 encryption\nalgorithm. This does not require any action on your part.\n\nFor more control over the encryption of the contents of your repository, you can use server-side encryption with Key\nManagement Service key stored in Key Management Service (KMS) to encrypt your images. For more information, see `Amazon\nECR encryption at rest <https://docs.aws.amazon.com/AmazonECR/latest/userguide/encryption-at-rest.html>`_ in the *Amazon\nElastic Container Registry User Guide*.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "encryptionType": {
               "enum": [
                  "AES256",
                  "KMS",
                  "KMS_DSSE"
               ],
               "title": "Encryptiontype",
               "type": "string"
            },
            "kmsKey": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Kmskey"
            }
         },
         "required": [
            "encryptionType"
         ],
         "title": "EncryptionConfiguration",
         "type": "object"
      },
      "ImageScanningConfiguration": {
         "description": "The image scanning configuration for a repository.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "scanOnPush": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Scanonpush"
            }
         },
         "title": "ImageScanningConfiguration",
         "type": "object"
      },
      "ImageTagMutabilityExclusionFilter": {
         "description": "A filter that specifies which image tags should be excluded from the repository's\nimage tag mutability setting.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "filterType": {
               "const": "WILDCARD",
               "title": "Filtertype",
               "type": "string"
            },
            "filter": {
               "title": "Filter",
               "type": "string"
            }
         },
         "required": [
            "filterType",
            "filter"
         ],
         "title": "ImageTagMutabilityExclusionFilter",
         "type": "object"
      },
      "Repository": {
         "description": "An object representing a repository.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "repositoryName": {
               "title": "Repositoryname",
               "type": "string"
            },
            "imageTagMutability": {
               "enum": [
                  "MUTABLE",
                  "IMMUTABLE",
                  "IMMUTABLE_WITH_EXCLUSION",
                  "MUTABLE_WITH_EXCLUSION"
               ],
               "title": "Imagetagmutability",
               "type": "string"
            },
            "imageScanningConfiguration": {
               "$ref": "#/$defs/ImageScanningConfiguration"
            },
            "repositoryArn": {
               "default": null,
               "title": "Repositoryarn",
               "type": "string"
            },
            "registryId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Registryid"
            },
            "repositoryUri": {
               "default": null,
               "title": "Repositoryuri",
               "type": "string"
            },
            "createdAt": {
               "default": null,
               "format": "date-time",
               "title": "Createdat",
               "type": "string"
            },
            "imageTagMutabilityExclusionFilters": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ImageTagMutabilityExclusionFilter"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Imagetagmutabilityexclusionfilters"
            },
            "encryptionConfiguration": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EncryptionConfiguration"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "Tags": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Tag"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Tags"
            }
         },
         "required": [
            "repositoryName",
            "imageTagMutability",
            "imageScanningConfiguration"
         ],
         "title": "Repository",
         "type": "object"
      },
      "Tag": {
         "description": "The metadata that you apply to a resource to help you categorize and\norganize them. Each tag consists of a key and an optional value. You define\nthem.\n\nThe following basic restrictions apply to tags:\n\n* Maximum number of tags per resource - 50\n* For each resource, each tag key must be unique, and each tag key can have\n  only one value.\n* Maximum key length - 128 Unicode characters in UTF-8\n* Maximum value length - 256 Unicode characters in UTF-8\n* If your tagging schema is used across multiple services and resources,\n  remember that other services may have restrictions on allowed characters.\n  Generally allowed characters are: letters, numbers, and spaces representable in\n  UTF-8, and the following characters: + - = . _ : / @.\n* Tag keys and values are case-sensitive.\n* Do not use ``aws:``, ``AWS:``, or any upper or lowercase combination of such\n  as a prefix for either keys or values as it is reserved for Amazon Web Services\n  use. You cannot edit or delete tag keys or values with this prefix. Tags with\n  this prefix do not count against your tags per resource limit.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "Key": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Key"
            },
            "Value": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Value"
            }
         },
         "title": "Tag",
         "type": "object"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field nextToken: str | None = None

The nextToken value to include in a future DescribeRepositories request.

When the results of a DescribeRepositories request exceed maxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.

field repositories: builtins.list[Repository] | None [Optional]

A list of repository objects corresponding to valid repositories.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.ECRAttribute[source]

Bases: Boto3Model

This data type is used in the ImageScanFinding data type.

Show JSON schema
{
   "title": "ECRAttribute",
   "description": "This data type is used in the ImageScanFinding data type.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "key": {
         "title": "Key",
         "type": "string"
      },
      "value": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Value"
      }
   },
   "required": [
      "key"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field key: str [Required]

The attribute key.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

field value: str | None = None

The value assigned to the attribute key.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.EnhancedImageScanFinding[source]

Bases: Boto3Model

The details of an enhanced image scan.

This is returned when enhanced scanning is enabled for your private registry.

Show JSON schema
{
   "title": "EnhancedImageScanFinding",
   "description": "The details of an enhanced image scan.\n\nThis is returned when enhanced scanning is enabled for your private registry.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "awsAccountId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Awsaccountid"
      },
      "description": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Description"
      },
      "findingArn": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Findingarn"
      },
      "firstObservedAt": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Firstobservedat"
      },
      "lastObservedAt": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Lastobservedat"
      },
      "packageVulnerabilityDetails": {
         "anyOf": [
            {
               "$ref": "#/$defs/PackageVulnerabilityDetails"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "remediation": {
         "anyOf": [
            {
               "$ref": "#/$defs/Remediation"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "resources": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Resource"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Resources"
      },
      "score": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Score"
      },
      "scoreDetails": {
         "anyOf": [
            {
               "$ref": "#/$defs/ScoreDetails"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "severity": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Severity"
      },
      "status": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Status"
      },
      "title": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Title"
      },
      "type": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Type"
      },
      "updatedAt": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Updatedat"
      },
      "fixAvailable": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Fixavailable"
      },
      "exploitAvailable": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Exploitavailable"
      }
   },
   "$defs": {
      "AwsEc2InstanceDetails": {
         "description": "Details of the Amazon EC2 instance involved in a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "type": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Type"
            },
            "imageId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imageid"
            },
            "ipV4Addresses": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Ipv4Addresses"
            },
            "ipV6Addresses": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Ipv6Addresses"
            },
            "keyName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Keyname"
            },
            "iamInstanceProfileArn": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Iaminstanceprofilearn"
            },
            "vpcId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vpcid"
            },
            "subnetId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Subnetid"
            },
            "launchedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Launchedat"
            },
            "platform": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Platform"
            }
         },
         "title": "AwsEc2InstanceDetails",
         "type": "object"
      },
      "AwsEcrContainerImageDetails": {
         "description": "The image details of the Amazon ECR container image.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "repositoryName": {
               "title": "Repositoryname",
               "type": "string"
            },
            "imageTags": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Imagetags"
            },
            "pushedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Pushedat"
            },
            "author": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Author"
            },
            "architecture": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Architecture"
            },
            "imageHash": {
               "title": "Imagehash",
               "type": "string"
            },
            "registry": {
               "title": "Registry",
               "type": "string"
            },
            "platform": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Platform"
            },
            "lastInUseAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Lastinuseat"
            },
            "inUseCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Inusecount"
            }
         },
         "required": [
            "repositoryName",
            "imageHash",
            "registry"
         ],
         "title": "AwsEcrContainerImageDetails",
         "type": "object"
      },
      "AwsLambdaFunctionDetails": {
         "description": "A summary of information about the Amazon Web Services Lambda function.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "functionName": {
               "title": "Functionname",
               "type": "string"
            },
            "runtime": {
               "enum": [
                  "NODEJS",
                  "NODEJS_12_X",
                  "NODEJS_14_X",
                  "NODEJS_16_X",
                  "JAVA_8",
                  "JAVA_8_AL2",
                  "JAVA_11",
                  "PYTHON_3_7",
                  "PYTHON_3_8",
                  "PYTHON_3_9",
                  "UNSUPPORTED",
                  "NODEJS_18_X",
                  "GO_1_X",
                  "JAVA_17",
                  "PYTHON_3_10",
                  "PYTHON_3_11",
                  "DOTNETCORE_3_1",
                  "DOTNET_6",
                  "DOTNET_7",
                  "RUBY_2_7",
                  "RUBY_3_2",
                  "DOTNET_10",
                  "NODEJS_24_X"
               ],
               "title": "Runtime",
               "type": "string"
            },
            "codeSha256": {
               "title": "Codesha256",
               "type": "string"
            },
            "version": {
               "title": "Version",
               "type": "string"
            },
            "executionRoleArn": {
               "title": "Executionrolearn",
               "type": "string"
            },
            "layers": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Layers"
            },
            "vpcConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LambdaVpcConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "packageType": {
               "anyOf": [
                  {
                     "enum": [
                        "IMAGE",
                        "ZIP"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Packagetype"
            },
            "architectures": {
               "anyOf": [
                  {
                     "items": {
                        "enum": [
                           "X86_64",
                           "ARM64"
                        ],
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Architectures"
            },
            "lastModifiedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Lastmodifiedat"
            }
         },
         "required": [
            "functionName",
            "runtime",
            "codeSha256",
            "version",
            "executionRoleArn"
         ],
         "title": "AwsLambdaFunctionDetails",
         "type": "object"
      },
      "CodeRepositoryDetails": {
         "description": "Contains details about a code repository associated with a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "projectName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Projectname"
            },
            "integrationArn": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Integrationarn"
            },
            "providerType": {
               "anyOf": [
                  {
                     "enum": [
                        "GITHUB",
                        "GITLAB_SELF_MANAGED"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Providertype"
            }
         },
         "title": "CodeRepositoryDetails",
         "type": "object"
      },
      "CvssScore": {
         "description": "The CVSS score for a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "baseScore": {
               "title": "Basescore",
               "type": "number"
            },
            "scoringVector": {
               "title": "Scoringvector",
               "type": "string"
            },
            "version": {
               "title": "Version",
               "type": "string"
            },
            "source": {
               "title": "Source",
               "type": "string"
            }
         },
         "required": [
            "baseScore",
            "scoringVector",
            "version",
            "source"
         ],
         "title": "CvssScore",
         "type": "object"
      },
      "CvssScoreAdjustment": {
         "description": "Details on adjustments Amazon Inspector made to the CVSS score for a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "metric": {
               "title": "Metric",
               "type": "string"
            },
            "reason": {
               "title": "Reason",
               "type": "string"
            }
         },
         "required": [
            "metric",
            "reason"
         ],
         "title": "CvssScoreAdjustment",
         "type": "object"
      },
      "CvssScoreDetails": {
         "description": "Information about the CVSS score.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "scoreSource": {
               "title": "Scoresource",
               "type": "string"
            },
            "cvssSource": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Cvsssource"
            },
            "version": {
               "title": "Version",
               "type": "string"
            },
            "score": {
               "title": "Score",
               "type": "number"
            },
            "scoringVector": {
               "title": "Scoringvector",
               "type": "string"
            },
            "adjustments": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/CvssScoreAdjustment"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Adjustments"
            }
         },
         "required": [
            "scoreSource",
            "version",
            "score",
            "scoringVector"
         ],
         "title": "CvssScoreDetails",
         "type": "object"
      },
      "LambdaVpcConfig": {
         "description": "The VPC security groups and subnets that are attached to an Amazon Web Services\nLambda function.\n\nFor more information, see\n`VPC Settings <https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html>`_.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "subnetIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Subnetids"
            },
            "securityGroupIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Securitygroupids"
            },
            "vpcId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vpcid"
            }
         },
         "title": "LambdaVpcConfig",
         "type": "object"
      },
      "PackageVulnerabilityDetails": {
         "description": "Information about a package vulnerability finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "vulnerabilityId": {
               "title": "Vulnerabilityid",
               "type": "string"
            },
            "vulnerablePackages": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/VulnerablePackage"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Vulnerablepackages"
            },
            "source": {
               "title": "Source",
               "type": "string"
            },
            "cvss": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/CvssScore"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Cvss"
            },
            "relatedVulnerabilities": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Relatedvulnerabilities"
            },
            "sourceUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Sourceurl"
            },
            "vendorSeverity": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vendorseverity"
            },
            "vendorCreatedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vendorcreatedat"
            },
            "vendorUpdatedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vendorupdatedat"
            },
            "referenceUrls": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Referenceurls"
            }
         },
         "required": [
            "vulnerabilityId",
            "source"
         ],
         "title": "PackageVulnerabilityDetails",
         "type": "object"
      },
      "Recommendation": {
         "description": "Details about the recommended course of action to remediate the finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Text"
            },
            "Url": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Url"
            }
         },
         "title": "Recommendation",
         "type": "object"
      },
      "Remediation": {
         "description": "Information on how to remediate a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "recommendation": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Recommendation"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "title": "Remediation",
         "type": "object"
      },
      "Resource": {
         "description": "Details about the resource involved in a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "tags": {
               "additionalProperties": {
                  "type": "string"
               },
               "title": "Tags",
               "type": "object"
            },
            "details": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ResourceDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Id"
            },
            "type": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Type"
            }
         },
         "title": "Resource",
         "type": "object"
      },
      "ResourceDetails": {
         "description": "Contains details about the resource involved in the finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "awsEc2Instance": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AwsEc2InstanceDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "awsEcrContainerImage": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AwsEcrContainerImageDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "awsLambdaFunction": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AwsLambdaFunctionDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "codeRepository": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeRepositoryDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "title": "ResourceDetails",
         "type": "object"
      },
      "ScoreDetails": {
         "description": "Information about the Amazon Inspector score given to a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "cvss": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CvssScoreDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "title": "ScoreDetails",
         "type": "object"
      },
      "VulnerablePackage": {
         "description": "Information on the vulnerable package identified by a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "packageManager": {
               "anyOf": [
                  {
                     "enum": [
                        "BUNDLER",
                        "CARGO",
                        "COMPOSER",
                        "NPM",
                        "NUGET",
                        "PIPENV",
                        "POETRY",
                        "YARN",
                        "GOBINARY",
                        "GOMOD",
                        "JAR",
                        "OS",
                        "PIP",
                        "PYTHONPKG",
                        "NODEPKG",
                        "POM",
                        "GEMSPEC",
                        "DOTNET_CORE",
                        "PYTHON",
                        "RUST",
                        "RUBY",
                        "GOLANG",
                        "JAVA",
                        "NODEJS",
                        "PHP",
                        "DOTNET",
                        "DOTNET5",
                        "DOTNET6",
                        "DOTNET7",
                        "GENERIC"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Packagemanager"
            },
            "name": {
               "title": "Name",
               "type": "string"
            },
            "version": {
               "title": "Version",
               "type": "string"
            },
            "sourceLayerHash": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Sourcelayerhash"
            },
            "epoch": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Epoch"
            },
            "release": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Release"
            },
            "arch": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Arch"
            },
            "filePath": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Filepath"
            },
            "fixedInVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Fixedinversion"
            },
            "remediation": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Remediation"
            },
            "sourceLambdaLayerArn": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Sourcelambdalayerarn"
            }
         },
         "required": [
            "name",
            "version"
         ],
         "title": "VulnerablePackage",
         "type": "object"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field awsAccountId: str | None = None

The Amazon Web Services account ID associated with the image.

field description: str | None = None

The description of the finding.

field exploitAvailable: str | None = None

If a finding discovered in your environment has an exploit available.

field findingArn: str | None = None

The Amazon Resource Number (ARN) of the finding.

field firstObservedAt: datetime | None = None

The date and time that the finding was first observed.

field fixAvailable: str | None = None

Details on whether a fix is available through a version update.

This value can be YES, NO, or PARTIAL. A PARTIAL fix means that some, but not all, of the packages identified in the finding have fixes available through updated versions.

field lastObservedAt: datetime | None = None

The date and time that the finding was last observed.

field packageVulnerabilityDetails: PackageVulnerabilityDetails | None = None

An object that contains the details of a package vulnerability finding.

field remediation: Remediation | None = None

An object that contains the details about how to remediate a finding.

field resources: builtins.list[Resource] | None [Optional]

Contains information on the resources involved in a finding.

field score: float | None = None

The Amazon Inspector score given to the finding.

field scoreDetails: ScoreDetails | None = None

An object that contains details of the Amazon Inspector score.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

field severity: str | None = None

The severity of the finding.

field status: str | None = None

The status of the finding.

field title: str | None = None

The title of the finding.

field type: str | None = None

The type of the finding.

field updatedAt: datetime | None = None

The date and time the finding was last updated at.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.ImageFailure[source]

Bases: Boto3Model

An object representing an Amazon ECR image failure.

Show JSON schema
{
   "title": "ImageFailure",
   "description": "An object representing an Amazon ECR image failure.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "imageId": {
         "anyOf": [
            {
               "$ref": "#/$defs/ImageIdentifier"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "failureCode": {
         "anyOf": [
            {
               "enum": [
                  "InvalidImageDigest",
                  "InvalidImageTag",
                  "ImageTagDoesNotMatchDigest",
                  "ImageNotFound",
                  "MissingDigestAndTag",
                  "ImageReferencedByManifestList",
                  "KmsError",
                  "UpstreamAccessDenied",
                  "UpstreamTooManyRequests",
                  "UpstreamUnavailable",
                  "ImageInaccessible"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Failurecode"
      },
      "failureReason": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Failurereason"
      }
   },
   "$defs": {
      "ImageIdentifier": {
         "description": "An object with identifying information for an image in an Amazon ECR repository.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "imageDigest": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imagedigest"
            },
            "imageTag": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imagetag"
            }
         },
         "title": "ImageIdentifier",
         "type": "object"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field failureCode: Literal['InvalidImageDigest', 'InvalidImageTag', 'ImageTagDoesNotMatchDigest', 'ImageNotFound', 'MissingDigestAndTag', 'ImageReferencedByManifestList', 'KmsError', 'UpstreamAccessDenied', 'UpstreamTooManyRequests', 'UpstreamUnavailable', 'ImageInaccessible'] | None = None

The code associated with the failure.

field failureReason: str | None = None

The reason for the failure.

field imageId: ImageIdentifier | None = None

The image ID associated with the failure.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.ImageReplicationStatus[source]

Bases: Boto3Model

The status of the replication process for an image.

Show JSON schema
{
   "title": "ImageReplicationStatus",
   "description": "The status of the replication process for an image.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "region": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Region"
      },
      "registryId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Registryid"
      },
      "status": {
         "anyOf": [
            {
               "enum": [
                  "IN_PROGRESS",
                  "COMPLETE",
                  "FAILED"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Status"
      },
      "failureCode": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Failurecode"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field failureCode: str | None = None

The failure code for a replication that has failed.

field region: str | None = None

The destination Region for the image replication.

field registryId: str | None = None

The Amazon Web Services account ID associated with the registry to which the image belongs.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

field status: Literal['IN_PROGRESS', 'COMPLETE', 'FAILED'] | None = None

The image replication status.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.ImageScanFinding[source]

Bases: Boto3Model

Contains information about an image scan finding.

Show JSON schema
{
   "title": "ImageScanFinding",
   "description": "Contains information about an image scan finding.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "description": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Description"
      },
      "uri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Uri"
      },
      "severity": {
         "anyOf": [
            {
               "enum": [
                  "INFORMATIONAL",
                  "LOW",
                  "MEDIUM",
                  "HIGH",
                  "CRITICAL",
                  "UNDEFINED"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Severity"
      },
      "attributes": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ECRAttribute"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Attributes"
      }
   },
   "$defs": {
      "ECRAttribute": {
         "description": "This data type is used in the ImageScanFinding data type.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "key": {
               "title": "Key",
               "type": "string"
            },
            "value": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Value"
            }
         },
         "required": [
            "key"
         ],
         "title": "ECRAttribute",
         "type": "object"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field attributes: builtins.list[ECRAttribute] | None [Optional]

A collection of attributes of the host from which the finding is generated.

field description: str | None = None

The description of the finding.

field name: str | None = None

The name associated with the finding, usually a CVE number.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

field severity: Literal['INFORMATIONAL', 'LOW', 'MEDIUM', 'HIGH', 'CRITICAL', 'UNDEFINED'] | None = None

The finding severity.

field uri: str | None = None

A link containing additional details about the security vulnerability.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.ImageScanFindings[source]

Bases: ReadonlyBoto3Model

The details of an image scan.

Show JSON schema
{
   "title": "ImageScanFindings",
   "description": "The details of an image scan.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "findingSeverityCounts": {
         "anyOf": [
            {
               "additionalProperties": {
                  "type": "integer"
               },
               "propertyNames": {
                  "enum": [
                     "INFORMATIONAL",
                     "LOW",
                     "MEDIUM",
                     "HIGH",
                     "CRITICAL",
                     "UNDEFINED",
                     "UNTRIAGED"
                  ]
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "title": "Findingseveritycounts"
      },
      "imageScanCompletedAt": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Imagescancompletedat"
      },
      "vulnerabilitySourceUpdatedAt": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Vulnerabilitysourceupdatedat"
      },
      "findings": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ImageScanFinding"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Findings"
      },
      "enhancedFindings": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/EnhancedImageScanFinding"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Enhancedfindings"
      }
   },
   "$defs": {
      "AwsEc2InstanceDetails": {
         "description": "Details of the Amazon EC2 instance involved in a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "type": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Type"
            },
            "imageId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imageid"
            },
            "ipV4Addresses": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Ipv4Addresses"
            },
            "ipV6Addresses": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Ipv6Addresses"
            },
            "keyName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Keyname"
            },
            "iamInstanceProfileArn": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Iaminstanceprofilearn"
            },
            "vpcId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vpcid"
            },
            "subnetId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Subnetid"
            },
            "launchedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Launchedat"
            },
            "platform": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Platform"
            }
         },
         "title": "AwsEc2InstanceDetails",
         "type": "object"
      },
      "AwsEcrContainerImageDetails": {
         "description": "The image details of the Amazon ECR container image.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "repositoryName": {
               "title": "Repositoryname",
               "type": "string"
            },
            "imageTags": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Imagetags"
            },
            "pushedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Pushedat"
            },
            "author": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Author"
            },
            "architecture": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Architecture"
            },
            "imageHash": {
               "title": "Imagehash",
               "type": "string"
            },
            "registry": {
               "title": "Registry",
               "type": "string"
            },
            "platform": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Platform"
            },
            "lastInUseAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Lastinuseat"
            },
            "inUseCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Inusecount"
            }
         },
         "required": [
            "repositoryName",
            "imageHash",
            "registry"
         ],
         "title": "AwsEcrContainerImageDetails",
         "type": "object"
      },
      "AwsLambdaFunctionDetails": {
         "description": "A summary of information about the Amazon Web Services Lambda function.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "functionName": {
               "title": "Functionname",
               "type": "string"
            },
            "runtime": {
               "enum": [
                  "NODEJS",
                  "NODEJS_12_X",
                  "NODEJS_14_X",
                  "NODEJS_16_X",
                  "JAVA_8",
                  "JAVA_8_AL2",
                  "JAVA_11",
                  "PYTHON_3_7",
                  "PYTHON_3_8",
                  "PYTHON_3_9",
                  "UNSUPPORTED",
                  "NODEJS_18_X",
                  "GO_1_X",
                  "JAVA_17",
                  "PYTHON_3_10",
                  "PYTHON_3_11",
                  "DOTNETCORE_3_1",
                  "DOTNET_6",
                  "DOTNET_7",
                  "RUBY_2_7",
                  "RUBY_3_2",
                  "DOTNET_10",
                  "NODEJS_24_X"
               ],
               "title": "Runtime",
               "type": "string"
            },
            "codeSha256": {
               "title": "Codesha256",
               "type": "string"
            },
            "version": {
               "title": "Version",
               "type": "string"
            },
            "executionRoleArn": {
               "title": "Executionrolearn",
               "type": "string"
            },
            "layers": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Layers"
            },
            "vpcConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LambdaVpcConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "packageType": {
               "anyOf": [
                  {
                     "enum": [
                        "IMAGE",
                        "ZIP"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Packagetype"
            },
            "architectures": {
               "anyOf": [
                  {
                     "items": {
                        "enum": [
                           "X86_64",
                           "ARM64"
                        ],
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Architectures"
            },
            "lastModifiedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Lastmodifiedat"
            }
         },
         "required": [
            "functionName",
            "runtime",
            "codeSha256",
            "version",
            "executionRoleArn"
         ],
         "title": "AwsLambdaFunctionDetails",
         "type": "object"
      },
      "CodeRepositoryDetails": {
         "description": "Contains details about a code repository associated with a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "projectName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Projectname"
            },
            "integrationArn": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Integrationarn"
            },
            "providerType": {
               "anyOf": [
                  {
                     "enum": [
                        "GITHUB",
                        "GITLAB_SELF_MANAGED"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Providertype"
            }
         },
         "title": "CodeRepositoryDetails",
         "type": "object"
      },
      "CvssScore": {
         "description": "The CVSS score for a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "baseScore": {
               "title": "Basescore",
               "type": "number"
            },
            "scoringVector": {
               "title": "Scoringvector",
               "type": "string"
            },
            "version": {
               "title": "Version",
               "type": "string"
            },
            "source": {
               "title": "Source",
               "type": "string"
            }
         },
         "required": [
            "baseScore",
            "scoringVector",
            "version",
            "source"
         ],
         "title": "CvssScore",
         "type": "object"
      },
      "CvssScoreAdjustment": {
         "description": "Details on adjustments Amazon Inspector made to the CVSS score for a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "metric": {
               "title": "Metric",
               "type": "string"
            },
            "reason": {
               "title": "Reason",
               "type": "string"
            }
         },
         "required": [
            "metric",
            "reason"
         ],
         "title": "CvssScoreAdjustment",
         "type": "object"
      },
      "CvssScoreDetails": {
         "description": "Information about the CVSS score.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "scoreSource": {
               "title": "Scoresource",
               "type": "string"
            },
            "cvssSource": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Cvsssource"
            },
            "version": {
               "title": "Version",
               "type": "string"
            },
            "score": {
               "title": "Score",
               "type": "number"
            },
            "scoringVector": {
               "title": "Scoringvector",
               "type": "string"
            },
            "adjustments": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/CvssScoreAdjustment"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Adjustments"
            }
         },
         "required": [
            "scoreSource",
            "version",
            "score",
            "scoringVector"
         ],
         "title": "CvssScoreDetails",
         "type": "object"
      },
      "ECRAttribute": {
         "description": "This data type is used in the ImageScanFinding data type.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "key": {
               "title": "Key",
               "type": "string"
            },
            "value": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Value"
            }
         },
         "required": [
            "key"
         ],
         "title": "ECRAttribute",
         "type": "object"
      },
      "EnhancedImageScanFinding": {
         "description": "The details of an enhanced image scan.\n\nThis is returned when enhanced scanning is enabled for your private registry.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "awsAccountId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Awsaccountid"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Description"
            },
            "findingArn": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Findingarn"
            },
            "firstObservedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Firstobservedat"
            },
            "lastObservedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Lastobservedat"
            },
            "packageVulnerabilityDetails": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/PackageVulnerabilityDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "remediation": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Remediation"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "resources": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Resource"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Resources"
            },
            "score": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Score"
            },
            "scoreDetails": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ScoreDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "severity": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Severity"
            },
            "status": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Status"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Title"
            },
            "type": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Type"
            },
            "updatedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Updatedat"
            },
            "fixAvailable": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Fixavailable"
            },
            "exploitAvailable": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Exploitavailable"
            }
         },
         "title": "EnhancedImageScanFinding",
         "type": "object"
      },
      "ImageScanFinding": {
         "description": "Contains information about an image scan finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Name"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Description"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Uri"
            },
            "severity": {
               "anyOf": [
                  {
                     "enum": [
                        "INFORMATIONAL",
                        "LOW",
                        "MEDIUM",
                        "HIGH",
                        "CRITICAL",
                        "UNDEFINED"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Severity"
            },
            "attributes": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ECRAttribute"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Attributes"
            }
         },
         "title": "ImageScanFinding",
         "type": "object"
      },
      "LambdaVpcConfig": {
         "description": "The VPC security groups and subnets that are attached to an Amazon Web Services\nLambda function.\n\nFor more information, see\n`VPC Settings <https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html>`_.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "subnetIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Subnetids"
            },
            "securityGroupIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Securitygroupids"
            },
            "vpcId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vpcid"
            }
         },
         "title": "LambdaVpcConfig",
         "type": "object"
      },
      "PackageVulnerabilityDetails": {
         "description": "Information about a package vulnerability finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "vulnerabilityId": {
               "title": "Vulnerabilityid",
               "type": "string"
            },
            "vulnerablePackages": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/VulnerablePackage"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Vulnerablepackages"
            },
            "source": {
               "title": "Source",
               "type": "string"
            },
            "cvss": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/CvssScore"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Cvss"
            },
            "relatedVulnerabilities": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Relatedvulnerabilities"
            },
            "sourceUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Sourceurl"
            },
            "vendorSeverity": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vendorseverity"
            },
            "vendorCreatedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vendorcreatedat"
            },
            "vendorUpdatedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vendorupdatedat"
            },
            "referenceUrls": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Referenceurls"
            }
         },
         "required": [
            "vulnerabilityId",
            "source"
         ],
         "title": "PackageVulnerabilityDetails",
         "type": "object"
      },
      "Recommendation": {
         "description": "Details about the recommended course of action to remediate the finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Text"
            },
            "Url": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Url"
            }
         },
         "title": "Recommendation",
         "type": "object"
      },
      "Remediation": {
         "description": "Information on how to remediate a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "recommendation": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Recommendation"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "title": "Remediation",
         "type": "object"
      },
      "Resource": {
         "description": "Details about the resource involved in a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "tags": {
               "additionalProperties": {
                  "type": "string"
               },
               "title": "Tags",
               "type": "object"
            },
            "details": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ResourceDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Id"
            },
            "type": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Type"
            }
         },
         "title": "Resource",
         "type": "object"
      },
      "ResourceDetails": {
         "description": "Contains details about the resource involved in the finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "awsEc2Instance": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AwsEc2InstanceDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "awsEcrContainerImage": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AwsEcrContainerImageDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "awsLambdaFunction": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AwsLambdaFunctionDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "codeRepository": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeRepositoryDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "title": "ResourceDetails",
         "type": "object"
      },
      "ScoreDetails": {
         "description": "Information about the Amazon Inspector score given to a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "cvss": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CvssScoreDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "title": "ScoreDetails",
         "type": "object"
      },
      "VulnerablePackage": {
         "description": "Information on the vulnerable package identified by a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "packageManager": {
               "anyOf": [
                  {
                     "enum": [
                        "BUNDLER",
                        "CARGO",
                        "COMPOSER",
                        "NPM",
                        "NUGET",
                        "PIPENV",
                        "POETRY",
                        "YARN",
                        "GOBINARY",
                        "GOMOD",
                        "JAR",
                        "OS",
                        "PIP",
                        "PYTHONPKG",
                        "NODEPKG",
                        "POM",
                        "GEMSPEC",
                        "DOTNET_CORE",
                        "PYTHON",
                        "RUST",
                        "RUBY",
                        "GOLANG",
                        "JAVA",
                        "NODEJS",
                        "PHP",
                        "DOTNET",
                        "DOTNET5",
                        "DOTNET6",
                        "DOTNET7",
                        "GENERIC"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Packagemanager"
            },
            "name": {
               "title": "Name",
               "type": "string"
            },
            "version": {
               "title": "Version",
               "type": "string"
            },
            "sourceLayerHash": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Sourcelayerhash"
            },
            "epoch": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Epoch"
            },
            "release": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Release"
            },
            "arch": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Arch"
            },
            "filePath": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Filepath"
            },
            "fixedInVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Fixedinversion"
            },
            "remediation": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Remediation"
            },
            "sourceLambdaLayerArn": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Sourcelambdalayerarn"
            }
         },
         "required": [
            "name",
            "version"
         ],
         "title": "VulnerablePackage",
         "type": "object"
      }
   },
   "additionalProperties": true
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

  • frozen: bool = True

  • extra: str = allow

Fields:
field enhancedFindings: builtins.list[EnhancedImageScanFinding] | None [Optional]

Details about the enhanced scan findings from Amazon Inspector.

field findingSeverityCounts: dict[Literal['INFORMATIONAL', 'LOW', 'MEDIUM', 'HIGH', 'CRITICAL', 'UNDEFINED', 'UNTRIAGED'], int] | None [Optional]

The image vulnerability counts, sorted by severity.

field findings: builtins.list[ImageScanFinding] | None [Optional]

The findings from the image scan.

field imageScanCompletedAt: datetime | None = None

The time of the last completed image scan.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

field vulnerabilitySourceUpdatedAt: datetime | None = None

The time when the vulnerability data was last scanned.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.ImageScanStatus[source]

Bases: Boto3Model

The current status of an image scan.

Show JSON schema
{
   "title": "ImageScanStatus",
   "description": "The current status of an image scan.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "status": {
         "anyOf": [
            {
               "enum": [
                  "IN_PROGRESS",
                  "COMPLETE",
                  "FAILED",
                  "UNSUPPORTED_IMAGE",
                  "ACTIVE",
                  "PENDING",
                  "SCAN_ELIGIBILITY_EXPIRED",
                  "FINDINGS_UNAVAILABLE",
                  "LIMIT_EXCEEDED",
                  "IMAGE_ARCHIVED"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Status"
      },
      "description": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Description"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field description: str | None = None

The description of the image scan status.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

field status: Literal['IN_PROGRESS', 'COMPLETE', 'FAILED', 'UNSUPPORTED_IMAGE', 'ACTIVE', 'PENDING', 'SCAN_ELIGIBILITY_EXPIRED', 'FINDINGS_UNAVAILABLE', 'LIMIT_EXCEEDED', 'IMAGE_ARCHIVED'] | None = None

The current state of an image scan.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.ListImagesFilter[source]

Bases: Boto3Model

An object representing a filter on a ListImages operation.

Show JSON schema
{
   "title": "ListImagesFilter",
   "description": "An object representing a filter on a ListImages operation.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "tagStatus": {
         "anyOf": [
            {
               "enum": [
                  "TAGGED",
                  "UNTAGGED",
                  "ANY"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Tagstatus"
      },
      "imageStatus": {
         "anyOf": [
            {
               "enum": [
                  "ACTIVE",
                  "ARCHIVED",
                  "ACTIVATING",
                  "ANY"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Imagestatus"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field imageStatus: Literal['ACTIVE', 'ARCHIVED', 'ACTIVATING', 'ANY'] | None = None

The image status with which to filter your ListImages results.

Valid values are ACTIVE, ARCHIVED, and ACTIVATING. If not specified, only images with ACTIVE status are returned.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

field tagStatus: Literal['TAGGED', 'UNTAGGED', 'ANY'] | None = None

The tag status with which to filter your ListImages results.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.ListImagesResponse[source]

Bases: Boto3Model

Show JSON schema
{
   "title": "ListImagesResponse",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "imageIds": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ImageIdentifier"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Imageids"
      },
      "nextToken": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Nexttoken"
      }
   },
   "$defs": {
      "ImageIdentifier": {
         "description": "An object with identifying information for an image in an Amazon ECR repository.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "imageDigest": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imagedigest"
            },
            "imageTag": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imagetag"
            }
         },
         "title": "ImageIdentifier",
         "type": "object"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field imageIds: builtins.list[ImageIdentifier] | None [Optional]

The list of image IDs for the requested repository.

field nextToken: str | None = None

The nextToken value to include in a future ListImages request.

When the results of a ListImages request exceed maxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.ListTagsForResourceResponse[source]

Bases: TagsDictMixin, Boto3Model

Show JSON schema
{
   "title": "ListTagsForResourceResponse",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "tags": {
         "items": {
            "$ref": "#/$defs/Tag"
         },
         "title": "Tags",
         "type": "array"
      }
   },
   "$defs": {
      "Tag": {
         "description": "The metadata that you apply to a resource to help you categorize and\norganize them. Each tag consists of a key and an optional value. You define\nthem.\n\nThe following basic restrictions apply to tags:\n\n* Maximum number of tags per resource - 50\n* For each resource, each tag key must be unique, and each tag key can have\n  only one value.\n* Maximum key length - 128 Unicode characters in UTF-8\n* Maximum value length - 256 Unicode characters in UTF-8\n* If your tagging schema is used across multiple services and resources,\n  remember that other services may have restrictions on allowed characters.\n  Generally allowed characters are: letters, numbers, and spaces representable in\n  UTF-8, and the following characters: + - = . _ : / @.\n* Tag keys and values are case-sensitive.\n* Do not use ``aws:``, ``AWS:``, or any upper or lowercase combination of such\n  as a prefix for either keys or values as it is reserved for Amazon Web Services\n  use. You cannot edit or delete tag keys or values with this prefix. Tags with\n  this prefix do not count against your tags per resource limit.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "Key": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Key"
            },
            "Value": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Value"
            }
         },
         "title": "Tag",
         "type": "object"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field Tags: builtins.list[Tag] [Optional] (alias 'tags')

The tags for the resource.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

tag_class

alias of Tag

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

property tags: TagsDict

Get the tags for the model instance.

Returns:

The tags for the model instance.

pydantic model botocraft.services.ecr.Resource[source]

Bases: Boto3Model

Details about the resource involved in a finding.

Show JSON schema
{
   "title": "Resource",
   "description": "Details about the resource involved in a finding.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "tags": {
         "additionalProperties": {
            "type": "string"
         },
         "title": "Tags",
         "type": "object"
      },
      "details": {
         "anyOf": [
            {
               "$ref": "#/$defs/ResourceDetails"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "id": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Id"
      },
      "type": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Type"
      }
   },
   "$defs": {
      "AwsEc2InstanceDetails": {
         "description": "Details of the Amazon EC2 instance involved in a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "type": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Type"
            },
            "imageId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Imageid"
            },
            "ipV4Addresses": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Ipv4Addresses"
            },
            "ipV6Addresses": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Ipv6Addresses"
            },
            "keyName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Keyname"
            },
            "iamInstanceProfileArn": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Iaminstanceprofilearn"
            },
            "vpcId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vpcid"
            },
            "subnetId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Subnetid"
            },
            "launchedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Launchedat"
            },
            "platform": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Platform"
            }
         },
         "title": "AwsEc2InstanceDetails",
         "type": "object"
      },
      "AwsEcrContainerImageDetails": {
         "description": "The image details of the Amazon ECR container image.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "repositoryName": {
               "title": "Repositoryname",
               "type": "string"
            },
            "imageTags": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Imagetags"
            },
            "pushedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Pushedat"
            },
            "author": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Author"
            },
            "architecture": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Architecture"
            },
            "imageHash": {
               "title": "Imagehash",
               "type": "string"
            },
            "registry": {
               "title": "Registry",
               "type": "string"
            },
            "platform": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Platform"
            },
            "lastInUseAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Lastinuseat"
            },
            "inUseCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Inusecount"
            }
         },
         "required": [
            "repositoryName",
            "imageHash",
            "registry"
         ],
         "title": "AwsEcrContainerImageDetails",
         "type": "object"
      },
      "AwsLambdaFunctionDetails": {
         "description": "A summary of information about the Amazon Web Services Lambda function.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "functionName": {
               "title": "Functionname",
               "type": "string"
            },
            "runtime": {
               "enum": [
                  "NODEJS",
                  "NODEJS_12_X",
                  "NODEJS_14_X",
                  "NODEJS_16_X",
                  "JAVA_8",
                  "JAVA_8_AL2",
                  "JAVA_11",
                  "PYTHON_3_7",
                  "PYTHON_3_8",
                  "PYTHON_3_9",
                  "UNSUPPORTED",
                  "NODEJS_18_X",
                  "GO_1_X",
                  "JAVA_17",
                  "PYTHON_3_10",
                  "PYTHON_3_11",
                  "DOTNETCORE_3_1",
                  "DOTNET_6",
                  "DOTNET_7",
                  "RUBY_2_7",
                  "RUBY_3_2",
                  "DOTNET_10",
                  "NODEJS_24_X"
               ],
               "title": "Runtime",
               "type": "string"
            },
            "codeSha256": {
               "title": "Codesha256",
               "type": "string"
            },
            "version": {
               "title": "Version",
               "type": "string"
            },
            "executionRoleArn": {
               "title": "Executionrolearn",
               "type": "string"
            },
            "layers": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Layers"
            },
            "vpcConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LambdaVpcConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "packageType": {
               "anyOf": [
                  {
                     "enum": [
                        "IMAGE",
                        "ZIP"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Packagetype"
            },
            "architectures": {
               "anyOf": [
                  {
                     "items": {
                        "enum": [
                           "X86_64",
                           "ARM64"
                        ],
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Architectures"
            },
            "lastModifiedAt": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Lastmodifiedat"
            }
         },
         "required": [
            "functionName",
            "runtime",
            "codeSha256",
            "version",
            "executionRoleArn"
         ],
         "title": "AwsLambdaFunctionDetails",
         "type": "object"
      },
      "CodeRepositoryDetails": {
         "description": "Contains details about a code repository associated with a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "projectName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Projectname"
            },
            "integrationArn": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Integrationarn"
            },
            "providerType": {
               "anyOf": [
                  {
                     "enum": [
                        "GITHUB",
                        "GITLAB_SELF_MANAGED"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Providertype"
            }
         },
         "title": "CodeRepositoryDetails",
         "type": "object"
      },
      "LambdaVpcConfig": {
         "description": "The VPC security groups and subnets that are attached to an Amazon Web Services\nLambda function.\n\nFor more information, see\n`VPC Settings <https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html>`_.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "subnetIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Subnetids"
            },
            "securityGroupIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Securitygroupids"
            },
            "vpcId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Vpcid"
            }
         },
         "title": "LambdaVpcConfig",
         "type": "object"
      },
      "ResourceDetails": {
         "description": "Contains details about the resource involved in the finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "awsEc2Instance": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AwsEc2InstanceDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "awsEcrContainerImage": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AwsEcrContainerImageDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "awsLambdaFunction": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AwsLambdaFunctionDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "codeRepository": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeRepositoryDetails"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "title": "ResourceDetails",
         "type": "object"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field Tags: dict[str, str] [Optional] (alias 'tags')

The tags attached to the resource.

field details: ResourceDetails | None = None

An object that contains details about the resource involved in a finding.

field id: str | None = None

The ID of the resource.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

field type: str | None = None

The type of resource.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.ecr.ScoreDetails[source]

Bases: Boto3Model

Information about the Amazon Inspector score given to a finding.

Show JSON schema
{
   "title": "ScoreDetails",
   "description": "Information about the Amazon Inspector score given to a finding.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "cvss": {
         "anyOf": [
            {
               "$ref": "#/$defs/CvssScoreDetails"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      }
   },
   "$defs": {
      "CvssScoreAdjustment": {
         "description": "Details on adjustments Amazon Inspector made to the CVSS score for a finding.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "metric": {
               "title": "Metric",
               "type": "string"
            },
            "reason": {
               "title": "Reason",
               "type": "string"
            }
         },
         "required": [
            "metric",
            "reason"
         ],
         "title": "CvssScoreAdjustment",
         "type": "object"
      },
      "CvssScoreDetails": {
         "description": "Information about the CVSS score.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "scoreSource": {
               "title": "Scoresource",
               "type": "string"
            },
            "cvssSource": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Cvsssource"
            },
            "version": {
               "title": "Version",
               "type": "string"
            },
            "score": {
               "title": "Score",
               "type": "number"
            },
            "scoringVector": {
               "title": "Scoringvector",
               "type": "string"
            },
            "adjustments": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/CvssScoreAdjustment"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Adjustments"
            }
         },
         "required": [
            "scoreSource",
            "version",
            "score",
            "scoringVector"
         ],
         "title": "CvssScoreDetails",
         "type": "object"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field cvss: CvssScoreDetails | None = None

An object that contains details about the CVSS score given to a finding.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.