"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.PullThroughCacheRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * The ``AWS::ECR::PullThroughCacheRule`` resource creates or updates a pull through cache rule. A pull through cache rule provides a way to cache images from an upstream registry in your Amazon ECR private registry.
 *
 * ## Example Usage
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const myECRPullThroughCacheRule = new aws_native.ecr.PullThroughCacheRule("myECRPullThroughCacheRule", {
 *     ecrRepositoryPrefix: "my-ecr",
 *     upstreamRegistryUrl: "public.ecr.aws",
 * });
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const myECRPullThroughCacheRule = new aws_native.ecr.PullThroughCacheRule("myECRPullThroughCacheRule", {
 *     ecrRepositoryPrefix: "my-ecr",
 *     upstreamRegistryUrl: "public.ecr.aws",
 * });
 *
 * ```
 */
class PullThroughCacheRule extends pulumi.CustomResource {
    /**
     * Get an existing PullThroughCacheRule resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, opts) {
        return new PullThroughCacheRule(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of PullThroughCacheRule.  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'] === PullThroughCacheRule.__pulumiType;
    }
    /**
     * Create a PullThroughCacheRule 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) {
            resourceInputs["credentialArn"] = args ? args.credentialArn : undefined;
            resourceInputs["customRoleArn"] = args ? args.customRoleArn : undefined;
            resourceInputs["ecrRepositoryPrefix"] = args ? args.ecrRepositoryPrefix : undefined;
            resourceInputs["upstreamRegistry"] = args ? args.upstreamRegistry : undefined;
            resourceInputs["upstreamRegistryUrl"] = args ? args.upstreamRegistryUrl : undefined;
            resourceInputs["upstreamRepositoryPrefix"] = args ? args.upstreamRepositoryPrefix : undefined;
        }
        else {
            resourceInputs["credentialArn"] = undefined /*out*/;
            resourceInputs["customRoleArn"] = undefined /*out*/;
            resourceInputs["ecrRepositoryPrefix"] = undefined /*out*/;
            resourceInputs["upstreamRegistry"] = undefined /*out*/;
            resourceInputs["upstreamRegistryUrl"] = undefined /*out*/;
            resourceInputs["upstreamRepositoryPrefix"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const replaceOnChanges = { replaceOnChanges: ["credentialArn", "customRoleArn", "ecrRepositoryPrefix", "upstreamRegistry", "upstreamRegistryUrl", "upstreamRepositoryPrefix"] };
        opts = pulumi.mergeOptions(opts, replaceOnChanges);
        super(PullThroughCacheRule.__pulumiType, name, resourceInputs, opts);
    }
}
exports.PullThroughCacheRule = PullThroughCacheRule;
/** @internal */
PullThroughCacheRule.__pulumiType = 'aws-native:ecr:PullThroughCacheRule';
//# sourceMappingURL=pullThroughCacheRule.js.map