That's not the right thing,we have to do this again and again
variable "profile" {
default = "course"
}
variable "region" {
default = "cn-beijing"
}
provider "alicloud" {
region = var.region
profile = var.profile
}
module "ecs_example" {
.......
source = "alibaba/ecs-instance/alicloud"
If we defined provider in our code ,we should not do this again if parent module did not define provider ,I think this is a legacy design issue,i checked aws module,they did the right thing,no provider defined in parent module
profile = var.profile
region = var.region
......
}