Merge pull request #186 from vvbogdanov87/genymotion-subnetid
Add subnet_id parameter [Genymotion on AWS]
This commit is contained in:
commit
c27ab1d6d6
|
@ -24,4 +24,18 @@ You can easily scale your Appium tests on Genymotion Android virtual devices in
|
||||||
docker run -it --rm -p 4723:4723 -v $PWD/genymotion/example/sample_devices:/root/tmp -v ~/.aws:/root/.aws -e TYPE=aws budtmo/docker-android-genymotion
|
docker run -it --rm -p 4723:4723 -v $PWD/genymotion/example/sample_devices:/root/tmp -v ~/.aws:/root/.aws -e TYPE=aws budtmo/docker-android-genymotion
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Existing security group and subnet can be used:
|
||||||
|
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"region": "us-west-2",
|
||||||
|
"instance": "t2.small",
|
||||||
|
"AMI": "ami-0673cbd39ef84d97c",
|
||||||
|
"SG": "sg-000aaa",
|
||||||
|
"subnet_id": "subnet-000aaa"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
You can also use [this docker-compose file](genymotion/example/geny.yml).
|
You can also use [this docker-compose file](genymotion/example/geny.yml).
|
||||||
|
|
|
@ -59,12 +59,17 @@ function prepare_geny_aws() {
|
||||||
instance=$(get_value '.instance')
|
instance=$(get_value '.instance')
|
||||||
ami=$(get_value '.AMI')
|
ami=$(get_value '.AMI')
|
||||||
sg=$(get_value '.SG')
|
sg=$(get_value '.SG')
|
||||||
|
subnet_id=$(get_value '.subnet_id')
|
||||||
|
if [[ $subnet_id == null ]]; then
|
||||||
|
subnet_id=""
|
||||||
|
fi
|
||||||
|
|
||||||
echo $region
|
echo $region
|
||||||
echo $android_version
|
echo $android_version
|
||||||
echo $instance
|
echo $instance
|
||||||
echo $ami
|
echo $ami
|
||||||
echo $sg
|
echo $sg
|
||||||
|
echo $subnet_id
|
||||||
|
|
||||||
#TODO: remove this dirty hack
|
#TODO: remove this dirty hack
|
||||||
if [[ $android_version == null ]]; then
|
if [[ $android_version == null ]]; then
|
||||||
|
@ -183,6 +188,11 @@ variable "instance_type_$index" {
|
||||||
default = "$instance"
|
default = "$instance"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "subnet_id_$index" {
|
||||||
|
type = "string"
|
||||||
|
default = "$subnet_id"
|
||||||
|
}
|
||||||
|
|
||||||
provider "aws" {
|
provider "aws" {
|
||||||
alias = "provider_$index"
|
alias = "provider_$index"
|
||||||
region = "\${var.aws_region_$index}"
|
region = "\${var.aws_region_$index}"
|
||||||
|
@ -214,6 +224,7 @@ resource "aws_instance" "geny_aws_$index" {
|
||||||
provider = "aws.provider_$index"
|
provider = "aws.provider_$index"
|
||||||
ami="\${data.aws_ami.geny_aws_$index.id}"
|
ami="\${data.aws_ami.geny_aws_$index.id}"
|
||||||
instance_type = "\${var.instance_type_$index}"
|
instance_type = "\${var.instance_type_$index}"
|
||||||
|
subnet_id = "\${var.subnet_id_$index}"
|
||||||
vpc_security_group_ids=["\${aws_security_group.geny_sg_$index.name}"]
|
vpc_security_group_ids=["\${aws_security_group.geny_sg_$index.name}"]
|
||||||
key_name = "\${aws_key_pair.geny_key_$index.key_name}"
|
key_name = "\${aws_key_pair.geny_key_$index.key_name}"
|
||||||
tags {
|
tags {
|
||||||
|
|
Loading…
Reference in a new issue