0

I'm attempting to use AWS CodePipeline to deploy an app to an EC2 instance using CodeDeploy agent, but it's failing with this frustratingly vague "InternalError":

CodePipeline error message

I can't find any other meaningful error.

I'm using terraform to define the CodePipeline. This is the "Deploy" section:

stage {
  name = "Deploy"

  action {
    name            = "Deploy"
    category        = "Deploy"
    owner           = "AWS"
    provider        = "CodeDeploy"
    input_artifacts = ["buildOut"]
    run_order        = 1
    version         = "1"

    configuration = {
      ApplicationName    = aws_codedeploy_app.my-codedeploy-app.id
      DeploymentGroupName = aws_codedeploy_deployment_group.my-codedeploy-group.id
    }
  }
}

What am I doing wrong?

2
  • What is your appspec.yml? Commented May 26, 2020 at 1:40
  • I've had similar caused by issues with the agent on the EC2 - latest version? Is the agent running? What do the agent logs show? Commented May 26, 2020 at 2:53

1 Answer 1

2

There are two small problems with your deployment definition.

  1. ApplicationName should reference app.name, not app.id
  2. DeploymentGroupName should reference deployment_group_name, not group.id

Try this:

stage {
  name = "Deploy"
  action {
    name            = "Deploy"
    category        = "Deploy"
    owner           = "AWS"
    provider        = "CodeDeploy"
    input_artifacts = ["buildOut"]
    run_order        = 1
    version         = "1"
    configuration = {
      ApplicationName    = aws_codedeploy_app.my-codedeploy-app.name  // This should be name, not id
      DeploymentGroupName = aws_codedeploy_deployment_group.my-codedeploy-group.deployment_group_name  // this should be deployment_group_name, not id
    }
  }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.