AWS Lab ECS with EFS | AWS Practice Hands on | Elastic Container Service
ฝัง
- เผยแพร่เมื่อ 22 ส.ค. 2020
- 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
Great hands on, Mr. Vasudevan. I was hoping you'd use EFS Access Points but this is nice, too. Thank you for the detailed walkthrough and I look forward to seeing more content.
P.S: Please consider adding a Patreon or PayPal email address in the description, so that interested people could donate for your work.
Thank you so much for your kind feedback, and the suggestions! We'll definitely look into them. Glad we could be of service to you!
Great content. Thank you
Glad you liked it, Mohammed! Enjoy the rest of your AWS journey!
Great work sir. thanks for all the contents
You're Welcome, Karthikeyan!
Very nice sir
Thank you for watching and stay tuned for more :)
y do we need efs already we are dockarizing and placing the html file in docker image
Hi Naresh,
We appreciate your comment on our video :)
Typically, the use case for EFS is a shared web application data file storage system accessed by multiple EC2 instances launched due to Load Balancing.
Please feel free to reach out for further questions/concerns :)