diff --git a/lib/terraspace_plugin_google/interfaces/backend.rb b/lib/terraspace_plugin_google/interfaces/backend.rb index cf5b17b..f56a6a7 100644 --- a/lib/terraspace_plugin_google/interfaces/backend.rb +++ b/lib/terraspace_plugin_google/interfaces/backend.rb @@ -14,14 +14,15 @@ def call if exist?(bucket) logger.debug "Bucket already exist: #{bucket}" else + location = @info["location"] logger.info "Creating bucket: #{bucket}" - create_bucket(bucket) + create_bucket(bucket, location: location) end end - def create_bucket(bucket) + def create_bucket(bucket, location: nil) c = TerraspacePluginGoogle::Interfaces::Config.instance.config.gcs - storage.create_bucket(bucket) do |b| + storage.create_bucket(bucket, location: location) do |b| b.versioning = c.versioning end end