Aws-cdk: Local resources for development and debugging

Created on 11 Jul 2018  路  2Comments  路  Source: aws/aws-cdk

Consider if perhaps specific constructs can support "local mode", which will allow us to bring up local instances of mock services such as DynamoDB, redis, memcached, postgres. This might be very beneficial for dev stacks for quick iteration and cost savings

For compute code (i.e. Lambda, EC2), it should be possible to do something like sam-cli where we deploy a proxy lambda and route events to the local machine, allowing developers to use the IDE for debugging.

One thing to notice is how the code behaves in respect to VPNs. There are some AWS resources (e.g. ElasticCache) that can only be accessed from within a VPC. Does that mean that the local machine needs to be connected to the VPC or the VPC needs to allow access from that machine.

efforlarge feature-request p1 packagtools

Most helpful comment

still relevant

All 2 comments

I normally recommend against this approach when talking to customers.

There are two ways that people approach local/offline development:

1) I want everything offline. I'm going to emulate the whole cloud.
2) I want the compute section that runs the code I'm iterating on offline, and all of my dependencies online.

Option 1 is hard. Some AWS services have offline versions (e.g. DynamoDB and possibly Kinesis from memory), there are also some community efforts like localstack. None of these achieve feature parity and fidelity with their real counterparts - which generally leads to frustration and bugs that only get found later in integration testing/production.

Option 2 provides a middle ground. It's generally rare that people are 100% disconnected from the internet when developing (planes/trains etc), and most of the time developing against real dependencies is possible. By just running the compute section (Lambda for example) locally, you can iterate fast on the bits you're working on, and still achieve fidelity with your dependencies.

still relevant

Was this page helpful?
0 / 5 - 0 ratings