Skip to content

Latest commit

 

History

History
115 lines (90 loc) · 2.11 KB

aws_codecommit_trigger.md

File metadata and controls

115 lines (90 loc) · 2.11 KB

aws_codecommit_trigger

back

Index

Terraform

terraform {
  required_providers {
    aws = ">= 3.35.0"
  }
}

top

Example Usage

module "aws_codecommit_trigger" {
  source = "./modules/aws/r/aws_codecommit_trigger"

  # repository_name - (required) is a type of string
  repository_name = null

  trigger = [{
    branches        = []
    custom_data     = null
    destination_arn = null
    events          = []
    name            = null
  }]
}

top

Variables

variable "repository_name" {
  description = "(required)"
  type        = string
}

variable "trigger" {
  description = "nested block: NestingSet, min items: 1, max items: 10"
  type = set(object(
    {
      branches        = list(string)
      custom_data     = string
      destination_arn = string
      events          = list(string)
      name            = string
    }
  ))
}

top

Resource

resource "aws_codecommit_trigger" "this" {
  # repository_name - (required) is a type of string
  repository_name = var.repository_name

  dynamic "trigger" {
    for_each = var.trigger
    content {
      # branches - (optional) is a type of list of string
      branches = trigger.value["branches"]
      # custom_data - (optional) is a type of string
      custom_data = trigger.value["custom_data"]
      # destination_arn - (required) is a type of string
      destination_arn = trigger.value["destination_arn"]
      # events - (required) is a type of list of string
      events = trigger.value["events"]
      # name - (required) is a type of string
      name = trigger.value["name"]
    }
  }

}

top

Outputs

output "configuration_id" {
  description = "returns a string"
  value       = aws_codecommit_trigger.this.configuration_id
}

output "id" {
  description = "returns a string"
  value       = aws_codecommit_trigger.this.id
}

output "this" {
  value = aws_codecommit_trigger.this
}

top