UNPKG

@aws-cdk/aws-events

Version:

Amazon EventBridge Construct Library

949 lines 676 kB
"use strict"; var _a, _b, _c, _d, _e, _f, _g; Object.defineProperty(exports, "__esModule", { value: true }); exports.CfnRule = exports.CfnEventBusPolicy = exports.CfnEventBus = exports.CfnEndpoint = exports.CfnConnection = exports.CfnArchive = exports.CfnApiDestination = void 0; const jsiiDeprecationWarnings = require("../.warnings.jsii.js"); const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti"); // Copyright 2012-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. // Generated from the AWS CloudFormation Resource Specification // See: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html // @cfn2ts:meta@ {"generated":"2023-06-19T15:13:32.849Z","fingerprint":"p3SvHtZNdrDFUhVEGe7woT1NBrK7MoGP/hKRTbAzpSY="} /* eslint-disable max-len */ // This is generated code - line lengths are difficult to control const cdk = require("@aws-cdk/core"); const cfn_parse = require("@aws-cdk/core/lib/helpers-internal"); /** * Determine whether the given properties match those of a `CfnApiDestinationProps` * * @param properties - the TypeScript properties of a `CfnApiDestinationProps` * * @returns the result of the validation. */ function CfnApiDestinationPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('connectionArn', cdk.requiredValidator)(properties.connectionArn)); errors.collect(cdk.propertyValidator('connectionArn', cdk.validateString)(properties.connectionArn)); errors.collect(cdk.propertyValidator('description', cdk.validateString)(properties.description)); errors.collect(cdk.propertyValidator('httpMethod', cdk.requiredValidator)(properties.httpMethod)); errors.collect(cdk.propertyValidator('httpMethod', cdk.validateString)(properties.httpMethod)); errors.collect(cdk.propertyValidator('invocationEndpoint', cdk.requiredValidator)(properties.invocationEndpoint)); errors.collect(cdk.propertyValidator('invocationEndpoint', cdk.validateString)(properties.invocationEndpoint)); errors.collect(cdk.propertyValidator('invocationRateLimitPerSecond', cdk.validateNumber)(properties.invocationRateLimitPerSecond)); errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name)); return errors.wrap('supplied properties not correct for "CfnApiDestinationProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Events::ApiDestination` resource * * @param properties - the TypeScript properties of a `CfnApiDestinationProps` * * @returns the AWS CloudFormation properties of an `AWS::Events::ApiDestination` resource. */ // @ts-ignore TS6133 function cfnApiDestinationPropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnApiDestinationPropsValidator(properties).assertSuccess(); return { ConnectionArn: cdk.stringToCloudFormation(properties.connectionArn), HttpMethod: cdk.stringToCloudFormation(properties.httpMethod), InvocationEndpoint: cdk.stringToCloudFormation(properties.invocationEndpoint), Description: cdk.stringToCloudFormation(properties.description), InvocationRateLimitPerSecond: cdk.numberToCloudFormation(properties.invocationRateLimitPerSecond), Name: cdk.stringToCloudFormation(properties.name), }; } // @ts-ignore TS6133 function CfnApiDestinationPropsFromCloudFormation(properties) { properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('connectionArn', 'ConnectionArn', cfn_parse.FromCloudFormation.getString(properties.ConnectionArn)); ret.addPropertyResult('httpMethod', 'HttpMethod', cfn_parse.FromCloudFormation.getString(properties.HttpMethod)); ret.addPropertyResult('invocationEndpoint', 'InvocationEndpoint', cfn_parse.FromCloudFormation.getString(properties.InvocationEndpoint)); ret.addPropertyResult('description', 'Description', properties.Description != null ? cfn_parse.FromCloudFormation.getString(properties.Description) : undefined); ret.addPropertyResult('invocationRateLimitPerSecond', 'InvocationRateLimitPerSecond', properties.InvocationRateLimitPerSecond != null ? cfn_parse.FromCloudFormation.getNumber(properties.InvocationRateLimitPerSecond) : undefined); ret.addPropertyResult('name', 'Name', properties.Name != null ? cfn_parse.FromCloudFormation.getString(properties.Name) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * A CloudFormation `AWS::Events::ApiDestination` * * Creates an API destination, which is an HTTP invocation endpoint configured as a target for events. * * When using ApiDesinations with OAuth authentication we recommend these best practices: * * - Create a secret in Secrets Manager with your OAuth credentials. * - Reference that secret in your CloudFormation template for `AWS::Events::Connection` using CloudFormation dynamic reference syntax. For more information, see [Secrets Manager secrets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html#dynamic-references-secretsmanager) . * * When the Connection resource is created the secret will be passed to EventBridge and stored in the customer account using “Service Linked Secrets,” effectively creating two secrets. This will minimize the cost because the original secret is only accessed when a CloudFormation template is created or updated, not every time an event is sent to the ApiDestination. The secret stored in the customer account by EventBridge is the one used for each event sent to the ApiDestination and AWS is responsible for the fees. * * > The secret stored in the customer account by EventBridge can’t be updated directly, only when a CloudFormation template is updated. * * For examples of CloudFormation templates that use secrets, see [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-connection.html#aws-resource-events-connection--examples) . * * @cloudformationResource AWS::Events::ApiDestination * @stability external * * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-apidestination.html */ class CfnApiDestination extends cdk.CfnResource { /** * Create a new `AWS::Events::ApiDestination`. * * @param scope - scope in which this resource is defined * @param id - scoped id of the resource * @param props - resource properties */ constructor(scope, id, props) { super(scope, id, { type: CfnApiDestination.CFN_RESOURCE_TYPE_NAME, properties: props }); try { jsiiDeprecationWarnings._aws_cdk_aws_events_CfnApiDestinationProps(props); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, CfnApiDestination); } throw error; } cdk.requireProperty(props, 'connectionArn', this); cdk.requireProperty(props, 'httpMethod', this); cdk.requireProperty(props, 'invocationEndpoint', this); this.attrArn = cdk.Token.asString(this.getAtt('Arn')); this.connectionArn = props.connectionArn; this.httpMethod = props.httpMethod; this.invocationEndpoint = props.invocationEndpoint; this.description = props.description; this.invocationRateLimitPerSecond = props.invocationRateLimitPerSecond; this.name = props.name; } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const propsResult = CfnApiDestinationPropsFromCloudFormation(resourceProperties); const ret = new CfnApiDestination(scope, id, propsResult.value); for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) { ret.addPropertyOverride(propKey, propVal); } options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes * */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnApiDestination.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } get cfnProperties() { return { connectionArn: this.connectionArn, httpMethod: this.httpMethod, invocationEndpoint: this.invocationEndpoint, description: this.description, invocationRateLimitPerSecond: this.invocationRateLimitPerSecond, name: this.name, }; } renderProperties(props) { return cfnApiDestinationPropsToCloudFormation(props); } } exports.CfnApiDestination = CfnApiDestination; _a = JSII_RTTI_SYMBOL_1; CfnApiDestination[_a] = { fqn: "@aws-cdk/aws-events.CfnApiDestination", version: "1.204.0" }; /** * The CloudFormation resource type name for this resource class. */ CfnApiDestination.CFN_RESOURCE_TYPE_NAME = "AWS::Events::ApiDestination"; /** * Determine whether the given properties match those of a `CfnArchiveProps` * * @param properties - the TypeScript properties of a `CfnArchiveProps` * * @returns the result of the validation. */ function CfnArchivePropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('archiveName', cdk.validateString)(properties.archiveName)); errors.collect(cdk.propertyValidator('description', cdk.validateString)(properties.description)); errors.collect(cdk.propertyValidator('eventPattern', cdk.validateObject)(properties.eventPattern)); errors.collect(cdk.propertyValidator('retentionDays', cdk.validateNumber)(properties.retentionDays)); errors.collect(cdk.propertyValidator('sourceArn', cdk.requiredValidator)(properties.sourceArn)); errors.collect(cdk.propertyValidator('sourceArn', cdk.validateString)(properties.sourceArn)); return errors.wrap('supplied properties not correct for "CfnArchiveProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Events::Archive` resource * * @param properties - the TypeScript properties of a `CfnArchiveProps` * * @returns the AWS CloudFormation properties of an `AWS::Events::Archive` resource. */ // @ts-ignore TS6133 function cfnArchivePropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnArchivePropsValidator(properties).assertSuccess(); return { SourceArn: cdk.stringToCloudFormation(properties.sourceArn), ArchiveName: cdk.stringToCloudFormation(properties.archiveName), Description: cdk.stringToCloudFormation(properties.description), EventPattern: cdk.objectToCloudFormation(properties.eventPattern), RetentionDays: cdk.numberToCloudFormation(properties.retentionDays), }; } // @ts-ignore TS6133 function CfnArchivePropsFromCloudFormation(properties) { properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('sourceArn', 'SourceArn', cfn_parse.FromCloudFormation.getString(properties.SourceArn)); ret.addPropertyResult('archiveName', 'ArchiveName', properties.ArchiveName != null ? cfn_parse.FromCloudFormation.getString(properties.ArchiveName) : undefined); ret.addPropertyResult('description', 'Description', properties.Description != null ? cfn_parse.FromCloudFormation.getString(properties.Description) : undefined); ret.addPropertyResult('eventPattern', 'EventPattern', properties.EventPattern != null ? cfn_parse.FromCloudFormation.getAny(properties.EventPattern) : undefined); ret.addPropertyResult('retentionDays', 'RetentionDays', properties.RetentionDays != null ? cfn_parse.FromCloudFormation.getNumber(properties.RetentionDays) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * A CloudFormation `AWS::Events::Archive` * * Creates an archive of events with the specified settings. When you create an archive, incoming events might not immediately start being sent to the archive. Allow a short period of time for changes to take effect. If you do not specify a pattern to filter events sent to the archive, all events are sent to the archive except replayed events. Replayed events are not sent to an archive. * * @cloudformationResource AWS::Events::Archive * @stability external * * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-archive.html */ class CfnArchive extends cdk.CfnResource { /** * Create a new `AWS::Events::Archive`. * * @param scope - scope in which this resource is defined * @param id - scoped id of the resource * @param props - resource properties */ constructor(scope, id, props) { super(scope, id, { type: CfnArchive.CFN_RESOURCE_TYPE_NAME, properties: props }); try { jsiiDeprecationWarnings._aws_cdk_aws_events_CfnArchiveProps(props); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, CfnArchive); } throw error; } cdk.requireProperty(props, 'sourceArn', this); this.attrArn = cdk.Token.asString(this.getAtt('Arn')); this.sourceArn = props.sourceArn; this.archiveName = props.archiveName; this.description = props.description; this.eventPattern = props.eventPattern; this.retentionDays = props.retentionDays; } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const propsResult = CfnArchivePropsFromCloudFormation(resourceProperties); const ret = new CfnArchive(scope, id, propsResult.value); for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) { ret.addPropertyOverride(propKey, propVal); } options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes * */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnArchive.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } get cfnProperties() { return { sourceArn: this.sourceArn, archiveName: this.archiveName, description: this.description, eventPattern: this.eventPattern, retentionDays: this.retentionDays, }; } renderProperties(props) { return cfnArchivePropsToCloudFormation(props); } } exports.CfnArchive = CfnArchive; _b = JSII_RTTI_SYMBOL_1; CfnArchive[_b] = { fqn: "@aws-cdk/aws-events.CfnArchive", version: "1.204.0" }; /** * The CloudFormation resource type name for this resource class. */ CfnArchive.CFN_RESOURCE_TYPE_NAME = "AWS::Events::Archive"; /** * Determine whether the given properties match those of a `CfnConnectionProps` * * @param properties - the TypeScript properties of a `CfnConnectionProps` * * @returns the result of the validation. */ function CfnConnectionPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('authParameters', cdk.requiredValidator)(properties.authParameters)); errors.collect(cdk.propertyValidator('authParameters', CfnConnection_AuthParametersPropertyValidator)(properties.authParameters)); errors.collect(cdk.propertyValidator('authorizationType', cdk.requiredValidator)(properties.authorizationType)); errors.collect(cdk.propertyValidator('authorizationType', cdk.validateString)(properties.authorizationType)); errors.collect(cdk.propertyValidator('description', cdk.validateString)(properties.description)); errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name)); return errors.wrap('supplied properties not correct for "CfnConnectionProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Events::Connection` resource * * @param properties - the TypeScript properties of a `CfnConnectionProps` * * @returns the AWS CloudFormation properties of an `AWS::Events::Connection` resource. */ // @ts-ignore TS6133 function cfnConnectionPropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnConnectionPropsValidator(properties).assertSuccess(); return { AuthorizationType: cdk.stringToCloudFormation(properties.authorizationType), AuthParameters: cfnConnectionAuthParametersPropertyToCloudFormation(properties.authParameters), Description: cdk.stringToCloudFormation(properties.description), Name: cdk.stringToCloudFormation(properties.name), }; } // @ts-ignore TS6133 function CfnConnectionPropsFromCloudFormation(properties) { properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('authorizationType', 'AuthorizationType', cfn_parse.FromCloudFormation.getString(properties.AuthorizationType)); ret.addPropertyResult('authParameters', 'AuthParameters', CfnConnectionAuthParametersPropertyFromCloudFormation(properties.AuthParameters)); ret.addPropertyResult('description', 'Description', properties.Description != null ? cfn_parse.FromCloudFormation.getString(properties.Description) : undefined); ret.addPropertyResult('name', 'Name', properties.Name != null ? cfn_parse.FromCloudFormation.getString(properties.Name) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * A CloudFormation `AWS::Events::Connection` * * Creates a connection. A connection defines the authorization type and credentials to use for authorization with an API destination HTTP endpoint. * * @cloudformationResource AWS::Events::Connection * @stability external * * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-connection.html */ class CfnConnection extends cdk.CfnResource { /** * Create a new `AWS::Events::Connection`. * * @param scope - scope in which this resource is defined * @param id - scoped id of the resource * @param props - resource properties */ constructor(scope, id, props) { super(scope, id, { type: CfnConnection.CFN_RESOURCE_TYPE_NAME, properties: props }); try { jsiiDeprecationWarnings._aws_cdk_aws_events_CfnConnectionProps(props); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, CfnConnection); } throw error; } cdk.requireProperty(props, 'authParameters', this); cdk.requireProperty(props, 'authorizationType', this); this.attrArn = cdk.Token.asString(this.getAtt('Arn')); this.attrSecretArn = cdk.Token.asString(this.getAtt('SecretArn')); this.authorizationType = props.authorizationType; this.authParameters = props.authParameters; this.description = props.description; this.name = props.name; } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const propsResult = CfnConnectionPropsFromCloudFormation(resourceProperties); const ret = new CfnConnection(scope, id, propsResult.value); for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) { ret.addPropertyOverride(propKey, propVal); } options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes * */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnConnection.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } get cfnProperties() { return { authorizationType: this.authorizationType, authParameters: this.authParameters, description: this.description, name: this.name, }; } renderProperties(props) { return cfnConnectionPropsToCloudFormation(props); } } exports.CfnConnection = CfnConnection; _c = JSII_RTTI_SYMBOL_1; CfnConnection[_c] = { fqn: "@aws-cdk/aws-events.CfnConnection", version: "1.204.0" }; /** * The CloudFormation resource type name for this resource class. */ CfnConnection.CFN_RESOURCE_TYPE_NAME = "AWS::Events::Connection"; /** * Determine whether the given properties match those of a `ApiKeyAuthParametersProperty` * * @param properties - the TypeScript properties of a `ApiKeyAuthParametersProperty` * * @returns the result of the validation. */ function CfnConnection_ApiKeyAuthParametersPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('apiKeyName', cdk.requiredValidator)(properties.apiKeyName)); errors.collect(cdk.propertyValidator('apiKeyName', cdk.validateString)(properties.apiKeyName)); errors.collect(cdk.propertyValidator('apiKeyValue', cdk.requiredValidator)(properties.apiKeyValue)); errors.collect(cdk.propertyValidator('apiKeyValue', cdk.validateString)(properties.apiKeyValue)); return errors.wrap('supplied properties not correct for "ApiKeyAuthParametersProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Events::Connection.ApiKeyAuthParameters` resource * * @param properties - the TypeScript properties of a `ApiKeyAuthParametersProperty` * * @returns the AWS CloudFormation properties of an `AWS::Events::Connection.ApiKeyAuthParameters` resource. */ // @ts-ignore TS6133 function cfnConnectionApiKeyAuthParametersPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnConnection_ApiKeyAuthParametersPropertyValidator(properties).assertSuccess(); return { ApiKeyName: cdk.stringToCloudFormation(properties.apiKeyName), ApiKeyValue: cdk.stringToCloudFormation(properties.apiKeyValue), }; } // @ts-ignore TS6133 function CfnConnectionApiKeyAuthParametersPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return new cfn_parse.FromCloudFormationResult(properties); } properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('apiKeyName', 'ApiKeyName', cfn_parse.FromCloudFormation.getString(properties.ApiKeyName)); ret.addPropertyResult('apiKeyValue', 'ApiKeyValue', cfn_parse.FromCloudFormation.getString(properties.ApiKeyValue)); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * Determine whether the given properties match those of a `AuthParametersProperty` * * @param properties - the TypeScript properties of a `AuthParametersProperty` * * @returns the result of the validation. */ function CfnConnection_AuthParametersPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('apiKeyAuthParameters', CfnConnection_ApiKeyAuthParametersPropertyValidator)(properties.apiKeyAuthParameters)); errors.collect(cdk.propertyValidator('basicAuthParameters', CfnConnection_BasicAuthParametersPropertyValidator)(properties.basicAuthParameters)); errors.collect(cdk.propertyValidator('invocationHttpParameters', CfnConnection_ConnectionHttpParametersPropertyValidator)(properties.invocationHttpParameters)); errors.collect(cdk.propertyValidator('oAuthParameters', CfnConnection_OAuthParametersPropertyValidator)(properties.oAuthParameters)); return errors.wrap('supplied properties not correct for "AuthParametersProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Events::Connection.AuthParameters` resource * * @param properties - the TypeScript properties of a `AuthParametersProperty` * * @returns the AWS CloudFormation properties of an `AWS::Events::Connection.AuthParameters` resource. */ // @ts-ignore TS6133 function cfnConnectionAuthParametersPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnConnection_AuthParametersPropertyValidator(properties).assertSuccess(); return { ApiKeyAuthParameters: cfnConnectionApiKeyAuthParametersPropertyToCloudFormation(properties.apiKeyAuthParameters), BasicAuthParameters: cfnConnectionBasicAuthParametersPropertyToCloudFormation(properties.basicAuthParameters), InvocationHttpParameters: cfnConnectionConnectionHttpParametersPropertyToCloudFormation(properties.invocationHttpParameters), OAuthParameters: cfnConnectionOAuthParametersPropertyToCloudFormation(properties.oAuthParameters), }; } // @ts-ignore TS6133 function CfnConnectionAuthParametersPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return new cfn_parse.FromCloudFormationResult(properties); } properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('apiKeyAuthParameters', 'ApiKeyAuthParameters', properties.ApiKeyAuthParameters != null ? CfnConnectionApiKeyAuthParametersPropertyFromCloudFormation(properties.ApiKeyAuthParameters) : undefined); ret.addPropertyResult('basicAuthParameters', 'BasicAuthParameters', properties.BasicAuthParameters != null ? CfnConnectionBasicAuthParametersPropertyFromCloudFormation(properties.BasicAuthParameters) : undefined); ret.addPropertyResult('invocationHttpParameters', 'InvocationHttpParameters', properties.InvocationHttpParameters != null ? CfnConnectionConnectionHttpParametersPropertyFromCloudFormation(properties.InvocationHttpParameters) : undefined); ret.addPropertyResult('oAuthParameters', 'OAuthParameters', properties.OAuthParameters != null ? CfnConnectionOAuthParametersPropertyFromCloudFormation(properties.OAuthParameters) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * Determine whether the given properties match those of a `BasicAuthParametersProperty` * * @param properties - the TypeScript properties of a `BasicAuthParametersProperty` * * @returns the result of the validation. */ function CfnConnection_BasicAuthParametersPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('password', cdk.requiredValidator)(properties.password)); errors.collect(cdk.propertyValidator('password', cdk.validateString)(properties.password)); errors.collect(cdk.propertyValidator('username', cdk.requiredValidator)(properties.username)); errors.collect(cdk.propertyValidator('username', cdk.validateString)(properties.username)); return errors.wrap('supplied properties not correct for "BasicAuthParametersProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Events::Connection.BasicAuthParameters` resource * * @param properties - the TypeScript properties of a `BasicAuthParametersProperty` * * @returns the AWS CloudFormation properties of an `AWS::Events::Connection.BasicAuthParameters` resource. */ // @ts-ignore TS6133 function cfnConnectionBasicAuthParametersPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnConnection_BasicAuthParametersPropertyValidator(properties).assertSuccess(); return { Password: cdk.stringToCloudFormation(properties.password), Username: cdk.stringToCloudFormation(properties.username), }; } // @ts-ignore TS6133 function CfnConnectionBasicAuthParametersPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return new cfn_parse.FromCloudFormationResult(properties); } properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('password', 'Password', cfn_parse.FromCloudFormation.getString(properties.Password)); ret.addPropertyResult('username', 'Username', cfn_parse.FromCloudFormation.getString(properties.Username)); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * Determine whether the given properties match those of a `ClientParametersProperty` * * @param properties - the TypeScript properties of a `ClientParametersProperty` * * @returns the result of the validation. */ function CfnConnection_ClientParametersPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('clientId', cdk.requiredValidator)(properties.clientId)); errors.collect(cdk.propertyValidator('clientId', cdk.validateString)(properties.clientId)); errors.collect(cdk.propertyValidator('clientSecret', cdk.requiredValidator)(properties.clientSecret)); errors.collect(cdk.propertyValidator('clientSecret', cdk.validateString)(properties.clientSecret)); return errors.wrap('supplied properties not correct for "ClientParametersProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Events::Connection.ClientParameters` resource * * @param properties - the TypeScript properties of a `ClientParametersProperty` * * @returns the AWS CloudFormation properties of an `AWS::Events::Connection.ClientParameters` resource. */ // @ts-ignore TS6133 function cfnConnectionClientParametersPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnConnection_ClientParametersPropertyValidator(properties).assertSuccess(); return { ClientID: cdk.stringToCloudFormation(properties.clientId), ClientSecret: cdk.stringToCloudFormation(properties.clientSecret), }; } // @ts-ignore TS6133 function CfnConnectionClientParametersPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return new cfn_parse.FromCloudFormationResult(properties); } properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('clientId', 'ClientID', cfn_parse.FromCloudFormation.getString(properties.ClientID)); ret.addPropertyResult('clientSecret', 'ClientSecret', cfn_parse.FromCloudFormation.getString(properties.ClientSecret)); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * Determine whether the given properties match those of a `ConnectionHttpParametersProperty` * * @param properties - the TypeScript properties of a `ConnectionHttpParametersProperty` * * @returns the result of the validation. */ function CfnConnection_ConnectionHttpParametersPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('bodyParameters', cdk.listValidator(CfnConnection_ParameterPropertyValidator))(properties.bodyParameters)); errors.collect(cdk.propertyValidator('headerParameters', cdk.listValidator(CfnConnection_ParameterPropertyValidator))(properties.headerParameters)); errors.collect(cdk.propertyValidator('queryStringParameters', cdk.listValidator(CfnConnection_ParameterPropertyValidator))(properties.queryStringParameters)); return errors.wrap('supplied properties not correct for "ConnectionHttpParametersProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Events::Connection.ConnectionHttpParameters` resource * * @param properties - the TypeScript properties of a `ConnectionHttpParametersProperty` * * @returns the AWS CloudFormation properties of an `AWS::Events::Connection.ConnectionHttpParameters` resource. */ // @ts-ignore TS6133 function cfnConnectionConnectionHttpParametersPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnConnection_ConnectionHttpParametersPropertyValidator(properties).assertSuccess(); return { BodyParameters: cdk.listMapper(cfnConnectionParameterPropertyToCloudFormation)(properties.bodyParameters), HeaderParameters: cdk.listMapper(cfnConnectionParameterPropertyToCloudFormation)(properties.headerParameters), QueryStringParameters: cdk.listMapper(cfnConnectionParameterPropertyToCloudFormation)(properties.queryStringParameters), }; } // @ts-ignore TS6133 function CfnConnectionConnectionHttpParametersPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return new cfn_parse.FromCloudFormationResult(properties); } properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('bodyParameters', 'BodyParameters', properties.BodyParameters != null ? cfn_parse.FromCloudFormation.getArray(CfnConnectionParameterPropertyFromCloudFormation)(properties.BodyParameters) : undefined); ret.addPropertyResult('headerParameters', 'HeaderParameters', properties.HeaderParameters != null ? cfn_parse.FromCloudFormation.getArray(CfnConnectionParameterPropertyFromCloudFormation)(properties.HeaderParameters) : undefined); ret.addPropertyResult('queryStringParameters', 'QueryStringParameters', properties.QueryStringParameters != null ? cfn_parse.FromCloudFormation.getArray(CfnConnectionParameterPropertyFromCloudFormation)(properties.QueryStringParameters) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * Determine whether the given properties match those of a `OAuthParametersProperty` * * @param properties - the TypeScript properties of a `OAuthParametersProperty` * * @returns the result of the validation. */ function CfnConnection_OAuthParametersPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('authorizationEndpoint', cdk.requiredValidator)(properties.authorizationEndpoint)); errors.collect(cdk.propertyValidator('authorizationEndpoint', cdk.validateString)(properties.authorizationEndpoint)); errors.collect(cdk.propertyValidator('clientParameters', cdk.requiredValidator)(properties.clientParameters)); errors.collect(cdk.propertyValidator('clientParameters', CfnConnection_ClientParametersPropertyValidator)(properties.clientParameters)); errors.collect(cdk.propertyValidator('httpMethod', cdk.requiredValidator)(properties.httpMethod)); errors.collect(cdk.propertyValidator('httpMethod', cdk.validateString)(properties.httpMethod)); errors.collect(cdk.propertyValidator('oAuthHttpParameters', CfnConnection_ConnectionHttpParametersPropertyValidator)(properties.oAuthHttpParameters)); return errors.wrap('supplied properties not correct for "OAuthParametersProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Events::Connection.OAuthParameters` resource * * @param properties - the TypeScript properties of a `OAuthParametersProperty` * * @returns the AWS CloudFormation properties of an `AWS::Events::Connection.OAuthParameters` resource. */ // @ts-ignore TS6133 function cfnConnectionOAuthParametersPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnConnection_OAuthParametersPropertyValidator(properties).assertSuccess(); return { AuthorizationEndpoint: cdk.stringToCloudFormation(properties.authorizationEndpoint), ClientParameters: cfnConnectionClientParametersPropertyToCloudFormation(properties.clientParameters), HttpMethod: cdk.stringToCloudFormation(properties.httpMethod), OAuthHttpParameters: cfnConnectionConnectionHttpParametersPropertyToCloudFormation(properties.oAuthHttpParameters), }; } // @ts-ignore TS6133 function CfnConnectionOAuthParametersPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return new cfn_parse.FromCloudFormationResult(properties); } properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('authorizationEndpoint', 'AuthorizationEndpoint', cfn_parse.FromCloudFormation.getString(properties.AuthorizationEndpoint)); ret.addPropertyResult('clientParameters', 'ClientParameters', CfnConnectionClientParametersPropertyFromCloudFormation(properties.ClientParameters)); ret.addPropertyResult('httpMethod', 'HttpMethod', cfn_parse.FromCloudFormation.getString(properties.HttpMethod)); ret.addPropertyResult('oAuthHttpParameters', 'OAuthHttpParameters', properties.OAuthHttpParameters != null ? CfnConnectionConnectionHttpParametersPropertyFromCloudFormation(properties.OAuthHttpParameters) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * Determine whether the given properties match those of a `ParameterProperty` * * @param properties - the TypeScript properties of a `ParameterProperty` * * @returns the result of the validation. */ function CfnConnection_ParameterPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('isValueSecret', cdk.validateBoolean)(properties.isValueSecret)); errors.collect(cdk.propertyValidator('key', cdk.requiredValidator)(properties.key)); errors.collect(cdk.propertyValidator('key', cdk.validateString)(properties.key)); errors.collect(cdk.propertyValidator('value', cdk.requiredValidator)(properties.value)); errors.collect(cdk.propertyValidator('value', cdk.validateString)(properties.value)); return errors.wrap('supplied properties not correct for "ParameterProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Events::Connection.Parameter` resource * * @param properties - the TypeScript properties of a `ParameterProperty` * * @returns the AWS CloudFormation properties of an `AWS::Events::Connection.Parameter` resource. */ // @ts-ignore TS6133 function cfnConnectionParameterPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnConnection_ParameterPropertyValidator(properties).assertSuccess(); return { IsValueSecret: cdk.booleanToCloudFormation(properties.isValueSecret), Key: cdk.stringToCloudFormation(properties.key), Value: cdk.stringToCloudFormation(properties.value), }; } // @ts-ignore TS6133 function CfnConnectionParameterPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return new cfn_parse.FromCloudFormationResult(properties); } properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('isValueSecret', 'IsValueSecret', properties.IsValueSecret != null ? cfn_parse.FromCloudFormation.getBoolean(properties.IsValueSecret) : undefined); ret.addPropertyResult('key', 'Key', cfn_parse.FromCloudFormation.getString(properties.Key)); ret.addPropertyResult('value', 'Value', cfn_parse.FromCloudFormation.getString(properties.Value)); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * Determine whether the given properties match those of a `CfnEndpointProps` * * @param properties - the TypeScript properties of a `CfnEndpointProps` * * @returns the result of the validation. */ function CfnEndpointPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('description', cdk.validateString)(properties.description)); errors.collect(cdk.propertyValidator('eventBuses', cdk.requiredValidator)(properties.eventBuses)); errors.collect(cdk.propertyValidator('eventBuses', cdk.listValidator(CfnEndpoint_EndpointEventBusPropertyValidator))(properties.eventBuses)); errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name)); errors.collect(cdk.propertyValidator('replicationConfig', CfnEndpoint_ReplicationConfigPropertyValidator)(properties.replicationConfig)); errors.collect(cdk.propertyValidator('roleArn', cdk.validateString)(properties.roleArn)); errors.collect(cdk.propertyValidator('routingConfig', cdk.requiredValidator)(properties.routingConfig)); errors.collect(cdk.propertyValidator('routingConfig', CfnEndpoint_RoutingConfigPropertyValidator)(properties.routingConfig)); return errors.wrap('supplied properties not correct for "CfnEndpointProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Events::Endpoint` resource * * @param properties - the TypeScript properties of a `CfnEndpointProps` * * @returns the AWS CloudFormation properties of an `AWS::Events::Endpoint` resource. */ // @ts-ignore TS6133 function cfnEndpointPropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnEndpointPropsValidator(properties).assertSuccess(); return { EventBuses: cdk.listMapper(cfnEndpointEndpointEventBusPropertyToCloudFormation)(properties.eventBuses), RoutingConfig: cfnEndpointRoutingConfigPropertyToCloudFormation(properties.routingConfig), Description: cdk.stringToCloudFormation(properties.description), Name: cdk.stringToCloudFormation(properties.name), ReplicationConfig: cfnEndpointReplicationConfigPropertyToCloudFormation(properties.replicationConfig), RoleArn: cdk.stringToCloudFormation(properties.roleArn), }; } // @ts-ignore TS6133 function CfnEndpointPropsFromCloudFormation(properties) { properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('eventBuses', 'EventBuses', cfn_parse.FromCloudFormation.getArray(CfnEndpointEndpointEventBusPropertyFromCloudFormation)(properties.EventBuses)); ret.addPropertyResult('routingConfig', 'RoutingConfig', CfnEndpointRoutingConfigPropertyFromCloudFormation(properties.RoutingConfig)); ret.addPropertyResult('description', 'Description', properties.Description != null ? cfn_parse.FromCloudFormation.getString(properties.Description) : undefined); ret.addPropertyResult('name', 'Name', properties.Name != null ? cfn_parse.FromCloudFormation.getString(properties.Name) : undefined); ret.addPropertyResult('replicationConfig', 'ReplicationConfig', properties.ReplicationConfig != null ? CfnEndpointReplicationConfigPropertyFromCloudFormation(properties.ReplicationConfig) : undefined); ret.addPropertyResult('roleArn', 'RoleArn', properties.RoleArn != null ? cfn_parse.FromCloudFormation.getString(properties.RoleArn) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * A CloudFormation `AWS::Events::Endpoint` * * A global endpoint used to improve your application's availability by making it regional-fault tolerant. For more information about global endpoints, see [Making applications Regional-fault tolerant with global endpoints and event replication](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-global-endpoints.html) in the *Amazon EventBridge User Guide* . * * @cloudformationResource AWS::Events::Endpoint * @stability external * * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-endpoint.html */ class CfnEndpoint extends cdk.CfnResource { /** * Create a new `AWS::Events::Endpoint`. * * @param scope - scope in which this resource is defined * @param id - scoped id of the resource * @param props - resource properties */ constructor(scope, id, props) { super(scope, id, { type: CfnEndpoint.CFN_RESOURCE_TYPE_NAME, properties: props }); try { jsiiDeprecationWarnings._aws_cdk_aws_events_CfnEndpointProps(props); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, CfnEndpoint); } throw error; } cdk.requireProperty(props