-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c72eb59
commit ca8c589
Showing
10 changed files
with
60 additions
and
31 deletions.
There are no files selected for viewing
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
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
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
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
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
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 |
---|---|---|
@@ -1,26 +1,42 @@ | ||
|
||
resource "aws_s3_bucket" "artifacts" { | ||
# tfsec:ignore:AWS077 | ||
# tfsec:ignore:AWS002 | ||
# checkov:skip=CKV_AWS_144: ADD REASON | ||
# checkov:skip=CKV_AWS_18: "Ensure the S3 bucket has access logging enabled" | ||
# checkov:skip=CKV_AWS_21: "Ensure all data stored in the S3 bucket have versioning enabled" | ||
# checkov:skip=CKV_AWS_52: "Ensure S3 bucket has MFA delete enabled" | ||
# checkov:skip=CKV2_AWS_6: ADD REASON | ||
# checkov:skip=CKV2_AWS_41: ADD REASON | ||
# checkov:skip=CKV_AWS_18:LEGACY | ||
# checkov:skip=CKV_AWS_144:LEGACY | ||
# checkov:skip=CKV_AWS_19:LEGACY | ||
# checkov:skip=CKV_AWS_145:LEGACY | ||
# checkov:skip=CKV_AWS_21:LEGACY | ||
count = var.bucketname == "" ? 1 : 0 | ||
bucket = local.bucketname | ||
acl = "private" | ||
force_destroy = var.force_artifact_destroy | ||
} | ||
|
||
versioning { | ||
enabled = var.versioning | ||
mfa_delete = var.mfa_delete | ||
} | ||
|
||
server_side_encryption_configuration { | ||
rule { | ||
apply_server_side_encryption_by_default { | ||
sse_algorithm = var.sse_algorithm | ||
} | ||
resource "aws_s3_bucket_server_side_encryption_configuration" "example" { | ||
count = var.bucketname == "" ? 1 : 0 | ||
bucket = aws_s3_bucket.artifacts[0].bucket | ||
rule { | ||
apply_server_side_encryption_by_default { | ||
sse_algorithm = var.sse_algorithm | ||
kms_master_key_id = var.kms_key_id | ||
} | ||
} | ||
} | ||
|
||
resource "aws_s3_bucket_versioning" "example" { | ||
count = var.bucketname == "" ? 1 : 0 | ||
bucket = aws_s3_bucket.artifacts[0].id | ||
versioning_configuration { | ||
status = var.versioning | ||
mfa_delete = var.mfa_delete | ||
} | ||
} | ||
|
||
|
||
|
||
resource "aws_s3_bucket_acl" "example" { | ||
count = var.bucketname == "" ? 1 : 0 | ||
bucket = aws_s3_bucket.artifacts[0].id | ||
acl = "private" | ||
} |
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
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
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
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