You've already forked devops-exercises
Add different solutions to AWS exercises
Not only console solutions, but also Terraform and Pulumi. In addition, this change fixes issues #279 and #280
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
## AWS VPC - My First VPC
|
||||
# My First VPC
|
||||
|
||||
### Objectives
|
||||
## Objectives
|
||||
|
||||
1. Create a new VPC
|
||||
1. It should have a CIDR that supports using at least 60,000 hosts
|
||||
1. It should have a CIDR that supports using at least 60,000 hosts
|
||||
2. It should be named "exercise-vpc"
|
||||
|
||||
## Solution
|
||||
|
||||
Click [here](solution.md) to view the solution
|
||||
0
topics/aws/exercises/new_vpc/main.tf
Normal file
0
topics/aws/exercises/new_vpc/main.tf
Normal file
10
topics/aws/exercises/new_vpc/pulumi/__main__.py
Normal file
10
topics/aws/exercises/new_vpc/pulumi/__main__.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import pulumi
|
||||
import pulumi_awsx as awsx
|
||||
|
||||
vpc = awsx.ec2.Vpc("exercise-vpc", cidr_block="10.0.0.0/16")
|
||||
|
||||
pulumi.export("vpc_id", vpc.vpc_id)
|
||||
pulumi.export("publicSubnetIds", vpc.public_subnet_ids)
|
||||
pulumi.export("privateSubnetIds", vpc.private_subnet_ids)
|
||||
|
||||
# Run 'pulumi up' to create it
|
||||
@@ -1,17 +1,30 @@
|
||||
## AWS VPC - My First VPC
|
||||
# My First VPC
|
||||
|
||||
### Objectives
|
||||
## Objectives
|
||||
|
||||
1. Create a new VPC
|
||||
1. It should have a CIDR that supports using at least 60,000 hosts
|
||||
1. It should have a CIDR that supports using at least 60,000 hosts
|
||||
2. It should be named "exercise-vpc"
|
||||
|
||||
### Solution
|
||||
## Solution
|
||||
|
||||
#### Console
|
||||
### Console
|
||||
|
||||
1. Under "Virtual Private Cloud" click on "Your VPCs"
|
||||
2. Click on "Create VPC"
|
||||
3. Insert a name (e.g. someVPC)
|
||||
3. Insert a name - "exercise-vpc"
|
||||
4. Insert IPv4 CIDR block: 10.0.0.0/16
|
||||
5. Keep "Tenancy" at Default
|
||||
6. Click on "Create VPC"
|
||||
|
||||
### Terraform
|
||||
|
||||
Click [here](terraform/main.tf) to view the solution
|
||||
|
||||
### Pulumi - Python
|
||||
|
||||
Click [here](pulumi/__main__.py) to view the solution
|
||||
|
||||
### Verify Solution
|
||||
|
||||
To verify you've create the VPC, you can run: `aws ec2 describe-vpcs -filters Name=tag:Name,Values=exercise-vpc`
|
||||
11
topics/aws/exercises/new_vpc/terraform/main.tf
Normal file
11
topics/aws/exercises/new_vpc/terraform/main.tf
Normal file
@@ -0,0 +1,11 @@
|
||||
resource "aws_vpc" "exercise-vpc" {
|
||||
cidr_block = "10.0.0.0/16"
|
||||
|
||||
tags = {
|
||||
Name = "exercise-vpc"
|
||||
}
|
||||
}
|
||||
|
||||
output "vpc-id" {
|
||||
value = aws_vpc.exercise-vpc.id
|
||||
}
|
||||
Reference in New Issue
Block a user