Package software.amazon.awssdk.arns
Class Arn
java.lang.Object
software.amazon.awssdk.arns.Arn
- All Implemented Interfaces:
ToCopyableBuilder<Arn.Builder,
Arn>
The Arns generated and recognized by this code are the Arns described here:
https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
The primary supported Arn format is:
arn:<partition>:<service>:<region>:<account>:<resource>
resourceAsString()
returns everything after the account section of the Arn
as a single string.
However, the following Arn formats are supported where the values are present and well
formatted through resource()
:
arn:<partition>:<service>:<region>:<account>:<resourcetype>/resource arn:<partition>:<service>:<region>:<account>:<resourcetype>/resource/qualifier arn:<partition>:<service>:<region>:<account>:<resourcetype>/resource:qualifier arn:<partition>:<service>:<region>:<account>:<resourcetype>:resource arn:<partition>:<service>:<region>:<account>:<resourcetype>:resource:qualifier
resource()
returns a ArnResource
which has access
to ArnResource.resourceType()
, ArnResource.resource()
and
ArnResource.qualifier()
.
To parse an Arn from a string use Arn.fromString(). To convert an Arn to it's string representation use Arn.toString().
For instance, for a string s, containing a well-formed Arn the following should always be true:
Arn theArn = Arn.fromString(s); s.equals(theArn.toString());
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Arn.Builder
builder()
boolean
static Arn
fromString
(String arn) Parses a given string into anArn
.int
hashCode()
region()
resource()
service()
Take this object and create a builder that contains all of the current property values of this object.toString()
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
partition
- Returns:
- The partition that the resource is in.
-
service
- Returns:
- The service namespace that identifies the AWS product (for example, Amazon S3, IAM, or Amazon RDS).
-
region
- Returns:
- The Region that the resource resides in.
-
accountId
- Returns:
- The ID of the AWS account that owns the resource, without the hyphens.
-
resource
- Returns:
ArnResource
-
resourceAsString
- Returns:
- the resource as string
-
builder
- Returns:
- a builder for
Arn
.
-
fromString
Parses a given string into anArn
. The resource is accessible entirely as a string throughresourceAsString()
. Where correctly formatted, a parsed resource containing resource type, resource and qualifier is available throughresource()
.- Parameters:
arn
- - A string containing an Arn.- Returns:
Arn
- A modeled Arn.
-
toString
-
equals
-
hashCode
public int hashCode() -
toBuilder
Description copied from interface:ToCopyableBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToCopyableBuilder<Arn.Builder,
Arn> - Returns:
- a builder for type T
-