如何在弹性魔豆使用YAML文件设置文件夹的权限? [英] How To Set Folder Permissions in Elastic Beanstalk Using YAML File?

查看:360
本文介绍了如何在弹性魔豆使用YAML文件设置文件夹的权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C#的Web API弹性魔豆的应用程序,需要的IUSER和IIS_USERS用户可以写入到部署目录以外的文件夹。我创建了一个config文件,并在我的项目把这个顶层.ebextensions文件夹。内容如下:

I have a C# Web API Elastic Beanstalk app which needs a folder outside the deployment directory that the IUSER and IIS_USERS users can write to. I've created a .config file and put this in the top level .ebextensions folder in my project. The contents are below:

commands:
  0_mkdir:
    command: mkdir C:\\AppFolder\\

  1_set_iuser_permissions:
    command: cacls C:\\AppFolder\\ /t /e /g IUser:f IIS_Users:f

然而,同时创建该文件夹的成功权限设置。如果任何人有任何想法,我做错了,我会非常感激。非常感谢在前进。

However while the folder is created successfully the permissions aren't set. If anyone has any idea what I am doing wrong I would be hugely grateful. Big thanks in advance.

推荐答案

在最后,我切换到使用JSON而不是YAML的,尽管我YAML被几个验证在线YAML测试,AWS仍然不会接受它。它总是与传递给ICACLS的参数问题。我也改到一个文件夹中的应用程序App_Data文件夹内,到应用程序外部的任何目录设置权限并未以工作。所以,我的最终配置文件如下:

In the end I switched to using Json instead of YAML as, despite my YAML being validated by several online YAML testers, AWS still wouldn't accept it. It always had issues with the parameters passed to icacls. I also changed to a folder within the application App_Data folder as setting permissions on any directory external to the application didn't appear to work. So, my final configuration file is as follows:

{
    "container_commands": {
        "01": {
            "command": "icacls \"C:/inetpub/wwwroot/AppName_deploy/App_Data/AppFolder\" /grant DefaultAppPool:(OI)(CI)F"
        }
    }
}

希望这可以帮助别人了。

Hope this helps someone else out.

这篇关于如何在弹性魔豆使用YAML文件设置文件夹的权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆