File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
javav2/example_code/s3/src/main/java/com/example/s3/lockscenario Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 1111
1212public class CreateObjectLockRole {
1313 public static void main (String [] args ) {
14- createLockRole ();
14+ final String usage = """
15+
16+ Usage: <roleName>
17+
18+ Where:
19+ roleName - the IAM role name.
20+ """ ;
21+
22+ if (args .length != 1 ) {
23+ System .out .println (usage );
24+ System .exit (1 );
25+ }
26+ String roleName = args [0 ];
27+ createLockRole (roleName );
1528 }
1629
1730 // snippet-start:[S3Lock.javav2.lock.role.main]
1831
1932 /**
2033 * Creates an IAM role for AWS S3 Batch Operations to manage object locks.
2134 */
22- public static void createLockRole () {
23- final String roleName = "batch_operations-object-lock1" ;
24-
35+ public static void createLockRole (String roleName ) {
2536 // Trust policy
2637 final String trustPolicy = """
2738 {
You can’t perform that action at this time.
0 commit comments