Hello,
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 (DependsOn, Properties):
Cloudformation:
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
Terraform:
resource "aws_codedeploy_deployment_group" "CodeDeployDeploymentGroup" {
app_name = aws_codedeploy_app.example.name
deployment_config_name = "CodeDeployDefault.LambdaAllAtOnce"
deployment_group_name = "${var.AppName}-CodeDeploymentGroup"
service_role_arn = aws_iam_role.example.arn
deployment_style {
deployment_option = "${var.DGDeploymentOption}"
deployment_type = "${var.DGDeploymentType}"
}
trigger_configuration {
trigger_events = ["DeploymentStart","DeploymentSuccess","DeploymentFailure","DeploymentStop","DeploymentRollback","DeploymentReady"]
trigger_name = "SlackTarget"
trigger_target_arn = ["${EnvName}CDNotificationTopicARN"]
}
}
Please let me know how to convert these lines of code to terraform.