Skip to content

Commit ae202dc

Browse files
authored
Merge pull request #428 from jdno/rustup-builds
Create S3 bucket for Rustup build artifacts
2 parents 835f4b7 + 68b75d9 commit ae202dc

File tree

4 files changed

+78
-0
lines changed

4 files changed

+78
-0
lines changed

terragrunt/accounts/legacy/rustup-prod/rustup/.terraform.lock.hcl

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
terraform {
2+
source = "../../../../..//terragrunt/modules/rustup"
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: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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 "ci_role" {
10+
source = "../gha-oidc-role"
11+
org = "rust-lang"
12+
repo = "rustup"
13+
branch = "master"
14+
}
15+
16+
resource "aws_iam_policy" "upload_builds" {
17+
name = "upload-rustup-builds"
18+
policy = jsonencode({
19+
Version = "2012-10-17"
20+
Statement = [
21+
{
22+
Sid = "WriteToRustupBuilds"
23+
Effect = "Allow"
24+
Action = ["s3:PutObject"]
25+
Resource = ["${aws_s3_bucket.builds.arn}/*"]
26+
}
27+
]
28+
})
29+
}
30+
31+
resource "aws_iam_role_policy_attachment" "ci_upload_builds" {
32+
role = module.ci_role.role.id
33+
policy_arn = aws_iam_policy.upload_builds.arn
34+
}

0 commit comments

Comments
 (0)