I want to use auth.AwsCredentialsProvider.new_default_chain() method in ECS task. In API doc https://awslabs.github.io/aws-crt-python/api/auth.html#awscrt.auth.AwsCredentialsProvider, found following:
Create the default provider chain used by most AWS SDKs.
Generally:
- Environment
- Profile
- (conditional, off by default) ECS
- (conditional, on by default) EC2 Instance Metadata
What does (conditional, off by default) mean and how to turn it on?
To enable it, you have to create an IAM Role for your ECS task, and attach it in the task definition for Amazon Elastic Container Service (Amazon ECS).
Below is the place (highlighted) where you can specify IAM Role while creating the Task Definition.