This repository has been archived by the owner on Dec 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
s3.tf
80 lines (64 loc) · 2.13 KB
/
s3.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Source bucket which holds manifest, source python files etc
module "source_bucket" {
source = "terraform-aws-modules/s3-bucket/aws"
bucket = "${var.SERVICE}-${var.BUILD_STAGE}-${data.aws_caller_identity.current.account_id}-source-bucket"
acl = "private"
versioning = {
enabled = true
}
block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
force_destroy = true
}
# Workflow bucket which holds all the inputs and outputs from the execution of the pipeline
module "machine_learning_pipeline_bucket" {
source = "terraform-aws-modules/s3-bucket/aws"
bucket = "${var.SERVICE}-${var.BUILD_STAGE}-${data.aws_caller_identity.current.account_id}-workflow-bucket"
acl = "private"
versioning = {
enabled = false
}
block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
force_destroy = true
}
# CodePipeline bucket which holds input/output artifacts
module "pipeline_artifact_bucket" {
source = "terraform-aws-modules/s3-bucket/aws"
bucket = "${var.SERVICE}-${var.BUILD_STAGE}-${data.aws_caller_identity.current.account_id}-artifact-bucket"
acl = "private"
versioning = {
enabled = false
}
block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
server_side_encryption_configuration = {
rule = {
apply_server_side_encryption_by_default = {
kms_master_key_id = aws_kms_alias.deployment_key.arn
sse_algorithm = "aws:kms"
}
}
}
force_destroy = true
}
# Serverless bucket used by serverless for Lambda deployment
module "serverless_bucket" {
source = "terraform-aws-modules/s3-bucket/aws"
bucket = "${var.SERVICE}-${var.BUILD_STAGE}-${data.aws_caller_identity.current.account_id}-serverless-bucket"
acl = "private"
versioning = {
enabled = false
}
block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
force_destroy = true
}