1- import * as pulumi from "@pulumi/pulumi" ;
1+ // Copyright 2025, Pulumi Corporation. All rights reserved.
2+
23import * as gcp from "@pulumi/gcp" ;
3- import * as random from "@pulumi/random " ;
4+ import * as pulumi from "@pulumi/pulumi " ;
45import * as pcloud from "@pulumi/pulumiservice" ;
6+ import * as random from "@pulumi/random" ;
57
68const config = new pulumi . Config ( ) ;
79const gcpConfig = new pulumi . Config ( "gcp" ) ;
@@ -27,48 +29,50 @@ const randomSuffix = new random.RandomString(`random-suffix`, {
2729 length : 5 ,
2830 lower : true ,
2931 upper : false ,
30- special : false
32+ special : false ,
3133} ) ;
3234
3335// The Workload Identity Pool id uses a random suffix so that this stack can be
3436// brought up and down repeatably: Workload Identity Pools only soft deletes and
3537// will auto-purge after 30 days. It is not possible to force a hard delete:
3638const identityPool = new gcp . iam . WorkloadIdentityPool ( `identity-pool` , {
37- workloadIdentityPoolId : pulumi . interpolate `${ workloadIdentityPoolId } -${ randomSuffix . result } `
39+ workloadIdentityPoolId : pulumi . interpolate `${ workloadIdentityPoolId } -${ randomSuffix . result } ` ,
3840} ) ;
3941
4042const oidcProvider = new gcp . iam . WorkloadIdentityPoolProvider ( `identity-pool-provider` , {
4143 workloadIdentityPoolId : identityPool . workloadIdentityPoolId ,
4244 workloadIdentityPoolProviderId : `pulumi-cloud-${ pulumi . getOrganization ( ) } -oidc` ,
4345 oidc : {
4446 issuerUri : "https://api.pulumi.com/oidc" ,
45- allowedAudiences : [ `gcp:${ pulumi . getOrganization ( ) } ` ]
47+ allowedAudiences : [ `gcp:${ pulumi . getOrganization ( ) } ` ] ,
4648 } ,
4749 attributeMapping : {
48- "google.subject" : "assertion.sub"
49- }
50+ "google.subject" : "assertion.sub" ,
51+ } ,
5052} ) ;
5153
5254const serviceAccount = new gcp . serviceaccount . Account ( "service-account" , {
5355 accountId : serviceAccountId ,
54- project : gcpProjectName
56+ project : gcpProjectName ,
5557} ) ;
5658
59+ // tslint:disable-next-line:no-unused-expression
5760new gcp . projects . IAMMember ( "service-account" , {
5861 member : pulumi . interpolate `serviceAccount:${ serviceAccount . email } ` ,
5962 role : "roles/admin" ,
60- project : gcpProjectName
63+ project : gcpProjectName ,
6164} ) ;
6265
66+ // tslint:disable-next-line:no-unused-expression
6367new gcp . serviceaccount . IAMBinding ( "service-account" , {
6468 serviceAccountId : serviceAccount . id ,
6569 role : "roles/iam.workloadIdentityUser" ,
66- members : [ pulumi . interpolate `principalSet://iam.googleapis.com/${ identityPool . name } /*` ]
70+ members : [ pulumi . interpolate `principalSet://iam.googleapis.com/${ identityPool . name } /*` ] ,
6771} ) ;
6872
6973// fn::open::gcp-login requires project number instead of project name:
7074const projectNumber = gcp . projects . getProjectOutput ( {
71- filter : `name:${ gcpProjectName } `
75+ filter : `name:${ gcpProjectName } ` ,
7276} ) . projects [ 0 ] . number
7377 . apply ( projectNumber => + projectNumber ) ; // this casts it from string to a number
7478
@@ -104,4 +108,5 @@ const environment = new pcloud.Environment("environment", {
104108 yaml : envYaml ,
105109} ) ;
106110
107- export const escEnvId = environment . id ;
111+
112+ export const escEnvId = environment . id ;
0 commit comments