77
88 < head >
99 < meta charset =utf-8 >
10-
10+
1111 < title >
1212 Make Cloud Run Service Public
1313 </ title >
14-
14+
1515 < meta name =description content ='Learn how to make a Google Cloud Run service publicly accessible using Node.js and the HTTP REST API. This guide covers setting IAM permissions, configuring service visibility, and deploying with gcloud and direct API calls. '>
1616 < link rel =icon type ='image/png ' href ='/blog/image/blog-30.png '>
1717 < meta name =viewport content ='width=device-width, initial-scale=1 '>
18-
18+
1919 < base href ='https://javascript-2020.github.io/blog/25-07-29/make-cloud-run-service-public/ '>
2020 < link rel =canonical href ='https://ext-code.com/blog/25-07-29/make-cloud-run-service-public/make-cloud-run-service-public.html '>
21-
22-
21+
22+
2323 < script type ='application/ld+json '>
2424
2525 {
3333 "mainEntityOfPage" : { "@type" :"WebPage" , "@id" :"https://ext-code.com/blog/25-07-29/make-cloud-run-service-public/make-cloud-run-service-public.html" } ,
3434 "publisher" : { "@type" :"Organization" , "name" :"ext-code.com" , "logo" :{ "@type" :"ImageObject" , "url" :"https://ext-code.com/favicon.ico" } } ,
3535 }
36-
36+
3737 </ script >
38-
39-
40- < script src ='https://libs.ext-code.com/js/dom/component/component.js '> </ script >
41- < script src ='https://libs.ext-code.com/js/dom/init-hdr/init-hdr.js '> </ script >
42-
43-
38+
39+
40+ < script src ='https://libs.ext-code.com/js/dom/component/v3.0/component.js?hdr '> </ script >
41+
42+
4443 < link rel =stylesheet href ='/blog/css/blog.css '>
45-
44+
4645 < style >
4746
4847 html
5756 [component ]
5857 {display : none}
5958
60- .description
59+ .description
6160 {max-width : 1000px ;text-align : justify;border-left : 4px solid # 4a90e2 ;padding : 1rem ;
6261 background-color : # f9f9f9 ;font-family : system-ui, sans-serif;font-size : 1rem ;line-height : 1.6 ;color : # 333 }
6362 .description > p
6463 {margin : 0 }
6564 .description > p + p
6665 {margin : 10px 0 }
67-
66+
6867 code
6968 {font-family : monospace;background : whitesmoke}
7069 code .inline
7170 {display : inline;padding : 5px 10px }
72-
71+
7372 a
7473 {color : # 4a90e2 ;text-decoration : none;font-weight : 500 }
75- a : hover
74+ a : hover
7675 {text-decoration : underline}
7776 .link-domain
7877 {font-size : 0.85rem ;color : # 777 ;margin-left : 0.25rem }
79- .link-domain ::before
78+ .link-domain ::before
8079 {content : '[' }
8180 .link-domain ::after
8281 {content : ']' }
8382 .link-txt
8483 {}
85-
84+
8685 input
8786 {font-size : 16px ;padding : 5px 7px ;box-sizing : border-box;}
8887 input [type = button ]
8988 {cursor : pointer}
90-
91-
92-
89+
90+
91+
9392 code
9493 {background : whitesmoke;border : 1px solid gray;padding : 10px ;font-size : 16px }
95-
96-
94+
95+
9796 </ style >
9897
9998 </ head >
10099
101100
102101 < body >
103-
102+
104103 < blog-hdr component =grp1 >
105104 < h1 class =title >
106105 Make Cloud Run Service Public
@@ -109,24 +108,24 @@ <h1 class=title>
109108 22 Oct 2025
110109 </ time >
111110 </ blog-hdr >
112-
113-
111+
112+
114113 < div class =description >
115114 < p >
116115 Learn how to make a Google Cloud Run service publicly accessible using Node.js and the HTTP REST API.
117116 This guide covers setting IAM permissions, configuring service visibility, and deploying with gcloud and direct API calls.
118117 </ p >
119118 </ div >
120-
121-
122-
119+
120+
121+
123122 < div >
124123 generate service account token
125124 </ div >
126125
127126 < code >
128-
129-
127+
128+
130129 import { GoogleAuth } from 'google-auth-library';
131130
132131 const auth = new GoogleAuth({
@@ -145,7 +144,7 @@ <h1 class=title>
145144 < div >
146145 using the service account token, make a service publically accessible
147146 </ div >
148-
147+
149148 < code >
150149
151150(async()=> {
@@ -161,7 +160,7 @@ <h1 class=title>
161160 var project = '';
162161 var service = '';
163162
164-
163+
165164
166165 //list service details
167166
@@ -177,8 +176,8 @@ <h1 class=title>
177176
178177 console.json(json);
179178
180-
181-
179+
180+
182181 //make public
183182
184183 var json = {
@@ -191,7 +190,7 @@ <h1 class=title>
191190 ]
192191 }
193192 };
194-
193+
195194 var url = `https://run.googleapis.com/v1/projects/${project}/locations/us-central1/services/${service}:setIamPolicy';
196195 var headers = {
197196 authorization : `Bearer ${token}`,
@@ -205,10 +204,10 @@ <h1 class=title>
205204 console.json(json);
206205
207206
208-
209-
207+
208+
210209})();
211-
210+
212211 </ code >
213212
214213
0 commit comments