8000 Implement EC2 support through Moto (#1363) · sharp-bits/localstack@89ffa24 · GitHub
[go: up one dir, main page]

Skip to content

Commit 89ffa24

Browse files
brettneesewhummer
authored andcommitted
Implement EC2 support through Moto (localstack#1363)
1 parent f207410 commit 89ffa24

File tree

10 files changed

+24
-6
lines changed

10 files changed

+24
-6
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ADD bin/supervisord.conf /etc/supervisord.conf
3535
ADD bin/docker-entrypoint.sh /usr/local/bin/
3636

3737
# expose service & web dashboard ports
38-
EXPOSE 4567-4593 8080
38+
EXPOSE 4567-4597 8080
3939

4040
# define command at startup
4141
ENTRYPOINT ["docker-entrypoint.sh"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ any longer.
5050
* **CloudWatch Logs** at http://localhost:4586
5151
* **STS** at http://localhost:4592
5252
* **IAM** at http://localhost:4593
53-
53+
* **EC2** at http://localhost:4597
5454

5555
Additionally, *LocalStack* provides a powerful set of tools to interact with the cloud services, including
5656
a fully featured KCL Kinesis client with Python binding, simple setup/teardown integration for nosetests, as

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ services:
44
localstack:
55
image: localstack/localstack
66
ports:
7-
- "4567-4593:4567-4593"
7+
- "4567-4593:4567-4597"
88
- "${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}"
99
environment:
1010
- SERVICES=${SERVICES- }

localstack/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import localstack_client.config
33

44
# LocalStack version
5-
VERSION = '0.9.4'
5+
VERSION = '0.9.5'
66

77
# default AWS region
88
if 'DEFAULT_REGION' not in os.environ:

localstack/ext/java/src/main/java/cloud/localstack/Localstack.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ public static String getEndpointStepFunctions() {
203203
return ensureInstallationAndGetEndpoint(ServiceName.STEPFUNCTIONS);
204204
}
205205

206+
public static String getEndpointEC2() {
207+
return ensureInstallationAndGetEndpoint(ServiceName.EC2);
208+
}
209+
210+
206211
/* UTILITY METHODS */
207212

208213
/**

localstack/ext/java/src/main/java/cloud/localstack/ServiceName.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ public class ServiceName {
2020
public static final String SSM = "ssm";
2121
public static final String SECRETSMANAGER = "secretsmanager";
2222
public static final String STEPFUNCTIONS = "stepfunctions";
23+
public static final String EC2 = "ec2";
24+
2325
}

localstack/ext/java/src/main/java/cloud/localstack/docker/LocalstackDocker.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ public String getEndpointSSM() {
175175
public String getEndpointSecretsmanager() {
176176
return endpointForService(ServiceName.SECRETSMANAGER);
177177
}
178+
179+
public String getEndpointEC2() {
180+
return endpointForService(ServiceName.EC2);
181+
}
178182

179183
public String getEndpointStepFunctions() { return endpointForService(ServiceName.STEPFUNCTIONS); }
180184

localstack/plugins.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from localstack.services.infra import (register_plugin, Plugin,
88
start_sns, start_ses, start_apigateway, start_elasticsearch_service, start_lambda,
99
start_redshift, start_firehose, start_cloudwatch, start_dynamodbstreams, start_route53,
10-
start_ssm, start_sts, start_secretsmanager, start_iam, start_cloudwatch_logs)
10+
start_ssm, start_sts, start_secretsmanager, start_iam, start_cloudwatch_logs, start_ec2)
1111
from localstack.services.kinesis import kinesis_listener, kinesis_starter
1212
from localstack.services.dynamodb import dynamodb_listener, dynamodb_starter
1313
from localstack.services.apigateway import apigateway_listener
@@ -76,6 +76,8 @@ def register_localstack_plugins():
7676
register_plugin(Plugin('stepfunctions',
7777
start=stepfunctions_starter.start_stepfunctions,
7878
listener=stepfunctions_listener.UPDATE_STEPFUNCTIONS))
79+
register_plugin(Plugin('ec2',
80+
start=start_ec2))
7981
except Exception as e:
8082
print('Unable to register plugins: %s' % e)
8183
sys.stdout.flush()

localstack/services/infra.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,11 @@ def start_secretsmanager(port=None, asynchronous=False):
262262
return start_moto_server('secretsmanager', port, name='Secrets Manager', asynchronous=asynchronous)
263263

264264

265+
def start_ec2(port=None, asynchronous=False):
266+
port = port or config.PORT_EC2
267+
return start_moto_server('ec2', port, name='EC2', asynchronous=asynchronous)
268+
269+
265270
# ---------------
266271
# HELPER METHODS
267272
# ---------------

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ flask-cors==3.0.3
1717
flask_swagger==0.2.12
1818
jsonpath-rw==1.4.0
1919
localstack-ext>=0.8.6
20-
localstack-client==0.8
20+
localstack-client==0.9
2121
moto-ext>=1.3.7.1< 41BA /div>
2222
nose>=1.3.7
2323
psutil==5.4.8

0 commit comments

Comments
 (0)
0