Skip to content

Commit

Permalink
Updated the cloudWatch filter to be more specific
Browse files Browse the repository at this point in the history
With this new filter only the DNS calls made by a minecraft client
triggers the start of the minecraft server
  • Loading branch information
AndresArcones authored and Colduck committed Mar 27, 2023
1 parent 7c0bd38 commit 877f480
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cdk/lib/domain-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@ export class DomainStack extends Stack {
* Create our log subscription filter to catch any log events containing
* our subdomain name and send them to our launcher lambda.
*/
const dnsFilterPattern = `_${config.subdomainPart}._tcp.${config.subdomainPart}.${config.domainName}`;

queryLogGroup.addSubscriptionFilter('SubscriptionFilter', {
destination: new logDestinations.LambdaDestination(launcherLambda),
filterPattern: logs.FilterPattern.anyTerm(subdomain),
filterPattern: logs.FilterPattern.anyTerm(dnsFilterPattern),
});

/**
Expand Down

0 comments on commit 877f480

Please sign in to comment.