Checkboxes for prior research
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
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
Checkboxes for prior research
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
buildmethod in the ARN parser util package seems to not distinguish S3 resources from other resources when generating ARNs.Regression Issue
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
Observed Behavior
For S3 resources, the
buildmethod generates incorrect ARNs that include region and account ID.Expected Behavior
For S3 resources, the
buildmethod should generate ARNs that do not include region and account ID.Possible Solution
Omit region and account ID in if service is
s3in the relevant code.Additional Information/Context
No response