Created
September 15, 2020 01:21
-
-
Save ayberk/102a8995569d5e9002bbb27db209b42e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/ec2metadata" | |
"github.com/aws/aws-sdk-go/aws/session" | |
) | |
func main() { | |
sess, err := session.NewSession(&aws.Config{ | |
Region: aws.String("us-west-2")}, | |
) | |
svc := ec2metadata.New(sess) | |
outpostArn, err := svc.GetMetadata("outpost-arn") | |
if err != nil { | |
fmt.Println(err) | |
} else { | |
fmt.Println(outpostArn) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment