|
| 1 | +// Generated by cdk-import |
| 2 | +import * as cdk from "aws-cdk-lib"; |
| 3 | +import * as constructs from "constructs"; |
| 4 | + |
| 5 | +/** |
| 6 | + * Creates one private endpoint for the specified cloud service provider. At this current version only AWS is supported |
| 7 | + * |
| 8 | + * @schema CfnPrivateEndpointAwsProps |
| 9 | + */ |
| 10 | +export interface CfnPrivateEndpointAwsProps { |
| 11 | + /** |
| 12 | + * The profile is defined in AWS Secret manager. See [Secret Manager Profile setup (../../../examples/profile-secret.yaml) |
| 13 | + * |
| 14 | + * @schema CfnPrivateEndpointAwsProps#Profile |
| 15 | + */ |
| 16 | + readonly profile?: string; |
| 17 | + |
| 18 | + /** |
| 19 | + * Unique 24-hexadecimal digit string that identifies your project. |
| 20 | + * |
| 21 | + * @schema CfnPrivateEndpointAwsProps#ProjectId |
| 22 | + */ |
| 23 | + readonly projectId: string; |
| 24 | + |
| 25 | + /** |
| 26 | + * Unique 24-hexadecimal digit string that identifies the private endpoint service for which you want to create a private endpoint. |
| 27 | + * |
| 28 | + * @schema CfnPrivateEndpointAwsProps#EndpointServiceId |
| 29 | + */ |
| 30 | + readonly endpointServiceId: string; |
| 31 | + |
| 32 | + /** |
| 33 | + * Unique string that identifies the private endpoint. for AWS is the VPC endpoint ID, example: vpce-xxxxxxxx |
| 34 | + * |
| 35 | + * @schema CfnPrivateEndpointAwsProps#Id |
| 36 | + */ |
| 37 | + readonly id?: string; |
| 38 | + |
| 39 | + /** |
| 40 | + * If this proper is set to TRUE, the cloud formation resource will return success Only if the private connection is Succeeded |
| 41 | + * |
| 42 | + * @schema CfnPrivateEndpointAwsProps#EnforceConnectionSuccess |
| 43 | + */ |
| 44 | + readonly enforceConnectionSuccess?: boolean; |
| 45 | + |
| 46 | + /** |
| 47 | + * State of the Amazon Web Service PrivateLink connection when MongoDB Cloud received this request. |
| 48 | + * |
| 49 | + * @schema CfnPrivateEndpointAwsProps#ConnectionStatus |
| 50 | + */ |
| 51 | + readonly connectionStatus?: string; |
| 52 | + |
| 53 | + /** |
| 54 | + * Error message returned when requesting private connection resource. The resource returns null if the request succeeded. |
| 55 | + * |
| 56 | + * @schema CfnPrivateEndpointAwsProps#ErrorMessage |
| 57 | + */ |
| 58 | + readonly errorMessage?: string; |
| 59 | +} |
| 60 | + |
| 61 | +/** |
| 62 | + * Converts an object of type 'CfnPrivateEndpointAwsProps' to JSON representation. |
| 63 | + */ |
| 64 | +/* eslint-disable max-len, quote-props */ |
| 65 | +export function toJson_CfnPrivateEndpointAwsProps( |
| 66 | + obj: CfnPrivateEndpointAwsProps | undefined |
| 67 | +): Record<string, any> | undefined { |
| 68 | + if (obj === undefined) { |
| 69 | + return undefined; |
| 70 | + } |
| 71 | + const result = { |
| 72 | + Profile: obj.profile, |
| 73 | + ProjectId: obj.projectId, |
| 74 | + EndpointServiceId: obj.endpointServiceId, |
| 75 | + Id: obj.id, |
| 76 | + EnforceConnectionSuccess: obj.enforceConnectionSuccess, |
| 77 | + ConnectionStatus: obj.connectionStatus, |
| 78 | + ErrorMessage: obj.errorMessage, |
| 79 | + }; |
| 80 | + // filter undefined values |
| 81 | + return Object.entries(result).reduce( |
| 82 | + (r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }), |
| 83 | + {} |
| 84 | + ); |
| 85 | +} |
| 86 | +/* eslint-enable max-len, quote-props */ |
| 87 | + |
| 88 | +/** |
| 89 | + * A CloudFormation `MongoDB::Atlas::PrivateEndpointAWS` |
| 90 | + * |
| 91 | + * @cloudformationResource MongoDB::Atlas::PrivateEndpointAWS |
| 92 | + * @stability external |
| 93 | + */ |
| 94 | +export class CfnPrivateEndpointAws extends cdk.CfnResource { |
| 95 | + /** |
| 96 | + * The CloudFormation resource type name for this resource class. |
| 97 | + */ |
| 98 | + public static readonly CFN_RESOURCE_TYPE_NAME = |
| 99 | + "MongoDB::Atlas::PrivateEndpointAWS"; |
| 100 | + |
| 101 | + /** |
| 102 | + * Resource props. |
| 103 | + */ |
| 104 | + public readonly props: CfnPrivateEndpointAwsProps; |
| 105 | + |
| 106 | + /** |
| 107 | + * Create a new `MongoDB::Atlas::PrivateEndpointAWS`. |
| 108 | + * |
| 109 | + * @param scope - scope in which this resource is defined |
| 110 | + * @param id - scoped id of the resource |
| 111 | + * @param props - resource properties |
| 112 | + */ |
| 113 | + constructor( |
| 114 | + scope: constructs.Construct, |
| 115 | + id: string, |
| 116 | + props: CfnPrivateEndpointAwsProps |
| 117 | + ) { |
| 118 | + super(scope, id, { |
| 119 | + type: CfnPrivateEndpointAws.CFN_RESOURCE_TYPE_NAME, |
| 120 | + properties: toJson_CfnPrivateEndpointAwsProps(props)!, |
| 121 | + }); |
| 122 | + |
| 123 | + this.props = props; |
| 124 | + } |
| 125 | +} |
0 commit comments