cloud

aws

test tool:

browser: main purpose of the address bar is to type https://example.com and send a GET request

curl: curl

curl --output <./cv.pdf>

Computing:

AWS Lambda is used to host and execute a function in response to events, without managing servers.

Lambda 把传统服务的那套“始终运行+监听端口+请求分发”的模型全部外包给了 AWS 平台,而自己只保留“收到事件就执行逻辑并返回结果”这一最小计算单元。

aws配置可以监听SQS,http API等trigger。

配置Lambda Package的时候需要指明handler。

RequestHandler借口不一定要显式实现。只要参数签名是 Lambda 支持的形式,例如:(InputStream, OutputStream[, Context]),就可以不实现接口,直接生效。

new lambda.Function(this, 'Calculator', {
    code: LambdaAsset.fromBrazil({
      brazilPackage: BrazilPackage.fromString('OffshoreItemPartnerAdapterHandlerLambda-1.0'),
      componentName: 'Calculator',
    }),
    handler: 'com.amazon.offshoreitempartneradapterhandlerlambda.lambda.calculator.Calculator::add',
    memorySize: 512,
    timeout: cdk.Duration.seconds(30),
    runtime: lambda.Runtime.JAVA_17
  });

AWS Batch:可以控制运行环境和资源细节

不同于Lambda有默认的Queue和Log权限,Batch一定要手动配置Role。

Storage:

AWS S3: object storage service

S3: Object(data & metadata) in Bucket

ECR(Elastic Container Registry):存储容器

ECS (Elastic Container Service):运行容器

ECS运行在EC2或者Fargate上。

AWS EC2: 一个EC2实例是一个虚拟机

Elastic Beanstalk

https://www.reddit.com/r/aws/comments/13f2jdg/comment/jr30r6l/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

Elastic Beanstalk 是建立在 EC2 之上的封装服务。它抽象了 EC2、负载均衡、自动伸缩等底层基础设施的复杂性。

Connect to an EC2:

Private Network:

An Amazon EC2 instance is launched within a specific subnet of a Virtual Private Cloud (VPC).

When you create your AWS accountAWS automatically provides you with a default VPC in each AWS region available in your account. This default VPC includes a public subnet with internet access in every Availability Zone within the region.

A VPC cannot span multiple Regions; it can only exist in a single Region. Therefore, you cannot have the same VPC across Regions; this is not allowed.

Imagine a VPC in the "us-east-1" region. This VPC could have subnets within availability zones "us-east-1a", "us-east-1b", and "us-east-1c".

默认账户在每个az都有一个subnet。

Public Subnet 是网络结构的设置,是否“对外可见”还取决于 EC2 是否有公网 IP。

一个有公网IP的EC2被外网访问的条件:

VPC通信

不同VPC可以使用peering connection通信。

Subnet通信

Subnet分类:PRIVATE_WITH_EGRESSPRIVATE_ISOLATEDPUBLIC

访问ECR要求使用PRIVATE_WITH_EGRESS

若 VPC 仅含 Private Subnet,无法访问公网。

若需访问公网,需新增 Public Subnet 并部署 NAT Gateway。

Private Subnet 通过 VPC 路由访问 Public Subnet 中的 NAT Gateway,由其代理访问公网。

[Private Subnet] --(VPC 内路由)--> [NAT Gateway in Public Subnet] --> [Internet]

IAM

iam.Role

iam.PolicyStatement 不会生成独立的资源,直接role.addToPolicy附着在Role上。

AWS::IAM::ManagedPolicy 是独立资源,可以分配给不同role。

root aws account 可以创建iam user用于登陆。

Others

SQS: Simple Queue Service

SES: Simple Email Service

ARN: Amazon Resource Name

Bedrock:host了各种模型,提供调用。

Event Bridge :控制粒度是分钟。

azure

App Service

Web Apps 和 Elastic Beanstalk 都支持直接运行 Docker 容器,而无需额外的配置信息。你只需要将容器镜像上传到容器注册表,指定要使用的镜像,平台会自动为你处理基础设施配置、容器部署等任务。

Blob Storage

可以部署脚本吗

azure