小编spu*_*fkc的帖子

如何从 AutoScaling 获取所有 EC2 实例 ID?

所以我有一个具有 3 种不同实例“类型”(服务器、代理、中继)的 AWS CloudFormation 模板

我正在使用 AutoScaling 动态启动某种类型的 X 个实例。

我的问题是,我需要模板输出中这些服务器的所有 IP,最好将其分成几个部分。

IE

服务器:xxxxyyyy

继电器:zzzz

代理商:aaaa

如何从输出中获取实例 ID?(我可以从ID中获取IP)

附模板:

{
"AWSTemplateFormatVersion" : "2010-09-09",

"Description" : "uDeploy Agent-Relay-Server",

"Parameters" : {
    "keyName" : {
        "Description" : "SSH key to enable access on the servers",
        "Type" : "String",
        "Default" : "nick-portal"
    },

    "ServerInstanceCount" : {
        "Description" : "Number of Servers to start",
        "Type" : "Number",
        "Default" : "1"
    },
    "RelayInstanceCount" : {
        "Description" : "Number of Agent Relays to start",
        "Type" …
Run Code Online (Sandbox Code Playgroud)

amazon-ec2 amazon-web-services aws-cloudformation autoscaling

6
推荐指数
1
解决办法
5377
查看次数

使用另一个类的C++方法声明

我开始学习C++(来自Java),所以请耐心等待.

我似乎无法接受我的方法声明来接受我所制作的课程.

"上下文"尚未宣布

我想我不理解一个基本概念,但我不知道是什么.

Expression.h

#include "Context.h"  
class Expression {  
public:  
    void interpret(Context *);  // This line has the error
    Expression();  
    virtual ~Expression();  
};  
Run Code Online (Sandbox Code Playgroud)

Context.h

#include <stack>  
#include <vector>  
#include "Expression.h"  

class Context {  
private:  
    std::stack<Expression*,std::vector<Expression*> > theStack;  
public:  
    Context();  
    virtual ~Context();  
};
Run Code Online (Sandbox Code Playgroud)

c++ header class

3
推荐指数
1
解决办法
119
查看次数