Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh committed Nov 26, 2024
1 parent 6ebe9a2 commit 98e7cb2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion nightly-playground/lib/nightly-playground-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class NightlyPlaygroundStack {

const wafStack = new NightlyPlaygroundWAF(scope, 'wafStack', {
...props,
ngnixLoadBalancer: routingStack.alb,
nginxLoadBalancer: routingStack.alb,
});

this.stacks.push(wafStack);
Expand Down
16 changes: 8 additions & 8 deletions nightly-playground/lib/routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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\''),
Expand All @@ -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;
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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'),
Expand Down
6 changes: 3 additions & 3 deletions nightly-playground/lib/waf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,16 @@ export class WebACLAssociation extends CfnWebACLAssociation {
}

export interface WafProps extends StackProps{
ngnixLoadBalancer: ApplicationLoadBalancer;
nginxLoadBalancer: ApplicationLoadBalancer;
}

export class NightlyPlaygroundWAF extends Stack {
constructor(scope: Construct, id: string, props: WafProps) {
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,
});
}
Expand Down
2 changes: 1 addition & 1 deletion nightly-playground/test/nightly-playground.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 98e7cb2

Please sign in to comment.