-
Notifications
You must be signed in to change notification settings - Fork 71
feat: adds metadata generation for the solution #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # Copyright 2023 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| apiVersion: blueprints.cloud.google.com/v1alpha1 | ||
| kind: BlueprintMetadata | ||
| metadata: | ||
| name: terraform-dynamic-python-webapp-display | ||
| spec: | ||
| info: | ||
| title: terraform-dynamic-python-webapp | ||
| source: | ||
| repo: https://github.com/GoogleCloudPlatform/terraform-dynamic-python-webapp | ||
| sourceType: git | ||
| ui: | ||
| input: | ||
| variables: | ||
| client_image_host: | ||
| name: client_image_host | ||
| title: Client Image Host | ||
| database_name: | ||
| name: database_name | ||
| title: Database Name | ||
| database_username: | ||
| name: database_username | ||
| title: Database Username | ||
| image_version: | ||
| name: image_version | ||
| title: Image Version | ||
| init: | ||
| name: init | ||
| title: Init | ||
| instance_name: | ||
| name: instance_name | ||
| title: Instance Name | ||
| labels: | ||
| name: labels | ||
| title: Labels | ||
| project_id: | ||
| name: project_id | ||
| title: Project Id | ||
| random_suffix: | ||
| name: random_suffix | ||
| title: Random Suffix | ||
| region: | ||
| name: region | ||
| title: Region | ||
| server_image_host: | ||
| name: server_image_host | ||
| title: Server Image Host | ||
| service_name: | ||
| name: service_name | ||
| title: Service Name | ||
| zone: | ||
| name: zone | ||
| title: Zone |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,99 +19,113 @@ metadata: | |
| annotations: | ||
| config.kubernetes.io/local-config: "true" | ||
| spec: | ||
| title: terraform-dynamic-python-webapp | ||
| source: | ||
| repo: https://github.com/GoogleCloudPlatform/terraform-dynamic-python-webapp.git | ||
| sourceType: git | ||
| actuationTool: | ||
| type: Terraform | ||
| version: '>= 0.13' | ||
| description: | ||
| tagline: This is an auto-generated module. | ||
| detailed: |- | ||
| The resources/services/activations/deletions that this module will create/trigger are: | ||
| - Cloud Run | ||
| - Cloud SQL | ||
| - Firebase Hosting | ||
| - Secret Manager | ||
| - IAM | ||
| - Cloud Storage | ||
| preDeploy: To deploy this blueprint you must have an active billing account and billing permissions. | ||
| documentation: | ||
| - title: Hosting a Static Website | ||
| url: https://cloud.google.com/storage/docs/hosting-static-website | ||
| examples: | ||
| - name: simple_example | ||
| location: examples/simple_example | ||
| variables: | ||
| - name: database_name | ||
| description: Cloud SQL database name | ||
| type: string | ||
| default: django | ||
| required: false | ||
| - name: database_username | ||
| description: Cloud SQL database name | ||
| type: string | ||
| default: server | ||
| required: false | ||
| - name: image_host_project | ||
| description: Google Cloud Project that hosts images | ||
| type: string | ||
| default: hsa-public/terraform-python-dynamic-webapp | ||
| required: false | ||
| - name: init | ||
| description: Initialize database? | ||
| type: bool | ||
| default: true | ||
| required: false | ||
| - name: instance_name | ||
| description: Cloud SQL Instance name | ||
| type: string | ||
| default: psql | ||
| required: false | ||
| - name: labels | ||
| description: A set of key/value label pairs to assign to the resources deployed by this blueprint. | ||
| type: map(string) | ||
| default: {} | ||
| required: false | ||
| - name: project_id | ||
| description: Google Cloud Project ID | ||
| type: string | ||
| required: true | ||
| - name: random_suffix | ||
| description: Add random suffix to VM name | ||
| type: string | ||
| default: true | ||
| required: false | ||
| - name: region | ||
| description: Google Cloud Region | ||
| type: string | ||
| default: us-central1 | ||
| required: false | ||
| - name: service_name | ||
| description: Cloud Run service name | ||
| type: string | ||
| default: server | ||
| required: false | ||
| - name: zone | ||
| description: GCP zone for provisioning zonal resources. | ||
| type: string | ||
| default: us-central1-c | ||
| required: false | ||
| outputs: | ||
| - name: django_admin_password | ||
| description: Djando Admin password | ||
| - name: django_admin_url | ||
| description: Djando Admin URL | ||
| - name: firebase_url | ||
| description: Firebase URL | ||
| - name: usage | ||
| description: Next steps for usage | ||
| roles: | ||
| - level: Project | ||
| info: | ||
| title: terraform-dynamic-python-webapp | ||
| source: | ||
| repo: https://github.com/GoogleCloudPlatform/terraform-dynamic-python-webapp | ||
| sourceType: git | ||
| actuationTool: | ||
| flavor: Terraform | ||
| version: '>= 0.13' | ||
| description: | ||
| tagline: This is an auto-generated module. | ||
| detailed: |- | ||
| The resources/services/activations/deletions that this module will create/trigger are: | ||
| - Cloud Run | ||
| - Cloud SQL | ||
| - Firebase Hosting | ||
| - Secret Manager | ||
| - IAM | ||
| - Cloud Storage | ||
| 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 | ||
| examples: | ||
| - name: simple_example | ||
| location: examples/simple_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: image_version | ||
| description: Version of the Container Registry image to use | ||
| varType: string | ||
| defaultValue: v1.7.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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: Do these variables need to be manually synchronized with the terraform variables, or is something automatic going to happen?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are updated automatically with the TF variables defined for the blueprint. |
||
| 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 | ||
| outputs: | ||
| - name: django_admin_password | ||
| description: Djando Admin password | ||
| - name: django_admin_url | ||
| description: Djando Admin URL | ||
| - name: firebase_url | ||
| description: Firebase URL | ||
| - name: neos_toc_url | ||
| description: Neos Tutorial URL | ||
| - name: usage | ||
| description: Next steps for usage | ||
| requirements: | ||
| roles: | ||
| - roles/owner | ||
| services: | ||
| - cloudresourcemanager.googleapis.com | ||
| - storage-api.googleapis.com | ||
| - serviceusage.googleapis.com | ||
| - level: Project | ||
| roles: | ||
| - roles/cloudsql.admin | ||
| - roles/compute.admin | ||
| - roles/compute.networkAdmin | ||
| - roles/firebase.managementServiceAgent | ||
| - roles/firebasehosting.admin | ||
| - roles/iam.serviceAccountAdmin | ||
| - roles/iam.serviceAccountUser | ||
| - roles/resourcemanager.projectIamAdmin | ||
| - roles/run.admin | ||
| - roles/secretmanager.admin | ||
| - roles/storage.admin | ||
|
Comment on lines
+115
to
+127
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: I compared these to https://github.com/GoogleCloudPlatform/terraform-dynamic-python-webapp/blob/main/infra/test/setup/iam.tf#L17 and they appear to be the same. Seems like we will need to keep them manually in sync, unless we can parse the values from this config into the iam.tf.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. infra/test/setup/iam.tf is the source for this as you rightly point out and will be updated automatically. I don't follow your comment "we will need to keep them manually in sync". Is there's another config you're keeping these roles in? |
||
| services: | ||
| - cloudresourcemanager.googleapis.com | ||
| - storage-api.googleapis.com | ||
| - serviceusage.googleapis.com | ||
|
Comment on lines
+129
to
+131
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: I see only three services listed here, shouldn't this include all the services needed?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe these are the services required to invoke terraform, which will then itself enable the other services. They're similar to the services avocano gets you to manually enable before running the script
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The source for this is the |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note for maintainers: we'll want to follow-up this change with a release-please config to update this value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the avocano version, not the self-version. Updating this is usually manual, are you saying release-please can help with this overhead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-please won't help with this. This should updated in the TF variable when a newer version of the blueprint is released and the metadata will be updated accordingly.