Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/placeholder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# Execute with "docker run --build-arg PROJECT_ID=$PROJECT_ID ..."
ARG PROJECT_ID=YOURPROJECTID
FROM gcr.io/$PROJECT_ID/firebase
FROM us-docker.pkg.dev/$PROJECT_ID/containers/firebase
WORKDIR /app

RUN apk add gettext curl
Expand Down
4 changes: 2 additions & 2 deletions app/placeholder/placeholder-image.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ steps:
"--build-arg",
"PROJECT_ID=$PROJECT_ID",
"-t",
"gcr.io/$PROJECT_ID/$_IMAGE_NAME",
"us-docker.pkg.dev/$PROJECT_ID/containers/$_IMAGE_NAME",
".",
]

images:
- gcr.io/$PROJECT_ID/$_IMAGE_NAME
- us-docker.pkg.dev/$PROJECT_ID/containers/$_IMAGE_NAME

substitutions:
_IMAGE_NAME: placeholder
Expand Down
6 changes: 3 additions & 3 deletions infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ Functional examples are included in the

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| client\_image\_host | Container Registry that hosts the client image (PROJECT\_ID[/folder]) | `string` | `"hsa-public/terraform-python-dynamic-webapp"` | no |
| client\_image\_host | Artifact Registry that hosts the client image (PROJECT\_ID/registry) | `string` | `"hsa-public/containers/terraform-python-dynamic-webapp"` | no |
| database\_name | Cloud SQL database name | `string` | `"django"` | no |
| database\_username | Cloud SQL database name | `string` | `"server"` | no |
| enable\_apis | Whether or not to enable underlying apis in this solution. | `bool` | `true` | no |
| image\_version | Version of the Container Registry image to use | `string` | `"v1.9.0"` | no |
| image\_version | Version of the container image to use | `string` | `"v1.9.0"` | no |
| init | Initialize database? | `bool` | `true` | no |
| instance\_name | Cloud SQL Instance name | `string` | `"psql"` | no |
| labels | A set of key/value label pairs to assign to the resources deployed by this blueprint. | `map(string)` | `{}` | no |
| project\_id | Google Cloud Project ID | `string` | n/a | yes |
| random\_suffix | Add random suffix to VM name | `string` | `true` | no |
| region | Google Cloud Region | `string` | `"us-central1"` | no |
| server\_image\_host | Container Registry that hosts the server image (PROJECT\_ID[/folder]) | `string` | `"hsa-public/terraform-python-dynamic-webapp"` | no |
| server\_image\_host | Artifact Registry that hosts the server image (PROJECT\_ID/registry) | `string` | `"hsa-public/containers/terraform-python-dynamic-webapp"` | no |
| service\_name | Cloud Run service name | `string` | `"server"` | no |
| zone | GCP zone for provisioning zonal resources. | `string` | `"us-central1-c"` | no |

Expand Down
8 changes: 4 additions & 4 deletions infra/containers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

# Base images supplied pre-built.
# Base images supplied pre-built

locals {
server_image = "gcr.io/${var.server_image_host}/server:${var.image_version}"
client_image = "gcr.io/${var.client_image_host}/client:${var.image_version}"
placeholder_image = "gcr.io/hsa-public/avocano-placeholder:latest"
server_image = "us-docker.pkg.dev/${var.server_image_host}/server:${var.image_version}"
client_image = "us-docker.pkg.dev/${var.client_image_host}/client:${var.image_version}"
placeholder_image = "us-docker.pkg.dev/hsa-public/containers/avocano-placeholder:latest"
}
233 changes: 117 additions & 116 deletions infra/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
dir: /infra
actuationTool:
flavor: Terraform
version: '>= 0.13'
version: ">= 0.13"
description:
tagline: This is an auto-generated module.
detailed: |-
Expand All @@ -41,125 +41,126 @@ spec:
preDeploy: To deploy this blueprint you must have an active billing account and billing permissions.
content:
documentation:
- title: Hosting a Static Website
url: https://cloud.google.com/storage/docs/hosting-static-website
- title: Hosting a Static Website
url: https://cloud.google.com/storage/docs/hosting-static-website
examples:
- name: simple_example
location: examples/simple_example
- name: suffix_example
location: examples/suffix_example
- name: simple_example
location: examples/simple_example
- name: suffix_example
location: examples/suffix_example
interfaces:
variables:
- name: client_image_host
description: Container Registry that hosts the client image (PROJECT_ID[/folder])
varType: string
defaultValue: hsa-public/terraform-python-dynamic-webapp
- name: database_name
description: Cloud SQL database name
varType: string
defaultValue: django
- name: database_username
description: Cloud SQL database name
varType: string
defaultValue: server
- name: enable_apis
description: Whether or not to enable underlying apis in this solution.
varType: bool
defaultValue: true
- name: image_version
description: Version of the Container Registry image to use
varType: string
defaultValue: v1.9.0
- name: init
description: Initialize database?
varType: bool
defaultValue: true
- name: instance_name
description: Cloud SQL Instance name
varType: string
defaultValue: psql
- name: labels
description: A set of key/value label pairs to assign to the resources deployed by this blueprint.
varType: map(string)
defaultValue: {}
- name: project_id
description: Google Cloud Project ID
varType: string
required: true
- name: random_suffix
description: Add random suffix to VM name
varType: string
defaultValue: true
- name: region
description: Google Cloud Region
varType: string
defaultValue: us-central1
- name: server_image_host
description: Container Registry that hosts the server image (PROJECT_ID[/folder])
varType: string
defaultValue: hsa-public/terraform-python-dynamic-webapp
- name: service_name
description: Cloud Run service name
varType: string
defaultValue: server
- name: zone
description: GCP zone for provisioning zonal resources.
varType: string
defaultValue: us-central1-c
- name: client_image_host
description: Artifact Registry that hosts the client image (PROJECT_ID/registry[/folder])
varType: string
defaultValue: hsa-public/containers/terraform-python-dynamic-webapp
- name: database_name
description: Cloud SQL database name
varType: string
defaultValue: django
- name: database_username
description: Cloud SQL database name
varType: string
defaultValue: server
- name: enable_apis
description: Whether or not to enable underlying apis in this solution.
varType: bool
defaultValue: true
- name: image_version
description: Version of the container image to use
varType: string
defaultValue: v1.9.0
- name: init
description: Initialize database?
varType: bool
defaultValue: true
- name: instance_name
description: Cloud SQL Instance name
varType: string
defaultValue: psql
- name: labels
description: A set of key/value label pairs to assign to the resources deployed by this blueprint.
varType: map(string)
defaultValue: {}
- name: project_id
description: Google Cloud Project ID
varType: string
defaultValue: null
required: true
- name: random_suffix
description: Add random suffix to VM name
varType: string
defaultValue: true
- name: region
description: Google Cloud Region
varType: string
defaultValue: us-central1
- name: server_image_host
description: Artifact Registry that hosts the server image (PROJECT_ID/registry[/folder])
varType: string
defaultValue: hsa-public/containers/terraform-python-dynamic-webapp
- name: service_name
description: Cloud Run service name
varType: string
defaultValue: server
- name: zone
description: GCP zone for provisioning zonal resources.
varType: string
defaultValue: us-central1-c
outputs:
- name: client_job_name
description: Name of the Cloud Run Job, deploying the front end
- name: django_admin_password
description: Django Admin password
- name: django_admin_url
description: Django Admin URL
- name: firebase_url
description: Firebase URL
- name: neos_toc_url
description: Neos Tutorial URL
- name: server_service_name
description: Name of the Cloud Run service, hosting the server API
- name: usage
description: Next steps for usage
- name: client_job_name
description: Name of the Cloud Run Job, deploying the front end
- name: django_admin_password
description: Django Admin password
- name: django_admin_url
description: Django Admin URL
- name: firebase_url
description: Firebase URL
- name: neos_toc_url
description: Neos Tutorial URL
- name: server_service_name
description: Name of the Cloud Run service, hosting the server API
- name: usage
description: Next steps for usage
requirements:
roles:
- level: Project
roles:
- roles/cloudbuild.builds.editor
- roles/cloudsql.admin
- roles/compute.admin
- roles/compute.networkAdmin
- roles/firebase.managementServiceAgent
- roles/firebasehosting.admin
- roles/iam.serviceAccountAdmin
- roles/iam.serviceAccountUser
- roles/pubsub.editor
- roles/resourcemanager.projectIamAdmin
- roles/run.admin
- roles/secretmanager.admin
- roles/storage.admin
- level: Project
roles:
- roles/cloudbuild.builds.editor
- roles/cloudsql.admin
- roles/compute.admin
- roles/compute.networkAdmin
- roles/firebase.managementServiceAgent
- roles/firebasehosting.admin
- roles/iam.serviceAccountAdmin
- roles/iam.serviceAccountUser
- roles/pubsub.editor
- roles/resourcemanager.projectIamAdmin
- roles/run.admin
- roles/secretmanager.admin
- roles/storage.admin
services:
- bigquery.googleapis.com
- bigquerymigration.googleapis.com
- bigquerystorage.googleapis.com
- cloudtrace.googleapis.com
- datastore.googleapis.com
- logging.googleapis.com
- monitoring.googleapis.com
- servicemanagement.googleapis.com
- serviceusage.googleapis.com
- sql-component.googleapis.com
- storage.googleapis.com
- storage-api.googleapis.com
- storage-component.googleapis.com
- artifactregistry.googleapis.com
- cloudbuild.googleapis.com
- cloudresourcemanager.googleapis.com
- compute.googleapis.com
- firebase.googleapis.com
- firebasehosting.googleapis.com
- iam.googleapis.com
- pubsub.googleapis.com
- run.googleapis.com
- secretmanager.googleapis.com
- sqladmin.googleapis.com
- bigquery.googleapis.com
- bigquerymigration.googleapis.com
- bigquerystorage.googleapis.com
- cloudtrace.googleapis.com
- datastore.googleapis.com
- logging.googleapis.com
- monitoring.googleapis.com
- servicemanagement.googleapis.com
- serviceusage.googleapis.com
- sql-component.googleapis.com
- storage.googleapis.com
- storage-api.googleapis.com
- storage-component.googleapis.com
- artifactregistry.googleapis.com
- cloudbuild.googleapis.com
- cloudresourcemanager.googleapis.com
- compute.googleapis.com
- firebase.googleapis.com
- firebasehosting.googleapis.com
- iam.googleapis.com
- pubsub.googleapis.com
- run.googleapis.com
- secretmanager.googleapis.com
- sqladmin.googleapis.com
10 changes: 5 additions & 5 deletions infra/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ variable "init" {
variable "image_version" {
type = string
default = "v1.9.0"
description = "Version of the Container Registry image to use"
description = "Version of the container image to use"
}

variable "client_image_host" {
type = string
default = "hsa-public/terraform-python-dynamic-webapp"
description = "Container Registry that hosts the client image (PROJECT_ID[/folder])"
default = "hsa-public/containers/terraform-python-dynamic-webapp"
description = "Artifact Registry that hosts the client image (PROJECT_ID/registry)"
}

variable "server_image_host" {
type = string
default = "hsa-public/terraform-python-dynamic-webapp"
description = "Container Registry that hosts the server image (PROJECT_ID[/folder])"
default = "hsa-public/containers/terraform-python-dynamic-webapp"
description = "Artifact Registry that hosts the server image (PROJECT_ID/registry)"
}

# Optional customisation
Expand Down