<?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 Wiwit Aryadi on Medium]]></title>
        <description><![CDATA[Stories by Wiwit Aryadi on Medium]]></description>
        <link>https://medium.com/@aryadiwwt?source=rss-cdb87cae66d7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DD8lkKPF-oUpRuMCXUXGFQ.jpeg</url>
            <title>Stories by Wiwit Aryadi on Medium</title>
            <link>https://medium.com/@aryadiwwt?source=rss-cdb87cae66d7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 12:21:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aryadiwwt/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[CloudSQL Export (GCP)]]></title>
            <link>https://aryadiwwt.medium.com/cloudsql-export-gcp-1602d75eace8?source=rss-cdb87cae66d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/1602d75eace8</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-sql]]></category>
            <dc:creator><![CDATA[Wiwit Aryadi]]></dc:creator>
            <pubDate>Sat, 23 Oct 2021 15:22:05 GMT</pubDate>
            <atom:updated>2021-10-23T15:33:20.167Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*AkVOZrDZhvOozyr3EwVgyw.png" /></figure><h3><strong>What is Google CloudSQL ?</strong></h3><p>CloudSQL is one of many services provided by Google Cloud Platform. Fully managed relational database service for MySQL, PostgreSQL, and SQL Server. Run the same relational databases you know with their rich extension collections, configuration flags and developer ecosystem, but without the hassle of self management. In this story i will go with postgresql instead. For more detail head over to <a href="https://cloud.google.com/sql">here</a>.</p><h3>The Story</h3><p>I want to dump my cloudsql database but in this case, i want use one of cloudsql feature that google provide, which is gcloud. Gcloud is tools and libraries for interacting with Google Cloud products and services and very useful for managing your workload or resource in Google Cloud Platform. With cloudSQL export and import feature you can dump your database and directly store to Google Cloud Storage ( Bucket ). before that you need several role permission in your service account as follow:</p><ul><li>Cloudsql admin role</li><li>Cloud Storage Object Writer</li></ul><h3>Prerequisite</h3><ul><li>Google Cloud Storage</li><li>Correct Service Account and Role</li></ul><p>Use this gcloud command to export your cloudsql database</p><pre>gcloud sql export sql &lt;your database id&gt; \<br>       --project &lt;your project&gt; \<br>       --verbosity &lt;info|warning|debug&gt; \<br>       -d &lt;your database to export&gt; \<br>       gs://&lt;your bucket&gt;/database/&lt;your db&gt;_db-$(date +%Y%m%d).sql  <br>       --offload</pre><p>offload flag above is used to prevent your exporting process do not bother another process running in your cloudsql. Please wait for exporting process finished. You can see the cloud sql operation when its unsuccessful or successful process in your cloudsql dashboard. Please also see your bucket to ensure the export process successfully.</p><h3>Links</h3><ul><li><a href="https://cloud.google.com/sdk">CloudSDK</a></li><li><a href="https://cloud.google.com/sql">CloudSQL</a></li><li><a href="https://cloud.google.com/iam/docs/service-accounts">ServiceAccounts</a></li><li><a href="https://cloud.google.com/sdk/gcloud/reference/sql/export/sql">GcloudExportSQL</a></li><li><a href="https://cloud.google.com/storage">GoogleCloudStorage</a></li></ul><p>Thank you for reading my story and hope you enjoy and get the insight. i know that many other way to dump your database, and this feature may only works in Google Cloud Platform Services. Please wait for CloudSQL Import in the next story.</p><p>Keep in touch on my <a href="https://www.linkedin.com/in/wiwitaryadi/">Linkedin</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1602d75eace8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cleanup Your Dangling Docker Images using Ansible]]></title>
            <link>https://aryadiwwt.medium.com/cleanup-your-dangling-docker-images-using-ansible-fbaa1ce2c978?source=rss-cdb87cae66d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbaa1ce2c978</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Wiwit Aryadi]]></dc:creator>
            <pubDate>Wed, 03 Mar 2021 11:43:15 GMT</pubDate>
            <atom:updated>2021-10-23T15:35:35.993Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*Z2N3YdEpP4FqtIyawcHaZw.png" /></figure><h3>What is Docker ?</h3><p><strong>Docker</strong> is an open-source software designed to facilitate and simplify application development. It is a set of platform-as-a-service products that create isolated virtualized environments for building, deploying, and testing applications. for more detail please visit docker official <a href="https://docs.docker.com/">documentation</a>.</p><h3>What is Docker image?</h3><p><strong>A Docker image</strong> is an immutable (unchangeable) file that contains the source code, libraries, dependencies, tools, and other files needed for an application to run.</p><p>Due to their read-only quality, these images are sometimes referred to as snapshots. They represent an application and its virtual environment at a specific point in time. This consistency is one of the great features of Docker. It allows developers to test and experiment software in stable, uniform conditions.</p><h3>Case</h3><p>Sometimes we have several dangling images in developmet or staging environment and consume your disk space and become not eficient for disk consumption. although you have big amount of disk size we have to optimize disk consumption. we can delete the dangling image manually with command docker rmi &lt;image-id&gt; but how if you have many server that running docker container , let say 10 server or more. it will take much time to delete image one by one. ssh to server A and continue to server B and so on.</p><h3>Solution</h3><p>In this article we will use automation tools namely ansible, one of several solutions out there, i chose ansible because it was powerfull for me and no need to install agent on remote machine like chef or puppet.</p><p><strong>Prerequisite:</strong></p><ul><li>Ansible Installed on your local or virtual machine. or</li><li>Ansible tower (AWX)</li></ul><p>if the pre requisite has not been installed, you can refer to <a href="https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html">this</a> site.</p><p>Here are we will make a very simple ansible playbook, see the example below:</p><pre>---<br><br>- hosts: &lt;your remote host&gt;<br>  gather_facts: yes<br>  tasks:<br>    - name: test connection<br>      ping:<br>    <br>    - name: cleanup dangling images<br>      shell: |<br>        oldimage=`docker images | grep &#39;&lt;none&gt;&#39; | awk &#39;{print $3}&#39;`<br>        if [ -z &quot;$oldimage&quot; ]<br>        then<br>        echo &quot;There is no dangling images found!&quot;<br>        else<br>        docker rmi ${oldimage} -f<br>        fi<br><br>      ignore_errors: yes<br>      become: true</pre><p>save the playbook name you want, and execute the ansible playbook with command ansible-playbook &lt;playbook_name.yml&gt; .</p><p>and walla , your playbook is going to remove all dangling images in your remote hosts and your disk space is optimized. For your information if you use ansible tower like AWX you can scheduled the ansible playbook template and you can save your time to do another task without worried about disk fills up quickly. Please refer to <a href="https://github.com/ansible/awx/blob/devel/INSTALL.md">this</a> for installation or more info about ansible AWX.</p><p>This is only one of many solutions out there that you can use and better you read about ansible first for best practice.</p><p>Hope this article help you to optimized your disk space efficiently and any sugesstions is open for me and let’s grow up together.</p><p>Thanks and keep in touch on my <a href="https://www.linkedin.com/in/wiwitaryadi/">Linkedin</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbaa1ce2c978" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Alert Policies Creation tricks with json file on GCP]]></title>
            <link>https://aryadiwwt.medium.com/alert-policies-creation-tricks-with-json-file-on-gcp-61ba57255d9b?source=rss-cdb87cae66d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/61ba57255d9b</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[cloud-monitoring]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[cloud-services]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Wiwit Aryadi]]></dc:creator>
            <pubDate>Wed, 27 May 2020 14:38:11 GMT</pubDate>
            <atom:updated>2021-05-06T05:46:37.494Z</atom:updated>
            <content:encoded><![CDATA[<h3>Alert Policies Creation tricks with json on GCP</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*WU8U9i0SsCFbEWwxFe6m6A.png" /></figure><p>What is alert policies ?</p><p>An alerting policy describes a set of conditions that you want to monitor. These conditions might relate to the state of an unhealthy system or to resource consumption. For example, you might want to create a policy to monitor an uptime check, or to create a policy that monitors your Cloud Monitoring API usage. In addition to conditions, in an alerting policy, you can specify how you want to be notified and what documentation is included in that notification.</p><p>make alert policies is easy to do through the GCP console if you want to create in just one, then what if you want to create alert policies in many projects, of course, it will take quite a long time. Therefore Google provides the option to use json files. to make it easy to make alert policies I want to share tricks based on my experience.</p><h3>Prerequisite</h3><ul><li>Google Cloud SDK</li><li>Editor role or monitoring permission on GCP project</li></ul><h3><strong>First Step</strong></h3><p>First create an alert policy via the console, don’t forget to add notification channel. after the alert policies have been made, continue to create other alert policies using the json file via gcloud command. How do you create the json file? before you continue to the next step please set the project that will be alerted, run the command below :</p><pre>gcloud config set project &lt;your_project&gt;</pre><h3>Second step</h3><p>We can display the alert policies that we made earlier using the following command:</p><pre>gcloud alpha monitoring policies list — format=’json’</pre><h3>Output</h3><pre>{<br>        &quot;conditionThreshold&quot;: {<br>          &quot;aggregations&quot;: [<br>            {<br>              &quot;alignmentPeriod&quot;: &quot;60s&quot;,<br>              &quot;perSeriesAligner&quot;: &quot;ALIGN_MEAN&quot;<br>            }<br>          ],<br>          &quot;comparison&quot;: &quot;COMPARISON_GT&quot;,<br>          &quot;duration&quot;: &quot;60s&quot;,<br>          &quot;filter&quot;: &quot;metric.type=\&quot;cloudsql.googleapis.com/database/memory/utilization\&quot; resource.type=\&quot;cloudsql_database\&quot; resource.label.\&quot;database_id\&quot;=\&quot;&lt;your_database_id&gt;\&quot;&quot;,<br>          &quot;thresholdValue&quot;: 0.75,<br>          &quot;trigger&quot;: {<br>            &quot;count&quot;: 1<br>          }<br>        },<br>        &quot;displayName&quot;: &quot;Cloud SQL - memory utilization above 75%&quot;,<br>        &quot;name&quot;: &quot;projects/&lt;your_project&gt;/alertPolicies/9191455718124165982/conditions/9191455718124166408&quot;<br>      }<br>    ],<br>    &quot;creationRecord&quot;: {<br>      &quot;mutateTime&quot;: &quot;2020-05-08T03:50:36.694570650Z&quot;,<br>      &quot;mutatedBy&quot;: &quot;&quot;<br>    },<br>    &quot;displayName&quot;: &quot;Cloud SQL Master - Memory utilization above 75%&quot;,<br>    &quot;enabled&quot;: true,<br>    &quot;mutationRecord&quot;: {<br>      &quot;mutateTime&quot;: &quot;2020-05-08T03:50:36.694570650Z&quot;,<br>      &quot;mutatedBy&quot;: &quot;&quot;<br>    },<br>    &quot;name&quot;: &quot;projects/&lt;your_project&gt;/alertPolicies/9191455718124165982&quot;,<br>    &quot;notificationChannels&quot;: [<br>      &quot;projects/&lt;your_project&gt;/notificationChannels/3693895893837773047&quot;,<br>      &quot;projects/&lt;your_project&gt;/notificationChannels/10330418666955204760&quot;<br>    ]<br>  }<br>]</pre><h3>Third Step</h3><p>Copy and paste json file format above and delete mutation record, name and creation record block, you can modify display name and treshold first. After that you can adjust another required based on your project.</p><h3>Fourth Step</h3><p>The next step is, execute the command below to create alert policies using the json file:</p><pre>gcloud alpha monitoring policies create --policy-from-file=&quot;path-to-file/file-name.json&quot;</pre><p>After execution, review alert policies creation via google cloud platform via console. Congrats !! Now you can repeat the steps above to create alert policies in another GCP project. Using json file will saving your time to create alert policies in many GCP projects.</p><p>For more information about managing alert policies using json file on Google Cloud Platform see the following link below :</p><p><a href="https://cloud.google.com/monitoring/alerts/policies-in-json">Sample policies | Cloud Monitoring | Google Cloud</a></p><h3>Disclaimer</h3><p>There are still some other features not described here, so it is recommended to look at the official documentation of the Google Cloud Platform if there is an explanation that is not understood.</p><p>Keep Learning !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61ba57255d9b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prevent destroy when adding new Vms using terraform on GCP]]></title>
            <link>https://aryadiwwt.medium.com/prevent-destroy-when-adding-new-vms-using-terraform-on-gcp-e5d945b2feec?source=rss-cdb87cae66d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5d945b2feec</guid>
            <category><![CDATA[cloud-architecture]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cloud-engineering]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Wiwit Aryadi]]></dc:creator>
            <pubDate>Fri, 27 Mar 2020 12:23:39 GMT</pubDate>
            <atom:updated>2020-03-27T12:23:39.926Z</atom:updated>
            <content:encoded><![CDATA[<p>terraform at glance !</p><p>Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.</p><p>Configuration files describe to Terraform the components needed to run a single application or your entire datacenter. Terraform generates an execution plan describing what it will do to reach the desired state, and then executes it to build the described infrastructure. As the configuration changes, Terraform is able to determine what changed and create incremental execution plans which can be applied. See the official website <a href="https://www.terraform.io/intro/index.html">here</a> for more informations and documentation.</p><p>I’m very impressed when i’ve been used terraform for managing instances at Google Cloud Platform. it’s magic, you can create a multiple VMs at once. But I wanna share about an issue that cause when I perform terraform apply for adding new an instance and terraform would destroy an existing instance. Finally I found the solution for this, FYI this is my first story on medium. i apologize if I make a mistake.</p><p>First, go to your terraform and examine the file and add the new lifecycle block to your file :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/269/1*HxM__PniltaydOejFqtEuA.png" /></figure><p>after adding lifecycle block in your terraform file , modify the “count” in your terraform file, see example below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*sqhOvvrYdhgq9oql1-q5UA.png" /></figure><p>after changing the “count”, save your file and ready to perform terraform apply, but first run terraform plan to see modification of file you’ve been set before. type “yes” after applying and see what happen.? Yup you got erorr while creating an instances because terraform detect your existing instances and cannot destroy it. by default terraform will destroy your existing instances and behavior has been modified by you with lifecycle block.</p><p>You need add target flag while execution, see the example of execution below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*CW13mb9AgNCqS7qV3eWqsw.png" /></figure><h3><strong>Conclusion</strong></h3><p>This is very basic use of terraform and need more improvement, you need to understand the terraform fundamental first. See the reference <a href="https://www.terraform.io/docs/index.html">here</a> for documentation.</p><h3><strong>Disclaimer</strong></h3><p>I just wanna share my experience using terraform and struggling to solve this issue because I am beginner in cloud. Maybe a lot of best way to solve this out there, sorry about my grammatical written. Keep Learning !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5d945b2feec" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>