-
Notifications
You must be signed in to change notification settings - Fork 652
Open
Labels
bugThis issue is a bug.This issue is a bug.closing-soonThis issue will automatically close in 4 days unless further comments are made.This issue will automatically close in 4 days unless further comments are made.p2This is a standard priority issueThis is a standard priority issuequeuedThis issues is on the AWS team's backlogThis issues is on the AWS team's backlogresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
It seems that S3 resource ARNs are formatted differently from those of most other AWS resources, as account ID and region are omitted in S3 resource ARNs.
However, the current build method in the ARN parser util package seems to not distinguish S3 resources from other resources when generating ARNs.
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
@aws-sdk/util-arn-parser@3.723.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v18.20.2
Reproduction Steps
import { build, parse } from "@aws-sdk/util-arn-parser";
function generateArn() {
return build({
partition: "aws",
accountId: "123456789012",
region: "us-east-1",
service: "s3",
resource: "a-bucket",
});
}
console.log(generateArn()); // arn:aws:s3:us-east-1:123456789012:a-bucket - I believe this is incorrect as the region and account ID should be omitted, like arn:aws:s3:::a-bucket .
Observed Behavior
For S3 resources, the build method generates incorrect ARNs that include region and account ID.
Expected Behavior
For S3 resources, the build method should generate ARNs that do not include region and account ID.
Possible Solution
Omit region and account ID in if service is s3 in the relevant code.
Additional Information/Context
No response
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.closing-soonThis issue will automatically close in 4 days unless further comments are made.This issue will automatically close in 4 days unless further comments are made.p2This is a standard priority issueThis is a standard priority issuequeuedThis issues is on the AWS team's backlogThis issues is on the AWS team's backlogresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.