Commit 0e889e9d authored by pfarago's avatar pfarago

add files for terraform assignment

parents
File added
# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hashicorp/google" {
version = "4.12.0"
hashes = [
"h1:twLiEKzbHAKTrPDoSN600wZm0CWM4oYZfiI4g1Evptk=",
"zh:104c9b1a14a0631ced8072f4cce00ea8e9d063f13c5f8cce0f0d9a1ad64230a1",
"zh:14bc7b8ba2f522e512b6a1405db443e89a0d7cb3e27edea3630fe5c6c71e9f71",
"zh:1d53032ccaac3b6452a8a91e6f68a022ad0a26affa70702a2cfa0346f4c3f2d3",
"zh:39184ecf86c42610e88a35edc5031535445e0224e2a11356ca0afa6bf9eba2e5",
"zh:46653430022ad1a154faac1b7c36308f421c5c7209e04dcda4fdf5c2019b5a90",
"zh:4c3c74d909b1d1ace7d57ec99e4c347c30b025588570d5382ca4140acb97df0e",
"zh:844e9d0e1f33c7b0ce08e34df9a3123f11169c8d02299d3a6d9bbae73482ebbc",
"zh:953758276c990efba630f3769616b9bb3d73e7fc7d2c385b2996d975f26b05ea",
"zh:afacd04e2ff3ac17cf998e9cfe28eed7cb2bc3ec2577e1e8d0053965aaddb8ac",
"zh:c7d18591d9c1b3ce812587e320509d3318cfcfb00758482a96b4699f947794b1",
"zh:c94bf6e4c746874da9bf69915966933ad29908be9eb1b0e0e5ea80c7a9202a6c",
]
}
provider "registry.terraform.io/hashicorp/random" {
version = "3.1.0"
hashes = [
"h1:rKYu5ZUbXwrLG1w81k7H3nce/Ys6yAxXhWcbtk36HjY=",
"zh:2bbb3339f0643b5daa07480ef4397bd23a79963cc364cdfbb4e86354cb7725bc",
"zh:3cd456047805bf639fbf2c761b1848880ea703a054f76db51852008b11008626",
"zh:4f251b0eda5bb5e3dc26ea4400dba200018213654b69b4a5f96abee815b4f5ff",
"zh:7011332745ea061e517fe1319bd6c75054a314155cb2c1199a5b01fe1889a7e2",
"zh:738ed82858317ccc246691c8b85995bc125ac3b4143043219bd0437adc56c992",
"zh:7dbe52fac7bb21227acd7529b487511c91f4107db9cc4414f50d04ffc3cab427",
"zh:a3a9251fb15f93e4cfc1789800fc2d7414bbc18944ad4c5c98f466e6477c42bc",
"zh:a543ec1a3a8c20635cf374110bd2f87c07374cf2c50617eee2c669b3ceeeaa9f",
"zh:d9ab41d556a48bd7059f0810cf020500635bfc696c9fc3adab5ea8915c1d886b",
"zh:d9e13427a7d011dbd654e591b0337e6074eef8c3b9bb11b2e39eaaf257044fd7",
"zh:f7605bd1437752114baf601bdf6931debe6dc6bfe3006eb7e9bb9080931dca8a",
]
}
{"Modules":[{"Key":"","Source":"","Dir":"."},{"Key":"my-vm","Source":"./modules","Dir":"modules"}]}
\ No newline at end of file
module "my-vm" {
source = "./modules"
}
variable "tags" {
type = list
default = []
}
resource "random_string" "random_gen" {
length = 16
special = false
lower = true
upper = false
number = false
}
resource "google_compute_instance" "default_instance" {
name = random_string.random_gen.result
machine_type = "e2-medium"
zone = "us-central1-c"
project = "united-night-342921"
tags = var.tags
allow_stopping_for_update = true
boot_disk {
initialize_params {
image = "debian-cloud/debian-9"
}
}
network_interface {
network = "default"
access_config {
// Ephemeral public IP
}
}
}
\ No newline at end of file
#variable "vm-name" {
# type = string
# default = "defaultName"
#}
#resource "google_compute_instance" "default" {
# name = random_string.random_gen.result
# machine_type = "e2-medium"
# zone = "us-central1-c"
# project = "united-night-342921"
#
# allow_stopping_for_update = true
# boot_disk {
# initialize_params {
# image = "debian-cloud/debian-9"
# }
# }
#
# network_interface {
# network = "default"
# access_config {
# // Ephemeral public IP
# }
# }
#}
\ No newline at end of file
{
"version": 4,
"terraform_version": "1.1.6",
"serial": 178,
"lineage": "87f5a9e5-5ec5-beb8-c91c-74aeff098d61",
"outputs": {},
"resources": []
}
{
"version": 4,
"terraform_version": "1.1.6",
"serial": 175,
"lineage": "87f5a9e5-5ec5-beb8-c91c-74aeff098d61",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "google_compute_instance",
"name": "default_instance",
"provider": "provider[\"registry.terraform.io/hashicorp/google\"]",
"instances": [
{
"schema_version": 6,
"attributes": {
"advanced_machine_features": [],
"allow_stopping_for_update": true,
"attached_disk": [],
"boot_disk": [
{
"auto_delete": true,
"device_name": "persistent-disk-0",
"disk_encryption_key_raw": "",
"disk_encryption_key_sha256": "",
"initialize_params": [
{
"image": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-9-stretch-v20220303",
"labels": {},
"size": 10,
"type": "pd-standard"
}
],
"kms_key_self_link": "",
"mode": "READ_WRITE",
"source": "https://www.googleapis.com/compute/v1/projects/united-night-342921/zones/us-central1-c/disks/aaevitzhoiwagfil"
}
],
"can_ip_forward": false,
"confidential_instance_config": [],
"cpu_platform": "Intel Broadwell",
"current_status": "RUNNING",
"deletion_protection": false,
"description": "",
"desired_status": null,
"enable_display": false,
"guest_accelerator": [],
"hostname": "",
"id": "projects/united-night-342921/zones/us-central1-c/instances/aaevitzhoiwagfil",
"instance_id": "3790705050184879112",
"label_fingerprint": "42WmSpB8rSM=",
"labels": null,
"machine_type": "e2-medium",
"metadata": null,
"metadata_fingerprint": "Nb-_lBrXyyU=",
"metadata_startup_script": null,
"min_cpu_platform": "",
"name": "aaevitzhoiwagfil",
"network_interface": [
{
"access_config": [
{
"nat_ip": "35.184.105.65",
"network_tier": "PREMIUM",
"public_ptr_domain_name": ""
}
],
"alias_ip_range": [],
"ipv6_access_config": [],
"ipv6_access_type": "",
"name": "nic0",
"network": "https://www.googleapis.com/compute/v1/projects/united-night-342921/global/networks/default",
"network_ip": "10.128.0.31",
"nic_type": "",
"queue_count": 0,
"stack_type": "IPV4_ONLY",
"subnetwork": "https://www.googleapis.com/compute/v1/projects/united-night-342921/regions/us-central1/subnetworks/default",
"subnetwork_project": "united-night-342921"
}
],
"project": "united-night-342921",
"reservation_affinity": [],
"resource_policies": null,
"scheduling": [
{
"automatic_restart": true,
"min_node_cpus": 0,
"node_affinities": [],
"on_host_maintenance": "MIGRATE",
"preemptible": false
}
],
"scratch_disk": [],
"self_link": "https://www.googleapis.com/compute/v1/projects/united-night-342921/zones/us-central1-c/instances/aaevitzhoiwagfil",
"service_account": [],
"shielded_instance_config": [],
"tags": [
"abc",
"def",
"ghi",
"jklmn"
],
"tags_fingerprint": "tKE3oyhXJvg=",
"timeouts": null,
"zone": "us-central1-c"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiNiJ9",
"dependencies": [
"random_string.random_gen"
]
}
]
},
{
"mode": "managed",
"type": "random_string",
"name": "random_gen",
"provider": "provider[\"registry.terraform.io/hashicorp/random\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"id": "aaevitzhoiwagfil",
"keepers": null,
"length": 16,
"lower": true,
"min_lower": 0,
"min_numeric": 0,
"min_special": 0,
"min_upper": 0,
"number": false,
"override_special": null,
"result": "aaevitzhoiwagfil",
"special": false,
"upper": false
},
"sensitive_attributes": [],
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ=="
}
]
}
]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment