我正在尝试使用Terraform在LocalStack上运行LocalStack实例。
在尝试创建实例50分钟之后,我从terraform获得了这个响应:
错误:获取EC2实例(i-cf4da152ddf3500e1)的错误: SerializationError:未能解除封送错误消息状态代码: 500,请求id:引起: UnmarshalError:未能解除由:预期元素类型引起的错误消息,但有
在main.tf第34行中,在资源"aws_instance“”示例“中: 34:资源"aws_instance”示例“{
对于LocalStack和Terraformv0.12.18,我使用以下配置:
provider "aws" {
access_key = "mock_access_key"
region = "us-east-1"
s3_force_path_style = true
secret_key = "mock_secret_key"
skip_credentials_validation = true
skip_metadata_api_check = true
skip_requesting_account_id = true
endpoints {
apigateway = "http://localhost:4567"
cloudformation = "http://localhost:4581"
cloudwatch = "http://localhost:4582"
dynamodb = "http://localhost:4569"
es = "http://localhost:4578"
firehose = "http://localhost:4573"
iam = "http://localhost:4593"
kinesis = "http://localhost:4568"
lambda = "http://localhost:4574"
route53 = "http://localhost:4580"
redshift = "http://localhost:4577"
s3 = "http://localhost:4572"
secretsmanager = "http://localhost:4584"
ses = "http://localhost:4579"
sns = "http://localhost:4575"
sqs = "http://localhost:4576"
ssm = "http://localhost:4583"
stepfunctions = "http://localhost:4585"
sts = "http://localhost:4592"
ec2 = "http://localhost:4597"
}
}
resource "aws_instance" "example" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
}
当我从最新的github (https://github.com/localstack/localstack)日志中直接从最新的github(https://github.com/localstack/localstack)中运行EC2时,我已经看到了EC2相关端点的设置。
我很感激任何能帮助我在LocalStack上运行LocalStack的建议。
发布于 2020-07-19 06:32:25
良好的工作下面的码头形象的地方堆栈。
码头运行-it -p 4500-4600:4500-4600 -p 8080:8080 -暴露4572个地区堆栈/地区堆栈:0.11.1
resource "aws_instance" "web" {
ami = "ami-0d57c0143330e1fa7"
instance_type = "t2.micro"
tags = {
Name = "HelloWorld"
}
}
provider "aws" {
region = "us-east-1"
s3_force_path_style = true
skip_credentials_validation = true
skip_metadata_api_check = true
skip_requesting_account_id = true
endpoints {
apigateway = "http://localhost:4567"
cloudformation = "http://localhost:4581"
cloudwatch = "http://localhost:4582"
dynamodb = "http://localhost:4569"
es = "http://localhost:4578"
firehose = "http://localhost:4573"
iam = "http://localhost:4593"
kinesis = "http://localhost:4568"
lambda = "http://localhost:4574"
route53 = "http://localhost:4580"
redshift = "http://LOCALHOST:4577"
s3 = "http://localhost:4572"
secretsmanager = "http://localhost:4584"
ses = "http://localhost:4579"
sns = "http://localhost:4575"
sqs = "http://localhost:4576"
ssm = "http://localhost:4583"
stepfunctions = "http://localhost:4585"
sts = "http://localhost:4592"
ec2 = "http://localhost:4597"
}
}
terraform应用
aws_instance.web: Destroying... [id=i-099392def6b574255]
aws_instance.web: Still destroying... [id=i-099392def6b574255, 10s elapsed]
aws_instance.web: Destruction complete after 10s
aws_instance.web: Creating...
aws_instance.web: Still creating... [10s elapsed]
aws_instance.web: Creation complete after 12s [id=i-9c942d138970d44a4]
Apply complete! Resources: 1 added, 0 changed, 1 destroyed.
注意事项:它是一个虚拟实例,因此对于ssh和所有这些都是不可用的。然而,适合于在ec2上测试地形应用/破坏用例。
https://stackoverflow.com/questions/61084050
复制相似问题