I'm using amazonica to create an ami and then launch an instance from the ami when it's ready.
The problem I'm having with amazonica is that it has about zero documentation (that I can find), apart from what's on readme. And what's on ready is very little and covers very little.
I can currently successfully look at running instances, grab latest / required instance, create an AMI off of it, wait until that's ready, and then launch that instance.
Only, the (run-instance)
method takes in I don't know what arguments. Looking at the java api doc I have figured out most of parameters with some trial and error but I still need to set a few more things.
Where can I find what parameters to pass to this function?
Currently, I have:
(run-instances :image-id ami-id
:min-count 1
:max-count 1
:instance-type "t2.small"
:key-name "api-key-pair"
:sercurity-groups ["sg-1a2b3c4d"]
;:vpc-id "vpc-a1b2c3d4"
:subnet-id "subnet-a1b2c3d4"
:monitoring true
:ebs-optimized false
:tag [{:value instance-name
:key "Name"}])
And this sets most things. But I can't figure out how to set:
- tag - I want to set a tag
name: "prod-1.0"
security groups. I've tried the one above, and this:
:security-groups [{:group-id "sg-1a2b3c4d"
:group-name "SG_STRICT"}]
but no use. Either the instance has default group, or, I get a strange errors like
...AmazonServiceException: The specified instance type can only be used in a VPC. A subnet ID or network interface ID is required to carry out the request
or
....s.AmazonServiceException: The security group '{:group-id "sg-1a2b3c4d", :group-name "SG_STRICT"}' does not exist
I've gone through that whole doc page a couple of times and can't find any other sensible options / keywords to pass.
I also want to start the instance with auto-assign-public-ip option too.
The source doesn't reveal much on amazonica, unfortunately, as the doc says it uses reflections heavily and tests aren't very elaborate.
so How do I set a security group and tags for this, please?
Aucun commentaire:
Enregistrer un commentaire