<?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 Amit Gupta on Medium]]></title>
        <description><![CDATA[Stories by Amit Gupta on Medium]]></description>
        <link>https://medium.com/@amitg2?source=rss-ef3bbdb8506e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*yANWEZkXjPu0qlSV.jpg</url>
            <title>Stories by Amit Gupta on Medium</title>
            <link>https://medium.com/@amitg2?source=rss-ef3bbdb8506e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 19:06:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amitg2/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[VPC — Virtual Private Cloud]]></title>
            <link>https://medium.com/@amitg2/vpc-virtual-private-cloud-b75e2bc7850e?source=rss-ef3bbdb8506e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b75e2bc7850e</guid>
            <dc:creator><![CDATA[Amit Gupta]]></dc:creator>
            <pubDate>Wed, 19 Oct 2022 14:01:11 GMT</pubDate>
            <atom:updated>2022-10-19T14:01:11.213Z</atom:updated>
            <content:encoded><![CDATA[<h3>VPC — Virtual Private Cloud</h3><p><strong>What is VPC in Google Cloud?</strong></p><figure><img alt="VPC" src="https://cdn-images-1.medium.com/max/1024/1*ea6NBlFqMd8SK0rE9838uQ.png" /><figcaption>Virtual Private Cloud</figcaption></figure><p>VPC is comprehensive Google managed networking Object. A VPC network on GCP allow user to create and manage its own private logically isolated network. Google cloud is organized in regions and Zones. With Google cloud user can provision Google resources connect them to each other and isolate them from one another in virtual private cloud. User can also define fine-grained networking policy within google cloud, google cloud and on premises or for other public cloud network.</p><p><strong>VPC Objects</strong></p><p>1. Projects</p><p>2. Network</p><p>a. <strong>Default Mode</strong>– 1 subnet per region, Default firewall rules, All ingress using RDP, SSH and ICMP allowed from within the default network for all protocol.</p><p>b. <strong>Auto Mode </strong>— Actually a default mode + set IP range for subnet with CIDR block of /20 can be expanded to /16</p><p>c. <strong>Custom Mode </strong>— Complete control of subnet region and expandable to any RFC 1918 size. An auto mode network can be converted to Custom one but not otherwise.</p><p>3. Subnetworks</p><p>4. Regions</p><p>5. Zone</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*R8Hew63h9Gj45RpwP8uScA.png" /></figure><p>VM1 and VM3 from network 1 can communicate with each other using internal IP only and taking advantage of google global network.</p><p>VM4 and VM5 communicate over internet with google edge router despite of in a same subnetwork</p><p>Subnet works Cross zone. Reserve 4 IP address in Primary Range — first 2 and last 2 IP address as (broadcast address). Single firewall rules apply to all VMs</p><p>1. New Subnet must not be overlapped to each other in the same VPC network in any region.</p><p>2. Should be inside RFC1918</p><p>3. Auto mode network Can be expanded but not shrink /20 to /16, but not larger</p><p>4. Avoid creating large subnet (could create CIRD range collision)</p><p><strong>Migrate of VM between Networks</strong></p><p>1. From Legacy network to VPC Network in same project.</p><p>2. From one VPC network to another VPC network in same project</p><p>3. From one subnet to another subnet in same VPC network.</p><p>4. From a service project network to Shared network of a Shared VPC host network.</p><p><strong>IP Address- </strong>Google works on 2 IP address Internal and External</p><p>Internal IP address — As soon as user create resources in VPN, DHCP automatically assigned internal IP address from the subnet range. It could be Ephemeral Ip address or Ephemeral (Custom) IP address or Reserve internal IP. So, Google basically creates a DNS name and assigned this IP to same name.</p><p>External IP — None or External IP address</p><p><strong>Routes:</strong> Map traffic to destination networks. A route is created when a network or Subnet is created</p><p><strong>VPC Network Best Practice</strong></p><p>1. Always create new VPC with required regions and IP address range instead of using the default one. After creating the custom VPC remove the default VPC.</p><p>2. Create a separate subnet for each tier of your application.</p><p>3. Always used a Load Balancer with SSL policies in front of all web servers. Provide global anycast Ip address and built-in protection to DDOS attack. SSL polices allow network admin to control. SSL encryption used to encrypt the data in transit</p><p>4. Private API access enable compute instance on VPC subnet to access API’s and services using an internal IP address rather than external IP address. No need to expose services to external world and decrease the security risk.</p><p>5. Ensure that every compute engine instance that access the Google API must have the matching internet gateway route set in GCP network. All GCP network have default gateway route unless manually deleted.</p><p><strong>Firewall Rules:</strong></p><p>Each VPC network in a project provides private communication between GCP compute resources deployed on the same network. GCP firewall rules provide an effective network protection and traffic control.</p><p>· Firewall rules are applied on a network that is why they are also global.</p><p>· Firewall rules provide the functionality for individual resource to control the ingress/egress traffic</p><p>· Connections are allowed or denied at instance level. Firewall rules protected the google resources from the unapproved connections</p><p>· By default, implied deny for all ingress, and allow for all egress.</p><p>· Firewall rules are stateful in nature. Allow bidirectional communication for the same established session. It means if connection is established the ingress and egress are allowed for same connection.</p><p>· On-premises resources can connect to VPC network either using IPsec VPN tunnel or Dedicated interconnect. GCP firewall rules can allow or deny the traffic communication.</p><p>· Firewall rules applies through all instance in a network apply to all instance of that network without tagging or mark the instance</p><p><strong>Firewall Rule Description: -</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*BKpJQNYStoXER84NQu7LZA.png" /></figure><p><strong>Default VPC is having 2 implied rules and 4 default rules</strong></p><p>Implied Rules: — Implied rules means rules that are available in all VPC network but not available to GCP console in the list of rules and cannot be change/delete. Default priority for both rules is 65535</p><p>1. Permits (allow) to all outgoing connection to any IP address</p><p>2. Block (deny) all incoming traffic.</p><p><strong>Default Rules: </strong>— Default priority 65534. Can be deleted/modify as available on GCP console under firewall rule list.</p><p>1. Default_allow_internal</p><p>2. Default_allow_ssh</p><p>3. Default_allow_rdp</p><p>4. Default_allow_icmp</p><p>Default Rules to Blocked Traffic on VPC Network</p><p>1. All GRE traffics for all source, all destination unless specify using protocol forwarding.</p><p>2. Any Protocol other than TCP/UDP/ICMP/AH/SCTP/IPIP</p><p>3. Egress traffic to TCP port 25 (SMTP) and 465,587 (SMTP over SSL/TLS)</p><p><strong>Best Practice (Firewall Rules)</strong></p><p>1. Apply model of least privileges. Always explicit allow only the traffic is necessary for application to communicate.</p><p>2. Minimize direct exposer to internet. Avoid creating allow firewall rules with source or destination range of Ip address (0.0.0.0/0).</p><p>3. Create a firewall rule to block all outbound traffic for all protocol and port with lowest priority. So that no protocol/port can be exposed accidently.</p><p>4. Always adopt a standard name. No format has been defined. So, decide on format and create the rules name accordingly.</p><p>e.g. DIRECTION — (ALLOW/DENY)-SERVICE-(TO/FROM)-LOCATION</p><p>5. Appling firewall rules considering service account instead of Tag based. Reason is that any user having compute instance admin rules can apply tag-based rules but for service account rules used should have explicit Cloud IM rights to be used.</p><p><strong>VPC Peering</strong></p><p>VPC Peering can provide connectivity/communication between 2 or more VPC network using non-overlapping ip address. Peer networks need not to be in same project or even in same organization. All VPC network and their firewall rules and routes are managed by the VPC network independently. 25 direct peer network can be created with single network.</p><p><strong>Advantage of Peered Network</strong></p><p>1. Decrease network latency as all resources are accessible through internal IP access in peered network.</p><p>2. Decrease network cost as only regular pricing is applied only and no external bandwidth egress charges even resources are in the same zone. Due to network peering all services using internal IP access to access the resource.</p><p>3. Increase Security as organization need not to be exposed service to external world if they are not related to outside word and deployed on different/multiple networks.</p><p><strong>Shared VPC</strong></p><p>First designated a project as Host Project (VPC network as Shared VPC Network) and then connect all other networks with this host project (shared VPC network). Shared VPC use to connect projects in the same organization only.</p><p><strong>GCP connection from On Premise</strong></p><p><strong>Dedicated Interconnect and Partner Interconnect</strong></p><p>1. both provide low latency highly available dedicated connections.</p><p>2. Cloud connection provide RSC1918 communication which provide access to internal and private IP access to both network.</p><p><strong>Dedicated Interconnect -</strong></p><p>1. Provide connectivity directly to GCP VPC network and on-premise network</p><p>2. Connection should have minimum 10 GBS of speed.</p><p>3. If more then 10 GBPS is required, then multiple connection can be setup</p><p>4. Dedicated connection requires routing equipment in a Google co-location facility that supports the region which user wants to connect.</p><p>5. Once everything setup then traffic flow between network only without going on Public Internet.</p><p><strong>Partner Interconnect –</strong></p><p>1. If there is no co-location facility is available in Google to create dedicated interconnect, then Partner interconnect can be established between Google VPC network and on-premises network.</p><p>2. In this scenario connection minimum requirement is to have 50MBPS and providers also have range of capacity options.</p><p>3. In Partner Interconnect all traffic flow directly between partner interconnect network without going to Public Internet.</p><p>4. The SLA is dependent on the type of connection and google will provide the SLA between Google and service providers only. End to end SLA connection would be dependent upon service providers.</p><p><strong>VPC Service Controls</strong></p><p>VPC service controls can reduce the risk of data exfiltration from GCP resources. Service controls creates a security perimeter around GCP managed resources and allow user to control the movement of data across the perimeter only.</p><p>1. VPC service controls enable broader context-based perimeter security, including controlling data egress across the perimeter. Also provide an additional layer of security defense in GCP apart from IAM (Granular Identity based access control).</p><p>2. Protect resources with a security perimeter with authorized VPC network using private google access with either Google Cloud or On-premises.</p><p>3. Also ensure clients with perimeter private access do not have access to unauthorized access to other resources outside perimeter.</p><p>4. Prevent data for being copied to unauthorized resource outside the perimeter.</p><p>5. Restrict Internet access to resources within perimeter using Allow list for IPv4 and IPv6 IP address ranges.</p><p><strong>Access Context Manager</strong></p><p>Access context manager tool is used to create fine grained attribute-based access policy for project and resources in GCP. Purpose of this tool is to define the desired rules and not policy enforcement.</p><p>1. Access Policy — Access Policy is a container for the Access levels. Single access policy can contain multiple access levels.</p><p>2. Access Level — It is a set of attributes and highly customizable (e.g. — High Trust, Medium Trust and Low Trust)</p><p>a. IP Address — define the ip range to allow or deny the access for source ip of orginating request. CIDR range can be used.</p><p>b. Device Type — ACM uses end point to get the information for source device, including OS and version. Access can be grant/deny based on this data</p><p>c. User Identity — Identity of specific entity can be mapped to this and permission can be provided based on this user Identity. Identity based accessed level can be created and managed using command line tool and not possible via GCP plateform.</p><p><strong>VPC Service Perimeter Configuration</strong></p><p>There are 4 stages on any VPC service perimeter configuration</p><p>1. Create an Access Policy</p><p>2. Secure resources with Service Perimeter</p><p>3. Set up private connectivity from VPC network</p><p>4. Grand Access from outside using access levels</p><p>Perimeter bridge can be used to communicate in hybrid cloud environment.</p><p><strong>VPC Flow Logs</strong></p><p>1. Record network flows send/received by VM instances</p><p>2. Use for network monitoring/forensic, real time security analysis and expense optimization</p><p>3. View in Cloud (Stackdriver) logging.</p><p>4. Flow logs can be exported to Bigquery/pub-sub etc.</p><p>5. Enable VPC flow logs means enable for all subnet also in the same VPC network.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b75e2bc7850e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Migration]]></title>
            <link>https://medium.com/@amitg2/cloud-migration-904c3e5fc872?source=rss-ef3bbdb8506e------2</link>
            <guid isPermaLink="false">https://medium.com/p/904c3e5fc872</guid>
            <category><![CDATA[cloud-migration]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[cloud-migration-strategy]]></category>
            <dc:creator><![CDATA[Amit Gupta]]></dc:creator>
            <pubDate>Mon, 27 Jun 2022 13:20:13 GMT</pubDate>
            <atom:updated>2022-06-27T13:20:13.683Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*lxBOtokZmKF2pMu2uLNMFA.png" /></figure><p>Cloud Migration is the need of an hour. Cloud Migration meaning is to define the process to migrate your application, data and other type of business components into any cloud environment without disturbing the user behavior. It is a continuous process to move and update the Customer application into cloud.</p><h3>Type of Cloud Migration</h3><p>1. On-premises to any cloud (IaaS, PaaS, SaaS)</p><p>2. Cloud to cloud</p><p>3. Reverse Cloud Migration — Cloud to on-premises</p><h3>Pros of Cloud Migration</h3><p>1. <strong>Flexibility (Availability) — </strong>Cloud Infrastructure supports high availability of an application. Infrastructure can be scale up and down based on traffic to meet the demand.</p><p>2. <strong>Scalability — </strong>Scalability is one of the important features in terms of infrastructure support. Nobody in this world can predict the infrastructure requirement for any application. You don’t need to buy the complete big scale infrastructure at first day. Cloud infrastructure gives the wings to the existing infrastructure so that they can be enhanced easily without impacting the works.</p><p>3. <strong>Agility — </strong>In today’s agility world nobody has time to wait. Cloud environment gives any application to go live in a minute. Even application modification, new version can be deployed easily without impacting the existing application or application downtime.</p><p>4. <strong>Productivity and Automation — </strong>One of the most important requirements to success in any business is to update the application and system. If application is available on cloud then application team is just focusing on development of the business logic and rest of the updates regarding the system and application API is managed by the cloud environment without any downtime. Cloud provider handle all the complexity of the infrastructure so that team can focus on the development work as well as how to grow the business only.</p><p>5. <strong>Security — </strong>All cloud providers understand the importance of customer data and application and that is the reason each one is having their own built in security features including cross-enterprise visibility, periodic updates, and security analytics. Most of the OWASP security top10 features handled by the in built security features.</p><p>6. <strong>Cost efficiency-Profitability — </strong>Mostly cloud works on pay per use so there is no need to invest in any infrastructure and pay only for what use. So, users capex money turns into opex one. Cloud help organization to decrease the hosting cost also as there is no need to invest the upfront cost on infrastructure.</p><p>7. <strong>Disaster Recovery — </strong>It is another important feature of using cloud. Dr is one of the most important and historically expensive (specifically for smaller size of business) features of any size of business. Cloud provides organize backup implementation and recovery solution that take less time and upfront investment.</p><p>8. <strong>Performance — </strong>Migration to cloud can improve the application performance and end user experience. Application hosted on cloud can easily increase the scale to serve more users or higher throughput.</p><p>9. <strong>Digital Experience (Mobility) </strong>— Users can access cloud application and data from anywhere. This is also known as digital transformation; it enables and provide users an improved experience from anywhere and provide them modern and flexible tools and application to use.</p><p>10. <strong>Secure Storage Options — </strong>Cloud provides highly secured storage options with minimal cost of usages and no upfront charges. This storage option can be easily scale up and down based on requirement without disturbing the application usage. This is an excellent option for the business with seasonal and periodic data storage requirement.</p><h3>Cloud Migration Process</h3><p>Cloud migration process is a step-by-step processing to upload a working application on any cloud environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*NCqEL8MvKC9TOOY9lbGmRQ.png" /></figure><p>1. <strong>Assess </strong>— This one is the most important aspect of cloud migration to assess the detailed requirement to move application into cloud. The best option to select the application which does not require any or minimal changes during the upload on cloud environment.</p><p>2. <strong>Pilot Testing (POC) </strong>— In this phase one component/form of the selected application move into the clod. And based on the post-migration performance of this form/component it is decided that weather the complete application can be moved to cloud or not. OR what all actions required to complete the migration of the same application.</p><p>3. <strong>Execution (Migrate Data and App) </strong>— After successful POC now it is decided whether first data needs to be migrated or application. In most of the cases it is suggested that first migrate the data always help and set the stage for application. But it is always better to take decision based on the application requirement.</p><p><strong>4.</strong> <strong>Optimize — </strong>Post migration this is one of the best features provide by cloud providers to use the different optimize strategies to give user a good experience on migrated application. Most common strategy is to reduce the size of static contents and use edge locations to save storage and bandwidth. These strategies are always based on the architecture of migrated application and user behaviors.</p><p><strong>5.</strong> <strong>Evidence (Verified Post Move Success) — </strong>Migration is not completed till the time it shows the return on investment on migrated application or the benefit of using Cloud instead of on-premises. So evidence is required to prove the benefits of cloud with pre-cloud and post-cloud performance of an application (technical and business) as well as cost effectiveness.</p><h3>Cloud Migration Strategies</h3><p>Broadly known as 6 R’s of migration</p><ol><li><strong>Re-Hosting (Lift and Shift) </strong>— This is the easiest strategies to migrate the application into cloud without doing any change in the existing application as<strong> IaaS</strong>. This approach is best suited for any organization with less or no knowledge of cloud. User just need to re-host the complete app with data on cloud without doing any change and use cloud as Infrastructure as a service. Good for application having a complex architecture, difficult to modify code.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UhGK2DRuhYB26E5s9ZeJ8Q.jpeg" /></figure><p>2. <strong>Re-Platforming (lift-tinker-and-shift) </strong>— In my point of view this is one of the best strategy for cloud novice for migration or the organization which just want to increase the trust into Cloud environment Once user select the application which best suited for cloud and easy to migrate, tweak and optimize the application/process/technology stack modernization to make better use of cloud tools and services (<strong>as PaaS</strong>) to achieve some tangible benefit without changing into the core architecture of application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y6y8DNP_wJ-yhJFwKsXO1A.jpeg" /></figure><p><strong>3. Re-Purchasing — </strong>Re-purchasing is another way of fast migration on cloud. Under this strategy user replace its existing application using SaaS based cloud native application tailored to business requirement. SaaS Cloud native application gets the application/existing data and package them into cloud-based product. This strategy can be good for HR, CRM or CMS application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dX3lDnRIeRoEvQ0R21YGYw.jpeg" /></figure><p>4. Re-Structuring — Re-Structuring or Re-Architect is one of the most expensive strategies in terms of cost as well as time. User will re-design the complete application architecture from scratch into cloud native application. New architecture covers all the business requirements and cater the features like performance, scalability, flexibility, security, optimization, and agility which are not possible to enhance with the existing application design and infrastructure. It is a time consuming and costly for any organization. But this strategy provides better result in terms of organization vision and goal towards Cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sHgppnlbeo6FaqTioRR3WQ.jpeg" /></figure><p><strong>5.</strong> <strong>Retire — </strong>Once user accessed the complete application portfolio for cloud migration and found that some application which are not important and useful as per the business requirement. Functional owner of the application may have asked all the important questions regarding the justification of the resources required for the same. The decision of retiring that application can be taken to save a lot of money for the business.</p><p><strong>6.</strong> <strong>Retain (Re-Visiting) — </strong>We should only migrate those application which benefitted to our business not all. Cloud migration decision should be based on cost, use and behavior of application i.e application with unique sensitive information or handle internal process of enterprise. We should migrate apps which help business to grow. Each component is having its own cost and benefits and without calculating this if without calculating these if we upload all components could cause serious damages to business finance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=904c3e5fc872" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GCP-Instance Group]]></title>
            <link>https://medium.com/@amitg2/gcp-instance-group-b61bb3edb90b?source=rss-ef3bbdb8506e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b61bb3edb90b</guid>
            <category><![CDATA[mig]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[managed-instance-group]]></category>
            <dc:creator><![CDATA[Amit Gupta]]></dc:creator>
            <pubDate>Fri, 03 Jun 2022 07:24:35 GMT</pubDate>
            <atom:updated>2022-06-03T07:24:35.143Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*fFAdZKihPVO2go_mKXyU2Q.png" /><figcaption>Instance Group</figcaption></figure><p><strong>Why Instance Group</strong></p><p>If there is a requirement to create a multiple VM’s in cloud for same type of machines type, OS type, memory size in a same VPC and also need to maintain a minimum number of instances which can be scale in and out any time based on certain rules.</p><p><strong>Instance Group:</strong></p><p>Group of instances managed as a single entity-Similar VM having same life cycle. Can be define in Region (for higher availability) as well as Zonal.</p><p>Two types of groups are available in GCP</p><p>1. <strong>Manage Instance group (MIG) — </strong>Identical VMs created using instance template <strong>— </strong>Auto Scaling, Auto Healing, and managed releases. Always Maintain certain numbers of instances. Support Rolling updates and Canary deployment. 2 types (1. Stateful MIG with database), (2 Stateless MIG)</p><p>2. <strong>Unmanaged Instance Group — </strong>Different configuration for VM in same group — No Auto healing and Auto scaling. Suitable for Heterogeneous Instances.</p><p><strong>Instance Template:</strong></p><p>Instance template is the base VM based on this MIG crates another VM. To create MIG user need to provide the reference instance template to generate the VM. The instance template defines the details which is required to create VM including VPC network and subnet. If no VPC network is provided, then Google will try to create the same in “default” network.</p><p><strong>Scenarios:</strong></p><p><strong>1.</strong> Stateless serving workload like web-based frontend app,</p><p><strong>2.</strong> Stateless batch processing, high performance, or high throughput application like image processing from queue.</p><p><strong>3.</strong> Stateful application like database, legacy application or long running batch processing app.</p><p><strong>MIG T</strong>ypes:</p><p>1. <strong>Zonal — </strong>Deploy multiple instances in a single zone only</p><p>2. <strong>Regional — </strong>Deploy multiple instances in a multiple zone across the same region (Max 2000 instances per regional group)</p><p><strong>MIG Benefits:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*7ej9Ya1t6qnYzFFV-q7Tzg.png" /></figure><p>Courtesy: <a href="https://cloud.google.com/compute/images/mig-overview.svg">Google Cloud Document</a></p><p><strong>Highly availability:</strong></p><p><strong>1.</strong> <strong>Keep VM instance running — If system stopped/crashed or deleted then it will automatically re-create the VM with same name and same templates</strong></p><p><strong>2.</strong> <strong>Application based Auto healing — </strong>App based auto healing check the application health by calling the HTTP call to port 80 of application and if any error occur it will re-create the instance</p><p><strong>3.</strong> <strong>Regional (Multiple Zone) Coverage — </strong>Supports regional MIG across multiple zones in same region<strong>, </strong>highly provides availability and secure from zone failure</p><p><strong>4.</strong> <strong>Load Balancer — </strong>MIG use LB to distribute load across zone</p><p><strong>Scalability (Autoscaling) — </strong>Managed by MIG to dynamically increase and decrease the VM based on define rules</p><p><strong>Automated Updates — </strong>MIG supports automatic deploy your application with the control on speed and scope of deployment with the level of service disruption without application downtime</p><p><strong>1.</strong> <strong>Rolling updates: </strong>Gradually updates instances</p><p><strong>2.</strong> <strong>Canary deployments: </strong>% of instances applied first and after that all instances will be replicated</p><p><strong>Support for Stateful workloads — </strong>Stateful workload like web frontend application, batch processing, long running batch computation with checkpoint, database, legacy monolithic app. Stateful MIG provides unique state of each instance (name, attached persistence disk and metadata) on machine restart, auto healing and update events</p><p><strong>Auto healing</strong></p><p><strong>1.</strong> <strong>Keep VM available — MIG commands re-create the vm with its original state if any vm stooped/crashes or deleted.</strong></p><p><strong>2.</strong> <strong>Application based Auto healing –</strong></p><p><strong>a.</strong> Provide specific application-based auto healing (Http call to port 80 for a specific number of times with retry options like check interval, timeout, healthy and unhealthy threshold etc.) to check the health of application and if there is any issue then MIG will automatically create a new VM. For Application based Auto healing need to create a firewall rule also. Coz if no firewall rule available then it could block the http request for health check and MIG will create new VM for healthy VM.</p><p><strong>b.</strong> Provide maximum of 1 Auto healing policy for single MIG</p><p><strong>c.</strong> Single health check for a maximum of 50 MIG</p><p><strong>d.</strong> Status: Below are the different VM status defining the health</p><p><strong>i.</strong> Healthy — VM reachable and give response to health check</p><p><strong>ii.</strong> Unhealthy — VM reachable but does not confirm the requirement of health check</p><p><strong>iii.</strong> Draining — VM drained, new connections are refused, and existing connections have time to complete</p><p><strong>iv.</strong> Timeout — return timeout connection for health check is not established or refused,</p><p><strong>v.</strong> Unknown: health check is not aware of any VM as it will take 30 min to connect with new VM. New VM always return unhealthy state until they connected to health check system.</p><p><strong>Preemptible Instances — </strong>Workload where cost is more important than speed of execution, we can create preemptible instance in MI. Last for 24 hrs. and only have 30 seconds to exit correctly. Preemptible instance can be deleted any time, but auto healing functionality bring it back once preemptible capacity is available.</p><p><strong>Container Based MIG — </strong>Deploy container image using instance template to instance in MIG.<strong> </strong>So, when instance loaded in MIG, image will load with container optimized OS and docker image only.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b61bb3edb90b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get GCDL in first go!!!]]></title>
            <link>https://medium.com/@amitg2/get-gcdl-in-first-go-a6ea54fae3da?source=rss-ef3bbdb8506e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6ea54fae3da</guid>
            <dc:creator><![CDATA[Amit Gupta]]></dc:creator>
            <pubDate>Mon, 04 Apr 2022 13:15:06 GMT</pubDate>
            <atom:updated>2022-04-04T13:15:06.214Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*EngiyEytUz0T4GHNfivRKw.png" /></figure><p>Cloud is a metaphor for the network of data centers that store and compute information available on internet. When we talk about Cloud computing, we’re talking about the technology and processes needed to store, manage, and access data that is transferred over the Cloud rather than the data that remains on your computer’s hard drive. Cloud enables and redefines in every industry and in every activity ability to</p><p>1. Collaborate</p><p>2. Perceive</p><p>3. Categorized</p><p>4. Predict</p><p>5. Recommend</p><p>Types of computing Model — Managed Services</p><p>1. Infrastructure as a Service (IaaS) — Offers compute and storage service platform.</p><p>2. Platform as a Service (PaaS) — Offers develop and deployed environment to build cloud apps- Cloud provider responsible for OS/upgrade of OS/Autoscaling/Availability/Load Balancing/App runtime. Customer is responsible for Application code/Configuration of app and services</p><p>a. Container as a Service (CaaS) — Container running on platform</p><p>b. Function as a Service (FaaS) — functions running on platform instead of app</p><p>c. Databases — RDS/NoSQL/Relational, Queues/AI etc.</p><p>3. Software as a Service (SaaS) — Deliver apps as a service. Offered subscription (Pay as you go). Customer is only responsible for configuring the software (GMAIL/outlook)</p><p>4. Serverless (FaaS — Function as a Service) — Zero visibility of server/ Pay for use only/ Focus on code only</p><p>TOIL</p><p>Benefit of Cloud Computing</p><p>1. Flexible — App and services can be accessed from anywhere</p><p>2. Efficient — Quickly develop and deploy the app/services without worrying about underline infra</p><p>3. Cost effective — Pay only for the uses of services (Pay only for compute resources — no capex)</p><p>4. Secure — Security is managed by the cloud providers</p><p>5. Offers Strategic values — Higher return on investment as always use the latest technologies. Higher availability/Scalability and quickly deploy on production.</p><p>Cloud Use case</p><p>1. Infrastructure Scalability</p><p>2. Disaster Recovery</p><p>3. Data Storage</p><p>4. Data Analytics</p><p>5. Application Development</p><p>Modernization focus area:-</p><p>1. Infrastructure — transform Legacy system to cloud (with defining the new governance policy and all security system in place)</p><p>2. Business Platforms-</p><p>3. Application</p><p>Developers Operation — Dev-Ops is a set of practices aims to increase software delivery velocity, improve service reliability, and build shared ownership among software stakeholders</p><p><strong>Google Cloud solutions for digital transformation</strong></p><p>1. Infrastructure Modernization — rehosting to replat forming — using new platform and application to enhance your existing work</p><p>2. Business Application platform portfolio</p><p>3. Application Modernization</p><p>4. Database and Storage solution — Cloud SQL, Spanner and firestore</p><p>5. Smart Analytics — bigquery serverless datawarehouse, looker — business intelligent plateform</p><p>6. Artificial Intelligence -</p><p>7. Security</p><p><strong>Successful culture transformation</strong></p><p>1. Talent — Attracting-Hiring-nurturing-retaining-celebrating-and growing the talent</p><p>2. Environment- Apart from work environment ever Perk-program and service should be lead to Job satisfaction of employee</p><p>3. Structure-How to design hierarchy/information and team</p><p>4. Strategy-How to align people to organization vision/purpose, Direction to set — How you major your progress- and How to adopt new information to achieve your goal</p><p>5. Empowerment- Enabling employees to give them access to right information to achieve the vision and also encourage them to use the information to resolve the problem and create the business. Certain degree of autonomy, independence, and responsibility</p><p>6. Innovation- can be owned and ordained. The fuel for innovation is a balance between freedom and constraint.</p><p>Google Cloud offers</p><p>1. Economic of scale</p><p>2. Automation</p><p>3. Rapid Elasticity</p><p>4. Data access</p><p><strong>Google Cloud type</strong></p><p>1. Public — Everything owned by Google cloud. Hardware managed by cloud and shared between multiple tenants</p><p>2. Private — Host everything in your own data center (). Deliver high level of security</p><p>3. Hybrid — combination of both (Public and Private)</p><p>4. Community cloud — NO Profit No loss</p><p><strong>Regions — </strong>20+ regions/Specific geographic location</p><p>1. High availability, 2. Low latency, 3. Global Footprint, 4. Adhere to government regulations</p><p><strong>Zones- </strong>In each region is having at-least 3 zones. Each zone is having at-least one or more data centers (discrete cluster — physical data center) and connected with low latency link. Provide higher availability and fault tolerance within zone.</p><p><strong>Instance Template</strong> — define machine type, image, labels, start up script and other properties. Convenient way to create same type of machine. Can’t modify the template once created.</p><p><strong>Sustained used discount — longer you run the VM bigger the discount you get. </strong>If use N1 and N2 type machine for more then 25% of a month then you will get 20 to 50% discount. No action required by users. Applicable on VM creates using GKE or compute engine. This discount doesn’t apply on machine type E2 and A2. Also, if VM creates using App engine flexible and data flow</p><p><strong>Committed use of Discount- </strong>Good for predictable resources use, up to 70% discount. Committed for 1 or 3 years. Applicable for VN created using GKE and Compute engine. Once committed cannot be canceled. And if needed the connect to billing support team.</p><p><strong>Preemptible VMs — </strong>Max life is 24hrs with a 30 sec warning to stop by GCP. Up to 80% discount</p><p>1. Use this type of VM if your application is fault -tolerant.</p><p>2. If you are Cost sensitive.</p><p>3. Workload is not immediate.</p><p>Restrictions –</p><p>1. Can not migrate to regular VM.</p><p>2. Not always available.</p><p>3. No automatic start. Manual process</p><p><strong>Sole Tenancy — </strong>Virtual instance on hardware dedicated to one customer only. Security and compliance/High performance/Licensing requirement (BYOL)</p><p><strong>Multi-tenancy- </strong>(Default) Multi tenancy means that multiple cloud customers of a vender can share the same computing resources. Cloud customer are not aware of each other and there data is kept separate. Multitenant architecture is a feature in many types of public cloud computing, including IaaS, PaaS, SaaS, containers, and serverless computing.</p><p><strong>Google cloud pricing calculator</strong> — use to calculate the price estimation for google cloud resources</p><p><strong>Custom hardened Images — </strong>Reduce boot time and improve security</p><p><strong>Custom Machine Type — </strong>build per vCPU and memory provisioned</p><p><strong>Instance Group — </strong>Group of instances managed as a single entity-Similar VM having same life cycle.Can be define in Region (for higher availability)as well as Zonal.</p><p>1. <strong>Manage Instance group — </strong>Identical VMs created using instance template <strong>— </strong>Auto Scaling, Auto Healing and managed releases. Always Maintain certain numbers of instances. Support Rolling updates and Canary deployment. 2 types (1. Stateful MIG with database), (2 Stateless MIG)</p><p>2. <strong>Unmanaged Instance Group — </strong>Different configuration for VM in same group — No Auto healing and Auto scaling.</p><p><strong>Load Balancer- </strong>Distribute load at backend</p><p><strong>3 Types of LB</strong></p><p><strong>HTTP LB — </strong>HTTP and<strong> </strong>External HTTP(S) LB, Internal HTTP(s) LB — Layer 7 protocol — Public or private, Single/Multi region</p><p><strong>TCP Load Balancer — TCP LB, </strong>SSL Proxy LB, TCP Proxy LB — Layer 4/proxy Protocol — Public or private, Single/Multi region</p><p><strong>UDP LB — </strong>UDP LB — Layer 4 Protocol — Public or private, Single region</p><p><strong>Shared Responsibility Model</strong></p><p><strong>Default — </strong>Data encryption at Rest and in Transit / IAM/KMS etc.</p><p><strong>Google Cloud — </strong>is responsible for all Hardware/Hardware upgrade/Network Audit Logging Security(Security access to data center).</p><p><strong>Customer — is responsible for</strong></p><p><strong>SaaS — Content + Access Policy +Usage</strong></p><p><strong>PaaS — SaaS + Web application deployment + Web app Security</strong></p><p><strong>IaaS — Paas + Operations + Network Security+ Guest OS</strong></p><p><strong>App Engine — (PaaS), Serverless, less flexible and less responsibility — </strong>Simplest way to deploy and scale of your app in Google cloud. <strong>Customer will Pay only for provisioned resources. User is only responsible for web-application deployment and security, access policies and usage of resources and application.</strong></p><p>1. Automatic load balancing and Scaling</p><p>2. Manage platform updates and monitoring</p><p>3. Application Versioning</p><p>4. Traffic Splitting — divert traffic based on % to different server. Use when deploy a new version of application. And using this divert some of the traffic to new app server.</p><p><strong>2 Types of App engine</strong></p><p><strong>Standard app Engine — runs in language specific Sand boxes (V1 for old lang version and V2 for new lang version). Down to 0 instance, Complete isolation from OS/Disk</strong></p><p><strong>Flexible app Engin kubernates — App instance runs on docker container. Can not down instance to Zero. Support any runtime. way to run single container on cloud</strong></p><p><strong>Command :- gcloud app…</strong></p><p><strong>Google kubernates Engine (GKE)- </strong>GKE is a<strong> </strong>hosted K8s cluster service. Open-source container orchestration service. It provides cluster management. GKE cluster can be customize and support many machine types and, nodes and network settings.</p><p><strong>Command :- gcloud container cluster…</strong></p><p><strong>Kubectl ….</strong></p><p><strong>Provide all Orchestration Features:</strong> Auto Scaling, Self-healing, Discovery feature, Zero downtime deployment and Load Balancing, Auto upgrade</p><p>GKE provide — (Pod cluster scaling), K8s auto upgrade, Container optimize OS build by google, support persistent disk and local SSD, cloud logging and monitoring</p><p><strong>Type of GKE Cluster</strong></p><p><strong>Standard — Everything managed by user</strong></p><p><strong>Autopilot — Cluster Managed by GKE</strong></p><p><strong>POD: </strong>Pod is the smallest unit in K8s that user can create and deploy.Pods are accessible inside the GKE only until they have exposed to outside world.</p><p><strong>POD Exposed Service: </strong>Stable end point for public use to access the PODs</p><p><strong>GKE create a service with fixed IP address for PODS and create a network load balancer</strong></p><p><strong>Google Cloud Function: — serverless code/app/function runs code in response to event or when any event trigger. Time bound from 1(default) minute to 9(Max) min</strong></p><p><strong>Cloud Run: </strong>Easiest way to run one container. Fully managed service- use for “Container to production in a second”. Fully managed serverless platform for containerize application. Zero responsibility for infrastructure. Pay per use (CPU, memory, Request and networking)</p><p>Fully integrated end to end dev experience. No limitations/Easily portable as it is container based/Integration with Cloud code (Editor), Cloud build (CI/CD), Cloud monitoring and cloud logging.services</p><p>Support YAML also.</p><p><strong>Anthos: </strong>run K8s cluster anywhere on multi-cloud<strong>/</strong>on-premises</p><p><strong>Cloud run for Anthos: </strong>Deploy workload to Anthos cluster running on google cloud or on-premises</p><p><strong>Pay for what you use:</strong></p><p><strong>1.</strong> <strong>Number of invocations</strong></p><p><strong>2.</strong> <strong>Compute time of the invocation</strong></p><p><strong>3.</strong> <strong>Amount for memory used and provisioned</strong></p><p><strong>GCP Block Storage :</strong></p><p>Data store on persistent disk (for higher durability)</p><p>Zonal — data replicated in one zone</p><p>Regional — data replicated in multiple zone</p><p>Data store on local disk -SSDs disk (for higher performance)</p><p><strong>FileStore </strong>— Fully managed noSQL database to store and sync client and server data. Support mobile(firebase), web application and server development. Support offline mode also. Keep data in sync for client for real time updates</p><p><strong>File Storage: </strong>High performance file storage. File storage instance is restricted to Region</p><p><strong>Cloud Storage — </strong>store binary object in a file format. Not a file system and every object has a URL. Always encrypt data by default. Data in transit also encrypt. Create a bucket for storage. Serverless, Auto scaling and infinite scale.</p><p>Store object using a Key-value approach/Treats entire object as a unit/No partial updates/Provide REST API to access and modify/ Can store binary data/images/media files and archive/Application packages and logs/ backup of database or storage classes/Staging data during transfer from on-premises to cloud</p><p>Bucket Attributes — 1. Globally unique name (Files in a flat namespace) 2. Storage Class, 3. Location (region/multi region), 4. IAM policies OR Access Control List (ACL-consists of 2 parts <strong>who</strong> can perform <strong>and what</strong> can be performed), 5. Object Versioning (Cloud storage object are immutable. If don’t turned on the versioning then new object always overwrite the old.), 5. Object Life cycle management rules.</p><p><strong>Class Type</strong></p><p><strong>GSUTIL &amp; API</strong></p><p><strong>Availability SLA</strong></p><p><strong>Minimum Storage Duration</strong></p><p><strong>Typical Monthly SLA</strong></p><p><strong>Multi-Regions — Separated by 160 KM</strong></p><p><strong>Dual — Regions</strong></p><p><strong>Region</strong></p><p><strong>Multi-Regions — Separated by 160 KM</strong></p><p><strong>Dual — Regions</strong></p><p><strong>Region</strong></p><p>Standard</p><p><strong>STANDARD</strong></p><p>99.95%</p><p>99.95</p><p>99.9%</p><p>None</p><p>&gt;99.99%</p><p>&gt;99.99%</p><p>99.99%</p><p>Nearline</p><p><strong>NEARLINE</strong></p><p>99.9%</p><p>99.9%</p><p>99%</p><p>30 Days</p><p>&gt;99.95%</p><p>&gt;99.95%</p><p>99.9%</p><p>Coldline</p><p><strong>COLDLINE</strong></p><p>99.9%</p><p>99.9%</p><p>99%</p><p>90 days</p><p>&gt;99.95%</p><p>&gt;99.95%</p><p>99.9%</p><p>Archive</p><p><strong>ARCHIVE</strong></p><p>99.9%</p><p>99.9%</p><p>99%</p><p>365 Days</p><p>&gt;99.95%</p><p>&gt;99.95%</p><p>99.9%</p><p>All storage classes provide 11–9s durability (99.999999999%)/Low latency/unlimited storage (Auto scaling)/Same API use for all classes/No committed SLA for Archive storage/ Committed SLA of 99.95% for multi region and 99.99% for single reason for Standard/Nearline/Coldline</p><p><strong>Standard</strong> — Frequently used data for shorter period</p><p><strong>Nearline — not more than 1 in 30 days — </strong>low cost highly durable storage service for infrequently accessed data. Good for read and write data once in a month .Incur fee per GB for reading data</p><p><strong>Coldline — not more than or at most 1 in 90 days </strong>— Very<strong> </strong>low cost highly durable storage service for archiving/backup/disaster recovery data. Incur higher fee per GB for reading data. Good for read and write data once in a quarter</p><p><strong>Archive — note more than or at most 1 in year — </strong>Very<strong> </strong>low cost highly durable storage service for archiving/backup/disaster recovery data</p><p><strong>Object life cycle Management — </strong>Files are frequently accessed when they created and usage reduce after time. So using Object life cycle management user can reduce cost by moving object to different storage class</p><p>1. First Identify object based on different predefined rules condition like creation date, islive or age etc.</p><p>2. Second set the action either setStorgaeClass or delete action</p><p>3. Allowed transition –</p><p>a. From Standard/Region/Multi Region TO Nearline/Coldline/Archive</p><p>b. From Nearline TO Coldline/Archive</p><p>c. Coldline to Archive</p><p><strong>Transferring data from on premises to Google Cloud</strong></p><p><strong>1.</strong> <strong>Online transfer — </strong>Use gsutil or API to transfer data upto 1 TB only for one time from on-premises or another google cloud storage bucket</p><p><strong>2.</strong> <strong>Storage Transfer Service — </strong>Recommend for large data transfer from any other cloud. Repeated schedule transfer and also support incremental transfer/reliable and Fault tolerant / for transferring more then 1 TB from anywhere or from any other cloud.</p><p><strong>3.</strong> <strong>Transfer appliances — </strong>physically<strong> </strong>Copy ship and upload data or data transfer take more than a week or data is more than 20 tb.</p><p><strong>a.</strong> <strong>Fast copy () upto 40 GBPS)</strong></p><p><strong>b.</strong> <strong>AES encryption (Customer managed keys)</strong></p><p><strong>c.</strong> <strong>2 Types TA40 (support upto 40TB encrypted data) and TA300 (upto 300TB encrypted data)</strong></p><p><strong>Private Access Options for services:</strong></p><p><strong>Private Service Connect endpoint: </strong>User creates private endpoints using global internal IP addresses within your VPC network and assign DNS names to these internal IP addresses with meaningful names. On-premises network can connect to these endpoint using VPN tunnel or interconnect attachments(VLAN)</p><p><strong>Private Google Access</strong> — Enable Private Google Access on a subnet by subnet basis; it’s a setting for subnets in a VPC network.</p><p><strong>Serverless VPC Access- </strong>Serverless VPC Access makes it possible for you to connect directly to your Virtual Private Cloud network from serverless environments such as Cloud Run, App Engine, or Cloud Functions. Request never exposed t internet and less latency</p><p><strong>Option</strong></p><p><strong>Clients</strong></p><p><strong>Connection</strong></p><p><strong>Supported Services</strong></p><p><strong>Usage</strong></p><p><strong>Connecting to Google APIs -</strong></p><p>Private service Connect for Google API &amp; Services</p><p>GCP resources with/without external IP, on-premises system</p><p>Using Private Service Connect endpoint</p><p>Most GCP services and API</p><p>Connect using endpoint define in your VPC. GCP resource and on-premises connect without external IP</p><p>Private Service Connect for Google APIs with consumer HTTP(S) service controls</p><p>GCP resources with/without external IP, on-premises systemt</p><p>Using Internal Service load balancer in VPC network</p><p>Supported only Selected regional API and services only</p><p>Regional Services available with URL Map for fine grained access. Regional services. Connect from On-premises without external IP in your VPC</p><p>Private Google Access (URL for services)</p><p>Google Cloud resources without external IP addresses</p><p>Connect to API and services</p><p>Support most google API and Services</p><p>Connect to API and services without giving google resource API and services external IP</p><p>Private Google access to connect Cloud and Developers API</p><p>On-premises host</p><p>Using Private Google Access</p><p>Support all Cloud and developer API except App engine Memecache/ Filestore/ Memorystore</p><p>Using Private Google access user can connect Cloud API from on-premises through VPN gateway</p><p><strong>Connecting to Service</strong></p><p>Private service Connect for Google API &amp; Services</p><p>Google Cloud VM instances with/without external IP address</p><p>Connect service of other VPC Using Private Service Connect endpoint</p><p>Supported some OR third party resources</p><p>Connect using endpoint define in Other VPC. GCP resource and other third party resources to connect without external IP</p><p>Private Service Connect for Google APIs with consumer HTTP(S) service controls</p><p>GCP resources with/without external IP, on-premises system</p><p>Using Internal Service load balancer in VPC network</p><p>Supported only Selected regional API and services only</p><p>Regional Services available with URL Map for fine grained access. Regional services. Connect from On-premises without external IP in Other VPC</p><p><strong>Connecting from serverless Google services (SEEVERLESS VPC ACCESS)</strong></p><p>Google Cloud VM instances with or without external IP addresses.</p><p>Connect directly from serverless Google services</p><p>through an internal VPC connection.</p><p>Cloud Run, App Engine standard environment, and Cloud Functions</p><p>Use this option to connect from a serverless environment on Google Cloud directly to resources in a VPC network using internal IP addresses.</p><p><strong>Data Category</strong></p><p>User Data — All data from users who uses/purchases services/products</p><p>Corporate Data — All data related to your organization</p><p>Industries Data -data found outside in the organization</p><p><strong>Google Cloud Database</strong></p><p><strong>1.</strong> <strong>On line Transaction Processing Database (OLTP) — </strong>Provide high volume of transaction data with speed and scale. OLTP stores data in relation and in ROWS. Works for small transaction data</p><p>a. <strong>Cloud SQL — Region database </strong>–Fully managed RDMS (MySQL andPostgres and SQL server). Easily integrate with existing app in google services. Automatic replication/Managed backup/Vertical scaling (Read-write)/Horizontal scaling (read)/Google Security. limited by data size selected</p><p>b. <strong>Cloud Spanner — Fully managed Global database service.</strong> Provide strong consistency and massive scalability. Built in high availability. Many IOPs (ten of thousands read/write operations per second).99.999% availablity with unlimited scale.Support 2 dialects PostgresSQL and Google standard SQL.</p><p><strong>2.</strong> <strong>Online Analytics Processing Database (OLAP)- OLAP</strong> store data in column together. High compression. Works for petabytes of data Distribute data. Execute complex query efficiently.</p><p>a. <strong>Cloud BigQuery</strong> — fully managed Serverless with downtime free upgrades OLAP database– Analise Petabyte of data — NO NEED TO PAY UNLESS QUERY THE DATA. Also good For adhoc query analysis or Time series data like (IOT censor data).On-demand (bases on query data OR Flatrate for dedicated resources) (1 TB query data is free per month.</p><p><strong>3.</strong> <strong>NOSQL database</strong> — Not only SQL/Flexible Schema/Horizontal scale for petabytes data</p><p>a. <strong>Cloud Firestore (earlier known as Datastore) </strong>— Managed serverless NoSql db (document db)</p><p>i. Support offline sync, real time data sync</p><p>ii. Provide support to ACID transactions, SQL like quarries, indexes</p><p>iii. Designed for Web and mobile application, web client</p><p>iv. Small to medium database (Zero to few TB)</p><p>v. Data can store in form of collection and in a collection again can store collection or data. Hierarchy data structures.</p><p>vi. Indexes are automatically on all fields. Can also create composite index</p><p>b. <strong>Cloud Bigtable — </strong>Managed, scalable NoSql wide column database. Consisten 10 ms atency.millions of request per second</p><p>i. Not recommended for transactional workloads</p><p>ii. Not Serverless and recommended for &gt;10 TB of data to several petabytes (huge streams of time series data).</p><p>iii. Use to analysis for real-time simple pre-defined queries on a single table containing huge volumes of time series data, ad tech, fintech and streaming data</p><p><strong>4.</strong> <strong>In memory database — MemoryStore</strong> service is the recommended in memory database in GCP. Use for caching/session/gaming/management etc.Support Reddis and memecache</p><p><strong>Cloud Identity Management (IAM)</strong></p><p><strong>WHO — </strong>Who can access the resources using IAM (google account/Group/service account/google workspace or cloud identity domain)</p><p><strong>Can do What — </strong>IAM Roles or set of permission</p><p><strong>On what resources — </strong>Resources to work on</p><p><strong>How to assign — Assign policy( Role) to users(WHO)</strong></p><p>· <strong>Basic or Primitive (coursed grained role)– Owner (Editor + manage role and permission on resources+billing) &gt; Editor (Viewer+ change a state of resources (Edit Actions)) &gt; Viewer (only view a state of assigned resources (Read only actions)) and Billing administrator role (Manage Billing/(Add/Remove administrator). Not recommended /don’t use in production</strong></p><p>· <strong>Predefined (fine grained role) </strong>— Predefined role and managed by google like Cloud Compute/Storage bucket admin etc.</p><p>· <strong>Custom — </strong>can create granular role for each resource or group and can not be defined on a folder</p><p>· <strong>Service Accounts</strong> — controls server to server interactions. Authenticates and control privileges used by resources. use private/encryption keys. Identified by an email</p><p><strong>a.</strong> <strong>Default Service type </strong>— automatically created once created the service (Not recommended)</p><p><strong>b.</strong> <strong>Custom Service Accounts </strong>— user created. provide fine grained access control</p><p><strong>c.</strong> <strong>Google Managed Service Account — </strong>created and managed by google</p><p><strong>IAM best practices:</strong></p><p><strong>1.</strong> <strong>Least privileged permission</strong></p><p><strong>a.</strong> <strong>Basic role is not recommended</strong></p><p><strong>b.</strong> <strong>Use Service account with minimum privileges</strong></p><p><strong>2.</strong> <strong>Separation of duty for all sensitive task</strong></p><p><strong>3.</strong> <strong>Constant monitoring</strong></p><p><strong>4.</strong> <strong>Use groups whenever possible-Create group and bind role to groups and assign users to that group</strong></p><p><strong>Policy — bind user with a permission</strong></p><p><strong>Organization Policy — </strong>Works on what<strong>. Create centralize constrained on all resources created in an organization. Organization policies are always having the precedence(override) on IAM role access</strong>. Also requires a role of Organization policy administrator to create these policies.</p><p><strong>Google Resources Hierarchy</strong></p><p><strong>Organization à Folders à Projects à Resources</strong></p><p><strong>1.</strong> <strong>Organization contains multiple folders</strong></p><p><strong>2.</strong> <strong>Folders contains multiple projects. Folders can be used to isolate requirement for each project/team</strong></p><p><strong>3.</strong> <strong>Project contains multiple resources. Or projects are the places where our resources are defined.</strong></p><p><strong>IAM policy can be set to any level and inherited from parents. You cannot restrict policy at lower level if it has been assigned to higher level</strong></p><p><strong>Recommendation for enterprise:</strong></p><p><strong>Isolate environment for each application</strong></p><p><strong>1.</strong> <strong>Create separate project for different environment or One project per application per environment</strong></p><p><strong>2.</strong> <strong>Create separate folder for each department to isolate the prod app for each dept.</strong></p><p><strong>Billing Account: </strong>It is mandatory to have a billing account for the organization. Active project resources should be connected to billing account. Same account can be associated to single or multiple projecta OR Organization can have multiple billing account. Two types of billing account. Billing data can be store into Bigquery for analysis/Cloud storage for archive</p><p>1. Self Serv</p><p>2. Invoiced</p><p>Recommendation:</p><p>1. Create billing account to represent your organization structure. (separate billing for each dept)</p><p>2. Always Create budgets and alert to avoid surprises (Alerts send to pub/sub, send mails to billing admin/users)</p><p><strong>Hybrid Cloud — </strong>Hybrid Cloud is a combination of on-premise and google cloud network. Connect to Google cloud from On premise</p><p><strong>Cloud VPN </strong>— Implement using IPsec VPN tunnel. Use to connect google cloud infrastructure from on-premise. Public traffic goes through internet with encrypted by Internet key encryption protocol. For low bandwidth requirement</p><p>Two types of VPN –</p><p>1. HA VPN (High availability VPN with SLA of 99.99% availability with 2 external IP address) only use for dynamic routing.</p><p>2. Classic VPN with SLA of 99.9% with single IP address use for dynamic and static (support policy and routing based) routing both</p><p>3. Data exchange happened through public network (internate)</p><p><strong>Cloud Interconnect — </strong>Physical connection between on-premise and google cloud. For high bandwidth requirement</p><p>1. Highly available and high throughput</p><p>2. 2 Type — Dedicated interconnect (10 gbps or 100 gbps), Partner interconnect (50mbps to 10 gbps)</p><p>3. Support privately accessed google API and services</p><p>4. Data exchange happened through private network</p><p>5. Reduce egress cost as private network used for exchange and not a public one</p><p><strong>Direct Peering </strong>— It is not a GCP service and a lower level connect to connect customer network with google network. Not recommended</p><p><strong>Federation : </strong>Connect any identity framework with google cloud to provide SSO</p><p>1. Federate any active directory with cloud identity using Google cloud directory sync (GCDS) and Active directory Federation service (ADFS).</p><p>2. Federating Azure AD with google cloud identity</p><p>3. Google workspace account with google cloud</p><p>SAML- protocols is used to enable single sign-on for hybrid cloud</p><p>Devops — 1. Communication 2. Feedback 3. Automation</p><p>Continuation Integration/ Continuation Deployment/ Continuation Delivery</p><p>Recommendation: 1. Static code analysis (lint/sonar/static Security checks) 2. Runtime checks (vulnerability checks using automated tools) 3. Tests (Unit/Integration/System/Sanity and regression)</p><p><strong>Cloud Deployment Manager : </strong>Use to deploy the infrastructure which is not part of CI/CD pipeline. Use Deployment Manager to create the stateful parts of the project and network configuration and deploy these outside of the CI/CD process as part of the initial setup</p><p><strong>CI-Cd Tools</strong></p><p><strong>Cloud Source repository</strong> — like Git- Fully featured private git repository for code</p><p>Docker Hub is a public container repository</p><p><strong>Container Registry</strong> (GCR)– Private repository for container Images only. Store for docker containers. Provide control access to images GCS bucket to store containers image only. Initial solution of GCP. Only multi-regional registry</p><p><strong>Artifact Registry — Evolution of Container Registry. </strong>An be store container images as well as non-container packages, npm packages and others. Separate repository. Not use of GCS. By default, auto encrypted either by google managed encryption key OR Customer managed key. Access can be controlled by pre-defined artifact role in IAM. Multi and regional repository</p><p><strong>Cloud Build</strong> — build deployment artifacts from source code and configuration</p><p><strong>Jenkins</strong> — continuous Integration for open source</p><p><strong>Spinnaker</strong> — Multi cloud continuous deliveries and support multiple deployment strategies Like blue-green/canary deployment</p><p><strong>Site Reliability Engineer (SRE) </strong>— team is taking care by single SRE team in terms of all aspect of applications.</p><p><strong>SRE Key Principle:</strong></p><p><strong>1.</strong> <strong>Manage by Service level Objectives (SLO) — </strong>SRE teams converts the business requirement into measurable unit like availability is 99.99%</p><p><strong>2.</strong> <strong>Minimize TOIL — try to automate as many things as possible. Try to minimize the manual efforts</strong></p><p><strong>3.</strong> <strong>Move fast by reducing the cost of failure — by having frequent small realease and 2nd automate processing</strong></p><p><strong>4.</strong> <strong>Shared ownership with Developer</strong></p><p><strong>Key Metrics of SRE</strong></p><p><strong>Service level Indicator (SLI) — Quantitative measure of an aspect of services (categories — availability, latency, throughput, durability, correctness (error rate)</strong></p><p><strong>Service Level Objective (SLO) — SLI + Target (like availability 99.99%, 99.999999999$ durability). SLO should be more complex to choose. It is always internal</strong></p><p><strong>Service Level Agreement — SLA + consequences (contract). What happened if SLO is not meet. To avoid the SLA consequences always create Strong SLO then external SLA. It is always external</strong></p><p><strong>Error budget — use to manage development velocity. And plan the release based on this. Like how fast the dev team can go fast on releases.</strong></p><p><strong>Best Practices for SRE:</strong></p><p><strong>1.</strong> <strong>Handling Access Load</strong></p><p><strong>a.</strong> <strong>API limits</strong></p><p><strong>b.</strong> <strong>Streaming Data</strong></p><p><strong>2.</strong> <strong>Reduce the Quality of services — Hardcoded the set of products if required in case of overloading network</strong></p><p><strong>3.</strong> <strong>Avoiding Cascading failure for example use of circuit breaker pattern</strong></p><p><strong>4.</strong> <strong>Penetration Testing (Ethical testing) White box (with information) and Black box(No Information))</strong></p><p><strong>5.</strong> <strong>Load Testing (Jmeter, Loadrunner, locust,gatlingn etc</strong></p><p><strong>6.</strong> <strong>Resilience Testing — How Application behave under stress — How does application behave in Failure</strong></p><p><strong>a.</strong> <strong>Chaos Testing (Simian Army) — Down anything or simulate the failure of any components then check for application.</strong></p><p><strong>b.</strong> <strong>Add Huge stress on any layer</strong></p><p><strong>c.</strong> <strong>Include Network in the testing like if VPN interconnect down or internet failure</strong></p><p><strong>d.</strong> <strong>Best Practice DiRT — Disaster Recovery Testing — planned and outage for pre-defined period</strong></p><p><strong>Cloud Ops:</strong></p><p>Ø <strong>Cloud logging — </strong>For analyzing and troubleshoot app. For centralize logging</p><p>Ø <strong>Cloud Monitoring — </strong>for monitoring and raise alerts. Dashboard and monitoring SLO</p><p>Ø <strong>Cloud trace — </strong>to trace the request across GCP services</p><p>Ø <strong>Cloud Profiler</strong> — to profiling the services (statistical, low provider profiler)</p><p>Ø <strong>Cloud Debugger </strong>— provide debugging environment in production server</p><p><strong>Audit logs — to knows who what in all app. Cloud audit logged all the action done by users</strong></p><p><strong>Error reporting — Real time error monitoring provide to developer to fix the issue</strong></p><p><strong>Cloud PUB/SUB </strong>— Message oriented middle ware. Reliable, scalable, fully managed highly available messaging service, Used for streaming analytics and data integration pipeline to ingest and distribute the data. Allow services to communicate asynchronously with a latency on the order of 100ms. 2 Services Pub/SUB and PUB/SUB lite (Zonal messages service with low cost). Support both Push (SNS) and Pull(SQS).Low cost (pay as use). In Pub-Sub communication messages only gets deleted from the queue when it got the confirmation msg from the subscriber. Default msg retention policy is 7 days, with subscription expiration (default 31 days).Default msg deadline is 10 sec only for failure.</p><p><strong>Big Data Flow — </strong>Use to extract transform data and load into BigQuery</p><p>· <strong>DataPrep — </strong>Clean and prepare data</p><p>· <strong>Dataflow </strong>— Unified stream data service and batch data processing that’s serverless, fast and cost effective. Service for large scale processing of data. <strong>Serverless, autoscaling data processing service for both streaming data and batch data. Managed version of Apacha Beam</strong></p><p>· <strong>DataProc — </strong>Complex<strong> </strong>Batch processing using Spark and Hadoop. Managed Spark and Hadoop service. Create multiple clusters for data processing. Use to perform complex batch queries.</p><p><strong>Cloud Data fusion</strong> — Data integration service to create data pipeline quickly. Codeless environment to create pipelines using a drag and drop. Visualize data pipelines. Powered by CDAP open source.</p><p><strong>Data Studio: </strong>Data visualization tool in Bigquery<strong>. </strong>Create<strong> </strong>Interactive dashboard and beautiful report</p><p><strong>Looker — </strong>business intelligence solution. Put simple data platform Sits on the top of analytics database and define data</p><p><strong>IOT Archecture</strong></p><p><strong>DataLakes- Dataware housing solution. Repository for all type of data-multi regional storage/can be store in a region also</strong></p><p><strong>Storage</strong></p><p><strong>Data Ingestion</strong></p><p><strong>Processing and Analytics</strong></p><p><strong>Data mining and exploration</strong></p><p>Cloud Storage</p><p>Streaming data — Pub-Sub and Data Flow</p><p>DataProc</p><p>DataPrep</p><p>Batch Process — gsutil, Data Transfer Service, Data transfer Appliances</p><p>Run query in Bigquery</p><p>Cloud datalab like numpy and Tansorflow</p><p><strong>Bigtable- </strong>cloud managed NoSQL database server for large analytical and operational workload with 99.999% availability with downtime free upgrades. Easily connect to bigquery or apache ecosystem. Design with storage engine for ML workload for better predictions. Data can be read using Application API/Streaming/Batch Process</p><p>1. High throughput at Low latency (ms-10)</p><p>2. Scalable (Cluster resizing) without downtime</p><p>3. Flexible automated replication to optimize any workload</p><p>4. Data encryption in flight and rest</p><p>5. Accessed by HBase API</p><p>6. Native compatibility with Hadoop eco system</p><p><strong>API Management in GCP:</strong></p><p><strong>1.</strong> <strong>Apigee API Management: </strong>Comprehensive API management tool.</p><p>a. Manage complete API life cycle (Design, Secure, analysis, monitor and monetize)</p><p>b. Supports REST, gRPC, non-gRPC REST, Integration with GCP, hybrid, on-premise apps</p><p>c. Deoploy on cloud, hybrid and on-premises</p><p><strong>2.</strong> <strong>Cloud End Point: </strong>Basic API management to support Google cloud backend</p><p><strong>a.</strong> Less complicated (Build a container and execute using Cloud Run)</p><p><strong>b.</strong> Support REST and gRPC</p><p><strong>3.</strong> <strong>API Gateway: </strong>Simple API management tool to support google cloud backend</p><p>a. Easy to setup</p><p><strong>b.</strong> Support REST and gRPC</p><p><strong>Artificial Intelligence </strong>— A broad field and term that describe any kind of machine capable of acting autonomously. Self driven car, fraud detection, Spam folder, google translator etc. 2 Types of AI</p><p>1. Strong AI — Machine learn by it-self and plan for future.</p><p>2. Narrow AI — Train the model (learn form data and trained the model for future)</p><p>Machine learning is based on example — provide millions of data + Create a Model + Use the same model for prediction.</p><p><strong>Machine Learning — </strong>Branch in the field of AI. Computers learn from data without using the complex set of rule.</p><p><strong>Pre-defined model provided by google — Cloud text to speech/ Speech to text/Translate API/Natural language API/</strong></p><p><strong>AI Hub : Plug and play AI services provided by google. Includes end to end pipelines and out of the box algorithm</strong></p><p><strong>Cloud Vision API — Use for Generic identification of Object in a image, detect faces, emotions, object , text and assign labels to images.</strong></p><p><strong>Auto ML Vision AI service — extension of Cloud Vision API- Create custom model</strong></p><p><strong>1.</strong> <strong>Simple Building of custom Model</strong></p><p><strong>a.</strong> <strong>AutoML Vision — Build custom model based on images. Identify the type of cloud or machine part based on an image.</strong></p><p><strong>b.</strong> <strong>AutoML Videos — Build custom model based on videos (Add lables, video analysis, Object detection and tracking</strong></p><p><strong>c.</strong> <strong>AutoML tables — Build custom model based on tables structured data</strong></p><p><strong>2.</strong> <strong>Data scientist to create custom model using framework like Tanserflow, pytorch, scikit-learn</strong></p><p><strong>3.</strong> <strong>Bigquery ML — create model using Queries</strong></p><p><strong>4.</strong> <strong>Vertax AI-Build and Deploy AI model. Make MLOps easy</strong></p><p><strong>AI Responsible Principle</strong></p><p><strong>1.</strong> <strong>Fairness — </strong>Data should not be biased and from all groups (Data characteristics — Complete/Coverage/Cleanness)</p><p><strong>2.</strong> <strong>Reliability — </strong>Should be a reliable data. Continuous testing high load and unexpected condition</p><p><strong>3.</strong> <strong>Inclusiveness — </strong>no one should left out</p><p><strong>4.</strong> <strong>Personal data Security and privacy</strong></p><p><strong>5.</strong> <strong>Transparency </strong>to explains to users</p><p><strong>6.</strong> <strong>Accountability </strong>should meet ethical and legal standard</p><p><strong>Use cases of AI-ML</strong></p><p><strong>1.</strong> <strong>Replacing Rule based system</strong></p><p><strong>2.</strong> <strong>Automating process</strong></p><p><strong>3.</strong> <strong>Understanding unstructured Data</strong></p><p><strong>4.</strong> <strong>Personalizing Application</strong></p><p><strong>Firebase: Google Mobile Platform –</strong></p><p><strong>1.</strong> Build apps for mobile app (android, iOS,The web, C++ and unity)</p><p><strong>2.</strong> Serverless app logic — Cloud function</p><p><strong>3.</strong> Fully managed database — <strong>Firestore </strong>with offline support</p><p><strong>Cloud Security and Operations</strong></p><p>Various cost of cloud impact people/process/technology. So to optimize cost any organization requires Finance/Business function and technology. Technology provides visibility/accountability/control and intelligence.</p><p>· <strong>Total Cost of Ownership</strong></p><p><strong>Comprehensive assessment — </strong>space (including networking+ security etc.) and associated cost/Hardware/software/communication/manage and support/user exp/service downtime/training and other productive losses</p><p>TCO can vary due to organization digitalization goal and continue evolving</p><p><strong>Best Practice</strong></p><p>1. Identify the individual/team to manage the cloud cost</p><p>2. Learn the difference between invoices and cost tools</p><p>3. Use cost management tools for accountability/visibility and control</p><p>4. Simplified Authentication/sign in floe/monitoring and analytics</p><p>5. Receive push msg -Cloud Messaging</p><p>6. Stores generate content — cloud storage</p><p><strong>How is cost decided -</strong></p><p>1. Resource Type and configuration, like Memory/CPU/access tier</p><p>2. Usage meters-how long VM is running. How much ingress/egress data how much invocation of cloud functions</p><p>3. Which Region — Price varies for different regions</p><p>4. Reserved or Not — Discount is available for some services if user reserve them for a long time like VM</p><p>5. Data Transfer — Ingress data transfer is free from on-premises but not egress. Egress to the same google cloud zone when using the internal IP address is free.</p><p>· <strong>Cloud Security</strong></p><p>1. Privacy — ISD 27–0–17 covers PII-</p><p>2. Security — by default encryption at rest and in -transit.</p><p>3. Compliance -</p><p>4. Availability — 99.999% or 5 9s or 5 minutes not availability in a year</p><p><strong>Security Layer</strong></p><p><strong>Key Management Service (KMS) — create and manage Cryptographic keys</strong></p><p><strong>Secret Managers — Store, </strong>Manage your password and API keys</p><p><strong>Cloud Armor — </strong>Provide security to production apps (at run time) from DDOS attack and common web attack (OWASP). Armor security policies (with layer 7) are only available for backends services behind the <strong>HTTP(s) load balancer</strong>.LB can be premium or standard. Send details to Security command center/cloud logging/cloud monitoring</p><p><strong>Cloud Security Scanner </strong>— CSS provides managed and custom vulnerability scanning for compute engine, App engine and GKE services web application. It includes all OWASP top 10 security risk.</p><p><strong>Binary Authorization — </strong>Ensure trusted container deploy to google cloud.</p><p><strong>Container threat Detection</strong> — Detects container runtime attack.</p><p><strong>Security Command Center — </strong>Provide<strong> </strong>Consolidated picture of security in google cloud. Provide an intelligent risk security dashboard and analytics system.</p><p>Ø Asset discovery and inventory — Discovery and view customer assets in real time across GCP products and services</p><p>Ø Threat Prevention- Understand the security state customer cloud resources state and quickly provide solution to all misconfigurations on a click.</p><p>Ø Threat Detection-Detect threat using logs running in google cloud at scale.</p><p><strong>Hardware Security — </strong>Hardware creates by google with Titan chip check the integrity on every reboot</p><p><strong>Software –</strong>Titan continue to check software and operation integrity</p><p><strong>Storage — </strong>DEK — Data encryption Key — Encrypt chunk of data using DEK then another wrapper key KEK Key encryption Key and store into multiple cloud storage places.</p><p><strong>Identity — </strong>0 trust model.<strong> </strong>Every user on every machine, Each layer Identity check</p><p><strong>Identity Platform — </strong>Identity platform is a customer identity and access management platform.</p><p><strong>Identity-Axway Proxy (IAP) — Use identity and context to guard access to your applications and VMs. </strong>Provide hybrid security to access resources. Authorize and authenticate users from on-premise as well as off-premises (cloud). Support untrusted network also, without using VPN connection.</p><p><strong>Beyondcorp enterprises </strong>— Zero trust solution provide secure access with integral threat and data protection. Provide continuous end to end protection.</p><p><strong>Chronical: </strong>Service<strong> </strong>Extracts signals from the security telemetry to find threat instantly</p><p><strong>Cloud Asset Inventory</strong> — Fully managed inventory service to view, managed, analyze all your cloud and Anthos asset across project and services at any given point of time.</p><p><strong>Cloud intrusion detection system (CIDS) — </strong>Detect Network based<strong> </strong>threats like spyware, malware, command and controls attacks</p><p><strong>Network — </strong>Data encryption in transit. Multilayer security</p><p><strong>Operations — </strong>24hrs * 365 days monitoring</p><p><strong>Customer Responsibility:</strong></p><p><strong>Granular access policy</strong></p><p>Ø <strong>MFA/Security Key/) google workspace hijacking</strong></p><p>Ø <strong>Ensure to have the visibility</strong></p><p>Ø <strong>Need to have plan and place in security breech</strong></p><p>Ø <strong>Maintenance operational redness</strong></p><p><strong>Network Address Translation (NAT) — Let certain resources to connect the outbound connection without creating the external IP addresses.Provide outgoing connectivity to the following resources</strong></p><p>· <strong>Compute Engine VM without external IP address</strong></p><p>· <strong>Private google kubernates engine</strong></p><p>· <strong>Cloud function (through Serverless VPC)</strong></p><p>· <strong>Cloud Run (through Serverless VPC)</strong></p><p>· <strong>App engine standard instance (through Serverless VPC)</strong></p><p><strong>Devops Objectives</strong></p><p>1. Reduce Silos — Shared ownership</p><p>2. Accept failure as normal — build iterative, collaborative failure</p><p>3. Implement Gradual changes — Reduce the cost of failure</p><p>4. Leverage automation and tooling — Focus on TOIL automation</p><p>5. Measure Everything –</p><p>Google Cloud Operation Suits</p><p>1. Operation Focus tool — Cloud Monitoring/logging/Reporting/Service Monitoring</p><p>2. Application Management Performance tool — Cloud Debugger/Trace/Profiler</p><p><strong>All google cloud belongs to a project. Project Identity (Project ID and Project Number) is Globally unique to GCP.</strong></p><p>4 ways to interact with Google cloud</p><p>1. <strong>Cloud Platform console</strong> — GCP is web based administrator interface to create and manage the GCP projects and resources. Gives access to cloud shell. A temp VM with Pre-installed SDK</p><p><strong>2.</strong> <strong>Cloud console Mobile app</strong></p><p>3. <strong>Cloud Shell and SDK</strong> — Command line tool for GCP products and services.SDK Command like <strong>gcloud, gsutil (cloud Storage) and bq(bigquery). </strong>SDK also available as docker images</p><p>4. <strong>Rest based API</strong> — Programmatic access to product and Services. Use JSON and Oauth 2.0 for authentication</p><p><strong>VPC — </strong>have Global scope — have subnet in any region — subnet can span the zone — can have resources in different zone on same subnet region</p><p><strong>VPC Flow Log- </strong>Keep records of the network flows received and sent by VM instances</p><p><strong>1.</strong> Traffic between regions and zones</p><p><strong>2.</strong> Traffic to specific countries on internet</p><p><strong>3.</strong> Top talkers</p><p><strong>Container: — </strong>The idea of container is to give user the independent scalability of workload in PaaS and add an abstraction layer for OS and hardware in IaaS.</p><p><strong>Kunernates (K8s):- </strong>K8s makes it easy to orchestrate many containers on many hosts, scale them as microservice, and deploy Rollouts and Rollbacks.</p><p>1. Imperative (using commands)</p><p>2. Declarative (using configure file)</p><p><strong>Google Adoption Framework — A unified approach to the cloud</strong></p><p>GAF works on 4 themes and 3 different phases</p><p><strong>Themes</strong></p><p><strong>1.</strong> <strong>Learn</strong> — Quality and scale of learning program</p><p><strong>2.</strong> <strong>Lead</strong> — support from leadership to migrate to cloud/budget/governess/assessed</p><p><strong>3.</strong> <strong>Scale</strong> — the extent to which use cloud native services</p><p><strong>4.</strong> <strong>Security</strong> -type of security for cloud/what controls are in place/technologies/strategies</p><p><strong>Phases</strong></p><p><strong>1.</strong> <strong>Tactical</strong> — Reduce cost on existing system and migrate to cloud with minimal disruption. Quick return on investment. Quick wins only (short-term goal)</p><p><strong>2.</strong> <strong>Strategic — </strong>Increase the value delivered by increasing the scope of migration on cloud. Also Include people and process and streamline the operations to be both more efficient and effective. A broader vision with an eye of future needs and scale (Mid-term goal)</p><p><strong>3.</strong> <strong>Transformational — </strong>once cloud migration works smoothly then turn the attention towards integrating the data and insight. Organization become an engine of innovation making it a partner to the business (long-term goal)</p><p><strong>Google Support Plan</strong></p><p><strong>Basic — Free with cloud subscription support only case, phone, and chat support for billing issues only.</strong></p><p><strong>Standard — Unlimited access to technical support to troubleshoot/help and explore. 4 hours initial response time. 8 hours and 5 days response only in English only. Active assist recommender API. Multi channel tech support</strong></p><p><strong>Enhanced — 1 hr initial response time. Multi channel/language support. 24/7 support for high/critical issues. Active assist recommender API. Cloud Support API. Access to purchased plant event system/Assured support/Technical account advisor service. Third party technical support</strong></p><p><strong>Premium — 15 min initial response. includes unlimited Designated Contacts (TAM). Support to critical workload. All standard support included. Training credits. New products review. Access to purchase mission critical services/Assured support.</strong></p><p><strong>Support HUB — </strong>Google provide a page which provide everything needed around support.</p><p><strong>Migration Services- These services can be use to migrate date to Google cloud</strong></p><p>Ø <strong>Database Migration Service — </strong>Migrate data to cloud SQL</p><p>Ø <strong>Storage transfer service </strong>— On premise to google cloud</p><p>Ø <strong>Transfer Appliances</strong> — Physical transfer of large data from on premises to google cloud</p><p>Ø <strong>Migrate for Compute Engine (Google cloud VMware engine)- </strong>running VMs to google cloud(on-premises or other cloud — lift and shift workload with minimal changes and risk)</p><p>Ø <strong>Migrate to Anthos- Migrate VMs to google container</strong></p><p>Ø <strong>Bigquery data transfer service- Migrate Analytics data to bigquery</strong></p><p><strong>Google provide 3 compliances resource pages:</strong></p><p><strong>Compliance Resource Manager — CRM</strong> provides easy, on-demand access to industry leading security certificates, third party audit certificates/documents/reports/contract commitments at no extra cost.</p><p><strong>GDPR Home Page — </strong>Provide all support to prioritize and improve the security of user personal data</p><p><strong>Compliance Offering — </strong>This page provides all Google certifications and compliances standard related information if satisfied. This page also provides region/sector specific certifications/regulations and all other general information.</p><p><strong>Rightsizing recommendation -</strong>Compute engine provide machine type recommendation to help to resource utilization of your vm instances. These recommendations are generated automatically based on system metrics gathered by google monitoring services over the previous 8 day.</p><p><strong>Data Loss Prevention (DLP) Service </strong>— DLP provides access to powerful sensitive data inspection, Classification, and de-identification platform. can be used to mask, tokenize, and transform sensitive elements in your data stored in Cloud Storage, BigQuery, and Datastore</p><p>Inspection — Inspect the data and know what data we have</p><p>Classification- how sensitive the data</p><p>De-identification- process of removing masking and replacing the data.</p><p><strong>Cloud CDN </strong>— Faster way to provide content to users. Its like cache in google cloud for content. Secure using signed cookies and URLs.</p><p><strong>Cloud composer- </strong>Fully managed Apache workflow orchestration services to manage multiple pipelines.</p><p><strong>Data Stream — </strong>Serverless, easy to use setup with secure connection. Send data from any data storage to cloud storage.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6ea54fae3da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Notes, That will get you Terraform Certification!!]]></title>
            <link>https://medium.com/@amitg2/notes-that-will-get-you-terraform-certification-145f91ae936c?source=rss-ef3bbdb8506e------2</link>
            <guid isPermaLink="false">https://medium.com/p/145f91ae936c</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[iac]]></category>
            <dc:creator><![CDATA[Amit Gupta]]></dc:creator>
            <pubDate>Wed, 16 Feb 2022 04:47:28 GMT</pubDate>
            <atom:updated>2022-02-16T06:23:11.424Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*AaNQuTLns9CKUaA26mcsfg.png" /></figure><p>Hello Friends, sharing the content, I used while preparing for Terraform certification. These will prepare you on almost all topics of the exam. All the Best!! Please don’t forget to share your success stories.</p><h3>IAC — Infrastructure as a Code</h3><p>1. What is IAC?</p><p>a. Write and execute code to define, create, update, deploy and destroy the infrastructure</p><p>b. IaC makes changes idempotent, consistent, repeatable, and predictable.</p><p>2. Features of IAC</p><p>a. IAC</p><p>b. Execution plan</p><p>c. Resource Graph</p><p>d. Change Automation</p><p>3. Benefits of IAC</p><p>a. More Reliable</p><p>b. More Manageable</p><p>c. Automation</p><p>d. Re-usability</p><p>e. Versioning</p><p>4. How IAC make easy to provision infrastructure</p><p>a. Saving Time by Provisioning and apply same infrastructure configuration</p><p>b. Standardize workflow can be used across provides lie AWS/Google/Azure etc by using a common syntax across all.</p><p>5. What is Idempotent in terms of IaC — <strong>no matter how many times you run your IAC</strong> result is same every time.</p><p>6. What are Day 0 and Day 1 activities?</p><p>a. Day 0: Code Provisions and configures your initial infrastructure</p><p>b. Day 1: Refer to OS and app configurations you apply after you have initially build the infra</p><p>7. Advantage of Terraform</p><p>a. Cloud Agnostic</p><p>b. State Management</p><p>c. Operator Confidence</p><p>8. Terraform builds a graph of all resources, and parallelizes the creation and modification of any non-dependent resources.</p><h3>Terraform Vs Other IAC</h3><p>1. Multi-cloud deployment — for Fault Tolerance — more graceful recovery of the loss of a region or entire provider</p><p>2. Cloud Agnostic allows a single configuration to manage, deploy multiple cloud provider for same infrastructure and to even handle cross-cloud dependencies</p><p>3. Terraform being cloud agnostic — It simplifies management and orchestration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*11EXjjN48tk8I4PfIZWLDg.jpeg" /><figcaption>Terraform — Cloud Agnostic</figcaption></figure><h3>Terraform</h3><p>1. <strong>Terraform Block: </strong>The Terraform block contains Terraform settings, including the required providers Terraform will use to provision your infrastructure. For each provider, the source attribute defines an optional hostname, a namespace, and the provider type. Terraform installs providers from the <a href="https://registry.terraform.io/">Terraform Registry</a> by default.</p><p>2. Each module should at least declare the minimum provider version it is known to work with, using the &gt;= version constraint syntax:</p><h3>Provider Requirements</h3><p>A provider requirement consists of a local name, a source location, and a version constraint</p><p>Each Terraform module must declare which providers it requires, so that Terraform can install and use them. Provider requirements are declared in a required providers block.</p><p><strong>The required_providers block must be nested inside the top-level terraform block (which can also contain other settings).</strong></p><p>Outside of the required_providers block, Terraform configurations always refer to providers by their local names.</p><p><strong>Terraform Cloud/Enterprise always install at every run</strong></p><p><strong>Terraform CLI initialize in a working directory. CLI supports optional cache to install plugin in a local directory using “plugin_cache_dir” in CLI congihuration</strong></p><p><strong>dependency lock file-</strong>create this file and commit to version control to use specific version of providers. <strong>If a lock file is present, Terraform Cloud, CLI, and Enterprise will all obey it when installing providers. Lock file is always name .terraform.lock.hcl</strong></p><p>build in terraform provides <a href="https://www.terraform.io/docs/language/state/remote-state-data.html">the </a><a href="https://www.terraform.io/docs/language/state/remote-state-data.html">terraform_remote_state data source</a>.</p><p><strong>Develop provider — </strong>Providers are written in Go, using the Terraform Plugin SDK.</p><p>Unlike many other objects in the Terraform language, a provider block may be omitted if its contents would otherwise be empty. Terraform assumes an empty default configuration for any provider that is not explicitly configured.</p><p><strong>Variable:-</strong></p><p><strong>Input Variables</strong></p><p>The name of a variable can be any valid identifier except the following:</p><p>source, version, providers, count, for_each, lifecycle, depends_on, locals.</p><p>Optional Argument for Variable block</p><p>Type, default, description, sensitive (if true not display the value in log and terminal output), validation</p><p>Variable Type</p><p>Primitive Type — string, number, bool</p><p>Complex Type — list(&lt;TYPE&gt;), set(&lt;TYPE&gt;), map(KEY=&lt;TYPE&gt;,KEY1=&lt;TYPE&gt;), object({ATTR_NAME=&lt;TYPE&gt;,….}),</p><p>Maps can be made with braces ({}) and colons (:) or equals signs (=)</p><p>To mark an attribute as optional, use the additional optional(…) modifier around its type declaration:</p><p>tuples({&lt;TYPE&gt;,….})</p><p>Keyword “any” indicate that variable can accept any type of value.</p><p>Null — can reset to empty</p><p><strong>In Terraform 0.12 and later, variables with map and object values behave the same way as other variables: the last value found overrides the previous values.</strong></p><p><strong>Variable Precedence from top to bottom</strong></p><p>1. Variables define on command line using -vars OR -vars-file option</p><p><strong>2.</strong> Variables define on *.auto.tfvars OR *.auto.tfvars.json</p><p><strong>3.</strong> terraform.tfvars.json file if present</p><p><strong>4.</strong> Terraform.tfvars file if present</p><p><strong>5.</strong> Variables define as environment variable</p><p><strong>Output Variables:</strong></p><p><strong>1.</strong> Root module can use output to print certain data on CLI</p><p>2. Child module can use to subset the out to parent module. In parent it can be accessed as follow</p><p>module.&lt;Child_MODULE NAME&gt;.&lt;OUTPUT Variable NAME&gt;.</p><p>3. In Remote state root module output can be used by any other configuration</p><p>Output block Arguments</p><p>Value (required), description (Optional),sensitive (Optional),depand_on (Optional)</p><p><strong>Local Variables</strong></p><p><strong>Locals{</strong></p><p><strong>Common_Tags={key=value,key1=value1}</strong></p><p><strong>}</strong></p><p><strong>Use à local.key</strong></p><p><strong>Modules:</strong></p><p>Every Terraform configuration has at least one module, known as its <em>root module</em>, which consists of the resources defined in the .tf files in the main working directory.</p><p><strong>Arguments: Source, Version, All input variables arguments (default, type, description, validation, sensitive)</strong></p><p><strong>Terraform workspace Commands:</strong></p><p>Default workspace name — default (Can not be deleted)</p><p>Show workspace details — terraform workspace show</p><p>List workspace — terraform workspace list</p><p>Create new Workspace — terraform workspace new newworkspaceName</p><p>Switch workspace — terraform workspace select workspacename</p><p>Delete workspace — terraform workspace delete workspacename</p><p><strong>Condition and Tags — —</strong></p><p>Resource “aws_instances” “instancesEx{</p><p>tags={</p><p>Name = “web — ${terraform.workspace}”</p><p>}</p><p>Count=”${terraform.workspace == “default”?5:1}”</p><p>}</p><h3>Terraform State</h3><p>The terraform state command is used for advanced state management. As your Terraform usage becomes more advanced, there are some cases where you may need to modify the Terraform state. Rather than modify the state directly, the terraform state commands can be used in many cases instead.</p><p>Terraform Cloud always encrypts state at rest and protects it with TLS in transit.</p><p>The S3 backend supports encryption at rest when the encrypt option is enabled. IAM policies and logging can be used to identify any invalid access. Requests for the state go over a TLS connection</p><p>terraform state list</p><p>terraform state list resoursename</p><p>for attribute details — terraform state show resoursename</p><p><a href="https://www.terraform.io/docs/cli/commands/graph.html">terraform graph — command</a> creates a visual representation of a configuration or a set of planned changes. The output is in the DOT format, which can be used by GraphViz to generate charts</p><p>CLi Configuration File Windows — user’s %APPDATA%/terraform.rc on linux userhomedirectoru.terraformrc</p><h3>Core Terraform workflow</h3><p><strong>Write à Plan à Apply</strong></p><p><strong>terraform init</strong></p><p><strong>terraform get — — use to install module</strong></p><p><strong>terraform init -upgrade (upgrade modules and plugin version)</strong></p><p><strong>terraform init -backend=false (will not run the backend command)</strong></p><p><strong>terraform init -get=false (skip initializing child module)</strong></p><p><strong>terraform init -get-plugins=false (skip initializing plugins)</strong></p><p><strong>terraform init -from-module=(SourceModuleName)</strong></p><p><strong>terraform fmt — format the terraform files in a directory</strong></p><p><strong>terraform validate — validate all the configuration in a directory. Validate the configuration syntactically and internally consistent (logic) regardless of any provided variables or existing state</strong></p><p><strong>terraform plan</strong></p><p><strong>terraform plan -refresh=true (update state prior to check the differences )</strong></p><p><strong>terraform plan -target=MODULENAME/RESOURCENAME Address to target name</strong></p><p><strong>terraform plan -out=tfplan (Store the execution plan)</strong></p><p><strong>terraform plan -destroy (Preview the destroy command)</strong></p><p><strong>terraform plan -detaild-exitCode</strong></p><p><strong>Plan out display with codes</strong></p><p><strong>* 0 = Succeeded with empty diff (no changes)</strong></p><p><strong>* 1 = Error</strong></p><p><strong>* 2 = Succeeded with non-empty diff (changes present)</strong></p><p><strong>terraform apply tfplan (execute the store plan)</strong></p><p><strong>terraform apply -auto-approve (apply without any manual approval)</strong></p><p><strong>Using Vault plan retrieve the credentials and write the result to plan config</strong></p><p><strong>if apply command run after 120 second of getting the token (generated from the moment the config retrieves the temporary AWS credentials) then it could fail as token has expired. Size can be increased by using changing the setting for “default_lease_ttl_seconds”</strong></p><p><strong>terraform destroy (Actually destroy the terraform managed infrastructure)</strong></p><p><strong>terraform import addressID — import any existing resources created by other means and add into the state file at the given address. Configuration still need manual modification</strong></p><p><strong>implicit dependency — implicit dependency via the interpolation expression can inform terraform about the relationship and determine the correct order to implement the infrastructure.</strong></p><p><strong>To change directory — terraform -chdir=environments/production apply</strong></p><p><strong>Explicit dependency — dependency which are not visible to terraform. Argument (Depands_on) define the dependency resource</strong></p><h3>Terraform State</h3><p><strong>Terraform backend determines how the state is loaded and execute. abstract the core functionality. Use ‘local’ as default backend</strong></p><p><strong>Local Backend — store state file locally. Lock the local file and execute operation and perform using system API</strong></p><p><strong>Terraform{</strong></p><p><strong>Backend “local” {</strong></p><p><strong>path = “relative/path/to/terraform.tfstate”</strong></p><p><strong>}</strong></p><p><strong>}</strong></p><p><strong>The following configuration options are supported:</strong></p><p><strong>Local-</strong></p><p><strong>path — (Optional) The path to the tfstate file. This defaults to “terraform.tfstate” relative to the root module by default.</strong></p><p><strong>workspace_dir — (Optional) The path to non-default workspaces.</strong></p><p><strong>Default path to default local is the path to terraform.tfstate in root directory</strong></p><p><strong>State locking — if backend supported then this happened to all write state. If fails then terraform stop working</strong></p><p><strong>Can be set to false</strong></p><p><strong>-lock=false</strong></p><p><strong>There are some important limitations on backend configuration:</strong></p><p><strong>A configuration can only provide one backend block.</strong></p><p><strong>A backend block cannot refer to named values (like input variables, locals, or data source attributes).</strong></p><p><strong>State Command</strong></p><p>terraform state</p><p><strong>Type of Backend</strong></p><p><strong>Standard — state management, state storage and locking,</strong></p><p><strong>Enhanced — shared storage space for all team members for use. apart from standard plus remote operations. Remote state loaded only in memory when in used</strong></p><p><strong>Switching from remote to local backend — remove terraform backend block from the configuration and init again. It will ask to switch</strong></p><p><strong>Backup state file — defining backup</strong></p><p><strong>Terraform refresh — refresh the state file to last updated state file only</strong></p><p><strong>Partial Configuration — When we remove secrets and access keys from the configuration this is called partial configuration.</strong></p><p><strong>How to pass values to partial configuration</strong></p><p><strong>1.</strong> <strong>Interactively — unless interactive input disabled it will ask on CLI for each required value</strong></p><p><strong>2.</strong> <strong>File — using variables file. File can be specified using -backend-config=PATH or secret/access keys can be stored in VAULT and download locally before running terraform</strong></p><p><strong>3.</strong> <strong>Command line Key Value Pair — not recommended — -backend-config=”KEY=VALUE”</strong></p><p><strong>a.</strong> <strong>Terraform init \-backend-config=”KEY=VALUE”\-backend-config=”KEY=VALUE”</strong></p><p><strong>Basic requirement to store partial configuration — to have empty backend configuration</strong></p><p><strong>Terraform{</strong></p><p><strong>backend “consul”={}</strong></p><p><strong>}</strong></p><p><strong>####IMP#### Terraform Cloud always encrypts the state at rest and protects it with TLS in transit.</strong></p><p><strong>You should only use force unlock command when automatic unlocking fails.</strong></p><h3>Debugging Terraform</h3><p>Set the environment variable TF_LOG (to any value TRACE, DEBUG, INFO, WARN or ERROR)</p><p>TRACE is the most verbose and it is the default if TF_LOG is set to something other than a log level name then it will disable logging</p><p><strong>TF_LOG_PATH </strong>is used to create an output log file. Forced terraform to append log in the specified log file define at this path.</p><p><strong>Environment Variable</strong></p><p>TF_INPUT=0 disable prompt for input variables</p><p>TF_VAR_ENVVARIABLENAME — Format to define any environment variable</p><p>TF_DATA_DIR — path to store configuration — — By default configuration data is written into a .terraform subdirectory of the current directory</p><p>TF_REGISTRY_DISCOVERY_RETRY</p><p>TF_REGISTRY_CLIENT_TIMEOUT</p><p>TF_CLI_CONFIG_FILE</p><p>TF_IGNORE = trace — display the file name of all files contains .terraform ignore extension</p><p><strong>## Terraform crash to check view crash.log file</strong></p><p>If Terraform ever crashes (a “panic” in the Go runtime), it saves a log file with the debug logs from the session as well as the panic message and back trace to crash.log.</p><p>panic message is the first thing to search for in case of crash and then back-trace</p><p><strong>Primary method to separate infrastructure configuration</strong></p><p><strong>Directories — Directory separated means two different configuration for different env</strong></p><p><strong>Workspace — Workspace separated means same configuration with different state in 2 different workspaces</strong></p><h3>Module</h3><p><strong>A module is a set of terraform files in a single directory contains configurations file in .tf format</strong></p><p><strong>Benefits for Module –</strong></p><p><strong>1.</strong> <strong>Organize configuration</strong></p><p><strong>2.</strong> <strong>Encapsulation configuration</strong></p><p><strong>3.</strong> <strong>Re-use of configuration</strong></p><p><strong>4.</strong> <strong>Provide consistency and ensure best practice</strong></p><p><strong>Use Module block to import configuration from different files/directories</strong></p><p><strong>2 ways to use module</strong></p><p><strong>Local — local file system and Remote — Remote file system</strong></p><p><strong>Set output of Module àmodule.&lt; ModuleName &gt;.&lt;outputName&gt;</strong></p><p><strong>Module “consul”{</strong></p><p><strong>Source=”/hashicorp/consul/aws”</strong></p><p><strong>Version=””</strong></p><p><strong>}</strong></p><p><strong>Syntax for referencing a module in registry — — </strong>&lt;NAMESPACE&gt;/&lt;NAME&gt;/&lt;PROVIDER&gt;</p><p>Terraform recommended semantic versioning for all modules</p><p><strong>What is module path- Address to a module — multiple module in a path indicate nesting. If no resource spec define in path then all resource of that module. If module path is missing then apply on root.</strong></p><h3>Understand Terraform Cloud and Enterprise capabilities</h3><p><strong>Sentinel — </strong>Embedded Policy as code framework. Fined grained, logic-based policy decision and extended to user information form external system<strong>.</strong></p><p>1. Codifying the policies, remove the ticketing queues</p><p>2. Has a full testing framework</p><p><strong>3.</strong> Avoid ticketing and provide self service capabilities, end to end automation, remove the friction of developers and operator</p><p><strong>Benefits of Sentinel Policy-as-code:</strong></p><p>1. Sandboxing</p><p>2. Codification</p><p>3. Version Control</p><p>4. Testing</p><p>5. Automation</p><p>Sentinel Policy Enforcement Level</p><p>1. Hard-Mandatory, 2. Soft-Mandatory, 3. Advisory</p><p>At this time, only HTTP/HTTPS remote sources are supported</p><p><strong>Private Module Registry </strong>— Registry to store all module for organization, share within the team, support searching, filtering and versioning</p><p><strong>Workspace- </strong>Separate working directory for different configuration , contains everything terraform needs to create and manage infrastructure.</p><p>Terraform CLI workspace — allow multiple state file in a same directory</p><p>Terraform Cloudworkspace — contains everything needed to manage a given set of infrastructure</p><p><strong>Terraform cloud can have read, plan, write and admin permission</strong></p><p><strong>Organization admin can create a group and assign users and permission</strong></p><p><strong>terraform cloud team plan charges per user</strong></p><p><strong>Style Conventions</strong></p><p>· <strong>Indent 2 space for each nesting level</strong></p><p>· <strong>Align the equal sign for each variable in same nesting level</strong></p><p>· <strong>Place Meta-argument first then arguments then blocks and last with meta-blocks</strong></p><p><strong>The Metta Argument Section use to define argument that can be used in each resource sections</strong></p><p><strong>Resource block are declarative</strong></p><p><strong>The format of resource block configurations is as follows:</strong></p><p><strong>&lt;block type&gt; “&lt;resource type&gt;” “&lt;local name/label&gt;”</strong></p><p><strong>Provisioner Block are non-declarative and un predictable</strong></p><p><strong>Resource META-Argument</strong></p><p><strong>Depands_on</strong></p><p><strong>For_each</strong></p><p><strong>Count -</strong>&lt;TYPE&gt;.&lt;NAME&gt;[&lt;INDEX&gt;] or module.&lt;NAME&gt;[&lt;INDEX&gt;] (for example, aws_instance.server[0])</p><p><strong>### </strong>A given resource or module block cannot use both count and for_each.</p><p><strong>Providers</strong></p><p><strong>Life Cycle — nested block and use within resource — The lifecycle settings all affect how Terraform constructs and traverses the dependency graph</strong></p><p>· <strong>Create_before_destroy (bool)</strong></p><p>· <strong>Before_destroy (bool)</strong></p><p>· <strong>Ignore_changes (list of attributes)</strong></p><p><strong>Provisioner — </strong>Provisioners should only be used as a last resort. For most common situations there are better alternatives.</p><p>1. The self-object represents the provisioner&#39;s parent resource, and has all of that resource&#39;s attributes. For example, use self.public_ip to reference an aws_instance&#39;s public_ip attribute.</p><p><strong>2.</strong> Suppressing provisioner logs on CLI</p><p><strong>3.</strong> Creation time provisioner</p><p><strong>a.</strong> If a creation-time provisioner fails, the resource is marked as <strong>tainted</strong>.</p><p><strong>4.</strong> Destroy time provisioner</p><p><strong>a.</strong> When=destroyed it means provisioner define withing destroy</p><p><strong>b.</strong> Remote-exec will use to execute the script</p><p><strong>5.</strong> Multiple Provisioner</p><p><strong>6.</strong> Failure Behavior</p><p><strong>a.</strong> Continue</p><p><strong>b.</strong> Fail</p><p><strong>Connection Block:-</strong></p><p><strong>Nested directly to resource affect all provisioner of that resource</strong></p><p><strong>Connection with in resource only affect that resource local connection settings</strong></p><p><strong>Generic Provisioner</strong></p><p><strong>File- </strong>3 argument (source, destination, content)</p><p>Directory upload — — rule</p><p>(i) If source /foo and destination /tmp then it will upload the data to /tmp/foo</p><p>(ii) If source /foo/ and destination /tmp then it will upload the data to /tmp not in /tmp/foo</p><p><strong>Local-exec — </strong>Invokes a local executable after a resource is created. but not guaranteed that resource will be fully operated</p><p>Argument — Command — (required),working_dir(optional), interpreter(optional-default select based on OS), environment(Optional- environment variable (key value pair))</p><p><strong>Remote-exec — </strong>Invokes executable on remote server after resource creation. This can be used to run a configuration management tool, bootstrap into a cluster, etc</p><p>Argument — inline (list of command scripts- execute in provided order),</p><p>Script — path to local scripts copy from local to remote resource and execute there</p><p>Scripts — list of path to local scripts copy from local to remote resource and execute there. This can not be provided with inline and script.</p><p>The data block creates a data instance of the given <em>type</em> (first block label) and <em>name</em> (second block label). The combination of the type and name must be unique.</p><h3>Terraform CLI</h3><p><strong>Terraform login hostname</strong></p><p><strong>Default</strong></p><p><strong>1.</strong> hostname is app.terraform.io.</p><p><strong>2.</strong> Terraform will obtain an API token and save it in plain text in a local CLI configuration file called credentials.tfrc.json. When you run terraform login,</p><p><strong>3.</strong> Terraform will remove the token stored in plain text in a local CLI configuration file called credentials.tfrc.json</p><h3>Terraform Cloud and Terraform Enterprise are different distributions of the same application</h3><p><strong>Private module Registry — Naming convention — hostname/namespace/name/provider</strong></p><p><strong>Public module registry format — namespace/name/provider</strong></p><p><strong>Requirements to publish a module on public Registry</strong></p><p><strong>1.</strong> <strong>Git repo with Public access</strong></p><p><strong>2.</strong> <strong>Naming convention — Terraform-&lt;provider&gt;-&lt;name&gt;</strong></p><p><strong>3.</strong> <strong>Repo description</strong></p><p><strong>4.</strong> <strong>Standard Module Structure</strong></p><p><strong>5.</strong> <strong>x.y.z tags for release version</strong></p><p>Terraform is mainly divided in to 2</p><p><strong>Terraform Core</strong> — Core Binary use to interact with plugin to create infrastructure</p><p><strong>Terraform Plugin</strong> — written in GOLANG language communicate with Terraform Core API over RPC interface.</p><p>Terraform is Mutable or immutable infrastructure? TF in an immutable infrastructure as you can create a new infra and redirect the traffic so no change in existing one and change the infra.</p><p>Required_Version — if given than all collaborative environment should use specific version at-least</p><p>Required_Provider control the minimum version for all resources providers</p><p>Version constrained only works with module installed on Terraform Public and Private registry repository</p><p>experiments — — can use any experimental features if available in release</p><p>Provider-meta — Meta information for all providers</p><h3>Terraform Cloud for Business or Terraform Enterprise.</h3><p>Terraform enterprised userd PostgresSQL as backend database for cluster environment</p><p>Self-Service Infrastructure, Audit Logging, and SAML/SSO are only available in Terraform Cloud for Business or Terraform Enterprise.</p><p>Air gapped installs do not check for updates over the network. Need to install terraform on a location where no internet then it is called Air-gapped installation</p><p>Terraform is available for macOS, FreeBSD, OpenBSD, Linux, Solaris, Windows.</p><p>Terraform Cloud use OAuth protocol to authenticate the VCS providers</p><h3>Terraform Free Plan:-</h3><p>1. Infrastructure as a code</p><p>2. State management /workspace</p><p>3. Remote Runs/Resource Graph</p><p>4. Providers/Modules</p><p>5. Remote Operation</p><p>6. VCS connection</p><p>7. Secure Variable Storage</p><p>8. Private/Public Repository</p><p>9. Community support</p><h3>Terraform Team and Governance Plan:-</h3><p>1. Free Plan (All inclusive)</p><p>2. Team Management</p><p>3. Sentenial Policy as Code Management/Policy enforced</p><p>4. Cost Estimation</p><p>5. Cloud support</p><p>6. Bronze support</p><h3>Business Plan:-</h3><p>1. Team and governance Plan (All inclusive)</p><p>2. SSO/Audit log/Self-hosted Agent</p><p>3. Custom concurrency</p><p>4. Self-Hosted Option</p><p>5. Premium Support</p><p>6. Silver/Gold Support</p><p><strong>Only constants are allowed to Terraform Block</strong></p><p>If output variable is marked as sensitive=true then value will not be displayed in the CLI but it is stored into state file.</p><h3>Terraform Client</h3><p>Terraform client is available for:</p><p>1. windows</p><p>2. macOS</p><p>3. Linux</p><p>4. FreeBSD</p><p>5. OpenBSD</p><p>6. Solaris</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=145f91ae936c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Go Serverless with AWS Best Practices!!!]]></title>
            <link>https://medium.com/@amitg2/go-serverless-with-aws-best-practices-74ee87810af0?source=rss-ef3bbdb8506e------2</link>
            <guid isPermaLink="false">https://medium.com/p/74ee87810af0</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[lambda]]></category>
            <dc:creator><![CDATA[Amit Gupta]]></dc:creator>
            <pubDate>Wed, 22 Dec 2021 05:59:24 GMT</pubDate>
            <atom:updated>2021-12-22T05:59:24.386Z</atom:updated>
            <content:encoded><![CDATA[<p>Trust me or not, if you are new to cloud paradigm &amp; does not have complete insights of your workload &amp; data patterns ‘Serverless’ is the best way to start. This paper will describe the need of going Serverless &amp; the best practices to follow while designing &amp; developing your Apps for Serverless stack on AWS cloud.</p><p>**<strong>The focus of the paper would be around Serverless web applications</strong>.</p><h3>Objective</h3><p>The objective of this paper is to highlight the practices to follow while designing the Serverless Apps on AWS cloud.</p><h3>Introduction</h3><p>For demonstration let’s consider a typical web application on AWS, which would look somewhat similar to below mentioned architecture. (there could be other variations based on use case) &amp; as usual would be having webhosting, compute, storage &amp; other components required for any web application on cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hxUpsvIsWrceUSH2cjrCkQ.png" /></figure><p>Having mentioned that, lets directly jump to the discussion on the various components &amp; first thing first : WHY SERVERLESS ???</p><h3>WHY SERVERLESS</h3><p><strong>Operational</strong> : the solution would consists of managed services which doesn’t required a user to manage servers</p><p><strong>Cost</strong> : pay per use (if you are not sure about the size of server provisioning)</p><p><strong>Available</strong> : all the time (no consideration on this front)</p><p><strong>Scalable</strong> : fairly scalable (no capacity planning)</p><p><strong>Resilient</strong> : built on top of fault tolerant infrastructure</p><p>The above is enough to convince that going Serverless is fairly easy then planning into entirety that will definitely cost time to market as well as good amount of homework on parameters like availability/scalability &amp; fault tolerance.</p><p>Now let’s deep dive into components :</p><h3>Compute — AWS Lambda</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/133/1*dY-j_IY73SOqeiem-vQ56w.png" /><figcaption>AWS Lambda</figcaption></figure><p>The is used as function as a code.</p><p>· Language : try using NodeJS/Python to keep it light weight.</p><p>· Memory : optimize as per usage. Check the past execution to arrive at optimal value.</p><p>· Flexibility : always use environment variables or parameter store for externalizing the configuration parameters.</p><p>· Deployment : prefer SAM over others. This being from AWS got first priority in implementing new features &amp; large AWS community support.</p><p>· Versioning : Always use lambda versioning to support old &amp; new consumers.</p><p>· Concurrency : Be cognizant about the limit of 1000 per region &amp; if required provision to allocate the primary functions upfront.</p><p>· Re-use &amp; Extensibility : Always use Lambda layers to reuse the code across different functions.</p><p>· Secrets/Parameters : Always use secrets manager or parameter store.</p><p>· Tagging : Always tag Lambda functions, this will not only enable to query for cost &amp; usage but also can be used to enforce tag based policies.</p><p>· Size : Keep the size of code package within limits.</p><p>· Timeout : consider only for functions which can execute within limits of 15 mins.</p><h3>AWS API Gateway</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/159/1*rBjYDCHwO5PCRNhwz5qjWA.png" /><figcaption>API Gateway</figcaption></figure><p>The is used as interface for API’s.</p><p>· Serverless : managed services</p><p>· Cost : pay per use</p><p>· Throttling : used to consider the backend limits, also to keep check of limits per customer.</p><p>· API Keys : Can be distributed per customer for usage &amp; limits</p><p>· Timeout : consider timeout of 29 seconds while planning for API’s</p><p>· Authentication &amp; Authorization : Consider API Gateway for these functions to stop unauthorized call at the interface level itself</p><p>· Stages : use stages for multiple environments</p><h3>Storage — DynamoDB</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/161/1*JhugXoPF1l2t8CDOiDq32w.png" /><figcaption>DynamoDB</figcaption></figure><p>The is used as data store for persistence.</p><p>· Partition Key : always avoid hot keys &amp; hot partitions to enhance the performance. Choose the keys to distribute the load across partitions.</p><p>· Access Pattern : design tables as per access patterns for better performance i.e., read &amp; write intensive tables.</p><p>· Query : choose scans &amp; filters judiciously. In most of the cases filter would give better performance due to limiting the data size.</p><p>· Scaling : use ‘OnDemand’ instead of provisioned for cases where the traffic size is not that familiar.</p><p>· Index : Use local secondary indexes when retrieving the data based on partition (or sort) key. Add additional indexes like Global Secondary indexes only on need basis &amp; be careful about the capacity units.</p><h3>Conclusion</h3><p>I hope the above share would help as quick reference while working on AWS Serverless stack. There are other patterns &amp; practices suggested by AWS as part of “AWS Well-Architected” framework &amp; should be referenced as applicable</p><h3>Reference</h3><p><a href="https://aws.amazon.com/architecture/well-architected">https://aws.amazon.com/architecture/well-architected</a></p><p><a href="https://aws.amazon.com/blogs/apn/the-5-pillars-of-the-aws-well-architected-framework/">https://aws.amazon.com/blogs/apn/the-5-pillars-of-the-aws-well-architected-framework/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74ee87810af0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>