Skip to content

Commit

Permalink
Test removing test env
Browse files Browse the repository at this point in the history
  • Loading branch information
namse authored Dec 4, 2023
1 parent 6b6b91f commit 32842a2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/oioi-agent-image-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@ jobs:
exit 1
fi
aws cloudformation delete-stack --stack-name $STACK_NAME
# aws cloudformation delete-stack --stack-name $STACK_NAME
14 changes: 7 additions & 7 deletions oioi/cdk/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,23 @@ export class Oioi extends Construct {
},
);

const logRemovalPolicy = props.logRemovalPolicy ?? cdk.RemovalPolicy.DESTROY;
const logRetention = props.logRetention ?? cdk.aws_logs.RetentionDays.ONE_WEEK;

const systemMessagesLogGroup = new cdk.aws_logs.LogGroup(
this,
"SystemMessagesLogGroup",
{
logGroupName: `/oioi/${props.groupName}/system_messages-${stackUuid}`,
retention:
props.logRetention ?? cdk.aws_logs.RetentionDays.ONE_WEEK,
removalPolicy:
props.logRemovalPolicy ?? cdk.RemovalPolicy.RETAIN,
retention: logRetention,
removalPolicy: logRemovalPolicy,
},
);

const agentLogGroup = new cdk.aws_logs.LogGroup(this, "AgentLogGroup", {
logGroupName: `/oioi/${props.groupName}/agent-${stackUuid}`,
retention:
props.logRetention ?? cdk.aws_logs.RetentionDays.ONE_WEEK,
removalPolicy: props.logRemovalPolicy ?? cdk.RemovalPolicy.RETAIN,
retention: logRetention,
removalPolicy: logRemovalPolicy,
});

const imageUri = (() => {
Expand Down
5 changes: 3 additions & 2 deletions oioi/oioi-test-cdk/lib/oioi-test-cdk-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export class OioiTestCdkStack extends cdk.Stack {
file: "sample.Dockerfile",
platform: cdk.aws_ecr_assets.Platform.LINUX_ARM64,
outputs: ["type=docker"],

});

const { vpc, autoScalingGroup, alb } = new oioi.Oioi(this, "Oioi", {
Expand Down Expand Up @@ -106,11 +107,11 @@ def handler(event, context):
const now = new Date();
const minutes = now.getMinutes();

const minus5Minutes = (60 + (minutes - 5)) % 60;
const plus30Minutes = (60 + (minutes + 30)) % 60;

new cdk.aws_events.Rule(this, "Rule", {
schedule: cdk.aws_events.Schedule.cron({
minute: minus5Minutes.toString(),
minute: plus30Minutes.toString(),
hour: "*",
}),
targets: [new cdk.aws_events_targets.LambdaFunction(lambda)],
Expand Down

0 comments on commit 32842a2

Please sign in to comment.