我收到这个奇怪的错误信息
PlatformTaskDefinitionIncompatibilityException: 指定的平台不满足任务定义所需的功能
我怀疑这与这条线有关,虽然不太确定
file_system_id = aws_efs_file_system.main.id
这是我的脚本:
provider "aws" {
region = "us-east-1"
profile = var.profile
}
### Network
# Fetch AZs in the current region
data "aws_availability_zones" "available" {}
resource "aws_vpc" "main" {
cidr_block = "172.17.0.0/16"
}
# Create var.az_count private subnets, each in a different AZ
resource "aws_subnet" "private" {
count = "${var.az_count}"
cidr_block = "${cidrsubnet(aws_vpc.main.cidr_block, 8, count.index)}"
availability_zone = "${data.aws_availability_zones.available.names[count.index]}"
vpc_id = "${aws_vpc.main.id}"
}
# Create var.az_count public subnets, each in a different AZ
resource "aws_subnet" …
Run Code Online (Sandbox Code Playgroud) 尝试从 AWS Backup 还原文件系统时,出现以下错误:
Access Denied
Insufficient privileges to perform this action. Please consult with the account administrator for necessary permissions.
Run Code Online (Sandbox Code Playgroud)
这很奇怪,因为我AdministratorAccess
在我的 AWS 用户下有:
运行CLI命令创建的文件系统:
Access Denied
Insufficient privileges to perform this action. Please consult with the account administrator for necessary permissions.
Run Code Online (Sandbox Code Playgroud)
另外,我按照EKSWorkshop创建了EFS。
任何帮助都感激不尽。
我有一个 ECS Fargate 容器,运行具有非 root 权限的 Nodejs 应用程序,并且还安装到容器内 /.user_data 上的 EFS。
我遵循了这个AWS 教程。我的设置几乎相似。
这是 Docker 文件:
FROM node:12-buster-slim
RUN apt-get update && \
apt-get install -y build-essential \
wget \
python3 \
make \
gcc \
libc6-dev \
git
# delete old user
RUN userdel -r node
# Run as a non-root user
RUN addgroup "new_user_group" && \
useradd "new_user" --gid "new_user_group" \
--home-dir "/home/new_user"
RUN git clone https://github.com/test-app.git /home/new_user/app
RUN chown -R new_user:new_user_group /home/new_user
RUN mkdir -p …
Run Code Online (Sandbox Code Playgroud) 所以,我正在尝试将我的 lambda 函数与 EFS 集成。我可以访问根目录(从 lambda 为只读),因为我可以xyz
在我的根目录中看到可用的目录。/mnt/
->xyz
当我尝试访问/mnt/xyz
或/mnt/xyz/
然后我收到此错误:
{
"errorType": "Error",
"errorMessage": "EACCES: permission denied, scandir '/mnt/xyz/'",
"trace": [
"Error: EACCES: permission denied, scandir '/mnt/xyz/'",
" at Object.readdirSync (fs.js:948:3)",
" at Runtime.exports.handler (/var/task/index.js:19:24)",
" at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"
]
}
Run Code Online (Sandbox Code Playgroud)
授予接入点的权限:777
我想将 EFS 与 fargate 一起使用,但在任务开始时出现此错误:
ResourceInitializationError: failed to invoke EFS utils commands to set up EFS volumes: stderr: Failed to resolve "fs-xxxxx.efs.eu-west-1.amazonaws.com" - check that your file system ID is correct
Run Code Online (Sandbox Code Playgroud)
我已经检查了文件系统 ID,它是正确的...我如何获得有关此错误的更多信息?它可能与安全组有关吗?
这是我与 terraform 一起使用的代码,我为两个可用区使用了两个挂载点:
resource "aws_efs_file_system" "efs_apache" {
}
resource "aws_efs_mount_target" "efs-mount" {
count = 2
file_system_id = aws_efs_file_system.efs_apache.id
subnet_id = sort(var.subnet_ids)[count.index]
security_groups = [aws_security_group.efs.id]
}
resource "aws_efs_access_point" "efs-access-point" {
file_system_id = aws_efs_file_system.efs_apache.id
}
resource "aws_security_group" "efs" {
name = "${var.name}-efs-sg"
description = "Allow traffic from self"
vpc_id …
Run Code Online (Sandbox Code Playgroud) amazon-web-services terraform amazon-efs aws-fargate terraform-provider-aws
我有一个用于存储容器日志的 AWS EFS 共享。
我想将此 nfs 共享 (aws efs) 挂载到 AWS Fargate。是否可以?
任何支持文档链接将不胜感激。
我正在尝试设置 EFS 并使用不同可用区中的 EC2 实例访问它。我为 EFS 创建了一个单独的安全组,它允许连接到 EC2 实例的安全组的流量。还在 EC2 实例上安装了 amazon-efs-utils 实用程序。但是当尝试执行以下命令时: sudo mount -t efs -o tls EFS-ID:/ efs
我收到以下错误:
mount.nfs4: Connection reset by peer
Run Code Online (Sandbox Code Playgroud)
我已经尝试了几次,但没有奏效。我在这里错过了什么?任何人都可以请让我知道。
谢谢
我的Web应用程序需要极低延迟的小数据blob(<10KB)读/写,可以存储为键值对.我正在考虑使用DynamoDB(使用DAX)和EFS以及ElastiCache.AWS声称他们都提供低延迟,但我找不到任何头2对比,而且我不清楚这三个是否甚至在同一个联盟.有人可以分享任何见解吗?
amazon-web-services amazon-elasticache amazon-dynamodb amazon-efs amazon-dynamodb-dax
我使用 Terraform 设置了 ECS 集群。一切都很好,但我有几个问题。
1.据我了解,EFS卷不需要挂载到ECS实例上。AWS 允许我们将 EFS 卷文件夹直接挂载到容器中。我对吗?
resource "aws_ecs_task_definition" "Task" {
family = var.ServiceName
container_definitions = file("service.json")
tags = {
Name = data.terraform_remote_state.Cluster.outputs.TagName
Project = data.terraform_remote_state.Cluster.outputs.TagName
}
volume {
name = "service-storage"
efs_volume_configuration {
file_system_id = data.terraform_remote_state.Cluster.outputs.EfsVolumeId
root_directory = "/"
}
}
}
Run Code Online (Sandbox Code Playgroud)
root_directory
这是 EFS 卷内部到文件夹的路径,该文件夹将安装到容器中。
服务.json
[
{
"name": "nginx13",
"image": "nginx",
"memory": 256,
"mountPoints": [
{
"containerPath": "/usr/share/nginx/html",
"sourceVolume": "service-storage"
}
],
"portMappings": [
{
"containerPort": 80
}
]
}
]
Run Code Online (Sandbox Code Playgroud)
containerPath
这是容器内部到root_directory …
我尝试将 aws lambda 和 efs 一起使用,这样我就可以执行超过默认 lambda 存储限制 500mb 的操作。我很困惑Local mount path和Access point之间的区别。
本地挂载路径是一个术语,用于描述文件系统在现有文件系统中的挂载位置,而访问点(也有自己的路径)是应用程序在代码中引用的位置?或者引用哪条路径实际上并不重要?
例如
AccessPointResource:
Type: 'AWS::EFS::AccessPoint'
Properties:
FileSystemId: !Ref FileSystemResource
PosixUser:
Uid: "1000"
Gid: "1000"
RootDirectory:
CreationInfo:
OwnerGid: "1000"
OwnerUid: "1000"
Permissions: "0777"
Path: "/myefs"
Run Code Online (Sandbox Code Playgroud)
这就是我创建接入点和直接在 lambda 上指定的安装路径以进行测试的方法。
我想我遇到的主要困惑是为什么有 2 条路径,它们之间有什么区别,以及我应该在 lambda 中使用哪一条?
amazon-efs ×10
aws-fargate ×4
terraform ×3
amazon-ecs ×2
aws-lambda ×2
amazon-ec2 ×1
amazon-iam ×1
docker ×1
nfs ×1
node.js ×1