This is an episode of the educational video series 'AWS By Doing' wherein you can learn AWS ECS with EFS by following along with an AWS certified Solutions Architect. Expect new episodes every Monday and Thursday!
This is a hands-on lab on: AWS ECS with EFS
Create a Key Pair to SSH into an EC2 Instance
Create an ECS Cluster
Create a Security Group for EFS file system
Create an EFS file system
Launch an EC2 instance that mounts the EFS file system
SSH into the EC2 Instance to add content to the EFS file system
Create an ECS Task Definition
Run an ECS Task and view the results
Modify the content of the EFS file system
Review the ECS Task results
Delete all created resources
Please give a thumbs up to this video to encourage us and share this video with your friends and colleagues! Also, subscribe to this channel 'AWS By Doing' and we will update you regularly with our LATEST and GREATEST offerings! Write in a comment of what you liked and how we can improve!
Link to our Playlist:
• AWS Labs | Intro to AW...
We acknowledge and thank the official AWS Documentation material which we have used to produce this educational video.
Link to AWS documentation:
docs.aws.amazon.com/AmazonECS...
Links/Commands/Code Snippets:
To connect to your instance using SSH
From a terminal window, navigate to your key pair folder
and run the ssh command:
ssh -i my-key-pair.pem my-instance-user-name@my-instance-public-dns-name
Command to verify that the Amazon EFS file system is mounted:
df -T
cd /mnt/efs/fs1
Create a file named index.html:
sudo nano index.html
Content of index.html:
//-- Replace '[' with 'less than' symbol AND ']' with 'greater than' symbol
[html]
[body]
[h1]It Works![/h1]
[p]You are using an Amazon EFS file system for persistent container storage.[/p]
[/body]
[/html]
[right-click]
[ctrl-x] y [enter]
Check out index.html:
ls
cat index.html
//----Start of Task Definition JSON--Copy from below this line----
{
"containerDefinitions": [
{
"memory": 128,
"portMappings": [
{
"hostPort": 80,
"containerPort": 80,
"protocol": "tcp"
}
],
"essential": true,
"mountPoints": [
{
"containerPath": "/usr/share/nginx/html",
"sourceVolume": "efs-html"
}
],
"name": "nginx",
"image": "nginx"
}
],
"volumes": [
{
"name": "efs-html",
"efsVolumeConfiguration": {
"fileSystemId": "fs-1324abcd",
"transitEncryption": "ENABLED"
}
}
],
"family": "efs-tutorial"
}
//----End of Task Definition JSON--Copy till above this line----
Commands to Unmount the EFS file system:
In the terminal of your instance, navigate to your home page:
cd ~
df -T
sudo umount /mnt/efs/fs1
df -T
logout
exit
Негізгі бет AWS Lab ECS with EFS | AWS Practice Hands on | Elastic Container Service
Пікірлер: 10