@incloodsolutions/devkit 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +150 -41
- package/dist/aws-cdk/api-gateway-v2.cjs +77 -0
- package/dist/aws-cdk/api-gateway-v2.cjs.map +1 -0
- package/dist/aws-cdk/api-gateway-v2.d.cts +55 -0
- package/dist/aws-cdk/api-gateway-v2.d.ts +55 -0
- package/dist/aws-cdk/api-gateway-v2.js +75 -0
- package/dist/aws-cdk/api-gateway-v2.js.map +1 -0
- package/dist/aws-cdk/api-gateway-websocket.cjs +77 -0
- package/dist/aws-cdk/api-gateway-websocket.cjs.map +1 -0
- package/dist/aws-cdk/api-gateway-websocket.d.cts +73 -0
- package/dist/aws-cdk/api-gateway-websocket.d.ts +73 -0
- package/dist/aws-cdk/api-gateway-websocket.js +75 -0
- package/dist/aws-cdk/api-gateway-websocket.js.map +1 -0
- package/dist/aws-cdk/api-gateway.cjs +98 -0
- package/dist/aws-cdk/api-gateway.cjs.map +1 -0
- package/dist/aws-cdk/api-gateway.d.cts +80 -0
- package/dist/aws-cdk/api-gateway.d.ts +80 -0
- package/dist/aws-cdk/api-gateway.js +96 -0
- package/dist/aws-cdk/api-gateway.js.map +1 -0
- package/dist/aws-cdk/cloudfront.cjs +68 -0
- package/dist/aws-cdk/cloudfront.cjs.map +1 -0
- package/dist/aws-cdk/cloudfront.d.cts +36 -0
- package/dist/aws-cdk/cloudfront.d.ts +36 -0
- package/dist/aws-cdk/cloudfront.js +66 -0
- package/dist/aws-cdk/cloudfront.js.map +1 -0
- package/dist/aws-cdk/cloudwatch.cjs +43 -0
- package/dist/aws-cdk/cloudwatch.cjs.map +1 -0
- package/dist/aws-cdk/cloudwatch.d.cts +36 -0
- package/dist/aws-cdk/cloudwatch.d.ts +36 -0
- package/dist/aws-cdk/cloudwatch.js +41 -0
- package/dist/aws-cdk/cloudwatch.js.map +1 -0
- package/dist/aws-cdk/dynamo-db.cjs +113 -0
- package/dist/aws-cdk/dynamo-db.cjs.map +1 -0
- package/dist/aws-cdk/dynamo-db.d.cts +53 -0
- package/dist/aws-cdk/dynamo-db.d.ts +53 -0
- package/dist/aws-cdk/dynamo-db.js +111 -0
- package/dist/aws-cdk/dynamo-db.js.map +1 -0
- package/dist/aws-cdk/event-bridge.cjs +47 -0
- package/dist/aws-cdk/event-bridge.cjs.map +1 -0
- package/dist/aws-cdk/event-bridge.d.cts +41 -0
- package/dist/aws-cdk/event-bridge.d.ts +41 -0
- package/dist/aws-cdk/event-bridge.js +45 -0
- package/dist/aws-cdk/event-bridge.js.map +1 -0
- package/dist/aws-cdk/lambda-authorizer-v2.cjs +50 -0
- package/dist/aws-cdk/lambda-authorizer-v2.cjs.map +1 -0
- package/dist/aws-cdk/lambda-authorizer-v2.d.cts +45 -0
- package/dist/aws-cdk/lambda-authorizer-v2.d.ts +45 -0
- package/dist/aws-cdk/lambda-authorizer-v2.js +48 -0
- package/dist/aws-cdk/lambda-authorizer-v2.js.map +1 -0
- package/dist/aws-cdk/lambda-authorizer.cjs +37 -0
- package/dist/aws-cdk/lambda-authorizer.cjs.map +1 -0
- package/dist/aws-cdk/lambda-authorizer.d.cts +44 -0
- package/dist/aws-cdk/lambda-authorizer.d.ts +44 -0
- package/dist/aws-cdk/lambda-authorizer.js +35 -0
- package/dist/aws-cdk/lambda-authorizer.js.map +1 -0
- package/dist/aws-cdk/lambda-layer.cjs +69 -0
- package/dist/aws-cdk/lambda-layer.cjs.map +1 -0
- package/dist/aws-cdk/lambda-layer.d.cts +52 -0
- package/dist/aws-cdk/lambda-layer.d.ts +52 -0
- package/dist/aws-cdk/lambda-layer.js +67 -0
- package/dist/aws-cdk/lambda-layer.js.map +1 -0
- package/dist/aws-cdk/lambda.cjs +82 -0
- package/dist/aws-cdk/lambda.cjs.map +1 -0
- package/dist/aws-cdk/lambda.d.cts +37 -0
- package/dist/aws-cdk/lambda.d.ts +37 -0
- package/dist/aws-cdk/lambda.js +80 -0
- package/dist/aws-cdk/lambda.js.map +1 -0
- package/dist/aws-cdk/role-policy.cjs +53 -0
- package/dist/aws-cdk/role-policy.cjs.map +1 -0
- package/dist/aws-cdk/role-policy.d.cts +44 -0
- package/dist/aws-cdk/role-policy.d.ts +44 -0
- package/dist/aws-cdk/role-policy.js +51 -0
- package/dist/aws-cdk/role-policy.js.map +1 -0
- package/dist/aws-cdk/s3-deployment.cjs +177 -0
- package/dist/aws-cdk/s3-deployment.cjs.map +1 -0
- package/dist/aws-cdk/s3-deployment.d.cts +72 -0
- package/dist/aws-cdk/s3-deployment.d.ts +72 -0
- package/dist/aws-cdk/s3-deployment.js +175 -0
- package/dist/aws-cdk/s3-deployment.js.map +1 -0
- package/dist/aws-cdk/s3.cjs +38 -0
- package/dist/aws-cdk/s3.cjs.map +1 -0
- package/dist/aws-cdk/s3.d.cts +36 -0
- package/dist/aws-cdk/s3.d.ts +36 -0
- package/dist/aws-cdk/s3.js +36 -0
- package/dist/aws-cdk/s3.js.map +1 -0
- package/dist/aws-cdk/sns.cjs +43 -0
- package/dist/aws-cdk/sns.cjs.map +1 -0
- package/dist/aws-cdk/sns.d.cts +45 -0
- package/dist/aws-cdk/sns.d.ts +45 -0
- package/dist/aws-cdk/sns.js +41 -0
- package/dist/aws-cdk/sns.js.map +1 -0
- package/dist/aws-cdk/sqs.cjs +55 -0
- package/dist/aws-cdk/sqs.cjs.map +1 -0
- package/dist/aws-cdk/sqs.d.cts +52 -0
- package/dist/aws-cdk/sqs.d.ts +52 -0
- package/dist/aws-cdk/sqs.js +53 -0
- package/dist/aws-cdk/sqs.js.map +1 -0
- package/dist/aws-cdk/vpc.cjs +33 -0
- package/dist/aws-cdk/vpc.cjs.map +1 -0
- package/dist/aws-cdk/vpc.d.cts +34 -0
- package/dist/aws-cdk/vpc.d.ts +34 -0
- package/dist/aws-cdk/vpc.js +31 -0
- package/dist/aws-cdk/vpc.js.map +1 -0
- package/dist/aws-cdk.cjs +905 -0
- package/dist/aws-cdk.cjs.map +1 -0
- package/dist/aws-cdk.d.cts +34 -0
- package/dist/aws-cdk.d.ts +34 -0
- package/dist/aws-cdk.js +887 -0
- package/dist/aws-cdk.js.map +1 -0
- package/dist/aws-types.cjs +4 -0
- package/dist/aws-types.cjs.map +1 -0
- package/dist/aws-types.d.cts +42 -0
- package/dist/aws-types.d.ts +42 -0
- package/dist/aws-types.js +3 -0
- package/dist/aws-types.js.map +1 -0
- package/dist/aws.cjs +905 -0
- package/dist/aws.cjs.map +1 -0
- package/dist/aws.d.cts +34 -0
- package/dist/aws.d.ts +34 -0
- package/dist/aws.js +887 -0
- package/dist/aws.js.map +1 -0
- package/dist/index.cjs +43 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -755
- package/dist/index.d.ts +34 -755
- package/dist/index.js +43 -19
- package/dist/index.js.map +1 -1
- package/package.json +181 -19
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Construct } from 'constructs';
|
|
2
|
+
import { Queue, QueueProps } from 'aws-cdk-lib/aws-sqs';
|
|
3
|
+
import { EventSourceMappingProps, Function } from 'aws-cdk-lib/aws-lambda';
|
|
4
|
+
import { IBaseCdkConstructProps } from '../aws-types.cjs';
|
|
5
|
+
import '@incloodsolutions/toolkit';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props for BaseSqsConstruct
|
|
9
|
+
*
|
|
10
|
+
* Provides configuration for:
|
|
11
|
+
* - SQS queue creation
|
|
12
|
+
* - Lambda event source mappings
|
|
13
|
+
*/
|
|
14
|
+
interface ISqsConstructProps extends Omit<IBaseCdkConstructProps<{
|
|
15
|
+
/** Configuration options for the SQS queue */
|
|
16
|
+
readonly queueOptions?: QueueProps;
|
|
17
|
+
/**
|
|
18
|
+
* Configuration for Lambda event source mapping
|
|
19
|
+
*
|
|
20
|
+
* Note:
|
|
21
|
+
* `eventSourceArn` and `target` are managed internally
|
|
22
|
+
*/
|
|
23
|
+
readonly eventSourceMappingOptions?: Omit<EventSourceMappingProps, 'eventSourceArn' | 'target'>;
|
|
24
|
+
}>, 'appName' | 'stage' | 'stackName'> {
|
|
25
|
+
/**
|
|
26
|
+
* Lambda functions to be triggered by SQS messages
|
|
27
|
+
*
|
|
28
|
+
* Each function will be connected via an event source mapping
|
|
29
|
+
*/
|
|
30
|
+
readonly targetFunctions?: Function[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* CDK construct for SQS queue with Lambda integration
|
|
34
|
+
*
|
|
35
|
+
* Responsibilities:
|
|
36
|
+
* - Creates an SQS queue with configurable options
|
|
37
|
+
* - Attaches one or more Lambda consumers via event source mappings
|
|
38
|
+
* - Applies default retry behaviour
|
|
39
|
+
* - Exposes the queue ARN as a CloudFormation output
|
|
40
|
+
*/
|
|
41
|
+
declare class BaseSqsConstruct extends Construct {
|
|
42
|
+
/** The created SQS queue instance */
|
|
43
|
+
readonly queue: Queue;
|
|
44
|
+
/**
|
|
45
|
+
* @param scope Parent construct
|
|
46
|
+
* @param id Unique construct identifier
|
|
47
|
+
* @param props Configuration for queue and Lambda consumers
|
|
48
|
+
*/
|
|
49
|
+
constructor(scope: Construct, id: string, props: ISqsConstructProps);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { BaseSqsConstruct };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Construct } from 'constructs';
|
|
2
|
+
import { Queue, QueueProps } from 'aws-cdk-lib/aws-sqs';
|
|
3
|
+
import { EventSourceMappingProps, Function } from 'aws-cdk-lib/aws-lambda';
|
|
4
|
+
import { IBaseCdkConstructProps } from '../aws-types.js';
|
|
5
|
+
import '@incloodsolutions/toolkit';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props for BaseSqsConstruct
|
|
9
|
+
*
|
|
10
|
+
* Provides configuration for:
|
|
11
|
+
* - SQS queue creation
|
|
12
|
+
* - Lambda event source mappings
|
|
13
|
+
*/
|
|
14
|
+
interface ISqsConstructProps extends Omit<IBaseCdkConstructProps<{
|
|
15
|
+
/** Configuration options for the SQS queue */
|
|
16
|
+
readonly queueOptions?: QueueProps;
|
|
17
|
+
/**
|
|
18
|
+
* Configuration for Lambda event source mapping
|
|
19
|
+
*
|
|
20
|
+
* Note:
|
|
21
|
+
* `eventSourceArn` and `target` are managed internally
|
|
22
|
+
*/
|
|
23
|
+
readonly eventSourceMappingOptions?: Omit<EventSourceMappingProps, 'eventSourceArn' | 'target'>;
|
|
24
|
+
}>, 'appName' | 'stage' | 'stackName'> {
|
|
25
|
+
/**
|
|
26
|
+
* Lambda functions to be triggered by SQS messages
|
|
27
|
+
*
|
|
28
|
+
* Each function will be connected via an event source mapping
|
|
29
|
+
*/
|
|
30
|
+
readonly targetFunctions?: Function[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* CDK construct for SQS queue with Lambda integration
|
|
34
|
+
*
|
|
35
|
+
* Responsibilities:
|
|
36
|
+
* - Creates an SQS queue with configurable options
|
|
37
|
+
* - Attaches one or more Lambda consumers via event source mappings
|
|
38
|
+
* - Applies default retry behaviour
|
|
39
|
+
* - Exposes the queue ARN as a CloudFormation output
|
|
40
|
+
*/
|
|
41
|
+
declare class BaseSqsConstruct extends Construct {
|
|
42
|
+
/** The created SQS queue instance */
|
|
43
|
+
readonly queue: Queue;
|
|
44
|
+
/**
|
|
45
|
+
* @param scope Parent construct
|
|
46
|
+
* @param id Unique construct identifier
|
|
47
|
+
* @param props Configuration for queue and Lambda consumers
|
|
48
|
+
*/
|
|
49
|
+
constructor(scope: Construct, id: string, props: ISqsConstructProps);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { BaseSqsConstruct };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Construct } from 'constructs';
|
|
2
|
+
import { RemovalPolicy, CfnOutput } from 'aws-cdk-lib';
|
|
3
|
+
import { Queue } from 'aws-cdk-lib/aws-sqs';
|
|
4
|
+
import { EventSourceMapping } from 'aws-cdk-lib/aws-lambda';
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var BaseSqsConstruct = class extends Construct {
|
|
9
|
+
static {
|
|
10
|
+
__name(this, "BaseSqsConstruct");
|
|
11
|
+
}
|
|
12
|
+
/** The created SQS queue instance */
|
|
13
|
+
queue;
|
|
14
|
+
/**
|
|
15
|
+
* @param scope Parent construct
|
|
16
|
+
* @param id Unique construct identifier
|
|
17
|
+
* @param props Configuration for queue and Lambda consumers
|
|
18
|
+
*/
|
|
19
|
+
constructor(scope, id, props) {
|
|
20
|
+
super(scope, id);
|
|
21
|
+
this.queue = new Queue(this, id, {
|
|
22
|
+
...props?.options?.queueOptions,
|
|
23
|
+
/**
|
|
24
|
+
* Removal policy applied to the queue
|
|
25
|
+
* Defaults to DESTROY if not explicitly defined
|
|
26
|
+
*/
|
|
27
|
+
removalPolicy: props?.options?.queueOptions?.removalPolicy || RemovalPolicy.DESTROY
|
|
28
|
+
});
|
|
29
|
+
if (props?.targetFunctions?.length) {
|
|
30
|
+
props.targetFunctions.forEach((targetFunction, index) => {
|
|
31
|
+
new EventSourceMapping(this, `${id}-eventSourceMap${index + 1}`, {
|
|
32
|
+
...props?.options?.eventSourceMappingOptions,
|
|
33
|
+
/** Target Lambda function */
|
|
34
|
+
target: targetFunction,
|
|
35
|
+
/** Source SQS queue ARN */
|
|
36
|
+
eventSourceArn: this.queue.queueArn,
|
|
37
|
+
/**
|
|
38
|
+
* Retry attempts for failed batch processing
|
|
39
|
+
* Defaults to 3 if not explicitly defined
|
|
40
|
+
*/
|
|
41
|
+
retryAttempts: props?.options?.eventSourceMappingOptions?.retryAttempts || 3
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
new CfnOutput(this, "SqsQueueArn", {
|
|
46
|
+
value: this.queue.queueArn
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export { BaseSqsConstruct };
|
|
52
|
+
//# sourceMappingURL=sqs.js.map
|
|
53
|
+
//# sourceMappingURL=sqs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/aws/cdk/constructs/sqs-construct.ts"],"names":[],"mappings":";;;;;;;AAqDO,IAAM,gBAAA,GAAN,cAA+B,SAAA,CAAU;AAAA,EArDhD;AAqDgD,IAAA,MAAA,CAAA,IAAA,EAAA,kBAAA,CAAA;AAAA;AAAA;AAAA,EAEtC,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOT,WAAA,CAAY,KAAA,EAAkB,EAAA,EAAY,KAAA,EAA2B;AACpE,IAAA,KAAA,CAAM,OAAO,EAAE,CAAA;AAEf,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAI,KAAA,CAAM,IAAA,EAAM,EAAA,EAAI;AAAA,MAChC,GAAG,OAAO,OAAA,EAAS,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMnB,aAAA,EACC,KAAA,EAAO,OAAA,EAAS,YAAA,EAAc,iBAAiB,aAAA,CAAc;AAAA,KAC9D,CAAA;AAKD,IAAA,IAAI,KAAA,EAAO,iBAAiB,MAAA,EAAQ;AACnC,MAAA,KAAA,CAAM,eAAA,CAAgB,OAAA,CAAQ,CAAC,cAAA,EAAgB,KAAA,KAAU;AACxD,QAAA,IAAI,mBAAmB,IAAA,EAAM,CAAA,EAAG,EAAE,CAAA,eAAA,EAAkB,KAAA,GAAQ,CAAC,CAAA,CAAA,EAAI;AAAA,UAChE,GAAG,OAAO,OAAA,EAAS,yBAAA;AAAA;AAAA,UAGnB,MAAA,EAAQ,cAAA;AAAA;AAAA,UAGR,cAAA,EAAgB,KAAK,KAAA,CAAM,QAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAM3B,aAAA,EACC,KAAA,EAAO,OAAA,EAAS,yBAAA,EAA2B,aAAA,IAAiB;AAAA,SAC7D,CAAA;AAAA,MACF,CAAC,CAAA;AAAA,IACF;AAKA,IAAA,IAAI,SAAA,CAAU,MAAM,aAAA,EAAe;AAAA,MAClC,KAAA,EAAO,KAAK,KAAA,CAAM;AAAA,KAClB,CAAA;AAAA,EACF;AACD","file":"sqs.js","sourcesContent":["import { Construct } from 'constructs';\nimport { CfnOutput, RemovalPolicy } from 'aws-cdk-lib';\nimport { Queue, QueueProps } from 'aws-cdk-lib/aws-sqs';\nimport {\n\tEventSourceMapping,\n\tEventSourceMappingProps,\n\tFunction,\n} from 'aws-cdk-lib/aws-lambda';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseSqsConstruct\n *\n * Provides configuration for:\n * - SQS queue creation\n * - Lambda event source mappings\n */\ninterface ISqsConstructProps extends Omit<\n\tIBaseCdkConstructProps<{\n\t\t/** Configuration options for the SQS queue */\n\t\treadonly queueOptions?: QueueProps;\n\n\t\t/**\n\t\t * Configuration for Lambda event source mapping\n\t\t *\n\t\t * Note:\n\t\t * `eventSourceArn` and `target` are managed internally\n\t\t */\n\t\treadonly eventSourceMappingOptions?: Omit<\n\t\t\tEventSourceMappingProps,\n\t\t\t'eventSourceArn' | 'target'\n\t\t>;\n\t}>,\n\t'appName' | 'stage' | 'stackName'\n> {\n\t/**\n\t * Lambda functions to be triggered by SQS messages\n\t *\n\t * Each function will be connected via an event source mapping\n\t */\n\treadonly targetFunctions?: Function[];\n}\n\n/**\n * CDK construct for SQS queue with Lambda integration\n *\n * Responsibilities:\n * - Creates an SQS queue with configurable options\n * - Attaches one or more Lambda consumers via event source mappings\n * - Applies default retry behaviour\n * - Exposes the queue ARN as a CloudFormation output\n */\nexport class BaseSqsConstruct extends Construct {\n\t/** The created SQS queue instance */\n\treadonly queue: Queue;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for queue and Lambda consumers\n\t */\n\tconstructor(scope: Construct, id: string, props: ISqsConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.queue = new Queue(this, id, {\n\t\t\t...props?.options?.queueOptions,\n\n\t\t\t/**\n\t\t\t * Removal policy applied to the queue\n\t\t\t * Defaults to DESTROY if not explicitly defined\n\t\t\t */\n\t\t\tremovalPolicy:\n\t\t\t\tprops?.options?.queueOptions?.removalPolicy || RemovalPolicy.DESTROY,\n\t\t});\n\n\t\t/**\n\t\t * Attach Lambda event source mappings for queue consumption\n\t\t */\n\t\tif (props?.targetFunctions?.length) {\n\t\t\tprops.targetFunctions.forEach((targetFunction, index) => {\n\t\t\t\tnew EventSourceMapping(this, `${id}-eventSourceMap${index + 1}`, {\n\t\t\t\t\t...props?.options?.eventSourceMappingOptions,\n\n\t\t\t\t\t/** Target Lambda function */\n\t\t\t\t\ttarget: targetFunction,\n\n\t\t\t\t\t/** Source SQS queue ARN */\n\t\t\t\t\teventSourceArn: this.queue.queueArn,\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Retry attempts for failed batch processing\n\t\t\t\t\t * Defaults to 3 if not explicitly defined\n\t\t\t\t\t */\n\t\t\t\t\tretryAttempts:\n\t\t\t\t\t\tprops?.options?.eventSourceMappingOptions?.retryAttempts || 3,\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * CloudFormation output exposing the SQS queue ARN\n\t\t */\n\t\tnew CfnOutput(this, 'SqsQueueArn', {\n\t\t\tvalue: this.queue.queueArn,\n\t\t});\n\t}\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var constructs = require('constructs');
|
|
4
|
+
var awsCdkLib = require('aws-cdk-lib');
|
|
5
|
+
var awsEc2 = require('aws-cdk-lib/aws-ec2');
|
|
6
|
+
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
+
var BaseVpcConstruct = class extends constructs.Construct {
|
|
10
|
+
static {
|
|
11
|
+
__name(this, "BaseVpcConstruct");
|
|
12
|
+
}
|
|
13
|
+
/** The created VPC instance */
|
|
14
|
+
vpc;
|
|
15
|
+
/**
|
|
16
|
+
* @param scope Parent construct
|
|
17
|
+
* @param id Unique construct identifier
|
|
18
|
+
* @param props Configuration for VPC
|
|
19
|
+
*/
|
|
20
|
+
constructor(scope, id, props) {
|
|
21
|
+
super(scope, id);
|
|
22
|
+
this.vpc = new awsEc2.Vpc(this, id, {
|
|
23
|
+
...props.options.vpcOptions
|
|
24
|
+
});
|
|
25
|
+
new awsCdkLib.CfnOutput(this, "VpcArn", {
|
|
26
|
+
value: this.vpc.vpcArn
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
exports.BaseVpcConstruct = BaseVpcConstruct;
|
|
32
|
+
//# sourceMappingURL=vpc.cjs.map
|
|
33
|
+
//# sourceMappingURL=vpc.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/aws/cdk/constructs/vpc-construct.ts"],"names":["Construct","Vpc","CfnOutput"],"mappings":";;;;;;;;AA0BO,IAAM,gBAAA,GAAN,cAA+BA,oBAAA,CAAU;AAAA,EA1BhD;AA0BgD,IAAA,MAAA,CAAA,IAAA,EAAA,kBAAA,CAAA;AAAA;AAAA;AAAA,EAEtC,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOT,WAAA,CAAY,KAAA,EAAkB,EAAA,EAAY,KAAA,EAA2B;AACpE,IAAA,KAAA,CAAM,OAAO,EAAE,CAAA;AAEf,IAAA,IAAA,CAAK,GAAA,GAAM,IAAIC,UAAA,CAAI,IAAA,EAAM,EAAA,EAAI;AAAA,MAC5B,GAAG,MAAM,OAAA,CAAQ;AAAA,KACjB,CAAA;AAKD,IAAA,IAAIC,mBAAA,CAAU,MAAM,QAAA,EAAU;AAAA,MAC7B,KAAA,EAAO,KAAK,GAAA,CAAI;AAAA,KAChB,CAAA;AAAA,EACF;AACD","file":"vpc.cjs","sourcesContent":["import { Construct } from 'constructs';\nimport { CfnOutput } from 'aws-cdk-lib';\nimport { Vpc, VpcProps } from 'aws-cdk-lib/aws-ec2';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseVpcConstruct\n *\n * Provides configuration for creating a VPC.\n */\ninterface IVpcConstructProps extends Omit<\n\tIBaseCdkConstructProps<{\n\t\t/** VPC configuration options */\n\t\treadonly vpcOptions: VpcProps;\n\t}>,\n\t'appName' | 'stage' | 'stackName'\n> {}\n\n/**\n * CDK construct for Virtual Private Cloud (VPC)\n *\n * Responsibilities:\n * - Creates a VPC with configurable options\n * - Exposes the VPC ARN as a CloudFormation output\n */\nexport class BaseVpcConstruct extends Construct {\n\t/** The created VPC instance */\n\treadonly vpc: Vpc;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for VPC\n\t */\n\tconstructor(scope: Construct, id: string, props: IVpcConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.vpc = new Vpc(this, id, {\n\t\t\t...props.options.vpcOptions,\n\t\t});\n\n\t\t/**\n\t\t * CloudFormation output exposing the VPC ARN\n\t\t */\n\t\tnew CfnOutput(this, 'VpcArn', {\n\t\t\tvalue: this.vpc.vpcArn,\n\t\t});\n\t}\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Construct } from 'constructs';
|
|
2
|
+
import { Vpc, VpcProps } from 'aws-cdk-lib/aws-ec2';
|
|
3
|
+
import { IBaseCdkConstructProps } from '../aws-types.cjs';
|
|
4
|
+
import '@incloodsolutions/toolkit';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Props for BaseVpcConstruct
|
|
8
|
+
*
|
|
9
|
+
* Provides configuration for creating a VPC.
|
|
10
|
+
*/
|
|
11
|
+
interface IVpcConstructProps extends Omit<IBaseCdkConstructProps<{
|
|
12
|
+
/** VPC configuration options */
|
|
13
|
+
readonly vpcOptions: VpcProps;
|
|
14
|
+
}>, 'appName' | 'stage' | 'stackName'> {
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* CDK construct for Virtual Private Cloud (VPC)
|
|
18
|
+
*
|
|
19
|
+
* Responsibilities:
|
|
20
|
+
* - Creates a VPC with configurable options
|
|
21
|
+
* - Exposes the VPC ARN as a CloudFormation output
|
|
22
|
+
*/
|
|
23
|
+
declare class BaseVpcConstruct extends Construct {
|
|
24
|
+
/** The created VPC instance */
|
|
25
|
+
readonly vpc: Vpc;
|
|
26
|
+
/**
|
|
27
|
+
* @param scope Parent construct
|
|
28
|
+
* @param id Unique construct identifier
|
|
29
|
+
* @param props Configuration for VPC
|
|
30
|
+
*/
|
|
31
|
+
constructor(scope: Construct, id: string, props: IVpcConstructProps);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { BaseVpcConstruct };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Construct } from 'constructs';
|
|
2
|
+
import { Vpc, VpcProps } from 'aws-cdk-lib/aws-ec2';
|
|
3
|
+
import { IBaseCdkConstructProps } from '../aws-types.js';
|
|
4
|
+
import '@incloodsolutions/toolkit';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Props for BaseVpcConstruct
|
|
8
|
+
*
|
|
9
|
+
* Provides configuration for creating a VPC.
|
|
10
|
+
*/
|
|
11
|
+
interface IVpcConstructProps extends Omit<IBaseCdkConstructProps<{
|
|
12
|
+
/** VPC configuration options */
|
|
13
|
+
readonly vpcOptions: VpcProps;
|
|
14
|
+
}>, 'appName' | 'stage' | 'stackName'> {
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* CDK construct for Virtual Private Cloud (VPC)
|
|
18
|
+
*
|
|
19
|
+
* Responsibilities:
|
|
20
|
+
* - Creates a VPC with configurable options
|
|
21
|
+
* - Exposes the VPC ARN as a CloudFormation output
|
|
22
|
+
*/
|
|
23
|
+
declare class BaseVpcConstruct extends Construct {
|
|
24
|
+
/** The created VPC instance */
|
|
25
|
+
readonly vpc: Vpc;
|
|
26
|
+
/**
|
|
27
|
+
* @param scope Parent construct
|
|
28
|
+
* @param id Unique construct identifier
|
|
29
|
+
* @param props Configuration for VPC
|
|
30
|
+
*/
|
|
31
|
+
constructor(scope: Construct, id: string, props: IVpcConstructProps);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { BaseVpcConstruct };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Construct } from 'constructs';
|
|
2
|
+
import { CfnOutput } from 'aws-cdk-lib';
|
|
3
|
+
import { Vpc } from 'aws-cdk-lib/aws-ec2';
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var BaseVpcConstruct = class extends Construct {
|
|
8
|
+
static {
|
|
9
|
+
__name(this, "BaseVpcConstruct");
|
|
10
|
+
}
|
|
11
|
+
/** The created VPC instance */
|
|
12
|
+
vpc;
|
|
13
|
+
/**
|
|
14
|
+
* @param scope Parent construct
|
|
15
|
+
* @param id Unique construct identifier
|
|
16
|
+
* @param props Configuration for VPC
|
|
17
|
+
*/
|
|
18
|
+
constructor(scope, id, props) {
|
|
19
|
+
super(scope, id);
|
|
20
|
+
this.vpc = new Vpc(this, id, {
|
|
21
|
+
...props.options.vpcOptions
|
|
22
|
+
});
|
|
23
|
+
new CfnOutput(this, "VpcArn", {
|
|
24
|
+
value: this.vpc.vpcArn
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { BaseVpcConstruct };
|
|
30
|
+
//# sourceMappingURL=vpc.js.map
|
|
31
|
+
//# sourceMappingURL=vpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/aws/cdk/constructs/vpc-construct.ts"],"names":[],"mappings":";;;;;;AA0BO,IAAM,gBAAA,GAAN,cAA+B,SAAA,CAAU;AAAA,EA1BhD;AA0BgD,IAAA,MAAA,CAAA,IAAA,EAAA,kBAAA,CAAA;AAAA;AAAA;AAAA,EAEtC,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOT,WAAA,CAAY,KAAA,EAAkB,EAAA,EAAY,KAAA,EAA2B;AACpE,IAAA,KAAA,CAAM,OAAO,EAAE,CAAA;AAEf,IAAA,IAAA,CAAK,GAAA,GAAM,IAAI,GAAA,CAAI,IAAA,EAAM,EAAA,EAAI;AAAA,MAC5B,GAAG,MAAM,OAAA,CAAQ;AAAA,KACjB,CAAA;AAKD,IAAA,IAAI,SAAA,CAAU,MAAM,QAAA,EAAU;AAAA,MAC7B,KAAA,EAAO,KAAK,GAAA,CAAI;AAAA,KAChB,CAAA;AAAA,EACF;AACD","file":"vpc.js","sourcesContent":["import { Construct } from 'constructs';\nimport { CfnOutput } from 'aws-cdk-lib';\nimport { Vpc, VpcProps } from 'aws-cdk-lib/aws-ec2';\n\nimport { IBaseCdkConstructProps } from '../../types';\n\n/**\n * Props for BaseVpcConstruct\n *\n * Provides configuration for creating a VPC.\n */\ninterface IVpcConstructProps extends Omit<\n\tIBaseCdkConstructProps<{\n\t\t/** VPC configuration options */\n\t\treadonly vpcOptions: VpcProps;\n\t}>,\n\t'appName' | 'stage' | 'stackName'\n> {}\n\n/**\n * CDK construct for Virtual Private Cloud (VPC)\n *\n * Responsibilities:\n * - Creates a VPC with configurable options\n * - Exposes the VPC ARN as a CloudFormation output\n */\nexport class BaseVpcConstruct extends Construct {\n\t/** The created VPC instance */\n\treadonly vpc: Vpc;\n\n\t/**\n\t * @param scope Parent construct\n\t * @param id Unique construct identifier\n\t * @param props Configuration for VPC\n\t */\n\tconstructor(scope: Construct, id: string, props: IVpcConstructProps) {\n\t\tsuper(scope, id);\n\n\t\tthis.vpc = new Vpc(this, id, {\n\t\t\t...props.options.vpcOptions,\n\t\t});\n\n\t\t/**\n\t\t * CloudFormation output exposing the VPC ARN\n\t\t */\n\t\tnew CfnOutput(this, 'VpcArn', {\n\t\t\tvalue: this.vpc.vpcArn,\n\t\t});\n\t}\n}\n"]}
|