Also another question - can I get a region from an...
# general
i
Also another question - can I get a region from an aws provider? Or maybe I can create an AWS client from an aws provider, so that I’ll use the AWS SDK with the corresponding configuration
h
i did this:
Copy code
def get_region(resource):
    """
    Gets the AWS region for a given resource.
    """
    provider = resource.get_provider('aws::')
    config = pulumi.Config("aws").get('region')
    if provider and provider.region:
        return provider.region
    # These are stolen out of pulumi-aws
    elif config:
        return config
    elif 'AWS_REGION' in os.environ:
        return os.environ['AWS_REGION']
    elif 'AWS_DEFAULT_REGION' in os.environ:
        return os.environ['AWS_DEFAULT_REGION']
    else:
        raise NoRegionError("Unable to determine AWS Region")
i
@high-translator-22614 Thanks! Would still like to have something more streamlined, like
aws.Provider::getAwsConfig()
or alike