aws / aws/aws-toolkit-azure-devops
IllegalLocationConstraintException when create S3 bucket
- Dominant language
- TypeScript
- Stars
- 258
- Forks
- 114
- PR merge metrics
- No merged PRs in 30d
Description
I am using task `S3Upload@1` in my yaml running in Azure DevOps.
When I set `createBucket` to `true` as below:
```
- task: S3Upload@1
inputs:
awsCredentials: testserviceconnection
regionName: us-east-1
bucketName: somethingtest
sourceFolder: cfntest
globExpressions: '**'
targetFolder: clientlambda
createBucket: true
```
I got an error as below:
```
message: 'The unspecified location constraint is incompatible for the region specific endpoint this request was sent to.',
code: 'IllegalLocationConstraintException',
region: null,
```
I think except `bucketName`, `LocationConstraint` should be set as well? Regarding the issue https://github.com/aws/aws-sdk-js/issues/475
Somehow the region is passed to the function, but it is not used anywhere.
https://github.com/aws/aws-toolkit-azure-devops/blob/6590be0558e2bd45cb4fb873be0f5616a7cac769/src/tasks/S3Upload/TaskOperations.ts#L63
Contributor guide
Research direction
Start at src/tasks/S3Upload/TaskOperations.ts around line 63 and trace how the region is passed into bucket creation. Confirm that createBucket handles the S3 location constraint for a regional endpoint such as us-east-1, then verify the S3Upload task no longer reports IllegalLocationConstraintException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100