GetArn

Parses an Amazon Resource Name (ARN) into its constituent parts.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var dbInstance = Output.Create(Aws.GetArn.InvokeAsync(new Aws.GetArnArgs
        {
            Arn = "arn:aws:rds:eu-west-1:123456789012:db:mysql-db",
        }));
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := aws.GetArn(ctx, &aws.GetArnArgs{
            Arn: "arn:aws:rds:eu-west-1:123456789012:db:mysql-db",
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

db_instance = aws.get_arn(arn="arn:aws:rds:eu-west-1:123456789012:db:mysql-db")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const dbInstance = pulumi.output(aws.getArn({
    arn: "arn:aws:rds:eu-west-1:123456789012:db:mysql-db",
}, { async: true }));

Using GetArn

function getArn(args: GetArnArgs, opts?: InvokeOptions): Promise<GetArnResult>
function  get_arn(arn=None, opts=None)
func GetArn(ctx *Context, args *GetArnArgs, opts ...InvokeOption) (*GetArnResult, error)
public static class GetArn {
    public static Task<GetArnResult> InvokeAsync(GetArnArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Arn string

The ARN to parse.

Arn string

The ARN to parse.

arn string

The ARN to parse.

arn str

The ARN to parse.

GetArn Result

The following output properties are available:

Account string

The ID of the AWS account that owns the resource, without the hyphens.

Arn string
Id string

The provider-assigned unique ID for this managed resource.

Partition string

The partition that the resource is in.

Region string

The region the resource resides in. Note that the ARNs for some resources do not require a region, so this component might be omitted.

Resource string

The content of this part of the ARN varies by service. It often includes an indicator of the type of resource—for example, an IAM user or Amazon RDS database —followed by a slash (/) or a colon (:), followed by the resource name itself.

Service string

The service namespace that identifies the AWS product.

Account string

The ID of the AWS account that owns the resource, without the hyphens.

Arn string
Id string

The provider-assigned unique ID for this managed resource.

Partition string

The partition that the resource is in.

Region string

The region the resource resides in. Note that the ARNs for some resources do not require a region, so this component might be omitted.

Resource string

The content of this part of the ARN varies by service. It often includes an indicator of the type of resource—for example, an IAM user or Amazon RDS database —followed by a slash (/) or a colon (:), followed by the resource name itself.

Service string

The service namespace that identifies the AWS product.

account string

The ID of the AWS account that owns the resource, without the hyphens.

arn string
id string

The provider-assigned unique ID for this managed resource.

partition string

The partition that the resource is in.

region string

The region the resource resides in. Note that the ARNs for some resources do not require a region, so this component might be omitted.

resource string

The content of this part of the ARN varies by service. It often includes an indicator of the type of resource—for example, an IAM user or Amazon RDS database —followed by a slash (/) or a colon (:), followed by the resource name itself.

service string

The service namespace that identifies the AWS product.

account str

The ID of the AWS account that owns the resource, without the hyphens.

arn str
id str

The provider-assigned unique ID for this managed resource.

partition str

The partition that the resource is in.

region str

The region the resource resides in. Note that the ARNs for some resources do not require a region, so this component might be omitted.

resource str

The content of this part of the ARN varies by service. It often includes an indicator of the type of resource—for example, an IAM user or Amazon RDS database —followed by a slash (/) or a colon (:), followed by the resource name itself.

service str

The service namespace that identifies the AWS product.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.