0

I tried using the following as template for my resource, in this example, the autoscaling group.

"Outputs": {                                                                                    
    "TemplateGroupSettings": {                                                                  
        "Properties": {                                                                         
            "AvailabilityZones" : { "Fn::GetAZs" : "" },                                        
            "LaunchConfigurationName": { "Ref": "LaunchConfig" },                               
            "MaxSize": "3",                                                                     
            "MinSize": "1",                                                                     
            "Tags": [                                                                           
                { "Key": "swarm:master", "Value": {"Ref": "JenkinsURL"}, "PropagateAtLaunch": "true" },
                { "Key": "swarm:username", "Value": {"Ref": "JenkinsUsername"}, "PropagateAtLaunch": "true" },
                { "Key": "swarm:executors", "Value": {"Ref": "JenkinsExecutors"}, "PropagateAtLaunch": "true" },
                { "Key": "ci:username", "Value": {"Ref": "CIUsername"}, "PropagateAtLaunch": "true" }]
        },                                                                                      
        "Type": "AWS::AutoScaling::AutoScalingGroup",                                           
        "UpdatePolicy": {                                                                       
            "AutoScalingRollingUpdate": {                                                       
                "MaxBatchSize": "1",                                                            
                "MinInstancesInService": "1",                                                   
                "WaitOnResourceSignals": "true",                                                
                "PauseTime": "PT1M5S"                                                           
            }                                                                                   
        }                                                                                       
    }                                                                                           
},       

But this option doesn't work

"Resources": {    
....
    "TemplateGroup": { "Ref": "TemplateGroupSettings" },                                        

Is there any other way around ? Because this one doesn't work

$ euform-create-stack --region eucalyptus -p InstanceType=t1.micro  -p EnvironmentType=production --template-file ~cftemplate.json --capabilities CAPABILITY_IAM teststack
euform-create-stack: error (ValidationError): Type is a required property of Resource
mastier
  • 872
  • 1
  • 10
  • 22
  • why are you defining Resource inside `"Outputs"` ? – krisnik Jul 28 '17 at 06:17
  • I want to have few autoscaling groups with the same configuration, named differently. Do not ask if it makes sense, it does not :-P But it is an some client requirement, I thought it will make it look clearer. – mastier Jul 28 '17 at 07:58
  • In one of your Resource definition, you must have missed specifying the type of resource which you want to create. Specifying `Type` to appropriate AWS::* type should resolve the issue. If you share the template, we can help you with identifying the problem – krisnik Jul 28 '17 at 08:55
  • I just specified the following: "TemplateGroup": { "Ref": "TemplateGroupSettings" }, Maybe I should set the Type, Properties, and UpdatePolicy indepedently, then it would work. – mastier Jul 28 '17 at 15:38

0 Answers0