boltops-tools/terraspace

Terrraspace example project not working

tsharks opened this issue · 1 comments

Checklist

  • Upgrade Terraspace: Are you using the latest version of Terraspace? This allows Terraspace to fix issues fast. There's an Upgrading Guide: https://terraspace.cloud/docs/misc/upgrading/
  • Reproducibility: Are you reporting a bug others will be able to reproduce and not asking a question. If you're unsure or want to ask a question, do so on https://community.boltops.com
  • Code sample: Have you put together a code sample to reproduce the issue and make it available? Code samples help speed up fixes dramatically. If it's an easily reproducible issue, then code samples are not needed. If you're unsure, please include a code sample.

My Environment

Software Version
Operating System Ubuntu
Terraform 1.3.6
Terraspace 2.2.6
Ruby 3.0.3p157

Expected Behaviour

Terraspace AWS example (terraspace new project infra --plugin aws --examples) project should deploy successfully when running terraspace up demo.

Current Behavior

The terraspace up demo command returns the following error:

random_pet.this: Creating...
random_pet.this: Creation complete after 0s [id=real-cub]
module.bucket.aws_s3_bucket.this: Creating...
module.bucket.aws_s3_bucket.this: Creation complete after 1s [id=bucket-real-cub]
module.bucket.aws_s3_bucket_acl.this: Creating...
╷
│ Error: error creating S3 bucket ACL for bucket-real-cub: AccessControlListNotSupported: The bucket does not allow ACLs
│ 	status code: 400, request id: SVN4Z36XFD9T7HEJ, host id: [...]
│ 
│   with module.bucket.aws_s3_bucket_acl.this,
│   on ../../modules/example/main.tf line 5, in resource "aws_s3_bucket_acl" "this":
│    5: resource "aws_s3_bucket_acl" "this" {
│ 

Step-by-step reproduction instructions

Following the instructions in the tutorial in the doc (https://terraspace.cloud/docs/learn/aws/new-project/ and https://terraspace.cloud/docs/learn/aws/deploy/) :

$ terraspace new project infra --plugin aws --examples
$ cd infra
$ terraspace up demo

Solution Suggestion

Given that AWS seems to be slowly deprecating ACLs (see here for latest changes), the example project should not use aws_s3_bucket_acl resources.

Note: Fix for this is in terraspace_plugin_aws. For new installs without the gem already installed, it will work. For existing installs, will need to update the gem manually. Can do that with:

bundle update terraspace_plugin_aws
bundle info terraspace_plugin_aws # to confirm that terraspace_plugin_aws is at least 0.6.0

Generally, I usually update everything and let bundler refresh all gems.

bundle update
bundle info terraspace_plugin_aws # to confirm 

Will update terraspace.gemspec in the next terraspace major release to ensure terraspace_plugin_aws is running at least 0.6.0 but for now these instructions should suffice.