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
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ The following resources will be deleted:
delete resources.database_catalogs.my_catalog
delete resources.database_instances.my_instance

This action will result in the deletion of the following Lakebase database instances.
All data stored in them will be permanently lost:
delete resources.database_instances.my_instance

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-lakebase-catalog-[UNIQUE_NAME]/default

Deleting files...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ Resources:
The following resources will be deleted:
delete resources.database_instances.my_database

This action will result in the deletion of the following Lakebase database instances.
All data stored in them will be permanently lost:
delete resources.database_instances.my_database

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-lakebase-single-instance-[UNIQUE_NAME]/default

Deleting files...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ Warning: unknown field: instance_profile_arn
The following resources will be deleted:
delete resources.database_instances.foo

This action will result in the deletion of the following Lakebase database instances.
All data stored in them will be permanently lost:
delete resources.database_instances.foo

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default

Deleting files...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ Deployment complete!
The following resources will be deleted:
delete resources.postgres_projects.foo

This action will result in the deletion of the following Lakebase projects along with
all their branches, databases, and endpoints. All data stored in them will be permanently lost:
delete resources.postgres_projects.foo

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default

Deleting files...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ The following resources will be deleted:
delete resources.postgres_branches.main
delete resources.postgres_projects.my_project

This action will result in the deletion of the following Lakebase projects along with
all their branches, databases, and endpoints. All data stored in them will be permanently lost:
delete resources.postgres_projects.my_project

This action will result in the deletion of the following Lakebase branches.
All data stored in them will be permanently lost:
delete resources.postgres_branches.main

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-branch-[UNIQUE_NAME]/default

Deleting files...
Expand Down
12 changes: 12 additions & 0 deletions acceptance/bundle/resources/postgres_branches/recreate/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ resources:

>>> [CLI] bundle deploy --auto-approve
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-branch-recreate-[UNIQUE_NAME]/default/files...

This action will result in the deletion or recreation of the following Lakebase branches.
All data stored in them will be permanently lost:
recreate resources.postgres_branches.main
Deploying resources...
Updating deployment state...
Deployment complete!
Expand All @@ -75,6 +79,14 @@ The following resources will be deleted:
delete resources.postgres_branches.main
delete resources.postgres_projects.my_project

This action will result in the deletion of the following Lakebase projects along with
all their branches, databases, and endpoints. All data stored in them will be permanently lost:
delete resources.postgres_projects.my_project

This action will result in the deletion of the following Lakebase branches.
All data stored in them will be permanently lost:
delete resources.postgres_branches.main

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-branch-recreate-[UNIQUE_NAME]/default

Deleting files...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ The following resources will be deleted:
delete resources.postgres_branches.dev_branch
delete resources.postgres_projects.my_project

This action will result in the deletion of the following Lakebase projects along with
all their branches, databases, and endpoints. All data stored in them will be permanently lost:
delete resources.postgres_projects.my_project

This action will result in the deletion of the following Lakebase branches.
All data stored in them will be permanently lost:
delete resources.postgres_branches.dev_branch

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/update-postgres-branch-[UNIQUE_NAME]/default

Deleting files...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ The following resources will be deleted:
delete resources.postgres_endpoints.custom
delete resources.postgres_projects.my_project

This action will result in the deletion of the following Lakebase projects along with
all their branches, databases, and endpoints. All data stored in them will be permanently lost:
delete resources.postgres_projects.my_project

This action will result in the deletion of the following Lakebase branches.
All data stored in them will be permanently lost:
delete resources.postgres_branches.main

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-endpoint-[UNIQUE_NAME]/default

Deleting files...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ The following resources will be deleted:
delete resources.postgres_endpoints.my_endpoint
delete resources.postgres_projects.my_project

This action will result in the deletion of the following Lakebase projects along with
all their branches, databases, and endpoints. All data stored in them will be permanently lost:
delete resources.postgres_projects.my_project

This action will result in the deletion of the following Lakebase branches.
All data stored in them will be permanently lost:
delete resources.postgres_branches.main

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-endpoint-recreate-[UNIQUE_NAME]/default

Deleting files...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@ The following resources will be deleted:
delete resources.postgres_endpoints.my_endpoint
delete resources.postgres_projects.my_project

This action will result in the deletion of the following Lakebase projects along with
all their branches, databases, and endpoints. All data stored in them will be permanently lost:
delete resources.postgres_projects.my_project

This action will result in the deletion of the following Lakebase branches.
All data stored in them will be permanently lost:
delete resources.postgres_branches.main

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/update-postgres-endpoint-[UNIQUE_NAME]/default

Deleting files...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ Resources:
The following resources will be deleted:
delete resources.postgres_projects.my_project

This action will result in the deletion of the following Lakebase projects along with
all their branches, databases, and endpoints. All data stored in them will be permanently lost:
delete resources.postgres_projects.my_project

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-single-project-[UNIQUE_NAME]/default

Deleting files...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ resources:

>>> [CLI] bundle deploy --auto-approve
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-recreate-[UNIQUE_NAME]/default/files...

This action will result in the deletion or recreation of the following Lakebase projects along with
all their branches, databases, and endpoints. All data stored in them will be permanently lost:
recreate resources.postgres_projects.my_project
Deploying resources...
Updating deployment state...
Deployment complete!
Expand All @@ -61,6 +65,10 @@ Deployment complete!
The following resources will be deleted:
delete resources.postgres_projects.my_project

This action will result in the deletion of the following Lakebase projects along with
all their branches, databases, and endpoints. All data stored in them will be permanently lost:
delete resources.postgres_projects.my_project

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-recreate-[UNIQUE_NAME]/default

Deleting files...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ Deployment complete!
The following resources will be deleted:
delete resources.postgres_projects.my_project

This action will result in the deletion of the following Lakebase projects along with
all their branches, databases, and endpoints. All data stored in them will be permanently lost:
delete resources.postgres_projects.my_project

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/update-postgres-project-[UNIQUE_NAME]/default

Deleting files...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ The following resources will be deleted:
delete resources.database_instances.my_instance
delete resources.synced_database_tables.my_synced_table

This action will result in the deletion of the following Lakebase database instances.
All data stored in them will be permanently lost:
delete resources.database_instances.my_instance

This action will result in the deletion of the following synced database tables.
The synced data in the destination database will be lost (the source table is preserved):
delete resources.synced_database_tables.my_synced_table

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-lakebase-synced-table-[UNIQUE_NAME]/default

Deleting files...
Expand Down
40 changes: 39 additions & 1 deletion bundle/phases/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,15 @@ func approvalForDeploy(ctx context.Context, b *bundle.Bundle, plan *deployplan.P
pipelineActions := filterGroup(actions, "pipelines", types...)
volumeActions := filterGroup(actions, "volumes", types...)
dashboardActions := filterGroup(actions, "dashboards", types...)
databaseInstanceActions := filterGroup(actions, "database_instances", types...)
syncedDatabaseTableActions := filterGroup(actions, "synced_database_tables", types...)
postgresProjectActions := filterGroup(actions, "postgres_projects", types...)
postgresBranchActions := filterGroup(actions, "postgres_branches", types...)

// We don't need to display any prompts in this case.
if len(schemaActions) == 0 && len(pipelineActions) == 0 && len(volumeActions) == 0 && len(dashboardActions) == 0 {
if len(schemaActions) == 0 && len(pipelineActions) == 0 && len(volumeActions) == 0 && len(dashboardActions) == 0 &&
len(databaseInstanceActions) == 0 && len(syncedDatabaseTableActions) == 0 &&
len(postgresProjectActions) == 0 && len(postgresBranchActions) == 0 {
return true, nil
}

Expand Down Expand Up @@ -80,6 +86,38 @@ func approvalForDeploy(ctx context.Context, b *bundle.Bundle, plan *deployplan.P
}
}

// One or more database instances is being deleted or recreated.
if len(databaseInstanceActions) != 0 {
cmdio.LogString(ctx, deleteOrRecreateDatabaseInstanceMessage)
for _, action := range databaseInstanceActions {
cmdio.Log(ctx, action)
}
}

// One or more synced database tables is being deleted or recreated.
if len(syncedDatabaseTableActions) != 0 {
cmdio.LogString(ctx, deleteOrRecreateSyncedDatabaseTableMessage)
for _, action := range syncedDatabaseTableActions {
cmdio.Log(ctx, action)
}
}

// One or more Lakebase projects is being deleted or recreated.
if len(postgresProjectActions) != 0 {
cmdio.LogString(ctx, deleteOrRecreatePostgresProjectMessage)
for _, action := range postgresProjectActions {
cmdio.Log(ctx, action)
}
}

// One or more Lakebase branches is being deleted or recreated.
if len(postgresBranchActions) != 0 {
cmdio.LogString(ctx, deleteOrRecreatePostgresBranchMessage)
for _, action := range postgresBranchActions {
cmdio.Log(ctx, action)
}
}

if b.AutoApprove {
return true, nil
}
Expand Down
36 changes: 36 additions & 0 deletions bundle/phases/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func approvalForDestroy(ctx context.Context, b *bundle.Bundle, plan *deployplan.
schemaActions := filterGroup(deleteActions, "schemas", deployplan.Delete)
pipelineActions := filterGroup(deleteActions, "pipelines", deployplan.Delete)
volumeActions := filterGroup(deleteActions, "volumes", deployplan.Delete)
databaseInstanceActions := filterGroup(deleteActions, "database_instances", deployplan.Delete)
syncedDatabaseTableActions := filterGroup(deleteActions, "synced_database_tables", deployplan.Delete)
postgresProjectActions := filterGroup(deleteActions, "postgres_projects", deployplan.Delete)
postgresBranchActions := filterGroup(deleteActions, "postgres_branches", deployplan.Delete)

if len(schemaActions) > 0 {
cmdio.LogString(ctx, deleteSchemaMessage)
Expand All @@ -79,6 +83,38 @@ func approvalForDestroy(ctx context.Context, b *bundle.Bundle, plan *deployplan.
cmdio.LogString(ctx, "")
}

if len(databaseInstanceActions) > 0 {
cmdio.LogString(ctx, deleteDatabaseInstanceMessage)
for _, a := range databaseInstanceActions {
cmdio.Log(ctx, a)
}
cmdio.LogString(ctx, "")
}

if len(syncedDatabaseTableActions) > 0 {
cmdio.LogString(ctx, deleteSyncedDatabaseTableMessage)
for _, a := range syncedDatabaseTableActions {
cmdio.Log(ctx, a)
}
cmdio.LogString(ctx, "")
}

if len(postgresProjectActions) > 0 {
cmdio.LogString(ctx, deletePostgresProjectMessage)
for _, a := range postgresProjectActions {
cmdio.Log(ctx, a)
}
cmdio.LogString(ctx, "")
}

if len(postgresBranchActions) > 0 {
cmdio.LogString(ctx, deletePostgresBranchMessage)
for _, a := range postgresBranchActions {
cmdio.Log(ctx, a)
}
cmdio.LogString(ctx, "")
}

cmdio.LogString(ctx, "All files and directories at the following location will be deleted: "+b.Config.Workspace.RootPath)
cmdio.LogString(ctx, "")

Expand Down
28 changes: 28 additions & 0 deletions bundle/phases/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ is removed from the catalog, but the underlying files are not deleted:`
deleteOrRecreateDashboardMessage = `
This action will result in the deletion or recreation of the following dashboards.
This will result in changed IDs and permanent URLs of the dashboards that will be recreated:`

deleteOrRecreateDatabaseInstanceMessage = `
This action will result in the deletion or recreation of the following Lakebase database instances.
All data stored in them will be permanently lost:`

deleteOrRecreateSyncedDatabaseTableMessage = `
This action will result in the deletion or recreation of the following synced database tables.
The synced data in the destination database will be lost (the source table is preserved):`

deleteOrRecreatePostgresProjectMessage = `
This action will result in the deletion or recreation of the following Lakebase projects along with
all their branches, databases, and endpoints. All data stored in them will be permanently lost:`

deleteOrRecreatePostgresBranchMessage = `
This action will result in the deletion or recreation of the following Lakebase branches.
All data stored in them will be permanently lost:`
)

// Messages for bundle destroy.
Expand All @@ -33,4 +49,16 @@ Streaming Tables (STs) and Materialized Views (MVs) managed by them:`
For managed volumes, the files stored in the volume are also deleted from your
cloud tenant within 30 days. For external volumes, the metadata about the volume
is removed from the catalog, but the underlying files are not deleted:`

deleteDatabaseInstanceMessage = `This action will result in the deletion of the following Lakebase database instances.
All data stored in them will be permanently lost:`

deleteSyncedDatabaseTableMessage = `This action will result in the deletion of the following synced database tables.
The synced data in the destination database will be lost (the source table is preserved):`

deletePostgresProjectMessage = `This action will result in the deletion of the following Lakebase projects along with
all their branches, databases, and endpoints. All data stored in them will be permanently lost:`

deletePostgresBranchMessage = `This action will result in the deletion of the following Lakebase branches.
All data stored in them will be permanently lost:`
)