Search code examples
terraform-provider-awsterraspace

Avoid creating backend s3 bucket when terraspace plan


Sometimes I need to check what resources will be created within an environment without automatically creating state s3 bucket. I use terraspace plan but it automatically create an s3 bucket with the TS_ENV variable name as set in the backend.tf

Example:

TS_ENV=prod terraspace plan STACK creates a new s3 bucket for the prod environment.

Is there an option to disable that behaviour and only create the bucket when terraspace up?


Solution

  • You need to create a 'aws.rb' file in 'config/plugins/' folder.

    Then you can put the following config to override the default behaviour:

    TerraspacePluginAws.configure do |config|
      config.auto_create = false # set to false to completely disable auto creation
    end
    

    Source: https://terraspace.cloud/docs/plugins/aws/