在aws中S3上传错误

时间:2016-08-25 08:06:11

标签: amazon-s3 ansible-playbook put

使用ansible将文件上传到存储桶的相应路径时,会显示如下错误:

boto.exception.S3CreateError: S3CreateError: 409 Conflict  
<?xml version="1.0" encoding="UTF-8"?>
  <Error>
    <Code>BucketAlreadyOwnedByYou</Code>
    <Message>Your previous request to create the named bucket succeeded and you already own it.</Message>
    <BucketName>useast1`

这是我的代码:

      - name: S3 storage
        s3:
          region: "{{ region }}"
          bucket: "{{ bucketname }}"
          object: "{{ path }}/file.json"
          src: "home/ffn/{{ user_name }}/kp_out.json"
          mode: put

1 个答案:

答案 0 :(得分:2)

我有ansible版本 ansible 2.2.1.0

我遇到了同样的问题,但在添加区域之后就有了问题

- name: copy to s3
  s3:
    bucket: <myBucket>
    mode: put
    aws_access_key: <myAccess>
    aws_secret_key: <mySecret>
    object: /<pathOnS3>/file.txt
    src: /home/user/file.txt
    permission: public-read
    region: eu-central-1