Table of Contents

Class Arn

Namespace
Amazon
Assembly
AWSSDK.Core.dll

Utility class to parse Amazon resource names more commonly known as an ARN.

public class Arn
Inheritance
Arn
Inherited Members

Constructors

Arn()

public Arn()

Properties

AccountId

Gets and sets the account ID associated with the ARN.

public string AccountId { get; set; }

Property Value

string

Partition

Gets and sets the partition associated with the ARN (e.g.: 'aws').

public string Partition { get; set; }

Property Value

string

Region

Gets and sets the region associated with the ARN (e.g.: 'us-east-1').

public string Region { get; set; }

Property Value

string

Resource

Gets and sets the resource associated with the ARN (e.g.: 'mybucket/myobject').

public string Resource { get; set; }

Property Value

string

Service

Gets and sets the AWS service associated with the ARN (e.g.: 's3').

public string Service { get; set; }

Property Value

string

Methods

Equals(object)

public override bool Equals(object o)

Parameters

o object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

IsArn(string)

Returns true if the string appears to be an ARN by seeing if the string starts with "arn:". This method doesn't guarantee the string is a valid ARN. To validate the string call TryParse.

public static bool IsArn(string arn)

Parameters

arn string

Returns

bool

Parse(string)

Parses the string into an ARN object.

public static Arn Parse(string arnString)

Parameters

arnString string

String to parse into an Arn.

Returns

Arn

The Arn object created from the passed in string.

Exceptions

ArgumentNullException

Thrown if arnString is null.

ArgumentException

Thrown if the string passed in not valid ARN.

ToString()

Turns the Arn object into a string representation of an ARN.

public override string ToString()

Returns

string

TryParse(string, out Arn)

Parses the string into an ARN object.

public static bool TryParse(string arnString, out Arn arn)

Parameters

arnString string

String to parse into an ARN.

arn Arn

The out parameter for the ARN object created by TryParse.

Returns

bool

True if the string was parsed into an ARN object.