Terraform-provider-aws: Add support for CodeBuild with VPC

Created on 30 Nov 2017  ·  4Comments  ·  Source: hashicorp/terraform-provider-aws

Amazon announced support for running CodeBuild builds within a VPC last week.

Affected Resource(s)

  • aws_codebuild_project

Expected Behavior

Create & update of projects should optionally allow the specification of VPC, subnets & security groups, likely within a new optional block to match the Create and Update APIs. Read will also need additions for these properties.

  • If VPC is supplied, subnets must also be supplied.
  • If subnets is supplied, VPC must also be supplied.
  • If security_groups is supplied, both VPC and subnets must be supplied.
resource "aws_codebuild_project" "foo" {
  name = "test-project"

  artifacts {
    type = "NO_ARTIFACTS"
  }

  environment {
    compute_type = "BUILD_GENERAL1_SMALL"
    image        = "2"
    type         = "LINUX_CONTAINER"
  }

  source {
    type     = "GITHUB"
    location = "https://github.com/mitchellh/packer.git"
  }

  vpc_config {
    vpc_id = "vpc-725fca"

    subnets = [
       "subnet-ba35d2e0",
       "subnet-ab129af1",
    ]

    security_group_ids = [
       "sg-f9f27d91",
       "sg-e4f48g23",
    ]
  }
}

References

Blog post
Documentation

enhancement serviccodebuild

Most helpful comment

This functionality has been merged into master via #2547 and #3324. It will be released in v1.10.0 of the AWS provider, likely tomorrow. 🎉

All 4 comments

I'm really looking for this as well. Only way (AWS is talking about) to access RDS instances from your continuous deployment.

This functionality has been merged into master via #2547 and #3324. It will be released in v1.10.0 of the AWS provider, likely tomorrow. 🎉

This has been released in version 1.10.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

Was this page helpful?
0 / 5 - 0 ratings