Wrzasq.pl

CloudFormation custom resource providers - with any runtime, any toolchain, any deployment pipeline

Thursday, 27 May 2021, 22:05

Yes, CloudFormation again. It may seems funny how many trouble case-studies and troubleshooting guides I can write for a tool I claim is best IaaC solution for AWS cloud… but I bet this is how it works for most of popular tools - you always have some edge cases and new features that require stabilization, yet if the tool is flexible enough you can overcome the downsides. In CloudFormation you can do so by using macros, modules, custom resources ("old way") or - subject of this post - resource providers. Resource providers allow for extending CloudFormation capabilities to handle custom resources in a standardized approach. You can think of it as a superior replacement for AWS::CloudFormation::CustomResource. Custom resources had a lot of limitations: you had to manage permissions for each instance - in resource providers it's the provider that defines required permissions; resource handler execution time was limited to single Lambda execution time (in fact you could count it times three thanks for handling retries) which was up to 45 minutes in current setup - resource providers allow you to report progress and integrate stabilization flow to extend this time to tens of hours. Resource providers are more integrated with CloudFormation service itself - in fact huge part of natively-supported resources is released open-source by AWS as resource providers. As always there is also some but and here I will try to describe my little experiment lifting the boundaries of resource providers to cover scenarios and needs that AWS claims are not "supported" right now.

Tags: , , , ,

» Komentarze

Provisioning AWS Athena queries with Lambda and StepFunctions

Saturday, 30 May 2020, 23:21

Amazon Athena is a brilliant tool for data processing and analytics in AWS cloud. Under the hood it utilizes Presto engine to query and process data in your S3 storage using standard SQL notation. The concept behind it is truely simple - run SQL queries against your data in S3 and pay only for the resurces consumed by the query. No cluster to manage - everything fully serverless and managed by Amazon; no need to learn new technology - you query data using SQL that most likely is known among your team; no need for additional storage or fees - you store data directly in S3. Did I mention a keyword serverless? Yes, it runs completely via API SDK, no need to manage any resource on your own (and cold startup in Athena is super low). It integrates tightly with Glue. When we say serverless in AWS we mainly think Lambda. And for sure, sooner or later you will want to integrate your query into some more complex workflow.

Tags: , , , ,

» Komentarze

FrontPageFilter - SPA with server side pages in Java

Thursday, 06 October 2016, 20:29

Time flies, browsers become more and more modern, they are more and more up-to-date. As the common web standards and new frontend technologies are being adopted you can shift more stuff to the client-side. Particularily it means nowadays you can leave most of the frontend part on your JavaScript application shoulders. Thanks to that SPA approach is getting more and more popular. Especially that most search engines and webmaster tools are now able to understand and execute JavaScript code to build full site representation for analysis. With all of these in mind it's an attractive idea to develop your backend application as a pure JSON API (it doesn't have to be pure REST) and handle everything related to presentation layer on a frontend (browser) side. But you still need an application to serve it all from your server(s). Which means your backend application still needs to be a web application.

Tags: , , , , , ,

» Komentarze

Mikroformaty

Thursday, 16 June 2016, 10:47

Mikroformaty od jakiegoś czasu stają się coraz popularniejsze, ale wciąż nie są na szeroką skalę ani używane, ani opisywane. Co to w ogóle takiego? Mikroformaty definiują sposób zapisu pewnego rodzaju informacji na stronach WWW głównie od strony budowy dokumentu, co umożliwia odczytanie takich informacji przez maszyny i programy.

Tags: , , ,

» Komentarze

Generator kodów kreskowych

Thursday, 16 June 2016, 10:47

Przy okazji tworzenia nowej oddsłony pewnego serwisu zetknąłem się z kolejnym nowym problemem - tworzeniem kodów kreskowych. Trzeba było napisać aplikację generującą takie kody. Do tej pory nigdy nie zajmowałem się ich tworzeniem, a jedynie obsługą od strony bazy danych - tworzylem programy ktore zarządzały wcześniej zczytanymi kodami. Tym razem musiałem je generować. Dla mnie była to nowość, ale jak zawsze w takich sytuacjach wyszukałem potrzebne mi informacje i specyfikacje i bazując na nich napisałem kod odpowiedzialny za te czarne paski. Niestety zauważyłem, że jest to kolejna problematyka, która nie jest raczej nigdzie poruszana, bo jedyne materiały jakie znalazłem to oficjalne standardyzacje kodów, a pozostałe znaleziska to zazwyczaj pytania na forach bez odpowiedzi. Dlatego postanowiłem się podzielić kolejną pigułką wiedzy i omówić tworzenie takich kodów z poziomu PHP przy użyciu biblioteki GD.

Tags: , , , , , ,

» Komentarze

DotPay Premium SMS - kody o różnych wartościach

Thursday, 16 June 2016, 10:47

DotPay to jeden z dwoch (obok Płatności.pl) największych serwisów obsługujących płatności internetowe w Polsce. Ja jakoś preferuję ten pierwszy - może to sentyment, może przyzwyczajenie, ale jakoś wygodniej mi się z nim pracuje. Wydaje się mi być łatwiejszy w implementacji we własnych rozwiązaniach, mniej restrykcyjny (przy zachowaniu wszelkich standardów bezpieczeństwa), a przez to o wiele bardziej elastyczny. Jego wielką zaletą jest wszechstronność, mamy tutaj ogromną ilość różnych kanałów płatności. Jednak o ile w zakresie obsługi mikropłatności i płatności internetowych możliwe, że Płatności.pl ma większą część rynku, to w zakresie płatności SMS wydaje mi się, żę niekwestionowanym liderem jest właśnie DotPay. Ja z DotPayem styczność mam od lat i wdrożenia oparte na tym systemie zdarzają mi się muszę przyznać dość często. Szczególnie ostatnio popularne stało się tworzenie na stronach swego rodzaju portfela, który można doładować na przykład SMSami. Pomijając kwestię prowizji, co moim zdaniem i tak powinno dyskwalifikować to rozwiązanie jako podstawę systemu płatności, mają one jednak jeszcze jedną wadę - sztywno skwantyfikowane wartości. Posiadanie zaufanego systemu płatności jest sprawą kluczową. Obsługując miliony ludzi obracających pieniędzmi w zakresie bankowości zarówno prywatnej jak i profesjonalnej, zakupów i podróży, Partypoker i innych gier online, systemy takie muszą działać szybko i stabilnie. Każda transakcja musi być całkowicie bezpieczna. Tego typu firmy muszą odpowiedzialnie podchodzić nawet do najmniejszych transakcji, aby utrzymać przy sobie klientów i pozyskiwać nowych.

Tags: , , ,

» Komentarze

JavaScript Zend-like url helper

Thursday, 16 June 2016, 10:47

In JavaScript, especially when you work with AJAX (many requests to frontend host) and dynamic UI (many requests for assets like images) you have to resolve a lot of URLs. Problem comes, when you have to keep some base of your URLs reference (like web application base URL), or keep your links switchable easily (static hosts balancing). If you are familiar with Zend_Framework, you must know baseUrl() helper for Zend_View. Isn't that a handful thing? Then why not use it in your client scripts as well :)? Here I propose my solution for easy URLs resolving that behaves much like Zend_View's baseUrl() helper.

Tags: , ,

» Komentarze

Using Disqus in XHTML applications

Thursday, 16 June 2016, 10:47

Disqus is a great service! Without any doubt - brilliant comments system for any website you have. With it you no longer need to care about implementing comments system, moderation tools, social stream etc. Everything you need from commenting system is there. However there is one problem with it - it doesn't work with real XHTML applications (not so common over the net, but still). What's even worse Disqus team stated clearly that they will not care about XHTML applications. If they won't, then I will :).

Tags: , , , ,

» Komentarze

Symfony2 - global templating variables in PHP renderer with ChillDevViewHelpersBundle

Thursday, 16 June 2016, 10:47

Short time ago, while working on one of my projects i faced a problem with PHP templating engine in Symfony2 (again the same) - passing pre-defined variables to view renderer. For some reason it's not possible to define global variables for PHP templating engine. It is possible for Twig (with TwigBundle), but there is no equivalent of that for PHP. After googling for a moment and browsing some of Stack Overflow questions I ensured myself that it's not possible and that I'm not the only one who is looking for such a feature.

Tags: , , ,

» Komentarze

Symfony2 - creating adapter-dependent sub-forms

Thursday, 16 June 2016, 10:47

I think this is quite commonly needed feature - form structure that vary depending on some other field(s). The project, on which I'm currently working, is integrated with a lot of external APIs which usually require additional per-user options for each of them. It's a SEO tool and - to pick an example - provides various indexing services integration. Some of them require API key, some require login and password, some specify different URLs. So for each of them form structure can differ. Of course you could use some conditions to pick correct structure, but it's not enough - form needs to change together with selected option. There are some partial tutorials on the web how to alternate form based on events, but it's just one part of the solution - here is more complex one.

Tags: , , , ,

» Komentarze