tfctl 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a629291d80ced92fb46ec555c3eb0023b5b28defd031e457719f76a30bf9127
4
- data.tar.gz: 2be23cc36e785f7fdae92c3717a7808b070549737682ecc26b02779b9cdc6489
3
+ metadata.gz: 7862426153b20908c7f418711505fc0192a1ea61f5edcc5ac1aa71d69190a8a6
4
+ data.tar.gz: c2d6272043b02a506316143a4ad9f9f61c811609092a2642e64fb3dcfaf09472
5
5
  SHA512:
6
- metadata.gz: 1a032960fc4809364bbe28cb85210713bc777b22d18c0041748c300c1e0a25fd01b4eb06bc242bfb880af10f3215c0776916ff32d80a40244d850eedaf514708
7
- data.tar.gz: fb9337a42296df0fc17afe77f75cdb5a94c0d1569f94094d8b39d54e1e1b3beab1ba50976cafdebe90cacec5daac8e492ff610be2dd2f206ecbe0bb39f396e3c
6
+ metadata.gz: b35eb69b4a65c422e025dc02761c52947824b656d7bdd12eafe88ca214b1e11ca68b27b27edf7b0fb73002a4cdfe80e6c714b46c2957b9548ac26feb910040a5
7
+ data.tar.gz: 57ea113b1384c4b6ea77af357eb647fbf1362d06bb438b111dca1037479a66d3c9b5d294f1e375fae8e4fe9d53c6df3d093d6d2df40683b86bc21a795ed13a3d
data/CHANGELOG.adoc CHANGED
@@ -1,5 +1,23 @@
1
1
  = Changelog
2
2
 
3
+ == 1.6.0
4
+
5
+ * fix: pass the default AWS provider explicitly from tfctl generated configuration.
6
+ This fixes provider inheritance issues when using multiple providers which
7
+ was introduced in 1.3.0. You may need to add a terraform block with
8
+ `required_provides` to your profiles if you don't have it defined already.
9
+ Terraform will warn about this during `init`. Here's an example block:
10
+
11
+ ----
12
+ terraform {
13
+ required_providers {
14
+ aws = {
15
+ source = "hashicorp/aws"
16
+ }
17
+ }
18
+ }
19
+ ----
20
+
3
21
  == 1.5.0
4
22
 
5
23
  * feat: support for setting default tags at AWS provider level. (Thanks @patrickli)
@@ -2,3 +2,7 @@ resource aws_s3_bucket bucket {
2
2
  bucket = var.name
3
3
  acl = "private"
4
4
  }
5
+
6
+ output "arn" {
7
+ value = aws_s3_bucket.bucket.arn
8
+ }
@@ -1,4 +1,11 @@
1
+ resource "random_pet" "bucket_prefix" {
2
+ }
3
+
1
4
  module "bucket" {
2
5
  source = "../../modules/s3-bucket"
3
- name = "${local.account_id}-${local.account["data"]["example_bucket_name"]}"
6
+ name = "${random_pet.bucket_prefix.id}-${local.account["data"]["example_bucket_name"]}"
7
+ }
8
+
9
+ output "bucket_arn" {
10
+ value = module.bucket.arn
4
11
  }
@@ -0,0 +1,7 @@
1
+ terraform {
2
+ required_providers {
3
+ aws = {
4
+ source = "hashicorp/aws"
5
+ }
6
+ }
7
+ }
@@ -6,7 +6,7 @@ variable "config" {
6
6
 
7
7
  locals {
8
8
  config = jsondecode(var.config)
9
- account_id = "${data.aws_caller_identity.current.account_id}"
9
+ account_id = data.aws_caller_identity.current.account_id
10
10
  # get account configuration from tfctl config
11
- account = [ for account in local.config["accounts"]: account if account["id"] == local.account_id ][0]
11
+ account = [for account in local.config["accounts"] : account if account["id"] == local.account_id][0]
12
12
  }
@@ -80,8 +80,11 @@ module Tfctl
80
80
  profile_block = {
81
81
  'module' => {
82
82
  profile => {
83
- 'source' => "../../../profiles/#{profile}",
84
- 'config' => '${var.config}',
83
+ 'source' => "../../../profiles/#{profile}",
84
+ 'config' => '${var.config}',
85
+ 'providers' => {
86
+ 'aws' => 'aws',
87
+ },
85
88
  },
86
89
  },
87
90
  }
data/lib/tfctl/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tfctl
4
- VERSION = '1.5.0'
4
+ VERSION = '1.6.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tfctl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Wasilczuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-30 00:00:00.000000000 Z
11
+ date: 2021-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-organizations
@@ -164,6 +164,7 @@ files:
164
164
  - examples/control_tower/modules/s3-bucket/variables.tf
165
165
  - examples/control_tower/profiles/example-profile/data.tf
166
166
  - examples/control_tower/profiles/example-profile/main.tf
167
+ - examples/control_tower/profiles/example-profile/terraform.tf
167
168
  - examples/control_tower/profiles/example-profile/variables.tf
168
169
  - examples/control_tower/tfctl.yaml
169
170
  - lib/hash.rb