Skip to content

Commit

Permalink
Merge pull request #36 from claffin/ami-setting
Browse files Browse the repository at this point in the history
Added AMI ID setting
  • Loading branch information
claffin authored Jul 1, 2021
2 parents 2d675be + f9c5b6b commit 7cab735
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cloudproxy/providers/aws/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def create_proxy():
sg_id = ec2_client.describe_security_groups(GroupNames=["cloudproxy"])
sg_id = sg_id["SecurityGroups"][0]["GroupId"]
instance = ec2.create_instances(
ImageId="ami-096cb92bb3580c759",
ImageId=config["providers"]["aws"]["ami"],
MinCount=1,
MaxCount=1,
InstanceType=config["providers"]["aws"]["size"],
Expand Down
3 changes: 3 additions & 0 deletions cloudproxy/providers/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"scaling": {"min_scaling": 0, "max_scaling": 0},
"size": "",
"region": "",
"ami": "",
"secrets": {"access_key_id": "", "secret_access_key": ""},
},
"hetzner": {
Expand Down Expand Up @@ -80,6 +81,8 @@
config["providers"]["aws"]["size"] = os.environ.get("AWS_SIZE", "t2.micro")
config["providers"]["aws"]["region"] = os.environ.get("AWS_REGION", "eu-west-2")

config["providers"]["aws"]["ami"] = os.environ.get("AWS_AMI", "ami-096cb92bb3580c759")

# Set Hetzner config
config["providers"]["hetzner"]["enabled"] = os.environ.get(
"HETZNER_ENABLED", False
Expand Down
6 changes: 4 additions & 2 deletions docs/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Now you have your access key and secret access key, you can now use AWS as a pro

``AWS_MAX_SCALING`` - this is currently unused, however will be when autoscaling is implemented. We recommend you set this as the same as the minimum scaling to avoid future issues for now. Default value: 2

``AWS_SIZE`` - this sets the droplet size, we recommend the smallest droplet as the volume even a small droplet can handle is high. Default value: t2.micro
``AWS_SIZE`` - this sets the instance size, we recommend the smallest instance as the volume even a small instance can handle is high. Default value: t2.micro

``AWS_REGION`` - this sets the region where the droplet is deployed. Some websites may redirect to the language of the country your IP is from. Default value: eu-west-2
``AWS_REGION`` - this sets the region where the instance is deployed. Some websites may redirect to the language of the country your IP is from. Default value: eu-west-2

``AWS_AMI`` - this sets the AMI the instance is deployed with. The default AMI is for Ubuntu 20.04, however each region may use a different AMI ID. If not using eu-west-2, you may need to set a different AMI ID. See the AWS AMI Marketplace for Ubuntu 20.04 AMI IDs. Default value: ami-096cb92bb3580c759

0 comments on commit 7cab735

Please sign in to comment.