Skip to content

Commit

Permalink
Merge pull request #3190 from yuvipanda/osscratch
Browse files Browse the repository at this point in the history
Setup scratch bucket for openscapes
  • Loading branch information
yuvipanda authored Oct 2, 2023
2 parents a4c1da7 + a5b03b7 commit 2a4539b
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
5 changes: 5 additions & 0 deletions config/clusters/openscapes/prod.values.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
basehub:
userServiceAccount:
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::783616723547:role/openscapeshub-prod
jupyterhub:
ingress:
hosts: [openscapes.2i2c.cloud]
tls:
- hosts: [openscapes.2i2c.cloud]
secretName: https-auto-tls
singleuser:
extraEnv:
SCRATCH_BUCKET: s3://openscapeshub-scratch/$(JUPYTERHUB_USER)
profileList:
- display_name: Python
description: Python datascience environment
Expand Down
5 changes: 5 additions & 0 deletions config/clusters/openscapes/staging.values.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
basehub:
userServiceAccount:
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::783616723547:role/openscapeshub-staging
jupyterhub:
ingress:
hosts: [staging.openscapes.2i2c.cloud]
tls:
- hosts: [staging.openscapes.2i2c.cloud]
secretName: https-auto-tls
singleuser:
extraEnv:
SCRATCH_BUCKET: s3://openscapeshub-scratch-staging/$(JUPYTERHUB_USER)
profileList:
- display_name: Python
description: Python datascience environment
Expand Down
11 changes: 11 additions & 0 deletions terraform/aws/buckets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,14 @@ resource "aws_s3_bucket_policy" "user_bucket_access" {
bucket = aws_s3_bucket.user_buckets[each.value.bucket_name].id
policy = data.aws_iam_policy_document.bucket_access[each.key].json
}

output "buckets" {
value = { for b, _ in var.user_buckets : b => aws_s3_bucket.user_buckets[b].id }
description = <<-EOT
List of S3 buckets created for this cluster
Since S3 bucket names need to be globally unique, we prefix each item in
the user_buckets variable with the prefix variable. This output displays
the full name of all S3 buckets created conveniently.
EOT
}
25 changes: 24 additions & 1 deletion terraform/aws/projects/openscapes.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,27 @@ region = "us-west-2"

cluster_name = "openscapeshub"

cluster_nodes_location = "us-west-2b"
cluster_nodes_location = "us-west-2b"

user_buckets = {
"scratch-staging" : {
"delete_after" : 7
},
"scratch" : {
"delete_after" : 7
},
}


hub_cloud_permissions = {
"staging" : {
requestor_pays : true,
bucket_admin_access : ["scratch-staging"],
extra_iam_policy : ""
},
"prod" : {
requestor_pays : true,
bucket_admin_access : ["scratch"],
extra_iam_policy : ""
},
}

0 comments on commit 2a4539b

Please sign in to comment.