"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.Endpoint = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Resource Type definition for AWS::Events::Endpoint.
 *
 * ## Example Usage
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const sampleEndpoint = new aws_native.events.Endpoint("sampleEndpoint", {
 *     name: "CreateExampleEndpoint",
 *     routingConfig: {
 *         failoverConfig: {
 *             primary: {
 *                 healthCheck: "arn:aws:route53:::healthcheck/0123456789abc",
 *             },
 *             secondary: {
 *                 route: "us-east-1",
 *             },
 *         },
 *     },
 *     replicationConfig: {
 *         state: aws_native.events.EndpointReplicationState.Enabled,
 *     },
 *     roleArn: "arn:aws:iam::123456789012:role/EndpointReplicationRole",
 *     eventBuses: [
 *         {
 *             eventBusArn: "arn:aws:events:us-west-2:123456789012:event-bus/ExampleEventBus",
 *         },
 *         {
 *             eventBusArn: "arn:aws:events:us-east-1:123456789012:event-bus/ExampleEventBus",
 *         },
 *     ],
 * });
 * export const sampleEndpointName = sampleEndpoint.id;
 *
 * ```
 * ### Example
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws_native from "@pulumi/aws-native";
 *
 * const sampleEndpoint = new aws_native.events.Endpoint("sampleEndpoint", {
 *     name: "CreateExampleEndpoint",
 *     routingConfig: {
 *         failoverConfig: {
 *             primary: {
 *                 healthCheck: "arn:aws:route53:::healthcheck/0123456789abc",
 *             },
 *             secondary: {
 *                 route: "us-east-1",
 *             },
 *         },
 *     },
 *     replicationConfig: {
 *         state: aws_native.events.EndpointReplicationState.Disabled,
 *     },
 *     eventBuses: [
 *         {
 *             eventBusArn: "arn:aws:events:us-west-2:123456789012:event-bus/ExampleEventBus",
 *         },
 *         {
 *             eventBusArn: "arn:aws:events:us-east-1:123456789012:event-bus/ExampleEventBus",
 *         },
 *     ],
 * });
 * export const sampleEndpointName = sampleEndpoint.id;
 *
 * ```
 */
class Endpoint extends pulumi.CustomResource {
    /**
     * Get an existing Endpoint 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 Endpoint(name, undefined, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Endpoint.  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'] === Endpoint.__pulumiType;
    }
    /**
     * Create a Endpoint 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?.eventBuses === undefined && !opts.urn) {
                throw new Error("Missing required property 'eventBuses'");
            }
            if (args?.routingConfig === undefined && !opts.urn) {
                throw new Error("Missing required property 'routingConfig'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["eventBuses"] = args?.eventBuses;
            resourceInputs["name"] = args?.name;
            resourceInputs["replicationConfig"] = args?.replicationConfig;
            resourceInputs["roleArn"] = args?.roleArn;
            resourceInputs["routingConfig"] = args?.routingConfig;
            resourceInputs["arn"] = undefined /*out*/;
            resourceInputs["endpointId"] = undefined /*out*/;
            resourceInputs["endpointUrl"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["stateReason"] = undefined /*out*/;
        }
        else {
            resourceInputs["arn"] = undefined /*out*/;
            resourceInputs["description"] = undefined /*out*/;
            resourceInputs["endpointId"] = undefined /*out*/;
            resourceInputs["endpointUrl"] = undefined /*out*/;
            resourceInputs["eventBuses"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["replicationConfig"] = undefined /*out*/;
            resourceInputs["roleArn"] = undefined /*out*/;
            resourceInputs["routingConfig"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["stateReason"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const replaceOnChanges = { replaceOnChanges: ["name"] };
        opts = pulumi.mergeOptions(opts, replaceOnChanges);
        super(Endpoint.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Endpoint = Endpoint;
/** @internal */
Endpoint.__pulumiType = 'aws-native:events:Endpoint';
//# sourceMappingURL=endpoint.js.map