<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Nordcloud Engineering - Medium]]></title>
        <description><![CDATA[The place where clouds are born - Medium]]></description>
        <link>https://medium.com/nordcloud-engineering?source=rss----6711a67bba47---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Nordcloud Engineering - Medium</title>
            <link>https://medium.com/nordcloud-engineering?source=rss----6711a67bba47---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 00:07:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/nordcloud-engineering" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Anonymising access logs in AWS Cloudfront]]></title>
            <link>https://medium.com/nordcloud-engineering/anonymising-access-logs-in-aws-cloudfront-2bda89d85900?source=rss----6711a67bba47---4</link>
            <guid isPermaLink="false">https://medium.com/p/2bda89d85900</guid>
            <category><![CDATA[data-privacy]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[logging]]></category>
            <category><![CDATA[cloudfront]]></category>
            <dc:creator><![CDATA[Marcin Kepka]]></dc:creator>
            <pubDate>Mon, 30 Jan 2023 10:31:18 GMT</pubDate>
            <atom:updated>2023-01-30T10:31:18.542Z</atom:updated>
            <content:encoded><![CDATA[<h3>Anonymising real time logs in AWS CloudFront</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1yaA5YQMu97ltv_5H5lN1A.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@martinadams?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Martin Adams</a></figcaption></figure><p>CloudFront allows you to log requests in two different ways.</p><ul><li>Standard logs</li><li>Real time logs</li></ul><p>The standard logs are great, there is no additional cost, and you only pay for the storage (S3). Unfortunately, they do not allow you to modify the fields that are being sent into the log stream. One of those fields is <strong>c-ip</strong> which is IP address of a person visiting your website. Under the GDPR an IP address is considered as personal information which must be processed in accordance with EU law.<br>On the other side of the spectrum the real time logs give you much more flexibility. You can define fields that you want to log in real time records. If you are not required to comply with requirements that mandate the logging of IP addresses, consider excluding them from your log configuration to maintain privacy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VQ3H8eAFJARVZse9vri11w.png" /></figure><h4>IP Masking</h4><p>If, after considering privacy concerns, you still wish to retain IP addresses in the logs, anonymising the data may be a viable option. Let’s take a closer look at the architecture for real-time logging:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*jtrFeGCEOVqSNuz23nTH_w.png" /><figcaption>Real time logging architecture</figcaption></figure><p>The CloudFront logs are being delivered to Kinesis data stream and then consumed by Firehose and sent to destination. The Firehose gives you ability to transform incoming data and deliver processed data to destination which is a S3 bucket in this case. We can write a simple Lambda function that will mask IP addresses on the fly by setting the last octet of IPv4 and the last 2 octets of IPv6 addresses to zeros. Here’s an example of how that function could look like.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/09ac16679596cfdffd68614e9b003768/href">https://medium.com/media/09ac16679596cfdffd68614e9b003768/href</a></iframe><p>And the example log output after masking IP address:</p><pre>1670495826.812 31.61.160.0 GET https www.example.com IPv4 TLSv1.3 PL<br>1670495831.636 51.178.130.0 GET http www.example.com IPv4 - FR<br>1670495849.538 68.235.60.0 GET http www.example.com IPv4 - US<br>1670495861.480 68.235.60.0 GET https www.example.com IPv4 TLSv1.2 US<br>1670495871.707 18.215.20.0 GET https www.example.com IPv4 TLSv1.2 US</pre><h4>Deployable stack</h4><p>And finally, here’s a full CloudFormation template that will deploy a CloudFront distribution with real time logging enabled, s3 bucket and a data transformation Lambda function that will take care of data masking.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1cd9b452b29962c90f8a69309d06723e/href">https://medium.com/media/1cd9b452b29962c90f8a69309d06723e/href</a></iframe><h3>Summary</h3><p>In conclusion, it is important to be mindful of privacy when logging requests on your website. While standard logs from CloudFront are cost-effective and convenient, they do not offer the flexibility to modify the fields being logged. Real-time logs offer increased control over the fields being logged, but come at an additional cost. If privacy is a concern and you are not required to comply with regulations that mandate the logging of IP addresses, it is recommended to exclude them from the log configuration or consider anonymizing the data. The choice between standard logs and real-time logs, and the handling of IP addresses in logs, will depend on your specific privacy requirements and regulations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bda89d85900" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nordcloud-engineering/anonymising-access-logs-in-aws-cloudfront-2bda89d85900">Anonymising access logs in AWS Cloudfront</a> was originally published in <a href="https://medium.com/nordcloud-engineering">Nordcloud Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A song of Decentralization and Observability: Dance with open telemetry]]></title>
            <link>https://medium.com/nordcloud-engineering/a-song-of-decentralization-and-observability-dance-with-open-telemetry-ec2c4d7006cf?source=rss----6711a67bba47---4</link>
            <guid isPermaLink="false">https://medium.com/p/ec2c4d7006cf</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloudformation]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[opentelemetry]]></category>
            <category><![CDATA[x-rays]]></category>
            <dc:creator><![CDATA[Aritra Nag]]></dc:creator>
            <pubDate>Wed, 03 Aug 2022 07:11:15 GMT</pubDate>
            <atom:updated>2022-10-28T08:14:18.667Z</atom:updated>
            <content:encoded><![CDATA[<h3>A song of Decentralization and Observability: Dance with OpenTelemetry</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y55ODrJW5tJqcLwDteRctA.jpeg" /></figure><h3><strong>Introduction</strong></h3><p>Following the announcement of general availability on tracing with AWS Distro for OpenTelemetry, There has been quite a buzz in the AWS developers community to enable a single pane of glass to enable tracing in the world of decentralized architectures. In this article, we will describe how observability and open telemetry fits into one of the most critical pillars of the <a href="https://docs.aws.amazon.com/wellarchitected/latest/framework/wellarchitected-framework.pdf">Well-Architected Framework — Operational Excellence</a> of AWS Ecosystem.</p><h4><strong>Observability</strong></h4><p>In modern technology environments, observability is a process that uses software tools to detect issues by observing both the inputs and outputs of the technology stack. Inputs include application and infrastructure stacks, while outputs include business transactions, user experiences, and application performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*0xTFwc1aNIpLjDqNsksUKA.png" /></figure><p><strong>Observability</strong> tools collect and analyze a broad spectrum of data, including application health and performance, business metrics like conversion rates, user experience mapping, and infrastructure and network telemetry to resolve issues before they impact business KPIs.</p><p>Over the last several years, enterprises have rapidly adopted cloud-native infrastructure services, such as AWS, in the form of microservices, serverless, and container technologies. In the IT ecosystem, Observability refers to the ability to understand an application’s performance based on output data, or telemetry. In de-centralized or microservices-based architecture design, <strong>telemetry</strong> can be divided into three major categories:</p><ul><li><strong>Traces</strong>: contextual data about a request through a system</li><li><strong>Metrics</strong>: quantitative information about processes</li><li><strong>Logs</strong>: specific messages emitted by a process or service</li></ul><p>Observability in software is about the integration of multiple forms of telemetry data which together can help us better understand how our software is operating. Advantages of integrating them into the software:</p><ul><li>Effective and efficient monitoring of workloads in the Cloud.</li><li>More Control and tracing capabilities of distributed systems.</li><li>Enhance birds-eye view for IT administrators and system architects over the total land space of the system.</li></ul><h4>Observability: OpenTelemetry(Otel)</h4><p>OpenTelemetry(Otel) is a collection of vendor-agnostic open-source tools, APIs, and SDKs that aims to offer an all-in-one framework for the collection of telemetry data and distribution of it to observability platforms. It is an incubating project managed by the <a href="https://www.cncf.io/">Cloud Native Computing Foundation</a> (CNCF), which also manages the Kubernetes framework, alongside a few other open-source container technology frameworks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NvbplXZYcyzIEe-01zfc7g.png" /></figure><p>There are multiple facets of the OpenTelemetry:</p><ol><li><strong>APIs</strong> are used to instrument our code to generate traces, Most libraries are expected to come with OpenTelemetry capabilities out of the box in the not-too-distant future. We will showcase the AWS-managed Prometheus writer API endpoint in our demo.</li><li><strong>SDKs</strong> to collect such data and pass it to the processing and export stages. AWS Xray SDK has been incorporated into our demo.</li><li>In-process <strong>exporters</strong>, running with the application, can translate the telemetry data into custom formats and send it directly or through a collector to back-ends,</li><li>The out-of-process <strong>collector</strong> is used for data filtering, aggregation, batching, and communication with various telemetry backends.</li></ol><p>The purpose of OpenTelemetry is to simplify the collection and management of telemetry data to enable developers to adopt observability best practices. OpenTelemetry has support from some of the biggest companies in the tech industry, with active contributions from Microsoft, Google, Amazon, Red Hat, Cisco, and <a href="https://opentelemetry.devstats.cncf.io/d/5/companies-table">many others</a>.</p><p>The ultimate goal for OpenTelemetry is to ensure that this <strong>telemetry</strong> data is a built-in feature of cloud-native software. This means that libraries, frameworks, and SDKs should emit this telemetry data without requiring end-users to proactively instrument their code.</p><p><em>Benefits</em>:</p><ol><li>It provides a standard vendor-agnostic interface.</li><li>Opentelemetry(Otel) supports the three main types of telemetry data in form of metrics, traces, and logs.</li><li>Flexibility and ease of use are also other advantages of OpenTelemetry.</li></ol><p>In the upcoming sections, We will showcase an end-to-end example of a microservice written in Java and Springboot which is deployed in AWS ECS as a service and load-balanced by AWS Elastic load balancer. AWS X-ray SDK has been used to incorporate the telemetry data to be parsed and sent across the Prometheus endpoint which will be visible in both AWS Cloudwatch as well as AWS-managed Grafana.</p><h4>Solution Design</h4><p>Several patterns can be used for deploying telemetry-enabled solutions for observability. The common ones include</p><ul><li><strong>Sidecar pattern</strong>: A common practice in the observability world is to use sidecars to provide container instrumentation. The advantage of the sidecar pattern is configuration and troubleshooting are quite easy. However, multi-level microservices architecture with thousands of small-scale services will add up the cost as well make this setup expensive.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O9bceaKwos7pmD3U988ckQ.png" /></figure><ul><li><strong>AWS ECS service pattern</strong>: Amazon ECS service deployment pattern is similar to the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/">DaemonSet</a> pattern in Kubernetes. An Amazon ECS service allows us to run and maintain a specified number of instances of an OTel task in ECS. The advantage of this pattern is cost saving. Compute costs are reduced because the number of instrumentation containers no longer has a 1:1 relationship with the application containers.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bNgPLr7O2jNgNauipgUyLw.png" /></figure><p>We will be showcasing the 2nd pattern in this blog. However, setting up automating the deployments and CI/CD is out of scope for this blog. <em>We have also previously showcased how to enable Continuous deployment and Continuous delivery when it comes to AWS Cloud infrastructure as a Code development using AWS CDK. Here is the link to the </em><a href="https://medium.com/nordcloud-engineering/enterprise-implementation-of-infra-as-code-using-cdk-5d229e08b414"><em>blog</em></a>.</p><p>We will explain each of the components of the project and also link them to each of the components shown in the diagram above. Here is the link to the <a href="https://github.com/aritnag/aws-otel-end-to-end">Repository</a> in case anybody wants to experience the full flavor of the solution design.</p><h4>Technology and AWS Services Used</h4><ol><li>Java Springboot application to create microservice for creating REST APIs</li><li>Docker for encapsulating the service to run in AWS ECS Fargate container service</li><li>AWS Services used to showcase tracing: AWS DynamoDB, S3, ELB, Route53, Managed Prometheus, and AWS ECS/ECR</li><li>Infrastructure is deployed using AWS Cloudformation scripts</li></ol><p><em>Application High-level Design Overview</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Atc1tpT14PRs2Z5Yj_zCTw.png" /></figure><p>The ECS Service is written in Spring boot and mainly consists of 2 APIs</p><ol><li><em>/api/healthcheck</em> → This API is primarily for the AWS load balancers and AWS ECS Services to ping and ensure the tasks are running correctly for sending traffic through the AWS ELB DNS endpoint. Once we start up the application, there will be traces displayed for this in the AWS Xray dashboard console as well.</li><li><em>/api/index → </em>This API is used for counting the number of AWS S3 buckets by invoking the AWS S3 SDK(list buckets) and also to fetch sample count from AWS DynamoDB using the DynamoDb SDK(query). There is also an invocation to an external API(<a href="https://nordcloud.com/">example: Nordcloud</a>) using a <a href="https://docs.spring.io/spring-cloud-openfeign/docs/current/reference/html/">Java Spring Native library</a></li></ol><p><strong><em>AWS Deployment Landscape: Cloudformation Scripts</em></strong></p><p>We will start the design by creating the AWS Cloud Landscape to deploy the microservices as a docker container within AWS Elastic container service. Here is the overview of the AWS components which will be created by the AWS Cloudformation scripts provided within the repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*34roTdMNRQBA6-jyf6G-jw.png" /></figure><p>We will discuss each of the components and the corresponding AWS Cloudformation scripts related to the same.</p><ol><li><strong>AWS VPC</strong> with CIDR range: 10.215.0.0/16 consisting of 2 public and 2 private subnets along with an Internet Gateway(IGW) and NatGateway</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d3e4e31494e65defa91484f0cd6dccf/href">https://medium.com/media/9d3e4e31494e65defa91484f0cd6dccf/href</a></iframe><p>2. <strong>AWS ECS</strong> <strong>Cluster</strong> for Creating ECS Fargate containers</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b6457e3bd06f11ca8d9f6100e393223a/href">https://medium.com/media/b6457e3bd06f11ca8d9f6100e393223a/href</a></iframe><p>3. <strong>AWS ECS Service</strong> which is built from the Java spring boot microservice containing the AWS S3, Xray, and DynamoDB SDK.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7d2d3c0b5790174a7f80a2b2e23568f8/href">https://medium.com/media/7d2d3c0b5790174a7f80a2b2e23568f8/href</a></iframe><p><strong>Note</strong>: Please ensure the task execution role has the following managed policies attached to it to enable pushing telemetry data to the AWS cloud Prometheus endpoint: <em>AWSXrayWriteOnlyAccess, AWSXRayDaemonWriteAccess, AmazonPrometheusRemoteWriteAccess</em></p><p>Also, we are using the AWS ECR repository to dockerize the microservice and refer to that in the above Cloudformation template under the <em>TaskDefinition</em> component</p><p>3. <strong>AWS Elastic Load Balancer</strong> and Listeners/Target groups for configuring and sending traffic towards the AWS ECS Service</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b475c2de279bb010cca07877883faba/href">https://medium.com/media/8b475c2de279bb010cca07877883faba/href</a></iframe><p><strong><em>OpenTelemetry Collectors Discovery Configuration</em></strong></p><p>In this section, We will showcase how the architecture behind the Opentelemetry works for our demo. Using AWS Cloudformation, We will create the AWS ECS Service pattern which will consume the AWS-managed Prometheus endpoint created by the above cloud formation script, and also use the AWS <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html">Service Discovery</a> feature to enable other services to discover this service and send the metrics towards this service. This <a href="https://opentelemetry.io/docs/collector/configuration/">configuration</a> will enable the logs, and metrics to be showcased in the AWS Cloudwatch dashboard. The below AWS Cloudformation scripts help us to create the AWS Services required to complete this full architecture</p><p><strong><em>AWS Deployment Landscape: Cloudformation Scripts</em></strong></p><ol><li><strong>AWS Managed Prometheus Endpoint</strong> to cater to the ingestion requirements of the traces and metrics data of the services for consolidating and showcasing in AWS Cloudwatch or AWS Managed Graphana dashboard.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2fc6bb8b70d8bdf22ca21753ac9188f9/href">https://medium.com/media/2fc6bb8b70d8bdf22ca21753ac9188f9/href</a></iframe><p>2. <strong>AWS Route 53 Private hosted zone</strong> for enabling the Service discovery feature. AWS ECS service can register with a friendly and predictable DNS name in Route 53. The hosted zones are updated automatically as our Amazon ECS services scale up or down.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/01754a7c6187ed3bc31a17a992287ac9/href">https://medium.com/media/01754a7c6187ed3bc31a17a992287ac9/href</a></iframe><p>3. AWS ECS service for open telemetry which contains all the configurations from <strong>AWS SSM parameters </strong>and is registered via the AWS Service discovery service shown above. Once the AWS ECS Service gets created and the Service discovery is added, the private internal API is injected via environment variables into other application AWS ECS services. This API will be used to send the telemetry data from the multiple services.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/986fd2878a46013b1bbcd018ee73a762/href">https://medium.com/media/986fd2878a46013b1bbcd018ee73a762/href</a></iframe><p>Note: We are using the AWS-managed public AWS ECR Image: <em>public.ecr.aws/aws-observability/aws-otel-collector:v0.12.0 </em>inside the task definition of the above AWS ECS Service.</p><p>We would be using <a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html">AWS SAM CLI</a> for deploying the Cloudformation scripts. This is one of the most common frameworks for deploying AWS Cloudformations scripts as serverless application resources. To use the AWS SAM CLI, we need the following tools:</p><ul><li>AWS SAM CLI — <a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html">Install the AWS SAM CLI</a>.</li><li>Docker — <a href="https://hub.docker.com/search/?type=edition&amp;offering=community">Install the Docker community edition</a>.</li></ul><p>To build and deploy the application for the first time, we need to run the following:</p><pre>sam build<br>sam deploy --guided --capabilities CAPABILITY_NAMED_IAM</pre><p>Finally, we conclude this section by setting up the AWS Infrastructure required to enable and run AWS ECS Service with Open telemetry and Service discovery.</p><p><em>Note</em>: Implementing the infrastructure using AWS Cloudformation is one of the many ways. Personally, AWS CDK is one of my favorites when it comes to infrastructure development. However, since most of the organizations and development teams still rely on AWS Cloudformation for their Cloud infrastructure landscape, we tried to create the same using AWS Cloudformation as well.</p><p><strong><em>Microservice: Java, Springboot, AWS dependencies</em></strong></p><p>This section will showcase how to instrument the Java application spring boot code to incorporate AWS Xray SDK and enable the tracing feature.</p><ol><li><em>Maven dependencies: </em>We need to add the following dependencies in the pom.xml of the project folder.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3a79932ede274c4fcaa466293e9565a/href">https://medium.com/media/c3a79932ede274c4fcaa466293e9565a/href</a></iframe><p>2. <a href="https://docs.aws.amazon.com/xray/latest/devguide/xray-console-sampling.html"><em>Sampling rules</em></a>: Add the tracing rules in the x-ray folder inside the resources section of the source code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c2d15ad168a221ae54749f186886c17/href">https://medium.com/media/3c2d15ad168a221ae54749f186886c17/href</a></iframe><p>3. <em>X-ray filter tracing bean</em>: This filter definition enables tracing the incoming HTTP requests, when we add this X-Ray servlet filter to the application, the X-Ray SDK for Java creates a segment for each sampled request. This segment includes the timing, method, and disposition of the HTTP request.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5efb8bc29a156f7abc325de5498bc02/href">https://medium.com/media/d5efb8bc29a156f7abc325de5498bc02/href</a></iframe><p>4. <em>Annotation: @xrayenabled </em>is being used as an annotation for the Spring boot components to enable the Xray features</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ae5bb04ca08f2d589c113e853cc8c405/href">https://medium.com/media/ae5bb04ca08f2d589c113e853cc8c405/href</a></iframe><p>5. <em>Tracing 3rd party API calls: </em>We have used Spring cloud <a href="https://cloud.spring.io/spring-cloud-netflix/multi/multi_spring-cloud-feign.html">FeignClient</a> to demonstrate the HTTP calls from the application and enable tracing on it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/395de3d2bef0cc8b9565a8331dca9366/href">https://medium.com/media/395de3d2bef0cc8b9565a8331dca9366/href</a></iframe><p>Additional AWS Services like S3 and Dynamodb SDK have been incorporated as well to showcase how the tracing works for the same. More details and advanced techniques can be found at this <a href="https://aws-otel.github.io/docs/getting-started/java-sdk">link</a>.</p><p>We are finally done with the instrumentation of the AWS Xray Code inside the Springboot application which will be deployed as an AWS ECS Service and exposed via an HTTP endpoint using AWS Elastic load balancer. Once we deploy the application and start using the endpoint, the spring boot application will start emitting traces and metrics which will get reflected in the AWS X-ray and AWS Cloudwatch dashboard. AWS X-Ray always encrypts traces at rest, and can also be configured to use AWS Key Management Service (AWS KMS) for compliance requirements like PCI and HIPAA.</p><p><a href="https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon-local.html">Running AWS Xray Locally</a><em>: </em>We can always run the X-Ray daemon on the machine and test out the tracing or metrics, in this case, the application will send the trace data to the local X-Ray daemon and that will, in turn, send it to AWS X-Ray service.</p><h4>Cloudwatch AWS X-Ray Dashboard</h4><p>Once we start making some API calls towards the AWS Elastic load balancer endpoint, based on the application architecture and design we can start seeing the tracing details flowing into the AWS Cloudwatch Xray dashboard.</p><p>Also, AWS X-ray is aware of the outbound HTTP calls(e.g. towards <a href="https://nordcloud.com)/">https://nordcloud.com)</a> from the application, it can identify service boundaries, and can therefore generate a Service Map showing the flow of traffic within our application. We’re able to easily see how one client request invokes three services and an outbound call to AWS S3 and AWS DynamoDB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*89VXE9jkB4lhkDObtbl-Rw.png" /></figure><p>There will be multiple calls towards the health check endpoint defined above in the application from the AWS ELB target group configuration and also towards the aws.amazon.com endpoint to retrieve the metadata and temporary credentials for invoking the different AWS services SDK incorporated inside the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wuJW1EB1TVYKQoLOKFiRng.png" /></figure><p>The individual trace details can be seen below since we have added Springboot pointcut on all our beans that&#39;s why the trace below is showing each class and method details handling the user request. Here we can see how different parameters related to the payload delivery like <em>Latency, Faults </em>are being displayed for each of the traces which are being ingested via the endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*US82ZYaHG0J9KK9CORHsJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6IJhjUQQwJuYJaww1AhkUw.png" /></figure><p>We can also trace the exception which might occur while making any changes inside the application. Using the AWS Xray dashboard and instrumenting the AWS SDK code inside the application with the annotation shown above, we can also drill down further to the exact line from where the exception is occurring. For Example, the below image shows the exception that we were getting while trying to deploy the AWS S3 SDK with a different profile credentials profile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L-K4mN8TR3D27lrsJOMApA.png" /></figure><h4>Grafana Managed Dashboard for metrics and tracing</h4><p>We can also visualize the telemetry data in AWS managed Grafana dashboard. There are multiple ways we can authenticate and set up Grafana (Saml-based and AWS SSO). Amazon Managed Grafana doesn’t just allow us to analyze data from AMP, we can also pull in metrics from self-hosted Prometheus or InfluxDB servers, from a range of AWS services including Amazon CloudWatch, AWS X-Ray, AWS IoT SiteWise, and Amazon Elasticsearch Service as well as from third-party services such as DataDog and Splunk. Based on the solution architecture showcased above, we can see the below examples where the metrics for the AWS ECS Cluster and AWS ECS Services are being presented in the Grafana dashboard.</p><p><em>Cloudwatch AWS ECS Container Metrics</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xpjpBw3rzacpAj7poartZg.png" /></figure><p><em>AWS Xray Tracing Metrics in Grafana</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zpIIdsrit1AVw57UGmesrw.png" /></figure><p>As we’ve seen, we now have some really powerful tools available in the form of Amazon Managed Grafana which allow us to pull in metrics from our applications, the runtime platforms they run on as well as the infrastructure that sits below. This makes it so much easier to spot performance issues, correlate errors, and trace transactions through increasingly complex heterogeneous systems, without having to spend time worrying about the scaling or resilience of our observability platform.</p><h4>Grafana or AWS Cloudwatch</h4><p>One of the main reasons for using Grafana in most organizations is the kind of flexibility we can get outside of AWS CloudWatch in the storage and manipulation of their metrics. We can spin up Grafana in a few minutes with very limited knowledge, and low ongoing maintenance, and still import our Cloudwatch metrics among other data sources. It also has a huge array of plugins so we can have one dashboard that covers AWS services plus non-AWS ones like Cassandra or MongoDB. It’s a tool that can be classified in the <strong>“Monitoring” </strong>category. It also supports multi-cloud monitoring with the help of plugins.</p><p>Whereas, Cloudwatch is mainly used if the organizations have strict data retention policies enforced. It also helps as a starting point to deep dive into the realm of observability since it covers the basics pretty well. AWS Cloudwatch is classified under the <strong>“Cloud Monitoring” </strong>category.</p><p>Having said the above difference, no tool can be said to be perfect. We must choose the tool based on our application architecture and organizational needs. For example, if we are planning to launch infra in AWS it would be perfect to use AWS CloudWatch for metrics, logs, and dashboards as it already has preconfigured configurations. If we are planning low-cost monitoring and customized multi-cloud dashboards, Grafana is a better choice</p><h4>Conclusion</h4><p>Finally, we came to the end of the demo and blog where we tried to showcase the power of AWS Xray to enable tracing within the application and how it helps us to triage multiple factors when it comes to application development and deployment. Especially, Metrics like latency, different container insights as well as Logs visualization help the developer drill down the exact components to improvise.</p><h4>Reference</h4><ol><li><a href="https://aws.amazon.com/cloudwatch/features/">https://aws.amazon.com/cloudwatch/features/</a></li><li><a href="https://aws.amazon.com/blogs/opensource/simplifying-amazon-ecs-monitoring-set-up-with-aws-distro-for-opentelemetry/">https://aws.amazon.com/blogs/opensource/simplifying-amazon-ecs-monitoring-set-up-with-aws-distro-for-opentelemetry/</a></li><li><a href="https://aws.amazon.com/blogs/opensource/deployment-patterns-for-the-aws-distro-for-opentelemetry-collector-with-amazon-elastic-container-service/">https://aws.amazon.com/blogs/opensource/deployment-patterns-for-the-aws-distro-for-opentelemetry-collector-with-amazon-elastic-container-service/</a></li><li><a href="https://grafana.com/oss/grafana/">https://grafana.com/oss/grafana/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec2c4d7006cf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nordcloud-engineering/a-song-of-decentralization-and-observability-dance-with-open-telemetry-ec2c4d7006cf">A song of Decentralization and Observability: Dance with open telemetry</a> was originally published in <a href="https://medium.com/nordcloud-engineering">Nordcloud Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Network in the cloud — Transit gateway]]></title>
            <link>https://medium.com/nordcloud-engineering/network-in-the-cloud-transit-gateway-2f04cd401c6c?source=rss----6711a67bba47---4</link>
            <guid isPermaLink="false">https://medium.com/p/2f04cd401c6c</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Mateusz Rutkowski]]></dc:creator>
            <pubDate>Thu, 14 Jul 2022 07:11:08 GMT</pubDate>
            <atom:updated>2022-07-14T07:11:08.838Z</atom:updated>
            <content:encoded><![CDATA[<h3>Network in the cloud — Transit gateway</h3><p><a href="https://omni-cloud.eu/en/how-to-interconnect-networks-in-cloud-basics/">Last time</a> I described how to create simple connectivities between networks created in Azure and AWS. This is fine for smaller environments or our pet projects, but what if we plan an expansion in the cloud? Maybe we are about to build a new landing zone? Or perhaps we should create a hybrid solution that will allow us to create a bridge between the public cloud and our on-premises infrastructure? To solve such challenges, we can utilize more advanced cloud-native services. Today I am going to put some light on one of such services, and to be precise, it will be about AWS Transit gateway. In further publications, I will write about other solutions.</p><h3>What is a Transit gateway?</h3><p>Transit gateway is a service available only in AWS, and its purpose is to provide an easily manageable networking hub, allowing the interconnection of our VPCs and on-premises networks. This service provides a regional virtual router that can route traffic between different networks. It is an answer to a question, what should you use when you need to allow communication between resources deployed in various environments.</p><p>Transit gateway can send traffic to different networks and network devices using so-called attachments, it can connect with:</p><ul><li>VPCs,</li><li>SD-WAN solutions,</li><li>Third-party NVA (Network Virtual Appliance),</li><li>AWS Direct Connect gateway,</li><li>Other Transit gateways (using peering or VPN connection).</li></ul><p>Can you do this using a different toolset? Sure, you can for example create your own network hub. It is important to remember that in AWS there is no support for transitive VPC traffic — it is traffic between two VPCs through another VPC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*fovE0Q-ENJbZWdeF.png" /><figcaption>Transitive traffic between two VPCs, through another VPC, is not allowed.</figcaption></figure><p>Of course, there are workarounds for such cases. One of them is the usage of VPN connectivity between spoke VPCs and hub VPC, but it is not trivial. You will need an EC2 instance with VPN software, establish all needed VPN tunnels, deliver HA mechanisms, and scale possibilities for such a solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/0*_-SiRX7EHGtfJISx.png" /><figcaption>Transitive VPC traffic with VPN tunnels.</figcaption></figure><p>So yes, you can do it a different way. But it is way simpler and more elastic to use the Transit gateway service. AWS will take care of HA and automatic scaling of solutions, to meet your needs.</p><h3>How does the Transit gateway work?</h3><p>Transit gateway is using the concept of attachments (which have some limitations, I will discuss them later on), if we want to interconnect two VPCs we need to:</p><ol><li>Create AWS Transit gateway,</li><li>Create attachments for both VPCs,</li><li>Take care of routing configuration, and traffic filtering on Security Groups and NACLs.</li></ol><p>During the creation of the attachment, you attach it to a specific subnet in VPC. The attachment will create ENI (Elastic Network Interface) in each of chosen subnets — it will reserve an IP address in each subnet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KnsqnID3_hBtqS25.png" /></figure><p>This is a good moment to step back and take a look at the best practices for the Transit gateway setup. AWS suggests the creation of a dedicated subnet for attachments, you may ask why? It is because, managing routing and NACLs in subnets where we have both our EC2 instances and TGW attachments quickly becomes complicated, problematic, and error-prone (especially if we want to give strict rules). It may lead to a state where changes and troubleshooting of network configuration are causing headaches. More about best practices you can find <a href="https://docs.aws.amazon.com/vpc/latest/tgw/tgw-best-design-practices.html">here</a>.</p><h3>Hybrid cloud</h3><p>Lately, it becomes more and more common that a public cloud environment needs to be communicated with the traditional data center, on-premises locations, or private cloud. Such an environment is called a hybrid cloud. Connectivity with our on-premises can be done in multiple ways, depending on our needs. We can establish Site-to-Site VPN connectivity, or even create dedicated physical connectivity using Direct Connect. Maybe we do not necessarily need to interconnect whole networks, but just provide access to some services to our users, and Client-to-Site VPN will be enough or direct access from the internet to that service (with certain guardrails of course).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*MbYQWDPT8UN5PeTp.png" /></figure><p>No matter what choice we will do (and it does not necessarily have to be a single one), the Transit gateway might be really useful to achieve this state as a central networking point of our network infrastructure, which will allow intercommunicating different nodes together.</p><h3>Limitations</h3><p>When we are working on the design of our infrastructure we should always remember about limitations of the services that we want to utilize. It is not different with Transit gateway, details are described in the <a href="https://docs.aws.amazon.com/vpc/latest/tgw/transit-gateway-quotas.html">documentation</a>, but the few most important according to me are:</p><ul><li>Up to 5 instances of Transit gateway per account (soft limit — can be raised),</li><li>up to 20 routing tables per TGW (soft limit — can be raised),</li><li>up to 5 attachments per VPC (<strong>hard limit</strong>)</li><li>up to 3 TGW per AWS Direct Connect Gateway (<strong>hard limit</strong>).</li></ul><p>Of course, depending on the use case different quotas will be relevant for us, and fortunately, some of those can be raised, but it is worth requesting it upfront.</p><h3>Costs</h3><p>Like most services Transit gateway is not a free service, but pricing calculations are not that complicated, we pay for:</p><ul><li>0,06$ for every attachment by the hour,</li><li>0,02$ per GB of data processed.</li></ul><p>The above prices are examples from the Frankfurt (eu-central-1) region on the day of publication, full pricing details can be found <a href="https://aws.amazon.com/transit-gateway/pricing/">here</a>.</p><p>Below are a few scenarios that will help wrap your head around cost calculations.</p><p><strong>Example 1. </strong>You created a TGW instance in the Central Europe region (Frankfurt) and attached to it a VPC. Then you make a route for traffic to different VPC through TGW. 1GB of data was sent from the EC2 instance between those two VPCs.</p><p>The hourly cost of AWS Transit gateway will be 0,12$ (you need two attachments, one in each VPC, and pricing for attachment is 0,06$/h). If TGW is shared between different AWS accounts, hourly costs are added to the account which owns the VPC with attachment.</p><p>Additionally, TGW processed 1GB of data originating from the EC2 instance. So it will be an additional 0,02$. Costs of data processing are added to the account which owns VPC from which traffic is originating.</p><p><strong>Example 2. </strong>EC2 instance existing in VPC connected to Transit gateway in North Virginia region transferred 1GB of data through peering to second Transit gateway in Oregon. Traffic is addressed to another EC2 instance existing in VPC attached to the second TGW.</p><p>Costs related to data transfer will be 0,04$ — from which 0,02$ is the cost of data processing by TGW from North Virginia, and an additional 0,02$ is the cost of transferring data between regions (outgoing traffic).</p><p>In this scenario, the second TGW (in Oregon) will not generate any additional costs as you do not pay for traffic originating from TGW peering, also you do not pay for traffic coming from a different region (costs were already covered as outgoing traffic in North Virginia).</p><h3>Summary</h3><p>When I was writing this blog post, I was at a stage of preparation for the AWS Advanced Networking Speciality exam, where one of the major topics is Transit gateway. As I already passed this exam, I need to admit that this is definitively a service that you need to have a good understanding of, if you want to pass this exam. This text is giving a brief overview of the Transit gateway, but it is for sure not enough for the exam, and you should deep dive into the documentation to get a better understanding of it. From a networking perspective, I consider TGW as one of the most important services (especially in larger environments), and if you don’t use I already, maybe it is time to ask why?</p><p><em>Sources:</em></p><p><a href="https://docs.aws.amazon.com/vpc/latest/tgw/what-is-transit-gateway.html">https://docs.aws.amazon.com/vpc/latest/tgw/what-is-transit-gateway.html</a></p><p><a href="https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html">https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html</a></p><p><a href="https://www.linkedin.com/pulse/aws-transit-gateway-use-dedicated-subnets-just-local-watson">https://www.linkedin.com/pulse/aws-transit-gateway-use-dedicated-subnets-just-local-watson</a></p><p><a href="https://docs.aws.amazon.com/vpc/latest/tgw/tgw-best-design-practices.html">https://docs.aws.amazon.com/vpc/latest/tgw/tgw-best-design-practices.html</a></p><p><a href="https://aws.amazon.com/blogs/networking-and-content-delivery/using-aws-client-vpn-to-scale-your-work-from-home-capacity/">https://aws.amazon.com/blogs/networking-and-content-delivery/using-aws-client-vpn-to-scale-your-work-from-home-capacity/</a></p><p><a href="https://docs.aws.amazon.com/vpc/latest/tgw/transit-gateway-quotas.html">https://docs.aws.amazon.com/vpc/latest/tgw/transit-gateway-quotas.html</a></p><p><a href="https://aws.amazon.com/transit-gateway/pricing/">https://aws.amazon.com/transit-gateway/pricing/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f04cd401c6c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nordcloud-engineering/network-in-the-cloud-transit-gateway-2f04cd401c6c">Network in the cloud — Transit gateway</a> was originally published in <a href="https://medium.com/nordcloud-engineering">Nordcloud Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy Amazon OpenSearch Service in a private VPC behind NGINX proxy and Cognito using…]]></title>
            <link>https://medium.com/nordcloud-engineering/deploy-amazon-opensearch-service-in-a-private-vpc-behind-nginx-proxy-and-cognito-using-751aca1299a?source=rss----6711a67bba47---4</link>
            <guid isPermaLink="false">https://medium.com/p/751aca1299a</guid>
            <category><![CDATA[cognito]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[opensearch]]></category>
            <dc:creator><![CDATA[Vincenzo Buonagura]]></dc:creator>
            <pubDate>Fri, 01 Jul 2022 08:03:54 GMT</pubDate>
            <atom:updated>2022-07-01T08:03:51.349Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deploy Amazon OpenSearch Service in a private VPC behind NGINX proxy and Cognito using CloudFormation</h3><h4>Introduction</h4><p>Amazon OpenSearch Service is a managed service that makes it easy to deploy, operate, and scale OpenSearch clusters in the AWS Cloud. Amazon OpenSearch Service is the successor to Amazon Elasticsearch Service and supports OpenSearch and legacy Elasticsearch OSS (up to 7.10, the final open source version of the software).</p><p>OpenSearch is a fully open-source search and analytics engine for use cases such as log analytics, real-time application monitoring, and clickstream analysis.</p><p>When you create an OpenSearch domain via the AWS Console, it is recommended to create it inside a private VPC to avoid exposing it to the public internet. While this is a best practice in terms of security, it makes a bit tricky to access the OpenSearch Dashboards from outside the VPC.</p><p>AWS suggests three different options to resolve this problem:</p><ul><li>Use an SSH Tunnel</li><li>Use an NGINX proxy deployed on an EC2 instance</li><li>Use a Site-to-Site VPN</li></ul><p>Although all three solutions are well documented by AWS (<a href="https://aws.amazon.com/premiumsupport/knowledge-center/opensearch-dashboards-vpc-cognito/">https://aws.amazon.com/premiumsupport/knowledge-center/opensearch-dashboards-vpc-cognito/</a>), they could be really time consuming especially if you need to setup repeatedly an OpenSearch domain for testing purposes (keeping an OpenSearch domain running for long time can be quite expensive).</p><p>In this article we are going to describe how to implement the second solution using a CloudFormation template.</p><h4>Architecture</h4><p>The diagram below shows the architecture for the chosen solution and deployed using the CloudFormation template described in the next section:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z4kN2EcdWAGnSDCtA_4rdA.png" /></figure><p>The following components are deployed:</p><ul><li>A VPC</li><li>A public subnet (where the NGINX proxy server resides) with an Internet Gateway</li><li>A private subnet (where the OpenSearch domain will be placed)</li><li>A Cognito User Pool with a corresponding Identity Pool</li><li>An EC2 Instance where the NGINX proxy server is hosted</li></ul><h4>Implementation</h4><p>The implementation is based on 1 main CloudFormation template (named Orchestrator) and 4 nested templates developed to deploy single components independently and to pass variables/outputs from one template to the other.</p><p>The nested templates are deployed in the following order:</p><ul><li>Infrastructure and Cognito (there are no dependencies between them)</li><li>OpenSearch (it needs the VPC, the private subnet and the Cognito Pools)</li><li>NGINX (it needs the VPC, the public subnet and the OpenSearch and Cognito urls)</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/005d5ba7d19c717d2cbfa1e01213e74d/href">https://medium.com/media/005d5ba7d19c717d2cbfa1e01213e74d/href</a></iframe><p>The CloudFormation template to deploy the infrastructure is fairly simple and it is essentially responsible to deploy the resources listed below:</p><ul><li>A VPC</li><li>A private subnet</li><li>An Internet Gateway and a Route Table associated to the VPC (to expose the public subnet)</li><li>A public subnet</li><li>Different NACLs (to allow TCP traffic from/to the public subnet)</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/df497750fccfcaa1746155401f73a6a9/href">https://medium.com/media/df497750fccfcaa1746155401f73a6a9/href</a></iframe><p>The CloudFormation template to deploy the Cognito resources needed to login into the OpenSearch Dashboards is a bit more complicated. It not only creates the User and Identity pools with corresponding roles for authenticated and unauthenticated users, but it also creates a default user with a temporary password using a Lambda function written in Python.</p><p>To achieve this, we have implemented a WiringFunction that is invoked (through a WiringFunctionInvocation) as soon as the Cognito pools and the Lambda execution role are created.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f13d2eb1da3b62bfc43bea3820dc00f/href">https://medium.com/media/0f13d2eb1da3b62bfc43bea3820dc00f/href</a></iframe><p>Once the Cognito pools are created, we are ready to setup and deploy an OpenSearch service domain. The code in this case is simpler and the template just creates the following resources:</p><ul><li>An IAM role that has the AmazonOpenSearchServiceCognitoAccess policy attached (this is a prerequisite to interact with Cognito)</li><li>An OpenSearch domain</li><li>A Security Group to allow communications over HTTPS</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b6e70f07400d441b8d484257279ad265/href">https://medium.com/media/b6e70f07400d441b8d484257279ad265/href</a></iframe><p>Now that we have our OpenSearch domain up and running, it’s time to setup and configure the NGINX proxy on the EC2 instance. In this case the template takes as input parameter not only the ids of the infrastructure resources needed for the EC2 instance, but also the CognitoUserPool and OpenSearch endpoint urls necessary to configure NGINX.</p><p>Two sections need to be noticed from the code snippet below regarding the creation of the EC2 instance:</p><ul><li>UserData</li><li>CloudFormation::Init</li></ul><p>The UserData field is used to install the NGINX package, generate the self-signed certificate and configure the init section. The CloudFormation::Init section instead, is mainly responsible for two tasks:</p><ul><li>Configure the default configuration file used by the proxy with the two endpoints received in input (to redirect the users either to Cognito login page or to the OpenSearch Dashboards)</li><li>Ensure that the NGINX service is up and running</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3a7d640d6c92c85ddb3fc69ecf3fa2ef/href">https://medium.com/media/3a7d640d6c92c85ddb3fc69ecf3fa2ef/href</a></iframe><p>Once the main template has been successfully executed, you will be able to access the OpenSearch Dashboards using the urls provided as output by the template itself.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=751aca1299a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nordcloud-engineering/deploy-amazon-opensearch-service-in-a-private-vpc-behind-nginx-proxy-and-cognito-using-751aca1299a">Deploy Amazon OpenSearch Service in a private VPC behind NGINX proxy and Cognito using…</a> was originally published in <a href="https://medium.com/nordcloud-engineering">Nordcloud Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Hitchhiker’s Guide to Costs and Usages in AWS]]></title>
            <link>https://medium.com/nordcloud-engineering/the-hitchhikers-guide-to-costs-and-usages-in-aws-d6a95de568d1?source=rss----6711a67bba47---4</link>
            <guid isPermaLink="false">https://medium.com/p/d6a95de568d1</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cost-management]]></category>
            <dc:creator><![CDATA[Aritra Nag]]></dc:creator>
            <pubDate>Tue, 14 Jun 2022 10:49:10 GMT</pubDate>
            <atom:updated>2022-10-28T08:13:39.883Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FAyzQSOhuwAY880BGe9n6w.jpeg" /></figure><h3>Introduction</h3><p>There are a lot of challenges when it comes to cost optimization in the cloud, and it’s more of a journey than a destination. Cost optimization is a journey, not a destination. To understand cost optimization from a holistic perspective, we like to think of it as a lifecycle.</p><p>Here are four general phases of the lifecycle: analysis, cost optimization, cloud governance, and usage and cost monitoring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*aRHggzpDS68GaBmTwHCewA.png" /></figure><p>AWS Cost Explorer helps us to explore and analyze spending across our AWS accounts, offering a wide range of filtering options to help us dig down into the details. With AWS Budgets we can set up the reports and alarms we need to keep a close eye on our spending. Lastly, the Cost and Usage reports give us a more granularity spend on the AWS services and resources for each service used.</p><h3><em>Tools</em></h3><p>We will explore some of the AWS tools which can be used to understand the cost and also create some notifications-based alerts to tame the usage of the AWS services.</p><ul><li>Cost Anomaly Detection</li><li>AWS Cost Explorer</li><li>AWS Budget</li><li>AWS Cost and Usage Dashboards</li></ul><p><strong>Cost Anomaly Detection</strong></p><p>AWS Cost Anomaly Detection is a monitoring feature that utilizes advanced machine learning techniques that identify anomalous and suspicious spend behaviors as early as possible so we can avoid costly surprises. Based on the selected spend segments, Cost Anomaly Detection automatically determines patterns each day by adjusting for organic growth and seasonal trends. It triggers an alert when spend seems abnormal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*on88jz1TRsEHWE2x5fa66A.png" /></figure><p><strong>AWS Cost Explorer</strong></p><p>The Cost Explorer provides us with granular insight into the AWS service usage and costs accrued. It gives us a detailed breakdown of all services in the table view &amp; visually. We can get AWS costs and usage over a daily or monthly granularity. It gives us the capability to create reports.</p><p>With granular insights, we can identify services and usage types that are costing more. It also helps us visualize cost trends over time. We can look for any sudden spike in usage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*DhWBLaGPPIZL5rTC.png" /></figure><p><strong>AWS Budget</strong></p><p>Sitting alongside each other within the AWS Cost Management group, AWS Budgets and AWS Cost Explorer are complementary services from Amazon Web Services (AWS). Using them together, we can analyze our cost and usage patterns and use that analysis to implement effective governance controls and cost optimizations. AWS Budgets lets us track service usage, utilization, and coverage for Reserved Instances and Savings Plans.</p><p><em>Creating budgets</em></p><p>There is an AWS setup wizard that starts when we create a budget through the console. Within the wizard, there are “Info” links at the top of each page, which lead to more detailed instructions and <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/budgets-create.html">AWS documentation</a>.</p><p><em>Budget alerts</em></p><p>Alerts are attached to a budget and can be created when creating or editing that budget. They consist of a threshold and a notification. The threshold contains a trigger, which determines whether the alert fires when today’s actual usage or the forecast usage for the budget period crosses the threshold.</p><p>We can also configure alerts to trigger automated actions when they fire. An action can be one of:</p><ol><li>Attach an IAM policy to a user, group, or role.</li><li>Attach a Service Control Policy (SCP) to an Organizational Unit or the organization’s root.</li><li>Stop specific EC2 or RDS instances.</li></ol><p><em>Forecasting in AWS Budgets</em></p><p>Forecasting gives us an additional option for how we set up our alerts. Using actual spending, we might set up an alert to notify us at 80% of our monthly budget, say. Using forecasting, we might want an alert based on projected overrun, say 105%. We can use both types of alerts with the same budget — a budget will support up to 5 alerts.</p><p>Limitations :</p><ol><li>Forecast alerts won’t fire at all unless we already have enough (roughly 5 weeks) usage data.</li><li>As with any forecasting, although there will be some intelligence in the underlying algorithm, it’s only based on ourprevious usage patterns and may be inaccurate.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p3OMQyi_RM1Hk-q6.jpg" /></figure><p><em>Budget Reports</em></p><p>Budget reports are sent by email on a regular cadence.</p><p>AWS keeps these reports simple (the only complexity is in the budgets themselves) — for a single report we can customize:</p><ol><li>Which budgets are included (we can include more than one)?</li><li>How often the report should be sent — daily, weekly, or monthly.</li><li>Who should receive the report — a list of email addresses.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sXoXDG7LSDyjpkj8zJk1OA.png" /></figure><p>We will look into both services in more detail and see how they differ and how they can be used together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2g2q-iS-MQW0hOBLg958AQ.png" /></figure><p><strong>AWS Cost and Usage Dashboards</strong></p><p>The AWS Cost and usage report contain the most encyclopedic set of cost and usage data available. We can use cost and usage reports to get our AWS billing data in the form of reports. We can receive reports that break down our cost by the hour or month, by a product or a product resource, or by the tax that we define ourselves. There are three basic benefits of setting up cost and usage reports as listed below:</p><ul><li>We can deliver report files to our Amazon S3 bucket.</li><li>We can also update the report up to three times a day.</li><li>Creating, retrieving, and deleting our reports can be done using the AWS cost and usage reports API reference.</li></ul><p><strong>Note</strong>: The following setup can be either done by a standalone account or consolidated reports for multiple accounts by enabling the consolidated billing feature in AWS organizations.</p><p>We will set up the following solution pattern using multiple AWS services which will not only enable us to check the cost and usage reports but also to fix dashboards in AWS Quicksight to monitor any anomaly in the usage of resources inside AWS services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gijhEqdoQna_p_UWU5gUSQ.png" /></figure><p>Here are the steps to enable the report generation:</p><ol><li>Enabling the reports from the Billing section in AWS Console and creating the configurations for report generation.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IRE870Dn9r0EYJXEZTS1Dg.png" /></figure><p>Adding configuration includes creating the bucket and defining the granularity of the data ingestions into the report. Also, we need to update the AWS Services like Athena, Quicksight will also be using these reports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Q5kD4_SjlT5E1fXQlIIjg.png" /></figure><p>Once the above configurations are set up, We will see the reports getting generated and stored in the S3 bucket. Also apart from the data, we will see some other files are also present.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TsPRV5KwvPw7b9nMH1FlZA.png" /></figure><p>Next, We need to download the <em>crawler-cfn.yml</em> file and use it to create a Cloudformation Stack. This Stack creates the AWS Glue Crawler and also the lambda’s which are responsible for pulling the data in Athena.</p><p><em>AWS Athena</em></p><p>Inside the AWS Athena Service, We can find the AWS Glue crawler has already created the database and tables schema based on the reports from the S3 bucket.</p><p>Once the stack is ready, we can check the CUR status by going to our database and running the following query:</p><pre>SELECT status FROM cost_and_usage_data_status;</pre><p>The above query will return either READY or UPDATING , the latter indicating that Athena may return incomplete results.</p><p>If the status is READY , we can verify it by counting the total number of items in our Athena database so far.</p><pre>SELECT</pre><pre>    COUNT(identity_line_item_id) AS Count<br>    <br>FROM my_cur_db.my_cur_table</pre><pre>WHERE<br>    MONTH = CAST(MONTH(CURRENT_DATE) AS varchar(4))<br>    AND YEAR = CAST(YEAR(CURRENT_DATE) AS varchar(4));</pre><p>The MONTH(CURRENT_DATE) statement will fetch the current month as an integer, and CAST() will convert it to a string.</p><p>The above query will return the number of rows currently in the billing table.</p><p><em>Data Wrangling and Customization</em></p><p>Moving on to explore the datasets and columns of the reports, AWS provides us with extensive <a href="https://docs.aws.amazon.com/cur/latest/userguide/identity-columns.html">documentation</a> for all the definitions of the columns for the report. Some of the important columns are :</p><p><em>Billing columns</em></p><ul><li>line_item_blended_cost : The <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/con-bill-blended-rates.html#Blended_CB">blended cost</a> of this line item.</li><li>line_item_line_item_type : The type of charge covered by this line item. Possible values are <em>Credit</em>, <em>DiscountedUsage</em>, <em>Fee</em>, <em>Refund</em>, <em>RIFee</em>, <em>Tax</em>, and <em>Usage</em>.</li><li>pricing_public_on_demand_cost : The cost for the line item is based on public on-demand instance rates.</li></ul><p><em>Resource columns</em></p><ul><li>line_item_resource_id : The resource ID of this line item, if enabled in CUR. For example, an Amazon S3 storage bucket, an Amazon EC2 compute instance, or an Amazon RDS database can each have a resource ID.</li><li>line_item_line_item_description : The description of the line item type.</li><li>resource_tags_user_name : Contains the value of the Name resource tag.</li></ul><p><em>Configuration columns</em></p><ul><li>line_item_availability_zone : The Availability Zone that hosts this line item, such as us-east-1a or us-east-1b .</li><li>product_instance_type : Describes the instance type, size, and family, which define the CPU, networking, and storage capacity of our instance.</li><li>product_instance_family : Describe our AWS EC2 instances family.</li></ul><p><em>Usage columns</em></p><ul><li>line_item_usage_account_id : The account ID that used this line item. For organizations, this can be either the master account or a member account.</li><li>line_item_operation : The specific AWS operation covered by this line item.</li><li>line_item_usage_type : The usage details of this line item.</li><li>line_item_usage_start_date , line_item_usage_end_date : The start and end dates for the corresponding line item in UTC. The format is YYYY-MM-DDTHH:mm:ssZ. The start date is inclusive, and the end date is exclusive.</li><li>month , year : The month and year of this line item.</li><li>line_item_product_code : The product code of this line item. For example, AmazonEC2 is the product code for Amazon Elastic Compute Cloud.</li></ul><p>Some of the relevant queries to find out the customized tailor-made queries are:</p><p><em>Identifying the most expensive services used</em></p><pre>SELECT<br><br>    line_item_resource_id AS Resource,<br>    SUM(line_item_blended_cost + discount_total_discount) AS Cost<br>    <br>FROM aritrausagereport<br><br>WHERE<br>    MONTH = CAST(MONTH(CURRENT_DATE) AS varchar(4))<br>    AND YEAR = CAST(YEAR(CURRENT_DATE) AS varchar(4))<br>    AND line_item_product_code = &#39;AWSLambda&#39;<br>    AND line_item_resource_id != &#39;&#39;<br>    <br>GROUP BY line_item_resource_id<br><br>ORDER BY Cost DESC<br><br>LIMIT 25;</pre><p>Most expensive AWS EC2 resource</p><pre>SELECT<br><br>    line_item_resource_id AS Resource,<br>    SUM(line_item_blended_cost + discount_total_discount) AS Cost<br>    <br>FROM aritrausagereport<br><br>WHERE<br>    MONTH = CAST(MONTH(CURRENT_DATE) AS varchar(4))<br>    AND YEAR = CAST(YEAR(CURRENT_DATE) AS varchar(4))<br>    AND line_item_product_code = &#39;AmazonEC2&#39;<br>    AND line_item_resource_id != &#39;&#39;<br>    <br>GROUP BY line_item_resource_id<br><br>ORDER BY Cost DESC<br><br>LIMIT 25;</pre><p>Most expensive S3 buckets:</p><pre>SELECT</pre><pre>    line_item_resource_id AS Resource,<br>    SUM(line_item_blended_cost + discount_total_discount) AS Cost<br>    <br>FROM aritrausagereport</pre><pre>WHERE<br>    MONTH = CAST(MONTH(CURRENT_DATE) AS varchar(4))<br>    AND YEAR = CAST(YEAR(CURRENT_DATE)  AS varchar(4))<br>    AND line_item_product_code = &#39;AmazonS3&#39;<br>    AND line_item_resource_id != &#39;&#39;<br>    <br>GROUP BY line_item_resource_id</pre><pre>ORDER BY Cost DESC</pre><pre>LIMIT 25;</pre><p>Lastly, another important use case would be to examine the cost of resources by their names.</p><p>Let’s say I have several resources with the name of my project, cdks3reactspa . These could be cdk-backendcontainer-jave , or aws-dynamodb-serverless etc. We can use the resource tags column to group costs based on names as well.</p><pre>SELECT</pre><pre>    resource_tags_user_name AS ResourceName,<br>    SUM(line_item_blended_cost + discount_total_discount) AS Cost<br>    <br>FROM aritrausagereport</pre><pre>WHERE<br>    MONTH = CAST(MONTH(CURRENT_DATE) AS varchar(4))<br>    AND YEAR = CAST(YEAR(CURRENT_DATE)  AS varchar(4))<br>    AND lower(resource_tags_user_name) LIKE &#39;%cdks3reactspa%&#39;<br>    <br>GROUP BY resource_tags_user_name</pre><pre>ORDER BY Cost DESC</pre><pre>LIMIT 25;</pre><p><em>Quicksight Dashboard Integration</em></p><p><strong>Note</strong>: Setting up the Quicksight roles/permissions is out of scope for this blog</p><p>This AWS service helps us to create custom dashboards based on the datasets which are getting generated from the above queries. Inside the service, We need to perform the following steps to create an automated refresh of the datasets.</p><ol><li>Inside the portal, We need to create a new dataset and mention the source as AWS Athena.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bqdm_qNU3R0lS3vc-9_bKA.png" /></figure><p>2. Based on the roles setup, it will automatically find the workgroup of the cost and usage report</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pO-_Fsah6Ib5cnaRGWF70A.png" /></figure><p>3. Once we have added the connection, All the valid tables and schemas will be shown inside the AWS Athena catalog.</p><p>4. There is an offering from AWS Quicksight called <a href="https://docs.aws.amazon.com/quicksight/latest/user/spice.html">SPICE</a> which can generate an analytics dashboard quicker. Else, We can also our own SQL queries to create the dashboards.</p><p>5. Finally, We set up the refresh schedules of the datasets inside the AWS quicksight console and also enable sharing options for different people to visualize the dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yraTSkLCL1widH-XHwGfKA.png" /></figure><p>Once, all the above setup is done. We move on the create the dashboard based on the datasets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5yCbHxFkCUxKbAfyXDadqA.png" /></figure><p>Here is the sample dashboard, Where we can see all the costs that happened for AWS services in the last 3 months. For e.g, the Month of May has seen a spike in usage of AWS ELB as well as AWS GuardDuty.</p><p>All the data will be incrementally changed based on the refresh rates as well as the setting of Cost usage reports in the billing console.</p><h3>Conclusion</h3><p>The Athena and CUR combination can help alleviate a lot of my-cloud-bill-is-a-huge-black-box problems. The Cost Explorer and Budget Reports are fine, but there are some problems only a heinous quadruple-join can solve.</p><p>CUR is also available for Redshift. If Athena’s concurrency limits are causing issues or if we need a full-blown RDBMS for cost analysis, then Redshift is the way to do it. For visualizations, QuickSight can use the columns directly but not the query results, so something like Redash or Tableau might be better for more complex dashboards.</p><h3>References</h3><ul><li><a href="https://aws.amazon.com/blogs/aws-cloud-financial-management/beginners-guide-to-aws-cost-management/">https://aws.amazon.com/blogs/aws-cloud-financial-management/beginners-guide-to-aws-cost-management/</a></li><li><a href="https://wellarchitectedlabs.com/">https://wellarchitectedlabs.com/</a></li><li><a href="https://docs.aws.amazon.com/wellarchitected/latest/cost-optimization-pillar/welcome.html">https://docs.aws.amazon.com/wellarchitected/latest/cost-optimization-pillar/welcome.html</a></li><li><a href="https://aws.amazon.com/about-aws/whats-new/2022/03/aws-cost-anomaly-detection-integration-chatbot/">https://aws.amazon.com/about-aws/whats-new/2022/03/aws-cost-anomaly-detection-integration-chatbot/</a></li><li><a href="https://aws.amazon.com/about-aws/whats-new/2022/03/aws-announces-aws-billing-conductor/">https://aws.amazon.com/about-aws/whats-new/2022/03/aws-announces-aws-billing-conductor/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6a95de568d1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nordcloud-engineering/the-hitchhikers-guide-to-costs-and-usages-in-aws-d6a95de568d1">The Hitchhiker’s Guide to Costs and Usages in AWS</a> was originally published in <a href="https://medium.com/nordcloud-engineering">Nordcloud Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A panoramic overview of the IoT architecture building blocks on AWS (Part two)]]></title>
            <link>https://medium.com/nordcloud-engineering/a-panoramic-overview-of-the-iot-architecture-building-blocks-on-aws-part-two-3936b14170ad?source=rss----6711a67bba47---4</link>
            <guid isPermaLink="false">https://medium.com/p/3936b14170ad</guid>
            <category><![CDATA[internet-of-things]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-native]]></category>
            <dc:creator><![CDATA[Fabrizio Gattuso]]></dc:creator>
            <pubDate>Mon, 06 Jun 2022 08:36:05 GMT</pubDate>
            <atom:updated>2022-06-06T08:36:04.899Z</atom:updated>
            <content:encoded><![CDATA[<p>In the first part (you can find the previous article <a href="https://medium.com/nordcloud-engineering/a-panoramic-overview-of-the-iot-architecture-building-blocks-on-aws-part-one-5e7a17a6f6b1">here</a>), we already discussed the different elements that are involved in the data generation and the communication between the <strong>IoT</strong> network with the cloud on the edge layer. In this article, we are going to discuss in detail the whole architecture components that are involved in the cloud section.</p><h3>Ingest, store and analyze</h3><p>This section of the system architecture is probably the most crucial after the IoT network. Every use case or scenario has different requirements, in some cases, it is not critical if the telemetries are duplicated, lost, or not received in the same order, in other scenarios you can’t miss telemetries because they are too sensitive for the system. To enforce a reliable ingestion process, it is important to design a pipeline that can scale fast and be resilient against potential problems. Usually, the telemetries received from the field are small data chunks where the traffic frequency can scale easily, pushing a lot of information to the cloud. To scale on the occasion of a possible pick, it is highly recommended to use serverless/managed services, accurate estimations are hard to perform.</p><p>AWS IoT Core and Sitewise can apply rules for every new telemetry received and transfer the traffic to the Kinesis suite to save, redirect and analyze the flow received. The kinesis suite has different services that can be potentially used in this architecture, the first candidate is <strong>Kinesis Data Stream. </strong>Until last year, it was necessary to provision Kinesis Data Stream capacity using shards. A shard has two main measure units: capacity and throughput. Data in the shard is ordered, but between shards is not. To not incur eventual problems during the ingestion phase, the user had to estimate the data flow and deploy the number of shards needed. AWS now offers an on-demand version of the service, giving the clients a data channel that scales on undefined workflows. Data passing through the service is stored in the shards for up to one year, but typically a value between one and seven days is configured.</p><p>Why save the data received in this service? First of all, it is essential to replicate telemetries in different architectural sections but the main reason behind this choice is the ability to rerun the ingestions process. In case of something happening during the workflow, relaunching the process with the same troubling data is useful for tests and debugging purposes. Data Stream can redirect data to different services such as ingestion lambda, EC2 and container services.</p><p>The second service of the Kinesis family is <strong>Data Firehose</strong>. This architecture element can receive incoming data from IoT Core and store data to <strong>S3</strong> for backup purposes or data lakes formation.</p><p>A data lake is a collection of different data formats available for machine learning models and AI algorithms such as <strong>SageMaker</strong>. Data can also be processed using an extract transform and load (ETL) service such as <strong>Glue </strong>and<strong> </strong>for fast analysis is suggested to<strong> </strong>run<strong> </strong>SQL syntax queries using <strong>Athena</strong>.<strong> </strong>In order to<strong> </strong>build exploratory dashboards, <strong>Quicksight</strong> provides a drag and drop interface to simplify the development phase.</p><p>In the case of S3 data being used as backup only, analyzing the different S3 tiers will optimize the storage cost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/0*Ea_GdhC7UkXrrCEV" /><figcaption><strong>Ingestion and offline analysis workflow</strong></figcaption></figure><p>Another essential element of this section is how to store telemetries to present them, to the end-user, in an efficient way. We already see how we store raw data in two different points: temporarily in the Kinesis Data Stream and for long-term purposes in S3. It is time to think about which database is the right solution for the IoT use case but in particular for your business scenario.</p><p>SQL for the nature of the data (limited or no relations between telemetries, schemaless and a high number of elements) is not a suitable choice. The most relevant technologies are the time-series DB and no-SQL databases.</p><p>Probably the most used time-series DB is <strong>InfluxDB</strong>, an open-source solution used in numerous applications. This DB engine also comes with a full suite of services (TICK stack) such as <strong>Telegraf</strong>, <strong>Chronograph</strong> and <strong>Kapacitor</strong> to store, analyze and apply rules to the stored data. The time-series DB technology allows fast ingestion and retrieval of the data based on the creation timestamp and optimizes storage capacity usage. The main problem with this solution is the cost of the management, managing an EC2 machine or a container by yourself is time-consuming and the right skills are needed. An alternative solution is to use <strong>InfluxDB cloud on AWS</strong> to lighten your duties but with an increase in the cloud cost.</p><p>Another feasible solution is <strong>Amazon Timestream</strong>, the time-series DB created by AWS, which offers a fully managed experience but is still a not consolidated solution.</p><p>The last possible product is a no-SQL DB such as <strong>DynamoDB</strong>. The most important element in this choice is how you design your data model and the user access pattern. Well-designed DynamoDB tables are valid solutions, leveraging the full integration of the AWS environment, the ability to scale on-demand, highly replicated data at the global level, and the enormous amount of further features can change your mind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/0*4-KKGr0hN2aFJDZ3" /><figcaption><strong>Various solutions for the database layer</strong></figcaption></figure><p>An important factor to consider in an IoT application is the nature of these solutions. These systems are heavy reading, if the user and queries numbers of the platform scale fast it is recommended to consider a cache system in front of the DB. For Influx and Timestream, <strong>Elasticache for Memcached or Redis</strong> are valid ideas, for DynamoDB is mandatory to consider <strong>Amazon DynamoDB Accelerator (DAX)</strong>.</p><p>Nowadays other scenarios are emerging, where traceability and immutability characteristics of your data are essential elements. In these cases, recent technology such as the blockchain is revolutionizing sectors like supply chain and asset tracking. A valid alternative to the standard database solutions is a private blockchain or a hyperledger on the cloud. For these particular cases, <strong>Amazon Managed Blockchain</strong> should be taken into consideration. However, these systems are slow, and used in conjunction with standard databases is necessary to increase the system response time.</p><h3>End-user interaction</h3><p>IoT applications usually are web interfaces focused on historical and real-time data shown in a dashboard view. In some specific scenarios and use cases, the user also needs to interact with the underlying network by sending configurations or commands to change the current state. A prototype or an internal application can be based on prebuilt dashboard services. This is useful for the initial phases of the project where it is essential to focus on the foundation level of your application but at the same time have control over the incoming data.</p><p>The first possible service and probably the simplest one is <strong>Amazon Quicksight</strong>. This software uses S3, Redshift, RDS and IoT Analytics as data sources. It is customizable and straightforward to use.</p><p>The second solution is <strong>Grafana</strong>. It is probably the standard for all the companies or business products that don’t want to invest money in an extensive web application. This open-source application offers to the customers: charts, graphs, and alert systems. It works stand-alone or can be embedded in a web page. The service usually runs on top of a container or EC2 instance but AWS offers a fully managed solution that takes care of all the infrastructure aspects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QyZcgHwBYUqAtYsM" /><figcaption><strong>Amazon Quicksight IoT dashboard example</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*S1j0TJtwjENy83I7" /><figcaption><strong>Grafana IoT dashboard example</strong></figcaption></figure><p>To get the most flexible customization and to offer a high-level application class, it is always preferable to build a web application solution from scratch. Nowadays the frontend and backend environments are saturated with frameworks, graphs libraries and public shared experience on how to build IoT dashboards. Amazon, for example, offers its help in the development phase of a web or a mobile application with <strong>AWS Amplify</strong>. This tool includes built-in libraries to connect your application to the AWS world in an effortless way. However, it is crucial to take into consideration some variables before jumping into the implementation phase.</p><p>IoT applications as we understood are heavy reading systems, often the different views you have to present to the end-user evolve fast, especially in the early phases. For these reasons, it is a good idea to take into consideration a <strong>GraphQL-based API</strong>. This query language for APIs offers fast responses to the frontend requests and it is not required to focus on tedious JSON schemas for every endpoint as we were used with the REST APIs.</p><p><strong>AWS AppSync</strong> is the managed API gateway for GraphQL. It offers a single endpoint architecture able to connect the frontend application with multiple databases and services. Subscriptions enable real-time communication between the backend and the frontend, a must for IoT applications with a high-frequency data production or with the need to send commands to the devices.</p><p>It is even possible to build a solution with the classic REST APIs using the well-known <strong>Amazon API Gateway</strong>. To enable real-time communication, it is mandatory to establish a WebSocket channel.</p><p>Another important point is to minimize the time access to your application. Customers are everywhere in the world and caching static and most frequent pages of your application improves the end-user experience. A Content Delivery Network (CDN) optimizes the communication with the clients and protects the public access to the internet.</p><p><strong>Amazon Cloudfront</strong> is the fully managed CDN from AWS that improves the application time response, blocks application-level attacks using the web firewall (WAF) and runs simple operations at the edge using AWS Lambda at Edge or Cloudfront functions.</p><p>In the following picture is proposed a possible architecture design:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1LCY6Z3RRLA58Kr7" /><figcaption><strong>IoT web application proposal design</strong></figcaption></figure><h3>Security</h3><p>Security is a topic that should be addressed at each level of the architecture: from the IoT network to the end-user. Each area has its peculiarities and can be exploited by an attacker but the most vulnerable components are the IoT network and the ingestion layer. In the last years, we learned about famous attacks on devices with the end goal of transforming the IoT network into a botnet. It is essential to limit the access to the devices from the external. For this reason, where it is possible, establishing a single entry point to the system is highly recommended.</p><p>AWS IoT Greengrass and Amazon FreeRTOS already have libraries and frameworks to enforce security in the devices and detect anomalous behavior in the network.</p><p><strong>AWS IoT Device Defender</strong> continuous monitoring and analyzes the device configuration and behavior to make sure they are not deviating from security best practices. When an alarm or a problem is detected, a notification is sent to Cloudwatch, SNS or the IoT console.</p><p>It is also critical to secure the link channel between the IoT network and the cloud. Every communication should be established using an <strong>SSL/TLS</strong> communication using valid certificates. A second security layer can be added using a <strong>VPN connection</strong> and/or a <strong>Direct Connect </strong>link to establish a private connection to the cloud. In case the budget is a concern, a site-to-site VPN is enough.</p><p>The public internet-faced services are also another critical section of the architecture. It is extremely important to enforce <strong>AWS WAF</strong> in all the services at the application level such as API GW, App Sync and Cloudfront. The firewall is able to block all the major attacks on the web and filter undesired IPs. Only the necessary services should be exposed to the public network and using Cloudfront, application load balancers (ALB) and enforcing HTTPS connections can save your nights.</p><p>In case you are looking for more secure in-depth architecture, services such as <strong>Guard Duty</strong> and <strong>Security Hub</strong>, provide checks and suggestions on where and how you should improve your security.</p><p>Attacks or bad user behavior should be prevented not only from the outside but also from the inside. Supposing that data lives in a data lake and sharing with other stakeholders is needed, it is important to regulate the access via an API, give read-only access to the data or replicate the original data lake. Using strict <strong>IAM roles and policies</strong> can limit access to important data, <strong>Cloudtrail</strong> instead gives you an overview/audit of the user access to the different services.</p><h3>Conclusions</h3><p>IoT systems are not easy to design and implement. Numerous considerations, different compromises and constraints make the journey, not a simple task. AWS offers a stunning number of already built solutions to make your life easier and to help you during your implementation. The fundamental suggestion is to start small, learn from the mistakes, and understand what brings business value and satisfaction to the end-users. Leveraging on already made services and serverless solutions offers the possibility to build a Minimum viable product (MVP) in a limited amount of time. The complexity and the customizations will come later and don’t forget to enjoy what you are doing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3936b14170ad" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nordcloud-engineering/a-panoramic-overview-of-the-iot-architecture-building-blocks-on-aws-part-two-3936b14170ad">A panoramic overview of the IoT architecture building blocks on AWS (Part two)</a> was originally published in <a href="https://medium.com/nordcloud-engineering">Nordcloud Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A panoramic overview of the IoT architecture building blocks on AWS (Part one)]]></title>
            <link>https://medium.com/nordcloud-engineering/a-panoramic-overview-of-the-iot-architecture-building-blocks-on-aws-part-one-5e7a17a6f6b1?source=rss----6711a67bba47---4</link>
            <guid isPermaLink="false">https://medium.com/p/5e7a17a6f6b1</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[internet-of-things]]></category>
            <dc:creator><![CDATA[Fabrizio Gattuso]]></dc:creator>
            <pubDate>Mon, 30 May 2022 07:33:21 GMT</pubDate>
            <atom:updated>2022-06-06T10:06:36.943Z</atom:updated>
            <content:encoded><![CDATA[<p>Without any doubt, the Internet of Things (IoT) is one of the most trending technologies in the IT space. IoT systems are used by multiple sectors such as agriculture, healthcare, supply chain, retail, manufacturing, hospitality and many more. The amount of devices in the market is growing as the amount of data is generated from them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a1EG2zSuszd4jwB57kollQ.jpeg" /><figcaption><strong>IoT world</strong></figcaption></figure><p>It is crucial to understand how to interact with millions of devices, ingest, store and retrieve this knowledge, and present these telemetries to the end-users. It is important to take into consideration how to protect the whole system from possible external attacks in specific scenarios and how to guarantee the data immutability.</p><p>All these requirements are hard to achieve in the old on-premises environments. Thanks to the power of the cloud and the flexibility of the new cloud-native solutions, it is possible to build architectures able to scale on the generated traffic, be reliable, and highly available against possible software failures. Cloud technologies made the development life cycle easier, focusing only on the business logic behind the product and without investing an unnecessary extreme budget.</p><p>This article will present all the information you need to start designing an IoT architecture on Amazon AWS, with a panoramic overview of five important areas: the IoT devices, the edge layer, the ingestion phase, the end-user interaction and the system security. The first two are discussed in this part and the next three in the next part.</p><h3>IoT devices</h3><p>An IoT device varies from a single sensor capable of communicating with another system element to more sophisticated devices able to compute operations, store data and execute actions.</p><p>Another important distinguishing factor to take into consideration is the power source of the device. A device connected to the power line is able to stay wake-up for the whole time using expensive communication technologies such as WiFi and standard Bluetooth. A device powered by a finite battery or with an auxiliary power source such as a solar panel or wind turbine needs to manage the finite energy by using different solutions to save energy and use energy-efficient communication technologies.</p><p>Based on these assumptions, not all devices are capable of running complex operating systems or using the same network topology.</p><h4>Operating system</h4><p>One of the most used operating systems for embedded devices is <strong>FreeRTOS</strong>. This OS is the market leader in real-time operating systems (RTOS) for microcontrollers and microprocessors. Supporting 40+ processor architectures, it is a tiny and power-save kernel and from 2017 AWS has taken stewardship of the FreeRTOS code integrating numerous external libraries to facilitate the communication with the cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*8dVJ7FbyUNZzQ4xb" /><figcaption><strong>An embedded device with Amazon FreeRTOS</strong></figcaption></figure><p>The Amazon library suite extends the open-source operating system with functionalities regarding <strong>MQTT</strong> communication, AWS IoT Greengrass integration, over the air (OTA) updates, and strong security components to manage keys, certificate authentication and code-signing.</p><h4>Network topology</h4><p>In order to choose the best network topology for your use case there are different factors to take into consideration, because of simplicity, we will analyze only two different scenarios:</p><ul><li>in the first case, the device is able to connect directly to the internet and to the cloud,</li><li>In the second case, the devices are forced to communicate with a gateway at the edge.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*OcJpvrQQbIcmBP0XQSXCSg.png" /><figcaption><strong>First topology — Direct communication to the cloud</strong></figcaption></figure><p>In the first topology, the devices are able to communicate directly with the cloud. The main advantage is the simplicity of the system, every link is directly established and there is no single point of failure.</p><p>Different disadvantages are also present: the main one is the high energy communications cost which usually means a direct connection to the power line or the usage of rechargeable batteries. In these scenarios it is essential to use communication protocols such as <strong>LoraWAN</strong> or <strong>Sigfox,</strong> leveraging on standard batteries, but the amount of data transmitted is unfortunately limited. Other communication technologies, such as <strong>WiFi</strong>, are used to send more data but the lifetime of the devices is really limited. Because of this, the end-user has to change batteries many times or directly connect the sensors to the power line.</p><p>The second disadvantage is the absence of an edge or border device. Without this network element, it is hard to pre-aggregate data and filter out malformed packets and a possible attacker has direct communication to every device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*A3caOC1S4B2DicuQjWYS9g.png" /><figcaption><strong>Second topology — Star, only the gateway communicates with the cloud</strong></figcaption></figure><h3>Edge layer</h3><p>Every IoT system, based on the cloud, should start to design the architecture from the edge components. We know that these devices are not part of the cloud network but the role is so important for the whole system that it should be considered as critical as all the other elements. The edge components are usually called gateways or IoT Hubs in the IoT world. These nodes are usually more powerful than the small sensors and the main role is to establish the communication with the cloud, manipulate the received data and enforce a central security gate. Manipulation of data is not only for standardization and filtering purposes but is also used as a strategy for saving money or reducing the traffic between the IoT site and the cloud. Usually, this is achieved by applying compression algorithms or pre-aggregating the telemetries.</p><p>Amazon AWS offers the solution for facilitating the development of edge devices. <strong>AWS IoT Greengrass</strong> provides standardized functionalities such as data management, messaging services, local data processing using machine learning models, configuration updates and pre-built software libraries. Greengrass is perfectly integrated with Amazon FreeRTOS and the cloud AWS services, bringing to the customer an easy and fast way to connect to the cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*R39IqjRwL2noX0MQ" /><figcaption><strong>AWS IoT Greengrass overview</strong></figcaption></figure><p>In the case of energy limitations, compliance, or other requirements where it is not possible to configure Greengrass, it is possible to build a simple gateway using Python and send the received data through standard communication protocols such as MQTT, HTTPS RestAPI and AMQP. MQTT is the most used and probably the standard de facto for this kind of connection. It is designed to be lightweight, works with a very low connectivities level and uses the publish-subscribe paradigm in order to connect remote devices to the cloud.</p><p>On the other side of the channel between the edge and the cloud, there is <strong>AWS IoT Core</strong>. This component is the main door to the cloud and the main AWS solution to connect to the IoT networks. IoT Core connects to devices using different protocols such as MQTT (also over Web Socket), HTTPS and LoraWAN. IoT Core establishes the communication, enforces encryption between the parts and is able to make a mirror state for all your devices. In case the gateway was not intelligent enough to do small processes on the data, IoT Core is able to perform simple tasks before ingesting the telemetries.</p><p>An extension to IoT Core that can work in parallel (importing data from) or standalone, is <strong>AWS IoT Sitewise</strong>. This service is designed for the Industrial IoT (IIoT) and ingests data from other less common protocols such as <strong>OPC-UA</strong>, <strong>Modbus</strong> and <strong>Ethernet/IP</strong>. These AWS services are capable of collecting, verifying and sending data to different internal pipelines in order to ingest, store and analyze the telemetry data received from the network. This is also not a one-way communication channel, because users or the cloud itself can send configurations, commands and other kinds of data to the IoT field.</p><p>The final but not less important reflection to make is where to deploy AWS border services. Supposing the use case scenario is sensible to the receiving time, it is always preferred to have IoT Core or IoT Sitewise deployed close to your IoT network in order to minimize the time travel communication. Having multiple regions for the ingestion components will increase the availability and the resiliency of the edge communication. After the ingestion process, it is optional to replicate or merge all the telemetry in a central region.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/0*mtDifGMEnVV1hF8C" /><figcaption><strong>AWS IoT Field to Edge solutions</strong></figcaption></figure><p>In the next part, we will discuss the cloud section of an IoT system focusing on the ingestion process, storing and analyzing data received, the end-user interaction with the building blocks for a web app, and at the end a security overview.</p><p>The second article will focus on the cloud environment and is reachable on this <a href="https://medium.com/nordcloud-engineering/a-panoramic-overview-of-the-iot-architecture-building-blocks-on-aws-part-two-3936b14170ad">page</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e7a17a6f6b1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nordcloud-engineering/a-panoramic-overview-of-the-iot-architecture-building-blocks-on-aws-part-one-5e7a17a6f6b1">A panoramic overview of the IoT architecture building blocks on AWS (Part one)</a> was originally published in <a href="https://medium.com/nordcloud-engineering">Nordcloud Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enterprise implementation of Infra-as-Code using CDK]]></title>
            <link>https://medium.com/nordcloud-engineering/enterprise-implementation-of-infra-as-code-using-cdk-5d229e08b414?source=rss----6711a67bba47---4</link>
            <guid isPermaLink="false">https://medium.com/p/5d229e08b414</guid>
            <category><![CDATA[solution-architecture]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[aws-cdk]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <dc:creator><![CDATA[Aritra Nag]]></dc:creator>
            <pubDate>Thu, 14 Apr 2022 09:16:24 GMT</pubDate>
            <atom:updated>2022-04-14T09:16:24.122Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oQ6-YOr9EY8BplkY" /></figure><h3>Introduction</h3><p>In the traditional IT and Software Development setup, we have always seen development squads are oblivious of how developed applications are deployed and how the infrastructure/configurations are maintained. With Cloudformation as one of the front-runners in the IaaC world of infrastructure development, declarative YAML-based implementation tends to be of no interest to squads doing object-oriented development. Moreover, with Cloudformation, Infra engineers needed to have specific service or domain knowledge as well. Once AWS introduced CDK in 2019, we started observing a change in the motivation for the development squads to involve themselves in the IaaC realm. This post describes the problem statement and resolution to steer the application squads to move toward deployable infrastructure code development. We will also showcase one of the solution patterns written in CDK, adopted within multiple squads in an organization.</p><h3>Problem Statement</h3><p>We have seen inside the enterprise IT and Software ecosystem, that there is a lack of cadence when it comes to developing infrastructure and applications together as part of similar life cycles. Initially, we have the IT infrastructure being maintained separately and have different iterations/development cycles.</p><p>Most of the common setup in the IT and Software industry is backed by the conglomerate of multiple teams namely,</p><ul><li><strong>Infrastructure</strong>: Managing the Cloud environment and its ecosystems.</li><li><strong>Configuration and Devops</strong>: Maintaining the different infrastructure-dependent configurations and DevOps support for application teams.</li><li><strong>Application development teams:</strong> Producing and maintaining the production deployable workloads and functionalities.</li></ul><h3>Resolution</h3><p><em>Change in Philosophy</em></p><p>With the adoption of CDK, we have tried to enable developers to also deploy and manage cloud infrastructure as well as provide the scope to get involved in the development realm of Infra-as-Code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/0*7KdAigwisw7Gq6ss" /></figure><p><em>Evolving Ecosystem of Traditional Software Development</em></p><p>One of the main advantages CDK brings is creating deployable resource management objects using code. Using the strength of object-oriented programming and different tool support in CDK, our multi-functional IT ecosystem has experienced increased overall visibility and knowledge of the infrastructure and AWS ecosystem. We have adopted the approach of the Cloud Center of Excellence (CCoE) where solution architects and developers of the infrastructure team provide solution patterns, including best practices and knowledge sessions. For providing the solution patterns, We have repositories that are leveraged with the packages getting deployed to be used/reused in the production-grade applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*O0L3JOPfUG1xKdmy" /></figure><p>For the CDK-based development, we have used the <strong>Construct Library </strong>which is a library of AWS-provided objects to encapsulate the Cloudformation configuration interface. These are L1 resources that are used to create the resources which need a more customizable setup. Additionally, we have been providing the team with pre-baked production-grade <strong>Solution Constructs</strong> to import into their application. Lastly, through different knowledge forums, we have been providing a <strong>curated list</strong> of <strong>CDK projects </strong>like <a href="https://github.com/kolomied/awesome-cdk">AWESOME CDK</a> which increased the development speed in CDK.</p><p><em>Solution Construct Deployment</em></p><p>Working with CDK has been proven to increase the production of the infrastructure engineers which provided them with the full CI/CD Workflow and Code Review. Engineers can also leverage the features of OOPS unit testing features like snapshots and assertions-based testing. One of the most common implementations using CDK and CI/CD is using Github and AWS services like Codebuild, Codecommit, and Cloudformation Changesets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*amr9nvAC77D2-RFG" /></figure><p><em>Migration of Cloudformation to CDK</em></p><p>For the Infra engineers and the Cloud solution architects team, we have opted for the following approaches to move the existing Cloudformation templates to CDK</p><ol><li><strong>Rewrite the templates to CDK:</strong> This is the longest approach for a few of the templates to be rewritten using CDK with If-Else conditions and unit tests, however, it provides the full flavor of CDK towards the development. Most of the solution constructs are being built using this approach.</li><li><strong>Importing templates inside a CDK application:</strong> This approach is by far the quickest way to get the infrastructure running on AWS CDK, but it also does the least to position the developers for success by basically adding a wrapper around the existing templates.</li><li><strong>Using 3rd party tools:</strong> <strong><em>AWS Cloudformation Disassembler</em> </strong>is also used to translate the Cloudformation templates into CDK, however, it also comes with perils as the tool itself is still evolving.</li></ol><h3>Architecture</h3><p>The next section through an end-to-end solution which consists of a solution pattern deployed in production using the CI/CD strength of Github and open-source framework projen.<br>We will present a pattern where an application is present which is a simple REST API, backed by a Java application using quarkus and maven. It will be deployed in the AWS Service ECS as a service. The most interesting part of the whole lifecycle is the CDK code.</p><p><em>Architecture Diagram</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oQP1llklKB-FOaGYXmTPoQ.jpeg" /></figure><p>In this example, we assume that we already have <strong>VPC</strong> and Bare<strong> ECS Cluster</strong> setup in the account. Also, we need to have a <strong>private Route53 </strong>hosted zone which will be used to create the application listener rules.</p><p><em>DevOps Setup</em></p><p>We will start with setting the IAM roles which will be used to deploy the resources as changeset in AWS accounts</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/823cd17c60e9564a4371de2e9f5fe1b3/href">https://medium.com/media/823cd17c60e9564a4371de2e9f5fe1b3/href</a></iframe><p>The Above Cloudformation template once executed into an AWS account will provide us with the role required to connect Github and the repository with the account. Also based on the resources deployed we might need to add more custom policies in the role as well.<br>Moving on to the Github actions and pipeline triggers, We will add the basic steps required in the workflow to execute the changesets in the AWS account</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6019de4131c4ddc853e5916cc7ae1a7b/href">https://medium.com/media/6019de4131c4ddc853e5916cc7ae1a7b/href</a></iframe><p>We need to add the role created in the secrets of the Github actions and also mention the region in which the stack sets will be deployed. This workflow contains the basic steps of automating the <strong>CDK synth </strong>and <strong>CDK deploy </strong>command with all the necessary installations.</p><p><em>Application to be deployed</em></p><p>Looking at the application deployed, it’s a simple REST JSON API built using Java, with Maven and Quarkus. It’s a basic API that will return a predefined response from the backend. Once we run the application locally, it will give the following response:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NV2wMt4C8D-k82sw" /></figure><p>We have established the structure of the application code and infrastructure CDK code in a separate folder based out of the root path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/0*bUt3Lhl_pV0bBRTK" /></figure><p>Moving inside the CDK code, We have started defining the VPC object by looking up the VPC id from the stack’s input.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c4429bb96ecdd3c4d204211764bb948/href">https://medium.com/media/6c4429bb96ecdd3c4d204211764bb948/href</a></iframe><p>Next, we will move on to fetch the existing ECS cluster setup by providing the security group id and cluster name from the stack’s input.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/86b0442f82f8de5d1860dcc924eb3b5b/href">https://medium.com/media/86b0442f82f8de5d1860dcc924eb3b5b/href</a></iframe><p>After creating the VPC and ECS cluster object, we move on to create the Task Definition based on the application described above. Here in the stack inputs, we need to provide the path in which the application and docker file is present. Also, we need to create the log group definition which will be created as part of this stack.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3416951bd852f06ed1b222bcb595e413/href">https://medium.com/media/3416951bd852f06ed1b222bcb595e413/href</a></iframe><p>Next, we provide the EC2 Service definition that will be created based on the task definition which is created above and also the desired count taken from the input.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c94cdbaac8475efcd78ca8f6b3e5000f/href">https://medium.com/media/c94cdbaac8475efcd78ca8f6b3e5000f/href</a></iframe><p>Lastly, we create some route53 records based on the DNS domain and ALB DNS name from the previously created private hosted zone</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ce4e4897955748efb6586607dbdea689/href">https://medium.com/media/ce4e4897955748efb6586607dbdea689/href</a></iframe><p>Lastly, We define the load balancing rules based on the above-created records and also create the autoscaling rules for the EC2 hosting the service.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/42161b4865e90e18e68dae04c0c266f3/href">https://medium.com/media/42161b4865e90e18e68dae04c0c266f3/href</a></iframe><p>All the above implementations provide the setup for the Application to be deployed in an ECS cluster as an EC2 based service. After committing the code to the Github, the workflow executes and creates a changeset in the AWS account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Hh0_h6lBGN_ZMg0X" /></figure><p>Once we log into the AWS account, We can also see the components are created and deployed in ECS as a service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f7cLpHcA1hH1BniK" /></figure><p>All the resources are created in private subnets and without creating a public API, We can connect to the EC2 using session manager and check the rest API is deployed and behaving as intended.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ntbqemu5U0I4IPAQ" /></figure><p>Here is the sample code for the full <a href="https://github.com/aritranagnordcloud/Workflow-CDK-demo">repository</a>. The Github actions run will not work in this scenario, we need to put the actual values inside the stack input parameters namely VPC ID, ECS cluster, and Security group(these are not part of this CDK stack)</p><h3>Conclusion</h3><p>Apart from the above methodology and inspirations, Squads are also provided with many workshops and community support for motivating them to adopt the CDK based on the programming languages they feel comfortable with.<br>Using the above approach, We have experienced different squads implementing the infrastructure configurations using CDK as well as improving the overall CI/CD workflow and also reducing issues or downtime in the production applications due to misconfigurations or infrastructures related issues.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d229e08b414" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nordcloud-engineering/enterprise-implementation-of-infra-as-code-using-cdk-5d229e08b414">Enterprise implementation of Infra-as-Code using CDK</a> was originally published in <a href="https://medium.com/nordcloud-engineering">Nordcloud Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing complex configurations in large scale environments]]></title>
            <link>https://medium.com/nordcloud-engineering/managing-complex-configurations-in-large-scale-environments-5bc6bfc009d5?source=rss----6711a67bba47---4</link>
            <guid isPermaLink="false">https://medium.com/p/5bc6bfc009d5</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Tomasz Brzoza]]></dc:creator>
            <pubDate>Tue, 12 Apr 2022 08:49:40 GMT</pubDate>
            <atom:updated>2022-04-12T11:45:41.191Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MWA16Ccus0NMT7GUlZw4Kw.jpeg" /><figcaption>Tired of managing all the configuration ?</figcaption></figure><p>Some time ago at Nordcloud I’ve been working on a project to help one of the customers to migrate from their existing OpenShift onprem cluster to an AWS based container platform. The task itself was quite a bit challenging. This already was an established project with 4 agile teams working on delivery. The platform itself had more than 40 microservices working together, 3 different software packages and at least 5 application environments.</p><p>The infrastructure to manage this beast was pretty complex (thats maybe a topic for another article) and to manage it the team chose to use <strong>Infrastructure as Code </strong>(IaC) and to be more precise Terraform. Terraform was the choice for a few reasons. One of the main factors was that the existing DevOps and Development teams had no background in AWS or IaC of any kind. When companies are undergoing digital transformation and moving to the cloud it’s crucial to factor in current skills and devise an upskilling plan to get maximum of your cloud experience.</p><p>Compared to other available options using <strong>HCL</strong> (Hashicorp Configuration Language) is usually the best option when facing existing teams with different backgrounds. It’s visually similar to JSON with additional data structures and capabilities built-in. It’s constructs are easily understood by team members with different backgrounds — DBAs, Java Developers, Sysadmins etc.</p><p>For us the challenge arose when building the CI/CD pipelines that update the services. Since we went for ECS Fargate the Environment variables were inside the task definition and had to be updated via Terraform pipelines. The framework the developers and 3rd party software was using heavily relied on Environment variables for its configuration. Since there were multiple application stages each consiting of 40+ microservices we had to devise a smart way of handling this via code.</p><p>Before the AWS move the teams had those spread over many configuration files and maps, sometimes dedicated to the service. Changing one setting on 5 containers in all stages required sometimes 20 Pull Requests. The management overhead of doing a release was killing the team.</p><p>In order to alleviate the problem we’ve decided for a repo structure that would host everything in one repo and one code base, that would be customized depending on environment variables during deployment time. We’ve created terraform module that would encompass many features of ECS, Secrets Manager, Parameter stores, ALB and others that would create everything with opinionated settings and also included ability to modify those.</p><p>While this was easily understood by Terraform and AWS pros, it proved challenging for the Java developers to change the settings they would usually do when working on premises. The DevOps team had to be involved for each change and nobody wanted that after putting so much effort into IaC.</p><p>Terraform came to the rescue once again with the ability to read YAML files and map them to memory structures. YAML is a well known standard in the IT world being present for years in many areas and software applications. Now we just needed to find some way to easily use this in our pipelines.</p><p>Since we’ve already been using Terraform Workspaces due to the size of the environment, that was a good anchor point for us to start working with. Terraform Workspaces are logical containers inside your Terraform state file that can help dividing resources you provision into separate groupings. In large scale environments they will also improve your provisioning speed as there is less resources to manage.</p><p>For demonstration purposes let me define following Terraform Workspaces :</p><pre>$ terraform workspace list<br>  default<br>* app-dev<br>  app-int<br>  app-prod<br>  app-test</pre><p>Below you can find a piece of code that reads the YAML file into an in memory map. It looks for a .yaml file named the same way as the Terraform workspace we are currently working in.</p><pre>locals {<br> file_prefix = &quot;./${terraform.workspace}&quot;<br> workspace_path_yml = &quot;${local.file_prefix}.yml&quot;<br> workspace_path_yaml = &quot;${local.file_prefix}.yaml&quot;<br> workspace = fileexists(local.workspace_path_yml) ? file(local.workspace_path_yml) : fileexists(local.workspace_path_yaml) ? file(local.workspace_path_yaml) : yamlencode({})<br>settings = yamldecode(local.workspace)<br>}</pre><pre>output &quot;settings&quot; {<br> value = local.settings<br>}</pre><p>The module reads the YAML files corresponding to the selected Terraform Workspace name and populates the in memory structure using yamldecode. Now how do we use that in our terraform code ?</p><p>For the sake of simplicity lets consider a following YAML file containing settings that will be used to configure our EC2 instances in the Development environment :</p><pre>stage: &quot;DEV&quot;<br>apache_1:<br>  number_of_nodes: 1<br>  instance_type : &quot;t3.medium&quot;<br>  disk_size: &quot;20&quot;<br>  volume_type: &quot;gp3&quot;<br>  tags:<br>    name: &quot;ApacheWebserver&quot;<br>    status: &quot;Green&quot;<br>    schedule: &quot;cron(0 6 ? * MON-FRI *)&quot;<br>    appname: &quot;Nordcloud-Web&quot; <br>    release: &quot;1.1&quot;<br>apache_2:<br>  number_of_nodes: 1<br>  instance_type : &quot;t3.medium&quot;<br>  disk_size: &quot;20&quot;<br>  volume_type: &quot;gp2&quot;<br>  tags:<br>    name: &quot;ApacheWebserver&quot;<br>    status: &quot;Blue&quot;<br>    schedule: &quot;cron(0 6 ? * MON-FRI *)&quot;<br>    appname: &quot;Nordcloud-Web&quot; <br>    release: &quot;0.1&quot;</pre><p>And a similar file for Production settings :</p><pre>stage: &quot;PROD&quot;<br>apache_1:<br>  number_of_nodes: 2<br>  instance_type : &quot;t3.medium&quot;<br>  disk_size: &quot;20&quot;<br>  volume_type: &quot;gp3&quot;<br>  tags:<br>    name: &quot;ApacheWebserver&quot;<br>    status: &quot;Green&quot;<br>    schedule: &quot;cron(0 6 ? * MON-FRI *)&quot;<br>    appname: &quot;Nordcloud-Web&quot; <br>    release: &quot;1.0&quot;<br>apache_2:<br>  number_of_nodes: 0<br>  instance_type : &quot;t3.medium&quot;<br>  disk_size: &quot;20&quot;<br>  volume_type: &quot;gp2&quot;<br>  tags:<br>    name: &quot;ApacheWebserver&quot;<br>    status: &quot;Blue&quot;<br>    schedule: &quot;cron(0 6 ? * MON-FRI *)&quot;<br>    appname: &quot;Nordcloud-Web&quot; <br>    release: &quot;0.1&quot;</pre><p>In the end this is how our repository looks like :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/175/1*jLUu835BkKPvc7YMLnoKpg.png" /><figcaption>Repository structure</figcaption></figure><p>In the Terraform code below you can see how we utilize the in memory map to populate the values for one of the instances. I’ve highlighted in bold the parts that take their settings from the YAML file :</p><pre>resource &quot;aws_instance&quot; &quot;apache_1&quot; {<br>  count = <strong>module.config.settings.apache_1.number_of_nodes</strong></pre><pre>  subnet_id = var.subnet_ID<br>  vpc_security_group_ids = [<br>  aws_security_group.apache.id]<br>  ami           = data.aws_ami.centos.id<br>  instance_type = <strong>module.config.settings.apache_1.instance_type</strong><br>  ebs_optimized = true</pre><pre>  ebs_block_device {<br>    delete_on_termination = false<br>    device_name           = &quot;/dev/sbd&quot;<br>    volume_type           = <strong>module.config.settings.apache_1.volume_type</strong><br>    volume_size           = <strong>module.config.settings.apache_1.disk_size</strong><br>  }</pre><pre>tags = {<br>    Name     = &quot;${<strong>module.config.settings.apache_1.tags.name</strong>}-${count.index}&quot;<br>    Status   = <strong>module.config.settings.apache_1.tags.status</strong><br>    Schedule = <strong>module.config.settings.apache_1.tags.schedule</strong><br>    AppName  = <strong>module.config.settings.apache_1.tags.appname</strong><br>    Relelase = <strong>module.config.settings.apache_1.tags.release</strong><br>  }<br>  user_data = templatefile(&quot;apache-user-data.bash&quot;, {<br>    region = data.aws_region.current.name<br>  })<br>}</pre><p>So if we execute this code while being in the <strong>app-dev</strong> workspace we would get the following :</p><pre>Terraform will perform the following actions:</pre><pre># aws_instance.apache_1[0] will be created<br>  + resource &quot;aws_instance&quot; &quot;apache_1&quot; {<br>      + ami                                  = &quot;ami-0e8286b71b81c3cc1&quot;<br>      + ebs_optimized                        = true<br>      + instance_type                        = &quot;t3.medium&quot;<br>      + tags                                 = {<br>          + &quot;AppName&quot;  = &quot;Nordcloud-Web&quot;<br>          + &quot;Name&quot;     = &quot;ApacheWebserver-0&quot;<br>          + &quot;Relelase&quot; = &quot;1.1&quot;<br>          + &quot;Schedule&quot; = &quot;cron(0 6 ? * MON-FRI *)&quot;<br>          + &quot;Status&quot;   = &quot;Green&quot;<br>        }</pre><pre>+ ebs_block_device {<br>          + delete_on_termination = false<br>          + device_name           = &quot;/dev/sdb&quot;<br>          + volume_size           = 20<br>          + volume_type           = &quot;gp3&quot;<br>        }  <br>    }</pre><pre># aws_instance.apache_2[0] will be created<br>  + resource &quot;aws_instance&quot; &quot;apache_2&quot; {<br>      + ami                                  = &quot;ami-0e8286b71b81c3cc1&quot;<br>      + ebs_optimized                        = true<br>      + instance_type                        = &quot;t3.medium&quot;<br>      + tags                                 = {<br>          + &quot;AppName&quot;  = &quot;Nordcloud-Web&quot;<br>          + &quot;Name&quot;     = &quot;ApacheWebserver-0&quot;<br>          + &quot;Relelase&quot; = &quot;0.1&quot;<br>          + &quot;Schedule&quot; = &quot;cron(0 6 ? * MON-FRI *)&quot;<br>          + &quot;Status&quot;   = &quot;Blue&quot;<br>        }</pre><pre>+ ebs_block_device {<br>          + delete_on_termination = false<br>          + device_name           = &quot;/dev/sdb&quot;<br>          + volume_size           = 20<br>          + volume_type           = &quot;gp2&quot;<br>        }<br>    }</pre><pre>Plan: 3 to add, 0 to change, 0 to destroy.</pre><pre>(<em>… parts of output skipped for clarity)</em></pre><p>But executing this in <strong>app-prod</strong> workspace produces following results :</p><pre># aws_instance.apache_1[0] will be created<br>  + resource &quot;aws_instance&quot; &quot;apache_1&quot; {<br>      + ami                                  = &quot;ami-0e8286b71b81c3cc1&quot;<br>      + ebs_optimized                        = true<br>      + instance_type                        = &quot;t3.medium&quot;<br>    <br>      + tags                                 = {<br>          + &quot;AppName&quot;  = &quot;Nordcloud-Web&quot;<br>          + &quot;Name&quot;     = &quot;ApacheWebserver-0&quot;<br>          + &quot;Relelase&quot; = &quot;1.0&quot;<br>          + &quot;Schedule&quot; = &quot;cron(0 6 ? * MON-FRI *)&quot;<br>          + &quot;Status&quot;   = &quot;Green&quot;<br>        }</pre><pre>+ ebs_block_device {<br>          + delete_on_termination = false<br>          + device_name           = &quot;/dev/sbd&quot;<br>          + volume_size           = 20<br>          + volume_type           = &quot;gp3&quot;<br>        }<br>    }</pre><pre># aws_instance.apache_1[1] will be created<br>  + resource &quot;aws_instance&quot; &quot;apache_1&quot; {<br>      + ami                                  = &quot;ami-0e8286b71b81c3cc1&quot;<br>      + ebs_optimized                        = true<br>      + instance_type                        = &quot;t3.medium&quot;<br>      + tags                                 = {<br>          + &quot;AppName&quot;  = &quot;Nordcloud-Web&quot;<br>          + &quot;Name&quot;     = &quot;ApacheWebserver-1&quot;<br>          + &quot;Relelase&quot; = &quot;1.0&quot;<br>          + &quot;Schedule&quot; = &quot;cron(0 6 ? * MON-FRI *)&quot;<br>          + &quot;Status&quot;   = &quot;Green&quot;<br>        }</pre><pre>+ ebs_block_device {<br>          + delete_on_termination = false<br>          + device_name           = &quot;/dev/sbd&quot;<br>          + volume_size           = 20<br>          + volume_type           = &quot;gp3&quot;<br>        }<br>    }<br> <br>Plan: 3 to add, 0 to change, 0 to destroy.</pre><p>Notice how in the prod stage we only create 2 nodes of the Green type but no nodes of the Blue type are created as a result.</p><p>The picture below demonstrates the flow of information in out setup :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-OOMsOodj_9ofg9aY7WRtQ.png" /></figure><p>So what does that give is ? In this example the developers of the application can set many parameters that can be interesting for them during the release and daily work using the YAML files . Changing the values of <em>number_of_nodes</em> or <em>Status </em>allows them to change the number of nodes that are running for the respective application versions. In the background there is a Load Balancer that distributes traffic according to the Status tag between Green/Blue nodes so simply by changing the tag they can direct the traffic to the nodes of their linking. The developers can also change the instance size or disk size and type simply by changing corresponding values of<em> instance_type</em>,<em> disk_size</em> and <em>volume_type</em> in the YAML file.</p><p>At the same time the settings that are not important for them are set in the corresponding .tfvars files.</p><p>This method scales rapidly and allows to limit the essential application configuration in one place while still maintaining it versioned inside a code repository and accessible to all team members. In the case of our project the YAML files stored all the environment variables as well as start/stop schedules, container sizing and healthchecks etc. This way the development teams could easily change the settings crucial to them while not affecting the AWS related settings of the whole platform.<br>At the same time we are able to utilize a single repository and a single code base for all our Terraform code limiting the code sprawl and arguably improving the readibility and maintainability of the solution.</p><p>While the examples are made using the AWS provider the method presented here can be used with other platforms as well.</p><p>An experienced reader will notice that what we are doing here could be achived with TFVARS and would be right. However the project is a complex structure in which each environment stage creates 500+ AWS resources. We wanted to keep TFVARS as the place used by the AWS Platform team to control aspects that are out of the scope for the product teams handling the tools. This approach allowed us to have best of both worlds while keeping things simple and KISS is one of the core principles we’ve established in the beggining of the project.</p><p>If you want to play around with the code you can have a look at :</p><p><a href="https://github.com/tommybe-nc/aws-config-demo">GitHub - tommybe-nc/aws-config-demo</a></p><p>Shoutout to <a href="https://twitter.com/flomotlik">https://twitter.com/flomotlik</a> for all his contributions and hard work.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bc6bfc009d5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nordcloud-engineering/managing-complex-configurations-in-large-scale-environments-5bc6bfc009d5">Managing complex configurations in large scale environments</a> was originally published in <a href="https://medium.com/nordcloud-engineering">Nordcloud Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to preserve MAC address of primary ENI (eth0) on AWS EC2 instances]]></title>
            <link>https://medium.com/nordcloud-engineering/how-to-preserve-mac-address-of-primary-eni-eth0-on-aws-ec2-instances-4716b29e5c03?source=rss----6711a67bba47---4</link>
            <guid isPermaLink="false">https://medium.com/p/4716b29e5c03</guid>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Mariusz Dworniczak]]></dc:creator>
            <pubDate>Tue, 05 Apr 2022 10:37:55 GMT</pubDate>
            <atom:updated>2022-04-06T06:38:04.676Z</atom:updated>
            <content:encoded><![CDATA[<p>The other day one of my coworkers wrote on the company Slack:</p><p>“<em>I have an EC2 instance with an ENI attached (just the default one). I need to migrate to a new EC2 instance (different base image) but need to also make sure, that the MAC address and if possible (but MAC is more important) the IP do not change during the migration. I have been doing some digging but could not find a definitive answer if this was possible or not.<br>The background is, that license server software is running on this machine which is “locked” through the MAC address and it would cause a lot of effort to switch to a new MAC for all his servers…</em>”</p><p>Obviously, there wouldn’t be a problem if had attached the secondary network interface and bonded the license with the MAC address of this secondary interface. Then he could detach this network interface from the old EC2 instance and then attach it to the new EC2 instance.</p><p>Unfortunately, he assigned the license to the MAC address of eth0, and normally it is not possible to detach the default (primary) network interface from an instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8xD_2uDadmSyB0-1_M4RXA.png" /><figcaption>Detaching eth0 is not possible</figcaption></figure><p>So what to do in a situation where an instance associated with MAC/IP address is terminated but we need to preserve the address beyond the instance lifecycle.</p><p>It is possible to try this approach.</p><p>Here is a picture from the old instance with the MAC address we would like to preserve:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ItCNFCVsQXfEYb9531LBpQ.png" /><figcaption>eth0 properties with MAC address shown</figcaption></figure><p>As you see the MAC address is: <strong>12:36:fa:70:67:91</strong></p><p>Now we must change the termination behaviour of this ENI card (not the old instance), so the ENI is protected against instance termination.</p><p>Please see the picture below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AcwPSr-EUjlVUkoTh-fKEA.png" /><figcaption>Change termination behaviour for eth0</figcaption></figure><p>By default, this check box is marked so we need to uncheck it.</p><p>Now we can terminate the old instance. The OLD_Instance is terminated and its primary interface remains available with clear Attachment status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f3BJKlGnn5RyG142cEw9iQ.png" /><figcaption>the old instance is terminated</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*maZVsl-KfPJoO27ZRFh-iw.png" /><figcaption>but the ENI from the old instance is available to be attached.</figcaption></figure><p>So after these operations we have available ENI to be used in the same subnet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iin_Xls-6S3rcbfCSyy32Q.png" /></figure><p>The old parameters including desired MAC <strong>12:36:fa:70:67:91</strong> as you can see are preserved.</p><p>During the creation of the new instance, we can select preserved network interface so the new instance will have the same IP address but also MAC address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YnI_P3clgLqDqjK6lvFNdQ.png" /><figcaption>Choose the old card during creation of a new machine</figcaption></figure><p>I hope you will find this article helpful. Thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4716b29e5c03" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nordcloud-engineering/how-to-preserve-mac-address-of-primary-eni-eth0-on-aws-ec2-instances-4716b29e5c03">How to preserve MAC address of primary ENI (eth0) on AWS EC2 instances</a> was originally published in <a href="https://medium.com/nordcloud-engineering">Nordcloud Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>