1. Packages
  2. Packages
  3. AWS
  4. API Docs
  5. trimIamRolePath
Viewing docs for AWS v7.38.0
published on Tuesday, Jul 21, 2026 by Pulumi
aws logo
Viewing docs for AWS v7.38.0
published on Tuesday, Jul 21, 2026 by Pulumi

    Trims the path prefix from an IAM role Amazon Resource Name (ARN). This function can be used when services require role ARNs to be passed without a path.

    See the AWS IAM documentation for additional information on IAM role ARNs.

    Signature

    trim_iam_role_path(arn string) string
    

    Using trimIamRolePath

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function trimIamRolePath(args: TrimIamRolePathArgs, opts?: InvokeOptions): Promise<TrimIamRolePathResult>
    function trimIamRolePathOutput(args: TrimIamRolePathOutputArgs, opts?: InvokeOptions): Output<TrimIamRolePathResult>
    def trim_iam_role_path(arn: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> TrimIamRolePathResult
    def trim_iam_role_path_output(arn: pulumi.Input[Optional[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[TrimIamRolePathResult]
    func TrimIamRolePath(ctx *Context, args *TrimIamRolePathArgs, opts ...InvokeOption) (*TrimIamRolePathResult, error)
    func TrimIamRolePathOutput(ctx *Context, args *TrimIamRolePathOutputArgs, opts ...InvokeOption) TrimIamRolePathResultOutput

    > Note: This function is named TrimIamRolePath in the Go SDK.

    public static class TrimIamRolePath 
    {
        public static Task<TrimIamRolePathResult> InvokeAsync(TrimIamRolePathArgs args, InvokeOptions? opts = null)
        public static Output<TrimIamRolePathResult> Invoke(TrimIamRolePathInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<TrimIamRolePathResult> trimIamRolePath(TrimIamRolePathArgs args, InvokeOptions options)
    public static Output<TrimIamRolePathResult> trimIamRolePath(TrimIamRolePathArgs args, InvokeOptions options)
    
    fn::invoke:
      function: aws:index/trimIamRolePath:trimIamRolePath
      arguments:
        # arguments dictionary
    data "aws_trim_iam_role_path" "name" {
        # arguments
    }

    The following arguments are supported:

    Arn string
    IAM role Amazon Resource Name (ARN)
    Arn string
    IAM role Amazon Resource Name (ARN)
    arn string
    IAM role Amazon Resource Name (ARN)
    arn String
    IAM role Amazon Resource Name (ARN)
    arn string
    IAM role Amazon Resource Name (ARN)
    arn str
    IAM role Amazon Resource Name (ARN)
    arn String
    IAM role Amazon Resource Name (ARN)

    trimIamRolePath Result

    The following output properties are available:

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    Viewing docs for AWS v7.38.0
    published on Tuesday, Jul 21, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial