cloudposse / terraform-aws-cicd

Terraform Module for CI/CD with AWS Code Pipeline and Code Build
https://cloudposse.com/accelerate
Apache License 2.0
192 stars 142 forks source link

Error: cache location is required when cache type is "S3" #96

Closed calvin-barker closed 2 years ago

calvin-barker commented 3 years ago

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

Terraform plan is failing on Terraform v1.0.0 with Error: cache location is required when cache type is "S3"

Expected Behavior

It should not be failing to create the CodeBuild resource

Steps to Reproduce

1.) I initialize a module:

module "build" {
  source     = "cloudposse/cicd/aws"
  attributes = (concat(var.attributes, ["codepipeline"]))
  namespace  = var.namespace
  stage      = var.stage
  name       = var.name
  enabled    = var.codepipeline_enabled

  # Application repository on GitHub
  github_oauth_token = var.codepipeline_github_token
  repo_owner         = var.codepipeline_repo_owner
  repo_name          = var.codepipeline_repo_name
  branch             = var.codepipeline_branch
}

2.) I commit and push.

3.) Terraform Cloud gives this error:

│ Error: cache location is required when cache type is "S3"
│ 
│   with module.landing_page.module.build.module.codebuild.aws_codebuild_project.default[0],
│   on .terraform/modules/landing_page.build.codebuild/main.tf line 265, in resource "aws_codebuild_project" "default":
│  265: resource "aws_codebuild_project" "default" {
│ 
╵

Environment (please complete the following information):

Using Terraform v1.0.0 in Terraform Cloud

aidan-mcarthur commented 3 years ago

Getting this too. Looks like the codebuild module being used is out of date (0.33.0)

nitrocode commented 2 years ago

Hopefully this is closed by this PR https://github.com/cloudposse/terraform-aws-cicd/pull/95

nitrocode commented 2 years ago

@aidan-mcarthur @calvin-barker please retry using the latest module version and comment back if this is still an issue.