Skip to content

Conversation

@sbkok
Copy link
Collaborator

@sbkok sbkok commented Sep 1, 2022

Why?

To add support for build/deploy steps that use CodeBuild and need to connect to internal resources that are only available through a VPC.

This feature allows you to configure which VPC to connect to, using a specific list of subnets and security groups. The latter helps ensure that the connection is only allowed to connect when a specific security group is used.

What?

Added three properties to the CodeBuild provider:

  • vpc_id (string)
  • subnet_ids (list of ids (strings))
  • security_group_ids (list of ids (strings))

When you configure a pipeline to use a specific VPC, you need to specify the subnets to use as well.

In case you don't specify any security groups, they will be automatically created for you. These security groups allow all egress traffic by default. It is recommended to use a specific security group so you can strictly define what egress traffic is allowed.

Please note: When you configure a specific CodeBuild environment in a pipeline to use a VPC it cannot be removed easily. To remove the VPC from the CodeBuild environment, you need to remove the pipeline stack and instruct ADF to generate the pipelines again (release trigger on aws-deployment-framework-pipelines in CodePipeline).

Documentation has been added and a sample that shows how to setup a pipeline to use a specific VPC.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@sbkok sbkok added this to the v3.2.0 milestone Sep 1, 2022
@sbkok sbkok force-pushed the feature/codebuild-vpc-support branch from e19ddda to 4700159 Compare September 1, 2022 14:58
def main():
LOGGER.info("ADF Version %s", ADF_VERSION)
LOGGER.info("ADF Log Level is %s", ADF_LOG_LEVEL)
_threads = []
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not used anywhere, hence I removed it.

**Why?**

To add support for build/deploy steps that use CodeBuild and need to
connect to internal resources that are only available through a VPC.

This feature allows you to configure which VPC to connect to, using a
specific list of subnets and security groups. The latter helps ensure
that the connection is only allowed to connect when a specific security
group is used.

**What?**

Added three properties to the CodeBuild provider:
- vpc_id (string)
- subnet_ids (list of ids (strings))
- security_group_ids (list of ids (strings))

When you configure a pipeline to use a specific VPC, you need to specify
the subnets to use as well.

In case you don't specify any security groups, they will be
automatically created for you. These security groups allow all egress
traffic by default. It is recommended to use a specific security group
so you can strictly define what egress traffic is allowed.

Please note: When you configure a specific CodeBuild environment in a
pipeline to use a VPC it cannot be removed easily. To remove the VPC
from the CodeBuild environment, you need to remove the pipeline stack
and instruct ADF to generate the pipelines again (release trigger on
aws-deployment-framework-pipelines in CodePipeline).

Documentation has been added and a sample that shows how to setup a
pipeline to use a specific VPC.
@sbkok sbkok force-pushed the feature/codebuild-vpc-support branch from 4700159 to da52997 Compare September 1, 2022 18:40
Copy link
Contributor

@javydekoning javydekoning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't spec_filename default to buildspec.yml if both spec_inline and the spec_filename is not provided?

@sbkok
Copy link
Collaborator Author

sbkok commented Sep 5, 2022

By default, when they are not supplied, they are not forwarded to CDK and thereby CloudFormation either.
Which defaults to buildspec.yml, see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-source.html#cfn-codebuild-project-source-buildspec

Copy link
Contributor

@javydekoning javydekoning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I personally don't like the Blockquotes style (>) in the unordered lists in the docs. It requires a prefix on every line and is harder to format (like line wrapping if we stick to linelength=80) and mix with codefences.

I have changed this in my latest PR #521 so we might have to change that if we choose to merge #521

@sbkok sbkok merged commit 96ac4c2 into awslabs:master Sep 6, 2022
@sbkok sbkok deleted the feature/codebuild-vpc-support branch September 6, 2022 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants