aws-ia / terraform-aws-control_tower_account_factory

AWS Control Tower Account Factory
Apache License 2.0
604 stars 386 forks source link

Enable to creation of the approval_rule_template in the AFT repositories #382

Open morettilf opened 11 months ago

morettilf commented 11 months ago

It would be great to have a possibility of including a security layer, such as the approval_rule_template, during the creation of AFT repositories, and performing the association. Something similar to this example:

resource "aws_codecommit_approval_rule_template" "templateDefault" { name = "Approval Default" description = "This is an approval default for this environment"

content = jsonencode({ Version = "2018-11-08" DestinationReferences = ["refs/heads/main"] Statements = [{ Type = "Approvers" NumberOfApprovalsNeeded = 1 ApprovalPoolMembers = ["GROUP_ARN"] }] }) }

resource "aws_codecommit_approval_rule_template_association" "associationOne" { for_each = {
"repositorio1" = "aft-NAMEREPO1" "repositorio2" = "aft-NAMEREPO2" "repositorio3" = "aft-NAMEREPO3" "repositorio4" = "aft-NAMEREPO4" "repositorio5" = "aft-NAMEREPO5" }

approval_rule_template_name = aws_codecommit_approval_rule_template.templateDefault.id repository_name = each.value }

stumins commented 11 months ago

Hi @morettilf,

Thank you for submitting this feature request. I've created a ticket in our internal backlog to look at how to best implement this behavior.