boltops-tools / terraspace

Terraspace: The Terraform Framework
https://terraspace.cloud
Apache License 2.0
674 stars 46 forks source link

Terrraspace example project not working #309

Closed tsharks closed 1 year ago

tsharks commented 1 year ago

Checklist

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.

tongueroo commented 1 year ago

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.