diff --git a/src/WithAwsPlugin.groovy b/src/WithAwsPlugin.groovy index 476a3452..00fccc1a 100644 --- a/src/WithAwsPlugin.groovy +++ b/src/WithAwsPlugin.groovy @@ -20,7 +20,7 @@ class WithAwsPlugin implements TerraformEnvironmentStagePlugin, Resettable { public Closure addWithAwsRole(String environment) { return { closure -> String iamRole = getRole(environment) - Integer sessionDuration = this.duration + Integer sessionDuration = getDuration() if (iamRole != null) { withAWS(role: iamRole, duration: sessionDuration) { @@ -59,6 +59,10 @@ class WithAwsPlugin implements TerraformEnvironmentStagePlugin, Resettable { return tempRole } + public Integer getDuration() { + return this.@duration + } + public static void reset() { this.role = null this.duration = 3600