<?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[Stories by Rajith on Medium]]></title>
        <description><![CDATA[Stories by Rajith on Medium]]></description>
        <link>https://medium.com/@rajithv?source=rss-1962bc71ad0a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3i5Mp9CJr3RefKsqLA9I4g.jpeg</url>
            <title>Stories by Rajith on Medium</title>
            <link>https://medium.com/@rajithv?source=rss-1962bc71ad0a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 16:43:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rajithv/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cross-Account Event Delivery with AWS EventBridge and CodeCommit]]></title>
            <link>https://towardsaws.com/cross-account-event-delivery-with-aws-eventbridge-and-codecommit-f129d47276a5?source=rss-1962bc71ad0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f129d47276a5</guid>
            <category><![CDATA[codebuild]]></category>
            <category><![CDATA[event-driven-architecture]]></category>
            <category><![CDATA[eventbridge]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-codecommit]]></category>
            <dc:creator><![CDATA[Rajith]]></dc:creator>
            <pubDate>Sat, 02 Mar 2024 04:12:10 GMT</pubDate>
            <atom:updated>2024-03-02T04:12:10.706Z</atom:updated>
            <content:encoded><![CDATA[<p>Cross-account event delivery in Amazon Web Services (AWS) facilitates seamless communication and integration between different accounts. In this guide, we will focus on establishing cross-account event delivery using AWS CloudWatch Events and AWS CodeCommit between two AWS accounts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*L8DRoD59noVNo_M36-VXBg.jpeg" /></figure><p>The primary focus of this guide is to trigger a CodeBuild project(<strong>e.g., sample-codebuild-project</strong>) in <strong>Account A</strong>(Event Receiver) when a code merge event occurs in a particular branch(<strong>e.g., master branch</strong>) in the CodeCommit repository within <strong>Account B</strong>( Event Sender).</p><p><strong>Understanding Cross-Account Event Delivery:</strong></p><p>Cross-account event delivery allows events generated in one AWS account to be delivered and processed by resources in another AWS account. This capability is instrumental in building event-driven architectures and enabling collaboration between AWS accounts.</p><h4>Account A Event Receiver (709326302347)</h4><ol><li>Enable Account A to Receive Events: To enable Account A to receive events from Account B, execute the following AWS CLI command:</li></ol><pre>aws events put-permission --action events:PutEvents --statement-id MySid --principal 494170752669 --region us-west-2 --profile receiver</pre><p>You can verify the permissions using:</p><pre>aws events describe-event-bus --profile receiver</pre><p>2. Create a CloudWatch Events rule with CodeCommit as the event source and CodeBuild project as the target</p><p>a. Create the trust policy that allows CloudWatch Events to assume the service role. Name the trust policy trustpolicyforcwe.json</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Principal&quot;: {<br>                &quot;Service&quot;: &quot;events.amazonaws.com&quot;<br>            },    <br>            &quot;Action&quot;: &quot;sts:AssumeRole&quot;<br>        }<br>    ]<br>}</pre><p>b. Create the CodeBuild-Invoke-Role-For-Cloudwatch-Events role and attach the trust policy.</p><pre>aws iam create-role --role-name CodeBuild-Invoke-Role-For-Cloudwatch-Events --assume-role-policy-document file://trustpolicyforcwe.json --profile receiver</pre><p>c. Create a policy permissionspolicycwe.jsonwhich have the permission to start a sample Codebuild project called sample-codebuild-project</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Action&quot;: [<br>                &quot;codebuild:StartBuild&quot;<br>            ],<br>            &quot;Resource&quot;: [          <br>                &quot;arn:aws:codebuild:us-west-2:709326302347:project/sample-codebuild-project&quot;<br>            ]<br>        }<br>    ]<br>}</pre><p>d. Attach Permissions Policy to Role:</p><p>Name the policy as CodePipeline-Permissions-Policy-for-CWE and Role as CodeBuild-Invoke-Role-For-Cloudwatch-Events.</p><pre>aws iam put-role-policy --role-name CodeBuild-Invoke-Role-For-Cloudwatch-Events --policy-name Codebuild-Permissions-Policy-For-CWE --policy-document file://permissionspolicycwe.json --profile receiver --region us-west-2</pre><p>3. Call the put-rule command and include the --name, --event-pattern, and --role-arn parameters</p><pre>aws events put-rule --name &quot;CodeCommitRepoRule&quot; --event-pattern &quot;{\&quot;source\&quot;:[\&quot;aws.codecommit\&quot;],\&quot;detail-type\&quot;:[\&quot;CodeCommit Repository State Change\&quot;],\&quot;resources\&quot;:[\&quot;arn:aws:codecommit:us-west-2:494170752669:sample-repo\&quot;],\&quot;detail\&quot;:{\&quot;referenceType\&quot;:[\&quot;branch\&quot;],\&quot;referenceName\&quot;:[\&quot;master\&quot;]}}&quot; --role-arn &quot;arn:aws:iam::709326302347:role/CodeBuild-Invoke-Role-For-Cloudwatch-Events&quot; --profile receiver --region us-west-2</pre><p>4. To add CodeBuild as a target, call the put-targets command and include the following parameters:</p><p>• The --rule parameter is used with the rule name we created by using put-rule.</p><p>• The --targets parameter is used with the list Id of the target in the list of targets and the ARN of the target CodeBuild Project.</p><p>The command provided indicates that in the rule <strong>CodeCommitRepoRule</strong>, the target Id is specified as number one, indicating its placement in the list of targets linked to the rule. Furthermore, the command incorporates the ARN for the CodeBuild, indicating that the CodeBuild project initiates automatically when changes occur in the branch within the CodeCommit repository.</p><pre>aws events put-targets --rule CodeCommitRepoRule --targets &quot;Id&quot;=&quot;1&quot;,&quot;Arn&quot;=&quot;arn:aws:codebuild:us-west-2:709326302347:project/test&quot;,&quot;RoleArn&quot;=&quot;arn:aws:iam::709326302347:role/CodeBuild-Invoke-Role-For-Cloudwatch-Events&quot; --profile receiver --region us-west-2</pre><h4>Account B as Event Sender (494170752669)</h4><ol><li>Send events to Receiver AWS account</li></ol><p>a. Create <strong>assume-role-policy-document.json</strong></p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Principal&quot;: {<br>            &quot;Service&quot;: &quot;events.amazonaws.com&quot;<br>            },<br>            &quot;Action&quot;: &quot;sts:AssumeRole&quot;<br>        }<br>    ]<br>}</pre><p>b. Create the role, enter the following command</p><pre>aws iam create-role --role-name cross-account-codecommit-event-delivery-role --assume-role-policy-document file://assume-role-policy-document.json --profile sender</pre><p>c. Create a file named <strong>permission-policy.json</strong> with the following content</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Action&quot;: [<br>                &quot;events:PutEvents&quot;<br>            ],<br>            &quot;Resource&quot;: [<br>                &quot;arn:aws:events:us-west-2:709326302347:event-bus/default&quot;<br>            ]<br>        }<br>    ]<br>}</pre><p>d. Attach the policy to the role <strong>cross-account-codecommit-event-delivery-role</strong></p><pre>aws iam put-role-policy --role-name cross-account-codecommit-event-delivery-role --policy-name EventBusDeliveryRolePolicy --policy-document file://permission-policy.json --profile sender</pre><p>2. Create a rule that matches the event types to send from this sender account (494170752669) to the receiver account (709326302347).</p><pre>aws events put-rule --name &quot;CodeCommitEvents&quot; --event-pattern &quot;{\&quot;source\&quot;:[\&quot;aws.codecommit\&quot;],\&quot;detail-type\&quot;:[\&quot;CodeCommit Repository State Change\&quot;],\&quot;resources\&quot;:[\&quot;arn:aws:codecommit:us-west-2:494170752669:sample-repo\&quot;],\&quot;detail\&quot;:{\&quot;referenceType\&quot;:[\&quot;branch\&quot;],\&quot;referenceName\&quot;:[\&quot;master\&quot;]}}&quot; --role-arn &quot;arn:aws:iam::494170752669:role/cross-account-codecommit-event-delivery-role&quot; --profile sender</pre><p>3. Add the receiver account’s(709326302347) default event bus as the target of the rule.</p><pre>aws events put-targets --rule CodeCommitEvents --targets &quot;Id&quot;=&quot;1&quot;,&quot;Arn&quot;=&quot;arn:aws:events:us-west-2:709326302347:event-bus/default&quot;,&quot;RoleArn&quot;=&quot;arn:aws:iam::494170752669:role/cross-account-codecommit-event-delivery-role&quot; --profile sender</pre><p>To see all the rules in place, head to the “Buses” section within Amazon EventBridge, where you’ll find them listed in both the Sender and Receiver Accounts.</p><p>That’s it!. The event-driven setup is ready, and you’re free to explore and experiment with it.</p><p><strong>Reference</strong></p><p><a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/triggering.html"><em>https://docs.aws.amazon.com/codepipeline/latest/userguide/triggering.html</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f129d47276a5" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/cross-account-event-delivery-with-aws-eventbridge-and-codecommit-f129d47276a5">Cross-Account Event Delivery with AWS EventBridge and CodeCommit</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Trigger for AWS CodeBuild using AWS EventBridge]]></title>
            <link>https://rajithv.medium.com/build-trigger-for-aws-codebuild-using-amazon-event-bridge-ab884d429096?source=rss-1962bc71ad0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab884d429096</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws-codebuild]]></category>
            <category><![CDATA[aws-codecommit]]></category>
            <category><![CDATA[amazon-eventbridge]]></category>
            <dc:creator><![CDATA[Rajith]]></dc:creator>
            <pubDate>Sat, 20 Aug 2022 16:29:58 GMT</pubDate>
            <atom:updated>2024-02-29T09:05:48.474Z</atom:updated>
            <content:encoded><![CDATA[<h4>Let’s use Amazon EventBridge to enable the build trigger on a Codebuild project in response to the status change on the CodeCommit repository. This post discusses how to start a build on CodeBuild Project automatically when the code commits or merge happens on the CodeCommit repository.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*xZegBuvhIO8sxbXR7J1jkA.jpeg" /></figure><p><strong>Prerequisites</strong></p><ul><li>A Codebuild project and, its source should be a CodeCommit repository. The branch I have taken here is develop.let’s assume the CodeBuild Project Name is TestTrigger and CodeCommit repository name is TestRepositoryin this tutorial.</li></ul><p>Create the trust policy that allows CloudWatch Events to assume the service role. Name the trust policy TrustPolicyForCWE.json</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Principal&quot;: {<br>                &quot;Service&quot;: &quot;events.amazonaws.com&quot;<br>            },<br>            &quot;Action&quot;: &quot;sts:AssumeRole&quot;<br>        }<br>    ]<br>}</pre><p>Use the following command to create the <strong>CodeBuild-Invoke-Role-For-Cloudwatch-Events</strong> role and attach the trust policy.</p><pre>aws iam create-role --role-name CodeBuild-Invoke-Role-For-Cloudwatch-Events --assume-role-policy-document file://TrustPolicyForCWE.json</pre><p>Create the permissions policy JSON, as shown below, for the CodeBuild project named TestTrigger. Replace &lt;CodeBuildProjectARN&gt; with your CodeBuild Project ARN. Name the permissions policy <strong>PermissionsPolicyforCWE.json</strong></p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Action&quot;: [<br>                &quot;codebuild:StartBuild&quot;<br>            ],<br>            &quot;Resource&quot;: [<br>                &quot;&lt;CodeBuildProjectARN&gt;&quot;<br>            ]<br>        }<br>    ]<br>}</pre><p>Here, let’s assume the CodeBuild Project ARN is arn:aws:codebuild:us-west-2:123456789123:project/TestTrigger</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Action&quot;: [<br>                &quot;codebuild:StartBuild&quot;<br>            ],<br>            &quot;Resource&quot;: [<br>                &quot;arn:aws:codebuild:us-west-2:123456789123:project/TestTrigger&quot;<br>            ]<br>        }<br>    ]<br>}</pre><p>Use the following command to attach the <strong>CodeBuild-Permissions-Policy-for-CWE</strong> permissions policy to the <strong>CodeBuild-Invoke-Role-For-Cloudwatch-Events</strong> role. Adding this policy to the role creates permissions for CloudWatch Events.</p><pre>aws iam put-role-policy --role-name CodeBuild-Invoke-Role-For-Cloudwatch-Events --policy-name CodeBuild-Permissions-Policy-For-CWE --policy-document file://PermissionsPolicyforCWE.json</pre><p>Call the put-rule command and include the --name, --event-pattern , and--role-arn parameters.</p><pre>aws events put-rule --name &quot;<strong>CodeBuildTriggerRule</strong>&quot; --event-pattern &quot;{\&quot;source\&quot;:[\&quot;aws.codecommit\&quot;],\&quot;detail-type\&quot;:[\&quot;<strong>CodeCommit Repository State Change</strong>\&quot;],\&quot;resources\&quot;:[\&quot;arn:aws:codecommit:us-west-2:<strong>123456789123</strong>:<strong>TestRepository</strong>\&quot;],\&quot;detail\&quot;:{\&quot;referenceType\&quot;:[\&quot;branch\&quot;],\&quot;referenceName\&quot;:[\&quot;<strong>develop</strong>\&quot;]}}&quot; --role-arn &quot;arn:aws:iam::<strong>123456789123</strong>:role/<strong>CodeBuild-Invoke-Role-For-Cloudwatch-Events</strong>&quot;</pre><p>To add CodeBuild Project as a target, call the put-targets command and include the following parameters:</p><ul><li>The --rule parameter is used with the rule_name you created by using put-rule.</li><li>The --targets parameter is used with the list Id of the target in the list of targets and the ARN of the Codebuild target.</li></ul><pre>aws events put-targets --rule <strong>CodeBuildTriggerRule</strong> --targets &quot;Id&quot;=&quot;1&quot;,&quot;Arn&quot;=&quot;arn:aws:codebuild:us-west-2:<strong>123456789123</strong>:project/TestTrigger&quot;,&quot;RoleArn&quot;=&quot;arn:aws:iam::<strong>123456789123</strong>:role/<strong>CodeBuild-Invoke-Role-For-Cloudwatch-Events</strong>&quot;</pre><p>The build process is now automated for every commit or merge occurring on the develop branch.</p><p><strong>Reference</strong></p><ul><li><a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-trigger-source-repo-changes-cli.html">Create a CloudWatch Events rule for a CodeCommit source (CLI)</a></li><li><a href="https://docs.aws.amazon.com/codecommit/latest/userguide/monitoring-events.html">Monitoring CodeCommit events in Amazon EventBridge and Amazon CloudWatch Events</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab884d429096" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Secret Manager Integration with EKS]]></title>
            <link>https://towardsaws.com/aws-secret-manager-on-eks-e050b38bc77d?source=rss-1962bc71ad0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/e050b38bc77d</guid>
            <category><![CDATA[aws-secrets-manager]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[aws-eks]]></category>
            <dc:creator><![CDATA[Rajith]]></dc:creator>
            <pubDate>Fri, 19 Aug 2022 05:02:06 GMT</pubDate>
            <atom:updated>2023-01-05T16:58:19.923Z</atom:updated>
            <content:encoded><![CDATA[<h4>In this post, let’s discuss how to create secrets using Secret Manager and how to mount the secrets to the EKS pods using the AWS Secrets CSI driver Provider.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*HKZ0wXSivppcJY0hw19mqg.jpeg" /></figure><p>We can make parameters stored in Parameter Store and secrets stored in Secrets Manager appear as files mounted in Kubernetes pods by using the AWS provider for the Secrets Store CSI Driver.</p><p>With the AWS Secrets and Configuration Provider (ASCP), we can store and manage the secrets in Secrets Manager and then retrieve them through the workloads running on Amazon EKS.</p><p>We can restrict access to the secrets from the EKS pods using IAM roles and policies. The pod identification will be retrieved by the ASCP and then exchanged for an IAM role. ASCP assumes the pod’s IAM role, and then it can obtain secrets from the Secrets Manager.</p><p>Follow the steps below to install the Secret Store CSI Driver and ASCP</p><ol><li>Install the Secrets Store CSI Driver</li></ol><pre>helm repo add secrets-store-csi-driver https://kubernetes-sigs.github.io/secrets-store-csi-driver/charts </pre><pre>helm install -n kube-system csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver --set enableSecretRotation=true --set syncSecret.enabled=true --version 1.2.4</pre><p>2. Install ASCP</p><pre>helm repo add aws-secrets-manager https://aws.github.io/secrets-store-csi-driver-provider-aws</pre><pre>helm install -n kube-system secrets-provider-aws aws-secrets-manager/secrets-store-csi-driver-provider-aws</pre><p><strong>Let’s see how to create and mount a secret in an EKS pod.</strong></p><ol><li>Set the AWS Region and the name of your cluster as shell variables so you can use them in bash commands.</li></ol><pre>REGION=us-west-2<br>CLUSTERNAME=test-cluster</pre><p>2. Create a secret and note down the <em>&lt;SECRETARN&gt;</em></p><pre>aws --region &quot;$REGION&quot; secretsmanager  create-secret --name test-secret --secret-string &#39;{&quot;username&quot;:&quot;rajith&quot;, &quot;password&quot;:&quot;Q7VRTDyM4qRZ&quot;}&#39;</pre><p>3. Create a resource policy for the pod that limits its access to the secret you created in the previous step. For <em>&lt;SECRETARN&gt;</em>, use the ARN of the secret. Save the policy ARN in a shell variable.</p><pre>POLICY_ARN=$(aws --region &quot;$REGION&quot; --query Policy.Arn --output text iam create-policy --policy-name eks-deployment-policy --policy-document &#39;{     &quot;Version&quot;: &quot;2012-10-17&quot;,     &quot;Statement&quot;: [ {         &quot;Effect&quot;: &quot;Allow&quot;,         &quot;Action&quot;: [&quot;secretsmanager:GetSecretValue&quot;, &quot;secretsmanager:DescribeSecret&quot;],         &quot;Resource&quot;: [&quot;<em>&lt;SECRETARN&gt;</em>&quot;]     } ] }&#39;)</pre><p>4. Create an IAM OIDC provider for the cluster, skip this step if you already have one.</p><pre>eksctl utils associate-iam-oidc-provider --region=&quot;$REGION&quot; --cluster=&quot;$CLUSTERNAME&quot; --approve # Only run this once</pre><p>5. Create the service account that the pod uses and link the resource policy we have created in step 3. Here, I use the service account name <em>eks-deployment-sa</em> for this tutorial.</p><pre>eksctl create iamserviceaccount --name eks-deployment-sa --region=&quot;$REGION&quot; --cluster &quot;$CLUSTERNAME&quot; --attach-policy-arn &quot;$POLICY_ARN&quot; --approve --override-existing-serviceaccounts</pre><p>6. Create the SecretProviderClass manifest to specify which secret to mount in the pod.</p><p><em>Example-SecretProviderClass.yaml</em></p><pre>apiVersion: secrets-store.csi.x-k8s.io/v1<br>kind: SecretProviderClass<br>metadata:<br>  name: eks-test-secret<br>spec:<br>  provider: aws<br>  secretObjects:<br>  - secretName: test-secret<br>    type: Opaque<br>    data: <br>    - objectName: username <br>      key: username<br>    - objectName: password <br>      key: password<br>  parameters:<br>    objects: |<br>        - objectName: &quot;test-secret&quot;<br>          objectType: &quot;secretsmanager&quot;<br>          jmesPath:<br>            - path: &quot;username&quot;<br>              objectAlias: &quot;username&quot;            <br>            - path: &quot;password&quot;<br>              objectAlias: &quot;password&quot;</pre><blockquote><em>Note: The </em><strong><em>objectName</em></strong><em> and </em><strong><em>objectAlias</em></strong><em> should be matching.</em></blockquote><p>7. Apply the SecretProviderClass manifest</p><pre>kubectl apply -f Example-SecretProviderClass.yaml</pre><p>8. Create a <em>ExampleDeployment.yaml</em> file to deploy a <em>Nginx pod</em>. The secret mount path within the pod is/mnt/secrets-store.</p><pre>kind: Service<br>apiVersion: v1<br>metadata:<br>  name: nginx-deployment<br>  labels:<br>    app: nginx<br>spec:<br>  selector:<br>    app: nginx<br>  ports:<br>    - protocol: TCP<br>      port: 80<br>      targetPort: 80<br>---<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: nginx-deployment<br>  labels:<br>    app: nginx<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      app: nginx<br>  template:<br>    metadata:<br>      labels:<br>        app: nginx<br>    spec:<br>      serviceAccountName: eks-deployment-sa<br>      volumes:<br>      - name: secrets-store-inline<br>        csi:<br>          driver: secrets-store.csi.k8s.io<br>          readOnly: true<br>          volumeAttributes:<br>            secretProviderClass: &quot;eks-test-secret&quot;<br>      containers:<br>      - name: nginx-deployment<br>        image: nginx<br>        ports:<br>        - containerPort: 80<br>        volumeMounts:<br>        - name: secrets-store-inline<br>          mountPath: &quot;/mnt/secrets-store&quot;<br>          readOnly: true<br>        env:<br>        - name: username<br>          valueFrom:<br>            secretKeyRef:<br>              name: test-secret <br>              key: username<br>        - name: password<br>          valueFrom:<br>            secretKeyRef:<br>              name: test-secret<br>              key: password</pre><p>9. Apply the deployment manifest</p><pre>kubectl apply -f ExampleDeployment.yaml</pre><p>10. After applying this manifest, we <em>should</em> be able to get our AWS Secret’s content directly from the env var username and password</p><pre>kubectl exec -it &lt;NAME OF THE POD&gt; -- env | grep username<br>kubectl exec -it &lt;NAME OF THE POD&gt; -- env | grep password</pre><p><strong>Reference</strong></p><ul><li><a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/integrating_csi_driver_tutorial.html">Tutorial: Create and mount a secret in an Amazon EKS pod</a></li><li><a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/integrating_csi_driver.html#integrating_csi_driver_install">Use AWS Secrets Manager secrets in Amazon Elastic Kubernetes Service</a></li><li><a href="https://secrets-store-csi-driver.sigs.k8s.io/topics/sync-as-kubernetes-secret.html">Sync as Kubernetes Secret</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e050b38bc77d" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/aws-secret-manager-on-eks-e050b38bc77d">AWS Secret Manager Integration with EKS</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Datadog vs Grafana vs AWS CloudWatch]]></title>
            <link>https://medium.com/innovation-incubator/datadog-vs-grafana-vs-aws-cloudwatch-ad9d6063d55c?source=rss-1962bc71ad0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad9d6063d55c</guid>
            <category><![CDATA[comparison]]></category>
            <category><![CDATA[datadog]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[cloudwatch]]></category>
            <category><![CDATA[monitoring-tools]]></category>
            <dc:creator><![CDATA[Rajith]]></dc:creator>
            <pubDate>Mon, 04 Apr 2022 07:38:51 GMT</pubDate>
            <atom:updated>2022-04-04T07:38:51.745Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*_NQWfwleZj2-LAn76Hm2AQ.png" /></figure><p>Today, enterprises are choosing to operate large numbers of servers both in the cloud and in their data centers to meet the ever-increasing demand. As organizations adopt more cloud-native technologies and IT infrastructure is becoming increasingly distributed, organizations must align business objectives and end-user experience with the availability and performance of the IT infrastructure. This shift requires infrastructure monitoring to ensure all our components work together across cloud environments, operating systems, storage, servers, virtualized systems, etc. In this post, we’ll explore the three best monitoring tools available.</p><p><strong>List of tools we will compare:</strong></p><ul><li>Datadog</li><li>AWS CloudWatch</li><li>Grafana</li></ul><h3>Datadog</h3><p>Datadog is monitoring, security, and analytics platform for developers, IT operations teams, security engineers, and business users in the cloud age. It can perform effective monitoring of servers, tools, and databases.</p><p>It helps users see inside any stack, at any scale, any app, and anywhere. It has been one of the pioneering tools to have a focus on infrastructure monitoring. The perfect merger of monitoring app performance, infrastructure, logs, and user experience is what makes it special.</p><h3>Grafana</h3><p>Grafana allows us to query, visualize, alert on, and understand our metrics no matter where they are stored. Create, explore, and share beautiful dashboards with our team and foster a data-driven culture. Grafana is primarily used to visualize our time-series database data into meaningful charts from which we can draw insights. Grafana can be used to build an open-source stack for APM, time-series, and logs monitoring.</p><h3>AWS Cloudwatch</h3><p>Amazon CloudWatch is a monitoring and observability service built for DevOps engineers, developers, site reliability engineers (SREs), IT managers, and product owners. CloudWatch provides us with data and actionable insights to monitor our applications, respond to system-wide performance changes, and optimize resource utilization. CloudWatch collects monitoring and operational data in the form of logs, metrics, and events. We get a unified view of operational health and gain complete visibility of our AWS resources, applications, and services running on AWS and on-premises. We can use CloudWatch to detect anomalous behavior in our environments, set alarms, visualize logs and metrics side by side, take automated actions, troubleshoot issues, and discover insights to keep our applications running smoothly.</p><h3>Key Differences</h3><ol><li><strong>Getting started with</strong></li></ol><p>If we are using AWS services, then CloudWatch already offers a default console to monitor the services we use in our AWS account.</p><p>For using Datadog, we first need to sign up for a Datadog account. Once we sign up, we can install Datadog agents on our hosts. The Datadog agent reports metrics and events from our host to Datadog.</p><p>For getting started with Grafana, we first need to install it. Once Grafana is installed we can connect it to our desired data source and start visualizing the data.</p><p>Some of the popular data sources that Grafana supports are:</p><ul><li>Prometheus</li><li>Jaeger</li><li>Zipkin</li><li>AWS CloudWatch</li><li>Graphite</li><li>Azure Monitor</li></ul><p><strong>2. Multi-cloud support</strong></p><p>Datadog supports multi-cloud monitoring like AWS, Azure, and Google cloud services.</p><p>CloudWatch is used to monitor AWS resources and applications that run on it. We can use the CloudWatch Logs agent installer on an instance to install and configure the CloudWatch Logs agent. After installation is complete, logs automatically flow from the instance to the log stream we create while installing the agent. The agent confirms that it has started and it stays running until we disable it.</p><p>Grafana supports multi-cloud monitoring with the help of plugins.</p><p><strong>3. Pricing</strong></p><p>With Amazon CloudWatch, there is no up-front commitment or minimum fee; we simply pay for what we use. We will be charged at the end of the month for our usage. CloudWatch provides a free tier that we can explore. CloudWatch’s paid tier called EC2 detailed monitoring starts at $2.10 per instance per month(assuming 7 metrics per instance). The cost also depends on the number of metrics sent and is divided into multiple tiers. The first 10k metrics are charged at $0.30 per metric per month.</p><p>Datadog is an expensive enterprise monitoring tool with many different pricing tiers that vary on our use cases. For example, infrastructure enterprise monitoring starts at $23 per host per month while its APM sand continuous profiler starts at $40 per host per month.</p><p>The open-source version of Grafana comes for free, although we do need to account for the cost of data storage and networking. GrafanaLabs offers paid cloud plans starting at $49 per month, which scale up based on usage.</p><p><strong>4. Dashboard</strong></p><p>It offers better visibility and UI experience. Since the Datadog interactions with the CloudWatch are through the CloudWatch API, so it exposes more metrics</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UgbI5-XTCt9frKbP.png" /><figcaption>By default, this is the landing page after we login to Datadog</figcaption></figure><p>CloudWatch enables us to create custom dashboards with the metrics and logs. Some features are missing like, grouping servers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KMn1Tumi4J8hjRpf.png" /><figcaption>CloudWatch dashboard</figcaption></figure><p>Grafana also offers better Visibility and UI experience for the end-users. Custom dashboard creation is a bit complex in Grafana.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qk4EzGuLTwshvrBL.png" /><figcaption>Grafana dashboard example</figcaption></figure><p><strong>5. Alerts and notification management</strong></p><p>Monitoring all of our infrastructures in one place wouldn’t be complete without the ability to know when critical changes are occurring.</p><p>Datadog integrates with partners like PagerDuty to ensure our on-call team members can be added to incidents and appropriately notified. Datadog also supports email and slack integration for notification.</p><p>AWS Cloudwatch has Alarms for alerts and several actions can be taken as part of this Alarm. For example, when there is high CPU or memory usage in web servers we can initiate an alarm to trigger autoscaling. Alarms also come with notification provision via email and SMS, it can also be integrated with PagerDuty for call alerts.</p><p>In Grafana, when an alert changes state, it sends out notifications. Each alert rule can have multiple notifications. To add a notification to an alert rule we first need to add and configure a notification channel (can be email, PagerDuty, or other integration)</p><p><strong>6. Log management</strong></p><p>Logging the important parts of our system’s operations is crucial for maintaining infrastructure health. Modern infrastructure can generate thousands of log events per minute. In this situation, we need to choose which logs to send to a log management solution, and which logs to archive. Filtering our logs before sending them, however, may lead to gaps in coverage or the accidental removal of valuable data.</p><p>Datadog Log Management, also referred to as Datadog logs or logging removes these limitations by decoupling log ingestion from indexing. This enables us to cost-effectively collect, process, archive, explore, and monitor all of our logs without limitations, also known as Logging without Limits.</p><p>CloudWatch Logs enables us to centralize the logs from all of our systems, applications, and AWS services that we use, in a single, highly scalable service. we can then easily view them, search them for specific error codes or patterns, filter them based on specific fields, or archive them securely for future analysis. CloudWatch Logs enables us to see all of our logs, regardless of their source, as a single and consistent flow of events ordered by time, and we can query them and sort them based on other dimensions, group them by specific fields, create custom computations with a powerful query language, and visualize log data in dashboards.</p><p>Grafana Loki is a horizontally scalable, highly available, multi-tenant log aggregation system inspired by Prometheus. It is designed to be very cost-effective and easy to operate. It does not index the contents of the logs, but rather a set of labels for each log stream.</p><p><strong>7. Metrics management</strong></p><p>CloudWatch Metrics are data about the performance of our systems. By default, many services provide free metrics for resources (such as Amazon EC2 instances, Amazon EBS volumes, and Amazon RDS DB instances). we can also enable detailed monitoring for some resources, such as our Amazon EC2 instances, or publish our application metrics. Amazon CloudWatch can load all the metrics in our account (both AWS resource metrics and application metrics that we provide) for search, graphing, and alarms.</p><p>In Datadog, metric data is ingested and stored as data points with a value and timestamp. A sequence of data points is stored as a time series. Any metrics with fractions of a second timestamp are rounded to the nearest second. If any points have the same timestamp, the latest point overwrites the previous ones. Metrics that track system health come automatically through Datadog’s integrations with more than 500 services. We can also track metrics that are specific to our business — also known as custom metrics. We can track things such as the number of user logins or user cart sizes to the frequency of our team’s code commits. In addition, metrics can help us adjust the scale of our environment to meet the demand from our customers. Knowing exactly how much we need to consume in resources can help us save money or improve performance.</p><p>Grafana Metrics are stored in a time-series database (TSDB), like Prometheus, by recording a metric and pairing that entry with a time stamp. Each TSDB uses a slightly different data model, but all combine these two aspects and Grafana Cloud can accept their different metrics formats for visualization. Grafana and Grafana Cloud offer a variety of visualizations to suit different use cases.</p><p><strong>8. Compliances</strong></p><p>Health organizations need to adhere to HIPAA compliance requirements for application logs as they grow and scale. Audit logs must be safely collected from every service within an organization’s system and stored for six years in case they are needed for an internal or HHS investigation. With Datadog’s HIPAA-compliant log management and security solutions, organizations can capture and store audit logs on a long-term basis, leverage their logs to verify their level of compliance with other HIPAA provisions, and automatically detect security threats in real-time.</p><p>Third-party auditors assess the security and compliance of Amazon CloudWatch as part of multiple AWS compliance programs. These include SOC, PCI, FedRAMP, HIPAA, and others. Amazon CloudWatch itself does not produce, store, or transmit PHI. Customers can monitor CloudWatch API calls with AWS CloudTrail.</p><p>Grafana Labs maintains PCI Compliance through third-party approved scanning vendors. Its also Certified through an independent third-party audit with A-LIGN for ISO 27001.</p><p><strong>9. Support</strong></p><p>Datadog offers a support platform at <a href="http://help.datadoghq.com/">help.datadoghq.com</a> and live-chat with Datadog Support Team on any business day between the hours of 10:00 and 19:00 ET. They also have a slack channel of community members and Datadog staff to discuss the latest Datadog announcements and features, get assistance with questions we have, and more</p><p>AWS Support gives customers help on technical issues and additional guidance to operate their infrastructures in the cloud. Customers can choose a tier that meets their specific requirements, continuing the AWS tradition of providing the building blocks of success without bundling or long-term commitments. AWS Support is one-on-one, fast-response support from experienced technical support engineers. The service helps customers use AWS’s products and features. With pay-by-the-month pricing and unlimited support cases, customers are freed from long-term commitments. Customers with operational issues or technical questions can contact a team of support engineers and receive predictable response times and personalized support.</p><p>There are differing types of Grafana Cloud account options, including a free tier. Each has a different feature set and different levels of support provided. There are 3 types of Grafana Cloud accounts Free, Pro and Advanced. Support is limited to documentation set and queries in the public community forums in the Free account, whereas email support is included in the Pro account. In Advanced support both email support and call support is included</p><p><strong>10. Serverless APM Monitoring</strong></p><p>Datadog gives us the ability to view all of those metrics, logs, and traces from our serverless applications in one place. With the help of a lambda function called Datadog Forwarder, Datadog can export custom matrices from Lambda. AWS CloudWatch provides effective Serverless APM monitoring with the help of Amazon X-Ray. Prebuilt dashboards are available in Grafana for serverless monitoring. We can also create custom dashboards</p><h3>Evaluation Based Our Organizational Needs</h3><p>We plan to host the infra and the application in the AWS Cloud environment. The following image shows the scoring done based on some evaluation criteria as per our organizational needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*ngg8BnorG2tX2mqxb6scXQ.png" /></figure><p>During the assessment process<strong>,</strong> we defined two main criteria<strong>:</strong></p><ul><li>Value</li><li>Ability to Execute</li></ul><p>Value is nothing but the combination of Functional Capabilities and Non-Functional capabilities. Ability to Execute stands for some general properties which include the ability to integrate, the market adoption, install-base, and pricing.</p><p>The score is nothing but the value assigned to rate each product feature. The score includes the value from 0–5.</p><p>Here we assume the weights in the following way.</p><ul><li>Value-50%</li><li>Functional Capabilities-50%</li><li>Non-Functional Capabilities-50%</li><li>Ability to Execute-50%</li><li>Integration-75%</li><li>Market Adoption-25%</li></ul><p>We can choose the most suitable tool based on the highest aggregate Value and the Ability to Execute.</p><h3>Conclusion</h3><p>The comparative study shows that no tool can be said to be perfect. We have to 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, dashboards .. as it already has preconfigured configurations for this. If we are planning low-cost monitoring It would be better to go for Grafana as it’s open-source and free. Datadog is compatible with many infra but its price is variable and usually determined by the number of agents/hosts installed on our system; we also have to purchase each feature individually. AWS CloudWatch can satisfy almost all monitoring needs. It does require the installation of a plugin or agent in most cases of CloudWatch. Also, the pay-as-you-go concept provides this at a low cost. Each tool can be leveraged depending on its audience, pricing, and ultimate application.</p><h3>Reference</h3><ol><li><a href="https://aws.amazon.com/cloudwatch/features/">https://aws.amazon.com/cloudwatch/features/</a></li><li><a href="https://www.datadoghq.com/product/">https://www.datadoghq.com/product/</a></li><li><a href="https://grafana.com/oss/grafana/">https://grafana.com/oss/grafana/</a></li></ol><p><strong>Co-Authors:</strong> <a href="https://medium.com/u/9f3dfa676374">Aaron</a> <a href="https://medium.com/u/b6da988055dc">Anil Augustine Chalissery</a> <a href="https://medium.com/u/1b21153322de">Subash</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad9d6063d55c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/innovation-incubator/datadog-vs-grafana-vs-aws-cloudwatch-ad9d6063d55c">Datadog vs Grafana vs AWS CloudWatch</a> was originally published in <a href="https://medium.com/innovation-incubator">Innovation Incubator</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>