mardi 13 décembre 2016

FN condition issue CF template

Thank you in Advance for your help. I am trying to create a CF template that has codndions. by using these conditions i can have multiple key names for output.

"Conditions" : {

"NicheFRElbURL" : {"Fn::Equals" : [{"Ref" : "Language"}, "FR"]},
"NicheDEElbURL" : {"Fn::Equals" : [{"Ref" : "Language"}, "DE"]}
},
 "Outputs" : {
 "NameofELB" : {  "Fn::If" : [
  "Value",
   { "Ref" : "NicheFRElbURL" }
   ]},
    "Fn::Join" : [ "", [ "http://", {
      "Fn::GetAtt" : [ "ElasticLoadBalancer", "DNSName" ]
    }, ":", {
      "Fn::FindInMap" : [ "EnvMap", { "Ref" : "EnvType" }, "WebServerPort" ]
    } ] ],


"NicheElbName" : {
  "Description" : "The name the ELB that was created.",
  "Value" : { "Ref" : "ElbName" }
}
},

"Outputs" : {
"NameofELB" :{  "Fn::If" : [
   "Value",
  { "Ref" : "NicheDEElbURL" }
  ]},
    "Fn::Join" : [ "", [ "http://", {
      "Fn::GetAtt" : [ "ElasticLoadBalancer", "DNSName" ]
    }, ":", {
      "Fn::FindInMap" : [ "EnvMap", { "Ref" : "EnvType" }, "WebServerPort" ]
    } ] ],


"NicheElbName" : {
  "Description" : "The name the ELB that was created.",
  "Value" : { "Ref" : "ElbName" }
}
}

i am getting below error message. Template validation error: Template format error: Invalid outputs property : [Fn::If]

Thanks,

Aucun commentaire:

Enregistrer un commentaire