Created
April 16, 2011 21:03
-
-
Save j2labs/923498 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -module(amazon). | |
| -include_lib("erlcloud/include/erlcloud.hrl"). | |
| -include_lib("erlcloud/include/erlcloud_ec2.hrl"). | |
| -export([init_ec2conn/0, | |
| create_instances/2]). | |
| %% | |
| %% These two are required first | |
| %% | |
| init_ec2conn() -> | |
| ssl:start(), | |
| erlcloud:start(), | |
| erlcloud_ec2:new("API_KEY", | |
| "SECRET_KEY"). | |
| create_instances(NumInstances, Config) -> | |
| erlcloud_ec2:run_instances(#ec2_instance_spec{ | |
| image_id="ami-ccf405a5", | |
| instance_type="t1.micro", | |
| max_count=NumInstances, | |
| min_count=NumInstances, | |
| availability_zone="us-east-1a", | |
| key_name="testing", | |
| group_set=["SecurityGroup"] | |
| }, | |
| Config). | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment