You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to utilize the python-terraform to create an AWS resource. I was trying to create SQS with it, and for it, I have provided the provider as "aws" and tried to initialize the terraform. But, I am facing an error that I have attached below.
Please find the code I used for destroying the instance:
from python_terraform import * enter = int(input('Enter the re-use period of the Queue: ')) tf = Terraform(working_dir='./terraform', variables={'re_use_period':enter}) tf.init('provider') tf.plan(no_color=IsFlagged, refresh=False, capture_output=True) approve = {"auto-approve": True}`
(1, '', '\nError: Could not satisfy plugin requirements\n\n\nPlugin reinitialization required. Please run "terraform init".\n\nPlugins are external binaries that Terraform uses to access and manipulate\nresources. The configuration provided requires plugins which can\'t be located,\ndon\'t satisfy the version constraints, or are otherwise incompatible.\n\nTerraform automatically discovers provider requirements from your\nconfiguration, including providers used in child modules. To see the\nrequirements and constraints from each module, run "terraform providers".\n\n\n\nError: provider.aws: no suitable version installed\n version requirements: "(any version)"\n versions installed: none\n\n\n')
Am I doing anything wrong, can anyone please help me in this?
The text was updated successfully, but these errors were encountered:
You facing this type of issue due to Terraform cannot find a suitable version of the provider that matches the version requirements specified in your configuration.
To solve this problem.
You have to specify version of AWS provider in provider.tf file / main.tf file.
Here an example:
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}
provider "aws" {
access_key = var.access_key
secret_key = var.secret_key
region = var.region
}
I am trying to utilize the python-terraform to create an AWS resource. I was trying to create SQS with it, and for it, I have provided the provider as "aws" and tried to initialize the terraform. But, I am facing an error that I have attached below.
Please find the code I used for destroying the instance:
from python_terraform import *
enter = int(input('Enter the re-use period of the Queue: '))
tf = Terraform(working_dir='./terraform', variables={'re_use_period':enter})
tf.init('provider')
tf.plan(no_color=IsFlagged, refresh=False, capture_output=True)
approve = {"auto-approve":
True}`provider.tf file we have,
provider "aws" {
access_key = var.access_key
secret_key = var.secret_key
region = var.region
}
Error:
(1, '', '\nError: Could not satisfy plugin requirements\n\n\nPlugin reinitialization required. Please run "terraform init".\n\nPlugins are external binaries that Terraform uses to access and manipulate\nresources. The configuration provided requires plugins which can\'t be located,\ndon\'t satisfy the version constraints, or are otherwise incompatible.\n\nTerraform automatically discovers provider requirements from your\nconfiguration, including providers used in child modules. To see the\nrequirements and constraints from each module, run "terraform providers".\n\n\n\nError: provider.aws: no suitable version installed\n version requirements: "(any version)"\n versions installed: none\n\n\n')
Am I doing anything wrong, can anyone please help me in this?
The text was updated successfully, but these errors were encountered: