diff --git a/nightly-playground/lib/nightly-playground-stack.ts b/nightly-playground/lib/nightly-playground-stack.ts index fae2318..fc730a8 100644 --- a/nightly-playground/lib/nightly-playground-stack.ts +++ b/nightly-playground/lib/nightly-playground-stack.ts @@ -117,7 +117,7 @@ export class NightlyPlaygroundStack { const wafStack = new NightlyPlaygroundWAF(scope, 'wafStack', { ...props, - ngnixLoadBalancer: routingStack.alb, + nginxLoadBalancer: routingStack.alb, }); this.stacks.push(wafStack); diff --git a/nightly-playground/lib/routing.ts b/nightly-playground/lib/routing.ts index 04fba19..9340e3b 100644 --- a/nightly-playground/lib/routing.ts +++ b/nightly-playground/lib/routing.ts @@ -50,7 +50,7 @@ export class Routing extends Stack { certificates: [ListenerCertificate.fromArn(props.certificateArn)], }); - const ngnix = new AutoScalingGroup(this, 'ngnixBasedRouting', { + const nginx = new AutoScalingGroup(this, 'nginxBasedRouting', { vpc: props.vpc, instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.LARGE), machineImage: MachineImage.latestAmazonLinux({ @@ -72,18 +72,18 @@ export class Routing extends Stack { signals: Signals.waitForAll(), }); - listener.addTargets('ngnixTargetGroup', { + listener.addTargets('nginxTargetGroup', { port: 443, protocol: ApplicationProtocol.HTTPS, healthCheck: { port: '443', path: '/', }, - targets: [ngnix], + targets: [nginx], }); } - private static getCfnInitElement(ngnixProps: RoutingProps): InitElement[] { + private static getCfnInitElement(nginxProps: RoutingProps): InitElement[] { const cfnInitConfig: InitElement[] = [ InitCommand.shellCommand('amazon-linux-extras install nginx1.12 -y'), InitCommand.shellCommand('openssl req -x509 -nodes -newkey rsa:4096 -keyout /etc/nginx/cert.key -out /etc/nginx/cert.crt -days 365 -subj \'/CN=SH\''), @@ -92,7 +92,7 @@ export class Routing extends Stack { server { listen 443; - server_name ${ngnixProps.domainName}; + server_name ${nginxProps.domainName}; ssl_certificate /etc/nginx/cert.crt; ssl_certificate_key /etc/nginx/cert.key; @@ -104,7 +104,7 @@ export class Routing extends Stack { ssl_prefer_server_ciphers on; location ^~ /2x { - proxy_pass https://${ngnixProps.endpoint2x}/2x; + proxy_pass https://${nginxProps.endpoint2x}/2x; proxy_set_header X-Real-IP $remote_addr; # Set the X-Real-IP header proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Set the X-Forwarded-For header proxy_set_header X-Forwarded-Proto $scheme; # Set the X-Forwarded-Proto header @@ -113,7 +113,7 @@ export class Routing extends Stack { proxy_busy_buffers_size 256k; } location ^~ /3x { - proxy_pass https://${ngnixProps.endpoint3x}/3x; + proxy_pass https://${nginxProps.endpoint3x}/3x; proxy_set_header X-Real-IP $remote_addr; # Set the X-Real-IP header proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Set the X-Forwarded-For header proxy_set_header X-Forwarded-Proto $scheme; # Set the X-Forwarded-Proto header @@ -122,7 +122,7 @@ export class Routing extends Stack { proxy_busy_buffers_size 256k; } }`), - InitFile.fromFileInline('/usr/share/nginx/html/index_nightly.html', join(__dirname, '../resources/assets/ngnix-index.html')), + InitFile.fromFileInline('/usr/share/nginx/html/index_nightly.html', join(__dirname, '../resources/assets/nginx-index.html')), InitCommand.shellCommand('cp /usr/share/nginx/html/index_nightly.html /usr/share/nginx/html/index.html'), InitCommand.shellCommand('sudo systemctl start nginx'), InitCommand.shellCommand('sudo systemctl enable nginx'), diff --git a/nightly-playground/lib/waf.ts b/nightly-playground/lib/waf.ts index a8cf927..65fa2f5 100644 --- a/nightly-playground/lib/waf.ts +++ b/nightly-playground/lib/waf.ts @@ -105,7 +105,7 @@ export class WebACLAssociation extends CfnWebACLAssociation { } export interface WafProps extends StackProps{ - ngnixLoadBalancer: ApplicationLoadBalancer; + nginxLoadBalancer: ApplicationLoadBalancer; } export class NightlyPlaygroundWAF extends Stack { @@ -113,8 +113,8 @@ export class NightlyPlaygroundWAF extends Stack { super(scope, id, props); const waf = new WAF(this, 'WAFv2'); // Create an association with the alb - new WebACLAssociation(this, 'wafALBassociation-ngnix', { - resourceArn: props.ngnixLoadBalancer.loadBalancerArn, + new WebACLAssociation(this, 'wafALBassociation-nginx', { + resourceArn: props.nginxLoadBalancer.loadBalancerArn, webAclArn: waf.attrArn, }); } diff --git a/nightly-playground/resources/assets/ngnix-index.html b/nightly-playground/resources/assets/nginx-index.html similarity index 100% rename from nightly-playground/resources/assets/ngnix-index.html rename to nightly-playground/resources/assets/nginx-index.html diff --git a/nightly-playground/test/nightly-playground.test.ts b/nightly-playground/test/nightly-playground.test.ts index b7115b2..aa76ee9 100644 --- a/nightly-playground/test/nightly-playground.test.ts +++ b/nightly-playground/test/nightly-playground.test.ts @@ -239,7 +239,7 @@ test('Ensure port mapping', () => { }); }); -test('ngnix load balancer and ASG resources', () => { +test('nginx load balancer and ASG resources', () => { const app = new App({ context: { distVersion: '2.3.0',