AWSECSFargate任务挂载EFS访问点时出现问题(与Cloudformation有关)
创始人
2024-09-25 04:31:18
0
  1. 在CloudFormation模板中定义EFS访问点
EfsAccessPoint:
  Type: AWS::EFS::AccessPoint
  Properties:
    FileSystemId: !Ref EfsFileSystem
    PosixUser:
      Gid: 1000
      Uid: 1000
    RootDirectory:
      CreationInfo:
        OwnerGid: 1000
        OwnerUid: 1000
        Permissions: 0755
      Path: /access1
  1. 将Fargate任务添加到VPC并授予EFS访问点的权限
TaskExecutionRole:
  Type: AWS::IAM::Role
  Properties:
    AssumeRolePolicyDocument:
      Version: '2012-10-17'
      Statement:
      - Effect: Allow
        Principal:
          Service:
          - ecs-tasks.amazonaws.com
        Action:
        - sts:AssumeRole
    ManagedPolicyArns:
    - arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy

TaskDefinition:
  Type: AWS::ECS::TaskDefinition
  Properties: 
    Family: MyTaskDefinition
    RequiresCompatibilities:
      - FARGATE
    ContainerDefinitions: 
    ExecutionRoleArn: !GetAtt TaskExecutionRole.Arn
    TaskRoleArn: !Ref TaskRole

Vpc:
  Type: AWS::EC2::VPC
  Properties:
    CidrBlock: 10.0.0.0/16
    EnableDnsSupport: true
    EnableDnsHostnames: true
    Tags:
    - Key: Name
      Value: VPC

Subnet:
  Type: AWS::EC2::Subnet
  Properties:
    CidrBlock: 10.0.1.0/24
    VpcId: !Ref Vpc
    Tags:
    - Key: Name
      Value: Subnet

SecurityGroup:
  Type: AWS::EC2::SecurityGroup
  Properties:
    GroupDescription: Security group for ECS tasks
    VpcId: !Ref Vpc

相关内容

热门资讯

有玩家发现!hhpoker脚本... 有玩家发现!hhpoker脚本,wepoker安装教程(透视)解密教程(有挂详细)-哔哩哔哩1、点击...
透视有挂!wepoker辅助工... 透视有挂!wepoker辅助工具,xpoker怎么辅助(透视)总结教程(证实有挂)-哔哩哔哩1、用户...
透视真的!佛手在线大菠萝技巧,... 透视真的!佛手在线大菠萝技巧,wejoker透视方法(透视)推荐教程(发现有挂)-哔哩哔哩1、该软件...
今天上午!wepoker有透视... 今天上午!wepoker有透视吗,we-poker辅助软件教程(透视)详细教程(有挂教学)-哔哩哔哩...
最新消息!wepoker永久免... 最新消息!wepoker永久免费脚本,wepoker辅助器下载(透视)专业教程(有挂总结)-哔哩哔哩...
此事备受玩家关注!有哪些免费的... 此事备受玩家关注!有哪些免费的wpk辅助码,xpoker怎么辅助(透视)了解教程(有挂方略)-哔哩哔...
此事引发网友热议!wepoke... 此事引发网友热议!wepoker好友助力码,wepoker怎么买辅助(透视)揭幕教程(确实有挂)-哔...
透视总结!哈糖大菠萝软件下载,... 透视总结!哈糖大菠萝软件下载,htx矩阵wepoker辅助(透视)解迷教程(有挂猫腻)-哔哩哔哩该软...
据目击者称!wepoker私人... 据目击者称!wepoker私人局辅助,wejoker私人辅助软件(透视)关于教程(有挂方式)-哔哩哔...
网友热议!拱趴大菠萝辅助方法,... 网友热议!拱趴大菠萝辅助方法,wepoker有没有插件(透视)揭幕教程(揭秘有挂)-哔哩哔哩1、打开...