【问题标题】:AWS opsworks createApp api won't work with provided password and username with bitbucketAWS opsworks createApp api 不适用于通过 bitbucket 提供的密码和用户名
【发布时间】:2014-06-01 23:14:04
【问题描述】:

我正在尝试使用 aws node.js sdk 在 OPSWorks 中创建应用程序。

我的存储库位于 bitbucket,它是私有的。

我想用我的账户密码而不是 SSH 来使用 AWS api。

这是代码:

  var appParams = {
        Name: 'Demo app',
        StackId: userData.Stacks.stackId,
        Type: 'nodejs',
        AppSource: {
            Password: '*******',
            Type: 'git',
            Url: 'https://myUserName@bitbucket.org/myUserName/demofresh.git',
            Username: 'myUserName'
        }
    }
    opsworks.createApp(appParams, function(err, data) {
        if (err)
            callback(err);
        else{
            console.log(data);
            callback(data);
        }
    });

由于某种原因,我在使用此应用程序运行实例时一直收到此错误。

错误:

---- Begin output of git ls-remote https://myUserName@bitbucket.org/myUserName/demofresh.git HEAD ----
STDOUT: 
STDERR: fatal: could not read Password for 'https://myUserName@bitbucket.org': No such device or address
---- End output of git ls-remote https://myUserName@bitbucket.org/myUserName/demofresh.git HEAD ----
Ran git ls-remote https://myUserName@bitbucket.org/myUserName/demofresh.git HEAD returned 128

我也试过把网址改成:

Url: 'https://myUserName@bitbucket.org/myUserName/demofresh.git',

然后我得到一个错误,它没有用户名字段。

它无法读取我提供的密码。

我成功使用了 DescribeApps,只是为了确保密码和用户名保存在亚马逊服务器的应用程序中。

那么可能是 AWS API 有问题?

【问题讨论】:

    标签: node.js amazon-web-services aws-opsworks


    【解决方案1】:

    我刚刚遇到了同样的问题,相信我在 AWS OpsWorks 找到了 RTFM 的解决方案: http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html

    在该文档中,它谈到了设置私有 repo,并指定不同的 repo 连接字符串:

    私有存储库 - 使用这些显示的 SSH 读/写格式 例子:

    • Github 存储库:git@github.com:project/repository。
    • Git 服务器上的存储库:user@server:project/repository

    所以,我进入了 bitbucket,复制了我的 SSH 连接字符串并将其设置如下:

    git@bitbucket.org:repo_owner/project.git
    

    另外,文档指出了 git repos 的两个额外设置:

    在源代码控制下选择 Git 会显示两个额外的可选 设置:

    存储库 SSH 密钥

    您必须指定部署 SSH 密钥才能访问私有 Git 存储库。对于 Git 子模块,指定的键必须有 访问这些子模块。有关更多信息,请参阅使用存储库 SSH 密钥。

    重要

    部署 SSH 密钥不能需要密码; AWS OpsWorks 没有办法通过。分支/修订 如果存储库有 多个分支,AWS OpsWorks 通过 默认。要指定特定分支,请输入分支名称 SHA1 哈希或标签名称。要指定特定的提交,请输入完整的 40 位十六进制提交 ID。

    【讨论】:

      猜你喜欢
      • 2015-04-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-27
      • 2016-01-21
      • 2019-07-28
      • 1970-01-01
      相关资源
      最近更新 更多