File tree 1 file changed +13
-7
lines changed
1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -60,14 +60,20 @@ export async function prepare(
60
60
return ;
61
61
}
62
62
63
- // NOTE: this will eventually be enalbed for everyone once AR is enabled
64
- // for GCFv1
63
+ // Note: Some of these are premium APIs that require billing to be enabled.
64
+ // We'd eventually have to add special error handling for billing APIs, but
65
+ // enableCloudBuild is called above and has this special casing already.
65
66
if ( wantBackend . cloudFunctions . find ( ( f ) => f . platform === "gcfv2" ) ) {
66
- await ensureApiEnabled . ensure (
67
- context . projectId ,
68
- "artifactregistry.googleapis.com" ,
69
- "artifactregistry"
70
- ) ;
67
+ const V2_APIS = {
68
+ "artifactregistry" : "artifactregistry.googleapis.com" ,
69
+ "cloudrun" : "run.googleapis.com" ,
70
+ "eventarc" : "eventarc.googleapis.com" ,
71
+ "pubsub" : "pubsub.googleapis.com" ,
72
+ } ;
73
+ const enablements = Object . entries ( V2_APIS ) . map ( ( [ tag , api ] ) => {
74
+ return ensureApiEnabled . ensure ( context . projectId , api , tag )
75
+ } ) ;
76
+ await Promise . all ( enablements ) ;
71
77
}
72
78
73
79
// Prepare the functions directory for upload, and set context.triggers.
You can’t perform that action at this time.
0 commit comments