<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ankit Mehta</title>
    <description>The latest articles on DEV Community by Ankit Mehta (@ankyitm).</description>
    <link>https://dev.to/ankyitm</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F258300%2Fa521ec11-dedd-445f-be01-9f960a9e4256.jpeg</url>
      <title>DEV Community: Ankit Mehta</title>
      <link>https://dev.to/ankyitm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ankyitm"/>
    <language>en</language>
    <item>
      <title>Terraforming Alibaba Cloud - VPC and vSwitch</title>
      <dc:creator>Ankit Mehta</dc:creator>
      <pubDate>Sun, 25 Apr 2021 01:51:27 +0000</pubDate>
      <link>https://dev.to/ankyitm/terraforming-alibaba-cloud-vpc-and-vswitch-9db</link>
      <guid>https://dev.to/ankyitm/terraforming-alibaba-cloud-vpc-and-vswitch-9db</guid>
      <description>&lt;p&gt;This post will help to build an Alibaba Cloud VPC and vswitches. VPC is an isolated network segment. Vswiches are logically divided VPC into smaller groups. For the people coming from another cloud provider, vswitches are overall subnets. &lt;/p&gt;

&lt;p&gt;As a best practice, it is recommended to use all the subnets in different subnets. &lt;/p&gt;

&lt;p&gt;This code is an extension of the previous post.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;variable "access_key" {}
variable "secret_key" {}
variable "region" {}

#Provider Definition
terraform {
  required_providers {
    alicloud = {
      source  = "aliyun/alicloud"
      version = "1.121.1"
    }
  }
}

#Provider Variables
provider "alicloud" {
  access_key = var.access_key
  secret_key = var.secret_key
  region     = var.region
}

#Resource Management Definition
resource "alicloud_resource_manager_resource_group" "development-rg" {
  resource_group_name = "aliyun-development-rg"
  display_name        = "aliyun-development-rg"
}

#VPC Definition
resource "alicloud_vpc" "vpc" {
  vpc_name          = "Development-VPC"
  description       = "This is development VPC"
  cidr_block        = "192.168.0.0/16"
  resource_group_id = alicloud_resource_manager_resource_group.development-rg.id
  tags = {
    type       = "development"
    managed-by = "Terraform"
  }
}

#VSwich Definition 
resource "alicloud_vswitch" "vswitch-1" {
  cidr_block = "192.168.1.0/24"
  zone_id    = "ap-southeast-1a"
  vpc_id     = alicloud_vpc.vpc.id

  vswitch_name = "development-subnet-1"

  description = "development-subnet-1"

  tags = {
    type       = "development"
    managed-by = "Terraform"
  }
}
resource "alicloud_vswitch" "vswitch-2" {
  cidr_block = "192.168.2.0/24"
  zone_id    = "ap-southeast-1b"
  vpc_id     = alicloud_vpc.vpc.id

  vswitch_name = "development-subnet-2"

  description = "development-subnet-2"

  tags = {
    type       = "development"
    managed-by = "Terraform"
  }
}
resource "alicloud_vswitch" "vswitch-3" {
  cidr_block = "192.168.3.0/24"
  zone_id    = "ap-southeast-1c"
  vpc_id     = alicloud_vpc.vpc.id

  vswitch_name = "development-subnet-3"

  description = "development-subnet-3"

  tags = {
    type       = "development"
    managed-by = "Terraform"
  }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>devops</category>
      <category>alibabacloud</category>
      <category>terraform</category>
    </item>
    <item>
      <title>Terraforming Alibaba Cloud - Resource Management </title>
      <dc:creator>Ankit Mehta</dc:creator>
      <pubDate>Sun, 18 Apr 2021 08:18:07 +0000</pubDate>
      <link>https://dev.to/ankyitm/alibaba-cloud-resource-management-3a70</link>
      <guid>https://dev.to/ankyitm/alibaba-cloud-resource-management-3a70</guid>
      <description>&lt;p&gt;Cloud services categorization and management can be challenging if resources are not tagged and group properly. This is the first post in the Alibaba Cloud Weekly series. &lt;/p&gt;

&lt;p&gt;In this blog post, the Alibaba Cloud Resource Management service is explained with Terraformation and provision. &lt;/p&gt;

&lt;p&gt;When starting with Alibaba Cloud, a default Resource Management group is created. However, keeping all the resources in the default group can be messy. One can create a Resource Management group separated by Department, Functional Group, or Environment. &lt;/p&gt;

&lt;p&gt;Following Terraform code can help in creating a new Resource Management group called "dev". For future posts, the same group will be used. &lt;/p&gt;

&lt;p&gt;For the current solution following two files are created. (upcoming blog posts will use modules)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.
├── terraform.tf
└── terraform.tfvars
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;terraform.tf :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;variable "access_key" {}
variable "secret_key" {}
variable "region" {}

terraform {
  required_providers {
    alicloud = {
      source  = "aliyun/alicloud"
      version = "1.121.1"
    }
  }
}

provider "alicloud" {
  access_key = var.access_key
  secret_key = var.secret_key
  region     = var.region
}

resource "alicloud_resource_manager_resource_group" "development-rg" {
  resource_group_name = "aliyun-development-rg"
  display_name        = "aliyun-development-rg"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;terraform.tfvars : ( &lt;a href="https://partners-intl.aliyun.com/help/doc-detail/116401.htm" rel="noopener noreferrer"&gt;To generate access and secret keys&lt;/a&gt; &lt;br&gt;
 &lt;a href="https://www.alibabacloud.com/help/doc-detail/40654.htm" rel="noopener noreferrer"&gt;For Regions&lt;/a&gt; )&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;access_key            = "SOMEACCESSKEY"
secret_key            = "SOMESECRETKEY"
region                = "SOMEREGION"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On successful, a new resource management group should be visible as follows. &lt;/p&gt;

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

&lt;p&gt;As stated earlier, the Resource Management Group is a one-stop location to find all the resources created for a particular group. &lt;/p&gt;

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

&lt;p&gt;While using Terraform for the next post, the resource group will be specified. Any resources created without resource group directive are created under the "Default" resource group. &lt;/p&gt;

&lt;p&gt;Note that there a soft limit on the Resource Management Group. Any account can have a maximum of 30 Groups, and this limit can be extended by opening a service limit increase ticket. &lt;/p&gt;

&lt;p&gt;Permissions can be set for each resource group to provide more granular access. &lt;/p&gt;

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

&lt;p&gt;Terraform Provider Reference: &lt;a href="https://registry.terraform.io/providers/aliyun/alicloud/latest/docs" rel="noopener noreferrer"&gt;https://registry.terraform.io/providers/aliyun/alicloud/latest/docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Do let us know your feedback in the comment box below. Also do let us know if you want us to explore any other Alibaba Cloud services. &lt;/p&gt;

&lt;p&gt;Next week we will add a VPC and VSwitch creation under the newly created Resource Management group. &lt;/p&gt;

&lt;p&gt;If you are new to Terraform and want us to create a post for it then do let us know in the comment section below. &lt;/p&gt;

</description>
      <category>terraform</category>
      <category>alibabacloud</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
