Skip to content

livetribe/livetribe-aws-arn-parser-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-arn-parser-java

Build Status Coverage Status

AWS ARN Parser

Supported ARNs

The AWS ARN parser currently supports:

  • apigateway ARNs
  • execute-api ARNs
  • iam ARNs

Usage

Parsing

import org.livetribe.aws.arn.ExecuteApiResourceArn;
import static org.livetribe.aws.arn.ArnParser.parseArn;

String token = "arn:aws:execute-api:us-east-1:123456789012:0df34wjxyd/*/GET/mydemoresource/*";
ExecuteApiResourceArn arn = (ExecuteApiResourceArn) parseArn(token);

Generating ARNs

import org.livetribe.aws.arn.Arn;
import org.livetribe.aws.arn.ExecuteApiResourceArn;
import static org.livetribe.aws.arn.HttpVerb.WILDCARD;

Arn arn = new ExecuteApiResourceArn("us-east-1", "123456789012", "0df34wjxyd",
                                    "test", WILDCARD, "/mydemoresource/*");

Converting the ARN to a String will provide a correctly formatted AWS ARN.

License

Apache License, Version 2.0