@pulumi/awsx
Version:
[](https://github.com/pulumi/pulumi-awsx/actions) [](https://slack.pulumi.com) [;
exports.RegistryImage = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages the lifecycle of a docker image in a registry. You can upload images to a registry (= `docker push`) and also delete them again. In contrast to [`awsx.ecr.Image`](/registry/packages/awsx/api-docs/ecr/image/), this resource does not require to build the image, but can be used to push an existing image to an ECR repository. The image will be pushed whenever the source image changes or is updated.
*
* ## Example Usage
* ### Pushing an image to an ECR repository
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as awsx from "@pulumi/awsx";
*
* const repository = new awsx.ecr.Repository("repository", { forceDelete: true });
*
* const preTaggedImage = new awsx.ecr.RegistryImage("registry-image", {
* repositoryUrl: repository.url,
* sourceImage: "my-awesome-image:v1.0.0",
* });
* ```
*/
class RegistryImage extends pulumi.ComponentResource {
/**
* Returns true if the given object is an instance of RegistryImage. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === RegistryImage.__pulumiType;
}
/**
* Create a RegistryImage resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name, args, opts) {
let resourceInputs = {};
opts = opts || {};
if (!opts.id) {
if (args?.repositoryUrl === undefined && !opts.urn) {
throw new Error("Missing required property 'repositoryUrl'");
}
if (args?.sourceImage === undefined && !opts.urn) {
throw new Error("Missing required property 'sourceImage'");
}
resourceInputs["insecureSkipVerify"] = args?.insecureSkipVerify;
resourceInputs["keepRemotely"] = args?.keepRemotely;
resourceInputs["repositoryUrl"] = args?.repositoryUrl;
resourceInputs["sourceImage"] = args?.sourceImage;
resourceInputs["tag"] = args?.tag;
resourceInputs["triggers"] = args?.triggers;
resourceInputs["image"] = undefined /*out*/;
}
else {
resourceInputs["image"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RegistryImage.__pulumiType, name, resourceInputs, opts, true /*remote*/);
}
}
exports.RegistryImage = RegistryImage;
/** @internal */
RegistryImage.__pulumiType = 'awsx:ecr:RegistryImage';
//# sourceMappingURL=registryImage.js.map