我正在为 ECS 中运行的一堆 (~75) 微服务构建一个 cloudformation 模板。有一个顶级模板将所有微服务作为嵌套堆栈包含在内。我希望所有微服务都使用相同的microservice.yaml模板并使用参数来定义要运行的微服务,而不是为每个服务创建数十个不同的模板文件。
AWSTemplateFormatVersion: '2010-09-09'
Description: Deploy a service into an ECS cluster
Parameters:
ServiceName:
Type: String
ImageUrl:
Type: String
LogLevel:
Type: String
Default: debug
NodeEnv:
Type: String
Default: integration
Resources:
TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
RequiresCompatibilities:
- EC2
ContainerDefinitions:
- Name: !Ref 'ServiceName'
Image: !Ref 'ImageUrl'
Environment:
- Name: LOG_LEVEL
Value: !Ref 'LogLevel'
- Name: NODE_ENV
Value: !Ref 'NodeEnv'
Service:
Type: AWS::ECS::Service
Properties:
ServiceName: !Ref 'ServiceName'
Cluster: !ImportValue production-infrastructure:ECSClusterName
DesiredCount: 1
TaskDefinition: !Ref 'TaskDefinition' …Run Code Online (Sandbox Code Playgroud) amazon-web-services amazon-ecs aws-cloudformation microservices
我是Struts2和OGNL的新手,正在制作一个带注册页面的简单Web应用程序.有两个字段,password并且repassword(重新输入密码)并使用验证框架我想验证两个密码是否匹配(我知道我可以使用JavaScript轻松完成).这是我到目前为止所得到的.所有的现场验证器都工作正常.这是我的第一个非现场验证器,我不能让它工作.
<validator type="expression">
<param name="expression">${password}!=${repassword}</param>
<message>Passwords must match.</message>
</validator>
Run Code Online (Sandbox Code Playgroud)
我试过两个
${password}!=${repassword}
Run Code Online (Sandbox Code Playgroud)
没有
password!=repassword
Run Code Online (Sandbox Code Playgroud)
OGNL标签.
我的收藏中有以下文件。每个文档都包含推文的文本和从推文中挑选出的一组实体(使用 AWS Comprehend):
{
"text" : "some tweet by John Smith in New York about Stack Overflow",
"entities" : [
{
"Type" : "ORGANIZATION",
"Text" : "stack overflow"
},
{
"Type" : "LOCATION",
"Text" : "new york"
},
{
"Type" : "PERSON",
"Text" : "john smith"
}
]
},
{
"text" : "another tweet by John Smith but this one from California and about Google",
"entities" : [
{
"Type" : "ORGANIZATION",
"Text" : "google"
},
{
"Type" : "LOCATION", …Run Code Online (Sandbox Code Playgroud) 我的收藏中有以下文件。每个文档都包含有关特定位置的历史天气数据:
{
'location':'new york',
'history':[
{'timestamp':1524542400, 'temp':79, 'wind_speed':1, 'wind_direction':'SW'}
{'timestamp':1524548400, 'temp':80, 'wind_speed':2, 'wind_direction':'SW'}
{'timestamp':1524554400, 'temp':82, 'wind_speed':3, 'wind_direction':'S'}
{'timestamp':1524560400, 'temp':78, 'wind_speed':4, 'wind_direction':'S'}
]
},
{
'location':'san francisco',
'history':[
{'timestamp':1524542400, 'temp':80, 'wind_speed':5, 'wind_direction':'SW'}
{'timestamp':1524548400, 'temp':81, 'wind_speed':6, 'wind_direction':'SW'}
{'timestamp':1524554400, 'temp':82, 'wind_speed':7, 'wind_direction':'S'}
{'timestamp':1524560400, 'temp':73, 'wind_speed':8, 'wind_direction':'S'}
]
},
{
'location':'miami',
'history':[
{'timestamp':1524542400, 'temp':84, 'wind_speed':9, 'wind_direction':'SW'}
{'timestamp':1524548400, 'temp':85, 'wind_speed':10, 'wind_direction':'SW'}
{'timestamp':1524554400, 'temp':86, 'wind_speed':11, 'wind_direction':'S'}
{'timestamp':1524560400, 'temp':87, 'wind_speed':12, 'wind_direction':'S'}
]
}
Run Code Online (Sandbox Code Playgroud)
我想获取每个位置(或多或少)的最新天气数据列表,如下所示:
{
'location':'new york',
'history':{'timestamp':1524560400, 'temp':78, 'wind_speed':4, 'wind_direction':'S'}
},
{
'location':'san francisco',
'history':{'timestamp':1524560400, 'temp':73, …Run Code Online (Sandbox Code Playgroud)