@@ -36,6 +36,17 @@ func main() {
3636 Usage : "aws secret key" ,
3737 EnvVar : "PLUGIN_SECRET_KEY,AWS_SECRET_ACCESS_KEY" ,
3838 },
39+ cli.StringFlag {
40+ Name : "assume-role" ,
41+ Usage : "aws iam role to assume" ,
42+ EnvVar : "PLUGIN_ASSUME_ROLE,ASSUME_ROLE" ,
43+ },
44+ cli.StringFlag {
45+ Name : "assume-role-session-name" ,
46+ Usage : "aws iam role session name to assume" ,
47+ Value : "drone-s3" ,
48+ EnvVar : "PLUGIN_ASSUME_ROLE_SESSION_NAME,ASSUME_ROLE_SESSION_NAME" ,
49+ },
3950 cli.StringFlag {
4051 Name : "bucket" ,
4152 Usage : "aws bucket" ,
@@ -129,23 +140,25 @@ func run(c *cli.Context) error {
129140 }
130141
131142 plugin := Plugin {
132- Endpoint : c .String ("endpoint" ),
133- Key : c .String ("access-key" ),
134- Secret : c .String ("secret-key" ),
135- Bucket : c .String ("bucket" ),
136- Region : c .String ("region" ),
137- Access : c .String ("acl" ),
138- Source : c .String ("source" ),
139- Target : c .String ("target" ),
140- StripPrefix : c .String ("strip-prefix" ),
141- Exclude : c .StringSlice ("exclude" ),
142- Encryption : c .String ("encryption" ),
143- ContentType : c .Generic ("content-type" ).(* StringMapFlag ).Get (),
144- ContentEncoding : c .Generic ("content-encoding" ).(* StringMapFlag ).Get (),
145- CacheControl : c .Generic ("cache-control" ).(* StringMapFlag ).Get (),
146- StorageClass : c .String ("storage-class" ),
147- PathStyle : c .Bool ("path-style" ),
148- DryRun : c .Bool ("dry-run" ),
143+ Endpoint : c .String ("endpoint" ),
144+ Key : c .String ("access-key" ),
145+ Secret : c .String ("secret-key" ),
146+ AssumeRole : c .String ("assume-role" ),
147+ AssumeRoleSessionName : c .String ("assume-role-session-name" ),
148+ Bucket : c .String ("bucket" ),
149+ Region : c .String ("region" ),
150+ Access : c .String ("acl" ),
151+ Source : c .String ("source" ),
152+ Target : c .String ("target" ),
153+ StripPrefix : c .String ("strip-prefix" ),
154+ Exclude : c .StringSlice ("exclude" ),
155+ Encryption : c .String ("encryption" ),
156+ ContentType : c .Generic ("content-type" ).(* StringMapFlag ).Get (),
157+ ContentEncoding : c .Generic ("content-encoding" ).(* StringMapFlag ).Get (),
158+ CacheControl : c .Generic ("cache-control" ).(* StringMapFlag ).Get (),
159+ StorageClass : c .String ("storage-class" ),
160+ PathStyle : c .Bool ("path-style" ),
161+ DryRun : c .Bool ("dry-run" ),
149162 }
150163
151164 return plugin .Exec ()
0 commit comments