Skip to content

Instantly share code, notes, and snippets.

View fortejas's full-sized avatar

Jason fortejas

View GitHub Profile
@fortejas
fortejas / README.md
Created May 21, 2021 16:12
EKS Bare Metal with CPU Manager Configured

Setup for EKS Bare Metal with CPU Manager Configured

This provisions an EKS cluster with CPU Management Policies confiured to static.

The instance type in the node group is m5.metal.

Setup

$ # Provision EKS Cluster
@fortejas
fortejas / README.md
Last active February 25, 2021 16:07
Using Secrets per Environment with CoPilot CLI

Using Secrets per Environment with CoPilot CLI

This assumes that we have a CoPilot app called test-app and both a test & prod environment configured.

  1. Start by uploading environment variables for our application's environments

    $ # Test Param
    $ aws ssm put-parameter \
@fortejas
fortejas / Dockerfile
Last active April 13, 2022 08:34
Python script to catch the Docker SIGTERM signal
FROM python:3-onbuild
EXPOSE 8000
CMD ["./server.py"]
@fortejas
fortejas / block-metadata.sh
Created November 6, 2019 08:50
Block Access to EC2 Metadata Service on ECS Optimized AMIs
#!/usr/bin/env bash
#
# Prevent access to the metadata endpoint from docker containers in Amazon Linux and Amazon Linux 2
#
printf "Creating /bin/update-iptables.sh"
cat <<EOF | tee /bin/update-iptables.sh
#!/usr/bin/env bash
@fortejas
fortejas / App.java
Created September 25, 2019 08:38
Sample - Accessing AWS Credentials from a container
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package app;
import java.util.List;
import software.amazon.awssdk.services.s3.model.Bucket;
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.services.sts.StsClient;
import software.amazon.awssdk.services.sts.model.GetCallerIdentityResponse;
@fortejas
fortejas / aws-app-mesh-ec2.yaml
Created July 9, 2019 08:37
AWS Example - App Mesh on EC2 with CloudFormation
# Copyright 2019 Amazon Web Services
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,