Amazon cloudformation 能否在AWS批处理的cloudformation堆栈中为同一计算环境定义多个作业队列?
我想在AWS批处理的cloudformation堆栈中为同一计算环境定义多个作业队列 我有一个作业队列名为“*解释器训练作业队列”,另一个作业队列名为 “*ModelPromotionJobQueue” 如下所述,但只有最后一个作业队列“*ModelPromotionJobQueues”显示在AWS批处理控制台中。这是否意味着AWS批处理群集只能有一个作业队列 目标是能够使用相同的AWS批处理集群将不同的作业发送到不同的队列Amazon cloudformation 能否在AWS批处理的cloudformation堆栈中为同一计算环境定义多个作业队列?,amazon-cloudformation,aws-batch,Amazon Cloudformation,Aws Batch,我想在AWS批处理的cloudformation堆栈中为同一计算环境定义多个作业队列 我有一个作业队列名为“*解释器训练作业队列”,另一个作业队列名为 “*ModelPromotionJobQueue” 如下所述,但只有最后一个作业队列“*ModelPromotionJobQueues”显示在AWS批处理控制台中。这是否意味着AWS批处理群集只能有一个作业队列 目标是能够使用相同的AWS批处理集群将不同的作业发送到不同的队列 JobQueue: Type: AWS::Batch::J
JobQueue:
Type: AWS::Batch::JobQueue
Properties:
ComputeEnvironmentOrder:
# Use on-demand instances
- Order: 1
ComputeEnvironment: !Ref ComputeEnvironment
State: ENABLED
Priority: 1
JobQueueName: !Join ['-', [!Ref ProjectName, 'InterpreterTrainingJobQueue', !Ref DeployName]]
JobQueue:
Type: AWS::Batch::JobQueue
Properties:
ComputeEnvironmentOrder:
# Use on-demand instances
- Order: 1
ComputeEnvironment: !Ref ComputeEnvironment
State: ENABLED
Priority: 1
JobQueueName: !Join ['-', [!Ref ProjectName, 'ModelPromotionJobQueue', !Ref DeployName]]
使用每个作业队列的新资源id进行更新:
InterpreterTrainingJobQueue:
Type: AWS::Batch::JobQueue
Properties:
ComputeEnvironmentOrder:
# Use on-demand instances
- Order: 1
ComputeEnvironment: !Ref ComputeEnvironment
State: ENABLED
Priority: 1
JobQueueName: !Join ['-', [!Ref ProjectName, 'InterpreterTrainingJobQueue', !Ref DeployName]]
ModelPromotionJobQueue:
Type: AWS::Batch::JobQueue
Properties:
ComputeEnvironmentOrder:
# Use on-demand instances
- Order: 1
ComputeEnvironment: !Ref ComputeEnvironment
State: ENABLED
Priority: 1
JobQueueName: !Join ['-', [!Ref ProjectName, 'ModelPromotionJobQueue', !Ref DeployName]]
因为您对这两个资源使用相同的ResourceId:
JobQueue
,所以CloudFormation会覆盖第一个资源。尝试使用不同的名称,最好是基于他们的目的。例如解释器培训作业队列
和模型促销作业队列
谢谢。我为每个队列创建了唯一的ResourceId,但在堆栈更新时,cloudformation说它无法创建新资源。关于如何让cloudformation识别新资源ID有什么想法吗?@morfys失败了为什么?有错误吗?另外,您是否可以使用您现在尝试执行的模板的新版本更新问题?是的,请发布错误。我的第一个怀疑是名称冲突,CloudFormation在删除旧资源(旧资源ID)之前创建了新资源(新资源ID)。如果是这种情况,请先拆下堆栈或使用不同的名称。谢谢。删除堆栈有帮助。