"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.SubscriptionFilter = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * The ``AWS::Logs::SubscriptionFilter`` resource specifies a subscription filter and associates it with the specified log group. Subscription filters allow you to subscribe to a real-time stream of log events and have them delivered to a specific destination. Currently, the supported destinations are:
 *   +  An Amazon Kinesis data stream belonging to the same account as the subscription filter, for same-account delivery.
 *   +  A logical destination that belongs to a different account, for cross-account delivery.
 *   +  An Amazon Kinesis Firehose delivery stream that belongs to the same account as the subscription filter, for same-account delivery.
 *   +  An LAMlong function that belongs to the same account as the subscription filter, for same-account delivery.
 *
 *  There can be as many as two subscription filters associated with a log group.
 */
class SubscriptionFilter extends pulumi.CustomResource {
    /**
     * Get an existing SubscriptionFilter 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 SubscriptionFilter(name, undefined, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of SubscriptionFilter.  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'] === SubscriptionFilter.__pulumiType;
    }
    /**
     * Create a SubscriptionFilter 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?.destinationArn === undefined && !opts.urn) {
                throw new Error("Missing required property 'destinationArn'");
            }
            if (args?.filterPattern === undefined && !opts.urn) {
                throw new Error("Missing required property 'filterPattern'");
            }
            if (args?.logGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'logGroupName'");
            }
            resourceInputs["applyOnTransformedLogs"] = args?.applyOnTransformedLogs;
            resourceInputs["destinationArn"] = args?.destinationArn;
            resourceInputs["distribution"] = args?.distribution;
            resourceInputs["emitSystemFields"] = args?.emitSystemFields;
            resourceInputs["fieldSelectionCriteria"] = args?.fieldSelectionCriteria;
            resourceInputs["filterName"] = args?.filterName;
            resourceInputs["filterPattern"] = args?.filterPattern;
            resourceInputs["logGroupName"] = args?.logGroupName;
            resourceInputs["roleArn"] = args?.roleArn;
        }
        else {
            resourceInputs["applyOnTransformedLogs"] = undefined /*out*/;
            resourceInputs["destinationArn"] = undefined /*out*/;
            resourceInputs["distribution"] = undefined /*out*/;
            resourceInputs["emitSystemFields"] = undefined /*out*/;
            resourceInputs["fieldSelectionCriteria"] = undefined /*out*/;
            resourceInputs["filterName"] = undefined /*out*/;
            resourceInputs["filterPattern"] = undefined /*out*/;
            resourceInputs["logGroupName"] = undefined /*out*/;
            resourceInputs["roleArn"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const replaceOnChanges = { replaceOnChanges: ["filterName", "logGroupName"] };
        opts = pulumi.mergeOptions(opts, replaceOnChanges);
        super(SubscriptionFilter.__pulumiType, name, resourceInputs, opts);
    }
}
exports.SubscriptionFilter = SubscriptionFilter;
/** @internal */
SubscriptionFilter.__pulumiType = 'aws-native:logs:SubscriptionFilter';
//# sourceMappingURL=subscriptionFilter.js.map