Skip to content

Commit

Permalink
Merge pull request #61 from tanakaryo/add-feature-tf
Browse files Browse the repository at this point in the history
#60 add new resource.
  • Loading branch information
tanakaryo authored Jun 22, 2024
2 parents 002103f + 85dbe90 commit 377c366
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 0 deletions.
3 changes: 3 additions & 0 deletions infrastructure-as-code/terraform/apps/app1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Architecture
#### this is simple gce architecture.
![architecture](gcp_arche1.drawio.png)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
resource "google_compute_instance" "instance1" {
name = "instance1"
machine_type = "e2-micro"
zone = "asia-northeast1-a"

boot_disk {
initialize_params {
image = "debian-cloud/debian-11"
labels = {
my_label = "value"
}
}
}

network_interface {
network = google_compute_network.vpc1.name
subnetwork = google_compute_subnetwork.subnet1.name
network_ip = "10.2.0.2"
access_config {
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PROJECT_ID = "<project-id>"
REGION = "asia-northeast1"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
resource "google_compute_network" "vpc1" {
name = "vpc1"
auto_create_subnetworks = "false"
}

resource "google_compute_subnetwork" "subnet1" {
name = "subnet1"
ip_cidr_range = "10.2.0.0/16"
region = var.REGION
network = google_compute_network.vpc1.id
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "5.34.0"
}
}
}

provider "google" {
project = var.PROJECT_ID
region = var.REGION
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
variable "PROJECT_ID" {
type = string
}

variable "REGION" {
type = string
}
30 changes: 30 additions & 0 deletions infrastructure-as-code/terraform/apps/app1/gcp_arche1.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<mxfile host="app.diagrams.net" modified="2024-06-22T16:33:05.287Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" etag="yBJM9-H_8REUM_SRUB6R" version="24.6.1" type="device">
<diagram name="ページ1" id="R3BdG8fvLfsXcJQ8adfj">
<mxGraphModel dx="1350" dy="713" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="1dFSMlrIg1avmV7D9cu1-3" value="" style="verticalLabelPosition=bottom;verticalAlign=top;html=1;shape=mxgraph.basic.rect;fillColor2=none;strokeWidth=1;size=20;indent=5;" vertex="1" parent="1">
<mxGeometry x="315" y="300" width="325" height="290" as="geometry" />
</mxCell>
<mxCell id="1dFSMlrIg1avmV7D9cu1-4" value="" style="editableCssRules=.*;html=1;shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image=data:image/svg+xml,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnY9Imh0dHBzOi8vdmVjdGEuaW8vbmFubyIgd2lkdGg9IjIwIiBoZWlnaHQ9IjIwIiB2aWV3Qm94PSIwIDAgMjAgMjAiPiYjeGE7CTxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+JiN4YTsJLnN0MHtmaWxsOiM0Mjg1ZjQ7fSYjeGE7CS5zdDF7ZmlsbDojNjY5ZGY2O30mI3hhOwkuc3Qye2ZpbGw6I2FlY2JmYTt9JiN4YTsJPC9zdHlsZT4mI3hhOwk8cGF0aCBjbGFzcz0ic3QyIiBkPSJNMTQgMGg2djZoLTZ6Ii8+JiN4YTsJPHBhdGggY2xhc3M9InN0MSIgZD0iTTE3IDBoM3Y2aC0zeiIvPiYjeGE7CTxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik0xNCAxNGg2djZoLTZ6Ii8+JiN4YTsJPHBhdGggY2xhc3M9InN0MSIgZD0iTTE3IDE0aDN2NmgtM3oiLz4mI3hhOwk8cGF0aCBjbGFzcz0ic3QyIiBkPSJNMCAwaDZ2NkgweiIvPiYjeGE7CTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0zIDBoM3Y2SDN6Ii8+JiN4YTsJPHBhdGggY2xhc3M9InN0MiIgZD0iTTAgMTRoNnY2SDB6Ii8+JiN4YTsJPGcgY2xhc3M9InN0MSI+JiN4YTsJCTxwYXRoIGQ9Ik0zIDE0aDN2Nkgzek02IDJoOHYySDZ6Ii8+JiN4YTsJCTxwYXRoIGQ9Ik02IDE2aDh2Mkg2ek0xNiA2aDJ2OGgtMnpNMiA2aDJ2OEgyeiIvPiYjeGE7CTwvZz4mI3hhOwk8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMiA2aDJ2Mkgyem0xNCAwaDJ2MmgtMnpNNiAyaDJ2Mkg2em0wIDE0aDJ2Mkg2eiIvPiYjeGE7PC9zdmc+;" vertex="1" parent="1">
<mxGeometry x="330" y="310" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="1dFSMlrIg1avmV7D9cu1-5" value="" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="354" y="360" width="256" height="200" as="geometry" />
</mxCell>
<mxCell id="1dFSMlrIg1avmV7D9cu1-6" value="&lt;font style=&quot;font-size: 13px;&quot;&gt;subnet&lt;/font&gt;" style="text;strokeColor=none;fillColor=none;html=1;fontSize=24;fontStyle=1;verticalAlign=middle;align=center;" vertex="1" parent="1">
<mxGeometry x="360" y="360" width="80" height="20" as="geometry" />
</mxCell>
<mxCell id="1dFSMlrIg1avmV7D9cu1-7" value="" style="strokeColor=#dddddd;shadow=1;strokeWidth=1;rounded=1;absoluteArcSize=1;arcSize=2;" vertex="1" parent="1">
<mxGeometry x="417" y="430" width="130" height="60" as="geometry" />
</mxCell>
<mxCell id="1dFSMlrIg1avmV7D9cu1-8" value="Compute&#xa;Engine" style="editableCssRules=.*;html=1;fontColor=#999999;shape=image;verticalLabelPosition=middle;verticalAlign=middle;labelPosition=right;align=left;spacingLeft=20;part=1;points=[];imageAspect=0;image=data:image/svg+xml,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnY9Imh0dHBzOi8vdmVjdGEuaW8vbmFubyIgd2lkdGg9IjIwIiBoZWlnaHQ9IjIwIiB2aWV3Qm94PSIwIDAgMjAgMjAiPiYjeGE7CTxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+JiN4YTsJLnN0MHtmaWxsOiM0Mjg1ZjQ7fSYjeGE7CS5zdDF7ZmlsbDojNjY5ZGY2O30mI3hhOwkuc3Qye2ZpbGw6I2FlY2JmYTt9JiN4YTsJPC9zdHlsZT4mI3hhOwk8cGF0aCBjbGFzcz0ic3QyIiBkPSJNNyA3aDZ2Nkg3eiIvPiYjeGE7CTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik05IDBoMnY0SDl6TTUgMGgydjRINXptOCAwaDJ2NGgtMnoiLz4mI3hhOwk8cGF0aCBjbGFzcz0ic3QwIiBkPSJNOSAxNmgydjRIOXptLTQgMGgydjRINXptOCAwaDJ2NGgtMnptMy01VjloNHYyem0wIDR2LTJoNHYyem0wLThWNWg0djJ6Ii8+JiN4YTsJPHBhdGggY2xhc3M9InN0MSIgZD0iTTAgMTFWOWg0djJ6bTAgNHYtMmg0djJ6bTAtOFY1aDR2MnoiLz4mI3hhOwk8cGF0aCBjbGFzcz0ic3QyIiBkPSJNMyAzdjE0aDE0VjN6bTEyIDEySDVWNWgxMHoiLz4mI3hhOwk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNMTAgMTBsLTMgM2g2eiIvPiYjeGE7CTxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMyA3bC0zIDMgMyAzeiIvPiYjeGE7PC9zdmc+;" vertex="1" parent="1dFSMlrIg1avmV7D9cu1-7">
<mxGeometry width="30" height="30" relative="1" as="geometry">
<mxPoint x="15" y="15" as="offset" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 377c366

Please sign in to comment.