forked from ankit25587/course-material
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88e23a0
commit 9d225a5
Showing
64 changed files
with
959 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
data local_file foo { | ||
filename = "sample1.txt" | ||
} | ||
|
||
output name1 { | ||
value = data.local_file.foo.content | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is fro datasource. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is random String from RP : frctr]h=H2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
resource local_file name1 { | ||
filename = "explicit.txt" | ||
content = "This is random String from RP : ${random_string.name2.id}" | ||
depends_on = [random_string.name2] | ||
} | ||
|
||
resource random_string name2 { | ||
length = 10 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
resource local_file sample_res { | ||
filename = "sample.txt" | ||
content = "I Love Terraform" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I Love Terraform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
resource random_integer name { | ||
min = 20 | ||
max = 350 | ||
|
||
lifecycle{ | ||
#create_before_destroy = true | ||
#prevent_destroy = true | ||
ignore_changes = [min, max] | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
resource local_file sample_res { | ||
filename = "sample_args.txt" | ||
sensitive_content = "I Love Terraform" | ||
file_permission = "0700" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I Love Terraform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
resource local_file name { | ||
content = "This is HCL" | ||
filename = "sample.txt" | ||
} | ||
|
||
resource random_string name { | ||
length = 10 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is HCL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I Love Cats |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I Love Dogs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
resource local_file cat_res { | ||
filename = "cat.txt" | ||
content = "I Love Cats" | ||
} | ||
|
||
resource local_file dog_res { | ||
filename = "dog.txt" | ||
content = "I Love Dogs" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
terraform { | ||
required_providers { | ||
random = { | ||
source = "hashicorp/random" | ||
version = "2.3.1" | ||
} | ||
} | ||
} | ||
|
||
provider "random" { | ||
# Configuration options | ||
} | ||
|
||
|
||
resource random_integer name { | ||
min = 0 | ||
max = 100 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
resource random_integer rint{ | ||
min = 80 | ||
max = 200 | ||
} | ||
|
||
resource random_string rstring { | ||
length = 15 | ||
} | ||
|
||
|
||
output name1 { | ||
value = random_integer.rint.result | ||
} | ||
|
||
output name2 { | ||
value = random_string.rstring.result | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
resource local_file sample_res { | ||
filename = var.filename1 | ||
content = var.content1["name"] | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
variable filename1 { | ||
type = string | ||
default = "sample1.txt" | ||
} | ||
/* | ||
variable content1 { | ||
type = number | ||
default = 23 | ||
} | ||
*/ | ||
|
||
/* | ||
variable content1 { | ||
type = bool | ||
default = true | ||
} | ||
*/ | ||
/* | ||
variable content1 { | ||
type = list(string) | ||
default = ["red", "green", "blue"] | ||
} | ||
*/ | ||
|
||
/* | ||
variable content1 { | ||
type = tuple([string,bool,number]) | ||
default = ["red", true, 23] | ||
} | ||
*/ | ||
|
||
variable content1 { | ||
type = map | ||
default = {name = "Ankit", age = 32} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
resource local_file sample_res { | ||
filename = var.filename1 | ||
content = var.content1 | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I am loving Terraform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
variable filename1 { | ||
type = string | ||
} | ||
|
||
variable content1 { | ||
type = string | ||
default = "I am loving Terraform" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
resource local_file sample_res { | ||
filename = var.filename1 | ||
content = var.content1 | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I am loving Terraform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
variable filename1 { | ||
type = string | ||
default = "sample1.txt" | ||
} | ||
|
||
variable content1 { | ||
type = string | ||
default = "I am loving Terraform" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"type": "service_account", | ||
"project_id": "terraform-gcp-326702", | ||
"private_key_id": "4991e78cebe24fd978c16b124f0066ca31ea0d94", | ||
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCnxWTy1uKo51fJ\nDPs+mJopRqrvPHpLdN85KiwhW5iHlzHCCpmEf2ZwkfCWT3+aUL5NdJW+Y7SS48Wz\nLLZTSFj3Jitk4dg5FLRw4EGQK/J6UnxUqMhMEEB/zUnK6QiKNo9xOwqkE4ihBHtZ\nDFI9pmmknQqdvcv3VBDATazbXYRfM01jU2mcX91RmzMq7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rFGR3e1DELp9+RF9npU2+RQMzZgAg9p0vNOVCagdj7cuUiDWNTxfRu33iVaA4\n6fxiSttN0gq/4tsKWDeLds65wblhBiinC+278SLY802Af26QyNLmWOJsE03gbhXr\nubK85nld6kCLK4k98VNpp1drZHiCMpEDFMY3VXECgYBfBTnltTQAxC9qeb4lb+zW\n1eGvGyRaLpdpZwPrqIdBvl77FVwe6ssAraib88eP6cvsrE0fhzSkAoDcxk/KFDe4\nylZe8pshC/VQwm41gn6UEHZHc+mexTWsQDKDPMTgaKdbomwbhrY16y3KXDjSb78/\nHrZMuNBzv3sz9IQQx4kvWw==\n-----END PRIVATE KEY-----\n", | ||
"client_email": "[email protected]", | ||
"client_id": "106740179622123437802", | ||
"auth_uri": "https://accounts.google.com/o/oauth2/auth", | ||
"token_uri": "https://oauth2.googleapis.com/token", | ||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", | ||
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/terraform-gcp%40terraform-gcp-326702.iam.gserviceaccount.com" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
resource "google_bigquery_dataset" "bd_ds" { | ||
dataset_id = "ds_from_tf" | ||
} | ||
|
||
resource "google_bigquery_table" "table_tf" { | ||
table_id = "table_from_tf" | ||
dataset_id = google_bigquery_dataset.bd_ds.dataset_id | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
terraform { | ||
required_providers { | ||
google = { | ||
source = "hashicorp/google" | ||
version = "3.85.0" | ||
} | ||
} | ||
} | ||
|
||
provider "google" { | ||
# Configuration options | ||
project = "terraform-gcp-326702" | ||
region = "us-central1" | ||
zone = "us-central1-a" | ||
credentials = "keys.json" | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"type": "service_account", | ||
"project_id": "terraform-gcp-326702", | ||
"private_key_id": "4991e78cebe24fd978c16b124f0066ca31ea0d94", | ||
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCnxWTy1uKo51fJ\nDPs+mJopRqrvPHpLdN85KiwhW5iHlzHCCpmEf2ZwkfCWT3+aUL5NdJW+Y7SS48Wz\nLLZTSFj3Jitk4dg5FLRw4EGQK/J6UnxUqMhMEEB/zUnK6QiKNo9xOwqkE4ihBHtZ\nDFI9pmmknQqdvcv3VBDATazbXYRfM01jU2mcX91RmzMq7YHYots0AyZ6uYbXbzfT\n38nsueoxn49G54N1uort/LvkwIFPAdn2pTVrjJGJwuaRLh9xHuTiHY3RAb3aCv9D\nBWH6/kxLB7+bjAatIBetejT0D6/gbm/wzbVJ3NyvmSgW0+zWBE7k++H8oASaXuT5\nCRMyp3ZFAgMBAAECggEABGIwRmicjTe64Yqt34oh0F845sEpahRAhzOz6cI21ZIe\ngTw58Vx2B3/GdPaDLxg2YSYaCdqZO6j3RvV0wYvQWigjrvP4Qcxw1UpLoLH5Q3dw\nVAgPt3xl/+uFwzVnJE2TXkk3OJlv8uDcWaV6r59L+CxdfDqTxt9xEn6PvCKUecKa\nNI6mfvqFDU/EvvsJiU3NS1Y+otHqrOhbygerxIG+2DvKSpCGorUbRq/xY6QadkV0\nIs8pM745jeALP9aSuGuQX2mM/kgwsLR4AhfoYLSGTy+dlNi+yndms6WVm0Azx4V/\nruvkNODxNo4x9ABxH18itfhVaygi7I7OdLwvjOhcSQKBgQDPiX2ajPZ80I+JPjbA\nvvuyxaS6indcAP/13HFiPz+0dNI3ONzEHIFKe4Pzk2OQqpz0CfuHdQSnvvvFBJjk\n6S0wHUUsiZdRy3a/7XYZ+mdz+yjLf6mKaAEuDUwGk2y2dwjaEoiskEq2LYLH1qiI\nKUlZvPD0XSwh1BIhgIRrM7DTrQKBgQDO8rP56h8GTirQThiyH76QqquNOvBafyMv\npxax1j1KJLXPeEkmoJQSb46YFTTf+ZOkwbL52nXlO+XwUY+GwLILofXqm7xrWZvr\nQ4QObn7ZDYyfGSYkqfSbkhOB1hPfSUEG1RwfScrY9Gtw3I4cpa6IVkTvSRDlSo6s\nxgrciBo/+QKBgDwNuP7D03+CikZYbleP7B1q+6PO9YL19xsZ0uVvD+wT8dBw79D/\nvpni6+fLun/eHtSvHs2vms0/gnMcRXHX12+YyK9+kP7mNVKMUCRsRQtWnhNkuZaH\nSfAdgOZWOpsCDtmri0kD59qXiMRy5QmhiMwi1Eahv2d6ilSPb8Hlj0FxAoGABE0C\n9ISrFGR3e1DELp9+RF9npU2+RQMzZgAg9p0vNOVCagdj7cuUiDWNTxfRu33iVaA4\n6fxiSttN0gq/4tsKWDeLds65wblhBiinC+278SLY802Af26QyNLmWOJsE03gbhXr\nubK85nld6kCLK4k98VNpp1drZHiCMpEDFMY3VXECgYBfBTnltTQAxC9qeb4lb+zW\n1eGvGyRaLpdpZwPrqIdBvl77FVwe6ssAraib88eP6cvsrE0fhzSkAoDcxk/KFDe4\nylZe8pshC/VQwm41gn6UEHZHc+mexTWsQDKDPMTgaKdbomwbhrY16y3KXDjSb78/\nHrZMuNBzv3sz9IQQx4kvWw==\n-----END PRIVATE KEY-----\n", | ||
"client_email": "[email protected]", | ||
"client_id": "106740179622123437802", | ||
"auth_uri": "https://accounts.google.com/o/oauth2/auth", | ||
"token_uri": "https://oauth2.googleapis.com/token", | ||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", | ||
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/terraform-gcp%40terraform-gcp-326702.iam.gserviceaccount.com" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
resource "google_bigtable_instance" "bt-from-tf" { | ||
|
||
name = "bt-from-tf" | ||
deletion_protection = false | ||
labels = { | ||
"env" = "testing" | ||
} | ||
cluster { | ||
cluster_id = "bt-from-tf-1" | ||
num_nodes = 1 | ||
storage_type = "SSD" | ||
} | ||
|
||
} | ||
|
||
|
||
resource "google_bigtable_table" "tb1" { | ||
name = "tb-from-tf" | ||
instance_name = google_bigtable_instance.bt-from-tf.name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
terraform { | ||
required_providers { | ||
google = { | ||
source = "hashicorp/google" | ||
version = "3.85.0" | ||
} | ||
} | ||
} | ||
|
||
provider "google" { | ||
# Configuration options | ||
project = "terraform-gcp-326702" | ||
region = "us-central1" | ||
zone = "us-central1-a" | ||
credentials = "keys.json" | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"type": "service_account", | ||
"project_id": "terraform-gcp-326702", | ||
"private_key_id": "4991e78cebe24fd978c16b124f0066ca31ea0d94", | ||
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiA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DlSo6s\nxgrciBo/+QKBgDwNuP7D03+CikZYbleP7B1q+6PO9YL19xsZ0uVvD+wT8dBw79D/\nvpni6+fLun/eHtSvHs2vms0/gnMcRXHX12+YyK9+kP7mNVKMUCRsRQtWnhNkuZaH\nSfAdgOZWOpsCDtmri0kD59qXiMRy5QmhiMwi1Eahv2d6ilSPb8Hlj0FxAoGABE0C\n9ISrFGR3e1DELp9+RF9npU2+RQMzZgAg9p0vNOVCagdj7cuUiDWNTxfRu33iVaA4\n6fxiSttN0gq/4tsKWDeLds65wblhBiinC+278SLY802Af26QyNLmWOJsE03gbhXr\nubK85nld6kCLK4k98VNpp1drZHiCMpEDFMY3VXECgYBfBTnltTQAxC9qeb4lb+zW\n1eGvGyRaLpdpZwPrqIdBvl77FVwe6ssAraib88eP6cvsrE0fhzSkAoDcxk/KFDe4\nylZe8pshC/VQwm41gn6UEHZHc+mexTWsQDKDPMTgaKdbomwbhrY16y3KXDjSb78/\nHrZMuNBzv3sz9IQQx4kvWw==\n-----END PRIVATE KEY-----\n", | ||
"client_email": "[email protected]", | ||
"client_id": "106740179622123437802", | ||
"auth_uri": "https://accounts.google.com/o/oauth2/auth", | ||
"token_uri": "https://oauth2.googleapis.com/token", | ||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", | ||
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/terraform-gcp%40terraform-gcp-326702.iam.gserviceaccount.com" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#Create Bucket | ||
#Upload index.zip | ||
#deploy function | ||
#policy binding | ||
|
||
resource "google_storage_bucket" "fun_bucket" { | ||
name = "fun_bucket_tf" | ||
} | ||
|
||
resource "google_storage_bucket_object" "srccode" { | ||
name = "index.zip" | ||
bucket = google_storage_bucket.fun_bucket.name | ||
source = "index.zip" | ||
} | ||
|
||
resource "google_cloudfunctions_function" "fun_from_tf" { | ||
name = "fun-from-tf" | ||
runtime = "nodejs14" | ||
description = "This is my first function from terraform script." | ||
|
||
available_memory_mb = 128 | ||
source_archive_bucket = google_storage_bucket.fun_bucket.name | ||
source_archive_object = google_storage_bucket_object.srccode.name | ||
|
||
trigger_http = true | ||
entry_point = "helloWorldtf" | ||
|
||
} | ||
|
||
resource "google_cloudfunctions_function_iam_member" "allowaccess" { | ||
region = google_cloudfunctions_function.fun_from_tf.region | ||
cloud_function = google_cloudfunctions_function.fun_from_tf.name | ||
|
||
role = "roles/cloudfunctions.invoker" | ||
member = "allUsers" | ||
|
||
} |
Oops, something went wrong.