"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.OriginAccessControl = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Creates a new origin access control in CloudFront. After you create an origin access control, you can add it to an origin in a CloudFront distribution so that CloudFront sends authenticated (signed) requests to the origin.
 *  This makes it possible to block public access to the origin, allowing viewers (users) to access the origin's content only through CloudFront.
 *  For more information about using a CloudFront origin access control, see [Restricting access to an origin](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-origin.html) in the *Amazon CloudFront Developer Guide*.
 */
class OriginAccessControl extends pulumi.CustomResource {
    /**
     * Get an existing OriginAccessControl 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 OriginAccessControl(name, undefined, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of OriginAccessControl.  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'] === OriginAccessControl.__pulumiType;
    }
    /**
     * Create a OriginAccessControl 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?.originAccessControlConfig === undefined && !opts.urn) {
                throw new Error("Missing required property 'originAccessControlConfig'");
            }
            resourceInputs["originAccessControlConfig"] = args?.originAccessControlConfig;
            resourceInputs["awsId"] = undefined /*out*/;
        }
        else {
            resourceInputs["awsId"] = undefined /*out*/;
            resourceInputs["originAccessControlConfig"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(OriginAccessControl.__pulumiType, name, resourceInputs, opts);
    }
}
exports.OriginAccessControl = OriginAccessControl;
/** @internal */
OriginAccessControl.__pulumiType = 'aws-native:cloudfront:OriginAccessControl';
//# sourceMappingURL=originAccessControl.js.map