configure aws cli in linux server
aws configure
Tip: You can deliver temporary credentials to the AWS CLI using your AWS Console session by running the command 'aws login'.
AWS Access Key ID [None]: AKIA6REBIQNDIG*******
AWS Secret Access Key [None]: vONNNXCdf3DUiAaxIng1*********
Default region name [None]: us-east-1
Default output format [None]: json
create vpc with 2 subnets
- VPC:
- name: qt-demo-vpc
- cidr-range: 10.2.0.0/16
- 2 subnets
- name: app1 & app2 & app3
- cidr: 10.2.1.0/24, 10.2.2.0/24, 10.2.3.0/24
refer Terraform vpc
Argument: inputs to resources in terraform
resource "aws_vpc" "qt-demo-vpc" {
cidr_block = "10.2.0.0/16"
tags = {
Name = "main"
}
}
resource "aws_subnet" "app_1" {
vpc_id = aws_vpc.qt-demo-vpc.id
cidr_block = "10.2.1.0/24"
tags = {
Name = "app1"
}
depends_on = [ aws_vpc.qt-demo-vpc ]
}
resource "aws_subnet" "app_2" {
vpc_id = aws_vpc.qt-demo-vpc.id
cidr_block = "10.2.2.0/24"
tags = {
Name = "app2"
}
depends_on = [ aws_vpc.qt-demo-vpc ]
}
resource "aws_subnet" "app_3" {
vpc_id = aws_vpc.qt-demo-vpc.id
cidr_block = "10.2.3.0/24"
tags = {
Name = "app3"
}
depends_on = [ aws_vpc.qt-demo-vpc ]
}
