Open Figrol opened 2 months ago
Hi @Figrol,
Thanks for taking the time to submit this issue. While this may seem like an obvious "it is required", unfortunately it's not that simple. The practical need to set the parameter depends on the configuration of your local environment. Specifically, there are a number of alternative mechanisms for setting the region (as well as the AWS credentials), which we respect:
Setting the region parameter is highly recommended, since you generally want to place your resources in a specific region (rather than assuming your AWS configs will stay unchanged), but as a parameter it's not strictly required.
There's a note at the end of the parameter documentation which attempts to explain this:
The AWS SDK (boto3) that Ansible uses may also read defaults for credentials and other settings, such as the region, from its configuration files in the Ansible ‘host’ context (typically ~/.aws/credentials). See https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html for more information.
Summary
When using the ec2_instance module, the examples and the table of parameters do not show the region parameter as being required. However, when running the module, the below error occurs:
"msg": "The amazon.aws.ec2_instance module requires a region and none was found in configuration, environment variables or module parameters",
When a region is added, it seems to work fine.
The same is present in the ec2_instance_info module.
Issue Type
Documentation Report
Component Name
ec2_instance, ec2_instance_info
Ansible Version
Collection Versions
Configuration
OS / Environment
RHEL 9 Ansible Automation Platform
Additional Information
No response
Code of Conduct