crooked-cat-6983
12/07/2023, 12:21 PMError waiting to create function: Error waiting for Creating function: Error code 3, message: Create repository operation for projects/.../locations/us-east1/repositories/gcf-artifacts has failed
This is my function creation code:
public static createGcpFunction(
functionName: string,
sourceBucket: Bucket,
destBucketName: string,
orgId: string,
region: string,
gcpProvider: Provider
): gcp.cloudfunctionsv2.Function {
const { copyFunction: copyFunctionConfig } = GcpResourcesConfig
return new gcp.cloudfunctionsv2.Function(
functionName,
{
location: region,
name: functionName,
buildConfig: {
runtime: copyFunctionConfig.runtime,
entryPoint: copyFunctionConfig.entryPoint,
source: {
storageSource: {
bucket: copyFunctionConfig.sourceCodeBucketName,
object: copyFunctionConfig.sourceCodeArchiveName,
},
},
},
eventTrigger: {
eventType: 'google.cloud.storage.object.v1.finalized',
triggerRegion: region,
eventFilters: [
{
attribute: 'bucket',
value: sourceBucket.name,
},
],
},
serviceConfig: {
maxInstanceCount: 1000,
availableMemory: `${copyFunctionConfig.memoryMb}M`,
timeoutSeconds: copyFunctionConfig.timeoutSeconds,
environmentVariables: {
DEST_BUCKET: destBucketName,
ORG_ID: orgId,
},
},
labels: GcpResourcesConfig.defaultLabels,
},
{
protect: true,
provider: gcpProvider,
dependsOn: [sourceBucket, gcpProvider],
customTimeouts: DEFAULT_CUSTOM_TIMEOUT,
}
)
}
My gamble is that the issue is with the build section, but I'm not sure what to change there.
Any ideas on what could be the issue?
Thanks 🙂dry-keyboard-94795
12/07/2023, 1:14 PMdry-keyboard-94795
12/07/2023, 1:20 PMcrooked-cat-6983
12/10/2023, 9:15 AMcrooked-cat-6983
12/10/2023, 9:16 AM