terraspace_plugin_aws 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -4
- data/Gemfile +1 -6
- data/README.md +14 -12
- data/lib/templates/hcl/project/config/terraform/backend.tf.tt +9 -0
- data/lib/templates/hcl/project/config/{templates → terraform}/provider.tf +0 -0
- data/lib/templates/hcl/stack/main.tf +2 -2
- data/lib/templates/hcl/stack/variables.tf +0 -6
- data/lib/templates/ruby/project/config/{templates → terraform}/backend.rb.tt +0 -0
- data/lib/templates/ruby/project/config/{templates → terraform}/provider.rb +0 -0
- data/lib/templates/ruby/stack/main.rb +2 -2
- data/lib/templates/ruby/stack/variables.rb +0 -6
- data/lib/templates/test/rspec/module/test/spec/fixtures/stack/main.tf +9 -0
- data/lib/templates/test/rspec/module/test/spec/fixtures/stack/outputs.tf +4 -0
- data/lib/templates/test/rspec/module/test/spec/fixtures/stack/variables.tf +11 -0
- data/lib/templates/test/rspec/module/test/spec/main_spec.rb.tt +2 -2
- data/lib/templates/test/rspec/project/spec/fixtures/tfvars/demo.tfvars +1 -0
- data/lib/templates/test/rspec/project/spec/spec_helper.rb +13 -0
- data/lib/templates/test/rspec/project/spec/stacks/demo/main_spec.rb +26 -0
- data/lib/terraspace_plugin_aws.rb +6 -4
- data/lib/terraspace_plugin_aws/interfaces/backend.rb +2 -0
- data/lib/terraspace_plugin_aws/interfaces/backend/base.rb +4 -0
- data/lib/terraspace_plugin_aws/interfaces/backend/bucket.rb +6 -6
- data/lib/terraspace_plugin_aws/interfaces/backend/table.rb +3 -3
- data/lib/terraspace_plugin_aws/interfaces/config.rb +7 -2
- data/lib/terraspace_plugin_aws/interfaces/expander.rb +2 -0
- data/lib/terraspace_plugin_aws/interfaces/layer.rb +4 -4
- data/lib/terraspace_plugin_aws/interfaces/summary.rb +60 -0
- data/lib/terraspace_plugin_aws/version.rb +1 -1
- metadata +13 -6
- data/lib/templates/hcl/project/config/templates/backend.tf.tt +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfca334913ce20496d5ed7dff1191c741880b1f7453beb43302641874a645052
|
4
|
+
data.tar.gz: 667087253840e4822c26e2ca73af799a14e63d8cca5a1b4b4d23557938a1e03f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6640c1548bdc8d0e9c6b7a61a9916eee88d8d1f7cb7a2527aba4c0dfba039c8216c9f1f2ba4aac684911344dbe6af73976c61b4d0ce49233ba4c879caa93e71b
|
7
|
+
data.tar.gz: a25e90407bee9259200a31b83aa61d9e285cc0b61fc93f1b5a77a7cacc7323e6fb909a551269f8d35bd22cfee242c0a19b5ab0ab164d539f841eec9eeed6cb59
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
#
|
1
|
+
# Changelog
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
-
## [0.0
|
7
|
-
-
|
8
|
-
|
6
|
+
## [0.1.0]
|
7
|
+
- Initial release
|
data/Gemfile
CHANGED
@@ -7,10 +7,5 @@ gem "rake", "~> 12.0"
|
|
7
7
|
gem "rspec", "~> 3.0"
|
8
8
|
|
9
9
|
group :development, :test do
|
10
|
-
|
11
|
-
base = ENV['TS_EDGE_ROOT'] || "#{ENV['HOME']}/environment/terraspace-edge"
|
12
|
-
gem "terraspace", path: "#{base}/terraspace"
|
13
|
-
else
|
14
|
-
gem "terraspace"
|
15
|
-
end
|
10
|
+
gem "terraspace"
|
16
11
|
end
|
data/README.md
CHANGED
@@ -18,23 +18,25 @@ config/plugins/aws.rb
|
|
18
18
|
|
19
19
|
```ruby
|
20
20
|
TerraspacePluginAws.configure do |config|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
21
|
+
config.auto_create = true # set to false to completely disable auto creation
|
22
|
+
|
23
|
+
config.s3.encryption = true
|
24
|
+
config.s3.enforce_ssl = true
|
25
|
+
config.s3.versioning = true
|
26
|
+
config.s3.lifecycle = true
|
27
|
+
config.s3.access_logging = true
|
28
|
+
config.s3.secure_existing = false # run the security controls on existing buckets. by default, only run on newly created bucket the first time
|
29
|
+
|
30
|
+
config.dynamodb.encryption = true
|
31
|
+
config.dynamodb.kms_master_key_id = nil
|
32
|
+
config.dynamodb.sse_type = "KMS"
|
31
33
|
end
|
32
34
|
```
|
33
35
|
|
34
36
|
By default:
|
35
37
|
|
36
|
-
* S3 Buckets are secured with encryption, have an enforce ssl bucket policy, have versioning enabled, has a lifecycle policy, and have bucket access logging enabled.
|
37
|
-
* DynamoDB tables have encryption enabled using the AWS Managed KMS Key for DynamoDB.
|
38
|
+
* S3 Buckets are secured with [encryption](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html), have an [enforce ssl bucket policy](https://aws.amazon.com/premiumsupport/knowledge-center/s3-bucket-policy-for-config-rule/), have [versioning enabled](https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html), has a [lifecycle policy](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-lifecycle.html), and have [bucket server access logging enabled](https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerLogs.html).
|
39
|
+
* DynamoDB tables have [encryption enabled](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/EncryptionAtRest.html) using the AWS Managed KMS Key for DynamoDB.
|
38
40
|
|
39
41
|
The settings generally only apply if the s3 bucket or dynamodb table do not yet exist yet and is created for the first time.
|
40
42
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
terraform {
|
2
|
+
backend "s3" {
|
3
|
+
bucket = "<%%= backend_expand('s3', 'terraform-state-:ACCOUNT-:REGION-:ENV') %>" # expanded by terraspace IE: terraform-state-112233445566-us-west-2-dev
|
4
|
+
key = "<%%= backend_expand('s3', ':REGION/:ENV/:BUILD_DIR/terraform.tfstate') %>" # expanded by terraspace IE: us-west-2/dev/modules/vm/terraform.tfstate
|
5
|
+
region = "<%%= backend_expand('s3', ':REGION') %>"
|
6
|
+
encrypt = true
|
7
|
+
dynamodb_table = "terraform_locks"
|
8
|
+
}
|
9
|
+
}
|
File without changes
|
@@ -1,9 +1,3 @@
|
|
1
|
-
variable "bucket" {
|
2
|
-
description = "The name of the bucket. If omitted, Terraform will assign a random, unique name." # IE: terraform-2020052606510241590000000
|
3
|
-
type = string
|
4
|
-
default = null
|
5
|
-
}
|
6
|
-
|
7
1
|
variable "acl" {
|
8
2
|
description = "The canned ACL to apply. Defaults to 'private'."
|
9
3
|
type = string
|
File without changes
|
File without changes
|
@@ -1,9 +1,3 @@
|
|
1
|
-
variable("bucket",
|
2
|
-
description: "The name of the bucket. If omitted, Terraform will assign a random, unique name.", # IE: terraform-2020052606510241590000000
|
3
|
-
type: "string",
|
4
|
-
default: nil,
|
5
|
-
)
|
6
|
-
|
7
1
|
variable("acl",
|
8
2
|
description: "The canned ACL to apply. Defaults to 'private'.",
|
9
3
|
type: "string",
|
@@ -0,0 +1,11 @@
|
|
1
|
+
variable "bucket" {
|
2
|
+
description = "The name of the bucket. If omitted, Terraform will assign a random, unique name." # IE: terraform-2020052606510241590000000
|
3
|
+
type = string
|
4
|
+
default = null
|
5
|
+
}
|
6
|
+
|
7
|
+
variable "acl" {
|
8
|
+
description = "The canned ACL to apply. Defaults to 'private'."
|
9
|
+
type = string
|
10
|
+
default = "private"
|
11
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# This starter example of a spec that creates a test harness and provisions a real s3 bucket.
|
2
2
|
# The test harness will be created at:
|
3
3
|
#
|
4
|
-
# /tmp/terraspace-test-harnesses/<%= @name
|
4
|
+
# /tmp/terraspace-test-harnesses/<%= @name %>-harness
|
5
5
|
#
|
6
6
|
# It's recommended to run this on a test AWS account.
|
7
7
|
#
|
@@ -9,7 +9,7 @@ describe "main" do
|
|
9
9
|
before(:all) do
|
10
10
|
mod_path = File.expand_path("../..", __dir__)
|
11
11
|
terraspace.build_test_harness(
|
12
|
-
name: "<%= @name
|
12
|
+
name: "<%= @name %>-harness",
|
13
13
|
modules: {example: mod_path},
|
14
14
|
stacks: {example: "#{mod_path}/test/spec/fixtures/stack"},
|
15
15
|
)
|
@@ -0,0 +1 @@
|
|
1
|
+
# var = "value"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
describe "main" do
|
2
|
+
before(:all) do
|
3
|
+
# Build terraspace project to use as a test harness
|
4
|
+
# Will be located at: /tmp/terraspace/test-harnesses/demo-harness
|
5
|
+
terraspace.build_test_harness(
|
6
|
+
name: "demo-harness",
|
7
|
+
modules: "app/modules", # include all modules in this folder
|
8
|
+
stacks: "app/stacks", # include all stacks in this folder
|
9
|
+
# override demo stack tfvars for testing
|
10
|
+
# copied over to test harness' app/stacks/demo/tfvars/test.tfvars
|
11
|
+
tfvars: {demo: "spec/fixtures/tfvars/demo.tfvars"},
|
12
|
+
# create config if needed. The folder will be copied over
|
13
|
+
# config: "spec/fixtures/config",
|
14
|
+
)
|
15
|
+
terraspace.up("demo") # provision real resources
|
16
|
+
end
|
17
|
+
after(:all) do
|
18
|
+
terraspace.down("demo") # destroy real resources
|
19
|
+
end
|
20
|
+
|
21
|
+
it "successful deploy" do
|
22
|
+
# Replace with your actual test
|
23
|
+
bucket_name = terraspace.output("example", "bucket_name")
|
24
|
+
expect(bucket_name).to include("bucket-") # IE: bucket-pet-name
|
25
|
+
end
|
26
|
+
end
|
@@ -1,6 +1,3 @@
|
|
1
|
-
lib = File.expand_path("../../../", __FILE__)
|
2
|
-
$:.unshift(lib)
|
3
|
-
|
4
1
|
require "memoist"
|
5
2
|
require "terraspace" # for interface
|
6
3
|
|
@@ -20,12 +17,17 @@ module TerraspacePluginAws
|
|
20
17
|
def configure(&block)
|
21
18
|
Interfaces::Config.instance.configure(&block)
|
22
19
|
end
|
20
|
+
|
21
|
+
def config
|
22
|
+
Interfaces::Config.instance.config
|
23
|
+
end
|
24
|
+
|
23
25
|
extend self
|
24
26
|
end
|
25
27
|
|
26
28
|
Terraspace::Plugin.register("aws",
|
27
29
|
backend: "s3",
|
28
|
-
|
30
|
+
config_class: TerraspacePluginAws::Interfaces::Config,
|
29
31
|
layer_class: TerraspacePluginAws::Interfaces::Layer, # used for layering
|
30
32
|
root: File.dirname(__dir__),
|
31
33
|
)
|
@@ -5,15 +5,15 @@ class TerraspacePluginAws::Interfaces::Backend
|
|
5
5
|
def create
|
6
6
|
bucket = @info["bucket"]
|
7
7
|
unless bucket # not bucket provided
|
8
|
-
|
8
|
+
logger.error "ERROR: no bucket value provided in your terraform backend config".color(:red)
|
9
9
|
exit 1
|
10
10
|
end
|
11
11
|
if exist?(bucket)
|
12
|
-
|
12
|
+
logger.debug "Bucket already exist: #{bucket}"
|
13
13
|
c = TerraspacePluginAws::Interfaces::Config.instance.config.s3
|
14
14
|
secure(bucket) if c.secure_existing
|
15
15
|
else
|
16
|
-
|
16
|
+
logger.info "Creating bucket: #{bucket}"
|
17
17
|
s3.create_bucket(bucket: bucket)
|
18
18
|
secure(bucket)
|
19
19
|
end
|
@@ -25,9 +25,9 @@ class TerraspacePluginAws::Interfaces::Backend
|
|
25
25
|
rescue Aws::S3::Errors::NotFound
|
26
26
|
false # Bucket does not exist
|
27
27
|
rescue Aws::S3::Errors::Forbidden => e
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
logger.error "#{e.class}: #{e.message}"
|
29
|
+
logger.error "ERROR: Bucket is not available: #{name}".color(:red)
|
30
|
+
logger.error "Bucket might be owned by someone else or is on another one of your AWS accounts."
|
31
31
|
exit 1
|
32
32
|
end
|
33
33
|
end
|
@@ -5,16 +5,16 @@ class TerraspacePluginAws::Interfaces::Backend
|
|
5
5
|
return unless table # not table provided
|
6
6
|
|
7
7
|
if exist?(table)
|
8
|
-
|
8
|
+
logger.debug "Table already exist: #{table}"
|
9
9
|
else
|
10
|
-
|
10
|
+
logger.info "Creating dynamodb table: #{table}"
|
11
11
|
create_table(table)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
def create_table(name)
|
16
16
|
dynamodb.create_table(table_definition(name))
|
17
|
-
|
17
|
+
logger.info "Waiting for dynamodb table to finish creating..."
|
18
18
|
dynamodb.wait_until(:table_exists, table_name: name)
|
19
19
|
end
|
20
20
|
|
@@ -3,15 +3,19 @@ module TerraspacePluginAws::Interfaces
|
|
3
3
|
include Terraspace::Plugin::Config::Interface
|
4
4
|
include Singleton
|
5
5
|
|
6
|
+
# interface method
|
7
|
+
# load_project_config: config/plugins/aws.rb
|
6
8
|
def provider
|
7
9
|
"aws"
|
8
10
|
end
|
9
11
|
|
12
|
+
# interface method
|
10
13
|
def defaults
|
11
14
|
c = ActiveSupport::OrderedOptions.new
|
12
|
-
c.s3 = ActiveSupport::OrderedOptions.new
|
13
|
-
c.dynamodb = ActiveSupport::OrderedOptions.new
|
14
15
|
|
16
|
+
c.auto_create = true
|
17
|
+
|
18
|
+
c.s3 = ActiveSupport::OrderedOptions.new
|
15
19
|
c.s3.encryption = true
|
16
20
|
c.s3.enforce_ssl = true
|
17
21
|
c.s3.versioning = true
|
@@ -19,6 +23,7 @@ module TerraspacePluginAws::Interfaces
|
|
19
23
|
c.s3.access_logging = true
|
20
24
|
c.s3.secure_existing = false # run the security controls on existing buckets. by default, only run on newly created bucket the first time
|
21
25
|
|
26
|
+
c.dynamodb = ActiveSupport::OrderedOptions.new
|
22
27
|
c.dynamodb.encryption = true
|
23
28
|
c.dynamodb.kms_master_key_id = nil
|
24
29
|
c.dynamodb.sse_type = "KMS"
|
@@ -4,6 +4,8 @@ module TerraspacePluginAws::Interfaces
|
|
4
4
|
class Expander
|
5
5
|
include Terraspace::Plugin::Expander::Interface
|
6
6
|
delegate :account, :region, to: :aws_data
|
7
|
+
alias_method :namespace, :account
|
8
|
+
alias_method :location, :region
|
7
9
|
|
8
10
|
def aws_data
|
9
11
|
$__aws_data ||= AwsData.new
|
@@ -5,13 +5,13 @@ module TerraspacePluginAws::Interfaces
|
|
5
5
|
extend Memoist
|
6
6
|
|
7
7
|
# interface method
|
8
|
-
def
|
9
|
-
aws_data.
|
8
|
+
def namespace
|
9
|
+
aws_data.account
|
10
10
|
end
|
11
11
|
|
12
12
|
# interface method
|
13
|
-
def
|
14
|
-
aws_data.
|
13
|
+
def region
|
14
|
+
aws_data.region
|
15
15
|
end
|
16
16
|
|
17
17
|
# interface method
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module TerraspacePluginAws::Interfaces
|
2
|
+
class Summary
|
3
|
+
include Terraspace::Plugin::Summary::Interface
|
4
|
+
include TerraspacePluginAws::Clients
|
5
|
+
|
6
|
+
# interface method
|
7
|
+
def download
|
8
|
+
resp = s3.list_objects(bucket: @bucket)
|
9
|
+
resp.contents.each do |content|
|
10
|
+
local_path = "#{@dest}/#{content.key}"
|
11
|
+
FileUtils.mkdir_p(File.dirname(local_path))
|
12
|
+
s3.get_object(
|
13
|
+
response_target: local_path,
|
14
|
+
bucket: @bucket,
|
15
|
+
key: content.key,
|
16
|
+
)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# interface method
|
21
|
+
def delete_empty_statefile(key)
|
22
|
+
delete_lock_id(key)
|
23
|
+
delete_s3_file(key)
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
def delete_s3_file(key)
|
28
|
+
s3.delete_object(
|
29
|
+
bucket: @bucket,
|
30
|
+
key: key,
|
31
|
+
)
|
32
|
+
# resp is:
|
33
|
+
#
|
34
|
+
# <struct Aws::S3::Types::DeleteObjectOutput
|
35
|
+
# delete_marker=nil,
|
36
|
+
# version_id=nil,
|
37
|
+
# request_charged=nil>
|
38
|
+
end
|
39
|
+
|
40
|
+
def delete_lock_id(key)
|
41
|
+
lock_id = "#{@bucket}/#{key}-md5"
|
42
|
+
table_name = @info['dynamodb_table']
|
43
|
+
dynamodb.delete_item(
|
44
|
+
key: {LockID: lock_id},
|
45
|
+
table_name: table_name,
|
46
|
+
)
|
47
|
+
# resp is:
|
48
|
+
#
|
49
|
+
# #<struct Aws::DynamoDB::Types::DeleteItemOutput
|
50
|
+
# attributes=nil,
|
51
|
+
# consumed_capacity=nil,
|
52
|
+
# item_collection_metrics=nil>
|
53
|
+
rescue Aws::DynamoDB::Errors::ResourceNotFoundException => e
|
54
|
+
# Exception happens when dynamodb table doesnt exist
|
55
|
+
# If the lock item is missing, it successfully sends the api call to delete, even though there's nothing to delete
|
56
|
+
logger.error "ERROR: #{e.class}: #{e.message}"
|
57
|
+
logger.error "Table may not exist"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terraspace_plugin_aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-dynamodb
|
@@ -113,23 +113,29 @@ files:
|
|
113
113
|
- lib/templates/hcl/module/main.tf
|
114
114
|
- lib/templates/hcl/module/outputs.tf
|
115
115
|
- lib/templates/hcl/module/variables.tf
|
116
|
-
- lib/templates/hcl/project/config/
|
117
|
-
- lib/templates/hcl/project/config/
|
116
|
+
- lib/templates/hcl/project/config/terraform/backend.tf.tt
|
117
|
+
- lib/templates/hcl/project/config/terraform/provider.tf
|
118
118
|
- lib/templates/hcl/stack/main.tf
|
119
119
|
- lib/templates/hcl/stack/outputs.tf
|
120
120
|
- lib/templates/hcl/stack/variables.tf
|
121
121
|
- lib/templates/ruby/module/main.rb
|
122
122
|
- lib/templates/ruby/module/outputs.rb
|
123
123
|
- lib/templates/ruby/module/variables.rb
|
124
|
-
- lib/templates/ruby/project/config/
|
125
|
-
- lib/templates/ruby/project/config/
|
124
|
+
- lib/templates/ruby/project/config/terraform/backend.rb.tt
|
125
|
+
- lib/templates/ruby/project/config/terraform/provider.rb
|
126
126
|
- lib/templates/ruby/stack/main.rb
|
127
127
|
- lib/templates/ruby/stack/outputs.rb
|
128
128
|
- lib/templates/ruby/stack/variables.rb
|
129
129
|
- lib/templates/test/rspec/module/test/.rspec
|
130
130
|
- lib/templates/test/rspec/module/test/Gemfile.tt
|
131
|
+
- lib/templates/test/rspec/module/test/spec/fixtures/stack/main.tf
|
132
|
+
- lib/templates/test/rspec/module/test/spec/fixtures/stack/outputs.tf
|
133
|
+
- lib/templates/test/rspec/module/test/spec/fixtures/stack/variables.tf
|
131
134
|
- lib/templates/test/rspec/module/test/spec/main_spec.rb.tt
|
132
135
|
- lib/templates/test/rspec/module/test/spec/spec_helper.rb
|
136
|
+
- lib/templates/test/rspec/project/spec/fixtures/tfvars/demo.tfvars
|
137
|
+
- lib/templates/test/rspec/project/spec/spec_helper.rb
|
138
|
+
- lib/templates/test/rspec/project/spec/stacks/demo/main_spec.rb
|
133
139
|
- lib/terraspace_plugin_aws.rb
|
134
140
|
- lib/terraspace_plugin_aws/autoloader.rb
|
135
141
|
- lib/terraspace_plugin_aws/clients.rb
|
@@ -144,6 +150,7 @@ files:
|
|
144
150
|
- lib/terraspace_plugin_aws/interfaces/decorator/base.rb
|
145
151
|
- lib/terraspace_plugin_aws/interfaces/expander.rb
|
146
152
|
- lib/terraspace_plugin_aws/interfaces/layer.rb
|
153
|
+
- lib/terraspace_plugin_aws/interfaces/summary.rb
|
147
154
|
- lib/terraspace_plugin_aws/version.rb
|
148
155
|
- terraspace_plugin_aws.gemspec
|
149
156
|
homepage: https://github.com/boltops-tools/terraspace_plugin_aws
|
@@ -1,9 +0,0 @@
|
|
1
|
-
terraform {
|
2
|
-
backend "s3" {
|
3
|
-
bucket = "<%%= backend_expand("s3", "terraform-state-:ACCOUNT-:REGION-:ENV") %>" # expanded by terraspace IE: terraform-state-112233445566-us-west-2-dev
|
4
|
-
key = "<%%= backend_expand("s3", ":REGION/:ENV/:BUILD_DIR/terraform.tfstate") %>" # expanded by terraspace IE: us-west-2/dev/modules/vm/terraform.tfstate
|
5
|
-
region = "<%%= backend_expand("s3", ":REGION") %>"
|
6
|
-
encrypt = true
|
7
|
-
dynamodb_table = "terraform_locks"
|
8
|
-
}
|
9
|
-
}
|