You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-6Lines changed: 40 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ This package implements an authentication plugin for the open-source Datastax Ja
8
8
9
9
The plugin depends on the AWS SDK for Java. It uses `AWSCredentialsProvider` to obtain credentials. Because the IAuthenticator interface operates at the level of `InetSocketAddress`, you must specify the service endpoint to use for the connection.
10
10
You can provide the Region in the constructor programmatically, via the `AWS_REGION` environment variable, or via the `aws.region` system property.
11
+
You can also provide an IAM role to assume for access to KeySpaces, programmatically or via the configuration file.
11
12
12
13
The full documentation for the plugin is available at
@@ -35,28 +36,40 @@ You can specify the Region using one of the following four methods:
35
36
* Constructor
36
37
* Configuration
37
38
38
-
## Environment Variable
39
+
###Environment Variable
39
40
40
41
You can use the `AWS_REGION` environment variable to match the endpoint that you are communicating with by setting it as part of your application start-up, as follows.
41
42
42
43
```shell
43
44
$ export AWS_Region=us-east-1
44
45
```
45
-
## System Property
46
+
###System Property
46
47
47
48
You can use the `aws.region` Java system property by specifying it on the command line, as follows.
48
49
49
50
```shell
50
51
$ java -Daws.region=us=east-1 ...
51
52
```
52
53
53
-
## Constructor
54
+
###Constructor
54
55
55
56
One of the constructors for `software.aws.mcs.auth.SigV4AuthProvider` takes a `String` representing the Region that will be used for that instance.
56
57
57
-
## Configuration
58
+
###Configuration
58
59
59
-
Set the Region explicitly in your `advanced.auth-provider.class` configuration (see example below), by specifying the `advanced.auth-provider.aws-region` property.
60
+
Set the Region explicitly in your `advanced.auth-provider` configuration (see example below), by specifying the `advanced.auth-provider.aws-region` property.
61
+
62
+
## Assume IAM Role Configuration
63
+
64
+
You can specify an IAM role to assume for access to KeySpaces using either the constructor or the driver configuration file
65
+
66
+
### Constructor
67
+
68
+
One of the constructors for `software.aws.mcs.auth.SigV4AuthProvider` takes two Strings , the first representing the region and the second representing the ARN of the IAM role to assume.
69
+
70
+
### Configuration
71
+
72
+
Set the IAM Role explicitly in your `advanced.auth-provider` configuration (see example below), by specifying the `advanced.auth-provider.aws-role-arn` property.
60
73
61
74
## Add the Authentication Plugin to the Application
62
75
@@ -119,7 +132,7 @@ To use the configuration file, set the `advanced.auth-provider.class` to `softwa
119
132
1. Set the `advanced.auth-provider.class` to `software.aws.mcs.auth.SigV4AuthProvider`.
120
133
1. Set `basic.load-balancing-policy.local-datacenter` to the region name. In this case, use `us-east-2`.
121
134
122
-
The following is an example of this.
135
+
The following is an example of this config without explicit role to be assumed.
123
136
124
137
```text
125
138
datastax-java-driver {
@@ -138,3 +151,24 @@ The following is an example of this.
138
151
}
139
152
}
140
153
```
154
+
155
+
The following is an example of this config with an explicit role to be assumed.
0 commit comments