File tree Expand file tree Collapse file tree
spartan/terraform/gke-cluster Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,6 +48,12 @@ resource "google_service_account" "ci" {
4848 description = " Service account for CI jobs that publish Docker images"
4949}
5050
51+ resource "google_service_account" "npm_registry_reader" {
52+ account_id = var. npm_registry_reader_service_account_id
53+ display_name = " npm Registry Reader Service Account"
54+ description = " Service account for CI jobs that install internal npm packages"
55+ }
56+
5157# Service account for External Secrets Operator
5258resource "google_service_account" "eso" {
5359 account_id = " external-secrets-operator"
@@ -79,4 +85,3 @@ data "google_iam_policy" "all_users_storage_read" {
7985 ]
8086 }
8187}
82-
Original file line number Diff line number Diff line change 1+ resource "google_artifact_registry_repository" "npm_registry" {
2+ project = var. project
3+ location = var. region
4+ repository_id = var. npm_registry_repository_id
5+ description = " npm repository"
6+ format = " NPM"
7+
8+ depends_on = [google_project_service . artifact_registry ]
9+ }
10+
11+ resource "google_artifact_registry_repository_iam_member" "ci_npm_registry_reader" {
12+ project = google_artifact_registry_repository. npm_registry . project
13+ location = google_artifact_registry_repository. npm_registry . location
14+ repository = google_artifact_registry_repository. npm_registry . name
15+ role = " roles/artifactregistry.reader"
16+ member = " serviceAccount:${ google_service_account . npm_registry_reader . email } "
17+ }
18+
19+ resource "google_artifact_registry_repository_iam_member" "ci_npm_registry_publisher" {
20+ project = google_artifact_registry_repository. npm_registry . project
21+ location = google_artifact_registry_repository. npm_registry . location
22+ repository = google_artifact_registry_repository. npm_registry . name
23+ role = " roles/artifactregistry.writer"
24+ member = " serviceAccount:${ google_service_account . ci . email } "
25+ }
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ output "ci_service_account_email" {
1010 value = google_service_account. ci . email
1111}
1212
13+ output "npm_registry_reader_service_account_email" {
14+ value = google_service_account. npm_registry_reader . email
15+ }
16+
1317output "region" {
1418 description = " Google cloud region"
1519 value = var. region
@@ -30,6 +34,21 @@ output "docker_registry_repository_url" {
3034 value = " ${ var . region } -docker.pkg.dev/${ var . project } /${ google_artifact_registry_repository . docker_registry . repository_id } "
3135}
3236
37+ output "npm_registry_hostname" {
38+ description = " Artifact Registry npm hostname"
39+ value = " ${ var . region } -npm.pkg.dev"
40+ }
41+
42+ output "npm_registry_repository" {
43+ description = " Artifact Registry npm repository resource name"
44+ value = google_artifact_registry_repository. npm_registry . name
45+ }
46+
47+ output "npm_registry_repository_url" {
48+ description = " Artifact Registry npm repository URL for npm config"
49+ value = " https://${ var . region } -npm.pkg.dev/${ var . project } /${ google_artifact_registry_repository . npm_registry . repository_id } /"
50+ }
51+
3352output "devnet_network_rpc_ips" {
3453 description = " Static IPs and hostnames for v4 devnet networks"
3554 value = {
@@ -40,4 +59,3 @@ output "devnet_network_rpc_ips" {
4059 }
4160 }
4261}
43-
Original file line number Diff line number Diff line change @@ -16,8 +16,20 @@ variable "docker_registry_repository_id" {
1616 default = " aztec"
1717}
1818
19+ variable "npm_registry_repository_id" {
20+ description = " Artifact Registry npm repository ID for internal Aztec packages."
21+ type = string
22+ default = " aztec-npm"
23+ }
24+
1925variable "ci_service_account_id" {
20- description = " Service account ID for CI jobs that push images to the Docker registry ."
26+ description = " Service account ID for CI jobs that publish internal artifacts ."
2127 type = string
2228 default = " aztec-ci"
2329}
30+
31+ variable "npm_registry_reader_service_account_id" {
32+ description = " Service account ID for CI jobs that install internal npm packages."
33+ type = string
34+ default = " aztec-npm-reader"
35+ }
You can’t perform that action at this time.
0 commit comments