【问题标题】:Deploying MVC application on AWS (.NET CORE 3.1) - Error: Environment must have instance profile associated with it在 AWS (.NET CORE 3.1) 上部署 MVC 应用程序 - 错误:环境必须具有与之关联的实例配置文件
【发布时间】:2020-07-12 07:16:14
【问题描述】:

主要问题是我不明白我必须在应用程序中的何处编写这些变量。


我无法在 AWS 上部署我的 MVC 应用程序。 部署后出现错误:环境必须有与之关联的实例配置文件。

我在这里找到了答案: AWS Elastic Beanstalk - Environment must have instance profile associated with it

但是我不明白我必须在程序中哪里写这些变量。

OptionSettings.member.1.Namespace = aws:autoscaling:launchconfiguration
OptionSettings.member.1.OptionName = IamInstanceProfile
OptionSettings.member.1.Value = aws-elasticbeanstalk-ec2-role

【问题讨论】:

    标签: amazon-web-services asp.net-core-mvc visual-studio-2019


    【解决方案1】:

    我在 Elastic Beanstalk 的环境页面中遇到了同样的错误。当我检查 Visual Studio 输出消息时,它说

    “在设置时捕获 AmazonIdentityManagementServiceException 角色:用户:arn:aws:iam::77485*****:user/vs_delpoy_agent 不是 授权执行:iam:GetInstanceProfile 在资源上:instance 配置文件 aws-elasticbeanstalk-ec2-role"

    我通过在 AWS 的 IAM 页面上创建自己的策略解决了这个问题。该策略包含这样的json

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "iam:GetInstanceProfile"
                ],
                "Resource": "*"
            }
        ]
    }
    

    然后将此新创建的策略添加到您的组中

    【讨论】:

      猜你喜欢
      • 2019-01-08
      • 2017-12-15
      • 1970-01-01
      • 1970-01-01
      • 2020-10-18
      • 2014-12-09
      • 2022-01-17
      • 2016-12-29
      • 1970-01-01
      相关资源
      最近更新 更多