2017-03-14 12 views
2

placementConstraintsをCloudFormationを使用してサービス定義に使用しようとしていますが、AWS::ECS::Serviceリソースにはプロパティとして存在しません。回避策はありますか?CloudFormationでECS placementConstraintsを使用する方法

ECSサービス:http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service_definition_paramters.html

CloudFormation ECSサービスリソース:http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html

答えて

0

PlacementConstraintはこれを書いている時点でAWS::ECS::Serviceのプロパティとして存在します。 AWSのドキュメントからの引用:

PlacementConstraintは、Amazon EC2コンテナサービス(アマゾンECS)に関連付けるサービス のタスクのための配置制約を指定するAWS :: ECS ::サービス・リソース の財産であります サービス。

参考:

[1]http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-placementconstraints-placementconstraint.html

[2]http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-placementconstraints

0

これが私の作品! yamlを間違ってインデントすると、このエラーが発生する可能性があります。

ApplicationService: 
    Type: AWS::ECS::Service 
    DependsOn: 
     - ALBListener 
     - ApplicationTaskDefinition 
     - ALBTargetGroup 
    Properties: 
     Cluster: 
     'Fn::ImportValue': !Sub ecs-${EnvironmentName}-clustername 
     DesiredCount: 15 
     LoadBalancers: 
     - ContainerName: !Sub ${AWS::StackName}-app 
      ContainerPort: 8080 
      TargetGroupArn: !Ref ALBTargetGroup 
     Role: 
     'Fn::ImportValue': !Sub ecs-${EnvironmentName}-servicerole-arn 
     TaskDefinition: !Ref ApplicationTaskDefinition 
     PlacementConstraints: 
     - Expression: attribute:ecs.instance-type == t2.medium 
     Type: memberOf 
     PlacementStrategies: 
     - Type: spread 
     Field: attribute:ecs.availability-zone 

これがうまくいかない場合は、cfnファイルをここに投稿してください。

関連する問題