Terraform Code in VSCode for AWS Resource Creation

I have created terraform config files in VSCode to create AWS Airflow resource in AWS.
when I run this code in AWS Cloud shell . It works like a magic (Exactly same code) . But when I run it in VSCode Terminal window ,I am getting the following error when I run "TERRAFORM APPLY ". any ideas. why it is erroring out in VSCODE but not in AWS shell

Error: error creating MWAA Environment: ValidationException: Provided subnet IDs could not be verified. Please check if the subnet IDs are correct and you have the required permissions to read their details.

on main.tf line 143, in resource “aws_mwaa_environment” “mwaa_environment”:
143: resource “aws_mwaa_environment” “mwaa_environment” {

1 Like