Note: You are viewing the documentation for an older major version of the AWS SDK for JavaScript (v2).
The modular AWS SDK for JavaScript (v3) is now General Available. For more information see the Developer Guide or API Reference.
Class: AWS.ECR
- Inherits:
-
AWS.Service
- Object
- AWS.Service
- AWS.ECR
- Identifier:
- ecr
- API Version:
- 2015-09-21
- Defined in:
- (unknown)
Overview
Constructs a service interface object. Each API operation is exposed as a function on service.
Service Description
Amazon Elastic Container Registry (Amazon ECR) is a managed container image registry service. Customers can use the familiar Docker CLI, or their preferred client, to push, pull, and manage images. Amazon ECR provides a secure, scalable, and reliable registry for your Docker or Open Container Initiative (OCI) images. Amazon ECR supports private repositories with resource-based permissions using IAM so that specific users or Amazon EC2 instances can access repositories and images.
Sending a Request Using ECR
var ecr = new AWS.ECR();
ecr.batchCheckLayerAvailability(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Locking the API Version
In order to ensure that the ECR object uses this specific API, you can
construct the object by passing the apiVersion
option to the constructor:
var ecr = new AWS.ECR({apiVersion: '2015-09-21'});
You can also set the API version globally in AWS.config.apiVersions
using
the ecr service identifier:
AWS.config.apiVersions = {
ecr: '2015-09-21',
// other service API versions
};
var ecr = new AWS.ECR();
Version:
-
2015-09-21
Waiter Resource States
This service supports a list of resource states that can be polled using the waitFor() method. The resource states are:
imageScanComplete, lifecyclePolicyPreviewComplete
Constructor Summary
-
new AWS.ECR(options = {}) ⇒ Object
constructor
Constructs a service object.
Property Summary
-
endpoint ⇒ AWS.Endpoint
readwrite
An Endpoint object representing the endpoint URL for service requests.
Properties inherited from AWS.Service
Method Summary
-
batchCheckLayerAvailability(params = {}, callback) ⇒ AWS.Request
Checks the availability of one or more image layers in a repository.
-
batchDeleteImage(params = {}, callback) ⇒ AWS.Request
Deletes a list of specified images within a repository.
-
batchGetImage(params = {}, callback) ⇒ AWS.Request
Gets detailed information for an image.
-
completeLayerUpload(params = {}, callback) ⇒ AWS.Request
Informs Amazon ECR that the image layer upload has completed for a specified registry, repository name, and upload ID.
-
createRepository(params = {}, callback) ⇒ AWS.Request
Creates a repository.
-
deleteLifecyclePolicy(params = {}, callback) ⇒ AWS.Request
Deletes the lifecycle policy associated with the specified repository.
-
deleteRegistryPolicy(params = {}, callback) ⇒ AWS.Request
Deletes the registry permissions policy.
-
deleteRepository(params = {}, callback) ⇒ AWS.Request
Deletes a repository.
-
deleteRepositoryPolicy(params = {}, callback) ⇒ AWS.Request
Deletes the repository policy associated with the specified repository.
-
describeImages(params = {}, callback) ⇒ AWS.Request
Returns metadata about the images in a repository.
-
describeImageScanFindings(params = {}, callback) ⇒ AWS.Request
Returns the scan findings for the specified image.
-
describeRegistry(params = {}, callback) ⇒ AWS.Request
Describes the settings for a registry.
-
describeRepositories(params = {}, callback) ⇒ AWS.Request
Describes image repositories in a registry.
-
getAuthorizationToken(params = {}, callback) ⇒ AWS.Request
Retrieves an authorization token.
-
getDownloadUrlForLayer(params = {}, callback) ⇒ AWS.Request
Retrieves the pre-signed Amazon S3 download URL corresponding to an image layer.
-
getLifecyclePolicy(params = {}, callback) ⇒ AWS.Request
Retrieves the lifecycle policy for the specified repository.
-
getLifecyclePolicyPreview(params = {}, callback) ⇒ AWS.Request
Retrieves the results of the lifecycle policy preview request for the specified repository.
-
getRegistryPolicy(params = {}, callback) ⇒ AWS.Request
Retrieves the permissions policy for a registry.
-
getRepositoryPolicy(params = {}, callback) ⇒ AWS.Request
Retrieves the repository policy for the specified repository.
-
initiateLayerUpload(params = {}, callback) ⇒ AWS.Request
Notifies Amazon ECR that you intend to upload an image layer.
-
listImages(params = {}, callback) ⇒ AWS.Request
Lists all the image IDs for the specified repository.
-
listTagsForResource(params = {}, callback) ⇒ AWS.Request
List the tags for an Amazon ECR resource.
-
putImage(params = {}, callback) ⇒ AWS.Request
Creates or updates the image manifest and tags associated with an image.
-
putImageScanningConfiguration(params = {}, callback) ⇒ AWS.Request
Updates the image scanning configuration for the specified repository.
-
putImageTagMutability(params = {}, callback) ⇒ AWS.Request
Updates the image tag mutability settings for the specified repository.
-
putLifecyclePolicy(params = {}, callback) ⇒ AWS.Request
Creates or updates the lifecycle policy for the specified repository.
-
putRegistryPolicy(params = {}, callback) ⇒ AWS.Request
Creates or updates the permissions policy for your registry.
-
putReplicationConfiguration(params = {}, callback) ⇒ AWS.Request
Creates or updates the replication configuration for a registry.
-
setRepositoryPolicy(params = {}, callback) ⇒ AWS.Request
Applies a repository policy to the specified repository to control access permissions.
-
startImageScan(params = {}, callback) ⇒ AWS.Request
Starts an image vulnerability scan.
-
startLifecyclePolicyPreview(params = {}, callback) ⇒ AWS.Request
Starts a preview of a lifecycle policy for the specified repository.
-
tagResource(params = {}, callback) ⇒ AWS.Request
Adds specified tags to a resource with the specified ARN.
-
untagResource(params = {}, callback) ⇒ AWS.Request
Deletes specified tags from a resource.
-
uploadLayerPart(params = {}, callback) ⇒ AWS.Request
Uploads an image layer part to Amazon ECR.
-
waitFor(state, params = {}, callback) ⇒ AWS.Request
Waits for a given ECR resource.
Methods inherited from AWS.Service
makeRequest, makeUnauthenticatedRequest, setupRequestListeners, defineService
Constructor Details
new AWS.ECR(options = {}) ⇒ Object
Constructs a service object. This object has one method for each API operation.
Examples:
Constructing a ECR object
var ecr = new AWS.ECR({apiVersion: '2015-09-21'});
Options Hash (options):
-
params
(map)
—
An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.
-
endpoint
(String|AWS.Endpoint)
—
The endpoint URI to send requests to. The default endpoint is built from the configured
region
. The endpoint should be a string like'https://{service}.{region}.amazonaws.com'
or an Endpoint object. -
accessKeyId
(String)
—
your AWS access key ID.
-
secretAccessKey
(String)
—
your AWS secret access key.
-
sessionToken
(AWS.Credentials)
—
the optional AWS session token to sign requests with.
-
credentials
(AWS.Credentials)
—
the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.
-
credentialProvider
(AWS.CredentialProviderChain)
—
the provider chain used to resolve credentials if no static
credentials
property is set. -
region
(String)
—
the region to send service requests to. See AWS.ECR.region for more information.
-
maxRetries
(Integer)
—
the maximum amount of retries to attempt with a request. See AWS.ECR.maxRetries for more information.
-
maxRedirects
(Integer)
—
the maximum amount of redirects to follow with a request. See AWS.ECR.maxRedirects for more information.
-
sslEnabled
(Boolean)
—
whether to enable SSL for requests.
-
paramValidation
(Boolean|map)
—
whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:
- min [Boolean] — Validates that a value meets the min
constraint. This is enabled by default when paramValidation is set
to
true
. - max [Boolean] — Validates that a value meets the max constraint.
- pattern [Boolean] — Validates that a string value matches a regular expression.
- enum [Boolean] — Validates that a string value matches one of the allowable enum values.
- min [Boolean] — Validates that a value meets the min
constraint. This is enabled by default when paramValidation is set
to
-
computeChecksums
(Boolean)
—
whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)
-
convertResponseTypes
(Boolean)
—
whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to
true
. -
correctClockSkew
(Boolean)
—
whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to
false
. -
s3ForcePathStyle
(Boolean)
—
whether to force path style URLs for S3 objects.
-
s3BucketEndpoint
(Boolean)
—
whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an
endpoint
to be provided explicitly to the service constructor. -
s3DisableBodySigning
(Boolean)
—
whether S3 body signing should be disabled when using signature version
v4
. Body signing can only be disabled when using https. Defaults totrue
. -
s3UsEast1RegionalEndpoint
('legacy'|'regional')
—
when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to
legacy
-
s3UseArnRegion
(Boolean)
—
whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to
true
-
retryDelayOptions
(map)
—
A set of options to configure the retry delay on retryable errors. Currently supported options are:
- base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
- customBackoff [function] — A custom function that accepts a
retry count and error and returns the amount of time to delay in
milliseconds. If the result is a non-zero negative value, no further
retry attempts will be made. The
base
option will be ignored if this option is supplied. The function is only called for retryable errors.
-
httpOptions
(map)
—
A set of options to pass to the low-level HTTP request. Currently supported options are:
- proxy [String] — the URL to proxy requests through
- agent [http.Agent, https.Agent] — the Agent object to perform
HTTP requests with. Used for connection pooling. Defaults to the global
agent (
http.globalAgent
) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment. - connectTimeout [Integer] — Sets the socket to timeout after
failing to establish a connection with the server after
connectTimeout
milliseconds. This timeout has no effect once a socket connection has been established. - timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
- xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
- xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
-
apiVersion
(String, Date)
—
a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by
apiVersions
). Specify 'latest' to use the latest possible version. -
apiVersions
(map<String, String|Date>)
—
a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.
-
logger
(#write, #log)
—
an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests
-
systemClockOffset
(Number)
—
an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global
AWS.config
object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds. -
signatureVersion
(String)
—
the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.
-
signatureCache
(Boolean)
—
whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to
true
. -
dynamoDbCrc32
(Boolean)
—
whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default:
true
. -
useAccelerateEndpoint
(Boolean)
—
Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default:
false
. -
clientSideMonitoring
(Boolean)
—
whether to collect and publish this client's performance metrics of all its API requests.
-
endpointDiscoveryEnabled
(Boolean|undefined)
—
whether to call operations with endpoints given by service dynamically. Setting this
-
endpointCacheSize
(Number)
—
the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000
-
hostPrefixEnabled
(Boolean)
—
whether to marshal request parameters to the prefix of hostname. Defaults to
true
. -
stsRegionalEndpoints
('legacy'|'regional')
—
whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.
Property Details
Method Details
batchCheckLayerAvailability(params = {}, callback) ⇒ AWS.Request
Checks the availability of one or more image layers in a repository.
When an image is pushed to a repository, each image layer is checked to verify if it has been uploaded before. If it has been uploaded, then the image layer is skipped.
docker
CLI to pull, tag, and push images. Service Reference:
Examples:
Calling the batchCheckLayerAvailability operation
var params = {
layerDigests: [ /* required */
'STRING_VALUE',
/* more items */
],
repositoryName: 'STRING_VALUE', /* required */
registryId: 'STRING_VALUE'
};
ecr.batchCheckLayerAvailability(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the image layers to check. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository that is associated with the image layers to check.
layerDigests
— (Array<String>
)The digests of the image layers to check.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:layers
— (Array<map>
)A list of image layer objects corresponding to the image layer references in the request.
layerDigest
— (String
)The
sha256
digest of the image layer.layerAvailability
— (String
)The availability status of the image layer.
Possible values include:"AVAILABLE"
"UNAVAILABLE"
layerSize
— (Integer
)The size, in bytes, of the image layer.
mediaType
— (String
)The media type of the layer, such as
application/vnd.docker.image.rootfs.diff.tar.gzip
orapplication/vnd.oci.image.layer.v1.tar+gzip
.
failures
— (Array<map>
)Any failures associated with the call.
layerDigest
— (String
)The layer digest associated with the failure.
failureCode
— (String
)The failure code associated with the failure.
Possible values include:"InvalidLayerDigest"
"MissingLayerDigest"
failureReason
— (String
)The reason for the failure.
-
(AWS.Response)
—
Returns:
batchDeleteImage(params = {}, callback) ⇒ AWS.Request
Deletes a list of specified images within a repository. Images are specified with either an imageTag
or imageDigest
.
You can remove a tag from an image by specifying the image's tag in your request. When you remove the last tag from an image, the image is deleted from your repository.
You can completely delete an image (and all of its tags) by specifying the image's digest in your request.
Service Reference:
Examples:
To delete multiple images
/* This example deletes images with the tags precise and trusty in a repository called ubuntu in the default registry for an account. */
var params = {
imageIds: [
{
imageTag: "precise"
}
],
repositoryName: "ubuntu"
};
ecr.batchDeleteImage(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
/*
data = {
failures: [
],
imageIds: [
{
imageDigest: "sha256:examplee6d1e504117a17000003d3753086354a38375961f2e665416ef4b1b2f",
imageTag: "precise"
}
]
}
*/
});
Calling the batchDeleteImage operation
var params = {
imageIds: [ /* required */
{
imageDigest: 'STRING_VALUE',
imageTag: 'STRING_VALUE'
},
/* more items */
],
repositoryName: 'STRING_VALUE', /* required */
registryId: 'STRING_VALUE'
};
ecr.batchDeleteImage(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the image to delete. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The repository that contains the image to delete.
imageIds
— (Array<map>
)A list of image ID references that correspond to images to delete. The format of the
imageIds
reference isimageTag=tag
orimageDigest=digest
.imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:imageIds
— (Array<map>
)The image IDs of the deleted images.
imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
failures
— (Array<map>
)Any failures associated with the call.
imageId
— (map
)The image ID associated with the failure.
imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
failureCode
— (String
)The code associated with the failure.
Possible values include:"InvalidImageDigest"
"InvalidImageTag"
"ImageTagDoesNotMatchDigest"
"ImageNotFound"
"MissingDigestAndTag"
"ImageReferencedByManifestList"
"KmsError"
failureReason
— (String
)The reason for the failure.
-
(AWS.Response)
—
Returns:
batchGetImage(params = {}, callback) ⇒ AWS.Request
Gets detailed information for an image. Images are specified with either an imageTag
or imageDigest
.
When an image is pulled, the BatchGetImage API is called once to retrieve the image manifest.
Service Reference:
Examples:
To obtain multiple images in a single request
/* This example obtains information for an image with a specified image digest ID from the repository named ubuntu in the current account. */
var params = {
imageIds: [
{
imageTag: "precise"
}
],
repositoryName: "ubuntu"
};
ecr.batchGetImage(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
/*
data = {
failures: [
],
images: [
{
imageId: {
imageDigest: "sha256:example76bdff6d83a09ba2a818f0d00000063724a9ac3ba5019c56f74ebf42a",
imageTag: "precise"
},
imageManifest: "{\n \"schemaVersion\": 1,\n \"name\": \"ubuntu\",\n \"tag\": \"precise\",\n...",
registryId: "244698725403",
repositoryName: "ubuntu"
}
]
}
*/
});
Calling the batchGetImage operation
var params = {
imageIds: [ /* required */
{
imageDigest: 'STRING_VALUE',
imageTag: 'STRING_VALUE'
},
/* more items */
],
repositoryName: 'STRING_VALUE', /* required */
acceptedMediaTypes: [
'STRING_VALUE',
/* more items */
],
registryId: 'STRING_VALUE'
};
ecr.batchGetImage(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the images to describe. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The repository that contains the images to describe.
imageIds
— (Array<map>
)A list of image ID references that correspond to images to describe. The format of the
imageIds
reference isimageTag=tag
orimageDigest=digest
.imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
acceptedMediaTypes
— (Array<String>
)The accepted media types for the request.
Valid values:
application/vnd.docker.distribution.manifest.v1+json
|application/vnd.docker.distribution.manifest.v2+json
|application/vnd.oci.image.manifest.v1+json
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:images
— (Array<map>
)A list of image objects corresponding to the image references in the request.
registryId
— (String
)The AWS account ID associated with the registry containing the image.
repositoryName
— (String
)The name of the repository associated with the image.
imageId
— (map
)An object containing the image tag and image digest associated with an image.
imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
imageManifest
— (String
)The image manifest associated with the image.
imageManifestMediaType
— (String
)The manifest media type of the image.
failures
— (Array<map>
)Any failures associated with the call.
imageId
— (map
)The image ID associated with the failure.
imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
failureCode
— (String
)The code associated with the failure.
Possible values include:"InvalidImageDigest"
"InvalidImageTag"
"ImageTagDoesNotMatchDigest"
"ImageNotFound"
"MissingDigestAndTag"
"ImageReferencedByManifestList"
"KmsError"
failureReason
— (String
)The reason for the failure.
-
(AWS.Response)
—
Returns:
completeLayerUpload(params = {}, callback) ⇒ AWS.Request
Informs Amazon ECR that the image layer upload has completed for a specified registry, repository name, and upload ID. You can optionally provide a sha256
digest of the image layer for data validation purposes.
When an image is pushed, the CompleteLayerUpload API is called once per each new image layer to verify that the upload has completed.
docker
CLI to pull, tag, and push images. Service Reference:
Examples:
Calling the completeLayerUpload operation
var params = {
layerDigests: [ /* required */
'STRING_VALUE',
/* more items */
],
repositoryName: 'STRING_VALUE', /* required */
uploadId: 'STRING_VALUE', /* required */
registryId: 'STRING_VALUE'
};
ecr.completeLayerUpload(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry to which to upload layers. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository to associate with the image layer.
uploadId
— (String
)The upload ID from a previous InitiateLayerUpload operation to associate with the image layer.
layerDigests
— (Array<String>
)The
sha256
digest of the image layer.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
repositoryName
— (String
)The repository name associated with the request.
uploadId
— (String
)The upload ID associated with the layer.
layerDigest
— (String
)The
sha256
digest of the image layer.
-
(AWS.Response)
—
Returns:
createRepository(params = {}, callback) ⇒ AWS.Request
Creates a repository. For more information, see Amazon ECR Repositories in the Amazon Elastic Container Registry User Guide.
Service Reference:
Examples:
To create a new repository
/* This example creates a repository called nginx-web-app inside the project-a namespace in the default registry for an account. */
var params = {
repositoryName: "project-a/nginx-web-app"
};
ecr.createRepository(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
/*
data = {
repository: {
registryId: "012345678901",
repositoryArn: "arn:aws:ecr:us-west-2:012345678901:repository/project-a/nginx-web-app",
repositoryName: "project-a/nginx-web-app"
}
}
*/
});
Calling the createRepository operation
var params = {
repositoryName: 'STRING_VALUE', /* required */
encryptionConfiguration: {
encryptionType: AES256 | KMS, /* required */
kmsKey: 'STRING_VALUE'
},
imageScanningConfiguration: {
scanOnPush: true || false
},
imageTagMutability: MUTABLE | IMMUTABLE,
tags: [
{
Key: 'STRING_VALUE',
Value: 'STRING_VALUE'
},
/* more items */
]
};
ecr.createRepository(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
repositoryName
— (String
)The name to use for the repository. The repository name may be specified on its own (such as
nginx-web-app
) or it can be prepended with a namespace to group the repository into a category (such asproject-a/nginx-web-app
).tags
— (Array<map>
)The metadata that you apply to the repository to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
Key
— (String
)One part of a key-value pair that make up a tag. A
key
is a general label that acts like a category for more specific tag values.Value
— (String
)The optional part of a key-value pair that make up a tag. A
value
acts as a descriptor within a tag category (key).
imageTagMutability
— (String
)The tag mutability setting for the repository. If this parameter is omitted, the default setting of
Possible values include:MUTABLE
will be used which will allow image tags to be overwritten. IfIMMUTABLE
is specified, all image tags within the repository will be immutable which will prevent them from being overwritten."MUTABLE"
"IMMUTABLE"
imageScanningConfiguration
— (map
)The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
scanOnPush
— (Boolean
)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 tofalse
and images will not be scanned unless a scan is manually started with the StartImageScan API.
encryptionConfiguration
— (map
)The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.
encryptionType
— required — (String
)The encryption type to use.
If you use the
KMS
encryption type, the contents of the repository will be encrypted using server-side encryption with customer master keys (CMKs) stored in AWS KMS. When you use AWS KMS to encrypt your data, you can either use the default AWS managed CMK for Amazon ECR, or specify your own CMK, which you already created. For more information, see Protecting Data Using Server-Side Encryption with CMKs Stored in AWS Key Management Service (SSE-KMS) in the Amazon Simple Storage Service Console Developer Guide..If you use the
Possible values include:AES256
encryption type, Amazon ECR uses server-side encryption with Amazon S3-managed encryption keys which encrypts the images in the repository using an AES-256 encryption algorithm. For more information, see Protecting Data Using Server-Side Encryption with Amazon S3-Managed Encryption Keys (SSE-S3) in the Amazon Simple Storage Service Console Developer Guide.."AES256"
"KMS"
kmsKey
— (String
)If you use the
KMS
encryption type, specify the CMK to use for encryption. The alias, key ID, or full ARN of the CMK can be specified. The key must exist in the same Region as the repository. If no key is specified, the default AWS managed CMK for Amazon ECR will be used.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:repository
— (map
)The repository that was created.
repositoryArn
— (String
)The Amazon Resource Name (ARN) that identifies the repository. The ARN contains the
arn:aws:ecr
namespace, followed by the region of the repository, AWS account ID of the repository owner, repository namespace, and repository name. For example,arn:aws:ecr:region:012345678910:repository/test
.registryId
— (String
)The AWS account ID associated with the registry that contains the repository.
repositoryName
— (String
)The name of the repository.
repositoryUri
— (String
)The URI for the repository. You can use this URI for container image
push
andpull
operations.createdAt
— (Date
)The date and time, in JavaScript date format, when the repository was created.
imageTagMutability
— (String
)The tag mutability setting for the repository.
Possible values include:"MUTABLE"
"IMMUTABLE"
imageScanningConfiguration
— (map
)The image scanning configuration for a repository.
scanOnPush
— (Boolean
)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 tofalse
and images will not be scanned unless a scan is manually started with the StartImageScan API.
encryptionConfiguration
— (map
)The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.
encryptionType
— required — (String
)The encryption type to use.
If you use the
KMS
encryption type, the contents of the repository will be encrypted using server-side encryption with customer master keys (CMKs) stored in AWS KMS. When you use AWS KMS to encrypt your data, you can either use the default AWS managed CMK for Amazon ECR, or specify your own CMK, which you already created. For more information, see Protecting Data Using Server-Side Encryption with CMKs Stored in AWS Key Management Service (SSE-KMS) in the Amazon Simple Storage Service Console Developer Guide..If you use the
Possible values include:AES256
encryption type, Amazon ECR uses server-side encryption with Amazon S3-managed encryption keys which encrypts the images in the repository using an AES-256 encryption algorithm. For more information, see Protecting Data Using Server-Side Encryption with Amazon S3-Managed Encryption Keys (SSE-S3) in the Amazon Simple Storage Service Console Developer Guide.."AES256"
"KMS"
kmsKey
— (String
)If you use the
KMS
encryption type, specify the CMK to use for encryption. The alias, key ID, or full ARN of the CMK can be specified. The key must exist in the same Region as the repository. If no key is specified, the default AWS managed CMK for Amazon ECR will be used.
-
(AWS.Response)
—
Returns:
deleteLifecyclePolicy(params = {}, callback) ⇒ AWS.Request
Deletes the lifecycle policy associated with the specified repository.
Service Reference:
Examples:
Calling the deleteLifecyclePolicy operation
var params = {
repositoryName: 'STRING_VALUE', /* required */
registryId: 'STRING_VALUE'
};
ecr.deleteLifecyclePolicy(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
repositoryName
— (String
)The repository name associated with the request.
lifecyclePolicyText
— (String
)The JSON lifecycle policy text.
lastEvaluatedAt
— (Date
)The time stamp of the last time that the lifecycle policy was run.
-
(AWS.Response)
—
Returns:
deleteRegistryPolicy(params = {}, callback) ⇒ AWS.Request
Deletes the registry permissions policy.
Service Reference:
Examples:
Calling the deleteRegistryPolicy operation
var params = {
};
ecr.deleteRegistryPolicy(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
- params (Object) (defaults to: {})
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
policyText
— (String
)The contents of the registry permissions policy that was deleted.
-
(AWS.Response)
—
Returns:
deleteRepository(params = {}, callback) ⇒ AWS.Request
Deletes a repository. If the repository contains images, you must either delete all images in the repository or use the force
option to delete the repository.
Service Reference:
Examples:
To force delete a repository
/* This example force deletes a repository named ubuntu in the default registry for an account. The force parameter is required if the repository contains images. */
var params = {
force: true,
repositoryName: "ubuntu"
};
ecr.deleteRepository(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
/*
data = {
repository: {
registryId: "012345678901",
repositoryArn: "arn:aws:ecr:us-west-2:012345678901:repository/ubuntu",
repositoryName: "ubuntu"
}
}
*/
});
Calling the deleteRepository operation
var params = {
repositoryName: 'STRING_VALUE', /* required */
force: true || false,
registryId: 'STRING_VALUE'
};
ecr.deleteRepository(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository to delete. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository to delete.
force
— (Boolean
)If a repository contains images, forces the deletion.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:repository
— (map
)The repository that was deleted.
repositoryArn
— (String
)The Amazon Resource Name (ARN) that identifies the repository. The ARN contains the
arn:aws:ecr
namespace, followed by the region of the repository, AWS account ID of the repository owner, repository namespace, and repository name. For example,arn:aws:ecr:region:012345678910:repository/test
.registryId
— (String
)The AWS account ID associated with the registry that contains the repository.
repositoryName
— (String
)The name of the repository.
repositoryUri
— (String
)The URI for the repository. You can use this URI for container image
push
andpull
operations.createdAt
— (Date
)The date and time, in JavaScript date format, when the repository was created.
imageTagMutability
— (String
)The tag mutability setting for the repository.
Possible values include:"MUTABLE"
"IMMUTABLE"
imageScanningConfiguration
— (map
)The image scanning configuration for a repository.
scanOnPush
— (Boolean
)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 tofalse
and images will not be scanned unless a scan is manually started with the StartImageScan API.
encryptionConfiguration
— (map
)The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.
encryptionType
— required — (String
)The encryption type to use.
If you use the
KMS
encryption type, the contents of the repository will be encrypted using server-side encryption with customer master keys (CMKs) stored in AWS KMS. When you use AWS KMS to encrypt your data, you can either use the default AWS managed CMK for Amazon ECR, or specify your own CMK, which you already created. For more information, see Protecting Data Using Server-Side Encryption with CMKs Stored in AWS Key Management Service (SSE-KMS) in the Amazon Simple Storage Service Console Developer Guide..If you use the
Possible values include:AES256
encryption type, Amazon ECR uses server-side encryption with Amazon S3-managed encryption keys which encrypts the images in the repository using an AES-256 encryption algorithm. For more information, see Protecting Data Using Server-Side Encryption with Amazon S3-Managed Encryption Keys (SSE-S3) in the Amazon Simple Storage Service Console Developer Guide.."AES256"
"KMS"
kmsKey
— (String
)If you use the
KMS
encryption type, specify the CMK to use for encryption. The alias, key ID, or full ARN of the CMK can be specified. The key must exist in the same Region as the repository. If no key is specified, the default AWS managed CMK for Amazon ECR will be used.
-
(AWS.Response)
—
Returns:
deleteRepositoryPolicy(params = {}, callback) ⇒ AWS.Request
Deletes the repository policy associated with the specified repository.
Service Reference:
Examples:
To delete the policy associated with a repository
/* This example deletes the policy associated with the repository named ubuntu in the current account. */
var params = {
repositoryName: "ubuntu"
};
ecr.deleteRepositoryPolicy(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
/*
data = {
policyText: "{ ... }",
registryId: "012345678901",
repositoryName: "ubuntu"
}
*/
});
Calling the deleteRepositoryPolicy operation
var params = {
repositoryName: 'STRING_VALUE', /* required */
registryId: 'STRING_VALUE'
};
ecr.deleteRepositoryPolicy(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository policy to delete. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository that is associated with the repository policy to delete.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
repositoryName
— (String
)The repository name associated with the request.
policyText
— (String
)The JSON repository policy that was deleted from the repository.
-
(AWS.Response)
—
Returns:
describeImages(params = {}, callback) ⇒ AWS.Request
Returns metadata about the images in a repository.
docker images
command shows the uncompressed image size, so it may return a larger image size than the image sizes returned by DescribeImages. Service Reference:
Examples:
Calling the describeImages operation
var params = {
repositoryName: 'STRING_VALUE', /* required */
filter: {
tagStatus: TAGGED | UNTAGGED | ANY
},
imageIds: [
{
imageDigest: 'STRING_VALUE',
imageTag: 'STRING_VALUE'
},
/* more items */
],
maxResults: 'NUMBER_VALUE',
nextToken: 'STRING_VALUE',
registryId: 'STRING_VALUE'
};
ecr.describeImages(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository in which to describe images. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The repository that contains the images to describe.
imageIds
— (Array<map>
)The list of image IDs for the requested repository.
imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
nextToken
— (String
)The
nextToken
value returned from a previous paginatedDescribeImages
request wheremaxResults
was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned thenextToken
value. This value isnull
when there are no more results to return. This option cannot be used when you specify images withimageIds
.maxResults
— (Integer
)The maximum number of repository results returned by
DescribeImages
in paginated output. When this parameter is used,DescribeImages
only returnsmaxResults
results in a single page along with anextToken
response element. The remaining results of the initial request can be seen by sending anotherDescribeImages
request with the returnednextToken
value. This value can be between 1 and 1000. If this parameter is not used, thenDescribeImages
returns up to 100 results and anextToken
value, if applicable. This option cannot be used when you specify images withimageIds
.filter
— (map
)The filter key and value with which to filter your
DescribeImages
results.tagStatus
— (String
)The tag status with which to filter your DescribeImages results. You can filter results based on whether they are
Possible values include:TAGGED
orUNTAGGED
."TAGGED"
"UNTAGGED"
"ANY"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:imageDetails
— (Array<map>
)A list of ImageDetail objects that contain data about the image.
registryId
— (String
)The AWS account ID associated with the registry to which this image belongs.
repositoryName
— (String
)The name of the repository to which this image belongs.
imageDigest
— (String
)The
sha256
digest of the image manifest.imageTags
— (Array<String>
)The list of tags associated with this image.
imageSizeInBytes
— (Integer
)The size, in bytes, of the image in the repository.
If the image is a manifest list, this will be the max size of all manifests in the list.
Note: Beginning with Docker version 1.9, the Docker client compresses image layers before pushing them to a V2 Docker registry. The output of thedocker images
command shows the uncompressed image size, so it may return a larger image size than the image sizes returned by DescribeImages.imagePushedAt
— (Date
)The date and time, expressed in standard JavaScript date format, at which the current image was pushed to the repository.
imageScanStatus
— (map
)The current state of the scan.
status
— (String
)The current state of an image scan.
Possible values include:"IN_PROGRESS"
"COMPLETE"
"FAILED"
description
— (String
)The description of the image scan status.
imageScanFindingsSummary
— (map
)A summary of the last completed image scan.
imageScanCompletedAt
— (Date
)The time of the last completed image scan.
vulnerabilitySourceUpdatedAt
— (Date
)The time when the vulnerability data was last scanned.
findingSeverityCounts
— (map<Integer>
)The image vulnerability counts, sorted by severity.
imageManifestMediaType
— (String
)The media type of the image manifest.
artifactMediaType
— (String
)The artifact media type of the image.
nextToken
— (String
)The
nextToken
value to include in a futureDescribeImages
request. When the results of aDescribeImages
request exceedmaxResults
, this value can be used to retrieve the next page of results. This value isnull
when there are no more results to return.
-
(AWS.Response)
—
Returns:
describeImageScanFindings(params = {}, callback) ⇒ AWS.Request
Returns the scan findings for the specified image.
Service Reference:
Examples:
Calling the describeImageScanFindings operation
var params = {
imageId: { /* required */
imageDigest: 'STRING_VALUE',
imageTag: 'STRING_VALUE'
},
repositoryName: 'STRING_VALUE', /* required */
maxResults: 'NUMBER_VALUE',
nextToken: 'STRING_VALUE',
registryId: 'STRING_VALUE'
};
ecr.describeImageScanFindings(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository in which to describe the image scan findings for. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The repository for the image for which to describe the scan findings.
imageId
— (map
)An object with identifying information for an Amazon ECR image.
imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
nextToken
— (String
)The
nextToken
value returned from a previous paginatedDescribeImageScanFindings
request wheremaxResults
was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned thenextToken
value. This value is null when there are no more results to return.maxResults
— (Integer
)The maximum number of image scan results returned by
DescribeImageScanFindings
in paginated output. When this parameter is used,DescribeImageScanFindings
only returnsmaxResults
results in a single page along with anextToken
response element. The remaining results of the initial request can be seen by sending anotherDescribeImageScanFindings
request with the returnednextToken
value. This value can be between 1 and 1000. If this parameter is not used, thenDescribeImageScanFindings
returns up to 100 results and anextToken
value, if applicable.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
repositoryName
— (String
)The repository name associated with the request.
imageId
— (map
)An object with identifying information for an Amazon ECR image.
imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
imageScanStatus
— (map
)The current state of the scan.
status
— (String
)The current state of an image scan.
Possible values include:"IN_PROGRESS"
"COMPLETE"
"FAILED"
description
— (String
)The description of the image scan status.
imageScanFindings
— (map
)The information contained in the image scan findings.
imageScanCompletedAt
— (Date
)The time of the last completed image scan.
vulnerabilitySourceUpdatedAt
— (Date
)The time when the vulnerability data was last scanned.
findings
— (Array<map>
)The findings from the image scan.
name
— (String
)The name associated with the finding, usually a CVE number.
description
— (String
)The description of the finding.
uri
— (String
)A link containing additional details about the security vulnerability.
severity
— (String
)The finding severity.
Possible values include:"INFORMATIONAL"
"LOW"
"MEDIUM"
"HIGH"
"CRITICAL"
"UNDEFINED"
attributes
— (Array<map>
)A collection of attributes of the host from which the finding is generated.
key
— required — (String
)The attribute key.
value
— (String
)The value assigned to the attribute key.
findingSeverityCounts
— (map<Integer>
)The image vulnerability counts, sorted by severity.
nextToken
— (String
)The
nextToken
value to include in a futureDescribeImageScanFindings
request. When the results of aDescribeImageScanFindings
request exceedmaxResults
, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.
-
(AWS.Response)
—
Returns:
Waiter Resource States:
describeRegistry(params = {}, callback) ⇒ AWS.Request
Describes the settings for a registry. The replication configuration for a repository can be created or updated with the PutReplicationConfiguration API action.
Service Reference:
Examples:
Calling the describeRegistry operation
var params = {
};
ecr.describeRegistry(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
- params (Object) (defaults to: {})
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The ID of the registry.
replicationConfiguration
— (map
)The replication configuration for the registry.
rules
— required — (Array<map>
)An array of objects representing the replication rules for a replication configuration. A replication configuration may contain only one replication rule but the rule may contain one or more replication destinations.
destinations
— required — (Array<map>
)An array of objects representing the details of a replication destination.
region
— required — (String
)A Region to replicate to.
registryId
— required — (String
)The account ID of the destination registry to replicate to.
-
(AWS.Response)
—
Returns:
describeRepositories(params = {}, callback) ⇒ AWS.Request
Describes image repositories in a registry.
Service Reference:
Examples:
To describe all repositories in the current account
/* The following example obtains a list and description of all repositories in the default registry to which the current user has access. */
var params = {
};
ecr.describeRepositories(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
/*
data = {
repositories: [
{
registryId: "012345678910",
repositoryArn: "arn:aws:ecr:us-west-2:012345678910:repository/ubuntu",
repositoryName: "ubuntu"
},
{
registryId: "012345678910",
repositoryArn: "arn:aws:ecr:us-west-2:012345678910:repository/test",
repositoryName: "test"
}
]
}
*/
});
Calling the describeRepositories operation
var params = {
maxResults: 'NUMBER_VALUE',
nextToken: 'STRING_VALUE',
registryId: 'STRING_VALUE',
repositoryNames: [
'STRING_VALUE',
/* more items */
]
};
ecr.describeRepositories(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS 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
— (Array<String>
)A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.
nextToken
— (String
)The
nextToken
value returned from a previous paginatedDescribeRepositories
request wheremaxResults
was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned thenextToken
value. This value isnull
when there are no more results to return. This option cannot be used when you specify repositories withrepositoryNames
.Note: This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.maxResults
— (Integer
)The maximum number of repository results returned by
DescribeRepositories
in paginated output. When this parameter is used,DescribeRepositories
only returnsmaxResults
results in a single page along with anextToken
response element. The remaining results of the initial request can be seen by sending anotherDescribeRepositories
request with the returnednextToken
value. This value can be between 1 and 1000. If this parameter is not used, thenDescribeRepositories
returns up to 100 results and anextToken
value, if applicable. This option cannot be used when you specify repositories withrepositoryNames
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:repositories
— (Array<map>
)A list of repository objects corresponding to valid repositories.
repositoryArn
— (String
)The Amazon Resource Name (ARN) that identifies the repository. The ARN contains the
arn:aws:ecr
namespace, followed by the region of the repository, AWS account ID of the repository owner, repository namespace, and repository name. For example,arn:aws:ecr:region:012345678910:repository/test
.registryId
— (String
)The AWS account ID associated with the registry that contains the repository.
repositoryName
— (String
)The name of the repository.
repositoryUri
— (String
)The URI for the repository. You can use this URI for container image
push
andpull
operations.createdAt
— (Date
)The date and time, in JavaScript date format, when the repository was created.
imageTagMutability
— (String
)The tag mutability setting for the repository.
Possible values include:"MUTABLE"
"IMMUTABLE"
imageScanningConfiguration
— (map
)The image scanning configuration for a repository.
scanOnPush
— (Boolean
)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 tofalse
and images will not be scanned unless a scan is manually started with the StartImageScan API.
encryptionConfiguration
— (map
)The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.
encryptionType
— required — (String
)The encryption type to use.
If you use the
KMS
encryption type, the contents of the repository will be encrypted using server-side encryption with customer master keys (CMKs) stored in AWS KMS. When you use AWS KMS to encrypt your data, you can either use the default AWS managed CMK for Amazon ECR, or specify your own CMK, which you already created. For more information, see Protecting Data Using Server-Side Encryption with CMKs Stored in AWS Key Management Service (SSE-KMS) in the Amazon Simple Storage Service Console Developer Guide..If you use the
Possible values include:AES256
encryption type, Amazon ECR uses server-side encryption with Amazon S3-managed encryption keys which encrypts the images in the repository using an AES-256 encryption algorithm. For more information, see Protecting Data Using Server-Side Encryption with Amazon S3-Managed Encryption Keys (SSE-S3) in the Amazon Simple Storage Service Console Developer Guide.."AES256"
"KMS"
kmsKey
— (String
)If you use the
KMS
encryption type, specify the CMK to use for encryption. The alias, key ID, or full ARN of the CMK can be specified. The key must exist in the same Region as the repository. If no key is specified, the default AWS managed CMK for Amazon ECR will be used.
nextToken
— (String
)The
nextToken
value to include in a futureDescribeRepositories
request. When the results of aDescribeRepositories
request exceedmaxResults
, this value can be used to retrieve the next page of results. This value isnull
when there are no more results to return.
-
(AWS.Response)
—
Returns:
getAuthorizationToken(params = {}, callback) ⇒ AWS.Request
Retrieves an authorization token. An authorization token represents your IAM authentication credentials and can be used to access any Amazon ECR registry that your IAM principal has access to. The authorization token is valid for 12 hours.
The authorizationToken
returned is a base64 encoded string that can be decoded and used in a docker login
command to authenticate to a registry. The AWS CLI offers an get-login-password
command that simplifies the login process. For more information, see Registry Authentication in the Amazon Elastic Container Registry User Guide.
Service Reference:
Examples:
To obtain an authorization token
/* This example gets an authorization token for your default registry. */
var params = {
};
ecr.getAuthorizationToken(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
/*
data = {
authorizationData: [
{
authorizationToken: "QVdTOkN...",
expiresAt: <Date Representation>,
proxyEndpoint: "https://012345678901.dkr.ecr.us-west-2.amazonaws.com"
}
]
}
*/
});
Calling the getAuthorizationToken operation
var params = {
registryIds: [
'STRING_VALUE',
/* more items */
]
};
ecr.getAuthorizationToken(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryIds
— (Array<String>
)A list of AWS account IDs that are associated with the registries for which to get AuthorizationData objects. If you do not specify a registry, the default registry is assumed.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:authorizationData
— (Array<map>
)A list of authorization token data objects that correspond to the
registryIds
values in the request.authorizationToken
— (String
)A base64-encoded string that contains authorization data for the specified Amazon ECR registry. When the string is decoded, it is presented in the format
user:password
for private registry authentication usingdocker login
.expiresAt
— (Date
)The Unix time in seconds and milliseconds when the authorization token expires. Authorization tokens are valid for 12 hours.
proxyEndpoint
— (String
)The registry URL to use for this authorization token in a
docker login
command. The Amazon ECR registry URL format ishttps://aws_account_id.dkr.ecr.region.amazonaws.com
. For example,https://012345678910.dkr.ecr.us-east-1.amazonaws.com
..
-
(AWS.Response)
—
Returns:
getDownloadUrlForLayer(params = {}, callback) ⇒ AWS.Request
Retrieves the pre-signed Amazon S3 download URL corresponding to an image layer. You can only get URLs for image layers that are referenced in an image.
When an image is pulled, the GetDownloadUrlForLayer API is called once per image layer that is not already cached.
docker
CLI to pull, tag, and push images. Service Reference:
Examples:
Calling the getDownloadUrlForLayer operation
var params = {
layerDigest: 'STRING_VALUE', /* required */
repositoryName: 'STRING_VALUE', /* required */
registryId: 'STRING_VALUE'
};
ecr.getDownloadUrlForLayer(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the image layer to download. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository that is associated with the image layer to download.
layerDigest
— (String
)The digest of the image layer to download.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:downloadUrl
— (String
)The pre-signed Amazon S3 download URL for the requested layer.
layerDigest
— (String
)The digest of the image layer to download.
-
(AWS.Response)
—
Returns:
getLifecyclePolicy(params = {}, callback) ⇒ AWS.Request
Retrieves the lifecycle policy for the specified repository.
Service Reference:
Examples:
Calling the getLifecyclePolicy operation
var params = {
repositoryName: 'STRING_VALUE', /* required */
registryId: 'STRING_VALUE'
};
ecr.getLifecyclePolicy(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
repositoryName
— (String
)The repository name associated with the request.
lifecyclePolicyText
— (String
)The JSON lifecycle policy text.
lastEvaluatedAt
— (Date
)The time stamp of the last time that the lifecycle policy was run.
-
(AWS.Response)
—
Returns:
getLifecyclePolicyPreview(params = {}, callback) ⇒ AWS.Request
Retrieves the results of the lifecycle policy preview request for the specified repository.
Service Reference:
Examples:
Calling the getLifecyclePolicyPreview operation
var params = {
repositoryName: 'STRING_VALUE', /* required */
filter: {
tagStatus: TAGGED | UNTAGGED | ANY
},
imageIds: [
{
imageDigest: 'STRING_VALUE',
imageTag: 'STRING_VALUE'
},
/* more items */
],
maxResults: 'NUMBER_VALUE',
nextToken: 'STRING_VALUE',
registryId: 'STRING_VALUE'
};
ecr.getLifecyclePolicyPreview(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository.
imageIds
— (Array<map>
)The list of imageIDs to be included.
imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
nextToken
— (String
)The
nextToken
value returned from a previous paginatedGetLifecyclePolicyPreviewRequest
request wheremaxResults
was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned thenextToken
value. This value isnull
when there are no more results to return. This option cannot be used when you specify images withimageIds
.maxResults
— (Integer
)The maximum number of repository results returned by
GetLifecyclePolicyPreviewRequest
in paginated output. When this parameter is used,GetLifecyclePolicyPreviewRequest
only returnsmaxResults
results in a single page along with anextToken
response element. The remaining results of the initial request can be seen by sending anotherGetLifecyclePolicyPreviewRequest
request with the returnednextToken
value. This value can be between 1 and 1000. If this parameter is not used, thenGetLifecyclePolicyPreviewRequest
returns up to 100 results and anextToken
value, if applicable. This option cannot be used when you specify images withimageIds
.filter
— (map
)An optional parameter that filters results based on image tag status and all tags, if tagged.
tagStatus
— (String
)The tag status of the image.
Possible values include:"TAGGED"
"UNTAGGED"
"ANY"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
repositoryName
— (String
)The repository name associated with the request.
lifecyclePolicyText
— (String
)The JSON lifecycle policy text.
status
— (String
)The status of the lifecycle policy preview request.
Possible values include:"IN_PROGRESS"
"COMPLETE"
"EXPIRED"
"FAILED"
nextToken
— (String
)The
nextToken
value to include in a futureGetLifecyclePolicyPreview
request. When the results of aGetLifecyclePolicyPreview
request exceedmaxResults
, this value can be used to retrieve the next page of results. This value isnull
when there are no more results to return.previewResults
— (Array<map>
)The results of the lifecycle policy preview request.
imageTags
— (Array<String>
)The list of tags associated with this image.
imageDigest
— (String
)The
sha256
digest of the image manifest.imagePushedAt
— (Date
)The date and time, expressed in standard JavaScript date format, at which the current image was pushed to the repository.
action
— (map
)The type of action to be taken.
type
— (String
)The type of action to be taken.
Possible values include:"EXPIRE"
appliedRulePriority
— (Integer
)The priority of the applied rule.
summary
— (map
)The list of images that is returned as a result of the action.
expiringImageTotalCount
— (Integer
)The number of expiring images.
-
(AWS.Response)
—
Returns:
Waiter Resource States:
getRegistryPolicy(params = {}, callback) ⇒ AWS.Request
Retrieves the permissions policy for a registry.
Service Reference:
Examples:
Calling the getRegistryPolicy operation
var params = {
};
ecr.getRegistryPolicy(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
- params (Object) (defaults to: {})
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The ID of the registry.
policyText
— (String
)The JSON text of the permissions policy for a registry.
-
(AWS.Response)
—
Returns:
getRepositoryPolicy(params = {}, callback) ⇒ AWS.Request
Retrieves the repository policy for the specified repository.
Service Reference:
Examples:
To get the current policy for a repository
/* This example obtains the repository policy for the repository named ubuntu. */
var params = {
repositoryName: "ubuntu"
};
ecr.getRepositoryPolicy(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
/*
data = {
policyText: "{\n \"Version\" : \"2008-10-17\",\n \"Statement\" : [ {\n \"Sid\" : \"new statement\",\n \"Effect\" : \"Allow\",\n \"Principal\" : {\n \"AWS\" : \"arn:aws:iam::012345678901:role/CodeDeployDemo\"\n },\n\"Action\" : [ \"ecr:GetDownloadUrlForLayer\", \"ecr:BatchGetImage\", \"ecr:BatchCheckLayerAvailability\" ]\n } ]\n}",
registryId: "012345678901",
repositoryName: "ubuntu"
}
*/
});
Calling the getRepositoryPolicy operation
var params = {
repositoryName: 'STRING_VALUE', /* required */
registryId: 'STRING_VALUE'
};
ecr.getRepositoryPolicy(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository with the policy to retrieve.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
repositoryName
— (String
)The repository name associated with the request.
policyText
— (String
)The JSON repository policy text associated with the repository.
-
(AWS.Response)
—
Returns:
initiateLayerUpload(params = {}, callback) ⇒ AWS.Request
Notifies Amazon ECR that you intend to upload an image layer.
When an image is pushed, the InitiateLayerUpload API is called once per image layer that has not already been uploaded. Whether or not an image layer has been uploaded is determined by the BatchCheckLayerAvailability API action.
docker
CLI to pull, tag, and push images. Service Reference:
Examples:
Calling the initiateLayerUpload operation
var params = {
repositoryName: 'STRING_VALUE', /* required */
registryId: 'STRING_VALUE'
};
ecr.initiateLayerUpload(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry to which you intend to upload layers. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository to which you intend to upload layers.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:uploadId
— (String
)The upload ID for the layer upload. This parameter is passed to further UploadLayerPart and CompleteLayerUpload operations.
partSize
— (Integer
)The size, in bytes, that Amazon ECR expects future layer part uploads to be.
-
(AWS.Response)
—
Returns:
listImages(params = {}, callback) ⇒ AWS.Request
Lists all the image IDs for the specified repository.
You can filter images based on whether or not they are tagged by using the tagStatus
filter and specifying either TAGGED
, UNTAGGED
or ANY
. For example, you can filter your results to return only UNTAGGED
images and then pipe that result to a BatchDeleteImage operation to delete them. Or, you can filter your results to return only TAGGED
images to list all of the tags in your repository.
Service Reference:
Examples:
To list all images in a repository
/* This example lists all of the images in the repository named ubuntu in the default registry in the current account. */
var params = {
repositoryName: "ubuntu"
};
ecr.listImages(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
/*
data = {
imageIds: [
{
imageDigest: "sha256:764f63476bdff6d83a09ba2a818f0d35757063724a9ac3ba5019c56f74ebf42a",
imageTag: "precise"
}
]
}
*/
});
Calling the listImages operation
var params = {
repositoryName: 'STRING_VALUE', /* required */
filter: {
tagStatus: TAGGED | UNTAGGED | ANY
},
maxResults: 'NUMBER_VALUE',
nextToken: 'STRING_VALUE',
registryId: 'STRING_VALUE'
};
ecr.listImages(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS 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.
repositoryName
— (String
)The repository with image IDs to be listed.
nextToken
— (String
)The
nextToken
value returned from a previous paginatedListImages
request wheremaxResults
was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned thenextToken
value. This value isnull
when there are no more results to return.Note: This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.maxResults
— (Integer
)The maximum number of image results returned by
ListImages
in paginated output. When this parameter is used,ListImages
only returnsmaxResults
results in a single page along with anextToken
response element. The remaining results of the initial request can be seen by sending anotherListImages
request with the returnednextToken
value. This value can be between 1 and 1000. If this parameter is not used, thenListImages
returns up to 100 results and anextToken
value, if applicable.filter
— (map
)The filter key and value with which to filter your
ListImages
results.tagStatus
— (String
)The tag status with which to filter your ListImages results. You can filter results based on whether they are
Possible values include:TAGGED
orUNTAGGED
."TAGGED"
"UNTAGGED"
"ANY"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:imageIds
— (Array<map>
)The list of image IDs for the requested repository.
imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
nextToken
— (String
)The
nextToken
value to include in a futureListImages
request. When the results of aListImages
request exceedmaxResults
, this value can be used to retrieve the next page of results. This value isnull
when there are no more results to return.
-
(AWS.Response)
—
Returns:
listTagsForResource(params = {}, callback) ⇒ AWS.Request
List the tags for an Amazon ECR resource.
Service Reference:
Examples:
Calling the listTagsForResource operation
var params = {
resourceArn: 'STRING_VALUE' /* required */
};
ecr.listTagsForResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
resourceArn
— (String
)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.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:tags
— (Array<map>
)The tags for the resource.
Key
— (String
)One part of a key-value pair that make up a tag. A
key
is a general label that acts like a category for more specific tag values.Value
— (String
)The optional part of a key-value pair that make up a tag. A
value
acts as a descriptor within a tag category (key).
-
(AWS.Response)
—
Returns:
putImage(params = {}, callback) ⇒ AWS.Request
Creates or updates the image manifest and tags associated with an image.
When an image is pushed and all new image layers have been uploaded, the PutImage API is called once to create or update the image manifest and the tags associated with the image.
docker
CLI to pull, tag, and push images. Service Reference:
Examples:
Calling the putImage operation
var params = {
imageManifest: 'STRING_VALUE', /* required */
repositoryName: 'STRING_VALUE', /* required */
imageDigest: 'STRING_VALUE',
imageManifestMediaType: 'STRING_VALUE',
imageTag: 'STRING_VALUE',
registryId: 'STRING_VALUE'
};
ecr.putImage(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository in which to put the image. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository in which to put the image.
imageManifest
— (String
)The image manifest corresponding to the image to be uploaded.
imageManifestMediaType
— (String
)The media type of the image manifest. If you push an image manifest that does not contain the
mediaType
field, you must specify theimageManifestMediaType
in the request.imageTag
— (String
)The tag to associate with the image. This parameter is required for images that use the Docker Image Manifest V2 Schema 2 or Open Container Initiative (OCI) formats.
imageDigest
— (String
)The image digest of the image manifest corresponding to the image.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:image
— (map
)Details of the image uploaded.
registryId
— (String
)The AWS account ID associated with the registry containing the image.
repositoryName
— (String
)The name of the repository associated with the image.
imageId
— (map
)An object containing the image tag and image digest associated with an image.
imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
imageManifest
— (String
)The image manifest associated with the image.
imageManifestMediaType
— (String
)The manifest media type of the image.
-
(AWS.Response)
—
Returns:
putImageScanningConfiguration(params = {}, callback) ⇒ AWS.Request
Updates the image scanning configuration for the specified repository.
Service Reference:
Examples:
Calling the putImageScanningConfiguration operation
var params = {
imageScanningConfiguration: { /* required */
scanOnPush: true || false
},
repositoryName: 'STRING_VALUE', /* required */
registryId: 'STRING_VALUE'
};
ecr.putImageScanningConfiguration(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository in which to update the image scanning configuration setting. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository in which to update the image scanning configuration setting.
imageScanningConfiguration
— (map
)The image scanning configuration for the repository. This setting determines whether images are scanned for known vulnerabilities after being pushed to the repository.
scanOnPush
— (Boolean
)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 tofalse
and images will not be scanned unless a scan is manually started with the StartImageScan API.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
repositoryName
— (String
)The repository name associated with the request.
imageScanningConfiguration
— (map
)The image scanning configuration setting for the repository.
scanOnPush
— (Boolean
)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 tofalse
and images will not be scanned unless a scan is manually started with the StartImageScan API.
-
(AWS.Response)
—
Returns:
putImageTagMutability(params = {}, callback) ⇒ AWS.Request
Updates the image tag mutability settings for the specified repository. For more information, see Image Tag Mutability in the Amazon Elastic Container Registry User Guide.
Service Reference:
Examples:
Calling the putImageTagMutability operation
var params = {
imageTagMutability: MUTABLE | IMMUTABLE, /* required */
repositoryName: 'STRING_VALUE', /* required */
registryId: 'STRING_VALUE'
};
ecr.putImageTagMutability(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository in which to update the image tag mutability settings. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository in which to update the image tag mutability settings.
imageTagMutability
— (String
)The tag mutability setting for the repository. If
Possible values include:MUTABLE
is specified, image tags can be overwritten. IfIMMUTABLE
is specified, all image tags within the repository will be immutable which will prevent them from being overwritten."MUTABLE"
"IMMUTABLE"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
repositoryName
— (String
)The repository name associated with the request.
imageTagMutability
— (String
)The image tag mutability setting for the repository.
Possible values include:"MUTABLE"
"IMMUTABLE"
-
(AWS.Response)
—
Returns:
putLifecyclePolicy(params = {}, callback) ⇒ AWS.Request
Creates or updates the lifecycle policy for the specified repository. For more information, see Lifecycle Policy Template.
Service Reference:
Examples:
Calling the putLifecyclePolicy operation
var params = {
lifecyclePolicyText: 'STRING_VALUE', /* required */
repositoryName: 'STRING_VALUE', /* required */
registryId: 'STRING_VALUE'
};
ecr.putLifecyclePolicy(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository to receive the policy.
lifecyclePolicyText
— (String
)The JSON repository policy text to apply to the repository.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
repositoryName
— (String
)The repository name associated with the request.
lifecyclePolicyText
— (String
)The JSON repository policy text.
-
(AWS.Response)
—
Returns:
putRegistryPolicy(params = {}, callback) ⇒ AWS.Request
Creates or updates the permissions policy for your registry.
A registry policy is used to specify permissions for another AWS account and is used when configuring cross-account replication. For more information, see Registry permissions in the Amazon Elastic Container Registry User Guide.
Service Reference:
Examples:
Calling the putRegistryPolicy operation
var params = {
policyText: 'STRING_VALUE' /* required */
};
ecr.putRegistryPolicy(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
policyText
— (String
)The JSON policy text to apply to your registry. The policy text follows the same format as IAM policy text. For more information, see Registry permissions in the Amazon Elastic Container Registry User Guide.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID.
policyText
— (String
)The JSON policy text for your registry.
-
(AWS.Response)
—
Returns:
putReplicationConfiguration(params = {}, callback) ⇒ AWS.Request
Creates or updates the replication configuration for a registry. The existing replication configuration for a repository can be retrieved with the DescribeRegistry API action. The first time the PutReplicationConfiguration API is called, a service-linked IAM role is created in your account for the replication process. For more information, see Using Service-Linked Roles for Amazon ECR in the Amazon Elastic Container Registry User Guide.
Service Reference:
Examples:
Calling the putReplicationConfiguration operation
var params = {
replicationConfiguration: { /* required */
rules: [ /* required */
{
destinations: [ /* required */
{
region: 'STRING_VALUE', /* required */
registryId: 'STRING_VALUE' /* required */
},
/* more items */
]
},
/* more items */
]
}
};
ecr.putReplicationConfiguration(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
replicationConfiguration
— (map
)An object representing the replication configuration for a registry.
rules
— required — (Array<map>
)An array of objects representing the replication rules for a replication configuration. A replication configuration may contain only one replication rule but the rule may contain one or more replication destinations.
destinations
— required — (Array<map>
)An array of objects representing the details of a replication destination.
region
— required — (String
)A Region to replicate to.
registryId
— required — (String
)The account ID of the destination registry to replicate to.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:replicationConfiguration
— (map
)The contents of the replication configuration for the registry.
rules
— required — (Array<map>
)An array of objects representing the replication rules for a replication configuration. A replication configuration may contain only one replication rule but the rule may contain one or more replication destinations.
destinations
— required — (Array<map>
)An array of objects representing the details of a replication destination.
region
— required — (String
)A Region to replicate to.
registryId
— required — (String
)The account ID of the destination registry to replicate to.
-
(AWS.Response)
—
Returns:
setRepositoryPolicy(params = {}, callback) ⇒ AWS.Request
Applies a repository policy to the specified repository to control access permissions. For more information, see Amazon ECR Repository Policies in the Amazon Elastic Container Registry User Guide.
Service Reference:
Examples:
Calling the setRepositoryPolicy operation
var params = {
policyText: 'STRING_VALUE', /* required */
repositoryName: 'STRING_VALUE', /* required */
force: true || false,
registryId: 'STRING_VALUE'
};
ecr.setRepositoryPolicy(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository to receive the policy.
policyText
— (String
)The JSON repository policy text to apply to the repository. For more information, see Amazon ECR Repository Policies in the Amazon Elastic Container Registry User Guide.
force
— (Boolean
)If the policy you are attempting to set on a repository policy would prevent you from setting another policy in the future, you must force the SetRepositoryPolicy operation. This is intended to prevent accidental repository lock outs.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
repositoryName
— (String
)The repository name associated with the request.
policyText
— (String
)The JSON repository policy text applied to the repository.
-
(AWS.Response)
—
Returns:
startImageScan(params = {}, callback) ⇒ AWS.Request
Starts an image vulnerability scan. An image scan can only be started once per day on an individual image. This limit includes if an image was scanned on initial push. For more information, see Image Scanning in the Amazon Elastic Container Registry User Guide.
Service Reference:
Examples:
Calling the startImageScan operation
var params = {
imageId: { /* required */
imageDigest: 'STRING_VALUE',
imageTag: 'STRING_VALUE'
},
repositoryName: 'STRING_VALUE', /* required */
registryId: 'STRING_VALUE'
};
ecr.startImageScan(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository in which to start an image scan request. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository that contains the images to scan.
imageId
— (map
)An object with identifying information for an Amazon ECR image.
imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
repositoryName
— (String
)The repository name associated with the request.
imageId
— (map
)An object with identifying information for an Amazon ECR image.
imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
imageScanStatus
— (map
)The current state of the scan.
status
— (String
)The current state of an image scan.
Possible values include:"IN_PROGRESS"
"COMPLETE"
"FAILED"
description
— (String
)The description of the image scan status.
-
(AWS.Response)
—
Returns:
startLifecyclePolicyPreview(params = {}, callback) ⇒ AWS.Request
Starts a preview of a lifecycle policy for the specified repository. This allows you to see the results before associating the lifecycle policy with the repository.
Service Reference:
Examples:
Calling the startLifecyclePolicyPreview operation
var params = {
repositoryName: 'STRING_VALUE', /* required */
lifecyclePolicyText: 'STRING_VALUE',
registryId: 'STRING_VALUE'
};
ecr.startLifecyclePolicyPreview(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository to be evaluated.
lifecyclePolicyText
— (String
)The policy to be evaluated against. If you do not specify a policy, the current policy for the repository is used.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
repositoryName
— (String
)The repository name associated with the request.
lifecyclePolicyText
— (String
)The JSON repository policy text.
status
— (String
)The status of the lifecycle policy preview request.
Possible values include:"IN_PROGRESS"
"COMPLETE"
"EXPIRED"
"FAILED"
-
(AWS.Response)
—
Returns:
tagResource(params = {}, callback) ⇒ AWS.Request
Adds specified tags to a resource with the specified ARN. Existing tags on a resource are not changed if they are not specified in the request parameters.
Service Reference:
Examples:
Calling the tagResource operation
var params = {
resourceArn: 'STRING_VALUE', /* required */
tags: [ /* required */
{
Key: 'STRING_VALUE',
Value: 'STRING_VALUE'
},
/* more items */
]
};
ecr.tagResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
resourceArn
— (String
)The Amazon Resource Name (ARN) of the the resource to which to add tags. Currently, the only supported resource is an Amazon ECR repository.
tags
— (Array<map>
)The tags to add to the resource. A tag is an array of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
Key
— (String
)One part of a key-value pair that make up a tag. A
key
is a general label that acts like a category for more specific tag values.Value
— (String
)The optional part of a key-value pair that make up a tag. A
value
acts as a descriptor within a tag category (key).
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
untagResource(params = {}, callback) ⇒ AWS.Request
Deletes specified tags from a resource.
Service Reference:
Examples:
Calling the untagResource operation
var params = {
resourceArn: 'STRING_VALUE', /* required */
tagKeys: [ /* required */
'STRING_VALUE',
/* more items */
]
};
ecr.untagResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
resourceArn
— (String
)The Amazon Resource Name (ARN) of the resource from which to remove tags. Currently, the only supported resource is an Amazon ECR repository.
tagKeys
— (Array<String>
)The keys of the tags to be removed.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
uploadLayerPart(params = {}, callback) ⇒ AWS.Request
Uploads an image layer part to Amazon ECR.
When an image is pushed, each new image layer is uploaded in parts. The maximum size of each image layer part can be 20971520 bytes (or about 20MB). The UploadLayerPart API is called once per each new image layer part.
docker
CLI to pull, tag, and push images. Service Reference:
Examples:
Calling the uploadLayerPart operation
var params = {
layerPartBlob: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */, /* required */
partFirstByte: 'NUMBER_VALUE', /* required */
partLastByte: 'NUMBER_VALUE', /* required */
repositoryName: 'STRING_VALUE', /* required */
uploadId: 'STRING_VALUE', /* required */
registryId: 'STRING_VALUE'
};
ecr.uploadLayerPart(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
registryId
— (String
)The AWS account ID associated with the registry to which you are uploading layer parts. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository to which you are uploading layer parts.
uploadId
— (String
)The upload ID from a previous InitiateLayerUpload operation to associate with the layer part upload.
partFirstByte
— (Integer
)The position of the first byte of the layer part witin the overall image layer.
partLastByte
— (Integer
)The position of the last byte of the layer part within the overall image layer.
layerPartBlob
— (Buffer, Typed Array, Blob, String
)The base64-encoded layer part payload.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
repositoryName
— (String
)The repository name associated with the request.
uploadId
— (String
)The upload ID associated with the request.
lastByteReceived
— (Integer
)The integer value of the last byte received in the request.
-
(AWS.Response)
—
Returns:
waitFor(state, params = {}, callback) ⇒ AWS.Request
Waits for a given ECR resource. The final callback or 'complete' event will be fired only when the resource is either in its final state or the waiter has timed out and stopped polling for the final state.
Examples:
Waiting for the imageScanComplete state
var params = {
imageId: { /* required */
},
repositoryName: 'STRING_VALUE', /* required */
};
ecr.waitFor('imageScanComplete', params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
state
(String)
—
the resource state to wait for. Available states for this service are listed in "Waiter Resource States" below.
-
params
(map)
(defaults to: {})
—
a list of parameters for the given state. See each waiter resource state for required parameters.
Callback (callback):
-
function(err, data) { ... }
Callback containing error and data information. See the respective resource state for the expected error or data information.
If the waiter times out its requests, it will return a
ResourceNotReady
error.
Returns:
Waiter Resource States:
Waiter Resource Details
ecr.waitFor('imageScanComplete', params = {}, [callback]) ⇒ AWS.Request
Waits for the imageScanComplete
state by periodically calling the underlying
ECR.describeImageScanFindings() operation every 5 seconds
(at most 60 times).
Examples:
Waiting for the imageScanComplete state
var params = {
imageId: { /* required */
},
repositoryName: 'STRING_VALUE', /* required */
};
ecr.waitFor('imageScanComplete', params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository in which to describe the image scan findings for. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The repository for the image for which to describe the scan findings.
imageId
— (map
)An object with identifying information for an Amazon ECR image.
imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
nextToken
— (String
)The
nextToken
value returned from a previous paginatedDescribeImageScanFindings
request wheremaxResults
was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned thenextToken
value. This value is null when there are no more results to return.maxResults
— (Integer
)The maximum number of image scan results returned by
DescribeImageScanFindings
in paginated output. When this parameter is used,DescribeImageScanFindings
only returnsmaxResults
results in a single page along with anextToken
response element. The remaining results of the initial request can be seen by sending anotherDescribeImageScanFindings
request with the returnednextToken
value. This value can be between 1 and 1000. If this parameter is not used, thenDescribeImageScanFindings
returns up to 100 results and anextToken
value, if applicable.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
repositoryName
— (String
)The repository name associated with the request.
imageId
— (map
)An object with identifying information for an Amazon ECR image.
imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
imageScanStatus
— (map
)The current state of the scan.
status
— (String
)The current state of an image scan.
Possible values include:"IN_PROGRESS"
"COMPLETE"
"FAILED"
description
— (String
)The description of the image scan status.
imageScanFindings
— (map
)The information contained in the image scan findings.
imageScanCompletedAt
— (Date
)The time of the last completed image scan.
vulnerabilitySourceUpdatedAt
— (Date
)The time when the vulnerability data was last scanned.
findings
— (Array<map>
)The findings from the image scan.
name
— (String
)The name associated with the finding, usually a CVE number.
description
— (String
)The description of the finding.
uri
— (String
)A link containing additional details about the security vulnerability.
severity
— (String
)The finding severity.
Possible values include:"INFORMATIONAL"
"LOW"
"MEDIUM"
"HIGH"
"CRITICAL"
"UNDEFINED"
attributes
— (Array<map>
)A collection of attributes of the host from which the finding is generated.
key
— required — (String
)The attribute key.
value
— (String
)The value assigned to the attribute key.
findingSeverityCounts
— (map<Integer>
)The image vulnerability counts, sorted by severity.
nextToken
— (String
)The
nextToken
value to include in a futureDescribeImageScanFindings
request. When the results of aDescribeImageScanFindings
request exceedmaxResults
, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.
-
(AWS.Response)
—
Returns:
See Also:
ecr.waitFor('lifecyclePolicyPreviewComplete', params = {}, [callback]) ⇒ AWS.Request
Waits for the lifecyclePolicyPreviewComplete
state by periodically calling the underlying
ECR.getLifecyclePolicyPreview() operation every 5 seconds
(at most 20 times).
Examples:
Waiting for the lifecyclePolicyPreviewComplete state
var params = {
repositoryName: 'STRING_VALUE', /* required */
};
ecr.waitFor('lifecyclePolicyPreviewComplete', params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
—
registryId
— (String
)The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
repositoryName
— (String
)The name of the repository.
imageIds
— (Array<map>
)The list of imageIDs to be included.
imageDigest
— (String
)The
sha256
digest of the image manifest.imageTag
— (String
)The tag used for the image.
nextToken
— (String
)The
nextToken
value returned from a previous paginatedGetLifecyclePolicyPreviewRequest
request wheremaxResults
was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned thenextToken
value. This value isnull
when there are no more results to return. This option cannot be used when you specify images withimageIds
.maxResults
— (Integer
)The maximum number of repository results returned by
GetLifecyclePolicyPreviewRequest
in paginated output. When this parameter is used,GetLifecyclePolicyPreviewRequest
only returnsmaxResults
results in a single page along with anextToken
response element. The remaining results of the initial request can be seen by sending anotherGetLifecyclePolicyPreviewRequest
request with the returnednextToken
value. This value can be between 1 and 1000. If this parameter is not used, thenGetLifecyclePolicyPreviewRequest
returns up to 100 results and anextToken
value, if applicable. This option cannot be used when you specify images withimageIds
.filter
— (map
)An optional parameter that filters results based on image tag status and all tags, if tagged.
tagStatus
— (String
)The tag status of the image.
Possible values include:"TAGGED"
"UNTAGGED"
"ANY"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:registryId
— (String
)The registry ID associated with the request.
repositoryName
— (String
)The repository name associated with the request.
lifecyclePolicyText
— (String
)The JSON lifecycle policy text.
status
— (String
)The status of the lifecycle policy preview request.
Possible values include:"IN_PROGRESS"
"COMPLETE"
"EXPIRED"
"FAILED"
nextToken
— (String
)The
nextToken
value to include in a futureGetLifecyclePolicyPreview
request. When the results of aGetLifecyclePolicyPreview
request exceedmaxResults
, this value can be used to retrieve the next page of results. This value isnull
when there are no more results to return.previewResults
— (Array<map>
)The results of the lifecycle policy preview request.
imageTags
— (Array<String>
)The list of tags associated with this image.
imageDigest
— (String
)The
sha256
digest of the image manifest.imagePushedAt
— (Date
)The date and time, expressed in standard JavaScript date format, at which the current image was pushed to the repository.
action
— (map
)The type of action to be taken.
type
— (String
)The type of action to be taken.
Possible values include:"EXPIRE"
appliedRulePriority
— (Integer
)The priority of the applied rule.
summary
— (map
)The list of images that is returned as a result of the action.
expiringImageTotalCount
— (Integer
)The number of expiring images.
-
(AWS.Response)
—
Returns:
See Also: