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
resource "google_project_service" "api_services" { | |
project = var.project_id | |
for_each = toset( | |
[ | |
"iam.googleapis.com", | |
"compute.googleapis.com", | |
"cloudresourcemanager.googleapis.com", | |
] | |
) | |
service = each.key |
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
#! /bin/bash | |
curl -sSO https://dl.google.com/cloudagents/add-logging-agent-repo.sh | |
sudo bash add-logging-agent-repo.sh --also-install | |
sudo apt-get update | |
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common | |
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -- | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian buster stable" | |
sudo apt-get update | |
sudo apt-get install -y docker-ce docker-ce-cli containerd.io | |
sudo usermod -a -G docker $USER |
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
variable "project_id" { | |
description = "GCP Project ID" | |
type = string | |
} | |
variable "region" { | |
description = "GCP Region" | |
type = string | |
} |
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
terraform { | |
required_providers { | |
google = { | |
source = "hashicorp/google" | |
version = "4.49.0" | |
} | |
} | |
} | |
provider "google" { |
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
resource "google_cloudbuild_trigger" "fn-ram-api-request" { | |
location = "europe-west1" | |
name = "build-fn-ram-api-request" | |
filename = "4_continuous_deployment/fn_ram_api_request/ci-cd/cloudbuild.yaml" | |
substitutions = { | |
_SERVICE_ACCOUNT = google_service_account.real-world-python.email | |
} | |
github { | |
owner = "danilo-nzyte" | |
name = "real_world_python_tutorials" |
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
output "prefect_service_account_key" { | |
value = google_service_account_key.prefect_service_account_key.private_key | |
sensitive = true | |
} |
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
#!/bin/bash | |
curl -sSO https://dl.google.com/cloudagents/install-logging-agent.sh sudo bash install-logging-agent.sh | |
sudo apt-get update -y | |
sudo apt-get upgrade -y | |
sudo apt-get install -y \ | |
ca-certificates \ | |
curl \ | |
gnupg \ | |
lsb-release \ | |
software-properties-common \ |
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
resource "google_project_service" "api_services" { | |
project = var.project_id | |
for_each = toset( | |
[ | |
"iam.googleapis.com", | |
"compute.googleapis.com", | |
"bigquery.googleapis.com", | |
"run.googleapis.com", | |
"cloudfunctions.googleapis.com", | |
"artifactregistry.googleapis.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
project_id = "real-world-python-tf" | |
region = "europe-west2" | |
zone = "europe-west2-b" | |
prefect_api_key = "INSERT_PREFECT_API_KEY" | |
prefect_workspace = "INSERT_PREFECT_USER/INSERT_PREFECT_WORKSPACE_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
variable "project_id" { | |
description = "GCP Project ID" | |
type = string | |
} | |
variable "region" { | |
description = "GCP Region" | |
type = string | |
} |
NewerOlder