-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #428 from jdno/rustup-builds
Create S3 bucket for Rustup build artifacts
- Loading branch information
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
terragrunt/accounts/legacy/rustup-prod/rustup/.terraform.lock.hcl
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
terraform { | ||
source = "../../../../..//terragrunt/modules/rustup" | ||
} | ||
|
||
include { | ||
path = find_in_parent_folders() | ||
merge_strategy = "deep" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
terraform { | ||
required_version = "~> 1.0" | ||
|
||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 4.20" | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# The rust-lang/rustup repository on GitHub builds and uploads Rustup artifacts | ||
# to this S3 bucket. | ||
resource "aws_s3_bucket" "builds" { | ||
provider = aws.us-east-1 | ||
|
||
bucket = "rustup-builds" | ||
} | ||
|
||
module "ci_role" { | ||
source = "../gha-oidc-role" | ||
org = "rust-lang" | ||
repo = "rustup" | ||
branch = "master" | ||
} | ||
|
||
resource "aws_iam_policy" "upload_builds" { | ||
name = "upload-rustup-builds" | ||
policy = jsonencode({ | ||
Version = "2012-10-17" | ||
Statement = [ | ||
{ | ||
Sid = "WriteToRustupBuilds" | ||
Effect = "Allow" | ||
Action = ["s3:PutObject"] | ||
Resource = ["${aws_s3_bucket.builds.arn}/*"] | ||
} | ||
] | ||
}) | ||
} | ||
|
||
resource "aws_iam_role_policy_attachment" "ci_upload_builds" { | ||
role = module.ci_role.role.id | ||
policy_arn = aws_iam_policy.upload_builds.arn | ||
} |