0

Trying to create AWS CodePipeline using Terraform. While applying resource aws_codepipeline > Deploy action, I'm getting below error:

* module.pipeline.aws_codepipeline.pipeline: 1 error(s) occurred:

* aws_codepipeline.pipeline: [ERROR] Error creating CodePipeline: InvalidActionDeclarationException: ActionType (Category: 'Deploy', Provider: 'ECS', Owner: 'AWS', Version: '1') in action 'Deploy' is not available
        status code: 400, request id: 276a85b8-60f0-11e8-8152-6160c01dc881

The terraform configuration is:

  resource "aws_codepipeline" "pipeline" {
  name     = "${var.cluster_name}-pipeline"
  role_arn = "${aws_iam_role.codepipeline_role.arn}"

  artifact_store {
    location = "${aws_s3_bucket.source.bucket}"
    type     = "S3"
  }

  stage {
    name = "Production"

    action {
      name            = "Deploy"
      category        = "Deploy"
      owner           = "AWS"
      provider        = "ECS"
      input_artifacts = ["imagedefinitions"]
      version         = "1"

      configuration {
        ClusterName = "${var.cluster_name}"
        ServiceName = "${var.app_service_name}"
        FileName    = "imagedefinitions.json"
      }
    }
  }
}

AWS region is 'ap-south-1'.

Any pointer's on what's wrong here?

the-petrolhead
  • 597
  • 1
  • 5
  • 16
  • 'terraform apply' runs successfully when region is switched to 'us-east-1.' Wondering why 'ap-south-1' causes the issue. – the-petrolhead May 26 '18 at 17:10
  • Have you tried deploying manually in `ap-south-1`, maybe that could give some insight? It appears based on https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/ CodePipelines should be supported. – Brandon Miller May 27 '18 at 00:03
  • Thanks @BrandonMiller for your response. Meanwhile, `aws codepipeline list-action-types --region ap-south-1` does not list ECS. When I change region to `us-east-1`, it is available. – the-petrolhead May 27 '18 at 07:22
  • AWS CodePipeline now supports ECS as deploy action provider in `ap-south-1`. Can anyone suggest where should I be looking for such announcements? – the-petrolhead Jun 11 '18 at 20:52

1 Answers1

1

Figured it out.

The issue is from provider end. AWS CodePipeline doesn't support deployments to Amazon ECS in region ap-south-1 as of yet.

https://aws.amazon.com/about-aws/whats-new/2017/12/aws-codepipeline-adds-support-for-amazon-ecs-and-aws-fargate/

the-petrolhead
  • 597
  • 1
  • 5
  • 16