Skip to content

Improve use of enum types for methods that require an aws.Region parameter #897

Open

Description

I am using an eks API that takes an aws.Region parameter, but aws.RegionResult.name doesn't have the right type
The API:

export declare function getRoleProvider(
            name: string,
            region?: aws.Region,
            profile?: string, 
            parent?: pulumi.ComponentResource
  ): CreationRoleProvider;

getRegion:

export declare function getRegion(
             args?: GetRegionArgs,
             opts?: pulumi.InvokeOptions
  ): Promise<GetRegionResult> & GetRegionResult;
export interface GetRegionResult {
    /**
     * The region's description in this format: "Location (Region name)".
     */
    readonly description: string;
    /**
     * The EC2 endpoint for the selected region.
     */
    readonly endpoint: string;
    /**
     * The name of the selected region.
     */
    readonly name: string;
    /**
     * id is the provider-assigned unique ID for this managed resource.
     */
    readonly id: string;
}

It would be great if GetRegionResult had an aws.Region field, so that I don't need to do an ugly cast when calling getRoleProvider

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    impact/usabilitySomething that impacts users' ability to use the product easily and intuitivelykind/enhancementImprovements or new featureslanguage/javascript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions