Skip to content
Prev Previous commit
Next Next commit
Attach codestar policy to codebuild service role if 'full clone' opti…
…on is selected
  • Loading branch information
joe-niland committed Jul 11, 2022
commit ec0ea1a9de0d9df1d4cbbb6574c5f310e797a01b
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ resource "aws_iam_role_policy_attachment" "codebuild_s3" {
}

resource "aws_iam_role_policy_attachment" "codebuild_codestar" {
count = module.this.enabled && local.use_codestar ? 1 : 0
count = module.this.enabled && local.use_codestar && var.codestar_output_artifact_format == "CODEBUILD_CLONE_REF" ? 1 : 0
role = module.codebuild.role_id
policy_arn = join("", aws_iam_policy.codestar.*.arn)
}
Expand Down