title: Cloudformation to Terraform conversion of Deployment Group
body: <p>I am converting the following Cloudformation code to Terraform. I have converted the most of the following code except the first few lines upto TriggerConfigurations (Type, DependsOn, Properties):</p>
  <p><strong>Cloudformation:</strong></p>
  <pre><code>CodeDeployDeploymentGroup:
      Type: 'AWS::CodeDeploy::DeploymentGroup'
      DependsOn:
        - CodeDeployApplication
        - CodeDeployRole
      Properties:
        ApplicationName: !Ref CodeDeployApplication
        ServiceRoleArn: !GetAtt 
          - CodeDeployRole
          - Arn
        TriggerConfigurations:
          - TriggerEvents:
              - DeploymentStart
              - DeploymentSuccess
              - DeploymentFailure
              - DeploymentStop
              - DeploymentRollback
              - DeploymentReady
            TriggerName: SlackTarget
            TriggerTargetArn: !ImportValue 
              'Fn::Sub': '${EnvName}CDNotificationTopicARN'
        DeploymentGroupName: !Join 
          - '-'
          - - !Ref AppName
            - CodeDeploymentGroup
        DeploymentConfigName: CodeDeployDefault.LambdaAllAtOnce
        DeploymentStyle:
          DeploymentOption: !Ref DGDeploymentOption
          DeploymentType: !Ref DGDeploymentType
  </code></pre>
  <p><strong>Terraform:</strong></p>
  <pre><code>resource &quot;aws_codedeploy_deployment_group&quot; &quot;CodeDeployDeploymentGroup&quot; {
    app_name               = aws_codedeploy_app.example.name
    deployment_config_name = &quot;CodeDeployDefault.LambdaAllAtOnce&quot;
    deployment_group_name  = &quot;${var.AppName}-CodeDeploymentGroup&quot;
    service_role_arn       = aws_iam_role.example.arn
  
      deployment_style {
      deployment_option = &quot;${var.DGDeploymentOption}&quot;
      deployment_type   = &quot;${var.DGDeploymentType}&quot;
    }
  
    trigger_configuration {
      trigger_events     = [&quot;DeploymentStart&quot;,&quot;DeploymentSuccess&quot;,&quot;DeploymentFailure&quot;,&quot;DeploymentStop&quot;,&quot;DeploymentRollback&quot;,&quot;DeploymentReady&quot;]
      trigger_name       = &quot;SlackTarget&quot;
      trigger_target_arn = [&quot;${EnvName}CDNotificationTopicARN&quot;]
    }
  }
    
  </code></pre>
  <p>Please let me know how to convert these lines of code to terraform.</p>