Closed peraltadavidtrvlx closed 4 days ago
Files identified in the description: None
If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
I had a similar issue, Ansible via SSM using an S3 bucket worked fine but suddenly I had this access denied error. I fixed it by adding s3:DeleteObject
to the Bucket Policy I was already using.
@peraltadavidtrvlx Please ensure that the s3:DeleteObject
is added to the bucket policy. However, if you are still facing issues please feel free to open a new issue.
Summary
I am trying to run powershell scripts on a remote windows server on a different account and region but it's failing when deleting the object in the ssm config bucket. SSM is able to upload the script on the config bucket but is failing on deletion
File "/home/circleci/.ansible/collections/ansible_collections/community/aws/plugins/connection/aws_ssm.py", line 628, in _file_transport_command client.delete_object(Bucket=self.get_option('bucket_name'), Key=s3_path)
Issue Type
Bug Report
Component Name
File "/home/circleci/.ansible/collections/ansible_collections/community/aws/plugins/connection/aws_ssm.py", line 628, in _file_transport_command
DeleteObject is denied when running commands on a remote instance in a separate account and different region:
SSM is invoked in eu-west-1 and the target is an instance in a separate account in ap-southeast-2
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
DISTRIB_ID=Ubuntu DISTRIB_RELEASE=20.04 DISTRIB_CODENAME=focal DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"
Steps to Reproduce
deploy.yml
inventory.yml
command:
Expected Results
TASK [Shell] ***** task path: /home/circleci/playbooks/deploy.yml:22 redirecting (type: modules) ansible.builtin.win_command to ansible.windows.win_command redirecting (type: modules) ansible.builtin.win_command to ansible.windows.win_command changed: [i-00b51caa9f0d972ed] => {"changed": true, "cmd": "hostname", "delta": "0:00:00.090585", "end": "2022-09-28 17:53:21.363015", "rc": 0, "start": "2022-09-28 17:53:21.272429", "stderr": "", "stderr_lines": [], "stdout": "EC2AMAZ-12HO4NT\r\n", "stdout_lines": ["EC2AMAZ-12HO4NT"]}
Actual Results
Code of Conduct