当前位置: 首页 > news >正文

国际网课平台Udemy上的亚马逊云科技AWS免费高分课程和创建、维护EC2动手实践

亚马逊云科技(AWS)是全球云行业最🔥火的云平台,在全球经济形势不好的大背景下,通过网课学习亚马逊云科技AWS基础备考亚马逊云科技AWS证书,对于找工作或者无背景转行做AWS帮助巨大。欢迎大家关注小李哥,及时了解世界最前沿的云计算、AI技术,快速成为国际云计算的专家。

什么是Udemy?

Udemy作为全球最大、最优质的网课平台之一,上面有非常多优质的亚马逊云科技AWS课程。但Udemy上的亚马逊云科技AWS课程最便宜的也要几十刀,最贵能到上百刀,十分昂贵。今天小李哥就给大家盘点全网最全的 Udemy上AWS免费高分课程大合集(选择标准为:评分4.4/5左右,好评500左右的课程)。

推荐优质学习资源

小李哥按课程方向类别给大家做了推荐,大家根据自己的需求选择。大家参考中的课程编号(非图1编号),排序为评分从高➡️低的排名

1️⃣ 用于AWS证书备考

3号Serverless computing in AWS: 适合云从业者(4.6分)

11号AWS VPC Transit Gateway - Hands On Learning! :适合助理级架构师(4.4分)

2️⃣ 适合无背景的AWS小白学习的课程

以下几门课程适用于完全没有背景的非IT人员(销售、市场等)、或者有初级背景的云计算从业者

4 AWS Certified Solutions Architect Associate Introduction(4.6分)

5 Amazon Web Services - Learning and Implementing AWS Solution(4.5分)

6 All About AWS Lambda and Serverless(4.5分)

9 Amazon Web Services (AWS) EC2: An Introduction(4.4分)

13 A Practical Introduction to Cloud Computing(4.3分)

3️⃣ AWS Serverless服务(适合云上软件开发)

7 AWS Tutorials - DynamoDB and Database Migration Service(4.4分)

8 Multitier architecture with AWS(4.4分)

15 AWS + Serverless(4.0分)

4️⃣ AWS网络(适合网络工程师/DevOps)

2 Amazon Web Services (AWS) - Zero to Hero(4.7分)

5️⃣ AWS架构/系统设计(适合☁️上开发/架构师)

12 Cloud Computing With Amazon Web Services(4.3分)

6️⃣ AWS DynamoDB and DMS (适合☁️数据岗)

1 Starting your Career with Amazon AWS(4.7分)

7️⃣ AWS cloudformation (软件定义代码、适合云上开发/DevOps)

14 Introduction to Cloud Computing for Beginners in 30 mins(4.2分)

8️⃣ AWS EC2 (适合云上DevOps/SysOps)

10 Amazon Web Services (AWS): CloudFormation(4.4分)

Udemy上的免费动手实验讲解:

今天给大家介绍的是如何用AWS Boto3 Python SDK创建EC2

首先我们安装Boto 3 SDK:

pip install awscli boto3

然后我们本地配置AWS的秘钥key

aws configure

示例输入:

$ aws configure
AWS Access Key ID [None]: ABCDEFGHIJKLMNOPQRST
AWS Secret Access Key [None]: abcdefghijklmnopqrstuvwxyz1234567890
Default region name [None]: us-west-2
Default output format [None]: json

接下来我们使用Python配置登录EC2服务器的SSH key pair:

import boto3
ec2 = boto3.resource('ec2')# create a file to store the key locally
outfile = open('ec2-keypair.pem','w')# call the boto ec2 function to create a key pair
key_pair = ec2.create_key_pair(KeyName='ec2-keypair')# capture the key and store it in a file
KeyPairOut = str(key_pair.key_material)
print(KeyPairOut)
outfile.write(KeyPairOut)

创建成功后,我们利用Python创建一个EC2服务器,同时在EC2创建时启动NGINX。

import boto3ec2 = boto3.resource('ec2')# User data script to install Nginx
user_data_script = """#!/bin/bash
sudo apt-get update
sudo apt-get install -y nginx
sudo service nginx start
"""# Create a new EC2 instance
instances = ec2.create_instances(ImageId='ami-00b6a8a2bd28daf19',MinCount=1,MaxCount=2,InstanceType='t2.micro',KeyName='ec2-keypair',UserData=user_data_script
)# Print the instance IDs
for instance in instances:print(f'Created instance with ID: {instance.id}')

对于保护EC2运行,提高云服务的稳定性、可用性,我们要定期为EC2创建镜像。在AWS上,镜像的形式叫做AMI,以下是常见AMI的代码。

import boto3ec2 = boto3.client('ec2')# Replace with your instance ID
instance_id = 'i-1234567890abcdef0'# Create an AMI from the instance
response = ec2.create_image(InstanceId=instance_id,Name='MyServerImage',Description='An AMI of my server',NoReboot=True  # Set to False if you want to reboot the instance before creating the image
)image_id = response['ImageId']
print(f'AMI created with ID: {image_id}')

如果我们想重启、删除一个EC2服务器,可以用以下代码:

重启:

import boto3ec2 = boto3.client('ec2')# Replace with your instance ID
instance_id = 'i-1234567890abcdef0'# Reboot the instance
response = ec2.reboot_instances(InstanceIds=[instance_id]
)print(f'Rebooted instance: {instance_id}')

删除:

import boto3ec2 = boto3.client('ec2')# Replace with your instance ID
instance_id = 'i-1234567890abcdef0'# Terminate the instance
response = ec2.terminate_instances(InstanceIds=[instance_id]
)print(f'Terminated instance: {instance_id}')

对于EC2维护和访问,如果可以分配固定IP,将会保证EC2重启后IP保持不变。我们使用如下代码实现IP固定(分配Elastic IP)

import boto3ec2 = boto3.client('ec2')# Allocate a new Elastic IP address
response = ec2.allocate_address(Domain='vpc'
)allocation_id = response['AllocationId']
print(f'Elastic IP allocated with ID: {allocation_id}')# Replace with your instance ID
instance_id = 'i-1234567890abcdef0'# Associate the Elastic IP with the instance
response = ec2.associate_address(InstanceId=instance_id,AllocationId=allocation_id
)print(f'Elastic IP associated with instance: {instance_id}')

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • linux高级编程(TCP)(传输控制协议)
  • Java核心技术【二十】Java泛型的基本概念和原理详解
  • 二叉树超详细解析
  • phpstudy框架,window平台,如何开端口给局域网访问?
  • AIGC专栏12——EasyAnimateV3发布详解 支持图文生视频 最大支持960x960x144帧视频生成
  • 【QT中实现摄像头播放、以及视频录制】
  • Consul与CoreDNS的对比
  • 架构设计(2)云原生架构与实例部署
  • 【WebGIS平台】传统聚落建筑科普数字化建模平台
  • MySQL之基本查询(上)-表的增删查改
  • 如何使用 Puppeteer 避免机器人检测?
  • oracle索引字段存储数据过长,导致索引失效
  • 突破传统,实时语音技术的革命。Livekit 开源代理框架来袭
  • for循环中list触发fast-fail或不触发的原理和方法
  • windows@windows设备之间远程命令行控制方案@windows设备间使用OpenSSH
  • 【跃迁之路】【444天】程序员高效学习方法论探索系列(实验阶段201-2018.04.25)...
  • chrome扩展demo1-小时钟
  • express.js的介绍及使用
  • Java 网络编程(2):UDP 的使用
  • Java到底能干嘛?
  • Spring核心 Bean的高级装配
  • VuePress 静态网站生成
  • 安卓应用性能调试和优化经验分享
  • 聊聊sentinel的DegradeSlot
  • 前端工程化(Gulp、Webpack)-webpack
  • 如何利用MongoDB打造TOP榜小程序
  • 如何优雅的使用vue+Dcloud(Hbuild)开发混合app
  • 如何在 Tornado 中实现 Middleware
  • 使用putty远程连接linux
  • 数据库写操作弃用“SELECT ... FOR UPDATE”解决方案
  • 微信开放平台全网发布【失败】的几点排查方法
  • 小李飞刀:SQL题目刷起来!
  • 学习ES6 变量的解构赋值
  • 再次简单明了总结flex布局,一看就懂...
  • 2017年360最后一道编程题
  • ​Linux·i2c驱动架构​
  • ​力扣解法汇总1802. 有界数组中指定下标处的最大值
  • ​软考-高级-系统架构设计师教程(清华第2版)【第15章 面向服务架构设计理论与实践(P527~554)-思维导图】​
  • %3cscript放入php,跟bWAPP学WEB安全(PHP代码)--XSS跨站脚本攻击
  • (3) cmake编译多个cpp文件
  • (3)STL算法之搜索
  • (C语言)球球大作战
  • (delphi11最新学习资料) Object Pascal 学习笔记---第8章第2节(共同的基类)
  • (poj1.2.1)1970(筛选法模拟)
  • (SpringBoot)第二章:Spring创建和使用
  • (二)斐波那契Fabonacci函数
  • (附源码)ssm失物招领系统 毕业设计 182317
  • (实战)静默dbca安装创建数据库 --参数说明+举例
  • (四十一)大数据实战——spark的yarn模式生产环境部署
  • (转)大型网站的系统架构
  • (轉貼) 蒼井そら挑戰筋肉擂台 (Misc)
  • .net core Redis 使用有序集合实现延迟队列
  • .Net Core 笔试1
  • .NET 使用 XPath 来读写 XML 文件
  • .NET分布式缓存Memcached从入门到实战