Terraform에서 오류가 발생함 플러그인 스키마를 로드하지 못했습니다
나는 terraform을 통해 aws에 s3 버킷과 클라우드 프론트를 만드는 데 사용하는 아래의 코드를 가지고 있지만 terraform은 오류를 낸다. 나는 윈도우용 테라폼 클리프의 최신 버전을 사용하고 있다. main.tf 파일의 아래 코드를 찾으십시오:
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.70.0"
}
}
}
provider "aws" {
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
region = "${var.aws_region}"
}
resource "aws_s3_bucket" "mybucket" {
bucket = "${var.bucket_name}"
acl = "public-read"
website {
redirect_all_requests_to = "index.html"
}
cors_rule {
allowed_headers = ["*"]
allowed_methods = ["PUT","POST"]
allowed_origins = ["*"]
expose_headers = ["ETag"]
max_age_seconds = 3000
}
policy = <<EOF
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "PublicReadForGetBucketObjects",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::${var.bucket_name}/*"
}
]
}
EOF
}
resource "aws_cloudfront_distribution" "distribution" {
origin {
domain_name = "${aws_s3_bucket.mybucket.website_endpoint}"
origin_id = "S3-${aws_s3_bucket.mybucket.bucket}"
custom_origin_config {
http_port = 80
https_port = 443
origin_protocol_policy = "match-viewer"
origin_ssl_protocols = ["TLSv1", "TLSv1.1", "TLSv1.2"]
}
}
default_root_object = "index.html"
enabled = true
custom_error_response {
error_caching_min_ttl = 3000
error_code = 404
response_code = 200
response_page_path = "/index.html"
}
default_cache_behavior {
allowed_methods = ["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"]
cached_methods = ["GET", "HEAD"]
target_origin_id = "S3-${aws_s3_bucket.mybucket.bucket}"
forwarded_values {
query_string = true
cookies {
forward = "none"
}
}
viewer_protocol_policy = "allow-all"
min_ttl = 0
default_ttl = 3600
max_ttl = 86400
}
# Restricts who is able to access this content
restrictions {
geo_restriction {
# type of restriction, blacklist, whitelist or none
restriction_type = "none"
}
}
# SSL certificate for the service.
viewer_certificate {
cloudfront_default_certificate = true
}
}
아래 오류 메시지를 찾으십시오:
Error: Failed to load plugin schemas
│
│ Error while loading schemas for plugin components: Failed to obtain provider schema: Could not load the schema for provider registry.terraform.io/hashicorp/aws: failed to retrieve schema
│ from provider "registry.terraform.io/hashicorp/aws": Plugin did not respond: The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).GetProviderSchema call. The
│ plugin logs may contain more details...
이 문제를 해결할 수 있도록 도와주세요, 저는 새로운 지형입니다. 이 오류는 다음 시간 동안 발생했습니다
나는 같은 문제에 직면했었다. 그 오류는 to와 조금 달랐다. 나는 HashiCups 제공업체의 예를 따르고 있었다.
이 문제는 초기화 시 캐시된 공급자를 업그레이드하거나 손상된 캐시 공급자를 탐지하지 못하거나 버전을 변경했지만 실행할 때만 캐시에서 버전을 찾아서 함께 사용하기로 결정한 경우에 발생합니다. 테라폼 디렉토리 및 잠금 파일을 삭제한 후 다시 시작합니다
Apple M1 칩에서 실행 중인 경우 다음을 설정해야 합니다:
export GODEBUG=asyncpreemptoff=1;
https://discuss.hashicorp.com/t/terraform-aws-provider-panic-plugin-did-not-respond/23396 https://github.com/hashicorp/terraform/issues/26104
저는 테라폼 초보자인데 같은 문제가 있었으니 이것이 도움이 되었으면 좋겠습니다. 플러그인 스키마를 로드하지 못했습니다. 같은 오류가 발생하여 파일을 엉망으로 만들었습니다. 제가 한 일은 이렇습니다
- 테라폼과 aws를 설치한 경로에서 새로운 프로젝트를 만들었는데, 그것은 "데스크탑"에 있었습니다.. 나는 그것이 필요했는지 아닌지 모르겠다.
- 그리고 나서 저는 새로운 두 개의 파일을 만들었고, 그 후 터미널에 입력하면 자동으로 파일이 생성됩니다. 그리고 저는 그 파일들에 대해 아무것도 바꾸지 않았습니다. 터미널에서 실행합니다.
여기 내 것
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
}
}
}
provider "aws" {
region = "us-east-1"
shared_config_files = ["~/.aws/config"]
shared_credentials_files = ["~/.aws/credentials"]
profile = "terraform-user"
}
그리고 여기에
resource "aws_vpc" "vpc" {
cidr_block = "10.123.0.0/16"
enable_dns_hostnames = true
enable_dns_support = true
tags = {
Name = "vpc"
}
}
여기 당신이 직면할 수 있는 몇 가지 다른 문제들이 있다: 당신이 터미널에서 만든 후 당신은 "변경 없음"을 받은 후 터미널에서 명령을 실행하기 전에 파일을 저장해야 한다.
오늘도 비슷한 문제가 있었는데, 테라폼 계획, 적용 또는 파괴 명령에서 동일한 오류가 발생했습니다. 쉬운 해결책을 찾았지만 헛수고였고 테라폼을 실행하기로 결정했고 오류를 해결했다. 저는 52개의 자원을 성공적으로 파괴하기 위해 테라폼 파괴를 실행할 수 있었습니다. 휴!
저도 같은 문제에 직면했는데, 문제는 파티션 마운트 지점에서 "noexec"이 활성화된 곳에서 실행된다는 것이었습니다.
다른 곳에서 테라폼을 실행하거나 현재 마운트 지점에서 "noexec"을 비활성화할 수 있습니다:
noexec 플래그를 편집 및 제거하려면 변경
/dev/mapper/VG00-LVhome /home ext4 defaults,noexec,nosuid
로.
/dev/mapper/VG00-LVhome /home ext4 defaults,nosuid
다시 마운트/홈으로 이동
도움이 됐으면 좋겠어요.
저도 이 문제가 생겼어요. 이전에 Terraform의 리소스()를 사용한 적이 있습니다(). 애플리케이션을 실행한 다음 더 이상 필요하지 않고 내 Terraform 코드에서 제거한 다음 계획을 실행하려고 시도하다가 이 오류가 발생했습니다.
나를 위해 그것을 고친 것은 실행하는 것, 내 테라폼 상태의 자원을 찾은 다음, 자원에서, 그리고 나서 내 디렉토리를 삭제하고, 실행하고, 이것은 작동했다
저도 같은 문제가 있었어요.
나의 문제는 OS를 다시 설치한 후에 발생했다. 해결책을 찾기 위해 나는 이 기사도 보았다:
나는 다음 단계로 그것을 참조하십시오
rm -rf .terraform
terraform init -backend-config="profile=##your_aws_profile"
terraform은 '.vmxform' 폴더를 다시 만들고 aws 제공자 플러그인을 업데이트합니다.
제공자에게 실행 권한을 부여하기 위해 사용하는 것이 속임수였습니다. @dpiada 기사 감사합니다!
예:
chmod +x .terraform/providers/registry.terraform.io/hashicorp/local/2.4.0/linux_amd64/terraform-provider-local_v2.4.0_x5
chmod +x .terraform/providers/registry.terraform.io/hashicorp/azurerm/3.55.0/linux_amd64/terraform-provider-azurerm_v3.55.0_x5
'개발하자' 카테고리의 다른 글
Kubernetes 클러스터의 WebRTC (0) | 2023.05.09 |
---|---|
Floating Firebase Messaging Crash Targeting S+(버전 31 이상)에는 FLAG_IMTOUBLE 중 하나가 필요합니다 (0) | 2023.05.09 |
Minikube를 사용하는 Windows Home 브라우저에서 Kubernetes Ingress에 액세스할 수 없습니까? (0) | 2023.05.08 |
Kubernetes 서비스 외부 IP 보류 중 (0) | 2023.05.07 |
펄럭이는 앱에 젤로케이터 패키지를 추가할 때 오류가 발생했습니까? (0) | 2023.05.06 |