samedi 26 septembre 2015

Teamcity Powershell step fails with AWS

I'm attempting to run a 'simple' clean up powershell script against an S3 bucket. However the step keeps on failing with exit code '1'.

The script has no error message or stack displayed before exiting.

Background:

  • The teamcity agent is running on an EC2 instance which has an assumed IAM role
  • The script within teamcity is utilising the IAM Role via the instance
  • The script runs correctly without errors when run manually on the EC2 Instance that is the build agent, it also assumes the IAM role from the instance.
  • Teamcity 8.1.2
  • Try/Catch around the offending commands (in this case Remove-S3Object) does nothing to prevent the exit of the script.
  • Other S3 related commands elsewhere in the script work correctly (in this case Get-S3Object)
  • The IAM role has a policy that allows it full access ("s3:*") to the s3 bucket.
  • Running Powershell 3

I've been tearing hair out with this one, so any suggestions are appreciated.




Aucun commentaire:

Enregistrer un commentaire