I am using aws sdk for auto scaling command line tool. I want to know that how to use cloud formation with this command line tool? i.e. can we give template id instead of instance/ ami id?
Example:
as-create-launch-config MyLC --image-id <CF tamplete id> --instance-type m1.small
can we give template id instead of instance/ ami id?
No, using Auto Scaling with AWS CloudFormation currently works the other way round only:
AWS CloudFormation fully supports all Auto Scaling resources like AWS::AutoScaling::AutoScalingGroup, AWS::AutoScaling::LaunchConfiguration etc., see the AWS Resource Types Reference for details on all available resources; there are a couple of Auto Scaling related AWS CloudFormation Sample Templates to get you started as well:
AutoScalingKeepAtNSample.template - An example of using Auto Scaling groups to manage a set of EC2 instances.
AutoScalingMultiAZSample.template - An example of using Load Balanced, Auto Scaling groups spanning multiple EC2 availability zones. This template has been updated to use Auto Scaling Policies.
AutoScalingMultiAZWithNotifications.template - An example of using Load Balanced Auto Scaling groups spanning multiple EC2 availability zones. This template uses Auto Scaling Policies and configures Auto Scaling notifications so that you can get emails when scaling events occur.
You can then use the AWS CloudFormation Command Line Tools to use your template(s) with said Auto Scaling resources, e.g. via cfn-create-stack, cfn-update-stack etc., see the Command Line Tools Reference for details on all available commands.