terraspace_plugin_azurerm 0.5.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/templates/hcl/project/config/terraform/backend.tf +4 -3
- data/lib/templates/ruby/project/config/terraform/backend.rb +4 -3
- data/lib/terraspace_plugin_azurerm/interfaces/backend/storage_account.rb +4 -4
- data/lib/terraspace_plugin_azurerm/interfaces/ci.rb +13 -0
- data/lib/terraspace_plugin_azurerm/interfaces/expander.rb +16 -0
- data/lib/terraspace_plugin_azurerm/version.rb +1 -1
- data/lib/terraspace_plugin_azurerm.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 194532966d4108be2a98fb6a0b7a9d04f2f2c84cad28ce2217a1aa48d274ba13
|
4
|
+
data.tar.gz: 6e3c693f26b7c85a9e411f9839ff80935e8d1a6d5c2af5cce37c1b33f9a2ce26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fda538935457a2cf506ffb95e4e3bed5328325349ca57c80f7affa69ac962d46cb4ebef7f73c80190863298b198a817a902763afd1c3b4d8cfda6dfdbd9fc4b4
|
7
|
+
data.tar.gz: 044da95d5619fa81c624f691c620e0aaafc3962565054ce86d5202cf4d637a7111cc43dbfeb1488db3250fafe5690f5d915405cdc92bb6406ef1c5a1dcfe8178
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,15 @@
|
|
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.6.1] - 2022-06-14
|
7
|
+
- [#17](https://github.com/boltops-tools/terraspace_plugin_azurerm/pull/17) backend.tf template project variable
|
8
|
+
|
9
|
+
## [0.6.0] - 2022-06-10
|
10
|
+
- [#16](https://github.com/boltops-tools/terraspace_plugin_azurerm/pull/16) update generated backend key and ci interface
|
11
|
+
|
12
|
+
## [0.5.1] - 2022-05-03
|
13
|
+
- [#15](https://github.com/boltops-tools/terraspace_plugin_azurerm/pull/15) pascalCase
|
14
|
+
|
6
15
|
## [0.5.0] - 2022-01-20
|
7
16
|
- [#14](https://github.com/boltops-tools/terraspace_plugin_azurerm/pull/14) use armrest gem
|
8
17
|
|
@@ -1,10 +1,11 @@
|
|
1
1
|
# SUBSCRIPTION_HASH is a short 4-char consistent hash of the longer subscription id.
|
2
|
+
# LOCATION_HASH is a short 4-char consistent hash of the longer location.
|
2
3
|
# This is useful because azure storage account names are not allowed special characters and are limited to 24 chars.
|
3
4
|
terraform {
|
4
5
|
backend "azurerm" {
|
5
|
-
resource_group_name = "<%= expansion(':ENV-:LOCATION') %>"
|
6
|
-
storage_account_name = "<%= expansion('ts:SUBSCRIPTION_HASH:
|
6
|
+
resource_group_name = "<%= expansion(':APP-:ENV-:LOCATION') %>"
|
7
|
+
storage_account_name = "<%= expansion('ts:APP_HASH:SUBSCRIPTION_HASH:LOCATION_HASH:ENV') %>"
|
7
8
|
container_name = "terraform-state"
|
8
|
-
key = "<%= expansion(':
|
9
|
+
key = "<%= expansion(':PROJECT/:TYPE_DIR/:APP/:ROLE/:MOD_NAME/:ENV/:EXTRA/:LOCATION/terraform.tfstate') %>"
|
9
10
|
}
|
10
11
|
}
|
@@ -1,8 +1,9 @@
|
|
1
1
|
# SUBSCRIPTION_HASH is a short 4-char consistent hash of the longer subscription id.
|
2
|
+
# LOCATION_HASH is a short 4-char consistent hash of the longer location.
|
2
3
|
# This is useful because azure storage account names are not allowed special characters and are limited to 24 chars.
|
3
4
|
backend("azurerm",
|
4
|
-
resource_group_name: "
|
5
|
-
storage_account_name: "ts:SUBSCRIPTION_HASH:
|
5
|
+
resource_group_name: ":APP-:ENV-:LOCATION",
|
6
|
+
storage_account_name: "ts:APP_HASH:SUBSCRIPTION_HASH:LOCATION_HASH:ENV",
|
6
7
|
container_name: "terraform-state",
|
7
|
-
key: ":
|
8
|
+
key: ":PROJECT/:TYPE_DIR/:APP/:ROLE/:MOD_NAME/:ENV/:EXTRA/:LOCATION/terraform.tfstate",
|
8
9
|
)
|
@@ -43,7 +43,7 @@ class TerraspacePluginAzurerm::Interfaces::Backend
|
|
43
43
|
tier: config.storage_account.sku.tier,
|
44
44
|
},
|
45
45
|
properties: {
|
46
|
-
|
46
|
+
allowBlobPublicAccess: config.storage_account.allow_blob_public_access,
|
47
47
|
},
|
48
48
|
kind: "StorageV2",
|
49
49
|
tags: config.tags,
|
@@ -67,9 +67,9 @@ class TerraspacePluginAzurerm::Interfaces::Backend
|
|
67
67
|
}
|
68
68
|
# final props
|
69
69
|
{
|
70
|
-
|
71
|
-
|
72
|
-
|
70
|
+
containerDeleteRetentionPolicy: container_delete_retention_policy,
|
71
|
+
deleteRetentionPolicy: delete_retention_policy,
|
72
|
+
isVersioningEnabled: sa.is_versioning_enabled,
|
73
73
|
}
|
74
74
|
end
|
75
75
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module TerraspacePluginAzurerm::Interfaces
|
2
|
+
class Ci
|
3
|
+
# interface method
|
4
|
+
def vars
|
5
|
+
{
|
6
|
+
ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}',
|
7
|
+
ARM_CLIENT_SECRET: '${{ secrets.ARM_CLIENT_SECRET }}',
|
8
|
+
ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}',
|
9
|
+
ARM_CLIENT_ID: '${{ secrets.ARM_CLIENT_ID }}',
|
10
|
+
}
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -29,5 +29,21 @@ module TerraspacePluginAzurerm::Interfaces
|
|
29
29
|
Digest::SHA1.hexdigest(subscription)[0..3]
|
30
30
|
end
|
31
31
|
alias_method :namespace_hash, :subscription_hash
|
32
|
+
|
33
|
+
# location_hash is a short 4-char consistent hash of the longer subscription id.
|
34
|
+
# This is useful because azure storage account names are not allowed special characters and are limited to 24 chars.
|
35
|
+
# NOTE: be careful to not change this! or else state path will change
|
36
|
+
def location_hash
|
37
|
+
Digest::SHA1.hexdigest(location)[0..3]
|
38
|
+
end
|
39
|
+
alias_method :region_hash, :location_hash
|
40
|
+
|
41
|
+
def app_hash
|
42
|
+
Digest::SHA1.hexdigest(ENV['TS_APP'])[0..3] if ENV['TS_APP']
|
43
|
+
end
|
44
|
+
|
45
|
+
def env_hash
|
46
|
+
Digest::SHA1.hexdigest(ENV['TS_ENV'])[0..3] if ENV['TS_ENV']
|
47
|
+
end
|
32
48
|
end
|
33
49
|
end
|
@@ -41,5 +41,6 @@ Terraspace::Plugin.register("azurerm",
|
|
41
41
|
config_class: TerraspacePluginAzurerm::Interfaces::Config,
|
42
42
|
helper_class: TerraspacePluginAzurerm::Interfaces::Helper,
|
43
43
|
layer_class: TerraspacePluginAzurerm::Interfaces::Layer,
|
44
|
+
ci_class: TerraspacePluginAzurerm::Interfaces::Ci,
|
44
45
|
root: File.dirname(__dir__),
|
45
46
|
)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terraspace_plugin_azurerm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: armrest
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- lib/terraspace_plugin_azurerm/interfaces/backend/blob_container.rb
|
119
119
|
- lib/terraspace_plugin_azurerm/interfaces/backend/resource_group_creator.rb
|
120
120
|
- lib/terraspace_plugin_azurerm/interfaces/backend/storage_account.rb
|
121
|
+
- lib/terraspace_plugin_azurerm/interfaces/ci.rb
|
121
122
|
- lib/terraspace_plugin_azurerm/interfaces/config.rb
|
122
123
|
- lib/terraspace_plugin_azurerm/interfaces/expander.rb
|
123
124
|
- lib/terraspace_plugin_azurerm/interfaces/helper.rb
|
@@ -148,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
149
|
- !ruby/object:Gem::Version
|
149
150
|
version: '0'
|
150
151
|
requirements: []
|
151
|
-
rubygems_version: 3.
|
152
|
+
rubygems_version: 3.3.12
|
152
153
|
signing_key:
|
153
154
|
specification_version: 4
|
154
155
|
summary: Terraspace Azurerm Cloud Plugin
|