...

Source file src/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/integration_test.go

Documentation: github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds

     1  //go:build integration && ec2env
     2  // +build integration,ec2env
     3  
     4  package ec2rolecreds
     5  
     6  import (
     7  	"context"
     8  	"testing"
     9  )
    10  
    11  func TestInteg_RetrieveCredentials(t *testing.T) {
    12  	provider := New()
    13  
    14  	creds, err := provider.Retrieve(context.Background())
    15  	if err != nil {
    16  		t.Fatalf("expect no error, got %v", err)
    17  	}
    18  
    19  	if !creds.HasKeys() {
    20  		t.Errorf("expect credential values, got none")
    21  	}
    22  
    23  	t.Logf("AccessKey: %v", creds.AccessKeyID)
    24  }
    25  

View as plain text