Skip to content

Commit 37044b8

Browse files
committed
Initial commit
1 parent ae24988 commit 37044b8

File tree

10 files changed

+537
-1
lines changed

10 files changed

+537
-1
lines changed

Diff for: .gitignore

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# If you prefer the allow list template instead of the deny list, see community template:
2+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3+
#
4+
# Binaries for programs and plugins
5+
*.exe
6+
*.exe~
7+
*.dll
8+
*.so
9+
*.dylib
10+
11+
# Test binary, built with `go test -c`
12+
*.test
13+
14+
# Output of the go coverage tool, specifically when used with LiteIDE
15+
*.out
16+
17+
# Dependency directories (remove the comment below to include it)
18+
vendor/
19+
20+
# Go workspace file
21+
go.work
22+
23+
# Terrafrom files
24+
*.tfstate
25+
*.tfstate.backup
26+
*.tfvars
27+
.terraform/
28+
.terraform.lock.hcl
29+
30+
# Secret files
31+
*credential*
32+
project-gcp.txt

Diff for: README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
# Proof of concepts related to multi-cloud networks
1+
## Proof of concepts related to multi-cloud networks
22

33
We will explore the functions and necessary properties such as creation, diary, update, and deletion of resources/services for configuring a multi-cloud network.
4+
5+
6+
### How to use this ?
7+
8+
TBD

Diff for: aws/main.tf

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Define the required version of Terraform and the providers that will be used in the project
2+
terraform {
3+
required_version = "1.5.5"
4+
5+
required_providers {
6+
# AWS provider is specified with its source and version
7+
aws = {
8+
source = "hashicorp/aws"
9+
version = "~> 5.21"
10+
}
11+
}
12+
}
13+
14+
# Provider block for AWS specifies the configuration for the provider
15+
provider "aws" {
16+
region = "ap-northeast-2"
17+
}
18+

Diff for: aws/networking.tf

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Define the VPC resource block
2+
resource "aws_vpc" "example_vpc" {
3+
cidr_block = "192.168.64.0/22"
4+
5+
tags = {
6+
Name = "terraform-101"
7+
}
8+
}
9+
10+
# # Define the internet gateway resource block and attach it to the VPC
11+
# resource "aws_internet_gateway" "example_igw" {
12+
# vpc_id = aws_vpc.example_vpc.id
13+
# }
14+
15+
# # Define the route table resource block and add a route to the internet gateway
16+
# resource "aws_route_table" "example_rt" {
17+
# vpc_id = aws_vpc.example_vpc.id
18+
19+
# route {
20+
# cidr_block = "0.0.0.0/0"
21+
# gateway_id = aws_internet_gateway.example_igw.id
22+
# }
23+
# }
24+
25+
# Define the subnets resource blocks with the desired CIDR blocks and associate them with the route table
26+
resource "aws_subnet" "example_subnet_1" {
27+
vpc_id = aws_vpc.example_vpc.id
28+
cidr_block = "192.168.64.0/24"
29+
map_public_ip_on_launch = true
30+
tags = {
31+
Name = "example_subnet_1"
32+
}
33+
}
34+
35+
resource "aws_subnet" "example_subnet_2" {
36+
vpc_id = aws_vpc.example_vpc.id
37+
cidr_block = "192.168.65.0/24"
38+
map_public_ip_on_launch = true
39+
tags = {
40+
Name = "example_subnet_2"
41+
}
42+
}
43+
44+
# # Associate the subnets with the route table
45+
# resource "aws_route_table_association" "example_rta_1" {
46+
# subnet_id = aws_subnet.example_subnet_1.id
47+
# route_table_id = aws_route_table.example_rt.id
48+
# }
49+
50+
# resource "aws_route_table_association" "example_rta_2" {
51+
# subnet_id = aws_subnet.example_subnet_2.id
52+
# route_table_id = aws_route_table.example_rt.id
53+
# }

Diff for: docs/2023-10-06-how-to-install-terraform.md

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# How to install Terraform
2+
3+
### Installation environment
4+
- OS: Ubuntu 20.04.6 LTS (on WSL2)
5+
- Terraform: v1.5.5 (I'm going to install Terrfarom v1.5.5 due to license issue.)
6+
- See [HashiCorp adopts Business Source License](https://www.hashicorp.com/blog/hashicorp-adopts-business-source-license)
7+
- See [7. What products will be covered by BSL 1.1 in their next release?](https://www.hashicorp.com/license-faq#products-covered-by-bsl)
8+
9+
### Install Terraform
10+
```bash
11+
# Ensure that your system is up to date
12+
sudo apt-get update
13+
# Ensure that you have installed the dependencies, such as `gnupg`, `software-properties-common`, `curl`, and unzip packages.
14+
sudo apt-get install -y software-properties-common gnupg2 curl unzip
15+
16+
### Install Terraform on Linux from tarball
17+
# Set Terraform version
18+
TERRAFORM_VERSION="1.5.5"
19+
20+
# Get tarball
21+
wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip
22+
23+
# Unzip the tarball
24+
unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip
25+
26+
# Move the terraform binary to `/usr/local/bin`
27+
sudo mv terraform /usr/local/bin/
28+
29+
# Make the toll acccessible to all user accounts
30+
which terraform
31+
32+
# Check the version of Terraform installed
33+
terraform --version
34+
```
35+
36+
#### Verify the installation
37+
```bash
38+
terraform -help
39+
```
40+
#### Enable tab completion
41+
If you use either Bash or Zsh, you can enable tab completion for Terraform commands.
42+
To enable autocomplete, first ensure that a config file exists for your chosen shell.
43+
44+
```bash
45+
touch ~/.bashrc
46+
```
47+
48+
Then install the autocomplete package.
49+
```bash
50+
terraform -install-autocomplete
51+
```
52+
53+
54+
### Appendix
55+
56+
Ref: [Install Terraform](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli)(official guide to install the latest version of Terraform)
57+
```bash
58+
# Ensure that your system is up to date and you have installed the `gnupg`, `software-properties-common`, and `curl` packages installed. You will use these packages to verify HashiCorp's GPG signature and install HashiCorp's Debian package repository.
59+
sudo apt-get update && sudo apt-get install -y gnupg software-properties-common
60+
61+
# Install the HashiCorp [GPG key](https://apt.releases.hashicorp.com/gpg "HashiCorp GPG key").
62+
wget -O- https://apt.releases.hashicorp.com/gpg | \
63+
gpg --dearmor | \
64+
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
65+
66+
# Verify the key's fingerprint.
67+
gpg --no-default-keyring \
68+
--keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg \
69+
--fingerprint
70+
71+
# Add the official HashiCorp repository to your system. The `lsb_release -cs` command finds the distribution release codename for your current system, such as `buster`, `groovy`, or `sid`.
72+
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
73+
https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
74+
sudo tee /etc/apt/sources.list.d/hashicorp.list
75+
76+
# Download the package information from HashiCorp.
77+
sudo apt update
78+
79+
# Install Terraform from the new repository.
80+
sudo apt-get install terraform
81+
```
82+
83+
#### Verify the installation
84+
```bash
85+
terraform -help
86+
```
87+
88+
#### Enable tab completion
89+
If you use either Bash or Zsh, you can enable tab completion for Terraform commands.
90+
91+
To enable autocomplete, first ensure that a config file exists for your chosen shell.
92+
```bash
93+
touch ~/.bashrc
94+
```
95+
96+
Then install the autocomplete package.
97+
```bash
98+
terraform -install-autocomplete
99+
```

0 commit comments

Comments
 (0)