Skip to content

Commit

Permalink
Merge pull request #121 from anuruddhal/2201.4.x
Browse files Browse the repository at this point in the history
Add support for IAM role
  • Loading branch information
anuruddhal authored Jan 29, 2025
2 parents 7d5cb95 + 86fd3a3 commit dd1aa7a
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 107 deletions.
2 changes: 1 addition & 1 deletion s3/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ modules = [
[[package]]
org = "ballerinax"
name = "aws.s3"
version = "3.3.0"
version = "3.4.0"
dependencies = [
{org = "ballerina", name = "crypto"},
{org = "ballerina", name = "http"},
Expand Down
10 changes: 9 additions & 1 deletion s3/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ s3:ConnectionConfig amazonS3Config = {
s3:Client amazonS3Client = check new(amazonS3Config);
```

IAM role-based authentication can be used as below if the code is running within an EC2 instance.
```ballerina
s3:ConnectionConfig amazonS3Config = {
authType: s3:EC2_IAM_ROLE,
region: <REGION>
} ;
```

### Step 3: Invoke connector operation
1. Now you can use the operations available within the connector. Note that they are in the form of remote operations.
Following is an example on how to create a bucket using the connector.
Expand All @@ -42,4 +50,4 @@ Following is an example on how to create a bucket using the connector.
```
2. Use `bal run` command to compile and run the Ballerina program.

**[You can find a list of samples here](https://github.com/ballerina-platform/module-ballerinax-aws.s3/tree/master/samples)**
**[You can find a list of samples here](https://github.com/ballerina-platform/module-ballerinax-aws.s3/tree/master/examples)**
Loading

0 comments on commit dd1aa7a

Please sign in to comment.