<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kay</title>
    <description>The latest articles on DEV Community by Kay (@kayh).</description>
    <link>https://dev.to/kayh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F485221%2Fbebd005b-ecd7-4611-852a-d49bce5da32a.png</url>
      <title>DEV Community: Kay</title>
      <link>https://dev.to/kayh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kayh"/>
    <language>en</language>
    <item>
      <title>Hacktoberfest 2023 Pledge</title>
      <dc:creator>Kay</dc:creator>
      <pubDate>Wed, 18 Oct 2023 00:45:52 +0000</pubDate>
      <link>https://dev.to/kayh/hacktoberfest-2023-pledge-2b3k</link>
      <guid>https://dev.to/kayh/hacktoberfest-2023-pledge-2b3k</guid>
      <description>&lt;p&gt;This will be my sixth Hacktoberfest!&lt;/p&gt;

</description>
      <category>hacktoberfest23</category>
    </item>
    <item>
      <title>How does Amazon Managed Service for Prometheus relate to Amazon CloudWatch?</title>
      <dc:creator>Kay</dc:creator>
      <pubDate>Sun, 09 Oct 2022 02:03:48 +0000</pubDate>
      <link>https://dev.to/aws-builders/how-does-amazon-managed-service-for-prometheus-relate-to-amazon-cloudwatch-3mfc</link>
      <guid>https://dev.to/aws-builders/how-does-amazon-managed-service-for-prometheus-relate-to-amazon-cloudwatch-3mfc</guid>
      <description>&lt;p&gt;&lt;strong&gt;Amazon CloudWatch&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CloudWatch provides end-to-end observability across logs, metrics, and traces for applications running on EC2, AWS container services (EKS, ECS), Lambda, and other AWS services.&lt;/li&gt;
&lt;li&gt;CloudWatch can &lt;strong&gt;discover and collect Prometheus metrics&lt;/strong&gt; as CloudWatch metrics to provide options for our customers to query and alarm on Prometheus metrics.&lt;/li&gt;
&lt;li&gt;You should use CloudWatch if you are looking for a comprehensive observability service that brings together logs, metrics, tracing, dashboarding, and alerting in a unified experience that encompasses AWS services, EC2, containers, and serverless.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Amazon Managed Service for Prometheus&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon Managed Service for Prometheus, which is specifically optimized for monitoring container-based workloads, offers a Prometheus-compatible APIs for ingesting and querying your Prometheus metrics.&lt;/li&gt;
&lt;li&gt;Amazon Managed Service for Prometheus &lt;strong&gt;is a metric-only service and does not collect logs or distributed trace data&lt;/strong&gt;. You can export selected CloudWatch metrics to Amazon Managed Service for Prometheus in order to use &lt;strong&gt;PromQL&lt;/strong&gt; as the common query language for querying and alarming on all your stored metrics.&lt;/li&gt;
&lt;li&gt;You should use Amazon Managed Service for Prometheus if you want a service that is fully compatible with the Prometheus open source project. You should also choose Amazon Managed Service for Prometheus if you are already running Prometheus and are looking to eliminate that ongoing operational cost while also improving security.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;See &lt;a href="https://aws.amazon.com/prometheus/faqs/"&gt;https://aws.amazon.com/prometheus/faqs/&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  CloudWatch metrics + AWS Distro for OpenTelemetry (ADOT) + Amazon Managed Service for Prometheus + Amazon Managed Grafana
&lt;/h3&gt;

&lt;p&gt;This blog post could be a good start for people who are interested in CloudWatch metrics + AWS Distro for OpenTelemetry (ADOT) + Amazon Managed Service for Prometheus + Amazon Managed Grafana -&lt;br&gt;
&lt;a href="https://aws.amazon.com/blogs/mt/viewing-amazon-cloudwatch-metrics-with-amazon-managed-service-for-prometheus-and-amazon-managed-grafana/"&gt;Viewing Amazon CloudWatch metrics with Amazon Managed Service for Prometheus and Amazon Managed Grafana&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloudwatch</category>
      <category>prometheus</category>
    </item>
    <item>
      <title>Gotchas when building GitHub self-hosted runners with AWS official AMIs/container images for Python apps</title>
      <dc:creator>Kay</dc:creator>
      <pubDate>Sat, 01 Oct 2022 05:54:45 +0000</pubDate>
      <link>https://dev.to/kayh/gotchas-when-building-github-self-hosted-runners-with-aws-official-amiscontainer-images-for-python-apps-3mfl</link>
      <guid>https://dev.to/kayh/gotchas-when-building-github-self-hosted-runners-with-aws-official-amiscontainer-images-for-python-apps-3mfl</guid>
      <description>&lt;p&gt;The following are some gotchas when setting up specific Python versions on GitHub self-hosted runners which are based on AWS official AMIs and container images.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Official Amazon Linux 2 AMI and official Amazon Linux 2 container image do not have the same Python runtimes setup.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon Linux 2 AMI (&lt;a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html"&gt;ECS-optimized AMI&lt;/a&gt; &lt;code&gt;/aws/service/ecs/optimized-ami/amazon-linux-2/recommended&lt;/code&gt;) has &lt;code&gt;python2.7&lt;/code&gt; and &lt;code&gt;python3.7&lt;/code&gt; by default. &lt;/li&gt;
&lt;li&gt;Amazon Linux 2 container image &lt;a href="https://gallery.ecr.aws/amazonlinux/amazonlinux"&gt;amazonlinux/amazonlinux&lt;/a&gt; (&lt;code&gt;public.ecr.aws/amazonlinux/amazonlinux&lt;/code&gt;) has only &lt;code&gt;python2.7&lt;/code&gt;; it does not have &lt;code&gt;python3&lt;/code&gt;/&lt;code&gt;pip&lt;/code&gt; installed by default.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Amazon Linux 2 AMI has &lt;code&gt;python3&lt;/code&gt; pointed to &lt;code&gt;python3.7&lt;/code&gt; by default. When changing &lt;code&gt;python3&lt;/code&gt; to point to other Python3 version (e.g. setting &lt;code&gt;update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1&lt;/code&gt;), it may break &lt;code&gt;cfn-signal&lt;/code&gt; so no signal will be sent to ASG at EC2 launch (i.e. no healthy instances will be registered).&lt;br&gt;
Note that this will be an issue if you use ASG for the runners (not ECS Fargate).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Keep &lt;code&gt;python&lt;/code&gt; to point to &lt;code&gt;python2.7&lt;/code&gt;, as &lt;code&gt;yum&lt;/code&gt; does not support Python3. You will see this error if setting &lt;code&gt;python&lt;/code&gt; to point to Python3:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; yum
File "/usr/bin/yum", line 30
except KeyboardInterrupt, e:
                       ^
SyntaxError: invalid syntax
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;See also &lt;a href="https://stackoverflow.com/questions/11213520/yum-crashed-with-keyboard-interrupt-error"&gt;https://stackoverflow.com/questions/11213520/yum-crashed-with-keyboard-interrupt-error&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;actions/setup-python@v4&lt;/code&gt; does not support &lt;code&gt;arm64&lt;/code&gt; (&lt;a href="https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json"&gt;https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json&lt;/a&gt;).&lt;br&gt;
See related Open issue &lt;a href="https://github.com/actions/setup-python/issues/108"&gt;https://github.com/actions/setup-python/issues/108&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Note: (3) and (4) are not Amazon Linux specific. Just issues experienced when building the Amazon official image based self-hosted runners.&lt;/p&gt;

</description>
      <category>github</category>
      <category>selfhostedrunner</category>
      <category>aws</category>
      <category>python</category>
    </item>
    <item>
      <title>Some notes about Bottlerocket Security</title>
      <dc:creator>Kay</dc:creator>
      <pubDate>Mon, 26 Sep 2022 23:34:47 +0000</pubDate>
      <link>https://dev.to/aws-builders/some-notes-about-bottlerocket-security-57fa</link>
      <guid>https://dev.to/aws-builders/some-notes-about-bottlerocket-security-57fa</guid>
      <description>&lt;p&gt;This post includes some notes about Bottlerocket security.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CIS Hardening Benchmark for Bottlerocket&lt;/li&gt;
&lt;li&gt;FIPS Support / Validation&lt;/li&gt;
&lt;li&gt;Does Bottlerocket have integration with AWS Inspector?&lt;/li&gt;
&lt;li&gt;Is OS host logs available? Does it have integration with CloudWatch Log?&lt;/li&gt;
&lt;li&gt;Reduced attack surface, verified software, enforced permission boundaries&lt;/li&gt;
&lt;li&gt;ECS/EBS encryption vs. OS crypto&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  CIS Hardening Benchmark for Bottlerocket
&lt;/h2&gt;

&lt;p&gt;Bottlerocket now has a Center for Internet Security (CIS) Benchmark. The CIS Benchmark is a catalog of security-focused configuration settings that help Bottlerocket customers configure or document any non-compliant configurations in a simple and efficient manner. The CIS Benchmark for Bottlerocket includes both Level 1 and Level 2 configuration profiles.&lt;/p&gt;

&lt;p&gt;See also &lt;a href="https://github.com/bottlerocket-os/bottlerocket/issues/1297"&gt;https://github.com/bottlerocket-os/bottlerocket/issues/1297&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  FIPS Support / Validation
&lt;/h2&gt;

&lt;p&gt;Issue (Open): &lt;a href="https://github.com/bottlerocket-os/bottlerocket/issues/1667"&gt;https://github.com/bottlerocket-os/bottlerocket/issues/1667&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;FIPS compliance is our second most requested feature, behind CIS (which is in progress), and I'm planning to focus on it once the CIS benchmark is complete.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Does Bottlerocket have integration with AWS Inspector?
&lt;/h2&gt;

&lt;p&gt;Bottlerocket is now supported by AWS inspector in commercial regions.&lt;/p&gt;

&lt;p&gt;See also&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/bottlerocket-os/bottlerocket/issues/848"&gt;https://github.com/bottlerocket-os/bottlerocket/issues/848&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bottlerocket-os/bottlerocket/issues/2056"&gt;https://github.com/bottlerocket-os/bottlerocket/issues/2056&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Is OS host logs available? Does it have integration with CloudWatch Log?
&lt;/h2&gt;

&lt;p&gt;No. There is no current plan to add a logging agent to the host OS.&lt;/p&gt;

&lt;p&gt;Issue (Open) &lt;a href="https://github.com/bottlerocket-os/bottlerocket/issues/850"&gt;https://github.com/bottlerocket-os/bottlerocket/issues/850&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Comments from Maintainers:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We have no current plans to add a logging agent to the host OS.&lt;/p&gt;

&lt;p&gt;When talking with many EKS customers, we found that a common pattern is to use Kubernetes’ facilities for log streaming, even for system level logs. Another method is to use Fluent Bit as covered in this blog post. These are our suggested methods for customers to get both container logs as well as other logs off the box.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Reduced attack surface, verified software, enforced permission boundaries
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Bottlerocket contains less software, and notably eliminates some components you might expect: &lt;strong&gt;Bottlerocket doesn’t have SSH, any interpreters like Python, or even a shell&lt;/strong&gt;; it is expected that Bottlerocket to be "hands-off" most of the time, and removing components like this makes it harder for an attacker to gain a foothold in the system. Beyond removal of software, Bottlerocket also reduces the attack surface of the operating system by applying software hardening techniques like:

&lt;ul&gt;
&lt;li&gt;building &lt;strong&gt;position-independent executables (PIE)&lt;/strong&gt;,&lt;/li&gt;
&lt;li&gt;using &lt;strong&gt;relocation read-only (RELRO) linking&lt;/strong&gt;, and&lt;/li&gt;
&lt;li&gt;building all &lt;strong&gt;first-party software with memory-safe languages like Rust and Go&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Bottlerocket uses &lt;a href="https://github.com/SELinuxProject"&gt;SELinux&lt;/a&gt; in enforcing mode to restrict modifications to itself even from privileged containers. SELinux is an implementation of Mandatory Access Control (MAC) enforced by the Linux kernel, and &lt;strong&gt;limits the set of actions processes can take&lt;/strong&gt;. Today, Bottlerocket’s SELinux policy is intended to restrict orchestrated containers from causing undesired and unexpected changes to the operating system. Going forward, we want to extend this policy to apply to all categories of persistent threats.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;See&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Blog post: &lt;a href="https://aws.amazon.com/blogs/containers/bottlerocket-a-special-purpose-container-operating-system/"&gt;https://aws.amazon.com/blogs/containers/bottlerocket-a-special-purpose-container-operating-system/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bottlerocket-os/bottlerocket/tree/develop/packages"&gt;Bottlerocket Packages&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ECS/EBS encryption vs. OS crypto
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Bottlerocket operates with 2 default storage volumes - standard EBS encryption applicable
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The root device, holds the active and passive partition sets. It also contains the &lt;code&gt;bootloader&lt;/code&gt;, the &lt;code&gt;dm-verity&lt;/code&gt; hash tree for verifying the immutable root filesystem, and the data store for the Bottlerocket API.&lt;/li&gt;
&lt;li&gt;The data device is used as persistent storage for container images, container orchestration, host-containers, and bootstrap containers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Bottlerocket cryptographically verifies itself
&lt;/h3&gt;

&lt;p&gt;The operating system is composed of a disk image that is verified on boot with dm-verity; unexpected changes to the contents of the disk image will cause the operating system to fail to boot.&lt;/p&gt;

&lt;p&gt;Bottlerocket uses its own software updater rather than a more common Linux package manager. Updates to Bottlerocket are vended from a repository that follows The Update Framework (TUF) specification; TUF mitigates common classes of attacks against software repositories present in traditional package manager systems.&lt;/p&gt;

&lt;p&gt;Source: &lt;a href="https://aws.amazon.com/blogs/containers/bottlerocket-a-special-purpose-container-operating-system/"&gt;https://aws.amazon.com/blogs/containers/bottlerocket-a-special-purpose-container-operating-system/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>bottlerocket</category>
      <category>security</category>
    </item>
    <item>
      <title>AWS Lambda Gotchas</title>
      <dc:creator>Kay</dc:creator>
      <pubDate>Fri, 23 Sep 2022 01:34:15 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-lambda-gotchas-17b2</link>
      <guid>https://dev.to/aws-builders/aws-lambda-gotchas-17b2</guid>
      <description>&lt;p&gt;This post includes few gotchas on AWS Lambda.&lt;/p&gt;

&lt;h3&gt;
  
  
  1)  Lambda Python Runtimes - Python 3.6/3.7 are Amazon Linux 1 and Python 3.8/3.9 are Amazon Linux 2
&lt;/h3&gt;

&lt;p&gt;Python 3.6/3.7 are Amazon Linux 1 and Python 3.8/3.9 are Amazon Linux 2.&lt;/p&gt;

&lt;p&gt;In general it should be fine to upgrade from Python 3.6 to 3.9.&lt;/p&gt;

&lt;p&gt;But there are cases you'll need to make some changes. For example, if you have code utilizing some sys call, e.g. &lt;code&gt;curl&lt;/code&gt; - &lt;code&gt;curl&lt;/code&gt; is not installed in Amazon Linux 2 by default.&lt;/p&gt;

&lt;h3&gt;
  
  
  2)  AWS CLI not allowing valid JSON in payload parameter with lambda invoke
&lt;/h3&gt;

&lt;p&gt;If you see error like &lt;code&gt;Invalid base64:&lt;/code&gt;, it could be because since awscli 2, payloads need to be base64 encoded when invoking a Lambda function.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;By default, the AWS CLI version 2 now passes all binary input and binary output parameters as base64-encoded strings. A parameter that requires binary input has its type specified as blob (binary large object) in the documentation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You will need to pass in also &lt;code&gt;--cli-binary-format raw-in-base64-out&lt;/code&gt;. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws lambda invoke --function-name testsms \
    --invocation-type Event \
    --cli-binary-format raw-in-base64-out \
    --payload '{"key": "test"}' response.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See also&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/aws/aws-cli/issues/4968"&gt;https://github.com/aws/aws-cli/issues/4968&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/60310607/amazon-aws-cli-not-allowing-valid-json-in-payload-parameter"&gt;https://stackoverflow.com/questions/60310607/amazon-aws-cli-not-allowing-valid-json-in-payload-parameter&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3)  Cannot do &lt;code&gt;ping&lt;/code&gt; from Lambda Function
&lt;/h3&gt;

&lt;p&gt;See &lt;a href="https://aws.amazon.com/lambda/faqs/"&gt;AWS Lambda FAQs&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Lambda attempts to impose as few restrictions as possible on normal language and operating system activities, but there are a few activities that are disabled: Inbound network connections are blocked by AWS Lambda, and for outbound connections, only TCP/IP and UDP/IP sockets are supported, and ptrace (debugging) system calls are blocked. TCP port 25 traffic is also blocked as an anti-spam measure.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  4)  Code storage for uploaded Lambda functions (&lt;code&gt;CodeStorageExceededException&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;The Lambda service stores your function code in an internal &lt;strong&gt;S3 bucket&lt;/strong&gt; that's private to your account. Each AWS account is allocated &lt;strong&gt;75 GB of storage in each Region&lt;/strong&gt; (and can be increased up to Terabytes). Code storage includes the total storage used by both &lt;strong&gt;Lambda functions and layers&lt;/strong&gt;. If you reach the quota, you receive a &lt;strong&gt;&lt;code&gt;CodeStorageExceededException&lt;/code&gt;&lt;/strong&gt; when you attempt to deploy new functions.&lt;/p&gt;

&lt;p&gt;See &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html"&gt;Lambda quotas&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To see the storage used&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;From AWS Lambda console &amp;gt; Dashboard&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From AWS CLI:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws lambda list-versions-by-function --function-name myTestFunction
aws lambda get-layer-version --layer-version --layer-name TestLayer --version-number 2
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;This returns each published version of the function/layer together with the $LATEST version. The CodeSize attribute shows the total number of bytes used by code storage of this function/layer.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;See &lt;a href="https://docs.aws.amazon.com/lambda/latest/operatorguide/code-storage.html"&gt;Monitoring Lambda code storage&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>lambda</category>
      <category>gotcha</category>
    </item>
    <item>
      <title>Amazon EC2 On-Demand Instance vCPUs limits</title>
      <dc:creator>Kay</dc:creator>
      <pubDate>Thu, 22 Sep 2022 01:06:17 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-ec2-on-demand-instance-vcpus-limits-3dif</link>
      <guid>https://dev.to/aws-builders/aws-ec2-on-demand-instance-vcpus-limits-3dif</guid>
      <description>&lt;h2&gt;
  
  
  On-Demand Instance vCPUs limits
&lt;/h2&gt;

&lt;p&gt;There is a limit on the number of running On-Demand Instances per AWS account per Region. On-Demand Instance limits are managed in terms of the &lt;strong&gt;number of vCPUs&lt;/strong&gt; that your running On-Demand Instances are using, regardless of the instance type. &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-on-demand-instances.html#ec2-on-demand-instances-limits"&gt;Each limit specifies the vCPU limit for one or more instance families&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To see the current vCPUs limits of your account from AWS EC2 console

&lt;ul&gt;
&lt;li&gt;Enter "vcpu" in the "Find limits" to shortlist the limits&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;To find out the current running instances (of the same instance family of the EC2 type you want to check), go to EC2 console.&lt;/li&gt;
&lt;li&gt;Calculate how many vCPUs you nee

&lt;ul&gt;
&lt;li&gt;You can use the &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-on-demand-instances.html#vcpu-limits-calculator"&gt;vCPU limits calculator&lt;/a&gt; to see what will be the numbers for adding instances of certain type.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Request a limit increase

&lt;ul&gt;
&lt;li&gt;Even though EC2 automatically increases your On-Demand Instance limits based on your usage, you can request a limit increase if necessary. See Request a limit increase for details.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;See also &lt;a href="https://aws.amazon.com/premiumsupport/knowledge-center/ec2-on-demand-instance-vcpu-increase/"&gt;https://aws.amazon.com/premiumsupport/knowledge-center/ec2-on-demand-instance-vcpu-increase/&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>limit</category>
      <category>vcpu</category>
    </item>
    <item>
      <title>Amazon EC2 Image Builder Gotchas</title>
      <dc:creator>Kay</dc:creator>
      <pubDate>Thu, 22 Sep 2022 00:56:27 +0000</pubDate>
      <link>https://dev.to/aws-builders/some-gotchas-when-using-amazon-ec2-image-builder-398l</link>
      <guid>https://dev.to/aws-builders/some-gotchas-when-using-amazon-ec2-image-builder-398l</guid>
      <description>&lt;h2&gt;
  
  
  Gotchas
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In &lt;code&gt;AWS::ImageBuilder::ContainerRecipe&lt;/code&gt;, &lt;code&gt;Parameters&lt;/code&gt; is supported only from Console and AWS CLI, but not from CloudFormation. Confirmed with AWS support.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In &lt;code&gt;AWS::ImageBuilder::ContainerRecipe&lt;/code&gt;, &lt;code&gt;ParentImage&lt;/code&gt; (or &lt;code&gt;Base image&lt;/code&gt; in Console) cannot reference another AWS account's ECR repo - this is not mentioned in &lt;a href="https://docs.aws.amazon.com/imagebuilder/latest/userguide/create-container-recipes.html"&gt;AWS documentation&lt;/a&gt;. Confirmed with AWS support.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If something is not right at early stage (e.g. parse file in Component Data), you will see &lt;code&gt;Internal Failure&lt;/code&gt; in CloudFormation console, but the errors will not be logged in S3 nor CloudWatch Logs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;CloudWatch Logs - &lt;code&gt;/aws/imagebuilder/${ImageName}&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Logging things happen in the EC2 instance of the build only.&lt;/li&gt;
&lt;li&gt;Not for Component Data syntax error, version conflict, etc.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tags are not inherited from the CloudFormation stack for all Image Builder resources (Component, Image Recipe / Container Recipe, Infrastructure configuration, Distribution, Image Pipeline).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Adding, removing, renaming Tags, need to change Version; otherwise &lt;code&gt;Internal Failure&lt;/code&gt; will be shown in the CloudFormation console, nothing in S3 log nor CW logs. Also need to update upstream resource's version e.g. Recipe Version.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Whenever a change to Recipe (include Git Component)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build time ~30 mins&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>ec2imagebuilder</category>
      <category>gotcha</category>
    </item>
    <item>
      <title>Accessing an API Gateway private REST API in another AWS account using an interface VPC endpoint</title>
      <dc:creator>Kay</dc:creator>
      <pubDate>Thu, 22 Sep 2022 00:40:25 +0000</pubDate>
      <link>https://dev.to/aws-builders/accessing-an-api-gateway-private-rest-api-in-another-aws-account-using-an-interface-vpc-endpoint-3ljl</link>
      <guid>https://dev.to/aws-builders/accessing-an-api-gateway-private-rest-api-in-another-aws-account-using-an-interface-vpc-endpoint-3ljl</guid>
      <description>&lt;p&gt;This repository &lt;a href="https://github.com/kyhau/access-private-apigw-in-another-account/blob/main/README.md" rel="noopener noreferrer"&gt;kyhau/access-private-apigw-in-another-account&lt;/a&gt; provides a working example for calling a private API Gateway REST API from another AWS account, including CloudFormation templates, API test code and GitHub Actions workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Concept
&lt;/h2&gt;

&lt;p&gt;To use an interface VPC endpoint to access an API Gateway private REST API that's in another AWS account, do the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create an interface endpoint in a VPC in one account (account A).&lt;/li&gt;
&lt;li&gt;Create an API Gateway private REST API in a second account (account B).&lt;/li&gt;
&lt;li&gt;Configure a resource policy for the private REST API that allows the interface endpoint to invoke the API.&lt;/li&gt;
&lt;li&gt;Test the setup by calling the private REST API from account A. There are 4 ways to call the API and are covered in the Lambda function ApiTesterFunction (ApiTester.py).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx486bqw3ppuy5rvjtn84.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx486bqw3ppuy5rvjtn84.png" alt="Cross Account Private API Gateway"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For details see &lt;a href="https://aws.amazon.com/premiumsupport/knowledge-center/api-gateway-private-cross-account-vpce/" rel="noopener noreferrer"&gt;How can I access an API Gateway private REST API in another AWS account using an interface VPC endpoint?&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Deployment Example
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;The workflow &lt;a href="https://github.com/kyhau/access-private-apigw-in-another-account/blob/main/.github/workflows/deploy-apigw-vpce.yaml" rel="noopener noreferrer"&gt;deploy-apigw-vpce.yaml&lt;/a&gt; deploys the interface VPC endpoint for API Gateway execute-api associated to VPC subnet(s) in Account-A.&lt;/li&gt;
&lt;li&gt;The workflow &lt;a href="https://github.com/kyhau/access-private-apigw-in-another-account/blob/main/.github/workflows/deploy-apigw.yaml" rel="noopener noreferrer"&gt;deploy-apigw.yaml&lt;/a&gt; deploys a simple API Gateway private REST API to Account-B. The stack deploys deploy a resource policy for the private REST API that allows the interface endpoint to invoke the API.&lt;/li&gt;
&lt;li&gt;The workflow &lt;a href="https://github.com/kyhau/access-private-apigw-in-another-account/blob/main/.github/workflows/deploy-lambda-api-tester.yaml" rel="noopener noreferrer"&gt;deploy-lambda-api-tester.yaml&lt;/a&gt; deploys a Lambda function to VPC subnet(s) in Account-A, for testing the&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Testing the API endpoints with the Lambda function ApiTesterFunction
&lt;/h2&gt;

&lt;p&gt;The Lambda function ApiTesterFunction (&lt;a href="https://github.com/kyhau/access-private-apigw-in-another-account/blob/main/function/ApiTester.py" rel="noopener noreferrer"&gt;ApiTester.py&lt;/a&gt;) tests the 4 endpoints/approaches accessing the API in another AWS account:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Default APIGW endpoint; work only if private DNS enabled for your interface endpoint&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://dummyapiid.execute-api.ap-southeast-2.amazonaws.com/v0/mock
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;API Gateway Route 53 Alias for VPC endpoint associated&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://dummyapiid-vpce-12345678901234567.execute-api.ap-southeast-2.amazonaws.com/v0/mock
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Public DNS name with a Host header&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://vpce-12345678901234567-abcd1234.execute-api.ap-southeast-2.vpce.amazonaws.com/v0/mock with headers Host=dummyapiid.execute-api.ap-southeast-2.amazonaws.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Public DNS name with the x-apigw-api-id header&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://vpce-12345678901234567-abcd1234.execute-api.ap-southeast-2.vpce.amazonaws.com/v0/mock with headers x-apigw-api-id=dummyapiid
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example of the Lambda function (ApiTesterFunction) execution log&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvkhnc2hzzk337e3nohfo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvkhnc2hzzk337e3nohfo.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>apigateway</category>
      <category>vpcendpoint</category>
      <category>privateapigateway</category>
    </item>
    <item>
      <title>Some notes about Amazon EKS IAM OIDC Provider</title>
      <dc:creator>Kay</dc:creator>
      <pubDate>Mon, 18 Apr 2022 23:52:55 +0000</pubDate>
      <link>https://dev.to/aws-builders/some-notes-about-amazon-eks-iam-oidc-provider-p1m</link>
      <guid>https://dev.to/aws-builders/some-notes-about-amazon-eks-iam-oidc-provider-p1m</guid>
      <description>&lt;h2&gt;
  
  
  Step 1
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;iam:*OpenIDConnectProvider*&lt;/code&gt; permissions are not required when creating an EKS cluster with &lt;code&gt;CreateCluster&lt;/code&gt;, which creates an &lt;strong&gt;OpenID Connect provider URL&lt;/strong&gt; (OpenID Connect issuer URL) for the cluster (e.g. &lt;a href="https://oidc.eks.ap-southeast-2.amazonaws.com/id/ABCABC111222333444ABCABC11122233"&gt;https://oidc.eks.ap-southeast-2.amazonaws.com/id/ABCABC111222333444ABCABC11122233&lt;/a&gt;). &lt;/p&gt;

&lt;p&gt;And in CloudTrail, there are no &lt;code&gt;*OpenIDConnectProvider*&lt;/code&gt; events logged.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2
&lt;/h2&gt;

&lt;p&gt;After (1), the cluster has an OpenID Connect issuer URL associated with it.  To use IAM roles for service accounts, an IAM OIDC provider must exist for the cluster. See &lt;a href="https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Then you need to run &lt;code&gt;ekctl utils associate-iam-oidc-provider&lt;/code&gt;, e.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ eksctl utils associate-iam-oidc-provider --cluster=k-test-oicd --approve --region=ap-southeast-2 --profile test-oidc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;strong&gt;Open ID Provider&lt;/strong&gt; with the same URL as (1) is created.&lt;/p&gt;

&lt;p&gt;For this step, this role needs to have at least the following permissions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iam:CreateOpenIDConnectProvider
iam:GetOpenIDConnectProvider
iam:TagOpenIDConnectProvider
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CloudTrail does NOT show the events as well (e.g. &lt;code&gt;CreateOpenIDConnectProvider&lt;/code&gt;).&lt;/p&gt;

</description>
      <category>eks</category>
      <category>oidc</category>
    </item>
    <item>
      <title>X-Ray tracing from SQS to Lambda</title>
      <dc:creator>Kay</dc:creator>
      <pubDate>Mon, 08 Feb 2021 23:57:55 +0000</pubDate>
      <link>https://dev.to/aws-builders/x-ray-tracing-from-sqs-to-lambda-8md</link>
      <guid>https://dev.to/aws-builders/x-ray-tracing-from-sqs-to-lambda-8md</guid>
      <description>&lt;p&gt;SQS supports X-Ray tracing but it does not propagate the trace to Lambda function. Lambda always starts a new trace with an immutable facade segment.&lt;/p&gt;

&lt;p&gt;This is a known issue, see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;aws-xray-sdk-node: &lt;a href="https://github.com/aws/aws-xray-sdk-node/issues/208" rel="noopener noreferrer"&gt;https://github.com/aws/aws-xray-sdk-node/issues/208&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;aws-xray-sdk-dotnet: &lt;a href="https://github.com/aws/aws-xray-sdk-dotnet/issues/110" rel="noopener noreferrer"&gt;https://github.com/aws/aws-xray-sdk-dotnet/issues/110&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Workaround
&lt;/h3&gt;

&lt;p&gt;There were some workaround discussions in the above issues.&lt;/p&gt;

&lt;p&gt;The following is a solution I implemented for a demo: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new segment to replace the facade segment created by Lambda, and&lt;/li&gt;
&lt;li&gt;assign with the retrieved trace ID and parent ID from the trace header of the SQS segment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example in typescript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Handler&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;SQSEvent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;SQSRecord&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aws-lambda&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Segment&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setSegment&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;utils&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aws-xray-sdk&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;

&lt;span class="c1"&gt;// Create a new Segment&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;traceHeaderStr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;sqsRecord&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;attributes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;AWSTraceHeader&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;traceData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;utils&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;processTraceData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;traceHeaderStr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sqsSegmentEndTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sqsRecord&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;attributes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ApproximateFirstReceiveTimestamp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;lambdaSegment&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Segment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;functionName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;traceData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;root&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;traceData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parent&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;lambdaSegment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;origin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;AWS::Lambda::Function&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="nx"&gt;lambdaSegment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;start_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;lambdaExecStartTime&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lambdaExecStartTime&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;sqsSegmentEndTime&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;lambdaSegment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addPluginData&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;function_arn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;functionArn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;region&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;sqsRecord&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;awsRegion&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;request_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;awsRequestId&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="c1"&gt;// Set it as the current Segment&lt;/span&gt;
&lt;span class="nf"&gt;setSegment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lambdaSegment&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Do something&lt;/span&gt;

&lt;span class="c1"&gt;// Close the segment&lt;/span&gt;
&lt;span class="nx"&gt;lambdaSegment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From Trace Map console:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn8g7pgh7jftz511u8o63.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn8g7pgh7jftz511u8o63.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example code can be found here on GitHub &lt;a href="https://github.com/kyhau/aws-tools/blob/master/X-Ray/xray-sqs-to-lambda/handler.ts" rel="noopener noreferrer"&gt;kyhau/aws-tools/b/X-Ray/xray-sqs-to-lambda/handler.ts&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>xray</category>
      <category>sqs</category>
      <category>lambda</category>
    </item>
    <item>
      <title>saml2aws-multi: a simple tool providing an easy-to-use command line interface for saml2aws</title>
      <dc:creator>Kay</dc:creator>
      <pubDate>Sat, 30 Jan 2021 00:04:38 +0000</pubDate>
      <link>https://dev.to/aws-builders/saml2aws-multi-a-simple-tool-providing-an-easy-to-use-command-line-interface-for-saml2aws-55n6</link>
      <guid>https://dev.to/aws-builders/saml2aws-multi-a-simple-tool-providing-an-easy-to-use-command-line-interface-for-saml2aws-55n6</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/kyhau/saml2aws-multi" rel="noopener noreferrer"&gt;&lt;code&gt;saml2aws-multi&lt;/code&gt;&lt;/a&gt; is a simple tool I created for using &lt;a href="https://github.com/Versent/saml2aws" rel="noopener noreferrer"&gt;&lt;code&gt;saml2aws&lt;/code&gt;&lt;/a&gt; more effectively on day-to-day tasks. &lt;code&gt;saml2aws-multi&lt;/code&gt; provides an easy-to-use command line interface to support login and retrieve AWS temporary credentials for multiple roles of different accounts with &lt;code&gt;saml2aws&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fowk8a1ewx6kmb61jcqbx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fowk8a1ewx6kmb61jcqbx.png" alt="Example-ListRoleNames"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Usage&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ awslogin --help
Usage: awslogin [OPTIONS] COMMAND [ARGS]...

  Get credentials for multiple accounts with saml2aws

Options:
  -k, --keyword TEXT              Pre-select roles with the given keyword(s)
  -f, --profile-name-format [RoleName|RoleName-AccountAlias]
                                  Profile name format  [default: RoleName]
  -r, --refresh-cached-roles      [default: False]
  -t, --session-duration TEXT     Session duration in seconds
  -d, --debug                     [default: False]
  --help                          Show this message and exit.

Commands:
  chained  List chained role profiles specified in ~/.aws/config
  switch   Switch default profile
  whoami   Who am I?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For detailed instruction and source see &lt;a href="https://github.com/kyhau/saml2aws-multi" rel="noopener noreferrer"&gt;kyhau/saml2aws-multi&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Hactoberfest 2020 Swag Arrived</title>
      <dc:creator>Kay</dc:creator>
      <pubDate>Sat, 09 Jan 2021 00:40:56 +0000</pubDate>
      <link>https://dev.to/kayh/hactoberfest-2020-swag-arrived-5gh2</link>
      <guid>https://dev.to/kayh/hactoberfest-2020-swag-arrived-5gh2</guid>
      <description>&lt;p&gt;Just received my Hacktoberfest 2020 swag. Looking forward to participate again this year.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fj5f6rvk19zl0xq83e4wj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fj5f6rvk19zl0xq83e4wj.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
      <category>github</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
