@@ -51,6 +51,7 @@ import { encodeHTML } from '../../../shared/utilities/textUtilities'
5151import { convertToTimeString } from '../../../shared/datetime'
5252import { getAuthType } from '../../../auth/utils'
5353import { UserWrittenCodeTracker } from '../../tracker/userWrittenCodeTracker'
54+ import { AuthUtil } from '../../util/authUtil'
5455
5556export function getSha256 ( buffer : Buffer ) {
5657 const hasher = crypto . createHash ( 'sha256' )
@@ -193,7 +194,11 @@ export async function stopJob(jobId: string) {
193194 }
194195}
195196
196- export async function uploadPayload ( payloadFileName : string , uploadContext ?: UploadContext ) {
197+ export async function uploadPayload (
198+ payloadFileName : string ,
199+ profile : RegionProfile | undefined ,
200+ uploadContext ?: UploadContext
201+ ) {
197202 const buffer = Buffer . from ( await fs . readFileBytes ( payloadFileName ) )
198203 const sha256 = getSha256 ( buffer )
199204
@@ -205,6 +210,7 @@ export async function uploadPayload(payloadFileName: string, uploadContext?: Upl
205210 contentChecksumType : CodeWhispererConstants . contentChecksumType ,
206211 uploadIntent : CodeWhispererConstants . uploadIntent ,
207212 uploadContext,
213+ profileArn : profile ?. arn ,
208214 } )
209215 } catch ( e : any ) {
210216 const errorMessage = `Creating the upload URL failed due to: ${ ( e as Error ) . message } `
@@ -759,7 +765,8 @@ export async function downloadResultArchive(
759765 exportId : jobId ,
760766 exportIntent : ExportIntent . TRANSFORMATION ,
761767 } ,
762- pathToArchive
768+ pathToArchive ,
769+ AuthUtil . instance . regionProfileManager . activeRegionProfile
763770 )
764771 } catch ( e : any ) {
765772 getLogger ( ) . error ( `CodeTransformation: ExportResultArchive error = %O` , e )
0 commit comments