- Install AWSCLIv2
- Login to AWS Management Console and Generate a new KeyPair.
- Save the downloaded key
- Configure AWS Command Line Interface (AWS CLI) with a new AWS Access Key and a secret generated on AWS
- Update the ec2_stack.yml and ec2_instance if you're using this template for your application
- Use AWS CLI to run create-stack command that'll create all the resources defined in the ec2_stack.yml
- Folder cloud_formation_template - Creates an EC2 instance and a Security Group, using AWS CloudFormation. All commands below are to be run from your command line.
- Create stack
aws cloudformation create-stack --stack-name App-Node-EC2 --template-body file://$PWD/ec2_stack.yaml
- Delete stack
aws cloudformation delete-stack \ --stack-name App-Node-EC2
- Update stack
aws cloudformation update-stack --stack-name App-Node-EC2 --template-body file://$PWD/ecr.yaml
- Folder terraform - Creates an EC2 instance and a Security Group, using AWS Terraform.
- Make sure terraform is install and add to your path.
- Plan infrastruture -
terraform init && terraform plan
- Create infrastruture -
terraform apply
- Destroy infrastruture -
terraform destroy
mkdir ~/devops-project git clone git@github.com:CodingBlackFemales/devops-cloud-project.git cd devops-cloud-project
cp ~/Downloads/aws-key1.pem ./ chmod 400 aws-key1.pem
On AWS CLI, Create a new user with programatic access which will generate a new Access Key & Secret. With that,
aws configure
aws cloudformation create-stack --stack-name App-Node-EC2 --template-body file://$PWD/ec2_stack.yml
ssh -i aws-key1.pem ubuntu@
export DOCKER_HOST=tcp://35.160.122.95:2375 docker ps -a
aws cloudformation delete-stack --stack-name App-Node-EC2