[英]Get aws ec2 instance metadata using go sdk v2
I try this example: https://aws.github.io/aws-sdk-go-v2/docs/sdk-utilities/ec2-imds/我试试这个例子: https://aws.github.io/aws-sdk-go-v2/docs/sdk-utilities/ec2-imds/
and go.mod is using: github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.15和 go.mod 正在使用:github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.15
but the localip prints as: &{{0xc0002d1680} {map[{}:{[{ false false {map[]}}]}]}}但 localip 打印为: &{{0xc0002d1680} {map[{}:{[{ false false {map[]}}]}]}}
Anyone have this working?有人有这个工作吗?
This solves the problem if anyone is interested: https://github.com/natemarks/ec2metadata如果有人感兴趣,这可以解决问题: https://github.com/natemarks/ec2metadata
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.