-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: ec2-fleet-plugin
-
None
-
Environment:**Plugin Version?**
Version4.2.1.515.v100267825939](https://plugins.jenkins.io/ec2-fleet)
**Jenkins Version?**
2.516.3
**Spot Fleet or ASG?**
ASG
**Label based fleet?**
Yes
**Linux or Windows?**
Both Linux and Windows fleets, Jenkins environment is Linux based
-
- Issue Details
*Describe the bug*
On the init/constructor of the class, they just call the client builder
but once running
Â
it does this
Â
Â
  public static AwsCredentialsProvider toSdkV2CredentialsProvider(AmazonWebServicesCredentials credentials)
Â
that then resolves the role correctly
Â
so that explains why ti's working 'post deploy' but not on init
Â
and i confirmed all they do on init isÂ
DescribeAutoScalingGroupsResponse result = client.describeAutoScalingGroups
Â
*To Reproduce*
1. Deploy a jenkins environment using JCasC configuration with 1 or more clouds using the awsCredentialsId parameter
2. Environment will fail to startup
3. Grant the jenkins task the autoscaling:DescribeAutoScalingGroups permission and restart the jenkins environment and it will start successfully
-
- Logs **
software.amazon.awssdk.services.autoscaling.model.AutoScalingException: User: (obscured) is not authorized to perform: autoscaling:DescribeAutoScalingGroups because no identity-based policy allows the autoscaling:DescribeAutoScalingGroups action (Service: AutoScaling, Status Code: 403, Request ID: (obscured)) (SDK Attempt Count: 1)
- Logs **
*EC2Fleet Configuration as Code*
``
clouds:
 - eC2Fleet:
   addNodeOnlyIfRunning: false
   alwaysReconnect: true
   awsCredentialsId: (obscured)
   cloudStatusIntervalSec: 10
   computerConnector:
    sSHConnector:
     credentialsId: (obscured)
     launchTimeoutSeconds: 600
     maxNumRetries: 40
     port: 22
     retryWaitTime: 15
     sshHostKeyVerificationStrategy: "nonVerifyingKeyVerificationStrategy"
   disableTaskResubmit: false
   executorScaler:
    nodeHardwareScaler:
     memoryGiBPerExecutor: 2
     vCpuPerExecutor: 1
   fleet: (obscured)
   idleMinutes: 60
   initOnlineCheckIntervalSec: 15
   initOnlineTimeoutSec: 600
   labelString: (obscured)
   maxSize: 10
   maxTotalUses: -1
   minSize: 0
   minSpareSize: 0
   name: (obscured)
   noDelayProvision: true
   numExecutors: 1
   privateIpUsed: true
   region: "us-east-2"
   restrictUsage: true
   scaleExecutorsByWeight: false
``
*Anything else unique about your setup?*
No