Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 14f9467

Browse files
committed
Add CodeBuild caching
1 parent 0a14e47 commit 14f9467

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

‎buildspec.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111
TF_VAR_build_docker_tag: "6.10.0"
1212
TF_VAR_buildspec: "buildspec.yml"
1313
TF_VAR_source_location: "https://github.com/jch254/serverless-node-dynamodb-api.git"
14+
TF_VAR_cache_bucket: "603-codebuild-cache/serverless-node-dynamodb-api"
1415
TF_VAR_dns_name: "sls-api.603.nz"
1516
TF_VAR_route53_zone_id: "Z18NTUPI1RKRGC"
1617
TF_VAR_acm_arn: "arn:aws:acm:us-east-1:982898479788:certificate/65811194-cc89-4926-83c3-199c5c0b6e0c"
@@ -29,3 +30,9 @@ phases:
2930
commands:
3031
- ./infrastructure/deploy-infrastructure.bash
3132
- ./infrastructure/deploy-serverless.bash
33+
34+
cache:
35+
paths:
36+
- 'infrastructure/.terraform/modules/**/*'
37+
- 'infrastructure/.terraform/plugins/**/*'
38+
- '/usr/local/share/.cache/yarn/v1/**/*'

‎infrastructure/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ resource "aws_codebuild_webhook" "codebuild_webhook" {
4949
}
5050

5151
module "codebuild_project" {
52-
source = "github.com/jch254/terraform-modules//codebuild-project?ref=1.0.0"
52+
source = "github.com/jch254/terraform-modules//codebuild-project?ref=1.0.4"
5353

5454
name = "${var.name}"
5555
codebuild_role_arn = "${aws_iam_role.codebuild_role.arn}"
@@ -58,6 +58,7 @@ module "codebuild_project" {
5858
source_type = "${var.source_type}"
5959
buildspec = "${var.buildspec}"
6060
source_location = "${var.source_location}"
61+
cache_bucket = "${var.cache_bucket}"
6162
}
6263

6364
resource "aws_api_gateway_domain_name" "domain" {

‎infrastructure/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ variable "source_location" {
3535
description = "HTTPS URL of CodeCommit repo or S3 bucket to use as project source"
3636
}
3737

38+
variable "cache_bucket" {
39+
description = "S3 bucket to use as build cache, the value must be a valid S3 bucket name/prefix"
40+
default = ""
41+
}
42+
3843
variable "dns_name" {
3944
description = "DNS name"
4045
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /