From a6ba396bb088b3c22190e66ec61d16654c3a680a Mon Sep 17 00:00:00 2001 From: Zack Chase Date: Mon, 30 Oct 2023 12:51:47 -0700 Subject: [PATCH] Add text to inform users about ESC on creds error (#2907) Part of https://github.com/pulumi/marketing/issues/816 This PR adds some text to current text emitted when a user hits a credentials to let them know about ESC and that they can configure their AWS creds with ESC. When I was testing this locally I noticed the error emitted twice (same with a warning about using the aws plugin from my path) so not sure if that is expected with local dev. Example output: promote-esc-on-error-aws --- provider/resources.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/provider/resources.go b/provider/resources.go index 7c895b2e17f..598ec14bcaf 100644 --- a/provider/resources.go +++ b/provider/resources.go @@ -617,7 +617,10 @@ func preConfigureCallback(vars resource.PropertyMap, c shim.ResourceConfig) erro if _, _, diag := awsbase.GetAwsConfig(context.Background(), config); diag != nil && diag.HasError() { return fmt.Errorf("unable to validate AWS credentials. \n"+ "Details: %s\n"+ - "Make sure you have set your AWS region, e.g. `pulumi config set aws:region us-west-2`. \n", formatDiags(diag)) + "Make sure you have set your AWS region, e.g. `pulumi config set aws:region us-west-2`. \n\n"+ + "NEW: You can use Pulumi ESC to set up dynamic credentials with AWS OIDC to ensure the "+ + "correct and valid credentials are used.\nLearn more: "+ + "https://www.pulumi.com/blog/esc-env-run-aws/", formatDiags(diag)) } return nil