Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions codebuild.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
test = "StringLike"
variable = "aws:SourceArn"
values = [
"arn:aws:codebuild:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:project/${var.pipeline_name}-*"
"arn:aws:codebuild:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:project/${var.pipeline_name}-*"
]
}
}
Expand All @@ -78,8 +78,8 @@
test = "StringEquals"
variable = "aws:SourceArn"
values = [
"arn:aws:codebuild:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:project/${var.pipeline_name}-plan",
"arn:aws:codebuild:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:project/${var.pipeline_name}-apply"
"arn:aws:codebuild:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:project/${var.pipeline_name}-plan",
"arn:aws:codebuild:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:project/${var.pipeline_name}-apply"
]
}
}
Expand All @@ -100,7 +100,7 @@
policy = data.aws_iam_policy_document.codebuild.json
}

data "aws_iam_policy_document" "codebuild" {

Check failure on line 103 in codebuild.tf

View workflow job for this annotation

GitHub Actions / scan

CKV_AWS_356: "Ensure no IAM policies documents allow "*" as a statement's resource for restrictable actions"

Check failure on line 103 in codebuild.tf

View workflow job for this annotation

GitHub Actions / scan

CKV_AWS_111: "Ensure IAM policies does not allow write access without constraints"
statement {
effect = "Allow"
actions = [
Expand All @@ -109,7 +109,7 @@
"logs:PutLogEvents"
]
resources = [
"arn:aws:logs:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:log-group:*"
"arn:aws:logs:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:log-group:*"
]
}

Expand Down Expand Up @@ -177,7 +177,7 @@

]
resources = [
"arn:aws:ec2:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:network-interface/*"
"arn:aws:ec2:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:network-interface/*"
]
condition {
test = "StringEquals"
Expand All @@ -191,7 +191,7 @@
variable = "ec2:Subnet"
values = [
for id in var.vpc["subnets"] :
"arn:aws:ec2:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:subnet/${id}"
"arn:aws:ec2:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:subnet/${id}"
]
}
}
Expand All @@ -216,7 +216,7 @@
}
}

resource "aws_cloudwatch_log_group" "this" {

Check failure on line 219 in codebuild.tf

View workflow job for this annotation

GitHub Actions / scan

CKV_AWS_338: "Ensure CloudWatch log groups retains logs for at least 1 year"
name = "/aws/codebuild/${var.pipeline_name}"
retention_in_days = var.log_retention
kms_key_id = var.kms_key
Expand Down
6 changes: 3 additions & 3 deletions codepipeline.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: MIT-0

resource "aws_codepipeline" "this" {

Check failure on line 4 in codepipeline.tf

View workflow job for this annotation

GitHub Actions / scan

CKV_AWS_219: "Ensure CodePipeline Artifact store is using a KMS CMK"
name = var.pipeline_name
pipeline_type = "V2"
role_arn = aws_iam_role.codepipeline_role.arn
Expand Down Expand Up @@ -115,7 +115,7 @@
test = "StringLike"
variable = "aws:SourceArn"
values = [
"arn:aws:codepipeline:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:${var.pipeline_name}"
"arn:aws:codepipeline:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:${var.pipeline_name}"
]
}
}
Expand Down Expand Up @@ -154,7 +154,7 @@
"codebuild:StartBuild"
]
resources = [
"arn:aws:codebuild:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:project/${var.pipeline_name}-*"
"arn:aws:codebuild:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:project/${var.pipeline_name}-*"
]
}

Expand All @@ -169,7 +169,7 @@
"codestar-connections:UseConnection"
]
resources = [
var.connection == null ? "arn:aws:codecommit:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:${var.repo}" : var.connection
var.connection == null ? "arn:aws:codecommit:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:${var.repo}" : var.connection
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion eventbridge.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "aws_cloudwatch_event_rule" "this" {
"CodeCommit Repository State Change"
],
"resources" : [
"arn:aws:codecommit:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:${var.repo}"
"arn:aws:codecommit:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:${var.repo}"
],
"detail" : {
"event" : [
Expand Down
Loading