<?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: Yaseen</title>
    <description>The latest articles on DEV Community by Yaseen (@yaseen_shariff_104).</description>
    <link>https://dev.to/yaseen_shariff_104</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%2F942836%2Fb3ef9612-9d26-41cd-8454-c5d647ccaa39.png</url>
      <title>DEV Community: Yaseen</title>
      <link>https://dev.to/yaseen_shariff_104</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yaseen_shariff_104"/>
    <language>en</language>
    <item>
      <title>API Gateway and Cloud Front in the same domain with different path</title>
      <dc:creator>Yaseen</dc:creator>
      <pubDate>Thu, 13 Oct 2022 13:56:04 +0000</pubDate>
      <link>https://dev.to/yaseen_shariff_104/api-gateway-and-cloud-front-in-the-same-domain-with-different-path-5fo3</link>
      <guid>https://dev.to/yaseen_shariff_104/api-gateway-and-cloud-front-in-the-same-domain-with-different-path-5fo3</guid>
      <description>&lt;p&gt;This is a very useful feature where we can have both cloudfront and api gateway in the same domain.&lt;/p&gt;

&lt;p&gt;Cloudfront has a beautiful feature of origins and behavior with which we can redirect to specific resource based on certain pattern.&lt;/p&gt;

&lt;p&gt;This is in assumption that already api gateway and cloudfront is created along with route53 configurations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vK0mCDkR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e9cqljuyls5n70y2vh7g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vK0mCDkR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e9cqljuyls5n70y2vh7g.png" alt="Image description" width="880" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First we will create origin for pointing to S3 bucket.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ho2cSX1r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q6pj52vmkrwwzlui4ih6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ho2cSX1r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q6pj52vmkrwwzlui4ih6.png" alt="Image description" width="880" height="490"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save the configurations.&lt;/p&gt;

&lt;p&gt;Later verify that we have new S3 origin.&lt;/p&gt;

&lt;p&gt;Let's create another origin pointing to api gateway.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2fxrkQo5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m32abksgj0caxi1mw60g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2fxrkQo5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m32abksgj0caxi1mw60g.png" alt="Image description" width="750" height="705"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We now want to create the behavior and attach the origin to it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YI2ZJ5Ga--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5xwspuhetjmyu1o88lpk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YI2ZJ5Ga--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5xwspuhetjmyu1o88lpk.png" alt="Image description" width="870" height="750"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have successfully created the behaviour, default is pointing to S3 bucket.&lt;/p&gt;

&lt;p&gt;You can also check &lt;a href="https://kuchbhilearning.blogspot.com/2022/10/api-gateway-and-cloud-front-in-same.html"&gt;https://kuchbhilearning.blogspot.com/2022/10/api-gateway-and-cloud-front-in-same.html&lt;/a&gt; &lt;/p&gt;

</description>
    </item>
    <item>
      <title>AWS-CDK Custom constructs</title>
      <dc:creator>Yaseen</dc:creator>
      <pubDate>Thu, 13 Oct 2022 13:36:50 +0000</pubDate>
      <link>https://dev.to/yaseen_shariff_104/aws-cdk-custom-constructs-24g0</link>
      <guid>https://dev.to/yaseen_shariff_104/aws-cdk-custom-constructs-24g0</guid>
      <description>&lt;p&gt;CDK constructs are cloud components. We use constructs to encapsulate logic, which we can reuse throughout our infrastructure code.&lt;br&gt;
AWS also defines Constructs as they are the basic building blocks of AWS CDK apps. A construct represents a "cloud component" and encapsulates everything AWS Cloud Formation needs to create the component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import * as s3 from 'aws-cdk-lib/aws-s3';
import { Construct } from 'constructs';
import * as cdk from 'aws-cdk-lib';

export class s3BucketConstruct extends Construct {
  public readonly s3Bucket: s3.Bucket;

  public constructor(scope: Construct, id: string) {
    super(scope, id);

    this.s3Bucket = new s3.Bucket(scope, `sample-s3-bucket`, {
      // Block all public access
      blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL,
      // When stack is deleted, delete this bucket also
      removalPolicy: cdk.RemovalPolicy.DESTROY,
      // Delete contained objects when bucket is deleted
      autoDeleteObjects: true,
    });
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is how we can create custom construct. &lt;br&gt;
You can also refer &lt;a href="https://kuchbhilearning.blogspot.com/2022/09/aws-cdk-custom-constructs.html"&gt;https://kuchbhilearning.blogspot.com/2022/09/aws-cdk-custom-constructs.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>awscdk</category>
      <category>construc</category>
      <category>node</category>
    </item>
  </channel>
</rss>
