Skip to content

Commit 63009ac

Browse files
Add S3 bucket for Docker build cache
Create a new S3 bucket in the global infrastructure for storing Docker BuildKit layer caches. This bucket will be used by GitHub Actions workflows to cache Docker build layers using the S3 cache backend. Features: - AES256 server-side encryption - 30-day lifecycle policy for automatic cache expiration - Output for bucket name to use in workflows Closes #4536 Co-authored-by: Marco Acierno <marcoacierno@users.noreply.github.com>
1 parent fcbab6e commit 63009ac

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
resource "aws_s3_bucket" "docker_cache" {
2+
bucket = "pythonit-docker-cache"
3+
}
4+
5+
resource "aws_s3_bucket_server_side_encryption_configuration" "docker_cache" {
6+
bucket = aws_s3_bucket.docker_cache.id
7+
8+
rule {
9+
bucket_key_enabled = false
10+
apply_server_side_encryption_by_default {
11+
sse_algorithm = "AES256"
12+
}
13+
}
14+
}
15+
16+
resource "aws_s3_bucket_lifecycle_configuration" "docker_cache" {
17+
bucket = aws_s3_bucket.docker_cache.id
18+
19+
rule {
20+
id = "expire-old-cache"
21+
status = "Enabled"
22+
23+
expiration {
24+
days = 30
25+
}
26+
}
27+
}
28+
29+
output "docker_cache_bucket_name" {
30+
value = aws_s3_bucket.docker_cache.bucket
31+
}

0 commit comments

Comments
 (0)