-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[breaking] make aws provider optional #247
Conversation
This change makes it optional to specify an aws provider. Only planning on supporting this for config v2 but it might work in v1 for some cases. The only breaking change is that we now require an aws account id for the global component, where before we would silently ignore the fact that it was missing.
Codecov Report
@@ Coverage Diff @@
## master #247 +/- ##
==========================================
+ Coverage 79.07% 79.12% +0.04%
==========================================
Files 15 16 +1
Lines 1214 1236 +22
==========================================
+ Hits 960 978 +18
- Misses 147 150 +3
- Partials 107 108 +1
Continue to review full report at Codecov.
|
@@ -218,9 +219,9 @@ func TestCreateFileNonExistentDirectory(t *testing.T) { | |||
} | |||
|
|||
func TestApplySmokeTest(t *testing.T) { | |||
a := assert.New(t) | |||
r := require.New(t) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
require fails fast, while assert keeps going
@@ -231,6 +232,7 @@ func TestApplySmokeTest(t *testing.T) { | |||
"aws_profile_provider": "prof", | |||
"aws_profile_backend": "prof", | |||
"aws_provider_version": "0.12.0", | |||
"account_id": 789, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You now need to specify an account_id for global
@@ -0,0 +1,188 @@ | |||
package v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is mostly just moved code from v2/validations.go
|
||
// ResolveAWSProvider will return an AWSProvder iff one of the required fields is set somewhere in the set of Common | ||
// config objects passed in. Otherwise it will return nil. | ||
func ResolveAWSProvider(commons ...Common) *AWSProvider { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is new tho
@@ -10,14 +10,14 @@ | |||
} | |||
|
|||
# Aliased Providers (for doing things in every region). | |||
{{ $out := . }} | |||
{{ $outter := . }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trying to make it clearer that we are capturing the outer scope
../../../terraform.d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was a bug, fixed now. unfortunately our tests don't catch this because we don't do any assertions on links
[breaking] make aws provider optional### Summary This change makes it optional to specify an aws provider. Only planning on supporting this for config v2 but it might accidentally work in v1. The only breaking change is that we now require an aws account id for the global component, where before we would silently ignore the fact that it was missing. I consider this a bug / oversight so fixing it here. ### Test Plan This diff adds a number of tests, especially golden file tests. None of the existing golden files had to be changed. ### References *
Summary
This change makes it optional to specify an aws provider. Only planning on supporting this for config
v2 but it might accidentally work in v1.
The only breaking change is that we now require an aws account id for the global component, where before we would silently ignore the fact that it was missing. I consider this a bug / oversight so fixing it here.
Test Plan
This diff adds a number of tests, especially golden file tests. None of the existing golden files had to be changed.
References