1
- import { aws_ec2 as ec2 } from 'aws-cdk-lib'
1
+ import type { Cluster , TaskDefinition } from 'aws-cdk-lib'
2
+ import { CfnOutput as Output , Size , aws_batch as batch , aws_ec2 as ec2 , aws_ecs as ecs } from 'aws-cdk-lib'
3
+ import { path as p } from '@stacksjs/path'
4
+ import type { Construct } from 'constructs'
2
5
import { Rule , Schedule } from 'aws-cdk-lib/aws-events'
3
6
import { EcsTask } from 'aws-cdk-lib/aws-events-targets'
4
- import type { Cluster , TaskDefinition } from 'aws-cdk-lib/aws-ecs'
5
- import type { Construct } from 'constructs'
6
7
import type { NestedCloudProps } from '../types'
7
8
8
9
export interface QueueStackProps extends NestedCloudProps {
@@ -12,11 +13,10 @@ export interface QueueStackProps extends NestedCloudProps {
12
13
13
14
export class QueueStack {
14
15
constructor ( scope : Construct , props : QueueStackProps ) {
15
- const rule = new Rule ( scope , 'Rule ' , {
16
+ const rule = new Rule ( scope , 'QueueRule ' , {
16
17
// schedule to run every second
17
18
ruleName : `${ props . appName } -${ props . appEnv } -queue` ,
18
19
schedule : Schedule . cron ( { minute : '*' , hour : '*' , month : '*' , weekDay : '*' , year : '*' } ) ,
19
- // schedule: Schedule.cron({ minute: '0', hour: '0' }), // For example, every day at midnight
20
20
} )
21
21
22
22
rule . addTarget ( new EcsTask ( {
@@ -37,9 +37,11 @@ export class QueueStack {
37
37
] ,
38
38
} ,
39
39
] ,
40
+
40
41
retryAttempts : 3 ,
42
+
41
43
subnetSelection : {
42
- subnetType : ec2 . SubnetType . PUBLIC ,
44
+ subnetType : ec2 . SubnetType . PUBLIC , // SubnetType.PRIVATE_WITH_EGRESS
43
45
} ,
44
46
} ) )
45
47
}
0 commit comments