-
Notifications
You must be signed in to change notification settings - Fork 298
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
adding terraform and tests #371
adding terraform and tests #371
Conversation
-var="project_id=${PROJECT_ID}" \ | ||
-var="storage_project_id=${STORAGE_PROJECT_ID}" \ | ||
-var="source_dataset_name=${SOURCE_DATASET_NAME}" \ | ||
-var="target_dataset_name=${TARGET_DATASET_NAME}" \ | ||
-var="crontab_format=${CRONTAB_FORMAT}" \ | ||
-var="seconds_before_expiration=${SECONDS_BEFORE_EXPIRATION}" \ |
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.
Recommend using a .tfvars file and have the user modify this file with their own values
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.
done
message = {"crontab_format":"0 1 * * *"} | ||
timestamps = [] | ||
for i in range(3): | ||
timestamps.append(get_snapshot_timestamp) | ||
time.sleep(1) | ||
print(timestamps) |
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.
What's the purpose of this?
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.
removed
# limitations under the License. | ||
|
||
terraform { | ||
backend "local" {} |
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.
Recommend using GCS remote backend
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.
done
tools/cloud_functions/bq_table_snapshots/terraform/variables.tf
Outdated
Show resolved
Hide resolved
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
terraform { |
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.
Run terraform fmt on all your terraform files
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.
done
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
…_tables_names/test_bq_backup_fetch_tables_names.py Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
…e_snapshots/test_bq_backup_create_snapshots.py Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
…e_snapshots/test_bq_backup_create_snapshots.py Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
…e_snapshots/test_bq_backup_create_snapshots.py Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
…_tables_names/test_bq_backup_fetch_tables_names.py Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
tools/cloud_functions/bq_table_snapshots/terraform/deployment_vars.tfvars
Outdated
Show resolved
Hide resolved
tools/cloud_functions/bq_table_snapshots/terraform/deployment_vars.tfvars
Outdated
Show resolved
Hide resolved
@@ -37,12 +37,43 @@ The following environemnt variables must be set: | |||
## bq_backup_create_snapshots | |||
The **bq_backup_create_snapshots** cloud function will submit a BigQuery job to create a snapshot for each table in scope. This cloud function will suffix the snapshot name with the snapshot datetime to guarantee a unique name. It will also calculate and set the expiration time of the snapshot based on seconds_before_expiration. Finally, it will determine the snapshot time based on crontab_format. | |||
The following environemnt variables must be set: |
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.
Reword this and line 32 as well since it instructs the user to set an environment variable but the Terraform will actually do this.
The following could be an appropriate rewording:
"The Cloud Function uses the following environment variables to determine which BigQuery project to use for compute and which to use for storing your BigQuery snapshots:"
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.
Also lines 32 & 39 have typo: environemnt
Fix: environment
tools/cloud_functions/bq_table_snapshots/terraform/variables.tf
Outdated
Show resolved
Hide resolved
tools/cloud_functions/bq_table_snapshots/terraform/variables.tf
Outdated
Show resolved
Hide resolved
tools/cloud_functions/bq_table_snapshots/terraform/variables.tf
Outdated
Show resolved
Hide resolved
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.
Line 16 replace Scheduloer with Scheduler
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.
Line 35 has typo: ame
Fix: name
…vars.tfvars Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
…vars.tfvars Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
The following environemnt variables must be set: | ||
* `BQ_DATA_PROJECT_ID `id of project used for BQ storage | ||
The **bq_backup_create_snapshots** Cloud Function will submit a BigQuery job to create a snapshot for each table in scope. This Cloud Function will suffix the snapshot name with the snapshot datetime to guarantee a unique name. It will also calculate and set the expiration time of the snapshot based on seconds_before_expiration. Finally, it will determine the snapshot time based on crontab_format. | ||
The following environment variables must be set: |
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.
The following environment variables must be set: | |
The Cloud Function uses the following environment variables to determine which BigQuery project to use for compute and which to use for storing your BigQuery snapshots: |
tools/cloud_functions/bq_table_snapshots/terraform/variables.tf
Outdated
Show resolved
Hide resolved
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
Co-authored-by: Daniel De Leo <danieldeleo@users.noreply.github.com>
No description provided.