We have written inspec control using aws-sdk and ruby to validate the S3 bucket. We are running the inspec against us-east-1 region.
But getting Control source code error - 503 service not available.
Tried running the same code manually after the s3 bucket is provisioned, but its not working out in pipeline.
1) Control Source Code Error /apps/cloudbees-je/cloudbees-data/workspace/xxxxx/security-compliance-profile/controls/s3-controls.rb:37
Failure/Error: its(location) { fail e.message } # rubocop: disable Style/SignalException
RuntimeError:
503 "Service Unavailable"
# /usr/local/ruby_2.5.1/lib/ruby/gems/2.5.0/gems/inspec-2.1.72/lib/inspec/rule.rb:62:in `block (2 levels) in initialize'
# /usr/local/ruby_2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.8.0/lib/rspec/core/example.rb:254:in `instance_exec'
Any help would be appreciated in knowing the cause regarding error - 503
The issue was the region against inspec running was not getting populated properly in Jenkins - groovy script.