s3_website – Configure an s3 bucket as a website¶
The below requirements are needed on the host that executes this module.
- python >= 2.6
- If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence
- Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See https://boto.readthedocs.io/en/latest/boto_config_tut.html
EC2_REGIONcan be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
# Note: These examples do not set authentication details, see the AWS Guide for details. # Configure an s3 bucket to redirect all requests to example.com - s3_website: name: mybucket.com redirect_all_requests: example.com state: present # Remove website configuration from an s3 bucket - s3_website: name: mybucket.com state: absent # Configure an s3 bucket as a website with index and error pages - s3_website: name: mybucket.com suffix: home.htm error_key: errors/404.htm state: present
Common return values are documented here, the following are the fields unique to this module: