Skip to content

Instantly share code, notes, and snippets.

View danieldspx's full-sized avatar
:octocat:

Daniel dos Santos Pereira danieldspx

:octocat:
View GitHub Profile
const taskDefinition = new awsx.ecs.EC2TaskDefinition('nginx-task-def', {
// The network mode is host because the networking of the container is tied directly to the underlying host that's running the container.
// Note that this brings a lot of problems, but for simplicity we will make it this way. Tipically you would
// choose bridge mode and use random hostPorts (by setting it to zero on the portMappings) and register it into some
// target group and then in a Load Balancer.
networkMode: 'host',
containers: {
nginx: {
image: awsx.ecs.Image.fromDockerBuild('nginx-img', {
// context is a path to a directory to use for the Docker build context, usually the directory in which the Dockerfile resides
@danieldspx
danieldspx / pulumi-infra.ts
Last active June 7, 2024 08:26
An example that creates a ECS Cluster + Capacity provider with EC2 instances managed by a Auto Scaling group
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
import * as random from "@pulumi/random";
const vpc = awsx.ec2.Vpc.getDefault();
const clusterName = 'dev-cluster';
// Create a random string that will be used to create the cluester name.
// This is usefull to avoid collision with existing clusters.
@danieldspx
danieldspx / git.md
Created December 5, 2017 03:37 — forked from leocomelli/git.md
Lista de comandos úteis do GIT

#GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda