pulumi / pulumi-aws-native

AWS Native Provider for Pulumi
Apache License 2.0
95 stars 17 forks source link

Provide does not use the region defined in AWS profile #1646

Open mikhailshilkov opened 3 months ago

mikhailshilkov commented 3 months ago

What happened?

We expect AWS region to be defined in the stack config, or in AWS_REGION or AWS_DEFAULT_REGION environment variables. If none is defined, we throw an error: https://github.com/pulumi/pulumi-aws-native/blob/b962c3b2c972f570ab96c9003748f124178615f6/provider/pkg/provider/provider.go#L288-L296

However, it's possible to define a region in user's AWS profile. The AWS Classic provider respects that configuration, and AWS Native should do the same. Unfortunately, the profile check happens later in the code: https://github.com/pulumi/pulumi-aws-native/blob/b962c3b2c972f570ab96c9003748f124178615f6/provider/pkg/provider/provider.go#L298

Example

[MyAwsProfile]
region = eu-central-1
... other AWS profile configuration

Output of pulumi about

CLI          
Version      3.126.0
Go Version   go1.22.4
Go Compiler  gc

Plugins
KIND      NAME        VERSION
resource  aws         6.25.0
resource  aws-native  0.81.0
language  nodejs      unknown
resource  random      4.16.0

Host     
OS       darwin
Version  14.5
Arch     arm64

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

corymhall commented 3 months ago

@mikhailshilkov do you know what the priority of this one is? Is it something we should fix this iteration or next?

mikhailshilkov commented 3 months ago

@corymhall It'd be nice to fix, but I don't have any strong timeline signal.