<div dir="ltr">Great work, David. Congratulations on the release!</div><div class="gmail_extra"><br><div class="gmail_quote">On 19 April 2016 at 21:39, David Reaver <span dir="ltr"><<a href="mailto:johndreaver@gmail.com" target="_blank">johndreaver@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Alberto!<div><br></div><div>You can certainly set up permissions and security groups on EC2 nodes using CloudFormation, run your job, and then tear down the CloudFormation stack. You can use stratosphere to specify the AWS resources like an EC2 instance, a VPC for it, some security groups, and an instance role. Then, you can use something like Ansible or even just a bash script to set up and run your job on that machine. Once it's done, you can tear down the stack you just built.</div><div><br></div><div>We actually do something similar to what you said for running pgbadger on our Postgres RDS logs. Our logs can reach a few GB per hour, so downloading them to a local machine can be pretty time-consuming, and processing can take long as well. In order to get RDS logs, you need to have permissions to do so on AWS. I made a stack in stratosphere that creates a large EC2 instance for processing, a strict security group that locks down the instance, and also sets up a temporary user that only has permission to download RDS logs. Using Ansible, I then install pgbadger and its dependencies, download the logs, run pgbadger, and then download the results. Once the job is done, everything that was just created is destroyed.</div><div><br></div><div>In summary, what you're saying is indeed possible and is a great use-case for CloudFormation. You just need to using something on top of stratosphere, as this library is simply used to build the CloudFormation templates. I'm considering adding support for running the templates directly in this library, maybe using amazonka-cloudformation. So far that hasn't been necessary for us.</div><div><br></div><div>Also note that CloudFormation has a way to estimate the cost of your created resources: <a href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-paying.html" target="_blank">http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-paying.html</a></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 19, 2016 at 12:21 PM, Alberto G. Corona <span dir="ltr"><<a href="mailto:agocorona@gmail.com" target="_blank">agocorona@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Very nice job.<div><br></div><div>I have tried AWS EC2 and I failed miserably since the permission system and his intricate configurations, his paranoid security, and  their secret formulas for pricing are beyond an average human intelligence.</div><div><br></div><div>It is possible to have an example stratosphere application that could configure and run a Haskell program in one or many EC2 nodes , close the instances and send back the results?</div><div><br></div><div>Are there  some elements still lacking to achieve such goal?</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>2016-04-19 20:56 GMT+02:00 David Reaver <span dir="ltr"><<a href="mailto:johndreaver@gmail.com" target="_blank">johndreaver@gmail.com</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div>Github: <a href="https://github.com/frontrowed/stratosphere" target="_blank">https://github.com/frontrowed/stratosphere</a></div><div>Hackage: <a href="https://hackage.haskell.org/package/stratosphere" target="_blank">https://hackage.haskell.org/package/stratosphere</a></div><div><br></div><div>CloudFormation is a system that provisions and updates Amazon Web Services</div><div>(AWS) resources based on declarative templates. Common criticisms of</div><div>CloudFormation include the use of JSON as the template language and limited</div><div>error-checking, often only available in the form of run-time errors and stack</div><div>rollbacks. By wrapping templates in Haskell, we are able to easily construct</div><div>them and help ensure correctness.</div><div><br></div><div>The goals of stratosphere are to:</div><div>- Build a Haskell EDSL to specify CloudFormation templates. Since it is</div><div>  embedded in Haskell, it is type-checked and generally much easier to work</div><div>  with than raw JSON.</div><div>- Have a simple checking/linting system outside of the types that can find</div><div>  common errors in templates.</div><div>- Be able to also read valid CloudFormation JSON templates so they can be</div><div>  type-checked. This also gives us free integration tests by using the huge</div><div>  amount of example templates available in the AWS docs.</div><div><br></div><div>Most of the commonly used CloudFormation resources are implemented, and adding</div><div>new resources is very straightforward. (We created a web scraper that generates</div><div>a JSON file from a given CloudFormation documentation page URL, and from that</div><div>we generate a Haskell module.) So far, we have implemented resources we use at</div><div>Front Row Education, and we will add more resources over time.</div><div><br></div><div>The library is very much in a usable state as-is. However, we want to make any</div><div>sweeping changes while it is still young. If you have any suggestions at all,</div><div>you want us to add your favorite resource, or if you find a bug, please file an</div><div>issue on Github!</div><div><br></div><div>Also, we want to give a huge thanks to Brendan Hay, the author of amazonka, for</div><div>his ideas and feedback on the project.</div></div>
<br></div></div>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>Alberto.</div>
</font></span></div>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>