I have a terraform provider, built with the terraform-sdk v2, the provider.go file looks as follows:
func Provider() *schema.Provider {
return &schema.Provider{
Schema: map[string]*schema.Schema{
"aws_region": {
Type: schema.TypeString,
Required: true,
},
},
ResourcesMap: map[string]*schema.Resource{
"aws_ecr_push_image": ResourcePushImage(),
},
ConfigureContextFunc: providerConfigure,
}
}
func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics) {
awsRegion := d.Get("aws_region").(string)
return awsRegion, nil
}
However when running terraform apply, I always get the error:
│ Error: Unsupported argument
│
│ on main.tf line 11, in provider "ecrbuildpush":
│ 11: aws_region = "eu-central-1"
│
│ An argument named "aws_region" is not expected here.