import * as pulumi from "@pulumi/pulumi" ; import * as gcp from "@pulumi/gcp" ; export function bindToRole ( name , sa , args ) { return new gcp . projects . IAMBinding ( name , { project : args . project , role : args . role , members : [ sa . email . apply ( email => `serviceAccount:${ email }` ) ] , } ) ; } export function createCiKey ( name , sa ) { return new gcp . serviceAccount . Key ( name , { serviceAccountId : sa . name } ) ; } export function clientSecret ( key ) { return key . privateKey . apply ( key => JSON . parse ( Buffer . from ( key , "base64" ) . toString ( "ascii" ) ) ) ; }