UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

101 lines 4.73 kB
"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.EventApiDestination = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an EventBridge event API Destination resource. * * > **Note:** EventBridge was formerly known as CloudWatch Events. The functionality is identical. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const test = new aws.cloudwatch.EventApiDestination("test", { * name: "api-destination", * description: "An API Destination", * invocationEndpoint: "https://api.destination.com/endpoint", * httpMethod: "POST", * invocationRateLimitPerSecond: 20, * connectionArn: testAwsCloudwatchEventConnection.arn, * }); * ``` * * ## Import * * Using `pulumi import`, import EventBridge API Destinations using the `name`. For example: * * ```sh * $ pulumi import aws:cloudwatch/eventApiDestination:EventApiDestination test api-destination * ``` */ class EventApiDestination extends pulumi.CustomResource { /** * Get an existing EventApiDestination 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 state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new EventApiDestination(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of EventApiDestination. 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'] === EventApiDestination.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["connectionArn"] = state ? state.connectionArn : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["httpMethod"] = state ? state.httpMethod : undefined; resourceInputs["invocationEndpoint"] = state ? state.invocationEndpoint : undefined; resourceInputs["invocationRateLimitPerSecond"] = state ? state.invocationRateLimitPerSecond : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["region"] = state ? state.region : undefined; } else { const args = argsOrState; if ((!args || args.connectionArn === undefined) && !opts.urn) { throw new Error("Missing required property 'connectionArn'"); } if ((!args || args.httpMethod === undefined) && !opts.urn) { throw new Error("Missing required property 'httpMethod'"); } if ((!args || args.invocationEndpoint === undefined) && !opts.urn) { throw new Error("Missing required property 'invocationEndpoint'"); } resourceInputs["connectionArn"] = args ? args.connectionArn : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["httpMethod"] = args ? args.httpMethod : undefined; resourceInputs["invocationEndpoint"] = args ? args.invocationEndpoint : undefined; resourceInputs["invocationRateLimitPerSecond"] = args ? args.invocationRateLimitPerSecond : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["arn"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(EventApiDestination.__pulumiType, name, resourceInputs, opts); } } exports.EventApiDestination = EventApiDestination; /** @internal */ EventApiDestination.__pulumiType = 'aws:cloudwatch/eventApiDestination:EventApiDestination'; //# sourceMappingURL=eventApiDestination.js.map