-
Notifications
You must be signed in to change notification settings - Fork 159
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
Improve error messages around AWS config #3310
Merged
Merged
Changes from 19 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
83d1474
improve error messages around AWS config
VenelinMartinov 9881bd5
add tests, message for invalid creds
VenelinMartinov f3dde28
use the pre-release bridge
VenelinMartinov 366c7f1
move error messages to separate text files
VenelinMartinov a67788d
fix tests
VenelinMartinov 5f4ed15
add expired sso error
VenelinMartinov 1f87b21
link in providertest with more logging
VenelinMartinov 5e454ec
Revert "link in providertest with more logging"
VenelinMartinov f9d0e9d
dont skip aws cred validation
VenelinMartinov 4857a86
try to run validation again
VenelinMartinov 2b10680
skip credentials tests in short mode
VenelinMartinov 0ec092c
tfgen and build_sdks
VenelinMartinov c99f4c3
schema
VenelinMartinov a2673af
schema?
VenelinMartinov 9adbe12
more schema
VenelinMartinov 4a7a7b3
cleaned plugins, regenerate schema and sdks
VenelinMartinov 806bc3d
unset the aws creds before running the tests
VenelinMartinov 7a82647
merge master
VenelinMartinov 50bcc1a
reset credential validation flag before tests
VenelinMartinov c249e19
fix test for duplicate errors
VenelinMartinov 9d8a964
remove unused test main
VenelinMartinov 039c10b
use prerelease pf
VenelinMartinov 847eaf6
go mod tidy
VenelinMartinov c946c9a
add some *s
VenelinMartinov 376f960
make the validation run flag local
VenelinMartinov f4f5bb8
Merge branch 'master' into vvm/improve_beginner_error_messages
VenelinMartinov 90f9a4c
don't match response inputs
VenelinMartinov 3e4f0db
fix tests
VenelinMartinov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,5 @@ sdk/python/*.egg-info | |
|
||
|
||
sdk/python/venv | ||
go.work | ||
go.work.sum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Failed to refresh cached SSO credentials. | ||
Please refresh SSO login. | ||
NEW: You can use Pulumi ESC to set up dynamic credentials with AWS OIDC to ensure the correct and valid credentials are used. | ||
Learn more: https://www.pulumi.com/registry/packages/aws/installation-configuration/#dynamically-generate-credentials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Invalid credentials configured. | ||
Please see https://www.pulumi.com/registry/packages/aws/installation-configuration/ for more information about providing credentials. | ||
NEW: You can use Pulumi ESC to set up dynamic credentials with AWS OIDC to ensure the correct and valid credentials are used. | ||
Learn more: https://www.pulumi.com/registry/packages/aws/installation-configuration/#dynamically-generate-credentials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
No valid credential sources found. | ||
Please see https://www.pulumi.com/registry/packages/aws/installation-configuration/ for more information about providing credentials. | ||
NEW: You can use Pulumi ESC to set up dynamic credentials with AWS OIDC to ensure the correct and valid credentials are used. | ||
Learn more: https://www.pulumi.com/registry/packages/aws/installation-configuration/#dynamically-generate-credentials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Missing region information | ||
Make sure you have set your AWS region, e.g. `pulumi config set aws:region us-west-2`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 behaviour is unfortunate and not very obvious. It took me a while to realise that the flag was the reason only the first test in a test run would succeed.
LMK if anyone has a better idea how to fix this - the issue is that the credential validation code is run only once because of
pulumi-aws/provider/resources.go
Line 752 in 50bcc1a
This is normally the behaviour we want, except that during tests we run the same "provider" binary multiple times and the flag needs to be reset between runs.
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.
The easiest way to do it would be to make
preConfigureCallback
a factory that takes a reference toatomic.Bool
and returnsfunc(vars resource.PropertyMap, config shim.ResourceConfig) error
. Then you could putcredentialsValidationRun
inside of theProvider()
function.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.
That would require a third interface for
preConfigureCallback
. If we are doing that why not implement apreConfigureOnce
and then have the logic in the bridge around making sure we only call it once?Not sure if it's worth doing for the sake of the tests.
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.
Yeah this is fine-ish this is what we have to do to test global state. To get rid of global state we'd need to move this to a parameter of provider somehow so tests can set something else in there
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.
No it wouldn't. I'm not suggesting making
tfbridge.ProviderInfo.PreConfigureCallback
a factory. I'm suggesting that we make the localpreConfigureCallback
a factory to capture a reference to aatomic.Bool
onProvider()
's stack: