UNPKG

@pulumi/aws

Version:

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

267 lines • 9.72 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.EventConnection = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an EventBridge connection 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.EventConnection("test", { * name: "ngrok-connection", * description: "A connection description", * authorizationType: "API_KEY", * authParameters: { * apiKey: { * key: "x-signature", * value: "1234", * }, * }, * }); * ``` * * ### Basic Authorization * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const test = new aws.cloudwatch.EventConnection("test", { * name: "ngrok-connection", * description: "A connection description", * authorizationType: "BASIC", * authParameters: { * basic: { * username: "user", * password: "Pass1234!", * }, * }, * }); * ``` * * ### OAuth Authorization * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const test = new aws.cloudwatch.EventConnection("test", { * name: "ngrok-connection", * description: "A connection description", * authorizationType: "OAUTH_CLIENT_CREDENTIALS", * authParameters: { * oauth: { * authorizationEndpoint: "https://auth.url.com/endpoint", * httpMethod: "GET", * clientParameters: { * clientId: "1234567890", * clientSecret: "Pass1234!", * }, * oauthHttpParameters: { * bodies: [{ * key: "body-parameter-key", * value: "body-parameter-value", * isValueSecret: false, * }], * headers: [{ * key: "header-parameter-key", * value: "header-parameter-value", * isValueSecret: false, * }], * queryStrings: [{ * key: "query-string-parameter-key", * value: "query-string-parameter-value", * isValueSecret: false, * }], * }, * }, * }, * }); * ``` * * ### Invocation Http Parameters * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const test = new aws.cloudwatch.EventConnection("test", { * name: "ngrok-connection", * description: "A connection description", * authorizationType: "BASIC", * authParameters: { * basic: { * username: "user", * password: "Pass1234!", * }, * invocationHttpParameters: { * bodies: [ * { * key: "body-parameter-key", * value: "body-parameter-value", * isValueSecret: false, * }, * { * key: "body-parameter-key2", * value: "body-parameter-value2", * isValueSecret: true, * }, * ], * headers: [{ * key: "header-parameter-key", * value: "header-parameter-value", * isValueSecret: false, * }], * queryStrings: [{ * key: "query-string-parameter-key", * value: "query-string-parameter-value", * isValueSecret: false, * }], * }, * }, * }); * ``` * * ### CMK Encryption * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getCallerIdentity({}); * const currentGetPartition = aws.getPartition({}); * const test = new aws.kms.Key("test", { * deletionWindowInDays: 7, * policy: JSON.stringify({ * Version: "2012-10-17", * Id: "key-policy-example", * Statement: [ * { * Sid: "Enable IAM User Permissions", * Effect: "Allow", * Principal: { * AWS: Promise.all([currentGetPartition, current]).then(([currentGetPartition, current]) => `arn:${currentGetPartition.partition}:iam::${current.accountId}:root`), * }, * Action: "kms:*", * Resource: "*", * }, * { * Sid: "Allow use of the key", * Effect: "Allow", * Principal: { * AWS: Promise.all([currentGetPartition, current]).then(([currentGetPartition, current]) => `arn:${currentGetPartition.partition}:iam::${current.accountId}:root`), * }, * Action: [ * "kms:DescribeKey", * "kms:Decrypt", * "kms:GenerateDataKey", * ], * Resource: "*", * Condition: { * StringLike: { * "kms:ViaService": "secretsmanager.*.amazonaws.com", * "kms:EncryptionContext:SecretARN": ["arn:aws:secretsmanager:*:*:secret:events!connection/*"], * }, * }, * }, * ], * }), * tags: { * EventBridgeApiDestinations: "true", * }, * }); * const testEventConnection = new aws.cloudwatch.EventConnection("test", { * name: "ngrok-connection", * description: "A connection description", * authorizationType: "BASIC", * authParameters: { * basic: { * username: "user", * password: "Pass1234!", * }, * }, * kmsKeyIdentifier: example.id, * }); * ``` * * ## Import * * Using `pulumi import`, import EventBridge EventBridge connection using the `name`. For example: * * ```sh * $ pulumi import aws:cloudwatch/eventConnection:EventConnection test ngrok-connection * ``` */ class EventConnection extends pulumi.CustomResource { /** * Get an existing EventConnection 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 EventConnection(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of EventConnection. 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'] === EventConnection.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["authParameters"] = state?.authParameters; resourceInputs["authorizationType"] = state?.authorizationType; resourceInputs["description"] = state?.description; resourceInputs["invocationConnectivityParameters"] = state?.invocationConnectivityParameters; resourceInputs["kmsKeyIdentifier"] = state?.kmsKeyIdentifier; resourceInputs["name"] = state?.name; resourceInputs["region"] = state?.region; resourceInputs["secretArn"] = state?.secretArn; } else { const args = argsOrState; if (args?.authParameters === undefined && !opts.urn) { throw new Error("Missing required property 'authParameters'"); } if (args?.authorizationType === undefined && !opts.urn) { throw new Error("Missing required property 'authorizationType'"); } resourceInputs["authParameters"] = args?.authParameters; resourceInputs["authorizationType"] = args?.authorizationType; resourceInputs["description"] = args?.description; resourceInputs["invocationConnectivityParameters"] = args?.invocationConnectivityParameters; resourceInputs["kmsKeyIdentifier"] = args?.kmsKeyIdentifier; resourceInputs["name"] = args?.name; resourceInputs["region"] = args?.region; resourceInputs["arn"] = undefined /*out*/; resourceInputs["secretArn"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(EventConnection.__pulumiType, name, resourceInputs, opts); } } exports.EventConnection = EventConnection; /** @internal */ EventConnection.__pulumiType = 'aws:cloudwatch/eventConnection:EventConnection'; //# sourceMappingURL=eventConnection.js.map