Skip to content

Commit 6e8dab2

Browse files
committed
Create S3 bucket for Rustup build artifacts
A new S3 bucket is being created as part of the effort to rebuild the Rustup release process. The bucket will store the build artifacts for Rustup, which the GitHub Actions in rust-lang/rustup will produce. Since the bucket is tied to a GitHub repository, only a single bucket in the production environment is being created.
1 parent 2a69016 commit 6e8dab2

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
terraform {
2+
source = "git::../../../../..//terragrunt/modules/rustup?ref=${trimspace(file("../deployed-ref"))}"
3+
}
4+
5+
include {
6+
path = find_in_parent_folders()
7+
merge_strategy = "deep"
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
terraform {
2+
required_version = "~> 1.0"
3+
4+
required_providers {
5+
aws = {
6+
source = "hashicorp/aws"
7+
version = "~> 4.20"
8+
}
9+
}
10+
}
11+

terragrunt/modules/rustup/s3.tf

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# The rust-lang/rustup repository on GitHub builds and uploads Rustup artifacts
2+
# to this S3 bucket.
3+
resource "aws_s3_bucket" "builds" {
4+
provider = aws.us-east-1
5+
6+
bucket = "rustup-builds"
7+
}
8+
9+
module "aws_iam_user" {
10+
source = "../gha-iam-user"
11+
org = "rust-lang"
12+
repo = "rustup"
13+
}
14+
15+
data "aws_iam_policy_document" "upload_builds" {
16+
statement {
17+
sid = "WriteToRustupBuilds"
18+
effect = "Allow"
19+
20+
actions = [
21+
"s3:PutObject",
22+
]
23+
24+
resources = ["${aws_s3_bucket.builds.arn}/*"]
25+
}
26+
}
27+
28+
resource "aws_iam_user_policy" "upload_builds" {
29+
name = "upload-rustup-builds"
30+
user = module.aws_iam_user.user_name
31+
policy = data.aws_iam_policy_document.upload_builds.json
32+
}

0 commit comments

Comments
 (0)